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
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bridges JiraClient's `{ok: false, code, ...}` result shape to the
|
|
3
|
-
* handler-throws-an-Error contract the factory expects.
|
|
4
|
-
*/
|
|
5
|
-
export class JiraError extends Error {
|
|
6
|
-
code;
|
|
7
|
-
retriable;
|
|
8
|
-
httpStatus;
|
|
9
|
-
constructor(code, message, retriable, httpStatus) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.name = "JiraError";
|
|
12
|
-
this.code = code;
|
|
13
|
-
this.retriable = retriable;
|
|
14
|
-
this.httpStatus = httpStatus;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=jira_error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jira_error.js","sourceRoot":"","sources":["../../../../src/connectors/jira/lib/jira_error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACzB,IAAI,CAAS;IACb,SAAS,CAAU;IACnB,UAAU,CAAqB;IAExC,YACE,IAAY,EACZ,OAAe,EACf,SAAkB,EAClB,UAAmB;QAEnB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bridges NotionClient's `{ok: false, code, ...}` result shape to the
|
|
3
|
-
* handler-throws-an-Error contract the factory expects. `mapError` unwraps
|
|
4
|
-
* these back into canonical error envelopes.
|
|
5
|
-
*/
|
|
6
|
-
export declare class NotionError extends Error {
|
|
7
|
-
readonly code: string;
|
|
8
|
-
readonly retriable: boolean;
|
|
9
|
-
readonly httpStatus: number | undefined;
|
|
10
|
-
constructor(code: string, message: string, retriable: boolean, httpStatus?: number);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=notion_error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notion_error.d.ts","sourceRoot":"","sources":["../../../../src/connectors/notion/lib/notion_error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;gBAGtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,OAAO,EAClB,UAAU,CAAC,EAAE,MAAM;CAQtB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bridges NotionClient's `{ok: false, code, ...}` result shape to the
|
|
3
|
-
* handler-throws-an-Error contract the factory expects. `mapError` unwraps
|
|
4
|
-
* these back into canonical error envelopes.
|
|
5
|
-
*/
|
|
6
|
-
export class NotionError extends Error {
|
|
7
|
-
code;
|
|
8
|
-
retriable;
|
|
9
|
-
httpStatus;
|
|
10
|
-
constructor(code, message, retriable, httpStatus) {
|
|
11
|
-
super(message);
|
|
12
|
-
this.name = "NotionError";
|
|
13
|
-
this.code = code;
|
|
14
|
-
this.retriable = retriable;
|
|
15
|
-
this.httpStatus = httpStatus;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=notion_error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notion_error.js","sourceRoot":"","sources":["../../../../src/connectors/notion/lib/notion_error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAS;IACb,SAAS,CAAU;IACnB,UAAU,CAAqB;IAExC,YACE,IAAY,EACZ,OAAe,EACf,SAAkB,EAClB,UAAmB;QAEnB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* SessionStart curation reminder for the AWS connector.
|
|
4
|
-
*/
|
|
5
|
-
try {
|
|
6
|
-
const data = process.env.CLAUDE_PLUGIN_DATA;
|
|
7
|
-
if (!data) process.exit(0);
|
|
8
|
-
const toolkitEntry = `${data}/node_modules/narai-primitives/dist/toolkit/plugin/reminder.js`;
|
|
9
|
-
const mod = await import(toolkitEntry);
|
|
10
|
-
const decision = mod.evaluateNudge({ connectors: ["aws"] });
|
|
11
|
-
if (decision.nudge) {
|
|
12
|
-
process.stdout.write(decision.banner + "\n");
|
|
13
|
-
}
|
|
14
|
-
} catch {
|
|
15
|
-
// best-effort — reminder never blocks startup
|
|
16
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aws-agent-plugin-runtime",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"description": "Runtime manifest for aws-agent-plugin. The SessionStart hook runs `npm install` on this manifest into ${CLAUDE_PLUGIN_DATA}.",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"narai-primitives": "^2.0.0"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Run a read-only Confluence query via the confluence-agent connector
|
|
3
|
-
argument-hint: "<action> <params-json>"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Invoke the `confluence-agent` skill with the user's $ARGUMENTS as the action name and params JSON. Return the connector's JSON envelope verbatim.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hooks": {
|
|
3
|
-
"SessionStart": [
|
|
4
|
-
{
|
|
5
|
-
"hooks": [
|
|
6
|
-
{
|
|
7
|
-
"type": "command",
|
|
8
|
-
"command": "diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (mkdir -p \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/\" && cd \"${CLAUDE_PLUGIN_DATA}\" && npm install --no-audit --no-fund) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\""
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"type": "command",
|
|
12
|
-
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/reminder.mjs\" 2>/dev/null || true"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"type": "command",
|
|
16
|
-
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/narai-primitives/plugin-hooks/stale-summarize.mjs\" 2>/dev/null || true",
|
|
17
|
-
"env": { "USAGE_CONNECTOR_NAME": "confluence" }
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"PostToolUse": [
|
|
23
|
-
{
|
|
24
|
-
"matcher": "Bash",
|
|
25
|
-
"hooks": [
|
|
26
|
-
{
|
|
27
|
-
"type": "command",
|
|
28
|
-
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/narai-primitives/plugin-hooks/usage-record.mjs\" 2>/dev/null || true",
|
|
29
|
-
"env": {
|
|
30
|
-
"USAGE_CONNECTOR_NAME": "confluence",
|
|
31
|
-
"USAGE_BIN_HINT": "narai-primitives/dist/connectors/confluence"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"SessionEnd": [
|
|
38
|
-
{
|
|
39
|
-
"hooks": [
|
|
40
|
-
{
|
|
41
|
-
"type": "command",
|
|
42
|
-
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/narai-primitives/plugin-hooks/session-summary.mjs\" 2>/dev/null || true",
|
|
43
|
-
"env": { "USAGE_CONNECTOR_NAME": "confluence" }
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* SessionStart curation reminder. Runs after the install hook.
|
|
4
|
-
*
|
|
5
|
-
* Imports `evaluateNudge` from the installed toolkit (lives under
|
|
6
|
-
* `${CLAUDE_PLUGIN_DATA}/node_modules`), checks thresholds + user skip
|
|
7
|
-
* state in `~/.claude/connectors/curation-prefs.json`, and prints one
|
|
8
|
-
* banner line if the Confluence connector has uncurated hardship entries
|
|
9
|
-
* worth reviewing.
|
|
10
|
-
*
|
|
11
|
-
* Non-failing: any error (missing toolkit, unreadable prefs, etc.) is
|
|
12
|
-
* swallowed. A missing nudge is better than a noisy session start.
|
|
13
|
-
*/
|
|
14
|
-
try {
|
|
15
|
-
const data = process.env.CLAUDE_PLUGIN_DATA;
|
|
16
|
-
if (!data) process.exit(0);
|
|
17
|
-
const toolkitEntry = `${data}/node_modules/narai-primitives/dist/toolkit/plugin/reminder.js`;
|
|
18
|
-
const mod = await import(toolkitEntry);
|
|
19
|
-
const decision = mod.evaluateNudge({ connectors: ["confluence"] });
|
|
20
|
-
if (decision.nudge) {
|
|
21
|
-
process.stdout.write(decision.banner + "\n");
|
|
22
|
-
}
|
|
23
|
-
} catch {
|
|
24
|
-
// best-effort — reminder never blocks startup
|
|
25
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: confluence-agent
|
|
3
|
-
description: |
|
|
4
|
-
Use when the user asks about read-only Confluence content — search via
|
|
5
|
-
CQL, single page retrieval, or space metadata. Never modifies
|
|
6
|
-
Confluence content.
|
|
7
|
-
context: fork
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Confluence Agent
|
|
11
|
-
|
|
12
|
-
Answer the user's question by invoking the `confluence-agent` binary
|
|
13
|
-
exposed by this plugin. It delegates to
|
|
14
|
-
`narai-primitives/confluence` via Atlassian's Confluence REST v1.
|
|
15
|
-
|
|
16
|
-
## Invocation
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
confluence-agent --action <action> --params '<json>'
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Return the connector's JSON envelope verbatim.
|
|
23
|
-
|
|
24
|
-
## Supported actions
|
|
25
|
-
|
|
26
|
-
| Action | Required params |
|
|
27
|
-
|---|---|
|
|
28
|
-
| `cql_search` | `cql`, optional `max_results` |
|
|
29
|
-
| `get_page` | `page_id` (numeric), optional `expand` |
|
|
30
|
-
| `get_space` | `space_key` (e.g. `DEV`) |
|
|
31
|
-
|
|
32
|
-
## Credentials
|
|
33
|
-
|
|
34
|
-
Set `CONFLUENCE_SITE_URL`, `CONFLUENCE_EMAIL`, `CONFLUENCE_API_TOKEN`
|
|
35
|
-
before use.
|
|
36
|
-
|
|
37
|
-
## Safety
|
|
38
|
-
|
|
39
|
-
Read-only — only GET requests are permitted by the connector's HTTP
|
|
40
|
-
method whitelist.
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: create-connector
|
|
3
|
-
description: |
|
|
4
|
-
Use this skill when the user wants to add a custom connector to their project —
|
|
5
|
-
wrapping a SaaS API, REST endpoint, GraphQL endpoint, SDK, or CLI tool so
|
|
6
|
-
Claude can call it via `gather()` from `narai-primitives`. Trigger even when
|
|
7
|
-
the user doesn't say "connector" explicitly: phrases like "I want to query
|
|
8
|
-
Stripe from Claude", "add Slack to our agents", "wrap our internal orders
|
|
9
|
-
API", "connect Salesforce", "make a Linear agent" all warrant this skill.
|
|
10
|
-
Scaffolds a minimal local connector at `.connectors/connectors/<name>/`
|
|
11
|
-
(project scope, default) or `~/.connectors/connectors/<name>/` (user scope) —
|
|
12
|
-
no `git init`, no `npm publish`, no plugin manifest, no marketplace entry.
|
|
13
|
-
Do NOT use for: modifying an existing connector (just edit the file),
|
|
14
|
-
wrapping an MCP server (different abstraction), querying databases (the `db`
|
|
15
|
-
connector inside narai-primitives already covers postgres/mysql/sqlite/mssql/
|
|
16
|
-
mongodb/dynamodb/oracle), or contributing a new builtin connector (that's a
|
|
17
|
-
PR to https://github.com/narailabs/narai-primitives — see its CONTRIBUTING.md).
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
# create-connector
|
|
21
|
-
|
|
22
|
-
Scaffold a custom connector that the user's local installation loads via `narai-primitives`'s `gather()`. The connector is **local-only**: it does not get published to npm, does not become a Claude Code plugin, and does not go in any marketplace. The user can later send a PR to `narailabs/narai-primitives` if their connector turns out to be broadly useful — that's a separate flow.
|
|
23
|
-
|
|
24
|
-
## What gets created
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
<scope>/.connectors/connectors/<slug>/
|
|
28
|
-
├── SKILL.md # Describes actions; read by gather()'s planner
|
|
29
|
-
├── index.mjs # Uses createConnector from narai-primitives
|
|
30
|
-
├── bin/<slug> # Shell shim → exec node ../index.mjs
|
|
31
|
-
└── (optional) tests/example.test.mjs
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Plus one entry appended to `<scope>/.connectors/config.yaml`:
|
|
35
|
-
|
|
36
|
-
```yaml
|
|
37
|
-
connectors:
|
|
38
|
-
<slug>:
|
|
39
|
-
skill: <abs-path-to-connector-dir> # path-style (config-loader supports it)
|
|
40
|
-
bin: <abs-path-to-bin>
|
|
41
|
-
enabled: true
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
That's it — the connector is reachable via `gather()` immediately. No install, no publish, no restart.
|
|
45
|
-
|
|
46
|
-
## When to invoke
|
|
47
|
-
|
|
48
|
-
Use this skill when the user wants to **create a new custom connector** for local use.
|
|
49
|
-
|
|
50
|
-
Classic phrasings:
|
|
51
|
-
- "I want to wrap the Stripe API"
|
|
52
|
-
- "Make me a Slack connector"
|
|
53
|
-
- "We need a connector for our internal orders API"
|
|
54
|
-
- "Add Linear to our agents"
|
|
55
|
-
|
|
56
|
-
Near-miss phrasings (still trigger):
|
|
57
|
-
- "I want to query Stripe from Claude"
|
|
58
|
-
- "Connect Salesforce to Claude Code"
|
|
59
|
-
- "Make a thing that lets me search Jira from Claude"
|
|
60
|
-
|
|
61
|
-
**Do NOT use this skill for:**
|
|
62
|
-
|
|
63
|
-
- **Modifying an existing connector.** Just edit the file directly.
|
|
64
|
-
- **Wrapping an MCP server.** MCP servers and connectors are different abstractions in Claude Code. Point the user at the Claude Code MCP docs.
|
|
65
|
-
- **Querying a database.** `narai-primitives/db` covers postgres, mysql, sqlite, mssql, mongodb, dynamodb, oracle. See `references/db-agent-pointer.md`. Only suggest a custom DB connector if it's a backend the bundled `db` connector doesn't support.
|
|
66
|
-
- **Contributing a builtin connector to `narai-primitives`.** That's a different flow (PR to the bundle's repo, separate test suite, plugin marketplace entry). This skill is for end-user local connectors only.
|
|
67
|
-
|
|
68
|
-
## Policy gate is automatic
|
|
69
|
-
|
|
70
|
-
Every connector built on `createConnector` from `narai-primitives/toolkit` gets the policy gate **automatically**. Classification (`read` / `write` / `delete` / `admin` / `privilege`), approval-mode resolution (`auto` / `confirm_once` / `confirm_each` / `grant_required`), escalation, audit logging, and hardship recording all flow from the toolkit — you don't import any extra modules and don't write any approval logic yourself.
|
|
71
|
-
|
|
72
|
-
What you **do** choose:
|
|
73
|
-
|
|
74
|
-
- The **classification** of each action (defaults to `read`).
|
|
75
|
-
- The **approval mode** for the connector (defaults to `auto` for read-only connectors).
|
|
76
|
-
|
|
77
|
-
Both surface in the interview only when relevant.
|
|
78
|
-
|
|
79
|
-
## Interview
|
|
80
|
-
|
|
81
|
-
Conversational, not a fixed form. Capture the essentials in **5–7 quick exchanges**, then generate a draft and let the user react. People react faster than they author from scratch.
|
|
82
|
-
|
|
83
|
-
### 1. Scope
|
|
84
|
-
|
|
85
|
-
Ask: *"Should this connector be available only in this project, or for all your projects?"*
|
|
86
|
-
|
|
87
|
-
| Choice | Where it lives | Default for |
|
|
88
|
-
|---|---|---|
|
|
89
|
-
| **Project (default)** | `./.connectors/connectors/<slug>/` | repo-specific stuff ("our internal orders API") |
|
|
90
|
-
| **User** | `~/.connectors/connectors/<slug>/` | personal tools ("my company's Linear") |
|
|
91
|
-
|
|
92
|
-
Pick a sensible default based on the user's phrasing. Confirm with them. The scope determines:
|
|
93
|
-
- Where files get written
|
|
94
|
-
- Which `config.yaml` gets the entry (`./.connectors/config.yaml` for project, `~/.connectors/config.yaml` for user)
|
|
95
|
-
|
|
96
|
-
### 2. Identity
|
|
97
|
-
|
|
98
|
-
Ask: *"What's the service slug?"*
|
|
99
|
-
|
|
100
|
-
- **Slug**: lowercase, alphanumeric + hyphens (e.g., `stripe`, `slack`, `linear`, `acme`, `acme-orders`). Used everywhere — directory name, bin name, config key, envelope `name`.
|
|
101
|
-
- **Description**: one sentence (e.g., "Read-only Stripe connector: customers, charges, invoices.")
|
|
102
|
-
|
|
103
|
-
Record. Move on.
|
|
104
|
-
|
|
105
|
-
### 3. Auth
|
|
106
|
-
|
|
107
|
-
Ask: *"How does authentication work for this API?"*
|
|
108
|
-
|
|
109
|
-
Map the answer to one of:
|
|
110
|
-
|
|
111
|
-
- **`bearer-token-env-var`** (default) — single env var like `STRIPE_API_KEY`, used as `Authorization: Bearer …`.
|
|
112
|
-
- **`api-key-header-env-var`** — single env var, used as a custom header like `X-API-Key`. Capture the header name.
|
|
113
|
-
- **`multi-secret`** — multiple env vars (e.g., `GITHUB_TOKEN` + `GITHUB_OWNER`). Capture each pairing of `config-key → env-var`.
|
|
114
|
-
- **`basic-auth`** — username + password env vars.
|
|
115
|
-
- **`oauth-with-refresh`** — leave a `// TODO` placeholder in `loadCredentials`. Tell the user explicitly: *"You'll need to implement the OAuth flow before the connector will work."*
|
|
116
|
-
- **`custom`** — anything else (mTLS, signed URLs, etc.). Same TODO treatment.
|
|
117
|
-
|
|
118
|
-
See `references/auth-patterns.md` for per-scheme `loadCredentials` snippets.
|
|
119
|
-
|
|
120
|
-
### 4. API basics
|
|
121
|
-
|
|
122
|
-
Ask: *"What's the API base URL? Any rate limit or versioning header you know about?"*
|
|
123
|
-
|
|
124
|
-
Defaults:
|
|
125
|
-
- **Rate limit**: 60/min. Adjust if the user knows.
|
|
126
|
-
- **Read timeout**: 30s.
|
|
127
|
-
- **User-Agent**: `narai-custom-<slug>` (helps the upstream service identify the caller).
|
|
128
|
-
|
|
129
|
-
### 5. Action surface
|
|
130
|
-
|
|
131
|
-
Ask: *"What actions should this connector expose? Just describe them — name, what it does, what params, what it returns."*
|
|
132
|
-
|
|
133
|
-
The user will say something like *"`get_customer` takes an id, returns the customer. `list_charges` takes optional `customer_id` and `limit` (default 25), returns a list."*
|
|
134
|
-
|
|
135
|
-
You write the Zod schemas, pick HTTP methods/endpoints (ask if not obvious), and assign default classifications:
|
|
136
|
-
|
|
137
|
-
- Names starting with `get_*`, `list_*`, `search_*`, `query_*`, `fetch_*` → `read`
|
|
138
|
-
- Names starting with `create_*`, `post_*`, `send_*`, `update_*`, `patch_*` → `write`
|
|
139
|
-
- Names starting with `delete_*`, `remove_*`, `archive_*` → `delete`
|
|
140
|
-
- Names starting with `grant_*`, `revoke_*` → `privilege`
|
|
141
|
-
|
|
142
|
-
Override on user signal — if they say *"this one mutates state"*, classify as `write` even if the name says otherwise.
|
|
143
|
-
|
|
144
|
-
See `references/action-design.md` for Zod schema patterns and the full classification → approval-mode table.
|
|
145
|
-
|
|
146
|
-
### 6. Approval mode (only if non-read actions exist)
|
|
147
|
-
|
|
148
|
-
If any action is non-`read`, ask: *"For the write/delete actions, how should the user approve them — `auto` (no prompt), `confirm_once` (per session), `confirm_each` (every call), or `grant_required` (out-of-band)?"*
|
|
149
|
-
|
|
150
|
-
Defaults:
|
|
151
|
-
- `read` → `auto`
|
|
152
|
-
- `write` → `confirm_once`
|
|
153
|
-
- `delete` → `confirm_each`
|
|
154
|
-
- `admin` / `privilege` → `grant_required`
|
|
155
|
-
|
|
156
|
-
Skip entirely if all actions are read.
|
|
157
|
-
|
|
158
|
-
### 7. Confirmation
|
|
159
|
-
|
|
160
|
-
Show the user a summary:
|
|
161
|
-
|
|
162
|
-
- File tree that will be created
|
|
163
|
-
- Actions table with classifications
|
|
164
|
-
- Auth scheme + env vars
|
|
165
|
-
- Scope path (project or user)
|
|
166
|
-
|
|
167
|
-
Ask: *"Anything to change before I scaffold?"* Wait for explicit OK.
|
|
168
|
-
|
|
169
|
-
## Scaffold
|
|
170
|
-
|
|
171
|
-
Templates live at `assets/templates/`. Three files plus an optional test:
|
|
172
|
-
|
|
173
|
-
| Stamp | From template | Substitutions |
|
|
174
|
-
|---|---|---|
|
|
175
|
-
| `<scope>/.connectors/connectors/<slug>/index.mjs` | `assets/templates/index.mjs.tmpl` | slug, description, auth, action specs |
|
|
176
|
-
| `<scope>/.connectors/connectors/<slug>/bin/<slug>` | `assets/templates/bin.tmpl` | slug |
|
|
177
|
-
| `<scope>/.connectors/connectors/<slug>/SKILL.md` | `assets/templates/connector-SKILL.md.tmpl` | slug, description, action surface |
|
|
178
|
-
| `<scope>/.connectors/connectors/<slug>/tests/example.test.mjs` (optional) | `assets/templates/tests-example.mjs.tmpl` | slug, first action |
|
|
179
|
-
|
|
180
|
-
After stamping:
|
|
181
|
-
|
|
182
|
-
1. `chmod +x <bin>` so the shim is executable.
|
|
183
|
-
2. Open `<scope>/.connectors/config.yaml` (create it if missing — minimal valid file is `connectors: {}`) and append the entry under `connectors:`:
|
|
184
|
-
```yaml
|
|
185
|
-
connectors:
|
|
186
|
-
<slug>:
|
|
187
|
-
skill: <abs-path-to-connector-dir>
|
|
188
|
-
bin: <abs-path-to-bin>
|
|
189
|
-
enabled: true
|
|
190
|
-
```
|
|
191
|
-
3. Report what was created with absolute paths.
|
|
192
|
-
|
|
193
|
-
### Placeholders
|
|
194
|
-
|
|
195
|
-
| Placeholder | Example value |
|
|
196
|
-
|---|---|
|
|
197
|
-
| `{{SLUG}}` | `stripe` |
|
|
198
|
-
| `{{ServicePascal}}` | `Stripe` (PascalCase, hyphens stripped) |
|
|
199
|
-
| `{{DESCRIPTION}}` | `Read-only Stripe connector: customers, charges, invoices.` |
|
|
200
|
-
| `{{API_BASE}}` | `https://api.stripe.com` |
|
|
201
|
-
| `{{RATE_LIMIT_PER_MIN}}` | `60` |
|
|
202
|
-
| `{{CREDENTIAL_ENV_VAR}}` | `STRIPE_API_KEY` |
|
|
203
|
-
| `{{AUTH_HEADER_ENTRY}}` | `Authorization: \`Bearer ${creds.token}\`` (one line; for `X-API-Key` it's `"X-API-Key": creds.token,`) |
|
|
204
|
-
| `{{ACTIONS_DICTIONARY}}` | the JS object literal of action handlers (filled in from interview) |
|
|
205
|
-
| `{{ACTIONS_TABLE_MD}}` | markdown table of actions for the connector's SKILL.md |
|
|
206
|
-
| `{{FIRST_ACTION}}` | first action name, used in the smoke-test invocation |
|
|
207
|
-
|
|
208
|
-
## Verify
|
|
209
|
-
|
|
210
|
-
After scaffolding:
|
|
211
|
-
|
|
212
|
-
```sh
|
|
213
|
-
# 1. Smoke-test the bin in isolation (env vars set, real API call optional).
|
|
214
|
-
<scope>/.connectors/connectors/<slug>/bin/<slug> --action <first-action> --params '{}'
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Expectation: a JSON envelope on stdout. Without credentials, expect `{"status":"error","error_code":"CONFIG_ERROR",…}` — that's the **right** shape; we're testing the dispatch plumbing, not connectivity.
|
|
218
|
-
|
|
219
|
-
```sh
|
|
220
|
-
# 2. End-to-end via the hub.
|
|
221
|
-
node -e 'import("narai-primitives").then(({gather}) => gather({prompt:"call <slug> <first-action>"}).then(r => console.log(JSON.stringify(r, null, 2))))'
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
Expectation: `gather()` plans `{ connector: "<slug>", action: "<first-action>", … }`, dispatches, returns either a success envelope (with credentials) or the same `CONFIG_ERROR` (without). The dispatch path is what's being verified.
|
|
225
|
-
|
|
226
|
-
If either fails, the most common causes are:
|
|
227
|
-
- `bin` not executable (`chmod +x`)
|
|
228
|
-
- `config.yaml` `skill:` and `bin:` paths not absolute (must be absolute, not `~/...`)
|
|
229
|
-
- `index.mjs` import path wrong (must be `narai-primitives/toolkit`, not the legacy `@narai/connector-toolkit`)
|
|
230
|
-
|
|
231
|
-
## Next steps (tell the user)
|
|
232
|
-
|
|
233
|
-
After verification:
|
|
234
|
-
|
|
235
|
-
1. **Set the credential**: `export <ENV_VAR>="…"` (or persist in their shell rc).
|
|
236
|
-
2. **Run a real action**: `node <bin> --action <action> --params '<real-params>'`. Should return `{"status":"success","data":…}`.
|
|
237
|
-
3. **(Optional) Add tests**: drop happy-path tests in `tests/` using vitest if installed locally, or skip — these are local connectors; tests are nice-to-have, not required.
|
|
238
|
-
4. **(If broadly useful)** Send a PR to `narailabs/narai-primitives` to promote the connector to a builtin — see that repo's CONTRIBUTING.md for the contributor flow (different scaffolding, with a plugin layer, marketplace entry, etc.).
|
|
239
|
-
|
|
240
|
-
If the auth scheme was `oauth-with-refresh` or `custom`, also flag: *"You'll need to implement the OAuth/custom flow in the `loadCredentials` block of `index.mjs` before the connector will work against the live API."*
|
|
241
|
-
|
|
242
|
-
## Pointers
|
|
243
|
-
|
|
244
|
-
- **Reference**: `references/connector-anatomy.md` — the createConnector contract, envelope shape, error codes.
|
|
245
|
-
- **Auth patterns**: `references/auth-patterns.md` — auth scheme → `loadCredentials` template per scheme.
|
|
246
|
-
- **Action design**: `references/action-design.md` — Zod schema patterns, classifications, handler shape.
|
|
247
|
-
- **DB redirect**: `references/db-agent-pointer.md` — when to point the user at the bundled `db` connector instead.
|
|
248
|
-
- **Builtin connectors** in `narai-primitives` (canonical examples to read for inspiration):
|
|
249
|
-
- GitHub: https://github.com/narailabs/narai-primitives/tree/main/src/connectors/github
|
|
250
|
-
- Notion: https://github.com/narailabs/narai-primitives/tree/main/src/connectors/notion
|
|
251
|
-
- DB (policy-gated, more complex): https://github.com/narailabs/narai-primitives/tree/main/src/connectors/db
|
|
252
|
-
- **Legacy version of this skill** (when connectors used to scaffold as full `@narai/<svc>-agent-connector` repos with their own npm package + plugin layer): see `SKILL.legacy.md` in this directory.
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// hooks/db-guard.mjs — db-agent-connector PreToolUse guardrail.
|
|
3
|
-
//
|
|
4
|
-
// V2.0: thin stub. Loads `plugin/hooks/guardrails.json` and delegates to
|
|
5
|
-
// the toolkit's `findBlockingRule`. The hub's unified `guardrails.mjs`
|
|
6
|
-
// reads the same manifest when the hub is installed; this file is the
|
|
7
|
-
// standalone fallback when only db-agent is installed.
|
|
8
|
-
//
|
|
9
|
-
// V2.0 regression: deny-event audit logging is no longer written from
|
|
10
|
-
// this hook (the toolkit's matcher doesn't log). The audit module still
|
|
11
|
-
// records executed-query events.
|
|
12
|
-
//
|
|
13
|
-
// Best-effort, not a security boundary. Fails open on any error.
|
|
14
|
-
|
|
15
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
16
|
-
import { homedir } from "node:os";
|
|
17
|
-
import { dirname, join } from "node:path";
|
|
18
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
19
|
-
|
|
20
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
21
|
-
const MANIFEST_PATH = join(__dirname, "guardrails.json");
|
|
22
|
-
|
|
23
|
-
function readStdin() {
|
|
24
|
-
try {
|
|
25
|
-
return readFileSync(0, "utf-8");
|
|
26
|
-
} catch {
|
|
27
|
-
return "";
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async function loadToolkit() {
|
|
32
|
-
const candidates = [
|
|
33
|
-
// 1. Bundle: db-guard at narai-primitives/plugins/db-agent/hooks/;
|
|
34
|
-
// toolkit at narai-primitives/dist/toolkit/guardrail.js (3 ups)
|
|
35
|
-
join(__dirname, "..", "..", "..", "dist", "toolkit", "guardrail.js"),
|
|
36
|
-
// 2. Bundle installed as a Claude Code plugin
|
|
37
|
-
process.env.CLAUDE_PLUGIN_DATA
|
|
38
|
-
? join(process.env.CLAUDE_PLUGIN_DATA, "node_modules", "narai-primitives", "dist", "toolkit", "guardrail.js")
|
|
39
|
-
: null,
|
|
40
|
-
// 3. Legacy plugin install
|
|
41
|
-
process.env.CLAUDE_PLUGIN_DATA
|
|
42
|
-
? join(process.env.CLAUDE_PLUGIN_DATA, "node_modules", "@narai", "connector-toolkit", "dist", "guardrail.js")
|
|
43
|
-
: null,
|
|
44
|
-
join(homedir(), "src", "connectors", "connector-toolkit", "dist", "guardrail.js"),
|
|
45
|
-
// 4. Local resolution from this file's nearest node_modules (dev sandbox).
|
|
46
|
-
join(__dirname, "..", "..", "node_modules", "@narai", "connector-toolkit", "dist", "guardrail.js"),
|
|
47
|
-
].filter((p) => p !== null);
|
|
48
|
-
for (const p of candidates) {
|
|
49
|
-
if (!existsSync(p)) continue;
|
|
50
|
-
try {
|
|
51
|
-
return await import(pathToFileURL(p).href);
|
|
52
|
-
} catch {
|
|
53
|
-
// try next
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function main() {
|
|
60
|
-
const raw = readStdin();
|
|
61
|
-
if (!raw) return;
|
|
62
|
-
|
|
63
|
-
let payload;
|
|
64
|
-
try {
|
|
65
|
-
payload = JSON.parse(raw);
|
|
66
|
-
} catch {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (payload?.tool_name !== "Bash") return;
|
|
71
|
-
if (process.env.DB_AGENT_GUARDRAILS === "off") return;
|
|
72
|
-
|
|
73
|
-
const command = payload?.tool_input?.command;
|
|
74
|
-
if (typeof command !== "string" || !command.trim()) return;
|
|
75
|
-
|
|
76
|
-
if (!existsSync(MANIFEST_PATH)) return;
|
|
77
|
-
|
|
78
|
-
const toolkit = await loadToolkit();
|
|
79
|
-
if (!toolkit) return;
|
|
80
|
-
const { findBlockingRule, defaultDenyMessage, loadGuardrailManifest } = toolkit;
|
|
81
|
-
if (typeof findBlockingRule !== "function") return;
|
|
82
|
-
|
|
83
|
-
let manifest;
|
|
84
|
-
try {
|
|
85
|
-
manifest = loadGuardrailManifest(MANIFEST_PATH);
|
|
86
|
-
} catch {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const match = findBlockingRule(command, [manifest]);
|
|
91
|
-
if (!match) return;
|
|
92
|
-
|
|
93
|
-
process.stdout.write(
|
|
94
|
-
JSON.stringify({
|
|
95
|
-
hookSpecificOutput: {
|
|
96
|
-
hookEventName: "PreToolUse",
|
|
97
|
-
permissionDecision: "deny",
|
|
98
|
-
permissionDecisionReason: defaultDenyMessage(match),
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
await main();
|
|
106
|
-
process.exit(0);
|
|
107
|
-
} catch (err) {
|
|
108
|
-
process.stderr.write(`db-guard: fail-open (${(err && err.message) || err})\n`);
|
|
109
|
-
process.exit(0);
|
|
110
|
-
}
|