aira-sdk 3.1.0 → 3.2.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.
- package/dist/gateway.d.ts +33 -0
- package/dist/gateway.js +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/package.json +5 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for routing LLM SDK calls through Aira Gateway.
|
|
3
|
+
*
|
|
4
|
+
* Usage (OpenAI):
|
|
5
|
+
* import OpenAI from "openai";
|
|
6
|
+
* import { gatewayOpenAIConfig } from "aira-sdk/gateway";
|
|
7
|
+
* const client = new OpenAI({
|
|
8
|
+
* ...gatewayOpenAIConfig({ airaApiKey: "aira_live_..." }),
|
|
9
|
+
* apiKey: "sk-...",
|
|
10
|
+
* });
|
|
11
|
+
*
|
|
12
|
+
* Usage (Anthropic):
|
|
13
|
+
* import Anthropic from "@anthropic-ai/sdk";
|
|
14
|
+
* import { gatewayAnthropicConfig } from "aira-sdk/gateway";
|
|
15
|
+
* const client = new Anthropic({
|
|
16
|
+
* ...gatewayAnthropicConfig({ airaApiKey: "aira_live_..." }),
|
|
17
|
+
* apiKey: "sk-ant-...",
|
|
18
|
+
* });
|
|
19
|
+
*/
|
|
20
|
+
export declare function gatewayOpenAIConfig(opts: {
|
|
21
|
+
airaApiKey: string;
|
|
22
|
+
gatewayUrl?: string;
|
|
23
|
+
}): {
|
|
24
|
+
baseURL: string;
|
|
25
|
+
defaultHeaders: Record<string, string>;
|
|
26
|
+
};
|
|
27
|
+
export declare function gatewayAnthropicConfig(opts: {
|
|
28
|
+
airaApiKey: string;
|
|
29
|
+
gatewayUrl?: string;
|
|
30
|
+
}): {
|
|
31
|
+
baseURL: string;
|
|
32
|
+
defaultHeaders: Record<string, string>;
|
|
33
|
+
};
|
package/dist/gateway.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Helpers for routing LLM SDK calls through Aira Gateway.
|
|
4
|
+
*
|
|
5
|
+
* Usage (OpenAI):
|
|
6
|
+
* import OpenAI from "openai";
|
|
7
|
+
* import { gatewayOpenAIConfig } from "aira-sdk/gateway";
|
|
8
|
+
* const client = new OpenAI({
|
|
9
|
+
* ...gatewayOpenAIConfig({ airaApiKey: "aira_live_..." }),
|
|
10
|
+
* apiKey: "sk-...",
|
|
11
|
+
* });
|
|
12
|
+
*
|
|
13
|
+
* Usage (Anthropic):
|
|
14
|
+
* import Anthropic from "@anthropic-ai/sdk";
|
|
15
|
+
* import { gatewayAnthropicConfig } from "aira-sdk/gateway";
|
|
16
|
+
* const client = new Anthropic({
|
|
17
|
+
* ...gatewayAnthropicConfig({ airaApiKey: "aira_live_..." }),
|
|
18
|
+
* apiKey: "sk-ant-...",
|
|
19
|
+
* });
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.gatewayOpenAIConfig = gatewayOpenAIConfig;
|
|
23
|
+
exports.gatewayAnthropicConfig = gatewayAnthropicConfig;
|
|
24
|
+
const DEFAULT_GATEWAY_URL = "https://api.airaproof.com";
|
|
25
|
+
function gatewayOpenAIConfig(opts) {
|
|
26
|
+
const base = (opts.gatewayUrl ?? DEFAULT_GATEWAY_URL).replace(/\/$/, "");
|
|
27
|
+
return {
|
|
28
|
+
baseURL: `${base}/gateway/openai/v1`,
|
|
29
|
+
defaultHeaders: { "X-Aira-Api-Key": opts.airaApiKey },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function gatewayAnthropicConfig(opts) {
|
|
33
|
+
const base = (opts.gatewayUrl ?? DEFAULT_GATEWAY_URL).replace(/\/$/, "");
|
|
34
|
+
return {
|
|
35
|
+
baseURL: `${base}/gateway/anthropic/v1`,
|
|
36
|
+
defaultHeaders: { "X-Aira-Api-Key": opts.airaApiKey },
|
|
37
|
+
};
|
|
38
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export type { AiraOptions } from "./client";
|
|
|
3
3
|
export { AiraSession } from "./session";
|
|
4
4
|
export { OfflineQueue } from "./offline";
|
|
5
5
|
export type { QueuedRequest } from "./offline";
|
|
6
|
+
export { gatewayOpenAIConfig, gatewayAnthropicConfig } from "./gateway";
|
|
6
7
|
export { AiraError, FRAMEWORK_ANNEX_IV, FRAMEWORK_ART12, FRAMEWORK_ART9, FRAMEWORK_ART6, type Authorization, type ActionReceipt, type ActionDetail, type AgentDetail, type AgentVersion, type CosignResult, type EvidencePackage, type ComplianceSnapshot, type EscrowAccount, type EscrowTransaction, type VerifyResult, type PaginatedList, type ComplianceReport, type ComplianceReportListResponse, type ComplianceReportVerification, type ActionExplanation, type ExplanationEnvelope, type ExplanationVerification, type OutputPolicy, type OutputPolicyUpdate, type OutputScanFlags, type OutputScanHit, type DoraIncident, type IctThirdParty, type DoraTest, } from "./types";
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FRAMEWORK_ART6 = exports.FRAMEWORK_ART9 = exports.FRAMEWORK_ART12 = exports.FRAMEWORK_ANNEX_IV = exports.AiraError = exports.OfflineQueue = exports.AiraSession = exports.Aira = void 0;
|
|
3
|
+
exports.FRAMEWORK_ART6 = exports.FRAMEWORK_ART9 = exports.FRAMEWORK_ART12 = exports.FRAMEWORK_ANNEX_IV = exports.AiraError = exports.gatewayAnthropicConfig = exports.gatewayOpenAIConfig = exports.OfflineQueue = exports.AiraSession = exports.Aira = void 0;
|
|
4
4
|
var client_1 = require("./client");
|
|
5
5
|
Object.defineProperty(exports, "Aira", { enumerable: true, get: function () { return client_1.Aira; } });
|
|
6
6
|
var session_1 = require("./session");
|
|
7
7
|
Object.defineProperty(exports, "AiraSession", { enumerable: true, get: function () { return session_1.AiraSession; } });
|
|
8
8
|
var offline_1 = require("./offline");
|
|
9
9
|
Object.defineProperty(exports, "OfflineQueue", { enumerable: true, get: function () { return offline_1.OfflineQueue; } });
|
|
10
|
+
var gateway_1 = require("./gateway");
|
|
11
|
+
Object.defineProperty(exports, "gatewayOpenAIConfig", { enumerable: true, get: function () { return gateway_1.gatewayOpenAIConfig; } });
|
|
12
|
+
Object.defineProperty(exports, "gatewayAnthropicConfig", { enumerable: true, get: function () { return gateway_1.gatewayAnthropicConfig; } });
|
|
10
13
|
var types_1 = require("./types");
|
|
11
14
|
Object.defineProperty(exports, "AiraError", { enumerable: true, get: function () { return types_1.AiraError; } });
|
|
12
15
|
Object.defineProperty(exports, "FRAMEWORK_ANNEX_IV", { enumerable: true, get: function () { return types_1.FRAMEWORK_ANNEX_IV; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aira-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "The authorization and audit layer for AI agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
+
"./gateway": {
|
|
13
|
+
"types": "./dist/gateway.d.ts",
|
|
14
|
+
"default": "./dist/gateway.js"
|
|
15
|
+
},
|
|
12
16
|
"./extras/langchain": {
|
|
13
17
|
"types": "./dist/extras/langchain.d.ts",
|
|
14
18
|
"default": "./dist/extras/langchain.js"
|