agent-afk 5.202.0 → 5.203.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/session/agent-session.d.ts +1 -0
- package/dist/agent/session-ledger-project.d.ts +103 -0
- package/dist/agent/session-ledger-reader.d.ts +8 -0
- package/dist/agent/session-ledger.d.ts +4 -63
- package/dist/agent/subagent/fork-types.d.ts +2 -1
- package/dist/agent/subagent.d.ts +3 -0
- package/dist/agent/types/session-types.d.ts +20 -0
- package/dist/agent/workspace/index.d.ts +1 -1
- package/dist/agent/workspace/workspace-tools.d.ts +2 -1
- package/dist/cli.mjs +685 -685
- package/dist/index.mjs +239 -239
- package/dist/telegram.mjs +302 -302
- package/dist/web-server/frontend/app-approvals.d.ts +7 -0
- package/dist/web-server/frontend/app-views.d.ts +3 -0
- package/dist/web-server/frontend/at-file-panel.d.ts +5 -0
- package/dist/web-server/frontend/bg-jobs-panel.d.ts +14 -0
- package/dist/web-server/frontend/diff-viewer.d.ts +17 -0
- package/dist/web-server/frontend/ledger-adapter.d.ts +7 -2
- package/dist/web-server/frontend/memory-panel.d.ts +6 -0
- package/dist/web-server/frontend/model-selector.d.ts +10 -0
- package/dist/web-server/frontend/render-approvals.d.ts +22 -0
- package/dist/web-server/frontend/render-incremental.d.ts +1 -0
- package/dist/web-server/frontend/render.d.ts +3 -22
- package/dist/web-server/frontend/schedules-view.d.ts +1 -0
- package/dist/web-server/frontend/session-status.d.ts +11 -0
- package/dist/web-server/frontend/subagent-tree.d.ts +27 -0
- package/dist/web-server/frontend/thinking-panel.d.ts +3 -0
- package/dist/web-server/frontend/tool-trace-panel.d.ts +2 -0
- package/dist/web-server/frontend/view-model.d.ts +19 -1
- package/dist/web-server/routes.bg-jobs.d.ts +3 -0
- package/dist/web-server/routes.memory.d.ts +3 -0
- package/dist/web-server/routes.models.d.ts +6 -0
- package/dist/web-ui-assets/app.js +45 -45
- package/dist/web-ui-assets/approvals.css +3 -1
- package/dist/web-ui-assets/index.html +19 -10
- package/dist/web-ui-assets/schedules.css +2 -3
- package/dist/web-ui-assets/styles.css +263 -1
- package/package.json +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { OutputEvent } from './types/session-types.js';
|
|
2
|
+
import type { ElicitationRequest, ElicitationResult } from './types/sdk-types.js';
|
|
3
|
+
export type LedgerRecord = {
|
|
4
|
+
v: 1;
|
|
5
|
+
ts: number;
|
|
6
|
+
} & LedgerPayload;
|
|
7
|
+
export type LedgerPayload = {
|
|
8
|
+
kind: 'meta';
|
|
9
|
+
sessionId: string;
|
|
10
|
+
model: string;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
surface?: string;
|
|
13
|
+
traceLabel?: string | null;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'user';
|
|
16
|
+
text: string;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'assistant';
|
|
19
|
+
text: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'thinking';
|
|
22
|
+
text: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'tool';
|
|
25
|
+
toolName: string;
|
|
26
|
+
input: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'tool_error';
|
|
29
|
+
toolName?: string;
|
|
30
|
+
content: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'tool_result';
|
|
33
|
+
toolUseId: string;
|
|
34
|
+
content: string;
|
|
35
|
+
durationMs?: number;
|
|
36
|
+
toolName?: string;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'done';
|
|
39
|
+
costUsd?: number;
|
|
40
|
+
durationMs?: number;
|
|
41
|
+
inputTokens?: number;
|
|
42
|
+
outputTokens?: number;
|
|
43
|
+
cacheReadTokens?: number;
|
|
44
|
+
stopReason?: string;
|
|
45
|
+
} | {
|
|
46
|
+
kind: 'error';
|
|
47
|
+
message: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'paused';
|
|
50
|
+
resetsAt?: string;
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'resumed';
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'tool_activity';
|
|
55
|
+
activeCount: number;
|
|
56
|
+
activeToolUseIds: string[];
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'rate_limit';
|
|
59
|
+
retryAfterMs?: number;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'progress';
|
|
62
|
+
message: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'subagent_lifecycle';
|
|
65
|
+
subagentId: string;
|
|
66
|
+
status: string;
|
|
67
|
+
model?: string;
|
|
68
|
+
agentType?: string;
|
|
69
|
+
durationMs?: number;
|
|
70
|
+
totalCostUsd?: number;
|
|
71
|
+
outputBytes?: number;
|
|
72
|
+
errorClass?: string;
|
|
73
|
+
errorMessage?: string;
|
|
74
|
+
promptHead?: string;
|
|
75
|
+
} | {
|
|
76
|
+
kind: 'background_job';
|
|
77
|
+
jobId: string;
|
|
78
|
+
status: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
} | {
|
|
81
|
+
kind: 'plan_mode';
|
|
82
|
+
mode: string;
|
|
83
|
+
} | {
|
|
84
|
+
kind: 'elicitation';
|
|
85
|
+
reqId: string;
|
|
86
|
+
request: ElicitationRequest;
|
|
87
|
+
} | {
|
|
88
|
+
kind: 'elicitation_response';
|
|
89
|
+
reqId: string;
|
|
90
|
+
result: ElicitationResult;
|
|
91
|
+
hmac: string;
|
|
92
|
+
} | {
|
|
93
|
+
kind: 'abort_request';
|
|
94
|
+
nonce: string;
|
|
95
|
+
hmac: string;
|
|
96
|
+
} | {
|
|
97
|
+
kind: 'closed';
|
|
98
|
+
reason?: string;
|
|
99
|
+
};
|
|
100
|
+
export declare const MAX_TEXT_LEN = 8000;
|
|
101
|
+
export declare const MAX_TOOL_INPUT_LEN = 400;
|
|
102
|
+
export declare function clip(text: string, max: number): string;
|
|
103
|
+
export declare function projectOutputEvent(event: OutputEvent): LedgerPayload | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LedgerRecord } from './session-ledger.js';
|
|
2
|
+
export declare function parseRecord(line: string): LedgerRecord | null;
|
|
3
|
+
export declare function ledgerExists(sessionId: string): Promise<boolean>;
|
|
4
|
+
export declare function readLedger(sessionId: string): AsyncGenerator<LedgerRecord>;
|
|
5
|
+
export declare function tailLedger(sessionId: string, opts?: {
|
|
6
|
+
fromStart?: boolean;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}): AsyncGenerator<LedgerRecord>;
|
|
@@ -1,60 +1,7 @@
|
|
|
1
1
|
import type { OutputEvent } from './types/session-types.js';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
ts: number;
|
|
6
|
-
} & LedgerPayload;
|
|
7
|
-
export type LedgerPayload = {
|
|
8
|
-
kind: 'meta';
|
|
9
|
-
sessionId: string;
|
|
10
|
-
model: string;
|
|
11
|
-
cwd?: string;
|
|
12
|
-
surface?: string;
|
|
13
|
-
traceLabel?: string | null;
|
|
14
|
-
} | {
|
|
15
|
-
kind: 'user';
|
|
16
|
-
text: string;
|
|
17
|
-
} | {
|
|
18
|
-
kind: 'assistant';
|
|
19
|
-
text: string;
|
|
20
|
-
} | {
|
|
21
|
-
kind: 'tool';
|
|
22
|
-
toolName: string;
|
|
23
|
-
input: string;
|
|
24
|
-
} | {
|
|
25
|
-
kind: 'tool_error';
|
|
26
|
-
toolName?: string;
|
|
27
|
-
content: string;
|
|
28
|
-
} | {
|
|
29
|
-
kind: 'done';
|
|
30
|
-
costUsd?: number;
|
|
31
|
-
durationMs?: number;
|
|
32
|
-
} | {
|
|
33
|
-
kind: 'error';
|
|
34
|
-
message: string;
|
|
35
|
-
} | {
|
|
36
|
-
kind: 'paused';
|
|
37
|
-
resetsAt?: string;
|
|
38
|
-
} | {
|
|
39
|
-
kind: 'resumed';
|
|
40
|
-
} | {
|
|
41
|
-
kind: 'elicitation';
|
|
42
|
-
reqId: string;
|
|
43
|
-
request: ElicitationRequest;
|
|
44
|
-
} | {
|
|
45
|
-
kind: 'elicitation_response';
|
|
46
|
-
reqId: string;
|
|
47
|
-
result: ElicitationResult;
|
|
48
|
-
hmac: string;
|
|
49
|
-
} | {
|
|
50
|
-
kind: 'abort_request';
|
|
51
|
-
nonce: string;
|
|
52
|
-
hmac: string;
|
|
53
|
-
} | {
|
|
54
|
-
kind: 'closed';
|
|
55
|
-
reason?: string;
|
|
56
|
-
};
|
|
57
|
-
export declare function projectOutputEvent(event: OutputEvent): LedgerPayload | null;
|
|
2
|
+
export type { LedgerRecord, LedgerPayload } from './session-ledger-project.js';
|
|
3
|
+
export { projectOutputEvent } from './session-ledger-project.js';
|
|
4
|
+
export { ledgerExists, readLedger, tailLedger } from './session-ledger-reader.js';
|
|
58
5
|
export declare class SessionLedgerWriter {
|
|
59
6
|
private readonly sessionId;
|
|
60
7
|
private readonly ledgerPath;
|
|
@@ -67,16 +14,10 @@ export declare class SessionLedgerWriter {
|
|
|
67
14
|
private readyResolve;
|
|
68
15
|
constructor(sessionId: string);
|
|
69
16
|
get active(): boolean;
|
|
70
|
-
record(payload: LedgerPayload): void;
|
|
17
|
+
record(payload: import('./session-ledger-project.js').LedgerPayload): void;
|
|
71
18
|
recordEvent(event: OutputEvent): void;
|
|
72
19
|
recordUser(text: string): void;
|
|
73
20
|
private _openStream;
|
|
74
21
|
private _writeLine;
|
|
75
22
|
close(reason?: string): Promise<void>;
|
|
76
23
|
}
|
|
77
|
-
export declare function ledgerExists(sessionId: string): Promise<boolean>;
|
|
78
|
-
export declare function readLedger(sessionId: string): AsyncGenerator<LedgerRecord>;
|
|
79
|
-
export declare function tailLedger(sessionId: string, opts?: {
|
|
80
|
-
fromStart?: boolean;
|
|
81
|
-
signal?: AbortSignal;
|
|
82
|
-
}): AsyncGenerator<LedgerRecord>;
|
|
@@ -3,7 +3,7 @@ import type { CanUseTool } from '../types/sdk-types.js';
|
|
|
3
3
|
import type { WorkspaceStore } from '../workspace/workspace-store.js';
|
|
4
4
|
import type { HookRegistry } from '../hooks.js';
|
|
5
5
|
import type { AgentConfig, IAgentSession } from '../types.js';
|
|
6
|
-
import type { SubagentProgressSink } from '../types/session-types.js';
|
|
6
|
+
import type { SubagentProgressSink, OutputEvent } from '../types/session-types.js';
|
|
7
7
|
import type { TraceSink } from '../trace/index.js';
|
|
8
8
|
import type { Surface } from '../awareness/types.js';
|
|
9
9
|
import type { PhaseRole } from '../tools/nesting.js';
|
|
@@ -39,4 +39,5 @@ export interface SubagentManagerOptions {
|
|
|
39
39
|
onSubagentSucceeded?: (usage: import('./result.js').SubagentTrace['usage'], costUsd: number | undefined) => void;
|
|
40
40
|
workspaceStore?: WorkspaceStore;
|
|
41
41
|
sessionLabel?: string;
|
|
42
|
+
outputEventSink?: (event: OutputEvent) => void;
|
|
42
43
|
}
|
package/dist/agent/subagent.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ChildAbortedListener } from './abort-graph.js';
|
|
2
|
+
import type { OutputEvent } from './types/session-types.js';
|
|
2
3
|
import type { AbortOrigin, TraceSink } from './trace/index.js';
|
|
3
4
|
import { type ReadScopeInputs } from './subagent-read-scope.js';
|
|
4
5
|
import { type SubagentHandle } from './subagent/handle.js';
|
|
@@ -33,11 +34,13 @@ export declare class SubagentManager {
|
|
|
33
34
|
private rootController;
|
|
34
35
|
private counter;
|
|
35
36
|
private onSubagentSucceededCb;
|
|
37
|
+
private outputEventSink;
|
|
36
38
|
constructor(options?: SubagentManagerOptions);
|
|
37
39
|
list(): Array<Pick<SubagentHandle, 'id' | 'status'>>;
|
|
38
40
|
get(id: string): SubagentHandle | undefined;
|
|
39
41
|
onChildAborted(listener: ChildAbortedListener): () => void;
|
|
40
42
|
setOnSubagentSucceeded(cb: (usage: import('./subagent/result.js').SubagentTrace['usage'], costUsd: number | undefined) => void): void;
|
|
43
|
+
setOutputEventSink(sink: (event: OutputEvent) => void): void;
|
|
41
44
|
setCwd(cwd: string): void;
|
|
42
45
|
setTraceWriter(writer: TraceSink | undefined): void;
|
|
43
46
|
getReadScopeInputs(): ReadScopeInputs;
|
|
@@ -86,6 +86,26 @@ export type OutputEvent = {
|
|
|
86
86
|
type: 'resumed';
|
|
87
87
|
hotSwapped: boolean;
|
|
88
88
|
accountId?: string;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'subagent_lifecycle';
|
|
91
|
+
subagentId: string;
|
|
92
|
+
status: 'started' | 'succeeded' | 'failed' | 'cancelled';
|
|
93
|
+
model?: string;
|
|
94
|
+
agentType?: string;
|
|
95
|
+
durationMs?: number;
|
|
96
|
+
totalCostUsd?: number;
|
|
97
|
+
outputBytes?: number;
|
|
98
|
+
errorClass?: string;
|
|
99
|
+
errorMessage?: string;
|
|
100
|
+
promptHead?: string;
|
|
101
|
+
} | {
|
|
102
|
+
type: 'background_job';
|
|
103
|
+
jobId: string;
|
|
104
|
+
status: 'started' | 'completed' | 'failed' | 'cancelled' | 'delivered';
|
|
105
|
+
label?: string;
|
|
106
|
+
} | {
|
|
107
|
+
type: 'plan_mode';
|
|
108
|
+
mode: 'plan' | 'implement' | 'default';
|
|
89
109
|
};
|
|
90
110
|
export interface ProgressEvent {
|
|
91
111
|
taskId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { WorkspaceStore, } from './workspace-store.js';
|
|
2
2
|
export type { WorkspaceEntryType, WorkspaceEntry, WorkspacePublishInput, WorkspaceRelationType, } from './workspace-store.js';
|
|
3
|
-
export { workspacePublishTool, workspaceQueryTool, workspaceSubscribeTool, workspaceToolSchemas, createWorkspaceHandlers, WORKSPACE_TOOL_NAMES, } from './workspace-tools.js';
|
|
3
|
+
export { workspacePublishTool, workspaceQueryTool, workspaceSubscribeTool, workspaceToolSchemas, createWorkspaceHandlers, WORKSPACE_TOOL_NAMES, WORKSPACE_CHILD_TOOL_NAMES, } from './workspace-tools.js';
|
|
4
4
|
export { WORKSPACE_DELIVERY_RING_CAPACITY, WORKSPACE_DELIVERY_MAX_BYTES, } from './workspace-subscription-constants.js';
|
|
5
5
|
export type { WorkspaceSubscription } from './workspace-subscription.js';
|
|
6
6
|
export { notifySubscribers, formatWorkspaceDeliveryEnvelope, generateSubscriptionId, } from './workspace-subscription.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AnthropicToolDef, ToolHandler } from '../tools/types.js';
|
|
2
2
|
import { WorkspaceStore } from './workspace-store.js';
|
|
3
|
-
export declare const WORKSPACE_TOOL_NAMES: readonly ["workspace_publish", "workspace_query"
|
|
3
|
+
export declare const WORKSPACE_TOOL_NAMES: readonly ["workspace_publish", "workspace_query"];
|
|
4
|
+
export declare const WORKSPACE_CHILD_TOOL_NAMES: readonly ["workspace_publish", "workspace_query", "workspace_subscribe"];
|
|
4
5
|
export declare const workspacePublishTool: AnthropicToolDef;
|
|
5
6
|
export declare const workspaceQueryTool: AnthropicToolDef;
|
|
6
7
|
export declare const workspaceSubscribeTool: AnthropicToolDef;
|