veto-sdk 2.0.0 → 2.2.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 (121) hide show
  1. package/dist/browser/index.d.ts +1 -1
  2. package/dist/browser/index.d.ts.map +1 -1
  3. package/dist/browser/index.js.map +1 -1
  4. package/dist/browser/protect.d.ts.map +1 -1
  5. package/dist/browser/protect.js +9 -1
  6. package/dist/browser/protect.js.map +1 -1
  7. package/dist/browser/types.d.ts +20 -1
  8. package/dist/browser/types.d.ts.map +1 -1
  9. package/dist/browser/veto.d.ts +10 -0
  10. package/dist/browser/veto.d.ts.map +1 -1
  11. package/dist/browser/veto.js +77 -4
  12. package/dist/browser/veto.js.map +1 -1
  13. package/dist/cloud/types.d.ts +17 -2
  14. package/dist/cloud/types.d.ts.map +1 -1
  15. package/dist/compiler/evaluator.d.ts.map +1 -1
  16. package/dist/compiler/evaluator.js +6 -0
  17. package/dist/compiler/evaluator.js.map +1 -1
  18. package/dist/core/events.d.ts +13 -1
  19. package/dist/core/events.d.ts.map +1 -1
  20. package/dist/core/events.js +37 -4
  21. package/dist/core/events.js.map +1 -1
  22. package/dist/core/protect.d.ts +7 -1
  23. package/dist/core/protect.d.ts.map +1 -1
  24. package/dist/core/protect.js +23 -5
  25. package/dist/core/protect.js.map +1 -1
  26. package/dist/core/veto.d.ts +43 -1
  27. package/dist/core/veto.d.ts.map +1 -1
  28. package/dist/core/veto.js +256 -13
  29. package/dist/core/veto.js.map +1 -1
  30. package/dist/deterministic/regex-safety.d.ts.map +1 -1
  31. package/dist/deterministic/regex-safety.js +42 -1
  32. package/dist/deterministic/regex-safety.js.map +1 -1
  33. package/dist/deterministic/types.d.ts +103 -0
  34. package/dist/deterministic/types.d.ts.map +1 -1
  35. package/dist/economic/budget-engine.d.ts +29 -0
  36. package/dist/economic/budget-engine.d.ts.map +1 -0
  37. package/dist/economic/budget-engine.js +146 -0
  38. package/dist/economic/budget-engine.js.map +1 -0
  39. package/dist/economic/connectors/ap2.d.ts +51 -0
  40. package/dist/economic/connectors/ap2.d.ts.map +1 -0
  41. package/dist/economic/connectors/ap2.js +133 -0
  42. package/dist/economic/connectors/ap2.js.map +1 -0
  43. package/dist/economic/connectors/index.d.ts +8 -0
  44. package/dist/economic/connectors/index.d.ts.map +1 -0
  45. package/dist/economic/connectors/index.js +8 -0
  46. package/dist/economic/connectors/index.js.map +1 -0
  47. package/dist/economic/connectors/mpp.d.ts +41 -0
  48. package/dist/economic/connectors/mpp.d.ts.map +1 -0
  49. package/dist/economic/connectors/mpp.js +97 -0
  50. package/dist/economic/connectors/mpp.js.map +1 -0
  51. package/dist/economic/connectors/x402.d.ts +20 -0
  52. package/dist/economic/connectors/x402.d.ts.map +1 -0
  53. package/dist/economic/connectors/x402.js +142 -0
  54. package/dist/economic/connectors/x402.js.map +1 -0
  55. package/dist/economic/evaluator.d.ts +77 -0
  56. package/dist/economic/evaluator.d.ts.map +1 -0
  57. package/dist/economic/evaluator.js +231 -0
  58. package/dist/economic/evaluator.js.map +1 -0
  59. package/dist/economic/index.d.ts +13 -0
  60. package/dist/economic/index.d.ts.map +1 -0
  61. package/dist/economic/index.js +15 -0
  62. package/dist/economic/index.js.map +1 -0
  63. package/dist/economic/types.d.ts +188 -0
  64. package/dist/economic/types.d.ts.map +1 -0
  65. package/dist/economic/types.js +10 -0
  66. package/dist/economic/types.js.map +1 -0
  67. package/dist/extractors/content.d.ts +42 -0
  68. package/dist/extractors/content.d.ts.map +1 -0
  69. package/dist/extractors/content.js +171 -0
  70. package/dist/extractors/content.js.map +1 -0
  71. package/dist/extractors/index.d.ts +7 -0
  72. package/dist/extractors/index.d.ts.map +1 -0
  73. package/dist/extractors/index.js +7 -0
  74. package/dist/extractors/index.js.map +1 -0
  75. package/dist/index.d.ts +9 -3
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +10 -2
  78. package/dist/index.js.map +1 -1
  79. package/dist/policy/generator.d.ts +110 -0
  80. package/dist/policy/generator.d.ts.map +1 -0
  81. package/dist/policy/generator.js +465 -0
  82. package/dist/policy/generator.js.map +1 -0
  83. package/dist/policy/index.d.ts +7 -0
  84. package/dist/policy/index.d.ts.map +1 -0
  85. package/dist/policy/index.js +7 -0
  86. package/dist/policy/index.js.map +1 -0
  87. package/dist/providers/adapters.d.ts +27 -0
  88. package/dist/providers/adapters.d.ts.map +1 -1
  89. package/dist/providers/adapters.js +58 -0
  90. package/dist/providers/adapters.js.map +1 -1
  91. package/dist/rules/condition-evaluator.d.ts +6 -0
  92. package/dist/rules/condition-evaluator.d.ts.map +1 -1
  93. package/dist/rules/condition-evaluator.js +60 -18
  94. package/dist/rules/condition-evaluator.js.map +1 -1
  95. package/dist/rules/expression-validator.d.ts.map +1 -1
  96. package/dist/rules/expression-validator.js +5 -0
  97. package/dist/rules/expression-validator.js.map +1 -1
  98. package/dist/rules/index.d.ts +1 -0
  99. package/dist/rules/index.d.ts.map +1 -1
  100. package/dist/rules/index.js +1 -0
  101. package/dist/rules/index.js.map +1 -1
  102. package/dist/rules/local-evaluator.d.ts +65 -0
  103. package/dist/rules/local-evaluator.d.ts.map +1 -0
  104. package/dist/rules/local-evaluator.js +250 -0
  105. package/dist/rules/local-evaluator.js.map +1 -0
  106. package/dist/rules/policy-ir-schema.d.ts +109 -0
  107. package/dist/rules/policy-ir-schema.d.ts.map +1 -1
  108. package/dist/rules/policy-ir-schema.js +90 -0
  109. package/dist/rules/policy-ir-schema.js.map +1 -1
  110. package/dist/rules/policy-packs.d.ts.map +1 -1
  111. package/dist/rules/policy-packs.js +1 -0
  112. package/dist/rules/policy-packs.js.map +1 -1
  113. package/dist/types/config.d.ts +2 -1
  114. package/dist/types/config.d.ts.map +1 -1
  115. package/dist/types/config.js.map +1 -1
  116. package/dist/utils/logger.d.ts +38 -2
  117. package/dist/utils/logger.d.ts.map +1 -1
  118. package/dist/utils/logger.js +231 -26
  119. package/dist/utils/logger.js.map +1 -1
  120. package/package.json +27 -12
  121. package/packs/economic-agent.yaml +62 -0
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Economic authorization types.
3
+ *
4
+ * Protocol-agnostic types for cost-aware agent authorization
5
+ * across x402, Stripe MPP, Google AP2, and custom protocols.
6
+ *
7
+ * @module economic/types
8
+ */
9
+ /**
10
+ * Supported payment protocols.
11
+ */
12
+ export type EconomicProtocol = 'x402' | 'mpp' | 'ap2' | 'custom';
13
+ /**
14
+ * Normalized economic context produced by protocol connectors.
15
+ *
16
+ * This is the single interface between connectors and the policy engine.
17
+ * Connectors parse protocol-specific responses into this shape;
18
+ * the policy engine evaluates it without knowing which protocol produced it.
19
+ */
20
+ export interface EconomicContext {
21
+ /** Resolved cost of this action in the budget currency */
22
+ cost: number;
23
+ /** Currency code (USD, EUR, etc.) */
24
+ currency: string;
25
+ /** Identified payer (wallet address, Stripe customer, mandate signer) */
26
+ payer?: string;
27
+ /** Which payment protocol produced this context */
28
+ protocol: EconomicProtocol;
29
+ /** Protocol-specific metadata (chain, token, mandate ID, session ID, etc.) */
30
+ protocol_metadata?: Record<string, unknown>;
31
+ }
32
+ /**
33
+ * Denial reason codes for economic authorization failures.
34
+ */
35
+ export type EconomicDenialReason = 'budget_exceeded' | 'approval_required' | 'payer_missing' | 'payer_unauthorized' | 'currency_mismatch' | 'invalid_cost' | 'connector_error';
36
+ /**
37
+ * Machine-readable details for economic authorization denials.
38
+ *
39
+ * Attached to GuardResult when an economic policy denies a tool call.
40
+ * Enables developers to programmatically handle different denial types.
41
+ */
42
+ export interface EconomicDenialDetails {
43
+ reason: EconomicDenialReason;
44
+ cost: number;
45
+ currency: string;
46
+ budget_scope: string;
47
+ budget_limit: number;
48
+ budget_spent: number;
49
+ budget_remaining: number;
50
+ /** The approval threshold that was exceeded (for approval_required denials) */
51
+ approval_threshold?: number;
52
+ payer?: string;
53
+ protocol?: string;
54
+ /** Rendered denial message from template (if configured) */
55
+ message?: string;
56
+ /** Connector name + raw error for connector_error reason */
57
+ connector_name?: string;
58
+ raw_error?: string;
59
+ }
60
+ /**
61
+ * Budget scope levels.
62
+ *
63
+ * - session: in-memory, SDK-only (LocalBudgetEngine)
64
+ * - agent/user/global: require platform (CloudBudgetEngine via Convex)
65
+ */
66
+ export type BudgetScope = 'session' | 'agent' | 'user' | 'global';
67
+ /**
68
+ * Budget configuration from policy YAML.
69
+ */
70
+ export interface EconomicBudgetConfig {
71
+ scope: BudgetScope;
72
+ limit: number;
73
+ currency: string;
74
+ /** Require approval above this amount (within budget) */
75
+ approval_threshold?: number;
76
+ /** Budget window — 'session' for SDK-only, timed windows require platform */
77
+ window: 'session' | '1h' | '24h' | '30d';
78
+ }
79
+ /**
80
+ * Cost extraction configuration from policy YAML.
81
+ */
82
+ export interface CostExtractionConfig {
83
+ /** Default dot-path to extract cost from tool call context */
84
+ default: string;
85
+ /** Per-tool overrides */
86
+ overrides?: Record<string, string>;
87
+ }
88
+ /**
89
+ * Payer validation configuration from policy YAML.
90
+ */
91
+ export interface PayerConfig {
92
+ /** Block if no payer identified */
93
+ required: boolean;
94
+ /** Optional payer allowlist */
95
+ approved?: string[];
96
+ }
97
+ /**
98
+ * Custom denial message templates.
99
+ */
100
+ export interface DenialReasonTemplates {
101
+ budget_exceeded?: string;
102
+ approval_required?: string;
103
+ payer_missing?: string;
104
+ payer_unauthorized?: string;
105
+ }
106
+ /**
107
+ * Top-level economic policy configuration from YAML.
108
+ */
109
+ export interface EconomicPolicyConfig {
110
+ budgets?: EconomicBudgetConfig[];
111
+ cost_extraction?: CostExtractionConfig;
112
+ payer?: PayerConfig;
113
+ denial_reasons?: DenialReasonTemplates;
114
+ }
115
+ /**
116
+ * Result of a budget check.
117
+ *
118
+ * Return-based (not throw-based) to compose cleanly with guard() flow.
119
+ */
120
+ export interface BudgetCheckResult {
121
+ allowed: boolean;
122
+ decision: 'allow' | 'deny' | 'require_approval';
123
+ denial?: EconomicDenialDetails;
124
+ }
125
+ /**
126
+ * Current budget status for a scope.
127
+ */
128
+ export interface EconomicBudgetStatus {
129
+ scope: BudgetScope;
130
+ spent: number;
131
+ limit: number;
132
+ remaining: number;
133
+ currency: string;
134
+ }
135
+ /**
136
+ * Budget engine interface.
137
+ *
138
+ * SDK defines the contract; implementations vary by deployment:
139
+ * - LocalBudgetEngine: in-memory, session scope only
140
+ * - CloudBudgetEngine: Convex-backed, all scopes (platform)
141
+ *
142
+ * BudgetEngine (interface)
143
+ * ├── LocalBudgetEngine (SDK, in-memory, session scope only)
144
+ * └── CloudBudgetEngine (platform, Convex-backed, all scopes)
145
+ */
146
+ export interface BudgetEngine {
147
+ /** Check if a cost is within budget and below approval threshold */
148
+ check(cost: number, currency: string, scope: BudgetScope): BudgetCheckResult;
149
+ /** Reserve budget (atomic check + deduct) */
150
+ reserve(cost: number, currency: string, scope: BudgetScope): BudgetCheckResult;
151
+ /** Record a committed charge */
152
+ record(cost: number, currency: string, scope: BudgetScope): void;
153
+ /** Refund a previously reserved/recorded amount */
154
+ refund(amount: number, scope: BudgetScope): void;
155
+ /** Get current budget status for a scope */
156
+ getStatus(scope: BudgetScope): EconomicBudgetStatus | null;
157
+ /** Reset budget state for a scope */
158
+ reset(scope: BudgetScope): void;
159
+ }
160
+ /**
161
+ * Protocol connector interface.
162
+ *
163
+ * Connectors parse protocol-specific responses into EconomicContext.
164
+ * Two modes:
165
+ * - extract(): manual — developer calls explicitly (works in any framework)
166
+ * - wrapFetch(): automatic — wraps fetch to auto-detect protocol signals
167
+ */
168
+ export interface ProtocolConnector {
169
+ /** Which protocol this connector handles */
170
+ protocol: EconomicProtocol;
171
+ /** Protocol version this connector was built against */
172
+ protocolVersion: string;
173
+ /**
174
+ * Parse a response into economic context (manual/callback mode).
175
+ * Returns null if the response is not a protocol signal.
176
+ */
177
+ extract(response: Response | Record<string, unknown>): EconomicContext | null;
178
+ /**
179
+ * Wrap a fetch function to auto-detect protocol signals (auto mode).
180
+ * Optional — not all connectors support auto-wrapping.
181
+ */
182
+ wrapFetch?(fetchFn: typeof fetch): typeof fetch;
183
+ }
184
+ /**
185
+ * Economic webhook event types (extends base webhook events).
186
+ */
187
+ export type EconomicWebhookEventType = 'budget_warning' | 'approval_triggered' | 'spend_committed' | 'protocol_detected';
188
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/economic/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,GACd,iBAAiB,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IAC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;;OAGG;IACH,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,OAAO,KAAK,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,gBAAgB,GAChB,oBAAoB,GACpB,iBAAiB,GACjB,mBAAmB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Economic authorization types.
3
+ *
4
+ * Protocol-agnostic types for cost-aware agent authorization
5
+ * across x402, Stripe MPP, Google AP2, and custom protocols.
6
+ *
7
+ * @module economic/types
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/economic/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Content extractor — deterministic regex-based entity extraction from text.
3
+ *
4
+ * Detects prices (multi-currency), emails, phone numbers, salary/compensation
5
+ * figures, equity percentages, government IDs, credit cards, and API keys.
6
+ *
7
+ * Pure string processing with no browser dependencies.
8
+ *
9
+ * @module extractors/content
10
+ */
11
+ export interface ExtractedEntities {
12
+ prices: number[];
13
+ max_price: number;
14
+ min_price: number;
15
+ emails: string[];
16
+ phone_numbers: string[];
17
+ salary_figures: number[];
18
+ has_salary_figures: boolean;
19
+ equity_percentages: number[];
20
+ has_equity_info: boolean;
21
+ sensitive_terms: string[];
22
+ has_sensitive_pii: boolean;
23
+ has_credit_cards: boolean;
24
+ has_gov_ids: boolean;
25
+ has_api_keys: boolean;
26
+ }
27
+ export interface ExtractEntitiesOptions {
28
+ maxPrices?: number;
29
+ maxEmails?: number;
30
+ maxPhones?: number;
31
+ maxSalaryFigures?: number;
32
+ maxEquityPercentages?: number;
33
+ textCap?: number;
34
+ }
35
+ /**
36
+ * Extract structured entities from arbitrary text.
37
+ *
38
+ * Returns prices, emails, phone numbers, salary figures, equity percentages,
39
+ * and boolean flags for credit cards, government IDs, and API keys.
40
+ */
41
+ export declare function extractEntities(text: string, options?: ExtractEntitiesOptions): ExtractedEntities;
42
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/extractors/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAmED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,sBAAsB,GAC/B,iBAAiB,CAoGnB"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Content extractor — deterministic regex-based entity extraction from text.
3
+ *
4
+ * Detects prices (multi-currency), emails, phone numbers, salary/compensation
5
+ * figures, equity percentages, government IDs, credit cards, and API keys.
6
+ *
7
+ * Pure string processing with no browser dependencies.
8
+ *
9
+ * @module extractors/content
10
+ */
11
+ const PRICE_REGEX = /(?:[$€£¥₹₩]|(?:USD|EUR|GBP|JPY|INR|CHF|AUD|CAD|CNY)\s?)\s?([\d,]+(?:\.\d{1,2})?)/gi;
12
+ const EMAIL_REGEX = /[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]{1,255}\.[a-zA-Z]{2,}/g;
13
+ const PHONE_REGEX = /(?:\+\d{1,3}[-.\s]?)?(?:\(?\d{2,4}\)?[-.\s]?)?\d{3,4}[-.\s]?\d{3,4}/g;
14
+ const SALARY_REGEX = /\b(?:salary\b|salaries\b|compensation\b|comp\b|pay\b|wage\b|wages\b|income\b|earning\b|base\b|total\s*comp\b|ote\b|ctc\b)[:\s]*(?:[$€£¥₹]|(?:USD|EUR|GBP)\s?)?\s?([\d,]+(?:\.\d{1,2})?)\s*(?:k|K|pa|p\.a\.)?/gi;
15
+ const SALARY_AMOUNT_REGEX = /(?:[$€£¥₹])\s?([\d,]+(?:\.\d{1,2})?)\s*(?:k|K)\s*(?:\/yr|\/year|per\s*(?:year|annum)|salary|comp|annual|base)/gi;
16
+ const EQUITY_REGEX = /([\d.]+)\s*%\s*(?:equity|vesting|options|ownership|stake|shares|stock|rsus?|esop)/gi;
17
+ const GOV_ID_REGEX = /\b\d{3}-\d{2}-\d{4}\b|\b[A-Z]{2}\s?\d{2}\s?\d{2}\s?\d{2}\s?[A-Z]\b|\b\d{2}-\d{7}\b/g;
18
+ const CREDIT_CARD_REGEX = /\b(?:\d{4}[-\s]?){3}\d{4}\b/g;
19
+ const API_KEY_REGEX = /\b(?:sk|pk|api|key|token|secret|bearer)[-_][a-zA-Z0-9_-]{20,}\b/gi;
20
+ const GOV_ID_KEYWORD_REGEX = /\b(?:ssn|social\s*security|ein|tax\s*id|national\s*id|identity|passport|license|licence|id\s*number)\b/i;
21
+ // eslint-disable-next-line no-misleading-character-class
22
+ const ZERO_WIDTH_REGEX = /[\u200B\u200C\u200D\uFEFF]/g;
23
+ function normalizeUnicode(text) {
24
+ return text
25
+ .replace(/\u00A0/g, ' ')
26
+ .replace(ZERO_WIDTH_REGEX, '')
27
+ .replace(/[\uFF10-\uFF19]/g, (ch) => String.fromCharCode(ch.charCodeAt(0) - 0xFF10 + 0x30));
28
+ }
29
+ function hasGovIdKeywordNearby(text, matchIndex, matchLength) {
30
+ const windowSize = 30;
31
+ const start = Math.max(0, matchIndex - windowSize);
32
+ const end = Math.min(text.length, matchIndex + matchLength + windowSize);
33
+ const window = text.slice(start, end);
34
+ return GOV_ID_KEYWORD_REGEX.test(window);
35
+ }
36
+ function parsePrice(match) {
37
+ return Number.parseFloat(match.replace(/,/g, ''));
38
+ }
39
+ function dedup(arr) {
40
+ return [...new Set(arr)];
41
+ }
42
+ function passesLuhn(digits) {
43
+ let sum = 0;
44
+ let alternate = false;
45
+ for (let i = digits.length - 1; i >= 0; i--) {
46
+ let n = parseInt(digits[i], 10);
47
+ if (alternate) {
48
+ n *= 2;
49
+ if (n > 9)
50
+ n -= 9;
51
+ }
52
+ sum += n;
53
+ alternate = !alternate;
54
+ }
55
+ return sum % 10 === 0;
56
+ }
57
+ function isLikelyPhoneNumber(value) {
58
+ const normalized = value.trim();
59
+ const digits = normalized.replace(/\D/g, '');
60
+ if (normalized.startsWith('+')) {
61
+ return digits.length >= 8;
62
+ }
63
+ return digits.length >= 10;
64
+ }
65
+ /**
66
+ * Extract structured entities from arbitrary text.
67
+ *
68
+ * Returns prices, emails, phone numbers, salary figures, equity percentages,
69
+ * and boolean flags for credit cards, government IDs, and API keys.
70
+ */
71
+ export function extractEntities(text, options) {
72
+ if (!text || text.length < 3)
73
+ return {
74
+ prices: [],
75
+ max_price: 0,
76
+ min_price: 0,
77
+ emails: [],
78
+ phone_numbers: [],
79
+ salary_figures: [],
80
+ has_salary_figures: false,
81
+ equity_percentages: [],
82
+ has_equity_info: false,
83
+ sensitive_terms: [],
84
+ has_sensitive_pii: false,
85
+ has_credit_cards: false,
86
+ has_gov_ids: false,
87
+ has_api_keys: false,
88
+ };
89
+ const maxPrices = options?.maxPrices ?? 100;
90
+ const maxEmails = options?.maxEmails ?? 50;
91
+ const maxPhones = options?.maxPhones ?? 50;
92
+ const maxSalaryFigures = options?.maxSalaryFigures ?? 50;
93
+ const maxEquityPercentages = options?.maxEquityPercentages ?? 50;
94
+ const textCap = options?.textCap ?? 200_000;
95
+ const raw = text.length > textCap ? text.slice(0, textCap) : text;
96
+ const capped = normalizeUnicode(raw);
97
+ const prices = [];
98
+ for (const match of capped.matchAll(PRICE_REGEX)) {
99
+ const price = parsePrice(match[1]);
100
+ if (price > 0 && price < 1_000_000) {
101
+ prices.push(price);
102
+ }
103
+ if (prices.length >= maxPrices)
104
+ break;
105
+ }
106
+ const emails = dedup([...capped.matchAll(EMAIL_REGEX)].map(m => m[0].toLowerCase())).slice(0, maxEmails);
107
+ const phoneNumbers = dedup([...capped.matchAll(PHONE_REGEX)]
108
+ .map(m => m[0].trim())
109
+ .filter(isLikelyPhoneNumber)
110
+ .slice(0, maxPhones));
111
+ const salaryFigures = [];
112
+ for (const regex of [SALARY_REGEX, SALARY_AMOUNT_REGEX]) {
113
+ regex.lastIndex = 0;
114
+ for (const match of capped.matchAll(regex)) {
115
+ const raw = match[1].replace(/,/g, '');
116
+ let amount = Number.parseFloat(raw);
117
+ if (match[0].toLowerCase().includes('k'))
118
+ amount *= 1000;
119
+ if (amount > 1000 && amount < 10_000_000) {
120
+ salaryFigures.push(amount);
121
+ }
122
+ if (salaryFigures.length >= maxSalaryFigures)
123
+ break;
124
+ }
125
+ }
126
+ const equityPercentages = [];
127
+ for (const match of capped.matchAll(EQUITY_REGEX)) {
128
+ const pct = Number.parseFloat(match[1]);
129
+ if (pct > 0 && pct <= 100)
130
+ equityPercentages.push(pct);
131
+ if (equityPercentages.length >= maxEquityPercentages)
132
+ break;
133
+ }
134
+ const govIdMatches = [...capped.matchAll(GOV_ID_REGEX)];
135
+ const govIdCount = govIdMatches.filter(m => hasGovIdKeywordNearby(capped, m.index, m[0].length)).length;
136
+ const creditCardMatches = [...capped.matchAll(CREDIT_CARD_REGEX)];
137
+ const creditCardCount = creditCardMatches.filter(m => passesLuhn(m[0].replace(/\D/g, ''))).length;
138
+ const apiKeyCount = [...capped.matchAll(API_KEY_REGEX)].length;
139
+ const sensitiveTerms = [];
140
+ if (salaryFigures.length > 0)
141
+ sensitiveTerms.push('salary');
142
+ if (equityPercentages.length > 0)
143
+ sensitiveTerms.push('equity');
144
+ if (govIdCount > 0)
145
+ sensitiveTerms.push('gov_id');
146
+ if (creditCardCount > 0)
147
+ sensitiveTerms.push('credit_card');
148
+ if (apiKeyCount > 0)
149
+ sensitiveTerms.push('api_key');
150
+ if (emails.length > 0)
151
+ sensitiveTerms.push('email');
152
+ if (phoneNumbers.length > 0)
153
+ sensitiveTerms.push('phone');
154
+ return {
155
+ prices,
156
+ max_price: prices.length > 0 ? prices.reduce((a, b) => a > b ? a : b, -Infinity) : 0,
157
+ min_price: prices.length > 0 ? prices.reduce((a, b) => a < b ? a : b, Infinity) : 0,
158
+ emails,
159
+ phone_numbers: phoneNumbers,
160
+ salary_figures: salaryFigures,
161
+ has_salary_figures: salaryFigures.length > 0,
162
+ equity_percentages: equityPercentages,
163
+ has_equity_info: equityPercentages.length > 0,
164
+ sensitive_terms: sensitiveTerms,
165
+ has_sensitive_pii: sensitiveTerms.length > 0,
166
+ has_credit_cards: creditCardCount > 0,
167
+ has_gov_ids: govIdCount > 0,
168
+ has_api_keys: apiKeyCount > 0,
169
+ };
170
+ }
171
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/extractors/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA4BH,MAAM,WAAW,GAAG,oFAAoF,CAAC;AACzG,MAAM,WAAW,GAAG,4DAA4D,CAAC;AACjF,MAAM,WAAW,GAAG,sEAAsE,CAAC;AAC3F,MAAM,YAAY,GAChB,gNAAgN,CA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AAC;QACrC,WAAW,EAAE,UAAU,GAAG,CAAC;QAC3B,YAAY,EAAE,WAAW,GAAG,CAAC;KAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Entity extraction utilities.
3
+ *
4
+ * @module extractors
5
+ */
6
+ export { extractEntities, type ExtractedEntities, type ExtractEntitiesOptions, } from './content.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extractors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Entity extraction utilities.
3
+ *
4
+ * @module extractors
5
+ */
6
+ export { extractEntities, } from './content.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extractors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,GAGhB,MAAM,cAAc,CAAC"}
package/dist/index.d.ts CHANGED
@@ -34,11 +34,12 @@
34
34
  export { Veto, ToolCallDeniedError, type VetoOptions, type VetoMode, type ValidationMode, type WrappedTools, type WrappedHandler, type GuardContext, type GuardResult, } from './core/veto.js';
35
35
  export { protect, type ProtectOptions, type ProtectMode, } from './core/protect.js';
36
36
  export type { ToolDefinition, ToolCall, ToolResult, ToolHandler, ExecutableTool, ToolInputSchema, JsonSchemaType, JsonSchemaProperty, } from './types/tool.js';
37
- export type { LogLevel, ValidationDecision, ValidationResult, ValidationContext, Validator, NamedValidator, ToolCallHistoryEntry, DecisionExportFormat, DecisionExportRecord, } from './types/config.js';
37
+ export type { LogLevel, StreamLogMode, ValidationDecision, ValidationResult, ValidationContext, Validator, NamedValidator, ToolCallHistoryEntry, DecisionExportFormat, DecisionExportRecord, } from './types/config.js';
38
38
  export type { Rule, RuleSet, RuleCondition, RuleAgentsScope, RuleAction, OutputRule, OutputRuleAction, RuleSeverity, ValidationAPIResponse, } from './rules/types.js';
39
39
  export type { CustomConfig, CustomProvider, CustomResponse, CustomToolCall, } from './custom/types.js';
40
40
  export { CustomClient } from './custom/client.js';
41
- export type { VetoCloudConfig, CloudValidationResponse, FailedConstraint, ApprovalData, ApprovalPollOptions, } from './cloud/types.js';
41
+ export type { VetoCloudConfig, CloudValidationResponse, FailedConstraint, ApprovalData, ApprovalPollOptions, SessionState, } from './cloud/types.js';
42
+ export type { ArgumentConstraint, SessionConstraints, SessionCounterConfig, CumulativeLimit, DeterministicPolicy, LocalValidationResult, } from './deterministic/types.js';
42
43
  export { VetoCloudClient, ApprovalTimeoutError } from './cloud/client.js';
43
44
  export type { InterceptionResult, DenialDetails } from './core/interceptor.js';
44
45
  export type { HistoryStats } from './core/history.js';
@@ -46,10 +47,15 @@ export type { OutputValidationResult } from './core/output-validator.js';
46
47
  export type { EventWebhookConfig, VetoWebhookEvent, VetoWebhookEventType, VetoWebhookFormat, } from './core/events.js';
47
48
  export { formatSlackPayload, formatPagerDutyPayload, formatGenericPayload, formatCefPayload, resolveEventWebhookConfig, } from './core/events.js';
48
49
  export { BudgetTracker, BudgetExceededError, type BudgetConfig, type ToolCostMap, type BudgetStatus, } from './core/budget.js';
49
- export { toOpenAI, fromOpenAI, fromOpenAIToolCall, toOpenAITools, toAnthropic, fromAnthropic, fromAnthropicToolUse, toAnthropicTools, toGoogleTool, fromGoogleFunctionCall, toMCP, fromMCP, fromMCPToolCall, toMCPTools, isMCPTool, } from './providers/adapters.js';
50
+ export { LocalBudgetEngine, EconomicEvaluator, createX402Connector, createMPPConnector, createAP2Connector, buildX402ConnectorError, buildMPPConnectorError, buildAP2ConnectorError, } from './economic/index.js';
51
+ export type { EconomicContext, EconomicDenialDetails, EconomicDenialReason, EconomicProtocol, BudgetEngine, BudgetCheckResult, BudgetScope, EconomicBudgetStatus, EconomicPolicyConfig, EconomicBudgetConfig, CostExtractionConfig, PayerConfig, ProtocolConnector, EconomicWebhookEventType, } from './economic/index.js';
52
+ export { toOpenAI, fromOpenAI, fromOpenAIToolCall, toOpenAITools, toAnthropic, fromAnthropic, fromAnthropicToolUse, toAnthropicTools, toGoogleTool, fromGoogleFunctionCall, toMCP, fromMCP, fromMCPToolCall, toMCPTools, isMCPTool, extractMCPEconomicContext, } from './providers/adapters.js';
50
53
  export type { OpenAITool, OpenAIToolCall, AnthropicTool, AnthropicToolUse, GoogleTool, GoogleFunctionCall, MCPTool, MCPToolCallArgs, MCPToolResult, MCPServerClient, } from './providers/types.js';
51
54
  export { compile, evaluate, typeCheck } from './compiler/index.js';
52
55
  export type { ASTNode, EvalContext, TypeCheckResult } from './compiler/index.js';
53
56
  export { OUTPUT_PATTERNS, OUTPUT_PATTERN_SSN, OUTPUT_PATTERN_CREDIT_CARD, OUTPUT_PATTERN_OPENAI_API_KEY, OUTPUT_PATTERN_GITHUB_API_KEY, OUTPUT_PATTERN_AWS_API_KEY, OUTPUT_PATTERN_EMAIL, OUTPUT_PATTERN_US_PHONE, } from './rules/patterns.js';
57
+ export { extractEntities, type ExtractedEntities, type ExtractEntitiesOptions, } from './extractors/content.js';
58
+ export { evaluateRulesLocally, evaluateCondition as evaluateConditionLocally, resolveFieldPath as resolveLocalFieldPath, type LocalEvalResult, } from './rules/local-evaluator.js';
59
+ export { BROWSER_AGENT_SYSTEM_PROMPT, getPolicyOutputSchema, sanitizeGeneratedRules, validatePolicyOutput, tryInstantGeneration, looksLikePolicyDeclaration, reviewPolicyRequest, type PolicyGenerationResult, type PolicyClarificationRequest, } from './policy/generator.js';
54
60
  export { init, isInitialized } from './cli/init.js';
55
61
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAG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AqB,CAAC;AAGjF,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,IAAI,wBAAwB,EAC7C,gBAAgB,IAAI,qBAAqB,EACzC,KAAK,eAAe,GACrB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -37,14 +37,22 @@ export { protect, } from './core/protect.js';
37
37
  export { CustomClient } from './custom/client.js';
38
38
  export { VetoCloudClient, ApprovalTimeoutError } from './cloud/client.js';
39
39
  export { formatSlackPayload, formatPagerDutyPayload, formatGenericPayload, formatCefPayload, resolveEventWebhookConfig, } from './core/events.js';
40
- // Budget
40
+ // Budget (legacy — use economic module for new code)
41
41
  export { BudgetTracker, BudgetExceededError, } from './core/budget.js';
42
+ // Economic authorization (x402, MPP, AP2)
43
+ export { LocalBudgetEngine, EconomicEvaluator, createX402Connector, createMPPConnector, createAP2Connector, buildX402ConnectorError, buildMPPConnectorError, buildAP2ConnectorError, } from './economic/index.js';
42
44
  // Provider adapters (for converting to/from provider formats)
43
- export { toOpenAI, fromOpenAI, fromOpenAIToolCall, toOpenAITools, toAnthropic, fromAnthropic, fromAnthropicToolUse, toAnthropicTools, toGoogleTool, fromGoogleFunctionCall, toMCP, fromMCP, fromMCPToolCall, toMCPTools, isMCPTool, } from './providers/adapters.js';
45
+ export { toOpenAI, fromOpenAI, fromOpenAIToolCall, toOpenAITools, toAnthropic, fromAnthropic, fromAnthropicToolUse, toAnthropicTools, toGoogleTool, fromGoogleFunctionCall, toMCP, fromMCP, fromMCPToolCall, toMCPTools, isMCPTool, extractMCPEconomicContext, } from './providers/adapters.js';
44
46
  // Compiler (AST-based policy expressions)
45
47
  export { compile, evaluate, typeCheck } from './compiler/index.js';
46
48
  // Common output redaction patterns (reference only, not auto-applied)
47
49
  export { OUTPUT_PATTERNS, OUTPUT_PATTERN_SSN, OUTPUT_PATTERN_CREDIT_CARD, OUTPUT_PATTERN_OPENAI_API_KEY, OUTPUT_PATTERN_GITHUB_API_KEY, OUTPUT_PATTERN_AWS_API_KEY, OUTPUT_PATTERN_EMAIL, OUTPUT_PATTERN_US_PHONE, } from './rules/patterns.js';
50
+ // Content extractors
51
+ export { extractEntities, } from './extractors/content.js';
52
+ // Local rule evaluator
53
+ export { evaluateRulesLocally, evaluateCondition as evaluateConditionLocally, resolveFieldPath as resolveLocalFieldPath, } from './rules/local-evaluator.js';
54
+ // Policy generator utilities
55
+ export { BROWSER_AGENT_SYSTEM_PROMPT, getPolicyOutputSchema, sanitizeGeneratedRules, validatePolicyOutput, tryInstantGeneration, looksLikePolicyDeclaration, reviewPolicyRequest, } from './policy/generator.js';
48
56
  // CLI init function (for programmatic use)
49
57
  export { init, isInitialized } from './cli/init.js';
50
58
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,cAAc;AACd,OAAO,EACL,IAAI,EACJ,mBAAmB,GAQpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,OAAO,GAGR,MAAM,mBAAmB,CAAC;AA8C3B,OAAO,EAAE,YAAY,EAA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