palaryn 0.1.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/LICENSE +21 -0
- package/README.md +716 -0
- package/dist/sdk/typescript/src/client.d.ts +71 -0
- package/dist/sdk/typescript/src/client.d.ts.map +1 -0
- package/dist/sdk/typescript/src/client.js +176 -0
- package/dist/sdk/typescript/src/client.js.map +1 -0
- package/dist/sdk/typescript/src/errors.d.ts +50 -0
- package/dist/sdk/typescript/src/errors.d.ts.map +1 -0
- package/dist/sdk/typescript/src/errors.js +103 -0
- package/dist/sdk/typescript/src/errors.js.map +1 -0
- package/dist/sdk/typescript/src/index.d.ts +4 -0
- package/dist/sdk/typescript/src/index.d.ts.map +1 -0
- package/dist/sdk/typescript/src/index.js +15 -0
- package/dist/sdk/typescript/src/index.js.map +1 -0
- package/dist/sdk/typescript/src/types.d.ts +101 -0
- package/dist/sdk/typescript/src/types.d.ts.map +1 -0
- package/dist/sdk/typescript/src/types.js +6 -0
- package/dist/sdk/typescript/src/types.js.map +1 -0
- package/dist/src/admin/index.d.ts +2 -0
- package/dist/src/admin/index.d.ts.map +1 -0
- package/dist/src/admin/index.js +6 -0
- package/dist/src/admin/index.js.map +1 -0
- package/dist/src/admin/routes.d.ts +5 -0
- package/dist/src/admin/routes.d.ts.map +1 -0
- package/dist/src/admin/routes.js +471 -0
- package/dist/src/admin/routes.js.map +1 -0
- package/dist/src/admin/templates.d.ts +51 -0
- package/dist/src/admin/templates.d.ts.map +1 -0
- package/dist/src/admin/templates.js +500 -0
- package/dist/src/admin/templates.js.map +1 -0
- package/dist/src/anomaly/detector.d.ts +141 -0
- package/dist/src/anomaly/detector.d.ts.map +1 -0
- package/dist/src/anomaly/detector.js +554 -0
- package/dist/src/anomaly/detector.js.map +1 -0
- package/dist/src/anomaly/index.d.ts +2 -0
- package/dist/src/anomaly/index.d.ts.map +1 -0
- package/dist/src/anomaly/index.js +7 -0
- package/dist/src/anomaly/index.js.map +1 -0
- package/dist/src/approval/manager.d.ts +147 -0
- package/dist/src/approval/manager.d.ts.map +1 -0
- package/dist/src/approval/manager.js +511 -0
- package/dist/src/approval/manager.js.map +1 -0
- package/dist/src/approval/webhook.d.ts +36 -0
- package/dist/src/approval/webhook.d.ts.map +1 -0
- package/dist/src/approval/webhook.js +135 -0
- package/dist/src/approval/webhook.js.map +1 -0
- package/dist/src/audit/logger.d.ts +70 -0
- package/dist/src/audit/logger.d.ts.map +1 -0
- package/dist/src/audit/logger.js +440 -0
- package/dist/src/audit/logger.js.map +1 -0
- package/dist/src/auth/index.d.ts +6 -0
- package/dist/src/auth/index.d.ts.map +1 -0
- package/dist/src/auth/index.js +22 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/auth/password.d.ts +3 -0
- package/dist/src/auth/password.d.ts.map +1 -0
- package/dist/src/auth/password.js +25 -0
- package/dist/src/auth/password.js.map +1 -0
- package/dist/src/auth/pkce.d.ts +13 -0
- package/dist/src/auth/pkce.d.ts.map +1 -0
- package/dist/src/auth/pkce.js +58 -0
- package/dist/src/auth/pkce.js.map +1 -0
- package/dist/src/auth/providers.d.ts +28 -0
- package/dist/src/auth/providers.d.ts.map +1 -0
- package/dist/src/auth/providers.js +198 -0
- package/dist/src/auth/providers.js.map +1 -0
- package/dist/src/auth/routes.d.ts +14 -0
- package/dist/src/auth/routes.d.ts.map +1 -0
- package/dist/src/auth/routes.js +431 -0
- package/dist/src/auth/routes.js.map +1 -0
- package/dist/src/auth/session.d.ts +24 -0
- package/dist/src/auth/session.d.ts.map +1 -0
- package/dist/src/auth/session.js +105 -0
- package/dist/src/auth/session.js.map +1 -0
- package/dist/src/billing/index.d.ts +7 -0
- package/dist/src/billing/index.d.ts.map +1 -0
- package/dist/src/billing/index.js +14 -0
- package/dist/src/billing/index.js.map +1 -0
- package/dist/src/billing/plan-enforcer.d.ts +44 -0
- package/dist/src/billing/plan-enforcer.d.ts.map +1 -0
- package/dist/src/billing/plan-enforcer.js +110 -0
- package/dist/src/billing/plan-enforcer.js.map +1 -0
- package/dist/src/billing/routes.d.ts +15 -0
- package/dist/src/billing/routes.d.ts.map +1 -0
- package/dist/src/billing/routes.js +193 -0
- package/dist/src/billing/routes.js.map +1 -0
- package/dist/src/billing/stripe-client.d.ts +14 -0
- package/dist/src/billing/stripe-client.d.ts.map +1 -0
- package/dist/src/billing/stripe-client.js +51 -0
- package/dist/src/billing/stripe-client.js.map +1 -0
- package/dist/src/billing/webhook-handler.d.ts +19 -0
- package/dist/src/billing/webhook-handler.d.ts.map +1 -0
- package/dist/src/billing/webhook-handler.js +169 -0
- package/dist/src/billing/webhook-handler.js.map +1 -0
- package/dist/src/billing/webhook-routes.d.ts +5 -0
- package/dist/src/billing/webhook-routes.d.ts.map +1 -0
- package/dist/src/billing/webhook-routes.js +30 -0
- package/dist/src/billing/webhook-routes.js.map +1 -0
- package/dist/src/budget/manager.d.ts +95 -0
- package/dist/src/budget/manager.d.ts.map +1 -0
- package/dist/src/budget/manager.js +547 -0
- package/dist/src/budget/manager.js.map +1 -0
- package/dist/src/budget/usage-extractor.d.ts +38 -0
- package/dist/src/budget/usage-extractor.d.ts.map +1 -0
- package/dist/src/budget/usage-extractor.js +165 -0
- package/dist/src/budget/usage-extractor.js.map +1 -0
- package/dist/src/cli.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +115 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config/defaults.d.ts +3 -0
- package/dist/src/config/defaults.d.ts.map +1 -0
- package/dist/src/config/defaults.js +243 -0
- package/dist/src/config/defaults.js.map +1 -0
- package/dist/src/config/validate.d.ts +15 -0
- package/dist/src/config/validate.d.ts.map +1 -0
- package/dist/src/config/validate.js +105 -0
- package/dist/src/config/validate.js.map +1 -0
- package/dist/src/dlp/composite-scanner.d.ts +47 -0
- package/dist/src/dlp/composite-scanner.d.ts.map +1 -0
- package/dist/src/dlp/composite-scanner.js +186 -0
- package/dist/src/dlp/composite-scanner.js.map +1 -0
- package/dist/src/dlp/index.d.ts +10 -0
- package/dist/src/dlp/index.d.ts.map +1 -0
- package/dist/src/dlp/index.js +26 -0
- package/dist/src/dlp/index.js.map +1 -0
- package/dist/src/dlp/interfaces.d.ts +33 -0
- package/dist/src/dlp/interfaces.d.ts.map +1 -0
- package/dist/src/dlp/interfaces.js +3 -0
- package/dist/src/dlp/interfaces.js.map +1 -0
- package/dist/src/dlp/patterns.d.ts +9 -0
- package/dist/src/dlp/patterns.d.ts.map +1 -0
- package/dist/src/dlp/patterns.js +25 -0
- package/dist/src/dlp/patterns.js.map +1 -0
- package/dist/src/dlp/prompt-injection-backend.d.ts +68 -0
- package/dist/src/dlp/prompt-injection-backend.d.ts.map +1 -0
- package/dist/src/dlp/prompt-injection-backend.js +148 -0
- package/dist/src/dlp/prompt-injection-backend.js.map +1 -0
- package/dist/src/dlp/prompt-injection-patterns.d.ts +32 -0
- package/dist/src/dlp/prompt-injection-patterns.d.ts.map +1 -0
- package/dist/src/dlp/prompt-injection-patterns.js +290 -0
- package/dist/src/dlp/prompt-injection-patterns.js.map +1 -0
- package/dist/src/dlp/regex-backend.d.ts +32 -0
- package/dist/src/dlp/regex-backend.d.ts.map +1 -0
- package/dist/src/dlp/regex-backend.js +153 -0
- package/dist/src/dlp/regex-backend.js.map +1 -0
- package/dist/src/dlp/scanner.d.ts +122 -0
- package/dist/src/dlp/scanner.d.ts.map +1 -0
- package/dist/src/dlp/scanner.js +444 -0
- package/dist/src/dlp/scanner.js.map +1 -0
- package/dist/src/dlp/text-normalizer.d.ts +41 -0
- package/dist/src/dlp/text-normalizer.d.ts.map +1 -0
- package/dist/src/dlp/text-normalizer.js +203 -0
- package/dist/src/dlp/text-normalizer.js.map +1 -0
- package/dist/src/dlp/trufflehog-backend.d.ts +64 -0
- package/dist/src/dlp/trufflehog-backend.d.ts.map +1 -0
- package/dist/src/dlp/trufflehog-backend.js +151 -0
- package/dist/src/dlp/trufflehog-backend.js.map +1 -0
- package/dist/src/executor/http-executor.d.ts +25 -0
- package/dist/src/executor/http-executor.d.ts.map +1 -0
- package/dist/src/executor/http-executor.js +333 -0
- package/dist/src/executor/http-executor.js.map +1 -0
- package/dist/src/executor/index.d.ts +6 -0
- package/dist/src/executor/index.d.ts.map +1 -0
- package/dist/src/executor/index.js +12 -0
- package/dist/src/executor/index.js.map +1 -0
- package/dist/src/executor/interfaces.d.ts +11 -0
- package/dist/src/executor/interfaces.d.ts.map +1 -0
- package/dist/src/executor/interfaces.js +3 -0
- package/dist/src/executor/interfaces.js.map +1 -0
- package/dist/src/executor/noop-executor.d.ts +13 -0
- package/dist/src/executor/noop-executor.d.ts.map +1 -0
- package/dist/src/executor/noop-executor.js +21 -0
- package/dist/src/executor/noop-executor.js.map +1 -0
- package/dist/src/executor/registry.d.ts +30 -0
- package/dist/src/executor/registry.d.ts.map +1 -0
- package/dist/src/executor/registry.js +62 -0
- package/dist/src/executor/registry.js.map +1 -0
- package/dist/src/executor/slack-executor.d.ts +24 -0
- package/dist/src/executor/slack-executor.d.ts.map +1 -0
- package/dist/src/executor/slack-executor.js +147 -0
- package/dist/src/executor/slack-executor.js.map +1 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +74 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/auth-verifier.d.ts +23 -0
- package/dist/src/mcp/auth-verifier.d.ts.map +1 -0
- package/dist/src/mcp/auth-verifier.js +162 -0
- package/dist/src/mcp/auth-verifier.js.map +1 -0
- package/dist/src/mcp/bridge.d.ts +132 -0
- package/dist/src/mcp/bridge.d.ts.map +1 -0
- package/dist/src/mcp/bridge.js +734 -0
- package/dist/src/mcp/bridge.js.map +1 -0
- package/dist/src/mcp/http-transport.d.ts +32 -0
- package/dist/src/mcp/http-transport.d.ts.map +1 -0
- package/dist/src/mcp/http-transport.js +538 -0
- package/dist/src/mcp/http-transport.js.map +1 -0
- package/dist/src/mcp/index.d.ts +10 -0
- package/dist/src/mcp/index.d.ts.map +1 -0
- package/dist/src/mcp/index.js +17 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/oauth-pages.d.ts +23 -0
- package/dist/src/mcp/oauth-pages.d.ts.map +1 -0
- package/dist/src/mcp/oauth-pages.js +121 -0
- package/dist/src/mcp/oauth-pages.js.map +1 -0
- package/dist/src/mcp/oauth-postgres-stores.d.ts +55 -0
- package/dist/src/mcp/oauth-postgres-stores.d.ts.map +1 -0
- package/dist/src/mcp/oauth-postgres-stores.js +226 -0
- package/dist/src/mcp/oauth-postgres-stores.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +95 -0
- package/dist/src/mcp/oauth-provider.d.ts.map +1 -0
- package/dist/src/mcp/oauth-provider.js +360 -0
- package/dist/src/mcp/oauth-provider.js.map +1 -0
- package/dist/src/mcp/oauth-stores.d.ts +62 -0
- package/dist/src/mcp/oauth-stores.d.ts.map +1 -0
- package/dist/src/mcp/oauth-stores.js +154 -0
- package/dist/src/mcp/oauth-stores.js.map +1 -0
- package/dist/src/mcp/server.d.ts +18 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +51 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/metrics/collector.d.ts +106 -0
- package/dist/src/metrics/collector.d.ts.map +1 -0
- package/dist/src/metrics/collector.js +311 -0
- package/dist/src/metrics/collector.js.map +1 -0
- package/dist/src/metrics/index.d.ts +2 -0
- package/dist/src/metrics/index.d.ts.map +1 -0
- package/dist/src/metrics/index.js +6 -0
- package/dist/src/metrics/index.js.map +1 -0
- package/dist/src/middleware/auth.d.ts +77 -0
- package/dist/src/middleware/auth.d.ts.map +1 -0
- package/dist/src/middleware/auth.js +720 -0
- package/dist/src/middleware/auth.js.map +1 -0
- package/dist/src/middleware/session.d.ts +18 -0
- package/dist/src/middleware/session.d.ts.map +1 -0
- package/dist/src/middleware/session.js +67 -0
- package/dist/src/middleware/session.js.map +1 -0
- package/dist/src/middleware/validate.d.ts +3 -0
- package/dist/src/middleware/validate.d.ts.map +1 -0
- package/dist/src/middleware/validate.js +85 -0
- package/dist/src/middleware/validate.js.map +1 -0
- package/dist/src/policy/engine.d.ts +107 -0
- package/dist/src/policy/engine.d.ts.map +1 -0
- package/dist/src/policy/engine.js +646 -0
- package/dist/src/policy/engine.js.map +1 -0
- package/dist/src/policy/index.d.ts +3 -0
- package/dist/src/policy/index.d.ts.map +1 -0
- package/dist/src/policy/index.js +8 -0
- package/dist/src/policy/index.js.map +1 -0
- package/dist/src/policy/opa-engine.d.ts +176 -0
- package/dist/src/policy/opa-engine.d.ts.map +1 -0
- package/dist/src/policy/opa-engine.js +790 -0
- package/dist/src/policy/opa-engine.js.map +1 -0
- package/dist/src/proxy/forward-proxy.d.ts +30 -0
- package/dist/src/proxy/forward-proxy.d.ts.map +1 -0
- package/dist/src/proxy/forward-proxy.js +580 -0
- package/dist/src/proxy/forward-proxy.js.map +1 -0
- package/dist/src/proxy/index.d.ts +2 -0
- package/dist/src/proxy/index.d.ts.map +1 -0
- package/dist/src/proxy/index.js +8 -0
- package/dist/src/proxy/index.js.map +1 -0
- package/dist/src/ratelimit/limiter.d.ts +45 -0
- package/dist/src/ratelimit/limiter.d.ts.map +1 -0
- package/dist/src/ratelimit/limiter.js +158 -0
- package/dist/src/ratelimit/limiter.js.map +1 -0
- package/dist/src/replay/engine.d.ts +40 -0
- package/dist/src/replay/engine.d.ts.map +1 -0
- package/dist/src/replay/engine.js +106 -0
- package/dist/src/replay/engine.js.map +1 -0
- package/dist/src/replay/index.d.ts +2 -0
- package/dist/src/replay/index.d.ts.map +1 -0
- package/dist/src/replay/index.js +6 -0
- package/dist/src/replay/index.js.map +1 -0
- package/dist/src/saas/index.d.ts +2 -0
- package/dist/src/saas/index.d.ts.map +1 -0
- package/dist/src/saas/index.js +18 -0
- package/dist/src/saas/index.js.map +1 -0
- package/dist/src/saas/routes.d.ts +18 -0
- package/dist/src/saas/routes.d.ts.map +1 -0
- package/dist/src/saas/routes.js +1566 -0
- package/dist/src/saas/routes.js.map +1 -0
- package/dist/src/server/app.d.ts +44 -0
- package/dist/src/server/app.d.ts.map +1 -0
- package/dist/src/server/app.js +854 -0
- package/dist/src/server/app.js.map +1 -0
- package/dist/src/server/errors.d.ts +32 -0
- package/dist/src/server/errors.d.ts.map +1 -0
- package/dist/src/server/errors.js +39 -0
- package/dist/src/server/errors.js.map +1 -0
- package/dist/src/server/gateway.d.ts +165 -0
- package/dist/src/server/gateway.d.ts.map +1 -0
- package/dist/src/server/gateway.js +964 -0
- package/dist/src/server/gateway.js.map +1 -0
- package/dist/src/server/index.d.ts +2 -0
- package/dist/src/server/index.d.ts.map +1 -0
- package/dist/src/server/index.js +295 -0
- package/dist/src/server/index.js.map +1 -0
- package/dist/src/server/logger.d.ts +33 -0
- package/dist/src/server/logger.d.ts.map +1 -0
- package/dist/src/server/logger.js +230 -0
- package/dist/src/server/logger.js.map +1 -0
- package/dist/src/server/stream-proxy.d.ts +32 -0
- package/dist/src/server/stream-proxy.d.ts.map +1 -0
- package/dist/src/server/stream-proxy.js +184 -0
- package/dist/src/server/stream-proxy.js.map +1 -0
- package/dist/src/storage/file-persistence.d.ts +48 -0
- package/dist/src/storage/file-persistence.d.ts.map +1 -0
- package/dist/src/storage/file-persistence.js +280 -0
- package/dist/src/storage/file-persistence.js.map +1 -0
- package/dist/src/storage/index.d.ts +5 -0
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/src/storage/index.js +21 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/storage/interfaces.d.ts +237 -0
- package/dist/src/storage/interfaces.d.ts.map +1 -0
- package/dist/src/storage/interfaces.js +3 -0
- package/dist/src/storage/interfaces.js.map +1 -0
- package/dist/src/storage/memory.d.ts +162 -0
- package/dist/src/storage/memory.d.ts.map +1 -0
- package/dist/src/storage/memory.js +603 -0
- package/dist/src/storage/memory.js.map +1 -0
- package/dist/src/storage/postgres.d.ts +267 -0
- package/dist/src/storage/postgres.d.ts.map +1 -0
- package/dist/src/storage/postgres.js +1555 -0
- package/dist/src/storage/postgres.js.map +1 -0
- package/dist/src/storage/redis.d.ts +202 -0
- package/dist/src/storage/redis.d.ts.map +1 -0
- package/dist/src/storage/redis.js +629 -0
- package/dist/src/storage/redis.js.map +1 -0
- package/dist/src/tracing/index.d.ts +2 -0
- package/dist/src/tracing/index.d.ts.map +1 -0
- package/dist/src/tracing/index.js +6 -0
- package/dist/src/tracing/index.js.map +1 -0
- package/dist/src/tracing/provider.d.ts +43 -0
- package/dist/src/tracing/provider.d.ts.map +1 -0
- package/dist/src/tracing/provider.js +74 -0
- package/dist/src/tracing/provider.js.map +1 -0
- package/dist/src/trust/calculator.d.ts +54 -0
- package/dist/src/trust/calculator.d.ts.map +1 -0
- package/dist/src/trust/calculator.js +102 -0
- package/dist/src/trust/calculator.js.map +1 -0
- package/dist/src/trust/index.d.ts +2 -0
- package/dist/src/trust/index.d.ts.map +1 -0
- package/dist/src/trust/index.js +7 -0
- package/dist/src/trust/index.js.map +1 -0
- package/dist/src/types/budget.d.ts +30 -0
- package/dist/src/types/budget.d.ts.map +1 -0
- package/dist/src/types/budget.js +3 -0
- package/dist/src/types/budget.js.map +1 -0
- package/dist/src/types/config.d.ts +176 -0
- package/dist/src/types/config.d.ts.map +1 -0
- package/dist/src/types/config.js +3 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/events.d.ts +24 -0
- package/dist/src/types/events.d.ts.map +1 -0
- package/dist/src/types/events.js +3 -0
- package/dist/src/types/events.js.map +1 -0
- package/dist/src/types/index.d.ts +8 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +24 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/policy.d.ts +60 -0
- package/dist/src/types/policy.d.ts.map +1 -0
- package/dist/src/types/policy.js +3 -0
- package/dist/src/types/policy.js.map +1 -0
- package/dist/src/types/stripe-config.d.ts +12 -0
- package/dist/src/types/stripe-config.d.ts.map +1 -0
- package/dist/src/types/stripe-config.js +3 -0
- package/dist/src/types/stripe-config.js.map +1 -0
- package/dist/src/types/subscription.d.ts +24 -0
- package/dist/src/types/subscription.d.ts.map +1 -0
- package/dist/src/types/subscription.js +38 -0
- package/dist/src/types/subscription.js.map +1 -0
- package/dist/src/types/tool-call.d.ts +42 -0
- package/dist/src/types/tool-call.d.ts.map +1 -0
- package/dist/src/types/tool-call.js +3 -0
- package/dist/src/types/tool-call.js.map +1 -0
- package/dist/src/types/tool-result.d.ts +58 -0
- package/dist/src/types/tool-result.d.ts.map +1 -0
- package/dist/src/types/tool-result.js +3 -0
- package/dist/src/types/tool-result.js.map +1 -0
- package/dist/src/types/user.d.ts +101 -0
- package/dist/src/types/user.d.ts.map +1 -0
- package/dist/src/types/user.js +6 -0
- package/dist/src/types/user.js.map +1 -0
- package/dist/tests/integration/api.test.d.ts +2 -0
- package/dist/tests/integration/api.test.d.ts.map +1 -0
- package/dist/tests/integration/api.test.js +1199 -0
- package/dist/tests/integration/api.test.js.map +1 -0
- package/dist/tests/integration/proxy.test.d.ts +2 -0
- package/dist/tests/integration/proxy.test.d.ts.map +1 -0
- package/dist/tests/integration/proxy.test.js +251 -0
- package/dist/tests/integration/proxy.test.js.map +1 -0
- package/dist/tests/integration/storage.test.d.ts +16 -0
- package/dist/tests/integration/storage.test.d.ts.map +1 -0
- package/dist/tests/integration/storage.test.js +826 -0
- package/dist/tests/integration/storage.test.js.map +1 -0
- package/dist/tests/unit/admin.test.d.ts +2 -0
- package/dist/tests/unit/admin.test.d.ts.map +1 -0
- package/dist/tests/unit/admin.test.js +698 -0
- package/dist/tests/unit/admin.test.js.map +1 -0
- package/dist/tests/unit/anomaly-detector.test.d.ts +2 -0
- package/dist/tests/unit/anomaly-detector.test.d.ts.map +1 -0
- package/dist/tests/unit/anomaly-detector.test.js +903 -0
- package/dist/tests/unit/anomaly-detector.test.js.map +1 -0
- package/dist/tests/unit/approval-manager.test.d.ts +2 -0
- package/dist/tests/unit/approval-manager.test.d.ts.map +1 -0
- package/dist/tests/unit/approval-manager.test.js +528 -0
- package/dist/tests/unit/approval-manager.test.js.map +1 -0
- package/dist/tests/unit/approval-webhook.test.d.ts +2 -0
- package/dist/tests/unit/approval-webhook.test.d.ts.map +1 -0
- package/dist/tests/unit/approval-webhook.test.js +355 -0
- package/dist/tests/unit/approval-webhook.test.js.map +1 -0
- package/dist/tests/unit/audit-logger.test.d.ts +2 -0
- package/dist/tests/unit/audit-logger.test.d.ts.map +1 -0
- package/dist/tests/unit/audit-logger.test.js +635 -0
- package/dist/tests/unit/audit-logger.test.js.map +1 -0
- package/dist/tests/unit/auth-routes.test.d.ts +2 -0
- package/dist/tests/unit/auth-routes.test.d.ts.map +1 -0
- package/dist/tests/unit/auth-routes.test.js +281 -0
- package/dist/tests/unit/auth-routes.test.js.map +1 -0
- package/dist/tests/unit/auth.test.d.ts +2 -0
- package/dist/tests/unit/auth.test.d.ts.map +1 -0
- package/dist/tests/unit/auth.test.js +1382 -0
- package/dist/tests/unit/auth.test.js.map +1 -0
- package/dist/tests/unit/billing.test.d.ts +2 -0
- package/dist/tests/unit/billing.test.d.ts.map +1 -0
- package/dist/tests/unit/billing.test.js +579 -0
- package/dist/tests/unit/billing.test.js.map +1 -0
- package/dist/tests/unit/budget-manager.test.d.ts +2 -0
- package/dist/tests/unit/budget-manager.test.d.ts.map +1 -0
- package/dist/tests/unit/budget-manager.test.js +778 -0
- package/dist/tests/unit/budget-manager.test.js.map +1 -0
- package/dist/tests/unit/budget-race.test.d.ts +2 -0
- package/dist/tests/unit/budget-race.test.d.ts.map +1 -0
- package/dist/tests/unit/budget-race.test.js +58 -0
- package/dist/tests/unit/budget-race.test.js.map +1 -0
- package/dist/tests/unit/cli.test.d.ts +2 -0
- package/dist/tests/unit/cli.test.d.ts.map +1 -0
- package/dist/tests/unit/cli.test.js +93 -0
- package/dist/tests/unit/cli.test.js.map +1 -0
- package/dist/tests/unit/concurrency.test.d.ts +2 -0
- package/dist/tests/unit/concurrency.test.d.ts.map +1 -0
- package/dist/tests/unit/concurrency.test.js +1270 -0
- package/dist/tests/unit/concurrency.test.js.map +1 -0
- package/dist/tests/unit/config-validate.test.d.ts +2 -0
- package/dist/tests/unit/config-validate.test.d.ts.map +1 -0
- package/dist/tests/unit/config-validate.test.js +230 -0
- package/dist/tests/unit/config-validate.test.js.map +1 -0
- package/dist/tests/unit/defaults.test.d.ts +2 -0
- package/dist/tests/unit/defaults.test.d.ts.map +1 -0
- package/dist/tests/unit/defaults.test.js +364 -0
- package/dist/tests/unit/defaults.test.js.map +1 -0
- package/dist/tests/unit/dlp-backends.test.d.ts +2 -0
- package/dist/tests/unit/dlp-backends.test.d.ts.map +1 -0
- package/dist/tests/unit/dlp-backends.test.js +563 -0
- package/dist/tests/unit/dlp-backends.test.js.map +1 -0
- package/dist/tests/unit/dlp-scanner.test.d.ts +2 -0
- package/dist/tests/unit/dlp-scanner.test.d.ts.map +1 -0
- package/dist/tests/unit/dlp-scanner.test.js +739 -0
- package/dist/tests/unit/dlp-scanner.test.js.map +1 -0
- package/dist/tests/unit/error-responses.test.d.ts +2 -0
- package/dist/tests/unit/error-responses.test.d.ts.map +1 -0
- package/dist/tests/unit/error-responses.test.js +101 -0
- package/dist/tests/unit/error-responses.test.js.map +1 -0
- package/dist/tests/unit/executor-registry.test.d.ts +2 -0
- package/dist/tests/unit/executor-registry.test.d.ts.map +1 -0
- package/dist/tests/unit/executor-registry.test.js +390 -0
- package/dist/tests/unit/executor-registry.test.js.map +1 -0
- package/dist/tests/unit/forward-proxy.test.d.ts +2 -0
- package/dist/tests/unit/forward-proxy.test.d.ts.map +1 -0
- package/dist/tests/unit/forward-proxy.test.js +621 -0
- package/dist/tests/unit/forward-proxy.test.js.map +1 -0
- package/dist/tests/unit/gateway-features.test.d.ts +2 -0
- package/dist/tests/unit/gateway-features.test.d.ts.map +1 -0
- package/dist/tests/unit/gateway-features.test.js +753 -0
- package/dist/tests/unit/gateway-features.test.js.map +1 -0
- package/dist/tests/unit/http-executor.test.d.ts +2 -0
- package/dist/tests/unit/http-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/http-executor.test.js +310 -0
- package/dist/tests/unit/http-executor.test.js.map +1 -0
- package/dist/tests/unit/mcp-bridge.test.d.ts +2 -0
- package/dist/tests/unit/mcp-bridge.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-bridge.test.js +1136 -0
- package/dist/tests/unit/mcp-bridge.test.js.map +1 -0
- package/dist/tests/unit/mcp-http-transport.test.d.ts +2 -0
- package/dist/tests/unit/mcp-http-transport.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-http-transport.test.js +899 -0
- package/dist/tests/unit/mcp-http-transport.test.js.map +1 -0
- package/dist/tests/unit/mcp-oauth.test.d.ts +2 -0
- package/dist/tests/unit/mcp-oauth.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-oauth.test.js +759 -0
- package/dist/tests/unit/mcp-oauth.test.js.map +1 -0
- package/dist/tests/unit/mcp-server.test.d.ts +15 -0
- package/dist/tests/unit/mcp-server.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-server.test.js +158 -0
- package/dist/tests/unit/mcp-server.test.js.map +1 -0
- package/dist/tests/unit/metrics.test.d.ts +2 -0
- package/dist/tests/unit/metrics.test.d.ts.map +1 -0
- package/dist/tests/unit/metrics.test.js +208 -0
- package/dist/tests/unit/metrics.test.js.map +1 -0
- package/dist/tests/unit/oauth.test.d.ts +2 -0
- package/dist/tests/unit/oauth.test.d.ts.map +1 -0
- package/dist/tests/unit/oauth.test.js +281 -0
- package/dist/tests/unit/oauth.test.js.map +1 -0
- package/dist/tests/unit/opa-circuit-breaker.test.d.ts +2 -0
- package/dist/tests/unit/opa-circuit-breaker.test.d.ts.map +1 -0
- package/dist/tests/unit/opa-circuit-breaker.test.js +297 -0
- package/dist/tests/unit/opa-circuit-breaker.test.js.map +1 -0
- package/dist/tests/unit/opa-engine.test.d.ts +2 -0
- package/dist/tests/unit/opa-engine.test.d.ts.map +1 -0
- package/dist/tests/unit/opa-engine.test.js +1813 -0
- package/dist/tests/unit/opa-engine.test.js.map +1 -0
- package/dist/tests/unit/pipeline-timing.test.d.ts +2 -0
- package/dist/tests/unit/pipeline-timing.test.d.ts.map +1 -0
- package/dist/tests/unit/pipeline-timing.test.js +528 -0
- package/dist/tests/unit/pipeline-timing.test.js.map +1 -0
- package/dist/tests/unit/policy-engine.test.d.ts +2 -0
- package/dist/tests/unit/policy-engine.test.d.ts.map +1 -0
- package/dist/tests/unit/policy-engine.test.js +1345 -0
- package/dist/tests/unit/policy-engine.test.js.map +1 -0
- package/dist/tests/unit/policy-store.test.d.ts +2 -0
- package/dist/tests/unit/policy-store.test.d.ts.map +1 -0
- package/dist/tests/unit/policy-store.test.js +60 -0
- package/dist/tests/unit/policy-store.test.js.map +1 -0
- package/dist/tests/unit/postgres-storage.test.d.ts +2 -0
- package/dist/tests/unit/postgres-storage.test.d.ts.map +1 -0
- package/dist/tests/unit/postgres-storage.test.js +614 -0
- package/dist/tests/unit/postgres-storage.test.js.map +1 -0
- package/dist/tests/unit/prompt-injection-backend.test.d.ts +2 -0
- package/dist/tests/unit/prompt-injection-backend.test.d.ts.map +1 -0
- package/dist/tests/unit/prompt-injection-backend.test.js +621 -0
- package/dist/tests/unit/prompt-injection-backend.test.js.map +1 -0
- package/dist/tests/unit/proxy-hardening.test.d.ts +2 -0
- package/dist/tests/unit/proxy-hardening.test.d.ts.map +1 -0
- package/dist/tests/unit/proxy-hardening.test.js +166 -0
- package/dist/tests/unit/proxy-hardening.test.js.map +1 -0
- package/dist/tests/unit/rate-limiter.test.d.ts +2 -0
- package/dist/tests/unit/rate-limiter.test.d.ts.map +1 -0
- package/dist/tests/unit/rate-limiter.test.js +443 -0
- package/dist/tests/unit/rate-limiter.test.js.map +1 -0
- package/dist/tests/unit/redis-storage.test.d.ts +2 -0
- package/dist/tests/unit/redis-storage.test.d.ts.map +1 -0
- package/dist/tests/unit/redis-storage.test.js +766 -0
- package/dist/tests/unit/redis-storage.test.js.map +1 -0
- package/dist/tests/unit/replay-engine.test.d.ts +2 -0
- package/dist/tests/unit/replay-engine.test.d.ts.map +1 -0
- package/dist/tests/unit/replay-engine.test.js +371 -0
- package/dist/tests/unit/replay-engine.test.js.map +1 -0
- package/dist/tests/unit/saas-routes.test.d.ts +2 -0
- package/dist/tests/unit/saas-routes.test.d.ts.map +1 -0
- package/dist/tests/unit/saas-routes.test.js +1399 -0
- package/dist/tests/unit/saas-routes.test.js.map +1 -0
- package/dist/tests/unit/session.test.d.ts +2 -0
- package/dist/tests/unit/session.test.d.ts.map +1 -0
- package/dist/tests/unit/session.test.js +532 -0
- package/dist/tests/unit/session.test.js.map +1 -0
- package/dist/tests/unit/slack-executor.test.d.ts +2 -0
- package/dist/tests/unit/slack-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/slack-executor.test.js +209 -0
- package/dist/tests/unit/slack-executor.test.js.map +1 -0
- package/dist/tests/unit/storage-hardening.test.d.ts +2 -0
- package/dist/tests/unit/storage-hardening.test.d.ts.map +1 -0
- package/dist/tests/unit/storage-hardening.test.js +165 -0
- package/dist/tests/unit/storage-hardening.test.js.map +1 -0
- package/dist/tests/unit/storage.test.d.ts +2 -0
- package/dist/tests/unit/storage.test.d.ts.map +1 -0
- package/dist/tests/unit/storage.test.js +698 -0
- package/dist/tests/unit/storage.test.js.map +1 -0
- package/dist/tests/unit/text-normalizer.test.d.ts +2 -0
- package/dist/tests/unit/text-normalizer.test.d.ts.map +1 -0
- package/dist/tests/unit/text-normalizer.test.js +229 -0
- package/dist/tests/unit/text-normalizer.test.js.map +1 -0
- package/dist/tests/unit/tracing.test.d.ts +2 -0
- package/dist/tests/unit/tracing.test.d.ts.map +1 -0
- package/dist/tests/unit/tracing.test.js +611 -0
- package/dist/tests/unit/tracing.test.js.map +1 -0
- package/dist/tests/unit/trust-calculator.test.d.ts +2 -0
- package/dist/tests/unit/trust-calculator.test.d.ts.map +1 -0
- package/dist/tests/unit/trust-calculator.test.js +497 -0
- package/dist/tests/unit/trust-calculator.test.js.map +1 -0
- package/dist/tests/unit/ts-sdk.test.d.ts +2 -0
- package/dist/tests/unit/ts-sdk.test.d.ts.map +1 -0
- package/dist/tests/unit/ts-sdk.test.js +421 -0
- package/dist/tests/unit/ts-sdk.test.js.map +1 -0
- package/dist/tests/unit/usage-extractor-llm.test.d.ts +2 -0
- package/dist/tests/unit/usage-extractor-llm.test.d.ts.map +1 -0
- package/dist/tests/unit/usage-extractor-llm.test.js +139 -0
- package/dist/tests/unit/usage-extractor-llm.test.js.map +1 -0
- package/dist/tests/unit/usage-extractor.test.d.ts +2 -0
- package/dist/tests/unit/usage-extractor.test.d.ts.map +1 -0
- package/dist/tests/unit/usage-extractor.test.js +271 -0
- package/dist/tests/unit/usage-extractor.test.js.map +1 -0
- package/dist/tests/unit/user-stores.test.d.ts +2 -0
- package/dist/tests/unit/user-stores.test.d.ts.map +1 -0
- package/dist/tests/unit/user-stores.test.js +687 -0
- package/dist/tests/unit/user-stores.test.js.map +1 -0
- package/dist/tests/unit/validate.test.d.ts +2 -0
- package/dist/tests/unit/validate.test.d.ts.map +1 -0
- package/dist/tests/unit/validate.test.js +545 -0
- package/dist/tests/unit/validate.test.js.map +1 -0
- package/package.json +86 -0
- package/policy-packs/README.md +42 -0
- package/policy-packs/default.yaml +46 -0
- package/policy-packs/dev_fast.yaml +54 -0
- package/policy-packs/prod_strict.yaml +83 -0
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BudgetManager = void 0;
|
|
4
|
+
/** Small epsilon for floating-point comparison tolerance in budget checks */
|
|
5
|
+
const BUDGET_EPSILON = 1e-10;
|
|
6
|
+
// Default cost table for different tool types (used when no config override provided)
|
|
7
|
+
const DEFAULT_COST_TABLE = {
|
|
8
|
+
'http.request': 0.001,
|
|
9
|
+
'http.request.write': 0.002,
|
|
10
|
+
'slack.post': 0.003,
|
|
11
|
+
'git.operation': 0.002,
|
|
12
|
+
'db.query': 0.005,
|
|
13
|
+
'browser.navigate': 0.01,
|
|
14
|
+
'default': 0.001,
|
|
15
|
+
};
|
|
16
|
+
class BudgetManager {
|
|
17
|
+
constructor(config, store) {
|
|
18
|
+
this.config = {
|
|
19
|
+
task_budget_usd: config.task_budget_usd ?? 2.0,
|
|
20
|
+
user_daily_budget_usd: config.user_daily_budget_usd,
|
|
21
|
+
user_monthly_budget_usd: config.user_monthly_budget_usd,
|
|
22
|
+
workspace_daily_budget_usd: config.workspace_daily_budget_usd,
|
|
23
|
+
workspace_monthly_budget_usd: config.workspace_monthly_budget_usd,
|
|
24
|
+
max_steps_per_task: config.max_steps_per_task ?? 50,
|
|
25
|
+
max_retries_per_call: config.max_retries_per_call ?? 3,
|
|
26
|
+
max_wall_clock_ms: config.max_wall_clock_ms ?? 300000,
|
|
27
|
+
token_pricing: config.token_pricing,
|
|
28
|
+
};
|
|
29
|
+
// Merge config.cost_table over defaults
|
|
30
|
+
this.costTable = { ...DEFAULT_COST_TABLE, ...(config.cost_table || {}) };
|
|
31
|
+
this.externalStore = store;
|
|
32
|
+
this.taskStates = new Map();
|
|
33
|
+
this.userDailySpend = new Map();
|
|
34
|
+
this.userMonthlySpend = new Map();
|
|
35
|
+
this.workspaceDailySpend = new Map();
|
|
36
|
+
this.workspaceMonthlySpend = new Map();
|
|
37
|
+
this.callRetryCounts = new Map();
|
|
38
|
+
this.costRecords = new Map();
|
|
39
|
+
this.reservations = new Map();
|
|
40
|
+
this.budgetLocks = new Map();
|
|
41
|
+
}
|
|
42
|
+
// Estimate cost for a tool call
|
|
43
|
+
estimateCost(toolCall) {
|
|
44
|
+
const toolName = toolCall.tool.name;
|
|
45
|
+
const capability = toolCall.tool.capability;
|
|
46
|
+
// First try an exact match with capability suffix for write/delete operations
|
|
47
|
+
let cost;
|
|
48
|
+
if (capability === 'write' || capability === 'delete' || capability === 'admin') {
|
|
49
|
+
cost = this.costTable[`${toolName}.${capability}`] ?? this.costTable[`${toolName}.write`];
|
|
50
|
+
}
|
|
51
|
+
// Fall back to base tool name, then default
|
|
52
|
+
if (cost === undefined) {
|
|
53
|
+
cost = this.costTable[toolName] ?? this.costTable['default'];
|
|
54
|
+
}
|
|
55
|
+
// Apply a multiplier for destructive or elevated operations
|
|
56
|
+
if (capability === 'delete') {
|
|
57
|
+
cost *= 1.5;
|
|
58
|
+
}
|
|
59
|
+
else if (capability === 'admin') {
|
|
60
|
+
cost *= 2.0;
|
|
61
|
+
}
|
|
62
|
+
// Respect per-call max_cost_usd constraint as an upper bound on the estimate
|
|
63
|
+
if (toolCall.constraints?.max_cost_usd !== undefined && toolCall.constraints.max_cost_usd > 0) {
|
|
64
|
+
cost = Math.min(cost, toolCall.constraints.max_cost_usd);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
tool_name: toolName,
|
|
68
|
+
capability,
|
|
69
|
+
estimated_cost_usd: cost,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Check if a tool call is within budget (returns allowed: false with reason if not)
|
|
73
|
+
// Optional overrides allow per-workspace budget configuration.
|
|
74
|
+
check(toolCall, overrides) {
|
|
75
|
+
const cfg = overrides ? { ...this.config, ...overrides } : this.config;
|
|
76
|
+
const state = this.getTaskState(toolCall);
|
|
77
|
+
const estimate = this.estimateCost(toolCall);
|
|
78
|
+
const estimatedCost = estimate.estimated_cost_usd;
|
|
79
|
+
// Check task budget
|
|
80
|
+
const taskBudget = cfg.task_budget_usd;
|
|
81
|
+
if (state.spent_usd + estimatedCost > taskBudget + BUDGET_EPSILON) {
|
|
82
|
+
return {
|
|
83
|
+
allowed: false,
|
|
84
|
+
reason: `Task budget exceeded: spent $${state.spent_usd.toFixed(4)} + estimated $${estimatedCost.toFixed(4)} > limit $${taskBudget.toFixed(4)}`,
|
|
85
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Check step limit
|
|
89
|
+
const maxSteps = cfg.max_steps_per_task;
|
|
90
|
+
if (state.steps + 1 > maxSteps) {
|
|
91
|
+
return {
|
|
92
|
+
allowed: false,
|
|
93
|
+
reason: `Step limit exceeded: ${state.steps} steps taken, max is ${maxSteps}`,
|
|
94
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
// Check wall clock time
|
|
98
|
+
const maxWallClock = cfg.max_wall_clock_ms;
|
|
99
|
+
const elapsed = Date.now() - new Date(state.started_at).getTime();
|
|
100
|
+
if (elapsed > maxWallClock) {
|
|
101
|
+
return {
|
|
102
|
+
allowed: false,
|
|
103
|
+
reason: `Wall clock time exceeded: ${elapsed}ms elapsed, max is ${maxWallClock}ms`,
|
|
104
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
// Check user daily budget
|
|
108
|
+
const userDailyLimit = cfg.user_daily_budget_usd;
|
|
109
|
+
if (userDailyLimit !== undefined) {
|
|
110
|
+
const dailyKey = `${state.actor_id}:${this.getDateKey()}`;
|
|
111
|
+
const dailySpend = this.userDailySpend.get(dailyKey) ?? 0;
|
|
112
|
+
if (dailySpend + estimatedCost > userDailyLimit + BUDGET_EPSILON) {
|
|
113
|
+
return {
|
|
114
|
+
allowed: false,
|
|
115
|
+
reason: `User daily budget exceeded: spent $${dailySpend.toFixed(4)} + estimated $${estimatedCost.toFixed(4)} > limit $${userDailyLimit.toFixed(4)}`,
|
|
116
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Check user monthly budget
|
|
121
|
+
const userMonthlyLimit = cfg.user_monthly_budget_usd;
|
|
122
|
+
if (userMonthlyLimit !== undefined) {
|
|
123
|
+
const monthlyKey = `${state.actor_id}:${this.getMonthKey()}`;
|
|
124
|
+
const monthlySpend = this.userMonthlySpend.get(monthlyKey) ?? 0;
|
|
125
|
+
if (monthlySpend + estimatedCost > userMonthlyLimit + BUDGET_EPSILON) {
|
|
126
|
+
return {
|
|
127
|
+
allowed: false,
|
|
128
|
+
reason: `User monthly budget exceeded: spent $${monthlySpend.toFixed(4)} + estimated $${estimatedCost.toFixed(4)} > limit $${userMonthlyLimit.toFixed(4)}`,
|
|
129
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Check workspace daily budget
|
|
134
|
+
const wsDailyLimit = cfg.workspace_daily_budget_usd;
|
|
135
|
+
if (wsDailyLimit !== undefined) {
|
|
136
|
+
const dailyKey = `${state.workspace_id}:${this.getDateKey()}`;
|
|
137
|
+
const dailySpend = this.workspaceDailySpend.get(dailyKey) ?? 0;
|
|
138
|
+
if (dailySpend + estimatedCost > wsDailyLimit + BUDGET_EPSILON) {
|
|
139
|
+
return {
|
|
140
|
+
allowed: false,
|
|
141
|
+
reason: `Workspace daily budget exceeded: spent $${dailySpend.toFixed(4)} + estimated $${estimatedCost.toFixed(4)} > limit $${wsDailyLimit.toFixed(4)}`,
|
|
142
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Check workspace monthly budget
|
|
147
|
+
const wsMonthlyLimit = cfg.workspace_monthly_budget_usd;
|
|
148
|
+
if (wsMonthlyLimit !== undefined) {
|
|
149
|
+
const monthlyKey = `${state.workspace_id}:${this.getMonthKey()}`;
|
|
150
|
+
const monthlySpend = this.workspaceMonthlySpend.get(monthlyKey) ?? 0;
|
|
151
|
+
if (monthlySpend + estimatedCost > wsMonthlyLimit + BUDGET_EPSILON) {
|
|
152
|
+
return {
|
|
153
|
+
allowed: false,
|
|
154
|
+
reason: `Workspace monthly budget exceeded: spent $${monthlySpend.toFixed(4)} + estimated $${estimatedCost.toFixed(4)} > limit $${wsMonthlyLimit.toFixed(4)}`,
|
|
155
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
allowed: true,
|
|
161
|
+
report: this.getReport(toolCall, estimatedCost, cfg),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Atomically check budget and reserve the estimated cost.
|
|
166
|
+
* The reservation temporarily reduces available budget so concurrent
|
|
167
|
+
* requests cannot both pass the check.
|
|
168
|
+
* Uses a per-task lock to serialize concurrent reservations for the same budget key.
|
|
169
|
+
*/
|
|
170
|
+
async reserveAndCheck(toolCall, overrides) {
|
|
171
|
+
// Serialize concurrent reservations for the same task to prevent interleaving
|
|
172
|
+
const lockKey = toolCall.task_id;
|
|
173
|
+
const existingLock = this.budgetLocks.get(lockKey) ?? Promise.resolve();
|
|
174
|
+
let releaseLock;
|
|
175
|
+
const newLock = new Promise(resolve => { releaseLock = resolve; });
|
|
176
|
+
this.budgetLocks.set(lockKey, existingLock.then(() => newLock));
|
|
177
|
+
// Wait for prior reservation with timeout to prevent deadlocks
|
|
178
|
+
const LOCK_TIMEOUT_MS = 5000;
|
|
179
|
+
let timeoutHandle;
|
|
180
|
+
try {
|
|
181
|
+
await Promise.race([
|
|
182
|
+
existingLock,
|
|
183
|
+
new Promise((_, reject) => {
|
|
184
|
+
timeoutHandle = setTimeout(() => reject(new Error('Budget lock timeout')), LOCK_TIMEOUT_MS);
|
|
185
|
+
}),
|
|
186
|
+
]);
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
// On timeout, proceed without lock (accept brief race risk vs permanent hang)
|
|
190
|
+
console.warn(`[budget] Lock timeout for task ${lockKey}, proceeding without lock`);
|
|
191
|
+
}
|
|
192
|
+
finally {
|
|
193
|
+
if (timeoutHandle !== undefined)
|
|
194
|
+
clearTimeout(timeoutHandle);
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
return this._reserveAndCheckSync(toolCall, overrides);
|
|
198
|
+
}
|
|
199
|
+
finally {
|
|
200
|
+
releaseLock();
|
|
201
|
+
// Clean up lock if no one else is waiting
|
|
202
|
+
if (this.budgetLocks.get(lockKey) === existingLock.then(() => newLock)) {
|
|
203
|
+
this.budgetLocks.delete(lockKey);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Synchronous check-and-reserve. Must be called while holding the per-task lock.
|
|
209
|
+
*/
|
|
210
|
+
_reserveAndCheckSync(toolCall, overrides) {
|
|
211
|
+
const result = this.check(toolCall, overrides);
|
|
212
|
+
if (!result.allowed) {
|
|
213
|
+
return result;
|
|
214
|
+
}
|
|
215
|
+
// Reserve the estimated cost
|
|
216
|
+
const estimate = this.estimateCost(toolCall);
|
|
217
|
+
const reservationKey = `reservation:${toolCall.tool_call_id}`;
|
|
218
|
+
// Temporarily record the estimated cost so concurrent requests see it
|
|
219
|
+
const state = this.getTaskState(toolCall);
|
|
220
|
+
state.spent_usd += estimate.estimated_cost_usd;
|
|
221
|
+
this.taskStates.set(toolCall.task_id, state);
|
|
222
|
+
// Also reserve against user/workspace counters
|
|
223
|
+
const dateKey = this.getDateKey();
|
|
224
|
+
const monthKey = this.getMonthKey();
|
|
225
|
+
const userDailyKey = `${state.actor_id}:${dateKey}`;
|
|
226
|
+
this.userDailySpend.set(userDailyKey, (this.userDailySpend.get(userDailyKey) ?? 0) + estimate.estimated_cost_usd);
|
|
227
|
+
const userMonthlyKey = `${state.actor_id}:${monthKey}`;
|
|
228
|
+
this.userMonthlySpend.set(userMonthlyKey, (this.userMonthlySpend.get(userMonthlyKey) ?? 0) + estimate.estimated_cost_usd);
|
|
229
|
+
const workspaceDailyKey = `${state.workspace_id}:${dateKey}`;
|
|
230
|
+
this.workspaceDailySpend.set(workspaceDailyKey, (this.workspaceDailySpend.get(workspaceDailyKey) ?? 0) + estimate.estimated_cost_usd);
|
|
231
|
+
const workspaceMonthlyKey = `${state.workspace_id}:${monthKey}`;
|
|
232
|
+
this.workspaceMonthlySpend.set(workspaceMonthlyKey, (this.workspaceMonthlySpend.get(workspaceMonthlyKey) ?? 0) + estimate.estimated_cost_usd);
|
|
233
|
+
// Track the reservation so we can commit or release later
|
|
234
|
+
this.reservations.set(reservationKey, {
|
|
235
|
+
amount: estimate.estimated_cost_usd,
|
|
236
|
+
taskId: toolCall.task_id,
|
|
237
|
+
workspaceId: state.workspace_id,
|
|
238
|
+
actorId: state.actor_id,
|
|
239
|
+
createdAt: Date.now(),
|
|
240
|
+
});
|
|
241
|
+
return { ...result, reservationKey };
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Commit a reservation with the actual cost. Releases the difference
|
|
245
|
+
* between the reserved (estimated) amount and the actual cost.
|
|
246
|
+
*/
|
|
247
|
+
commitReservation(reservationKey, actualCost) {
|
|
248
|
+
const reservation = this.reservations.get(reservationKey);
|
|
249
|
+
if (!reservation)
|
|
250
|
+
return;
|
|
251
|
+
const diff = reservation.amount - actualCost;
|
|
252
|
+
if (diff !== 0) {
|
|
253
|
+
// Adjust task state: remove reserved amount, add actual
|
|
254
|
+
const state = this.taskStates.get(reservation.taskId);
|
|
255
|
+
if (state) {
|
|
256
|
+
state.spent_usd -= diff;
|
|
257
|
+
this.taskStates.set(reservation.taskId, state);
|
|
258
|
+
}
|
|
259
|
+
// Adjust user/workspace counters
|
|
260
|
+
const dateKey = this.getDateKey();
|
|
261
|
+
const monthKey = this.getMonthKey();
|
|
262
|
+
const userDailyKey = `${reservation.actorId}:${dateKey}`;
|
|
263
|
+
const curUD = this.userDailySpend.get(userDailyKey);
|
|
264
|
+
if (curUD !== undefined)
|
|
265
|
+
this.userDailySpend.set(userDailyKey, curUD - diff);
|
|
266
|
+
const userMonthlyKey = `${reservation.actorId}:${monthKey}`;
|
|
267
|
+
const curUM = this.userMonthlySpend.get(userMonthlyKey);
|
|
268
|
+
if (curUM !== undefined)
|
|
269
|
+
this.userMonthlySpend.set(userMonthlyKey, curUM - diff);
|
|
270
|
+
const workspaceDailyKey = `${reservation.workspaceId}:${dateKey}`;
|
|
271
|
+
const curWD = this.workspaceDailySpend.get(workspaceDailyKey);
|
|
272
|
+
if (curWD !== undefined)
|
|
273
|
+
this.workspaceDailySpend.set(workspaceDailyKey, curWD - diff);
|
|
274
|
+
const workspaceMonthlyKey = `${reservation.workspaceId}:${monthKey}`;
|
|
275
|
+
const curWM = this.workspaceMonthlySpend.get(workspaceMonthlyKey);
|
|
276
|
+
if (curWM !== undefined)
|
|
277
|
+
this.workspaceMonthlySpend.set(workspaceMonthlyKey, curWM - diff);
|
|
278
|
+
}
|
|
279
|
+
this.reservations.delete(reservationKey);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Release a reservation entirely (e.g. on error before execution completes).
|
|
283
|
+
* Removes the reserved amount from all counters.
|
|
284
|
+
*/
|
|
285
|
+
releaseReservation(reservationKey) {
|
|
286
|
+
const reservation = this.reservations.get(reservationKey);
|
|
287
|
+
if (!reservation)
|
|
288
|
+
return;
|
|
289
|
+
// Remove the reserved amount from task state
|
|
290
|
+
const state = this.taskStates.get(reservation.taskId);
|
|
291
|
+
if (state) {
|
|
292
|
+
state.spent_usd -= reservation.amount;
|
|
293
|
+
state.steps = Math.max(0, state.steps - 0); // steps not incremented during reserve
|
|
294
|
+
this.taskStates.set(reservation.taskId, state);
|
|
295
|
+
}
|
|
296
|
+
// Remove from user/workspace counters
|
|
297
|
+
const dateKey = this.getDateKey();
|
|
298
|
+
const monthKey = this.getMonthKey();
|
|
299
|
+
const userDailyKey = `${reservation.actorId}:${dateKey}`;
|
|
300
|
+
const curUD = this.userDailySpend.get(userDailyKey);
|
|
301
|
+
if (curUD !== undefined)
|
|
302
|
+
this.userDailySpend.set(userDailyKey, curUD - reservation.amount);
|
|
303
|
+
const userMonthlyKey = `${reservation.actorId}:${monthKey}`;
|
|
304
|
+
const curUM = this.userMonthlySpend.get(userMonthlyKey);
|
|
305
|
+
if (curUM !== undefined)
|
|
306
|
+
this.userMonthlySpend.set(userMonthlyKey, curUM - reservation.amount);
|
|
307
|
+
const workspaceDailyKey = `${reservation.workspaceId}:${dateKey}`;
|
|
308
|
+
const curWD = this.workspaceDailySpend.get(workspaceDailyKey);
|
|
309
|
+
if (curWD !== undefined)
|
|
310
|
+
this.workspaceDailySpend.set(workspaceDailyKey, curWD - reservation.amount);
|
|
311
|
+
const workspaceMonthlyKey = `${reservation.workspaceId}:${monthKey}`;
|
|
312
|
+
const curWM = this.workspaceMonthlySpend.get(workspaceMonthlyKey);
|
|
313
|
+
if (curWM !== undefined)
|
|
314
|
+
this.workspaceMonthlySpend.set(workspaceMonthlyKey, curWM - reservation.amount);
|
|
315
|
+
this.reservations.delete(reservationKey);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Record a completed tool call's cost.
|
|
319
|
+
* When skipCostIncrement is true (e.g. because a reservation already accounts
|
|
320
|
+
* for the cost), only step counting and cost record storage are performed.
|
|
321
|
+
*/
|
|
322
|
+
record(toolCall, costOrRecord, skipCostIncrement = false) {
|
|
323
|
+
const actualCostUsd = typeof costOrRecord === 'number' ? costOrRecord : (costOrRecord.actual_cost_usd ?? costOrRecord.estimated_cost_usd);
|
|
324
|
+
// Store cost record for later retrieval
|
|
325
|
+
if (typeof costOrRecord !== 'number') {
|
|
326
|
+
this.costRecords.set(toolCall.tool_call_id, costOrRecord);
|
|
327
|
+
}
|
|
328
|
+
const state = this.getTaskState(toolCall);
|
|
329
|
+
if (!skipCostIncrement) {
|
|
330
|
+
// Update task state cost
|
|
331
|
+
state.spent_usd += actualCostUsd;
|
|
332
|
+
}
|
|
333
|
+
// Always increment steps
|
|
334
|
+
state.steps += 1;
|
|
335
|
+
this.taskStates.set(toolCall.task_id, state);
|
|
336
|
+
// Persist to external store if available
|
|
337
|
+
if (this.externalStore) {
|
|
338
|
+
this.externalStore.setTaskState(toolCall.task_id, state);
|
|
339
|
+
}
|
|
340
|
+
if (!skipCostIncrement) {
|
|
341
|
+
// Update user daily spend
|
|
342
|
+
const dateKey = this.getDateKey();
|
|
343
|
+
const monthKey = this.getMonthKey();
|
|
344
|
+
const userDailyKey = `${state.actor_id}:${dateKey}`;
|
|
345
|
+
const currentUserDaily = this.userDailySpend.get(userDailyKey) ?? 0;
|
|
346
|
+
this.userDailySpend.set(userDailyKey, currentUserDaily + actualCostUsd);
|
|
347
|
+
// Update user monthly spend
|
|
348
|
+
const userMonthlyKey = `${state.actor_id}:${monthKey}`;
|
|
349
|
+
const currentUserMonthly = this.userMonthlySpend.get(userMonthlyKey) ?? 0;
|
|
350
|
+
this.userMonthlySpend.set(userMonthlyKey, currentUserMonthly + actualCostUsd);
|
|
351
|
+
// Update workspace daily spend
|
|
352
|
+
const workspaceDailyKey = `${state.workspace_id}:${dateKey}`;
|
|
353
|
+
const currentWorkspaceDaily = this.workspaceDailySpend.get(workspaceDailyKey) ?? 0;
|
|
354
|
+
this.workspaceDailySpend.set(workspaceDailyKey, currentWorkspaceDaily + actualCostUsd);
|
|
355
|
+
// Update workspace monthly spend
|
|
356
|
+
const workspaceMonthlyKey = `${state.workspace_id}:${monthKey}`;
|
|
357
|
+
const currentWorkspaceMonthly = this.workspaceMonthlySpend.get(workspaceMonthlyKey) ?? 0;
|
|
358
|
+
this.workspaceMonthlySpend.set(workspaceMonthlyKey, currentWorkspaceMonthly + actualCostUsd);
|
|
359
|
+
// Persist counter updates to external store
|
|
360
|
+
if (this.externalStore) {
|
|
361
|
+
this.externalStore.incrementCounter(userDailyKey, actualCostUsd);
|
|
362
|
+
this.externalStore.incrementCounter(userMonthlyKey, actualCostUsd);
|
|
363
|
+
this.externalStore.incrementCounter(workspaceDailyKey, actualCostUsd);
|
|
364
|
+
this.externalStore.incrementCounter(workspaceMonthlyKey, actualCostUsd);
|
|
365
|
+
}
|
|
366
|
+
// Prune stale counter keys (from prior days/months) to prevent unbounded growth
|
|
367
|
+
this.pruneStaleCounters(dateKey, monthKey);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/** Remove counter entries whose date/month suffix doesn't match today */
|
|
371
|
+
pruneStaleCounters(currentDateKey, currentMonthKey) {
|
|
372
|
+
// Only prune periodically (when maps get large)
|
|
373
|
+
if (this.userDailySpend.size <= 100)
|
|
374
|
+
return;
|
|
375
|
+
for (const key of this.userDailySpend.keys()) {
|
|
376
|
+
if (!key.endsWith(`:${currentDateKey}`)) {
|
|
377
|
+
this.userDailySpend.delete(key);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
for (const key of this.workspaceDailySpend.keys()) {
|
|
381
|
+
if (!key.endsWith(`:${currentDateKey}`)) {
|
|
382
|
+
this.workspaceDailySpend.delete(key);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
for (const key of this.userMonthlySpend.keys()) {
|
|
386
|
+
if (!key.endsWith(`:${currentMonthKey}`)) {
|
|
387
|
+
this.userMonthlySpend.delete(key);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
for (const key of this.workspaceMonthlySpend.keys()) {
|
|
391
|
+
if (!key.endsWith(`:${currentMonthKey}`)) {
|
|
392
|
+
this.workspaceMonthlySpend.delete(key);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
// Record a retry for a tool call
|
|
397
|
+
recordRetry(toolCallId) {
|
|
398
|
+
const currentCount = this.callRetryCounts.get(toolCallId) ?? 0;
|
|
399
|
+
const newCount = currentCount + 1;
|
|
400
|
+
this.callRetryCounts.set(toolCallId, newCount);
|
|
401
|
+
if (this.externalStore) {
|
|
402
|
+
this.externalStore.incrementRetryCount(toolCallId);
|
|
403
|
+
}
|
|
404
|
+
const maxRetries = this.config.max_retries_per_call;
|
|
405
|
+
return {
|
|
406
|
+
allowed: newCount <= maxRetries,
|
|
407
|
+
count: newCount,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
// Get budget report for a tool call
|
|
411
|
+
getReport(toolCall, estimatedCost, effectiveConfig) {
|
|
412
|
+
const cfg = effectiveConfig ?? this.config;
|
|
413
|
+
const state = this.getTaskState(toolCall);
|
|
414
|
+
return {
|
|
415
|
+
estimated_cost_usd: estimatedCost,
|
|
416
|
+
spent_cost_usd_task: state.spent_usd,
|
|
417
|
+
remaining_cost_usd_task: Math.max(0, (cfg.task_budget_usd ?? 2.0) - state.spent_usd),
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
// Get budget report with actual cost and usage data
|
|
421
|
+
getReportWithActual(toolCall, estimatedCost, actualCostUsd, usage) {
|
|
422
|
+
const base = this.getReport(toolCall, estimatedCost);
|
|
423
|
+
return {
|
|
424
|
+
...base,
|
|
425
|
+
actual_cost_usd: actualCostUsd,
|
|
426
|
+
usage,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
// Get the active cost table (for introspection)
|
|
430
|
+
getCostTable() {
|
|
431
|
+
return { ...this.costTable };
|
|
432
|
+
}
|
|
433
|
+
// Get the cost record for a specific tool call
|
|
434
|
+
getCostRecord(toolCallId) {
|
|
435
|
+
return this.costRecords.get(toolCallId);
|
|
436
|
+
}
|
|
437
|
+
// Get or create task state
|
|
438
|
+
getTaskState(toolCall) {
|
|
439
|
+
const existing = this.taskStates.get(toolCall.task_id);
|
|
440
|
+
if (existing) {
|
|
441
|
+
return existing;
|
|
442
|
+
}
|
|
443
|
+
const newState = {
|
|
444
|
+
task_id: toolCall.task_id,
|
|
445
|
+
workspace_id: toolCall.workspace_id,
|
|
446
|
+
actor_id: toolCall.actor.id,
|
|
447
|
+
spent_usd: 0,
|
|
448
|
+
steps: 0,
|
|
449
|
+
started_at: toolCall.timestamp ?? new Date().toISOString(),
|
|
450
|
+
};
|
|
451
|
+
this.taskStates.set(toolCall.task_id, newState);
|
|
452
|
+
return newState;
|
|
453
|
+
}
|
|
454
|
+
// Helper to get date key (YYYY-MM-DD)
|
|
455
|
+
getDateKey() {
|
|
456
|
+
return new Date().toISOString().split('T')[0];
|
|
457
|
+
}
|
|
458
|
+
// Helper to get month key (YYYY-MM)
|
|
459
|
+
getMonthKey() {
|
|
460
|
+
return new Date().toISOString().slice(0, 7);
|
|
461
|
+
}
|
|
462
|
+
// Reset task state (for testing)
|
|
463
|
+
async flush() {
|
|
464
|
+
if (this.externalStore?.flush)
|
|
465
|
+
await this.externalStore.flush();
|
|
466
|
+
}
|
|
467
|
+
reset() {
|
|
468
|
+
this.taskStates.clear();
|
|
469
|
+
this.userDailySpend.clear();
|
|
470
|
+
this.userMonthlySpend.clear();
|
|
471
|
+
this.workspaceDailySpend.clear();
|
|
472
|
+
this.workspaceMonthlySpend.clear();
|
|
473
|
+
this.callRetryCounts.clear();
|
|
474
|
+
this.costRecords.clear();
|
|
475
|
+
this.reservations.clear();
|
|
476
|
+
this.budgetLocks.clear();
|
|
477
|
+
this.externalStore?.reset();
|
|
478
|
+
}
|
|
479
|
+
/** Get spending data for a specific actor */
|
|
480
|
+
getActorSpending(actorId, days) {
|
|
481
|
+
const dateKey = this.getDateKey();
|
|
482
|
+
const monthKey = this.getMonthKey();
|
|
483
|
+
// Daily spend for today
|
|
484
|
+
const dailyKey = `${actorId}:${dateKey}`;
|
|
485
|
+
const dailySpend = this.userDailySpend.get(dailyKey) ?? 0;
|
|
486
|
+
// Monthly spend for current month
|
|
487
|
+
const monthlyKey = `${actorId}:${monthKey}`;
|
|
488
|
+
const monthlySpend = this.userMonthlySpend.get(monthlyKey) ?? 0;
|
|
489
|
+
// Count tasks where this actor is involved
|
|
490
|
+
let taskCount = 0;
|
|
491
|
+
let totalSpend = 0;
|
|
492
|
+
for (const state of this.taskStates.values()) {
|
|
493
|
+
if (state.actor_id === actorId) {
|
|
494
|
+
taskCount++;
|
|
495
|
+
totalSpend += state.spent_usd;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
daily_spend: dailySpend,
|
|
500
|
+
monthly_spend: monthlySpend,
|
|
501
|
+
task_count: taskCount,
|
|
502
|
+
total_spend: totalSpend,
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
// Get current config
|
|
506
|
+
getConfig() {
|
|
507
|
+
return { ...this.config };
|
|
508
|
+
}
|
|
509
|
+
/** Return aggregate spending across all tracked entities */
|
|
510
|
+
getSpendingSummary() {
|
|
511
|
+
let taskTotal = 0;
|
|
512
|
+
for (const state of this.taskStates.values()) {
|
|
513
|
+
taskTotal += state.spent_usd;
|
|
514
|
+
}
|
|
515
|
+
const dateKey = this.getDateKey();
|
|
516
|
+
const monthKey = this.getMonthKey();
|
|
517
|
+
let userDailyTotal = 0;
|
|
518
|
+
for (const [key, val] of this.userDailySpend) {
|
|
519
|
+
if (key.endsWith(`:${dateKey}`))
|
|
520
|
+
userDailyTotal += val;
|
|
521
|
+
}
|
|
522
|
+
let userMonthlyTotal = 0;
|
|
523
|
+
for (const [key, val] of this.userMonthlySpend) {
|
|
524
|
+
if (key.endsWith(`:${monthKey}`))
|
|
525
|
+
userMonthlyTotal += val;
|
|
526
|
+
}
|
|
527
|
+
let workspaceDailyTotal = 0;
|
|
528
|
+
for (const [key, val] of this.workspaceDailySpend) {
|
|
529
|
+
if (key.endsWith(`:${dateKey}`))
|
|
530
|
+
workspaceDailyTotal += val;
|
|
531
|
+
}
|
|
532
|
+
let workspaceMonthlyTotal = 0;
|
|
533
|
+
for (const [key, val] of this.workspaceMonthlySpend) {
|
|
534
|
+
if (key.endsWith(`:${monthKey}`))
|
|
535
|
+
workspaceMonthlyTotal += val;
|
|
536
|
+
}
|
|
537
|
+
return {
|
|
538
|
+
task_total: taskTotal,
|
|
539
|
+
user_daily_total: userDailyTotal,
|
|
540
|
+
user_monthly_total: userMonthlyTotal,
|
|
541
|
+
workspace_daily_total: workspaceDailyTotal,
|
|
542
|
+
workspace_monthly_total: workspaceMonthlyTotal,
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
exports.BudgetManager = BudgetManager;
|
|
547
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src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AChC,kBAAkB,EAAE,gBAAgB;YACpC,qBAAqB,EAAE,mBAAmB;YAC1C,uBAAuB,EAAE,qBAAqB;SAC/C,CAAC;IACJ,CAAC;CACF;AAhnBD,sCAgnBC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { UsageData } from '../types/tool-result';
|
|
2
|
+
import { TokenPricing } from '../types/budget';
|
|
3
|
+
export declare class UsageExtractor {
|
|
4
|
+
private tokenPricing;
|
|
5
|
+
constructor(tokenPricing?: Record<string, TokenPricing>);
|
|
6
|
+
/**
|
|
7
|
+
* Extract usage data from HTTP response headers.
|
|
8
|
+
* Supports Anthropic, OpenAI-style, and generic header conventions.
|
|
9
|
+
*/
|
|
10
|
+
extractFromHeaders(headers?: Record<string, string>): UsageData | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Extract usage data from response body.
|
|
13
|
+
* Supports OpenAI-style `usage` object and Anthropic-style `usage` object.
|
|
14
|
+
*/
|
|
15
|
+
extractFromBody(body: unknown): UsageData | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Compute cost from usage data using token pricing config.
|
|
18
|
+
* Returns the computed cost in USD, or undefined if pricing not available.
|
|
19
|
+
*/
|
|
20
|
+
computeCost(usage: UsageData, model?: string): number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Extract model name from response body.
|
|
23
|
+
* Supports OpenAI format (body.model) and Anthropic format (body.model).
|
|
24
|
+
*/
|
|
25
|
+
extractModelFromBody(body: unknown): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Detect provider from model name.
|
|
28
|
+
*/
|
|
29
|
+
detectProvider(model: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Merge two UsageData objects. The second (body) takes precedence for conflicting fields,
|
|
32
|
+
* except provider_cost_usd which is preferred from headers.
|
|
33
|
+
*/
|
|
34
|
+
merge(fromHeaders?: UsageData, fromBody?: UsageData): UsageData | undefined;
|
|
35
|
+
private parseIntHeader;
|
|
36
|
+
private parseFloatHeader;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=usage-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-extractor.d.ts","sourceRoot":"","sources":["../../../src/budget/usage-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,cAAc;IACzB,OAAO,CAAC,YAAY,CAA+B;gBAEvC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IAIvD;;;OAGG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS;IAkC3E;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS;IAoCrD;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAgBjE;;;OAGG;IACH,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAOvD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAUrC;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAmB3E,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,gBAAgB;CAKzB"}
|