truceptor 0.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. acp/__init__.py +16 -0
  2. acp/bundle/dashboard/app.js +1564 -0
  3. acp/bundle/dashboard/index.html +123 -0
  4. acp/bundle/dashboard/styles.css +1114 -0
  5. acp/bundle/docker-compose.yml +82 -0
  6. acp/bundle/interceptor/Dockerfile +16 -0
  7. acp/bundle/interceptor/README.md +105 -0
  8. acp/bundle/interceptor/api/openapi.yaml +220 -0
  9. acp/bundle/interceptor/cmd/server/main.go +41 -0
  10. acp/bundle/interceptor/go.mod +47 -0
  11. acp/bundle/interceptor/go.sum +111 -0
  12. acp/bundle/interceptor/internal/approval/errors.go +10 -0
  13. acp/bundle/interceptor/internal/approval/repository.go +12 -0
  14. acp/bundle/interceptor/internal/approval/store.go +221 -0
  15. acp/bundle/interceptor/internal/approval/store_test.go +47 -0
  16. acp/bundle/interceptor/internal/approval/sync.go +48 -0
  17. acp/bundle/interceptor/internal/approval/sync_test.go +53 -0
  18. acp/bundle/interceptor/internal/audit/events.go +6 -0
  19. acp/bundle/interceptor/internal/audit/logger.go +53 -0
  20. acp/bundle/interceptor/internal/audit/store.go +116 -0
  21. acp/bundle/interceptor/internal/audit/store_iface.go +9 -0
  22. acp/bundle/interceptor/internal/auth/context.go +41 -0
  23. acp/bundle/interceptor/internal/auth/load.go +42 -0
  24. acp/bundle/interceptor/internal/auth/principal.go +9 -0
  25. acp/bundle/interceptor/internal/auth/validator.go +168 -0
  26. acp/bundle/interceptor/internal/auth/validator_test.go +61 -0
  27. acp/bundle/interceptor/internal/config/config.go +24 -0
  28. acp/bundle/interceptor/internal/config/env.go +83 -0
  29. acp/bundle/interceptor/internal/gateway/bootstrap.go +51 -0
  30. acp/bundle/interceptor/internal/gateway/router.go +36 -0
  31. acp/bundle/interceptor/internal/gateway/routes.go +42 -0
  32. acp/bundle/interceptor/internal/gateway/server.go +90 -0
  33. acp/bundle/interceptor/internal/handlers/agent_handler.go +94 -0
  34. acp/bundle/interceptor/internal/handlers/approval_handler.go +122 -0
  35. acp/bundle/interceptor/internal/handlers/insights_handler.go +37 -0
  36. acp/bundle/interceptor/internal/handlers/policy_catalog_handler.go +35 -0
  37. acp/bundle/interceptor/internal/handlers/replay_handler.go +61 -0
  38. acp/bundle/interceptor/internal/handlers/tool_handler.go +51 -0
  39. acp/bundle/interceptor/internal/middleware/auth.go +29 -0
  40. acp/bundle/interceptor/internal/middleware/cors.go +60 -0
  41. acp/bundle/interceptor/internal/middleware/jwt.go +47 -0
  42. acp/bundle/interceptor/internal/middleware/logging.go +35 -0
  43. acp/bundle/interceptor/internal/middleware/recovery.go +27 -0
  44. acp/bundle/interceptor/internal/middleware/tracing.go +15 -0
  45. acp/bundle/interceptor/internal/models/policy.go +38 -0
  46. acp/bundle/interceptor/internal/models/request.go +11 -0
  47. acp/bundle/interceptor/internal/models/response.go +8 -0
  48. acp/bundle/interceptor/internal/policy/evaluator.go +64 -0
  49. acp/bundle/interceptor/internal/policy/mapper.go +33 -0
  50. acp/bundle/interceptor/internal/policy/opa_client.go +83 -0
  51. acp/bundle/interceptor/internal/policycatalog/rules.go +242 -0
  52. acp/bundle/interceptor/internal/policycatalog/rules_test.go +80 -0
  53. acp/bundle/interceptor/internal/policycatalog/scanner.go +126 -0
  54. acp/bundle/interceptor/internal/policycatalog/scanner_test.go +54 -0
  55. acp/bundle/interceptor/internal/registry/agent.go +53 -0
  56. acp/bundle/interceptor/internal/registry/memory.go +154 -0
  57. acp/bundle/interceptor/internal/replay/service.go +187 -0
  58. acp/bundle/interceptor/internal/replay/service_test.go +76 -0
  59. acp/bundle/interceptor/internal/services/audit_service.go +18 -0
  60. acp/bundle/interceptor/internal/services/interceptor_service.go +183 -0
  61. acp/bundle/interceptor/internal/services/policy_service.go +23 -0
  62. acp/bundle/interceptor/internal/storage/postgres/agents.go +153 -0
  63. acp/bundle/interceptor/internal/storage/postgres/approval.go +171 -0
  64. acp/bundle/interceptor/internal/storage/postgres/audit.go +156 -0
  65. acp/bundle/interceptor/internal/storage/postgres/db.go +62 -0
  66. acp/bundle/interceptor/internal/storage/postgres/migrations/001_schema.sql +55 -0
  67. acp/bundle/interceptor/internal/storage/postgres/migrations/002_seed_agents.sql +7 -0
  68. acp/bundle/interceptor/internal/tracing/context.go +24 -0
  69. acp/bundle/interceptor/internal/tracing/trace.go +34 -0
  70. acp/bundle/interceptor/internal/utils/errors.go +13 -0
  71. acp/bundle/interceptor/internal/utils/response.go +28 -0
  72. acp/bundle/interceptor/internal/utils/validation.go +21 -0
  73. acp/bundle/interceptor/policies/README.md +102 -0
  74. acp/bundle/interceptor/policies/mortgage_application.rego +25 -0
  75. acp/bundle/interceptor/policies/mortgage_underwriting.rego +34 -0
  76. acp/bundle/interceptor/policies/rbac.rego +50 -0
  77. acp/bundle/interceptor/policies/router.rego +30 -0
  78. acp/bundle/interceptor/scripts/generate-jwt-keys.sh +35 -0
  79. acp/bundle/interceptor/scripts/run-local.sh +24 -0
  80. acp/bundle/jwt/public.pem +9 -0
  81. acp/bundle/nginx-dashboard.conf +26 -0
  82. acp/bundle/nginx-gateway.conf +36 -0
  83. acp/bundle/policies/README.md +102 -0
  84. acp/bundle/policies/mortgage_application.rego +25 -0
  85. acp/bundle/policies/mortgage_underwriting.rego +34 -0
  86. acp/bundle/policies/rbac.rego +50 -0
  87. acp/bundle/policies/router.rego +30 -0
  88. acp/bundle/public/index.html +12 -0
  89. acp/cli.py +177 -0
  90. acp/client.py +215 -0
  91. acp/config.py +19 -0
  92. acp/decorators.py +61 -0
  93. acp/exceptions.py +30 -0
  94. acp/policies.py +113 -0
  95. acp/policy-starter/mortgage_application.rego +25 -0
  96. acp/policy-starter/mortgage_underwriting.rego +34 -0
  97. acp/policy-starter/rbac.rego +50 -0
  98. acp/policy-starter/router.rego +30 -0
  99. acp/runtime.py +93 -0
  100. truceptor-0.3.2.dist-info/METADATA +401 -0
  101. truceptor-0.3.2.dist-info/RECORD +105 -0
  102. truceptor-0.3.2.dist-info/WHEEL +5 -0
  103. truceptor-0.3.2.dist-info/entry_points.txt +2 -0
  104. truceptor-0.3.2.dist-info/licenses/LICENSE +21 -0
  105. truceptor-0.3.2.dist-info/top_level.txt +1 -0
acp/__init__.py ADDED
@@ -0,0 +1,16 @@
1
+ """ACP Python SDK + CLI — governed execution client for the interceptor."""
2
+
3
+ __version__ = "0.3.2"
4
+
5
+ from acp.client import ACPClient, ToolCallResponse
6
+ from acp.decorators import governed_tool
7
+ from acp.exceptions import ACPSDKError, PolicyDenied, PolicyEscalated
8
+
9
+ __all__ = [
10
+ "ACPClient",
11
+ "ToolCallResponse",
12
+ "governed_tool",
13
+ "ACPSDKError",
14
+ "PolicyDenied",
15
+ "PolicyEscalated",
16
+ ]