narai-primitives 2.0.0-rc.1
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/LICENSE +21 -0
- package/README.md +64 -0
- package/dist/config/bootstrap.d.ts +28 -0
- package/dist/config/bootstrap.d.ts.map +1 -0
- package/dist/config/bootstrap.js +80 -0
- package/dist/config/bootstrap.js.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +12 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/load.d.ts +37 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +99 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/resolve.d.ts +23 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/resolve.js +198 -0
- package/dist/config/resolve.js.map +1 -0
- package/dist/config/secrets.d.ts +20 -0
- package/dist/config/secrets.d.ts.map +1 -0
- package/dist/config/secrets.js +43 -0
- package/dist/config/secrets.js.map +1 -0
- package/dist/config/types.d.ts +104 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +11 -0
- package/dist/config/types.js.map +1 -0
- package/dist/connectors/aws/cli.d.ts +3 -0
- package/dist/connectors/aws/cli.d.ts.map +1 -0
- package/dist/connectors/aws/cli.js +27 -0
- package/dist/connectors/aws/cli.js.map +1 -0
- package/dist/connectors/aws/index.d.ts +27 -0
- package/dist/connectors/aws/index.d.ts.map +1 -0
- package/dist/connectors/aws/index.js +281 -0
- package/dist/connectors/aws/index.js.map +1 -0
- package/dist/connectors/aws/lib/aws_client.d.ts +140 -0
- package/dist/connectors/aws/lib/aws_client.d.ts.map +1 -0
- package/dist/connectors/aws/lib/aws_client.js +196 -0
- package/dist/connectors/aws/lib/aws_client.js.map +1 -0
- package/dist/connectors/aws/lib/aws_error.d.ts +10 -0
- package/dist/connectors/aws/lib/aws_error.d.ts.map +1 -0
- package/dist/connectors/aws/lib/aws_error.js +15 -0
- package/dist/connectors/aws/lib/aws_error.js.map +1 -0
- package/dist/connectors/confluence/cli.d.ts +3 -0
- package/dist/connectors/confluence/cli.d.ts.map +1 -0
- package/dist/connectors/confluence/cli.js +24 -0
- package/dist/connectors/confluence/cli.js.map +1 -0
- package/dist/connectors/confluence/index.d.ts +15 -0
- package/dist/connectors/confluence/index.d.ts.map +1 -0
- package/dist/connectors/confluence/index.js +295 -0
- package/dist/connectors/confluence/index.js.map +1 -0
- package/dist/connectors/confluence/lib/confluence_client.d.ts +135 -0
- package/dist/connectors/confluence/lib/confluence_client.d.ts.map +1 -0
- package/dist/connectors/confluence/lib/confluence_client.js +329 -0
- package/dist/connectors/confluence/lib/confluence_client.js.map +1 -0
- package/dist/connectors/confluence/lib/confluence_error.d.ts +13 -0
- package/dist/connectors/confluence/lib/confluence_error.d.ts.map +1 -0
- package/dist/connectors/confluence/lib/confluence_error.js +19 -0
- package/dist/connectors/confluence/lib/confluence_error.js.map +1 -0
- package/dist/connectors/db/cli.d.ts +5 -0
- package/dist/connectors/db/cli.d.ts.map +1 -0
- package/dist/connectors/db/cli.js +34 -0
- package/dist/connectors/db/cli.js.map +1 -0
- package/dist/connectors/db/config.d.ts +18 -0
- package/dist/connectors/db/config.d.ts.map +1 -0
- package/dist/connectors/db/config.js +142 -0
- package/dist/connectors/db/config.js.map +1 -0
- package/dist/connectors/db/connector.d.ts +31 -0
- package/dist/connectors/db/connector.d.ts.map +1 -0
- package/dist/connectors/db/connector.js +175 -0
- package/dist/connectors/db/connector.js.map +1 -0
- package/dist/connectors/db/dispatcher.d.ts +36 -0
- package/dist/connectors/db/dispatcher.d.ts.map +1 -0
- package/dist/connectors/db/dispatcher.js +597 -0
- package/dist/connectors/db/dispatcher.js.map +1 -0
- package/dist/connectors/db/index.d.ts +22 -0
- package/dist/connectors/db/index.d.ts.map +1 -0
- package/dist/connectors/db/index.js +26 -0
- package/dist/connectors/db/index.js.map +1 -0
- package/dist/connectors/db/lib/audit.d.ts +32 -0
- package/dist/connectors/db/lib/audit.d.ts.map +1 -0
- package/dist/connectors/db/lib/audit.js +130 -0
- package/dist/connectors/db/lib/audit.js.map +1 -0
- package/dist/connectors/db/lib/connection.d.ts +61 -0
- package/dist/connectors/db/lib/connection.d.ts.map +1 -0
- package/dist/connectors/db/lib/connection.js +326 -0
- package/dist/connectors/db/lib/connection.js.map +1 -0
- package/dist/connectors/db/lib/credentials.d.ts +60 -0
- package/dist/connectors/db/lib/credentials.d.ts.map +1 -0
- package/dist/connectors/db/lib/credentials.js +117 -0
- package/dist/connectors/db/lib/credentials.js.map +1 -0
- package/dist/connectors/db/lib/drivers/base.d.ts +83 -0
- package/dist/connectors/db/lib/drivers/base.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/base.js +46 -0
- package/dist/connectors/db/lib/drivers/base.js.map +1 -0
- package/dist/connectors/db/lib/drivers/dynamodb.d.ts +108 -0
- package/dist/connectors/db/lib/drivers/dynamodb.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/dynamodb.js +468 -0
- package/dist/connectors/db/lib/drivers/dynamodb.js.map +1 -0
- package/dist/connectors/db/lib/drivers/mongodb.d.ts +60 -0
- package/dist/connectors/db/lib/drivers/mongodb.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/mongodb.js +371 -0
- package/dist/connectors/db/lib/drivers/mongodb.js.map +1 -0
- package/dist/connectors/db/lib/drivers/mysql.d.ts +45 -0
- package/dist/connectors/db/lib/drivers/mysql.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/mysql.js +265 -0
- package/dist/connectors/db/lib/drivers/mysql.js.map +1 -0
- package/dist/connectors/db/lib/drivers/oracle.d.ts +53 -0
- package/dist/connectors/db/lib/drivers/oracle.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/oracle.js +350 -0
- package/dist/connectors/db/lib/drivers/oracle.js.map +1 -0
- package/dist/connectors/db/lib/drivers/postgresql.d.ts +65 -0
- package/dist/connectors/db/lib/drivers/postgresql.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/postgresql.js +294 -0
- package/dist/connectors/db/lib/drivers/postgresql.js.map +1 -0
- package/dist/connectors/db/lib/drivers/register.d.ts +16 -0
- package/dist/connectors/db/lib/drivers/register.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/register.js +111 -0
- package/dist/connectors/db/lib/drivers/register.js.map +1 -0
- package/dist/connectors/db/lib/drivers/sqlite.d.ts +11 -0
- package/dist/connectors/db/lib/drivers/sqlite.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/sqlite.js +147 -0
- package/dist/connectors/db/lib/drivers/sqlite.js.map +1 -0
- package/dist/connectors/db/lib/drivers/sqlserver.d.ts +58 -0
- package/dist/connectors/db/lib/drivers/sqlserver.d.ts.map +1 -0
- package/dist/connectors/db/lib/drivers/sqlserver.js +274 -0
- package/dist/connectors/db/lib/drivers/sqlserver.js.map +1 -0
- package/dist/connectors/db/lib/environments.d.ts +68 -0
- package/dist/connectors/db/lib/environments.d.ts.map +1 -0
- package/dist/connectors/db/lib/environments.js +53 -0
- package/dist/connectors/db/lib/environments.js.map +1 -0
- package/dist/connectors/db/lib/index.d.ts +28 -0
- package/dist/connectors/db/lib/index.d.ts.map +1 -0
- package/dist/connectors/db/lib/index.js +30 -0
- package/dist/connectors/db/lib/index.js.map +1 -0
- package/dist/connectors/db/lib/plugin_config.d.ts +64 -0
- package/dist/connectors/db/lib/plugin_config.d.ts.map +1 -0
- package/dist/connectors/db/lib/plugin_config.js +287 -0
- package/dist/connectors/db/lib/plugin_config.js.map +1 -0
- package/dist/connectors/db/lib/policy.d.ts +162 -0
- package/dist/connectors/db/lib/policy.d.ts.map +1 -0
- package/dist/connectors/db/lib/policy.js +581 -0
- package/dist/connectors/db/lib/policy.js.map +1 -0
- package/dist/connectors/db/lib/query.d.ts +22 -0
- package/dist/connectors/db/lib/query.d.ts.map +1 -0
- package/dist/connectors/db/lib/query.js +93 -0
- package/dist/connectors/db/lib/query.js.map +1 -0
- package/dist/connectors/db/lib/schema.d.ts +13 -0
- package/dist/connectors/db/lib/schema.d.ts.map +1 -0
- package/dist/connectors/db/lib/schema.js +80 -0
- package/dist/connectors/db/lib/schema.js.map +1 -0
- package/dist/connectors/gcp/cli.d.ts +3 -0
- package/dist/connectors/gcp/cli.d.ts.map +1 -0
- package/dist/connectors/gcp/cli.js +24 -0
- package/dist/connectors/gcp/cli.js.map +1 -0
- package/dist/connectors/gcp/index.d.ts +24 -0
- package/dist/connectors/gcp/index.d.ts.map +1 -0
- package/dist/connectors/gcp/index.js +205 -0
- package/dist/connectors/gcp/index.js.map +1 -0
- package/dist/connectors/gcp/lib/gcp_client.d.ts +88 -0
- package/dist/connectors/gcp/lib/gcp_client.d.ts.map +1 -0
- package/dist/connectors/gcp/lib/gcp_client.js +434 -0
- package/dist/connectors/gcp/lib/gcp_client.js.map +1 -0
- package/dist/connectors/gcp/lib/gcp_error.d.ts +10 -0
- package/dist/connectors/gcp/lib/gcp_error.d.ts.map +1 -0
- package/dist/connectors/gcp/lib/gcp_error.js +15 -0
- package/dist/connectors/gcp/lib/gcp_error.js.map +1 -0
- package/dist/connectors/github/cli.d.ts +3 -0
- package/dist/connectors/github/cli.d.ts.map +1 -0
- package/dist/connectors/github/cli.js +23 -0
- package/dist/connectors/github/cli.js.map +1 -0
- package/dist/connectors/github/index.d.ts +23 -0
- package/dist/connectors/github/index.d.ts.map +1 -0
- package/dist/connectors/github/index.js +462 -0
- package/dist/connectors/github/index.js.map +1 -0
- package/dist/connectors/github/lib/github_client.d.ts +181 -0
- package/dist/connectors/github/lib/github_client.d.ts.map +1 -0
- package/dist/connectors/github/lib/github_client.js +383 -0
- package/dist/connectors/github/lib/github_client.js.map +1 -0
- package/dist/connectors/github/lib/github_error.d.ts +11 -0
- package/dist/connectors/github/lib/github_error.d.ts.map +1 -0
- package/dist/connectors/github/lib/github_error.js +17 -0
- package/dist/connectors/github/lib/github_error.js.map +1 -0
- package/dist/connectors/jira/cli.d.ts +3 -0
- package/dist/connectors/jira/cli.d.ts.map +1 -0
- package/dist/connectors/jira/cli.js +24 -0
- package/dist/connectors/jira/cli.js.map +1 -0
- package/dist/connectors/jira/index.d.ts +13 -0
- package/dist/connectors/jira/index.d.ts.map +1 -0
- package/dist/connectors/jira/index.js +287 -0
- package/dist/connectors/jira/index.js.map +1 -0
- package/dist/connectors/jira/lib/adf.d.ts +25 -0
- package/dist/connectors/jira/lib/adf.d.ts.map +1 -0
- package/dist/connectors/jira/lib/adf.js +105 -0
- package/dist/connectors/jira/lib/adf.js.map +1 -0
- package/dist/connectors/jira/lib/jira_client.d.ts +143 -0
- package/dist/connectors/jira/lib/jira_client.d.ts.map +1 -0
- package/dist/connectors/jira/lib/jira_client.js +355 -0
- package/dist/connectors/jira/lib/jira_client.js.map +1 -0
- package/dist/connectors/jira/lib/jira_error.d.ts +11 -0
- package/dist/connectors/jira/lib/jira_error.d.ts.map +1 -0
- package/dist/connectors/jira/lib/jira_error.js +17 -0
- package/dist/connectors/jira/lib/jira_error.js.map +1 -0
- package/dist/connectors/notion/cli.d.ts +3 -0
- package/dist/connectors/notion/cli.d.ts.map +1 -0
- package/dist/connectors/notion/cli.js +22 -0
- package/dist/connectors/notion/cli.js.map +1 -0
- package/dist/connectors/notion/index.d.ts +20 -0
- package/dist/connectors/notion/index.d.ts.map +1 -0
- package/dist/connectors/notion/index.js +317 -0
- package/dist/connectors/notion/index.js.map +1 -0
- package/dist/connectors/notion/lib/notion_client.d.ts +117 -0
- package/dist/connectors/notion/lib/notion_client.d.ts.map +1 -0
- package/dist/connectors/notion/lib/notion_client.js +377 -0
- package/dist/connectors/notion/lib/notion_client.js.map +1 -0
- package/dist/connectors/notion/lib/notion_error.d.ts +12 -0
- package/dist/connectors/notion/lib/notion_error.d.ts.map +1 -0
- package/dist/connectors/notion/lib/notion_error.js +18 -0
- package/dist/connectors/notion/lib/notion_error.js.map +1 -0
- package/dist/hub/cli.d.ts +4 -0
- package/dist/hub/cli.d.ts.map +1 -0
- package/dist/hub/cli.js +93 -0
- package/dist/hub/cli.js.map +1 -0
- package/dist/hub/dispatch.d.ts +33 -0
- package/dist/hub/dispatch.d.ts.map +1 -0
- package/dist/hub/dispatch.js +297 -0
- package/dist/hub/dispatch.js.map +1 -0
- package/dist/hub/index.d.ts +9 -0
- package/dist/hub/index.d.ts.map +1 -0
- package/dist/hub/index.js +215 -0
- package/dist/hub/index.js.map +1 -0
- package/dist/hub/plan.d.ts +24 -0
- package/dist/hub/plan.d.ts.map +1 -0
- package/dist/hub/plan.js +103 -0
- package/dist/hub/plan.js.map +1 -0
- package/dist/hub/types.d.ts +65 -0
- package/dist/hub/types.d.ts.map +1 -0
- package/dist/hub/types.js +3 -0
- package/dist/hub/types.js.map +1 -0
- package/dist/toolkit/_optional.d.ts +14 -0
- package/dist/toolkit/_optional.d.ts.map +1 -0
- package/dist/toolkit/_optional.js +96 -0
- package/dist/toolkit/_optional.js.map +1 -0
- package/dist/toolkit/agent_cli.d.ts +33 -0
- package/dist/toolkit/agent_cli.d.ts.map +1 -0
- package/dist/toolkit/agent_cli.js +62 -0
- package/dist/toolkit/agent_cli.js.map +1 -0
- package/dist/toolkit/agent_resolver.d.ts +46 -0
- package/dist/toolkit/agent_resolver.d.ts.map +1 -0
- package/dist/toolkit/agent_resolver.js +78 -0
- package/dist/toolkit/agent_resolver.js.map +1 -0
- package/dist/toolkit/audit/events.d.ts +45 -0
- package/dist/toolkit/audit/events.d.ts.map +1 -0
- package/dist/toolkit/audit/events.js +8 -0
- package/dist/toolkit/audit/events.js.map +1 -0
- package/dist/toolkit/audit/writer.d.ts +16 -0
- package/dist/toolkit/audit/writer.d.ts.map +1 -0
- package/dist/toolkit/audit/writer.js +73 -0
- package/dist/toolkit/audit/writer.js.map +1 -0
- package/dist/toolkit/cli/usage-report.d.ts +3 -0
- package/dist/toolkit/cli/usage-report.d.ts.map +1 -0
- package/dist/toolkit/cli/usage-report.js +76 -0
- package/dist/toolkit/cli/usage-report.js.map +1 -0
- package/dist/toolkit/connector.d.ts +142 -0
- package/dist/toolkit/connector.d.ts.map +1 -0
- package/dist/toolkit/connector.js +593 -0
- package/dist/toolkit/connector.js.map +1 -0
- package/dist/toolkit/extract_binary.d.ts +45 -0
- package/dist/toolkit/extract_binary.d.ts.map +1 -0
- package/dist/toolkit/extract_binary.js +342 -0
- package/dist/toolkit/extract_binary.js.map +1 -0
- package/dist/toolkit/extract_multimodal.d.ts +22 -0
- package/dist/toolkit/extract_multimodal.d.ts.map +1 -0
- package/dist/toolkit/extract_multimodal.js +209 -0
- package/dist/toolkit/extract_multimodal.js.map +1 -0
- package/dist/toolkit/fetch_attachment.d.ts +21 -0
- package/dist/toolkit/fetch_attachment.d.ts.map +1 -0
- package/dist/toolkit/fetch_attachment.js +169 -0
- package/dist/toolkit/fetch_attachment.js.map +1 -0
- package/dist/toolkit/fetch_helper.d.ts +47 -0
- package/dist/toolkit/fetch_helper.d.ts.map +1 -0
- package/dist/toolkit/fetch_helper.js +124 -0
- package/dist/toolkit/fetch_helper.js.map +1 -0
- package/dist/toolkit/guardrail.d.ts +63 -0
- package/dist/toolkit/guardrail.d.ts.map +1 -0
- package/dist/toolkit/guardrail.js +166 -0
- package/dist/toolkit/guardrail.js.map +1 -0
- package/dist/toolkit/hardship/curate.d.ts +47 -0
- package/dist/toolkit/hardship/curate.d.ts.map +1 -0
- package/dist/toolkit/hardship/curate.js +113 -0
- package/dist/toolkit/hardship/curate.js.map +1 -0
- package/dist/toolkit/hardship/patterns.d.ts +32 -0
- package/dist/toolkit/hardship/patterns.d.ts.map +1 -0
- package/dist/toolkit/hardship/patterns.js +98 -0
- package/dist/toolkit/hardship/patterns.js.map +1 -0
- package/dist/toolkit/hardship/preamble.d.ts +13 -0
- package/dist/toolkit/hardship/preamble.d.ts.map +1 -0
- package/dist/toolkit/hardship/preamble.js +47 -0
- package/dist/toolkit/hardship/preamble.js.map +1 -0
- package/dist/toolkit/hardship/read.d.ts +34 -0
- package/dist/toolkit/hardship/read.d.ts.map +1 -0
- package/dist/toolkit/hardship/read.js +116 -0
- package/dist/toolkit/hardship/read.js.map +1 -0
- package/dist/toolkit/hardship/record.d.ts +43 -0
- package/dist/toolkit/hardship/record.d.ts.map +1 -0
- package/dist/toolkit/hardship/record.js +74 -0
- package/dist/toolkit/hardship/record.js.map +1 -0
- package/dist/toolkit/hardship/scope.d.ts +20 -0
- package/dist/toolkit/hardship/scope.d.ts.map +1 -0
- package/dist/toolkit/hardship/scope.js +56 -0
- package/dist/toolkit/hardship/scope.js.map +1 -0
- package/dist/toolkit/index.d.ts +42 -0
- package/dist/toolkit/index.d.ts.map +1 -0
- package/dist/toolkit/index.js +51 -0
- package/dist/toolkit/index.js.map +1 -0
- package/dist/toolkit/plugin/curate-cmd.d.ts +22 -0
- package/dist/toolkit/plugin/curate-cmd.d.ts.map +1 -0
- package/dist/toolkit/plugin/curate-cmd.js +72 -0
- package/dist/toolkit/plugin/curate-cmd.js.map +1 -0
- package/dist/toolkit/plugin/prefs.d.ts +15 -0
- package/dist/toolkit/plugin/prefs.d.ts.map +1 -0
- package/dist/toolkit/plugin/prefs.js +78 -0
- package/dist/toolkit/plugin/prefs.js.map +1 -0
- package/dist/toolkit/plugin/reminder.d.ts +28 -0
- package/dist/toolkit/plugin/reminder.d.ts.map +1 -0
- package/dist/toolkit/plugin/reminder.js +103 -0
- package/dist/toolkit/plugin/reminder.js.map +1 -0
- package/dist/toolkit/policy/approval.d.ts +24 -0
- package/dist/toolkit/policy/approval.d.ts.map +1 -0
- package/dist/toolkit/policy/approval.js +56 -0
- package/dist/toolkit/policy/approval.js.map +1 -0
- package/dist/toolkit/policy/config.d.ts +38 -0
- package/dist/toolkit/policy/config.d.ts.map +1 -0
- package/dist/toolkit/policy/config.js +172 -0
- package/dist/toolkit/policy/config.js.map +1 -0
- package/dist/toolkit/policy/gate.d.ts +28 -0
- package/dist/toolkit/policy/gate.d.ts.map +1 -0
- package/dist/toolkit/policy/gate.js +126 -0
- package/dist/toolkit/policy/gate.js.map +1 -0
- package/dist/toolkit/policy/types.d.ts +106 -0
- package/dist/toolkit/policy/types.d.ts.map +1 -0
- package/dist/toolkit/policy/types.js +22 -0
- package/dist/toolkit/policy/types.js.map +1 -0
- package/dist/toolkit/security_check.d.ts +15 -0
- package/dist/toolkit/security_check.d.ts.map +1 -0
- package/dist/toolkit/security_check.js +109 -0
- package/dist/toolkit/security_check.js.map +1 -0
- package/dist/toolkit/usage/aggregate-cross-session.d.ts +36 -0
- package/dist/toolkit/usage/aggregate-cross-session.d.ts.map +1 -0
- package/dist/toolkit/usage/aggregate-cross-session.js +142 -0
- package/dist/toolkit/usage/aggregate-cross-session.js.map +1 -0
- package/dist/toolkit/usage/aggregate.d.ts +4 -0
- package/dist/toolkit/usage/aggregate.d.ts.map +1 -0
- package/dist/toolkit/usage/aggregate.js +105 -0
- package/dist/toolkit/usage/aggregate.js.map +1 -0
- package/dist/toolkit/usage/index.d.ts +11 -0
- package/dist/toolkit/usage/index.d.ts.map +1 -0
- package/dist/toolkit/usage/index.js +7 -0
- package/dist/toolkit/usage/index.js.map +1 -0
- package/dist/toolkit/usage/parse.d.ts +5 -0
- package/dist/toolkit/usage/parse.d.ts.map +1 -0
- package/dist/toolkit/usage/parse.js +19 -0
- package/dist/toolkit/usage/parse.js.map +1 -0
- package/dist/toolkit/usage/record.d.ts +8 -0
- package/dist/toolkit/usage/record.d.ts.map +1 -0
- package/dist/toolkit/usage/record.js +18 -0
- package/dist/toolkit/usage/record.js.map +1 -0
- package/dist/toolkit/usage/retention.d.ts +6 -0
- package/dist/toolkit/usage/retention.d.ts.map +1 -0
- package/dist/toolkit/usage/retention.js +71 -0
- package/dist/toolkit/usage/retention.js.map +1 -0
- package/dist/toolkit/usage/tokenize.d.ts +11 -0
- package/dist/toolkit/usage/tokenize.d.ts.map +1 -0
- package/dist/toolkit/usage/tokenize.js +24 -0
- package/dist/toolkit/usage/tokenize.js.map +1 -0
- package/dist/toolkit/usage/types.d.ts +34 -0
- package/dist/toolkit/usage/types.d.ts.map +1 -0
- package/dist/toolkit/usage/types.js +2 -0
- package/dist/toolkit/usage/types.js.map +1 -0
- package/package.json +124 -0
- package/plugin-hooks/session-summary.mjs +138 -0
- package/plugin-hooks/stale-summarize.mjs +70 -0
- package/plugin-hooks/usage-record.mjs +112 -0
- package/plugins/aws-agent/.claude-plugin/plugin.json +6 -0
- package/plugins/aws-agent/README.md +46 -0
- package/plugins/aws-agent/bin/aws-agent +22 -0
- package/plugins/aws-agent/commands/aws-agent.md +6 -0
- package/plugins/aws-agent/hooks/hooks.json +49 -0
- package/plugins/aws-agent/hooks/reminder.mjs +16 -0
- package/plugins/aws-agent/package.json +9 -0
- package/plugins/aws-agent/skills/aws-agent/SKILL.md +70 -0
- package/plugins/confluence-agent/.claude-plugin/plugin.json +6 -0
- package/plugins/confluence-agent/README.md +15 -0
- package/plugins/confluence-agent/bin/confluence-agent +17 -0
- package/plugins/confluence-agent/commands/confluence-agent.md +6 -0
- package/plugins/confluence-agent/hooks/hooks.json +49 -0
- package/plugins/confluence-agent/hooks/reminder.mjs +25 -0
- package/plugins/confluence-agent/package.json +8 -0
- package/plugins/confluence-agent/skills/confluence-agent/SKILL.md +40 -0
- package/plugins/db-agent/.claude-plugin/plugin.json +20 -0
- package/plugins/db-agent/README.md +13 -0
- package/plugins/db-agent/bin/db-agent +17 -0
- package/plugins/db-agent/commands/db-agent.md +6 -0
- package/plugins/db-agent/hooks/db-guard.mjs +110 -0
- package/plugins/db-agent/hooks/guardrails.json +26 -0
- package/plugins/db-agent/hooks/hooks.json +61 -0
- package/plugins/db-agent/hooks/reminder.mjs +16 -0
- package/plugins/db-agent/package.json +8 -0
- package/plugins/db-agent/skills/db-agent/SKILL.md +50 -0
- package/plugins/gcp-agent/.claude-plugin/plugin.json +6 -0
- package/plugins/gcp-agent/README.md +31 -0
- package/plugins/gcp-agent/bin/gcp-agent +18 -0
- package/plugins/gcp-agent/commands/gcp-agent.md +6 -0
- package/plugins/gcp-agent/hooks/hooks.json +49 -0
- package/plugins/gcp-agent/hooks/reminder.mjs +16 -0
- package/plugins/gcp-agent/package.json +9 -0
- package/plugins/gcp-agent/skills/gcp-agent/SKILL.md +54 -0
- package/plugins/github-agent/.claude-plugin/plugin.json +6 -0
- package/plugins/github-agent/README.md +13 -0
- package/plugins/github-agent/bin/github-agent +17 -0
- package/plugins/github-agent/commands/github-agent.md +6 -0
- package/plugins/github-agent/hooks/hooks.json +49 -0
- package/plugins/github-agent/hooks/reminder.mjs +16 -0
- package/plugins/github-agent/package.json +8 -0
- package/plugins/github-agent/skills/github-agent/SKILL.md +41 -0
- package/plugins/jira-agent/.claude-plugin/plugin.json +6 -0
- package/plugins/jira-agent/README.md +15 -0
- package/plugins/jira-agent/bin/jira-agent +17 -0
- package/plugins/jira-agent/commands/jira-agent.md +6 -0
- package/plugins/jira-agent/hooks/hooks.json +49 -0
- package/plugins/jira-agent/hooks/reminder.mjs +16 -0
- package/plugins/jira-agent/package.json +8 -0
- package/plugins/jira-agent/skills/jira-agent/SKILL.md +37 -0
- package/plugins/notion-agent/.claude-plugin/plugin.json +6 -0
- package/plugins/notion-agent/README.md +23 -0
- package/plugins/notion-agent/bin/notion-agent +17 -0
- package/plugins/notion-agent/commands/notion-agent.md +6 -0
- package/plugins/notion-agent/hooks/hooks.json +49 -0
- package/plugins/notion-agent/hooks/reminder.mjs +17 -0
- package/plugins/notion-agent/package.json +8 -0
- package/plugins/notion-agent/skills/notion-agent/SKILL.md +48 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# confluence-agent-plugin
|
|
2
|
+
|
|
3
|
+
Claude Code plugin that wraps `@narai/confluence-agent-connector` as a read-only Confluence skill and slash command. Same layout as aws/gcp/notion-agent-plugin.
|
|
4
|
+
|
|
5
|
+
## Credentials
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
export CONFLUENCE_SITE_URL="https://your.atlassian.net"
|
|
9
|
+
export CONFLUENCE_EMAIL="you@example.com"
|
|
10
|
+
export CONFLUENCE_API_TOKEN="…"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
MIT
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
if [ -z "${CLAUDE_PLUGIN_DATA:-}" ]; then
|
|
5
|
+
echo "confluence-agent: CLAUDE_PLUGIN_DATA is not set (run from inside Claude Code)" >&2
|
|
6
|
+
exit 2
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
CLI="${CLAUDE_PLUGIN_DATA}/node_modules/@narai/confluence-agent-connector/dist/cli.js"
|
|
10
|
+
|
|
11
|
+
if [ ! -f "$CLI" ]; then
|
|
12
|
+
echo "confluence-agent: connector CLI not found at $CLI" >&2
|
|
13
|
+
echo "Restart your Claude Code session to re-run the SessionStart install hook." >&2
|
|
14
|
+
exit 2
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
exec node "$CLI" "$@"
|
|
@@ -0,0 +1,6 @@
|
|
|
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.
|
|
@@ -0,0 +1,49 @@
|
|
|
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}/plugin/hooks/reminder.mjs\" 2>/dev/null || true"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "command",
|
|
16
|
+
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/@narai/connector-toolkit/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/connector-toolkit/plugin-hooks/usage-record.mjs\" 2>/dev/null || true",
|
|
29
|
+
"env": {
|
|
30
|
+
"USAGE_CONNECTOR_NAME": "confluence",
|
|
31
|
+
"USAGE_BIN_HINT": "@narai/confluence-agent-connector"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"SessionEnd": [
|
|
38
|
+
{
|
|
39
|
+
"hooks": [
|
|
40
|
+
{
|
|
41
|
+
"type": "command",
|
|
42
|
+
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/@narai/connector-toolkit/plugin-hooks/session-summary.mjs\" 2>/dev/null || true",
|
|
43
|
+
"env": { "USAGE_CONNECTOR_NAME": "confluence" }
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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/connector-toolkit/dist/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
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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/confluence-agent-connector` 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.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "db-agent-plugin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Safe, read-only database query agent for Claude Code. Wraps @narai/db-agent-connector. Every statement passes the policy gate before any driver loads or any connection is opened.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Narai Labs",
|
|
7
|
+
"url": "https://github.com/narailabs"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/narailabs/db-agent-connector",
|
|
10
|
+
"repository": "https://github.com/narailabs/db-agent-connector",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": ["database", "sql", "postgresql", "mysql", "sqlite", "policy-gate"],
|
|
13
|
+
"userConfig": {
|
|
14
|
+
"install_guardrails": {
|
|
15
|
+
"description": "Block direct DB-client invocations (psql, mysql, sqlite3, mongosh, pg_dump, aws dynamodb, ...) from Bash so all database access is routed through the db-agent CLI. Strongly recommended. Set to 'off' to disable.",
|
|
16
|
+
"sensitive": false
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"hooks": "./hooks/hooks.json"
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# db-agent-plugin
|
|
2
|
+
|
|
3
|
+
Claude Code plugin that wraps [`@narai/db-agent-connector`](https://www.npmjs.com/package/@narai/db-agent-connector).
|
|
4
|
+
|
|
5
|
+
Exposes the `db-agent` skill. Every query passes through the policy gate before any driver loads or any connection opens. V2.0 vocab and defaults:
|
|
6
|
+
|
|
7
|
+
- `read` (SELECT/EXPLAIN/SHOW/DESCRIBE/WITH) → executed through the driver with row/timeout caps
|
|
8
|
+
- `write` (INSERT/UPDATE/REPLACE/MERGE/UPSERT) → escalates by default
|
|
9
|
+
- `delete` (DELETE/TRUNCATE) → returned as formatted SQL, never executed
|
|
10
|
+
- `admin` (CREATE/DROP/ALTER/RENAME) → returned as formatted SQL, never executed
|
|
11
|
+
- `privilege` (GRANT/REVOKE) → hard-denied
|
|
12
|
+
|
|
13
|
+
Install via Claude Code's plugin marketplace. The `SessionStart` hook installs `@narai/db-agent-connector` into the plugin's data directory on first use.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
if [ -z "${CLAUDE_PLUGIN_DATA:-}" ]; then
|
|
5
|
+
echo "db-agent: CLAUDE_PLUGIN_DATA is not set (run from inside Claude Code)" >&2
|
|
6
|
+
exit 2
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
CLI="${CLAUDE_PLUGIN_DATA}/node_modules/@narai/db-agent-connector/dist/cli.js"
|
|
10
|
+
|
|
11
|
+
if [ ! -f "$CLI" ]; then
|
|
12
|
+
echo "db-agent: connector CLI not found at $CLI" >&2
|
|
13
|
+
echo "Restart your Claude Code session to re-run the SessionStart install hook." >&2
|
|
14
|
+
exit 2
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
exec node "$CLI" "$@"
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"name": "db-agent-connector",
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"block_first_token_basename": [
|
|
7
|
+
"psql",
|
|
8
|
+
"mysql",
|
|
9
|
+
"mariadb",
|
|
10
|
+
"sqlite3",
|
|
11
|
+
"mongosh",
|
|
12
|
+
"mongo",
|
|
13
|
+
"mongodump",
|
|
14
|
+
"mongorestore",
|
|
15
|
+
"pg_dump",
|
|
16
|
+
"pg_restore",
|
|
17
|
+
"mysqldump",
|
|
18
|
+
"sqlcmd",
|
|
19
|
+
"mssql-cli",
|
|
20
|
+
"duckdb"
|
|
21
|
+
],
|
|
22
|
+
"block_two_token_command": ["aws dynamodb"],
|
|
23
|
+
"redirect": "Route database access through the db-agent CLI: `db-agent --action query --params '{\"env\":\"<name>\",\"sql\":\"...\"}'` or use sqlite_path. Do NOT bypass — reformulate the intent."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"SessionStart": [
|
|
3
|
+
{
|
|
4
|
+
"hooks": [
|
|
5
|
+
{
|
|
6
|
+
"type": "command",
|
|
7
|
+
"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\""
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"type": "command",
|
|
11
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/plugin/hooks/reminder.mjs\" 2>/dev/null || true"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "command",
|
|
15
|
+
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/@narai/connector-toolkit/plugin-hooks/stale-summarize.mjs\" 2>/dev/null || true",
|
|
16
|
+
"env": { "USAGE_CONNECTOR_NAME": "db" }
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"PreToolUse": [
|
|
22
|
+
{
|
|
23
|
+
"matcher": "Bash",
|
|
24
|
+
"hooks": [
|
|
25
|
+
{
|
|
26
|
+
"type": "command",
|
|
27
|
+
"command": "node ${CLAUDE_PLUGIN_ROOT}/plugin/hooks/db-guard.mjs",
|
|
28
|
+
"env": {
|
|
29
|
+
"DB_AGENT_GUARDRAILS": "${user_config.install_guardrails}"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"PostToolUse": [
|
|
36
|
+
{
|
|
37
|
+
"matcher": "Bash",
|
|
38
|
+
"hooks": [
|
|
39
|
+
{
|
|
40
|
+
"type": "command",
|
|
41
|
+
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/@narai/connector-toolkit/plugin-hooks/usage-record.mjs\" 2>/dev/null || true",
|
|
42
|
+
"env": {
|
|
43
|
+
"USAGE_CONNECTOR_NAME": "db",
|
|
44
|
+
"USAGE_BIN_HINT": "@narai/db-agent-connector"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"SessionEnd": [
|
|
51
|
+
{
|
|
52
|
+
"hooks": [
|
|
53
|
+
{
|
|
54
|
+
"type": "command",
|
|
55
|
+
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/@narai/connector-toolkit/plugin-hooks/session-summary.mjs\" 2>/dev/null || true",
|
|
56
|
+
"env": { "USAGE_CONNECTOR_NAME": "db" }
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SessionStart curation reminder for the db-agent 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/connector-toolkit/dist/plugin/reminder.js`;
|
|
9
|
+
const mod = await import(toolkitEntry);
|
|
10
|
+
const decision = mod.evaluateNudge({ connectors: ["db"] });
|
|
11
|
+
if (decision.nudge) {
|
|
12
|
+
process.stdout.write(decision.banner + "\n");
|
|
13
|
+
}
|
|
14
|
+
} catch {
|
|
15
|
+
// best-effort — reminder never blocks startup
|
|
16
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: db-agent
|
|
3
|
+
description: |
|
|
4
|
+
Use when the user asks about reading data from a database — SELECT queries,
|
|
5
|
+
schema introspection, "show me the rows/tables/columns…". Supports
|
|
6
|
+
PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, DynamoDB, and Oracle via
|
|
7
|
+
pluggable drivers. Every statement passes the policy gate BEFORE any
|
|
8
|
+
driver loads or any connection opens: write statements escalate, delete
|
|
9
|
+
and admin statements return formatted SQL without executing, privilege
|
|
10
|
+
statements are hard-denied.
|
|
11
|
+
context: fork
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Database Agent
|
|
15
|
+
|
|
16
|
+
Answer the user's question by invoking the `db-agent` binary exposed by this
|
|
17
|
+
plugin. It delegates to `@narai/db-agent-connector`, which enforces the
|
|
18
|
+
policy gate before any backend is touched.
|
|
19
|
+
|
|
20
|
+
## Invocation
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
db-agent --action <action> --params '<json>'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Return the connector's JSON envelope verbatim.
|
|
27
|
+
|
|
28
|
+
## Supported actions
|
|
29
|
+
|
|
30
|
+
| Action | Required params | Optional params |
|
|
31
|
+
|----------|-----------------------------------------------|-------------------------------------------------------------------|
|
|
32
|
+
| `query` | `env` + `sql` (or `sqlite_path` + `sql`) | `max_rows` (default 1000), `timeout_ms` (default 30000), `approval_mode`, `config_path` |
|
|
33
|
+
| `schema` | `env` (or `sqlite_path`) | `filter` (table-name pattern like `users%`), `config_path` |
|
|
34
|
+
|
|
35
|
+
## Envelope statuses
|
|
36
|
+
|
|
37
|
+
- `ok` — read succeeded; `rows` / `tables` / `row_count` / `columns` / `truncated` populated.
|
|
38
|
+
- `present_only` — formatted SQL returned, **never executed**. Default for `delete` (DELETE/TRUNCATE) and `admin` (CREATE/DROP/ALTER/RENAME).
|
|
39
|
+
- `denied` — `privilege` (GRANT/REVOKE) always; or the configured policy denied.
|
|
40
|
+
- `escalate` — needs approval. Default for `write` (INSERT/UPDATE/REPLACE/MERGE/UPSERT); also `grant_required` mode and unbounded SELECT.
|
|
41
|
+
- `error` — driver or SQL error after an allowed verdict.
|
|
42
|
+
|
|
43
|
+
## Safety
|
|
44
|
+
|
|
45
|
+
Read-only by design. The policy gate rejects every non-read statement before
|
|
46
|
+
any driver loads. WRITE escalates by default; DELETE/ADMIN return formatted
|
|
47
|
+
SQL with no execution; PRIVILEGE is hard-denied. Never shell out to `psql`,
|
|
48
|
+
`mysql`, `sqlite3`, `mongosh`, `pg_dump`, `duckdb`, or `aws dynamodb` — the
|
|
49
|
+
`db-agent` binary is the only sanctioned channel. Never edit the operator's
|
|
50
|
+
config to weaken a policy decision; report the decision instead.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# gcp-agent-plugin
|
|
2
|
+
|
|
3
|
+
Claude Code plugin that wraps [`@narai/gcp-agent-connector`](https://www.npmjs.com/package/@narai/gcp-agent-connector) as a read-only GCP skill and slash command.
|
|
4
|
+
|
|
5
|
+
- **Skill** `gcp-agent` — automatic invocation for Cloud Run / Cloud SQL / Pub/Sub / Cloud Logging questions.
|
|
6
|
+
- **Slash command** `/gcp-agent <action> <params-json>`.
|
|
7
|
+
- **Binary** `gcp-agent` — thin shim over the installed connector CLI.
|
|
8
|
+
|
|
9
|
+
## How install works
|
|
10
|
+
|
|
11
|
+
On first `SessionStart` the hook in `hooks/hooks.json`:
|
|
12
|
+
|
|
13
|
+
1. compares the plugin's `package.json` with `${CLAUDE_PLUGIN_DATA}/package.json`;
|
|
14
|
+
2. if different or missing, copies the manifest and runs `npm install --no-audit --no-fund` inside `${CLAUDE_PLUGIN_DATA}`;
|
|
15
|
+
3. if the install fails, removes the stale copy so the hook re-runs next session.
|
|
16
|
+
|
|
17
|
+
After install,
|
|
18
|
+
`${CLAUDE_PLUGIN_DATA}/node_modules/@narai/gcp-agent-connector/dist/cli.js`
|
|
19
|
+
exists and `bin/gcp-agent` exec's it.
|
|
20
|
+
|
|
21
|
+
## Credentials
|
|
22
|
+
|
|
23
|
+
Install the Google Cloud SDK and authenticate:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
gcloud auth application-default login
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
MIT
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# gcp-agent — thin shim over @narai/gcp-agent-connector.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
if [ -z "${CLAUDE_PLUGIN_DATA:-}" ]; then
|
|
6
|
+
echo "gcp-agent: CLAUDE_PLUGIN_DATA is not set (run from inside Claude Code)" >&2
|
|
7
|
+
exit 2
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
CLI="${CLAUDE_PLUGIN_DATA}/node_modules/@narai/gcp-agent-connector/dist/cli.js"
|
|
11
|
+
|
|
12
|
+
if [ ! -f "$CLI" ]; then
|
|
13
|
+
echo "gcp-agent: connector CLI not found at $CLI" >&2
|
|
14
|
+
echo "Restart your Claude Code session to re-run the SessionStart install hook." >&2
|
|
15
|
+
exit 2
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
exec node "$CLI" "$@"
|
|
@@ -0,0 +1,49 @@
|
|
|
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}/plugin/hooks/reminder.mjs\" 2>/dev/null || true"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "command",
|
|
16
|
+
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/@narai/connector-toolkit/plugin-hooks/stale-summarize.mjs\" 2>/dev/null || true",
|
|
17
|
+
"env": { "USAGE_CONNECTOR_NAME": "gcp" }
|
|
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/connector-toolkit/plugin-hooks/usage-record.mjs\" 2>/dev/null || true",
|
|
29
|
+
"env": {
|
|
30
|
+
"USAGE_CONNECTOR_NAME": "gcp",
|
|
31
|
+
"USAGE_BIN_HINT": "@narai/gcp-agent-connector"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"SessionEnd": [
|
|
38
|
+
{
|
|
39
|
+
"hooks": [
|
|
40
|
+
{
|
|
41
|
+
"type": "command",
|
|
42
|
+
"command": "node \"${CLAUDE_PLUGIN_DATA}/node_modules/@narai/connector-toolkit/plugin-hooks/session-summary.mjs\" 2>/dev/null || true",
|
|
43
|
+
"env": { "USAGE_CONNECTOR_NAME": "gcp" }
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SessionStart curation reminder for the GCP 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/connector-toolkit/dist/plugin/reminder.js`;
|
|
9
|
+
const mod = await import(toolkitEntry);
|
|
10
|
+
const decision = mod.evaluateNudge({ connectors: ["gcp"] });
|
|
11
|
+
if (decision.nudge) {
|
|
12
|
+
process.stdout.write(decision.banner + "\n");
|
|
13
|
+
}
|
|
14
|
+
} catch {
|
|
15
|
+
// best-effort — reminder never blocks startup
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gcp-agent-plugin-runtime",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Runtime manifest for gcp-agent-plugin. The SessionStart hook runs `npm install` on this manifest into ${CLAUDE_PLUGIN_DATA}.",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@narai/gcp-agent-connector": "file:.."
|
|
8
|
+
}
|
|
9
|
+
}
|