@burdenoff/be-sdk 2026.1112.1 → 2026.1114.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.
Files changed (74) hide show
  1. package/dist/activity/index.d.ts +2 -2
  2. package/dist/ai-credits/index.d.ts +1 -1
  3. package/dist/auth/index.d.ts +1 -1
  4. package/dist/bootstrap/index.d.ts +1 -1
  5. package/dist/cache/index.d.ts +1 -1
  6. package/dist/context/index.d.ts +1 -1
  7. package/dist/event-queue/index.d.ts +1 -1
  8. package/dist/export/index.d.ts +1 -1
  9. package/dist/export/index.js +1 -1
  10. package/dist/{export-DJXE3Osa.js → export-lqKewsuF.js} +2 -2
  11. package/dist/{export-DJXE3Osa.js.map → export-lqKewsuF.js.map} +1 -1
  12. package/dist/files/index.d.ts +1 -1
  13. package/dist/gateway/index.d.ts +3 -3
  14. package/dist/gateway/index.js +2 -2
  15. package/dist/gateway-2en8Gx_a.js +274 -0
  16. package/dist/gateway-2en8Gx_a.js.map +1 -0
  17. package/dist/graph/index.d.ts +1 -1
  18. package/dist/{graphql-CUDyhibV.d.ts → graphql-C8jKLLel.d.ts} +1 -1
  19. package/dist/{index-B2LCaK0R.d.ts → index-479i3w77.d.ts} +1 -1
  20. package/dist/{index-BGzMYJsm.d.ts → index-8pUSoT85.d.ts} +1 -1
  21. package/dist/{index-ADmsX0BI.d.ts → index-9MJVKzWA.d.ts} +3 -3
  22. package/dist/{index-FbXPfen7.d.ts → index-BJwHEzpN.d.ts} +1 -1
  23. package/dist/{index-CTTwo9av.d.ts → index-BTaQMEgB.d.ts} +1 -1
  24. package/dist/{index-CDOqxSIi.d.ts → index-Base-sg5.d.ts} +1 -1
  25. package/dist/{index-C_GXXF32.d.ts → index-Bh6W5JO4.d.ts} +3 -3
  26. package/dist/{index-BeVtqGO-.d.ts → index-Bwn5Z1h-.d.ts} +1 -1
  27. package/dist/{index-FRRaa6h2.d.ts → index-CEtULfb_.d.ts} +3 -3
  28. package/dist/{index-DqbGqfAy.d.ts → index-Cwu5Mpji.d.ts} +1 -1
  29. package/dist/{index-CaM9JUcc.d.ts → index-DSynXDRD.d.ts} +1 -1
  30. package/dist/{index-CVCyKzhB.d.ts → index-DWER4-_x.d.ts} +3 -3
  31. package/dist/{index-cmR9k9ga.d.ts → index-DhFP_AIB.d.ts} +1 -1
  32. package/dist/{index-zd_NPGJo.d.ts → index-DqpCL9kD.d.ts} +4 -4
  33. package/dist/{index-U_tu3zUl.d.ts → index-Dw_0wE4q.d.ts} +2 -2
  34. package/dist/{index-3KOZ1zN9.d.ts → index-HeUeEsMU.d.ts} +1 -1
  35. package/dist/{index-Cot73bdh.d.ts → index-KlrnELrN.d.ts} +1 -1
  36. package/dist/{index-MArCb8Aq.d.ts → index-SvWwlTUC.d.ts} +1 -1
  37. package/dist/{index-CHwMhK6v.d.ts → index-YMGOJins.d.ts} +2 -2
  38. package/dist/index-oJMtR3nl.d.ts +88 -0
  39. package/dist/index.d.ts +21 -21
  40. package/dist/index.js +5 -5
  41. package/dist/init/index.d.ts +1 -1
  42. package/dist/init/index.js +1 -1
  43. package/dist/{init-CQPFmOOe.js → init-D814LeLF.js} +2 -2
  44. package/dist/{init-CQPFmOOe.js.map → init-D814LeLF.js.map} +1 -1
  45. package/dist/instrumentation/index.d.ts +2 -2
  46. package/dist/layer/index.d.ts +2 -2
  47. package/dist/layer-Bcix-WCl.js.map +1 -1
  48. package/dist/{layer-BZBZZWeV.d.ts → layer-C0zxAUgR.d.ts} +1 -0
  49. package/dist/logger/index.d.ts +1 -1
  50. package/dist/notifications/index.d.ts +1 -1
  51. package/dist/payments/index.d.ts +2 -2
  52. package/dist/rbac/index.d.ts +1 -1
  53. package/dist/resource-caps/index.d.ts +1 -1
  54. package/dist/search/index.d.ts +2 -2
  55. package/dist/security/index.d.ts +1 -1
  56. package/dist/security/rate-limit/index.d.ts +1 -1
  57. package/dist/tags/index.d.ts +1 -1
  58. package/dist/telemetry/index.d.ts +2 -2
  59. package/dist/temporal/index.d.ts +1 -1
  60. package/dist/tracker/index.d.ts +2 -2
  61. package/dist/tracker/index.js +2 -2
  62. package/dist/{tracker-PQztSlhJ.js → tracker-Cl3cGKe-.js} +2 -2
  63. package/dist/{tracker-PQztSlhJ.js.map → tracker-Cl3cGKe-.js.map} +1 -1
  64. package/dist/translation/index.d.ts +2 -2
  65. package/dist/types/index.d.ts +2 -2
  66. package/dist/{types-C6EKaS3V.d.ts → types-gJ9Qqi9E.d.ts} +1 -1
  67. package/dist/usage/index.d.ts +1 -1
  68. package/dist/usage/index.js +1 -1
  69. package/dist/{usage-BRqVP3CJ.js → usage-ygkKsxdd.js} +2 -2
  70. package/dist/{usage-BRqVP3CJ.js.map → usage-ygkKsxdd.js.map} +1 -1
  71. package/package.json +3 -3
  72. package/dist/gateway-ByVo-n37.js +0 -50
  73. package/dist/gateway-ByVo-n37.js.map +0 -1
  74. package/dist/index-YOShAwkq.d.ts +0 -45
@@ -1,3 +1,3 @@
1
- import { u as logger } from "../index-Cot73bdh.js";
2
- import { $ as Counter, A as buildMetricsConfig, At as HTTPInstrumentationConfig, B as GraphQLOperationType, Bt as TraceContext, C as DEFAULT_METRICS_CONFIG, Ct as isTracerInitialized, D as buildFeatureFlags, Dt as DatabaseInstrumentationConfig, E as buildDatabaseConfig, Et as CacheInstrumentationConfig, F as isInstrumentationConfigInitialized, Ft as MetricsConfig, G as createPrometheusPlugin, H as PrometheusPluginOptions, I as resetInstrumentationConfig, It as OperationContext, J as getGraphQLSpanFromContext, K as extractOperationInfo, L as updateInstrumentationConfig, Lt as STANDARD_METRICS, M as getInstrumentationConfig, Mt as InstrumentationFeatureFlags, N as initializeInstrumentationConfig, Nt as LoggingConfig, O as buildGraphQLConfig, Ot as EventQueueInstrumentationConfig, P as isFeatureEnabled, Pt as MetricDefinition, Q as isPrometheusAvailable, R as ApolloInlineTraceOptions, Rt as SpanAttributes, S as DEFAULT_LOGGING_CONFIG, St as injectTraceContext, T as ENV_VARS, Tt as withSpan, U as createApolloInlineTracePlugin, V as InstrumentationContextExtension, Vt as TracingConfig, W as createGraphQLInstrumentationPlugin, X as instrumentResolverMap, Y as instrumentResolver, Z as isApolloInlineTraceAvailable, _ as DEFAULT_DATABASE_CONFIG, _t as Tracer, at as createCounter, b as DEFAULT_GRAPHQL_CONFIG, bt as getTracer, c as resetInstrumentation, ct as createUpDownCounter, d as Log, dt as isMetricsRegistryInitialized, et as Gauge, f as Metric, ft as resetMetricsRegistry, g as DEFAULT_CACHE_CONFIG, gt as SpanStatus, h as traced, ht as SpanKind, i as getLogger, it as UpDownCounter, j as buildTracingConfig, jt as InstrumentationConfig, k as buildInstrumentationConfig, kt as GraphQLInstrumentationConfig, l as setupInstrumentation, lt as getMetricsRegistry, m as instrumented, mt as SpanEvent, n as InstrumentationSetupResult, nt as MetricLabels, o as initializeInstrumentation, ot as createGauge, p as Trace, pt as Span, q as getGraphQLOperationFromContext, r as SetupInstrumentationOptions, rt as MetricsRegistry, s as isInstrumentationInitialized, st as createHistogram, t as InitializeInstrumentationOptions, tt as Histogram, u as Instrument, ut as initializeMetricsRegistry, v as DEFAULT_EVENT_QUEUE_CONFIG, vt as extractTraceContext, w as DEFAULT_TRACING_CONFIG, wt as startSpan, x as DEFAULT_HTTP_CONFIG, xt as initializeTracer, y as DEFAULT_FEATURE_FLAGS, yt as getTraceContext, z as GraphQLOperationInfo, zt as SpanContext } from "../index-B2LCaK0R.js";
1
+ import { u as logger } from "../index-KlrnELrN.js";
2
+ import { $ as Counter, A as buildMetricsConfig, At as HTTPInstrumentationConfig, B as GraphQLOperationType, Bt as TraceContext, C as DEFAULT_METRICS_CONFIG, Ct as isTracerInitialized, D as buildFeatureFlags, Dt as DatabaseInstrumentationConfig, E as buildDatabaseConfig, Et as CacheInstrumentationConfig, F as isInstrumentationConfigInitialized, Ft as MetricsConfig, G as createPrometheusPlugin, H as PrometheusPluginOptions, I as resetInstrumentationConfig, It as OperationContext, J as getGraphQLSpanFromContext, K as extractOperationInfo, L as updateInstrumentationConfig, Lt as STANDARD_METRICS, M as getInstrumentationConfig, Mt as InstrumentationFeatureFlags, N as initializeInstrumentationConfig, Nt as LoggingConfig, O as buildGraphQLConfig, Ot as EventQueueInstrumentationConfig, P as isFeatureEnabled, Pt as MetricDefinition, Q as isPrometheusAvailable, R as ApolloInlineTraceOptions, Rt as SpanAttributes, S as DEFAULT_LOGGING_CONFIG, St as injectTraceContext, T as ENV_VARS, Tt as withSpan, U as createApolloInlineTracePlugin, V as InstrumentationContextExtension, Vt as TracingConfig, W as createGraphQLInstrumentationPlugin, X as instrumentResolverMap, Y as instrumentResolver, Z as isApolloInlineTraceAvailable, _ as DEFAULT_DATABASE_CONFIG, _t as Tracer, at as createCounter, b as DEFAULT_GRAPHQL_CONFIG, bt as getTracer, c as resetInstrumentation, ct as createUpDownCounter, d as Log, dt as isMetricsRegistryInitialized, et as Gauge, f as Metric, ft as resetMetricsRegistry, g as DEFAULT_CACHE_CONFIG, gt as SpanStatus, h as traced, ht as SpanKind, i as getLogger, it as UpDownCounter, j as buildTracingConfig, jt as InstrumentationConfig, k as buildInstrumentationConfig, kt as GraphQLInstrumentationConfig, l as setupInstrumentation, lt as getMetricsRegistry, m as instrumented, mt as SpanEvent, n as InstrumentationSetupResult, nt as MetricLabels, o as initializeInstrumentation, ot as createGauge, p as Trace, pt as Span, q as getGraphQLOperationFromContext, r as SetupInstrumentationOptions, rt as MetricsRegistry, s as isInstrumentationInitialized, st as createHistogram, t as InitializeInstrumentationOptions, tt as Histogram, u as Instrument, ut as initializeMetricsRegistry, v as DEFAULT_EVENT_QUEUE_CONFIG, vt as extractTraceContext, w as DEFAULT_TRACING_CONFIG, wt as startSpan, x as DEFAULT_HTTP_CONFIG, xt as initializeTracer, y as DEFAULT_FEATURE_FLAGS, yt as getTraceContext, z as GraphQLOperationInfo, zt as SpanContext } from "../index-479i3w77.js";
3
3
  export { type ApolloInlineTraceOptions, type CacheInstrumentationConfig, type Counter, DEFAULT_CACHE_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_EVENT_QUEUE_CONFIG, DEFAULT_FEATURE_FLAGS, DEFAULT_GRAPHQL_CONFIG, DEFAULT_HTTP_CONFIG, DEFAULT_LOGGING_CONFIG, DEFAULT_METRICS_CONFIG, DEFAULT_TRACING_CONFIG, type DatabaseInstrumentationConfig, ENV_VARS, type EventQueueInstrumentationConfig, type Gauge, type GraphQLInstrumentationConfig, type GraphQLOperationInfo, type GraphQLOperationType, type HTTPInstrumentationConfig, type Histogram, InitializeInstrumentationOptions, Instrument, type InstrumentationConfig, type InstrumentationContextExtension, type InstrumentationFeatureFlags, InstrumentationSetupResult, Log, type LoggingConfig, Metric, type MetricDefinition, type MetricLabels, type MetricsConfig, MetricsRegistry, type OperationContext, type PrometheusPluginOptions, STANDARD_METRICS, SetupInstrumentationOptions, type Span, type SpanAttributes, type SpanContext, type SpanEvent, SpanKind, SpanStatus, Trace, type TraceContext, Tracer, type TracingConfig, type UpDownCounter, buildDatabaseConfig, buildFeatureFlags, buildGraphQLConfig, buildInstrumentationConfig, buildMetricsConfig, buildTracingConfig, createApolloInlineTracePlugin, createCounter, createGauge, createGraphQLInstrumentationPlugin, createHistogram, createPrometheusPlugin, createUpDownCounter, extractOperationInfo, extractTraceContext, getGraphQLOperationFromContext, getGraphQLSpanFromContext, getInstrumentationConfig, getLogger, getMetricsRegistry, getTraceContext, getTracer, initializeInstrumentation, initializeInstrumentationConfig, initializeMetricsRegistry, initializeTracer, injectTraceContext, instrumentResolver, instrumentResolverMap, instrumented, isApolloInlineTraceAvailable, isFeatureEnabled, isInstrumentationConfigInitialized, isInstrumentationInitialized, isMetricsRegistryInitialized, isPrometheusAvailable, isTracerInitialized, logger, resetInstrumentation, resetInstrumentationConfig, resetMetricsRegistry, setupInstrumentation, startSpan, traced, updateInstrumentationConfig, withSpan };
@@ -1,3 +1,3 @@
1
- import { a as DEFAULT_LAYER_RESOURCES, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, u as LayerConfig } from "../layer-BZBZZWeV.js";
2
- import { i as getGatewayUrlForLayer, n as createLayerManagerFromEnv, o as validateLayerConfig, r as detectLayerFromServiceName, t as LayerManager } from "../index-CDOqxSIi.js";
1
+ import { a as DEFAULT_LAYER_RESOURCES, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, u as LayerConfig } from "../layer-C0zxAUgR.js";
2
+ import { i as getGatewayUrlForLayer, n as createLayerManagerFromEnv, o as validateLayerConfig, r as detectLayerFromServiceName, t as LayerManager } from "../index-Base-sg5.js";
3
3
  export { DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS, type GatewayRoutingConfig, type LayerConfig, type LayerFullConfig, type LayerGatewayConfig, LayerManager, type LayerResourceUrls, type ServiceLayer, createLayerManagerFromEnv, detectLayerFromServiceName, getGatewayUrlForLayer, validateLayerConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"layer-Bcix-WCl.js","names":[],"sources":["../src/types/layer.ts"],"sourcesContent":["/**\n * Layer Type Definitions for Burdenoff Backend SDK\n *\n * This module defines types for the layer-aware architecture,\n * supporting wspace (workspace) and global (tenant) service layers.\n *\n * @module types/layer\n * @category Configuration\n */\n\n/**\n * Service layer types\n * - wspace: Workspace layer services (product-specific operations)\n * - global: Global/tenant layer services (cross-product services)\n */\nexport type ServiceLayer = 'wspace' | 'global';\n\n/**\n * Layer configuration for a service\n */\nexport interface LayerConfig {\n /**\n * Layer type this service belongs to\n * @example 'wspace' or 'global'\n */\n layer: ServiceLayer;\n\n /**\n * Service name (e.g., 'wspace-tags-svc', 'global-auth-svc')\n */\n serviceName: string;\n\n /**\n * Service identity for bypass headers\n * Used for M2M authentication\n * @default serviceName\n */\n serviceIdentity?: string;\n}\n\n/**\n * Gateway configuration per layer\n */\nexport interface LayerGatewayConfig {\n /**\n * Internal gateway URL (same layer int-gateway)\n * - wspace services use: wspace-int-gateway\n * - global services use: global-int-gateway\n */\n internalGatewayUrl: string;\n\n /**\n * Cross-layer gateway URL (cross layer public-gateway)\n * - wspace services use: global-public-gateway\n * - global services use: wspace-public-gateway\n */\n crossLayerGatewayUrl: string;\n}\n\n/**\n * Resource URLs per layer\n */\nexport interface LayerResourceUrls {\n /**\n * Event queue (Redis Streams) URL.\n *\n * Single fleet-shared Redis instance in every environment:\n * - ACA (prod/alpha): Azure Managed Redis — `REDIS_URL` injected from\n * KeyVault overrides this default.\n * - Local dev: self-hosted `shared-valkey` reachable via\n * docker-compose; the default below points at the same container\n * name used by `~/products/dev`'s compose graph.\n *\n * `LayerManager.resolveResourceConfig()` always prefers `REDIS_URL`\n * from the environment, so the layer-scoped default is only the\n * local-dev fallback.\n */\n eventQueueUrl: string;\n\n /**\n * Valkey/Redis URL for the layer\n */\n valkeyUrl: string;\n\n /**\n * Temporal server address for the layer\n */\n temporalAddress: string;\n\n /**\n * Temporal namespace for the layer\n */\n temporalNamespace: string;\n\n /**\n * RBAC gateway URL (for permission checks)\n */\n rbacGatewayUrl: string;\n}\n\n/**\n * Complete layer configuration including gateways and resources\n */\nexport interface LayerFullConfig extends LayerConfig {\n /**\n * Gateway configuration\n */\n gateways: LayerGatewayConfig;\n\n /**\n * Resource URLs\n */\n resources: LayerResourceUrls;\n}\n\n/**\n * Gateway routing rules by layer\n * Defines which gateway to use for same-layer vs cross-layer communication\n */\nexport interface GatewayRoutingConfig {\n /**\n * Layer this config applies to\n */\n layer: ServiceLayer;\n\n /**\n * Internal gateway for same-layer M2M calls\n */\n internalGateway: {\n /** Gateway host (without protocol) */\n host: string;\n /** Gateway port */\n port: number;\n /** GraphQL endpoint path */\n graphqlPath: string;\n };\n\n /**\n * Public gateway for cross-layer calls\n */\n crossLayerGateway: {\n /** Gateway host (without protocol) */\n host: string;\n /** Gateway port */\n port: number;\n /** GraphQL endpoint path */\n graphqlPath: string;\n };\n}\n\n/**\n * Default gateway routing configuration\n */\nexport const DEFAULT_GATEWAY_ROUTING: Record<ServiceLayer, GatewayRoutingConfig> = {\n wspace: {\n layer: 'wspace',\n internalGateway: {\n host: 'wspace-int-gateway',\n port: 4001,\n graphqlPath: '/workspaces/graphql',\n },\n crossLayerGateway: {\n host: 'global-public-gateway',\n port: 4000,\n graphqlPath: '/global/graphql',\n },\n },\n global: {\n layer: 'global',\n internalGateway: {\n host: 'global-int-gateway',\n port: 4002,\n graphqlPath: '/global/graphql',\n },\n crossLayerGateway: {\n host: 'wspace-public-gateway',\n port: 4003,\n graphqlPath: '/workspaces/graphql',\n },\n },\n};\n\n/**\n * Default stream configurations per layer\n */\nexport const DEFAULT_LAYER_STREAMS: Record<\n ServiceLayer,\n Array<{ name: string; subjects: string[]; description?: string }>\n> = {\n wspace: [\n {\n name: 'WSPACE_EVENTS',\n subjects: ['wspace.>'],\n description: 'Workspace layer events stream',\n },\n {\n name: 'WSPACE_GRAPH_EVENTS',\n subjects: ['graph.>'],\n description: 'Workspace layer graph events stream (captures all graph entity events)',\n },\n ],\n global: [\n {\n name: 'GLOBAL_EVENTS',\n subjects: ['global.>'],\n description: 'Global layer events stream',\n },\n {\n name: 'GLOBAL_GRAPH_EVENTS',\n subjects: ['graph.>'],\n description: 'Global layer graph events stream (captures all graph entity events)',\n },\n ],\n};\n\n/**\n * Build internal gateway URL for a layer\n * Uses HTTP for internal K8s communication (mTLS via Istio service mesh)\n */\nfunction buildInternalGatewayUrl(layer: ServiceLayer): string {\n const routing = DEFAULT_GATEWAY_ROUTING[layer];\n const { host, port, graphqlPath } = routing.internalGateway;\n // Internal K8s services use plain HTTP with mTLS handled by Istio\n const protocol = 'http';\n return `${protocol}://${host}:${port}${graphqlPath}`;\n}\n\n/**\n * Default resource URLs per layer\n *\n * Note: Internal K8s service communication uses plain HTTP with mTLS via Istio.\n * External traffic uses HTTPS via ingress gateway.\n */\nexport const DEFAULT_LAYER_RESOURCES: Record<ServiceLayer, LayerResourceUrls> = {\n // The event queue is a single fleet-shared Redis (Azure Managed Redis in\n // ACA, fed via REDIS_URL; self-hosted shared-valkey in local dev). The\n // layer-scoped default URL below is only the local-dev compose hostname —\n // production always overrides via REDIS_URL.\n wspace: {\n eventQueueUrl: 'redis://wspace-shared-valkey:6379',\n valkeyUrl: 'valkey://wspace-valkey:6379',\n temporalAddress: 'wspace-temporal:7233',\n temporalNamespace: 'wspace-default',\n rbacGatewayUrl: buildInternalGatewayUrl('wspace'),\n },\n global: {\n eventQueueUrl: 'redis://global-shared-valkey:6379',\n valkeyUrl: 'valkey://global-valkey:6379',\n temporalAddress: 'global-temporal:7233',\n temporalNamespace: 'global-default',\n rbacGatewayUrl: buildInternalGatewayUrl('global'),\n },\n};\n\n/**\n * Circuit breaker configuration for gateway client\n */\nexport interface CircuitBreakerConfig {\n /**\n * Number of failures before opening circuit\n * @default 5\n */\n failureThreshold: number;\n\n /**\n * Time in milliseconds to wait before attempting to close circuit\n * @default 30000 (30 seconds)\n */\n resetTimeout: number;\n\n /**\n * Time window in milliseconds for counting failures\n * @default 60000 (60 seconds)\n */\n failureWindow: number;\n}\n\n/**\n * Default circuit breaker configuration\n */\nexport const DEFAULT_CIRCUIT_BREAKER_CONFIG: CircuitBreakerConfig = {\n failureThreshold: 5,\n resetTimeout: 30000,\n failureWindow: 60000,\n};\n\n/**\n * Retry configuration for gateway client\n */\nexport interface GatewayRetryConfig {\n /**\n * Maximum number of retry attempts\n * @default 3\n */\n maxAttempts: number;\n\n /**\n * Initial delay in milliseconds before first retry\n * @default 1000 (1 second)\n */\n initialDelay: number;\n\n /**\n * Maximum delay in milliseconds between retries\n * @default 10000 (10 seconds)\n */\n maxDelay: number;\n\n /**\n * Backoff multiplier for exponential backoff\n * @default 2\n */\n backoffMultiplier: number;\n}\n\n/**\n * Default retry configuration\n */\nexport const DEFAULT_GATEWAY_RETRY_CONFIG: GatewayRetryConfig = {\n maxAttempts: 3,\n initialDelay: 1000,\n maxDelay: 10000,\n backoffMultiplier: 2,\n};\n\n/**\n * Headers automatically added by gateway client for M2M calls\n */\nexport interface GatewayRequestHeaders {\n /**\n * Actor ID making the request\n */\n 'x-actor-id'?: string;\n\n /**\n * Actor type\n */\n 'x-actor-type'?: 'user' | 'app' | 'service' | 'super_admin';\n\n /**\n * Workspace ID for the request context\n */\n 'x-workspace-id'?: string;\n\n /**\n * Service identity for bypass validation\n */\n 'x-service-identity'?: string;\n\n /**\n * Call type indicator\n */\n 'x-call-type'?: 'internal' | 'cross-layer';\n\n /**\n * Permission bypass flag\n */\n 'x-bypass-permission'?: string;\n\n /**\n * RBAC bypass flag (set by gateway)\n */\n 'x-rbac-bypass'?: 'true' | 'false';\n\n /**\n * Bypass source (set by gateway)\n */\n 'x-bypass-source'?: string;\n\n /**\n * Bypass timestamp (set by gateway)\n */\n 'x-bypass-timestamp'?: string;\n\n /**\n * Cloudflare Access service-token client id, re-presented on cross-layer\n * outbound calls so the peer layer's CF-Access-gated public gateway admits\n * the request. Normally attached automatically from request context.\n */\n 'cf-access-client-id'?: string;\n\n /**\n * Cloudflare Access service-token client secret (paired with the client id).\n */\n 'cf-access-client-secret'?: string;\n\n /**\n * Delegated `app_as_user` bearer (`Bearer <jwt>`) for an internal-gateway\n * call made as an agent acting for a user. The internal gateway verifies it\n * and derives the actor; see `buildDelegatedGatewayHeaders`.\n */\n 'x-delegated-authorization'?: string;\n}\n"],"mappings":";;;;AAyJA,MAAa,0BAAsE;CACjF,QAAQ;EACN,OAAO;EACP,iBAAiB;GACf,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA,mBAAmB;GACjB,MAAM;GACN,MAAM;GACN,aAAa;EACf;CACF;CACA,QAAQ;EACN,OAAO;EACP,iBAAiB;GACf,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA,mBAAmB;GACjB,MAAM;GACN,MAAM;GACN,aAAa;EACf;CACF;AACF;;;;AAKA,MAAa,wBAGT;CACF,QAAQ,CACN;EACE,MAAM;EACN,UAAU,CAAC,UAAU;EACrB,aAAa;CACf,GACA;EACE,MAAM;EACN,UAAU,CAAC,SAAS;EACpB,aAAa;CACf,CACF;CACA,QAAQ,CACN;EACE,MAAM;EACN,UAAU,CAAC,UAAU;EACrB,aAAa;CACf,GACA;EACE,MAAM;EACN,UAAU,CAAC,SAAS;EACpB,aAAa;CACf,CACF;AACF;;;;;AAMA,SAAS,wBAAwB,OAA6B;CAE5D,MAAM,EAAE,MAAM,MAAM,gBADJ,wBAAwB,MACG,CAAC;CAG5C,OAAO,UAAiB,KAAK,GAAG,OAAO;AACzC;;;;;;;AAQA,MAAa,0BAAmE;CAK9E,QAAQ;EACN,eAAe;EACf,WAAW;EACX,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB,wBAAwB,QAAQ;CAClD;CACA,QAAQ;EACN,eAAe;EACf,WAAW;EACX,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB,wBAAwB,QAAQ;CAClD;AACF;;;;AA4BA,MAAa,iCAAuD;CAClE,kBAAkB;CAClB,cAAc;CACd,eAAe;AACjB;;;;AAkCA,MAAa,+BAAmD;CAC9D,aAAa;CACb,cAAc;CACd,UAAU;CACV,mBAAmB;AACrB"}
1
+ {"version":3,"file":"layer-Bcix-WCl.js","names":[],"sources":["../src/types/layer.ts"],"sourcesContent":["/**\n * Layer Type Definitions for Burdenoff Backend SDK\n *\n * This module defines types for the layer-aware architecture,\n * supporting wspace (workspace) and global (tenant) service layers.\n *\n * @module types/layer\n * @category Configuration\n */\n\n/**\n * Service layer types\n * - wspace: Workspace layer services (product-specific operations)\n * - global: Global/tenant layer services (cross-product services)\n */\nexport type ServiceLayer = 'wspace' | 'global';\n\n/**\n * Layer configuration for a service\n */\nexport interface LayerConfig {\n /**\n * Layer type this service belongs to\n * @example 'wspace' or 'global'\n */\n layer: ServiceLayer;\n\n /**\n * Service name (e.g., 'wspace-tags-svc', 'global-auth-svc')\n */\n serviceName: string;\n\n /**\n * Service identity for bypass headers\n * Used for M2M authentication\n * @default serviceName\n */\n serviceIdentity?: string;\n}\n\n/**\n * Gateway configuration per layer\n */\nexport interface LayerGatewayConfig {\n /**\n * Internal gateway URL (same layer int-gateway)\n * - wspace services use: wspace-int-gateway\n * - global services use: global-int-gateway\n */\n internalGatewayUrl: string;\n\n /**\n * Cross-layer gateway URL (cross layer public-gateway)\n * - wspace services use: global-public-gateway\n * - global services use: wspace-public-gateway\n */\n crossLayerGatewayUrl: string;\n}\n\n/**\n * Resource URLs per layer\n */\nexport interface LayerResourceUrls {\n /**\n * Event queue (Redis Streams) URL.\n *\n * Single fleet-shared Redis instance in every environment:\n * - ACA (prod/alpha): Azure Managed Redis — `REDIS_URL` injected from\n * KeyVault overrides this default.\n * - Local dev: self-hosted `shared-valkey` reachable via\n * docker-compose; the default below points at the same container\n * name used by `~/products/dev`'s compose graph.\n *\n * `LayerManager.resolveResourceConfig()` always prefers `REDIS_URL`\n * from the environment, so the layer-scoped default is only the\n * local-dev fallback.\n */\n eventQueueUrl: string;\n\n /**\n * Valkey/Redis URL for the layer\n */\n valkeyUrl: string;\n\n /**\n * Temporal server address for the layer\n */\n temporalAddress: string;\n\n /**\n * Temporal namespace for the layer\n */\n temporalNamespace: string;\n\n /**\n * RBAC gateway URL (for permission checks)\n */\n rbacGatewayUrl: string;\n}\n\n/**\n * Complete layer configuration including gateways and resources\n */\nexport interface LayerFullConfig extends LayerConfig {\n /**\n * Gateway configuration\n */\n gateways: LayerGatewayConfig;\n\n /**\n * Resource URLs\n */\n resources: LayerResourceUrls;\n}\n\n/**\n * Gateway routing rules by layer\n * Defines which gateway to use for same-layer vs cross-layer communication\n */\nexport interface GatewayRoutingConfig {\n /**\n * Layer this config applies to\n */\n layer: ServiceLayer;\n\n /**\n * Internal gateway for same-layer M2M calls\n */\n internalGateway: {\n /** Gateway host (without protocol) */\n host: string;\n /** Gateway port */\n port: number;\n /** GraphQL endpoint path */\n graphqlPath: string;\n };\n\n /**\n * Public gateway for cross-layer calls\n */\n crossLayerGateway: {\n /** Gateway host (without protocol) */\n host: string;\n /** Gateway port */\n port: number;\n /** GraphQL endpoint path */\n graphqlPath: string;\n };\n}\n\n/**\n * Default gateway routing configuration\n */\nexport const DEFAULT_GATEWAY_ROUTING: Record<ServiceLayer, GatewayRoutingConfig> = {\n wspace: {\n layer: 'wspace',\n internalGateway: {\n host: 'wspace-int-gateway',\n port: 4001,\n graphqlPath: '/workspaces/graphql',\n },\n crossLayerGateway: {\n host: 'global-public-gateway',\n port: 4000,\n graphqlPath: '/global/graphql',\n },\n },\n global: {\n layer: 'global',\n internalGateway: {\n host: 'global-int-gateway',\n port: 4002,\n graphqlPath: '/global/graphql',\n },\n crossLayerGateway: {\n host: 'wspace-public-gateway',\n port: 4003,\n graphqlPath: '/workspaces/graphql',\n },\n },\n};\n\n/**\n * Default stream configurations per layer\n */\nexport const DEFAULT_LAYER_STREAMS: Record<\n ServiceLayer,\n Array<{ name: string; subjects: string[]; description?: string }>\n> = {\n wspace: [\n {\n name: 'WSPACE_EVENTS',\n subjects: ['wspace.>'],\n description: 'Workspace layer events stream',\n },\n {\n name: 'WSPACE_GRAPH_EVENTS',\n subjects: ['graph.>'],\n description: 'Workspace layer graph events stream (captures all graph entity events)',\n },\n ],\n global: [\n {\n name: 'GLOBAL_EVENTS',\n subjects: ['global.>'],\n description: 'Global layer events stream',\n },\n {\n name: 'GLOBAL_GRAPH_EVENTS',\n subjects: ['graph.>'],\n description: 'Global layer graph events stream (captures all graph entity events)',\n },\n ],\n};\n\n/**\n * Build internal gateway URL for a layer\n * Uses HTTP for internal K8s communication (mTLS via Istio service mesh)\n */\nfunction buildInternalGatewayUrl(layer: ServiceLayer): string {\n const routing = DEFAULT_GATEWAY_ROUTING[layer];\n const { host, port, graphqlPath } = routing.internalGateway;\n // Internal K8s services use plain HTTP with mTLS handled by Istio\n const protocol = 'http';\n return `${protocol}://${host}:${port}${graphqlPath}`;\n}\n\n/**\n * Default resource URLs per layer\n *\n * Note: Internal K8s service communication uses plain HTTP with mTLS via Istio.\n * External traffic uses HTTPS via ingress gateway.\n */\nexport const DEFAULT_LAYER_RESOURCES: Record<ServiceLayer, LayerResourceUrls> = {\n // The event queue is a single fleet-shared Redis (Azure Managed Redis in\n // ACA, fed via REDIS_URL; self-hosted shared-valkey in local dev). The\n // layer-scoped default URL below is only the local-dev compose hostname —\n // production always overrides via REDIS_URL.\n wspace: {\n eventQueueUrl: 'redis://wspace-shared-valkey:6379',\n valkeyUrl: 'valkey://wspace-valkey:6379',\n temporalAddress: 'wspace-temporal:7233',\n temporalNamespace: 'wspace-default',\n rbacGatewayUrl: buildInternalGatewayUrl('wspace'),\n },\n global: {\n eventQueueUrl: 'redis://global-shared-valkey:6379',\n valkeyUrl: 'valkey://global-valkey:6379',\n temporalAddress: 'global-temporal:7233',\n temporalNamespace: 'global-default',\n rbacGatewayUrl: buildInternalGatewayUrl('global'),\n },\n};\n\n/**\n * Circuit breaker configuration for gateway client\n */\nexport interface CircuitBreakerConfig {\n /**\n * Number of failures before opening circuit\n * @default 5\n */\n failureThreshold: number;\n\n /**\n * Time in milliseconds to wait before attempting to close circuit\n * @default 30000 (30 seconds)\n */\n resetTimeout: number;\n\n /**\n * Time window in milliseconds for counting failures\n * @default 60000 (60 seconds)\n */\n failureWindow: number;\n}\n\n/**\n * Default circuit breaker configuration\n */\nexport const DEFAULT_CIRCUIT_BREAKER_CONFIG: CircuitBreakerConfig = {\n failureThreshold: 5,\n resetTimeout: 30000,\n failureWindow: 60000,\n};\n\n/**\n * Retry configuration for gateway client\n */\nexport interface GatewayRetryConfig {\n /**\n * Maximum number of retry attempts\n * @default 3\n */\n maxAttempts: number;\n\n /**\n * Initial delay in milliseconds before first retry\n * @default 1000 (1 second)\n */\n initialDelay: number;\n\n /**\n * Maximum delay in milliseconds between retries\n * @default 10000 (10 seconds)\n */\n maxDelay: number;\n\n /**\n * Backoff multiplier for exponential backoff\n * @default 2\n */\n backoffMultiplier: number;\n}\n\n/**\n * Default retry configuration\n */\nexport const DEFAULT_GATEWAY_RETRY_CONFIG: GatewayRetryConfig = {\n maxAttempts: 3,\n initialDelay: 1000,\n maxDelay: 10000,\n backoffMultiplier: 2,\n};\n\n/**\n * Headers automatically added by gateway client for M2M calls\n */\nexport interface GatewayRequestHeaders {\n /**\n * Actor ID making the request\n */\n 'x-actor-id'?: string;\n\n /**\n * Actor type\n */\n 'x-actor-type'?: 'user' | 'app' | 'service' | 'super_admin';\n\n /**\n * Workspace ID for the request context\n */\n 'x-workspace-id'?: string;\n\n /**\n * Service identity for bypass validation\n */\n 'x-service-identity'?: string;\n\n /**\n * Call type indicator\n */\n 'x-call-type'?: 'internal' | 'cross-layer';\n\n /**\n * Permission bypass flag\n */\n 'x-bypass-permission'?: string;\n\n /**\n * RBAC bypass flag (set by gateway)\n */\n 'x-rbac-bypass'?: 'true' | 'false';\n\n /**\n * Bypass source (set by gateway)\n */\n 'x-bypass-source'?: string;\n\n /**\n * Bypass timestamp (set by gateway)\n */\n 'x-bypass-timestamp'?: string;\n\n /**\n * Cloudflare Access service-token client id, re-presented on cross-layer\n * outbound calls so the peer layer's CF-Access-gated public gateway admits\n * the request. Normally attached automatically from request context.\n */\n 'cf-access-client-id'?: string;\n\n /**\n * Cloudflare Access service-token client secret (paired with the client id).\n */\n 'cf-access-client-secret'?: string;\n\n /**\n * Delegated `app_as_user` bearer (`Bearer <jwt>`) for an internal-gateway\n * call made as an agent acting for a user. The internal gateway verifies it\n * and derives the actor; see `buildDelegatedGatewayHeaders`.\n */\n 'x-delegated-authorization'?: string;\n\n /**\n * Name of the calling service. An internal gateway uses it as the actor id\n * of a service call that names no `x-actor-id`.\n */\n 'x-service-name'?: string;\n}\n"],"mappings":";;;;AAyJA,MAAa,0BAAsE;CACjF,QAAQ;EACN,OAAO;EACP,iBAAiB;GACf,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA,mBAAmB;GACjB,MAAM;GACN,MAAM;GACN,aAAa;EACf;CACF;CACA,QAAQ;EACN,OAAO;EACP,iBAAiB;GACf,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA,mBAAmB;GACjB,MAAM;GACN,MAAM;GACN,aAAa;EACf;CACF;AACF;;;;AAKA,MAAa,wBAGT;CACF,QAAQ,CACN;EACE,MAAM;EACN,UAAU,CAAC,UAAU;EACrB,aAAa;CACf,GACA;EACE,MAAM;EACN,UAAU,CAAC,SAAS;EACpB,aAAa;CACf,CACF;CACA,QAAQ,CACN;EACE,MAAM;EACN,UAAU,CAAC,UAAU;EACrB,aAAa;CACf,GACA;EACE,MAAM;EACN,UAAU,CAAC,SAAS;EACpB,aAAa;CACf,CACF;AACF;;;;;AAMA,SAAS,wBAAwB,OAA6B;CAE5D,MAAM,EAAE,MAAM,MAAM,gBADJ,wBAAwB,MACG,CAAC;CAG5C,OAAO,UAAiB,KAAK,GAAG,OAAO;AACzC;;;;;;;AAQA,MAAa,0BAAmE;CAK9E,QAAQ;EACN,eAAe;EACf,WAAW;EACX,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB,wBAAwB,QAAQ;CAClD;CACA,QAAQ;EACN,eAAe;EACf,WAAW;EACX,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB,wBAAwB,QAAQ;CAClD;AACF;;;;AA4BA,MAAa,iCAAuD;CAClE,kBAAkB;CAClB,cAAc;CACd,eAAe;AACjB;;;;AAkCA,MAAa,+BAAmD;CAC9D,aAAa;CACb,cAAc;CACd,UAAU;CACV,mBAAmB;AACrB"}
@@ -65,5 +65,6 @@ interface GatewayRequestHeaders {
65
65
  'cf-access-client-id'?: string;
66
66
  'cf-access-client-secret'?: string;
67
67
  'x-delegated-authorization'?: string;
68
+ 'x-service-name'?: string;
68
69
  }
69
70
  export { DEFAULT_LAYER_RESOURCES as a, GatewayRetryConfig as c, LayerFullConfig as d, LayerGatewayConfig as f, DEFAULT_GATEWAY_ROUTING as i, GatewayRoutingConfig as l, ServiceLayer as m, DEFAULT_CIRCUIT_BREAKER_CONFIG as n, DEFAULT_LAYER_STREAMS as o, LayerResourceUrls as p, DEFAULT_GATEWAY_RETRY_CONFIG as r, GatewayRequestHeaders as s, CircuitBreakerConfig as t, LayerConfig as u };
@@ -1,2 +1,2 @@
1
- import { a as LoggerTransport, d as redactSensitiveFields, f as redactSensitiveString, i as LoggerConfig, l as log, n as LogMeta, o as debug, p as warn, r as Logger, s as error, t as LogLevel, u as logger } from "../index-Cot73bdh.js";
1
+ import { a as LoggerTransport, d as redactSensitiveFields, f as redactSensitiveString, i as LoggerConfig, l as log, n as LogMeta, o as debug, p as warn, r as Logger, s as error, t as LogLevel, u as logger } from "../index-KlrnELrN.js";
2
2
  export { LogLevel, LogMeta, Logger, LoggerConfig, LoggerTransport, debug, error, log, logger, redactSensitiveFields, redactSensitiveString, warn };
@@ -1,2 +1,2 @@
1
- import { _ as TenantNotificationsModule, a as NotificationType, c as SendChannelNotificationOptions, d as BatchNotificationInput, f as NotificationChannel$1, g as SendWithTemplateInput, h as SendNotificationInput, i as NotificationResponse, l as SendNotificationOptions, m as NotificationType$1, n as Notification, o as NotificationsModule, p as NotificationPriority, r as NotificationChannel, s as RecipientInput, t as GetNotificationsOptions, u as SendTemplateNotificationOptions } from "../index-U_tu3zUl.js";
1
+ import { _ as TenantNotificationsModule, a as NotificationType, c as SendChannelNotificationOptions, d as BatchNotificationInput, f as NotificationChannel$1, g as SendWithTemplateInput, h as SendNotificationInput, i as NotificationResponse, l as SendNotificationOptions, m as NotificationType$1, n as Notification, o as NotificationsModule, p as NotificationPriority, r as NotificationChannel, s as RecipientInput, t as GetNotificationsOptions, u as SendTemplateNotificationOptions } from "../index-Dw_0wE4q.js";
2
2
  export { GetNotificationsOptions, Notification, NotificationChannel, NotificationPriority, NotificationResponse, NotificationType, NotificationsModule, RecipientInput, SendChannelNotificationOptions, SendNotificationOptions, SendTemplateNotificationOptions, type BatchNotificationInput as TenantBatchNotificationInput, NotificationChannel$1 as TenantNotificationChannel, NotificationType$1 as TenantNotificationType, TenantNotificationsModule, type SendNotificationInput as TenantSendNotificationInput, type SendWithTemplateInput as TenantSendWithTemplateInput };
@@ -1,5 +1,5 @@
1
- import { t as BurdenoffGraphQLClient } from "../graphql-CUDyhibV.js";
2
- import { p as SDKContext } from "../index-CTTwo9av.js";
1
+ import { t as BurdenoffGraphQLClient } from "../graphql-C8jKLLel.js";
2
+ import { p as SDKContext } from "../index-BTaQMEgB.js";
3
3
  export declare enum PaymentStatus {
4
4
  PENDING = "pending",
5
5
  PROCESSING = "processing",
@@ -1,2 +1,2 @@
1
- import { a as Permission, c as RoleDefaultPermission, d as RBACClient, f as RBACDirectiveConfig, h as createRBACDirectiveFromEnv, i as PBACPermissionLevel, l as createRBACClientFromEnv, m as createRBACDirectiveForLayer, n as EffectivePermissionEntry, o as RBACModule, p as createRBACDirective, r as PBACActorType, s as Role, t as CheckPermissionOptions, u as LayerAwareRBACConfig } from "../index-C_GXXF32.js";
1
+ import { a as Permission, c as RoleDefaultPermission, d as RBACClient, f as RBACDirectiveConfig, h as createRBACDirectiveFromEnv, i as PBACPermissionLevel, l as createRBACClientFromEnv, m as createRBACDirectiveForLayer, n as EffectivePermissionEntry, o as RBACModule, p as createRBACDirective, r as PBACActorType, s as Role, t as CheckPermissionOptions, u as LayerAwareRBACConfig } from "../index-Bh6W5JO4.js";
2
2
  export { CheckPermissionOptions, EffectivePermissionEntry, type LayerAwareRBACConfig, PBACActorType, PBACPermissionLevel, Permission, RBACClient, type RBACDirectiveConfig, RBACModule, Role, RoleDefaultPermission, createRBACClientFromEnv, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv };
@@ -1,4 +1,4 @@
1
- import { t as BurdenoffGraphQLClient } from "../graphql-CUDyhibV.js";
1
+ import { t as BurdenoffGraphQLClient } from "../graphql-C8jKLLel.js";
2
2
  import { GraphQLError } from "graphql";
3
3
  export type ResourceName = 'workspace' | 'workspaceMember' | 'sandbox' | 'vibe' | 'agent' | 'conversation' | 'message' | 'tag' | 'file' | 'group' | 'calendar' | 'scheduledTask' | 'form' | 'apiKey' | 'webhook';
4
4
  export type PlanTier = 'free' | 'paid';
@@ -1,5 +1,5 @@
1
- import { t as BurdenoffGraphQLClient } from "../graphql-CUDyhibV.js";
2
- import { p as SDKContext } from "../index-CTTwo9av.js";
1
+ import { t as BurdenoffGraphQLClient } from "../graphql-C8jKLLel.js";
2
+ import { p as SDKContext } from "../index-BTaQMEgB.js";
3
3
  export interface SearchOptions {
4
4
  query: string;
5
5
  resourceTypes?: string[];
@@ -1,2 +1,2 @@
1
- import { t as index_d_exports } from "../index-cmR9k9ga.js";
1
+ import { t as index_d_exports } from "../index-DhFP_AIB.js";
2
2
  export { index_d_exports as RateLimit };
@@ -1,2 +1,2 @@
1
- import { a as resolveRateLimitModeFromEnv, c as RateLimitResult, i as enforceRateLimit, l as buildRateLimitKey, n as RateLimiterDeps, o as RateLimitConfig, r as checkRateLimit, s as RateLimitMode } from "../../index-cmR9k9ga.js";
1
+ import { a as resolveRateLimitModeFromEnv, c as RateLimitResult, i as enforceRateLimit, l as buildRateLimitKey, n as RateLimiterDeps, o as RateLimitConfig, r as checkRateLimit, s as RateLimitMode } from "../../index-DhFP_AIB.js";
2
2
  export { type RateLimitConfig, type RateLimitMode, type RateLimitResult, type RateLimiterDeps, buildRateLimitKey, checkRateLimit, enforceRateLimit, resolveRateLimitModeFromEnv };
@@ -1,2 +1,2 @@
1
- import { A as EntityTagInfo, B as TagVocabularyRef, C as ENTITY_TAGS_GRAPHQL_CODES, D as AvailableTag, E as isEntityTagsError, F as TagActor, H as TagsGatewayClient, I as TagActorType, L as TagAssignmentSource, M as RawTagAssignment, N as TAG_ACTOR_TYPES, O as CreateTagOptions, P as TAG_ASSIGNMENT_SOURCES, R as TagEntityOptions, S as entityTagsTypeNames, T as EntityTagsErrorCode, V as TaggedEntityPage, _ as slugifyTagKey, a as EntityTagMutationEvent, b as assertTagPrefix, c as createEntityTagResolvers, d as EntityTagsSdlOptions, f as UNIVERSAL_TAG_STUB_SDL, g as mapTagAssignment, h as TagsGatewayAdapterOptions, i as EntityTagBinding, j as FindEntitiesByTagsOptions, k as EntityTagAssignment, l as defaultTagActor, m as TagsGatewayAdapter, n as CreateEntityTagResolversOptions, o as EntityTagOperation, p as buildEntityTagsSdl, r as EntityTagAccessCheck, s as EntityTagResolvers, u as EntityTagsRbacOptions, v as EntityTagsFieldNames, w as EntityTagsError, x as entityTagsFieldNames, y as EntityTagsTypeNames, z as TagVocabularyConfig } from "../index-3KOZ1zN9.js";
1
+ import { A as EntityTagInfo, B as TagVocabularyRef, C as ENTITY_TAGS_GRAPHQL_CODES, D as AvailableTag, E as isEntityTagsError, F as TagActor, H as TagsGatewayClient, I as TagActorType, L as TagAssignmentSource, M as RawTagAssignment, N as TAG_ACTOR_TYPES, O as CreateTagOptions, P as TAG_ASSIGNMENT_SOURCES, R as TagEntityOptions, S as entityTagsTypeNames, T as EntityTagsErrorCode, V as TaggedEntityPage, _ as slugifyTagKey, a as EntityTagMutationEvent, b as assertTagPrefix, c as createEntityTagResolvers, d as EntityTagsSdlOptions, f as UNIVERSAL_TAG_STUB_SDL, g as mapTagAssignment, h as TagsGatewayAdapterOptions, i as EntityTagBinding, j as FindEntitiesByTagsOptions, k as EntityTagAssignment, l as defaultTagActor, m as TagsGatewayAdapter, n as CreateEntityTagResolversOptions, o as EntityTagOperation, p as buildEntityTagsSdl, r as EntityTagAccessCheck, s as EntityTagResolvers, u as EntityTagsRbacOptions, v as EntityTagsFieldNames, w as EntityTagsError, x as entityTagsFieldNames, y as EntityTagsTypeNames, z as TagVocabularyConfig } from "../index-HeUeEsMU.js";
2
2
  export { type AvailableTag, type CreateEntityTagResolversOptions, type CreateTagOptions, ENTITY_TAGS_GRAPHQL_CODES, type EntityTagAccessCheck, type EntityTagAssignment, type EntityTagBinding, type EntityTagInfo, type EntityTagMutationEvent, type EntityTagOperation, type EntityTagResolvers, EntityTagsError, type EntityTagsErrorCode, type EntityTagsFieldNames, type EntityTagsRbacOptions, type EntityTagsSdlOptions, type EntityTagsTypeNames, type FindEntitiesByTagsOptions, type RawTagAssignment, TAG_ACTOR_TYPES, TAG_ASSIGNMENT_SOURCES, type TagActor, type TagActorType, type TagAssignmentSource, type TagEntityOptions, type TagVocabularyConfig, type TagVocabularyRef, type TaggedEntityPage, TagsGatewayAdapter, type TagsGatewayAdapterOptions, type TagsGatewayClient, UNIVERSAL_TAG_STUB_SDL, assertTagPrefix, buildEntityTagsSdl, createEntityTagResolvers, defaultTagActor, entityTagsFieldNames, entityTagsTypeNames, isEntityTagsError, mapTagAssignment, slugifyTagKey };
@@ -1,5 +1,5 @@
1
- import { r as Logger } from "../index-Cot73bdh.js";
2
- import { l as setupInstrumentation, n as InstrumentationSetupResult, o as initializeInstrumentation, r as SetupInstrumentationOptions } from "../index-B2LCaK0R.js";
1
+ import { r as Logger } from "../index-KlrnELrN.js";
2
+ import { l as setupInstrumentation, n as InstrumentationSetupResult, o as initializeInstrumentation, r as SetupInstrumentationOptions } from "../index-479i3w77.js";
3
3
  interface TelemetryIdGenerator {
4
4
  generateTraceId(): string;
5
5
  generateSpanId(): string;
@@ -1,2 +1,2 @@
1
- import { a as TemporalWorkerManager, c as TemporalClientFactory, i as TemporalWorkerFactory, l as WorkflowStartOptions, n as TemporalWorker, o as TemporalClient, r as TemporalWorkerConfig, s as TemporalClientConfig, t as TemporalModule } from "../index-CaM9JUcc.js";
1
+ import { a as TemporalWorkerManager, c as TemporalClientFactory, i as TemporalWorkerFactory, l as WorkflowStartOptions, n as TemporalWorker, o as TemporalClient, r as TemporalWorkerConfig, s as TemporalClientConfig, t as TemporalModule } from "../index-DSynXDRD.js";
2
2
  export { TemporalClient, type TemporalClientConfig, TemporalClientFactory, TemporalModule, TemporalWorker, type TemporalWorkerConfig, TemporalWorkerFactory, TemporalWorkerManager, type WorkflowStartOptions };
@@ -1,5 +1,5 @@
1
1
  import { a as ActorOrigin, n as AI_ASSISTANT_ACTOR_ORIGIN, o as AssistantSessionAttribution } from "../assistant-session-DA5ZKJOr.js";
2
2
  import { t as suppressMutationAudit } from "../explicit-activity-scope-D8VeGGpt.js";
3
- import { p as UsageMetricType } from "../index-CVCyKzhB.js";
4
- import { S as trackerStub, _ as UsageTrackingOptions, a as AGENT_ACTIVITY_RESOURCE_TYPE, b as resolveAssistantSession, c as trackAgentActivity, d as RbacCheckOptions, f as TrackedActorType, g as UnifiedTrackingOptions, h as UnifiedTrackerStub, i as AGENT_ACTIVITY_ACTIONS, l as ActivityTrackingOptions, m as UNIFIED_TRACKER_CONSTANTS, n as TrackResult, o as AgentActivityAction, p as TrackingEvent, r as TrackerModule, s as AgentActivityOptions, t as TrackOptions, u as ProductTracker, v as createProductTracker, x as trackOperation, y as isTrackedActorType } from "../index-zd_NPGJo.js";
3
+ import { p as UsageMetricType } from "../index-DWER4-_x.js";
4
+ import { S as trackerStub, _ as UsageTrackingOptions, a as AGENT_ACTIVITY_RESOURCE_TYPE, b as resolveAssistantSession, c as trackAgentActivity, d as RbacCheckOptions, f as TrackedActorType, g as UnifiedTrackingOptions, h as UnifiedTrackerStub, i as AGENT_ACTIVITY_ACTIONS, l as ActivityTrackingOptions, m as UNIFIED_TRACKER_CONSTANTS, n as TrackResult, o as AgentActivityAction, p as TrackingEvent, r as TrackerModule, s as AgentActivityOptions, t as TrackOptions, u as ProductTracker, v as createProductTracker, x as trackOperation, y as isTrackedActorType } from "../index-DqpCL9kD.js";
5
5
  export { AGENT_ACTIVITY_ACTIONS, AGENT_ACTIVITY_RESOURCE_TYPE, AI_ASSISTANT_ACTOR_ORIGIN, type ActivityTrackingOptions, type ActorOrigin, type AgentActivityAction, type AgentActivityOptions, type AssistantSessionAttribution, type ProductTracker, type RbacCheckOptions, TrackOptions, TrackResult, type TrackedActorType, TrackerModule, type TrackingEvent, UNIFIED_TRACKER_CONSTANTS, UnifiedTrackerStub, type UnifiedTrackingOptions, UsageMetricType, type UsageTrackingOptions, createProductTracker, isTrackedActorType, resolveAssistantSession, suppressMutationAudit, trackAgentActivity, trackOperation, trackerStub };
@@ -1,8 +1,8 @@
1
1
  import { i as suppressMutationAudit } from "../explicit-activity-scope-DikJ7NAE.js";
2
2
  import "../activity/index.js";
3
- import { i as UsageMetricType } from "../usage-BRqVP3CJ.js";
3
+ import { i as UsageMetricType } from "../usage-ygkKsxdd.js";
4
4
  import { a as resolveAssistantSession, i as isTrackedActorType, l as AI_ASSISTANT_ACTOR_ORIGIN, n as UnifiedTrackerStub, o as trackOperation, r as createProductTracker, s as trackerStub, t as UNIFIED_TRACKER_CONSTANTS } from "../stub-BUnfMiAS.js";
5
- import { i as trackAgentActivity, n as AGENT_ACTIVITY_ACTIONS, r as AGENT_ACTIVITY_RESOURCE_TYPE, t as TrackerModule } from "../tracker-PQztSlhJ.js";
5
+ import { i as trackAgentActivity, n as AGENT_ACTIVITY_ACTIONS, r as AGENT_ACTIVITY_RESOURCE_TYPE, t as TrackerModule } from "../tracker-Cl3cGKe-.js";
6
6
 
7
7
  export { AGENT_ACTIVITY_ACTIONS, AGENT_ACTIVITY_RESOURCE_TYPE, AI_ASSISTANT_ACTOR_ORIGIN, TrackerModule, UNIFIED_TRACKER_CONSTANTS, UnifiedTrackerStub, UsageMetricType, createProductTracker, isTrackedActorType, resolveAssistantSession, suppressMutationAudit, trackAgentActivity, trackOperation, trackerStub };
8
8
  //# sourceMappingURL=index.js.map
@@ -2,7 +2,7 @@ import { PermissionDeniedError, QuotaExceededError, ValidationError } from "./ty
2
2
  import { a as logger } from "./logger-B6rCpb7D.js";
3
3
  import { t as RBACModule } from "./rbac-Dvz0YzEt.js";
4
4
  import { ActivityModule, ActivitySeverity, ActivityStatus, ActivityType } from "./activity/index.js";
5
- import { a as UsageModule } from "./usage-BRqVP3CJ.js";
5
+ import { a as UsageModule } from "./usage-ygkKsxdd.js";
6
6
  import { n as NotificationType, r as NotificationsModule } from "./notifications-DY_i37WN.js";
7
7
  import { o as trackOperation } from "./stub-BUnfMiAS.js";
8
8
  import { r as runInExplicitActivityScope, t as createExplicitActivityScope } from "./explicit-activity-scope-DikJ7NAE.js";
@@ -455,4 +455,4 @@ var TrackerModule = class {
455
455
  };
456
456
 
457
457
  export { trackAgentActivity as i, AGENT_ACTIVITY_ACTIONS as n, AGENT_ACTIVITY_RESOURCE_TYPE as r, TrackerModule as t };
458
- //# sourceMappingURL=tracker-PQztSlhJ.js.map
458
+ //# sourceMappingURL=tracker-Cl3cGKe-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracker-PQztSlhJ.js","names":[],"sources":["../src/tracker/agent-activity.ts","../src/tracker/index.ts"],"sourcesContent":["/**\n * AI-agent activity (BOFF-9684)\n *\n * Platform-wide activity actions for what an AI agent does, and a helper that records them with\n * the agent as an `app` actor. The audit trail can then separate agent actions from the human\n * actions around them (ISO/IEC 42001 Annex A.9 evidence) and link each one back to the person\n * who started the run (`onBehalfOf`).\n *\n * The action names follow the platform taxonomy `<domain>.<resource>.<verb>` and are shared by\n * every product that runs agents; the product is identified by `productId`.\n *\n * @example\n * ```ts\n * import { AGENT_ACTIVITY_ACTIONS, trackAgentActivity } from '@burdenoff/be-sdk/tracker';\n *\n * await trackAgentActivity({\n * action: AGENT_ACTIVITY_ACTIONS.TOOL_CALLED,\n * agentId: agent.id,\n * workspaceId,\n * onBehalfOf: userId,\n * productId: 'botmanor',\n * metadata: { toolName: 'search' },\n * });\n * ```\n *\n * @module tracker/agent-activity\n * @category Tracking\n */\nimport { createExplicitActivityScope, runInExplicitActivityScope } from '../activity/explicit-activity-scope.js';\nimport { trackOperation } from './stub.js';\n\n/** Activity actions for AI-agent behaviour. */\nexport const AGENT_ACTIVITY_ACTIONS = Object.freeze({\n /** An agent run (one turn) finished and produced a response. */\n RUN_COMPLETED: 'agent.run.completed',\n /** An agent run failed before producing a response. */\n RUN_FAILED: 'agent.run.failed',\n /** The agent called a tool (MCP or similar). `success: false` when the call failed. */\n TOOL_CALLED: 'agent.tool.called',\n /** The agent delegated a sub-task to another agent. */\n DELEGATION_SENT: 'agent.delegation.sent',\n /** A governance policy refused something the agent run attempted (input, output, tool, model, budget, rate). */\n POLICY_BLOCKED: 'agent.policy.blocked',\n} as const);\n\nexport type AgentActivityAction = (typeof AGENT_ACTIVITY_ACTIONS)[keyof typeof AGENT_ACTIVITY_ACTIONS];\n\n/** Default `resourceType` of agent activity rows; `resourceId` defaults to the agent id. */\nexport const AGENT_ACTIVITY_RESOURCE_TYPE = 'agent';\n\nconst FAILURE_ACTIONS: ReadonlySet<AgentActivityAction> = new Set<AgentActivityAction>([\n AGENT_ACTIVITY_ACTIONS.RUN_FAILED,\n AGENT_ACTIVITY_ACTIONS.POLICY_BLOCKED,\n]);\n\nexport interface AgentActivityOptions {\n action: AgentActivityAction;\n /** The agent that acted. Recorded as the row's actor (`userId`) with `actorType: 'app'`. */\n agentId: string;\n workspaceId: string;\n /** The human who started the run, when there is one. */\n onBehalfOf?: string;\n /** Product that runs the agent, e.g. `botmanor`. */\n productId?: string;\n /** Defaults to false for RUN_FAILED and POLICY_BLOCKED, true otherwise. */\n success?: boolean;\n errorMessage?: string;\n description?: string;\n /** Defaults to `AGENT_ACTIVITY_RESOURCE_TYPE`. */\n resourceType?: string;\n /** Defaults to `agentId`. */\n resourceId?: string;\n metadata?: Record<string, unknown>;\n /** Stable idempotency key, only for callers that may replay the same event. */\n dedupeKey?: string;\n}\n\n/**\n * Record one AI-agent activity row, attributed to the agent as an `app` actor.\n *\n * Fire-and-forget like `trackOperation`: it never throws for a delivery failure and never blocks\n * on the activity service. It runs in its own explicit-activity scope, so recording what the\n * agent did does not suppress the mutation-audit row of the human request that started the run.\n */\nexport function trackAgentActivity(options: AgentActivityOptions): Promise<boolean> {\n const success = options.success ?? !FAILURE_ACTIONS.has(options.action);\n return runInExplicitActivityScope(createExplicitActivityScope(), () =>\n trackOperation({\n operationName: options.action,\n userId: options.agentId,\n actorType: 'app',\n ...(options.onBehalfOf ? { onBehalfOf: options.onBehalfOf } : {}),\n workspaceId: options.workspaceId,\n ...(options.productId ? { productId: options.productId } : {}),\n success,\n ...(options.errorMessage ? { errorMessage: options.errorMessage } : {}),\n activityOptions: {\n enabled: true,\n activityType: options.action,\n description: options.description ?? `Agent ${options.agentId}: ${options.action}`,\n workspaceId: options.workspaceId,\n resourceType: options.resourceType ?? AGENT_ACTIVITY_RESOURCE_TYPE,\n resourceId: options.resourceId ?? options.agentId,\n metadata: { ...options.metadata, agentId: options.agentId },\n ...(options.dedupeKey ? { dedupeKey: options.dedupeKey } : {}),\n },\n })\n );\n}\n","/**\n * Unified Tracker Module\n * Aggregates RBAC + Activity + Usage + Notifications in single function call\n * This is the MOST IMPORTANT module that products should use for most operations\n */\n\nimport type { BurdenoffGraphQLClient } from '../client/graphql.js';\nimport type { SDKContext } from '../types/index.js';\nimport { PermissionDeniedError, QuotaExceededError, ValidationError } from '../types/index.js';\nimport { logger } from '../logger/index.js';\nimport { RBACModule, type CheckPermissionOptions } from '../rbac/index.js';\nimport { ActivityModule, ActivityType, ActivityStatus, ActivitySeverity } from '../activity/index.js';\nimport { UsageModule, type UsageMetricType } from '../usage/index.js';\nimport { NotificationsModule, NotificationType } from '../notifications/index.js';\n\nexport interface TrackOptions {\n /** User performing the action */\n userId: string;\n /** Action being performed */\n action: string;\n /** Resource type */\n resourceType: string;\n /** Optional resource ID */\n resourceId?: string;\n /** Workspace context */\n workspaceId?: string;\n /** Organization context */\n organizationId?: string;\n /** Project context */\n projectId?: string;\n\n /** RBAC options */\n rbac?: {\n /** Check permission before executing (default: true) */\n enabled?: boolean;\n /** Custom permission action (defaults to action parameter) */\n permissionAction?: string;\n };\n\n /** Activity tracking options */\n activity?: {\n /** Enable activity tracking (default: true) */\n enabled?: boolean;\n /** Activity type (auto-inferred if not provided) */\n activityType?: ActivityType;\n /** Additional metadata */\n metadata?: Record<string, unknown>;\n /** IP address */\n ipAddress?: string;\n /** User agent */\n userAgent?: string;\n /** Severity level */\n severity?: ActivitySeverity;\n };\n\n /**\n * Usage tracking options.\n *\n * The tracker meters a workspace quota only when `quotaName` is set: it checks capacity\n * with the owner's `checkWorkspaceQuota` (for positive amounts) and records the amount\n * with `trackUsage`. Without a `quotaName` the usage step is skipped. Mutations whose\n * schema carries a gateway `@usage` directive are already metered by the gateway and\n * should not set `quotaName` here, or the quota is charged twice.\n */\n usage?: {\n /** Enable usage tracking (default: true) */\n enabled?: boolean;\n /** Workspace quota to charge, for example `platform.projects.created`. */\n quotaName?: string;\n /** Product that owns the quota. Defaults to the SDK context's `productId`. */\n productId?: string;\n /** Description stored on the usage record. Defaults to `<action> <resourceType>`. */\n description?: string;\n /**\n * Amount to record (default: 1). A negative amount releases usage, for example on\n * delete; the quota check is skipped for it.\n */\n amount?: number;\n /** Check quota before recording a positive amount (default: true) */\n checkQuota?: boolean;\n /**\n * Legacy metric name. The workspace usage owner has no metric types, so a metric type\n * without a `quotaName` is not metered by the tracker.\n */\n metricType?: UsageMetricType;\n /** Legacy entity type. Workspace quotas are always charged to the workspace. */\n entityType?: 'user' | 'workspace' | 'organization';\n };\n\n /** Notification options */\n notification?: {\n /** Send notification on success */\n onSuccess?: {\n title: string;\n message: string;\n type?: NotificationType;\n /** Additional user IDs to notify */\n additionalUserIds?: string[];\n };\n /** Send notification on failure */\n onFailure?: {\n title: string;\n message: string;\n type?: NotificationType;\n /** Additional user IDs to notify */\n additionalUserIds?: string[];\n };\n };\n}\n\n/** A usage step that meters a named workspace quota. */\ninterface ResolvedUsage {\n quotaName: string;\n amount: number;\n workspaceId: string;\n checkQuota: boolean;\n}\n\nexport interface TrackResult {\n success: boolean;\n /** Permission check result */\n permissionGranted: boolean;\n /** Quota check result (if quota checking enabled) */\n quotaAvailable?: boolean;\n quotaRemaining?: number;\n /** Activity record ID */\n activityId?: string;\n /** True when the usage step recorded the amount with the owner */\n usageTracked?: boolean;\n /**\n * @deprecated The owner's `trackUsage` returns `Boolean!` and no record id, so this is\n * never set. Read `usageTracked` instead.\n */\n usageRecordId?: string;\n /** Notification IDs sent */\n notificationIds?: string[];\n /** Error if operation failed */\n error?: {\n type: 'permission' | 'quota' | 'validation' | 'unknown';\n message: string;\n details?: Record<string, unknown>;\n };\n /** Operation duration in milliseconds */\n duration: number;\n}\n\n/**\n * Unified Tracker Module\n *\n * The primary module products should use for tracking operations.\n * Automatically handles RBAC checks, activity logging, usage tracking, and notifications.\n *\n * @example\n * ```typescript\n * const result = await sdk.tracker.track({\n * userId: 'user123',\n * action: 'create_project',\n * resourceType: 'project',\n * workspaceId: 'ws123',\n * usage: {\n * quotaName: 'myproduct.projects.count',\n * productId: 'myproduct',\n * amount: 1,\n * checkQuota: true,\n * },\n * notification: {\n * onSuccess: {\n * title: 'Project Created',\n * message: 'Your project has been created successfully',\n * },\n * },\n * });\n *\n * if (!result.success) {\n * // Handle error\n * }\n * ```\n */\nexport class TrackerModule {\n private rbac: RBACModule;\n private activity: ActivityModule;\n private usage: UsageModule;\n private notifications: NotificationsModule;\n\n constructor(\n client: BurdenoffGraphQLClient,\n private context: SDKContext = {}\n ) {\n this.rbac = new RBACModule(client, context);\n this.activity = new ActivityModule(client, context);\n this.usage = new UsageModule(client, context);\n this.notifications = new NotificationsModule(client, context);\n }\n\n /**\n * Track operation with RBAC, Activity, Usage, and Notifications\n * This is the primary method products should use\n */\n public async track(options: TrackOptions): Promise<TrackResult> {\n const startTime = Date.now();\n const result: TrackResult = {\n success: false,\n permissionGranted: false,\n duration: 0,\n };\n\n try {\n // Validate required fields\n this.validateOptions(options);\n\n // Step 1: Check RBAC permission (if enabled)\n if (options.rbac?.enabled !== false) {\n await this.checkPermission(options, result);\n if (!result.permissionGranted) {\n result.duration = Date.now() - startTime;\n await this.logFailedActivity(options, result, startTime);\n return result;\n }\n } else {\n result.permissionGranted = true;\n }\n\n // Steps 2 and 3: check quota, then record usage (only for a named workspace quota)\n const usage = this.resolveUsage(options);\n if (usage) {\n let quotaAssignmentId: string | undefined;\n if (usage.checkQuota) {\n quotaAssignmentId = await this.checkQuota(options, usage, result);\n if (result.quotaAvailable === false) {\n result.duration = Date.now() - startTime;\n await this.logFailedActivity(options, result, startTime);\n return result;\n }\n }\n await this.trackUsage(options, usage, quotaAssignmentId, result);\n }\n\n // Step 4: Log successful activity (if enabled)\n if (options.activity?.enabled !== false) {\n await this.logSuccessActivity(options, result, startTime);\n }\n\n // Step 5: Send success notification (if configured)\n if (options.notification?.onSuccess) {\n await this.sendSuccessNotification(options, result);\n }\n\n result.success = true;\n result.duration = Date.now() - startTime;\n\n logger.info('[Tracker] Operation tracked successfully', {\n action: options.action,\n duration: result.duration,\n });\n\n return result;\n } catch (error) {\n result.duration = Date.now() - startTime;\n result.success = false;\n\n // Categorize error\n if (error instanceof PermissionDeniedError) {\n result.error = {\n type: 'permission',\n message: error.message,\n details: error.details,\n };\n } else if (error instanceof QuotaExceededError) {\n result.error = {\n type: 'quota',\n message: error.message,\n details: error.details,\n };\n } else if (error instanceof ValidationError) {\n result.error = {\n type: 'validation',\n message: error.message,\n details: error.details,\n };\n } else {\n result.error = {\n type: 'unknown',\n message: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n\n // Log failed activity\n await this.logFailedActivity(options, result, startTime);\n\n // Send failure notification (if configured)\n if (options.notification?.onFailure) {\n await this.sendFailureNotification(options, result);\n }\n\n logger.error('[Tracker] Operation tracking failed', {\n action: options.action,\n error: result.error,\n duration: result.duration,\n });\n\n return result;\n }\n }\n\n /**\n * Track operation and throw on failure\n * Convenience method that throws errors instead of returning them in result\n */\n public async trackOrThrow(options: TrackOptions): Promise<TrackResult> {\n const result = await this.track(options);\n\n if (!result.success && result.error) {\n const errorMessage = result.error.message;\n const errorDetails = result.error.details;\n\n switch (result.error.type) {\n case 'permission':\n throw new PermissionDeniedError(errorMessage, errorDetails);\n case 'quota':\n throw new QuotaExceededError(errorMessage, errorDetails);\n case 'validation':\n throw new ValidationError(errorMessage, errorDetails);\n default:\n throw new Error(errorMessage);\n }\n }\n\n return result;\n }\n\n /**\n * Simplified track method for common operations.\n * The trailing metric type is accepted for source compatibility and is not metered.\n */\n public async trackSimple(\n userId: string,\n action: string,\n resourceType: string,\n resourceId?: string,\n _metricType?: UsageMetricType\n ): Promise<boolean> {\n // A metric type has no workspace quota on the owner, so trackSimple never meters usage.\n // Call track() with `usage.quotaName` to charge a quota.\n const result = await this.track({\n userId,\n action,\n resourceType,\n resourceId,\n workspaceId: this.context.workspaceId,\n usage: { enabled: false },\n });\n\n return result.success;\n }\n\n /**\n * Validate tracking options\n */\n private validateOptions(options: TrackOptions): void {\n if (!options.userId) {\n throw new ValidationError('User ID is required');\n }\n\n if (!options.action) {\n throw new ValidationError('Action is required');\n }\n\n if (!options.resourceType) {\n throw new ValidationError('Resource type is required');\n }\n }\n\n /**\n * Check RBAC permission\n */\n private async checkPermission(options: TrackOptions, result: TrackResult): Promise<void> {\n const permissionOptions: CheckPermissionOptions = {\n userId: options.userId,\n action: options.rbac?.permissionAction || options.action,\n resourceType: options.resourceType,\n resourceId: options.resourceId,\n workspaceId: options.workspaceId,\n };\n\n const hasPermission = await this.rbac.checkPermission(permissionOptions);\n result.permissionGranted = hasPermission;\n\n if (!hasPermission) {\n result.error = {\n type: 'permission',\n message: 'Permission denied',\n details: permissionOptions as unknown as Record<string, unknown>,\n };\n }\n }\n\n /**\n * Resolve the usage step for an operation, or null when nothing is metered: usage is\n * disabled, or no workspace quota is named (a legacy `metricType` alone has no owner\n * quota to charge).\n */\n private resolveUsage(options: TrackOptions): ResolvedUsage | null {\n const usage = options.usage;\n if (!usage || usage.enabled === false) {\n return null;\n }\n const quotaName = usage.quotaName?.trim();\n if (!quotaName) {\n if (usage.metricType) {\n logger.debug('[Tracker] Usage step skipped: no quotaName for legacy metricType', {\n action: options.action,\n metricType: usage.metricType,\n });\n }\n return null;\n }\n const amount = usage.amount ?? 1;\n if (typeof amount !== 'number' || !Number.isFinite(amount) || amount === 0) {\n throw new ValidationError('Usage amount must be a finite, non-zero number');\n }\n const workspaceId = options.workspaceId ?? this.context.workspaceId;\n if (!workspaceId) {\n throw new ValidationError('Workspace ID is required to track workspace quota usage');\n }\n return {\n quotaName,\n amount,\n workspaceId,\n // Only consumption is gated; a release (negative amount) must always go through.\n checkQuota: usage.checkQuota !== false && amount > 0,\n };\n }\n\n /**\n * Check workspace quota capacity. Returns the assignment to charge when one exists.\n */\n private async checkQuota(\n options: TrackOptions,\n usage: ResolvedUsage,\n result: TrackResult\n ): Promise<string | undefined> {\n const quotaCheck = await this.usage.checkWorkspaceQuota({\n quotaName: usage.quotaName,\n amount: usage.amount,\n workspaceId: usage.workspaceId,\n userId: options.userId,\n });\n\n result.quotaAvailable = quotaCheck.allowed;\n result.quotaRemaining = quotaCheck.limitLeft ?? undefined;\n\n if (!quotaCheck.allowed) {\n const notProvisioned = quotaCheck.assignmentId === null;\n result.error = {\n type: 'quota',\n message: notProvisioned\n ? `Quota ${usage.quotaName} is not included in this workspace's plan`\n : 'Quota exceeded',\n details: {\n quotaName: usage.quotaName,\n requestedAmount: usage.amount,\n limitLeft: quotaCheck.limitLeft,\n notProvisioned,\n },\n };\n }\n\n return quotaCheck.assignmentId ?? undefined;\n }\n\n /**\n * Record workspace quota usage with the owner.\n */\n private async trackUsage(\n options: TrackOptions,\n usage: ResolvedUsage,\n quotaAssignmentId: string | undefined,\n result: TrackResult\n ): Promise<void> {\n result.usageTracked = await this.usage.trackUsage({\n quotaName: usage.quotaName,\n productId: options.usage?.productId,\n amount: usage.amount,\n description: options.usage?.description?.trim() || `${options.action} ${options.resourceType}`,\n workspaceId: usage.workspaceId,\n userId: options.userId,\n quotaAssignmentId,\n metadata: {\n action: options.action,\n resourceType: options.resourceType,\n ...(options.resourceId ? { resourceId: options.resourceId } : {}),\n },\n });\n }\n\n /**\n * Log successful activity\n */\n private async logSuccessActivity(options: TrackOptions, result: TrackResult, startTime: number): Promise<void> {\n const activityRecord = await this.activity.log({\n userId: options.userId,\n activityType: options.activity?.activityType || this.inferActivityType(options.action),\n resourceType: options.resourceType,\n resourceId: options.resourceId,\n action: options.action,\n status: ActivityStatus.SUCCESS,\n workspaceId: options.workspaceId,\n organizationId: options.organizationId,\n projectId: options.projectId,\n ipAddress: options.activity?.ipAddress,\n userAgent: options.activity?.userAgent,\n metadata: options.activity?.metadata,\n severity: options.activity?.severity || ActivitySeverity.LOW,\n duration: Date.now() - startTime,\n });\n\n result.activityId = activityRecord.id;\n }\n\n /**\n * Log failed activity\n */\n private async logFailedActivity(options: TrackOptions, result: TrackResult, startTime: number): Promise<void> {\n if (options.activity?.enabled === false) {\n return;\n }\n\n try {\n const activityRecord = await this.activity.log({\n userId: options.userId,\n activityType: options.activity?.activityType || this.inferActivityType(options.action),\n resourceType: options.resourceType,\n resourceId: options.resourceId,\n action: options.action,\n status: ActivityStatus.FAILURE,\n workspaceId: options.workspaceId,\n organizationId: options.organizationId,\n projectId: options.projectId,\n ipAddress: options.activity?.ipAddress,\n userAgent: options.activity?.userAgent,\n metadata: options.activity?.metadata,\n severity: ActivitySeverity.HIGH,\n errorMessage: result.error?.message,\n duration: Date.now() - startTime,\n });\n\n result.activityId = activityRecord.id;\n } catch (error) {\n logger.error('[Tracker] Failed to log activity', { error });\n }\n }\n\n /**\n * Send success notification\n */\n private async sendSuccessNotification(options: TrackOptions, result: TrackResult): Promise<void> {\n if (!options.notification?.onSuccess) {\n return;\n }\n\n try {\n const userIds = [options.userId, ...(options.notification.onSuccess.additionalUserIds || [])];\n\n const response = await this.notifications.send({\n title: options.notification.onSuccess.title,\n message: options.notification.onSuccess.message,\n type: options.notification.onSuccess.type || NotificationType.SUCCESS,\n userIds,\n });\n\n result.notificationIds = response.notificationIds;\n } catch (error) {\n logger.error('[Tracker] Failed to send success notification', { error });\n }\n }\n\n /**\n * Send failure notification\n */\n private async sendFailureNotification(options: TrackOptions, result: TrackResult): Promise<void> {\n if (!options.notification?.onFailure) {\n return;\n }\n\n try {\n const userIds = [options.userId, ...(options.notification.onFailure.additionalUserIds || [])];\n\n const response = await this.notifications.send({\n title: options.notification.onFailure.title,\n message: options.notification.onFailure.message,\n type: options.notification.onFailure.type || NotificationType.ERROR,\n userIds,\n });\n\n result.notificationIds = response.notificationIds;\n } catch (error) {\n logger.error('[Tracker] Failed to send failure notification', { error });\n }\n }\n\n /**\n * Infer activity type from action\n */\n private inferActivityType(action: string): ActivityType {\n const actionLower = action.toLowerCase();\n\n if (actionLower.includes('create') || actionLower.includes('add')) return ActivityType.CREATE;\n if (actionLower.includes('update') || actionLower.includes('edit')) return ActivityType.UPDATE;\n if (actionLower.includes('delete') || actionLower.includes('remove')) return ActivityType.DELETE;\n if (actionLower.includes('read') || actionLower.includes('view')) return ActivityType.READ;\n if (actionLower.includes('login')) return ActivityType.LOGIN;\n if (actionLower.includes('logout')) return ActivityType.LOGOUT;\n if (actionLower.includes('export')) return ActivityType.EXPORT;\n if (actionLower.includes('import')) return ActivityType.IMPORT;\n if (actionLower.includes('share')) return ActivityType.SHARE;\n if (actionLower.includes('download')) return ActivityType.DOWNLOAD;\n if (actionLower.includes('upload')) return ActivityType.UPLOAD;\n\n return ActivityType.CUSTOM;\n }\n\n /**\n * Batch track multiple operations\n */\n public async trackBatch(operations: TrackOptions[]): Promise<TrackResult[]> {\n logger.debug('[Tracker] Batch tracking operations', { count: operations.length });\n\n const results = await Promise.all(operations.map((op) => this.track(op)));\n\n logger.info('[Tracker] Batch tracking completed', {\n total: results.length,\n successful: results.filter((r) => r.success).length,\n failed: results.filter((r) => !r.success).length,\n });\n\n return results;\n }\n}\n\n// Export stub implementation for services that don't need full tracking\nexport {\n trackOperation,\n createProductTracker,\n UnifiedTrackerStub,\n trackerStub,\n UNIFIED_TRACKER_CONSTANTS,\n} from './stub.js';\nexport { isTrackedActorType, resolveAssistantSession } from './stub.js';\n// Assistant-session attribution on activity rows (BOFF-9649)\nexport { AI_ASSISTANT_ACTOR_ORIGIN } from '../activity/assistant-session.js';\nexport type { ActorOrigin, AssistantSessionAttribution } from '../activity/assistant-session.js';\nexport type {\n TrackingEvent,\n RbacCheckOptions,\n UsageTrackingOptions,\n ActivityTrackingOptions,\n UnifiedTrackingOptions,\n ProductTracker,\n TrackedActorType,\n} from './stub.js';\n\n// AI-agent activity actions and recorder (BOFF-9684)\nexport { AGENT_ACTIVITY_ACTIONS, AGENT_ACTIVITY_RESOURCE_TYPE, trackAgentActivity } from './agent-activity.js';\nexport type { AgentActivityAction, AgentActivityOptions } from './agent-activity.js';\n\n// Opt a resolver out of the mutation-audit backstop row (see server/mutation-audit.ts)\nexport { suppressMutationAudit } from '../activity/explicit-activity-scope.js';\n\n// Re-export UsageMetricType from usage module for convenience\nexport { UsageMetricType } from '../usage/index.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,yBAAyB,OAAO,OAAO;;CAElD,eAAe;;CAEf,YAAY;;CAEZ,aAAa;;CAEb,iBAAiB;;CAEjB,gBAAgB;AAClB,CAAU;;AAKV,MAAa,+BAA+B;AAE5C,MAAM,kCAAoD,IAAI,IAAyB,CACrF,uBAAuB,YACvB,uBAAuB,cACzB,CAAC;;;;;;;;AA+BD,SAAgB,mBAAmB,SAAiD;CAClF,MAAM,UAAU,QAAQ,WAAW,CAAC,gBAAgB,IAAI,QAAQ,MAAM;CACtE,OAAO,2BAA2B,4BAA4B,SAC5D,eAAe;EACb,eAAe,QAAQ;EACvB,QAAQ,QAAQ;EAChB,WAAW;EACX,GAAI,QAAQ,aAAa,EAAE,YAAY,QAAQ,WAAW,IAAI,CAAC;EAC/D,aAAa,QAAQ;EACrB,GAAI,QAAQ,YAAY,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;EAC5D;EACA,GAAI,QAAQ,eAAe,EAAE,cAAc,QAAQ,aAAa,IAAI,CAAC;EACrE,iBAAiB;GACf,SAAS;GACT,cAAc,QAAQ;GACtB,aAAa,QAAQ,eAAe,SAAS,QAAQ,QAAQ,IAAI,QAAQ;GACzE,aAAa,QAAQ;GACrB,cAAc,QAAQ;GACtB,YAAY,QAAQ,cAAc,QAAQ;GAC1C,UAAU;IAAE,GAAG,QAAQ;IAAU,SAAS,QAAQ;GAA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E,OAAO,KAAK,sCAAsC;GAChD,OAAO,QAAQ;GACf,YAAY,QAAQ,QAAQ,MAAM,EAAE,OAAO,CAAC,CAAC;GAC7C,QAAQ,QAAQ,QAAQ,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;EAC5C,CAAC;EAED,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"tracker-Cl3cGKe-.js","names":[],"sources":["../src/tracker/agent-activity.ts","../src/tracker/index.ts"],"sourcesContent":["/**\n * AI-agent activity (BOFF-9684)\n *\n * Platform-wide activity actions for what an AI agent does, and a helper that records them with\n * the agent as an `app` actor. The audit trail can then separate agent actions from the human\n * actions around them (ISO/IEC 42001 Annex A.9 evidence) and link each one back to the person\n * who started the run (`onBehalfOf`).\n *\n * The action names follow the platform taxonomy `<domain>.<resource>.<verb>` and are shared by\n * every product that runs agents; the product is identified by `productId`.\n *\n * @example\n * ```ts\n * import { AGENT_ACTIVITY_ACTIONS, trackAgentActivity } from '@burdenoff/be-sdk/tracker';\n *\n * await trackAgentActivity({\n * action: AGENT_ACTIVITY_ACTIONS.TOOL_CALLED,\n * agentId: agent.id,\n * workspaceId,\n * onBehalfOf: userId,\n * productId: 'botmanor',\n * metadata: { toolName: 'search' },\n * });\n * ```\n *\n * @module tracker/agent-activity\n * @category Tracking\n */\nimport { createExplicitActivityScope, runInExplicitActivityScope } from '../activity/explicit-activity-scope.js';\nimport { trackOperation } from './stub.js';\n\n/** Activity actions for AI-agent behaviour. */\nexport const AGENT_ACTIVITY_ACTIONS = Object.freeze({\n /** An agent run (one turn) finished and produced a response. */\n RUN_COMPLETED: 'agent.run.completed',\n /** An agent run failed before producing a response. */\n RUN_FAILED: 'agent.run.failed',\n /** The agent called a tool (MCP or similar). `success: false` when the call failed. */\n TOOL_CALLED: 'agent.tool.called',\n /** The agent delegated a sub-task to another agent. */\n DELEGATION_SENT: 'agent.delegation.sent',\n /** A governance policy refused something the agent run attempted (input, output, tool, model, budget, rate). */\n POLICY_BLOCKED: 'agent.policy.blocked',\n} as const);\n\nexport type AgentActivityAction = (typeof AGENT_ACTIVITY_ACTIONS)[keyof typeof AGENT_ACTIVITY_ACTIONS];\n\n/** Default `resourceType` of agent activity rows; `resourceId` defaults to the agent id. */\nexport const AGENT_ACTIVITY_RESOURCE_TYPE = 'agent';\n\nconst FAILURE_ACTIONS: ReadonlySet<AgentActivityAction> = new Set<AgentActivityAction>([\n AGENT_ACTIVITY_ACTIONS.RUN_FAILED,\n AGENT_ACTIVITY_ACTIONS.POLICY_BLOCKED,\n]);\n\nexport interface AgentActivityOptions {\n action: AgentActivityAction;\n /** The agent that acted. Recorded as the row's actor (`userId`) with `actorType: 'app'`. */\n agentId: string;\n workspaceId: string;\n /** The human who started the run, when there is one. */\n onBehalfOf?: string;\n /** Product that runs the agent, e.g. `botmanor`. */\n productId?: string;\n /** Defaults to false for RUN_FAILED and POLICY_BLOCKED, true otherwise. */\n success?: boolean;\n errorMessage?: string;\n description?: string;\n /** Defaults to `AGENT_ACTIVITY_RESOURCE_TYPE`. */\n resourceType?: string;\n /** Defaults to `agentId`. */\n resourceId?: string;\n metadata?: Record<string, unknown>;\n /** Stable idempotency key, only for callers that may replay the same event. */\n dedupeKey?: string;\n}\n\n/**\n * Record one AI-agent activity row, attributed to the agent as an `app` actor.\n *\n * Fire-and-forget like `trackOperation`: it never throws for a delivery failure and never blocks\n * on the activity service. It runs in its own explicit-activity scope, so recording what the\n * agent did does not suppress the mutation-audit row of the human request that started the run.\n */\nexport function trackAgentActivity(options: AgentActivityOptions): Promise<boolean> {\n const success = options.success ?? !FAILURE_ACTIONS.has(options.action);\n return runInExplicitActivityScope(createExplicitActivityScope(), () =>\n trackOperation({\n operationName: options.action,\n userId: options.agentId,\n actorType: 'app',\n ...(options.onBehalfOf ? { onBehalfOf: options.onBehalfOf } : {}),\n workspaceId: options.workspaceId,\n ...(options.productId ? { productId: options.productId } : {}),\n success,\n ...(options.errorMessage ? { errorMessage: options.errorMessage } : {}),\n activityOptions: {\n enabled: true,\n activityType: options.action,\n description: options.description ?? `Agent ${options.agentId}: ${options.action}`,\n workspaceId: options.workspaceId,\n resourceType: options.resourceType ?? AGENT_ACTIVITY_RESOURCE_TYPE,\n resourceId: options.resourceId ?? options.agentId,\n metadata: { ...options.metadata, agentId: options.agentId },\n ...(options.dedupeKey ? { dedupeKey: options.dedupeKey } : {}),\n },\n })\n );\n}\n","/**\n * Unified Tracker Module\n * Aggregates RBAC + Activity + Usage + Notifications in single function call\n * This is the MOST IMPORTANT module that products should use for most operations\n */\n\nimport type { BurdenoffGraphQLClient } from '../client/graphql.js';\nimport type { SDKContext } from '../types/index.js';\nimport { PermissionDeniedError, QuotaExceededError, ValidationError } from '../types/index.js';\nimport { logger } from '../logger/index.js';\nimport { RBACModule, type CheckPermissionOptions } from '../rbac/index.js';\nimport { ActivityModule, ActivityType, ActivityStatus, ActivitySeverity } from '../activity/index.js';\nimport { UsageModule, type UsageMetricType } from '../usage/index.js';\nimport { NotificationsModule, NotificationType } from '../notifications/index.js';\n\nexport interface TrackOptions {\n /** User performing the action */\n userId: string;\n /** Action being performed */\n action: string;\n /** Resource type */\n resourceType: string;\n /** Optional resource ID */\n resourceId?: string;\n /** Workspace context */\n workspaceId?: string;\n /** Organization context */\n organizationId?: string;\n /** Project context */\n projectId?: string;\n\n /** RBAC options */\n rbac?: {\n /** Check permission before executing (default: true) */\n enabled?: boolean;\n /** Custom permission action (defaults to action parameter) */\n permissionAction?: string;\n };\n\n /** Activity tracking options */\n activity?: {\n /** Enable activity tracking (default: true) */\n enabled?: boolean;\n /** Activity type (auto-inferred if not provided) */\n activityType?: ActivityType;\n /** Additional metadata */\n metadata?: Record<string, unknown>;\n /** IP address */\n ipAddress?: string;\n /** User agent */\n userAgent?: string;\n /** Severity level */\n severity?: ActivitySeverity;\n };\n\n /**\n * Usage tracking options.\n *\n * The tracker meters a workspace quota only when `quotaName` is set: it checks capacity\n * with the owner's `checkWorkspaceQuota` (for positive amounts) and records the amount\n * with `trackUsage`. Without a `quotaName` the usage step is skipped. Mutations whose\n * schema carries a gateway `@usage` directive are already metered by the gateway and\n * should not set `quotaName` here, or the quota is charged twice.\n */\n usage?: {\n /** Enable usage tracking (default: true) */\n enabled?: boolean;\n /** Workspace quota to charge, for example `platform.projects.created`. */\n quotaName?: string;\n /** Product that owns the quota. Defaults to the SDK context's `productId`. */\n productId?: string;\n /** Description stored on the usage record. Defaults to `<action> <resourceType>`. */\n description?: string;\n /**\n * Amount to record (default: 1). A negative amount releases usage, for example on\n * delete; the quota check is skipped for it.\n */\n amount?: number;\n /** Check quota before recording a positive amount (default: true) */\n checkQuota?: boolean;\n /**\n * Legacy metric name. The workspace usage owner has no metric types, so a metric type\n * without a `quotaName` is not metered by the tracker.\n */\n metricType?: UsageMetricType;\n /** Legacy entity type. Workspace quotas are always charged to the workspace. */\n entityType?: 'user' | 'workspace' | 'organization';\n };\n\n /** Notification options */\n notification?: {\n /** Send notification on success */\n onSuccess?: {\n title: string;\n message: string;\n type?: NotificationType;\n /** Additional user IDs to notify */\n additionalUserIds?: string[];\n };\n /** Send notification on failure */\n onFailure?: {\n title: string;\n message: string;\n type?: NotificationType;\n /** Additional user IDs to notify */\n additionalUserIds?: string[];\n };\n };\n}\n\n/** A usage step that meters a named workspace quota. */\ninterface ResolvedUsage {\n quotaName: string;\n amount: number;\n workspaceId: string;\n checkQuota: boolean;\n}\n\nexport interface TrackResult {\n success: boolean;\n /** Permission check result */\n permissionGranted: boolean;\n /** Quota check result (if quota checking enabled) */\n quotaAvailable?: boolean;\n quotaRemaining?: number;\n /** Activity record ID */\n activityId?: string;\n /** True when the usage step recorded the amount with the owner */\n usageTracked?: boolean;\n /**\n * @deprecated The owner's `trackUsage` returns `Boolean!` and no record id, so this is\n * never set. Read `usageTracked` instead.\n */\n usageRecordId?: string;\n /** Notification IDs sent */\n notificationIds?: string[];\n /** Error if operation failed */\n error?: {\n type: 'permission' | 'quota' | 'validation' | 'unknown';\n message: string;\n details?: Record<string, unknown>;\n };\n /** Operation duration in milliseconds */\n duration: number;\n}\n\n/**\n * Unified Tracker Module\n *\n * The primary module products should use for tracking operations.\n * Automatically handles RBAC checks, activity logging, usage tracking, and notifications.\n *\n * @example\n * ```typescript\n * const result = await sdk.tracker.track({\n * userId: 'user123',\n * action: 'create_project',\n * resourceType: 'project',\n * workspaceId: 'ws123',\n * usage: {\n * quotaName: 'myproduct.projects.count',\n * productId: 'myproduct',\n * amount: 1,\n * checkQuota: true,\n * },\n * notification: {\n * onSuccess: {\n * title: 'Project Created',\n * message: 'Your project has been created successfully',\n * },\n * },\n * });\n *\n * if (!result.success) {\n * // Handle error\n * }\n * ```\n */\nexport class TrackerModule {\n private rbac: RBACModule;\n private activity: ActivityModule;\n private usage: UsageModule;\n private notifications: NotificationsModule;\n\n constructor(\n client: BurdenoffGraphQLClient,\n private context: SDKContext = {}\n ) {\n this.rbac = new RBACModule(client, context);\n this.activity = new ActivityModule(client, context);\n this.usage = new UsageModule(client, context);\n this.notifications = new NotificationsModule(client, context);\n }\n\n /**\n * Track operation with RBAC, Activity, Usage, and Notifications\n * This is the primary method products should use\n */\n public async track(options: TrackOptions): Promise<TrackResult> {\n const startTime = Date.now();\n const result: TrackResult = {\n success: false,\n permissionGranted: false,\n duration: 0,\n };\n\n try {\n // Validate required fields\n this.validateOptions(options);\n\n // Step 1: Check RBAC permission (if enabled)\n if (options.rbac?.enabled !== false) {\n await this.checkPermission(options, result);\n if (!result.permissionGranted) {\n result.duration = Date.now() - startTime;\n await this.logFailedActivity(options, result, startTime);\n return result;\n }\n } else {\n result.permissionGranted = true;\n }\n\n // Steps 2 and 3: check quota, then record usage (only for a named workspace quota)\n const usage = this.resolveUsage(options);\n if (usage) {\n let quotaAssignmentId: string | undefined;\n if (usage.checkQuota) {\n quotaAssignmentId = await this.checkQuota(options, usage, result);\n if (result.quotaAvailable === false) {\n result.duration = Date.now() - startTime;\n await this.logFailedActivity(options, result, startTime);\n return result;\n }\n }\n await this.trackUsage(options, usage, quotaAssignmentId, result);\n }\n\n // Step 4: Log successful activity (if enabled)\n if (options.activity?.enabled !== false) {\n await this.logSuccessActivity(options, result, startTime);\n }\n\n // Step 5: Send success notification (if configured)\n if (options.notification?.onSuccess) {\n await this.sendSuccessNotification(options, result);\n }\n\n result.success = true;\n result.duration = Date.now() - startTime;\n\n logger.info('[Tracker] Operation tracked successfully', {\n action: options.action,\n duration: result.duration,\n });\n\n return result;\n } catch (error) {\n result.duration = Date.now() - startTime;\n result.success = false;\n\n // Categorize error\n if (error instanceof PermissionDeniedError) {\n result.error = {\n type: 'permission',\n message: error.message,\n details: error.details,\n };\n } else if (error instanceof QuotaExceededError) {\n result.error = {\n type: 'quota',\n message: error.message,\n details: error.details,\n };\n } else if (error instanceof ValidationError) {\n result.error = {\n type: 'validation',\n message: error.message,\n details: error.details,\n };\n } else {\n result.error = {\n type: 'unknown',\n message: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n\n // Log failed activity\n await this.logFailedActivity(options, result, startTime);\n\n // Send failure notification (if configured)\n if (options.notification?.onFailure) {\n await this.sendFailureNotification(options, result);\n }\n\n logger.error('[Tracker] Operation tracking failed', {\n action: options.action,\n error: result.error,\n duration: result.duration,\n });\n\n return result;\n }\n }\n\n /**\n * Track operation and throw on failure\n * Convenience method that throws errors instead of returning them in result\n */\n public async trackOrThrow(options: TrackOptions): Promise<TrackResult> {\n const result = await this.track(options);\n\n if (!result.success && result.error) {\n const errorMessage = result.error.message;\n const errorDetails = result.error.details;\n\n switch (result.error.type) {\n case 'permission':\n throw new PermissionDeniedError(errorMessage, errorDetails);\n case 'quota':\n throw new QuotaExceededError(errorMessage, errorDetails);\n case 'validation':\n throw new ValidationError(errorMessage, errorDetails);\n default:\n throw new Error(errorMessage);\n }\n }\n\n return result;\n }\n\n /**\n * Simplified track method for common operations.\n * The trailing metric type is accepted for source compatibility and is not metered.\n */\n public async trackSimple(\n userId: string,\n action: string,\n resourceType: string,\n resourceId?: string,\n _metricType?: UsageMetricType\n ): Promise<boolean> {\n // A metric type has no workspace quota on the owner, so trackSimple never meters usage.\n // Call track() with `usage.quotaName` to charge a quota.\n const result = await this.track({\n userId,\n action,\n resourceType,\n resourceId,\n workspaceId: this.context.workspaceId,\n usage: { enabled: false },\n });\n\n return result.success;\n }\n\n /**\n * Validate tracking options\n */\n private validateOptions(options: TrackOptions): void {\n if (!options.userId) {\n throw new ValidationError('User ID is required');\n }\n\n if (!options.action) {\n throw new ValidationError('Action is required');\n }\n\n if (!options.resourceType) {\n throw new ValidationError('Resource type is required');\n }\n }\n\n /**\n * Check RBAC permission\n */\n private async checkPermission(options: TrackOptions, result: TrackResult): Promise<void> {\n const permissionOptions: CheckPermissionOptions = {\n userId: options.userId,\n action: options.rbac?.permissionAction || options.action,\n resourceType: options.resourceType,\n resourceId: options.resourceId,\n workspaceId: options.workspaceId,\n };\n\n const hasPermission = await this.rbac.checkPermission(permissionOptions);\n result.permissionGranted = hasPermission;\n\n if (!hasPermission) {\n result.error = {\n type: 'permission',\n message: 'Permission denied',\n details: permissionOptions as unknown as Record<string, unknown>,\n };\n }\n }\n\n /**\n * Resolve the usage step for an operation, or null when nothing is metered: usage is\n * disabled, or no workspace quota is named (a legacy `metricType` alone has no owner\n * quota to charge).\n */\n private resolveUsage(options: TrackOptions): ResolvedUsage | null {\n const usage = options.usage;\n if (!usage || usage.enabled === false) {\n return null;\n }\n const quotaName = usage.quotaName?.trim();\n if (!quotaName) {\n if (usage.metricType) {\n logger.debug('[Tracker] Usage step skipped: no quotaName for legacy metricType', {\n action: options.action,\n metricType: usage.metricType,\n });\n }\n return null;\n }\n const amount = usage.amount ?? 1;\n if (typeof amount !== 'number' || !Number.isFinite(amount) || amount === 0) {\n throw new ValidationError('Usage amount must be a finite, non-zero number');\n }\n const workspaceId = options.workspaceId ?? this.context.workspaceId;\n if (!workspaceId) {\n throw new ValidationError('Workspace ID is required to track workspace quota usage');\n }\n return {\n quotaName,\n amount,\n workspaceId,\n // Only consumption is gated; a release (negative amount) must always go through.\n checkQuota: usage.checkQuota !== false && amount > 0,\n };\n }\n\n /**\n * Check workspace quota capacity. Returns the assignment to charge when one exists.\n */\n private async checkQuota(\n options: TrackOptions,\n usage: ResolvedUsage,\n result: TrackResult\n ): Promise<string | undefined> {\n const quotaCheck = await this.usage.checkWorkspaceQuota({\n quotaName: usage.quotaName,\n amount: usage.amount,\n workspaceId: usage.workspaceId,\n userId: options.userId,\n });\n\n result.quotaAvailable = quotaCheck.allowed;\n result.quotaRemaining = quotaCheck.limitLeft ?? undefined;\n\n if (!quotaCheck.allowed) {\n const notProvisioned = quotaCheck.assignmentId === null;\n result.error = {\n type: 'quota',\n message: notProvisioned\n ? `Quota ${usage.quotaName} is not included in this workspace's plan`\n : 'Quota exceeded',\n details: {\n quotaName: usage.quotaName,\n requestedAmount: usage.amount,\n limitLeft: quotaCheck.limitLeft,\n notProvisioned,\n },\n };\n }\n\n return quotaCheck.assignmentId ?? undefined;\n }\n\n /**\n * Record workspace quota usage with the owner.\n */\n private async trackUsage(\n options: TrackOptions,\n usage: ResolvedUsage,\n quotaAssignmentId: string | undefined,\n result: TrackResult\n ): Promise<void> {\n result.usageTracked = await this.usage.trackUsage({\n quotaName: usage.quotaName,\n productId: options.usage?.productId,\n amount: usage.amount,\n description: options.usage?.description?.trim() || `${options.action} ${options.resourceType}`,\n workspaceId: usage.workspaceId,\n userId: options.userId,\n quotaAssignmentId,\n metadata: {\n action: options.action,\n resourceType: options.resourceType,\n ...(options.resourceId ? { resourceId: options.resourceId } : {}),\n },\n });\n }\n\n /**\n * Log successful activity\n */\n private async logSuccessActivity(options: TrackOptions, result: TrackResult, startTime: number): Promise<void> {\n const activityRecord = await this.activity.log({\n userId: options.userId,\n activityType: options.activity?.activityType || this.inferActivityType(options.action),\n resourceType: options.resourceType,\n resourceId: options.resourceId,\n action: options.action,\n status: ActivityStatus.SUCCESS,\n workspaceId: options.workspaceId,\n organizationId: options.organizationId,\n projectId: options.projectId,\n ipAddress: options.activity?.ipAddress,\n userAgent: options.activity?.userAgent,\n metadata: options.activity?.metadata,\n severity: options.activity?.severity || ActivitySeverity.LOW,\n duration: Date.now() - startTime,\n });\n\n result.activityId = activityRecord.id;\n }\n\n /**\n * Log failed activity\n */\n private async logFailedActivity(options: TrackOptions, result: TrackResult, startTime: number): Promise<void> {\n if (options.activity?.enabled === false) {\n return;\n }\n\n try {\n const activityRecord = await this.activity.log({\n userId: options.userId,\n activityType: options.activity?.activityType || this.inferActivityType(options.action),\n resourceType: options.resourceType,\n resourceId: options.resourceId,\n action: options.action,\n status: ActivityStatus.FAILURE,\n workspaceId: options.workspaceId,\n organizationId: options.organizationId,\n projectId: options.projectId,\n ipAddress: options.activity?.ipAddress,\n userAgent: options.activity?.userAgent,\n metadata: options.activity?.metadata,\n severity: ActivitySeverity.HIGH,\n errorMessage: result.error?.message,\n duration: Date.now() - startTime,\n });\n\n result.activityId = activityRecord.id;\n } catch (error) {\n logger.error('[Tracker] Failed to log activity', { error });\n }\n }\n\n /**\n * Send success notification\n */\n private async sendSuccessNotification(options: TrackOptions, result: TrackResult): Promise<void> {\n if (!options.notification?.onSuccess) {\n return;\n }\n\n try {\n const userIds = [options.userId, ...(options.notification.onSuccess.additionalUserIds || [])];\n\n const response = await this.notifications.send({\n title: options.notification.onSuccess.title,\n message: options.notification.onSuccess.message,\n type: options.notification.onSuccess.type || NotificationType.SUCCESS,\n userIds,\n });\n\n result.notificationIds = response.notificationIds;\n } catch (error) {\n logger.error('[Tracker] Failed to send success notification', { error });\n }\n }\n\n /**\n * Send failure notification\n */\n private async sendFailureNotification(options: TrackOptions, result: TrackResult): Promise<void> {\n if (!options.notification?.onFailure) {\n return;\n }\n\n try {\n const userIds = [options.userId, ...(options.notification.onFailure.additionalUserIds || [])];\n\n const response = await this.notifications.send({\n title: options.notification.onFailure.title,\n message: options.notification.onFailure.message,\n type: options.notification.onFailure.type || NotificationType.ERROR,\n userIds,\n });\n\n result.notificationIds = response.notificationIds;\n } catch (error) {\n logger.error('[Tracker] Failed to send failure notification', { error });\n }\n }\n\n /**\n * Infer activity type from action\n */\n private inferActivityType(action: string): ActivityType {\n const actionLower = action.toLowerCase();\n\n if (actionLower.includes('create') || actionLower.includes('add')) return ActivityType.CREATE;\n if (actionLower.includes('update') || actionLower.includes('edit')) return ActivityType.UPDATE;\n if (actionLower.includes('delete') || actionLower.includes('remove')) return ActivityType.DELETE;\n if (actionLower.includes('read') || actionLower.includes('view')) return ActivityType.READ;\n if (actionLower.includes('login')) return ActivityType.LOGIN;\n if (actionLower.includes('logout')) return ActivityType.LOGOUT;\n if (actionLower.includes('export')) return ActivityType.EXPORT;\n if (actionLower.includes('import')) return ActivityType.IMPORT;\n if (actionLower.includes('share')) return ActivityType.SHARE;\n if (actionLower.includes('download')) return ActivityType.DOWNLOAD;\n if (actionLower.includes('upload')) return ActivityType.UPLOAD;\n\n return ActivityType.CUSTOM;\n }\n\n /**\n * Batch track multiple operations\n */\n public async trackBatch(operations: TrackOptions[]): Promise<TrackResult[]> {\n logger.debug('[Tracker] Batch tracking operations', { count: operations.length });\n\n const results = await Promise.all(operations.map((op) => this.track(op)));\n\n logger.info('[Tracker] Batch tracking completed', {\n total: results.length,\n successful: results.filter((r) => r.success).length,\n failed: results.filter((r) => !r.success).length,\n });\n\n return results;\n }\n}\n\n// Export stub implementation for services that don't need full tracking\nexport {\n trackOperation,\n createProductTracker,\n UnifiedTrackerStub,\n trackerStub,\n UNIFIED_TRACKER_CONSTANTS,\n} from './stub.js';\nexport { isTrackedActorType, resolveAssistantSession } from './stub.js';\n// Assistant-session attribution on activity rows (BOFF-9649)\nexport { AI_ASSISTANT_ACTOR_ORIGIN } from '../activity/assistant-session.js';\nexport type { ActorOrigin, AssistantSessionAttribution } from '../activity/assistant-session.js';\nexport type {\n TrackingEvent,\n RbacCheckOptions,\n UsageTrackingOptions,\n ActivityTrackingOptions,\n UnifiedTrackingOptions,\n ProductTracker,\n TrackedActorType,\n} from './stub.js';\n\n// AI-agent activity actions and recorder (BOFF-9684)\nexport { AGENT_ACTIVITY_ACTIONS, AGENT_ACTIVITY_RESOURCE_TYPE, trackAgentActivity } from './agent-activity.js';\nexport type { AgentActivityAction, AgentActivityOptions } from './agent-activity.js';\n\n// Opt a resolver out of the mutation-audit backstop row (see server/mutation-audit.ts)\nexport { suppressMutationAudit } from '../activity/explicit-activity-scope.js';\n\n// Re-export UsageMetricType from usage module for convenience\nexport { UsageMetricType } from '../usage/index.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,yBAAyB,OAAO,OAAO;;CAElD,eAAe;;CAEf,YAAY;;CAEZ,aAAa;;CAEb,iBAAiB;;CAEjB,gBAAgB;AAClB,CAAU;;AAKV,MAAa,+BAA+B;AAE5C,MAAM,kCAAoD,IAAI,IAAyB,CACrF,uBAAuB,YACvB,uBAAuB,cACzB,CAAC;;;;;;;;AA+BD,SAAgB,mBAAmB,SAAiD;CAClF,MAAM,UAAU,QAAQ,WAAW,CAAC,gBAAgB,IAAI,QAAQ,MAAM;CACtE,OAAO,2BAA2B,4BAA4B,SAC5D,eAAe;EACb,eAAe,QAAQ;EACvB,QAAQ,QAAQ;EAChB,WAAW;EACX,GAAI,QAAQ,aAAa,EAAE,YAAY,QAAQ,WAAW,IAAI,CAAC;EAC/D,aAAa,QAAQ;EACrB,GAAI,QAAQ,YAAY,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;EAC5D;EACA,GAAI,QAAQ,eAAe,EAAE,cAAc,QAAQ,aAAa,IAAI,CAAC;EACrE,iBAAiB;GACf,SAAS;GACT,cAAc,QAAQ;GACtB,aAAa,QAAQ,eAAe,SAAS,QAAQ,QAAQ,IAAI,QAAQ;GACzE,aAAa,QAAQ;GACrB,cAAc,QAAQ;GACtB,YAAY,QAAQ,cAAc,QAAQ;GAC1C,UAAU;IAAE,GAAG,QAAQ;IAAU,SAAS,QAAQ;GAAQ;GAC1D,GAAI,QAAQ,YAAY,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;EAC9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,EAAE,OAAO,CAAC,CAAC;GAC7C,QAAQ,QAAQ,QAAQ,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;EAC5C,CAAC;EAED,OAAO;CACT;AACF"}
@@ -1,5 +1,5 @@
1
- import { t as BurdenoffGraphQLClient } from "../graphql-CUDyhibV.js";
2
- import { p as SDKContext } from "../index-CTTwo9av.js";
1
+ import { t as BurdenoffGraphQLClient } from "../graphql-C8jKLLel.js";
2
+ import { p as SDKContext } from "../index-BTaQMEgB.js";
3
3
  export type SupportedLanguage = 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'zh' | 'ja' | 'ko' | 'ar' | 'hi' | 'bn' | 'ta' | 'te' | 'ml';
4
4
  export interface TranslationOptions {
5
5
  text: string;
@@ -1,3 +1,3 @@
1
- import { a as DEFAULT_LAYER_RESOURCES, c as GatewayRetryConfig, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, n as DEFAULT_CIRCUIT_BREAKER_CONFIG, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, r as DEFAULT_GATEWAY_RETRY_CONFIG, s as GatewayRequestHeaders, t as CircuitBreakerConfig, u as LayerConfig } from "../layer-BZBZZWeV.js";
2
- import { _ as TemporalHealthStatus, a as EventQueueSDKConfig, c as NetworkError, d as RetryConfig, f as SDKConfig, g as SDKShutdownOptions, h as SDKHealthStatus, i as EventQueueHealthStatus, l as PermissionDeniedError, m as SDKError, n as ActorType, o as LoggerConfig, p as SDKContext, r as AuthenticationError, s as LoggerTransport, t as APIError, u as QuotaExceededError, v as TimeoutError, y as ValidationError } from "../index-CTTwo9av.js";
1
+ import { a as DEFAULT_LAYER_RESOURCES, c as GatewayRetryConfig, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, n as DEFAULT_CIRCUIT_BREAKER_CONFIG, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, r as DEFAULT_GATEWAY_RETRY_CONFIG, s as GatewayRequestHeaders, t as CircuitBreakerConfig, u as LayerConfig } from "../layer-C0zxAUgR.js";
2
+ import { _ as TemporalHealthStatus, a as EventQueueSDKConfig, c as NetworkError, d as RetryConfig, f as SDKConfig, g as SDKShutdownOptions, h as SDKHealthStatus, i as EventQueueHealthStatus, l as PermissionDeniedError, m as SDKError, n as ActorType, o as LoggerConfig, p as SDKContext, r as AuthenticationError, s as LoggerTransport, t as APIError, u as QuotaExceededError, v as TimeoutError, y as ValidationError } from "../index-BTaQMEgB.js";
3
3
  export { APIError, ActorType, AuthenticationError, type CircuitBreakerConfig, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_GATEWAY_RETRY_CONFIG, DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS, EventQueueHealthStatus, EventQueueSDKConfig, type GatewayRequestHeaders, type GatewayRetryConfig, type GatewayRoutingConfig, type LayerConfig, type LayerFullConfig, type LayerGatewayConfig, type LayerResourceUrls, LoggerConfig, LoggerTransport, NetworkError, PermissionDeniedError, QuotaExceededError, RetryConfig, SDKConfig, SDKContext, SDKError, SDKHealthStatus, SDKShutdownOptions, type ServiceLayer, TemporalHealthStatus, TimeoutError, ValidationError };
@@ -1,4 +1,4 @@
1
- import { c as GatewayRetryConfig, m as ServiceLayer, s as GatewayRequestHeaders, t as CircuitBreakerConfig } from "./layer-BZBZZWeV.js";
1
+ import { c as GatewayRetryConfig, m as ServiceLayer, s as GatewayRequestHeaders, t as CircuitBreakerConfig } from "./layer-C0zxAUgR.js";
2
2
  interface GatewayClientConfig {
3
3
  layer: ServiceLayer;
4
4
  serviceName: string;
@@ -1,2 +1,2 @@
1
- import { C as OrgBillingUsageOperationInput, S as BillingUsageOperationInput, T as WorkspaceBillingUsageOperationInput, _ as UsageSummary, a as Quota, b as BillingUsageClient, c as SetQuotaOptions, d as TrackWorkspaceUsageOptions, f as UsageEntityType, g as UsageRecord, h as UsageOperationUnsupportedError, i as GetUsageOptions, l as TRACK_USAGE_MUTATION, m as UsageModule, n as CheckQuotaOptions, o as QuotaCheckResult, p as UsageMetricType, r as CheckWorkspaceQuotaOptions, s as QuotaPeriod, t as CHECK_WORKSPACE_QUOTA_QUERY, u as TrackUsageOptions, v as WorkspaceQuotaCheckResult, w as QuotaLimit, x as BillingUsageClientConfig, y as buildTrackUsageInput } from "../index-CVCyKzhB.js";
1
+ import { C as OrgBillingUsageOperationInput, S as BillingUsageOperationInput, T as WorkspaceBillingUsageOperationInput, _ as UsageSummary, a as Quota, b as BillingUsageClient, c as SetQuotaOptions, d as TrackWorkspaceUsageOptions, f as UsageEntityType, g as UsageRecord, h as UsageOperationUnsupportedError, i as GetUsageOptions, l as TRACK_USAGE_MUTATION, m as UsageModule, n as CheckQuotaOptions, o as QuotaCheckResult, p as UsageMetricType, r as CheckWorkspaceQuotaOptions, s as QuotaPeriod, t as CHECK_WORKSPACE_QUOTA_QUERY, u as TrackUsageOptions, v as WorkspaceQuotaCheckResult, w as QuotaLimit, x as BillingUsageClientConfig, y as buildTrackUsageInput } from "../index-DWER4-_x.js";
2
2
  export { BillingUsageClient, type BillingUsageClientConfig, type BillingUsageOperationInput, CHECK_WORKSPACE_QUOTA_QUERY, CheckQuotaOptions, CheckWorkspaceQuotaOptions, GetUsageOptions, type OrgBillingUsageOperationInput, Quota, QuotaCheckResult, type QuotaLimit, QuotaPeriod, SetQuotaOptions, TRACK_USAGE_MUTATION, TrackUsageOptions, TrackWorkspaceUsageOptions, UsageEntityType, UsageMetricType, UsageModule, UsageOperationUnsupportedError, UsageRecord, UsageSummary, type WorkspaceBillingUsageOperationInput, WorkspaceQuotaCheckResult, buildTrackUsageInput };
@@ -1,4 +1,4 @@
1
- import { a as UsageModule, c as BillingUsageClient, i as UsageMetricType, n as QuotaPeriod, o as UsageOperationUnsupportedError, r as TRACK_USAGE_MUTATION, s as buildTrackUsageInput, t as CHECK_WORKSPACE_QUOTA_QUERY } from "../usage-BRqVP3CJ.js";
1
+ import { a as UsageModule, c as BillingUsageClient, i as UsageMetricType, n as QuotaPeriod, o as UsageOperationUnsupportedError, r as TRACK_USAGE_MUTATION, s as buildTrackUsageInput, t as CHECK_WORKSPACE_QUOTA_QUERY } from "../usage-ygkKsxdd.js";
2
2
 
3
3
  export { BillingUsageClient, CHECK_WORKSPACE_QUOTA_QUERY, QuotaPeriod, TRACK_USAGE_MUTATION, UsageMetricType, UsageModule, UsageOperationUnsupportedError, buildTrackUsageInput };
4
4
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import { QuotaExceededError, SDKError, ValidationError } from "./types/index.js";
2
2
  import { t as GatewayClient } from "./client-sAJTrb4i.js";
3
3
  import { a as logger } from "./logger-B6rCpb7D.js";
4
- import "./gateway-ByVo-n37.js";
4
+ import "./gateway-2en8Gx_a.js";
5
5
  import { randomUUID } from "node:crypto";
6
6
 
7
7
  // src/usage/billing.ts
@@ -679,4 +679,4 @@ var UsageModule = class {
679
679
  };
680
680
 
681
681
  export { UsageModule as a, BillingUsageClient as c, UsageMetricType as i, QuotaPeriod as n, UsageOperationUnsupportedError as o, TRACK_USAGE_MUTATION as r, buildTrackUsageInput as s, CHECK_WORKSPACE_QUOTA_QUERY as t };
682
- //# sourceMappingURL=usage-BRqVP3CJ.js.map
682
+ //# sourceMappingURL=usage-ygkKsxdd.js.map