pgbeam 0.4.2 → 0.4.8

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.
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
 
3
- var operationsMap_gen = require('./operations-map.gen-c7vqzfzd.cjs');
3
+ var operationsMap_gen = require('./operations-map.gen-gco09oqg.cjs');
4
4
 
5
5
  /**
6
6
  * Generated by generate-sdk-ts-maps.ts from backend/openapi/bundles/public.yaml — do not edit manually.
@@ -208,7 +208,7 @@ var operationsMap_gen = require('./operations-map.gen-c7vqzfzd.cjs');
208
208
  ],
209
209
  "requestBodyType": "{ limit?: number; lookback_days?: number }",
210
210
  "requestBodyRequired": false,
211
- "responseType": "{ candidate?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; message?: string; notes?: string[]; observed_entries: number; observed_queries: number; replay?: { items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }; sufficient_history: boolean; window_end: string; window_start: string }",
211
+ "responseType": "{ candidate?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; message?: string; notes?: string[]; observed_entries: number; observed_queries: number; replay?: { items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { bound_credentials?: number; distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; traffic_scope: \"project\" | \"bound_credentials\"; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }; sufficient_history: boolean; window_end: string; window_start: string }",
212
212
  "responseStatus": "200"
213
213
  },
214
214
  "listAnomalyAlerts": {
@@ -512,6 +512,47 @@ var operationsMap_gen = require('./operations-map.gen-c7vqzfzd.cjs');
512
512
  "responseType": "",
513
513
  "responseStatus": "200"
514
514
  },
515
+ "getAuditSessionSummary": {
516
+ "operationId": "getAuditSessionSummary",
517
+ "method": "GET",
518
+ "path": "/v1/projects/{project_id}/audit-logs/sessions/{session_id}",
519
+ "summary": "Summarize one agent session",
520
+ "description": "Groups a session's audit entries into one deterministic summary: the credentials and origins involved, the window it spans, how many statements were allowed, blocked, masked and truncated, the rows and bytes it moved, and the tables it read, wrote and was refused. No model is involved, so the same entries always summarize the same way. Returns metadata only (table names and counts), never row values, and requires the same audit:read permission the list and export endpoints do.",
521
+ "parameters": [
522
+ {
523
+ "name": "project_id",
524
+ "in": "path",
525
+ "required": true,
526
+ "type": "string",
527
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
528
+ },
529
+ {
530
+ "name": "session_id",
531
+ "in": "path",
532
+ "required": true,
533
+ "type": "string",
534
+ "description": "Session identifier from an audit entry's session_id field. Unique per connection within a proxy instance, not over time."
535
+ },
536
+ {
537
+ "name": "start",
538
+ "in": "query",
539
+ "required": false,
540
+ "type": "string",
541
+ "description": "Return entries at or after this timestamp (inclusive lower bound)."
542
+ },
543
+ {
544
+ "name": "end",
545
+ "in": "query",
546
+ "required": false,
547
+ "type": "string",
548
+ "description": "Return entries strictly older than this timestamp (cursor / upper bound)."
549
+ }
550
+ ],
551
+ "requestBodyType": "",
552
+ "requestBodyRequired": false,
553
+ "responseType": "{ allowed: number; blocked: number; bytes_out: number; credential_ids: string[]; duration_ms: number; ended_at: string; entries_scanned: number; latency_ms_total: number; masked: number; other: number; project_id: string; rows_returned: number; scan_truncated: boolean; session_id: string; sources: string[]; started_at: string; statements: number; tables_blocked: string[]; tables_read: string[]; tables_written: string[]; truncated: number; unparsed_statements: number }",
554
+ "responseStatus": "200"
555
+ },
515
556
  "verifyAuditChain": {
516
557
  "operationId": "verifyAuditChain",
517
558
  "method": "GET",
@@ -543,7 +584,7 @@ var operationsMap_gen = require('./operations-map.gen-c7vqzfzd.cjs');
543
584
  ],
544
585
  "requestBodyType": "",
545
586
  "requestBodyRequired": false,
546
- "responseType": "{ chain_end_seq?: number; chain_start_seq?: number; failure_reason?: string; first_broken_seq?: number; ok: boolean; unchained_count: number; verified_at: string; verified_count: number }",
587
+ "responseType": "{ anchor_status?: string; anchor_verified_from_seq?: number; anchor_verified_through_seq?: number; chain_end_seq?: number; chain_start_seq?: number; failure_reason?: string; first_broken_seq?: number; keyed_count: number; link_status?: string; link_verified_from_seq?: number; ok: boolean; unchained_count: number; verified_at: string; verified_count: number }",
547
588
  "responseStatus": "200"
548
589
  },
549
590
  "listPlans": {
@@ -1528,9 +1569,9 @@ var operationsMap_gen = require('./operations-map.gen-c7vqzfzd.cjs');
1528
1569
  "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1529
1570
  }
1530
1571
  ],
1531
- "requestBodyType": "{ credential_id?: string; end_ts?: string; limit?: number; policy?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; policy_id?: string; start_ts?: string }",
1572
+ "requestBodyType": "{ bound_policy_id?: string; credential_id?: string; end_ts?: string; limit?: number; policy?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; policy_id?: string; start_ts?: string }",
1532
1573
  "requestBodyRequired": true,
1533
- "responseType": "{ items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }",
1574
+ "responseType": "{ items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { bound_credentials?: number; distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; traffic_scope: \"project\" | \"bound_credentials\"; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }",
1534
1575
  "responseStatus": "200"
1535
1576
  },
1536
1577
  "listProjects": {
@@ -2177,6 +2218,40 @@ var operationsMap_gen = require('./operations-map.gen-c7vqzfzd.cjs');
2177
2218
  "responseType": "{ usage: ({ bytes_transferred: number; cache_hits: number; cache_misses: number; connection_seconds: number; day: string; queries_total: number; region: string })[] }",
2178
2219
  "responseStatus": "200"
2179
2220
  },
2221
+ "getAgentUsageBreakdown": {
2222
+ "operationId": "getAgentUsageBreakdown",
2223
+ "method": "GET",
2224
+ "path": "/v1/projects/{project_id}/usage/agents",
2225
+ "summary": "Break down project usage by agent credential",
2226
+ "description": "Aggregates the audit trail into per-agent usage for a window: statements by decision, rows and bytes returned, the cache outcome breakdown, and latency percentiles. Read-only, derived entirely from entries the gateway already records.\n\nGrouped by credential, not by session. `session_id` is 32 bits of randomness minted per connection, so it identifies a connection rather than an agent or a run, and at scale it collides; the credential is the only stable identity in the trail.\n\nThis endpoint reports usage and deliberately attributes no dollar figure to an agent. Overage is computed on the organization's total against a plan limit, so no single agent causes it independently of the others, and any per-agent split of that bill is a policy choice rather than a measurement. The organization's limits and marginal rates are returned alongside the usage so a caller can apply its own policy, with both meanings of a zero limit already resolved.\n\nThree things are reported rather than assumed. Usage recorded against no credential is its own line, so agents plus unattributed equals totals exactly. Latency covers only entries that ran and carried a finite value: every refusal writes a literal zero because there was nothing to time, and counting those would drag an agent's percentiles toward zero in proportion to how often it was refused, so the heavily blocked agent would report the fastest queries. And gap markers left by undelivered entries set `complete` to false, since a total over a trail with holes in it is a floor, not a measurement.\n\nBoth `start` and `end` are optional. Omitting `end` means now; omitting `start` means 30 days before the end. The window is half-open and is capped at 92 days, because this aggregate reads every row in the window on the request path and an unbounded one would sort a year of latencies per group. `requested_start` and `requested_end` echo the window that was actually used, so a caller that pinned neither still knows what the totals cover.",
2227
+ "parameters": [
2228
+ {
2229
+ "name": "project_id",
2230
+ "in": "path",
2231
+ "required": true,
2232
+ "type": "string",
2233
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
2234
+ },
2235
+ {
2236
+ "name": "start",
2237
+ "in": "query",
2238
+ "required": false,
2239
+ "type": "string",
2240
+ "description": "Return entries at or after this timestamp (inclusive lower bound)."
2241
+ },
2242
+ {
2243
+ "name": "end",
2244
+ "in": "query",
2245
+ "required": false,
2246
+ "type": "string",
2247
+ "description": "Return entries strictly older than this timestamp (cursor / upper bound)."
2248
+ }
2249
+ ],
2250
+ "requestBodyType": "",
2251
+ "requestBodyRequired": false,
2252
+ "responseType": "{ agents: ({ allowed: number; blocked: number; bytes_out: number; cache_bypass: number; cache_hit: number; cache_miss: number; cache_none: number; cache_stale: number; credential_id?: string; entries: number; first_seen?: string; last_seen?: string; latency_measured: number; latency_ms_total: number; latency_p50_ms: number; latency_p95_ms: number; latency_p99_ms: number; latency_unmeasured: number; masked: number; rows_returned: number; truncated: number })[]; complete: boolean; drop_markers: { entries_dropped: number; markers: number; markers_unparsed: number; reasons: string[]; truncated: boolean }; marginal_rates: { bytes_overage_billable: boolean; bytes_per_month: number; overage_per_1k_queries: number; overage_per_gb: number; plan: string; queries_per_day: number; query_overage_billable: boolean }; project_id: string; requested_end: string; requested_start: string; totals: { allowed: number; blocked: number; bytes_out: number; cache_bypass: number; cache_hit: number; cache_miss: number; cache_none: number; cache_stale: number; credential_id?: string; entries: number; first_seen?: string; last_seen?: string; latency_measured: number; latency_ms_total: number; latency_p50_ms: number; latency_p95_ms: number; latency_p99_ms: number; latency_unmeasured: number; masked: number; rows_returned: number; truncated: number }; unattributed: { allowed: number; blocked: number; bytes_out: number; cache_bypass: number; cache_hit: number; cache_miss: number; cache_none: number; cache_stale: number; credential_id?: string; entries: number; first_seen?: string; last_seen?: string; latency_measured: number; latency_ms_total: number; latency_p50_ms: number; latency_p95_ms: number; latency_p99_ms: number; latency_unmeasured: number; masked: number; rows_returned: number; truncated: number }; window_end: string; window_start: string }",
2253
+ "responseStatus": "200"
2254
+ },
2180
2255
  "listWebhookEndpoints": {
2181
2256
  "operationId": "listWebhookEndpoints",
2182
2257
  "method": "GET",
@@ -1,4 +1,4 @@
1
- export { qQ as ApiOperations, qR as ApiTag, qS as RequestMap, qT as Route, qU as operationsByPath, qV as operationsByTag } from './operations-map.gen-ihvz917v.js';
1
+ export { qd as ApiOperations, qe as ApiTag, qf as RequestMap, qg as Route, qh as operationsByPath, qi as operationsByTag } from './operations-map.gen-oqab3wi9.js';
2
2
 
3
3
  /**
4
4
  * Generated by generate-sdk-ts-maps.ts from backend/openapi/bundles/public.yaml — do not edit manually.
@@ -1,4 +1,4 @@
1
- export { qQ as ApiOperations, qR as ApiTag, qS as RequestMap, qT as Route, qU as operationsByPath, qV as operationsByTag } from './operations-map.gen-ihvz917v.js';
1
+ export { qd as ApiOperations, qe as ApiTag, qf as RequestMap, qg as Route, qh as operationsByPath, qi as operationsByTag } from './operations-map.gen-oqab3wi9.js';
2
2
 
3
3
  /**
4
4
  * Generated by generate-sdk-ts-maps.ts from backend/openapi/bundles/public.yaml — do not edit manually.
@@ -1,4 +1,4 @@
1
- export { o as operationsByPath, a as operationsByTag } from './operations-map.gen-g44nmkz5.js';
1
+ export { o as operationsByPath, a as operationsByTag } from './operations-map.gen-dojer3ji.js';
2
2
 
3
3
  /**
4
4
  * Generated by generate-sdk-ts-maps.ts from backend/openapi/bundles/public.yaml — do not edit manually.
@@ -206,7 +206,7 @@ export { o as operationsByPath, a as operationsByTag } from './operations-map.ge
206
206
  ],
207
207
  "requestBodyType": "{ limit?: number; lookback_days?: number }",
208
208
  "requestBodyRequired": false,
209
- "responseType": "{ candidate?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; message?: string; notes?: string[]; observed_entries: number; observed_queries: number; replay?: { items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }; sufficient_history: boolean; window_end: string; window_start: string }",
209
+ "responseType": "{ candidate?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; message?: string; notes?: string[]; observed_entries: number; observed_queries: number; replay?: { items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { bound_credentials?: number; distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; traffic_scope: \"project\" | \"bound_credentials\"; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }; sufficient_history: boolean; window_end: string; window_start: string }",
210
210
  "responseStatus": "200"
211
211
  },
212
212
  "listAnomalyAlerts": {
@@ -510,6 +510,47 @@ export { o as operationsByPath, a as operationsByTag } from './operations-map.ge
510
510
  "responseType": "",
511
511
  "responseStatus": "200"
512
512
  },
513
+ "getAuditSessionSummary": {
514
+ "operationId": "getAuditSessionSummary",
515
+ "method": "GET",
516
+ "path": "/v1/projects/{project_id}/audit-logs/sessions/{session_id}",
517
+ "summary": "Summarize one agent session",
518
+ "description": "Groups a session's audit entries into one deterministic summary: the credentials and origins involved, the window it spans, how many statements were allowed, blocked, masked and truncated, the rows and bytes it moved, and the tables it read, wrote and was refused. No model is involved, so the same entries always summarize the same way. Returns metadata only (table names and counts), never row values, and requires the same audit:read permission the list and export endpoints do.",
519
+ "parameters": [
520
+ {
521
+ "name": "project_id",
522
+ "in": "path",
523
+ "required": true,
524
+ "type": "string",
525
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
526
+ },
527
+ {
528
+ "name": "session_id",
529
+ "in": "path",
530
+ "required": true,
531
+ "type": "string",
532
+ "description": "Session identifier from an audit entry's session_id field. Unique per connection within a proxy instance, not over time."
533
+ },
534
+ {
535
+ "name": "start",
536
+ "in": "query",
537
+ "required": false,
538
+ "type": "string",
539
+ "description": "Return entries at or after this timestamp (inclusive lower bound)."
540
+ },
541
+ {
542
+ "name": "end",
543
+ "in": "query",
544
+ "required": false,
545
+ "type": "string",
546
+ "description": "Return entries strictly older than this timestamp (cursor / upper bound)."
547
+ }
548
+ ],
549
+ "requestBodyType": "",
550
+ "requestBodyRequired": false,
551
+ "responseType": "{ allowed: number; blocked: number; bytes_out: number; credential_ids: string[]; duration_ms: number; ended_at: string; entries_scanned: number; latency_ms_total: number; masked: number; other: number; project_id: string; rows_returned: number; scan_truncated: boolean; session_id: string; sources: string[]; started_at: string; statements: number; tables_blocked: string[]; tables_read: string[]; tables_written: string[]; truncated: number; unparsed_statements: number }",
552
+ "responseStatus": "200"
553
+ },
513
554
  "verifyAuditChain": {
514
555
  "operationId": "verifyAuditChain",
515
556
  "method": "GET",
@@ -541,7 +582,7 @@ export { o as operationsByPath, a as operationsByTag } from './operations-map.ge
541
582
  ],
542
583
  "requestBodyType": "",
543
584
  "requestBodyRequired": false,
544
- "responseType": "{ chain_end_seq?: number; chain_start_seq?: number; failure_reason?: string; first_broken_seq?: number; ok: boolean; unchained_count: number; verified_at: string; verified_count: number }",
585
+ "responseType": "{ anchor_status?: string; anchor_verified_from_seq?: number; anchor_verified_through_seq?: number; chain_end_seq?: number; chain_start_seq?: number; failure_reason?: string; first_broken_seq?: number; keyed_count: number; link_status?: string; link_verified_from_seq?: number; ok: boolean; unchained_count: number; verified_at: string; verified_count: number }",
545
586
  "responseStatus": "200"
546
587
  },
547
588
  "listPlans": {
@@ -1526,9 +1567,9 @@ export { o as operationsByPath, a as operationsByTag } from './operations-map.ge
1526
1567
  "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1527
1568
  }
1528
1569
  ],
1529
- "requestBodyType": "{ credential_id?: string; end_ts?: string; limit?: number; policy?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; policy_id?: string; start_ts?: string }",
1570
+ "requestBodyType": "{ bound_policy_id?: string; credential_id?: string; end_ts?: string; limit?: number; policy?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; policy_id?: string; start_ts?: string }",
1530
1571
  "requestBodyRequired": true,
1531
- "responseType": "{ items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }",
1572
+ "responseType": "{ items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { bound_credentials?: number; distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; traffic_scope: \"project\" | \"bound_credentials\"; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }",
1532
1573
  "responseStatus": "200"
1533
1574
  },
1534
1575
  "listProjects": {
@@ -2175,6 +2216,40 @@ export { o as operationsByPath, a as operationsByTag } from './operations-map.ge
2175
2216
  "responseType": "{ usage: ({ bytes_transferred: number; cache_hits: number; cache_misses: number; connection_seconds: number; day: string; queries_total: number; region: string })[] }",
2176
2217
  "responseStatus": "200"
2177
2218
  },
2219
+ "getAgentUsageBreakdown": {
2220
+ "operationId": "getAgentUsageBreakdown",
2221
+ "method": "GET",
2222
+ "path": "/v1/projects/{project_id}/usage/agents",
2223
+ "summary": "Break down project usage by agent credential",
2224
+ "description": "Aggregates the audit trail into per-agent usage for a window: statements by decision, rows and bytes returned, the cache outcome breakdown, and latency percentiles. Read-only, derived entirely from entries the gateway already records.\n\nGrouped by credential, not by session. `session_id` is 32 bits of randomness minted per connection, so it identifies a connection rather than an agent or a run, and at scale it collides; the credential is the only stable identity in the trail.\n\nThis endpoint reports usage and deliberately attributes no dollar figure to an agent. Overage is computed on the organization's total against a plan limit, so no single agent causes it independently of the others, and any per-agent split of that bill is a policy choice rather than a measurement. The organization's limits and marginal rates are returned alongside the usage so a caller can apply its own policy, with both meanings of a zero limit already resolved.\n\nThree things are reported rather than assumed. Usage recorded against no credential is its own line, so agents plus unattributed equals totals exactly. Latency covers only entries that ran and carried a finite value: every refusal writes a literal zero because there was nothing to time, and counting those would drag an agent's percentiles toward zero in proportion to how often it was refused, so the heavily blocked agent would report the fastest queries. And gap markers left by undelivered entries set `complete` to false, since a total over a trail with holes in it is a floor, not a measurement.\n\nBoth `start` and `end` are optional. Omitting `end` means now; omitting `start` means 30 days before the end. The window is half-open and is capped at 92 days, because this aggregate reads every row in the window on the request path and an unbounded one would sort a year of latencies per group. `requested_start` and `requested_end` echo the window that was actually used, so a caller that pinned neither still knows what the totals cover.",
2225
+ "parameters": [
2226
+ {
2227
+ "name": "project_id",
2228
+ "in": "path",
2229
+ "required": true,
2230
+ "type": "string",
2231
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
2232
+ },
2233
+ {
2234
+ "name": "start",
2235
+ "in": "query",
2236
+ "required": false,
2237
+ "type": "string",
2238
+ "description": "Return entries at or after this timestamp (inclusive lower bound)."
2239
+ },
2240
+ {
2241
+ "name": "end",
2242
+ "in": "query",
2243
+ "required": false,
2244
+ "type": "string",
2245
+ "description": "Return entries strictly older than this timestamp (cursor / upper bound)."
2246
+ }
2247
+ ],
2248
+ "requestBodyType": "",
2249
+ "requestBodyRequired": false,
2250
+ "responseType": "{ agents: ({ allowed: number; blocked: number; bytes_out: number; cache_bypass: number; cache_hit: number; cache_miss: number; cache_none: number; cache_stale: number; credential_id?: string; entries: number; first_seen?: string; last_seen?: string; latency_measured: number; latency_ms_total: number; latency_p50_ms: number; latency_p95_ms: number; latency_p99_ms: number; latency_unmeasured: number; masked: number; rows_returned: number; truncated: number })[]; complete: boolean; drop_markers: { entries_dropped: number; markers: number; markers_unparsed: number; reasons: string[]; truncated: boolean }; marginal_rates: { bytes_overage_billable: boolean; bytes_per_month: number; overage_per_1k_queries: number; overage_per_gb: number; plan: string; queries_per_day: number; query_overage_billable: boolean }; project_id: string; requested_end: string; requested_start: string; totals: { allowed: number; blocked: number; bytes_out: number; cache_bypass: number; cache_hit: number; cache_miss: number; cache_none: number; cache_stale: number; credential_id?: string; entries: number; first_seen?: string; last_seen?: string; latency_measured: number; latency_ms_total: number; latency_p50_ms: number; latency_p95_ms: number; latency_p99_ms: number; latency_unmeasured: number; masked: number; rows_returned: number; truncated: number }; unattributed: { allowed: number; blocked: number; bytes_out: number; cache_bypass: number; cache_hit: number; cache_miss: number; cache_none: number; cache_stale: number; credential_id?: string; entries: number; first_seen?: string; last_seen?: string; latency_measured: number; latency_ms_total: number; latency_p50_ms: number; latency_p95_ms: number; latency_p99_ms: number; latency_unmeasured: number; masked: number; rows_returned: number; truncated: number }; window_end: string; window_start: string }",
2251
+ "responseStatus": "200"
2252
+ },
2178
2253
  "listWebhookEndpoints": {
2179
2254
  "operationId": "listWebhookEndpoints",
2180
2255
  "method": "GET",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pgbeam",
3
- "version": "0.4.2",
4
- "description": "TypeScript SDK for the PgBeam API — globally distributed PostgreSQL proxy platform",
3
+ "version": "0.4.8",
4
+ "description": "TypeScript SDK for the PgBeam API, a Postgres proxy for safe AI agent access with policy enforcement in the wire protocol",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./package.json": "./package.json",
@@ -47,14 +47,14 @@
47
47
  ],
48
48
  "homepage": "https://pgbeam.com",
49
49
  "devDependencies": {
50
- "@kubb/adapter-oas": "5.0.0-beta.11",
50
+ "@kubb/adapter-oas": "5.0.6",
51
51
  "@kubb/middleware-barrel": "5.0.0-beta.35",
52
- "@kubb/plugin-ts": "5.0.0-beta.10",
52
+ "@kubb/plugin-ts": "5.0.0",
53
+ "@pgbeam/config": "0.0.1",
53
54
  "@typescript/typescript6": "6.0.2",
54
55
  "bunchee": "7.0.1",
55
- "kubb": "5.0.0-beta.11",
56
- "typescript": "7.0.2",
57
- "@pgbeam/config": "0.0.1"
56
+ "kubb": "5.0.6",
57
+ "typescript": "7.0.2"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "bunchee",