@auctra/sdk 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts DELETED
@@ -1,66 +0,0 @@
1
- export type EvaluateActionInput = {
2
- agentId: string;
3
- actionType: string;
4
- payload?: Record<string, unknown>;
5
- };
6
- export type EvaluateActionResponse = {
7
- decision: "allowed" | "blocked" | "require_approval";
8
- risk_score: number;
9
- reason: string;
10
- delegation_id: string | null;
11
- delegator: string | null;
12
- sponsor: string;
13
- matched_policies: string[];
14
- action_request_id: string;
15
- };
16
- export type AuctraClientOptions = {
17
- apiKey: string;
18
- baseUrl?: string;
19
- };
20
- export declare class Auctra {
21
- private apiKey;
22
- private baseUrl;
23
- constructor(options: AuctraClientOptions);
24
- private request;
25
- evaluateAction(input: EvaluateActionInput): Promise<EvaluateActionResponse>;
26
- listAgents(): Promise<{
27
- agents: unknown[];
28
- }>;
29
- getAgent(agentId: string): Promise<{
30
- agent: unknown;
31
- }>;
32
- createAgent(input: {
33
- name: string;
34
- modelProvider: string;
35
- modelName: string;
36
- description?: string;
37
- environment?: string;
38
- authorityLevel?: string;
39
- sponsorUserId?: string;
40
- }): Promise<unknown>;
41
- listDelegations(): Promise<{
42
- delegations: unknown[];
43
- }>;
44
- createDelegation(input: {
45
- agentId: string;
46
- actionTypes: string[];
47
- validUntil: string;
48
- maxAmount?: number;
49
- currency?: string;
50
- delegatorUserId?: string;
51
- }): Promise<unknown>;
52
- revokeDelegation(delegationId: string): Promise<unknown>;
53
- listActionRequests(): Promise<{
54
- action_requests: unknown[];
55
- }>;
56
- approveActionRequest(actionRequestId: string, reason?: string): Promise<unknown>;
57
- rejectActionRequest(actionRequestId: string, reason?: string): Promise<unknown>;
58
- escalateActionRequest(actionRequestId: string, reason?: string): Promise<unknown>;
59
- listPolicies(): Promise<{
60
- policies: unknown[];
61
- }>;
62
- listAuditEvents(): Promise<{
63
- audit_events: unknown[];
64
- }>;
65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,EAAE,MAAM,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;IAYK,eAAe;qBACgB,OAAO,EAAE;;IAGxC,gBAAgB,CAAC,KAAK,EAAE;QAC5B,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;IAWK,gBAAgB,CAAC,YAAY,EAAE,MAAM;IAIrC,kBAAkB;yBACiB,OAAO,EAAE;;IAG5C,oBAAoB,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAM7D,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAM5D,qBAAqB,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAM9D,YAAY;kBACgB,OAAO,EAAE;;IAGrC,eAAe;sBACiB,OAAO,EAAE;;CAEhD"}
package/dist/index.js DELETED
@@ -1,87 +0,0 @@
1
- export class Auctra {
2
- apiKey;
3
- baseUrl;
4
- constructor(options) {
5
- this.apiKey = options.apiKey;
6
- this.baseUrl = (options.baseUrl ?? "https://console.auctra.tech").replace(/\/$/, "");
7
- }
8
- async request(method, path, body) {
9
- const response = await fetch(`${this.baseUrl}${path}`, {
10
- method,
11
- headers: {
12
- ...(body ? { "content-type": "application/json" } : {}),
13
- authorization: `Bearer ${this.apiKey}`,
14
- },
15
- ...(body ? { body: JSON.stringify(body) } : {}),
16
- });
17
- const data = await response.json();
18
- if (!response.ok) {
19
- throw new Error(data.error ?? `Auctra API error (${response.status})`);
20
- }
21
- return data;
22
- }
23
- async evaluateAction(input) {
24
- return this.request("POST", "/v1/action-requests/evaluate", {
25
- agent_id: input.agentId,
26
- action_type: input.actionType,
27
- payload: input.payload ?? {},
28
- });
29
- }
30
- async listAgents() {
31
- return this.request("GET", "/v1/agents");
32
- }
33
- async getAgent(agentId) {
34
- return this.request("GET", `/v1/agents/${agentId}`);
35
- }
36
- async createAgent(input) {
37
- return this.request("POST", "/v1/agents", {
38
- name: input.name,
39
- model_provider: input.modelProvider,
40
- model_name: input.modelName,
41
- description: input.description,
42
- environment: input.environment,
43
- authority_level: input.authorityLevel,
44
- sponsor_user_id: input.sponsorUserId,
45
- });
46
- }
47
- async listDelegations() {
48
- return this.request("GET", "/v1/delegations");
49
- }
50
- async createDelegation(input) {
51
- return this.request("POST", "/v1/delegations", {
52
- agent_id: input.agentId,
53
- action_types: input.actionTypes,
54
- valid_until: input.validUntil,
55
- max_amount: input.maxAmount,
56
- currency: input.currency,
57
- delegator_user_id: input.delegatorUserId,
58
- });
59
- }
60
- async revokeDelegation(delegationId) {
61
- return this.request("POST", `/v1/delegations/${delegationId}/revoke`, {});
62
- }
63
- async listActionRequests() {
64
- return this.request("GET", "/v1/action-requests");
65
- }
66
- async approveActionRequest(actionRequestId, reason) {
67
- return this.request("POST", `/v1/action-requests/${actionRequestId}/approve`, {
68
- reason,
69
- });
70
- }
71
- async rejectActionRequest(actionRequestId, reason) {
72
- return this.request("POST", `/v1/action-requests/${actionRequestId}/reject`, {
73
- reason,
74
- });
75
- }
76
- async escalateActionRequest(actionRequestId, reason) {
77
- return this.request("POST", `/v1/action-requests/${actionRequestId}/escalate`, {
78
- reason,
79
- });
80
- }
81
- async listPolicies() {
82
- return this.request("GET", "/v1/policies");
83
- }
84
- async listAuditEvents() {
85
- return this.request("GET", "/v1/audit-events");
86
- }
87
- }