@vorim/sdk 3.12.0 → 3.16.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 (127) hide show
  1. package/dist/index.cjs +14 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +14 -2
  4. package/dist/index.d.ts +14 -2
  5. package/dist/index.js +14 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/integrations/anthropic.d.cts +1 -1
  8. package/dist/integrations/anthropic.d.ts +1 -1
  9. package/dist/integrations/ap2.d.cts +1 -1
  10. package/dist/integrations/ap2.d.ts +1 -1
  11. package/dist/integrations/aws-iam.cjs +225 -0
  12. package/dist/integrations/aws-iam.cjs.map +1 -0
  13. package/dist/integrations/aws-iam.d.cts +156 -0
  14. package/dist/integrations/aws-iam.d.ts +156 -0
  15. package/dist/integrations/aws-iam.js +199 -0
  16. package/dist/integrations/aws-iam.js.map +1 -0
  17. package/dist/integrations/bank-rails.d.cts +1 -1
  18. package/dist/integrations/bank-rails.d.ts +1 -1
  19. package/dist/integrations/circle.d.cts +1 -1
  20. package/dist/integrations/circle.d.ts +1 -1
  21. package/dist/integrations/cloudflare.d.cts +1 -1
  22. package/dist/integrations/cloudflare.d.ts +1 -1
  23. package/dist/integrations/coinbase-cdp.cjs +230 -0
  24. package/dist/integrations/coinbase-cdp.cjs.map +1 -0
  25. package/dist/integrations/coinbase-cdp.d.cts +169 -0
  26. package/dist/integrations/coinbase-cdp.d.ts +169 -0
  27. package/dist/integrations/coinbase-cdp.js +204 -0
  28. package/dist/integrations/coinbase-cdp.js.map +1 -0
  29. package/dist/integrations/crewai.d.cts +1 -1
  30. package/dist/integrations/crewai.d.ts +1 -1
  31. package/dist/integrations/entra.cjs +225 -0
  32. package/dist/integrations/entra.cjs.map +1 -0
  33. package/dist/integrations/entra.d.cts +155 -0
  34. package/dist/integrations/entra.d.ts +155 -0
  35. package/dist/integrations/entra.js +199 -0
  36. package/dist/integrations/entra.js.map +1 -0
  37. package/dist/integrations/fhir.cjs +304 -0
  38. package/dist/integrations/fhir.cjs.map +1 -0
  39. package/dist/integrations/fhir.d.cts +185 -0
  40. package/dist/integrations/fhir.d.ts +185 -0
  41. package/dist/integrations/fhir.js +278 -0
  42. package/dist/integrations/fhir.js.map +1 -0
  43. package/dist/integrations/guidewire.cjs +363 -0
  44. package/dist/integrations/guidewire.cjs.map +1 -0
  45. package/dist/integrations/guidewire.d.cts +258 -0
  46. package/dist/integrations/guidewire.d.ts +258 -0
  47. package/dist/integrations/guidewire.js +337 -0
  48. package/dist/integrations/guidewire.js.map +1 -0
  49. package/dist/integrations/hermes.d.cts +1 -1
  50. package/dist/integrations/hermes.d.ts +1 -1
  51. package/dist/integrations/langchain.d.cts +1 -1
  52. package/dist/integrations/langchain.d.ts +1 -1
  53. package/dist/integrations/langgraph.d.cts +1 -1
  54. package/dist/integrations/langgraph.d.ts +1 -1
  55. package/dist/integrations/legal.cjs +339 -0
  56. package/dist/integrations/legal.cjs.map +1 -0
  57. package/dist/integrations/legal.d.cts +225 -0
  58. package/dist/integrations/legal.d.ts +225 -0
  59. package/dist/integrations/legal.js +313 -0
  60. package/dist/integrations/legal.js.map +1 -0
  61. package/dist/integrations/life-sciences.cjs +335 -0
  62. package/dist/integrations/life-sciences.cjs.map +1 -0
  63. package/dist/integrations/life-sciences.d.cts +214 -0
  64. package/dist/integrations/life-sciences.d.ts +214 -0
  65. package/dist/integrations/life-sciences.js +309 -0
  66. package/dist/integrations/life-sciences.js.map +1 -0
  67. package/dist/integrations/lithic.cjs +290 -0
  68. package/dist/integrations/lithic.cjs.map +1 -0
  69. package/dist/integrations/lithic.d.cts +130 -0
  70. package/dist/integrations/lithic.d.ts +130 -0
  71. package/dist/integrations/lithic.js +264 -0
  72. package/dist/integrations/lithic.js.map +1 -0
  73. package/dist/integrations/llamaindex.d.cts +1 -1
  74. package/dist/integrations/llamaindex.d.ts +1 -1
  75. package/dist/integrations/marqeta.cjs +285 -0
  76. package/dist/integrations/marqeta.cjs.map +1 -0
  77. package/dist/integrations/marqeta.d.cts +121 -0
  78. package/dist/integrations/marqeta.d.ts +121 -0
  79. package/dist/integrations/marqeta.js +259 -0
  80. package/dist/integrations/marqeta.js.map +1 -0
  81. package/dist/integrations/modern-treasury.d.cts +1 -1
  82. package/dist/integrations/modern-treasury.d.ts +1 -1
  83. package/dist/integrations/nekuda.d.cts +1 -1
  84. package/dist/integrations/nekuda.d.ts +1 -1
  85. package/dist/integrations/okta.cjs +229 -0
  86. package/dist/integrations/okta.cjs.map +1 -0
  87. package/dist/integrations/okta.d.cts +172 -0
  88. package/dist/integrations/okta.d.ts +172 -0
  89. package/dist/integrations/okta.js +203 -0
  90. package/dist/integrations/okta.js.map +1 -0
  91. package/dist/integrations/openai.d.cts +1 -1
  92. package/dist/integrations/openai.d.ts +1 -1
  93. package/dist/integrations/paypal-agent.d.cts +1 -1
  94. package/dist/integrations/paypal-agent.d.ts +1 -1
  95. package/dist/integrations/plaid.d.cts +1 -1
  96. package/dist/integrations/plaid.d.ts +1 -1
  97. package/dist/integrations/ramp.cjs +206 -0
  98. package/dist/integrations/ramp.cjs.map +1 -0
  99. package/dist/integrations/ramp.d.cts +139 -0
  100. package/dist/integrations/ramp.d.ts +139 -0
  101. package/dist/integrations/ramp.js +180 -0
  102. package/dist/integrations/ramp.js.map +1 -0
  103. package/dist/integrations/shopify.d.cts +1 -1
  104. package/dist/integrations/shopify.d.ts +1 -1
  105. package/dist/integrations/siem.d.cts +1 -1
  106. package/dist/integrations/siem.d.ts +1 -1
  107. package/dist/integrations/skyfire.d.cts +1 -1
  108. package/dist/integrations/skyfire.d.ts +1 -1
  109. package/dist/integrations/stripe-acp.d.cts +1 -1
  110. package/dist/integrations/stripe-acp.d.ts +1 -1
  111. package/dist/integrations/stripe-issuing.cjs +316 -0
  112. package/dist/integrations/stripe-issuing.cjs.map +1 -0
  113. package/dist/integrations/stripe-issuing.d.cts +154 -0
  114. package/dist/integrations/stripe-issuing.d.ts +154 -0
  115. package/dist/integrations/stripe-issuing.js +290 -0
  116. package/dist/integrations/stripe-issuing.js.map +1 -0
  117. package/dist/integrations/truanon.d.cts +1 -1
  118. package/dist/integrations/truanon.d.ts +1 -1
  119. package/dist/integrations/ucp.d.cts +1 -1
  120. package/dist/integrations/ucp.d.ts +1 -1
  121. package/dist/integrations/vercel-ai.d.cts +1 -1
  122. package/dist/integrations/vercel-ai.d.ts +1 -1
  123. package/dist/integrations/x402.d.cts +1 -1
  124. package/dist/integrations/x402.d.ts +1 -1
  125. package/dist/{types-zzK9YOoa.d.cts → types-Lp1iHEDz.d.cts} +21 -1
  126. package/dist/{types-zzK9YOoa.d.ts → types-Lp1iHEDz.d.ts} +21 -1
  127. package/package.json +121 -1
@@ -0,0 +1,203 @@
1
+ // src/integrations/okta.ts
2
+ var ESCALATION_OPS = /* @__PURE__ */ new Set(["grantRole", "createApiToken"]);
3
+ var OPERATION_SCOPE = {
4
+ read: "agent:read",
5
+ createUser: "agent:write",
6
+ deactivateUser: "agent:write",
7
+ assignAppToUser: "agent:write",
8
+ addUserToGroup: "agent:write",
9
+ grantRole: "agent:elevate",
10
+ createApiToken: "agent:elevate"
11
+ };
12
+ var VorimOkta = class {
13
+ sdk;
14
+ agentId;
15
+ orgUrl;
16
+ adminId;
17
+ minTrustScore;
18
+ escalatePrivileged;
19
+ escalationTimeoutMs;
20
+ onError;
21
+ constructor(sdk, config) {
22
+ if (!config?.agentId) throw new Error("[vorim] Okta integration requires an agentId.");
23
+ if (!config?.orgUrl) throw new Error("[vorim] Okta integration requires an orgUrl.");
24
+ this.sdk = sdk;
25
+ this.agentId = config.agentId;
26
+ this.orgUrl = config.orgUrl;
27
+ this.adminId = config.adminId;
28
+ this.minTrustScore = config.minTrustScore ?? 0;
29
+ this.escalatePrivileged = config.escalatePrivileged ?? true;
30
+ this.escalationTimeoutMs = config.escalationTimeoutMs ?? 3e5;
31
+ this.onError = config.onError ?? "closed";
32
+ }
33
+ isPrivileged(operation) {
34
+ return ESCALATION_OPS.has(operation);
35
+ }
36
+ scopeFor(operation) {
37
+ return OPERATION_SCOPE[operation] ?? "agent:write";
38
+ }
39
+ /**
40
+ * Decide whether the acting agent may run this operation, before it runs.
41
+ * Order: trust floor, then the privileged gate (escalate a role grant or token
42
+ * mint to the named admin), then permission scope.
43
+ */
44
+ async authorize(action) {
45
+ const privileged = this.isPrivileged(action.operation);
46
+ const scope = this.scopeFor(action.operation);
47
+ try {
48
+ if (this.minTrustScore > 0) {
49
+ const trust = await this.sdk.verify(this.agentId);
50
+ if ((trust?.trust_score ?? 0) < this.minTrustScore) {
51
+ return { authorized: false, reason: `trust score below ${this.minTrustScore}`, outcome: privileged ? "privileged-denied" : "ordinary" };
52
+ }
53
+ }
54
+ if (privileged) {
55
+ if (!this.escalatePrivileged) {
56
+ return { authorized: false, reason: `${action.operation} requires a human admin and escalatePrivileged is off`, outcome: "privileged-denied" };
57
+ }
58
+ if (!this.adminId) {
59
+ return {
60
+ authorized: false,
61
+ reason: `${action.operation} requires a configured adminId (the approving human admin)`,
62
+ outcome: "privileged-denied"
63
+ };
64
+ }
65
+ const esc = await this.escalate(action, scope);
66
+ return {
67
+ authorized: esc.approved,
68
+ reason: esc.approved ? void 0 : esc.reason ?? "admin did not approve",
69
+ outcome: esc.approved ? "approved-by-admin" : "privileged-denied",
70
+ adminId: esc.approved ? this.adminId : void 0,
71
+ decisionId: esc.decisionId
72
+ };
73
+ }
74
+ const perm = await this.sdk.check(this.agentId, scope);
75
+ return perm.allowed ? { authorized: true, outcome: "ordinary", adminId: this.adminId } : { authorized: false, reason: perm.reason ?? `missing scope ${scope}`, outcome: "ordinary" };
76
+ } catch (e) {
77
+ return this.onError === "open" ? { authorized: true, reason: "vorim unreachable, failed open", outcome: privileged ? "approved-by-admin" : "ordinary" } : { authorized: false, reason: `vorim unreachable: ${e?.message ?? "error"}`, outcome: privileged ? "privileged-denied" : "ordinary" };
78
+ }
79
+ }
80
+ async escalate(action, scope) {
81
+ const decision = await this.sdk.beforeAction(
82
+ {
83
+ agentId: this.agentId,
84
+ actionType: "api_request",
85
+ actionTarget: `okta:${action.operation}`,
86
+ requiredScope: scope,
87
+ payload: { operation: action.operation, target_id: action.targetId, role: action.role },
88
+ context: { integration: "okta", org_url: this.orgUrl, requires_human_admin: true, admin_hint: this.adminId }
89
+ },
90
+ { throwOnDeny: false }
91
+ );
92
+ if (decision.decision === "escalate") {
93
+ const resolved = await this.sdk.waitForDecisionResolution(decision.decisionId, { timeoutMs: this.escalationTimeoutMs });
94
+ const approved = resolved.decision === "allow" || resolved.escalationResolution === "approved";
95
+ return { approved, reason: approved ? void 0 : "admin refused", decisionId: decision.decisionId };
96
+ }
97
+ if (decision.decision === "allow") return { approved: true, decisionId: decision.decisionId };
98
+ if (decision.decision === "fallback")
99
+ return { approved: this.onError === "open", reason: "runtime unreachable", decisionId: decision.decisionId };
100
+ return { approved: false, reason: decision.reason ?? "denied", decisionId: decision.decisionId };
101
+ }
102
+ async record(action, result, extra = {}) {
103
+ const scope = this.scopeFor(action.operation);
104
+ try {
105
+ await this.sdk.emit(
106
+ {
107
+ agent_id: this.agentId,
108
+ event_type: "api_request",
109
+ action: `okta:${action.operation}${action.targetId ? " " + action.targetId : ""}`,
110
+ resource: action.targetId || this.orgUrl,
111
+ permission: scope,
112
+ result,
113
+ input_hash: action.inputHash,
114
+ metadata: {
115
+ integration: "okta",
116
+ org_url: this.orgUrl,
117
+ operation: action.operation,
118
+ privileged: this.isPrivileged(action.operation),
119
+ ...action.role ? { role: action.role } : {},
120
+ ...extra.outcome ? { outcome: extra.outcome } : {},
121
+ ...extra.adminId ?? this.adminId ? { approved_by_admin: extra.adminId ?? this.adminId } : {},
122
+ ...extra.decisionId ? { decision_id: extra.decisionId } : {},
123
+ ...extra.reason ? { reason: extra.reason } : {}
124
+ }
125
+ },
126
+ { sign: true }
127
+ );
128
+ return true;
129
+ } catch {
130
+ return false;
131
+ }
132
+ }
133
+ async guard(action, run) {
134
+ const auth = await this.authorize(action);
135
+ if (!auth.authorized) {
136
+ const recorded = await this.record(action, "denied", { reason: auth.reason, outcome: auth.outcome, adminId: auth.adminId, decisionId: auth.decisionId });
137
+ return { receipt: this.receipt(action, false, "denied", auth, recorded) };
138
+ }
139
+ try {
140
+ const value = await run();
141
+ const recorded = await this.record(action, "success", { outcome: auth.outcome, adminId: auth.adminId, decisionId: auth.decisionId });
142
+ return { receipt: this.receipt(action, true, "success", auth, recorded), value };
143
+ } catch (e) {
144
+ const recorded = await this.record(action, "error", { reason: e?.message, outcome: auth.outcome, adminId: auth.adminId, decisionId: auth.decisionId });
145
+ throw Object.assign(e ?? new Error("okta operation failed"), {
146
+ vorimReceipt: this.receipt(action, true, "error", { ...auth, reason: e?.message }, recorded)
147
+ });
148
+ }
149
+ }
150
+ // --- Named helpers ---------------------------------------------------------
151
+ /** Guard creating a user (POST /api/v1/users). Requires agent:write. */
152
+ guardedCreateUser(meta, run) {
153
+ return this.guard({ operation: "createUser", targetId: meta.targetId, inputHash: meta.inputHash }, run);
154
+ }
155
+ /** Guard deactivating a user. Requires agent:write. */
156
+ guardedDeactivateUser(meta, run) {
157
+ return this.guard({ operation: "deactivateUser", targetId: meta.targetId, inputHash: meta.inputHash }, run);
158
+ }
159
+ /** Guard assigning an app to a user. Requires agent:write. */
160
+ guardedAssignAppToUser(meta, run) {
161
+ return this.guard({ operation: "assignAppToUser", targetId: meta.targetId, inputHash: meta.inputHash }, run);
162
+ }
163
+ /** Guard adding a user to a group. Requires agent:write. */
164
+ guardedAddUserToGroup(meta, run) {
165
+ return this.guard({ operation: "addUserToGroup", targetId: meta.targetId, inputHash: meta.inputHash }, run);
166
+ }
167
+ /** Guard granting an admin role (POST /api/v1/users/{id}/roles). Always
168
+ * escalates to the named admin. Pass the role (e.g. 'SUPER_ADMIN'). */
169
+ guardedGrantRole(meta, run) {
170
+ return this.guard({ operation: "grantRole", targetId: meta.targetId, role: meta.role, inputHash: meta.inputHash }, run);
171
+ }
172
+ /** Guard creating / rotating an API token (mints a long-lived, unscoped
173
+ * full-admin credential). Always escalates to the named admin. */
174
+ guardedCreateApiToken(meta, run) {
175
+ return this.guard({ operation: "createApiToken", targetId: meta.targetId, inputHash: meta.inputHash }, run);
176
+ }
177
+ receipt(action, authorized, result, auth, recorded) {
178
+ return {
179
+ authorized,
180
+ agentId: this.agentId,
181
+ orgUrl: this.orgUrl,
182
+ operation: action.operation,
183
+ targetId: action.targetId,
184
+ role: action.role,
185
+ privileged: this.isPrivileged(action.operation),
186
+ outcome: auth.outcome ?? "ordinary",
187
+ adminId: auth.adminId ?? this.adminId,
188
+ result,
189
+ scope: this.scopeFor(action.operation),
190
+ reason: auth.reason,
191
+ decisionId: auth.decisionId,
192
+ recorded
193
+ };
194
+ }
195
+ };
196
+ function createVorimOkta(sdk, config) {
197
+ return new VorimOkta(sdk, config);
198
+ }
199
+ export {
200
+ VorimOkta,
201
+ createVorimOkta
202
+ };
203
+ //# sourceMappingURL=okta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/integrations/okta.ts"],"sourcesContent":["// ============================================================================\n// Vorim AI — Okta (Management API) Integration\n//\n// This guards an AI agent that administers an Okta org through the Okta\n// Management API — creating users, assigning apps, managing groups, granting\n// admin roles, minting API tokens. Before each write runs it verifies the\n// acting agent's Vorim identity and scoped permission, and for the two highest-\n// stakes operations (granting an admin role, minting an API token) it escalates\n// to a named human admin and waits. Either way it signs a tamper-evident record\n// of which agent did what, under which authority, and who approved it.\n//\n// WHY THIS LAYER\n// An Okta SSWS API token is unscoped: it inherits the full permissions of the\n// admin who created it, so an agent holding one can do anything that admin can,\n// and nothing proves which agent (not which other) made a given change. Vorim\n// binds each Management API write to a verified agent identity, caps what a\n// delegated agent may do, forces a human into the loop for the dangerous ops,\n// and signs the record. It composes with Okta's own OAuth-for-Okta service-app\n// model rather than replacing it: the closure holds the service-app key, Vorim\n// never does.\n//\n// THE ESCALATION RULE (the wedge)\n// Two operations mint or escalate standing authority and must always route to a\n// named human admin: granting an admin role (especially SUPER_ADMIN) and\n// creating/rotating an API token (which mints a long-lived, unscoped full-admin\n// credential). An agent may propose these; a human authorizes them.\n//\n// SCOPE MAPPING (uses Vorim's real scopes)\n// read directory -> agent:read\n// create/deactivate user, assign -> agent:write\n// app, manage group membership\n// grant admin role / mint token -> agent:elevate (named-admin approval;\n// segregation of duties)\n//\n// HONEST COMPLIANCE FRAMING\n// A signed, attributable record of each identity change supports SOC 2 (CC6\n// logical access, CC7 change monitoring) and access-governance review. No regime\n// mandates cryptographic signatures on audit logs; signing is a stronger-than-\n// required way to satisfy the tamper-evident + attributable intent. Say\n// \"cryptographic proof of which agent made which change, verifiable offline\",\n// never \"required for compliance\".\n//\n// This layer never holds the Okta token and never calls Okta itself. You pass\n// the Okta SDK / Management API call as a closure; it authorizes, escalates if\n// needed, runs it, and signs the receipt.\n//\n// Usage:\n// import createVorim from '@vorim/sdk';\n// import { createVorimOkta } from '@vorim/sdk/integrations/okta';\n//\n// const vorim = createVorim({ apiKey: 'agid_sk_...' });\n// const okta = createVorimOkta(vorim, {\n// agentId: 'agid_abc123',\n// orgUrl: 'https://acme.okta.com',\n// adminId: 'admin_42', // the human who approves privileged ops\n// });\n//\n// const { receipt, value } = await okta.guardedCreateUser(\n// { targetId: 'user email or login' },\n// () => oktaClient.userApi.createUser({ body }),\n// );\n// ============================================================================\n\nimport type { VorimSDK } from '../index.js';\nimport type { PermissionScope } from '../types.js';\n\n/** The Okta Management API operations this guard classifies. */\nexport type OktaOperation =\n | 'createUser' // POST /api/v1/users\n | 'deactivateUser' // POST /api/v1/users/{id}/lifecycle/deactivate\n | 'assignAppToUser' // POST /api/v1/apps/{appId}/users\n | 'addUserToGroup' // PUT /api/v1/groups/{groupId}/users/{userId}\n | 'grantRole' // POST /api/v1/users/{id}/roles (admin role)\n | 'createApiToken' // mint / rotate an API token\n | 'read';\n\n/** Operations that mint or escalate standing authority — always escalate to a\n * named human admin. */\nconst ESCALATION_OPS = new Set<string>(['grantRole', 'createApiToken']);\n\nconst OPERATION_SCOPE: Record<string, PermissionScope> = {\n read: 'agent:read',\n createUser: 'agent:write',\n deactivateUser: 'agent:write',\n assignAppToUser: 'agent:write',\n addUserToGroup: 'agent:write',\n grantRole: 'agent:elevate',\n createApiToken: 'agent:elevate',\n};\n\nexport interface OktaGuardConfig {\n /** The acting agent's Vorim id (agid_...). */\n agentId: string;\n /** The Okta org URL, e.g. 'https://acme.okta.com'. Recorded on every receipt\n * so a change is attributable to one org. */\n orgUrl: string;\n /** The human admin who approves privileged operations (grant role, mint\n * token). Required if any escalation-class op will be run. Recorded as the\n * approver. */\n adminId?: string;\n /** Minimum trust score the agent must hold before any write. Default 0. */\n minTrustScore?: number;\n /** For a privileged op, escalate to the named admin and wait for approval\n * instead of denying. Requires the runtime decision plane. Default true (an\n * unapproved role grant or token mint is exactly what this exists to stop). */\n escalatePrivileged?: boolean;\n /** Max time to wait for admin approval, ms. Default 300000 (5 min). */\n escalationTimeoutMs?: number;\n /** Fail closed (deny on any Vorim error) or fail open. Default 'closed'. */\n onError?: 'closed' | 'open';\n}\n\nexport interface OktaAction {\n /** The Okta operation, e.g. 'createUser'. Drives the scope and whether the op\n * is escalation-class. Unknown labels default to write. */\n operation: OktaOperation | string;\n /** The target the action affects (user id/login, app id, group id). Recorded\n * for attribution. */\n targetId?: string;\n /** For grantRole: the role being granted, e.g. 'SUPER_ADMIN'. Recorded. */\n role?: string;\n /** Optional hash of the request body. */\n inputHash?: string;\n}\n\n/** How a privileged op resolved. */\nexport type OktaOutcome = 'ordinary' | 'approved-by-admin' | 'privileged-denied';\n\n/** An offline-verifiable receipt for one Okta Management API operation. */\nexport interface OktaReceipt {\n authorized: boolean;\n agentId: string;\n orgUrl: string;\n operation: string;\n targetId?: string;\n role?: string;\n /** True when the op mints/escalates authority (needs a human admin). */\n privileged: boolean;\n outcome: OktaOutcome;\n /** The admin recorded on the action. */\n adminId?: string;\n result: 'success' | 'denied' | 'error';\n scope: PermissionScope;\n reason?: string;\n decisionId?: string;\n recorded: boolean;\n}\n\nexport class VorimOkta {\n private sdk: VorimSDK;\n private agentId: string;\n private orgUrl: string;\n private adminId?: string;\n private minTrustScore: number;\n private escalatePrivileged: boolean;\n private escalationTimeoutMs: number;\n private onError: 'closed' | 'open';\n\n constructor(sdk: VorimSDK, config: OktaGuardConfig) {\n if (!config?.agentId) throw new Error('[vorim] Okta integration requires an agentId.');\n if (!config?.orgUrl) throw new Error('[vorim] Okta integration requires an orgUrl.');\n this.sdk = sdk;\n this.agentId = config.agentId;\n this.orgUrl = config.orgUrl;\n this.adminId = config.adminId;\n this.minTrustScore = config.minTrustScore ?? 0;\n this.escalatePrivileged = config.escalatePrivileged ?? true;\n this.escalationTimeoutMs = config.escalationTimeoutMs ?? 300_000;\n this.onError = config.onError ?? 'closed';\n }\n\n private isPrivileged(operation: string): boolean {\n return ESCALATION_OPS.has(operation);\n }\n\n private scopeFor(operation: string): PermissionScope {\n return OPERATION_SCOPE[operation] ?? 'agent:write';\n }\n\n /**\n * Decide whether the acting agent may run this operation, before it runs.\n * Order: trust floor, then the privileged gate (escalate a role grant or token\n * mint to the named admin), then permission scope.\n */\n async authorize(\n action: OktaAction,\n ): Promise<{ authorized: boolean; reason?: string; outcome: OktaOutcome; adminId?: string; decisionId?: string }> {\n const privileged = this.isPrivileged(action.operation);\n const scope = this.scopeFor(action.operation);\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: privileged ? 'privileged-denied' : 'ordinary' };\n }\n }\n\n if (privileged) {\n if (!this.escalatePrivileged) {\n return { authorized: false, reason: `${action.operation} requires a human admin and escalatePrivileged is off`, outcome: 'privileged-denied' };\n }\n if (!this.adminId) {\n return {\n authorized: false,\n reason: `${action.operation} requires a configured adminId (the approving human admin)`,\n outcome: 'privileged-denied',\n };\n }\n const esc = await this.escalate(action, scope);\n return {\n authorized: esc.approved,\n reason: esc.approved ? undefined : (esc.reason ?? 'admin did not approve'),\n outcome: esc.approved ? 'approved-by-admin' : 'privileged-denied',\n adminId: esc.approved ? this.adminId : undefined,\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: 'ordinary', adminId: this.adminId }\n : { authorized: false, reason: perm.reason ?? `missing scope ${scope}`, outcome: 'ordinary' };\n } catch (e: any) {\n return this.onError === 'open'\n ? { authorized: true, reason: 'vorim unreachable, failed open', outcome: privileged ? 'approved-by-admin' : 'ordinary' }\n : { authorized: false, reason: `vorim unreachable: ${e?.message ?? 'error'}`, outcome: privileged ? 'privileged-denied' : 'ordinary' };\n }\n }\n\n private async escalate(action: OktaAction, 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: `okta:${action.operation}`,\n requiredScope: scope,\n payload: { operation: action.operation, target_id: action.targetId, role: action.role },\n context: { integration: 'okta', org_url: this.orgUrl, requires_human_admin: true, admin_hint: this.adminId },\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 : 'admin refused', 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: OktaAction,\n result: 'success' | 'denied' | 'error',\n extra: { reason?: string; outcome?: OktaOutcome; adminId?: 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: `okta:${action.operation}${action.targetId ? ' ' + action.targetId : ''}`,\n resource: action.targetId || this.orgUrl,\n permission: scope,\n result,\n input_hash: action.inputHash,\n metadata: {\n integration: 'okta',\n org_url: this.orgUrl,\n operation: action.operation,\n privileged: this.isPrivileged(action.operation),\n ...(action.role ? { role: action.role } : {}),\n ...(extra.outcome ? { outcome: extra.outcome } : {}),\n ...(extra.adminId ?? this.adminId ? { approved_by_admin: extra.adminId ?? this.adminId } : {}),\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: OktaAction, run: () => Promise<T>): Promise<{ receipt: OktaReceipt; 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, adminId: auth.adminId, 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, adminId: auth.adminId, 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, adminId: auth.adminId, decisionId: auth.decisionId });\n throw Object.assign(e ?? new Error('okta 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 user (POST /api/v1/users). Requires agent:write. */\n guardedCreateUser<T>(meta: { targetId?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'createUser', targetId: meta.targetId, inputHash: meta.inputHash }, run);\n }\n\n /** Guard deactivating a user. Requires agent:write. */\n guardedDeactivateUser<T>(meta: { targetId?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'deactivateUser', targetId: meta.targetId, inputHash: meta.inputHash }, run);\n }\n\n /** Guard assigning an app to a user. Requires agent:write. */\n guardedAssignAppToUser<T>(meta: { targetId?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'assignAppToUser', targetId: meta.targetId, inputHash: meta.inputHash }, run);\n }\n\n /** Guard adding a user to a group. Requires agent:write. */\n guardedAddUserToGroup<T>(meta: { targetId?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'addUserToGroup', targetId: meta.targetId, inputHash: meta.inputHash }, run);\n }\n\n /** Guard granting an admin role (POST /api/v1/users/{id}/roles). Always\n * escalates to the named admin. Pass the role (e.g. 'SUPER_ADMIN'). */\n guardedGrantRole<T>(meta: { targetId?: string; role?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'grantRole', targetId: meta.targetId, role: meta.role, inputHash: meta.inputHash }, run);\n }\n\n /** Guard creating / rotating an API token (mints a long-lived, unscoped\n * full-admin credential). Always escalates to the named admin. */\n guardedCreateApiToken<T>(meta: { targetId?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'createApiToken', targetId: meta.targetId, inputHash: meta.inputHash }, run);\n }\n\n private receipt(\n action: OktaAction,\n authorized: boolean,\n result: 'success' | 'denied' | 'error',\n auth: { reason?: string; outcome?: OktaOutcome; adminId?: string; decisionId?: string },\n recorded: boolean,\n ): OktaReceipt {\n return {\n authorized,\n agentId: this.agentId,\n orgUrl: this.orgUrl,\n operation: action.operation,\n targetId: action.targetId,\n role: action.role,\n privileged: this.isPrivileged(action.operation),\n outcome: auth.outcome ?? 'ordinary',\n adminId: auth.adminId ?? this.adminId,\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 VorimOkta guard around a Vorim SDK instance.\n *\n * @example\n * ```typescript\n * import createVorim from '@vorim/sdk';\n * import { createVorimOkta } from '@vorim/sdk/integrations/okta';\n *\n * const vorim = createVorim({ apiKey: 'agid_sk_...' });\n * const okta = createVorimOkta(vorim, {\n * agentId: 'agid_abc123',\n * orgUrl: 'https://acme.okta.com',\n * adminId: 'admin_42',\n * });\n *\n * // A role grant always escalates to the named admin:\n * const { receipt } = await okta.guardedGrantRole(\n * { targetId: 'user_9', role: 'SUPER_ADMIN' },\n * () => oktaClient.roleAssignmentApi.assignRoleToUser({ userId: 'user_9', assignRoleRequest }),\n * );\n * ```\n */\nexport function createVorimOkta(sdk: VorimSDK, config: OktaGuardConfig): VorimOkta {\n return new VorimOkta(sdk, config);\n}\n"],"mappings":";AA8EA,IAAM,iBAAiB,oBAAI,IAAY,CAAC,aAAa,gBAAgB,CAAC;AAEtE,IAAM,kBAAmD;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,gBAAgB;AAClB;AA4DO,IAAM,YAAN,MAAgB;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,KAAe,QAAyB;AAClD,QAAI,CAAC,QAAQ,QAAS,OAAM,IAAI,MAAM,+CAA+C;AACrF,QAAI,CAAC,QAAQ,OAAQ,OAAM,IAAI,MAAM,8CAA8C;AACnF,SAAK,MAAM;AACX,SAAK,UAAU,OAAO;AACtB,SAAK,SAAS,OAAO;AACrB,SAAK,UAAU,OAAO;AACtB,SAAK,gBAAgB,OAAO,iBAAiB;AAC7C,SAAK,qBAAqB,OAAO,sBAAsB;AACvD,SAAK,sBAAsB,OAAO,uBAAuB;AACzD,SAAK,UAAU,OAAO,WAAW;AAAA,EACnC;AAAA,EAEQ,aAAa,WAA4B;AAC/C,WAAO,eAAe,IAAI,SAAS;AAAA,EACrC;AAAA,EAEQ,SAAS,WAAoC;AACnD,WAAO,gBAAgB,SAAS,KAAK;AA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WAAW,KAAK,UAAU,GAAG,GAAG;AAAA,EACxH;AAAA;AAAA;AAAA,EAIA,sBAAyB,MAAiD,KAAuB;AAC/F,WAAO,KAAK,MAAM,EAAE,WAAW,kBAAkB,UAAU,KAAK,UAAU,WAAW,KAAK,UAAU,GAAG,GAAG;AAAA,EAC5G;AAAA,EAEQ,QACN,QACA,YACA,QACA,MACA,UACa;AACb,WAAO;AAAA,MACL;AAAA,MACA,SAAS,KAAK;AAAA,MACd,QAAQ,KAAK;AAAA,MACb,WAAW,OAAO;AAAA,MAClB,UAAU,OAAO;AAAA,MACjB,MAAM,OAAO;AAAA,MACb,YAAY,KAAK,aAAa,OAAO,SAAS;AAAA,MAC9C,SAAS,KAAK,WAAW;AAAA,MACzB,SAAS,KAAK,WAAW,KAAK;AAAA,MAC9B;AAAA,MACA,OAAO,KAAK,SAAS,OAAO,SAAS;AAAA,MACrC,QAAQ,KAAK;AAAA,MACb,YAAY,KAAK;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;AAwBO,SAAS,gBAAgB,KAAe,QAAoC;AACjF,SAAO,IAAI,UAAU,KAAK,MAAM;AAClC;","names":[]}
@@ -1,4 +1,4 @@
1
- import { P as PermissionScope, A as AgentRegistrationResult } from '../types-zzK9YOoa.cjs';
1
+ import { P as PermissionScope, A as AgentRegistrationResult } from '../types-Lp1iHEDz.cjs';
2
2
  import { VorimSDK, ReplayInputs } from '../index.cjs';
3
3
  import { E as EscalationPolicy, T as TransportFailurePolicy } from '../_runtime-gate-DOJUKJBu.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { P as PermissionScope, A as AgentRegistrationResult } from '../types-zzK9YOoa.js';
1
+ import { P as PermissionScope, A as AgentRegistrationResult } from '../types-Lp1iHEDz.js';
2
2
  import { VorimSDK, ReplayInputs } from '../index.js';
3
3
  import { E as EscalationPolicy, T as TransportFailurePolicy } from '../_runtime-gate-DOJUKJBu.js';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { VorimSDK } from '../index.cjs';
2
- import '../types-zzK9YOoa.cjs';
2
+ import '../types-Lp1iHEDz.cjs';
3
3
 
4
4
  interface PayPalConfig {
5
5
  apiKey: string;
@@ -1,5 +1,5 @@
1
1
  import { VorimSDK } from '../index.js';
2
- import '../types-zzK9YOoa.js';
2
+ import '../types-Lp1iHEDz.js';
3
3
 
4
4
  interface PayPalConfig {
5
5
  apiKey: string;
@@ -1,5 +1,5 @@
1
1
  import { VorimSDK } from '../index.cjs';
2
- import '../types-zzK9YOoa.cjs';
2
+ import '../types-Lp1iHEDz.cjs';
3
3
 
4
4
  type PlaidEnvironment = 'sandbox' | 'production';
5
5
  type PlaidAchClass = 'ppd' | 'ccd' | 'web' | 'tel';
@@ -1,5 +1,5 @@
1
1
  import { VorimSDK } from '../index.js';
2
- import '../types-zzK9YOoa.js';
2
+ import '../types-Lp1iHEDz.js';
3
3
 
4
4
  type PlaidEnvironment = 'sandbox' | 'production';
5
5
  type PlaidAchClass = 'ppd' | 'ccd' | 'web' | 'tel';
@@ -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;AACtB,SAAK,iBAAiB,OAAO;AAC7B,SAAK,sBAAsB,OAAO,uBAAuB;AACzD,SAAK,aAAa,OAAO,cAAc,OAAO;AAC9C,SAAK,sBAAsB,OAAO,uBAAuB;AACzD,SAAK,gBAAgB,OAAO,iBAAiB;AAC7C,SAAK,UAAU,OAAO,WAAW;AAAA,EACnC;AAAA,EAEQ,SAAS,WAAoC;AACnD,WAAO,gBAAgB,SAAS,KAAK;AAAA,EACvC;AAAA;AAAA,EAGQ,eAAe,WAA4B;AACjD,WAAO,cAAc,iBAAiB,cAAc;AAAA,EACtD;AAAA,EAEA,MAAM,UACJ,QACoH;AACpH,UAAM,QAAQ,KAAK,SAAS,OAAO,SAAS;AAC5C,UAAM,cACJ,KAAK,eAAe,OAAO,SAAS,KACpC,KAAK,kBAAkB,QACvB,OAAO,OAAO,WAAW,YACzB,OAAO,SAAS,KAAK;AAEvB,QAAI;AACF,UAAI,KAAK,gBAAgB,GAAG;AAC1B,cAAM,QAAQ,MAAM,KAAK,IAAI,OAAO,KAAK,OAAO;AAChD,a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