narai-primitives 2.1.3 → 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 +3 -2
- package/dist/connectors/db/dispatcher.d.ts.map +1 -1
- package/dist/connectors/db/dispatcher.js +136 -40
- 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-agent → db-connector}/package.json +1 -1
- 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/{jira-agent → github-connector}/package.json +1 -1
- 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/{confluence-agent → gitlab-connector}/package.json +1 -1
- 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/{github-agent → jira-connector}/package.json +1 -1
- 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/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/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/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/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
|
+
* gitlab_client.ts — GitLab REST client. Thin wrapper over the shared
|
|
3
|
+
* `HttpClient` in `narai-primitives/toolkit`: supplies Bearer auth,
|
|
4
|
+
* sets baseUrl to `<host>/api/v4`, and allows all five HTTP methods.
|
|
5
|
+
*
|
|
6
|
+
* Read methods added in Task 3: searchCode, listIssues, getIssue,
|
|
7
|
+
* listMergeRequests, getMergeRequest, getFile, getNotes, listReleaseLinks,
|
|
8
|
+
* getReleaseLink, listPipelines, getPipeline, listPipelineJobs, getJobLogs.
|
|
9
|
+
*/
|
|
10
|
+
import { HttpClient, } from "narai-primitives/toolkit";
|
|
11
|
+
import { resolveSecret } from "narai-primitives/credentials";
|
|
12
|
+
const GITLAB_DEFAULT_HOST = "https://gitlab.com";
|
|
13
|
+
// ── Credential loader ────────────────────────────────────────────────────────
|
|
14
|
+
function emptyToNull(v) {
|
|
15
|
+
return v == null || v === "" ? null : v;
|
|
16
|
+
}
|
|
17
|
+
export async function loadGitlabCredentials() {
|
|
18
|
+
const token = emptyToNull((await resolveSecret("GITLAB_TOKEN")) ??
|
|
19
|
+
process.env["GITLAB_TOKEN"] ??
|
|
20
|
+
null);
|
|
21
|
+
if (!token)
|
|
22
|
+
return null;
|
|
23
|
+
const host = emptyToNull((await resolveSecret("GITLAB_HOST")) ??
|
|
24
|
+
process.env["GITLAB_HOST"] ??
|
|
25
|
+
null);
|
|
26
|
+
const defaultNamespace = emptyToNull((await resolveSecret("GITLAB_NAMESPACE")) ??
|
|
27
|
+
process.env["GITLAB_NAMESPACE"] ??
|
|
28
|
+
null);
|
|
29
|
+
return { token, host, defaultNamespace };
|
|
30
|
+
}
|
|
31
|
+
// ── GitlabClient ─────────────────────────────────────────────────────────────
|
|
32
|
+
export class GitlabClient {
|
|
33
|
+
_http;
|
|
34
|
+
_defaultNamespace;
|
|
35
|
+
constructor(opts) {
|
|
36
|
+
const host = opts.host ?? GITLAB_DEFAULT_HOST;
|
|
37
|
+
this._defaultNamespace = opts.defaultNamespace ?? null;
|
|
38
|
+
this._http = new HttpClient({
|
|
39
|
+
baseUrl: `${host}/api/v4`,
|
|
40
|
+
authHeader: `Bearer ${opts.token}`,
|
|
41
|
+
serviceName: "GitLab",
|
|
42
|
+
allowedMethods: new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]),
|
|
43
|
+
rateLimitPerMin: opts.rateLimitPerMin,
|
|
44
|
+
connectTimeoutMs: opts.connectTimeoutMs,
|
|
45
|
+
readTimeoutMs: opts.readTimeoutMs,
|
|
46
|
+
fetchImpl: opts.fetchImpl,
|
|
47
|
+
sleepImpl: opts.sleepImpl,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
get host() {
|
|
51
|
+
return this._http.host;
|
|
52
|
+
}
|
|
53
|
+
get defaultNamespace() {
|
|
54
|
+
return this._defaultNamespace;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Encodes `namespace/project` for use in GitLab project API paths.
|
|
58
|
+
* All slashes (including those in group/subgroup paths) are percent-encoded.
|
|
59
|
+
* Example: projectPath("group/sub", "proj") → "group%2Fsub%2Fproj"
|
|
60
|
+
*/
|
|
61
|
+
projectPath(namespace, project) {
|
|
62
|
+
return encodeURIComponent(`${namespace}/${project}`);
|
|
63
|
+
}
|
|
64
|
+
// ── Minimal HTTP wrappers ────────────────────────────────────────────────
|
|
65
|
+
async get(relPath, query) {
|
|
66
|
+
return this._http.request("GET", relPath, { query });
|
|
67
|
+
}
|
|
68
|
+
async post(relPath, body) {
|
|
69
|
+
return this._http.request("POST", relPath, { body });
|
|
70
|
+
}
|
|
71
|
+
async patch(relPath, body) {
|
|
72
|
+
return this._http.request("PATCH", relPath, { body });
|
|
73
|
+
}
|
|
74
|
+
async put(relPath, body) {
|
|
75
|
+
return this._http.request("PUT", relPath, { body });
|
|
76
|
+
}
|
|
77
|
+
async delete(relPath) {
|
|
78
|
+
return this._http.request("DELETE", relPath);
|
|
79
|
+
}
|
|
80
|
+
// ── Read methods ─────────────────────────────────────────────────────────
|
|
81
|
+
async getProject(namespace, project) {
|
|
82
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}`);
|
|
83
|
+
}
|
|
84
|
+
async searchCode(namespace, project, query, opts = {}) {
|
|
85
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/search`, { scope: "blobs", search: query, page: opts.page, per_page: opts.perPage });
|
|
86
|
+
}
|
|
87
|
+
async listIssues(namespace, project, query = {}) {
|
|
88
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/issues`, { state: query.state, per_page: query.per_page, page: query.page });
|
|
89
|
+
}
|
|
90
|
+
async getIssue(namespace, project, iid) {
|
|
91
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/issues/${iid}`);
|
|
92
|
+
}
|
|
93
|
+
async listMergeRequests(namespace, project, query = {}) {
|
|
94
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/merge_requests`, { state: query.state, per_page: query.per_page, page: query.page });
|
|
95
|
+
}
|
|
96
|
+
async getMergeRequest(namespace, project, iid) {
|
|
97
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/merge_requests/${iid}`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Fetches a file at a given ref. The path itself is URL-encoded because
|
|
101
|
+
* GitLab requires the file path to be encoded in the URL segment.
|
|
102
|
+
*/
|
|
103
|
+
async getFile(namespace, project, filePath, ref = "main") {
|
|
104
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/repository/files/${encodeURIComponent(filePath)}`, { ref });
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Fetches notes (comments) on an issue or merge request.
|
|
108
|
+
* `noteableType` is "issue" | "merge_request"; maps to URL segment
|
|
109
|
+
* "issues" or "merge_requests".
|
|
110
|
+
*/
|
|
111
|
+
async getNotes(namespace, project, noteableType, iid, opts = {}) {
|
|
112
|
+
const segment = noteableType === "issue" ? "issues" : "merge_requests";
|
|
113
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/${segment}/${iid}/notes`, { page: opts.page, per_page: opts.perPage });
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Fetches discussions (including diff/inline threads) on a merge request.
|
|
117
|
+
* GitLab's Notes API does not return DiscussionNote/DiffNote entries;
|
|
118
|
+
* those are only available via the Discussions API.
|
|
119
|
+
*/
|
|
120
|
+
async getDiscussions(namespace, project, mrIid, opts = {}) {
|
|
121
|
+
const projectPath = this.projectPath(namespace, project);
|
|
122
|
+
const query = {};
|
|
123
|
+
if (opts.page !== undefined)
|
|
124
|
+
query.page = opts.page;
|
|
125
|
+
if (opts.perPage !== undefined)
|
|
126
|
+
query.per_page = opts.perPage;
|
|
127
|
+
return this.get(`/projects/${projectPath}/merge_requests/${mrIid}/discussions`, query);
|
|
128
|
+
}
|
|
129
|
+
async listReleaseLinks(namespace, project, tag) {
|
|
130
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/releases/${encodeURIComponent(tag)}/assets/links`);
|
|
131
|
+
}
|
|
132
|
+
async getReleaseLink(namespace, project, tag, linkId) {
|
|
133
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/releases/${encodeURIComponent(tag)}/assets/links/${linkId}`);
|
|
134
|
+
}
|
|
135
|
+
async listPipelines(namespace, project, query = {}) {
|
|
136
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/pipelines`, { ref: query.ref, status: query.status, per_page: query.per_page, page: query.page });
|
|
137
|
+
}
|
|
138
|
+
async getPipeline(namespace, project, pipelineId) {
|
|
139
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/pipelines/${pipelineId}`);
|
|
140
|
+
}
|
|
141
|
+
async listPipelineJobs(namespace, project, pipelineId, opts = {}) {
|
|
142
|
+
const query = {};
|
|
143
|
+
if (opts.page !== undefined)
|
|
144
|
+
query.page = opts.page;
|
|
145
|
+
if (opts.perPage !== undefined)
|
|
146
|
+
query.per_page = opts.perPage;
|
|
147
|
+
return this.get(`/projects/${this.projectPath(namespace, project)}/pipelines/${pipelineId}/jobs`, query);
|
|
148
|
+
}
|
|
149
|
+
/** Returns the job trace log as a plain text string. */
|
|
150
|
+
async getJobLogs(namespace, project, jobId) {
|
|
151
|
+
return this._http.request("GET", `/projects/${this.projectPath(namespace, project)}/jobs/${jobId}/trace`, { responseType: "text" });
|
|
152
|
+
}
|
|
153
|
+
// ── Issue mutations ──────────────────────────────────────────────────────
|
|
154
|
+
async createIssue(namespace, project, body) {
|
|
155
|
+
return this.post(`/projects/${this.projectPath(namespace, project)}/issues`, body);
|
|
156
|
+
}
|
|
157
|
+
async updateIssue(namespace, project, iid, body) {
|
|
158
|
+
return this.put(`/projects/${this.projectPath(namespace, project)}/issues/${iid}`, body);
|
|
159
|
+
}
|
|
160
|
+
async closeIssue(namespace, project, iid) {
|
|
161
|
+
return this.put(`/projects/${this.projectPath(namespace, project)}/issues/${iid}`, { state_event: "close" });
|
|
162
|
+
}
|
|
163
|
+
// ── Merge request mutations ──────────────────────────────────────────────
|
|
164
|
+
async createMergeRequest(namespace, project, body) {
|
|
165
|
+
return this.post(`/projects/${this.projectPath(namespace, project)}/merge_requests`, body);
|
|
166
|
+
}
|
|
167
|
+
async updateMergeRequest(namespace, project, iid, body) {
|
|
168
|
+
return this.put(`/projects/${this.projectPath(namespace, project)}/merge_requests/${iid}`, body);
|
|
169
|
+
}
|
|
170
|
+
async closeMergeRequest(namespace, project, iid) {
|
|
171
|
+
return this.put(`/projects/${this.projectPath(namespace, project)}/merge_requests/${iid}`, { state_event: "close" });
|
|
172
|
+
}
|
|
173
|
+
async mergeMergeRequest(namespace, project, iid, body = {}) {
|
|
174
|
+
return this.put(`/projects/${this.projectPath(namespace, project)}/merge_requests/${iid}/merge`, body);
|
|
175
|
+
}
|
|
176
|
+
// ── Note mutations ───────────────────────────────────────────────────────
|
|
177
|
+
noteSegment(noteableType) {
|
|
178
|
+
return noteableType === "issue" ? "issues" : "merge_requests";
|
|
179
|
+
}
|
|
180
|
+
async addNote(namespace, project, noteableType, iid, body) {
|
|
181
|
+
const projectPath = this.projectPath(namespace, project);
|
|
182
|
+
const segment = this.noteSegment(noteableType);
|
|
183
|
+
// For MR diff notes (with position payload), GitLab requires the
|
|
184
|
+
// /discussions endpoint — /notes silently strips position and creates
|
|
185
|
+
// a non-diff conversation comment.
|
|
186
|
+
if (noteableType === "merge_request" && body.position) {
|
|
187
|
+
const discussionResult = await this.post(`/projects/${projectPath}/${segment}/${iid}/discussions`, body);
|
|
188
|
+
if (!discussionResult.ok)
|
|
189
|
+
return discussionResult;
|
|
190
|
+
const firstNote = discussionResult.data.notes?.[0];
|
|
191
|
+
if (!firstNote) {
|
|
192
|
+
return {
|
|
193
|
+
ok: false,
|
|
194
|
+
code: "SERVER_ERROR",
|
|
195
|
+
status: discussionResult.status,
|
|
196
|
+
message: "discussion created but no notes returned",
|
|
197
|
+
retriable: false,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
return { ok: true, status: discussionResult.status, data: firstNote };
|
|
201
|
+
}
|
|
202
|
+
return this.post(`/projects/${projectPath}/${segment}/${iid}/notes`, body);
|
|
203
|
+
}
|
|
204
|
+
async updateNote(namespace, project, noteableType, iid, noteId, body, opts = {}) {
|
|
205
|
+
const projectPath = this.projectPath(namespace, project);
|
|
206
|
+
const notePath = noteableType === "merge_request" && opts.discussionId
|
|
207
|
+
? `/projects/${projectPath}/merge_requests/${iid}/discussions/${opts.discussionId}/notes/${noteId}`
|
|
208
|
+
: `/projects/${projectPath}/${this.noteSegment(noteableType)}/${iid}/notes/${noteId}`;
|
|
209
|
+
return this.put(notePath, body);
|
|
210
|
+
}
|
|
211
|
+
async deleteNote(namespace, project, noteableType, iid, noteId, opts = {}) {
|
|
212
|
+
const projectPath = this.projectPath(namespace, project);
|
|
213
|
+
const notePath = noteableType === "merge_request" && opts.discussionId
|
|
214
|
+
? `/projects/${projectPath}/merge_requests/${iid}/discussions/${opts.discussionId}/notes/${noteId}`
|
|
215
|
+
: `/projects/${projectPath}/${this.noteSegment(noteableType)}/${iid}/notes/${noteId}`;
|
|
216
|
+
return this.delete(notePath);
|
|
217
|
+
}
|
|
218
|
+
// ── Release mutations ────────────────────────────────────────────────────
|
|
219
|
+
async createRelease(namespace, project, body) {
|
|
220
|
+
return this.post(`/projects/${this.projectPath(namespace, project)}/releases`, body);
|
|
221
|
+
}
|
|
222
|
+
async updateRelease(namespace, project, tag, body) {
|
|
223
|
+
return this.put(`/projects/${this.projectPath(namespace, project)}/releases/${encodeURIComponent(tag)}`, body);
|
|
224
|
+
}
|
|
225
|
+
async deleteRelease(namespace, project, tag) {
|
|
226
|
+
return this.delete(`/projects/${this.projectPath(namespace, project)}/releases/${encodeURIComponent(tag)}`);
|
|
227
|
+
}
|
|
228
|
+
async deleteReleaseLink(namespace, project, tag, linkId) {
|
|
229
|
+
return this.delete(`/projects/${this.projectPath(namespace, project)}/releases/${encodeURIComponent(tag)}/assets/links/${linkId}`);
|
|
230
|
+
}
|
|
231
|
+
// ── Pipeline mutations ───────────────────────────────────────────────────
|
|
232
|
+
async retryPipeline(namespace, project, pipelineId) {
|
|
233
|
+
return this.post(`/projects/${this.projectPath(namespace, project)}/pipelines/${pipelineId}/retry`);
|
|
234
|
+
}
|
|
235
|
+
async cancelPipeline(namespace, project, pipelineId) {
|
|
236
|
+
return this.post(`/projects/${this.projectPath(namespace, project)}/pipelines/${pipelineId}/cancel`);
|
|
237
|
+
}
|
|
238
|
+
async triggerPipeline(namespace, project, body) {
|
|
239
|
+
return this.post(`/projects/${this.projectPath(namespace, project)}/trigger/pipeline`, body);
|
|
240
|
+
}
|
|
241
|
+
async playJob(namespace, project, jobId, variables) {
|
|
242
|
+
const body = {};
|
|
243
|
+
if (variables !== undefined) {
|
|
244
|
+
body["job_variables_attributes"] = Object.entries(variables).map(([key, value]) => ({ key, value }));
|
|
245
|
+
}
|
|
246
|
+
return this.post(`/projects/${this.projectPath(namespace, project)}/jobs/${jobId}/play`, body);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=gitlab_client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab_client.js","sourceRoot":"","sources":["../../../../src/connectors/gitlab/lib/gitlab_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,GAEX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAmIjD,gFAAgF;AAEhF,SAAS,WAAW,CAAC,CAA4B;IAC/C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jB,OAAe,EACf,KAAa,EACb,SAAkC;QAElC,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,0BAA0B,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAC9D,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CACnC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CACd,aAAa,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,KAAK,OAAO,EACtE,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface GitlabBehavior {
|
|
2
|
+
requireDraftMr: boolean;
|
|
3
|
+
host: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface LoadGitlabBehaviorOptions {
|
|
6
|
+
cwd?: string;
|
|
7
|
+
home?: string;
|
|
8
|
+
env?: NodeJS.ProcessEnv;
|
|
9
|
+
}
|
|
10
|
+
export declare function loadGitlabBehavior(opts?: LoadGitlabBehaviorOptions): GitlabBehavior;
|
|
11
|
+
//# sourceMappingURL=gitlab_config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab_config.d.ts","sourceRoot":"","sources":["../../../../src/connectors/gitlab/lib/gitlab_config.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AA6ED,wBAAgB,kBAAkB,CAChC,IAAI,GAAE,yBAA8B,GACnC,cAAc,CA8BhB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connector-specific runtime knobs that sit outside the toolkit's
|
|
3
|
+
* policy/approval YAML. Today: `require_draft_mr` and `host`.
|
|
4
|
+
*
|
|
5
|
+
* - `require_draft_mr` — when true, every `create_merge_request` call is
|
|
6
|
+
* rewritten to draft mode regardless of caller input.
|
|
7
|
+
* - `host` — the GitLab instance base URL (default: "https://gitlab.com").
|
|
8
|
+
*
|
|
9
|
+
* Precedence for host (highest wins, as merged in defaultSdk):
|
|
10
|
+
* 1. resolveSecret("GITLAB_HOST") — secret provider (Vault, AWS SM, etc.)
|
|
11
|
+
* 2. GITLAB_HOST env var
|
|
12
|
+
* 3. <cwd>/.gitlab-agent/config.yaml `gitlab.host`
|
|
13
|
+
* 4. ~/.gitlab-agent/config.yaml `gitlab.host`
|
|
14
|
+
* 5. Default https://gitlab.com (applied in GitlabClient constructor)
|
|
15
|
+
*
|
|
16
|
+
* loadGitlabBehavior() returns host=null when neither env nor YAML sets it,
|
|
17
|
+
* allowing the caller to distinguish "explicitly configured" from "absent".
|
|
18
|
+
*
|
|
19
|
+
* Replicates the toolkit's discover-and-merge pattern locally so we don't
|
|
20
|
+
* depend on internals of `toolkit/policy/config.ts` that aren't part of
|
|
21
|
+
* its public surface.
|
|
22
|
+
*/
|
|
23
|
+
import * as fs from "node:fs";
|
|
24
|
+
import * as os from "node:os";
|
|
25
|
+
import * as path from "node:path";
|
|
26
|
+
import * as yaml from "js-yaml";
|
|
27
|
+
const TRUTHY = new Set(["1", "true", "yes"]);
|
|
28
|
+
const FALSY = new Set(["0", "false", "no"]);
|
|
29
|
+
function readYamlFile(filePath) {
|
|
30
|
+
if (!fs.existsSync(filePath))
|
|
31
|
+
return null;
|
|
32
|
+
const raw = fs.readFileSync(filePath, "utf-8");
|
|
33
|
+
const parsed = yaml.load(raw);
|
|
34
|
+
if (parsed === null || parsed === undefined)
|
|
35
|
+
return {};
|
|
36
|
+
if (typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
37
|
+
throw new Error(`gitlab config: expected a YAML mapping at root of ${filePath}, got ${Array.isArray(parsed) ? "list" : typeof parsed}`);
|
|
38
|
+
}
|
|
39
|
+
return parsed;
|
|
40
|
+
}
|
|
41
|
+
function getGitlabSection(configPath) {
|
|
42
|
+
const doc = readYamlFile(configPath);
|
|
43
|
+
if (doc === null)
|
|
44
|
+
return undefined;
|
|
45
|
+
const section = doc["gitlab"];
|
|
46
|
+
if (section === undefined)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (typeof section !== "object" || section === null || Array.isArray(section)) {
|
|
49
|
+
throw new Error(`gitlab config: 'gitlab:' section in ${configPath} must be a mapping`);
|
|
50
|
+
}
|
|
51
|
+
return section;
|
|
52
|
+
}
|
|
53
|
+
function readGitlabSectionFlag(configPath, key) {
|
|
54
|
+
const section = getGitlabSection(configPath);
|
|
55
|
+
if (section === undefined)
|
|
56
|
+
return undefined;
|
|
57
|
+
const value = section[key];
|
|
58
|
+
if (value === undefined)
|
|
59
|
+
return undefined;
|
|
60
|
+
if (typeof value !== "boolean") {
|
|
61
|
+
throw new Error(`gitlab config: 'gitlab.${key}' in ${configPath} must be a boolean, got ${typeof value}`);
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function readGitlabSectionString(configPath, key) {
|
|
66
|
+
const section = getGitlabSection(configPath);
|
|
67
|
+
if (section === undefined)
|
|
68
|
+
return undefined;
|
|
69
|
+
const value = section[key];
|
|
70
|
+
if (value === undefined)
|
|
71
|
+
return undefined;
|
|
72
|
+
if (typeof value !== "string") {
|
|
73
|
+
throw new Error(`gitlab config: 'gitlab.${key}' in ${configPath} must be a string, got ${typeof value}`);
|
|
74
|
+
}
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
function parseEnvBoolOverride(raw) {
|
|
78
|
+
if (raw === undefined || raw === "")
|
|
79
|
+
return undefined;
|
|
80
|
+
const v = raw.toLowerCase();
|
|
81
|
+
if (TRUTHY.has(v))
|
|
82
|
+
return true;
|
|
83
|
+
if (FALSY.has(v))
|
|
84
|
+
return false;
|
|
85
|
+
throw new Error(`GITLAB_REQUIRE_DRAFT_MR: expected one of 1/0/true/false/yes/no, got ${JSON.stringify(raw)}`);
|
|
86
|
+
}
|
|
87
|
+
export function loadGitlabBehavior(opts = {}) {
|
|
88
|
+
const home = opts.home ?? os.homedir();
|
|
89
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
90
|
+
const env = opts.env ?? process.env;
|
|
91
|
+
let requireDraftMr = false;
|
|
92
|
+
let host = null;
|
|
93
|
+
const userCfg = path.join(home, ".gitlab-agent", "config.yaml");
|
|
94
|
+
const repoCfg = path.join(cwd, ".gitlab-agent", "config.yaml");
|
|
95
|
+
const userDraft = readGitlabSectionFlag(userCfg, "require_draft_mr");
|
|
96
|
+
if (userDraft !== undefined)
|
|
97
|
+
requireDraftMr = userDraft;
|
|
98
|
+
const userHost = readGitlabSectionString(userCfg, "host");
|
|
99
|
+
if (userHost !== undefined)
|
|
100
|
+
host = userHost;
|
|
101
|
+
const repoDraft = readGitlabSectionFlag(repoCfg, "require_draft_mr");
|
|
102
|
+
if (repoDraft !== undefined)
|
|
103
|
+
requireDraftMr = repoDraft;
|
|
104
|
+
const repoHost = readGitlabSectionString(repoCfg, "host");
|
|
105
|
+
if (repoHost !== undefined)
|
|
106
|
+
host = repoHost;
|
|
107
|
+
const envDraft = parseEnvBoolOverride(env["GITLAB_REQUIRE_DRAFT_MR"]);
|
|
108
|
+
if (envDraft !== undefined)
|
|
109
|
+
requireDraftMr = envDraft;
|
|
110
|
+
const envHost = env["GITLAB_HOST"];
|
|
111
|
+
if (envHost !== undefined && envHost !== "")
|
|
112
|
+
host = envHost;
|
|
113
|
+
return { requireDraftMr, host };
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=gitlab_config.js.map
|
|
@@ -0,0 +1 @@
|
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C1D,IAAI,QAAQ,KAAK,SAAS;QAAE,IAAI,GAAG,QAAQ,CAAC;IAE5C,MAAM,SAAS,GAAG,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACrE,IAAI,SAAS,KAAK,SAAS;QAAE,cAAc,GAAG,SAAS,CAAC;IAExD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1D,IAAI,QAAQ,KAAK,SAAS;QAAE,IAAI,GAAG,QAAQ,CAAC;IAE5C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC;IACtE,IAAI,QAAQ,KAAK,SAAS;QAAE,cAAc,GAAG,QAAQ,CAAC;IAEtD,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC;IACnC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE;QAAE,IAAI,GAAG,OAAO,CAAC;IAE5D,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -3,11 +3,13 @@ import { JiraClient } from "./lib/jira_client.js";
|
|
|
3
3
|
export interface BuildOptions {
|
|
4
4
|
sdk?: () => Promise<JiraClient>;
|
|
5
5
|
credentials?: () => Promise<Record<string, unknown>>;
|
|
6
|
+
/** Override the default policy rules (used in tests). */
|
|
7
|
+
defaultPolicy?: import("narai-primitives/toolkit").PolicyRules;
|
|
6
8
|
}
|
|
7
9
|
export declare function buildJiraConnector(overrides?: BuildOptions): Connector;
|
|
8
10
|
declare const connector: Connector;
|
|
9
11
|
export default connector;
|
|
10
12
|
export declare const main: (argv: readonly string[]) => Promise<number>, fetch: (action: string, params: unknown) => Promise<import("narai-primitives/toolkit").Envelope>, validActions: ReadonlySet<string>;
|
|
11
13
|
export { JiraClient, loadJiraCredentials, type JiraClientOptions, type JiraResult, } from "./lib/jira_client.js";
|
|
12
|
-
export { JiraError } from "
|
|
14
|
+
export { ConnectorError as JiraError } from "narai-primitives/toolkit";
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/jira/index.ts"],"names":[],"mappings":"AAWA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/jira/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAUL,KAAK,SAAS,EAEf,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,UAAU,EAEX,MAAM,sBAAsB,CAAC;AAsM9B,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,yDAAyD;IACzD,aAAa,CAAC,EAAE,OAAO,0BAA0B,EAAE,WAAW,CAAC;CAChE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,GAAE,YAAiB,GAAG,SAAS,CA6X1E;AAGD,QAAA,MAAM,SAAS,WAAuB,CAAC;AACvC,eAAe,SAAS,CAAC;AACzB,eAAO,MAAQ,IAAI,gDAAE,KAAK,6FAAE,YAAY,qBAAc,CAAC;AAEvD,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,0BAA0B,CAAC"}
|