agent-afk 5.207.2 → 5.208.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/agent/tools/handlers/web-request.d.ts +2 -2
- package/dist/agent/tools/handlers/web-scrape.d.ts +2 -2
- package/dist/cli.mjs +581 -581
- package/dist/index.mjs +1 -1
- package/dist/telegram.mjs +1 -1
- package/dist/web-server/shared/ledger-adapter.d.ts +3 -0
- package/dist/web-ui-assets/assets/index-3YQ3Lxgf.css +1 -0
- package/dist/web-ui-assets/assets/index-Ye2O81KT.js +298 -0
- package/dist/web-ui-assets/index.html +14 -87
- package/package.json +2 -2
- package/dist/web-server/frontend/ansi-strip.d.ts +0 -1
- package/dist/web-server/frontend/app-approvals.d.ts +0 -7
- package/dist/web-server/frontend/app-chrome.d.ts +0 -3
- package/dist/web-server/frontend/app-views.d.ts +0 -3
- package/dist/web-server/frontend/app.d.ts +0 -1
- package/dist/web-server/frontend/at-file-panel.d.ts +0 -5
- package/dist/web-server/frontend/bg-jobs-panel.d.ts +0 -14
- package/dist/web-server/frontend/chrome.d.ts +0 -1
- package/dist/web-server/frontend/composer-value.d.ts +0 -1
- package/dist/web-server/frontend/composer-wiring.d.ts +0 -7
- package/dist/web-server/frontend/diff-viewer.d.ts +0 -17
- package/dist/web-server/frontend/dom-utils.d.ts +0 -2
- package/dist/web-server/frontend/ledger-adapter.d.ts +0 -2
- package/dist/web-server/frontend/markdown-dom.d.ts +0 -1
- package/dist/web-server/frontend/memory-panel.d.ts +0 -6
- package/dist/web-server/frontend/model-selector.d.ts +0 -10
- package/dist/web-server/frontend/queue-panel.d.ts +0 -21
- package/dist/web-server/frontend/queue-reorder.d.ts +0 -5
- package/dist/web-server/frontend/render-approvals.d.ts +0 -22
- package/dist/web-server/frontend/render-incremental.d.ts +0 -3
- package/dist/web-server/frontend/render.d.ts +0 -16
- package/dist/web-server/frontend/schedule-form.d.ts +0 -7
- package/dist/web-server/frontend/schedule-history.d.ts +0 -1
- package/dist/web-server/frontend/schedules-view.d.ts +0 -33
- package/dist/web-server/frontend/scroll-pin.d.ts +0 -7
- package/dist/web-server/frontend/session-status.d.ts +0 -11
- package/dist/web-server/frontend/slash-autocomplete-render.d.ts +0 -3
- package/dist/web-server/frontend/slash-autocomplete.d.ts +0 -39
- package/dist/web-server/frontend/slash-highlight.d.ts +0 -8
- package/dist/web-server/frontend/sse-client.d.ts +0 -20
- package/dist/web-server/frontend/subagent-tree.d.ts +0 -27
- package/dist/web-server/frontend/thinking-panel.d.ts +0 -3
- package/dist/web-server/frontend/tool-trace-panel.d.ts +0 -2
- package/dist/web-server/frontend/view-model.d.ts +0 -66
- package/dist/web-server/frontend/web-token.d.ts +0 -3
- package/dist/web-ui-assets/app.js +0 -65
- package/dist/web-ui-assets/approvals.css +0 -55
- package/dist/web-ui-assets/at-file.css +0 -110
- package/dist/web-ui-assets/bg-jobs.css +0 -130
- package/dist/web-ui-assets/chrome.js +0 -1
- package/dist/web-ui-assets/diff-viewer.css +0 -168
- package/dist/web-ui-assets/memory.css +0 -146
- package/dist/web-ui-assets/model-selector.css +0 -118
- package/dist/web-ui-assets/schedules.css +0 -201
- package/dist/web-ui-assets/styles.css +0 -680
- /package/dist/{web → http-client}/egress-guard.d.ts +0 -0
- /package/dist/{web → http-client}/extract.d.ts +0 -0
- /package/dist/{web → http-client}/extraction-advisory.d.ts +0 -0
- /package/dist/{web → http-client}/index.d.ts +0 -0
- /package/dist/{web → http-client}/retryFetch.d.ts +0 -0
- /package/dist/{web → http-client}/scrape.d.ts +0 -0
- /package/dist/{web → http-client}/search.d.ts +0 -0
- /package/dist/{web → http-client}/types.d.ts +0 -0
- /package/dist/{web → http-client}/web-request.d.ts +0 -0
|
@@ -1,89 +1,16 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!DOCTYPE html>
|
|
2
2
|
<html lang="en" class="dark">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<!-- Inline data-URI favicon: browsers request /favicon.ico unconditionally,
|
|
17
|
-
and a 404 there logs a console error on every load. Inlining answers it
|
|
18
|
-
without a round trip or an extra asset in the bundle. -->
|
|
19
|
-
<link
|
|
20
|
-
rel="icon"
|
|
21
|
-
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='10' fill='%23f9854b'/%3E%3C/svg%3E"
|
|
22
|
-
/>
|
|
23
|
-
<link rel="stylesheet" href="/styles.css" />
|
|
24
|
-
<link rel="stylesheet" href="/approvals.css" />
|
|
25
|
-
<link rel="stylesheet" href="/schedules.css" />
|
|
26
|
-
<link rel="stylesheet" href="/at-file.css" />
|
|
27
|
-
<link rel="stylesheet" href="/diff-viewer.css" />
|
|
28
|
-
<link rel="stylesheet" href="/bg-jobs.css" />
|
|
29
|
-
<link rel="stylesheet" href="/model-selector.css" />
|
|
30
|
-
<link rel="stylesheet" href="/memory.css" />
|
|
31
|
-
</head>
|
|
32
|
-
<body>
|
|
33
|
-
<header class="topbar">
|
|
34
|
-
<div class="brand">
|
|
35
|
-
<span class="brand-mark"></span>
|
|
36
|
-
<span class="brand-name">afk</span>
|
|
37
|
-
</div>
|
|
38
|
-
<div id="meter" class="meter"></div>
|
|
39
|
-
<div id="status" class="status" role="status" aria-live="polite">idle</div>
|
|
40
|
-
<button id="menu-toggle" type="button" class="menu-toggle" aria-label="Toggle sessions">☰</button>
|
|
41
|
-
</header>
|
|
42
|
-
<div id="toast" class="toast" hidden></div>
|
|
43
|
-
|
|
44
|
-
<main class="layout">
|
|
45
|
-
<aside id="sidebar" class="sidebar">
|
|
46
|
-
<nav class="sidebar-nav">
|
|
47
|
-
<button id="nav-sessions" type="button" class="sidebar-nav-btn is-active" data-view="sessions">Sessions</button>
|
|
48
|
-
<button id="nav-schedules" type="button" class="sidebar-nav-btn" data-view="schedules">Schedules</button>
|
|
49
|
-
<button id="nav-bg-jobs" type="button" class="sidebar-nav-btn" data-view="bg-jobs">Jobs</button>
|
|
50
|
-
<button id="nav-memory" type="button" class="sidebar-nav-btn" data-view="memory">Memory</button>
|
|
51
|
-
</nav>
|
|
52
|
-
<div id="sidebar-head" class="sidebar-head">
|
|
53
|
-
<span>Sessions</span>
|
|
54
|
-
<button id="new-session" type="button" class="new-session" title="Start a new session">+ New</button>
|
|
55
|
-
</div>
|
|
56
|
-
<div id="sessions" class="sessions"></div>
|
|
57
|
-
</aside>
|
|
58
|
-
<div id="sidebar-backdrop" class="sidebar-backdrop"></div>
|
|
59
|
-
|
|
60
|
-
<section class="main">
|
|
61
|
-
<div id="transcript" class="transcript"></div>
|
|
62
|
-
<div id="schedules-view" class="sched-view" hidden></div>
|
|
63
|
-
<div id="bg-jobs-view" class="bgjob-view" hidden></div>
|
|
64
|
-
<div id="memory-view" class="mem-view" hidden></div>
|
|
65
|
-
<div id="approvals" class="approvals"></div>
|
|
66
|
-
<div id="composer" class="composer">
|
|
67
|
-
<div id="slash-menu" class="slash-menu" hidden></div>
|
|
68
|
-
<div id="queue" class="queue"></div>
|
|
69
|
-
<div class="composer-row">
|
|
70
|
-
<!-- The mirror renders the highlighted copy of the textarea's text;
|
|
71
|
-
the textarea paints its own text transparent and keeps the
|
|
72
|
-
caret. Both must share text metrics — see styles.css. -->
|
|
73
|
-
<div class="prompt-wrap">
|
|
74
|
-
<div id="prompt-mirror" class="prompt-mirror" aria-hidden="true"></div>
|
|
75
|
-
<textarea id="prompt" rows="2" placeholder="Message the agent…" aria-label="Message the agent"></textarea>
|
|
76
|
-
</div>
|
|
77
|
-
<button id="stop" type="button" class="stop" hidden>Stop</button>
|
|
78
|
-
<button id="send" type="button" class="send">Send</button>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</section>
|
|
82
|
-
</main>
|
|
83
|
-
|
|
84
|
-
<script type="module" src="/app.js"></script>
|
|
85
|
-
<!-- Was an inline <script>; moved to a file because the document is served
|
|
86
|
-
under `script-src 'self'`, which blocks inline execution. -->
|
|
87
|
-
<script type="module" src="/chrome.js"></script>
|
|
88
|
-
</body>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="color-scheme" content="dark light" />
|
|
7
|
+
<meta name="afk-token" content="__AFK_WEB_TOKEN__" />
|
|
8
|
+
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🌀</text></svg>" />
|
|
9
|
+
<title>AFK Dashboard</title>
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-Ye2O81KT.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-3YQ3Lxgf.css">
|
|
12
|
+
</head>
|
|
13
|
+
<body class="bg-background text-foreground antialiased">
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
</body>
|
|
89
16
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-afk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.208.1",
|
|
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",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"test:coverage": "vitest run --coverage",
|
|
121
121
|
"test:watch": "vitest watch",
|
|
122
122
|
"test:pty": "vitest run --config vitest.pty.config.ts",
|
|
123
|
-
"lint": "tsc --noEmit
|
|
123
|
+
"lint": "tsc --noEmit",
|
|
124
124
|
"audit:sdk": "tsx scripts/audit-sdk-dependency.ts",
|
|
125
125
|
"audit:sdk:check": "tsx scripts/audit-sdk-dependency.ts --check",
|
|
126
126
|
"audit:sdk:update-lock": "tsx scripts/audit-sdk-dependency.ts --update-lock",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function stripAnsi(s: string): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ApprovalAnswer } from './render.js';
|
|
2
|
-
export type ApiFunction = <T>(path: string, init?: RequestInit) => Promise<T>;
|
|
3
|
-
export interface ApprovalsManager {
|
|
4
|
-
pollPending: () => Promise<void>;
|
|
5
|
-
answerApproval: (id: string, answer: ApprovalAnswer) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function createApprovalsManager(api: ApiFunction, container: HTMLElement): ApprovalsManager;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface BgJobMeta {
|
|
2
|
-
jobId: string;
|
|
3
|
-
subagentId: string;
|
|
4
|
-
label: string;
|
|
5
|
-
promptHash: string;
|
|
6
|
-
model: string;
|
|
7
|
-
startedAt: number;
|
|
8
|
-
endedAt?: number;
|
|
9
|
-
status: 'running' | 'completed' | 'failed' | 'cancelled';
|
|
10
|
-
parentSessionId?: string;
|
|
11
|
-
stopReason?: string;
|
|
12
|
-
schemaVersion: 1;
|
|
13
|
-
}
|
|
14
|
-
export declare function renderBgJobsPanel(container: HTMLElement, jobs: BgJobMeta[]): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function notifyValueChanged(input: HTMLTextAreaElement): void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SlashAutocomplete } from './slash-autocomplete.js';
|
|
2
|
-
import type { CommandEntry } from '../../cli/input/slash-match.js';
|
|
3
|
-
export interface ComposerAffordanceDeps {
|
|
4
|
-
input: HTMLTextAreaElement;
|
|
5
|
-
loadCommands: () => Promise<CommandEntry[]>;
|
|
6
|
-
}
|
|
7
|
-
export declare function wireComposerAffordances(deps: ComposerAffordanceDeps): SlashAutocomplete | undefined;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface DiffLine {
|
|
2
|
-
type: 'add' | 'del' | 'ctx';
|
|
3
|
-
content: string;
|
|
4
|
-
oldNum?: number;
|
|
5
|
-
newNum?: number;
|
|
6
|
-
}
|
|
7
|
-
export interface DiffHunk {
|
|
8
|
-
header: string;
|
|
9
|
-
oldStart: number;
|
|
10
|
-
newStart: number;
|
|
11
|
-
lines: DiffLine[];
|
|
12
|
-
}
|
|
13
|
-
export declare function parseDiffHunks(diff: string): DiffHunk[];
|
|
14
|
-
export declare function renderDiffBlock(diff: string, opts?: {
|
|
15
|
-
fileName?: string;
|
|
16
|
-
collapsed?: boolean;
|
|
17
|
-
}): HTMLElement;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export type { TranscriptItem, ToolCallItem, SubagentItem, SessionTotals, LedgerRecordLike, SseStreamFrame, ToolIndex, SubagentIndex, } from '../shared/ledger-adapter.js';
|
|
2
|
-
export { resetIdCounter, ledgerRecordToItem, accumulateTotals, ledgerToItems, } from '../shared/ledger-adapter.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderMarkdown(source: string, className?: string): HTMLElement;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface ModelInfo {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
}
|
|
5
|
-
export interface ModelSelectorOpts {
|
|
6
|
-
onSelect: (modelId: string) => void;
|
|
7
|
-
current?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function createModelSelector(opts: ModelSelectorOpts, models?: readonly ModelInfo[]): HTMLElement;
|
|
10
|
-
export declare function renderModelBadge(model: string): HTMLElement;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface QueuePanelDeps {
|
|
2
|
-
container: HTMLElement;
|
|
3
|
-
input: HTMLTextAreaElement;
|
|
4
|
-
send: HTMLElement;
|
|
5
|
-
submit: (text: string) => Promise<void>;
|
|
6
|
-
isLive: () => boolean;
|
|
7
|
-
isTurnActive: () => boolean;
|
|
8
|
-
onAccepted: () => void;
|
|
9
|
-
onError: (message: string) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare class QueuePanel {
|
|
12
|
-
private readonly deps;
|
|
13
|
-
private queue;
|
|
14
|
-
private flushing;
|
|
15
|
-
constructor(deps: QueuePanelDeps);
|
|
16
|
-
entries(): readonly string[];
|
|
17
|
-
clear(): void;
|
|
18
|
-
wire(): void;
|
|
19
|
-
render(): void;
|
|
20
|
-
flush(): Promise<void>;
|
|
21
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function moveUp<T>(list: readonly T[], index: number): T[];
|
|
2
|
-
export declare function moveDown<T>(list: readonly T[], index: number): T[];
|
|
3
|
-
export declare function removeAt<T>(list: readonly T[], index: number): T[];
|
|
4
|
-
export declare function editAt<T>(list: readonly T[], index: number, value: T): T[];
|
|
5
|
-
export declare function insert<T>(list: readonly T[], index: number, value: T): T[];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface PendingApproval {
|
|
2
|
-
id: string;
|
|
3
|
-
sessionId?: string;
|
|
4
|
-
createdAt?: string;
|
|
5
|
-
request: {
|
|
6
|
-
message?: string;
|
|
7
|
-
title?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
serverName?: string;
|
|
10
|
-
origin?: string;
|
|
11
|
-
type?: 'text' | 'confirm' | 'choice' | 'multi_choice' | 'number';
|
|
12
|
-
choices?: string[];
|
|
13
|
-
questionDefault?: string | boolean | number;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export type ApprovalAnswer = {
|
|
17
|
-
action: 'accept';
|
|
18
|
-
content?: Record<string, unknown>;
|
|
19
|
-
} | {
|
|
20
|
-
action: 'decline';
|
|
21
|
-
};
|
|
22
|
-
export declare function renderApprovals(container: HTMLElement, pending: PendingApproval[], onAnswer: (id: string, answer: ApprovalAnswer) => void): void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { TranscriptItem } from './ledger-adapter.js';
|
|
2
|
-
export type { PendingApproval, ApprovalAnswer } from './render-approvals.js';
|
|
3
|
-
export { renderApprovals } from './render-approvals.js';
|
|
4
|
-
export interface SessionSummary {
|
|
5
|
-
id: string;
|
|
6
|
-
mode: 'live' | 'readonly';
|
|
7
|
-
cwd?: string;
|
|
8
|
-
surface?: string;
|
|
9
|
-
updatedAt?: string;
|
|
10
|
-
title?: string;
|
|
11
|
-
alive?: boolean;
|
|
12
|
-
model?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function renderSidebar(container: HTMLElement, sessions: SessionSummary[], activeId: string | undefined, onSelect: (id: string) => void): void;
|
|
15
|
-
export declare function renderTranscript(container: HTMLElement, items: TranscriptItem[]): void;
|
|
16
|
-
export declare function relativeTime(iso: string): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ScheduleConfig } from './schedules-view.js';
|
|
2
|
-
interface ScheduleFormOptions {
|
|
3
|
-
api: <T>(path: string, init?: RequestInit) => Promise<T>;
|
|
4
|
-
onSaved: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare function openScheduleForm(schedule: ScheduleConfig | null, opts: ScheduleFormOptions): void;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function openScheduleHistory(scheduleId: string, api: <T>(path: string, init?: RequestInit) => Promise<T>): void;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface ScheduleConfig {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
command: string;
|
|
5
|
-
cron: string;
|
|
6
|
-
trigger?: 'cron' | 'sessionstart' | 'both';
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
notifyOn?: 'failure' | 'always' | 'never';
|
|
9
|
-
createdAt: string;
|
|
10
|
-
updatedAt: string;
|
|
11
|
-
}
|
|
12
|
-
interface SchedulesViewOptions {
|
|
13
|
-
container: HTMLElement;
|
|
14
|
-
api: <T>(path: string, init?: RequestInit) => Promise<T>;
|
|
15
|
-
onEdit: (schedule: ScheduleConfig) => void;
|
|
16
|
-
onShowHistory: (id: string) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare class SchedulesView {
|
|
19
|
-
private container;
|
|
20
|
-
private api;
|
|
21
|
-
private onEdit;
|
|
22
|
-
private onShowHistory;
|
|
23
|
-
private schedules;
|
|
24
|
-
private daemonStatus;
|
|
25
|
-
constructor(opts: SchedulesViewOptions);
|
|
26
|
-
load(): Promise<void>;
|
|
27
|
-
private render;
|
|
28
|
-
private renderCard;
|
|
29
|
-
private inflight;
|
|
30
|
-
private toggleSchedule;
|
|
31
|
-
private deleteSchedule;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SessionSummary } from './render.js';
|
|
2
|
-
export type SessionStatusGroup = 'needs-input' | 'active' | 'completed';
|
|
3
|
-
export interface SessionGroups {
|
|
4
|
-
needsInput: SessionSummary[];
|
|
5
|
-
active: SessionSummary[];
|
|
6
|
-
completed: SessionSummary[];
|
|
7
|
-
}
|
|
8
|
-
export declare function classifySession(session: SessionSummary, pendingSessionIds?: ReadonlySet<string>): SessionStatusGroup;
|
|
9
|
-
export declare function groupSessionsByStatus(sessions: SessionSummary[], pendingSessionIds?: ReadonlySet<string>): SessionGroups;
|
|
10
|
-
export declare function renderStatusBadge(status: SessionStatusGroup): HTMLSpanElement;
|
|
11
|
-
export declare function renderGroupedSessionList(groups: SessionGroups, container: HTMLElement, activeId: string | undefined, onSelect: (id: string) => void): void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { SlashCandidate } from '../../cli/input/slash-match.js';
|
|
2
|
-
export declare const REPL_ONLY: ReadonlySet<string>;
|
|
3
|
-
export declare function renderSlashRow(cand: SlashCandidate, optionId: string, isSelected: boolean, onAccept: (cand: SlashCandidate) => void): HTMLElement;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type CommandEntry, type SlashCandidate } from '../../cli/input/slash-match.js';
|
|
2
|
-
export { REPL_ONLY } from './slash-autocomplete-render.js';
|
|
3
|
-
export interface SlashAutocompleteDeps {
|
|
4
|
-
input: HTMLTextAreaElement;
|
|
5
|
-
menu: HTMLElement;
|
|
6
|
-
loadCommands: () => Promise<CommandEntry[]>;
|
|
7
|
-
onCommandsLoaded?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare class SlashAutocomplete {
|
|
10
|
-
private readonly deps;
|
|
11
|
-
private commands;
|
|
12
|
-
private loading;
|
|
13
|
-
private candidates;
|
|
14
|
-
private selected;
|
|
15
|
-
private open;
|
|
16
|
-
private openIntent;
|
|
17
|
-
private focused;
|
|
18
|
-
private composing;
|
|
19
|
-
private generation;
|
|
20
|
-
private readonly menuId;
|
|
21
|
-
private readonly status;
|
|
22
|
-
constructor(deps: SlashAutocompleteDeps);
|
|
23
|
-
isOpen(): boolean;
|
|
24
|
-
knows(name: string): boolean;
|
|
25
|
-
preload(): Promise<void>;
|
|
26
|
-
current(): SlashCandidate | undefined;
|
|
27
|
-
wire(): void;
|
|
28
|
-
private onKeyDown;
|
|
29
|
-
private move;
|
|
30
|
-
private revealSelected;
|
|
31
|
-
private accept;
|
|
32
|
-
private close;
|
|
33
|
-
private syncAria;
|
|
34
|
-
private optionId;
|
|
35
|
-
refresh(): Promise<void>;
|
|
36
|
-
private ensureCommands;
|
|
37
|
-
private render;
|
|
38
|
-
private row;
|
|
39
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface HighlightToken {
|
|
2
|
-
text: string;
|
|
3
|
-
kind: 'known' | 'slash' | 'plain';
|
|
4
|
-
}
|
|
5
|
-
export declare function tokenizeInput(value: string, isKnown: (name: string) => boolean): HighlightToken[];
|
|
6
|
-
export declare function paintMirror(mirror: HTMLElement, tokens: readonly HighlightToken[]): void;
|
|
7
|
-
export declare function repaintSlashHighlight(input: HTMLTextAreaElement, mirror: HTMLElement, isKnown: (name: string) => boolean): void;
|
|
8
|
-
export declare function mountSlashHighlight(input: HTMLTextAreaElement, mirror: HTMLElement, isKnown: (name: string) => boolean): () => void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type StreamStatus = 'connecting' | 'open' | 'reconnecting' | 'closed' | 'ended';
|
|
2
|
-
export interface StreamHandlers {
|
|
3
|
-
onEvent: (data: unknown, meta: {
|
|
4
|
-
id?: string;
|
|
5
|
-
}) => void;
|
|
6
|
-
onStatus?: (status: StreamStatus, reason?: string) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare class SessionStream {
|
|
9
|
-
private readonly sessionId;
|
|
10
|
-
private readonly token;
|
|
11
|
-
private readonly handlers;
|
|
12
|
-
private controller;
|
|
13
|
-
private lastEventId;
|
|
14
|
-
private attempt;
|
|
15
|
-
private stopped;
|
|
16
|
-
constructor(sessionId: string, token: string, handlers: StreamHandlers);
|
|
17
|
-
start(): void;
|
|
18
|
-
stop(): void;
|
|
19
|
-
private connect;
|
|
20
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface SubagentNode {
|
|
2
|
-
id: string;
|
|
3
|
-
parentId?: string;
|
|
4
|
-
model?: string;
|
|
5
|
-
agentType?: string;
|
|
6
|
-
status: string;
|
|
7
|
-
durationMs?: number;
|
|
8
|
-
totalCostUsd?: number;
|
|
9
|
-
promptHead?: string;
|
|
10
|
-
children: SubagentNode[];
|
|
11
|
-
}
|
|
12
|
-
export interface SubagentLifecycleEvent {
|
|
13
|
-
subagentId: string;
|
|
14
|
-
status: string;
|
|
15
|
-
parentId?: string;
|
|
16
|
-
model?: string;
|
|
17
|
-
agentType?: string;
|
|
18
|
-
durationMs?: number;
|
|
19
|
-
totalCostUsd?: number;
|
|
20
|
-
promptHead?: string;
|
|
21
|
-
}
|
|
22
|
-
export declare class SubagentTreeState {
|
|
23
|
-
#private;
|
|
24
|
-
addEvent(event: SubagentLifecycleEvent): void;
|
|
25
|
-
getRoots(): SubagentNode[];
|
|
26
|
-
}
|
|
27
|
-
export declare function renderSubagentTree(state: SubagentTreeState, container: HTMLElement): void;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { OutputEvent } from '../../agent/types/session-types.js';
|
|
2
|
-
import type { ToolDiffChunk } from '../../agent/types/message-types.js';
|
|
3
|
-
export interface UserMessageItem {
|
|
4
|
-
kind: 'user';
|
|
5
|
-
id: string;
|
|
6
|
-
text: string;
|
|
7
|
-
timestamp?: Date;
|
|
8
|
-
}
|
|
9
|
-
export interface AssistantTextItem {
|
|
10
|
-
kind: 'assistant';
|
|
11
|
-
id: string;
|
|
12
|
-
text: string;
|
|
13
|
-
}
|
|
14
|
-
export interface ThinkingItem {
|
|
15
|
-
kind: 'thinking';
|
|
16
|
-
id: string;
|
|
17
|
-
text: string;
|
|
18
|
-
}
|
|
19
|
-
export type ToolCallStatus = 'running' | 'ok' | 'error';
|
|
20
|
-
export interface ToolCallItem {
|
|
21
|
-
kind: 'tool';
|
|
22
|
-
id: string;
|
|
23
|
-
name: string;
|
|
24
|
-
inputPreview: string;
|
|
25
|
-
status: ToolCallStatus;
|
|
26
|
-
output?: string;
|
|
27
|
-
outputUnavailable?: boolean;
|
|
28
|
-
diff?: ToolDiffChunk['diff'];
|
|
29
|
-
durationMs?: number;
|
|
30
|
-
}
|
|
31
|
-
export interface ErrorItem {
|
|
32
|
-
kind: 'error';
|
|
33
|
-
id: string;
|
|
34
|
-
message: string;
|
|
35
|
-
}
|
|
36
|
-
export interface NoticeItem {
|
|
37
|
-
kind: 'notice';
|
|
38
|
-
id: string;
|
|
39
|
-
text: string;
|
|
40
|
-
}
|
|
41
|
-
export interface SubagentItem {
|
|
42
|
-
kind: 'subagent';
|
|
43
|
-
id: string;
|
|
44
|
-
subagentId: string;
|
|
45
|
-
status: string;
|
|
46
|
-
label: string;
|
|
47
|
-
model?: string;
|
|
48
|
-
durationMs?: number;
|
|
49
|
-
promptHead?: string;
|
|
50
|
-
}
|
|
51
|
-
export interface BgJobItem {
|
|
52
|
-
kind: 'bg_job';
|
|
53
|
-
id: string;
|
|
54
|
-
jobId: string;
|
|
55
|
-
status: string;
|
|
56
|
-
label: string;
|
|
57
|
-
}
|
|
58
|
-
export type TranscriptItem = UserMessageItem | AssistantTextItem | ThinkingItem | ToolCallItem | ErrorItem | NoticeItem | SubagentItem | BgJobItem;
|
|
59
|
-
export interface ApplyOptions {
|
|
60
|
-
replay?: boolean;
|
|
61
|
-
}
|
|
62
|
-
export interface TranscriptModel {
|
|
63
|
-
apply(event: OutputEvent, opts?: ApplyOptions): void;
|
|
64
|
-
getItems(): TranscriptItem[];
|
|
65
|
-
}
|
|
66
|
-
export declare function createTranscriptModel(): TranscriptModel;
|