@geostack/arc 0.1.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/LICENSE +21 -0
- package/README.md +122 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +890 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +632 -0
- package/dist/index.js +1514 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import { type JWK } from "jose";
|
|
2
|
+
export type JsonObject = Record<string, unknown>;
|
|
3
|
+
export type ArcRiskLevel = "critical" | "high" | "low" | "medium";
|
|
4
|
+
export type ArcDefaultDecision = "allow" | "ask" | "block";
|
|
5
|
+
export type ArcActionCost = {
|
|
6
|
+
currency?: string;
|
|
7
|
+
field: string;
|
|
8
|
+
mode: "field";
|
|
9
|
+
} | {
|
|
10
|
+
currency?: string;
|
|
11
|
+
fixedMinor: number;
|
|
12
|
+
mode: "fixed";
|
|
13
|
+
};
|
|
14
|
+
export type ArcActionDefinition = {
|
|
15
|
+
cost?: ArcActionCost;
|
|
16
|
+
defaultDecision: ArcDefaultDecision;
|
|
17
|
+
description?: string;
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
input: JsonObject;
|
|
20
|
+
name: string;
|
|
21
|
+
output?: JsonObject;
|
|
22
|
+
risk: ArcRiskLevel;
|
|
23
|
+
tags?: string[];
|
|
24
|
+
};
|
|
25
|
+
export type ArcActionDefinitions = Record<string, ArcActionDefinition>;
|
|
26
|
+
export type ArcActionSyncItem = {
|
|
27
|
+
cost_currency?: string | null;
|
|
28
|
+
cost_field?: string | null;
|
|
29
|
+
cost_fixed_minor?: number | null;
|
|
30
|
+
cost_mode?: "field" | "fixed" | "none";
|
|
31
|
+
default_decision: ArcDefaultDecision;
|
|
32
|
+
description: string | null;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
input_schema: JsonObject;
|
|
35
|
+
key: string;
|
|
36
|
+
name: string;
|
|
37
|
+
output_schema?: JsonObject | null;
|
|
38
|
+
risk_level: ArcRiskLevel;
|
|
39
|
+
tags?: string[];
|
|
40
|
+
};
|
|
41
|
+
export type ArcActionSyncPayload = {
|
|
42
|
+
actions: ArcActionSyncItem[];
|
|
43
|
+
};
|
|
44
|
+
export type ArcPublicAction = ArcActionSyncItem & {
|
|
45
|
+
app_id: string;
|
|
46
|
+
created_at: string;
|
|
47
|
+
id: string;
|
|
48
|
+
updated_at: string;
|
|
49
|
+
};
|
|
50
|
+
export type ArcExecutionRequestBody = {
|
|
51
|
+
action_request_id?: string | null;
|
|
52
|
+
action_key: string;
|
|
53
|
+
agent: {
|
|
54
|
+
display_name: string | null;
|
|
55
|
+
id: string;
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
app_id: string;
|
|
59
|
+
app_user_id: string;
|
|
60
|
+
org_id: string;
|
|
61
|
+
authorization?: {
|
|
62
|
+
approval_status: string | null;
|
|
63
|
+
approval_id?: string | null;
|
|
64
|
+
app_verification_status?: "internal" | "official" | "pending" | "unverified" | "verified";
|
|
65
|
+
authority_token_use?: "arc_authority";
|
|
66
|
+
decision: "allow" | "ask";
|
|
67
|
+
delegation_id: string | null;
|
|
68
|
+
delegation_status: string | null;
|
|
69
|
+
issued_by: "arc";
|
|
70
|
+
};
|
|
71
|
+
decision: "allow" | "ask";
|
|
72
|
+
input: unknown;
|
|
73
|
+
input_hash: string;
|
|
74
|
+
invocation_id: string;
|
|
75
|
+
nonce: string;
|
|
76
|
+
risk_level: ArcRiskLevel;
|
|
77
|
+
timestamp: string;
|
|
78
|
+
user: {
|
|
79
|
+
email: string;
|
|
80
|
+
id: string;
|
|
81
|
+
name: string | null;
|
|
82
|
+
};
|
|
83
|
+
workspace_id: string;
|
|
84
|
+
};
|
|
85
|
+
export type ArcRequestVerificationResult = {
|
|
86
|
+
claims: ArcSignedClaims;
|
|
87
|
+
payload: ArcExecutionRequestBody;
|
|
88
|
+
valid: true;
|
|
89
|
+
};
|
|
90
|
+
export type ArcSignedClaims = {
|
|
91
|
+
action_request_id?: string | null;
|
|
92
|
+
action_key: string;
|
|
93
|
+
app_id: string;
|
|
94
|
+
body_hash: string;
|
|
95
|
+
input_hash: string;
|
|
96
|
+
invocation_id: string;
|
|
97
|
+
nonce: string;
|
|
98
|
+
org_id: string;
|
|
99
|
+
timestamp: string;
|
|
100
|
+
workspace_id: string;
|
|
101
|
+
};
|
|
102
|
+
export type ArcAuthorityClaims = ArcSignedClaims & {
|
|
103
|
+
agent_id: string;
|
|
104
|
+
app_verification_status: "internal" | "official" | "pending" | "unverified" | "verified";
|
|
105
|
+
approval_id: string | null;
|
|
106
|
+
aud: string;
|
|
107
|
+
decision: "allow" | "ask";
|
|
108
|
+
delegation_id: string | null;
|
|
109
|
+
exp: number;
|
|
110
|
+
human_user_id: string;
|
|
111
|
+
iat: number;
|
|
112
|
+
iss: string;
|
|
113
|
+
jti: string;
|
|
114
|
+
risk_level: ArcRiskLevel;
|
|
115
|
+
scope: string;
|
|
116
|
+
sub: string;
|
|
117
|
+
token_use: "arc_authority";
|
|
118
|
+
};
|
|
119
|
+
export type ArcNonceReplayStore = {
|
|
120
|
+
/**
|
|
121
|
+
* Return true only when this nonce was not seen before and has now been recorded
|
|
122
|
+
* until expiresAt. Return false for replayed nonces.
|
|
123
|
+
*/
|
|
124
|
+
useNonce: (nonce: string, expiresAt: Date) => boolean | Promise<boolean>;
|
|
125
|
+
};
|
|
126
|
+
export type ArcInvocationIdempotencyStore = {
|
|
127
|
+
/**
|
|
128
|
+
* Return true only when this invocation id was not processed before and has
|
|
129
|
+
* now been recorded. Return false for duplicate/replayed invocation ids.
|
|
130
|
+
*/
|
|
131
|
+
useInvocation: (invocationId: string) => boolean | Promise<boolean>;
|
|
132
|
+
};
|
|
133
|
+
export type VerifyArcRequestOptions = {
|
|
134
|
+
jwks: {
|
|
135
|
+
keys: JWK[];
|
|
136
|
+
} | JWK[];
|
|
137
|
+
maxTimestampSkewMs?: number;
|
|
138
|
+
nonceStore?: ArcNonceReplayStore;
|
|
139
|
+
now?: Date;
|
|
140
|
+
unsafeAllowInMemoryNonceStore?: boolean;
|
|
141
|
+
};
|
|
142
|
+
export type ValidateArcInvocationOptions = {
|
|
143
|
+
expectedActionKey?: string;
|
|
144
|
+
expectedAppId?: string;
|
|
145
|
+
expectedDecision?: "allow" | "ask";
|
|
146
|
+
expectedOrgId?: string;
|
|
147
|
+
expectedRiskLevel?: ArcRiskLevel;
|
|
148
|
+
expectedWorkspaceId?: string;
|
|
149
|
+
inputSchema?: JsonObject;
|
|
150
|
+
invocationStore?: ArcInvocationIdempotencyStore;
|
|
151
|
+
};
|
|
152
|
+
export type VerifyArcDelegationOptions = {
|
|
153
|
+
expectedDelegationId?: string;
|
|
154
|
+
requireActiveDelegation?: boolean;
|
|
155
|
+
requireApprovedAsk?: boolean;
|
|
156
|
+
};
|
|
157
|
+
export type VerifyArcExecutionOptions = VerifyArcRequestOptions & ValidateArcInvocationOptions & VerifyArcDelegationOptions;
|
|
158
|
+
export type VerifyArcAuthorityTokenOptions = {
|
|
159
|
+
expectedActionKey?: string;
|
|
160
|
+
expectedAppId?: string;
|
|
161
|
+
expectedAudience?: string;
|
|
162
|
+
expectedDecision?: "allow" | "ask";
|
|
163
|
+
expectedDelegationId?: string;
|
|
164
|
+
expectedIssuer?: string;
|
|
165
|
+
expectedOrgId?: string;
|
|
166
|
+
expectedWorkspaceId?: string;
|
|
167
|
+
jwks: {
|
|
168
|
+
keys: JWK[];
|
|
169
|
+
} | JWK[];
|
|
170
|
+
maxClockSkewMs?: number;
|
|
171
|
+
nonceStore?: ArcNonceReplayStore;
|
|
172
|
+
now?: Date;
|
|
173
|
+
};
|
|
174
|
+
export type ArcAuthorityVerificationResult = {
|
|
175
|
+
claims: ArcAuthorityClaims;
|
|
176
|
+
expiresAt: Date;
|
|
177
|
+
valid: true;
|
|
178
|
+
};
|
|
179
|
+
export type ArcAuthorityIntrospectionInput = {
|
|
180
|
+
apiUrl?: string;
|
|
181
|
+
appApiKey: string;
|
|
182
|
+
fetch?: FetchLike;
|
|
183
|
+
invocationId?: string;
|
|
184
|
+
signedExecutionId?: string;
|
|
185
|
+
token?: string;
|
|
186
|
+
};
|
|
187
|
+
export type ArcAuthorityIntrospectionResult = {
|
|
188
|
+
active: boolean;
|
|
189
|
+
action: string | null;
|
|
190
|
+
agent_id: string | null;
|
|
191
|
+
app_id: string;
|
|
192
|
+
approval_id: string | null;
|
|
193
|
+
approval_status: string | null;
|
|
194
|
+
audience: string | null;
|
|
195
|
+
decision: ArcDefaultDecision | null;
|
|
196
|
+
delegation_id: string | null;
|
|
197
|
+
expires_at: string | null;
|
|
198
|
+
human_user_id: string | null;
|
|
199
|
+
invocation_id: string | null;
|
|
200
|
+
invocation_status: string | null;
|
|
201
|
+
issuer: string | null;
|
|
202
|
+
org_id: string | null;
|
|
203
|
+
reason: string | null;
|
|
204
|
+
risk_level: ArcRiskLevel | null;
|
|
205
|
+
scope: string | null;
|
|
206
|
+
token_use: string | null;
|
|
207
|
+
workspace_id: string | null;
|
|
208
|
+
};
|
|
209
|
+
export type RequireArcAuthorityOptions = VerifyArcAuthorityTokenOptions;
|
|
210
|
+
export type ArcAuthorityMiddlewareOptions = VerifyArcAuthorityTokenOptions & {
|
|
211
|
+
actionResolver?: (request: unknown) => string | undefined;
|
|
212
|
+
tokenResolver?: (request: unknown) => string | undefined;
|
|
213
|
+
};
|
|
214
|
+
export type ArcRequestLike = {
|
|
215
|
+
body: string | Uint8Array | ArcExecutionRequestBody;
|
|
216
|
+
headers: Headers | Record<string, string | string[] | undefined>;
|
|
217
|
+
};
|
|
218
|
+
export type ArcActionHandlerContext = {
|
|
219
|
+
actionKey: string;
|
|
220
|
+
agent: ArcExecutionRequestBody["agent"];
|
|
221
|
+
appUserId: string;
|
|
222
|
+
input: unknown;
|
|
223
|
+
invocationId: string;
|
|
224
|
+
payload: ArcExecutionRequestBody;
|
|
225
|
+
user: ArcExecutionRequestBody["user"];
|
|
226
|
+
};
|
|
227
|
+
export type ArcActionHandler = (context: ArcActionHandlerContext) => Promise<unknown> | unknown;
|
|
228
|
+
export type ArcActionHandlers<TActions extends ArcActionDefinitions> = Partial<Record<keyof TActions & string, ArcActionHandler>>;
|
|
229
|
+
export type HandleActionOptions = Omit<Partial<VerifyArcRequestOptions>, "jwks"> & {
|
|
230
|
+
apiUrl?: string;
|
|
231
|
+
jwks?: VerifyArcRequestOptions["jwks"];
|
|
232
|
+
jwksUrl?: string;
|
|
233
|
+
};
|
|
234
|
+
export type ArcActionRouteHandler = (request: unknown, response?: unknown) => Promise<Response | unknown>;
|
|
235
|
+
export type ArcExecutor = {
|
|
236
|
+
handleAction: <TActions extends ArcActionDefinitions>(actions: TActions, handlers: ArcActionHandlers<TActions>, options?: HandleActionOptions) => ArcActionRouteHandler;
|
|
237
|
+
verify: (request: unknown, options?: HandleActionOptions) => Promise<ArcRequestVerificationResult>;
|
|
238
|
+
};
|
|
239
|
+
export type FetchLike = (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
240
|
+
export type ArcDeveloperClientOptions = {
|
|
241
|
+
apiKey?: string;
|
|
242
|
+
baseUrl?: string;
|
|
243
|
+
fetch?: FetchLike;
|
|
244
|
+
orgId?: string;
|
|
245
|
+
sessionCookie?: string;
|
|
246
|
+
};
|
|
247
|
+
export type ArcAgentClientOptions = {
|
|
248
|
+
agentToken?: string;
|
|
249
|
+
baseUrl?: string;
|
|
250
|
+
fetch?: FetchLike;
|
|
251
|
+
};
|
|
252
|
+
export type ArcAgentRuntimeOptions = {
|
|
253
|
+
agentToken?: string;
|
|
254
|
+
apiUrl?: string;
|
|
255
|
+
fetch?: FetchLike;
|
|
256
|
+
};
|
|
257
|
+
export type ArcRequestOptions = {
|
|
258
|
+
headers?: Record<string, string>;
|
|
259
|
+
retrySafeGet?: boolean;
|
|
260
|
+
};
|
|
261
|
+
export type SyncActionsOptions = {
|
|
262
|
+
appId?: string;
|
|
263
|
+
baseUrl?: string;
|
|
264
|
+
client?: ArcDeveloperClient;
|
|
265
|
+
dryRun?: boolean;
|
|
266
|
+
sessionCookie?: string;
|
|
267
|
+
};
|
|
268
|
+
export type ArcDelegationActionInput = Record<string, ArcDefaultDecision> | Array<{
|
|
269
|
+
action_id?: string;
|
|
270
|
+
action_key?: string;
|
|
271
|
+
decision: ArcDefaultDecision;
|
|
272
|
+
key?: string;
|
|
273
|
+
}>;
|
|
274
|
+
export type ArcDelegationInput = {
|
|
275
|
+
agent_id: string;
|
|
276
|
+
app_id: string;
|
|
277
|
+
actions: ArcDelegationActionInput;
|
|
278
|
+
expires_at?: string | null;
|
|
279
|
+
label?: string | null;
|
|
280
|
+
name?: string | null;
|
|
281
|
+
};
|
|
282
|
+
export type ArcDelegationUpdateInput = {
|
|
283
|
+
actions?: ArcDelegationActionInput;
|
|
284
|
+
expires_at?: string | null;
|
|
285
|
+
label?: string | null;
|
|
286
|
+
name?: string | null;
|
|
287
|
+
};
|
|
288
|
+
export type ArcAuditExportFormat = "bundle" | "csv" | "jsonl";
|
|
289
|
+
export type ArcAuditFilters = {
|
|
290
|
+
action_id?: string;
|
|
291
|
+
action_key?: string;
|
|
292
|
+
actor_id?: string;
|
|
293
|
+
agent_id?: string;
|
|
294
|
+
app_id?: string;
|
|
295
|
+
approval_id?: string;
|
|
296
|
+
decision?: ArcDefaultDecision;
|
|
297
|
+
delegation_id?: string;
|
|
298
|
+
event_type?: string;
|
|
299
|
+
from?: string;
|
|
300
|
+
invocation_id?: string;
|
|
301
|
+
status?: string;
|
|
302
|
+
to?: string;
|
|
303
|
+
user_id?: string;
|
|
304
|
+
};
|
|
305
|
+
export type ArcAuditExportInput = ArcAuditFilters & {
|
|
306
|
+
filters?: ArcAuditFilters;
|
|
307
|
+
format?: ArcAuditExportFormat;
|
|
308
|
+
limit?: number;
|
|
309
|
+
offset?: number;
|
|
310
|
+
};
|
|
311
|
+
export type ArcOrgInviteInput = {
|
|
312
|
+
email: string;
|
|
313
|
+
name?: string | null;
|
|
314
|
+
role: "admin" | "developer" | "owner" | "viewer";
|
|
315
|
+
};
|
|
316
|
+
export type ArcAgentRuntimeAgent = {
|
|
317
|
+
active_delegations_count?: number;
|
|
318
|
+
created_at: string;
|
|
319
|
+
device_name: string | null;
|
|
320
|
+
display_name: string | null;
|
|
321
|
+
environment: string;
|
|
322
|
+
id: string;
|
|
323
|
+
labels: string[];
|
|
324
|
+
name: string;
|
|
325
|
+
owner_user_id: string;
|
|
326
|
+
status: "active" | "disabled" | "revoked";
|
|
327
|
+
type: "browser" | "cloud" | "custom" | "local" | "mcp";
|
|
328
|
+
updated_at: string;
|
|
329
|
+
};
|
|
330
|
+
export type ArcAgentRuntimeApp = {
|
|
331
|
+
arc_verification_status: "internal" | "official" | "pending" | "unverified" | "verified";
|
|
332
|
+
delegation?: {
|
|
333
|
+
expires_at: string | null;
|
|
334
|
+
id: string;
|
|
335
|
+
status: "active" | "expired" | "revoked";
|
|
336
|
+
};
|
|
337
|
+
delegation_id?: string;
|
|
338
|
+
delegation_status?: "active" | "expired" | "revoked";
|
|
339
|
+
description: string | null;
|
|
340
|
+
docs_url: string | null;
|
|
341
|
+
grant_id: string;
|
|
342
|
+
granted_action_count: number;
|
|
343
|
+
id: string;
|
|
344
|
+
name: string;
|
|
345
|
+
slug: string;
|
|
346
|
+
supported_transports: string[];
|
|
347
|
+
};
|
|
348
|
+
export type ArcAgentRuntimeAction = {
|
|
349
|
+
app_id: string;
|
|
350
|
+
decision: ArcDefaultDecision;
|
|
351
|
+
default_decision: ArcDefaultDecision;
|
|
352
|
+
delegation_id?: string;
|
|
353
|
+
description: string | null;
|
|
354
|
+
id: string;
|
|
355
|
+
input_schema: JsonObject;
|
|
356
|
+
key: string;
|
|
357
|
+
name: string;
|
|
358
|
+
output_schema?: JsonObject | null;
|
|
359
|
+
policy_id: string;
|
|
360
|
+
risk_level: ArcRiskLevel;
|
|
361
|
+
tags?: string[];
|
|
362
|
+
};
|
|
363
|
+
export type ArcAgentRuntimeGrant = {
|
|
364
|
+
actions: ArcAgentRuntimeAction[];
|
|
365
|
+
app: ArcAgentRuntimeApp;
|
|
366
|
+
id: string;
|
|
367
|
+
};
|
|
368
|
+
export type ArcAgentRuntimeInvokeOptions = {
|
|
369
|
+
idempotencyKey?: string;
|
|
370
|
+
};
|
|
371
|
+
export type ArcAgentRuntimeInvocationResult = {
|
|
372
|
+
approval_id: string | null;
|
|
373
|
+
decision: "allow";
|
|
374
|
+
idempotency_key: string;
|
|
375
|
+
invocation_id: string | null;
|
|
376
|
+
raw: unknown;
|
|
377
|
+
result: unknown;
|
|
378
|
+
status: "executed" | "queued";
|
|
379
|
+
} | {
|
|
380
|
+
approval_id: string | null;
|
|
381
|
+
decision: "ask";
|
|
382
|
+
idempotency_key: string;
|
|
383
|
+
invocation_id: string | null;
|
|
384
|
+
raw: unknown;
|
|
385
|
+
result: null;
|
|
386
|
+
status: "pending_approval";
|
|
387
|
+
} | {
|
|
388
|
+
approval_id: null;
|
|
389
|
+
decision: "block";
|
|
390
|
+
idempotency_key: string;
|
|
391
|
+
invocation_id: string | null;
|
|
392
|
+
raw: unknown;
|
|
393
|
+
result: null;
|
|
394
|
+
status: "blocked";
|
|
395
|
+
} | {
|
|
396
|
+
approval_id: null;
|
|
397
|
+
decision: string | null;
|
|
398
|
+
error: {
|
|
399
|
+
code: string;
|
|
400
|
+
message: string;
|
|
401
|
+
status?: number;
|
|
402
|
+
};
|
|
403
|
+
idempotency_key: string;
|
|
404
|
+
invocation_id: string | null;
|
|
405
|
+
raw: unknown;
|
|
406
|
+
result: null;
|
|
407
|
+
status: "error";
|
|
408
|
+
};
|
|
409
|
+
export declare class ArcError extends Error {
|
|
410
|
+
readonly code: string;
|
|
411
|
+
constructor(code: string, message: string);
|
|
412
|
+
}
|
|
413
|
+
export declare class ArcValidationError extends ArcError {
|
|
414
|
+
constructor(code: string, message: string);
|
|
415
|
+
}
|
|
416
|
+
export declare class ArcActionError extends ArcError {
|
|
417
|
+
readonly statusCode: number;
|
|
418
|
+
constructor(statusCode: number, code: string, message: string);
|
|
419
|
+
}
|
|
420
|
+
export declare class ArcHttpError extends ArcError {
|
|
421
|
+
readonly status: number;
|
|
422
|
+
readonly responseBody: unknown;
|
|
423
|
+
constructor(status: number, code: string, message: string, responseBody: unknown);
|
|
424
|
+
}
|
|
425
|
+
export declare class ArcRequestVerificationError extends Error {
|
|
426
|
+
readonly code: string;
|
|
427
|
+
constructor(code: string, message: string);
|
|
428
|
+
}
|
|
429
|
+
export declare function defineActions<TActions extends ArcActionDefinitions>(actions: TActions): TActions;
|
|
430
|
+
export declare function createActionSyncPayload<TActions extends ArcActionDefinitions>(actions: TActions): ArcActionSyncPayload;
|
|
431
|
+
export declare function syncActions<TActions extends ArcActionDefinitions>(actions: TActions, options?: SyncActionsOptions): Promise<ArcActionSyncPayload | unknown>;
|
|
432
|
+
export declare function handleAction<TActions extends ArcActionDefinitions>(actions: TActions, handlers: ArcActionHandlers<TActions>, options?: HandleActionOptions): ArcActionRouteHandler;
|
|
433
|
+
export declare function createArcExecutor(options?: HandleActionOptions): ArcExecutor;
|
|
434
|
+
export declare function verifyArcRequest(request: ArcRequestLike, options: VerifyArcRequestOptions): Promise<ArcRequestVerificationResult>;
|
|
435
|
+
export declare function verifyArcSignature(request: ArcRequestLike, options: VerifyArcRequestOptions): Promise<ArcRequestVerificationResult>;
|
|
436
|
+
export declare function verifyArcExecution(request: ArcRequestLike, options: VerifyArcExecutionOptions): Promise<ArcRequestVerificationResult>;
|
|
437
|
+
export declare function verifyArcAuthorityToken(token: string, options: VerifyArcAuthorityTokenOptions): Promise<ArcAuthorityVerificationResult>;
|
|
438
|
+
export declare function requireArcAuthority(token: string, options: RequireArcAuthorityOptions): Promise<ArcAuthorityClaims>;
|
|
439
|
+
export declare function createArcAuthorityMiddleware(options: ArcAuthorityMiddlewareOptions): (request: unknown, response: unknown, next?: (error?: unknown) => void) => Promise<any>;
|
|
440
|
+
export declare function introspectArcAuthority(input: ArcAuthorityIntrospectionInput): Promise<ArcAuthorityIntrospectionResult>;
|
|
441
|
+
export declare function verifyArcDelegation(payload: ArcExecutionRequestBody, options?: VerifyArcDelegationOptions): true;
|
|
442
|
+
export declare function validateArcInvocation(payload: ArcExecutionRequestBody, options?: ValidateArcInvocationOptions): Promise<true>;
|
|
443
|
+
export declare function createMemoryNonceStore(): ArcNonceReplayStore;
|
|
444
|
+
export declare class ArcDeveloperClient {
|
|
445
|
+
readonly options: ArcDeveloperClientOptions;
|
|
446
|
+
private readonly fetchImpl;
|
|
447
|
+
private sessionCookie;
|
|
448
|
+
constructor(options?: ArcDeveloperClientOptions);
|
|
449
|
+
get cookie(): string | null;
|
|
450
|
+
setCookie(cookie: string | null): void;
|
|
451
|
+
devLogin(input: {
|
|
452
|
+
email: string;
|
|
453
|
+
name?: string | null;
|
|
454
|
+
}): Promise<unknown>;
|
|
455
|
+
logout(): Promise<unknown>;
|
|
456
|
+
me(): Promise<unknown>;
|
|
457
|
+
listOrgs(): Promise<unknown>;
|
|
458
|
+
getCurrentOrg(): Promise<unknown>;
|
|
459
|
+
listOrgMembers(): Promise<unknown>;
|
|
460
|
+
inviteOrgMember(input: ArcOrgInviteInput): Promise<unknown>;
|
|
461
|
+
createApp(input: {
|
|
462
|
+
app_url?: string | null;
|
|
463
|
+
auth_requirements?: JsonObject;
|
|
464
|
+
category?: string;
|
|
465
|
+
description?: string | null;
|
|
466
|
+
docs_url?: string | null;
|
|
467
|
+
execute_url: string;
|
|
468
|
+
logo_url?: string | null;
|
|
469
|
+
manifest_version?: string;
|
|
470
|
+
name: string;
|
|
471
|
+
slug: string;
|
|
472
|
+
support_url?: string | null;
|
|
473
|
+
supported_transports?: string[];
|
|
474
|
+
verification_status?: string;
|
|
475
|
+
visibility?: "org" | "private" | "public";
|
|
476
|
+
}): Promise<unknown>;
|
|
477
|
+
createAppFromManifest(input: JsonObject): Promise<unknown>;
|
|
478
|
+
listApps(): Promise<unknown>;
|
|
479
|
+
getApp(appId: string): Promise<unknown>;
|
|
480
|
+
createAppApiKey(appId: string, input?: {
|
|
481
|
+
name?: string;
|
|
482
|
+
}): Promise<unknown>;
|
|
483
|
+
listAppApiKeys(appId: string): Promise<unknown>;
|
|
484
|
+
revokeAppApiKey(appId: string, keyId: string): Promise<unknown>;
|
|
485
|
+
rotateAppApiKey(appId: string, keyId: string, input?: {
|
|
486
|
+
name?: string;
|
|
487
|
+
}): Promise<unknown>;
|
|
488
|
+
syncActions(appId: string, actions: ArcActionDefinitions | ArcActionSyncItem[]): Promise<unknown>;
|
|
489
|
+
createAppConnection(input: {
|
|
490
|
+
app_id: string;
|
|
491
|
+
app_user_id: string;
|
|
492
|
+
}): Promise<unknown>;
|
|
493
|
+
createDevAgentToken(input: {
|
|
494
|
+
agent_type: string;
|
|
495
|
+
display_name?: string | null;
|
|
496
|
+
}): Promise<unknown>;
|
|
497
|
+
registerAgent(input: {
|
|
498
|
+
device_name?: string | null;
|
|
499
|
+
environment?: string;
|
|
500
|
+
expires_in_seconds?: number;
|
|
501
|
+
labels?: string[];
|
|
502
|
+
name: string;
|
|
503
|
+
non_expiring?: boolean;
|
|
504
|
+
public_key?: string | null;
|
|
505
|
+
type: "browser" | "cloud" | "custom" | "local" | "mcp";
|
|
506
|
+
}): Promise<unknown>;
|
|
507
|
+
listAgents(): Promise<unknown>;
|
|
508
|
+
getAgent(agentId: string): Promise<unknown>;
|
|
509
|
+
updateAgent(agentId: string, input: Record<string, unknown>): Promise<unknown>;
|
|
510
|
+
revokeAgent(agentId: string): Promise<unknown>;
|
|
511
|
+
regenerateAgentToken(agentId: string, input?: {
|
|
512
|
+
expires_in_seconds?: number;
|
|
513
|
+
non_expiring?: boolean;
|
|
514
|
+
}): Promise<unknown>;
|
|
515
|
+
listAgentGrants(agentId: string): Promise<unknown>;
|
|
516
|
+
putAgentGrant(agentId: string, appId: string, actions: Record<string, ArcDefaultDecision>): Promise<unknown>;
|
|
517
|
+
listDelegations(): Promise<unknown>;
|
|
518
|
+
getDelegation(delegationId: string): Promise<unknown>;
|
|
519
|
+
createDelegation(input: ArcDelegationInput): Promise<unknown>;
|
|
520
|
+
updateDelegationPermissions(delegationId: string, input: ArcDelegationUpdateInput): Promise<unknown>;
|
|
521
|
+
revokeDelegation(delegationId: string, input?: {
|
|
522
|
+
reason?: string | null;
|
|
523
|
+
}): Promise<unknown>;
|
|
524
|
+
listDelegationAudit(delegationId: string): Promise<unknown>;
|
|
525
|
+
listRegistryApps(): Promise<unknown>;
|
|
526
|
+
getRegistryApp(appId: string): Promise<unknown>;
|
|
527
|
+
listRegistryAppActions(appId: string): Promise<unknown>;
|
|
528
|
+
getRegistryAppManifest(appId: string): Promise<unknown>;
|
|
529
|
+
listApprovals(): Promise<unknown>;
|
|
530
|
+
getApproval(approvalId: string): Promise<unknown>;
|
|
531
|
+
approveApproval(approvalId: string): Promise<unknown>;
|
|
532
|
+
denyApproval(approvalId: string): Promise<unknown>;
|
|
533
|
+
tailAudit(input?: {
|
|
534
|
+
limit?: number;
|
|
535
|
+
}): Promise<unknown>;
|
|
536
|
+
exportAudit(input?: ArcAuditExportInput): Promise<unknown>;
|
|
537
|
+
createAuditExport(input?: ArcAuditExportInput): Promise<unknown>;
|
|
538
|
+
getAuditExport(exportId: string): Promise<unknown>;
|
|
539
|
+
verifyAudit(input?: ArcAuditExportInput): Promise<unknown>;
|
|
540
|
+
getAuditTimeline(input?: ArcAuditExportInput): Promise<unknown>;
|
|
541
|
+
getJwks(): Promise<unknown>;
|
|
542
|
+
getAuthorityMetadata(): Promise<unknown>;
|
|
543
|
+
introspectAuthority(input: {
|
|
544
|
+
invocation_id?: string;
|
|
545
|
+
signed_execution_id?: string;
|
|
546
|
+
token?: string;
|
|
547
|
+
}): Promise<unknown>;
|
|
548
|
+
request<T = unknown>(method: string, path: string, body?: unknown, options?: ArcRequestOptions): Promise<T>;
|
|
549
|
+
private authHeaders;
|
|
550
|
+
}
|
|
551
|
+
export declare class ArcAgentRuntimeClient {
|
|
552
|
+
readonly options: ArcAgentRuntimeOptions;
|
|
553
|
+
private readonly fetchImpl;
|
|
554
|
+
constructor(options?: ArcAgentRuntimeOptions);
|
|
555
|
+
me(): Promise<ArcAgentRuntimeAgent>;
|
|
556
|
+
listApps(): Promise<ArcAgentRuntimeApp[]>;
|
|
557
|
+
listActions(appId: string): Promise<ArcAgentRuntimeAction[]>;
|
|
558
|
+
getAvailableActions(): Promise<ArcAgentRuntimeAction[]>;
|
|
559
|
+
createActionRequest(input: {
|
|
560
|
+
action: string;
|
|
561
|
+
amount?: number;
|
|
562
|
+
app_id?: string;
|
|
563
|
+
app_slug?: string;
|
|
564
|
+
evidence?: Array<Record<string, unknown>>;
|
|
565
|
+
idempotency_key?: string;
|
|
566
|
+
reason?: string;
|
|
567
|
+
resource?: string;
|
|
568
|
+
resource_id?: string;
|
|
569
|
+
resource_type?: string;
|
|
570
|
+
}): Promise<unknown>;
|
|
571
|
+
pollActionRequest(actionRequestId: string): Promise<unknown>;
|
|
572
|
+
listGrants(): Promise<ArcAgentRuntimeGrant[]>;
|
|
573
|
+
invoke(appId: string, actionKey: string, input?: JsonObject, options?: ArcAgentRuntimeInvokeOptions): Promise<ArcAgentRuntimeInvocationResult>;
|
|
574
|
+
request<T = unknown>(method: string, path: string, body?: unknown): Promise<T>;
|
|
575
|
+
}
|
|
576
|
+
export declare function createArcAgentRuntime(options: ArcAgentRuntimeOptions): ArcAgentRuntimeClient;
|
|
577
|
+
export declare class ArcAgentClient {
|
|
578
|
+
readonly options: ArcAgentClientOptions;
|
|
579
|
+
private readonly fetchImpl;
|
|
580
|
+
constructor(options?: ArcAgentClientOptions);
|
|
581
|
+
invoke(input: {
|
|
582
|
+
action_key: string;
|
|
583
|
+
app_id?: string;
|
|
584
|
+
app_slug?: string;
|
|
585
|
+
idempotency_key?: string;
|
|
586
|
+
input?: JsonObject;
|
|
587
|
+
}): Promise<unknown>;
|
|
588
|
+
listActions(input: {
|
|
589
|
+
app_id?: string;
|
|
590
|
+
app_slug?: string;
|
|
591
|
+
}): Promise<unknown>;
|
|
592
|
+
createActionRequest(input: {
|
|
593
|
+
action: string;
|
|
594
|
+
amount?: number;
|
|
595
|
+
app_id?: string;
|
|
596
|
+
app_slug?: string;
|
|
597
|
+
evidence?: Array<Record<string, unknown>>;
|
|
598
|
+
idempotency_key?: string;
|
|
599
|
+
reason?: string;
|
|
600
|
+
resource?: string;
|
|
601
|
+
resource_id?: string;
|
|
602
|
+
resource_type?: string;
|
|
603
|
+
}): Promise<unknown>;
|
|
604
|
+
pollActionRequest(actionRequestId: string): Promise<unknown>;
|
|
605
|
+
getInvocation(invocationId: string): Promise<unknown>;
|
|
606
|
+
me(): Promise<ArcAgentRuntimeAgent>;
|
|
607
|
+
listApps(): Promise<ArcAgentRuntimeApp[]>;
|
|
608
|
+
listGrants(): Promise<ArcAgentRuntimeGrant[]>;
|
|
609
|
+
request<T = unknown>(method: string, path: string, body?: unknown): Promise<T>;
|
|
610
|
+
}
|
|
611
|
+
export declare const arc: {
|
|
612
|
+
ArcAgentClient: typeof ArcAgentClient;
|
|
613
|
+
ArcAgentRuntimeClient: typeof ArcAgentRuntimeClient;
|
|
614
|
+
ArcDeveloperClient: typeof ArcDeveloperClient;
|
|
615
|
+
createActionSyncPayload: typeof createActionSyncPayload;
|
|
616
|
+
createArcAuthorityMiddleware: typeof createArcAuthorityMiddleware;
|
|
617
|
+
createArcExecutor: typeof createArcExecutor;
|
|
618
|
+
createArcAgentRuntime: typeof createArcAgentRuntime;
|
|
619
|
+
createMemoryNonceStore: typeof createMemoryNonceStore;
|
|
620
|
+
defineActions: typeof defineActions;
|
|
621
|
+
handleAction: typeof handleAction;
|
|
622
|
+
introspectArcAuthority: typeof introspectArcAuthority;
|
|
623
|
+
requireArcAuthority: typeof requireArcAuthority;
|
|
624
|
+
syncActions: typeof syncActions;
|
|
625
|
+
validateArcInvocation: typeof validateArcInvocation;
|
|
626
|
+
verifyArcDelegation: typeof verifyArcDelegation;
|
|
627
|
+
verifyArcExecution: typeof verifyArcExecution;
|
|
628
|
+
verifyArcSignature: typeof verifyArcSignature;
|
|
629
|
+
verifyArcAuthorityToken: typeof verifyArcAuthorityToken;
|
|
630
|
+
verifyArcRequest: typeof verifyArcRequest;
|
|
631
|
+
};
|
|
632
|
+
export declare function createSlug(value: string): string;
|