@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.
Files changed (51) hide show
  1. package/dist/ArtifactsPage-BxaqShTv.js +1178 -0
  2. package/dist/{BoardPage-DDcf5vup.js → BoardPage-DH7p5o99.js} +54 -54
  3. package/dist/{CardDetail-D0TLVhf7.js → CardDetail-LfDCJQhS.js} +26 -26
  4. package/dist/{ComparePage-C32hPOqV.js → ComparePage-CrbCyu4u.js} +33 -33
  5. package/dist/MemoriesPage-BRA53Hlb.js +679 -0
  6. package/dist/{OverviewPage-BkeuYg6d.js → OverviewPage-BSBqY83_.js} +31 -31
  7. package/dist/{RegisterPage-Dawr26jh.js → RegisterPage-64yGl9E-.js} +75 -75
  8. package/dist/SessionPage-C4hSlxWQ.js +906 -0
  9. package/dist/api/agentClient.d.ts +62 -1
  10. package/dist/api/wire.d.ts +461 -4
  11. package/dist/features/artifacts/ArtifactDetail.d.ts +15 -0
  12. package/dist/features/artifacts/ArtifactDialogs.d.ts +29 -0
  13. package/dist/features/artifacts/ArtifactLedger.d.ts +11 -0
  14. package/dist/features/artifacts/ArtifactStats.d.ts +9 -0
  15. package/dist/features/artifacts/ArtifactsPage.d.ts +1 -0
  16. package/dist/features/artifacts/artifactsCommands.d.ts +3 -0
  17. package/dist/features/artifacts/artifactsStore.d.ts +27 -0
  18. package/dist/features/artifacts/artifactsUi.d.ts +33 -0
  19. package/dist/features/bootstrap.d.ts +1 -0
  20. package/dist/features/chat/model/artifactAccess.d.ts +50 -0
  21. package/dist/features/chat/model/artifactCsv.d.ts +11 -0
  22. package/dist/features/chat/model/artifactExport.d.ts +45 -0
  23. package/dist/features/chat/model/artifactStats.d.ts +79 -0
  24. package/dist/features/chat/model/artifacts.d.ts +151 -0
  25. package/dist/features/chat/model/claims.d.ts +102 -0
  26. package/dist/features/chat/model/contextSources.d.ts +41 -0
  27. package/dist/features/chat/model/entries.d.ts +32 -2
  28. package/dist/features/chat/model/format.d.ts +6 -0
  29. package/dist/features/chat/model/memoryRecords.d.ts +79 -0
  30. package/dist/features/chat/model/monitors.d.ts +11 -0
  31. package/dist/features/chat/model/progress.d.ts +73 -0
  32. package/dist/features/chat/model/tasks.d.ts +1 -1
  33. package/dist/features/chat/panels/ProgressPanel.d.ts +8 -0
  34. package/dist/features/chat/session/SessionController.d.ts +3 -2
  35. package/dist/features/chat/session/useFileMentions.d.ts +18 -5
  36. package/dist/features/chat/transcript/ArtifactCard.d.ts +8 -0
  37. package/dist/features/chat/transcript/Rows.d.ts +12 -1
  38. package/dist/features/memories/MemoriesPage.d.ts +1 -0
  39. package/dist/features/memories/memoriesCommands.d.ts +3 -0
  40. package/dist/features/memories/memoriesController.d.ts +81 -0
  41. package/dist/features/workspace/claimsCommands.d.ts +26 -0
  42. package/dist/features/workspace/collisionsWatcher.d.ts +7 -0
  43. package/dist/features/workspace/useSessionPageHooks.d.ts +1 -1
  44. package/dist/{index-B0hmy2Cw.js → index-CMPf-3JZ.js} +4412 -3293
  45. package/dist/index.d.ts +2 -0
  46. package/dist/index.js +86 -82
  47. package/dist/lib/paths.d.ts +12 -0
  48. package/dist/lib/zip.d.ts +14 -0
  49. package/dist/{promptHistory-DQyt2Br0.js → promptHistory-BR0NpLCI.js} +14 -14
  50. package/package.json +1 -1
  51. package/dist/SessionPage-68nDek9w.js +0 -881
@@ -1,7 +1,7 @@
1
1
  import type { BackgroundSubagent } from '../features/chat/model/subagents';
2
2
  import { type Transport } from '../host';
3
3
  import { type ConnectionState, type SseHandle } from './chatStream';
4
- import type { AcceptResult, AddedDir, AgentInfo, BackgroundTask, ContextUsage, CreateRun, CreateSession, Envelope, FleetRunSummary, FleetTaskDiff, McpServer, RunInspection, RunSummary, ModelInfo, Page, RedoResult, RestoreResult, ResumeRequest, Run, ServerInfo, Session, SessionPullRequest, SessionStatus, SnapshotInfo, TaskInfo, TranscriptItem, UndoRequest, UndoResult, WorkspaceDiff, WorkspaceInfo } from './wire';
4
+ import type { AcceptResult, ClaimsView, ContextSources, MemoryPatch, MemoryRecord, MemoryRevision, MemoryStatusReport, ArtifactAccess, ArtifactInfo, ArtifactList, AddedDir, AgentInfo, BackgroundTask, ContextUsage, CreateRun, CreateSession, Envelope, FleetRunSummary, FleetTaskDiff, McpServer, RunInspection, RunSummary, ModelInfo, Page, RedoResult, RestoreResult, ResumeRequest, Run, ServerInfo, Session, SessionPullRequest, SessionStatus, SnapshotInfo, TaskInfo, TranscriptItem, UndoRequest, UndoResult, WorkspaceDiff, WorkspaceInfo } from './wire';
5
5
  export interface StreamHandlers {
6
6
  onEnvelope: (env: Envelope) => void;
7
7
  onState?: (state: ConnectionState, detail?: string) => void;
@@ -81,6 +81,67 @@ export declare class EuropacoreClient {
81
81
  server: string;
82
82
  tools: string[];
83
83
  }>;
84
+ /** The session's file claims, the other sessions in its repository with theirs, and requests to or from it. */
85
+ claims(id: string): Promise<ClaimsView>;
86
+ /**
87
+ * Let go of one of your own sessions' claims (every one without `paths`), or with `to` hand them to another
88
+ * session. What follows arrives as `claim.resolved` and in the sessions' `metadata.claims`.
89
+ */
90
+ releaseClaims(id: string, body: {
91
+ paths?: string[];
92
+ to?: string;
93
+ note?: string;
94
+ }): Promise<ClaimsView>;
95
+ /** Ask, on behalf of your own session, for paths another session holds; the request arrives as `claim.requested`. */
96
+ requestClaims(id: string, body: {
97
+ paths: string[];
98
+ reason?: string;
99
+ }): Promise<ClaimsView>;
100
+ /** The caller's long-term memories (one scope, or all of theirs), with their tokens and flags. */
101
+ memories(query?: {
102
+ scope?: string;
103
+ project?: string | null;
104
+ status?: string;
105
+ flag?: string;
106
+ q?: string;
107
+ }): Promise<MemoryRecord[]>;
108
+ /** One memory, with its markdown. */
109
+ memory(id: string): Promise<MemoryRecord>;
110
+ /** Change a memory's kind, description or body; with `revision`, 409 `memory_changed` if it moved on. */
111
+ updateMemory(id: string, patch: MemoryPatch): Promise<MemoryRecord>;
112
+ /** Forget (prune) a memory; restorable. Forgetting twice changes nothing, so it may be sent again. */
113
+ forgetMemory(id: string, reason: string): Promise<MemoryRecord>;
114
+ /** Bring a forgotten or merged memory back. */
115
+ restoreMemory(id: string): Promise<MemoryRecord>;
116
+ /** A memory's revisions, newest first. */
117
+ memoryRevisions(id: string): Promise<MemoryRevision[]>;
118
+ /** Each of the caller's memory scopes at a glance, and their projects with memories. */
119
+ memoryStatus(project?: string | null): Promise<MemoryStatusReport>;
120
+ /** What a session loads, source by source in load order. */
121
+ contextSources(id: string): Promise<ContextSources>;
122
+ /** The caller's artifacts, newest first; with `session`, that session's first, and with `shared` others' shared with them. */
123
+ artifactList(session?: string | null, options?: {
124
+ shared?: boolean;
125
+ }): Promise<ArtifactList>;
126
+ /** One artifact: the caller's, or with `owner` one that user shares with the caller. Its `url` opens now. */
127
+ artifact(id: string, owner?: string | null): Promise<ArtifactInfo>;
128
+ /** Who can open one of the caller's artifacts. Narrowing it stops the links already given out. */
129
+ setArtifactAccess(id: string, access: ArtifactAccess): Promise<ArtifactInfo>;
130
+ /** Stop every link to one of the caller's artifacts; who can open it stays the same, through new links. */
131
+ revokeArtifactLinks(id: string): Promise<ArtifactInfo>;
132
+ /** Delete an artifact and every version; with `unpublish`, its published copy is taken down first, and nothing is deleted when that fails. */
133
+ deleteArtifact(id: string, options?: {
134
+ unpublish?: boolean;
135
+ }): Promise<void>;
136
+ /** Take one of the caller's artifacts' published copy down (a permanent one: a temporary one only expires). Slow. */
137
+ unpublishArtifact(id: string): Promise<ArtifactInfo>;
138
+ /**
139
+ * A viewer link the server gave, made absolute. A server that knows its public URL (europacoreui's does) gives
140
+ * absolute links; one that does not gives paths from its root, put after the transport's base without its `/v1`.
141
+ */
142
+ artifactLink(url: string): string;
143
+ /** One file of a version, through the viewer. The link is the capability: no credentials are sent with it. */
144
+ artifactFile(link: string, path: string, version: number): Promise<Uint8Array>;
84
145
  /** The session's workspace: branch and the files changed since `base` (HEAD by default). */
85
146
  sessionWorkspace(sessionId: string, base?: string): Promise<WorkspaceInfo>;
86
147
  /** A unified diff of the session's workspace; one file when `path` (repository-relative) is given. */
@@ -35,6 +35,19 @@ export interface ServerInfo {
35
35
  accept: boolean;
36
36
  max_bytes: number;
37
37
  };
38
+ /** The server keeps artifacts, the pages agents make (`/v1/artifacts` and its viewer). */
39
+ artifacts?: boolean;
40
+ /** It can take an artifact's permanent published copy down (`POST /v1/artifacts/{id}/unpublish`). */
41
+ artifact_unpublish?: boolean;
42
+ /** The server keeps long-term memories (`/v1/memories`, `europacore serve --memory`). */
43
+ memory?: boolean;
44
+ /** Sessions list what they load, source by source (`GET /v1/sessions/{sid}/context/sources`). */
45
+ context_sources?: boolean;
46
+ /**
47
+ * It keeps file claims per repository: a session's write to a file another session owns is refused and the
48
+ * owner's agent is asked for it (`/v1/sessions/{sid}/claims`, spec §3.14). Its sessions' agents message each other.
49
+ */
50
+ peers?: boolean;
38
51
  };
39
52
  principal: {
40
53
  workspace_id: string | null;
@@ -79,6 +92,8 @@ export interface AgentInfo {
79
92
  permission_modes?: boolean;
80
93
  /** An `exit_plan_mode` approval may carry an edited plan (`Resume.plan`). */
81
94
  plan_edits?: boolean;
95
+ /** Its sessions take part in file claims and peer messages (`message_session`, `answer_claim_request`). */
96
+ peers?: boolean;
82
97
  };
83
98
  /** The permission modes its sessions may use (Claude Code's: default, acceptEdits, plan, …); empty for none. */
84
99
  permission_modes?: string[];
@@ -175,10 +190,13 @@ export interface WorkspaceInfo {
175
190
  files: ChangedFile[];
176
191
  files_truncated: boolean;
177
192
  }
178
- /** A command or sub-agent running in the background of a session (`tasks.updated`, `/v1/sessions/{sid}/tasks`). */
193
+ /**
194
+ * A command, sub-agent or monitor running in the background of a session (`tasks.updated`,
195
+ * `/v1/sessions/{sid}/tasks`). A monitor is a command or file watch whose output wakes the agent.
196
+ */
179
197
  export interface BackgroundTask {
180
198
  task_id: string;
181
- kind: 'command' | 'subagent';
199
+ kind: 'command' | 'subagent' | 'monitor';
182
200
  title: string;
183
201
  state: 'running' | 'completed' | 'failed' | 'stopped';
184
202
  /** Running time so far, or in all once finished. */
@@ -190,6 +208,8 @@ export interface BackgroundTask {
190
208
  /** The start of a sub-agent's result. */
191
209
  summary?: string;
192
210
  error?: string;
211
+ /** A monitor's batches of output so far. */
212
+ events?: number;
193
213
  /** A sub-agent's agent, when the server says (not in the contract yet; the row shows it before the title). */
194
214
  agent?: string;
195
215
  }
@@ -286,6 +306,237 @@ export interface FleetReviewEntry {
286
306
  max_rounds: number;
287
307
  attention: 'ready_to_merge' | 'ci_failed' | null;
288
308
  }
309
+ export type MemoryScopeName = 'org' | 'user' | 'project';
310
+ export type MemoryRecordKind = 'user' | 'feedback' | 'project' | 'reference';
311
+ export type MemoryRecordStatus = 'active' | 'merged' | 'pruned';
312
+ export type MemoryFlagName = 'stale' | 'duplicate' | 'over_cap' | 'never_recalled' | 'kept';
313
+ export interface MemoryScopeKey {
314
+ scope: MemoryScopeName;
315
+ workspace_id: string | null;
316
+ user_id: string | null;
317
+ project_id: string | null;
318
+ }
319
+ /** Something to know about a memory; a duplicate names its partner. */
320
+ export interface MemoryFlag {
321
+ flag: MemoryFlagName;
322
+ detail: string;
323
+ partner_id?: string | null;
324
+ partner_name?: string | null;
325
+ }
326
+ /** One memory. `tokens` and `flags` come from servers that compute them (absent on older ones). */
327
+ export interface MemoryRecord {
328
+ id: string;
329
+ key: MemoryScopeKey;
330
+ kind: MemoryRecordKind;
331
+ name: string;
332
+ description: string;
333
+ body: string;
334
+ status: MemoryRecordStatus;
335
+ superseded_by: string | null;
336
+ source: string;
337
+ session_id: string | null;
338
+ revision: number;
339
+ created_at: string;
340
+ updated_at: string;
341
+ last_recalled_at: string | null;
342
+ recall_count: number;
343
+ kept_until: string | null;
344
+ metadata: Record<string, unknown>;
345
+ tokens?: {
346
+ index: number;
347
+ body: number;
348
+ };
349
+ flags?: MemoryFlag[];
350
+ /** `GET /v1/memories/{id}` only: the memory in Claude Code's auto-memory format. */
351
+ markdown?: string;
352
+ }
353
+ export interface MemoryPatch {
354
+ kind?: MemoryRecordKind;
355
+ description?: string;
356
+ body?: string;
357
+ /** The revision the change was made against: 409 `memory_changed` when it has moved on. */
358
+ revision?: number;
359
+ }
360
+ export interface MemoryRevision {
361
+ id: string;
362
+ memory_id: string;
363
+ revision: number;
364
+ op: string;
365
+ before: Record<string, unknown> | null;
366
+ after: Record<string, unknown> | null;
367
+ actor: string;
368
+ dream_id: string | null;
369
+ session_id: string | null;
370
+ created_at: string;
371
+ }
372
+ export interface MemoryScopeStatus {
373
+ scope: MemoryScopeName;
374
+ label: string;
375
+ project_id?: string | null;
376
+ active_by_kind: Record<string, number>;
377
+ index_lines: number;
378
+ index_chars: number;
379
+ index_tokens?: number;
380
+ retired?: number;
381
+ flags?: Partial<Record<MemoryFlagName, number>>;
382
+ last_dream: string | null;
383
+ sessions_since_dream: number;
384
+ changes_since_dream: number;
385
+ }
386
+ export interface MemoryStatusReport {
387
+ scopes: MemoryScopeStatus[];
388
+ /** The caller's own projects with memories. */
389
+ projects?: string[];
390
+ }
391
+ export type ContextSourceKind = 'system_prompt' | 'tools' | 'instructions' | 'environment' | 'memory_index' | 'memory_preload' | 'skill' | 'plan' | 'hook' | 'other' | 'conversation';
392
+ /** One thing a session's model reads, in load order. */
393
+ export interface ContextSource {
394
+ n: number;
395
+ id: string;
396
+ kind: ContextSourceKind;
397
+ label: string;
398
+ origin?: string | null;
399
+ path?: string | null;
400
+ scope?: string | null;
401
+ retention?: string | null;
402
+ /** sent: the model has it; pending: it reaches the next call; preview: a memory index not pinned yet. */
403
+ status: 'sent' | 'pending' | 'preview';
404
+ tokens: number;
405
+ chars: number;
406
+ items: number;
407
+ text?: string | null;
408
+ }
409
+ export interface ContextSources {
410
+ session_id: string | null;
411
+ model: string | null;
412
+ context_window: number | null;
413
+ estimated_tokens: number;
414
+ sources: ContextSource[];
415
+ memory?: {
416
+ scopes: {
417
+ scope: MemoryScopeName;
418
+ label: string;
419
+ workspace_id: string | null;
420
+ user_id: string | null;
421
+ project_id: string | null;
422
+ }[];
423
+ writable: boolean;
424
+ preload_k: number;
425
+ index_max_lines: number;
426
+ index_max_chars: number;
427
+ } | null;
428
+ }
429
+ /**
430
+ * Who can open an artifact: its owner (`private`, with links that expire), everyone signed in to its workspace
431
+ * (`workspace`, likewise), or anyone with its link (`public`).
432
+ */
433
+ export type ArtifactAccess = 'private' | 'workspace' | 'public';
434
+ /** Where a version was put for anyone with the link; a temporary page has a claim link and an expiry. */
435
+ export interface ArtifactPublication {
436
+ target: string;
437
+ url: string;
438
+ claim_url: string | null;
439
+ expires_at: string | null;
440
+ created_at?: string | null;
441
+ /** The session that published it, from servers that keep it. */
442
+ session_id?: string | null;
443
+ /** When it was taken down; a copy taken down is no longer up. */
444
+ removed_at?: string | null;
445
+ }
446
+ /** What the runs that wrote a version spent: each run's tokens since its previous write, other work included. */
447
+ export interface ArtifactUsage {
448
+ input_tokens: number;
449
+ output_tokens: number;
450
+ cache_read_tokens: number;
451
+ cache_write_tokens: number;
452
+ total_tokens: number;
453
+ cost_usd?: number | null;
454
+ }
455
+ export interface ArtifactVersionInfo {
456
+ version: number;
457
+ created_at: string;
458
+ /** The version's file paths, the entry among them. */
459
+ files: string[];
460
+ published: ArtifactPublication | null;
461
+ /** The session whose run wrote this version, from servers that keep it; null when unknown. */
462
+ session_id?: string | null;
463
+ /** From servers that measure them (absent on older ones). */
464
+ bytes?: number;
465
+ usage?: ArtifactUsage | null;
466
+ /** The git repository the writing session's workspace was in (`owner/repo`); null outside one. */
467
+ project?: string | null;
468
+ }
469
+ /** Opens of an artifact's page. `people` are others who opened it signed in; `link` the opens of its public link. */
470
+ export interface ArtifactViews {
471
+ total: number;
472
+ last_30_days: {
473
+ opens: number;
474
+ link: number;
475
+ own: number;
476
+ people: number;
477
+ };
478
+ /** The latest open by anyone else, or through the public link. */
479
+ last_viewed_at: string | null;
480
+ }
481
+ /** An artifact as `/v1/artifacts` shows it. `url` is the viewer's: absolute, or server-relative. */
482
+ export interface ArtifactInfo {
483
+ id: string;
484
+ title: string;
485
+ description: string;
486
+ icon: string | null;
487
+ format: 'html' | 'markdown' | string;
488
+ entry: string;
489
+ version: number;
490
+ versions: ArtifactVersionInfo[];
491
+ /** The session that made it; null for one no session made. */
492
+ session_id: string | null;
493
+ url: string;
494
+ published_url: string | null;
495
+ created_at: string;
496
+ updated_at: string;
497
+ /** The latest version's bytes, from servers that measure them. */
498
+ size?: number | null;
499
+ /** Summed over the versions that carry usage; `versions` says how many did. */
500
+ usage?: (ArtifactUsage & {
501
+ versions: number;
502
+ }) | null;
503
+ /** Its versions' repositories, in the order first written; from servers that record them. */
504
+ projects?: string[];
505
+ /** Who can open it; absent from servers that keep no access (there, anyone with the link can). */
506
+ access?: ArtifactAccess;
507
+ /** When it was first shared beyond its owner; null while private, and for one public from before access. */
508
+ shared_at?: string | null;
509
+ /** The owner's user id. */
510
+ owner?: string | null;
511
+ /** The caller owns it: false for one shared with the caller. */
512
+ mine?: boolean;
513
+ /** When `url` stops opening: a signed link's expiry; null for the public link. */
514
+ url_expires_at?: string | null;
515
+ /** How often its page was opened; the owner's only, from servers that count. */
516
+ views?: ArtifactViews | null;
517
+ }
518
+ /** `GET /v1/artifacts`: the list, and the repository of the session named by `session=`. */
519
+ export interface ArtifactList {
520
+ artifacts: ArtifactInfo[];
521
+ project?: string | null;
522
+ /** Others' artifacts shared with the caller, when asked for (`shared=true`). */
523
+ shared?: ArtifactInfo[];
524
+ }
525
+ /** A page a session wrote (`artifact_write`), as the server keeps it in `metadata.artifacts`, the newest write last. */
526
+ export interface SessionArtifact {
527
+ id: string;
528
+ title: string;
529
+ version: number;
530
+ format: string;
531
+ /** The viewer's url; it carries a token, so it is never shown. */
532
+ url: string | null;
533
+ published_url?: string | null;
534
+ claim_url?: string | null;
535
+ expires_at?: string | null;
536
+ target?: string | null;
537
+ since?: string | null;
538
+ access?: ArtifactAccess;
539
+ }
289
540
  /** A pull request a session opened (or registered), and where its CI and review have got to (`metadata.pull_requests`). */
290
541
  export interface SessionPullRequest {
291
542
  number: number;
@@ -309,6 +560,144 @@ export interface SessionPullRequest {
309
560
  since?: string;
310
561
  head_sha?: string;
311
562
  }
563
+ /** A session as another session sees it, in a repository's claims: never its transcript. */
564
+ export interface Ref {
565
+ session_id: string;
566
+ title: string;
567
+ user: string;
568
+ /** One of the caller's own sessions (a teammate's is not). */
569
+ mine: boolean;
570
+ /** A session handed off to the cloud, mirrored here. */
571
+ cloud?: boolean;
572
+ }
573
+ /**
574
+ * A claim on a path of a repository (`'dir/'` covers what is under it). A `change` claim is the first writer's
575
+ * while the path has uncommitted changes in that checkout; a `declared` one was claimed or given and holds anywhere
576
+ * in the repository; a `shared` one has two holders and a boundary between them.
577
+ */
578
+ export interface Claim {
579
+ path: string;
580
+ kind: 'change' | 'declared' | 'shared';
581
+ holders: Ref[];
582
+ checkout: string;
583
+ /** What each holder keeps to, for a shared claim (a `keep` records one too); advisory inside the file. */
584
+ boundary?: string | null;
585
+ reason: string;
586
+ since: string;
587
+ /** Sessions the path passes to, first come first served, once its holder is done with it. */
588
+ queue: Ref[];
589
+ }
590
+ /** What the owner does with one path a contender asks for. */
591
+ export type Disposition = 'give' | 'keep' | 'share' | 'after' | 'will_do';
592
+ export type ClaimOutcome = 'handed_over' | 'declined' | 'split' | 'share' | 'after' | 'will_do' | 'released' | 'committed' | 'withdrawn' | 'deleted' | 'user' | 'cycle' | 'expired';
593
+ /**
594
+ * A contender's request for paths another session owns: the owner answers per path (round 1), the contender may
595
+ * counter once (round 2), and the owner's reply is final (round 3).
596
+ */
597
+ export interface ClaimRequest {
598
+ id: string;
599
+ paths: string[];
600
+ contender: Ref;
601
+ owner: Ref;
602
+ /** The kind of claim the owner held when the request opened. */
603
+ owner_kind: Claim['kind'];
604
+ /** The contender's task, or the reason it gave. */
605
+ reason: string;
606
+ /** The refused edit, as a short diff; empty when no write was refused. */
607
+ change: string;
608
+ /** How often the owner has written each path. */
609
+ owner_writes: Record<string, number>;
610
+ round: 1 | 2 | 3;
611
+ status: 'open' | 'answered' | 'countered' | 'doing' | 'ended';
612
+ answer?: Record<string, Disposition> | null;
613
+ counter?: Record<string, Disposition> | null;
614
+ boundary?: string | null;
615
+ note?: string | null;
616
+ /** Paths the owner has made the contender's change to (a `will_do`). */
617
+ done?: string[] | null;
618
+ outcome?: ClaimOutcome | null;
619
+ since: string;
620
+ }
621
+ /** What a peer message is about: free text (`message_session`), a request and its rounds, or a path come free. */
622
+ export type PeerAbout = 'message' | 'request' | 'answer' | 'counter' | 'done' | 'free' | 'cycle';
623
+ /** A message to a session's agent from another session's (`from`), or from the claims themselves (null). */
624
+ export interface PeerMessage {
625
+ id: string;
626
+ from: Ref | null;
627
+ to: Ref;
628
+ about: PeerAbout;
629
+ request_id?: string | null;
630
+ text: string;
631
+ at: string;
632
+ }
633
+ /** How a peer message reached its session: drained into a live run, woke it with a notice run, or waits. */
634
+ export type PeerDelivery = 'live' | 'woke' | 'waiting';
635
+ /** `peer.message`, on the recipient's stream. */
636
+ export type PeerMessageEvent = PeerMessage & {
637
+ delivery?: PeerDelivery;
638
+ };
639
+ /** Another session working in the same repository, with what it holds. */
640
+ export interface PeerSession {
641
+ session_id: string;
642
+ title: string;
643
+ user: string;
644
+ /** The user owns that session too (not a teammate's). */
645
+ mine?: boolean;
646
+ /** A session handed off to the cloud, mirrored here. */
647
+ cloud?: boolean;
648
+ checkout: string;
649
+ running: boolean;
650
+ claims: Claim[];
651
+ }
652
+ /** `GET /v1/sessions/{sid}/claims`: the session's claims, the other sessions here, and requests to or from it. */
653
+ export interface ClaimsView {
654
+ repo: string;
655
+ checkout: string;
656
+ claims: Claim[];
657
+ others: PeerSession[];
658
+ requests: ClaimRequest[];
659
+ /** Messages waiting for the session's next run. */
660
+ pending: PeerMessage[];
661
+ /** 'contested': a request it made could not be settled between the agents, so it needs its user. */
662
+ attention: string | null;
663
+ /** Why it needs its user, in the server's words. */
664
+ attention_reason?: string | null;
665
+ }
666
+ /** `metadata.claims`, which the server owns and writes before it tells the model. */
667
+ export interface MetadataClaims {
668
+ v: 1;
669
+ repo: string;
670
+ checkout: string;
671
+ /** The paths it has changed and so owns until they are committed. */
672
+ changed: unknown[];
673
+ /** The paths it claimed, or was given. */
674
+ declared: unknown[];
675
+ /** Its requests, live or settled in the last hour; their `owner` and `contender` are session ids here. */
676
+ requests: unknown[];
677
+ pending: PeerMessage[];
678
+ attention: string | null;
679
+ attention_reason?: string | null;
680
+ }
681
+ /** `display.kind == 'peer_message'`: what `message_session` sent, and how it was delivered. */
682
+ export interface PeerMessageDisplay {
683
+ kind: 'peer_message';
684
+ to: Ref | string;
685
+ text: string;
686
+ delivery?: PeerDelivery | null;
687
+ }
688
+ /** `display.kind == 'claim_answer'`: what `answer_claim_request` answered, in which round. */
689
+ export interface ClaimAnswerDisplay {
690
+ kind: 'claim_answer';
691
+ request_id: string;
692
+ round: number;
693
+ answer?: Record<string, Disposition> | null;
694
+ /** It accepted the answer (the asker) or the counter (the owner). */
695
+ accept?: boolean;
696
+ /** Paths whose promised change it reported made. */
697
+ done?: string[];
698
+ boundary?: string | null;
699
+ note?: string | null;
700
+ }
312
701
  /** A fleet run as `GET /v1/fleet/runs` lists it. */
313
702
  export interface FleetRunSummary {
314
703
  run_id: string;
@@ -436,13 +825,50 @@ export type TranscriptItem = {
436
825
  id: string;
437
826
  summary?: string;
438
827
  }
439
- /** Put in the history by the harness, not the user: what woke the agent (`task_notice`), a hook's or a recovery's. */
828
+ /**
829
+ * Put in the history by the harness, not the user: what woke the agent (`task_notice`), a hook's or a recovery's,
830
+ * or a monitor's output (`monitor`, with its fields).
831
+ */
440
832
  | {
441
833
  kind: 'notice';
442
834
  id: string;
443
835
  origin?: string;
444
836
  text: string;
837
+ monitor?: MonitorOutput;
838
+ }
839
+ /** A message from another session's agent, as the agent read it (a peer, not the user). */
840
+ | {
841
+ kind: 'peer';
842
+ id: string;
843
+ from?: Ref | null;
844
+ about?: PeerAbout;
845
+ request_id?: string | null;
846
+ text: string;
847
+ at?: string;
445
848
  };
849
+ /** How a monitor ended: its command exited, it reached its timeout, it printed too much, or it was stopped. */
850
+ export interface MonitorEnd {
851
+ reason: 'exited' | 'timeout' | 'rate' | 'user' | 'stopped';
852
+ exit_code?: number | null;
853
+ seconds?: number | null;
854
+ /** Its batches of output in all. */
855
+ events?: number;
856
+ /** The last line of a failed command's stderr. */
857
+ stderr?: string;
858
+ }
859
+ /**
860
+ * What the agent was given of a monitor's output (`monitor_output`, and a `monitor` notice in `/messages`): its new
861
+ * lines (a command's stdout, or `added|modified|deleted <path>` for a file watch), and how it ended.
862
+ */
863
+ export interface MonitorOutput {
864
+ monitor_id: string;
865
+ description: string;
866
+ kind: 'command' | 'files';
867
+ lines: string[];
868
+ /** Lines that arrived but were not passed on. */
869
+ dropped: number;
870
+ end: MonitorEnd | null;
871
+ }
446
872
  /** `notice`: a run the server started itself, because a background task finished while the session was idle. */
447
873
  export type RunKind = 'turn' | 'resume' | 'notice';
448
874
  export type RunStatus = 'queued' | 'running' | 'completed' | 'paused' | 'failed' | 'cancelled';
@@ -650,14 +1076,45 @@ export interface AnswersDisplay {
650
1076
  answer: string;
651
1077
  }[];
652
1078
  }
1079
+ /**
1080
+ * `display.kind == "artifact"`: a page `artifact_write` made or `artifact_publish` put up (spec §5.2). `url` is the
1081
+ * viewer's, null when the server has none; a publish adds where it went.
1082
+ */
1083
+ export interface ArtifactDisplay {
1084
+ kind: 'artifact';
1085
+ id: string;
1086
+ title: string;
1087
+ version: number;
1088
+ format: string;
1089
+ url: string | null;
1090
+ published_url?: string | null;
1091
+ claim_url?: string | null;
1092
+ expires_at?: string | null;
1093
+ target?: string | null;
1094
+ /** Who can open it, from servers that keep access. */
1095
+ access?: ArtifactAccess;
1096
+ /** `artifact_unpublish`: the published copy's address, now taken down. */
1097
+ removed_url?: string | null;
1098
+ }
1099
+ /** `display.kind == "artifact_deleted"`: the agent's `artifact_delete` removed a page, and the sessions that wrote it. */
1100
+ export interface ArtifactDeletedDisplay {
1101
+ kind: 'artifact_deleted';
1102
+ id: string;
1103
+ title: string;
1104
+ sessions?: string[];
1105
+ }
653
1106
  export type ToolDisplay = {
654
1107
  kind: 'plan';
655
1108
  plan: PlanItem[];
656
1109
  summary?: string;
657
- } | DiffDisplay | ExecDisplay | AnswersDisplay | {
1110
+ } | DiffDisplay | ExecDisplay | AnswersDisplay | ArtifactDisplay | ArtifactDeletedDisplay | PeerMessageDisplay | ClaimAnswerDisplay | {
658
1111
  kind: string;
659
1112
  [key: string]: unknown;
660
1113
  };
1114
+ export declare function isPeerMessageDisplay(display: ToolDisplay | null | undefined): display is PeerMessageDisplay;
1115
+ export declare function isClaimAnswerDisplay(display: ToolDisplay | null | undefined): display is ClaimAnswerDisplay;
1116
+ export declare function isArtifactDisplay(display: ToolDisplay | null | undefined): display is ArtifactDisplay;
1117
+ export declare function isArtifactDeletedDisplay(display: ToolDisplay | null | undefined): display is ArtifactDeletedDisplay;
661
1118
  export declare function isDiffDisplay(display: ToolDisplay | null | undefined): display is DiffDisplay;
662
1119
  export declare function isExecDisplay(display: ToolDisplay | null | undefined): display is ExecDisplay;
663
1120
  export declare function isAnswersDisplay(display: ToolDisplay | null | undefined): display is AnswersDisplay;
@@ -0,0 +1,15 @@
1
+ import type { ArtifactInfo } from '../../api/wire';
2
+ import { type SessionLink } from '../chat/model/artifacts';
3
+ export type DetailAction = 'access' | 'delete' | 'unpublish';
4
+ export declare function ArtifactDetail({ artifact: a, link, canUnpublish, mentionIn, onAction, sessionTitle, }: {
5
+ artifact: ArtifactInfo;
6
+ link: (id: string | null) => SessionLink;
7
+ canUnpublish: boolean;
8
+ /** The session `@artifact:<id>` goes into, when the page was opened from one. */
9
+ mentionIn: {
10
+ title: string;
11
+ mention: (text: string) => void;
12
+ } | null;
13
+ onAction: (action: DetailAction) => void;
14
+ sessionTitle: (id: string | null) => string | null;
15
+ }): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import type { ArtifactInfo } from '../../api/wire';
2
+ import { type ExportScope } from '../chat/model/artifactExport';
3
+ import { type SessionLink } from '../chat/model/artifacts';
4
+ export declare function DeleteArtifactsDialog({ items, link, canUnpublish, onClose, onDone, onMakePrivate, onExport, }: {
5
+ items: ArtifactInfo[];
6
+ link: (id: string | null) => SessionLink;
7
+ canUnpublish: boolean;
8
+ onClose: () => void;
9
+ onDone: () => void;
10
+ /** Make them private instead (`p`). */
11
+ onMakePrivate: () => void;
12
+ /** Save a copy first (`s`; a download here, europacorecli's workspace archive). */
13
+ onExport: () => Promise<void>;
14
+ }): import("react").JSX.Element;
15
+ export declare function AccessDialog({ items, onClose }: {
16
+ items: ArtifactInfo[];
17
+ onClose: () => void;
18
+ }): import("react").JSX.Element;
19
+ /** Take a permanent published copy down (`U`), after saying what that does. */
20
+ export declare function UnpublishDialog({ artifact, onClose }: {
21
+ artifact: ArtifactInfo;
22
+ onClose: () => void;
23
+ }): import("react").JSX.Element;
24
+ /** The export menu (`X`): CSV of the rows, a ZIP of the files, the page to print, and the source as written. */
25
+ export declare function ExportMenu({ scope, sessionTitle, label, }: {
26
+ scope: ExportScope;
27
+ sessionTitle: (id: string | null) => string | null;
28
+ label?: string;
29
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ArtifactInfo } from '../../api/wire';
2
+ import { type SortColumn } from '../chat/model/artifacts';
3
+ export declare function ArtifactLedger({ rows, sessionTitle, initialSort, initialDescending, onOpen, onDelete, onAccess, }: {
4
+ rows: ArtifactInfo[];
5
+ sessionTitle: (id: string | null) => string | null;
6
+ initialSort?: SortColumn;
7
+ initialDescending?: boolean;
8
+ onOpen: (a: ArtifactInfo) => void;
9
+ onDelete: (items: ArtifactInfo[]) => void;
10
+ onAccess: (items: ArtifactInfo[]) => void;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ArtifactInfo } from '../../api/wire';
2
+ export declare function ArtifactStats({ list, project, onOpen, onLedger, }: {
3
+ list: ArtifactInfo[];
4
+ /** The repository of the session the page was opened from, for `p`. */
5
+ project: string | null;
6
+ onOpen: (a: ArtifactInfo) => void;
7
+ /** Open the ledger on these, oldest first (untouched) or as they come (stale). */
8
+ onLedger: (only: 'untouched' | 'stale') => void;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ArtifactsPage(): import("react").JSX.Element;