agent-afk 5.175.0 → 5.176.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/agent/tools/handlers/index.d.ts +2 -1
- package/dist/agent/tools/handlers/web-request.d.ts +14 -0
- package/dist/agent/tools/schemas.d.ts +1 -0
- package/dist/cli.mjs +639 -639
- package/dist/config/env.d.ts +1249 -179
- package/dist/index.mjs +233 -233
- package/dist/telegram.mjs +312 -312
- package/dist/web/web-request.d.ts +47 -0
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { EgressGuardOptions } from './egress-guard.js';
|
|
2
|
+
import type { FetchFn } from './types.js';
|
|
3
|
+
export declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
4
|
+
export declare const MAX_TIMEOUT_MS = 120000;
|
|
5
|
+
export declare const DEFAULT_MAX_RESPONSE_BYTES = 100000;
|
|
6
|
+
export declare const MAX_RESPONSE_BYTES = 1000000;
|
|
7
|
+
export type MethodRisk = 'low' | 'medium' | 'high';
|
|
8
|
+
export type HttpMethod = 'GET' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
9
|
+
export declare function classifyMethodRisk(method: HttpMethod): MethodRisk;
|
|
10
|
+
export declare function isIdempotentMethod(method: HttpMethod): boolean;
|
|
11
|
+
export interface WebRequestResult {
|
|
12
|
+
status: number;
|
|
13
|
+
headers: Record<string, string>;
|
|
14
|
+
body: unknown;
|
|
15
|
+
truncated: boolean;
|
|
16
|
+
timing_ms: number;
|
|
17
|
+
risk: MethodRisk;
|
|
18
|
+
}
|
|
19
|
+
export type RecordEffectFn = (entry: {
|
|
20
|
+
url: string;
|
|
21
|
+
method: HttpMethod;
|
|
22
|
+
status: number;
|
|
23
|
+
risk: MethodRisk;
|
|
24
|
+
timing_ms: number;
|
|
25
|
+
}) => void | Promise<void>;
|
|
26
|
+
export type DomainCheckFn = (url: string) => {
|
|
27
|
+
allowed: true;
|
|
28
|
+
} | {
|
|
29
|
+
allowed: false;
|
|
30
|
+
reason: string;
|
|
31
|
+
};
|
|
32
|
+
export interface WebRequestOptions {
|
|
33
|
+
url: string;
|
|
34
|
+
method: HttpMethod;
|
|
35
|
+
body?: string | Record<string, unknown> | unknown[] | null;
|
|
36
|
+
headers?: Record<string, string>;
|
|
37
|
+
maxResponseBytes?: number;
|
|
38
|
+
signal: AbortSignal;
|
|
39
|
+
fetchFn?: FetchFn;
|
|
40
|
+
lookupFn?: EgressGuardOptions['lookupFn'];
|
|
41
|
+
domainCheck?: DomainCheckFn;
|
|
42
|
+
recordEffect?: RecordEffectFn;
|
|
43
|
+
}
|
|
44
|
+
export declare function webRequest(opts: WebRequestOptions): Promise<WebRequestResult>;
|
|
45
|
+
export declare function parseMethod(raw: unknown): HttpMethod | {
|
|
46
|
+
error: string;
|
|
47
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-afk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.176.0",
|
|
4
4
|
"description": "Open-source coding-agent harness you can actually change — own the loop (prompts, gates, routing, skills, terminal states), use any model, run long tasks while you're away.",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|