@stigmer/cli 0.1.0-dev.20261017020314.g644422724c27

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 (1074) hide show
  1. package/LICENSE +194 -0
  2. package/README.md +45 -0
  3. package/auth/auth0.d.ts +19 -0
  4. package/auth/auth0.d.ts.map +1 -0
  5. package/auth/auth0.js +39 -0
  6. package/auth/auth0.js.map +1 -0
  7. package/auth/callback-server.d.ts +18 -0
  8. package/auth/callback-server.d.ts.map +1 -0
  9. package/auth/callback-server.js +77 -0
  10. package/auth/callback-server.js.map +1 -0
  11. package/auth/index.d.ts +5 -0
  12. package/auth/index.d.ts.map +1 -0
  13. package/auth/index.js +6 -0
  14. package/auth/index.js.map +1 -0
  15. package/auth/login.d.ts +2 -0
  16. package/auth/login.d.ts.map +1 -0
  17. package/auth/login.js +81 -0
  18. package/auth/login.js.map +1 -0
  19. package/auth/pages.d.ts +7 -0
  20. package/auth/pages.d.ts.map +1 -0
  21. package/auth/pages.js +21 -0
  22. package/auth/pages.js.map +1 -0
  23. package/auth/pkce.d.ts +7 -0
  24. package/auth/pkce.d.ts.map +1 -0
  25. package/auth/pkce.js +22 -0
  26. package/auth/pkce.js.map +1 -0
  27. package/auth/token.d.ts +38 -0
  28. package/auth/token.d.ts.map +1 -0
  29. package/auth/token.js +120 -0
  30. package/auth/token.js.map +1 -0
  31. package/backend.d.ts +5 -0
  32. package/backend.d.ts.map +1 -0
  33. package/backend.js +14 -0
  34. package/backend.js.map +1 -0
  35. package/cli/stigmer.d.ts +3 -0
  36. package/cli/stigmer.d.ts.map +1 -0
  37. package/cli/stigmer.js +14 -0
  38. package/cli/stigmer.js.map +1 -0
  39. package/client/client.d.ts +44 -0
  40. package/client/client.d.ts.map +1 -0
  41. package/client/client.js +82 -0
  42. package/client/client.js.map +1 -0
  43. package/client/index.d.ts +2 -0
  44. package/client/index.d.ts.map +1 -0
  45. package/client/index.js +3 -0
  46. package/client/index.js.map +1 -0
  47. package/client/organizations.d.ts +41 -0
  48. package/client/organizations.d.ts.map +1 -0
  49. package/client/organizations.js +86 -0
  50. package/client/organizations.js.map +1 -0
  51. package/client/single-org.d.ts +16 -0
  52. package/client/single-org.d.ts.map +1 -0
  53. package/client/single-org.js +35 -0
  54. package/client/single-org.js.map +1 -0
  55. package/commands/access-history/index.d.ts +3 -0
  56. package/commands/access-history/index.d.ts.map +1 -0
  57. package/commands/access-history/index.js +99 -0
  58. package/commands/access-history/index.js.map +1 -0
  59. package/commands/agent-exec-flags.d.ts +30 -0
  60. package/commands/agent-exec-flags.d.ts.map +1 -0
  61. package/commands/agent-exec-flags.js +49 -0
  62. package/commands/agent-exec-flags.js.map +1 -0
  63. package/commands/agent.d.ts +3 -0
  64. package/commands/agent.d.ts.map +1 -0
  65. package/commands/agent.js +43 -0
  66. package/commands/agent.js.map +1 -0
  67. package/commands/apikey/duration.d.ts +2 -0
  68. package/commands/apikey/duration.d.ts.map +1 -0
  69. package/commands/apikey/duration.js +30 -0
  70. package/commands/apikey/duration.js.map +1 -0
  71. package/commands/apikey/index.d.ts +18 -0
  72. package/commands/apikey/index.d.ts.map +1 -0
  73. package/commands/apikey/index.js +198 -0
  74. package/commands/apikey/index.js.map +1 -0
  75. package/commands/apply.d.ts +3 -0
  76. package/commands/apply.d.ts.map +1 -0
  77. package/commands/apply.js +146 -0
  78. package/commands/apply.js.map +1 -0
  79. package/commands/auth/index.d.ts +3 -0
  80. package/commands/auth/index.d.ts.map +1 -0
  81. package/commands/auth/index.js +58 -0
  82. package/commands/auth/index.js.map +1 -0
  83. package/commands/auth/login.d.ts +13 -0
  84. package/commands/auth/login.d.ts.map +1 -0
  85. package/commands/auth/login.js +58 -0
  86. package/commands/auth/login.js.map +1 -0
  87. package/commands/auth/whoami.d.ts +22 -0
  88. package/commands/auth/whoami.d.ts.map +1 -0
  89. package/commands/auth/whoami.js +123 -0
  90. package/commands/auth/whoami.js.map +1 -0
  91. package/commands/channel.d.ts +3 -0
  92. package/commands/channel.d.ts.map +1 -0
  93. package/commands/channel.js +114 -0
  94. package/commands/channel.js.map +1 -0
  95. package/commands/completion.d.ts +3 -0
  96. package/commands/completion.d.ts.map +1 -0
  97. package/commands/completion.js +80 -0
  98. package/commands/completion.js.map +1 -0
  99. package/commands/config/backend.d.ts +3 -0
  100. package/commands/config/backend.d.ts.map +1 -0
  101. package/commands/config/backend.js +171 -0
  102. package/commands/config/backend.js.map +1 -0
  103. package/commands/config/context.d.ts +3 -0
  104. package/commands/config/context.d.ts.map +1 -0
  105. package/commands/config/context.js +88 -0
  106. package/commands/config/context.js.map +1 -0
  107. package/commands/config/index.d.ts +3 -0
  108. package/commands/config/index.d.ts.map +1 -0
  109. package/commands/config/index.js +13 -0
  110. package/commands/config/index.js.map +1 -0
  111. package/commands/config/kv.d.ts +3 -0
  112. package/commands/config/kv.d.ts.map +1 -0
  113. package/commands/config/kv.js +39 -0
  114. package/commands/config/kv.js.map +1 -0
  115. package/commands/connect.d.ts +3 -0
  116. package/commands/connect.d.ts.map +1 -0
  117. package/commands/connect.js +74 -0
  118. package/commands/connect.js.map +1 -0
  119. package/commands/delete.d.ts +3 -0
  120. package/commands/delete.d.ts.map +1 -0
  121. package/commands/delete.js +44 -0
  122. package/commands/delete.js.map +1 -0
  123. package/commands/down.d.ts +3 -0
  124. package/commands/down.d.ts.map +1 -0
  125. package/commands/down.js +23 -0
  126. package/commands/down.js.map +1 -0
  127. package/commands/download.d.ts +3 -0
  128. package/commands/download.d.ts.map +1 -0
  129. package/commands/download.js +79 -0
  130. package/commands/download.js.map +1 -0
  131. package/commands/eval.d.ts +3 -0
  132. package/commands/eval.d.ts.map +1 -0
  133. package/commands/eval.js +115 -0
  134. package/commands/eval.js.map +1 -0
  135. package/commands/get.d.ts +3 -0
  136. package/commands/get.d.ts.map +1 -0
  137. package/commands/get.js +113 -0
  138. package/commands/get.js.map +1 -0
  139. package/commands/install.d.ts +3 -0
  140. package/commands/install.d.ts.map +1 -0
  141. package/commands/install.js +68 -0
  142. package/commands/install.js.map +1 -0
  143. package/commands/internal-daemon.d.ts +3 -0
  144. package/commands/internal-daemon.d.ts.map +1 -0
  145. package/commands/internal-daemon.js +15 -0
  146. package/commands/internal-daemon.js.map +1 -0
  147. package/commands/list.d.ts +10 -0
  148. package/commands/list.d.ts.map +1 -0
  149. package/commands/list.js +131 -0
  150. package/commands/list.js.map +1 -0
  151. package/commands/logs.d.ts +3 -0
  152. package/commands/logs.d.ts.map +1 -0
  153. package/commands/logs.js +59 -0
  154. package/commands/logs.js.map +1 -0
  155. package/commands/marketplace.d.ts +3 -0
  156. package/commands/marketplace.d.ts.map +1 -0
  157. package/commands/marketplace.js +94 -0
  158. package/commands/marketplace.js.map +1 -0
  159. package/commands/mcp-server.d.ts +22 -0
  160. package/commands/mcp-server.d.ts.map +1 -0
  161. package/commands/mcp-server.js +105 -0
  162. package/commands/mcp-server.js.map +1 -0
  163. package/commands/mcp.d.ts +3 -0
  164. package/commands/mcp.d.ts.map +1 -0
  165. package/commands/mcp.js +58 -0
  166. package/commands/mcp.js.map +1 -0
  167. package/commands/push.d.ts +27 -0
  168. package/commands/push.d.ts.map +1 -0
  169. package/commands/push.js +401 -0
  170. package/commands/push.js.map +1 -0
  171. package/commands/reset.d.ts +3 -0
  172. package/commands/reset.d.ts.map +1 -0
  173. package/commands/reset.js +45 -0
  174. package/commands/reset.js.map +1 -0
  175. package/commands/resume.d.ts +3 -0
  176. package/commands/resume.d.ts.map +1 -0
  177. package/commands/resume.js +90 -0
  178. package/commands/resume.js.map +1 -0
  179. package/commands/run.d.ts +3 -0
  180. package/commands/run.d.ts.map +1 -0
  181. package/commands/run.js +158 -0
  182. package/commands/run.js.map +1 -0
  183. package/commands/runs/approve.d.ts +3 -0
  184. package/commands/runs/approve.d.ts.map +1 -0
  185. package/commands/runs/approve.js +37 -0
  186. package/commands/runs/approve.js.map +1 -0
  187. package/commands/runs/control.d.ts +3 -0
  188. package/commands/runs/control.d.ts.map +1 -0
  189. package/commands/runs/control.js +71 -0
  190. package/commands/runs/control.js.map +1 -0
  191. package/commands/runs/index.d.ts +3 -0
  192. package/commands/runs/index.d.ts.map +1 -0
  193. package/commands/runs/index.js +28 -0
  194. package/commands/runs/index.js.map +1 -0
  195. package/commands/runs/logs.d.ts +3 -0
  196. package/commands/runs/logs.d.ts.map +1 -0
  197. package/commands/runs/logs.js +33 -0
  198. package/commands/runs/logs.js.map +1 -0
  199. package/commands/runs/scores.d.ts +3 -0
  200. package/commands/runs/scores.d.ts.map +1 -0
  201. package/commands/runs/scores.js +26 -0
  202. package/commands/runs/scores.js.map +1 -0
  203. package/commands/runs/to-eval-case.d.ts +3 -0
  204. package/commands/runs/to-eval-case.d.ts.map +1 -0
  205. package/commands/runs/to-eval-case.js +35 -0
  206. package/commands/runs/to-eval-case.js.map +1 -0
  207. package/commands/runs/trace.d.ts +3 -0
  208. package/commands/runs/trace.d.ts.map +1 -0
  209. package/commands/runs/trace.js +24 -0
  210. package/commands/runs/trace.js.map +1 -0
  211. package/commands/schedule.d.ts +3 -0
  212. package/commands/schedule.d.ts.map +1 -0
  213. package/commands/schedule.js +57 -0
  214. package/commands/schedule.js.map +1 -0
  215. package/commands/search.d.ts +3 -0
  216. package/commands/search.d.ts.map +1 -0
  217. package/commands/search.js +76 -0
  218. package/commands/search.js.map +1 -0
  219. package/commands/service-account/index.d.ts +7 -0
  220. package/commands/service-account/index.d.ts.map +1 -0
  221. package/commands/service-account/index.js +144 -0
  222. package/commands/service-account/index.js.map +1 -0
  223. package/commands/setup.d.ts +3 -0
  224. package/commands/setup.d.ts.map +1 -0
  225. package/commands/setup.js +76 -0
  226. package/commands/setup.js.map +1 -0
  227. package/commands/shared.d.ts +15 -0
  228. package/commands/shared.d.ts.map +1 -0
  229. package/commands/shared.js +34 -0
  230. package/commands/shared.js.map +1 -0
  231. package/commands/status.d.ts +3 -0
  232. package/commands/status.d.ts.map +1 -0
  233. package/commands/status.js +18 -0
  234. package/commands/status.js.map +1 -0
  235. package/commands/tag.d.ts +3 -0
  236. package/commands/tag.d.ts.map +1 -0
  237. package/commands/tag.js +24 -0
  238. package/commands/tag.js.map +1 -0
  239. package/commands/up.d.ts +3 -0
  240. package/commands/up.d.ts.map +1 -0
  241. package/commands/up.js +84 -0
  242. package/commands/up.js.map +1 -0
  243. package/commands/usage.d.ts +5 -0
  244. package/commands/usage.d.ts.map +1 -0
  245. package/commands/usage.js +92 -0
  246. package/commands/usage.js.map +1 -0
  247. package/commands/validate.d.ts +3 -0
  248. package/commands/validate.d.ts.map +1 -0
  249. package/commands/validate.js +95 -0
  250. package/commands/validate.js.map +1 -0
  251. package/commands/vault.d.ts +3 -0
  252. package/commands/vault.d.ts.map +1 -0
  253. package/commands/vault.js +143 -0
  254. package/commands/vault.js.map +1 -0
  255. package/commands/version.d.ts +3 -0
  256. package/commands/version.d.ts.map +1 -0
  257. package/commands/version.js +11 -0
  258. package/commands/version.js.map +1 -0
  259. package/config/config.d.ts +110 -0
  260. package/config/config.d.ts.map +1 -0
  261. package/config/config.js +199 -0
  262. package/config/config.js.map +1 -0
  263. package/config/index.d.ts +5 -0
  264. package/config/index.d.ts.map +1 -0
  265. package/config/index.js +6 -0
  266. package/config/index.js.map +1 -0
  267. package/config/keys.d.ts +6 -0
  268. package/config/keys.d.ts.map +1 -0
  269. package/config/keys.js +80 -0
  270. package/config/keys.js.map +1 -0
  271. package/config/paths.d.ts +10 -0
  272. package/config/paths.d.ts.map +1 -0
  273. package/config/paths.js +21 -0
  274. package/config/paths.js.map +1 -0
  275. package/config/resolve.d.ts +65 -0
  276. package/config/resolve.d.ts.map +1 -0
  277. package/config/resolve.js +160 -0
  278. package/config/resolve.js.map +1 -0
  279. package/errors/classify.d.ts +17 -0
  280. package/errors/classify.d.ts.map +1 -0
  281. package/errors/classify.js +204 -0
  282. package/errors/classify.js.map +1 -0
  283. package/errors/cli-exit-error.d.ts +6 -0
  284. package/errors/cli-exit-error.d.ts.map +1 -0
  285. package/errors/cli-exit-error.js +15 -0
  286. package/errors/cli-exit-error.js.map +1 -0
  287. package/errors/exit-codes.d.ts +10 -0
  288. package/errors/exit-codes.d.ts.map +1 -0
  289. package/errors/exit-codes.js +15 -0
  290. package/errors/exit-codes.js.map +1 -0
  291. package/errors/handle.d.ts +14 -0
  292. package/errors/handle.d.ts.map +1 -0
  293. package/errors/handle.js +46 -0
  294. package/errors/handle.js.map +1 -0
  295. package/errors/index.d.ts +6 -0
  296. package/errors/index.d.ts.map +1 -0
  297. package/errors/index.js +7 -0
  298. package/errors/index.js.map +1 -0
  299. package/errors/usage-error.d.ts +5 -0
  300. package/errors/usage-error.d.ts.map +1 -0
  301. package/errors/usage-error.js +13 -0
  302. package/errors/usage-error.js.map +1 -0
  303. package/index.d.ts +3 -0
  304. package/index.d.ts.map +1 -0
  305. package/index.js +8 -0
  306. package/index.js.map +1 -0
  307. package/local/artifact.d.ts +77 -0
  308. package/local/artifact.d.ts.map +1 -0
  309. package/local/artifact.js +268 -0
  310. package/local/artifact.js.map +1 -0
  311. package/local/constants.d.ts +41 -0
  312. package/local/constants.d.ts.map +1 -0
  313. package/local/constants.js +48 -0
  314. package/local/constants.js.map +1 -0
  315. package/local/daemon/components.d.ts +20 -0
  316. package/local/daemon/components.d.ts.map +1 -0
  317. package/local/daemon/components.js +140 -0
  318. package/local/daemon/components.js.map +1 -0
  319. package/local/daemon/env.d.ts +77 -0
  320. package/local/daemon/env.d.ts.map +1 -0
  321. package/local/daemon/env.js +107 -0
  322. package/local/daemon/env.js.map +1 -0
  323. package/local/daemon/host.d.ts +15 -0
  324. package/local/daemon/host.d.ts.map +1 -0
  325. package/local/daemon/host.js +115 -0
  326. package/local/daemon/host.js.map +1 -0
  327. package/local/daemon/index.d.ts +8 -0
  328. package/local/daemon/index.d.ts.map +1 -0
  329. package/local/daemon/index.js +8 -0
  330. package/local/daemon/index.js.map +1 -0
  331. package/local/daemon/launch.d.ts +38 -0
  332. package/local/daemon/launch.d.ts.map +1 -0
  333. package/local/daemon/launch.js +261 -0
  334. package/local/daemon/launch.js.map +1 -0
  335. package/local/daemon/process.d.ts +42 -0
  336. package/local/daemon/process.d.ts.map +1 -0
  337. package/local/daemon/process.js +166 -0
  338. package/local/daemon/process.js.map +1 -0
  339. package/local/daemon/supervisor.d.ts +56 -0
  340. package/local/daemon/supervisor.d.ts.map +1 -0
  341. package/local/daemon/supervisor.js +211 -0
  342. package/local/daemon/supervisor.js.map +1 -0
  343. package/local/daemon/types.d.ts +65 -0
  344. package/local/daemon/types.d.ts.map +1 -0
  345. package/local/daemon/types.js +9 -0
  346. package/local/daemon/types.js.map +1 -0
  347. package/local/llm-config.d.ts +24 -0
  348. package/local/llm-config.d.ts.map +1 -0
  349. package/local/llm-config.js +74 -0
  350. package/local/llm-config.js.map +1 -0
  351. package/local/logs/tail.d.ts +19 -0
  352. package/local/logs/tail.d.ts.map +1 -0
  353. package/local/logs/tail.js +86 -0
  354. package/local/logs/tail.js.map +1 -0
  355. package/local/logs/view.d.ts +20 -0
  356. package/local/logs/view.d.ts.map +1 -0
  357. package/local/logs/view.js +50 -0
  358. package/local/logs/view.js.map +1 -0
  359. package/local/net/tcp.d.ts +23 -0
  360. package/local/net/tcp.d.ts.map +1 -0
  361. package/local/net/tcp.js +47 -0
  362. package/local/net/tcp.js.map +1 -0
  363. package/local/operator-config.d.ts +28 -0
  364. package/local/operator-config.d.ts.map +1 -0
  365. package/local/operator-config.js +77 -0
  366. package/local/operator-config.js.map +1 -0
  367. package/local/paths.d.ts +47 -0
  368. package/local/paths.d.ts.map +1 -0
  369. package/local/paths.js +83 -0
  370. package/local/paths.js.map +1 -0
  371. package/local/reset.d.ts +14 -0
  372. package/local/reset.d.ts.map +1 -0
  373. package/local/reset.js +57 -0
  374. package/local/reset.js.map +1 -0
  375. package/local/runtime/index.d.ts +5 -0
  376. package/local/runtime/index.d.ts.map +1 -0
  377. package/local/runtime/index.js +8 -0
  378. package/local/runtime/index.js.map +1 -0
  379. package/local/runtime/node.d.ts +17 -0
  380. package/local/runtime/node.d.ts.map +1 -0
  381. package/local/runtime/node.js +139 -0
  382. package/local/runtime/node.js.map +1 -0
  383. package/local/runtime/runner.d.ts +45 -0
  384. package/local/runtime/runner.d.ts.map +1 -0
  385. package/local/runtime/runner.js +131 -0
  386. package/local/runtime/runner.js.map +1 -0
  387. package/local/runtime/runtimes-install.d.ts +13 -0
  388. package/local/runtime/runtimes-install.d.ts.map +1 -0
  389. package/local/runtime/runtimes-install.js +63 -0
  390. package/local/runtime/runtimes-install.js.map +1 -0
  391. package/local/runtime/server.d.ts +40 -0
  392. package/local/runtime/server.d.ts.map +1 -0
  393. package/local/runtime/server.js +144 -0
  394. package/local/runtime/server.js.map +1 -0
  395. package/local/runtime/which.d.ts +3 -0
  396. package/local/runtime/which.d.ts.map +1 -0
  397. package/local/runtime/which.js +30 -0
  398. package/local/runtime/which.js.map +1 -0
  399. package/local/setup/prompt.d.ts +8 -0
  400. package/local/setup/prompt.d.ts.map +1 -0
  401. package/local/setup/prompt.js +63 -0
  402. package/local/setup/prompt.js.map +1 -0
  403. package/local/setup/wizard.d.ts +43 -0
  404. package/local/setup/wizard.d.ts.map +1 -0
  405. package/local/setup/wizard.js +119 -0
  406. package/local/setup/wizard.js.map +1 -0
  407. package/local/state/health-state.d.ts +26 -0
  408. package/local/state/health-state.d.ts.map +1 -0
  409. package/local/state/health-state.js +34 -0
  410. package/local/state/health-state.js.map +1 -0
  411. package/local/state/index.d.ts +7 -0
  412. package/local/state/index.d.ts.map +1 -0
  413. package/local/state/index.js +8 -0
  414. package/local/state/index.js.map +1 -0
  415. package/local/state/lock.d.ts +13 -0
  416. package/local/state/lock.d.ts.map +1 -0
  417. package/local/state/lock.js +84 -0
  418. package/local/state/lock.js.map +1 -0
  419. package/local/state/log-rotation.d.ts +17 -0
  420. package/local/state/log-rotation.d.ts.map +1 -0
  421. package/local/state/log-rotation.js +101 -0
  422. package/local/state/log-rotation.js.map +1 -0
  423. package/local/state/pidfile.d.ts +11 -0
  424. package/local/state/pidfile.d.ts.map +1 -0
  425. package/local/state/pidfile.js +35 -0
  426. package/local/state/pidfile.js.map +1 -0
  427. package/local/state/proc.d.ts +29 -0
  428. package/local/state/proc.d.ts.map +1 -0
  429. package/local/state/proc.js +84 -0
  430. package/local/state/proc.js.map +1 -0
  431. package/local/state/startup-config.d.ts +24 -0
  432. package/local/state/startup-config.d.ts.map +1 -0
  433. package/local/state/startup-config.js +36 -0
  434. package/local/state/startup-config.js.map +1 -0
  435. package/local/status.d.ts +9 -0
  436. package/local/status.d.ts.map +1 -0
  437. package/local/status.js +170 -0
  438. package/local/status.js.map +1 -0
  439. package/local/temporal/download.d.ts +42 -0
  440. package/local/temporal/download.d.ts.map +1 -0
  441. package/local/temporal/download.js +55 -0
  442. package/local/temporal/download.js.map +1 -0
  443. package/local/temporal/index.d.ts +5 -0
  444. package/local/temporal/index.d.ts.map +1 -0
  445. package/local/temporal/index.js +6 -0
  446. package/local/temporal/index.js.map +1 -0
  447. package/local/temporal/inspect.d.ts +15 -0
  448. package/local/temporal/inspect.d.ts.map +1 -0
  449. package/local/temporal/inspect.js +72 -0
  450. package/local/temporal/inspect.js.map +1 -0
  451. package/local/temporal/manager.d.ts +62 -0
  452. package/local/temporal/manager.d.ts.map +1 -0
  453. package/local/temporal/manager.js +221 -0
  454. package/local/temporal/manager.js.map +1 -0
  455. package/local/temporal/supervisor.d.ts +34 -0
  456. package/local/temporal/supervisor.d.ts.map +1 -0
  457. package/local/temporal/supervisor.js +83 -0
  458. package/local/temporal/supervisor.js.map +1 -0
  459. package/local/webconsole/index.d.ts +3 -0
  460. package/local/webconsole/index.d.ts.map +1 -0
  461. package/local/webconsole/index.js +27 -0
  462. package/local/webconsole/index.js.map +1 -0
  463. package/logger.d.ts +13 -0
  464. package/logger.d.ts.map +1 -0
  465. package/logger.js +35 -0
  466. package/logger.js.map +1 -0
  467. package/marketplace/config.d.ts +61 -0
  468. package/marketplace/config.d.ts.map +1 -0
  469. package/marketplace/config.js +179 -0
  470. package/marketplace/config.js.map +1 -0
  471. package/marketplace/github.d.ts +68 -0
  472. package/marketplace/github.d.ts.map +1 -0
  473. package/marketplace/github.js +272 -0
  474. package/marketplace/github.js.map +1 -0
  475. package/marketplace/index.d.ts +8 -0
  476. package/marketplace/index.d.ts.map +1 -0
  477. package/marketplace/index.js +12 -0
  478. package/marketplace/index.js.map +1 -0
  479. package/marketplace/install.d.ts +35 -0
  480. package/marketplace/install.d.ts.map +1 -0
  481. package/marketplace/install.js +156 -0
  482. package/marketplace/install.js.map +1 -0
  483. package/marketplace/materialize.d.ts +19 -0
  484. package/marketplace/materialize.d.ts.map +1 -0
  485. package/marketplace/materialize.js +53 -0
  486. package/marketplace/materialize.js.map +1 -0
  487. package/marketplace/official.d.ts +28 -0
  488. package/marketplace/official.d.ts.map +1 -0
  489. package/marketplace/official.js +87 -0
  490. package/marketplace/official.js.map +1 -0
  491. package/marketplace/read.d.ts +17 -0
  492. package/marketplace/read.d.ts.map +1 -0
  493. package/marketplace/read.js +44 -0
  494. package/marketplace/read.js.map +1 -0
  495. package/marketplace/ref.d.ts +13 -0
  496. package/marketplace/ref.d.ts.map +1 -0
  497. package/marketplace/ref.js +54 -0
  498. package/marketplace/ref.js.map +1 -0
  499. package/marketplace/render.d.ts +22 -0
  500. package/marketplace/render.d.ts.map +1 -0
  501. package/marketplace/render.js +115 -0
  502. package/marketplace/render.js.map +1 -0
  503. package/output/command-result.d.ts +55 -0
  504. package/output/command-result.d.ts.map +1 -0
  505. package/output/command-result.js +147 -0
  506. package/output/command-result.js.map +1 -0
  507. package/output/confirm.d.ts +22 -0
  508. package/output/confirm.d.ts.map +1 -0
  509. package/output/confirm.js +43 -0
  510. package/output/confirm.js.map +1 -0
  511. package/output/format.d.ts +22 -0
  512. package/output/format.d.ts.map +1 -0
  513. package/output/format.js +72 -0
  514. package/output/format.js.map +1 -0
  515. package/output/index.d.ts +7 -0
  516. package/output/index.d.ts.map +1 -0
  517. package/output/index.js +8 -0
  518. package/output/index.js.map +1 -0
  519. package/output/ndjson.d.ts +7 -0
  520. package/output/ndjson.d.ts.map +1 -0
  521. package/output/ndjson.js +13 -0
  522. package/output/ndjson.js.map +1 -0
  523. package/output/proto.d.ts +12 -0
  524. package/output/proto.d.ts.map +1 -0
  525. package/output/proto.js +34 -0
  526. package/output/proto.js.map +1 -0
  527. package/output/style.d.ts +19 -0
  528. package/output/style.d.ts.map +1 -0
  529. package/output/style.js +44 -0
  530. package/output/style.js.map +1 -0
  531. package/output/table.d.ts +5 -0
  532. package/output/table.d.ts.map +1 -0
  533. package/output/table.js +43 -0
  534. package/output/table.js.map +1 -0
  535. package/package.json +50 -0
  536. package/program.d.ts +17 -0
  537. package/program.d.ts.map +1 -0
  538. package/program.js +195 -0
  539. package/program.js.map +1 -0
  540. package/registry/aliases.d.ts +21 -0
  541. package/registry/aliases.d.ts.map +1 -0
  542. package/registry/aliases.js +99 -0
  543. package/registry/aliases.js.map +1 -0
  544. package/registry/index.d.ts +6 -0
  545. package/registry/index.d.ts.map +1 -0
  546. package/registry/index.js +7 -0
  547. package/registry/index.js.map +1 -0
  548. package/registry/metadata.d.ts +27 -0
  549. package/registry/metadata.d.ts.map +1 -0
  550. package/registry/metadata.js +152 -0
  551. package/registry/metadata.js.map +1 -0
  552. package/registry/registry.d.ts +56 -0
  553. package/registry/registry.d.ts.map +1 -0
  554. package/registry/registry.js +85 -0
  555. package/registry/registry.js.map +1 -0
  556. package/registry/verb-support.d.ts +5 -0
  557. package/registry/verb-support.d.ts.map +1 -0
  558. package/registry/verb-support.js +112 -0
  559. package/registry/verb-support.js.map +1 -0
  560. package/registry/verbs.d.ts +16 -0
  561. package/registry/verbs.d.ts.map +1 -0
  562. package/registry/verbs.js +35 -0
  563. package/registry/verbs.js.map +1 -0
  564. package/resources/access-history.d.ts +28 -0
  565. package/resources/access-history.d.ts.map +1 -0
  566. package/resources/access-history.js +124 -0
  567. package/resources/access-history.js.map +1 -0
  568. package/resources/agent/quality.d.ts +40 -0
  569. package/resources/agent/quality.d.ts.map +1 -0
  570. package/resources/agent/quality.js +338 -0
  571. package/resources/agent/quality.js.map +1 -0
  572. package/resources/agent/resolve.d.ts +5 -0
  573. package/resources/agent/resolve.d.ts.map +1 -0
  574. package/resources/agent/resolve.js +23 -0
  575. package/resources/agent/resolve.js.map +1 -0
  576. package/resources/apply/apply.d.ts +62 -0
  577. package/resources/apply/apply.d.ts.map +1 -0
  578. package/resources/apply/apply.js +371 -0
  579. package/resources/apply/apply.js.map +1 -0
  580. package/resources/apply/handlers.d.ts +54 -0
  581. package/resources/apply/handlers.d.ts.map +1 -0
  582. package/resources/apply/handlers.js +56 -0
  583. package/resources/apply/handlers.js.map +1 -0
  584. package/resources/channel.d.ts +52 -0
  585. package/resources/channel.d.ts.map +1 -0
  586. package/resources/channel.js +404 -0
  587. package/resources/channel.js.map +1 -0
  588. package/resources/connect/address.d.ts +5 -0
  589. package/resources/connect/address.d.ts.map +1 -0
  590. package/resources/connect/address.js +49 -0
  591. package/resources/connect/address.js.map +1 -0
  592. package/resources/connect/connect.d.ts +30 -0
  593. package/resources/connect/connect.d.ts.map +1 -0
  594. package/resources/connect/connect.js +163 -0
  595. package/resources/connect/connect.js.map +1 -0
  596. package/resources/connect/discover.d.ts +7 -0
  597. package/resources/connect/discover.d.ts.map +1 -0
  598. package/resources/connect/discover.js +122 -0
  599. package/resources/connect/discover.js.map +1 -0
  600. package/resources/connect/display.d.ts +10 -0
  601. package/resources/connect/display.d.ts.map +1 -0
  602. package/resources/connect/display.js +50 -0
  603. package/resources/connect/display.js.map +1 -0
  604. package/resources/connect/sign-in.d.ts +48 -0
  605. package/resources/connect/sign-in.d.ts.map +1 -0
  606. package/resources/connect/sign-in.js +158 -0
  607. package/resources/connect/sign-in.js.map +1 -0
  608. package/resources/cursor-pages.d.ts +9 -0
  609. package/resources/cursor-pages.d.ts.map +1 -0
  610. package/resources/cursor-pages.js +25 -0
  611. package/resources/cursor-pages.js.map +1 -0
  612. package/resources/delete.d.ts +34 -0
  613. package/resources/delete.d.ts.map +1 -0
  614. package/resources/delete.js +260 -0
  615. package/resources/delete.js.map +1 -0
  616. package/resources/documents.d.ts +16 -0
  617. package/resources/documents.d.ts.map +1 -0
  618. package/resources/documents.js +89 -0
  619. package/resources/documents.js.map +1 -0
  620. package/resources/download.d.ts +16 -0
  621. package/resources/download.d.ts.map +1 -0
  622. package/resources/download.js +101 -0
  623. package/resources/download.js.map +1 -0
  624. package/resources/eval-run/follow.d.ts +67 -0
  625. package/resources/eval-run/follow.d.ts.map +1 -0
  626. package/resources/eval-run/follow.js +285 -0
  627. package/resources/eval-run/follow.js.map +1 -0
  628. package/resources/eval-run/node-io.d.ts +4 -0
  629. package/resources/eval-run/node-io.d.ts.map +1 -0
  630. package/resources/eval-run/node-io.js +39 -0
  631. package/resources/eval-run/node-io.js.map +1 -0
  632. package/resources/eval-run/options.d.ts +116 -0
  633. package/resources/eval-run/options.d.ts.map +1 -0
  634. package/resources/eval-run/options.js +265 -0
  635. package/resources/eval-run/options.js.map +1 -0
  636. package/resources/eval-run/report.d.ts +64 -0
  637. package/resources/eval-run/report.d.ts.map +1 -0
  638. package/resources/eval-run/report.js +434 -0
  639. package/resources/eval-run/report.js.map +1 -0
  640. package/resources/eval-run/run.d.ts +10 -0
  641. package/resources/eval-run/run.d.ts.map +1 -0
  642. package/resources/eval-run/run.js +158 -0
  643. package/resources/eval-run/run.js.map +1 -0
  644. package/resources/eval.d.ts +69 -0
  645. package/resources/eval.d.ts.map +1 -0
  646. package/resources/eval.js +225 -0
  647. package/resources/eval.js.map +1 -0
  648. package/resources/get-bindings.d.ts +13 -0
  649. package/resources/get-bindings.d.ts.map +1 -0
  650. package/resources/get-bindings.js +93 -0
  651. package/resources/get-bindings.js.map +1 -0
  652. package/resources/get.d.ts +6 -0
  653. package/resources/get.d.ts.map +1 -0
  654. package/resources/get.js +43 -0
  655. package/resources/get.js.map +1 -0
  656. package/resources/git.d.ts +15 -0
  657. package/resources/git.d.ts.map +1 -0
  658. package/resources/git.js +69 -0
  659. package/resources/git.js.map +1 -0
  660. package/resources/ignore/index.d.ts +3 -0
  661. package/resources/ignore/index.d.ts.map +1 -0
  662. package/resources/ignore/index.js +6 -0
  663. package/resources/ignore/index.js.map +1 -0
  664. package/resources/ignore/matcher.d.ts +11 -0
  665. package/resources/ignore/matcher.d.ts.map +1 -0
  666. package/resources/ignore/matcher.js +41 -0
  667. package/resources/ignore/matcher.js.map +1 -0
  668. package/resources/list.d.ts +16 -0
  669. package/resources/list.d.ts.map +1 -0
  670. package/resources/list.js +453 -0
  671. package/resources/list.js.map +1 -0
  672. package/resources/mcp/add.d.ts +18 -0
  673. package/resources/mcp/add.d.ts.map +1 -0
  674. package/resources/mcp/add.js +95 -0
  675. package/resources/mcp/add.js.map +1 -0
  676. package/resources/mcp/placeholder-resolver.d.ts +19 -0
  677. package/resources/mcp/placeholder-resolver.d.ts.map +1 -0
  678. package/resources/mcp/placeholder-resolver.js +52 -0
  679. package/resources/mcp/placeholder-resolver.js.map +1 -0
  680. package/resources/picker/ink.d.ts +45 -0
  681. package/resources/picker/ink.d.ts.map +1 -0
  682. package/resources/picker/ink.js +45 -0
  683. package/resources/picker/ink.js.map +1 -0
  684. package/resources/picker/tty.d.ts +19 -0
  685. package/resources/picker/tty.d.ts.map +1 -0
  686. package/resources/picker/tty.js +21 -0
  687. package/resources/picker/tty.js.map +1 -0
  688. package/resources/plugin.d.ts +131 -0
  689. package/resources/plugin.d.ts.map +1 -0
  690. package/resources/plugin.js +382 -0
  691. package/resources/plugin.js.map +1 -0
  692. package/resources/reference.d.ts +44 -0
  693. package/resources/reference.d.ts.map +1 -0
  694. package/resources/reference.js +152 -0
  695. package/resources/reference.js.map +1 -0
  696. package/resources/render.d.ts +52 -0
  697. package/resources/render.d.ts.map +1 -0
  698. package/resources/render.js +135 -0
  699. package/resources/render.js.map +1 -0
  700. package/resources/run/agent-exec.d.ts +16 -0
  701. package/resources/run/agent-exec.d.ts.map +1 -0
  702. package/resources/run/agent-exec.js +89 -0
  703. package/resources/run/agent-exec.js.map +1 -0
  704. package/resources/run/attachments.d.ts +24 -0
  705. package/resources/run/attachments.d.ts.map +1 -0
  706. package/resources/run/attachments.js +237 -0
  707. package/resources/run/attachments.js.map +1 -0
  708. package/resources/run/create.d.ts +57 -0
  709. package/resources/run/create.d.ts.map +1 -0
  710. package/resources/run/create.js +112 -0
  711. package/resources/run/create.js.map +1 -0
  712. package/resources/run/epilogue.d.ts +9 -0
  713. package/resources/run/epilogue.d.ts.map +1 -0
  714. package/resources/run/epilogue.js +172 -0
  715. package/resources/run/epilogue.js.map +1 -0
  716. package/resources/run/header.d.ts +31 -0
  717. package/resources/run/header.d.ts.map +1 -0
  718. package/resources/run/header.js +54 -0
  719. package/resources/run/header.js.map +1 -0
  720. package/resources/run/plugins.d.ts +11 -0
  721. package/resources/run/plugins.d.ts.map +1 -0
  722. package/resources/run/plugins.js +18 -0
  723. package/resources/run/plugins.js.map +1 -0
  724. package/resources/run/prepare.d.ts +149 -0
  725. package/resources/run/prepare.d.ts.map +1 -0
  726. package/resources/run/prepare.js +180 -0
  727. package/resources/run/prepare.js.map +1 -0
  728. package/resources/run/references.d.ts +22 -0
  729. package/resources/run/references.d.ts.map +1 -0
  730. package/resources/run/references.js +56 -0
  731. package/resources/run/references.js.map +1 -0
  732. package/resources/run/resolve.d.ts +5 -0
  733. package/resources/run/resolve.d.ts.map +1 -0
  734. package/resources/run/resolve.js +16 -0
  735. package/resources/run/resolve.js.map +1 -0
  736. package/resources/run/resume.d.ts +12 -0
  737. package/resources/run/resume.d.ts.map +1 -0
  738. package/resources/run/resume.js +97 -0
  739. package/resources/run/resume.js.map +1 -0
  740. package/resources/run/stream.d.ts +24 -0
  741. package/resources/run/stream.d.ts.map +1 -0
  742. package/resources/run/stream.js +74 -0
  743. package/resources/run/stream.js.map +1 -0
  744. package/resources/run/vaults.d.ts +11 -0
  745. package/resources/run/vaults.d.ts.map +1 -0
  746. package/resources/run/vaults.js +19 -0
  747. package/resources/run/vaults.js.map +1 -0
  748. package/resources/run/workspace.d.ts +17 -0
  749. package/resources/run/workspace.d.ts.map +1 -0
  750. package/resources/run/workspace.js +147 -0
  751. package/resources/run/workspace.js.map +1 -0
  752. package/resources/run-approve.d.ts +18 -0
  753. package/resources/run-approve.d.ts.map +1 -0
  754. package/resources/run-approve.js +72 -0
  755. package/resources/run-approve.js.map +1 -0
  756. package/resources/run-control.d.ts +19 -0
  757. package/resources/run-control.d.ts.map +1 -0
  758. package/resources/run-control.js +37 -0
  759. package/resources/run-control.js.map +1 -0
  760. package/resources/run-format.d.ts +15 -0
  761. package/resources/run-format.d.ts.map +1 -0
  762. package/resources/run-format.js +49 -0
  763. package/resources/run-format.js.map +1 -0
  764. package/resources/run-logs.d.ts +17 -0
  765. package/resources/run-logs.d.ts.map +1 -0
  766. package/resources/run-logs.js +105 -0
  767. package/resources/run-logs.js.map +1 -0
  768. package/resources/run-scores.d.ts +20 -0
  769. package/resources/run-scores.d.ts.map +1 -0
  770. package/resources/run-scores.js +132 -0
  771. package/resources/run-scores.js.map +1 -0
  772. package/resources/run-to-eval-case.d.ts +24 -0
  773. package/resources/run-to-eval-case.d.ts.map +1 -0
  774. package/resources/run-to-eval-case.js +113 -0
  775. package/resources/run-to-eval-case.js.map +1 -0
  776. package/resources/run-trace.d.ts +10 -0
  777. package/resources/run-trace.d.ts.map +1 -0
  778. package/resources/run-trace.js +81 -0
  779. package/resources/run-trace.js.map +1 -0
  780. package/resources/runs.d.ts +45 -0
  781. package/resources/runs.d.ts.map +1 -0
  782. package/resources/runs.js +123 -0
  783. package/resources/runs.js.map +1 -0
  784. package/resources/schedule.d.ts +22 -0
  785. package/resources/schedule.d.ts.map +1 -0
  786. package/resources/schedule.js +116 -0
  787. package/resources/schedule.js.map +1 -0
  788. package/resources/search.d.ts +21 -0
  789. package/resources/search.d.ts.map +1 -0
  790. package/resources/search.js +25 -0
  791. package/resources/search.js.map +1 -0
  792. package/resources/service-account.d.ts +37 -0
  793. package/resources/service-account.d.ts.map +1 -0
  794. package/resources/service-account.js +139 -0
  795. package/resources/service-account.js.map +1 -0
  796. package/resources/session.d.ts +20 -0
  797. package/resources/session.d.ts.map +1 -0
  798. package/resources/session.js +51 -0
  799. package/resources/session.js.map +1 -0
  800. package/resources/skill.d.ts +123 -0
  801. package/resources/skill.d.ts.map +1 -0
  802. package/resources/skill.js +441 -0
  803. package/resources/skill.js.map +1 -0
  804. package/resources/stream/answer.d.ts +34 -0
  805. package/resources/stream/answer.d.ts.map +1 -0
  806. package/resources/stream/answer.js +88 -0
  807. package/resources/stream/answer.js.map +1 -0
  808. package/resources/stream/headless.d.ts +45 -0
  809. package/resources/stream/headless.d.ts.map +1 -0
  810. package/resources/stream/headless.js +100 -0
  811. package/resources/stream/headless.js.map +1 -0
  812. package/resources/stream/ink.d.ts +22 -0
  813. package/resources/stream/ink.d.ts.map +1 -0
  814. package/resources/stream/ink.js +24 -0
  815. package/resources/stream/ink.js.map +1 -0
  816. package/resources/stream/render-ndjson.d.ts +23 -0
  817. package/resources/stream/render-ndjson.d.ts.map +1 -0
  818. package/resources/stream/render-ndjson.js +28 -0
  819. package/resources/stream/render-ndjson.js.map +1 -0
  820. package/resources/stream/render-plaintext.d.ts +27 -0
  821. package/resources/stream/render-plaintext.d.ts.map +1 -0
  822. package/resources/stream/render-plaintext.js +142 -0
  823. package/resources/stream/render-plaintext.js.map +1 -0
  824. package/resources/stream/submit.d.ts +25 -0
  825. package/resources/stream/submit.d.ts.map +1 -0
  826. package/resources/stream/submit.js +132 -0
  827. package/resources/stream/submit.js.map +1 -0
  828. package/resources/stream/tty.d.ts +8 -0
  829. package/resources/stream/tty.d.ts.map +1 -0
  830. package/resources/stream/tty.js +15 -0
  831. package/resources/stream/tty.js.map +1 -0
  832. package/resources/tag.d.ts +4 -0
  833. package/resources/tag.d.ts.map +1 -0
  834. package/resources/tag.js +37 -0
  835. package/resources/tag.js.map +1 -0
  836. package/resources/usage.d.ts +47 -0
  837. package/resources/usage.d.ts.map +1 -0
  838. package/resources/usage.js +376 -0
  839. package/resources/usage.js.map +1 -0
  840. package/resources/validate.d.ts +7 -0
  841. package/resources/validate.d.ts.map +1 -0
  842. package/resources/validate.js +36 -0
  843. package/resources/validate.js.map +1 -0
  844. package/resources/vault.d.ts +79 -0
  845. package/resources/vault.d.ts.map +1 -0
  846. package/resources/vault.js +277 -0
  847. package/resources/vault.js.map +1 -0
  848. package/resources/version.d.ts +11 -0
  849. package/resources/version.d.ts.map +1 -0
  850. package/resources/version.js +80 -0
  851. package/resources/version.js.map +1 -0
  852. package/runtime.d.ts +5 -0
  853. package/runtime.d.ts.map +1 -0
  854. package/runtime.js +19 -0
  855. package/runtime.js.map +1 -0
  856. package/src/auth/auth0.ts +43 -0
  857. package/src/auth/callback-server.ts +104 -0
  858. package/src/auth/index.ts +6 -0
  859. package/src/auth/login.ts +106 -0
  860. package/src/auth/pages.ts +31 -0
  861. package/src/auth/pkce.ts +26 -0
  862. package/src/auth/token.ts +159 -0
  863. package/src/backend.ts +15 -0
  864. package/src/cli/stigmer.ts +16 -0
  865. package/src/client/client.ts +157 -0
  866. package/src/client/index.ts +3 -0
  867. package/src/client/organizations.ts +118 -0
  868. package/src/client/single-org.ts +62 -0
  869. package/src/commands/access-history/index.ts +124 -0
  870. package/src/commands/agent-exec-flags.ts +76 -0
  871. package/src/commands/agent.ts +57 -0
  872. package/src/commands/apikey/duration.ts +35 -0
  873. package/src/commands/apikey/index.ts +273 -0
  874. package/src/commands/apply.ts +200 -0
  875. package/src/commands/auth/index.ts +76 -0
  876. package/src/commands/auth/login.ts +70 -0
  877. package/src/commands/auth/whoami.ts +157 -0
  878. package/src/commands/channel.ts +178 -0
  879. package/src/commands/completion.ts +94 -0
  880. package/src/commands/config/backend.ts +239 -0
  881. package/src/commands/config/context.ts +110 -0
  882. package/src/commands/config/index.ts +18 -0
  883. package/src/commands/config/kv.ts +44 -0
  884. package/src/commands/connect.ts +115 -0
  885. package/src/commands/delete.ts +59 -0
  886. package/src/commands/down.ts +27 -0
  887. package/src/commands/download.ts +113 -0
  888. package/src/commands/eval.ts +148 -0
  889. package/src/commands/get.ts +138 -0
  890. package/src/commands/install.ts +108 -0
  891. package/src/commands/internal-daemon.ts +17 -0
  892. package/src/commands/list.ts +164 -0
  893. package/src/commands/logs.ts +73 -0
  894. package/src/commands/marketplace.ts +133 -0
  895. package/src/commands/mcp-server.ts +125 -0
  896. package/src/commands/mcp.ts +92 -0
  897. package/src/commands/push.ts +630 -0
  898. package/src/commands/reset.ts +57 -0
  899. package/src/commands/resume.ts +122 -0
  900. package/src/commands/run.ts +228 -0
  901. package/src/commands/runs/approve.ts +57 -0
  902. package/src/commands/runs/control.ts +96 -0
  903. package/src/commands/runs/index.ts +31 -0
  904. package/src/commands/runs/logs.ts +45 -0
  905. package/src/commands/runs/scores.ts +34 -0
  906. package/src/commands/runs/to-eval-case.ts +50 -0
  907. package/src/commands/runs/trace.ts +32 -0
  908. package/src/commands/schedule.ts +70 -0
  909. package/src/commands/search.ts +95 -0
  910. package/src/commands/service-account/index.ts +180 -0
  911. package/src/commands/setup.ts +97 -0
  912. package/src/commands/shared.ts +41 -0
  913. package/src/commands/status.ts +20 -0
  914. package/src/commands/tag.ts +31 -0
  915. package/src/commands/up.ts +113 -0
  916. package/src/commands/usage.ts +116 -0
  917. package/src/commands/validate.ts +127 -0
  918. package/src/commands/vault.ts +245 -0
  919. package/src/commands/version.ts +13 -0
  920. package/src/config/config.ts +308 -0
  921. package/src/config/index.ts +33 -0
  922. package/src/config/keys.ts +105 -0
  923. package/src/config/paths.ts +25 -0
  924. package/src/config/resolve.ts +174 -0
  925. package/src/errors/classify.ts +249 -0
  926. package/src/errors/cli-exit-error.ts +16 -0
  927. package/src/errors/exit-codes.ts +17 -0
  928. package/src/errors/handle.ts +53 -0
  929. package/src/errors/index.ts +7 -0
  930. package/src/errors/usage-error.ts +14 -0
  931. package/src/index.ts +8 -0
  932. package/src/local/artifact.ts +351 -0
  933. package/src/local/constants.ts +55 -0
  934. package/src/local/daemon/components.ts +145 -0
  935. package/src/local/daemon/env.ts +171 -0
  936. package/src/local/daemon/host.ts +128 -0
  937. package/src/local/daemon/index.ts +18 -0
  938. package/src/local/daemon/launch.ts +326 -0
  939. package/src/local/daemon/process.ts +213 -0
  940. package/src/local/daemon/supervisor.ts +249 -0
  941. package/src/local/daemon/types.ts +78 -0
  942. package/src/local/llm-config.ts +86 -0
  943. package/src/local/logs/tail.ts +100 -0
  944. package/src/local/logs/view.ts +65 -0
  945. package/src/local/net/tcp.ts +65 -0
  946. package/src/local/operator-config.ts +95 -0
  947. package/src/local/paths.ts +95 -0
  948. package/src/local/reset.ts +90 -0
  949. package/src/local/runtime/index.ts +19 -0
  950. package/src/local/runtime/node.ts +173 -0
  951. package/src/local/runtime/runner.ts +159 -0
  952. package/src/local/runtime/runtimes-install.ts +75 -0
  953. package/src/local/runtime/server.ts +197 -0
  954. package/src/local/runtime/which.ts +30 -0
  955. package/src/local/setup/prompt.ts +70 -0
  956. package/src/local/setup/wizard.ts +140 -0
  957. package/src/local/state/health-state.ts +55 -0
  958. package/src/local/state/index.ts +8 -0
  959. package/src/local/state/lock.ts +92 -0
  960. package/src/local/state/log-rotation.ts +112 -0
  961. package/src/local/state/pidfile.ts +37 -0
  962. package/src/local/state/proc.ts +82 -0
  963. package/src/local/state/startup-config.ts +55 -0
  964. package/src/local/status.ts +189 -0
  965. package/src/local/temporal/download.ts +84 -0
  966. package/src/local/temporal/index.ts +14 -0
  967. package/src/local/temporal/inspect.ts +80 -0
  968. package/src/local/temporal/manager.ts +261 -0
  969. package/src/local/temporal/supervisor.ts +97 -0
  970. package/src/local/webconsole/index.ts +30 -0
  971. package/src/logger.ts +39 -0
  972. package/src/marketplace/config.ts +255 -0
  973. package/src/marketplace/github.ts +410 -0
  974. package/src/marketplace/index.ts +54 -0
  975. package/src/marketplace/install.ts +217 -0
  976. package/src/marketplace/materialize.ts +80 -0
  977. package/src/marketplace/official.ts +126 -0
  978. package/src/marketplace/read.ts +76 -0
  979. package/src/marketplace/ref.ts +74 -0
  980. package/src/marketplace/render.ts +151 -0
  981. package/src/output/command-result.ts +199 -0
  982. package/src/output/confirm.ts +54 -0
  983. package/src/output/format.ts +101 -0
  984. package/src/output/index.ts +30 -0
  985. package/src/output/ndjson.ts +14 -0
  986. package/src/output/proto.ts +55 -0
  987. package/src/output/style.ts +57 -0
  988. package/src/output/table.ts +52 -0
  989. package/src/program.ts +209 -0
  990. package/src/registry/aliases.ts +113 -0
  991. package/src/registry/index.ts +30 -0
  992. package/src/registry/metadata.ts +170 -0
  993. package/src/registry/registry.ts +135 -0
  994. package/src/registry/verb-support.ts +117 -0
  995. package/src/registry/verbs.ts +42 -0
  996. package/src/resources/access-history.ts +167 -0
  997. package/src/resources/agent/quality.ts +424 -0
  998. package/src/resources/agent/resolve.ts +31 -0
  999. package/src/resources/apply/apply.ts +472 -0
  1000. package/src/resources/apply/handlers.ts +115 -0
  1001. package/src/resources/channel.ts +548 -0
  1002. package/src/resources/connect/address.ts +47 -0
  1003. package/src/resources/connect/connect.ts +219 -0
  1004. package/src/resources/connect/discover.ts +145 -0
  1005. package/src/resources/connect/display.ts +67 -0
  1006. package/src/resources/connect/sign-in.ts +210 -0
  1007. package/src/resources/cursor-pages.ts +35 -0
  1008. package/src/resources/delete.ts +381 -0
  1009. package/src/resources/documents.ts +102 -0
  1010. package/src/resources/download.ts +147 -0
  1011. package/src/resources/eval-run/follow.ts +390 -0
  1012. package/src/resources/eval-run/node-io.ts +42 -0
  1013. package/src/resources/eval-run/options.ts +391 -0
  1014. package/src/resources/eval-run/report.ts +529 -0
  1015. package/src/resources/eval-run/run.ts +230 -0
  1016. package/src/resources/eval.ts +278 -0
  1017. package/src/resources/get-bindings.ts +137 -0
  1018. package/src/resources/get.ts +51 -0
  1019. package/src/resources/git.ts +71 -0
  1020. package/src/resources/ignore/index.ts +20 -0
  1021. package/src/resources/ignore/matcher.ts +55 -0
  1022. package/src/resources/list.ts +552 -0
  1023. package/src/resources/mcp/add.ts +105 -0
  1024. package/src/resources/mcp/placeholder-resolver.ts +63 -0
  1025. package/src/resources/picker/ink.tsx +123 -0
  1026. package/src/resources/picker/tty.ts +30 -0
  1027. package/src/resources/plugin.ts +560 -0
  1028. package/src/resources/reference.ts +170 -0
  1029. package/src/resources/render.ts +198 -0
  1030. package/src/resources/run/agent-exec.ts +115 -0
  1031. package/src/resources/run/attachments.ts +300 -0
  1032. package/src/resources/run/create.ts +181 -0
  1033. package/src/resources/run/epilogue.ts +200 -0
  1034. package/src/resources/run/header.ts +72 -0
  1035. package/src/resources/run/plugins.ts +32 -0
  1036. package/src/resources/run/prepare.ts +350 -0
  1037. package/src/resources/run/references.ts +77 -0
  1038. package/src/resources/run/resolve.ts +18 -0
  1039. package/src/resources/run/resume.ts +122 -0
  1040. package/src/resources/run/stream.ts +96 -0
  1041. package/src/resources/run/vaults.ts +33 -0
  1042. package/src/resources/run/workspace.ts +171 -0
  1043. package/src/resources/run-approve.ts +94 -0
  1044. package/src/resources/run-control.ts +59 -0
  1045. package/src/resources/run-format.ts +44 -0
  1046. package/src/resources/run-logs.ts +131 -0
  1047. package/src/resources/run-scores.ts +164 -0
  1048. package/src/resources/run-to-eval-case.ts +160 -0
  1049. package/src/resources/run-trace.ts +102 -0
  1050. package/src/resources/runs.ts +155 -0
  1051. package/src/resources/schedule.ts +132 -0
  1052. package/src/resources/search.ts +62 -0
  1053. package/src/resources/service-account.ts +195 -0
  1054. package/src/resources/session.ts +64 -0
  1055. package/src/resources/skill.ts +577 -0
  1056. package/src/resources/stream/answer.ts +125 -0
  1057. package/src/resources/stream/headless.ts +150 -0
  1058. package/src/resources/stream/ink.tsx +56 -0
  1059. package/src/resources/stream/render-ndjson.ts +44 -0
  1060. package/src/resources/stream/render-plaintext.ts +153 -0
  1061. package/src/resources/stream/submit.ts +145 -0
  1062. package/src/resources/stream/tty.ts +14 -0
  1063. package/src/resources/tag.ts +51 -0
  1064. package/src/resources/usage.ts +443 -0
  1065. package/src/resources/validate.ts +37 -0
  1066. package/src/resources/vault.ts +372 -0
  1067. package/src/resources/version.ts +103 -0
  1068. package/src/runtime.ts +23 -0
  1069. package/src/types/marked-terminal.d.ts +31 -0
  1070. package/src/version.ts +46 -0
  1071. package/version.d.ts +2 -0
  1072. package/version.d.ts.map +1 -0
  1073. package/version.js +45 -0
  1074. package/version.js.map +1 -0
@@ -0,0 +1,62 @@
1
+ import { type JsonValue, type Message } from "@bufbuild/protobuf";
2
+ import { type ApiResourceMetadata } from "@stigmer/apis/ai/stigmer/commons/apiresource/metadata_pb";
3
+ import { CommandResult } from "../../output/index.js";
4
+ import { type ApplyHandler, type ControllerFn } from "./handlers.js";
5
+ export interface ApplyItem {
6
+ readonly filePath: string;
7
+ readonly handler: ApplyHandler;
8
+ readonly document: JsonValue;
9
+ }
10
+ export interface ApplyOutcome {
11
+ readonly result: CommandResult;
12
+ /** Optional org-mismatch warning to surface on stderr. */
13
+ readonly warning?: string;
14
+ /**
15
+ * The applied resource message (absent in dry-run), as the server stored
16
+ * it: authoritative metadata (id, slug, visibility) for anything that
17
+ * runs after the apply.
18
+ */
19
+ readonly applied?: Message;
20
+ }
21
+ /** Expand a path into ordered, kind-resolved apply items (strict YAML parse). */
22
+ export declare function resolveApplyItems(path: string): ApplyItem[];
23
+ /**
24
+ * Resolve a YAML `kind` to its apply handler, enforcing the verb-support gate.
25
+ * The unknown-kind wording is the registry's (`unknownKindError`), shared
26
+ * with `validate -f`, so a retired kind is refused with the same sentence on
27
+ * both paths. `where` is woven into errors for a precise location.
28
+ */
29
+ export declare function resolveHandlerForKind(kind: string, where: string): ApplyHandler;
30
+ /**
31
+ * Stable sort by dependency priority (Array.prototype.sort is stable in V8).
32
+ * The priority rides each handler (`applyOrder`, sourced from the SDK
33
+ * manifest registry) — there is deliberately no local ordering table to
34
+ * drift from it.
35
+ */
36
+ export declare function sortApplyItems(items: ApplyItem[]): ApplyItem[];
37
+ /** True when any item needs org context (everything except Organization). */
38
+ export declare function requiresOrgContext(items: readonly ApplyItem[]): boolean;
39
+ /** Apply a single YAML item: strict-marshal to a proto, then apply the message. */
40
+ export declare function applyItem(controller: ControllerFn, item: ApplyItem, org: string, dryRun: boolean): Promise<ApplyOutcome>;
41
+ /**
42
+ * Strict YAML→proto marshal for one item, with a precise location in the error.
43
+ * Split out from {@link applyItem} so marshalling can be exercised and reused
44
+ * apart from the apply it feeds.
45
+ *
46
+ * A file is a desired state (`toDesiredState`): its etag is dropped, and so
47
+ * is the id of each reference it names by slug. A file `get -o yaml`
48
+ * printed whole applies after the resource changed, and a reference whose
49
+ * slug was edited follows the new slug instead of disagreeing with a
50
+ * leftover id.
51
+ */
52
+ export declare function marshalItem(item: ApplyItem): Message;
53
+ /**
54
+ * Apply a fully-marshalled resource message: inject org, then dry-run preview or
55
+ * drive the controller's `apply` RPC. The single apply core behind file mode,
56
+ * taking the message rather than the YAML so org injection, create/update
57
+ * detection and result shaping live in one place whatever produced the message.
58
+ */
59
+ export declare function applyMessage(controller: ControllerFn, handler: ApplyHandler, message: Message, org: string, dryRun: boolean): Promise<ApplyOutcome>;
60
+ /** Read a resource message's metadata (id/name/slug/org), if present. */
61
+ export declare function resourceMetadata(message: Message): ApiResourceMetadata | undefined;
62
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/resources/apply/apply.ts"],"names":[],"mappings":"AAaA,OAAO,EAA4B,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAY5F,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,0DAA0D,CAAC;AAelE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,KAAK,YAAY,EAAkB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAErF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,YAAY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2
+ //
3
+ // Pipeline per document: strict YAML→proto marshal, reduced to the desired
4
+ // state the file declares (no etag, references by slug) → inject the
5
+ // resolved org when absent → dry-run preview OR drive the raw command
6
+ // controller's `apply` RPC with the full proto → build a CommandResult. Items
7
+ // across all files are sorted into dependency order before applying so parents
8
+ // (org → agent → channel → …) land before their dependents.
9
+ //
10
+ // The slug rules (a renamed-away slug named, a declared slug followed with a
11
+ // rename, a kind that cannot rename) are the SDK's, shared with the
12
+ // console's YAML editors; this file words their outcomes for the terminal.
13
+ import { create, equals, fromJson } from "@bufbuild/protobuf";
14
+ import { Code } from "@connectrpc/connect";
15
+ import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
16
+ import { ApiResourceVisibility } from "@stigmer/apis/ai/stigmer/commons/apiresource/enum_pb";
17
+ import { UpdateVisibilityInputSchema } from "@stigmer/apis/ai/stigmer/commons/apiresource/io_pb";
18
+ import { UpdateOrganizationPoliciesInputSchema } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/io_pb";
19
+ import { OrganizationQueryController } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/query_pb";
20
+ import { OrganizationPoliciesSchema, } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/spec_pb";
21
+ import { ApiResourceMetadataSchema, } from "@stigmer/apis/ai/stigmer/commons/apiresource/metadata_pb";
22
+ import { organizationLabel, organizationNamed, } from "../../client/organizations.js";
23
+ import { applyNamingCurrentSlug, followDeclaredSlug, retiredShapeWayForward, SlugChangeRefusedError, SlugRenamedError, toDesiredState, } from "@stigmer/client";
24
+ import { classify, UsageError } from "../../errors/index.js";
25
+ import { CommandResult } from "../../output/index.js";
26
+ import { defaultRegistry, unknownKindError, Verb } from "../../registry/index.js";
27
+ import { loadDocuments, resolveYamlFiles } from "../documents.js";
28
+ import { APPLY_HANDLERS } from "./handlers.js";
29
+ /** Expand a path into ordered, kind-resolved apply items (strict YAML parse). */
30
+ export function resolveApplyItems(path) {
31
+ const files = resolveYamlFiles(path);
32
+ if (files.length === 0)
33
+ throw new UsageError("no YAML files found");
34
+ const items = [];
35
+ for (const file of files) {
36
+ for (const doc of loadDocuments(file, { strict: true })) {
37
+ items.push({ filePath: file, handler: resolveHandlerForKind(doc.kind, file), document: doc.document });
38
+ }
39
+ }
40
+ if (items.length === 0)
41
+ throw new UsageError("no valid resources found in files");
42
+ return sortApplyItems(items);
43
+ }
44
+ /**
45
+ * Resolve a YAML `kind` to its apply handler, enforcing the verb-support gate.
46
+ * The unknown-kind wording is the registry's (`unknownKindError`), shared
47
+ * with `validate -f`, so a retired kind is refused with the same sentence on
48
+ * both paths. `where` is woven into errors for a precise location.
49
+ */
50
+ export function resolveHandlerForKind(kind, where) {
51
+ const info = defaultRegistry().getByYamlKind(kind);
52
+ if (info === undefined)
53
+ throw unknownKindError(kind, where);
54
+ if (!info.supportedVerbs.has(Verb.Apply))
55
+ throw new UsageError(`${info.displayName} does not support 'apply'`);
56
+ const handler = APPLY_HANDLERS.get(info.kind);
57
+ if (handler === undefined)
58
+ throw new UsageError(`apply not implemented for ${info.displayName}`);
59
+ return handler;
60
+ }
61
+ /**
62
+ * Stable sort by dependency priority (Array.prototype.sort is stable in V8).
63
+ * The priority rides each handler (`applyOrder`, sourced from the SDK
64
+ * manifest registry) — there is deliberately no local ordering table to
65
+ * drift from it.
66
+ */
67
+ export function sortApplyItems(items) {
68
+ items.sort((a, b) => a.handler.applyOrder - b.handler.applyOrder);
69
+ return items;
70
+ }
71
+ /** True when any item needs org context (everything except Organization). */
72
+ export function requiresOrgContext(items) {
73
+ return items.some((item) => item.handler.kind !== ApiResourceKind.organization);
74
+ }
75
+ /** Apply a single YAML item: strict-marshal to a proto, then apply the message. */
76
+ export async function applyItem(controller, item, org, dryRun) {
77
+ return applyMessage(controller, item.handler, marshalItem(item), org, dryRun);
78
+ }
79
+ /**
80
+ * Strict YAML→proto marshal for one item, with a precise location in the error.
81
+ * Split out from {@link applyItem} so marshalling can be exercised and reused
82
+ * apart from the apply it feeds.
83
+ *
84
+ * A file is a desired state (`toDesiredState`): its etag is dropped, and so
85
+ * is the id of each reference it names by slug. A file `get -o yaml`
86
+ * printed whole applies after the resource changed, and a reference whose
87
+ * slug was edited follows the new slug instead of disagreeing with a
88
+ * leftover id.
89
+ */
90
+ export function marshalItem(item) {
91
+ try {
92
+ return toDesiredState(item.handler.schema, fromJson(item.handler.schema, item.document, { ignoreUnknownFields: false }));
93
+ }
94
+ catch (err) {
95
+ const hint = retiredShapeWayForward(item.document);
96
+ throw new UsageError(`invalid ${item.handler.displayName} in ${item.filePath}: ${err.message}${hint === undefined ? "" : `\n${hint}`}`);
97
+ }
98
+ }
99
+ /**
100
+ * Apply a fully-marshalled resource message: inject org, then dry-run preview or
101
+ * drive the controller's `apply` RPC. The single apply core behind file mode,
102
+ * taking the message rather than the YAML so org injection, create/update
103
+ * detection and result shaping live in one place whatever produced the message.
104
+ */
105
+ export async function applyMessage(controller, handler, message, org, dryRun) {
106
+ // An organization belongs to no organization: its own metadata.org stays
107
+ // empty, whatever the context or `--org` names for the file's other kinds.
108
+ const orgWarning = handler.kind === ApiResourceKind.organization ? undefined : await injectOrg(controller, message, org);
109
+ const created = (metaOf(message)?.id ?? "") === "";
110
+ if (dryRun) {
111
+ return { result: await buildDryRunResult(controller, handler, message), warning: orgWarning };
112
+ }
113
+ const applied = await applyNamingSlug(controller, handler, message);
114
+ // Visibility and policies land before the slug: a refused rename stops
115
+ // the command, so everything else the manifest asked for has landed by
116
+ // then, and the refusal reports it.
117
+ const visibilityWarning = await applyDeclaredVisibility(controller, handler, message, applied);
118
+ await applyDeclaredPolicies(controller, handler, message, applied);
119
+ const slugWarning = await applyDeclaredSlug(controller, handler, message, applied, visibilityWarning);
120
+ const warning = combineWarnings(orgWarning, visibilityWarning, slugWarning);
121
+ const result = buildApplyResult(handler, applied, created);
122
+ return { result, warning, applied };
123
+ }
124
+ /**
125
+ * Land a manifest-declared visibility through the guarded door. Plain
126
+ * updates preserve the stored visibility on both editions (oss#573) — the
127
+ * `updateVisibility` RPC is the only mutation path, so when the applied
128
+ * resource comes back with a different level than the manifest declared,
129
+ * follow up with one RPC (the skill-push precedent: no-ops are skipped, an
130
+ * unchanged manifest costs nothing extra). Server-side guard rejections
131
+ * (an unsupported level) propagate as command failures —
132
+ * the spec update has landed at that point, and the error says so.
133
+ *
134
+ * Returns a warning (instead of following up) for kinds without the RPC:
135
+ * their manifests can only carry a level the create path already rejected,
136
+ * so a diff here means a pre-existing resource and an unsupported ask.
137
+ */
138
+ async function applyDeclaredVisibility(controller, handler, message, applied) {
139
+ const declared = metaOf(message)?.visibility ?? ApiResourceVisibility.api_resource_visibility_unspecified;
140
+ if (declared === ApiResourceVisibility.api_resource_visibility_unspecified)
141
+ return undefined;
142
+ const appliedMeta = metaOf(applied);
143
+ const resourceId = appliedMeta?.id ?? "";
144
+ if (resourceId === "" || appliedMeta?.visibility === declared)
145
+ return undefined;
146
+ if (handler.updateVisibility === undefined) {
147
+ return (`${handler.displayName} visibility cannot be changed declaratively — ` +
148
+ "the manifest's metadata.visibility was ignored (the stored value is kept)");
149
+ }
150
+ try {
151
+ const updated = await handler.updateVisibility(controller, create(UpdateVisibilityInputSchema, { resourceId, visibility: declared }));
152
+ // Reflect the landed level on the outcome the caller already holds.
153
+ const updatedMeta = metaOf(updated);
154
+ if (appliedMeta !== undefined && updatedMeta !== undefined) {
155
+ appliedMeta.visibility = updatedMeta.visibility;
156
+ }
157
+ return undefined;
158
+ }
159
+ catch (err) {
160
+ throw new UsageError(`${handler.displayName} spec applied, but the manifest's visibility change was rejected: ${err.message}`);
161
+ }
162
+ }
163
+ /**
164
+ * Land an Organization manifest's declared policies through the guarded
165
+ * door. An update or apply keeps the stored policies (a stale manifest
166
+ * neither fails nor reverts one), so when the applied organization comes
167
+ * back with different policies than the manifest declared, follow up with
168
+ * one `updatePolicies` — the visibility precedent: a manifest that declares
169
+ * no policies, or the ones already stored, costs nothing extra. A refusal
170
+ * (a member who may not change them) fails the command after the spec has
171
+ * landed, and the error says so.
172
+ */
173
+ async function applyDeclaredPolicies(controller, handler, message, applied) {
174
+ if (handler.updatePolicies === undefined)
175
+ return;
176
+ const declared = message.spec?.policies;
177
+ if (declared === undefined)
178
+ return;
179
+ const appliedOrg = applied;
180
+ const orgId = appliedOrg.metadata?.id ?? "";
181
+ if (orgId === "" || equals(OrganizationPoliciesSchema, storedPolicies(appliedOrg), declared))
182
+ return;
183
+ try {
184
+ const updated = (await handler.updatePolicies(controller, create(UpdateOrganizationPoliciesInputSchema, { orgId, policies: declared })));
185
+ // Reflect the landed policies on the outcome the caller already holds.
186
+ if (appliedOrg.spec !== undefined) {
187
+ appliedOrg.spec.policies = updated.spec?.policies;
188
+ }
189
+ }
190
+ catch (err) {
191
+ throw new UsageError(`${handler.displayName} spec applied, but the manifest's policies change was rejected: ${err.message}`);
192
+ }
193
+ }
194
+ /**
195
+ * The policies an organization holds: a row stored without them holds the
196
+ * defaults (members may create agents), as the server reads it.
197
+ */
198
+ function storedPolicies(organization) {
199
+ return (organization.spec?.policies ?? create(OrganizationPoliciesSchema, { membersCanCreateAgents: true }));
200
+ }
201
+ /**
202
+ * Land a manifest-declared slug change through the guarded door (the SDK's
203
+ * `followDeclaredSlug`). An apply finds its resource by the manifest's id
204
+ * when it carries one, and an update ignores the slug, so a manifest that
205
+ * carries the id and a new slug (an organization's `get -o yaml`, edited)
206
+ * updates the resource and leaves the slug as it was; one `rename` follows,
207
+ * as visibility is followed up. Without the id the slug is how apply finds
208
+ * the resource, so a new slug means a new resource. A kind with no rename
209
+ * keeps its slug, and the returned warning says so. A refusal fails the
210
+ * command after the spec and any declared visibility have landed; the error
211
+ * says what landed and carries the visibility follow-up's warning. Its
212
+ * advice follows the refusal: a slug that is taken or reserved
213
+ * (AlreadyExists) asks for another slug, a caller who may not rename
214
+ * (PermissionDenied: renaming needs what deleting needs, an organization's
215
+ * owner for an organization) is told so, anything else gets none.
216
+ */
217
+ async function applyDeclaredSlug(controller, handler, message, applied, visibilityWarning) {
218
+ const declared = metaOf(message);
219
+ const appliedMeta = metaOf(applied);
220
+ try {
221
+ const followed = await followDeclaredSlug(controller, handler, message, applied);
222
+ if (followed.slugKept) {
223
+ return (`${handler.displayName} slugs do not change: the file's metadata.slug '${declared?.slug ?? ""}' ` +
224
+ `was not applied, and the slug stays '${appliedMeta?.slug ?? ""}'`);
225
+ }
226
+ if (followed.renamedFrom !== undefined && appliedMeta !== undefined) {
227
+ appliedMeta.slug = metaOf(followed.message)?.slug ?? declared?.slug ?? appliedMeta.slug;
228
+ }
229
+ return undefined;
230
+ }
231
+ catch (err) {
232
+ /* v8 ignore next -- @preserve: followDeclaredSlug throws only SlugChangeRefusedError; the guard narrows the type */
233
+ if (!(err instanceof SlugChangeRefusedError))
234
+ throw err;
235
+ const visibilityLanded = declared !== undefined &&
236
+ declared.visibility !== ApiResourceVisibility.api_resource_visibility_unspecified &&
237
+ appliedMeta?.visibility === declared.visibility;
238
+ const landed = visibilityLanded ? "spec and visibility" : "spec";
239
+ const warning = visibilityWarning === undefined ? "" : ` (${visibilityWarning})`;
240
+ throw new UsageError(`${handler.displayName} ${landed} applied${warning}, but the manifest's slug change was rejected: ` +
241
+ `${err.cause.message}. The slug stays '${err.slug}'${renameAdvice(err.cause, handler)}.`);
242
+ }
243
+ }
244
+ /** What to do after a refused rename, by the refusal's code; "" when there is nothing to add. */
245
+ function renameAdvice(err, handler) {
246
+ switch (classify(err)?.code) {
247
+ case Code.AlreadyExists:
248
+ return "; choose another slug and apply again";
249
+ case Code.PermissionDenied:
250
+ return handler.kind === ApiResourceKind.organization
251
+ ? "; renaming needs the organization's owner"
252
+ : `; renaming needs the permission to delete the ${handler.displayName.toLowerCase()}`;
253
+ default:
254
+ return "";
255
+ }
256
+ }
257
+ /**
258
+ * Applies the message (the SDK's `applyNamingCurrentSlug`); a refusal for a
259
+ * renamed-away slug is answered with the slug the resource has now, read
260
+ * as the caller by the old slug (which still leads to it for reading), so
261
+ * the file can be corrected. A caller who may not read the resource, or a
262
+ * kind with no read by reference, gets the server's own words.
263
+ */
264
+ async function applyNamingSlug(controller, handler, message) {
265
+ try {
266
+ return await applyNamingCurrentSlug(controller, handler, message);
267
+ }
268
+ catch (err) {
269
+ if (!(err instanceof SlugRenamedError))
270
+ throw err;
271
+ throw new UsageError(`${handler.displayName} '${err.slug}' was renamed to '${err.currentSlug}'; update the file's metadata.slug to '${err.currentSlug}' and apply again`);
272
+ }
273
+ }
274
+ function combineWarnings(...warnings) {
275
+ const present = warnings.filter((w) => w !== undefined);
276
+ return present.length > 0 ? present.join("; ") : undefined;
277
+ }
278
+ /** Read a resource message's metadata (id/name/slug/org), if present. */
279
+ export function resourceMetadata(message) {
280
+ return metaOf(message);
281
+ }
282
+ function metaOf(message) {
283
+ return message.metadata;
284
+ }
285
+ // Inject the resolved org into metadata.org when the document omitted it. When
286
+ // the document specifies a *different* org, return a warning (Go warns but
287
+ // honors the document's value — we do the same). An organization is named
288
+ // by its id or its slug, so two different strings are asked about before
289
+ // they are called different organizations, and the warning names each by
290
+ // its slug where the caller can see it.
291
+ async function injectOrg(controller, message, org) {
292
+ if (org === "")
293
+ return undefined;
294
+ const holder = message;
295
+ if (holder.metadata === undefined) {
296
+ holder.metadata = create(ApiResourceMetadataSchema, { org });
297
+ return undefined;
298
+ }
299
+ if (holder.metadata.org === "") {
300
+ holder.metadata.org = org;
301
+ return undefined;
302
+ }
303
+ if (holder.metadata.org === org)
304
+ return undefined;
305
+ const reader = organizationReader(controller);
306
+ const [declared, target] = await Promise.all([
307
+ organizationNamed(reader, holder.metadata.org),
308
+ organizationNamed(reader, org),
309
+ ]);
310
+ if (declared !== undefined && declared.id === target?.id)
311
+ return undefined;
312
+ const declaredLabel = declared?.slug || holder.metadata.org;
313
+ const targetLabel = target?.slug || org;
314
+ return `resource org '${declaredLabel}' differs from target org '${targetLabel}'; using '${declaredLabel}'`;
315
+ }
316
+ /**
317
+ * The organization get the shared name helpers ask, over the raw query
318
+ * controller, asked once per value for as long as the controller lives (one
319
+ * command): a manifest of many documents naming one organization makes one
320
+ * lookup, not two per document.
321
+ */
322
+ function organizationReader(controller) {
323
+ let gets = organizationGets.get(controller);
324
+ if (gets === undefined) {
325
+ gets = new Map();
326
+ organizationGets.set(controller, gets);
327
+ }
328
+ const memo = gets;
329
+ return {
330
+ organization: {
331
+ get: (value) => {
332
+ let got = memo.get(value);
333
+ if (got === undefined) {
334
+ got = controller(OrganizationQueryController).get({ value });
335
+ memo.set(value, got);
336
+ }
337
+ return got;
338
+ },
339
+ },
340
+ };
341
+ }
342
+ /** Each controller's organization gets, by the value asked. */
343
+ const organizationGets = new WeakMap();
344
+ function buildApplyResult(handler, applied, created) {
345
+ const meta = metaOf(applied);
346
+ const result = CommandResult.success(`${handler.displayName} ${created ? "created" : "updated"} successfully`);
347
+ const section = result.addSection("Resource Details");
348
+ if (meta?.id)
349
+ section.field("ID", meta.id);
350
+ if (meta?.name)
351
+ section.field("Name", meta.name);
352
+ if (meta?.slug)
353
+ section.field("Slug", meta.slug);
354
+ return result;
355
+ }
356
+ // The preview names the organization by slug, as other output does: the
357
+ // injected context organization is an id.
358
+ async function buildDryRunResult(controller, handler, message) {
359
+ const meta = metaOf(message);
360
+ const name = meta?.name ?? handler.displayName;
361
+ const result = CommandResult.success(`Dry run: ${name} is valid`);
362
+ const section = result.addSection(`${handler.displayName} Preview`);
363
+ if (meta?.name)
364
+ section.field("Name", meta.name);
365
+ if (meta?.slug)
366
+ section.field("Slug", meta.slug);
367
+ if (meta?.org)
368
+ section.field("Org", await organizationLabel(organizationReader(controller), meta.org));
369
+ return result;
370
+ }
371
+ //# sourceMappingURL=apply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/resources/apply/apply.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,sEAAsE;AACtE,8EAA8E;AAC9E,+EAA+E;AAC/E,4D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I,IAAI,EAAE,GAAG;QAAE,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACvG,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { DescMessage, DescService, Message } from "@bufbuild/protobuf";
2
+ import type { Client } from "@connectrpc/connect";
3
+ import type { ApiResourceReference, RenameInput, UpdateVisibilityInput } from "@stigmer/apis/ai/stigmer/commons/apiresource/io_pb";
4
+ import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
5
+ import type { UpdateOrganizationPoliciesInput } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/io_pb";
6
+ /** Accessor for a raw Connect client over a generated service controller. */
7
+ export type ControllerFn = <Desc extends DescService>(service: Desc) => Client<Desc>;
8
+ export interface ApplyHandler {
9
+ readonly kind: ApiResourceKind;
10
+ /** Human-facing name for messages, e.g. "MCP Server". */
11
+ readonly displayName: string;
12
+ /** Proto schema for strict YAML→proto marshalling. */
13
+ readonly schema: DescMessage;
14
+ /**
15
+ * Position in the dependency apply order (ascending) — referenced kinds
16
+ * apply before their dependents. Manifest kinds carry the SDK registry's
17
+ * value; the CLI extras slot around them (organization first, the
18
+ * session after every blueprint it can reference).
19
+ */
20
+ readonly applyOrder: number;
21
+ /** Drive the controller's `apply` RPC with the full resource message. */
22
+ apply(controller: ControllerFn, message: Message): Promise<Message>;
23
+ /**
24
+ * Drive the controller's `updateVisibility` RPC — the only door for
25
+ * visibility changes (plain updates preserve stored visibility, oss#573).
26
+ * Present exactly when the kind has the RPC; the apply core follows up
27
+ * through it when a manifest-declared level differs from the stored one.
28
+ * Manifest kinds inherit the binding from the SDK registry.
29
+ */
30
+ updateVisibility?(controller: ControllerFn, input: UpdateVisibilityInput): Promise<Message>;
31
+ /**
32
+ * Drive the controller's `rename` RPC, the only door for a slug change
33
+ * (an update ignores the slug). Present exactly when the kind has the
34
+ * RPC; the apply core follows up through it when a manifest that carries
35
+ * the resource's id declares a different slug than the stored one.
36
+ */
37
+ rename?(controller: ControllerFn, input: RenameInput): Promise<Message>;
38
+ /**
39
+ * Read the resource a reference names, as the caller: present on every
40
+ * kind with a rename, so a write the server refuses for naming a
41
+ * renamed-away slug can be answered with the slug it has now, when the
42
+ * caller may read it.
43
+ */
44
+ getByReference?(controller: ControllerFn, ref: ApiResourceReference): Promise<Message>;
45
+ /**
46
+ * Drive the organization's `updatePolicies` RPC, the only door for a
47
+ * policy change (update and apply keep the stored policies). Present only
48
+ * on the organization; the apply core follows up through it when a
49
+ * manifest declares policies that differ from the stored ones.
50
+ */
51
+ updatePolicies?(controller: ControllerFn, input: UpdateOrganizationPoliciesInput): Promise<Message>;
52
+ }
53
+ export declare const APPLY_HANDLERS: ReadonlyMap<ApiResourceKind, ApplyHandler>;
54
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/resources/apply/handlers.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACtB,MAAM,oDAAoD,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AAIpH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAC;AAG9G,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,SAAS,WAAW,EAAE,OAAO,EAAE,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;AAErF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,KAAK,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpE;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5F;;;;;OAKG;IACH,MAAM,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE;;;;;OAKG;IACH,cAAc,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvF;;;;;OAKG;IACH,cAAc,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,+BAA+B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrG;AAwBD,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,eAAe,EAAE,YAAY,CAGpE,CAAC"}
@@ -0,0 +1,56 @@
1
+ // Apply-handler registry for `apply -f` (file mode).
2
+ //
3
+ // The manifest kinds come from the SDK's manifest registry
4
+ // (`manifestKinds()` in @stigmer/client) — the one table binding a kind to its
5
+ // proto schema, its raw command-controller `apply` RPC, and its dependency
6
+ // apply order. The CLI consumes that table instead of keeping a copy: the
7
+ // copy this file used to carry drifted twice (ChannelApp was missing
8
+ // entirely — stigmer/stigmer#353 — and three kinds were absent from the
9
+ // local ordering map, so multi-document bundles applied on file-order luck).
10
+ //
11
+ // Both registries drive the *generated controllers* directly — not the
12
+ // high-level SDK `apply(input)` methods — because the SDK's `*Input`
13
+ // wrappers are lossy (they drop `metadata.id`, so an update would be
14
+ // misrouted as a create). The `apply` RPC takes the full resource message,
15
+ // preserving every field round-tripped from YAML.
16
+ //
17
+ // CLI_EXTRA_HANDLERS carries the kinds the CLI applies but the SDK's
18
+ // manifest engine deliberately does not treat as manifest kinds:
19
+ // Organization (not org-scoped — the bootstrap resource every other kind
20
+ // lives inside) and Session, a runtime kind rather than a blueprint.
21
+ // A kind added here must also declare Apply in the registry's verb matrix —
22
+ // the conformance test in registry/registry.test.ts enforces both
23
+ // directions, so an entry without a matrix line (or vice versa) fails CI.
24
+ import { SessionSchema } from "@stigmer/apis/ai/stigmer/agentic/session/v1/api_pb";
25
+ import { SessionCommandController } from "@stigmer/apis/ai/stigmer/agentic/session/v1/command_pb";
26
+ import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
27
+ import { OrganizationSchema } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/api_pb";
28
+ import { OrganizationCommandController } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/command_pb";
29
+ import { OrganizationQueryController } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/query_pb";
30
+ import { manifestKinds } from "@stigmer/client";
31
+ // The SDK registry's applyOrder values end at schedule = 12; the extras slot
32
+ // outside that range so a future SDK kind never collides with them.
33
+ const CLI_EXTRA_HANDLERS = [
34
+ {
35
+ kind: ApiResourceKind.organization,
36
+ displayName: "Organization",
37
+ schema: OrganizationSchema,
38
+ applyOrder: 0,
39
+ apply: (c, m) => c(OrganizationCommandController).apply(m),
40
+ rename: (c, i) => c(OrganizationCommandController).rename(i),
41
+ getByReference: (c, ref) => c(OrganizationQueryController).get({ value: ref.slug }),
42
+ updatePolicies: (c, i) => c(OrganizationCommandController).updatePolicies(i),
43
+ },
44
+ {
45
+ kind: ApiResourceKind.session,
46
+ displayName: "Session",
47
+ schema: SessionSchema,
48
+ applyOrder: 14,
49
+ apply: (c, m) => c(SessionCommandController).apply(m),
50
+ },
51
+ ];
52
+ export const APPLY_HANDLERS = new Map([
53
+ ...manifestKinds().map((handler) => [handler.kind, handler]),
54
+ ...CLI_EXTRA_HANDLERS.map((handler) => [handler.kind, handler]),
55
+ ]);
56
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/resources/apply/handlers.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,2DAA2D;AAC3D,+EAA+E;AAC/E,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,wEAAwE;AACxE,6EAA6E;AAC7E,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,qEAAqE;AACrE,2EAA2E;AAC3E,kDAAkD;AAClD,EAAE;AACF,qEAAqE;AACrE,iEAAiE;AACjE,yEAAyE;AACzE,qEAAqE;AACrE,4EAA4E;AAC5E,kEAAkE;AAClE,0EAA0E;AAS1E,OAAO,EAAgB,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AACpH,OAAO,EAAqB,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAChH,OAAO,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAC5G,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AAExG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAmDhD,6EAA6E;AAC7E,oEAAoE;AACpE,MAAM,kBAAkB,GAA4B;IAClD;QACE,IAAI,EAAE,eAAe,CAAC,YAAY;QAClC,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,kBAAkB;QAC1B,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,KAAK,CAAC,CAAiB,CAAC;QAC1E,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5D,cAAc,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;QACnF,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;KAC7E;IACD;QACE,IAAI,EAAE,eAAe,CAAC,OAAO;QAC7B,WAAW,EAAE,SAAS;QACtB,MAAM,EAAE,aAAa;QACrB,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,KAAK,CAAC,CAAY,CAAC;KACjE;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAA+C,IAAI,GAAG,CAAgC;IAC/G,GAAG,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAU,CAAC;IACrE,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAU,CAAC;CACzE,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { type Stigmer } from "@stigmer/client";
2
+ import { CommandResult } from "../output/index.js";
3
+ /** Who can chat over the link. Mirrors the SDK's SharingAudience. */
4
+ export type LinkAudience = "public" | "org";
5
+ /** Inputs for {@link linkAgent} beyond the reference itself. */
6
+ export interface LinkAgentOptions {
7
+ /** Desired link state: `true` to turn it on, `false` to turn it off. */
8
+ readonly enabled: boolean;
9
+ /**
10
+ * Desired audience. Omitted means "keep the link's current audience" —
11
+ * a plain toggle must never flip an org-members-only link back to
12
+ * public (or vice versa).
13
+ */
14
+ readonly audience?: LinkAudience;
15
+ /**
16
+ * Rotate the link token: the server generates a fresh `?k=` secret and
17
+ * the current link (tokened or plain) stops working immediately. The
18
+ * token is server-owned status — never part of the spec this module
19
+ * merges.
20
+ */
21
+ readonly resetLink?: boolean;
22
+ /** The app origin serving the hosted chat page and `embed.js`. */
23
+ readonly appOrigin: string;
24
+ /**
25
+ * Whether the CLI points at a local backend. Guest chat (the token mint
26
+ * behind the hosted page) is a Stigmer Cloud capability, so a local link
27
+ * gets a "won't serve visitors" warning alongside the result.
28
+ */
29
+ readonly isLocal: boolean;
30
+ /**
31
+ * The chat link's slug (`--name`): which web channel of the agent to
32
+ * edit, and the slug a new one is created under. Omitted means the
33
+ * agent's canonical link, created as `<agent slug>-web`.
34
+ */
35
+ readonly name?: string;
36
+ }
37
+ /**
38
+ * Turn the referenced agent's chat link on or off and describe the
39
+ * outcome. Idempotent: when the link is already in the desired state, no
40
+ * write is issued (the link is still reported when it is on). When the
41
+ * agent has no link yet, turning it on creates one.
42
+ */
43
+ export declare function linkAgent(client: Stigmer, ref: string, org: string, options: LinkAgentOptions): Promise<CommandResult>;
44
+ /**
45
+ * Turn the referenced channel (a `chn_…` id, `org/slug`, or bare slug
46
+ * against `org`) on or off, whatever its type, and describe the outcome.
47
+ * The write is the masked update of `spec.enabled` alone; a channel
48
+ * already in the state is reported without a write. Disabling pauses the
49
+ * channel: its configuration, credentials and install stay as stored.
50
+ */
51
+ export declare function setChannelEnabled(client: Stigmer, ref: string, org: string, enabled: boolean): Promise<CommandResult>;
52
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/resources/channel.ts"],"names":[],"mappings":"AAyCA,OAAO,EAOL,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMnD,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5C,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAKD;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAuGxB;AAmRD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,CAsCxB"}