@vorim/sdk 3.18.2 → 3.20.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 (109) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +73 -1
  3. package/dist/index.cjs +145 -7
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +111 -3
  6. package/dist/index.d.ts +111 -3
  7. package/dist/index.js +138 -7
  8. package/dist/index.js.map +1 -1
  9. package/dist/integrations/anthropic.d.cts +1 -1
  10. package/dist/integrations/anthropic.d.ts +1 -1
  11. package/dist/integrations/ap2.d.cts +1 -1
  12. package/dist/integrations/ap2.d.ts +1 -1
  13. package/dist/integrations/aws-iam.d.cts +1 -1
  14. package/dist/integrations/aws-iam.d.ts +1 -1
  15. package/dist/integrations/bank-rails.d.cts +1 -1
  16. package/dist/integrations/bank-rails.d.ts +1 -1
  17. package/dist/integrations/circle.d.cts +1 -1
  18. package/dist/integrations/circle.d.ts +1 -1
  19. package/dist/integrations/cloudflare.d.cts +1 -1
  20. package/dist/integrations/cloudflare.d.ts +1 -1
  21. package/dist/integrations/coinbase-cdp.d.cts +1 -1
  22. package/dist/integrations/coinbase-cdp.d.ts +1 -1
  23. package/dist/integrations/commerce-agents.cjs +467 -0
  24. package/dist/integrations/commerce-agents.cjs.map +1 -0
  25. package/dist/integrations/commerce-agents.d.cts +199 -0
  26. package/dist/integrations/commerce-agents.d.ts +199 -0
  27. package/dist/integrations/commerce-agents.js +429 -0
  28. package/dist/integrations/commerce-agents.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.d.cts +1 -1
  32. package/dist/integrations/entra.d.ts +1 -1
  33. package/dist/integrations/fhir.d.cts +1 -1
  34. package/dist/integrations/fhir.d.ts +1 -1
  35. package/dist/integrations/grok.d.cts +1 -1
  36. package/dist/integrations/grok.d.ts +1 -1
  37. package/dist/integrations/guidewire.d.cts +1 -1
  38. package/dist/integrations/guidewire.d.ts +1 -1
  39. package/dist/integrations/hermes.d.cts +1 -1
  40. package/dist/integrations/hermes.d.ts +1 -1
  41. package/dist/integrations/jira.cjs +190 -0
  42. package/dist/integrations/jira.cjs.map +1 -0
  43. package/dist/integrations/jira.d.cts +162 -0
  44. package/dist/integrations/jira.d.ts +162 -0
  45. package/dist/integrations/jira.js +164 -0
  46. package/dist/integrations/jira.js.map +1 -0
  47. package/dist/integrations/langchain.d.cts +1 -1
  48. package/dist/integrations/langchain.d.ts +1 -1
  49. package/dist/integrations/langgraph.d.cts +1 -1
  50. package/dist/integrations/langgraph.d.ts +1 -1
  51. package/dist/integrations/legal.d.cts +1 -1
  52. package/dist/integrations/legal.d.ts +1 -1
  53. package/dist/integrations/life-sciences.d.cts +1 -1
  54. package/dist/integrations/life-sciences.d.ts +1 -1
  55. package/dist/integrations/linear.cjs +193 -0
  56. package/dist/integrations/linear.cjs.map +1 -0
  57. package/dist/integrations/linear.d.cts +173 -0
  58. package/dist/integrations/linear.d.ts +173 -0
  59. package/dist/integrations/linear.js +167 -0
  60. package/dist/integrations/linear.js.map +1 -0
  61. package/dist/integrations/lithic.d.cts +1 -1
  62. package/dist/integrations/lithic.d.ts +1 -1
  63. package/dist/integrations/llamaindex.d.cts +1 -1
  64. package/dist/integrations/llamaindex.d.ts +1 -1
  65. package/dist/integrations/marqeta.d.cts +1 -1
  66. package/dist/integrations/marqeta.d.ts +1 -1
  67. package/dist/integrations/modern-treasury.d.cts +1 -1
  68. package/dist/integrations/modern-treasury.d.ts +1 -1
  69. package/dist/integrations/nekuda.d.cts +1 -1
  70. package/dist/integrations/nekuda.d.ts +1 -1
  71. package/dist/integrations/okta.d.cts +1 -1
  72. package/dist/integrations/okta.d.ts +1 -1
  73. package/dist/integrations/openai.d.cts +1 -1
  74. package/dist/integrations/openai.d.ts +1 -1
  75. package/dist/integrations/openrouter.d.cts +1 -1
  76. package/dist/integrations/openrouter.d.ts +1 -1
  77. package/dist/integrations/paypal-agent.d.cts +1 -1
  78. package/dist/integrations/paypal-agent.d.ts +1 -1
  79. package/dist/integrations/perplexity.cjs +430 -0
  80. package/dist/integrations/perplexity.cjs.map +1 -0
  81. package/dist/integrations/perplexity.d.cts +65 -0
  82. package/dist/integrations/perplexity.d.ts +65 -0
  83. package/dist/integrations/perplexity.js +388 -0
  84. package/dist/integrations/perplexity.js.map +1 -0
  85. package/dist/integrations/plaid.d.cts +1 -1
  86. package/dist/integrations/plaid.d.ts +1 -1
  87. package/dist/integrations/ramp.d.cts +1 -1
  88. package/dist/integrations/ramp.d.ts +1 -1
  89. package/dist/integrations/shopify.d.cts +1 -1
  90. package/dist/integrations/shopify.d.ts +1 -1
  91. package/dist/integrations/siem.d.cts +1 -1
  92. package/dist/integrations/siem.d.ts +1 -1
  93. package/dist/integrations/skyfire.d.cts +1 -1
  94. package/dist/integrations/skyfire.d.ts +1 -1
  95. package/dist/integrations/stripe-acp.d.cts +1 -1
  96. package/dist/integrations/stripe-acp.d.ts +1 -1
  97. package/dist/integrations/stripe-issuing.d.cts +1 -1
  98. package/dist/integrations/stripe-issuing.d.ts +1 -1
  99. package/dist/integrations/truanon.d.cts +1 -1
  100. package/dist/integrations/truanon.d.ts +1 -1
  101. package/dist/integrations/ucp.d.cts +1 -1
  102. package/dist/integrations/ucp.d.ts +1 -1
  103. package/dist/integrations/vercel-ai.d.cts +1 -1
  104. package/dist/integrations/vercel-ai.d.ts +1 -1
  105. package/dist/integrations/x402.d.cts +1 -1
  106. package/dist/integrations/x402.d.ts +1 -1
  107. package/dist/{types-Lp1iHEDz.d.cts → types-BmeluKHI.d.cts} +1 -1
  108. package/dist/{types-Lp1iHEDz.d.ts → types-BmeluKHI.d.ts} +1 -1
  109. package/package.json +41 -1
@@ -0,0 +1,190 @@
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/jira.ts
21
+ var jira_exports = {};
22
+ __export(jira_exports, {
23
+ VorimJira: () => VorimJira,
24
+ createVorimJira: () => createVorimJira
25
+ });
26
+ module.exports = __toCommonJS(jira_exports);
27
+ var OPERATION_SCOPE = {
28
+ read: "agent:read",
29
+ createIssue: "agent:write",
30
+ updateIssue: "agent:write",
31
+ deleteIssue: "agent:write",
32
+ // destructive: removes the issue and its history
33
+ transitionIssue: "agent:write",
34
+ assignIssue: "agent:write",
35
+ addWorklog: "agent:write",
36
+ bulkUpdate: "agent:write",
37
+ // higher blast radius: many issues in one call
38
+ addComment: "agent:communicate"
39
+ };
40
+ var VorimJira = class {
41
+ sdk;
42
+ agentId;
43
+ siteHost;
44
+ humanId;
45
+ minTrustScore;
46
+ onError;
47
+ constructor(sdk, config) {
48
+ if (!config?.agentId) throw new Error("[vorim] Jira integration requires an agentId.");
49
+ if (!config?.siteHost) throw new Error("[vorim] Jira integration requires a siteHost.");
50
+ this.sdk = sdk;
51
+ this.agentId = config.agentId;
52
+ this.siteHost = config.siteHost;
53
+ this.humanId = config.humanId;
54
+ this.minTrustScore = config.minTrustScore ?? 0;
55
+ this.onError = config.onError ?? "closed";
56
+ }
57
+ /** The Vorim scope a given operation requires. Unknown operations fall back to
58
+ * agent:write (a mutation is at least a write). */
59
+ scopeFor(operation) {
60
+ return OPERATION_SCOPE[operation] ?? "agent:write";
61
+ }
62
+ /**
63
+ * Check whether the acting agent may run this issue operation, before it
64
+ * runs. Enforces (in order): trust floor, permission scope. Returns
65
+ * { authorized, reason }.
66
+ */
67
+ async authorize(action) {
68
+ const scope = this.scopeFor(action.operation);
69
+ try {
70
+ if (this.minTrustScore > 0) {
71
+ const trust = await this.sdk.verify(this.agentId);
72
+ if ((trust?.trust_score ?? 0) < this.minTrustScore) {
73
+ return { authorized: false, reason: `trust score below ${this.minTrustScore}` };
74
+ }
75
+ }
76
+ const perm = await this.sdk.check(this.agentId, scope);
77
+ return perm.allowed ? { authorized: true } : { authorized: false, reason: perm.reason ?? `missing scope ${scope}` };
78
+ } catch (e) {
79
+ return this.onError === "open" ? { authorized: true, reason: "vorim unreachable, failed open" } : { authorized: false, reason: `vorim unreachable: ${e?.message ?? "error"}` };
80
+ }
81
+ }
82
+ /**
83
+ * Emit a source-signed audit event for an issue operation and return whether
84
+ * it was recorded. Called after the mutation runs (or after a denial). The
85
+ * event names the agent, the site, and the human the agent acts for, so the
86
+ * record is attributable and independently verifiable offline.
87
+ */
88
+ async record(action, result, reason) {
89
+ const scope = this.scopeFor(action.operation);
90
+ try {
91
+ await this.sdk.emit({
92
+ agent_id: this.agentId,
93
+ event_type: "api_request",
94
+ action: `jira:${action.operation}${action.resourceId ? " " + action.resourceId : ""}`,
95
+ resource: action.resourceId || this.siteHost,
96
+ permission: scope,
97
+ result,
98
+ input_hash: action.inputHash,
99
+ metadata: {
100
+ integration: "jira",
101
+ site_host: this.siteHost,
102
+ acts_for_human: this.humanId,
103
+ operation: action.operation,
104
+ ...reason ? { reason } : {}
105
+ }
106
+ }, { sign: true });
107
+ return true;
108
+ } catch {
109
+ return false;
110
+ }
111
+ }
112
+ /**
113
+ * The full flow for one issue operation: authorize, run the Jira REST call if
114
+ * allowed, sign a receipt either way. If not authorized, `run` is never called
115
+ * (the mutation does not happen). Rethrows an error from `run` after recording
116
+ * it, with the receipt attached as `vorimReceipt`, so your handler still sees
117
+ * Jira failures.
118
+ */
119
+ async guard(action, run) {
120
+ const auth = await this.authorize(action);
121
+ if (!auth.authorized) {
122
+ const recorded = await this.record(action, "denied", auth.reason);
123
+ return { receipt: this.receipt(action, false, "denied", auth.reason, recorded) };
124
+ }
125
+ try {
126
+ const value = await run();
127
+ const recorded = await this.record(action, "success");
128
+ return { receipt: this.receipt(action, true, "success", void 0, recorded), value };
129
+ } catch (e) {
130
+ const recorded = await this.record(action, "error", e?.message);
131
+ throw Object.assign(e ?? new Error("jira operation failed"), {
132
+ vorimReceipt: this.receipt(action, true, "error", e?.message, recorded)
133
+ });
134
+ }
135
+ }
136
+ // --- Named helpers for the Jira mutations ----------------------------------
137
+ // Each wraps guard() with the right operation label so the scope and receipt
138
+ // are correct without the caller having to remember the mapping. You pass the
139
+ // REST call as `run`; this layer never talks to Jira itself.
140
+ /** Guard a `createIssue`. Requires agent:write. */
141
+ createIssue(meta, run) {
142
+ return this.guard({ operation: "createIssue", resourceId: meta.issueKey, inputHash: meta.inputHash }, run);
143
+ }
144
+ /** Guard an `updateIssue`. Requires agent:write. */
145
+ updateIssue(meta, run) {
146
+ return this.guard({ operation: "updateIssue", resourceId: meta.issueKey, inputHash: meta.inputHash }, run);
147
+ }
148
+ /** Guard a `deleteIssue`. Requires agent:write. Destructive: removes the
149
+ * issue and its history — a candidate for a higher minTrustScore. */
150
+ deleteIssue(meta, run) {
151
+ return this.guard({ operation: "deleteIssue", resourceId: meta.issueKey, inputHash: meta.inputHash }, run);
152
+ }
153
+ /** Guard a `transitionIssue` (move an issue through workflow states).
154
+ * Requires agent:write. */
155
+ transitionIssue(meta, run) {
156
+ return this.guard({ operation: "transitionIssue", resourceId: meta.issueKey, inputHash: meta.inputHash }, run);
157
+ }
158
+ /** Guard an `addComment`. Requires agent:communicate — an agent posting a
159
+ * comment is communication, not a data edit. */
160
+ addComment(meta, run) {
161
+ return this.guard({ operation: "addComment", resourceId: meta.issueKey, inputHash: meta.inputHash }, run);
162
+ }
163
+ /** Guard an `assignIssue`. Requires agent:write. */
164
+ assignIssue(meta, run) {
165
+ return this.guard({ operation: "assignIssue", resourceId: meta.issueKey, inputHash: meta.inputHash }, run);
166
+ }
167
+ receipt(action, authorized, result, reason, recorded) {
168
+ return {
169
+ authorized,
170
+ agentId: this.agentId,
171
+ humanId: this.humanId,
172
+ siteHost: this.siteHost,
173
+ operation: action.operation,
174
+ resourceId: action.resourceId,
175
+ result,
176
+ scope: this.scopeFor(action.operation),
177
+ reason,
178
+ recorded
179
+ };
180
+ }
181
+ };
182
+ function createVorimJira(sdk, config) {
183
+ return new VorimJira(sdk, config);
184
+ }
185
+ // Annotate the CommonJS export names for ESM import in node:
186
+ 0 && (module.exports = {
187
+ VorimJira,
188
+ createVorimJira
189
+ });
190
+ //# sourceMappingURL=jira.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/integrations/jira.ts"],"sourcesContent":["// ============================================================================\n// Vorim AI — Jira (issue-tracker operations) Integration\n//\n// This guards an AI agent that MANAGES a Jira project through the Jira Cloud\n// platform REST API v3 — creating and updating issues, transitioning them\n// through workflow states, commenting, assigning, logging work, and running\n// bulk updates. Before each mutation runs it checks the acting agent holds the\n// right permission, then signs a tamper-evident audit record of what the agent\n// did.\n//\n// WHY A GUARD ON JIRA\n// On the Jira REST API an agent authenticates with a single API token (or an\n// OAuth app scope) and Jira's own project permissions: every agent on that\n// token looks identical, there is no way to cap a sub-agent below \"edit\n// issues\", and nothing proves agent X (not agent Y) transitioned a given issue\n// or closed it. Jira audit logs record the account, not which delegated agent\n// acted or which human it acted for. That is the gap this fills. It never\n// replaces Jira's permissions — it composes with them, adding a signed,\n// per-agent, per-human record of the mutation on top.\n//\n// SCOPE MAPPING (uses Vorim's real scopes)\n// read Jira data -> agent:read\n// mutate an issue -> agent:write (create, update, delete,\n// transition, assign,\n// worklog, bulk update)\n// post a comment -> agent:communicate (an agent commenting is\n// communication, not a data\n// edit)\n//\n// This layer never holds a Jira token and never calls Jira itself. You pass it\n// the mutation to run; it authorizes, runs it, and signs the receipt.\n//\n// Usage:\n// import createVorim from '@vorim/sdk';\n// import { createVorimJira } from '@vorim/sdk/integrations/jira';\n//\n// const vorim = createVorim({ apiKey: 'agid_sk_...' });\n// const jira = createVorimJira(vorim, {\n// agentId: 'agid_abc123',\n// siteHost: 'acme.atlassian.net', // the Jira site the agent operates on\n// humanId: 'user_42', // the person the agent acts for\n// });\n//\n// // Wrap the REST call you were going to make anyway:\n// const { receipt, value } = await jira.transitionIssue(\n// { issueKey: 'ENG-231', inputHash },\n// () => fetch(`https://acme.atlassian.net/rest/api/3/issue/ENG-231/transitions`, { ... }),\n// );\n// if (!receipt.authorized) console.warn(receipt.reason);\n// ============================================================================\n\nimport type { VorimSDK } from '../index.js';\nimport type { PermissionScope } from '../types.js';\n\n/** The Jira REST operations this guard knows how to classify. Any other label\n * is accepted too; it just defaults to the 'write' risk tier. */\nexport type JiraOperation =\n | 'createIssue'\n | 'updateIssue'\n | 'deleteIssue'\n | 'transitionIssue'\n | 'addComment'\n | 'assignIssue'\n | 'addWorklog'\n | 'bulkUpdate'\n | 'read';\n\n/** Map each Jira operation to the least Vorim scope that should be required to\n * run it. Reads need read; issue mutations need write; posting a comment is\n * communication. Note the two higher-risk tiers within write:\n * - deleteIssue is destructive (an issue and its history are removed).\n * - bulkUpdate has a larger blast radius (many issues in one call).\n * Both still require agent:write; treat them as candidates for a higher trust\n * floor via minTrustScore. */\nconst OPERATION_SCOPE: Record<string, PermissionScope> = {\n read: 'agent:read',\n createIssue: 'agent:write',\n updateIssue: 'agent:write',\n deleteIssue: 'agent:write', // destructive: removes the issue and its history\n transitionIssue: 'agent:write',\n assignIssue: 'agent:write',\n addWorklog: 'agent:write',\n bulkUpdate: 'agent:write', // higher blast radius: many issues in one call\n addComment: 'agent:communicate',\n};\n\nexport interface JiraGuardConfig {\n /** The acting agent's Vorim id (agid_...). */\n agentId: string;\n /** The Jira site this agent operates on, e.g. 'acme.atlassian.net'. Recorded\n * in every receipt so an action is attributable to a specific instance. */\n siteHost: string;\n /** The human/principal the agent acts for. Recorded in every receipt so an\n * issue action is attributable to a person, not just a machine. */\n humanId?: string;\n /** Minimum trust score the acting agent must hold before any mutation runs.\n * Default 0 (off). */\n minTrustScore?: number;\n /** Fail closed (deny on any Vorim error) or fail open. Default 'closed'. */\n onError?: 'closed' | 'open';\n}\n\nexport interface JiraAction {\n /** The Jira operation being run, e.g. 'transitionIssue'. Drives the scope\n * requirement. Unknown labels default to the 'write' tier. */\n operation: JiraOperation | string;\n /** The Jira resource the action targets, e.g. an issue key like 'ENG-231'. */\n resourceId?: string;\n /** Optional hash of the request body so the receipt covers the exact input\n * without the guard storing it. */\n inputHash?: string;\n}\n\n/** An offline-verifiable receipt for one Jira operation. */\nexport interface JiraReceipt {\n authorized: boolean;\n agentId: string;\n humanId?: string;\n siteHost: string;\n operation: string;\n /** The issue key the action targeted, e.g. 'ENG-231'. */\n resourceId?: string;\n result: 'success' | 'denied' | 'error';\n scope: PermissionScope;\n /** Reason a check failed, when authorized is false. */\n reason?: string;\n /** True once the audit event was signed and ingested. */\n recorded: boolean;\n}\n\nexport class VorimJira {\n private sdk: VorimSDK;\n private agentId: string;\n private siteHost: string;\n private humanId?: string;\n private minTrustScore: number;\n private onError: 'closed' | 'open';\n\n constructor(sdk: VorimSDK, config: JiraGuardConfig) {\n if (!config?.agentId) throw new Error('[vorim] Jira integration requires an agentId.');\n if (!config?.siteHost) throw new Error('[vorim] Jira integration requires a siteHost.');\n this.sdk = sdk;\n this.agentId = config.agentId;\n this.siteHost = config.siteHost;\n this.humanId = config.humanId;\n this.minTrustScore = config.minTrustScore ?? 0;\n this.onError = config.onError ?? 'closed';\n }\n\n /** The Vorim scope a given operation requires. Unknown operations fall back to\n * agent:write (a mutation is at least a write). */\n private scopeFor(operation: string): PermissionScope {\n return OPERATION_SCOPE[operation] ?? 'agent:write';\n }\n\n /**\n * Check whether the acting agent may run this issue operation, before it\n * runs. Enforces (in order): trust floor, permission scope. Returns\n * { authorized, reason }.\n */\n async authorize(action: JiraAction): Promise<{ authorized: boolean; reason?: string }> {\n const scope = this.scopeFor(action.operation);\n\n try {\n // Trust floor (optional): refuse low-trust agents up front.\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}` };\n }\n }\n const perm = await this.sdk.check(this.agentId, scope);\n return perm.allowed\n ? { authorized: true }\n : { authorized: false, reason: perm.reason ?? `missing scope ${scope}` };\n } catch (e: any) {\n // Fail closed by default: a check we could not complete is a deny.\n return this.onError === 'open'\n ? { authorized: true, reason: 'vorim unreachable, failed open' }\n : { authorized: false, reason: `vorim unreachable: ${e?.message ?? 'error'}` };\n }\n }\n\n /**\n * Emit a source-signed audit event for an issue operation and return whether\n * it was recorded. Called after the mutation runs (or after a denial). The\n * event names the agent, the site, and the human the agent acts for, so the\n * record is attributable and independently verifiable offline.\n */\n async record(action: JiraAction, result: 'success' | 'denied' | 'error', reason?: string): Promise<boolean> {\n const scope = this.scopeFor(action.operation);\n try {\n await this.sdk.emit({\n agent_id: this.agentId,\n event_type: 'api_request',\n action: `jira:${action.operation}${action.resourceId ? ' ' + action.resourceId : ''}`,\n resource: action.resourceId || this.siteHost,\n permission: scope,\n result,\n input_hash: action.inputHash,\n metadata: {\n integration: 'jira',\n site_host: this.siteHost,\n acts_for_human: this.humanId,\n operation: action.operation,\n ...(reason ? { reason } : {}),\n },\n }, { sign: true }); // source-signed: the agent's key signs the record\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * The full flow for one issue operation: authorize, run the Jira REST call if\n * allowed, sign a receipt either way. If not authorized, `run` is never called\n * (the mutation does not happen). Rethrows an error from `run` after recording\n * it, with the receipt attached as `vorimReceipt`, so your handler still sees\n * Jira failures.\n */\n async guard<T>(action: JiraAction, run: () => Promise<T>): Promise<{ receipt: JiraReceipt; value?: T }> {\n const auth = await this.authorize(action);\n if (!auth.authorized) {\n const recorded = await this.record(action, 'denied', auth.reason);\n return { receipt: this.receipt(action, false, 'denied', auth.reason, recorded) };\n }\n try {\n const value = await run();\n const recorded = await this.record(action, 'success');\n return { receipt: this.receipt(action, true, 'success', undefined, recorded), value };\n } catch (e: any) {\n const recorded = await this.record(action, 'error', e?.message);\n throw Object.assign(e ?? new Error('jira operation failed'), {\n vorimReceipt: this.receipt(action, true, 'error', e?.message, recorded),\n });\n }\n }\n\n // --- Named helpers for the Jira mutations ----------------------------------\n // Each wraps guard() with the right operation label so the scope and receipt\n // are correct without the caller having to remember the mapping. You pass the\n // REST call as `run`; this layer never talks to Jira itself.\n\n /** Guard a `createIssue`. Requires agent:write. */\n createIssue<T>(meta: { issueKey?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'createIssue', resourceId: meta.issueKey, inputHash: meta.inputHash }, run);\n }\n\n /** Guard an `updateIssue`. Requires agent:write. */\n updateIssue<T>(meta: { issueKey?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'updateIssue', resourceId: meta.issueKey, inputHash: meta.inputHash }, run);\n }\n\n /** Guard a `deleteIssue`. Requires agent:write. Destructive: removes the\n * issue and its history — a candidate for a higher minTrustScore. */\n deleteIssue<T>(meta: { issueKey?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'deleteIssue', resourceId: meta.issueKey, inputHash: meta.inputHash }, run);\n }\n\n /** Guard a `transitionIssue` (move an issue through workflow states).\n * Requires agent:write. */\n transitionIssue<T>(meta: { issueKey?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'transitionIssue', resourceId: meta.issueKey, inputHash: meta.inputHash }, run);\n }\n\n /** Guard an `addComment`. Requires agent:communicate — an agent posting a\n * comment is communication, not a data edit. */\n addComment<T>(meta: { issueKey?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'addComment', resourceId: meta.issueKey, inputHash: meta.inputHash }, run);\n }\n\n /** Guard an `assignIssue`. Requires agent:write. */\n assignIssue<T>(meta: { issueKey?: string; inputHash?: string }, run: () => Promise<T>) {\n return this.guard({ operation: 'assignIssue', resourceId: meta.issueKey, inputHash: meta.inputHash }, run);\n }\n\n private receipt(\n action: JiraAction,\n authorized: boolean,\n result: 'success' | 'denied' | 'error',\n reason: string | undefined,\n recorded: boolean,\n ): JiraReceipt {\n return {\n authorized,\n agentId: this.agentId,\n humanId: this.humanId,\n siteHost: this.siteHost,\n operation: action.operation,\n resourceId: action.resourceId,\n result,\n scope: this.scopeFor(action.operation),\n reason,\n recorded,\n };\n }\n}\n\n/**\n * Create a VorimJira guard around a Vorim SDK instance.\n *\n * @example\n * ```typescript\n * import createVorim from '@vorim/sdk';\n * import { createVorimJira } from '@vorim/sdk/integrations/jira';\n *\n * const vorim = createVorim({ apiKey: 'agid_sk_...' });\n * const jira = createVorimJira(vorim, {\n * agentId: 'agid_abc123',\n * siteHost: 'acme.atlassian.net',\n * humanId: 'user_42',\n * });\n *\n * const { receipt, value } = await jira.transitionIssue(\n * { issueKey: 'ENG-231', inputHash },\n * () => fetch(transitionsUrl, { method: 'POST', body }),\n * );\n * ```\n */\nexport function createVorimJira(sdk: VorimSDK, config: JiraGuardConfig): VorimJira {\n return new VorimJira(sdk, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0EA,IAAM,kBAAmD;AAAA,EACvD,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA;AAAA,EACb,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA;AAAA,EACZ,YAAY;AACd;AA8CO,IAAM,YAAN,MAAgB;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,KAAe,QAAyB;AAClD,QAAI,CAAC,QAAQ,QAAS,OAAM,IAAI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js';
2
+ import { P as PermissionScope } from '../types-BmeluKHI.cjs';
3
+
4
+ /** The Jira REST operations this guard knows how to classify. Any other label
5
+ * is accepted too; it just defaults to the 'write' risk tier. */
6
+ type JiraOperation = 'createIssue' | 'updateIssue' | 'deleteIssue' | 'transitionIssue' | 'addComment' | 'assignIssue' | 'addWorklog' | 'bulkUpdate' | 'read';
7
+ interface JiraGuardConfig {
8
+ /** The acting agent's Vorim id (agid_...). */
9
+ agentId: string;
10
+ /** The Jira site this agent operates on, e.g. 'acme.atlassian.net'. Recorded
11
+ * in every receipt so an action is attributable to a specific instance. */
12
+ siteHost: string;
13
+ /** The human/principal the agent acts for. Recorded in every receipt so an
14
+ * issue action is attributable to a person, not just a machine. */
15
+ humanId?: string;
16
+ /** Minimum trust score the acting agent must hold before any mutation runs.
17
+ * Default 0 (off). */
18
+ minTrustScore?: number;
19
+ /** Fail closed (deny on any Vorim error) or fail open. Default 'closed'. */
20
+ onError?: 'closed' | 'open';
21
+ }
22
+ interface JiraAction {
23
+ /** The Jira operation being run, e.g. 'transitionIssue'. Drives the scope
24
+ * requirement. Unknown labels default to the 'write' tier. */
25
+ operation: JiraOperation | string;
26
+ /** The Jira resource the action targets, e.g. an issue key like 'ENG-231'. */
27
+ resourceId?: string;
28
+ /** Optional hash of the request body so the receipt covers the exact input
29
+ * without the guard storing it. */
30
+ inputHash?: string;
31
+ }
32
+ /** An offline-verifiable receipt for one Jira operation. */
33
+ interface JiraReceipt {
34
+ authorized: boolean;
35
+ agentId: string;
36
+ humanId?: string;
37
+ siteHost: string;
38
+ operation: string;
39
+ /** The issue key the action targeted, e.g. 'ENG-231'. */
40
+ resourceId?: string;
41
+ result: 'success' | 'denied' | 'error';
42
+ scope: PermissionScope;
43
+ /** Reason a check failed, when authorized is false. */
44
+ reason?: string;
45
+ /** True once the audit event was signed and ingested. */
46
+ recorded: boolean;
47
+ }
48
+ declare class VorimJira {
49
+ private sdk;
50
+ private agentId;
51
+ private siteHost;
52
+ private humanId?;
53
+ private minTrustScore;
54
+ private onError;
55
+ constructor(sdk: VorimSDK, config: JiraGuardConfig);
56
+ /** The Vorim scope a given operation requires. Unknown operations fall back to
57
+ * agent:write (a mutation is at least a write). */
58
+ private scopeFor;
59
+ /**
60
+ * Check whether the acting agent may run this issue operation, before it
61
+ * runs. Enforces (in order): trust floor, permission scope. Returns
62
+ * { authorized, reason }.
63
+ */
64
+ authorize(action: JiraAction): Promise<{
65
+ authorized: boolean;
66
+ reason?: string;
67
+ }>;
68
+ /**
69
+ * Emit a source-signed audit event for an issue operation and return whether
70
+ * it was recorded. Called after the mutation runs (or after a denial). The
71
+ * event names the agent, the site, and the human the agent acts for, so the
72
+ * record is attributable and independently verifiable offline.
73
+ */
74
+ record(action: JiraAction, result: 'success' | 'denied' | 'error', reason?: string): Promise<boolean>;
75
+ /**
76
+ * The full flow for one issue operation: authorize, run the Jira REST call if
77
+ * allowed, sign a receipt either way. If not authorized, `run` is never called
78
+ * (the mutation does not happen). Rethrows an error from `run` after recording
79
+ * it, with the receipt attached as `vorimReceipt`, so your handler still sees
80
+ * Jira failures.
81
+ */
82
+ guard<T>(action: JiraAction, run: () => Promise<T>): Promise<{
83
+ receipt: JiraReceipt;
84
+ value?: T;
85
+ }>;
86
+ /** Guard a `createIssue`. Requires agent:write. */
87
+ createIssue<T>(meta: {
88
+ issueKey?: string;
89
+ inputHash?: string;
90
+ }, run: () => Promise<T>): Promise<{
91
+ receipt: JiraReceipt;
92
+ value?: T | undefined;
93
+ }>;
94
+ /** Guard an `updateIssue`. Requires agent:write. */
95
+ updateIssue<T>(meta: {
96
+ issueKey?: string;
97
+ inputHash?: string;
98
+ }, run: () => Promise<T>): Promise<{
99
+ receipt: JiraReceipt;
100
+ value?: T | undefined;
101
+ }>;
102
+ /** Guard a `deleteIssue`. Requires agent:write. Destructive: removes the
103
+ * issue and its history — a candidate for a higher minTrustScore. */
104
+ deleteIssue<T>(meta: {
105
+ issueKey?: string;
106
+ inputHash?: string;
107
+ }, run: () => Promise<T>): Promise<{
108
+ receipt: JiraReceipt;
109
+ value?: T | undefined;
110
+ }>;
111
+ /** Guard a `transitionIssue` (move an issue through workflow states).
112
+ * Requires agent:write. */
113
+ transitionIssue<T>(meta: {
114
+ issueKey?: string;
115
+ inputHash?: string;
116
+ }, run: () => Promise<T>): Promise<{
117
+ receipt: JiraReceipt;
118
+ value?: T | undefined;
119
+ }>;
120
+ /** Guard an `addComment`. Requires agent:communicate — an agent posting a
121
+ * comment is communication, not a data edit. */
122
+ addComment<T>(meta: {
123
+ issueKey?: string;
124
+ inputHash?: string;
125
+ }, run: () => Promise<T>): Promise<{
126
+ receipt: JiraReceipt;
127
+ value?: T | undefined;
128
+ }>;
129
+ /** Guard an `assignIssue`. Requires agent:write. */
130
+ assignIssue<T>(meta: {
131
+ issueKey?: string;
132
+ inputHash?: string;
133
+ }, run: () => Promise<T>): Promise<{
134
+ receipt: JiraReceipt;
135
+ value?: T | undefined;
136
+ }>;
137
+ private receipt;
138
+ }
139
+ /**
140
+ * Create a VorimJira guard around a Vorim SDK instance.
141
+ *
142
+ * @example
143
+ * ```typescript
144
+ * import createVorim from '@vorim/sdk';
145
+ * import { createVorimJira } from '@vorim/sdk/integrations/jira';
146
+ *
147
+ * const vorim = createVorim({ apiKey: 'agid_sk_...' });
148
+ * const jira = createVorimJira(vorim, {
149
+ * agentId: 'agid_abc123',
150
+ * siteHost: 'acme.atlassian.net',
151
+ * humanId: 'user_42',
152
+ * });
153
+ *
154
+ * const { receipt, value } = await jira.transitionIssue(
155
+ * { issueKey: 'ENG-231', inputHash },
156
+ * () => fetch(transitionsUrl, { method: 'POST', body }),
157
+ * );
158
+ * ```
159
+ */
160
+ declare function createVorimJira(sdk: VorimSDK, config: JiraGuardConfig): VorimJira;
161
+
162
+ export { type JiraAction, type JiraGuardConfig, type JiraOperation, type JiraReceipt, VorimJira, createVorimJira };
@@ -0,0 +1,162 @@
1
+ import { VorimSDK } from '../index.js';
2
+ import { P as PermissionScope } from '../types-BmeluKHI.js';
3
+
4
+ /** The Jira REST operations this guard knows how to classify. Any other label
5
+ * is accepted too; it just defaults to the 'write' risk tier. */
6
+ type JiraOperation = 'createIssue' | 'updateIssue' | 'deleteIssue' | 'transitionIssue' | 'addComment' | 'assignIssue' | 'addWorklog' | 'bulkUpdate' | 'read';
7
+ interface JiraGuardConfig {
8
+ /** The acting agent's Vorim id (agid_...). */
9
+ agentId: string;
10
+ /** The Jira site this agent operates on, e.g. 'acme.atlassian.net'. Recorded
11
+ * in every receipt so an action is attributable to a specific instance. */
12
+ siteHost: string;
13
+ /** The human/principal the agent acts for. Recorded in every receipt so an
14
+ * issue action is attributable to a person, not just a machine. */
15
+ humanId?: string;
16
+ /** Minimum trust score the acting agent must hold before any mutation runs.
17
+ * Default 0 (off). */
18
+ minTrustScore?: number;
19
+ /** Fail closed (deny on any Vorim error) or fail open. Default 'closed'. */
20
+ onError?: 'closed' | 'open';
21
+ }
22
+ interface JiraAction {
23
+ /** The Jira operation being run, e.g. 'transitionIssue'. Drives the scope
24
+ * requirement. Unknown labels default to the 'write' tier. */
25
+ operation: JiraOperation | string;
26
+ /** The Jira resource the action targets, e.g. an issue key like 'ENG-231'. */
27
+ resourceId?: string;
28
+ /** Optional hash of the request body so the receipt covers the exact input
29
+ * without the guard storing it. */
30
+ inputHash?: string;
31
+ }
32
+ /** An offline-verifiable receipt for one Jira operation. */
33
+ interface JiraReceipt {
34
+ authorized: boolean;
35
+ agentId: string;
36
+ humanId?: string;
37
+ siteHost: string;
38
+ operation: string;
39
+ /** The issue key the action targeted, e.g. 'ENG-231'. */
40
+ resourceId?: string;
41
+ result: 'success' | 'denied' | 'error';
42
+ scope: PermissionScope;
43
+ /** Reason a check failed, when authorized is false. */
44
+ reason?: string;
45
+ /** True once the audit event was signed and ingested. */
46
+ recorded: boolean;
47
+ }
48
+ declare class VorimJira {
49
+ private sdk;
50
+ private agentId;
51
+ private siteHost;
52
+ private humanId?;
53
+ private minTrustScore;
54
+ private onError;
55
+ constructor(sdk: VorimSDK, config: JiraGuardConfig);
56
+ /** The Vorim scope a given operation requires. Unknown operations fall back to
57
+ * agent:write (a mutation is at least a write). */
58
+ private scopeFor;
59
+ /**
60
+ * Check whether the acting agent may run this issue operation, before it
61
+ * runs. Enforces (in order): trust floor, permission scope. Returns
62
+ * { authorized, reason }.
63
+ */
64
+ authorize(action: JiraAction): Promise<{
65
+ authorized: boolean;
66
+ reason?: string;
67
+ }>;
68
+ /**
69
+ * Emit a source-signed audit event for an issue operation and return whether
70
+ * it was recorded. Called after the mutation runs (or after a denial). The
71
+ * event names the agent, the site, and the human the agent acts for, so the
72
+ * record is attributable and independently verifiable offline.
73
+ */
74
+ record(action: JiraAction, result: 'success' | 'denied' | 'error', reason?: string): Promise<boolean>;
75
+ /**
76
+ * The full flow for one issue operation: authorize, run the Jira REST call if
77
+ * allowed, sign a receipt either way. If not authorized, `run` is never called
78
+ * (the mutation does not happen). Rethrows an error from `run` after recording
79
+ * it, with the receipt attached as `vorimReceipt`, so your handler still sees
80
+ * Jira failures.
81
+ */
82
+ guard<T>(action: JiraAction, run: () => Promise<T>): Promise<{
83
+ receipt: JiraReceipt;
84
+ value?: T;
85
+ }>;
86
+ /** Guard a `createIssue`. Requires agent:write. */
87
+ createIssue<T>(meta: {
88
+ issueKey?: string;
89
+ inputHash?: string;
90
+ }, run: () => Promise<T>): Promise<{
91
+ receipt: JiraReceipt;
92
+ value?: T | undefined;
93
+ }>;
94
+ /** Guard an `updateIssue`. Requires agent:write. */
95
+ updateIssue<T>(meta: {
96
+ issueKey?: string;
97
+ inputHash?: string;
98
+ }, run: () => Promise<T>): Promise<{
99
+ receipt: JiraReceipt;
100
+ value?: T | undefined;
101
+ }>;
102
+ /** Guard a `deleteIssue`. Requires agent:write. Destructive: removes the
103
+ * issue and its history — a candidate for a higher minTrustScore. */
104
+ deleteIssue<T>(meta: {
105
+ issueKey?: string;
106
+ inputHash?: string;
107
+ }, run: () => Promise<T>): Promise<{
108
+ receipt: JiraReceipt;
109
+ value?: T | undefined;
110
+ }>;
111
+ /** Guard a `transitionIssue` (move an issue through workflow states).
112
+ * Requires agent:write. */
113
+ transitionIssue<T>(meta: {
114
+ issueKey?: string;
115
+ inputHash?: string;
116
+ }, run: () => Promise<T>): Promise<{
117
+ receipt: JiraReceipt;
118
+ value?: T | undefined;
119
+ }>;
120
+ /** Guard an `addComment`. Requires agent:communicate — an agent posting a
121
+ * comment is communication, not a data edit. */
122
+ addComment<T>(meta: {
123
+ issueKey?: string;
124
+ inputHash?: string;
125
+ }, run: () => Promise<T>): Promise<{
126
+ receipt: JiraReceipt;
127
+ value?: T | undefined;
128
+ }>;
129
+ /** Guard an `assignIssue`. Requires agent:write. */
130
+ assignIssue<T>(meta: {
131
+ issueKey?: string;
132
+ inputHash?: string;
133
+ }, run: () => Promise<T>): Promise<{
134
+ receipt: JiraReceipt;
135
+ value?: T | undefined;
136
+ }>;
137
+ private receipt;
138
+ }
139
+ /**
140
+ * Create a VorimJira guard around a Vorim SDK instance.
141
+ *
142
+ * @example
143
+ * ```typescript
144
+ * import createVorim from '@vorim/sdk';
145
+ * import { createVorimJira } from '@vorim/sdk/integrations/jira';
146
+ *
147
+ * const vorim = createVorim({ apiKey: 'agid_sk_...' });
148
+ * const jira = createVorimJira(vorim, {
149
+ * agentId: 'agid_abc123',
150
+ * siteHost: 'acme.atlassian.net',
151
+ * humanId: 'user_42',
152
+ * });
153
+ *
154
+ * const { receipt, value } = await jira.transitionIssue(
155
+ * { issueKey: 'ENG-231', inputHash },
156
+ * () => fetch(transitionsUrl, { method: 'POST', body }),
157
+ * );
158
+ * ```
159
+ */
160
+ declare function createVorimJira(sdk: VorimSDK, config: JiraGuardConfig): VorimJira;
161
+
162
+ export { type JiraAction, type JiraGuardConfig, type JiraOperation, type JiraReceipt, VorimJira, createVorimJira };