@markmo/europacore-session-ui 0.2.0 → 0.4.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/README.md +1 -1
- package/dist/ArtifactsPage-BxaqShTv.js +1178 -0
- package/dist/{BoardPage-BAQrGP7G.js → BoardPage-DH7p5o99.js} +274 -265
- package/dist/{CardDetail-CCgP8R61.js → CardDetail-LfDCJQhS.js} +42 -33
- package/dist/{ComparePage-FcLLhKzC.js → ComparePage-CrbCyu4u.js} +33 -33
- package/dist/MemoriesPage-BRA53Hlb.js +679 -0
- package/dist/{OverviewPage-CbfbyGNT.js → OverviewPage-BSBqY83_.js} +50 -49
- package/dist/{RegisterPage-3-hJNQEV.js → RegisterPage-64yGl9E-.js} +76 -76
- package/dist/SessionPage-C4hSlxWQ.js +906 -0
- package/dist/api/agentClient.d.ts +66 -1
- package/dist/api/wire.d.ts +540 -4
- package/dist/features/artifacts/ArtifactDetail.d.ts +15 -0
- package/dist/features/artifacts/ArtifactDialogs.d.ts +29 -0
- package/dist/features/artifacts/ArtifactLedger.d.ts +11 -0
- package/dist/features/artifacts/ArtifactStats.d.ts +9 -0
- package/dist/features/artifacts/ArtifactsPage.d.ts +1 -0
- package/dist/features/artifacts/artifactsCommands.d.ts +3 -0
- package/dist/features/artifacts/artifactsStore.d.ts +27 -0
- package/dist/features/artifacts/artifactsUi.d.ts +33 -0
- package/dist/features/bootstrap.d.ts +1 -0
- package/dist/features/chat/model/artifactAccess.d.ts +50 -0
- package/dist/features/chat/model/artifactCsv.d.ts +11 -0
- package/dist/features/chat/model/artifactExport.d.ts +45 -0
- package/dist/features/chat/model/artifactStats.d.ts +79 -0
- package/dist/features/chat/model/artifacts.d.ts +151 -0
- package/dist/features/chat/model/claims.d.ts +102 -0
- package/dist/features/chat/model/contextSources.d.ts +41 -0
- package/dist/features/chat/model/entries.d.ts +37 -2
- package/dist/features/chat/model/fleet.d.ts +11 -0
- package/dist/features/chat/model/format.d.ts +6 -0
- package/dist/features/chat/model/inspect.d.ts +11 -0
- package/dist/features/chat/model/memory.d.ts +3 -3
- package/dist/features/chat/model/memoryRecords.d.ts +79 -0
- package/dist/features/chat/model/monitors.d.ts +11 -0
- package/dist/features/chat/model/progress.d.ts +73 -0
- package/dist/features/chat/model/routing.d.ts +20 -0
- package/dist/features/chat/model/store.d.ts +5 -0
- package/dist/features/chat/model/tasks.d.ts +1 -1
- package/dist/features/chat/panels/ProgressPanel.d.ts +8 -0
- package/dist/features/chat/session/ComposerHistory.d.ts +1 -1
- package/dist/features/chat/session/SessionController.d.ts +3 -2
- package/dist/features/chat/session/useFileMentions.d.ts +18 -5
- package/dist/features/chat/transcript/ArtifactCard.d.ts +8 -0
- package/dist/features/chat/transcript/Rows.d.ts +12 -1
- package/dist/features/commands/InspectDialog.d.ts +3 -0
- package/dist/features/commands/dialogs.d.ts +1 -1
- package/dist/features/commands/registry.d.ts +1 -1
- package/dist/features/memories/MemoriesPage.d.ts +1 -0
- package/dist/features/memories/memoriesCommands.d.ts +3 -0
- package/dist/features/memories/memoriesController.d.ts +81 -0
- package/dist/features/memory/MemoryDialog.d.ts +1 -1
- package/dist/features/memory/memoryService.d.ts +10 -10
- package/dist/features/workspace/claimsCommands.d.ts +26 -0
- package/dist/features/workspace/collisionsWatcher.d.ts +7 -0
- package/dist/features/workspace/useSessionPageHooks.d.ts +1 -1
- package/dist/{index-NjGO7Jg1.js → index-CMPf-3JZ.js} +4821 -3447
- package/dist/index.d.ts +2 -0
- package/dist/index.js +86 -82
- package/dist/lib/paths.d.ts +12 -0
- package/dist/lib/zip.d.ts +14 -0
- package/dist/{promptHistory-DjSCHmEk.js → promptHistory-BR0NpLCI.js} +14 -14
- package/package.json +1 -1
- package/dist/SessionPage-CA9hAakW.js +0 -865
|
@@ -49,3 +49,14 @@ export declare function taskProgress(task: FleetTaskEntry): string | null;
|
|
|
49
49
|
export declare function pauseOf(pauses: Pause[], pendingId: string | null | undefined): Pause | null;
|
|
50
50
|
/** The message that sends a fleet session's run a command (europacore's fleet agent parses it). */
|
|
51
51
|
export declare function fleetCommand(kind: 'cancel' | 'retry' | 'steer' | 'approve' | 'release', task?: string | null, text?: string): string;
|
|
52
|
+
/** A fleet spec sent as a prompt, read back for a person: its name, and what it runs. */
|
|
53
|
+
export interface FleetSpecSummary {
|
|
54
|
+
name: string | null;
|
|
55
|
+
/** "3 tasks", or for one task run several ways, "add token refresh · 3 variants (a, b, c)". */
|
|
56
|
+
runs: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* What a fleet spec (JSON, or TOML as `/fleet` sends it) runs, or null when `text` is not one. The fleet agent's
|
|
60
|
+
* prompt is the whole spec; the transcript and the brief show this instead, with the spec one click away.
|
|
61
|
+
*/
|
|
62
|
+
export declare function fleetSpecSummary(text: string): FleetSpecSummary | null;
|
|
@@ -9,3 +9,9 @@ export declare function compactJson(value: unknown, max?: number): string;
|
|
|
9
9
|
export declare function relativeTime(iso: string, now?: number): string;
|
|
10
10
|
/** A short span for a column: "42s", "5m", "3h", "2d". */
|
|
11
11
|
export declare function formatSpan(ms: number | null | undefined): string;
|
|
12
|
+
/** A size for a column: "412 B", "8.1 KB", "412 KB", "1.4 MB". */
|
|
13
|
+
export declare function formatBytes(n: number | null | undefined): string;
|
|
14
|
+
/** How long until `iso`, as a short span ("42m"); "" once it has passed or when it is no time at all. */
|
|
15
|
+
export declare function timeUntil(iso: string | null | undefined, now?: number): string;
|
|
16
|
+
/** A moment as a clock time, "14:32", with the day in front when it is not today: "29 Oct 14:32". */
|
|
17
|
+
export declare function clockTime(iso: string | null | undefined, now?: number): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RunSummary, StepView, ToolCallView } from '../../../api/wire';
|
|
2
|
+
/** ``value`` on one line, cut to ``limit`` characters (0: whole). */
|
|
3
|
+
export declare function clip(value: unknown, limit?: number): string;
|
|
4
|
+
/** Why the run stopped, in a word: its stop reason, else its error code, else its status. */
|
|
5
|
+
export declare function stoppedBecause(run: RunSummary): string;
|
|
6
|
+
/** A run's line in the list: steps, tokens, cost and why it stopped. */
|
|
7
|
+
export declare function runLine(run: RunSummary): string;
|
|
8
|
+
/** A step's model call: model, tokens in and out, cache read/written, cost. */
|
|
9
|
+
export declare function stepLine(step: StepView): string;
|
|
10
|
+
/** A tool call: its name with arguments, how it ended and what it returned. */
|
|
11
|
+
export declare function toolLine(call: ToolCallView, limit?: number): string;
|
|
@@ -90,7 +90,7 @@ export type MemoryArgs = {
|
|
|
90
90
|
} | {
|
|
91
91
|
error: string;
|
|
92
92
|
};
|
|
93
|
-
/** Parses the arguments of /
|
|
93
|
+
/** Parses the arguments of /decisions. */
|
|
94
94
|
export declare function parseMemoryArgs(args: string): MemoryArgs;
|
|
95
95
|
/** Decisions and requirements the agent marked in its text: "Decision: …" lines and "## Decisions" sections. */
|
|
96
96
|
export declare function extractMarked(text: string): MarkedItem[];
|
|
@@ -101,7 +101,7 @@ export declare function parseExtraction(text: string): {
|
|
|
101
101
|
} | {
|
|
102
102
|
error: string;
|
|
103
103
|
};
|
|
104
|
-
/** Sent by /
|
|
104
|
+
/** Sent by /decisions extract. Avoids the words the mock server picks scenarios from. */
|
|
105
105
|
export declare const EXTRACT_PROMPT = "List the key decisions and requirements agreed so far in this conversation. Reply with only a ```json fence containing a JSON array of objects with the fields kind (\"decision\" or \"requirement\"), text and rationale (a string or null). Reply with [] when there are none.";
|
|
106
106
|
/** A well-formed copy of a stored or mirrored entry, or null when it is malformed. */
|
|
107
107
|
export declare function parseEntry(value: unknown): MemoryEntry | null;
|
|
@@ -109,7 +109,7 @@ export declare function parseEntry(value: unknown): MemoryEntry | null;
|
|
|
109
109
|
export declare function mirroredEntries(metadata: Record<string, unknown> | null | undefined): MemoryEntry[];
|
|
110
110
|
/** Register order: decisions before requirements, then by id number. */
|
|
111
111
|
export declare function compareEntries(a: MemoryEntry, b: MemoryEntry): number;
|
|
112
|
-
/** The /
|
|
112
|
+
/** The /decisions notice: counts, one line per entry (rationale below it) and the commands. */
|
|
113
113
|
export declare function formatMemoryList(entries: MemoryEntry[], heading: string, now?: number): string;
|
|
114
114
|
/** "D-001 Use pnpm for…" for pickers and notices. */
|
|
115
115
|
export declare function memoryLabel(entry: MemoryEntry, width?: number): string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Long-term memories as the memories screen shows them: its scopes and smart views, the rows each shows, the
|
|
3
|
+
* text of a flag, and the markdown a memory is edited as. Pure: no client, no browser. Not the decision register
|
|
4
|
+
* (`model/memory.ts`), which is the client's own. A port of europacorecli's `src/state/memory-records.ts`.
|
|
5
|
+
*/
|
|
6
|
+
import type { MemoryFlag, MemoryFlagName, MemoryPatch, MemoryRecord, MemoryRecordKind, MemoryRevision, MemoryScopeName } from '../../../api/wire';
|
|
7
|
+
export declare const MEMORY_SCOPES: MemoryScopeName[];
|
|
8
|
+
export declare const MEMORY_KINDS: MemoryRecordKind[];
|
|
9
|
+
/** The caps the server enforces, checked here too so an edit is refused before it is sent. */
|
|
10
|
+
export declare const DESCRIPTION_MAX = 200;
|
|
11
|
+
export declare const BODY_MAX = 4000;
|
|
12
|
+
export type SmartView = MemoryFlagName | 'forgotten';
|
|
13
|
+
/** The smart views, by flag; "forgotten" lists the merged and pruned memories, which restore brings back. */
|
|
14
|
+
export declare const SMART_VIEWS: {
|
|
15
|
+
view: SmartView;
|
|
16
|
+
label: string;
|
|
17
|
+
}[];
|
|
18
|
+
/** How each flag is written: a word when there is room, a letter when not. */
|
|
19
|
+
export declare const FLAG_TEXT: Record<MemoryFlagName, {
|
|
20
|
+
word: string;
|
|
21
|
+
letter: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** One line of the scopes pane: everything, one scope (one project), or a smart view. */
|
|
25
|
+
export interface ScopeNode {
|
|
26
|
+
id: string;
|
|
27
|
+
kind: 'all' | 'scope' | 'view';
|
|
28
|
+
label: string;
|
|
29
|
+
/** Null for a project not loaded yet. */
|
|
30
|
+
count: number | null;
|
|
31
|
+
scope?: MemoryScopeName;
|
|
32
|
+
project?: string | null;
|
|
33
|
+
view?: SmartView;
|
|
34
|
+
}
|
|
35
|
+
export declare function isActive(record: MemoryRecord): boolean;
|
|
36
|
+
export declare function hasFlag(record: MemoryRecord, flag: MemoryFlagName): boolean;
|
|
37
|
+
/** A project id's label: "project markmo/europacore". */
|
|
38
|
+
export declare function projectLabel(project: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* The scopes pane: all memories, the org, the user, each project (the session's first, then the other projects
|
|
41
|
+
* the caller has memories in), then the smart views. Counts are of active memories; a project not loaded has none.
|
|
42
|
+
*/
|
|
43
|
+
export declare function scopeNodes(records: MemoryRecord[], labels: Partial<Record<MemoryScopeName, string>>, projects: string[], loaded: ReadonlySet<string>): ScopeNode[];
|
|
44
|
+
/** Whether `record` matches a filter: every word in its name, description or body; `k:kind`, `s:source`. */
|
|
45
|
+
export declare function matchesQuery(record: MemoryRecord, query: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The rows `node` shows, in the index's order (scope, kind, name). `keep` holds memories changed here, which stay
|
|
48
|
+
* where they were whatever their status now, so forgetting one does not make it vanish from under the cursor.
|
|
49
|
+
*/
|
|
50
|
+
export declare function recordsFor(node: ScopeNode, records: MemoryRecord[], query: string, keep?: ReadonlySet<string>): MemoryRecord[];
|
|
51
|
+
/** The flags column: the words when they fit `width`, else their letters. */
|
|
52
|
+
export declare function flagCell(record: MemoryRecord, width: number): string;
|
|
53
|
+
/** What a flag means for this memory, for its callout. */
|
|
54
|
+
export declare function flagCallout(flag: MemoryFlag): string;
|
|
55
|
+
/** When the memory reaches a model. */
|
|
56
|
+
export declare function loadsWhen(record: MemoryRecord): string;
|
|
57
|
+
/** Who wrote it, in which session, and when. */
|
|
58
|
+
export declare function writtenBy(record: MemoryRecord, now?: number): string;
|
|
59
|
+
/** A memory as `$EDITOR` shows it, parsed back. */
|
|
60
|
+
export interface ParsedMemoryMarkdown {
|
|
61
|
+
name: string | null;
|
|
62
|
+
description: string;
|
|
63
|
+
kind: MemoryRecordKind;
|
|
64
|
+
body: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The markdown the server renders a memory as (`name`, `description` and `type` in the frontmatter, then the
|
|
68
|
+
* body), parsed back with the server's own rules, but strictly: what the server would quietly repair (a missing
|
|
69
|
+
* frontmatter, a description too long) is an error here, so an edit never saves something the person did not see.
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseMemoryMarkdown(text: string): ParsedMemoryMarkdown | {
|
|
72
|
+
error: string;
|
|
73
|
+
};
|
|
74
|
+
/** The change an edit makes, against the revision it was read at; null when nothing changed. */
|
|
75
|
+
export declare function memoryPatch(current: MemoryRecord, parsed: ParsedMemoryMarkdown): MemoryPatch | null | {
|
|
76
|
+
error: string;
|
|
77
|
+
};
|
|
78
|
+
/** What one revision changed, a line per field. */
|
|
79
|
+
export declare function revisionChanges(revision: MemoryRevision): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MonitorEnd, MonitorOutput } from '../../../api/wire';
|
|
2
|
+
import type { MonitorEntry } from './entries';
|
|
3
|
+
/**
|
|
4
|
+
* A monitor's output as the server sends it (a `monitor_output` event's data, or a `monitor` notice's `monitor`),
|
|
5
|
+
* or null when it lacks what a row needs.
|
|
6
|
+
*/
|
|
7
|
+
export declare function monitorOutputOf(data: unknown): MonitorOutput | null;
|
|
8
|
+
/** The transcript row for what the agent was given of a monitor's output. */
|
|
9
|
+
export declare function monitorEntry(key: string, output: MonitorOutput): MonitorEntry;
|
|
10
|
+
/** How a monitor ended, in a phrase: "its command exited with code 1 after 12s (3 events): Traceback…". */
|
|
11
|
+
export declare function monitorEndText(end: MonitorEnd, files: boolean): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ViewState } from './store';
|
|
2
|
+
export type StepStatus = 'completed' | 'in_progress' | 'pending';
|
|
3
|
+
export interface ProgressStep {
|
|
4
|
+
text: string;
|
|
5
|
+
status: StepStatus;
|
|
6
|
+
}
|
|
7
|
+
/** A page the session wrote; never its viewer url, which carries a token. */
|
|
8
|
+
export interface ArtifactOutput {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
format: string;
|
|
12
|
+
version: number;
|
|
13
|
+
published: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface PullRequestOutput {
|
|
16
|
+
number: number;
|
|
17
|
+
state: 'open' | 'merged' | 'closed';
|
|
18
|
+
hint: string;
|
|
19
|
+
ready: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** A file the agent wrote: its writes summed, which can be more than the net change. */
|
|
22
|
+
export interface FileOutput {
|
|
23
|
+
path: string;
|
|
24
|
+
added: number;
|
|
25
|
+
deleted: number;
|
|
26
|
+
writes: number;
|
|
27
|
+
}
|
|
28
|
+
export interface Progress {
|
|
29
|
+
steps: ProgressStep[];
|
|
30
|
+
done: number;
|
|
31
|
+
artifacts: ArtifactOutput[];
|
|
32
|
+
pullRequests: PullRequestOutput[];
|
|
33
|
+
files: FileOutput[];
|
|
34
|
+
/** Web search queries, each once, in the order first asked. */
|
|
35
|
+
searches: string[];
|
|
36
|
+
sites: {
|
|
37
|
+
host: string;
|
|
38
|
+
fetches: number;
|
|
39
|
+
}[];
|
|
40
|
+
connectors: {
|
|
41
|
+
server: string;
|
|
42
|
+
calls: number;
|
|
43
|
+
}[];
|
|
44
|
+
skills: string[];
|
|
45
|
+
/** Skills loaded whose name the server did not send. */
|
|
46
|
+
unnamedSkills: number;
|
|
47
|
+
/** Images sent with the session's turns. */
|
|
48
|
+
images: number;
|
|
49
|
+
}
|
|
50
|
+
export declare const EMPTY_PROGRESS: Progress;
|
|
51
|
+
/** The host a fetched url is on, without `www.`; null for anything that is not a web address. */
|
|
52
|
+
export declare function hostOf(url: string): string | null;
|
|
53
|
+
/** The server an MCP tool belongs to: `mcp__github__search_issues` is github's. */
|
|
54
|
+
export declare function mcpServerOf(toolName: string): string | null;
|
|
55
|
+
export declare function progressOf(state: Pick<ViewState, 'plan' | 'session' | 'entries'>): Progress;
|
|
56
|
+
/** Nothing to show yet: no step, no output and no source. */
|
|
57
|
+
export declare function isEmptyProgress(p: Progress): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether a change to the view can change its progress: the plan, the session's metadata, a reload, or a turn or
|
|
60
|
+
* tool call. Streamed text only touches assistant entries and the run, so it never does.
|
|
61
|
+
*/
|
|
62
|
+
export declare function touchesProgress(changed: ReadonlySet<string>): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Which of a plan's steps to show, at most `max`: from `before` steps ahead of the first one not done. The done steps
|
|
65
|
+
* ahead of the window are counted rather than shown. `fill` moves the window back to use all of `max` when the plan
|
|
66
|
+
* ends sooner, so a short plan shows whole.
|
|
67
|
+
*/
|
|
68
|
+
export declare function stepWindow(items: readonly {
|
|
69
|
+
status: string;
|
|
70
|
+
}[], max: number, before?: number, fill?: boolean): {
|
|
71
|
+
start: number;
|
|
72
|
+
end: number;
|
|
73
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** The model router's `model_route` events as a transcript notice and a footer badge. */
|
|
2
|
+
import type { ModelRouteData } from '../../../api/wire';
|
|
3
|
+
import type { NoticeLevel } from './entries';
|
|
4
|
+
/** The turn's tier as the footer shows it; null when the session's model is not routed. */
|
|
5
|
+
export interface RouteView {
|
|
6
|
+
tier: string;
|
|
7
|
+
/** The model serving the turn, which may differ from the session's model id (`router`). */
|
|
8
|
+
model: string | null;
|
|
9
|
+
shadow: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* One line saying which tier and model a turn runs on and why, or null for a session whose model is not
|
|
13
|
+
* routed: the server sends `pinned` every turn, and saying so each time would only be noise.
|
|
14
|
+
*/
|
|
15
|
+
export declare function routeNotice(data: ModelRouteData): {
|
|
16
|
+
level: NoticeLevel;
|
|
17
|
+
text: string;
|
|
18
|
+
} | null;
|
|
19
|
+
/** The footer's badge for a route, or null when the session's model is not routed. */
|
|
20
|
+
export declare function routeView(data: ModelRouteData): RouteView | null;
|
|
@@ -20,6 +20,11 @@ export interface ViewState {
|
|
|
20
20
|
plan: PlanView | null;
|
|
21
21
|
usage: UsageView;
|
|
22
22
|
undeliveredSteers: string[];
|
|
23
|
+
/** The hint of a run whose `run.result` came with an error, kept for the `run.failed` that follows. */
|
|
24
|
+
pendingHint: {
|
|
25
|
+
runId: string;
|
|
26
|
+
hint: string;
|
|
27
|
+
} | null;
|
|
23
28
|
/** The session's workspace status (spec §3.7), refreshed by `workspace.updated`. */
|
|
24
29
|
workspace: WorkspaceInfo | null;
|
|
25
30
|
connection: ConnectionState;
|
|
@@ -3,7 +3,7 @@ import type { ToolEntry } from './entries';
|
|
|
3
3
|
import type { SessionStore } from './store';
|
|
4
4
|
/** Entry keys of background tasks: they outlive the run that started them. */
|
|
5
5
|
export declare const TASK_KEY_PREFIX = "task:";
|
|
6
|
-
/** True for an entry that stands for a background command
|
|
6
|
+
/** True for an entry that stands for a background command, sub-agent or monitor. */
|
|
7
7
|
export declare function isBackgroundTask(entry: {
|
|
8
8
|
key: string;
|
|
9
9
|
}): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionController } from '../session/SessionController';
|
|
2
|
+
/**
|
|
3
|
+
* The session's progress (europacorecli's progress panel): the plan's steps, what the agent made (pages, pull
|
|
4
|
+
* requests, files) and what it used on the way (searches, sites, MCP connectors, skills, images).
|
|
5
|
+
*/
|
|
6
|
+
export declare function ProgressPanel({ controller }: {
|
|
7
|
+
controller: SessionController;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { type KeyboardEvent, type RefObject } from 'react';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function useHistoryWalk(text: string, setText: (value: string) => void, textarea: RefObject<HTMLTextAreaElement | null>): {
|
|
8
8
|
onKeyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => boolean;
|
|
9
|
-
reset: () =>
|
|
9
|
+
reset: () => void;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Ctrl+R: the prompts sent, newest first (this workspace's before the rest), narrowed by the words typed in any
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type ServerCommand } from '../../../api/agentClient';
|
|
2
|
-
import type { AgentInfo, FormField, ImageInput, McpServer, Pause, QuestionAnswers, Run, Session, Stage } from '../../../api/wire';
|
|
2
|
+
import type { AgentInfo, Envelope, FormField, ImageInput, McpServer, Pause, QuestionAnswers, Run, Session, Stage } from '../../../api/wire';
|
|
3
3
|
import { type FleetParent } from '../model/fleet';
|
|
4
4
|
import { SessionStore } from '../model/store';
|
|
5
5
|
/** What /continue sends when it is given no instructions of its own. */
|
|
6
6
|
export declare const CONTINUE_PROMPT = "Continue where you left off.";
|
|
7
7
|
/** What /recap sends. */
|
|
8
8
|
export declare const RECAP_PROMPT = "In two or three lines, recap this session: the goal, what has been decided so far, and what remains. Reply with only the recap.";
|
|
9
|
-
/**
|
|
9
|
+
/** Hear every event of every followed session; the returned function stops. */
|
|
10
|
+
export declare function onSessionEnvelope(listener: (sessionId: string, env: Envelope) => void): () => void;
|
|
10
11
|
export declare const LOCAL: {
|
|
11
12
|
readonly followUps: "@followUps";
|
|
12
13
|
readonly images: "@images";
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
import type { ArtifactInfo } from '../../../api/wire';
|
|
1
2
|
import type { SessionController } from './SessionController';
|
|
2
|
-
/**
|
|
3
|
+
/** A completion for `@`: what goes after the `@`, and how the list shows it. */
|
|
4
|
+
export interface Mention {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
detail?: string;
|
|
8
|
+
kind: 'file' | 'artifact';
|
|
9
|
+
}
|
|
10
|
+
/** The `@query` at the end of the draft, when it is typing a mention. */
|
|
3
11
|
export declare function mentionQuery(draft: string): string | null;
|
|
4
|
-
/** `draft` with its trailing `@query` replaced by `@
|
|
5
|
-
export declare function insertMention(draft: string,
|
|
6
|
-
/**
|
|
7
|
-
export declare function
|
|
12
|
+
/** `draft` with its trailing `@query` replaced by `@value `. */
|
|
13
|
+
export declare function insertMention(draft: string, value: string): string;
|
|
14
|
+
/** The artifacts matching `query`, as mentions: `@artifact:<id>`, which the agent reads with `artifact_read`. */
|
|
15
|
+
export declare function artifactMentions(list: ArtifactInfo[], query: string, limit: number): Mention[];
|
|
16
|
+
/**
|
|
17
|
+
* What `@query` completes: the session's workspace files (the app's `WorkspaceService.files`), then the artifacts
|
|
18
|
+
* whose title, id or description match; `@artifact:` completes only artifacts.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useFileMentions(controller: SessionController, query: string | null): Mention[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ArtifactDeletedDisplay, ArtifactDisplay } from '../../../api/wire';
|
|
2
|
+
export declare function ArtifactCard({ display: d, sessionId }: {
|
|
3
|
+
display: ArtifactDisplay;
|
|
4
|
+
sessionId: string | null;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function ArtifactDeletedCard({ display: d }: {
|
|
7
|
+
display: ArtifactDeletedDisplay;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PlanItem } from '../../../api/wire';
|
|
2
|
-
import type { AssistantEntry, DecisionEntry, DiffEntry, NoticeEntry, RunEndEntry, SteerEntry, ToolEntry, UserEntry, WakeEntry } from '../model/entries';
|
|
2
|
+
import type { AssistantEntry, DecisionEntry, DiffEntry, MonitorEntry, NoticeEntry, PeerEntry, RunEndEntry, SteerEntry, ToolEntry, UserEntry, WakeEntry } from '../model/entries';
|
|
3
3
|
import type { SessionController } from '../session/SessionController';
|
|
4
4
|
export declare const UserRow: import("react").NamedExoticComponent<{
|
|
5
5
|
controller: SessionController;
|
|
@@ -49,6 +49,17 @@ export declare function RunEndRow({ entry }: {
|
|
|
49
49
|
export declare function WakeRow({ entry }: {
|
|
50
50
|
entry: WakeEntry;
|
|
51
51
|
}): import("react").JSX.Element;
|
|
52
|
+
/** A message from another session's agent: input for this session's agent, not the user's word. */
|
|
53
|
+
export declare function PeerRow({ entry }: {
|
|
54
|
+
entry: PeerEntry;
|
|
55
|
+
}): import("react").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* What the agent was given of a monitor's output: the monitor, its lines (the command's output, so untrusted, shown
|
|
58
|
+
* as text) and how it ended.
|
|
59
|
+
*/
|
|
60
|
+
export declare function MonitorRow({ entry }: {
|
|
61
|
+
entry: MonitorEntry;
|
|
62
|
+
}): import("react").JSX.Element;
|
|
52
63
|
export declare function DiffBlock({ entry, renderDiff }: {
|
|
53
64
|
entry: DiffEntry;
|
|
54
65
|
renderDiff?: (patch: string) => React.ReactNode;
|
|
@@ -5,7 +5,7 @@ export interface DialogProps {
|
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
}
|
|
8
|
-
/** Features register the dialogs commands open: `/undo` opens "undo", `/
|
|
8
|
+
/** Features register the dialogs commands open: `/undo` opens "undo", `/decisions` "decisions", and so on. */
|
|
9
9
|
export declare function registerDialog(kind: string, component: ComponentType<DialogProps>): void;
|
|
10
10
|
export declare function openDialog(kind: string, props?: Record<string, unknown>): void;
|
|
11
11
|
export declare function closeDialog(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionController } from '../chat/session/SessionController';
|
|
2
|
-
export type CommandGroup = 'Session' | 'Decide' | 'Workspace' | 'Fleet' | '
|
|
2
|
+
export type CommandGroup = 'Session' | 'Decide' | 'Workspace' | 'Fleet' | 'Decisions' | 'Go to' | 'App' | 'Prompt' | "This session's";
|
|
3
3
|
export interface Completion {
|
|
4
4
|
value: string;
|
|
5
5
|
description?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function MemoriesPage(): import("react").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ContextSources, MemoryRecord, MemoryRevision, MemoryScopeStatus } from '../../api/wire';
|
|
2
|
+
export interface MemoriesView {
|
|
3
|
+
records: MemoryRecord[];
|
|
4
|
+
statuses: MemoryScopeStatus[];
|
|
5
|
+
projects: string[];
|
|
6
|
+
loaded: ReadonlySet<string>;
|
|
7
|
+
kept: ReadonlySet<string>;
|
|
8
|
+
revisions: MemoryRevision[] | null;
|
|
9
|
+
sources: ContextSources | null;
|
|
10
|
+
sourcesNote: string;
|
|
11
|
+
error: string;
|
|
12
|
+
busy: boolean;
|
|
13
|
+
version: number;
|
|
14
|
+
}
|
|
15
|
+
/** What a change says back: shown as a toast. */
|
|
16
|
+
export interface Outcome {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class MemoriesController {
|
|
21
|
+
/** The session the context view describes, and whose project's memories open first. */
|
|
22
|
+
private readonly sessionId;
|
|
23
|
+
/** The server lists sessions' context sources (`context_sources`). */
|
|
24
|
+
private readonly contextSourcesServed;
|
|
25
|
+
private data;
|
|
26
|
+
private statuses;
|
|
27
|
+
private projectIds;
|
|
28
|
+
private readonly loadedProjects;
|
|
29
|
+
private readonly changed;
|
|
30
|
+
private revisionList;
|
|
31
|
+
private found;
|
|
32
|
+
private note;
|
|
33
|
+
private error;
|
|
34
|
+
private busy;
|
|
35
|
+
/** Answers to an earlier open are dropped. */
|
|
36
|
+
private generation;
|
|
37
|
+
private project;
|
|
38
|
+
/** Edits the server refused, by memory, reopened by the next edit. */
|
|
39
|
+
private readonly drafts;
|
|
40
|
+
private readonly listeners;
|
|
41
|
+
private snapshot;
|
|
42
|
+
constructor(
|
|
43
|
+
/** The session the context view describes, and whose project's memories open first. */
|
|
44
|
+
sessionId: string | null,
|
|
45
|
+
/** The server lists sessions' context sources (`context_sources`). */
|
|
46
|
+
contextSourcesServed: () => boolean);
|
|
47
|
+
private view;
|
|
48
|
+
private render;
|
|
49
|
+
subscribe: (listener: () => void) => (() => void);
|
|
50
|
+
getSnapshot: () => MemoriesView;
|
|
51
|
+
/** The project whose memories open first: the session's. */
|
|
52
|
+
get sessionProject(): string | null;
|
|
53
|
+
/** Read everything afresh: the session's context first, for its project. */
|
|
54
|
+
open(): Promise<void>;
|
|
55
|
+
private load;
|
|
56
|
+
/** The session's context sources; why there are none when there aren't. */
|
|
57
|
+
loadSources(): Promise<void>;
|
|
58
|
+
/** Read everything again, keeping the projects opened and the memories changed here. */
|
|
59
|
+
reload(): Promise<void>;
|
|
60
|
+
/** Another of the caller's projects, read when its scope is first chosen; what went wrong, or null. */
|
|
61
|
+
loadProject(project: string): Promise<string | null>;
|
|
62
|
+
history(record: MemoryRecord): Promise<Outcome | null>;
|
|
63
|
+
closeHistory(): void;
|
|
64
|
+
private replace;
|
|
65
|
+
forget(record: MemoryRecord): Promise<Outcome>;
|
|
66
|
+
restore(record: MemoryRecord): Promise<Outcome>;
|
|
67
|
+
/**
|
|
68
|
+
* What an edit starts from: the draft the server refused last time, else the memory as markdown, read afresh;
|
|
69
|
+
* with the record read, whose revision the save is made against.
|
|
70
|
+
*/
|
|
71
|
+
startEdit(record: MemoryRecord): Promise<{
|
|
72
|
+
text: string;
|
|
73
|
+
current: MemoryRecord;
|
|
74
|
+
draft: boolean;
|
|
75
|
+
} | Outcome>;
|
|
76
|
+
/** Save an edit against the revision read; one refused is kept as the draft the next edit reopens. */
|
|
77
|
+
save(current: MemoryRecord, edited: string): Promise<Outcome>;
|
|
78
|
+
/** Throw away a refused edit. */
|
|
79
|
+
dropDraft(id: string): void;
|
|
80
|
+
}
|
|
81
|
+
export declare function useMemories(controller: MemoriesController): MemoriesView;
|
|
@@ -7,7 +7,7 @@ export declare function MemoryDialog({ open, onClose, controller, initialView, }
|
|
|
7
7
|
open: boolean;
|
|
8
8
|
onClose: () => void;
|
|
9
9
|
controller: MemoryController;
|
|
10
|
-
/** `/
|
|
10
|
+
/** `/decisions all` opens on the whole scope. */
|
|
11
11
|
initialView?: View;
|
|
12
12
|
}): import("react").JSX.Element;
|
|
13
13
|
export default MemoryDialog;
|
|
@@ -101,15 +101,15 @@ export declare function recordApproval(controller: MemoryController, info: Decid
|
|
|
101
101
|
export interface MemoryList {
|
|
102
102
|
heading: string;
|
|
103
103
|
scope: string;
|
|
104
|
-
/** Whole scope (`/
|
|
104
|
+
/** Whole scope (`/decisions all`) or just this session. */
|
|
105
105
|
all: boolean;
|
|
106
106
|
entries: MemoryEntry[];
|
|
107
107
|
}
|
|
108
108
|
/** The scope's entries as this window knows them, the controller's session read from its live copy. */
|
|
109
109
|
export declare function scopeOf(controller: MemoryController, sessions?: Iterable<MemorySession>): MemoryEntry[];
|
|
110
|
-
/** `/
|
|
110
|
+
/** `/decisions` (this session's entries) and `/decisions all` (the whole scope's), for the decisions dialog. */
|
|
111
111
|
export declare function listMemory(controller: MemoryController, all?: boolean): MemoryList;
|
|
112
|
-
/** Active labels, for completing `/
|
|
112
|
+
/** Active labels, for completing `/decisions retire|edit|supersede <id>`. */
|
|
113
113
|
export declare function memoryIds(controller: MemoryController): string[];
|
|
114
114
|
export interface ScopeTarget {
|
|
115
115
|
scope: string;
|
|
@@ -137,18 +137,18 @@ export declare function supersedeIn(scope: ScopeTarget, id: string, text: string
|
|
|
137
137
|
}): Promise<MemoryResult & {
|
|
138
138
|
sessions?: Session[];
|
|
139
139
|
}>;
|
|
140
|
-
/** `/
|
|
140
|
+
/** `/decisions retire <id>`. */
|
|
141
141
|
export declare function retire(controller: MemoryController, id: string, options?: WriteOptions): Promise<MemoryResult<MemoryEntry> & {
|
|
142
142
|
session?: Session | null;
|
|
143
143
|
}>;
|
|
144
|
-
/** `/
|
|
144
|
+
/** `/decisions edit <id> <text> [-- why]`. */
|
|
145
145
|
export declare function edit(controller: MemoryController, id: string, text: string | {
|
|
146
146
|
text: string;
|
|
147
147
|
rationale?: string | null;
|
|
148
148
|
}, options?: WriteOptions): Promise<MemoryResult<MemoryEntry> & {
|
|
149
149
|
session?: Session | null;
|
|
150
150
|
}>;
|
|
151
|
-
/** `/
|
|
151
|
+
/** `/decisions supersede <id> <text> [-- why]`. */
|
|
152
152
|
export declare function supersede(controller: MemoryController, id: string, text: string | {
|
|
153
153
|
text: string;
|
|
154
154
|
rationale?: string | null;
|
|
@@ -174,7 +174,7 @@ export declare function awaitAnswer(controller: MemoryController, runId: string,
|
|
|
174
174
|
text: string;
|
|
175
175
|
}>;
|
|
176
176
|
/**
|
|
177
|
-
* `/
|
|
177
|
+
* `/decisions extract`: asks the agent for the decisions and requirements agreed so far, waits for its answer and
|
|
178
178
|
* reads it. The proposal's `fresh` items are the ones to confirm (ExtractConfirmDialog), then `addExtracted`.
|
|
179
179
|
*/
|
|
180
180
|
export declare function extract(controller: MemoryController, options?: WriteOptions & {
|
|
@@ -204,10 +204,10 @@ export type MemoryCommand = {
|
|
|
204
204
|
} | {
|
|
205
205
|
error: string;
|
|
206
206
|
};
|
|
207
|
-
/** The command a
|
|
208
|
-
export declare function memoryCommandName(name: string): 'decision' | 'requirement' | '
|
|
207
|
+
/** The command a register slash command names (`decision`, `dec`, `requirement`, `req`, `decisions`, `register`), or null. */
|
|
208
|
+
export declare function memoryCommandName(name: string): 'decision' | 'requirement' | 'decisions' | 'register' | null;
|
|
209
209
|
/**
|
|
210
|
-
* Parses a
|
|
210
|
+
* Parses a register slash command: `parseMemoryCommand(args)` for `/decisions <args>`, or with a command name
|
|
211
211
|
* (`/dec`, `/req`, …) for the others. Builds on parseMemoryArgs.
|
|
212
212
|
*/
|
|
213
213
|
export declare function parseMemoryCommand(args: string, command?: string): MemoryCommand;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Envelope } from '../../api/wire';
|
|
2
|
+
import type { SessionController } from '../chat/session/SessionController';
|
|
3
|
+
import type { Command, CommandContext } from '../commands/registry';
|
|
4
|
+
type Toast = (message: string, tone?: 'info' | 'ok' | 'danger') => void;
|
|
5
|
+
/** What a claim event or a contested session says, given the sessions the browser follows. */
|
|
6
|
+
export interface ClaimsEnv {
|
|
7
|
+
/** A followed session, by id. */
|
|
8
|
+
get(id: string): Pick<SessionController, 'id' | 'store' | 'title' | 'notice'> | undefined;
|
|
9
|
+
/** The session on screen. */
|
|
10
|
+
shownId(): string | null;
|
|
11
|
+
toast: Toast;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A request opened, answered or ended, on session `id`'s stream: a toast, the session's title first when it is out
|
|
15
|
+
* of view. Both sides' streams carry it, so when the other side is on screen, that one says it in its own words.
|
|
16
|
+
*/
|
|
17
|
+
export declare function claimToast(env: ClaimsEnv, id: string, envelope: Envelope): void;
|
|
18
|
+
/**
|
|
19
|
+
* Session `id`'s metadata changed: say once when a request it made could not be settled, which puts it in the inbox
|
|
20
|
+
* until the user's next message. The first read only takes stock.
|
|
21
|
+
*/
|
|
22
|
+
export declare function contestedCheck(env: ClaimsEnv, id: string): void;
|
|
23
|
+
/** `/claims [release <path> | give <path> [session] | ask <path> [reason]]`. */
|
|
24
|
+
export declare function runClaims(ctx: Pick<CommandContext, 'controller' | 'toast'>, args: string): Promise<void>;
|
|
25
|
+
export declare const claimsCommand: Command;
|
|
26
|
+
export {};
|
|
@@ -12,6 +12,12 @@ export interface CollisionOptions {
|
|
|
12
12
|
repoOf?: (controller: Watched) => string | null;
|
|
13
13
|
/** A new hard collision, in words (the TUI flashes it); by default a warning in both sessions' transcripts. */
|
|
14
14
|
warn?: (text: string, a: Watched | null, b: Watched | null) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a hard collision switches its sessions to asking. By default not once the server keeps file claims
|
|
17
|
+
* (`capabilities.peers`): it refuses a write to a file another session owns itself, and the agents settle it. A
|
|
18
|
+
* mode switched by an earlier collision still goes back.
|
|
19
|
+
*/
|
|
20
|
+
gate?: () => boolean;
|
|
15
21
|
}
|
|
16
22
|
/** The repository a session works in, as the browser can tell: its workspace's top level. */
|
|
17
23
|
export declare function defaultRepoOf(controller: Watched): string | null;
|
|
@@ -35,6 +41,7 @@ export declare class CollisionWatcher {
|
|
|
35
41
|
private readonly listeners;
|
|
36
42
|
private version;
|
|
37
43
|
private readonly repoOf;
|
|
44
|
+
private readonly gates;
|
|
38
45
|
private readonly warn;
|
|
39
46
|
constructor(options?: CollisionOptions);
|
|
40
47
|
subscribe: (listener: Listener) => (() => void);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fill in the session page's hooks from the workspace feature: collisions
|
|
3
3
|
* between the followed sessions (hold or leave a file on the approval card),
|
|
4
|
-
* and the full diff viewer for `/diff` in the transcript.
|
|
4
|
+
* the file claims' toasts, and the full diff viewer for `/diff` in the transcript.
|
|
5
5
|
*/
|
|
6
6
|
export declare function useSessionPageHooks(): void;
|