@markmo/europacore-session-ui 0.3.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/dist/ArtifactsPage-BxaqShTv.js +1178 -0
- package/dist/{BoardPage-DDcf5vup.js → BoardPage-DH7p5o99.js} +54 -54
- package/dist/{CardDetail-D0TLVhf7.js → CardDetail-LfDCJQhS.js} +26 -26
- package/dist/{ComparePage-C32hPOqV.js → ComparePage-CrbCyu4u.js} +33 -33
- package/dist/MemoriesPage-BRA53Hlb.js +679 -0
- package/dist/{OverviewPage-BkeuYg6d.js → OverviewPage-BSBqY83_.js} +31 -31
- package/dist/{RegisterPage-Dawr26jh.js → RegisterPage-64yGl9E-.js} +75 -75
- package/dist/SessionPage-C4hSlxWQ.js +906 -0
- package/dist/api/agentClient.d.ts +62 -1
- package/dist/api/wire.d.ts +461 -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 +32 -2
- package/dist/features/chat/model/format.d.ts +6 -0
- 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/tasks.d.ts +1 -1
- package/dist/features/chat/panels/ProgressPanel.d.ts +8 -0
- 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/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/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-B0hmy2Cw.js → index-CMPf-3JZ.js} +4412 -3293
- 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-DQyt2Br0.js → promptHistory-BR0NpLCI.js} +14 -14
- package/package.json +1 -1
- package/dist/SessionPage-68nDek9w.js +0 -881
|
@@ -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
|
+
};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|