narai-primitives 2.1.2 → 2.2.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.
- package/README.md +16 -4
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +12 -1
- package/dist/config/load.js.map +1 -1
- package/dist/connectors/confluence/index.d.ts +3 -1
- package/dist/connectors/confluence/index.d.ts.map +1 -1
- package/dist/connectors/confluence/index.js +246 -31
- package/dist/connectors/confluence/index.js.map +1 -1
- package/dist/connectors/confluence/lib/confluence_client.d.ts +50 -30
- package/dist/connectors/confluence/lib/confluence_client.d.ts.map +1 -1
- package/dist/connectors/confluence/lib/confluence_client.js +69 -225
- package/dist/connectors/confluence/lib/confluence_client.js.map +1 -1
- package/dist/connectors/db/connector.d.ts.map +1 -1
- package/dist/connectors/db/connector.js +12 -6
- package/dist/connectors/db/connector.js.map +1 -1
- package/dist/connectors/db/dispatcher.d.ts +4 -3
- package/dist/connectors/db/dispatcher.d.ts.map +1 -1
- package/dist/connectors/db/dispatcher.js +144 -45
- package/dist/connectors/db/dispatcher.js.map +1 -1
- package/dist/connectors/db/index.d.ts +9 -0
- package/dist/connectors/db/index.d.ts.map +1 -1
- package/dist/connectors/db/index.js +9 -0
- package/dist/connectors/db/index.js.map +1 -1
- package/dist/connectors/db/lib/audit.d.ts.map +1 -1
- package/dist/connectors/db/lib/audit.js +46 -4
- package/dist/connectors/db/lib/audit.js.map +1 -1
- package/dist/connectors/db/lib/drivers/dynamodb.d.ts.map +1 -1
- package/dist/connectors/db/lib/drivers/dynamodb.js +24 -4
- package/dist/connectors/db/lib/drivers/dynamodb.js.map +1 -1
- package/dist/connectors/db/lib/drivers/mysql.js +1 -1
- package/dist/connectors/db/lib/drivers/mysql.js.map +1 -1
- package/dist/connectors/db/lib/drivers/postgresql.js +1 -1
- package/dist/connectors/db/lib/drivers/postgresql.js.map +1 -1
- package/dist/connectors/db/lib/drivers/sqlite.d.ts.map +1 -1
- package/dist/connectors/db/lib/drivers/sqlite.js +9 -5
- package/dist/connectors/db/lib/drivers/sqlite.js.map +1 -1
- package/dist/connectors/db/lib/drivers/sqlserver.d.ts.map +1 -1
- package/dist/connectors/db/lib/drivers/sqlserver.js +66 -32
- package/dist/connectors/db/lib/drivers/sqlserver.js.map +1 -1
- package/dist/connectors/db/lib/environments.d.ts +16 -0
- package/dist/connectors/db/lib/environments.d.ts.map +1 -1
- package/dist/connectors/db/lib/environments.js +16 -0
- package/dist/connectors/db/lib/environments.js.map +1 -1
- package/dist/connectors/db/lib/grant-store.d.ts +70 -0
- package/dist/connectors/db/lib/grant-store.d.ts.map +1 -0
- package/dist/connectors/db/lib/grant-store.js +149 -0
- package/dist/connectors/db/lib/grant-store.js.map +1 -0
- package/dist/connectors/db/lib/plugin_config.d.ts +2 -0
- package/dist/connectors/db/lib/plugin_config.d.ts.map +1 -1
- package/dist/connectors/db/lib/plugin_config.js +23 -2
- package/dist/connectors/db/lib/plugin_config.js.map +1 -1
- package/dist/connectors/db/lib/policy.d.ts +50 -14
- package/dist/connectors/db/lib/policy.d.ts.map +1 -1
- package/dist/connectors/db/lib/policy.js +295 -73
- package/dist/connectors/db/lib/policy.js.map +1 -1
- package/dist/connectors/github/actions/_fields.d.ts +18 -0
- package/dist/connectors/github/actions/_fields.d.ts.map +1 -0
- package/dist/connectors/github/actions/_fields.js +29 -0
- package/dist/connectors/github/actions/_fields.js.map +1 -0
- package/dist/connectors/github/actions/_pagination.d.ts +12 -0
- package/dist/connectors/github/actions/_pagination.d.ts.map +1 -0
- package/dist/connectors/github/actions/_pagination.js +26 -0
- package/dist/connectors/github/actions/_pagination.js.map +1 -0
- package/dist/connectors/github/actions/_types.d.ts +14 -0
- package/dist/connectors/github/actions/_types.d.ts.map +1 -0
- package/dist/connectors/github/actions/_types.js +2 -0
- package/dist/connectors/github/actions/_types.js.map +1 -0
- package/dist/connectors/github/actions/comments.d.ts +3 -0
- package/dist/connectors/github/actions/comments.d.ts.map +1 -0
- package/dist/connectors/github/actions/comments.js +166 -0
- package/dist/connectors/github/actions/comments.js.map +1 -0
- package/dist/connectors/github/actions/issues.d.ts +3 -0
- package/dist/connectors/github/actions/issues.d.ts.map +1 -0
- package/dist/connectors/github/actions/issues.js +129 -0
- package/dist/connectors/github/actions/issues.js.map +1 -0
- package/dist/connectors/github/actions/pulls.d.ts +3 -0
- package/dist/connectors/github/actions/pulls.d.ts.map +1 -0
- package/dist/connectors/github/actions/pulls.js +182 -0
- package/dist/connectors/github/actions/pulls.js.map +1 -0
- package/dist/connectors/github/actions/reads.d.ts +3 -0
- package/dist/connectors/github/actions/reads.d.ts.map +1 -0
- package/dist/connectors/github/actions/reads.js +349 -0
- package/dist/connectors/github/actions/reads.js.map +1 -0
- package/dist/connectors/github/actions/releases.d.ts +3 -0
- package/dist/connectors/github/actions/releases.d.ts.map +1 -0
- package/dist/connectors/github/actions/releases.js +124 -0
- package/dist/connectors/github/actions/releases.js.map +1 -0
- package/dist/connectors/github/actions/workflows.d.ts +3 -0
- package/dist/connectors/github/actions/workflows.d.ts.map +1 -0
- package/dist/connectors/github/actions/workflows.js +224 -0
- package/dist/connectors/github/actions/workflows.js.map +1 -0
- package/dist/connectors/github/index.d.ts +13 -1
- package/dist/connectors/github/index.d.ts.map +1 -1
- package/dist/connectors/github/index.js +33 -396
- package/dist/connectors/github/index.js.map +1 -1
- package/dist/connectors/github/lib/github_client.d.ts +242 -29
- package/dist/connectors/github/lib/github_client.d.ts.map +1 -1
- package/dist/connectors/github/lib/github_client.js +202 -256
- package/dist/connectors/github/lib/github_client.js.map +1 -1
- package/dist/connectors/github/lib/github_config.d.ts +10 -0
- package/dist/connectors/github/lib/github_config.d.ts.map +1 -0
- package/dist/connectors/github/lib/github_config.js +79 -0
- package/dist/connectors/github/lib/github_config.js.map +1 -0
- package/dist/connectors/gitlab/actions/_fields.d.ts +20 -0
- package/dist/connectors/gitlab/actions/_fields.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/_fields.js +44 -0
- package/dist/connectors/gitlab/actions/_fields.js.map +1 -0
- package/dist/connectors/gitlab/actions/_pagination.d.ts +19 -0
- package/dist/connectors/gitlab/actions/_pagination.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/_pagination.js +33 -0
- package/dist/connectors/gitlab/actions/_pagination.js.map +1 -0
- package/dist/connectors/gitlab/actions/_types.d.ts +12 -0
- package/dist/connectors/gitlab/actions/_types.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/_types.js +2 -0
- package/dist/connectors/gitlab/actions/_types.js.map +1 -0
- package/dist/connectors/gitlab/actions/issues.d.ts +3 -0
- package/dist/connectors/gitlab/actions/issues.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/issues.js +119 -0
- package/dist/connectors/gitlab/actions/issues.js.map +1 -0
- package/dist/connectors/gitlab/actions/merges.d.ts +3 -0
- package/dist/connectors/gitlab/actions/merges.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/merges.js +198 -0
- package/dist/connectors/gitlab/actions/merges.js.map +1 -0
- package/dist/connectors/gitlab/actions/notes.d.ts +3 -0
- package/dist/connectors/gitlab/actions/notes.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/notes.js +145 -0
- package/dist/connectors/gitlab/actions/notes.js.map +1 -0
- package/dist/connectors/gitlab/actions/pipelines.d.ts +3 -0
- package/dist/connectors/gitlab/actions/pipelines.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/pipelines.js +136 -0
- package/dist/connectors/gitlab/actions/pipelines.js.map +1 -0
- package/dist/connectors/gitlab/actions/reads.d.ts +3 -0
- package/dist/connectors/gitlab/actions/reads.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/reads.js +422 -0
- package/dist/connectors/gitlab/actions/reads.js.map +1 -0
- package/dist/connectors/gitlab/actions/releases.d.ts +3 -0
- package/dist/connectors/gitlab/actions/releases.d.ts.map +1 -0
- package/dist/connectors/gitlab/actions/releases.js +99 -0
- package/dist/connectors/gitlab/actions/releases.js.map +1 -0
- package/dist/connectors/gitlab/cli.d.ts +3 -0
- package/dist/connectors/gitlab/cli.d.ts.map +1 -0
- package/dist/connectors/gitlab/cli.js +24 -0
- package/dist/connectors/gitlab/cli.js.map +1 -0
- package/dist/connectors/gitlab/index.d.ts +29 -0
- package/dist/connectors/gitlab/index.d.ts.map +1 -0
- package/dist/connectors/gitlab/index.js +95 -0
- package/dist/connectors/gitlab/index.js.map +1 -0
- package/dist/connectors/gitlab/lib/gitlab_client.d.ts +306 -0
- package/dist/connectors/gitlab/lib/gitlab_client.d.ts.map +1 -0
- package/dist/connectors/gitlab/lib/gitlab_client.js +249 -0
- package/dist/connectors/gitlab/lib/gitlab_client.js.map +1 -0
- package/dist/connectors/gitlab/lib/gitlab_config.d.ts +11 -0
- package/dist/connectors/gitlab/lib/gitlab_config.d.ts.map +1 -0
- package/dist/connectors/gitlab/lib/gitlab_config.js +115 -0
- package/dist/connectors/gitlab/lib/gitlab_config.js.map +1 -0
- package/dist/connectors/jira/index.d.ts +3 -1
- package/dist/connectors/jira/index.d.ts.map +1 -1
- package/dist/connectors/jira/index.js +299 -41
- package/dist/connectors/jira/index.js.map +1 -1
- package/dist/connectors/jira/lib/jira_client.d.ts +56 -41
- package/dist/connectors/jira/lib/jira_client.d.ts.map +1 -1
- package/dist/connectors/jira/lib/jira_client.js +71 -248
- package/dist/connectors/jira/lib/jira_client.js.map +1 -1
- package/dist/connectors/linear/cli.d.ts +3 -0
- package/dist/connectors/linear/cli.d.ts.map +1 -0
- package/dist/connectors/linear/cli.js +22 -0
- package/dist/connectors/linear/cli.js.map +1 -0
- package/dist/connectors/linear/index.d.ts +27 -0
- package/dist/connectors/linear/index.d.ts.map +1 -0
- package/dist/connectors/linear/index.js +496 -0
- package/dist/connectors/linear/index.js.map +1 -0
- package/dist/connectors/linear/lib/linear_client.d.ts +249 -0
- package/dist/connectors/linear/lib/linear_client.d.ts.map +1 -0
- package/dist/connectors/linear/lib/linear_client.js +154 -0
- package/dist/connectors/linear/lib/linear_client.js.map +1 -0
- package/dist/connectors/linear/lib/queries.d.ts +15 -0
- package/dist/connectors/linear/lib/queries.d.ts.map +1 -0
- package/dist/connectors/linear/lib/queries.js +188 -0
- package/dist/connectors/linear/lib/queries.js.map +1 -0
- package/dist/connectors/notion/index.d.ts +2 -1
- package/dist/connectors/notion/index.d.ts.map +1 -1
- package/dist/connectors/notion/index.js +213 -28
- package/dist/connectors/notion/index.js.map +1 -1
- package/dist/connectors/notion/lib/markdown_to_blocks.d.ts +21 -0
- package/dist/connectors/notion/lib/markdown_to_blocks.d.ts.map +1 -0
- package/dist/connectors/notion/lib/markdown_to_blocks.js +102 -0
- package/dist/connectors/notion/lib/markdown_to_blocks.js.map +1 -0
- package/dist/connectors/notion/lib/notion_blocks.d.ts +34 -0
- package/dist/connectors/notion/lib/notion_blocks.d.ts.map +1 -0
- package/dist/connectors/notion/lib/notion_blocks.js +87 -0
- package/dist/connectors/notion/lib/notion_blocks.js.map +1 -0
- package/dist/connectors/notion/lib/notion_client.d.ts +35 -25
- package/dist/connectors/notion/lib/notion_client.d.ts.map +1 -1
- package/dist/connectors/notion/lib/notion_client.js +63 -185
- package/dist/connectors/notion/lib/notion_client.js.map +1 -1
- package/dist/hub/index.d.ts.map +1 -1
- package/dist/hub/index.js +23 -3
- package/dist/hub/index.js.map +1 -1
- package/dist/toolkit/agent_resolver.d.ts +14 -4
- package/dist/toolkit/agent_resolver.d.ts.map +1 -1
- package/dist/toolkit/agent_resolver.js +38 -6
- package/dist/toolkit/agent_resolver.js.map +1 -1
- package/dist/toolkit/atlassian/adf_validator.d.ts +45 -0
- package/dist/toolkit/atlassian/adf_validator.d.ts.map +1 -0
- package/dist/toolkit/atlassian/adf_validator.js +83 -0
- package/dist/toolkit/atlassian/adf_validator.js.map +1 -0
- package/dist/toolkit/atlassian/index.d.ts +5 -0
- package/dist/toolkit/atlassian/index.d.ts.map +1 -0
- package/dist/toolkit/atlassian/index.js +5 -0
- package/dist/toolkit/atlassian/index.js.map +1 -0
- package/dist/toolkit/audit/writer.d.ts.map +1 -1
- package/dist/toolkit/audit/writer.js +45 -5
- package/dist/toolkit/audit/writer.js.map +1 -1
- package/dist/toolkit/connector_error.d.ts +12 -0
- package/dist/toolkit/connector_error.d.ts.map +1 -0
- package/dist/toolkit/connector_error.js +18 -0
- package/dist/toolkit/connector_error.js.map +1 -0
- package/dist/toolkit/guardrail.d.ts +12 -2
- package/dist/toolkit/guardrail.d.ts.map +1 -1
- package/dist/toolkit/guardrail.js +17 -3
- package/dist/toolkit/guardrail.js.map +1 -1
- package/dist/toolkit/http_client.d.ts +134 -0
- package/dist/toolkit/http_client.d.ts.map +1 -0
- package/dist/toolkit/http_client.js +385 -0
- package/dist/toolkit/http_client.js.map +1 -0
- package/dist/toolkit/index.d.ts +3 -0
- package/dist/toolkit/index.d.ts.map +1 -1
- package/dist/toolkit/index.js +5 -0
- package/dist/toolkit/index.js.map +1 -1
- package/dist/toolkit/usage/aggregate.d.ts.map +1 -1
- package/dist/toolkit/usage/aggregate.js +19 -3
- package/dist/toolkit/usage/aggregate.js.map +1 -1
- package/package.json +14 -2
- package/plugin-hooks/dispatcher.mjs +584 -0
- package/plugin-hooks/plugin-config.mjs +36 -0
- package/plugins/{aws-agent → aws-connector}/.claude-plugin/plugin.json +1 -1
- package/plugins/{aws-agent → aws-connector}/README.md +7 -7
- package/plugins/{aws-agent/bin/aws-agent → aws-connector/bin/aws-connector} +3 -3
- package/plugins/aws-connector/commands/aws-connector.md +6 -0
- package/plugins/{gcp-agent → aws-connector}/hooks/hooks.json +12 -11
- package/plugins/aws-connector/package.json +9 -0
- package/plugins/aws-connector/plugin-config.json +4 -0
- package/plugins/{aws-agent/skills/aws-agent → aws-connector/skills/aws-connector}/SKILL.md +5 -5
- package/plugins/confluence-connector/.claude-plugin/plugin.json +6 -0
- package/plugins/{confluence-agent → confluence-connector}/README.md +2 -2
- package/plugins/confluence-connector/bin/confluence-connector +17 -0
- package/plugins/confluence-connector/commands/confluence-connector.md +6 -0
- package/plugins/{jira-agent → confluence-connector}/hooks/hooks.json +12 -11
- package/plugins/confluence-connector/package.json +8 -0
- package/plugins/confluence-connector/plugin-config.json +4 -0
- package/plugins/confluence-connector/skills/confluence-connector/SKILL.md +146 -0
- package/plugins/{create-connector → connector-creator}/.claude-plugin/plugin.json +1 -1
- package/plugins/{create-connector → connector-creator}/README.md +2 -2
- package/plugins/connector-creator/skills/connector-creator/SKILL.md +412 -0
- package/plugins/connector-creator/skills/connector-creator/assets/templates/_runtime/connector-gate.mjs.tmpl +120 -0
- package/plugins/connector-creator/skills/connector-creator/assets/templates/composite/SKILL.md.tmpl +26 -0
- package/plugins/connector-creator/skills/connector-creator/assets/templates/composite/bin.tmpl +2 -0
- package/plugins/connector-creator/skills/connector-creator/assets/templates/composite/index.mjs.tmpl +35 -0
- package/plugins/connector-creator/skills/connector-creator/assets/templates/knowledge/SKILL.md.tmpl +23 -0
- package/plugins/connector-creator/skills/connector-creator/assets/templates/shell-gate/SKILL.md.tmpl +27 -0
- package/plugins/connector-creator/skills/connector-creator/assets/templates/shell-gate/gates.json.tmpl +5 -0
- package/plugins/connector-creator/skills/connector-creator/lib/connector-registry.mjs +43 -0
- package/plugins/connector-creator/skills/connector-creator/lib/settings-wiring.mjs +71 -0
- package/plugins/connector-creator/skills/connector-creator/references/connector-contract.md +79 -0
- package/plugins/connector-creator/skills/connector-creator/references/flavor-authoring.md +58 -0
- package/plugins/connector-creator/skills/connector-creator/references/research-patterns.md +51 -0
- package/plugins/{db-agent → db-connector}/.claude-plugin/plugin.json +3 -3
- package/plugins/{db-agent → db-connector}/README.md +2 -2
- package/plugins/{github-agent/bin/github-agent → db-connector/bin/db-connector} +3 -3
- package/plugins/db-connector/commands/db-connector.md +6 -0
- package/plugins/db-connector/gates.json +37 -0
- package/plugins/{db-agent → db-connector}/hooks/guardrails.json +4 -2
- package/plugins/{aws-agent → db-connector}/hooks/hooks.json +15 -11
- package/plugins/db-connector/package.json +8 -0
- package/plugins/db-connector/plugin-config.json +5 -0
- package/plugins/{db-agent/skills/db-agent → db-connector/skills/db-connector}/SKILL.md +5 -5
- package/plugins/{gcp-agent → gcp-connector}/.claude-plugin/plugin.json +1 -1
- package/plugins/{gcp-agent → gcp-connector}/README.md +5 -5
- package/plugins/{gcp-agent/bin/gcp-agent → gcp-connector/bin/gcp-connector} +3 -3
- package/plugins/gcp-connector/commands/gcp-connector.md +6 -0
- package/plugins/{github-agent → gcp-connector}/hooks/hooks.json +12 -11
- package/plugins/gcp-connector/package.json +9 -0
- package/plugins/gcp-connector/plugin-config.json +4 -0
- package/plugins/{gcp-agent/skills/gcp-agent → gcp-connector/skills/gcp-connector}/SKILL.md +5 -5
- package/plugins/git-connector/.claude-plugin/plugin.json +6 -0
- package/plugins/git-connector/CONTRIBUTING.md +117 -0
- package/plugins/git-connector/README.md +94 -0
- package/plugins/git-connector/SECURITY.md +143 -0
- package/plugins/git-connector/gates.json +54 -0
- package/plugins/git-connector/hooks/hooks.json +25 -0
- package/plugins/git-connector/package.json +9 -0
- package/plugins/git-connector/plugin-config.json +4 -0
- package/plugins/{github-agent → github-connector}/.claude-plugin/plugin.json +1 -1
- package/plugins/github-connector/README.md +48 -0
- package/plugins/{confluence-agent/bin/confluence-agent → github-connector/bin/github-connector} +3 -3
- package/plugins/github-connector/commands/github-connector.md +6 -0
- package/plugins/github-connector/hooks/hooks.json +50 -0
- package/plugins/github-connector/package.json +8 -0
- package/plugins/github-connector/plugin-config.json +4 -0
- package/plugins/github-connector/skills/github-connector/SKILL.md +106 -0
- package/plugins/gitlab-connector/.claude-plugin/plugin.json +6 -0
- package/plugins/gitlab-connector/README.md +62 -0
- package/plugins/{db-agent/bin/db-agent → gitlab-connector/bin/gitlab-connector} +3 -3
- package/plugins/gitlab-connector/commands/gitlab-connector.md +6 -0
- package/plugins/gitlab-connector/hooks/hooks.json +50 -0
- package/plugins/gitlab-connector/package.json +8 -0
- package/plugins/gitlab-connector/plugin-config.json +4 -0
- package/plugins/gitlab-connector/skills/gitlab-connector/SKILL.md +115 -0
- package/plugins/jira-connector/.claude-plugin/plugin.json +6 -0
- package/plugins/{jira-agent → jira-connector}/README.md +1 -1
- package/plugins/{jira-agent/bin/jira-agent → jira-connector/bin/jira-connector} +2 -2
- package/plugins/jira-connector/commands/jira-connector.md +6 -0
- package/plugins/jira-connector/hooks/hooks.json +50 -0
- package/plugins/jira-connector/package.json +8 -0
- package/plugins/jira-connector/plugin-config.json +4 -0
- package/plugins/jira-connector/skills/jira-connector/SKILL.md +146 -0
- package/plugins/linear-connector/.claude-plugin/plugin.json +6 -0
- package/plugins/linear-connector/README.md +29 -0
- package/plugins/linear-connector/bin/linear-connector +17 -0
- package/plugins/linear-connector/commands/linear-connector.md +6 -0
- package/plugins/linear-connector/hooks/hooks.json +50 -0
- package/plugins/linear-connector/package.json +8 -0
- package/plugins/linear-connector/plugin-config.json +4 -0
- package/plugins/linear-connector/skills/linear-connector/SKILL.md +159 -0
- package/plugins/notion-connector/.claude-plugin/plugin.json +6 -0
- package/plugins/{notion-agent → notion-connector}/README.md +5 -5
- package/plugins/{notion-agent/bin/notion-agent → notion-connector/bin/notion-connector} +2 -2
- package/plugins/notion-connector/commands/notion-connector.md +6 -0
- package/plugins/notion-connector/hooks/hooks.json +50 -0
- package/plugins/notion-connector/package.json +8 -0
- package/plugins/notion-connector/plugin-config.json +4 -0
- package/plugins/notion-connector/skills/notion-connector/SKILL.md +141 -0
- package/dist/connectors/confluence/lib/confluence_error.d.ts +0 -13
- package/dist/connectors/confluence/lib/confluence_error.d.ts.map +0 -1
- package/dist/connectors/confluence/lib/confluence_error.js +0 -19
- package/dist/connectors/confluence/lib/confluence_error.js.map +0 -1
- package/dist/connectors/github/lib/github_error.d.ts +0 -11
- package/dist/connectors/github/lib/github_error.d.ts.map +0 -1
- package/dist/connectors/github/lib/github_error.js +0 -17
- package/dist/connectors/github/lib/github_error.js.map +0 -1
- package/dist/connectors/jira/lib/jira_error.d.ts +0 -11
- package/dist/connectors/jira/lib/jira_error.d.ts.map +0 -1
- package/dist/connectors/jira/lib/jira_error.js +0 -17
- package/dist/connectors/jira/lib/jira_error.js.map +0 -1
- package/dist/connectors/notion/lib/notion_error.d.ts +0 -12
- package/dist/connectors/notion/lib/notion_error.d.ts.map +0 -1
- package/dist/connectors/notion/lib/notion_error.js +0 -18
- package/dist/connectors/notion/lib/notion_error.js.map +0 -1
- package/plugins/aws-agent/commands/aws-agent.md +0 -6
- package/plugins/aws-agent/hooks/reminder.mjs +0 -16
- package/plugins/aws-agent/package.json +0 -9
- package/plugins/confluence-agent/.claude-plugin/plugin.json +0 -6
- package/plugins/confluence-agent/commands/confluence-agent.md +0 -6
- package/plugins/confluence-agent/hooks/hooks.json +0 -49
- package/plugins/confluence-agent/hooks/reminder.mjs +0 -25
- package/plugins/confluence-agent/package.json +0 -8
- package/plugins/confluence-agent/skills/confluence-agent/SKILL.md +0 -40
- package/plugins/create-connector/skills/create-connector/SKILL.md +0 -252
- package/plugins/db-agent/commands/db-agent.md +0 -6
- package/plugins/db-agent/hooks/db-guard.mjs +0 -110
- package/plugins/db-agent/hooks/hooks.json +0 -61
- package/plugins/db-agent/hooks/reminder.mjs +0 -16
- package/plugins/db-agent/package.json +0 -8
- package/plugins/gcp-agent/commands/gcp-agent.md +0 -6
- package/plugins/gcp-agent/hooks/reminder.mjs +0 -16
- package/plugins/gcp-agent/package.json +0 -9
- package/plugins/github-agent/README.md +0 -13
- package/plugins/github-agent/commands/github-agent.md +0 -6
- package/plugins/github-agent/hooks/reminder.mjs +0 -16
- package/plugins/github-agent/package.json +0 -8
- package/plugins/github-agent/skills/github-agent/SKILL.md +0 -41
- package/plugins/jira-agent/.claude-plugin/plugin.json +0 -6
- package/plugins/jira-agent/commands/jira-agent.md +0 -6
- package/plugins/jira-agent/hooks/reminder.mjs +0 -16
- package/plugins/jira-agent/package.json +0 -8
- package/plugins/jira-agent/skills/jira-agent/SKILL.md +0 -37
- package/plugins/notion-agent/.claude-plugin/plugin.json +0 -6
- package/plugins/notion-agent/commands/notion-agent.md +0 -6
- package/plugins/notion-agent/hooks/hooks.json +0 -49
- package/plugins/notion-agent/hooks/reminder.mjs +0 -17
- package/plugins/notion-agent/package.json +0 -8
- package/plugins/notion-agent/skills/notion-agent/SKILL.md +0 -48
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/bin.tmpl +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/connector-SKILL.md.tmpl +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/index.mjs.tmpl +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/assets/templates/tests-example.mjs.tmpl +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/action-design.md +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/auth-patterns.md +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/connector-anatomy.md +0 -0
- /package/plugins/{create-connector/skills/create-connector/references/db-agent-pointer.md → connector-creator/skills/connector-creator/references/db-connector-pointer.md} +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/plugin-layer.md +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/template-sync.md +0 -0
- /package/plugins/{create-connector/skills/create-connector → connector-creator/skills/connector-creator}/references/verification.md +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* linear_client.ts — thin GraphQL client for Linear's API.
|
|
3
|
+
*
|
|
4
|
+
* Thin wrapper over the shared `HttpClient` in `narai-primitives/toolkit`:
|
|
5
|
+
* adds the Linear-specific raw-key Authorization header (no Bearer prefix),
|
|
6
|
+
* POSTs every operation to `/graphql`, and unwraps the `{data, errors}`
|
|
7
|
+
* GraphQL response envelope. All retry/throttle/timeout/URL-validation
|
|
8
|
+
* logic comes from the shared client.
|
|
9
|
+
*/
|
|
10
|
+
import { type HttpResult, type HttpResultErr, type HttpResultOk } from "narai-primitives/toolkit";
|
|
11
|
+
export interface LinearClientOptions {
|
|
12
|
+
apiKey: string;
|
|
13
|
+
rateLimitPerMin?: number;
|
|
14
|
+
connectTimeoutMs?: number;
|
|
15
|
+
readTimeoutMs?: number;
|
|
16
|
+
fetchImpl?: typeof globalThis.fetch;
|
|
17
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export type LinearErrorPayload = HttpResultErr;
|
|
20
|
+
export type LinearSuccessPayload<T> = HttpResultOk<T>;
|
|
21
|
+
export type LinearResult<T> = HttpResult<T>;
|
|
22
|
+
/** Resolve Linear credentials from the shared credential provider chain. */
|
|
23
|
+
export declare function loadLinearCredentials(): Promise<{
|
|
24
|
+
apiKey: string;
|
|
25
|
+
} | null>;
|
|
26
|
+
export declare class LinearClient {
|
|
27
|
+
private readonly _http;
|
|
28
|
+
constructor(opts: LinearClientOptions);
|
|
29
|
+
/** Clear the per-client rate-limit sliding window. Test-only convenience. */
|
|
30
|
+
resetRateLimiter(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Execute a GraphQL query or mutation against Linear's API.
|
|
33
|
+
* Returns `LinearResult<T>` where `T` is the shape of `data` in the
|
|
34
|
+
* response. GraphQL `errors` are surfaced as `ok: false` results.
|
|
35
|
+
*/
|
|
36
|
+
query<T = unknown>(doc: string, variables?: Record<string, unknown>): Promise<LinearResult<T>>;
|
|
37
|
+
getIssue(idOrIdentifier: string): Promise<LinearResult<{
|
|
38
|
+
issue: LinearIssue;
|
|
39
|
+
}>>;
|
|
40
|
+
searchIssues(filter: {
|
|
41
|
+
team_key?: string;
|
|
42
|
+
state?: string;
|
|
43
|
+
assignee_email?: string;
|
|
44
|
+
text?: string;
|
|
45
|
+
max_results: number;
|
|
46
|
+
}): Promise<LinearResult<{
|
|
47
|
+
issues: {
|
|
48
|
+
nodes: LinearIssueSummary[];
|
|
49
|
+
pageInfo: {
|
|
50
|
+
hasNextPage: boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}>>;
|
|
54
|
+
getProject(id: string): Promise<LinearResult<{
|
|
55
|
+
project: LinearProject;
|
|
56
|
+
}>>;
|
|
57
|
+
getTeam(keyOrId: string): Promise<LinearResult<{
|
|
58
|
+
team: LinearTeam;
|
|
59
|
+
}>>;
|
|
60
|
+
getComments(issueId: string, maxResults: number): Promise<LinearResult<{
|
|
61
|
+
issue: {
|
|
62
|
+
comments: {
|
|
63
|
+
nodes: LinearComment[];
|
|
64
|
+
pageInfo: {
|
|
65
|
+
hasNextPage: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
} | null;
|
|
69
|
+
}>>;
|
|
70
|
+
listAttachments(issueId: string): Promise<LinearResult<{
|
|
71
|
+
issue: {
|
|
72
|
+
attachments: {
|
|
73
|
+
nodes: LinearAttachment[];
|
|
74
|
+
};
|
|
75
|
+
} | null;
|
|
76
|
+
}>>;
|
|
77
|
+
createIssue(input: {
|
|
78
|
+
teamId: string;
|
|
79
|
+
title: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
assigneeId?: string;
|
|
82
|
+
labelIds?: string[];
|
|
83
|
+
priority?: number;
|
|
84
|
+
parentId?: string;
|
|
85
|
+
}): Promise<LinearResult<{
|
|
86
|
+
issueCreate: {
|
|
87
|
+
success: boolean;
|
|
88
|
+
issue: LinearIssueSummary;
|
|
89
|
+
};
|
|
90
|
+
}>>;
|
|
91
|
+
updateIssue(id: string, input: {
|
|
92
|
+
title?: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
assigneeId?: string;
|
|
95
|
+
stateId?: string;
|
|
96
|
+
priority?: number;
|
|
97
|
+
}): Promise<LinearResult<{
|
|
98
|
+
issueUpdate: {
|
|
99
|
+
success: boolean;
|
|
100
|
+
issue: {
|
|
101
|
+
id: string;
|
|
102
|
+
identifier: string;
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
}>>;
|
|
107
|
+
archiveIssue(id: string): Promise<LinearResult<{
|
|
108
|
+
issueArchive: {
|
|
109
|
+
success: boolean;
|
|
110
|
+
};
|
|
111
|
+
}>>;
|
|
112
|
+
addComment(input: {
|
|
113
|
+
issueId: string;
|
|
114
|
+
body: string;
|
|
115
|
+
}): Promise<LinearResult<{
|
|
116
|
+
commentCreate: {
|
|
117
|
+
success: boolean;
|
|
118
|
+
comment: LinearComment;
|
|
119
|
+
};
|
|
120
|
+
}>>;
|
|
121
|
+
updateComment(id: string, input: {
|
|
122
|
+
body: string;
|
|
123
|
+
}): Promise<LinearResult<{
|
|
124
|
+
commentUpdate: {
|
|
125
|
+
success: boolean;
|
|
126
|
+
comment: {
|
|
127
|
+
id: string;
|
|
128
|
+
body: string;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}>>;
|
|
133
|
+
deleteComment(id: string): Promise<LinearResult<{
|
|
134
|
+
commentDelete: {
|
|
135
|
+
success: boolean;
|
|
136
|
+
};
|
|
137
|
+
}>>;
|
|
138
|
+
attachmentLink(input: {
|
|
139
|
+
issueId: string;
|
|
140
|
+
title: string;
|
|
141
|
+
url: string;
|
|
142
|
+
subtitle?: string;
|
|
143
|
+
metadata?: Record<string, unknown>;
|
|
144
|
+
}): Promise<LinearResult<{
|
|
145
|
+
attachmentCreate: {
|
|
146
|
+
success: boolean;
|
|
147
|
+
attachment: {
|
|
148
|
+
id: string;
|
|
149
|
+
title: string;
|
|
150
|
+
url: string;
|
|
151
|
+
createdAt: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
}>>;
|
|
155
|
+
}
|
|
156
|
+
export interface LinearIssue {
|
|
157
|
+
id: string;
|
|
158
|
+
identifier: string;
|
|
159
|
+
title: string;
|
|
160
|
+
description: string | null;
|
|
161
|
+
priority: number;
|
|
162
|
+
url: string;
|
|
163
|
+
archivedAt: string | null;
|
|
164
|
+
createdAt: string;
|
|
165
|
+
updatedAt: string;
|
|
166
|
+
state: {
|
|
167
|
+
id: string;
|
|
168
|
+
name: string;
|
|
169
|
+
type: string;
|
|
170
|
+
} | null;
|
|
171
|
+
assignee: {
|
|
172
|
+
id: string;
|
|
173
|
+
name: string;
|
|
174
|
+
email: string;
|
|
175
|
+
displayName: string;
|
|
176
|
+
} | null;
|
|
177
|
+
team: {
|
|
178
|
+
id: string;
|
|
179
|
+
key: string;
|
|
180
|
+
name: string;
|
|
181
|
+
} | null;
|
|
182
|
+
labels: {
|
|
183
|
+
nodes: Array<{
|
|
184
|
+
id: string;
|
|
185
|
+
name: string;
|
|
186
|
+
color: string;
|
|
187
|
+
}>;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export interface LinearIssueSummary {
|
|
191
|
+
id: string;
|
|
192
|
+
identifier: string;
|
|
193
|
+
title: string;
|
|
194
|
+
priority: number;
|
|
195
|
+
url: string;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
updatedAt: string;
|
|
198
|
+
state: {
|
|
199
|
+
name: string;
|
|
200
|
+
type: string;
|
|
201
|
+
} | null;
|
|
202
|
+
assignee: {
|
|
203
|
+
displayName: string;
|
|
204
|
+
email: string;
|
|
205
|
+
} | null;
|
|
206
|
+
team: {
|
|
207
|
+
key: string;
|
|
208
|
+
name: string;
|
|
209
|
+
} | null;
|
|
210
|
+
}
|
|
211
|
+
export interface LinearProject {
|
|
212
|
+
id: string;
|
|
213
|
+
name: string;
|
|
214
|
+
description: string | null;
|
|
215
|
+
state: string;
|
|
216
|
+
startDate: string | null;
|
|
217
|
+
targetDate: string | null;
|
|
218
|
+
createdAt: string;
|
|
219
|
+
updatedAt: string;
|
|
220
|
+
}
|
|
221
|
+
export interface LinearTeam {
|
|
222
|
+
id: string;
|
|
223
|
+
key: string;
|
|
224
|
+
name: string;
|
|
225
|
+
description: string | null;
|
|
226
|
+
}
|
|
227
|
+
export interface LinearComment {
|
|
228
|
+
id: string;
|
|
229
|
+
body: string;
|
|
230
|
+
createdAt: string;
|
|
231
|
+
updatedAt: string;
|
|
232
|
+
user: {
|
|
233
|
+
id: string;
|
|
234
|
+
name: string;
|
|
235
|
+
displayName: string;
|
|
236
|
+
email: string;
|
|
237
|
+
} | null;
|
|
238
|
+
}
|
|
239
|
+
export interface LinearAttachment {
|
|
240
|
+
id: string;
|
|
241
|
+
title: string;
|
|
242
|
+
subtitle: string | null;
|
|
243
|
+
url: string;
|
|
244
|
+
createdAt: string;
|
|
245
|
+
creator: {
|
|
246
|
+
displayName: string;
|
|
247
|
+
} | null;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=linear_client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear_client.d.ts","sourceRoot":"","sources":["../../../../src/connectors/linear/lib/linear_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAC;AAsBlC,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAC/C,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AAE5C,4EAA4E;AAC5E,wBAAsB,qBAAqB,IAAI,OAAO,CACpD;IAAE,MAAM,EAAE,MAA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AAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACzC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* linear_client.ts — thin GraphQL client for Linear's API.
|
|
3
|
+
*
|
|
4
|
+
* Thin wrapper over the shared `HttpClient` in `narai-primitives/toolkit`:
|
|
5
|
+
* adds the Linear-specific raw-key Authorization header (no Bearer prefix),
|
|
6
|
+
* POSTs every operation to `/graphql`, and unwraps the `{data, errors}`
|
|
7
|
+
* GraphQL response envelope. All retry/throttle/timeout/URL-validation
|
|
8
|
+
* logic comes from the shared client.
|
|
9
|
+
*/
|
|
10
|
+
import { HttpClient, } from "narai-primitives/toolkit";
|
|
11
|
+
import { resolveSecret } from "narai-primitives/credentials";
|
|
12
|
+
import { GET_ISSUE, SEARCH_ISSUES, GET_PROJECT, GET_TEAM, TEAMS_BY_KEY, GET_COMMENTS, LIST_ATTACHMENTS, CREATE_ISSUE, UPDATE_ISSUE, ARCHIVE_ISSUE, ADD_COMMENT, UPDATE_COMMENT, DELETE_COMMENT, ATTACHMENT_LINK, } from "./queries.js";
|
|
13
|
+
const LINEAR_API_BASE = "https://api.linear.app";
|
|
14
|
+
const LINEAR_GRAPHQL_PATH = "/graphql";
|
|
15
|
+
/** Resolve Linear credentials from the shared credential provider chain. */
|
|
16
|
+
export async function loadLinearCredentials() {
|
|
17
|
+
const apiKey = (await resolveSecret("LINEAR_API_KEY")) ??
|
|
18
|
+
process.env["LINEAR_API_KEY"] ??
|
|
19
|
+
null;
|
|
20
|
+
if (!apiKey)
|
|
21
|
+
return null;
|
|
22
|
+
return { apiKey };
|
|
23
|
+
}
|
|
24
|
+
export class LinearClient {
|
|
25
|
+
_http;
|
|
26
|
+
constructor(opts) {
|
|
27
|
+
this._http = new HttpClient({
|
|
28
|
+
baseUrl: LINEAR_API_BASE,
|
|
29
|
+
// Linear uses the raw API key as the Authorization header value —
|
|
30
|
+
// no `Bearer ` prefix.
|
|
31
|
+
authHeader: opts.apiKey,
|
|
32
|
+
serviceName: "Linear",
|
|
33
|
+
allowedMethods: new Set(["POST"]),
|
|
34
|
+
rateLimitPerMin: opts.rateLimitPerMin,
|
|
35
|
+
connectTimeoutMs: opts.connectTimeoutMs,
|
|
36
|
+
readTimeoutMs: opts.readTimeoutMs,
|
|
37
|
+
fetchImpl: opts.fetchImpl,
|
|
38
|
+
sleepImpl: opts.sleepImpl,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Clear the per-client rate-limit sliding window. Test-only convenience. */
|
|
42
|
+
resetRateLimiter() {
|
|
43
|
+
this._http.resetRateLimiter();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Execute a GraphQL query or mutation against Linear's API.
|
|
47
|
+
* Returns `LinearResult<T>` where `T` is the shape of `data` in the
|
|
48
|
+
* response. GraphQL `errors` are surfaced as `ok: false` results.
|
|
49
|
+
*/
|
|
50
|
+
async query(doc, variables) {
|
|
51
|
+
const raw = await this._http.request("POST", LINEAR_GRAPHQL_PATH, {
|
|
52
|
+
body: { query: doc, variables: variables ?? {} },
|
|
53
|
+
});
|
|
54
|
+
if (!raw.ok)
|
|
55
|
+
return raw;
|
|
56
|
+
const json = raw.data;
|
|
57
|
+
if (json.errors && json.errors.length > 0) {
|
|
58
|
+
const first = json.errors[0];
|
|
59
|
+
const code = first.extensions?.code ?? "GRAPHQL_ERROR";
|
|
60
|
+
return {
|
|
61
|
+
ok: false,
|
|
62
|
+
code,
|
|
63
|
+
message: first.message,
|
|
64
|
+
retriable: false,
|
|
65
|
+
status: raw.status,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (!json.data) {
|
|
69
|
+
return {
|
|
70
|
+
ok: false,
|
|
71
|
+
code: "GRAPHQL_ERROR",
|
|
72
|
+
message: "Linear response contained no data",
|
|
73
|
+
retriable: false,
|
|
74
|
+
status: raw.status,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return { ok: true, data: json.data, status: raw.status };
|
|
78
|
+
}
|
|
79
|
+
// ── Typed operation methods ──────────────────────────────────────────────
|
|
80
|
+
async getIssue(idOrIdentifier) {
|
|
81
|
+
return this.query(GET_ISSUE, {
|
|
82
|
+
id: idOrIdentifier,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async searchIssues(filter) {
|
|
86
|
+
const gqlFilter = {};
|
|
87
|
+
if (filter.team_key) {
|
|
88
|
+
gqlFilter["team"] = { key: { eq: filter.team_key } };
|
|
89
|
+
}
|
|
90
|
+
if (filter.state) {
|
|
91
|
+
gqlFilter["state"] = { name: { eq: filter.state } };
|
|
92
|
+
}
|
|
93
|
+
if (filter.assignee_email) {
|
|
94
|
+
gqlFilter["assignee"] = { email: { eq: filter.assignee_email } };
|
|
95
|
+
}
|
|
96
|
+
if (filter.text) {
|
|
97
|
+
gqlFilter["title"] = { containsIgnoreCase: filter.text };
|
|
98
|
+
}
|
|
99
|
+
return this.query(SEARCH_ISSUES, {
|
|
100
|
+
filter: Object.keys(gqlFilter).length > 0 ? gqlFilter : undefined,
|
|
101
|
+
first: filter.max_results,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async getProject(id) {
|
|
105
|
+
return this.query(GET_PROJECT, { id });
|
|
106
|
+
}
|
|
107
|
+
async getTeam(keyOrId) {
|
|
108
|
+
const isUuid = /^[0-9a-fA-F-]{32,}$/.test(keyOrId);
|
|
109
|
+
if (isUuid) {
|
|
110
|
+
return this.query(GET_TEAM, { id: keyOrId });
|
|
111
|
+
}
|
|
112
|
+
const r = await this.query(TEAMS_BY_KEY, { key: keyOrId });
|
|
113
|
+
if (!r.ok)
|
|
114
|
+
return r;
|
|
115
|
+
const team = r.data.teams.nodes[0];
|
|
116
|
+
if (!team) {
|
|
117
|
+
return {
|
|
118
|
+
ok: false,
|
|
119
|
+
code: "NOT_FOUND",
|
|
120
|
+
message: `Team with key '${keyOrId}' not found`,
|
|
121
|
+
retriable: false,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return { ok: true, data: { team }, status: r.status };
|
|
125
|
+
}
|
|
126
|
+
async getComments(issueId, maxResults) {
|
|
127
|
+
return this.query(GET_COMMENTS, { id: issueId, first: maxResults });
|
|
128
|
+
}
|
|
129
|
+
async listAttachments(issueId) {
|
|
130
|
+
return this.query(LIST_ATTACHMENTS, { id: issueId });
|
|
131
|
+
}
|
|
132
|
+
async createIssue(input) {
|
|
133
|
+
return this.query(CREATE_ISSUE, { input });
|
|
134
|
+
}
|
|
135
|
+
async updateIssue(id, input) {
|
|
136
|
+
return this.query(UPDATE_ISSUE, { id, input });
|
|
137
|
+
}
|
|
138
|
+
async archiveIssue(id) {
|
|
139
|
+
return this.query(ARCHIVE_ISSUE, { id });
|
|
140
|
+
}
|
|
141
|
+
async addComment(input) {
|
|
142
|
+
return this.query(ADD_COMMENT, { input });
|
|
143
|
+
}
|
|
144
|
+
async updateComment(id, input) {
|
|
145
|
+
return this.query(UPDATE_COMMENT, { id, input });
|
|
146
|
+
}
|
|
147
|
+
async deleteComment(id) {
|
|
148
|
+
return this.query(DELETE_COMMENT, { id });
|
|
149
|
+
}
|
|
150
|
+
async attachmentLink(input) {
|
|
151
|
+
return this.query(ATTACHMENT_LINK, { input });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=linear_client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear_client.js","sourceRoot":"","sources":["../../../../src/connectors/linear/lib/linear_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,GAIX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,YAA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IAEM,KAAK,CAAC,UAAU,CAAC,KAGvB;QAKC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5C,CAAC;IAEM,KAAK,CAAC,aAAa,CACxB,EAAU,EACV,KAAuB;QASvB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,aAAa,CACxB,EAAU;QAEV,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,KAM3B;QAaC,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const GET_ISSUE = "\n query GetIssue($id: String!) {\n issue(id: $id) {\n id\n identifier\n title\n description\n priority\n url\n archivedAt\n createdAt\n updatedAt\n state { id name type }\n assignee { id name email displayName }\n team { id key name }\n labels { nodes { id name color } }\n }\n }\n";
|
|
2
|
+
export declare const SEARCH_ISSUES = "\n query SearchIssues($filter: IssueFilter, $first: Int) {\n issues(filter: $filter, first: $first) {\n nodes {\n id\n identifier\n title\n priority\n url\n createdAt\n updatedAt\n state { name type }\n assignee { displayName email }\n team { key name }\n }\n pageInfo { hasNextPage endCursor }\n }\n }\n";
|
|
3
|
+
export declare const GET_PROJECT = "\n query GetProject($id: String!) {\n project(id: $id) {\n id\n name\n description\n state\n startDate\n targetDate\n createdAt\n updatedAt\n }\n }\n";
|
|
4
|
+
export declare const GET_TEAM = "\n query GetTeam($id: String!) {\n team(id: $id) {\n id\n key\n name\n description\n }\n }\n";
|
|
5
|
+
export declare const TEAMS_BY_KEY = "\n query TeamsByKey($key: String!) {\n teams(filter: { key: { eq: $key } }) {\n nodes {\n id\n key\n name\n description\n }\n }\n }\n";
|
|
6
|
+
export declare const GET_COMMENTS = "\n query GetComments($id: String!, $first: Int) {\n issue(id: $id) {\n comments(first: $first) {\n nodes {\n id\n body\n createdAt\n updatedAt\n user { id name displayName email }\n }\n pageInfo { hasNextPage }\n }\n }\n }\n";
|
|
7
|
+
export declare const LIST_ATTACHMENTS = "\n query ListAttachments($id: String!) {\n issue(id: $id) {\n attachments {\n nodes {\n id\n title\n subtitle\n url\n createdAt\n creator { displayName }\n }\n }\n }\n }\n";
|
|
8
|
+
export declare const CREATE_ISSUE = "\n mutation CreateIssue($input: IssueCreateInput!) {\n issueCreate(input: $input) {\n success\n issue {\n id\n identifier\n url\n title\n createdAt\n }\n }\n }\n";
|
|
9
|
+
export declare const UPDATE_ISSUE = "\n mutation UpdateIssue($id: String!, $input: IssueUpdateInput!) {\n issueUpdate(id: $id, input: $input) {\n success\n issue {\n id\n identifier\n updatedAt\n }\n }\n }\n";
|
|
10
|
+
export declare const ARCHIVE_ISSUE = "\n mutation ArchiveIssue($id: String!) {\n issueArchive(id: $id) {\n success\n }\n }\n";
|
|
11
|
+
export declare const ADD_COMMENT = "\n mutation AddComment($input: CommentCreateInput!) {\n commentCreate(input: $input) {\n success\n comment {\n id\n body\n createdAt\n user { displayName }\n }\n }\n }\n";
|
|
12
|
+
export declare const UPDATE_COMMENT = "\n mutation UpdateComment($id: String!, $input: CommentUpdateInput!) {\n commentUpdate(id: $id, input: $input) {\n success\n comment {\n id\n body\n updatedAt\n }\n }\n }\n";
|
|
13
|
+
export declare const DELETE_COMMENT = "\n mutation DeleteComment($id: String!) {\n commentDelete(id: $id) {\n success\n }\n }\n";
|
|
14
|
+
export declare const ATTACHMENT_LINK = "\n mutation AttachmentLink($input: AttachmentCreateInput!) {\n attachmentCreate(input: $input) {\n success\n attachment {\n id\n title\n url\n createdAt\n }\n }\n }\n";
|
|
15
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../src/connectors/linear/lib/queries.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,wWAkBrB,CAAC;AAEF,eAAO,MAAM,aAAa,kZAkBzB,CAAC;AAEF,eAAO,MAAM,WAAW,0MAavB,CAAC;AAEF,eAAO,MAAM,QAAQ,6HASpB,CAAC;AAEF,eAAO,MAAM,YAAY,wLAWxB,CAAC;AAEF,eAAO,MAAM,YAAY,yTAexB,CAAC;AAEF,eAAO,MAAM,gBAAgB,sQAe5B,CAAC;AAIF,eAAO,MAAM,YAAY,gOAaxB,CAAC;AAEF,eAAO,MAAM,YAAY,2NAWxB,CAAC;AAEF,eAAO,MAAM,aAAa,wGAMzB,CAAC;AAEF,eAAO,MAAM,WAAW,iOAYvB,CAAC;AAEF,eAAO,MAAM,cAAc,6NAW1B,CAAC;AAEF,eAAO,MAAM,cAAc,0GAM1B,CAAC;AAEF,eAAO,MAAM,eAAe,8NAY3B,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// Named GraphQL query/mutation strings for the Linear connector.
|
|
2
|
+
// Field selections are intentionally lean — only what handlers surface.
|
|
3
|
+
export const GET_ISSUE = `
|
|
4
|
+
query GetIssue($id: String!) {
|
|
5
|
+
issue(id: $id) {
|
|
6
|
+
id
|
|
7
|
+
identifier
|
|
8
|
+
title
|
|
9
|
+
description
|
|
10
|
+
priority
|
|
11
|
+
url
|
|
12
|
+
archivedAt
|
|
13
|
+
createdAt
|
|
14
|
+
updatedAt
|
|
15
|
+
state { id name type }
|
|
16
|
+
assignee { id name email displayName }
|
|
17
|
+
team { id key name }
|
|
18
|
+
labels { nodes { id name color } }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
export const SEARCH_ISSUES = `
|
|
23
|
+
query SearchIssues($filter: IssueFilter, $first: Int) {
|
|
24
|
+
issues(filter: $filter, first: $first) {
|
|
25
|
+
nodes {
|
|
26
|
+
id
|
|
27
|
+
identifier
|
|
28
|
+
title
|
|
29
|
+
priority
|
|
30
|
+
url
|
|
31
|
+
createdAt
|
|
32
|
+
updatedAt
|
|
33
|
+
state { name type }
|
|
34
|
+
assignee { displayName email }
|
|
35
|
+
team { key name }
|
|
36
|
+
}
|
|
37
|
+
pageInfo { hasNextPage endCursor }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
export const GET_PROJECT = `
|
|
42
|
+
query GetProject($id: String!) {
|
|
43
|
+
project(id: $id) {
|
|
44
|
+
id
|
|
45
|
+
name
|
|
46
|
+
description
|
|
47
|
+
state
|
|
48
|
+
startDate
|
|
49
|
+
targetDate
|
|
50
|
+
createdAt
|
|
51
|
+
updatedAt
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const GET_TEAM = `
|
|
56
|
+
query GetTeam($id: String!) {
|
|
57
|
+
team(id: $id) {
|
|
58
|
+
id
|
|
59
|
+
key
|
|
60
|
+
name
|
|
61
|
+
description
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
export const TEAMS_BY_KEY = `
|
|
66
|
+
query TeamsByKey($key: String!) {
|
|
67
|
+
teams(filter: { key: { eq: $key } }) {
|
|
68
|
+
nodes {
|
|
69
|
+
id
|
|
70
|
+
key
|
|
71
|
+
name
|
|
72
|
+
description
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
export const GET_COMMENTS = `
|
|
78
|
+
query GetComments($id: String!, $first: Int) {
|
|
79
|
+
issue(id: $id) {
|
|
80
|
+
comments(first: $first) {
|
|
81
|
+
nodes {
|
|
82
|
+
id
|
|
83
|
+
body
|
|
84
|
+
createdAt
|
|
85
|
+
updatedAt
|
|
86
|
+
user { id name displayName email }
|
|
87
|
+
}
|
|
88
|
+
pageInfo { hasNextPage }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
export const LIST_ATTACHMENTS = `
|
|
94
|
+
query ListAttachments($id: String!) {
|
|
95
|
+
issue(id: $id) {
|
|
96
|
+
attachments {
|
|
97
|
+
nodes {
|
|
98
|
+
id
|
|
99
|
+
title
|
|
100
|
+
subtitle
|
|
101
|
+
url
|
|
102
|
+
createdAt
|
|
103
|
+
creator { displayName }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
109
|
+
// Mutations
|
|
110
|
+
export const CREATE_ISSUE = `
|
|
111
|
+
mutation CreateIssue($input: IssueCreateInput!) {
|
|
112
|
+
issueCreate(input: $input) {
|
|
113
|
+
success
|
|
114
|
+
issue {
|
|
115
|
+
id
|
|
116
|
+
identifier
|
|
117
|
+
url
|
|
118
|
+
title
|
|
119
|
+
createdAt
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
export const UPDATE_ISSUE = `
|
|
125
|
+
mutation UpdateIssue($id: String!, $input: IssueUpdateInput!) {
|
|
126
|
+
issueUpdate(id: $id, input: $input) {
|
|
127
|
+
success
|
|
128
|
+
issue {
|
|
129
|
+
id
|
|
130
|
+
identifier
|
|
131
|
+
updatedAt
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
export const ARCHIVE_ISSUE = `
|
|
137
|
+
mutation ArchiveIssue($id: String!) {
|
|
138
|
+
issueArchive(id: $id) {
|
|
139
|
+
success
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
export const ADD_COMMENT = `
|
|
144
|
+
mutation AddComment($input: CommentCreateInput!) {
|
|
145
|
+
commentCreate(input: $input) {
|
|
146
|
+
success
|
|
147
|
+
comment {
|
|
148
|
+
id
|
|
149
|
+
body
|
|
150
|
+
createdAt
|
|
151
|
+
user { displayName }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
156
|
+
export const UPDATE_COMMENT = `
|
|
157
|
+
mutation UpdateComment($id: String!, $input: CommentUpdateInput!) {
|
|
158
|
+
commentUpdate(id: $id, input: $input) {
|
|
159
|
+
success
|
|
160
|
+
comment {
|
|
161
|
+
id
|
|
162
|
+
body
|
|
163
|
+
updatedAt
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
`;
|
|
168
|
+
export const DELETE_COMMENT = `
|
|
169
|
+
mutation DeleteComment($id: String!) {
|
|
170
|
+
commentDelete(id: $id) {
|
|
171
|
+
success
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
export const ATTACHMENT_LINK = `
|
|
176
|
+
mutation AttachmentLink($input: AttachmentCreateInput!) {
|
|
177
|
+
attachmentCreate(input: $input) {
|
|
178
|
+
success
|
|
179
|
+
attachment {
|
|
180
|
+
id
|
|
181
|
+
title
|
|
182
|
+
url
|
|
183
|
+
createdAt
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
`;
|
|
188
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../../src/connectors/linear/lib/queries.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,wEAAwE;AAExE,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;CAkBxB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;CAkB5B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;CAa1B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;CASvB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;CAW3B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;CAe3B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;CAe/B,CAAC;AAEF,YAAY;AAEZ,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;CAa3B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;CAW3B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;CAM5B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;CAY1B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;CAW7B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;CAM7B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;CAY9B,CAAC"}
|
|
@@ -10,11 +10,12 @@ import { NotionClient } from "./lib/notion_client.js";
|
|
|
10
10
|
export interface BuildOptions {
|
|
11
11
|
sdk?: () => Promise<NotionClient>;
|
|
12
12
|
credentials?: () => Promise<Record<string, unknown>>;
|
|
13
|
+
defaultPolicy?: import("narai-primitives/toolkit").PolicyRules;
|
|
13
14
|
}
|
|
14
15
|
export declare function buildNotionConnector(overrides?: BuildOptions): Connector;
|
|
15
16
|
declare const connector: Connector;
|
|
16
17
|
export default connector;
|
|
17
18
|
export declare const main: (argv: readonly string[]) => Promise<number>, fetch: (action: string, params: unknown) => Promise<import("narai-primitives/toolkit").Envelope>, validActions: ReadonlySet<string>;
|
|
18
19
|
export { NotionClient, extractTitleFromPage, loadNotionCredentials, type NotionClientOptions, type NotionResult, } from "./lib/notion_client.js";
|
|
19
|
-
export { NotionError } from "
|
|
20
|
+
export { ConnectorError as NotionError } from "narai-primitives/toolkit";
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/notion/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/notion/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,YAAY,EAIb,MAAM,wBAAwB,CAAC;AAgMhC,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,aAAa,CAAC,EAAE,OAAO,0BAA0B,EAAE,WAAW,CAAC;CAChE;AAED,wBAAgB,oBAAoB,CAAC,SAAS,GAAE,YAAiB,GAAG,SAAS,CAkX5E;AAGD,QAAA,MAAM,SAAS,WAAyB,CAAC;AACzC,eAAe,SAAS,CAAC;AACzB,eAAO,MAAQ,IAAI,gDAAE,KAAK,6FAAE,YAAY,qBAAc,CAAC;AAGvD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
|