narai-primitives 2.1.3 → 2.3.0

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 (392) hide show
  1. package/README.md +20 -4
  2. package/dist/config/load.d.ts.map +1 -1
  3. package/dist/config/load.js +12 -1
  4. package/dist/config/load.js.map +1 -1
  5. package/dist/connectors/confluence/index.d.ts +3 -1
  6. package/dist/connectors/confluence/index.d.ts.map +1 -1
  7. package/dist/connectors/confluence/index.js +246 -31
  8. package/dist/connectors/confluence/index.js.map +1 -1
  9. package/dist/connectors/confluence/lib/confluence_client.d.ts +50 -30
  10. package/dist/connectors/confluence/lib/confluence_client.d.ts.map +1 -1
  11. package/dist/connectors/confluence/lib/confluence_client.js +69 -225
  12. package/dist/connectors/confluence/lib/confluence_client.js.map +1 -1
  13. package/dist/connectors/db/connector.d.ts.map +1 -1
  14. package/dist/connectors/db/connector.js +12 -6
  15. package/dist/connectors/db/connector.js.map +1 -1
  16. package/dist/connectors/db/dispatcher.d.ts +3 -2
  17. package/dist/connectors/db/dispatcher.d.ts.map +1 -1
  18. package/dist/connectors/db/dispatcher.js +142 -40
  19. package/dist/connectors/db/dispatcher.js.map +1 -1
  20. package/dist/connectors/db/index.d.ts +9 -0
  21. package/dist/connectors/db/index.d.ts.map +1 -1
  22. package/dist/connectors/db/index.js +9 -0
  23. package/dist/connectors/db/index.js.map +1 -1
  24. package/dist/connectors/db/lib/audit.d.ts.map +1 -1
  25. package/dist/connectors/db/lib/audit.js +46 -4
  26. package/dist/connectors/db/lib/audit.js.map +1 -1
  27. package/dist/connectors/db/lib/drivers/dynamodb.d.ts.map +1 -1
  28. package/dist/connectors/db/lib/drivers/dynamodb.js +24 -4
  29. package/dist/connectors/db/lib/drivers/dynamodb.js.map +1 -1
  30. package/dist/connectors/db/lib/drivers/mysql.js +1 -1
  31. package/dist/connectors/db/lib/drivers/mysql.js.map +1 -1
  32. package/dist/connectors/db/lib/drivers/postgresql.js +1 -1
  33. package/dist/connectors/db/lib/drivers/postgresql.js.map +1 -1
  34. package/dist/connectors/db/lib/drivers/sqlite.d.ts.map +1 -1
  35. package/dist/connectors/db/lib/drivers/sqlite.js +9 -5
  36. package/dist/connectors/db/lib/drivers/sqlite.js.map +1 -1
  37. package/dist/connectors/db/lib/drivers/sqlserver.d.ts.map +1 -1
  38. package/dist/connectors/db/lib/drivers/sqlserver.js +66 -32
  39. package/dist/connectors/db/lib/drivers/sqlserver.js.map +1 -1
  40. package/dist/connectors/db/lib/environments.d.ts +16 -0
  41. package/dist/connectors/db/lib/environments.d.ts.map +1 -1
  42. package/dist/connectors/db/lib/environments.js +16 -0
  43. package/dist/connectors/db/lib/environments.js.map +1 -1
  44. package/dist/connectors/db/lib/grant-store.d.ts +77 -0
  45. package/dist/connectors/db/lib/grant-store.d.ts.map +1 -0
  46. package/dist/connectors/db/lib/grant-store.js +158 -0
  47. package/dist/connectors/db/lib/grant-store.js.map +1 -0
  48. package/dist/connectors/db/lib/plugin_config.d.ts +2 -0
  49. package/dist/connectors/db/lib/plugin_config.d.ts.map +1 -1
  50. package/dist/connectors/db/lib/plugin_config.js +23 -2
  51. package/dist/connectors/db/lib/plugin_config.js.map +1 -1
  52. package/dist/connectors/db/lib/policy.d.ts +50 -14
  53. package/dist/connectors/db/lib/policy.d.ts.map +1 -1
  54. package/dist/connectors/db/lib/policy.js +298 -74
  55. package/dist/connectors/db/lib/policy.js.map +1 -1
  56. package/dist/connectors/github/actions/_fields.d.ts +18 -0
  57. package/dist/connectors/github/actions/_fields.d.ts.map +1 -0
  58. package/dist/connectors/github/actions/_fields.js +29 -0
  59. package/dist/connectors/github/actions/_fields.js.map +1 -0
  60. package/dist/connectors/github/actions/_pagination.d.ts +12 -0
  61. package/dist/connectors/github/actions/_pagination.d.ts.map +1 -0
  62. package/dist/connectors/github/actions/_pagination.js +26 -0
  63. package/dist/connectors/github/actions/_pagination.js.map +1 -0
  64. package/dist/connectors/github/actions/_types.d.ts +14 -0
  65. package/dist/connectors/github/actions/_types.d.ts.map +1 -0
  66. package/dist/connectors/github/actions/_types.js +2 -0
  67. package/dist/connectors/github/actions/_types.js.map +1 -0
  68. package/dist/connectors/github/actions/comments.d.ts +3 -0
  69. package/dist/connectors/github/actions/comments.d.ts.map +1 -0
  70. package/dist/connectors/github/actions/comments.js +166 -0
  71. package/dist/connectors/github/actions/comments.js.map +1 -0
  72. package/dist/connectors/github/actions/issues.d.ts +3 -0
  73. package/dist/connectors/github/actions/issues.d.ts.map +1 -0
  74. package/dist/connectors/github/actions/issues.js +129 -0
  75. package/dist/connectors/github/actions/issues.js.map +1 -0
  76. package/dist/connectors/github/actions/pulls.d.ts +3 -0
  77. package/dist/connectors/github/actions/pulls.d.ts.map +1 -0
  78. package/dist/connectors/github/actions/pulls.js +182 -0
  79. package/dist/connectors/github/actions/pulls.js.map +1 -0
  80. package/dist/connectors/github/actions/reads.d.ts +3 -0
  81. package/dist/connectors/github/actions/reads.d.ts.map +1 -0
  82. package/dist/connectors/github/actions/reads.js +349 -0
  83. package/dist/connectors/github/actions/reads.js.map +1 -0
  84. package/dist/connectors/github/actions/releases.d.ts +3 -0
  85. package/dist/connectors/github/actions/releases.d.ts.map +1 -0
  86. package/dist/connectors/github/actions/releases.js +124 -0
  87. package/dist/connectors/github/actions/releases.js.map +1 -0
  88. package/dist/connectors/github/actions/workflows.d.ts +3 -0
  89. package/dist/connectors/github/actions/workflows.d.ts.map +1 -0
  90. package/dist/connectors/github/actions/workflows.js +224 -0
  91. package/dist/connectors/github/actions/workflows.js.map +1 -0
  92. package/dist/connectors/github/index.d.ts +13 -1
  93. package/dist/connectors/github/index.d.ts.map +1 -1
  94. package/dist/connectors/github/index.js +33 -396
  95. package/dist/connectors/github/index.js.map +1 -1
  96. package/dist/connectors/github/lib/github_client.d.ts +242 -29
  97. package/dist/connectors/github/lib/github_client.d.ts.map +1 -1
  98. package/dist/connectors/github/lib/github_client.js +202 -256
  99. package/dist/connectors/github/lib/github_client.js.map +1 -1
  100. package/dist/connectors/github/lib/github_config.d.ts +10 -0
  101. package/dist/connectors/github/lib/github_config.d.ts.map +1 -0
  102. package/dist/connectors/github/lib/github_config.js +79 -0
  103. package/dist/connectors/github/lib/github_config.js.map +1 -0
  104. package/dist/connectors/gitlab/actions/_fields.d.ts +20 -0
  105. package/dist/connectors/gitlab/actions/_fields.d.ts.map +1 -0
  106. package/dist/connectors/gitlab/actions/_fields.js +44 -0
  107. package/dist/connectors/gitlab/actions/_fields.js.map +1 -0
  108. package/dist/connectors/gitlab/actions/_pagination.d.ts +19 -0
  109. package/dist/connectors/gitlab/actions/_pagination.d.ts.map +1 -0
  110. package/dist/connectors/gitlab/actions/_pagination.js +33 -0
  111. package/dist/connectors/gitlab/actions/_pagination.js.map +1 -0
  112. package/dist/connectors/gitlab/actions/_types.d.ts +12 -0
  113. package/dist/connectors/gitlab/actions/_types.d.ts.map +1 -0
  114. package/dist/connectors/gitlab/actions/_types.js +2 -0
  115. package/dist/connectors/gitlab/actions/_types.js.map +1 -0
  116. package/dist/connectors/gitlab/actions/issues.d.ts +3 -0
  117. package/dist/connectors/gitlab/actions/issues.d.ts.map +1 -0
  118. package/dist/connectors/gitlab/actions/issues.js +119 -0
  119. package/dist/connectors/gitlab/actions/issues.js.map +1 -0
  120. package/dist/connectors/gitlab/actions/merges.d.ts +3 -0
  121. package/dist/connectors/gitlab/actions/merges.d.ts.map +1 -0
  122. package/dist/connectors/gitlab/actions/merges.js +198 -0
  123. package/dist/connectors/gitlab/actions/merges.js.map +1 -0
  124. package/dist/connectors/gitlab/actions/notes.d.ts +3 -0
  125. package/dist/connectors/gitlab/actions/notes.d.ts.map +1 -0
  126. package/dist/connectors/gitlab/actions/notes.js +145 -0
  127. package/dist/connectors/gitlab/actions/notes.js.map +1 -0
  128. package/dist/connectors/gitlab/actions/pipelines.d.ts +3 -0
  129. package/dist/connectors/gitlab/actions/pipelines.d.ts.map +1 -0
  130. package/dist/connectors/gitlab/actions/pipelines.js +136 -0
  131. package/dist/connectors/gitlab/actions/pipelines.js.map +1 -0
  132. package/dist/connectors/gitlab/actions/reads.d.ts +3 -0
  133. package/dist/connectors/gitlab/actions/reads.d.ts.map +1 -0
  134. package/dist/connectors/gitlab/actions/reads.js +422 -0
  135. package/dist/connectors/gitlab/actions/reads.js.map +1 -0
  136. package/dist/connectors/gitlab/actions/releases.d.ts +3 -0
  137. package/dist/connectors/gitlab/actions/releases.d.ts.map +1 -0
  138. package/dist/connectors/gitlab/actions/releases.js +99 -0
  139. package/dist/connectors/gitlab/actions/releases.js.map +1 -0
  140. package/dist/connectors/gitlab/cli.d.ts +3 -0
  141. package/dist/connectors/gitlab/cli.d.ts.map +1 -0
  142. package/dist/connectors/gitlab/cli.js +24 -0
  143. package/dist/connectors/gitlab/cli.js.map +1 -0
  144. package/dist/connectors/gitlab/index.d.ts +29 -0
  145. package/dist/connectors/gitlab/index.d.ts.map +1 -0
  146. package/dist/connectors/gitlab/index.js +95 -0
  147. package/dist/connectors/gitlab/index.js.map +1 -0
  148. package/dist/connectors/gitlab/lib/gitlab_client.d.ts +306 -0
  149. package/dist/connectors/gitlab/lib/gitlab_client.d.ts.map +1 -0
  150. package/dist/connectors/gitlab/lib/gitlab_client.js +249 -0
  151. package/dist/connectors/gitlab/lib/gitlab_client.js.map +1 -0
  152. package/dist/connectors/gitlab/lib/gitlab_config.d.ts +11 -0
  153. package/dist/connectors/gitlab/lib/gitlab_config.d.ts.map +1 -0
  154. package/dist/connectors/gitlab/lib/gitlab_config.js +115 -0
  155. package/dist/connectors/gitlab/lib/gitlab_config.js.map +1 -0
  156. package/dist/connectors/jira/index.d.ts +3 -1
  157. package/dist/connectors/jira/index.d.ts.map +1 -1
  158. package/dist/connectors/jira/index.js +299 -41
  159. package/dist/connectors/jira/index.js.map +1 -1
  160. package/dist/connectors/jira/lib/jira_client.d.ts +56 -41
  161. package/dist/connectors/jira/lib/jira_client.d.ts.map +1 -1
  162. package/dist/connectors/jira/lib/jira_client.js +71 -248
  163. package/dist/connectors/jira/lib/jira_client.js.map +1 -1
  164. package/dist/connectors/linear/cli.d.ts +3 -0
  165. package/dist/connectors/linear/cli.d.ts.map +1 -0
  166. package/dist/connectors/linear/cli.js +22 -0
  167. package/dist/connectors/linear/cli.js.map +1 -0
  168. package/dist/connectors/linear/index.d.ts +27 -0
  169. package/dist/connectors/linear/index.d.ts.map +1 -0
  170. package/dist/connectors/linear/index.js +496 -0
  171. package/dist/connectors/linear/index.js.map +1 -0
  172. package/dist/connectors/linear/lib/linear_client.d.ts +249 -0
  173. package/dist/connectors/linear/lib/linear_client.d.ts.map +1 -0
  174. package/dist/connectors/linear/lib/linear_client.js +154 -0
  175. package/dist/connectors/linear/lib/linear_client.js.map +1 -0
  176. package/dist/connectors/linear/lib/queries.d.ts +15 -0
  177. package/dist/connectors/linear/lib/queries.d.ts.map +1 -0
  178. package/dist/connectors/linear/lib/queries.js +188 -0
  179. package/dist/connectors/linear/lib/queries.js.map +1 -0
  180. package/dist/connectors/notion/index.d.ts +2 -1
  181. package/dist/connectors/notion/index.d.ts.map +1 -1
  182. package/dist/connectors/notion/index.js +213 -28
  183. package/dist/connectors/notion/index.js.map +1 -1
  184. package/dist/connectors/notion/lib/markdown_to_blocks.d.ts +21 -0
  185. package/dist/connectors/notion/lib/markdown_to_blocks.d.ts.map +1 -0
  186. package/dist/connectors/notion/lib/markdown_to_blocks.js +102 -0
  187. package/dist/connectors/notion/lib/markdown_to_blocks.js.map +1 -0
  188. package/dist/connectors/notion/lib/notion_blocks.d.ts +34 -0
  189. package/dist/connectors/notion/lib/notion_blocks.d.ts.map +1 -0
  190. package/dist/connectors/notion/lib/notion_blocks.js +87 -0
  191. package/dist/connectors/notion/lib/notion_blocks.js.map +1 -0
  192. package/dist/connectors/notion/lib/notion_client.d.ts +35 -25
  193. package/dist/connectors/notion/lib/notion_client.d.ts.map +1 -1
  194. package/dist/connectors/notion/lib/notion_client.js +63 -185
  195. package/dist/connectors/notion/lib/notion_client.js.map +1 -1
  196. package/dist/hub/index.d.ts.map +1 -1
  197. package/dist/hub/index.js +23 -3
  198. package/dist/hub/index.js.map +1 -1
  199. package/dist/toolkit/agent_resolver.d.ts +14 -4
  200. package/dist/toolkit/agent_resolver.d.ts.map +1 -1
  201. package/dist/toolkit/agent_resolver.js +38 -6
  202. package/dist/toolkit/agent_resolver.js.map +1 -1
  203. package/dist/toolkit/atlassian/adf_validator.d.ts +45 -0
  204. package/dist/toolkit/atlassian/adf_validator.d.ts.map +1 -0
  205. package/dist/toolkit/atlassian/adf_validator.js +83 -0
  206. package/dist/toolkit/atlassian/adf_validator.js.map +1 -0
  207. package/dist/toolkit/atlassian/index.d.ts +5 -0
  208. package/dist/toolkit/atlassian/index.d.ts.map +1 -0
  209. package/dist/toolkit/atlassian/index.js +5 -0
  210. package/dist/toolkit/atlassian/index.js.map +1 -0
  211. package/dist/toolkit/audit/writer.d.ts.map +1 -1
  212. package/dist/toolkit/audit/writer.js +45 -5
  213. package/dist/toolkit/audit/writer.js.map +1 -1
  214. package/dist/toolkit/connector_error.d.ts +12 -0
  215. package/dist/toolkit/connector_error.d.ts.map +1 -0
  216. package/dist/toolkit/connector_error.js +18 -0
  217. package/dist/toolkit/connector_error.js.map +1 -0
  218. package/dist/toolkit/guardrail.d.ts +12 -2
  219. package/dist/toolkit/guardrail.d.ts.map +1 -1
  220. package/dist/toolkit/guardrail.js +17 -3
  221. package/dist/toolkit/guardrail.js.map +1 -1
  222. package/dist/toolkit/http_client.d.ts +134 -0
  223. package/dist/toolkit/http_client.d.ts.map +1 -0
  224. package/dist/toolkit/http_client.js +385 -0
  225. package/dist/toolkit/http_client.js.map +1 -0
  226. package/dist/toolkit/index.d.ts +3 -0
  227. package/dist/toolkit/index.d.ts.map +1 -1
  228. package/dist/toolkit/index.js +5 -0
  229. package/dist/toolkit/index.js.map +1 -1
  230. package/dist/toolkit/usage/aggregate.d.ts.map +1 -1
  231. package/dist/toolkit/usage/aggregate.js +19 -3
  232. package/dist/toolkit/usage/aggregate.js.map +1 -1
  233. package/package.json +14 -2
  234. package/plugin-hooks/dispatcher.mjs +639 -0
  235. package/plugin-hooks/plugin-config.mjs +36 -0
  236. package/plugins/{aws-agent → aws-connector}/.claude-plugin/plugin.json +1 -1
  237. package/plugins/{aws-agent → aws-connector}/README.md +7 -7
  238. package/plugins/{aws-agent/bin/aws-agent → aws-connector/bin/aws-connector} +3 -3
  239. package/plugins/aws-connector/commands/aws-connector.md +6 -0
  240. package/plugins/{gcp-agent → aws-connector}/hooks/hooks.json +12 -11
  241. package/plugins/aws-connector/package.json +9 -0
  242. package/plugins/aws-connector/plugin-config.json +4 -0
  243. package/plugins/{aws-agent/skills/aws-agent → aws-connector/skills/aws-connector}/SKILL.md +5 -5
  244. package/plugins/confluence-connector/.claude-plugin/plugin.json +6 -0
  245. package/plugins/{confluence-agent → confluence-connector}/README.md +2 -2
  246. package/plugins/confluence-connector/bin/confluence-connector +17 -0
  247. package/plugins/confluence-connector/commands/confluence-connector.md +6 -0
  248. package/plugins/{jira-agent → confluence-connector}/hooks/hooks.json +12 -11
  249. package/plugins/confluence-connector/package.json +8 -0
  250. package/plugins/confluence-connector/plugin-config.json +4 -0
  251. package/plugins/confluence-connector/skills/confluence-connector/SKILL.md +146 -0
  252. package/plugins/{create-connector → connector-creator}/.claude-plugin/plugin.json +1 -1
  253. package/plugins/{create-connector → connector-creator}/README.md +2 -2
  254. package/plugins/connector-creator/skills/connector-creator/SKILL.md +412 -0
  255. package/plugins/connector-creator/skills/connector-creator/assets/templates/_runtime/connector-gate.mjs.tmpl +120 -0
  256. package/plugins/connector-creator/skills/connector-creator/assets/templates/composite/SKILL.md.tmpl +26 -0
  257. package/plugins/connector-creator/skills/connector-creator/assets/templates/composite/bin.tmpl +2 -0
  258. package/plugins/connector-creator/skills/connector-creator/assets/templates/composite/index.mjs.tmpl +35 -0
  259. package/plugins/connector-creator/skills/connector-creator/assets/templates/knowledge/SKILL.md.tmpl +23 -0
  260. package/plugins/connector-creator/skills/connector-creator/assets/templates/shell-gate/SKILL.md.tmpl +27 -0
  261. package/plugins/connector-creator/skills/connector-creator/assets/templates/shell-gate/gates.json.tmpl +5 -0
  262. package/plugins/connector-creator/skills/connector-creator/lib/connector-registry.mjs +43 -0
  263. package/plugins/connector-creator/skills/connector-creator/lib/settings-wiring.mjs +71 -0
  264. package/plugins/connector-creator/skills/connector-creator/references/connector-contract.md +79 -0
  265. package/plugins/connector-creator/skills/connector-creator/references/flavor-authoring.md +58 -0
  266. package/plugins/connector-creator/skills/connector-creator/references/research-patterns.md +51 -0
  267. package/plugins/{db-agent → db-connector}/.claude-plugin/plugin.json +3 -3
  268. package/plugins/{db-agent → db-connector}/README.md +2 -2
  269. package/plugins/{github-agent/bin/github-agent → db-connector/bin/db-connector} +3 -3
  270. package/plugins/db-connector/commands/db-connector.md +6 -0
  271. package/plugins/db-connector/gates.json +45 -0
  272. package/plugins/db-connector/gates.strict-bare.json +13 -0
  273. package/plugins/{db-agent → db-connector}/hooks/guardrails.json +4 -2
  274. package/plugins/{aws-agent → db-connector}/hooks/hooks.json +15 -11
  275. package/plugins/{db-agent → db-connector}/package.json +1 -1
  276. package/plugins/db-connector/plugin-config.json +5 -0
  277. package/plugins/{db-agent/skills/db-agent → db-connector/skills/db-connector}/SKILL.md +5 -5
  278. package/plugins/{gcp-agent → gcp-connector}/.claude-plugin/plugin.json +1 -1
  279. package/plugins/{gcp-agent → gcp-connector}/README.md +5 -5
  280. package/plugins/{gcp-agent/bin/gcp-agent → gcp-connector/bin/gcp-connector} +3 -3
  281. package/plugins/gcp-connector/commands/gcp-connector.md +6 -0
  282. package/plugins/{github-agent → gcp-connector}/hooks/hooks.json +12 -11
  283. package/plugins/gcp-connector/package.json +9 -0
  284. package/plugins/gcp-connector/plugin-config.json +4 -0
  285. package/plugins/{gcp-agent/skills/gcp-agent → gcp-connector/skills/gcp-connector}/SKILL.md +5 -5
  286. package/plugins/git-connector/.claude-plugin/plugin.json +6 -0
  287. package/plugins/git-connector/CONTRIBUTING.md +117 -0
  288. package/plugins/git-connector/README.md +94 -0
  289. package/plugins/git-connector/SECURITY.md +143 -0
  290. package/plugins/git-connector/gates.json +67 -0
  291. package/plugins/git-connector/hooks/hooks.json +25 -0
  292. package/plugins/git-connector/package.json +9 -0
  293. package/plugins/git-connector/plugin-config.json +4 -0
  294. package/plugins/{github-agent → github-connector}/.claude-plugin/plugin.json +1 -1
  295. package/plugins/github-connector/README.md +48 -0
  296. package/plugins/{confluence-agent/bin/confluence-agent → github-connector/bin/github-connector} +3 -3
  297. package/plugins/github-connector/commands/github-connector.md +6 -0
  298. package/plugins/github-connector/hooks/hooks.json +50 -0
  299. package/plugins/{jira-agent → github-connector}/package.json +1 -1
  300. package/plugins/github-connector/plugin-config.json +4 -0
  301. package/plugins/github-connector/skills/github-connector/SKILL.md +106 -0
  302. package/plugins/gitlab-connector/.claude-plugin/plugin.json +6 -0
  303. package/plugins/gitlab-connector/README.md +62 -0
  304. package/plugins/{db-agent/bin/db-agent → gitlab-connector/bin/gitlab-connector} +3 -3
  305. package/plugins/gitlab-connector/commands/gitlab-connector.md +6 -0
  306. package/plugins/gitlab-connector/gates.json +18 -0
  307. package/plugins/gitlab-connector/hooks/hooks.json +50 -0
  308. package/plugins/{confluence-agent → gitlab-connector}/package.json +1 -1
  309. package/plugins/gitlab-connector/plugin-config.json +4 -0
  310. package/plugins/gitlab-connector/skills/gitlab-connector/SKILL.md +115 -0
  311. package/plugins/jira-connector/.claude-plugin/plugin.json +6 -0
  312. package/plugins/{jira-agent → jira-connector}/README.md +1 -1
  313. package/plugins/{jira-agent/bin/jira-agent → jira-connector/bin/jira-connector} +2 -2
  314. package/plugins/jira-connector/commands/jira-connector.md +6 -0
  315. package/plugins/jira-connector/gates.json +12 -0
  316. package/plugins/jira-connector/hooks/hooks.json +50 -0
  317. package/plugins/{github-agent → jira-connector}/package.json +1 -1
  318. package/plugins/jira-connector/plugin-config.json +4 -0
  319. package/plugins/jira-connector/skills/jira-connector/SKILL.md +146 -0
  320. package/plugins/linear-connector/.claude-plugin/plugin.json +6 -0
  321. package/plugins/linear-connector/README.md +29 -0
  322. package/plugins/linear-connector/bin/linear-connector +17 -0
  323. package/plugins/linear-connector/commands/linear-connector.md +6 -0
  324. package/plugins/linear-connector/hooks/hooks.json +50 -0
  325. package/plugins/linear-connector/package.json +8 -0
  326. package/plugins/linear-connector/plugin-config.json +4 -0
  327. package/plugins/linear-connector/skills/linear-connector/SKILL.md +159 -0
  328. package/plugins/notion-connector/.claude-plugin/plugin.json +6 -0
  329. package/plugins/{notion-agent → notion-connector}/README.md +5 -5
  330. package/plugins/{notion-agent/bin/notion-agent → notion-connector/bin/notion-connector} +2 -2
  331. package/plugins/notion-connector/commands/notion-connector.md +6 -0
  332. package/plugins/notion-connector/hooks/hooks.json +50 -0
  333. package/plugins/notion-connector/package.json +8 -0
  334. package/plugins/notion-connector/plugin-config.json +4 -0
  335. package/plugins/notion-connector/skills/notion-connector/SKILL.md +141 -0
  336. package/dist/connectors/confluence/lib/confluence_error.d.ts +0 -13
  337. package/dist/connectors/confluence/lib/confluence_error.d.ts.map +0 -1
  338. package/dist/connectors/confluence/lib/confluence_error.js +0 -19
  339. package/dist/connectors/confluence/lib/confluence_error.js.map +0 -1
  340. package/dist/connectors/github/lib/github_error.d.ts +0 -11
  341. package/dist/connectors/github/lib/github_error.d.ts.map +0 -1
  342. package/dist/connectors/github/lib/github_error.js +0 -17
  343. package/dist/connectors/github/lib/github_error.js.map +0 -1
  344. package/dist/connectors/jira/lib/jira_error.d.ts +0 -11
  345. package/dist/connectors/jira/lib/jira_error.d.ts.map +0 -1
  346. package/dist/connectors/jira/lib/jira_error.js +0 -17
  347. package/dist/connectors/jira/lib/jira_error.js.map +0 -1
  348. package/dist/connectors/notion/lib/notion_error.d.ts +0 -12
  349. package/dist/connectors/notion/lib/notion_error.d.ts.map +0 -1
  350. package/dist/connectors/notion/lib/notion_error.js +0 -18
  351. package/dist/connectors/notion/lib/notion_error.js.map +0 -1
  352. package/plugins/aws-agent/commands/aws-agent.md +0 -6
  353. package/plugins/aws-agent/hooks/reminder.mjs +0 -16
  354. package/plugins/aws-agent/package.json +0 -9
  355. package/plugins/confluence-agent/.claude-plugin/plugin.json +0 -6
  356. package/plugins/confluence-agent/commands/confluence-agent.md +0 -6
  357. package/plugins/confluence-agent/hooks/hooks.json +0 -49
  358. package/plugins/confluence-agent/hooks/reminder.mjs +0 -25
  359. package/plugins/confluence-agent/skills/confluence-agent/SKILL.md +0 -40
  360. package/plugins/create-connector/skills/create-connector/SKILL.md +0 -252
  361. package/plugins/db-agent/commands/db-agent.md +0 -6
  362. package/plugins/db-agent/hooks/db-guard.mjs +0 -110
  363. package/plugins/db-agent/hooks/hooks.json +0 -61
  364. package/plugins/db-agent/hooks/reminder.mjs +0 -16
  365. package/plugins/gcp-agent/commands/gcp-agent.md +0 -6
  366. package/plugins/gcp-agent/hooks/reminder.mjs +0 -16
  367. package/plugins/gcp-agent/package.json +0 -9
  368. package/plugins/github-agent/README.md +0 -13
  369. package/plugins/github-agent/commands/github-agent.md +0 -6
  370. package/plugins/github-agent/hooks/reminder.mjs +0 -16
  371. package/plugins/github-agent/skills/github-agent/SKILL.md +0 -41
  372. package/plugins/jira-agent/.claude-plugin/plugin.json +0 -6
  373. package/plugins/jira-agent/commands/jira-agent.md +0 -6
  374. package/plugins/jira-agent/hooks/reminder.mjs +0 -16
  375. package/plugins/jira-agent/skills/jira-agent/SKILL.md +0 -37
  376. package/plugins/notion-agent/.claude-plugin/plugin.json +0 -6
  377. package/plugins/notion-agent/commands/notion-agent.md +0 -6
  378. package/plugins/notion-agent/hooks/hooks.json +0 -49
  379. package/plugins/notion-agent/hooks/reminder.mjs +0 -17
  380. package/plugins/notion-agent/package.json +0 -8
  381. package/plugins/notion-agent/skills/notion-agent/SKILL.md +0 -48
  382. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/bin.tmpl +0 -0
  383. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/connector-SKILL.md.tmpl +0 -0
  384. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/index.mjs.tmpl +0 -0
  385. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/tests-example.mjs.tmpl +0 -0
  386. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/action-design.md +0 -0
  387. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/auth-patterns.md +0 -0
  388. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/connector-anatomy.md +0 -0
  389. /package/plugins/{create-connector/skills/create-connector/references/db-agent-pointer.md → connector-creator/skills/connector-creator/references/db-connector-pointer.md} +0 -0
  390. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/plugin-layer.md +0 -0
  391. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/template-sync.md +0 -0
  392. /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/verification.md +0 -0
@@ -0,0 +1,496 @@
1
+ /**
2
+ * @narai/linear-agent-connector — read + write Linear connector.
3
+ *
4
+ * Built on @narai/connector-toolkit. The default export is a ready-to-use
5
+ * `Connector` instance; `buildLinearConnector(overrides?)` is exposed
6
+ * for tests that want to inject a fake Linear client.
7
+ *
8
+ * Linear specifics:
9
+ * - GraphQL only (single endpoint: https://api.linear.app/graphql)
10
+ * - Auth: `Authorization: <api_key>` (no Bearer — Linear-specific)
11
+ * - Native markdown for issue descriptions and comments — no ADF
12
+ * - No native attachment hosting; `attachment_link` creates URL pointers
13
+ */
14
+ import { ConnectorError, createConnector, fetchAttachment, mapHttpError, sanitizeLabel, throwIfHttpError, } from "narai-primitives/toolkit";
15
+ import { z } from "zod";
16
+ import { LinearClient, loadLinearCredentials, } from "./lib/linear_client.js";
17
+ // ───────────────────────────────────────────────────────────────────────────
18
+ // Param schemas
19
+ // ───────────────────────────────────────────────────────────────────────────
20
+ // Matches both `ENG-123` identifiers and UUIDs (32+ hex chars with optional dashes)
21
+ const issueIdOrIdentifierSchema = z
22
+ .string()
23
+ .min(1)
24
+ .regex(/^([A-Z][A-Z0-9]+-\d+|[0-9a-fA-F-]{32,})$/, "Expected an identifier like ENG-123 or a Linear UUID");
25
+ const issueUuidSchema = z
26
+ .string()
27
+ .regex(/^[0-9a-fA-F-]{32,}$/, "Invalid Linear UUID");
28
+ const teamKeySchema = z
29
+ .string()
30
+ .regex(/^[A-Z][A-Z0-9]+$/, "Invalid team_key — uppercase alphanumeric");
31
+ const getIssueParams = z.object({ id: issueIdOrIdentifierSchema });
32
+ const searchIssuesParams = z.object({
33
+ team_key: teamKeySchema.optional(),
34
+ state: z.string().optional(),
35
+ assignee_email: z.string().email().optional(),
36
+ text: z.string().optional(),
37
+ max_results: z.number().int().positive().default(50),
38
+ });
39
+ const getProjectParams = z.object({ id: issueUuidSchema });
40
+ const getTeamParams = z.object({ key_or_id: z.string().min(1) });
41
+ const getCommentsParams = z.object({
42
+ issue_id: issueIdOrIdentifierSchema,
43
+ max_results: z.number().int().positive().default(50),
44
+ });
45
+ const listAttachmentsParams = z.object({ issue_id: issueIdOrIdentifierSchema });
46
+ const getAttachmentParams = z.object({
47
+ issue_id: issueIdOrIdentifierSchema,
48
+ attachment_id: issueUuidSchema,
49
+ });
50
+ const createIssueParams = z.object({
51
+ team_id: issueUuidSchema,
52
+ title: z.string().min(1),
53
+ description: z.string().optional(),
54
+ assignee_id: issueUuidSchema.optional(),
55
+ label_ids: z.array(issueUuidSchema).optional(),
56
+ priority: z.number().int().min(0).max(4).optional(),
57
+ parent_id: issueUuidSchema.optional(),
58
+ });
59
+ const updateIssueParams = z.object({
60
+ id: issueIdOrIdentifierSchema,
61
+ title: z.string().optional(),
62
+ description: z.string().optional(),
63
+ assignee_id: issueUuidSchema.optional(),
64
+ state_id: issueUuidSchema.optional(),
65
+ priority: z.number().int().min(0).max(4).optional(),
66
+ });
67
+ const archiveIssueParams = z.object({ id: issueIdOrIdentifierSchema });
68
+ const addCommentParams = z.object({
69
+ issue_id: issueIdOrIdentifierSchema,
70
+ body: z.string().min(1),
71
+ });
72
+ const updateCommentParams = z.object({
73
+ comment_id: issueUuidSchema,
74
+ body: z.string().min(1),
75
+ });
76
+ const deleteCommentParams = z.object({ comment_id: issueUuidSchema });
77
+ const attachmentLinkParams = z.object({
78
+ issue_id: issueIdOrIdentifierSchema,
79
+ title: z.string().min(1),
80
+ url: z.string().url(),
81
+ subtitle: z.string().optional(),
82
+ metadata: z.record(z.string(), z.unknown()).optional(),
83
+ });
84
+ // ───────────────────────────────────────────────────────────────────────────
85
+ // Error-code translation: Linear client codes → toolkit canonical codes
86
+ // ───────────────────────────────────────────────────────────────────────────
87
+ const CODE_MAP = {
88
+ UNAUTHORIZED: "AUTH_ERROR",
89
+ FORBIDDEN: "AUTH_ERROR",
90
+ NOT_FOUND: "NOT_FOUND",
91
+ RATE_LIMITED: "RATE_LIMITED",
92
+ TIMEOUT: "TIMEOUT",
93
+ NETWORK_ERROR: "CONNECTION_ERROR",
94
+ SERVER_ERROR: "CONNECTION_ERROR",
95
+ BAD_REQUEST: "VALIDATION_ERROR",
96
+ UNPROCESSABLE: "VALIDATION_ERROR",
97
+ INVALID_URL: "VALIDATION_ERROR",
98
+ METHOD_NOT_ALLOWED: "VALIDATION_ERROR",
99
+ HTTP_ERROR: "CONNECTION_ERROR",
100
+ CONFIG_ERROR: "CONFIG_ERROR",
101
+ GRAPHQL_ERROR: "VALIDATION_ERROR",
102
+ };
103
+ export function buildLinearConnector(overrides = {}) {
104
+ const defaultCredentials = async () => {
105
+ const creds = await loadLinearCredentials();
106
+ return creds ?? {};
107
+ };
108
+ const defaultSdk = async () => {
109
+ const creds = await loadLinearCredentials();
110
+ if (!creds) {
111
+ throw new ConnectorError("CONFIG_ERROR", "Linear credentials not configured. Set LINEAR_API_KEY or register a " +
112
+ "credential provider via narai-primitives/credentials.", false);
113
+ }
114
+ return new LinearClient(creds);
115
+ };
116
+ return createConnector({
117
+ name: "linear",
118
+ version: "1.0.0",
119
+ scope: () => "linear",
120
+ credentials: overrides.credentials ?? defaultCredentials,
121
+ sdk: overrides.sdk ?? defaultSdk,
122
+ ...(overrides.defaultPolicy !== undefined
123
+ ? { defaultPolicy: overrides.defaultPolicy }
124
+ : {}),
125
+ actions: {
126
+ // ── Read actions ────────────────────────────────────────────────────
127
+ get_issue: {
128
+ description: "Fetch a Linear issue by identifier (e.g. ENG-123) or UUID",
129
+ params: getIssueParams,
130
+ classify: { kind: "read" },
131
+ handler: async (p, ctx) => {
132
+ const result = await ctx.sdk.getIssue(p.id);
133
+ throwIfHttpError(result);
134
+ const issue = result.data.issue;
135
+ if (!issue) {
136
+ throw new ConnectorError("NOT_FOUND", `Issue '${p.id}' not found`, false, 404);
137
+ }
138
+ return {
139
+ id: issue.id,
140
+ identifier: issue.identifier,
141
+ title: issue.title,
142
+ description: issue.description ?? null,
143
+ priority: issue.priority,
144
+ url: issue.url,
145
+ archived_at: issue.archivedAt ?? null,
146
+ created_at: issue.createdAt,
147
+ updated_at: issue.updatedAt,
148
+ state: issue.state ?? null,
149
+ assignee: issue.assignee ?? null,
150
+ team: issue.team ?? null,
151
+ labels: issue.labels.nodes,
152
+ };
153
+ },
154
+ },
155
+ search_issues: {
156
+ description: "Search Linear issues by team, state, assignee, or text",
157
+ params: searchIssuesParams,
158
+ classify: { kind: "read" },
159
+ handler: async (p, ctx) => {
160
+ const searchFilter = { max_results: p.max_results };
161
+ if (p.team_key !== undefined)
162
+ searchFilter.team_key = p.team_key;
163
+ if (p.state !== undefined)
164
+ searchFilter.state = p.state;
165
+ if (p.assignee_email !== undefined)
166
+ searchFilter.assignee_email = p.assignee_email;
167
+ if (p.text !== undefined)
168
+ searchFilter.text = p.text;
169
+ const result = await ctx.sdk.searchIssues(searchFilter);
170
+ throwIfHttpError(result);
171
+ const nodes = result.data.issues.nodes;
172
+ return {
173
+ total: nodes.length,
174
+ issues: nodes.map((i) => ({
175
+ id: i.id,
176
+ identifier: i.identifier,
177
+ title: i.title,
178
+ priority: i.priority,
179
+ url: i.url,
180
+ state: i.state ?? null,
181
+ assignee: i.assignee ?? null,
182
+ team: i.team ?? null,
183
+ created_at: i.createdAt,
184
+ updated_at: i.updatedAt,
185
+ })),
186
+ truncated: result.data.issues.pageInfo.hasNextPage,
187
+ };
188
+ },
189
+ },
190
+ get_project: {
191
+ description: "Fetch a Linear project by UUID",
192
+ params: getProjectParams,
193
+ classify: { kind: "read" },
194
+ handler: async (p, ctx) => {
195
+ const result = await ctx.sdk.getProject(p.id);
196
+ throwIfHttpError(result);
197
+ const project = result.data.project;
198
+ if (!project) {
199
+ throw new ConnectorError("NOT_FOUND", `Project '${p.id}' not found`, false, 404);
200
+ }
201
+ return {
202
+ id: project.id,
203
+ name: project.name,
204
+ description: project.description ?? null,
205
+ state: project.state,
206
+ start_date: project.startDate ?? null,
207
+ target_date: project.targetDate ?? null,
208
+ created_at: project.createdAt,
209
+ updated_at: project.updatedAt,
210
+ };
211
+ },
212
+ },
213
+ get_team: {
214
+ description: "Fetch a Linear team by key (e.g. ENG) or UUID",
215
+ params: getTeamParams,
216
+ classify: { kind: "read" },
217
+ handler: async (p, ctx) => {
218
+ const result = await ctx.sdk.getTeam(p.key_or_id);
219
+ throwIfHttpError(result);
220
+ const team = result.data.team;
221
+ if (!team) {
222
+ throw new ConnectorError("NOT_FOUND", `Team '${p.key_or_id}' not found`, false, 404);
223
+ }
224
+ return {
225
+ id: team.id,
226
+ key: team.key,
227
+ name: team.name,
228
+ description: team.description ?? null,
229
+ };
230
+ },
231
+ },
232
+ get_comments: {
233
+ description: "List comments on a Linear issue",
234
+ params: getCommentsParams,
235
+ classify: { kind: "read" },
236
+ handler: async (p, ctx) => {
237
+ const result = await ctx.sdk.getComments(p.issue_id, p.max_results);
238
+ throwIfHttpError(result);
239
+ if (!result.data.issue) {
240
+ throw new ConnectorError("NOT_FOUND", `Issue '${p.issue_id}' not found`, false, 404);
241
+ }
242
+ const { nodes, pageInfo } = result.data.issue.comments;
243
+ return {
244
+ issue_id: p.issue_id,
245
+ total: nodes.length,
246
+ comments: nodes.map((c) => ({
247
+ comment_id: c.id,
248
+ body: c.body,
249
+ author: c.user?.displayName ?? null,
250
+ created_at: c.createdAt,
251
+ updated_at: c.updatedAt,
252
+ })),
253
+ truncated: pageInfo.hasNextPage,
254
+ };
255
+ },
256
+ },
257
+ list_attachments: {
258
+ description: "List attachment URLs linked to a Linear issue",
259
+ params: listAttachmentsParams,
260
+ classify: { kind: "read" },
261
+ handler: async (p, ctx) => {
262
+ const result = await ctx.sdk.listAttachments(p.issue_id);
263
+ throwIfHttpError(result);
264
+ if (!result.data.issue) {
265
+ throw new ConnectorError("NOT_FOUND", `Issue '${p.issue_id}' not found`, false, 404);
266
+ }
267
+ const nodes = result.data.issue.attachments.nodes;
268
+ return {
269
+ issue_id: p.issue_id,
270
+ total: nodes.length,
271
+ attachments: nodes.map((a) => ({
272
+ attachment_id: a.id,
273
+ title: a.title,
274
+ subtitle: a.subtitle ?? null,
275
+ url: a.url,
276
+ created_at: a.createdAt,
277
+ creator: a.creator?.displayName ?? null,
278
+ })),
279
+ };
280
+ },
281
+ },
282
+ get_attachment: {
283
+ description: "Fetch and extract a Linear attachment by looking up its URL via list_attachments, then fetching the external file",
284
+ params: getAttachmentParams,
285
+ classify: { kind: "read" },
286
+ handler: async (p, ctx) => {
287
+ const list = await ctx.sdk.listAttachments(p.issue_id);
288
+ throwIfHttpError(list);
289
+ if (!list.data.issue) {
290
+ throw new ConnectorError("NOT_FOUND", `Issue '${p.issue_id}' not found`, false, 404);
291
+ }
292
+ const match = list.data.issue.attachments.nodes.find((a) => a.id === p.attachment_id);
293
+ if (!match) {
294
+ throw new ConnectorError("NOT_FOUND", `Attachment '${p.attachment_id}' not found on issue '${p.issue_id}'`, false, 404);
295
+ }
296
+ let dl;
297
+ try {
298
+ dl = await fetchAttachment(match.url);
299
+ }
300
+ catch (err) {
301
+ const message = err instanceof Error ? err.message : String(err);
302
+ // Deterministic failures (invalid URL scheme, size cap, etc.)
303
+ // should not be retried — same input will always fail. Network
304
+ // / transient errors stay retriable.
305
+ const isDeterministic = message.includes("invalid URL scheme") ||
306
+ (err instanceof Error &&
307
+ err.constructor?.name === "FetchCapExceeded");
308
+ throw new ConnectorError(isDeterministic ? "BAD_REQUEST" : "HTTP_ERROR", `Failed to fetch attachment URL: ${message}`, !isDeterministic);
309
+ }
310
+ return {
311
+ attachment_id: match.id,
312
+ issue_id: p.issue_id,
313
+ title: match.title,
314
+ filename: sanitizeLabel(dl.filename, 255),
315
+ media_type: dl.contentType,
316
+ size_bytes: dl.sizeBytes,
317
+ checksum: dl.checksum,
318
+ extracted: dl.extracted,
319
+ source_url: dl.sourceUrl,
320
+ };
321
+ },
322
+ },
323
+ // ── Write actions ───────────────────────────────────────────────────
324
+ create_issue: {
325
+ description: "Create a new Linear issue",
326
+ params: createIssueParams,
327
+ classify: { kind: "write" },
328
+ handler: async (p, ctx) => {
329
+ const input = {
330
+ teamId: p.team_id,
331
+ title: p.title,
332
+ };
333
+ if (p.description !== undefined)
334
+ input["description"] = p.description;
335
+ if (p.assignee_id !== undefined)
336
+ input["assigneeId"] = p.assignee_id;
337
+ if (p.label_ids !== undefined)
338
+ input["labelIds"] = p.label_ids;
339
+ if (p.priority !== undefined)
340
+ input["priority"] = p.priority;
341
+ if (p.parent_id !== undefined)
342
+ input["parentId"] = p.parent_id;
343
+ const result = await ctx.sdk.createIssue(input);
344
+ throwIfHttpError(result);
345
+ const { success, issue } = result.data.issueCreate;
346
+ if (!success || !issue) {
347
+ throw new ConnectorError("SERVER_ERROR", "issueCreate returned success=false", false);
348
+ }
349
+ return {
350
+ id: issue.id,
351
+ identifier: issue.identifier,
352
+ url: issue.url,
353
+ title: issue.title,
354
+ created_at: issue.createdAt,
355
+ };
356
+ },
357
+ },
358
+ update_issue: {
359
+ description: "Update fields on an existing Linear issue",
360
+ params: updateIssueParams,
361
+ classify: { kind: "write" },
362
+ handler: async (p, ctx) => {
363
+ const input = {};
364
+ if (p.title !== undefined)
365
+ input["title"] = p.title;
366
+ if (p.description !== undefined)
367
+ input["description"] = p.description;
368
+ if (p.assignee_id !== undefined)
369
+ input["assigneeId"] = p.assignee_id;
370
+ if (p.state_id !== undefined)
371
+ input["stateId"] = p.state_id;
372
+ if (p.priority !== undefined)
373
+ input["priority"] = p.priority;
374
+ const result = await ctx.sdk.updateIssue(p.id, input);
375
+ throwIfHttpError(result);
376
+ const { success, issue } = result.data.issueUpdate;
377
+ if (!success) {
378
+ throw new ConnectorError("SERVER_ERROR", "issueUpdate returned success=false", false);
379
+ }
380
+ return {
381
+ id: issue.id,
382
+ identifier: issue.identifier,
383
+ updated_at: issue.updatedAt,
384
+ updated: true,
385
+ };
386
+ },
387
+ },
388
+ archive_issue: {
389
+ description: "Archive a Linear issue (Linear's soft-delete via issueArchive mutation)",
390
+ params: archiveIssueParams,
391
+ classify: { kind: "write", aspects: ["delete"] },
392
+ handler: async (p, ctx) => {
393
+ const result = await ctx.sdk.archiveIssue(p.id);
394
+ throwIfHttpError(result);
395
+ const { success } = result.data.issueArchive;
396
+ if (!success) {
397
+ throw new ConnectorError("SERVER_ERROR", "issueArchive returned success=false", false);
398
+ }
399
+ return { id: p.id, archived: true };
400
+ },
401
+ },
402
+ add_comment: {
403
+ description: "Add a markdown comment to a Linear issue",
404
+ params: addCommentParams,
405
+ classify: { kind: "write" },
406
+ handler: async (p, ctx) => {
407
+ const result = await ctx.sdk.addComment({
408
+ issueId: p.issue_id,
409
+ body: p.body,
410
+ });
411
+ throwIfHttpError(result);
412
+ const { success, comment } = result.data.commentCreate;
413
+ if (!success || !comment) {
414
+ throw new ConnectorError("SERVER_ERROR", "commentCreate returned success=false", false);
415
+ }
416
+ return {
417
+ comment_id: comment.id,
418
+ body: comment.body,
419
+ author: comment.user?.displayName ?? null,
420
+ created_at: comment.createdAt,
421
+ };
422
+ },
423
+ },
424
+ update_comment: {
425
+ description: "Update an existing comment on a Linear issue",
426
+ params: updateCommentParams,
427
+ classify: { kind: "write" },
428
+ handler: async (p, ctx) => {
429
+ const result = await ctx.sdk.updateComment(p.comment_id, { body: p.body });
430
+ throwIfHttpError(result);
431
+ const { success, comment } = result.data.commentUpdate;
432
+ if (!success) {
433
+ throw new ConnectorError("SERVER_ERROR", "commentUpdate returned success=false", false);
434
+ }
435
+ return {
436
+ comment_id: comment.id,
437
+ body: comment.body,
438
+ updated_at: comment.updatedAt,
439
+ updated: true,
440
+ };
441
+ },
442
+ },
443
+ delete_comment: {
444
+ description: "Delete a comment from a Linear issue",
445
+ params: deleteCommentParams,
446
+ classify: { kind: "write", aspects: ["delete"] },
447
+ handler: async (p, ctx) => {
448
+ const result = await ctx.sdk.deleteComment(p.comment_id);
449
+ throwIfHttpError(result);
450
+ const { success } = result.data.commentDelete;
451
+ if (!success) {
452
+ throw new ConnectorError("SERVER_ERROR", "commentDelete returned success=false", false);
453
+ }
454
+ return { comment_id: p.comment_id, deleted: true };
455
+ },
456
+ },
457
+ attachment_link: {
458
+ description: "Link an external URL as an Attachment object on a Linear issue",
459
+ params: attachmentLinkParams,
460
+ classify: { kind: "write" },
461
+ handler: async (p, ctx) => {
462
+ const input = {
463
+ issueId: p.issue_id,
464
+ title: p.title,
465
+ url: p.url,
466
+ };
467
+ if (p.subtitle !== undefined)
468
+ input["subtitle"] = p.subtitle;
469
+ if (p.metadata !== undefined)
470
+ input["metadata"] = p.metadata;
471
+ const result = await ctx.sdk.attachmentLink(input);
472
+ throwIfHttpError(result);
473
+ const { success, attachment } = result.data.attachmentCreate;
474
+ if (!success || !attachment) {
475
+ throw new ConnectorError("SERVER_ERROR", "attachmentCreate returned success=false", false);
476
+ }
477
+ return {
478
+ attachment_id: attachment.id,
479
+ title: sanitizeLabel(attachment.title, 255),
480
+ url: attachment.url,
481
+ created_at: attachment.createdAt,
482
+ };
483
+ },
484
+ },
485
+ },
486
+ mapError: mapHttpError(CODE_MAP),
487
+ });
488
+ }
489
+ // Default production connector.
490
+ const connector = buildLinearConnector();
491
+ export default connector;
492
+ export const { main, fetch, validActions } = connector;
493
+ // Re-exports for advanced consumers.
494
+ export { LinearClient, loadLinearCredentials, } from "./lib/linear_client.js";
495
+ export { ConnectorError as LinearError } from "narai-primitives/toolkit";
496
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connectors/linear/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,aAAa,EACb,gBAAgB,GAGjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E,oFAAoF;AACpF,MAAM,yBAAyB,GAAG,CAAC;KAChC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,KAAK,CACJ,0CAA0C,EAC1C,sDAAsD,CACvD,CAAC;AAEJ,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,EAAE;KACR,KAAK,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;AAEvD,MAAM,aAAa,GAAG,CAAC;KACpB,MAAM,EAAE;KACR,KAAK,CAAC,kBAAkB,EAAE,2CAA2C,CAAC,CAAC;AAE1E,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAEnE,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CA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