@vorim/sdk 3.11.0 → 3.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/integrations/cloudflare.cjs +134 -0
  4. package/dist/integrations/cloudflare.cjs.map +1 -0
  5. package/dist/integrations/cloudflare.d.cts +93 -0
  6. package/dist/integrations/cloudflare.d.ts +93 -0
  7. package/dist/integrations/cloudflare.js +108 -0
  8. package/dist/integrations/cloudflare.js.map +1 -0
  9. package/dist/integrations/coinbase-cdp.cjs +230 -0
  10. package/dist/integrations/coinbase-cdp.cjs.map +1 -0
  11. package/dist/integrations/coinbase-cdp.d.cts +169 -0
  12. package/dist/integrations/coinbase-cdp.d.ts +169 -0
  13. package/dist/integrations/coinbase-cdp.js +204 -0
  14. package/dist/integrations/coinbase-cdp.js.map +1 -0
  15. package/dist/integrations/fhir.cjs +304 -0
  16. package/dist/integrations/fhir.cjs.map +1 -0
  17. package/dist/integrations/fhir.d.cts +185 -0
  18. package/dist/integrations/fhir.d.ts +185 -0
  19. package/dist/integrations/fhir.js +278 -0
  20. package/dist/integrations/fhir.js.map +1 -0
  21. package/dist/integrations/guidewire.cjs +363 -0
  22. package/dist/integrations/guidewire.cjs.map +1 -0
  23. package/dist/integrations/guidewire.d.cts +258 -0
  24. package/dist/integrations/guidewire.d.ts +258 -0
  25. package/dist/integrations/guidewire.js +337 -0
  26. package/dist/integrations/guidewire.js.map +1 -0
  27. package/dist/integrations/legal.cjs +339 -0
  28. package/dist/integrations/legal.cjs.map +1 -0
  29. package/dist/integrations/legal.d.cts +225 -0
  30. package/dist/integrations/legal.d.ts +225 -0
  31. package/dist/integrations/legal.js +313 -0
  32. package/dist/integrations/legal.js.map +1 -0
  33. package/dist/integrations/life-sciences.cjs +335 -0
  34. package/dist/integrations/life-sciences.cjs.map +1 -0
  35. package/dist/integrations/life-sciences.d.cts +214 -0
  36. package/dist/integrations/life-sciences.d.ts +214 -0
  37. package/dist/integrations/life-sciences.js +309 -0
  38. package/dist/integrations/life-sciences.js.map +1 -0
  39. package/dist/integrations/lithic.cjs +290 -0
  40. package/dist/integrations/lithic.cjs.map +1 -0
  41. package/dist/integrations/lithic.d.cts +130 -0
  42. package/dist/integrations/lithic.d.ts +130 -0
  43. package/dist/integrations/lithic.js +264 -0
  44. package/dist/integrations/lithic.js.map +1 -0
  45. package/dist/integrations/marqeta.cjs +285 -0
  46. package/dist/integrations/marqeta.cjs.map +1 -0
  47. package/dist/integrations/marqeta.d.cts +121 -0
  48. package/dist/integrations/marqeta.d.ts +121 -0
  49. package/dist/integrations/marqeta.js +259 -0
  50. package/dist/integrations/marqeta.js.map +1 -0
  51. package/dist/integrations/ramp.cjs +206 -0
  52. package/dist/integrations/ramp.cjs.map +1 -0
  53. package/dist/integrations/ramp.d.cts +139 -0
  54. package/dist/integrations/ramp.d.ts +139 -0
  55. package/dist/integrations/ramp.js +180 -0
  56. package/dist/integrations/ramp.js.map +1 -0
  57. package/dist/integrations/shopify.cjs +203 -0
  58. package/dist/integrations/shopify.cjs.map +1 -0
  59. package/dist/integrations/shopify.d.cts +175 -0
  60. package/dist/integrations/shopify.d.ts +175 -0
  61. package/dist/integrations/shopify.js +177 -0
  62. package/dist/integrations/shopify.js.map +1 -0
  63. package/dist/integrations/stripe-issuing.cjs +316 -0
  64. package/dist/integrations/stripe-issuing.cjs.map +1 -0
  65. package/dist/integrations/stripe-issuing.d.cts +154 -0
  66. package/dist/integrations/stripe-issuing.d.ts +154 -0
  67. package/dist/integrations/stripe-issuing.js +290 -0
  68. package/dist/integrations/stripe-issuing.js.map +1 -0
  69. package/dist/integrations/web-bot-auth.cjs +143 -0
  70. package/dist/integrations/web-bot-auth.cjs.map +1 -0
  71. package/dist/integrations/web-bot-auth.d.cts +51 -0
  72. package/dist/integrations/web-bot-auth.d.ts +51 -0
  73. package/dist/integrations/web-bot-auth.js +108 -0
  74. package/dist/integrations/web-bot-auth.js.map +1 -0
  75. package/package.json +121 -1
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/integrations/ramp.ts
21
+ var ramp_exports = {};
22
+ __export(ramp_exports, {
23
+ VorimRamp: () => VorimRamp,
24
+ createVorimRamp: () => createVorimRamp
25
+ });
26
+ module.exports = __toCommonJS(ramp_exports);
27
+ var OPERATION_SCOPE = {
28
+ createLimit: "agent:write",
29
+ updateRestriction: "agent:write",
30
+ terminateCard: "agent:write"
31
+ };
32
+ var VorimRamp = class {
33
+ sdk;
34
+ agentId;
35
+ humanId;
36
+ maxLimitAmount;
37
+ escalateOverCeiling;
38
+ approverId;
39
+ escalationTimeoutMs;
40
+ minTrustScore;
41
+ onError;
42
+ constructor(sdk, config) {
43
+ if (!config?.agentId) throw new Error("[vorim] Ramp integration requires an agentId.");
44
+ this.sdk = sdk;
45
+ this.agentId = config.agentId;
46
+ this.humanId = config.humanId;
47
+ this.maxLimitAmount = config.maxLimitAmount;
48
+ this.escalateOverCeiling = config.escalateOverCeiling ?? false;
49
+ this.approverId = config.approverId ?? config.humanId;
50
+ this.escalationTimeoutMs = config.escalationTimeoutMs ?? 3e5;
51
+ this.minTrustScore = config.minTrustScore ?? 0;
52
+ this.onError = config.onError ?? "closed";
53
+ }
54
+ scopeFor(operation) {
55
+ return OPERATION_SCOPE[operation] ?? "agent:write";
56
+ }
57
+ /** Only createLimit / updateRestriction carry a limit amount to cap. */
58
+ hasLimitAmount(operation) {
59
+ return operation === "createLimit" || operation === "updateRestriction";
60
+ }
61
+ async authorize(action) {
62
+ const scope = this.scopeFor(action.operation);
63
+ const overCeiling = this.hasLimitAmount(action.operation) && this.maxLimitAmount != null && typeof action.amount === "number" && action.amount > this.maxLimitAmount;
64
+ try {
65
+ if (this.minTrustScore > 0) {
66
+ const trust = await this.sdk.verify(this.agentId);
67
+ if ((trust?.trust_score ?? 0) < this.minTrustScore) {
68
+ return { authorized: false, reason: `trust score below ${this.minTrustScore}`, outcome: overCeiling ? "over-ceiling" : "within" };
69
+ }
70
+ }
71
+ if (overCeiling) {
72
+ if (!this.escalateOverCeiling) {
73
+ return {
74
+ authorized: false,
75
+ reason: `limit ${action.amount} exceeds this agent's ceiling of ${this.maxLimitAmount}`,
76
+ outcome: "over-ceiling"
77
+ };
78
+ }
79
+ const esc = await this.escalate(action, scope);
80
+ return {
81
+ authorized: esc.approved,
82
+ reason: esc.approved ? void 0 : esc.reason ?? "named approver denied",
83
+ outcome: esc.approved ? "escalated-approved" : "escalated-denied",
84
+ approverId: this.approverId,
85
+ decisionId: esc.decisionId
86
+ };
87
+ }
88
+ const perm = await this.sdk.check(this.agentId, scope);
89
+ return perm.allowed ? { authorized: true, outcome: "within" } : { authorized: false, reason: perm.reason ?? `missing scope ${scope}`, outcome: "within" };
90
+ } catch (e) {
91
+ return this.onError === "open" ? { authorized: true, reason: "vorim unreachable, failed open", outcome: overCeiling ? "over-ceiling" : "within" } : { authorized: false, reason: `vorim unreachable: ${e?.message ?? "error"}`, outcome: overCeiling ? "over-ceiling" : "within" };
92
+ }
93
+ }
94
+ async escalate(action, scope) {
95
+ const decision = await this.sdk.beforeAction(
96
+ {
97
+ agentId: this.agentId,
98
+ actionType: "api_request",
99
+ actionTarget: `ramp:${action.operation}`,
100
+ requiredScope: scope,
101
+ payload: { amount: action.amount, interval: action.interval, limit: this.maxLimitAmount, card_id: action.cardId },
102
+ context: { integration: "ramp", requires_named_approver: true, approver_hint: this.approverId }
103
+ },
104
+ { throwOnDeny: false }
105
+ );
106
+ if (decision.decision === "escalate") {
107
+ const resolved = await this.sdk.waitForDecisionResolution(decision.decisionId, { timeoutMs: this.escalationTimeoutMs });
108
+ const approved = resolved.decision === "allow" || resolved.escalationResolution === "approved";
109
+ return { approved, reason: approved ? void 0 : "named approver denied", decisionId: decision.decisionId };
110
+ }
111
+ if (decision.decision === "allow") return { approved: true, decisionId: decision.decisionId };
112
+ if (decision.decision === "fallback")
113
+ return { approved: this.onError === "open", reason: "runtime unreachable", decisionId: decision.decisionId };
114
+ return { approved: false, reason: decision.reason ?? "denied", decisionId: decision.decisionId };
115
+ }
116
+ async record(action, result, extra = {}) {
117
+ const scope = this.scopeFor(action.operation);
118
+ try {
119
+ await this.sdk.emit(
120
+ {
121
+ agent_id: this.agentId,
122
+ event_type: "api_request",
123
+ action: `ramp:${action.operation}${action.cardId ? " " + action.cardId : ""}`,
124
+ resource: action.cardId || "ramp",
125
+ permission: scope,
126
+ result,
127
+ input_hash: action.inputHash,
128
+ metadata: {
129
+ integration: "ramp",
130
+ operation: action.operation,
131
+ acts_for_human: this.humanId,
132
+ ...action.amount != null ? { amount: action.amount } : {},
133
+ ...action.interval ? { interval: action.interval } : {},
134
+ ...extra.outcome ? { limit_outcome: extra.outcome } : {},
135
+ ...extra.approverId ? { approver_id: extra.approverId } : {},
136
+ ...extra.decisionId ? { decision_id: extra.decisionId } : {},
137
+ ...extra.reason ? { reason: extra.reason } : {}
138
+ }
139
+ },
140
+ { sign: true }
141
+ );
142
+ return true;
143
+ } catch {
144
+ return false;
145
+ }
146
+ }
147
+ async guard(action, run) {
148
+ const auth = await this.authorize(action);
149
+ if (!auth.authorized) {
150
+ const recorded = await this.record(action, "denied", { reason: auth.reason, outcome: auth.outcome, approverId: auth.approverId, decisionId: auth.decisionId });
151
+ return { receipt: this.receipt(action, false, "denied", auth, recorded) };
152
+ }
153
+ try {
154
+ const value = await run();
155
+ const recorded = await this.record(action, "success", { outcome: auth.outcome, approverId: auth.approverId, decisionId: auth.decisionId });
156
+ return { receipt: this.receipt(action, true, "success", auth, recorded), value };
157
+ } catch (e) {
158
+ const recorded = await this.record(action, "error", { reason: e?.message, outcome: auth.outcome, approverId: auth.approverId, decisionId: auth.decisionId });
159
+ throw Object.assign(e ?? new Error("ramp operation failed"), {
160
+ vorimReceipt: this.receipt(action, true, "error", { ...auth, reason: e?.message }, recorded)
161
+ });
162
+ }
163
+ }
164
+ // --- Named helpers ---------------------------------------------------------
165
+ /** Guard creating a limit / virtual card. Requires agent:write; the limit
166
+ * amount is checked against maxLimitAmount. */
167
+ guardedCreateLimit(meta, run) {
168
+ return this.guard({ operation: "createLimit", ...meta }, run);
169
+ }
170
+ /** Guard updating a card restriction (amount/interval/category/vendors).
171
+ * Requires agent:write; a raised amount is checked against the ceiling. */
172
+ guardedUpdateRestriction(meta, run) {
173
+ return this.guard({ operation: "updateRestriction", ...meta }, run);
174
+ }
175
+ /** Guard suspending / terminating a card. Requires agent:write. */
176
+ guardedTerminateCard(meta, run) {
177
+ return this.guard({ operation: "terminateCard", ...meta }, run);
178
+ }
179
+ receipt(action, authorized, result, auth, recorded) {
180
+ return {
181
+ authorized,
182
+ agentId: this.agentId,
183
+ humanId: this.humanId,
184
+ operation: action.operation,
185
+ cardId: action.cardId,
186
+ amount: action.amount,
187
+ interval: action.interval,
188
+ limitOutcome: auth.outcome,
189
+ approverId: auth.approverId,
190
+ result,
191
+ scope: this.scopeFor(action.operation),
192
+ reason: auth.reason,
193
+ decisionId: auth.decisionId,
194
+ recorded
195
+ };
196
+ }
197
+ };
198
+ function createVorimRamp(sdk, config) {
199
+ return new VorimRamp(sdk, config);
200
+ }
201
+ // Annotate the CommonJS export names for ESM import in node:
202
+ 0 && (module.exports = {
203
+ VorimRamp,
204
+ createVorimRamp
205
+ });
206
+ //# sourceMappingURL=ramp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/integrations/ramp.ts"],"sourcesContent":["// ============================================================================\n// Vorim AI — Ramp (B2B agent spend cards) Integration\n//\n// This guards an AI agent that provisions and manages Ramp virtual spend cards\n// through the Limits API. Before each op runs it verifies the agent's identity\n// and scoped permission, caps the limit amount an agent may create/raise, and\n// signs a tamper-evident record of the provisioning action.\n//\n// HONEST SCOPE: PROVISIONING, NOT PER-AUTHORIZATION\n// Ramp is a spend-management layer on top of Visa, not a raw issuer. There is no\n// real-time authorization webhook to sit in front of (unlike Stripe Issuing,\n// Lithic ASA, or Marqeta JIT). So Vorim signs each card-issue and limit-change,\n// and enforces a ceiling on the LIMIT the agent may provision, rather than\n// deciding each transaction. Use the card-issuing connectors when you need a\n// signed record of every authorization; use Ramp for governed B2B provisioning.\n//\n// SCOPE MAPPING (uses Vorim's real scopes)\n// create a limit / virtual card -> agent:write (+ limit-amount ceiling)\n// update a restriction -> agent:write\n// suspend / terminate a card -> agent:write\n//\n// This layer never holds Ramp OAuth credentials and never calls Ramp itself. You\n// pass the Ramp API call as a closure; it authorizes, runs it, signs the receipt.\n//\n// COMPLIANCE FRAMING (honest)\n// PCI DSS Requirement 10 mandates tamper-evident audit logs, NOT cryptographic\n// signatures. A signed record of each provisioning action satisfies that intent.\n// Say \"tamper-evident, signed record of every card-provisioning action\", never\n// \"required by PCI\".\n//\n// Usage:\n// import createVorim from '@vorim/sdk';\n// import { createVorimRamp } from '@vorim/sdk/integrations/ramp';\n//\n// const vorim = createVorim({ apiKey: 'agid_sk_...' });\n// const ramp = createVorimRamp(vorim, {\n// agentId: 'agid_abc123',\n// maxLimitAmount: 500000, // an agent can provision limits up to $5,000.00\n// });\n//\n// const { receipt, value } = await ramp.guardedCreateLimit(\n// { amount: 250000, interval: 'MONTHLY' },\n// () => rampClient.limits.create({ ... }),\n// );\n// ============================================================================\n\nimport type { VorimSDK } from '../index.js';\nimport type { PermissionScope } from '../types.js';\n\nexport type RampOperation = 'createLimit' | 'updateRestriction' | 'terminateCard';\n\nconst OPERATION_SCOPE: Record<string, PermissionScope> = {\n createLimit: 'agent:write',\n updateRestriction: 'agent:write',\n terminateCard: 'agent:write',\n};\n\nexport interface RampConfig {\n /** The acting agent's Vorim id (agid_...). */\n agentId: string;\n /** The person/team the agent acts for. Recorded and default escalation target. */\n humanId?: string;\n /** Attenuation: cap the limit amount an agent may create or raise, in minor\n * units (cents). A createLimit / updateRestriction above this is denied or\n * escalated. Omit for no ceiling. */\n maxLimitAmount?: number;\n /** Over the limit-amount ceiling, escalate to a named approver instead of\n * denying. Default false. */\n escalateOverCeiling?: boolean;\n /** Named approver for an over-ceiling provisioning op. Defaults to humanId. */\n approverId?: string;\n /** Max wait for an escalation, ms. Default 300000 (a human sign-off). */\n escalationTimeoutMs?: number;\n /** Minimum trust score before an op. Default 0. */\n minTrustScore?: number;\n /** Fail closed (deny on any Vorim error) or fail open. Default 'closed'. */\n onError?: 'closed' | 'open';\n}\n\nexport interface RampAction {\n /** The Ramp operation, e.g. 'createLimit'. Drives the scope. */\n operation: RampOperation | string;\n /** The card / limit the op targets, when known. */\n cardId?: string;\n /** For createLimit / updateRestriction: the limit amount in minor units.\n * Checked against maxLimitAmount. */\n amount?: number;\n /** The limit interval, e.g. 'MONTHLY'. Recorded. */\n interval?: string;\n /** Optional hash of the request body. */\n inputHash?: string;\n}\n\nexport type LimitOutcome = 'within' | 'escalated-approved' | 'escalated-denied' | 'over-ceiling';\n\nexport interface RampReceipt {\n authorized: boolean;\n agentId: string;\n humanId?: string;\n operation: string;\n cardId?: string;\n amount?: number;\n interval?: string;\n limitOutcome?: LimitOutcome;\n approverId?: string;\n result: 'success' | 'denied' | 'error';\n scope: PermissionScope;\n reason?: string;\n decisionId?: string;\n recorded: boolean;\n}\n\nexport class VorimRamp {\n private sdk: VorimSDK;\n private agentId: string;\n private humanId?: string;\n private maxLimitAmount?: number;\n private escalateOverCeiling: boolean;\n private approverId?: string;\n private escalationTimeoutMs: number;\n private minTrustScore: number;\n private onError: 'closed' | 'open';\n\n constructor(sdk: VorimSDK, config: RampConfig) {\n if (!config?.agentId) throw new Error('[vorim] Ramp integration requires an agentId.');\n this.sdk = sdk;\n this.agentId = config.agentId;\n this.humanId = config.humanId;\n this.maxLimitAmount = config.maxLimitAmount;\n this.escalateOverCeiling = config.escalateOverCeiling ?? false;\n this.approverId = config.approverId ?? config.humanId;\n this.escalationTimeoutMs = config.escalationTimeoutMs ?? 300_000;\n this.minTrustScore = config.minTrustScore ?? 0;\n this.onError = config.onError ?? 'closed';\n }\n\n private scopeFor(operation: string): PermissionScope {\n return OPERATION_SCOPE[operation] ?? 'agent:write';\n }\n\n /** Only createLimit / updateRestriction carry a limit amount to cap. */\n private hasLimitAmount(operation: string): boolean {\n return operation === 'createLimit' || operation === 'updateRestriction';\n }\n\n async authorize(\n action: RampAction,\n ): Promise<{ authorized: boolean; reason?: string; outcome: LimitOutcome; approverId?: string; decisionId?: string }> {\n const scope = this.scopeFor(action.operation);\n const overCeiling =\n this.hasLimitAmount(action.operation) &&\n this.maxLimitAmount != null &&\n typeof action.amount === 'number' &&\n action.amount > this.maxLimitAmount;\n\n try {\n if (this.minTrustScore > 0) {\n const trust = await this.sdk.verify(this.agentId);\n if ((trust?.trust_score ?? 0) < this.minTrustScore) {\n return { authorized: false, reason: `trust score below ${this.minTrustScore}`, outcome: overCeiling ? 'over-ceiling' : 'within' };\n }\n }\n\n if (overCeiling) {\n if (!this.escalateOverCeiling) {\n return {\n authorized: false,\n reason: `limit ${action.amount} exceeds this agent's ceiling of ${this.maxLimitAmount}`,\n outcome: 'over-ceiling',\n };\n }\n const esc = await this.escalate(action, scope);\n return {\n authorized: esc.approved,\n reason: esc.approved ? undefined : (esc.reason ?? 'named approver denied'),\n outcome: esc.approved ? 'escalated-approved' : 'escalated-denied',\n approverId: this.approverId,\n decisionId: esc.decisionId,\n };\n }\n\n const perm = await this.sdk.check(this.agentId, scope);\n return perm.allowed\n ? { authorized: true, outcome: 'within' }\n : { authorized: false, reason: perm.reason ?? `missing scope ${scope}`, outcome: 'within' };\n } catch (e: any) {\n return this.onError === 'open'\n ? { authorized: true, reason: 'vorim unreachable, failed open', outcome: overCeiling ? 'over-ceiling' : 'within' }\n : { authorized: false, reason: `vorim unreachable: ${e?.message ?? 'error'}`, outcome: overCeiling ? 'over-ceiling' : 'within' };\n }\n }\n\n private async escalate(action: RampAction, scope: PermissionScope): Promise<{ approved: boolean; reason?: string; decisionId?: string }> {\n const decision = await this.sdk.beforeAction(\n {\n agentId: this.agentId,\n actionType: 'api_request',\n actionTarget: `ramp:${action.operation}`,\n requiredScope: scope,\n payload: { amount: action.amount, interval: action.interval, limit: this.maxLimitAmount, card_id: action.cardId },\n context: { integration: 'ramp', requires_named_approver: true, approver_hint: this.approverId },\n },\n { throwOnDeny: false },\n );\n if (decision.decision === 'escalate') {\n const resolved = await this.sdk.waitForDecisionResolution(decision.decisionId, { timeoutMs: this.escalationTimeoutMs });\n const approved = resolved.decision === 'allow' || resolved.escalationResolution === 'approved';\n return { approved, reason: approved ? undefined : 'named approver denied', decisionId: decision.decisionId };\n }\n if (decision.decision === 'allow') return { approved: true, decisionId: decision.decisionId };\n if (decision.decision === 'fallback')\n return { approved: this.onError === 'open', reason: 'runtime unreachable', decisionId: decision.decisionId };\n return { approved: false, reason: decision.reason ?? 'denied', decisionId: decision.decisionId };\n }\n\n async record(\n action: RampAction,\n result: 'success' | 'denied' | 'error',\n extra: { reason?: string; outcome?: LimitOutcome; approverId?: string; decisionId?: string } = {},\n ): Promise<boolean> {\n const scope = this.scopeFor(action.operation);\n try {\n await this.sdk.emit(\n {\n agent_id: this.agentId,\n event_type: 'api_request',\n action: `ramp:${action.operation}${action.cardId ? ' ' + action.cardId : ''}`,\n resource: action.cardId || 'ramp',\n permission: scope,\n result,\n input_hash: action.inputHash,\n metadata: {\n integration: 'ramp',\n operation: action.operation,\n acts_for_human: this.humanId,\n ...(action.amount != null ? { amount: action.amount } : {}),\n ...(action.interval ? { interval: action.interval } : {}),\n ...(extra.outcome ? { limit_outcome: extra.outcome } : {}),\n ...(extra.approverId ? { approver_id: extra.approverId } : {}),\n ...(extra.decisionId ? { decision_id: extra.decisionId } : {}),\n ...(extra.reason ? { reason: extra.reason } : {}),\n },\n },\n { sign: true },\n );\n return true;\n } catch {\n return false;\n }\n }\n\n async guard<T>(action: RampAction, run: () => Promise<T>): Promise<{ receipt: RampReceipt; value?: T }> {\n const auth = await this.authorize(action);\n if (!auth.authorized) {\n const recorded = await this.record(action, 'denied', { reason: auth.reason, outcome: auth.outcome, approverId: auth.approverId, decisionId: auth.decisionId });\n return { receipt: this.receipt(action, false, 'denied', auth, recorded) };\n }\n try {\n const value = await run();\n const recorded = await this.record(action, 'success', { outcome: auth.outcome, approverId: auth.approverId, decisionId: auth.decisionId });\n return { receipt: this.receipt(action, true, 'success', auth, recorded), value };\n } catch (e: any) {\n const recorded = await this.record(action, 'error', { reason: e?.message, outcome: auth.outcome, approverId: auth.approverId, decisionId: auth.decisionId });\n throw Object.assign(e ?? new Error('ramp operation failed'), {\n vorimReceipt: this.receipt(action, true, 'error', { ...auth, reason: e?.message }, recorded),\n });\n }\n }\n\n // --- Named helpers ---------------------------------------------------------\n\n /** Guard creating a limit / virtual card. Requires agent:write; the limit\n * amount is checked against maxLimitAmount. */\n guardedCreateLimit<T>(meta: { amount?: number; interval?: string; cardId?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'createLimit', ...meta }, run);\n }\n\n /** Guard updating a card restriction (amount/interval/category/vendors).\n * Requires agent:write; a raised amount is checked against the ceiling. */\n guardedUpdateRestriction<T>(meta: { cardId?: string; amount?: number; interval?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'updateRestriction', ...meta }, run);\n }\n\n /** Guard suspending / terminating a card. Requires agent:write. */\n guardedTerminateCard<T>(meta: { cardId?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'terminateCard', ...meta }, run);\n }\n\n private receipt(\n action: RampAction,\n authorized: boolean,\n result: 'success' | 'denied' | 'error',\n auth: { reason?: string; outcome?: LimitOutcome; approverId?: string; decisionId?: string },\n recorded: boolean,\n ): RampReceipt {\n return {\n authorized,\n agentId: this.agentId,\n humanId: this.humanId,\n operation: action.operation,\n cardId: action.cardId,\n amount: action.amount,\n interval: action.interval,\n limitOutcome: auth.outcome,\n approverId: auth.approverId,\n result,\n scope: this.scopeFor(action.operation),\n reason: auth.reason,\n decisionId: auth.decisionId,\n recorded,\n };\n }\n}\n\n/**\n * Create a VorimRamp guard around a Vorim SDK instance.\n *\n * @example\n * ```typescript\n * import createVorim from '@vorim/sdk';\n * import { createVorimRamp } from '@vorim/sdk/integrations/ramp';\n *\n * const vorim = createVorim({ apiKey: 'agid_sk_...' });\n * const ramp = createVorimRamp(vorim, { agentId: 'agid_abc123', maxLimitAmount: 500000 });\n *\n * const { receipt, value } = await ramp.guardedCreateLimit(\n * { amount: 250000, interval: 'MONTHLY' },\n * () => rampClient.limits.create({ ... }),\n * );\n * ```\n */\nexport function createVorimRamp(sdk: VorimSDK, config: RampConfig): VorimRamp {\n return new VorimRamp(sdk, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDA,IAAM,kBAAmD;AAAA,EACvD,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,eAAe;AACjB;AAyDO,IAAM,YAAN,MAAgB;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,KAAe,QAAoB;AAC7C,QAAI,CAAC,QAAQ,QAAS,OAAM,IAAI,MAAM,+CAA+C;AACrF,SAAK,MAAM;AACX,SAAK,UAAU,OAAO;AACtB,SAAK,UAAU,OAAO;AACt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AK;AAAA,MACd,SAAS,KAAK;AAAA,MACd,WAAW,OAAO;AAAA,MAClB,QAAQ,OAAO;AAAA,MACf,QAAQ,OAAO;AAAA,MACf,UAAU,OAAO;AAAA,MACjB,cAAc,KAAK;AAAA,MACnB,YAAY,KAAK;AAAA,MACjB;AAAA,MACA,OAAO,KAAK,SAAS,OAAO,SAAS;AAAA,MACrC,QAAQ,KAAK;AAAA,MACb,YAAY,KAAK;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;AAmBO,SAAS,gBAAgB,KAAe,QAA+B;AAC5E,SAAO,IAAI,UAAU,KAAK,MAAM;AAClC;","names":[]}
@@ -0,0 +1,139 @@
1
+ import { VorimSDK } from '../index.cjs';
2
+ import { P as PermissionScope } from '../types-zzK9YOoa.cjs';
3
+
4
+ type RampOperation = 'createLimit' | 'updateRestriction' | 'terminateCard';
5
+ interface RampConfig {
6
+ /** The acting agent's Vorim id (agid_...). */
7
+ agentId: string;
8
+ /** The person/team the agent acts for. Recorded and default escalation target. */
9
+ humanId?: string;
10
+ /** Attenuation: cap the limit amount an agent may create or raise, in minor
11
+ * units (cents). A createLimit / updateRestriction above this is denied or
12
+ * escalated. Omit for no ceiling. */
13
+ maxLimitAmount?: number;
14
+ /** Over the limit-amount ceiling, escalate to a named approver instead of
15
+ * denying. Default false. */
16
+ escalateOverCeiling?: boolean;
17
+ /** Named approver for an over-ceiling provisioning op. Defaults to humanId. */
18
+ approverId?: string;
19
+ /** Max wait for an escalation, ms. Default 300000 (a human sign-off). */
20
+ escalationTimeoutMs?: number;
21
+ /** Minimum trust score before an op. Default 0. */
22
+ minTrustScore?: number;
23
+ /** Fail closed (deny on any Vorim error) or fail open. Default 'closed'. */
24
+ onError?: 'closed' | 'open';
25
+ }
26
+ interface RampAction {
27
+ /** The Ramp operation, e.g. 'createLimit'. Drives the scope. */
28
+ operation: RampOperation | string;
29
+ /** The card / limit the op targets, when known. */
30
+ cardId?: string;
31
+ /** For createLimit / updateRestriction: the limit amount in minor units.
32
+ * Checked against maxLimitAmount. */
33
+ amount?: number;
34
+ /** The limit interval, e.g. 'MONTHLY'. Recorded. */
35
+ interval?: string;
36
+ /** Optional hash of the request body. */
37
+ inputHash?: string;
38
+ }
39
+ type LimitOutcome = 'within' | 'escalated-approved' | 'escalated-denied' | 'over-ceiling';
40
+ interface RampReceipt {
41
+ authorized: boolean;
42
+ agentId: string;
43
+ humanId?: string;
44
+ operation: string;
45
+ cardId?: string;
46
+ amount?: number;
47
+ interval?: string;
48
+ limitOutcome?: LimitOutcome;
49
+ approverId?: string;
50
+ result: 'success' | 'denied' | 'error';
51
+ scope: PermissionScope;
52
+ reason?: string;
53
+ decisionId?: string;
54
+ recorded: boolean;
55
+ }
56
+ declare class VorimRamp {
57
+ private sdk;
58
+ private agentId;
59
+ private humanId?;
60
+ private maxLimitAmount?;
61
+ private escalateOverCeiling;
62
+ private approverId?;
63
+ private escalationTimeoutMs;
64
+ private minTrustScore;
65
+ private onError;
66
+ constructor(sdk: VorimSDK, config: RampConfig);
67
+ private scopeFor;
68
+ /** Only createLimit / updateRestriction carry a limit amount to cap. */
69
+ private hasLimitAmount;
70
+ authorize(action: RampAction): Promise<{
71
+ authorized: boolean;
72
+ reason?: string;
73
+ outcome: LimitOutcome;
74
+ approverId?: string;
75
+ decisionId?: string;
76
+ }>;
77
+ private escalate;
78
+ record(action: RampAction, result: 'success' | 'denied' | 'error', extra?: {
79
+ reason?: string;
80
+ outcome?: LimitOutcome;
81
+ approverId?: string;
82
+ decisionId?: string;
83
+ }): Promise<boolean>;
84
+ guard<T>(action: RampAction, run: () => Promise<T>): Promise<{
85
+ receipt: RampReceipt;
86
+ value?: T;
87
+ }>;
88
+ /** Guard creating a limit / virtual card. Requires agent:write; the limit
89
+ * amount is checked against maxLimitAmount. */
90
+ guardedCreateLimit<T>(meta: {
91
+ amount?: number;
92
+ interval?: string;
93
+ cardId?: string;
94
+ inputHash?: string;
95
+ }, run: () => Promise<T>): Promise<{
96
+ receipt: RampReceipt;
97
+ value?: T | undefined;
98
+ }>;
99
+ /** Guard updating a card restriction (amount/interval/category/vendors).
100
+ * Requires agent:write; a raised amount is checked against the ceiling. */
101
+ guardedUpdateRestriction<T>(meta: {
102
+ cardId?: string;
103
+ amount?: number;
104
+ interval?: string;
105
+ inputHash?: string;
106
+ }, run: () => Promise<T>): Promise<{
107
+ receipt: RampReceipt;
108
+ value?: T | undefined;
109
+ }>;
110
+ /** Guard suspending / terminating a card. Requires agent:write. */
111
+ guardedTerminateCard<T>(meta: {
112
+ cardId?: string;
113
+ inputHash?: string;
114
+ }, run: () => Promise<T>): Promise<{
115
+ receipt: RampReceipt;
116
+ value?: T | undefined;
117
+ }>;
118
+ private receipt;
119
+ }
120
+ /**
121
+ * Create a VorimRamp guard around a Vorim SDK instance.
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * import createVorim from '@vorim/sdk';
126
+ * import { createVorimRamp } from '@vorim/sdk/integrations/ramp';
127
+ *
128
+ * const vorim = createVorim({ apiKey: 'agid_sk_...' });
129
+ * const ramp = createVorimRamp(vorim, { agentId: 'agid_abc123', maxLimitAmount: 500000 });
130
+ *
131
+ * const { receipt, value } = await ramp.guardedCreateLimit(
132
+ * { amount: 250000, interval: 'MONTHLY' },
133
+ * () => rampClient.limits.create({ ... }),
134
+ * );
135
+ * ```
136
+ */
137
+ declare function createVorimRamp(sdk: VorimSDK, config: RampConfig): VorimRamp;
138
+
139
+ export { type LimitOutcome, type RampAction, type RampConfig, type RampOperation, type RampReceipt, VorimRamp, createVorimRamp };
@@ -0,0 +1,139 @@
1
+ import { VorimSDK } from '../index.js';
2
+ import { P as PermissionScope } from '../types-zzK9YOoa.js';
3
+
4
+ type RampOperation = 'createLimit' | 'updateRestriction' | 'terminateCard';
5
+ interface RampConfig {
6
+ /** The acting agent's Vorim id (agid_...). */
7
+ agentId: string;
8
+ /** The person/team the agent acts for. Recorded and default escalation target. */
9
+ humanId?: string;
10
+ /** Attenuation: cap the limit amount an agent may create or raise, in minor
11
+ * units (cents). A createLimit / updateRestriction above this is denied or
12
+ * escalated. Omit for no ceiling. */
13
+ maxLimitAmount?: number;
14
+ /** Over the limit-amount ceiling, escalate to a named approver instead of
15
+ * denying. Default false. */
16
+ escalateOverCeiling?: boolean;
17
+ /** Named approver for an over-ceiling provisioning op. Defaults to humanId. */
18
+ approverId?: string;
19
+ /** Max wait for an escalation, ms. Default 300000 (a human sign-off). */
20
+ escalationTimeoutMs?: number;
21
+ /** Minimum trust score before an op. Default 0. */
22
+ minTrustScore?: number;
23
+ /** Fail closed (deny on any Vorim error) or fail open. Default 'closed'. */
24
+ onError?: 'closed' | 'open';
25
+ }
26
+ interface RampAction {
27
+ /** The Ramp operation, e.g. 'createLimit'. Drives the scope. */
28
+ operation: RampOperation | string;
29
+ /** The card / limit the op targets, when known. */
30
+ cardId?: string;
31
+ /** For createLimit / updateRestriction: the limit amount in minor units.
32
+ * Checked against maxLimitAmount. */
33
+ amount?: number;
34
+ /** The limit interval, e.g. 'MONTHLY'. Recorded. */
35
+ interval?: string;
36
+ /** Optional hash of the request body. */
37
+ inputHash?: string;
38
+ }
39
+ type LimitOutcome = 'within' | 'escalated-approved' | 'escalated-denied' | 'over-ceiling';
40
+ interface RampReceipt {
41
+ authorized: boolean;
42
+ agentId: string;
43
+ humanId?: string;
44
+ operation: string;
45
+ cardId?: string;
46
+ amount?: number;
47
+ interval?: string;
48
+ limitOutcome?: LimitOutcome;
49
+ approverId?: string;
50
+ result: 'success' | 'denied' | 'error';
51
+ scope: PermissionScope;
52
+ reason?: string;
53
+ decisionId?: string;
54
+ recorded: boolean;
55
+ }
56
+ declare class VorimRamp {
57
+ private sdk;
58
+ private agentId;
59
+ private humanId?;
60
+ private maxLimitAmount?;
61
+ private escalateOverCeiling;
62
+ private approverId?;
63
+ private escalationTimeoutMs;
64
+ private minTrustScore;
65
+ private onError;
66
+ constructor(sdk: VorimSDK, config: RampConfig);
67
+ private scopeFor;
68
+ /** Only createLimit / updateRestriction carry a limit amount to cap. */
69
+ private hasLimitAmount;
70
+ authorize(action: RampAction): Promise<{
71
+ authorized: boolean;
72
+ reason?: string;
73
+ outcome: LimitOutcome;
74
+ approverId?: string;
75
+ decisionId?: string;
76
+ }>;
77
+ private escalate;
78
+ record(action: RampAction, result: 'success' | 'denied' | 'error', extra?: {
79
+ reason?: string;
80
+ outcome?: LimitOutcome;
81
+ approverId?: string;
82
+ decisionId?: string;
83
+ }): Promise<boolean>;
84
+ guard<T>(action: RampAction, run: () => Promise<T>): Promise<{
85
+ receipt: RampReceipt;
86
+ value?: T;
87
+ }>;
88
+ /** Guard creating a limit / virtual card. Requires agent:write; the limit
89
+ * amount is checked against maxLimitAmount. */
90
+ guardedCreateLimit<T>(meta: {
91
+ amount?: number;
92
+ interval?: string;
93
+ cardId?: string;
94
+ inputHash?: string;
95
+ }, run: () => Promise<T>): Promise<{
96
+ receipt: RampReceipt;
97
+ value?: T | undefined;
98
+ }>;
99
+ /** Guard updating a card restriction (amount/interval/category/vendors).
100
+ * Requires agent:write; a raised amount is checked against the ceiling. */
101
+ guardedUpdateRestriction<T>(meta: {
102
+ cardId?: string;
103
+ amount?: number;
104
+ interval?: string;
105
+ inputHash?: string;
106
+ }, run: () => Promise<T>): Promise<{
107
+ receipt: RampReceipt;
108
+ value?: T | undefined;
109
+ }>;
110
+ /** Guard suspending / terminating a card. Requires agent:write. */
111
+ guardedTerminateCard<T>(meta: {
112
+ cardId?: string;
113
+ inputHash?: string;
114
+ }, run: () => Promise<T>): Promise<{
115
+ receipt: RampReceipt;
116
+ value?: T | undefined;
117
+ }>;
118
+ private receipt;
119
+ }
120
+ /**
121
+ * Create a VorimRamp guard around a Vorim SDK instance.
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * import createVorim from '@vorim/sdk';
126
+ * import { createVorimRamp } from '@vorim/sdk/integrations/ramp';
127
+ *
128
+ * const vorim = createVorim({ apiKey: 'agid_sk_...' });
129
+ * const ramp = createVorimRamp(vorim, { agentId: 'agid_abc123', maxLimitAmount: 500000 });
130
+ *
131
+ * const { receipt, value } = await ramp.guardedCreateLimit(
132
+ * { amount: 250000, interval: 'MONTHLY' },
133
+ * () => rampClient.limits.create({ ... }),
134
+ * );
135
+ * ```
136
+ */
137
+ declare function createVorimRamp(sdk: VorimSDK, config: RampConfig): VorimRamp;
138
+
139
+ export { type LimitOutcome, type RampAction, type RampConfig, type RampOperation, type RampReceipt, VorimRamp, createVorimRamp };