agent-afk 5.308.1 → 5.308.3
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/awareness/runtime-source.d.ts +2 -0
- package/dist/agent/daemon/gates.d.ts +2 -2
- package/dist/agent/effect-ledger/index.d.ts +1 -3
- package/dist/agent/elicitation-router.d.ts +0 -5
- package/dist/agent/gh-fix-of-fix.d.ts +0 -2
- package/dist/agent/hooks/config-loader.d.ts +1 -1
- package/dist/agent/marketplaces/manifest.d.ts +0 -1
- package/dist/agent/memory/memory-tools.input.d.ts +1 -0
- package/dist/agent/peer/envelope.d.ts +0 -1
- package/dist/agent/pr-review-label.d.ts +3 -3
- package/dist/agent/preexisting-ledger/detector.d.ts +3 -3
- package/dist/agent/providers/anthropic-direct/compact.d.ts +1 -3
- package/dist/agent/providers/openai-compatible/query/client-rebuild.d.ts +4 -0
- package/dist/agent/providers/openai-compatible/query/dispatch-append.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/token-refresh.d.ts +15 -0
- package/dist/agent/providers/openai-compatible/query.d.ts +5 -1
- package/dist/agent/session/sdk-surface-warning.d.ts +3 -0
- package/dist/agent/state/state-store.d.ts +0 -1
- package/dist/agent/storage/sqlite.d.ts +7 -0
- package/dist/agent/tools/handlers/terminal-font-size.d.ts +1 -1
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/agent/types/session-types.d.ts +1 -0
- package/dist/agent/usage/burn-rate.d.ts +0 -1
- package/dist/agent/workspace/workspace-store.d.ts +0 -1
- package/dist/browser/routing.d.ts +3 -4
- package/dist/browser/types.d.ts +1 -1
- package/dist/cli/commands/interactive/loop-iteration.boundary.d.ts +6 -2
- package/dist/cli/commands/interactive/peer-inbox-notifier.d.ts +0 -1
- package/dist/cli.mjs +472 -472
- package/dist/config/env.browser.d.ts +1 -1
- package/dist/config/env.d.ts +8 -1
- package/dist/config/env.misc.d.ts +7 -0
- package/dist/index.mjs +183 -180
- package/dist/telegram.mjs +234 -232
- package/dist/utils/abort.d.ts +10 -0
- package/dist/utils/crash-notifier.d.ts +9 -0
- package/package.json +2 -2
- package/dist/browser/agent-browser/actions.d.ts +0 -15
- package/dist/browser/agent-browser/client.d.ts +0 -69
- package/dist/browser/agent-browser/connection.d.ts +0 -15
- package/dist/browser/agent-browser/index.d.ts +0 -30
package/dist/utils/abort.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
1
|
export declare function forwardAbortSignal(parent: AbortSignal, child: AbortController): () => void;
|
|
2
|
+
export interface RequestAbortScopeOptions {
|
|
3
|
+
parentSignal: AbortSignal;
|
|
4
|
+
timeoutMs: number;
|
|
5
|
+
timeoutMessage: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RequestAbortScope {
|
|
8
|
+
readonly signal: AbortSignal;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createRequestAbortScope(opts: RequestAbortScopeOptions): RequestAbortScope;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CRASH_EXIT_DELAY_MS = 200;
|
|
2
|
+
export declare const CRASH_PUSH_GUARD_MS = 60000;
|
|
3
|
+
export interface CrashNotifierOptions {
|
|
4
|
+
extraLines?: () => string[];
|
|
5
|
+
}
|
|
6
|
+
export interface CrashNotifierHandle {
|
|
7
|
+
reset: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function installCrashNotifier(label: string, pushFn: (message: string) => Promise<unknown>, opts?: CrashNotifierOptions): CrashNotifierHandle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-afk",
|
|
3
|
-
"version": "5.308.
|
|
3
|
+
"version": "5.308.3",
|
|
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",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"emphasize": "^7.0.0",
|
|
144
144
|
"jsdom": "^30.1.1",
|
|
145
145
|
"log-update": "^8.0.0",
|
|
146
|
-
"marked": "^
|
|
146
|
+
"marked": "^18.1.0",
|
|
147
147
|
"node-cron": "^4.2.1",
|
|
148
148
|
"openai": "^7.30.0",
|
|
149
149
|
"ora": "^9.4.1",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ActOutcome } from '../provider.js';
|
|
2
|
-
import type { ActInput, InteractiveElement, Target } from '../types.js';
|
|
3
|
-
import type { BrowserConfig } from '../types.js';
|
|
4
|
-
import type { AgentBrowserClient, InspectElement } from './client.js';
|
|
5
|
-
export declare function mapElement(el: InspectElement): InteractiveElement;
|
|
6
|
-
export declare function resolveElementId(knownElements: Map<string, InteractiveElement>, target: Target): string | null;
|
|
7
|
-
export declare function executeAction(client: AgentBrowserClient, tabId: string, action: string, elementId: string, value?: string, timeoutMs?: number): Promise<void>;
|
|
8
|
-
export interface SemanticResolveContext {
|
|
9
|
-
client: AgentBrowserClient;
|
|
10
|
-
config: BrowserConfig;
|
|
11
|
-
tabId: string;
|
|
12
|
-
}
|
|
13
|
-
export declare function resolveSemanticAndAct(ctx: SemanticResolveContext, input: ActInput): Promise<{
|
|
14
|
-
elementId: string;
|
|
15
|
-
} | ActOutcome>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { AgentBrowserConnection } from './connection.js';
|
|
2
|
-
export interface AgentBrowserTab {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
url: string;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
isActive?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface InspectElement {
|
|
10
|
-
id: string;
|
|
11
|
-
tag: string;
|
|
12
|
-
role: string;
|
|
13
|
-
label: string;
|
|
14
|
-
kind: string | null;
|
|
15
|
-
value: string | null;
|
|
16
|
-
placeholder: string | null;
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
checked?: boolean;
|
|
19
|
-
selected?: boolean;
|
|
20
|
-
expanded?: boolean;
|
|
21
|
-
bbox: {
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
w: number;
|
|
25
|
-
h: number;
|
|
26
|
-
};
|
|
27
|
-
selector?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface ReadResult {
|
|
30
|
-
content: string;
|
|
31
|
-
url: string;
|
|
32
|
-
title: string;
|
|
33
|
-
wordCount: number;
|
|
34
|
-
}
|
|
35
|
-
export declare class AgentBrowserClient {
|
|
36
|
-
private readonly baseUrl;
|
|
37
|
-
private readonly token;
|
|
38
|
-
constructor(connection: AgentBrowserConnection);
|
|
39
|
-
private call;
|
|
40
|
-
listTabs(): Promise<AgentBrowserTab[]>;
|
|
41
|
-
openTab(url: string): Promise<{
|
|
42
|
-
tabId: string;
|
|
43
|
-
}>;
|
|
44
|
-
closeTab(tabId: string): Promise<void>;
|
|
45
|
-
read(tabId: string, opts?: {
|
|
46
|
-
mode?: string;
|
|
47
|
-
query?: string;
|
|
48
|
-
budget?: number;
|
|
49
|
-
}): Promise<ReadResult>;
|
|
50
|
-
inspect(tabId: string, opts?: {
|
|
51
|
-
mode?: string;
|
|
52
|
-
query?: string;
|
|
53
|
-
limit?: number;
|
|
54
|
-
}): Promise<{
|
|
55
|
-
elements: InspectElement[];
|
|
56
|
-
}>;
|
|
57
|
-
click(tabId: string, elementId: string): Promise<void>;
|
|
58
|
-
fill(tabId: string, elementId: string, value: string): Promise<void>;
|
|
59
|
-
press(tabId: string, key: string, elementId?: string): Promise<void>;
|
|
60
|
-
select(tabId: string, elementId: string, value: string): Promise<void>;
|
|
61
|
-
waitFor(tabId: string, condition: string, opts?: {
|
|
62
|
-
value?: string;
|
|
63
|
-
timeout?: number;
|
|
64
|
-
}): Promise<void>;
|
|
65
|
-
evalScript(tabId: string, script: string): Promise<unknown>;
|
|
66
|
-
screenshot(tabId: string): Promise<{
|
|
67
|
-
data: string;
|
|
68
|
-
}>;
|
|
69
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface AgentBrowserConnection {
|
|
2
|
-
url: string;
|
|
3
|
-
token: string;
|
|
4
|
-
pid: number;
|
|
5
|
-
version: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function readConnectionFile(path?: string): AgentBrowserConnection | null;
|
|
8
|
-
export declare function isPidAlive(pid: number): boolean;
|
|
9
|
-
export declare function probeHealth(baseUrl: string, token: string, timeoutMs?: number): Promise<boolean>;
|
|
10
|
-
export interface AvailabilityResult {
|
|
11
|
-
available: boolean;
|
|
12
|
-
connection: AgentBrowserConnection | null;
|
|
13
|
-
reason: string | null;
|
|
14
|
-
}
|
|
15
|
-
export declare function checkAvailability(connectionPath?: string): Promise<AvailabilityResult>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { BrowserProvider, OpenOutcome, ActOutcome } from '../provider.js';
|
|
2
|
-
import type { ActInput, BrowserConfig, BrowserObservation, BrowserProviderState, CloseInput, ExtractInput, ExtractResult, InteractiveElement, ObserveInput, OpenInput, RenderInput, RenderResult, ScreenshotInput, ScreenshotResult } from '../types.js';
|
|
3
|
-
import { AgentBrowserClient } from './client.js';
|
|
4
|
-
import type { AgentBrowserConnection } from './connection.js';
|
|
5
|
-
export interface SessionState {
|
|
6
|
-
tabId: string;
|
|
7
|
-
observationCounter: number;
|
|
8
|
-
knownElements: Map<string, InteractiveElement>;
|
|
9
|
-
lastAction: string | null;
|
|
10
|
-
lastActionAt: string | null;
|
|
11
|
-
currentUrl: string | null;
|
|
12
|
-
currentTitle: string | null;
|
|
13
|
-
}
|
|
14
|
-
export declare class AgentBrowserProvider implements BrowserProvider {
|
|
15
|
-
readonly name = "agent-browser";
|
|
16
|
-
private readonly config;
|
|
17
|
-
readonly client: AgentBrowserClient;
|
|
18
|
-
private readonly sessions;
|
|
19
|
-
constructor(config: BrowserConfig, connection: AgentBrowserConnection);
|
|
20
|
-
open(input: OpenInput): Promise<OpenOutcome>;
|
|
21
|
-
observe(input: ObserveInput): Promise<BrowserObservation>;
|
|
22
|
-
act(input: ActInput): Promise<ActOutcome>;
|
|
23
|
-
render(_input: RenderInput): Promise<RenderResult>;
|
|
24
|
-
screenshot(input: ScreenshotInput): Promise<ScreenshotResult>;
|
|
25
|
-
extract(_input: ExtractInput): Promise<ExtractResult>;
|
|
26
|
-
close(input: CloseInput): Promise<void>;
|
|
27
|
-
describe(sessionId: string): BrowserProviderState | null;
|
|
28
|
-
shutdown(): Promise<void>;
|
|
29
|
-
private buildObservation;
|
|
30
|
-
}
|