@adecore/agents-react 0.65.1 → 0.66.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 (122) hide show
  1. package/dist/chat/activity.d.ts +5 -2
  2. package/dist/chat/activity.js +13 -2
  3. package/dist/chat/logic/bookmarks.d.ts +3 -2
  4. package/dist/chat/logic/continue-after-stop.d.ts +2 -2
  5. package/dist/chat/logic/fork.d.ts +7 -6
  6. package/dist/chat/logic/goal.d.ts +8 -3
  7. package/dist/chat/logic/goal.js +7 -1
  8. package/dist/chat/logic/handback.d.ts +2 -2
  9. package/dist/chat/logic/limit.d.ts +2 -2
  10. package/dist/chat/logic/limit.js +8 -0
  11. package/dist/chat/logic/resume-compaction.d.ts +4 -3
  12. package/dist/chat/logic/scrubber.d.ts +3 -2
  13. package/dist/chat/logic/timeline-target.d.ts +4 -3
  14. package/dist/chat/logic/timeline.d.ts +5 -4
  15. package/dist/chat/logic/timeline.js +9 -0
  16. package/dist/chat/recent-messages.d.ts +3 -3
  17. package/dist/chat/runtime-modes.d.ts +2 -1
  18. package/dist/chat/runtime-modes.js +5 -1
  19. package/dist/chat/subagent-conversation.d.ts +5 -4
  20. package/dist/chat/subagent-conversation.js +3 -2
  21. package/dist/chat/subagent-list.d.ts +4 -3
  22. package/dist/chat/subagent-view.d.ts +4 -3
  23. package/dist/chat/ui/ChatActivity.js +19 -15
  24. package/dist/chat/ui/Composer.d.ts +3 -2
  25. package/dist/chat/ui/GoalDock.d.ts +3 -2
  26. package/dist/chat/ui/GoalDock.js +19 -28
  27. package/dist/chat/ui/LimitState.d.ts +2 -2
  28. package/dist/chat/ui/RunSettings.d.ts +3 -2
  29. package/dist/chat/ui/RunSettings.js +318 -298
  30. package/dist/chat/ui/composer/ComposerControls.d.ts +2 -2
  31. package/dist/chat/ui/composer/use-chat-controls.d.ts +3 -2
  32. package/dist/chat/ui/composer/use-compaction-offer.d.ts +3 -2
  33. package/dist/chat/ui/composer/use-composer-menus.d.ts +3 -2
  34. package/dist/chat/ui/composer/use-continuable-turn.d.ts +2 -2
  35. package/dist/chat/ui/composer/use-effort-stepper.d.ts +3 -2
  36. package/dist/chat/ui/reply-context.d.ts +2 -2
  37. package/dist/chat/ui/rows/MessageRows.d.ts +4 -0
  38. package/dist/chat/ui/rows/MessageRows.js +61 -1
  39. package/dist/chat/ui/rows/Rows.js +42 -26
  40. package/dist/chat/ui/rows/SubagentRow.d.ts +3 -2
  41. package/dist/chat/ui/rows/WorkRows.d.ts +3 -2
  42. package/dist/chat/waiting-on.d.ts +5 -4
  43. package/dist/chat/waiting-on.js +2 -1
  44. package/dist/chat/workflow-list.d.ts +3 -2
  45. package/dist/chat-client.d.ts +2 -1
  46. package/dist/chat-sink.d.ts +16 -9
  47. package/dist/host/host-hooks.d.ts +2 -1
  48. package/dist/host/host-hooks.js +5 -0
  49. package/dist/host/host.d.ts +8 -2
  50. package/dist/host/timeline-row.d.ts +10 -4
  51. package/dist/index.d.ts +2 -2
  52. package/dist/locales/en/agent-chat.d.ts +16 -0
  53. package/dist/locales/en/agent-chat.js +17 -1
  54. package/dist/locales/en/agent-usage.d.ts +0 -2
  55. package/dist/locales/en/agent-usage.js +0 -2
  56. package/dist/locales/nl/agent-chat.d.ts +16 -0
  57. package/dist/locales/nl/agent-chat.js +17 -1
  58. package/dist/locales/nl/agent-usage.d.ts +0 -2
  59. package/dist/locales/nl/agent-usage.js +0 -2
  60. package/dist/port-transport.d.ts +10 -1
  61. package/dist/port-transport.js +14 -3
  62. package/dist/state/chats.d.ts +17 -15
  63. package/dist/state/chats.js +7 -0
  64. package/dist/state/index.d.ts +1 -1
  65. package/dist/state/usage.d.ts +3 -2
  66. package/dist/state/usage.js +34 -3
  67. package/dist/transport.d.ts +3 -2
  68. package/dist/usage/limit-groups.js +2 -4
  69. package/package.json +9 -9
  70. package/src/chat/activity.ts +19 -6
  71. package/src/chat/forks.ts +3 -3
  72. package/src/chat/logic/bookmarks.ts +3 -2
  73. package/src/chat/logic/continue-after-stop.ts +3 -2
  74. package/src/chat/logic/fork.ts +8 -7
  75. package/src/chat/logic/goal.ts +13 -4
  76. package/src/chat/logic/handback.ts +2 -3
  77. package/src/chat/logic/limit.ts +7 -2
  78. package/src/chat/logic/resume-compaction.ts +7 -6
  79. package/src/chat/logic/scrubber.ts +4 -3
  80. package/src/chat/logic/timeline-target.ts +4 -3
  81. package/src/chat/logic/timeline.ts +22 -16
  82. package/src/chat/pending-prompts.ts +3 -2
  83. package/src/chat/recent-messages.ts +5 -6
  84. package/src/chat/runtime-modes.ts +7 -2
  85. package/src/chat/subagent-conversation.ts +12 -9
  86. package/src/chat/subagent-list.ts +4 -3
  87. package/src/chat/subagent-view.ts +4 -3
  88. package/src/chat/ui/ChatActivity.tsx +11 -7
  89. package/src/chat/ui/Composer.tsx +3 -2
  90. package/src/chat/ui/GoalDock.tsx +6 -5
  91. package/src/chat/ui/LimitState.tsx +5 -5
  92. package/src/chat/ui/RunSettings.tsx +17 -9
  93. package/src/chat/ui/composer/ComposerControls.tsx +3 -2
  94. package/src/chat/ui/composer/use-chat-controls.ts +3 -2
  95. package/src/chat/ui/composer/use-compaction-offer.ts +4 -3
  96. package/src/chat/ui/composer/use-composer-menus.ts +3 -2
  97. package/src/chat/ui/composer/use-continuable-turn.ts +3 -3
  98. package/src/chat/ui/composer/use-effort-stepper.ts +3 -2
  99. package/src/chat/ui/reply-context.ts +2 -2
  100. package/src/chat/ui/rows/MessageRows.tsx +17 -1
  101. package/src/chat/ui/rows/Rows.tsx +3 -0
  102. package/src/chat/ui/rows/SubagentRow.tsx +5 -4
  103. package/src/chat/ui/rows/WorkRows.tsx +3 -2
  104. package/src/chat/ui/thread-references.ts +3 -3
  105. package/src/chat/waiting-on.ts +8 -7
  106. package/src/chat/workflow-list.ts +3 -2
  107. package/src/chat-client.ts +3 -2
  108. package/src/chat-sink.ts +21 -9
  109. package/src/host/host-hooks.ts +9 -1
  110. package/src/host/host.ts +13 -2
  111. package/src/host/timeline-row.ts +7 -5
  112. package/src/index.ts +2 -1
  113. package/src/locales/en/agent-chat.ts +17 -1
  114. package/src/locales/en/agent-usage.ts +0 -2
  115. package/src/locales/nl/agent-chat.ts +17 -1
  116. package/src/locales/nl/agent-usage.ts +0 -2
  117. package/src/port-transport.ts +20 -3
  118. package/src/state/chats.ts +34 -35
  119. package/src/state/index.ts +1 -1
  120. package/src/state/usage.ts +45 -5
  121. package/src/transport.ts +4 -2
  122. package/src/usage/limit-groups.ts +2 -2
@@ -1,6 +1,6 @@
1
- import { type ChatInfo } from '@adecore/agent-contracts';
2
1
  import { type Shortcut } from '@adecore/ui';
3
2
  import { type Ref } from 'react';
3
+ import type { ChatThreadInfo } from '../../../chat-sink.js';
4
4
  import type { StashedPrompt } from '../../stash.js';
5
5
  import { type PlusMenuSigils } from './ComposerPlusMenu.js';
6
6
  import type { ChatControls } from './use-chat-controls.js';
@@ -14,7 +14,7 @@ interface SendProps {
14
14
  }
15
15
  interface ComposerControlsProps {
16
16
  chatId: string;
17
- info: ChatInfo;
17
+ info: ChatThreadInfo;
18
18
  providerFixed: boolean;
19
19
  writable: boolean;
20
20
  attachable: boolean;
@@ -1,8 +1,9 @@
1
- import type { AgentKind, ChatInfo, ModelSelection, RuntimeMode } from '@adecore/agent-contracts';
1
+ import type { AgentKind, ModelSelection, RuntimeMode } from '@adecore/agent-contracts';
2
+ import type { ChatThreadInfo } from '../../../chat-sink.js';
2
3
  import type { ComposerNotice } from './use-notice.js';
3
4
  interface ControlsInput {
4
5
  chatId: string;
5
- info: ChatInfo;
6
+ info: ChatThreadInfo;
6
7
  notice: ComposerNotice;
7
8
  onRetarget(provider: AgentKind, selection: ModelSelection): Promise<void>;
8
9
  }
@@ -1,2 +1,3 @@
1
- import type { ChatInfo, ProviderCapabilities } from '@adecore/agent-contracts';
2
- export declare function useCompactionOffer(chatId: string, info: ChatInfo, compaction: ProviderCapabilities['compaction'] | undefined): import("../../logic/resume-compaction.js").ResumeCompactionOffer | null;
1
+ import type { ProviderCapabilities } from '@adecore/agent-contracts';
2
+ import type { ChatThreadInfo } from '../../../chat-sink.js';
3
+ export declare function useCompactionOffer(chatId: string, info: ChatThreadInfo, compaction: ProviderCapabilities['compaction'] | undefined): import("../../logic/resume-compaction.js").ResumeCompactionOffer | null;
@@ -1,12 +1,13 @@
1
- import type { ChatInfo, ProviderCapabilities } from '@adecore/agent-contracts';
1
+ import type { ProviderCapabilities } from '@adecore/agent-contracts';
2
2
  import { type RefObject } from 'react';
3
+ import type { ChatThreadInfo } from '../../../chat-sink.js';
3
4
  import type { ComposerInputHandle } from '../ComposerInput.js';
4
5
  import type { ComposerDraft } from './use-composer-draft.js';
5
6
  import { type PromptMenus } from './use-prompt-menus.js';
6
7
  export type { ComposerCommand } from './use-prompt-menus.js';
7
8
  interface MenusInput {
8
9
  chatId: string;
9
- info: ChatInfo;
10
+ info: ChatThreadInfo;
10
11
  capabilities: ProviderCapabilities | undefined;
11
12
  providerName: string | undefined;
12
13
  draft: ComposerDraft;
@@ -1,2 +1,2 @@
1
- import type { ChatInfo } from '@adecore/agent-contracts';
2
- export declare function useContinuableTurn(chatId: string, info: ChatInfo): string | null;
1
+ import type { ChatThreadInfo } from '../../../chat-sink.js';
2
+ export declare function useContinuableTurn(chatId: string, info: ChatThreadInfo): string | null;
@@ -1,9 +1,10 @@
1
- import type { ChatInfo, ModelInfo } from '@adecore/agent-contracts';
1
+ import type { ModelInfo } from '@adecore/agent-contracts';
2
+ import type { ChatThreadInfo } from '../../../chat-sink.js';
2
3
  import type { ChatControls } from './use-chat-controls.js';
3
4
  import type { ComposerNotice } from './use-notice.js';
4
5
  interface EffortStepperInput {
5
6
  chatId: string;
6
- info: ChatInfo;
7
+ info: ChatThreadInfo;
7
8
  model: ModelInfo | undefined;
8
9
  writable: boolean;
9
10
  controls: ChatControls;
@@ -1,7 +1,7 @@
1
- import type { ChatInfo } from '@adecore/agent-contracts';
1
+ import type { ChatThreadInfo } from '../../chat-sink.js';
2
2
  import type { UiReplyTarget } from '../logic/timeline-target.js';
3
3
  export declare const ReplyContext: import("react").Context<{
4
- provider: ChatInfo['provider'];
4
+ provider: ChatThreadInfo['provider'];
5
5
  chatId?: string;
6
6
  } | null>;
7
7
  export declare const UiReplyNavigationContext: import("react").Context<{
@@ -42,6 +42,10 @@ export declare function NoteRow({ id, level, text, from, said }: {
42
42
  from?: string;
43
43
  said?: true;
44
44
  }): import("react").JSX.Element;
45
+ export declare function UnknownRow({ id, waits }: {
46
+ id: string;
47
+ waits: boolean;
48
+ }): import("react").JSX.Element;
45
49
  export declare function AgentTurnRow({ label, onOpen }: {
46
50
  label: string;
47
51
  onOpen?: () => void;
@@ -7,7 +7,7 @@ import { Bot, Brain, ChevronDown, CircleAlert, CircleCheck, CircleX, File, Info,
7
7
  import { useContext, useState } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { useChatHost } from '../../../host/host.js';
10
- import { useHostAttachmentUrl, useHostChatPlace, useHostReplyAuthor, useHostStreaming } from '../../../host/host-hooks.js';
10
+ import { useHostAttachmentUrl, useHostChatPlace, useHostReplyAuthor, useHostStreaming, useHostUnknownItemWords } from '../../../host/host-hooks.js';
11
11
  import { useChatScope } from '../../../scope.js';
12
12
  import { useChatRow, useCurrentItem } from '../../../state/chats.js';
13
13
  import { useProviders } from '../../../state/providers.js';
@@ -1989,6 +1989,66 @@ export function NoteRow(t0) {
1989
1989
  }
1990
1990
  return t1;
1991
1991
  }
1992
+ /* An item of a newer host this version cannot read: one muted line in its place, with nothing on it to act on. */
1993
+ export function UnknownRow(t0) {
1994
+ const $ = _c(11);
1995
+ const {
1996
+ id,
1997
+ waits
1998
+ } = t0;
1999
+ const {
2000
+ t
2001
+ } = useTranslation("agent-chat");
2002
+ const words = useHostUnknownItemWords();
2003
+ let t1;
2004
+ if ($[0] !== t || $[1] !== waits || $[2] !== words?.item || $[3] !== words?.request) {
2005
+ t1 = waits ? words?.request ?? t("rows.unknown.request") : words?.item ?? t("rows.unknown.item");
2006
+ $[0] = t;
2007
+ $[1] = waits;
2008
+ $[2] = words?.item;
2009
+ $[3] = words?.request;
2010
+ $[4] = t1;
2011
+ } else {
2012
+ t1 = $[4];
2013
+ }
2014
+ const text = t1;
2015
+ let t2;
2016
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
2017
+ t2 = /*#__PURE__*/_jsx("span", {
2018
+ className: ROW_GUTTER,
2019
+ children: NOTE_ICON.info
2020
+ });
2021
+ $[5] = t2;
2022
+ } else {
2023
+ t2 = $[5];
2024
+ }
2025
+ let t3;
2026
+ if ($[6] !== text) {
2027
+ t3 = /*#__PURE__*/_jsx("span", {
2028
+ "data-find-field": "summary",
2029
+ className: "min-w-0 flex-1 select-text",
2030
+ children: text
2031
+ });
2032
+ $[6] = text;
2033
+ $[7] = t3;
2034
+ } else {
2035
+ t3 = $[7];
2036
+ }
2037
+ let t4;
2038
+ if ($[8] !== id || $[9] !== t3) {
2039
+ t4 = /*#__PURE__*/_jsxs("div", {
2040
+ "data-find-item": id,
2041
+ className: "-mx-1 mb-0.5 flex min-h-7 items-start gap-2 px-1 py-1 text-xs text-text-faint",
2042
+ children: [t2, t3]
2043
+ });
2044
+ $[8] = id;
2045
+ $[9] = t3;
2046
+ $[10] = t4;
2047
+ } else {
2048
+ t4 = $[10];
2049
+ }
2050
+ return t4;
2051
+ }
1992
2052
  function NoteLine(t0) {
1993
2053
  const $ = _c(34);
1994
2054
  const {
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
4
4
  import { isImageGeneration } from '../../logic/generated-image.js';
5
5
  import { ForksRow } from './ForksRow.js';
6
6
  import { GeneratedImageRow } from './GeneratedImageRow.js';
7
- import { AgentTurnRow, ApprovalHistoryRow, AssistantRow, CompactionRow, LiveThoughtRow, NoteRow, QuestionHistoryRow, ReportRow, SelectionSwitchRow, SentByAgentRow, SentMessageRow, ThinkingRow, UserRow } from './MessageRows.js';
7
+ import { AgentTurnRow, ApprovalHistoryRow, AssistantRow, CompactionRow, LiveThoughtRow, NoteRow, QuestionHistoryRow, ReportRow, SelectionSwitchRow, SentByAgentRow, SentMessageRow, ThinkingRow, UnknownRow, UserRow } from './MessageRows.js';
8
8
  import { SubagentBranchRow } from './SubagentRow.js';
9
9
  import { VisualRow } from './VisualRow.js';
10
10
  import { WorkflowRow } from './WorkflowRow.js';
@@ -70,7 +70,7 @@ function AppCardRow(t0) {
70
70
  }
71
71
  /* One row of a thread, the chat's own or a subagent's read back, drawn the same way in both. */
72
72
  export function Row(t0) {
73
- const $ = _c(103);
73
+ const $ = _c(106);
74
74
  const {
75
75
  row,
76
76
  chatId,
@@ -476,77 +476,93 @@ export function Row(t0) {
476
476
  }
477
477
  return t1;
478
478
  }
479
+ case "unknown":
480
+ {
481
+ let t1;
482
+ if ($[89] !== row.id || $[90] !== row.waits) {
483
+ t1 = /*#__PURE__*/_jsx(UnknownRow, {
484
+ id: row.id,
485
+ waits: row.waits
486
+ });
487
+ $[89] = row.id;
488
+ $[90] = row.waits;
489
+ $[91] = t1;
490
+ } else {
491
+ t1 = $[91];
492
+ }
493
+ return t1;
494
+ }
479
495
  case "selection-switch":
480
496
  {
481
497
  let t1;
482
- if ($[89] !== chatId || $[90] !== row.from || $[91] !== row.to) {
498
+ if ($[92] !== chatId || $[93] !== row.from || $[94] !== row.to) {
483
499
  t1 = /*#__PURE__*/_jsx(SelectionSwitchRow, {
484
500
  chatId: chatId,
485
501
  from: row.from,
486
502
  to: row.to
487
503
  });
488
- $[89] = chatId;
489
- $[90] = row.from;
490
- $[91] = row.to;
491
- $[92] = t1;
504
+ $[92] = chatId;
505
+ $[93] = row.from;
506
+ $[94] = row.to;
507
+ $[95] = t1;
492
508
  } else {
493
- t1 = $[92];
509
+ t1 = $[95];
494
510
  }
495
511
  return t1;
496
512
  }
497
513
  case "working":
498
514
  {
499
515
  let t1;
500
- if ($[93] !== row.tool) {
516
+ if ($[96] !== row.tool) {
501
517
  t1 = row.tool === undefined ? {} : {
502
518
  tool: row.tool
503
519
  };
504
- $[93] = row.tool;
505
- $[94] = t1;
520
+ $[96] = row.tool;
521
+ $[97] = t1;
506
522
  } else {
507
- t1 = $[94];
523
+ t1 = $[97];
508
524
  }
509
525
  let t2;
510
- if ($[95] !== row.startedAt || $[96] !== t1) {
526
+ if ($[98] !== row.startedAt || $[99] !== t1) {
511
527
  t2 = /*#__PURE__*/_jsx(WorkingRow, {
512
528
  startedAt: row.startedAt,
513
529
  ...t1
514
530
  });
515
- $[95] = row.startedAt;
516
- $[96] = t1;
517
- $[97] = t2;
531
+ $[98] = row.startedAt;
532
+ $[99] = t1;
533
+ $[100] = t2;
518
534
  } else {
519
- t2 = $[97];
535
+ t2 = $[100];
520
536
  }
521
537
  return t2;
522
538
  }
523
539
  case "app-card":
524
540
  {
525
541
  let t1;
526
- if ($[98] !== row.card) {
542
+ if ($[101] !== row.card) {
527
543
  t1 = /*#__PURE__*/_jsx(AppCardRow, {
528
544
  card: row.card
529
545
  });
530
- $[98] = row.card;
531
- $[99] = t1;
546
+ $[101] = row.card;
547
+ $[102] = t1;
532
548
  } else {
533
- t1 = $[99];
549
+ t1 = $[102];
534
550
  }
535
551
  return t1;
536
552
  }
537
553
  case "visual":
538
554
  {
539
555
  let t1;
540
- if ($[100] !== chatId || $[101] !== row.visual) {
556
+ if ($[103] !== chatId || $[104] !== row.visual) {
541
557
  t1 = /*#__PURE__*/_jsx(VisualRow, {
542
558
  chatId: chatId,
543
559
  visual: row.visual
544
560
  });
545
- $[100] = chatId;
546
- $[101] = row.visual;
547
- $[102] = t1;
561
+ $[103] = chatId;
562
+ $[104] = row.visual;
563
+ $[105] = t1;
548
564
  } else {
549
- t1 = $[102];
565
+ t1 = $[105];
550
566
  }
551
567
  return t1;
552
568
  }
@@ -1,10 +1,11 @@
1
- import { type ChatItem, type ChatSubagentItem } from '@adecore/agent-contracts';
1
+ import { type ChatSubagentItem } from '@adecore/agent-contracts';
2
+ import type { ChatThreadItem } from '../../../chat-sink.js';
2
3
  import type { SubagentBranch } from '../../../host/timeline-row.js';
3
4
  import { type SubagentStep } from '../../subagent-view.js';
4
5
  export declare function SubagentRow({ chatId, item, work, expanded, onToggle, onOpenConversation }: {
5
6
  chatId: string;
6
7
  item: ChatSubagentItem;
7
- work: ChatItem[];
8
+ work: ChatThreadItem[];
8
9
  expanded: boolean;
9
10
  onToggle(): void;
10
11
  onOpenConversation?(): void;
@@ -1,5 +1,6 @@
1
- import type { ChatCheckpointDiff, ChatToolItem, ChatTurnItem } from '@adecore/agent-contracts';
1
+ import type { ChatCheckpointDiff, ChatToolItem } from '@adecore/agent-contracts';
2
2
  import { type ReactNode } from 'react';
3
+ import type { ChatThreadTurn } from '../../../chat-sink.js';
3
4
  import { type Look } from '../../../host/timeline-row.js';
4
5
  import type { BaseMoved } from '../../../host/timeline-row.js';
5
6
  import { type LookRun } from '../../logic/command-looks.js';
@@ -50,7 +51,7 @@ export declare function WorkGroupRow({ tools, summary, look, expanded, onToggle
50
51
  onToggle(): void;
51
52
  }): import("react").JSX.Element;
52
53
  export declare function TurnFoldRow({ turn, label, work, expanded, expandable, onToggle }: {
53
- turn: ChatTurnItem;
54
+ turn: ChatThreadTurn;
54
55
  label: string;
55
56
  work: readonly string[];
56
57
  expanded: boolean;
@@ -1,13 +1,14 @@
1
- import type { ChatBackgroundTask, ChatInfo } from '@adecore/agent-contracts';
1
+ import type { ChatThreadInfo } from '../chat-sink.js';
2
+ import { type ChatThreadBackgroundTask } from './activity.js';
2
3
  export interface WaitingChild {
3
4
  paused?: {
4
5
  until?: number;
5
6
  };
6
- child?: Pick<ChatInfo, 'status' | 'requests'>;
7
+ child?: Pick<ChatThreadInfo, 'status' | 'requests'>;
7
8
  }
8
9
  export interface WaitingOnInput {
9
10
  children?: readonly WaitingChild[];
10
- background?: readonly ChatBackgroundTask[];
11
+ background?: readonly ChatThreadBackgroundTask[];
11
12
  subagents?: number;
12
13
  workflows?: number;
13
14
  delegating?: boolean;
@@ -21,7 +22,7 @@ export type WaitingOn = {
21
22
  until?: number;
22
23
  } | {
23
24
  kind: 'command';
24
- task: ChatBackgroundTask;
25
+ task: ChatThreadBackgroundTask;
25
26
  } | {
26
27
  kind: 'background';
27
28
  subagents: number;
@@ -1,5 +1,6 @@
1
1
  import { formatElapsedShort, formatMoment } from '@adecore/ui/format';
2
2
  import i18next from 'i18next';
3
+ import { backgroundTaskName } from './activity.js';
3
4
  /*
4
5
  * The one thing a chat waits on, most pressing first: a child that needs the person, a child paused
5
6
  * until a time, the oldest command or monitor in the background, background subagents and workflows,
@@ -60,7 +61,7 @@ export function waitingOnLabel(waiting, now) {
60
61
  });
61
62
  case 'command':
62
63
  return t('waitingOn.command', {
63
- command: waiting.task.description || waiting.task.command || t(`activity.${waiting.task.kind}`),
64
+ command: backgroundTaskName(waiting.task),
64
65
  age: formatElapsedShort(Math.max(0, now - waiting.task.startedAt))
65
66
  });
66
67
  case 'background':
@@ -1,4 +1,5 @@
1
- import { type ChatItem, type ChatToolItem, type ChatWorkflow } from '@adecore/agent-contracts';
1
+ import { type ChatToolItem, type ChatWorkflow } from '@adecore/agent-contracts';
2
+ import type { ChatThreadItem } from '../chat-sink.js';
2
3
  export type WorkflowCall = ChatToolItem & {
3
4
  workflow: ChatWorkflow;
4
5
  };
@@ -7,7 +8,7 @@ interface WorkflowPill {
7
8
  word: WorkflowWord;
8
9
  label: string;
9
10
  }
10
- export declare function flyoutWorkflows(order: readonly string[], structure: Readonly<Record<string, ChatItem>>): WorkflowCall[];
11
+ export declare function flyoutWorkflows(order: readonly string[], structure: Readonly<Record<string, ChatThreadItem>>): WorkflowCall[];
11
12
  export declare function workflowWordOf(tool: WorkflowCall): WorkflowWord;
12
13
  export declare function workflowPillOf(calls: readonly WorkflowCall[]): WorkflowPill;
13
14
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { AgentKind, ChatAttachmentUpload, ChatAttachResult, ChatBookmark, ChatPreferencesPayload, ChatQuoteSource, ChatSkill, ChatVisual, ModelSelection, ProviderInfo, RuntimeMode } from '@adecore/agent-contracts';
2
+ import type { Tolerant } from '@adecore/agent-contracts/tolerance';
2
3
  import type { ChatSink } from './chat-sink.js';
3
4
  import { type ChatTransport } from './transport.js';
4
5
  interface ChatOpenOptions {
@@ -33,7 +34,7 @@ export declare class ChatClient {
33
34
  private preferences;
34
35
  private checkpoints;
35
36
  constructor(transport: ChatTransport, sink: ChatSink, providers?: ProviderSink | null);
36
- inspect(chatId: string): Promise<ChatAttachResult>;
37
+ inspect(chatId: string): Promise<Tolerant<ChatAttachResult>>;
37
38
  observe(chatId: string): () => void;
38
39
  open(chatId: string, options: ChatOpenOptions): Promise<boolean>;
39
40
  retarget(chatId: string, provider: AgentKind, selection: ModelSelection): Promise<void>;
@@ -1,19 +1,26 @@
1
1
  import type { ChatBookmark, ChatEvent, ChatHistoryResult, ChatInfo, ChatItem, ChatSubagentItem, ChatToolItem, ChatVisual } from '@adecore/agent-contracts';
2
+ import type { Tolerant } from '@adecore/agent-contracts/tolerance';
3
+ export type ChatThreadItem = Tolerant<ChatItem>;
4
+ export type ChatThreadTurn = Extract<ChatThreadItem, {
5
+ kind: 'turn';
6
+ }>;
7
+ export type ChatThreadInfo = Tolerant<ChatInfo>;
8
+ export type ChatThreadEvent = Tolerant<ChatEvent>;
2
9
  export type ChatHistoryPage = ChatHistoryResult['history'];
3
10
  export interface ChatPage {
4
11
  history: ChatHistoryPage;
5
- pending: ChatItem[];
6
- subagents?: ChatSubagentItem[];
7
- workflows?: ChatToolItem[];
8
- outline?: ChatItem[];
12
+ pending: ChatThreadItem[];
13
+ subagents?: Tolerant<ChatSubagentItem>[];
14
+ workflows?: Tolerant<ChatToolItem>[];
15
+ outline?: ChatThreadItem[];
9
16
  }
10
17
  export interface ChatSink {
11
18
  historyIdentity?(chatId: string): object | undefined;
12
- reset(chatId: string, info: ChatInfo, items: ChatItem[], page?: ChatPage): void;
13
- prepend(chatId: string, cursor: string, page: ChatHistoryResult): void;
14
- apply(chatId: string, event: ChatEvent): void;
15
- replay?(chatId: string, events: readonly ChatEvent[]): void;
16
- status(chatId: string, info: ChatInfo): void;
19
+ reset(chatId: string, info: ChatThreadInfo, items: ChatThreadItem[], page?: ChatPage): void;
20
+ prepend(chatId: string, cursor: string, page: Tolerant<ChatHistoryResult>): void;
21
+ apply(chatId: string, event: ChatThreadEvent): void;
22
+ replay?(chatId: string, events: readonly ChatThreadEvent[]): void;
23
+ status(chatId: string, info: ChatThreadInfo): void;
17
24
  bookmarks(chatId: string, bookmarks: ChatBookmark[]): void;
18
25
  visuals(chatId: string, visuals: ChatVisual[]): void;
19
26
  forget(chatId: string): void;
@@ -1,6 +1,6 @@
1
1
  import type { ProviderPlatform } from '@adecore/agent-contracts';
2
2
  import type { AccountRule } from './host.js';
3
- import { type ChatHost, type CommandLook, type ComposerStatusItem } from './host.js';
3
+ import { type ChatHost, type CommandLook, type ComposerStatusItem, type UnknownItemWords } from './host.js';
4
4
  import { type Referables } from './references.js';
5
5
  export declare function useHostCodeMode(): 'light' | 'dark';
6
6
  export declare function useHostCodeThemes(): {
@@ -11,6 +11,7 @@ export declare function useHostAttachmentUrl(...args: Parameters<ChatHost['attac
11
11
  export declare function useHostTasks(...args: Parameters<ChatHost['tasks']['useTasks']>): ReturnType<ChatHost['tasks']['useTasks']>;
12
12
  export declare function useHostTask(...args: Parameters<ChatHost['tasks']['useTask']>): ReturnType<ChatHost['tasks']['useTask']>;
13
13
  export declare function useHostExtraPrompts(...args: Parameters<ChatHost['prompts']['useExtra']>): ReturnType<ChatHost['prompts']['useExtra']>;
14
+ export declare function useHostUnknownItemWords(): UnknownItemWords | null;
14
15
  export declare function useHostStreaming(): ReturnType<ChatHost['useStreaming']>;
15
16
  export declare function useHostSendDelivery(): ReturnType<ChatHost['useSendDelivery']>;
16
17
  export declare function useHostHidesToolCalls(...args: Parameters<ChatHost['useHidesToolCalls']>): ReturnType<ChatHost['useHidesToolCalls']>;
@@ -20,6 +20,11 @@ export function useHostTask(...args) {
20
20
  export function useHostExtraPrompts(...args) {
21
21
  return useChatHost().prompts.useExtra(...args);
22
22
  }
23
+ const useNoUnknownItemWords = () => null;
24
+ export function useHostUnknownItemWords() {
25
+ const useWords = useChatHost().useUnknownItemWords ?? useNoUnknownItemWords;
26
+ return useWords();
27
+ }
23
28
  export function useHostStreaming() {
24
29
  return useChatHost().useStreaming();
25
30
  }
@@ -1,10 +1,11 @@
1
- import type { AgentKind, ChatAttachment, ChatCheckpointDiff, ChatConfigurePayload, ChatGoalAction, ChatItem, ChatSubagentItem, ChatUiChoicePayload, ChatUiQueryPayload, ChatUiQueryReading, ChatUiLinkPayload, ChatUiLinkReading, ChatVisual, ProviderPlatform } from '@adecore/agent-contracts';
1
+ import type { AgentKind, ChatAttachment, ChatCheckpointDiff, ChatConfigurePayload, ChatGoalAction, ChatSubagentItem, ChatUiChoicePayload, ChatUiQueryPayload, ChatUiQueryReading, ChatUiLinkPayload, ChatUiLinkReading, ChatVisual, ProviderPlatform } from '@adecore/agent-contracts';
2
2
  import type { EditorEngine } from '@adecore/editor';
3
3
  import type { Extension } from '@codemirror/state';
4
4
  import type { EditorView } from '@codemirror/view';
5
5
  import type { LucideIcon } from 'lucide-react';
6
6
  import { type ComponentProps, type ComponentType, type ReactNode, type RefObject } from 'react';
7
7
  import type { Highlighter, ThemeRegistration } from 'shiki';
8
+ import type { ChatThreadItem } from '../chat-sink.js';
8
9
  import type { HostPrompt, PromptAction, PromptViewProps } from './prompts.js';
9
10
  import type { ReferableKind, Referables } from './references.js';
10
11
  import type { TimelineRow } from './timeline-row.js';
@@ -83,7 +84,7 @@ export interface TimelineFindOptions {
83
84
  scroller: RefObject<HTMLDivElement | null>;
84
85
  enabled: boolean;
85
86
  rows: readonly TimelineRow[];
86
- structure: Readonly<Record<string, ChatItem>> | undefined;
87
+ structure: Readonly<Record<string, ChatThreadItem>> | undefined;
87
88
  order: readonly string[] | undefined;
88
89
  firstRowInView(): number;
89
90
  openTurn(turnId: string): void;
@@ -270,6 +271,10 @@ export interface AgentMark {
270
271
  viewBox?: string;
271
272
  fillRule?: 'nonzero' | 'evenodd';
272
273
  }
274
+ export interface UnknownItemWords {
275
+ readonly item: string;
276
+ readonly request: string;
277
+ }
273
278
  export interface ChatHost {
274
279
  agentMarks?: Readonly<Partial<Record<AgentKind, AgentMark>>>;
275
280
  useExpandingCommands?(): readonly {
@@ -409,6 +414,7 @@ export interface ChatHost {
409
414
  openSettings(section: 'providers' | 'agents'): void;
410
415
  useResumeAtReset(scopeId: string): boolean;
411
416
  useComposerPlaceholder(scopeId: string, chatId: string): string | null;
417
+ useUnknownItemWords?(): UnknownItemWords | null;
412
418
  ComposerSlot: ComponentType<ComposerSlotProps> | null;
413
419
  ComposerHeaderSlot?: ComponentType<ComposerHeaderSlotProps> | null;
414
420
  useComposerStatus?(scopeId: string, chatId: string): readonly ComposerStatusItem[];
@@ -1,10 +1,11 @@
1
- import type { ChatApprovalItem, ChatAssistantItem, ChatCheckpointDiff, ChatItem, ChatNoteMessage, ChatQuestionItem, ChatSubagentItem, ChatThinkingItem, ChatToolItem, ChatTurnItem, ChatUserItem, ChatVisual, ChatWorkflow, ModelSelection } from '@adecore/agent-contracts';
1
+ import type { ChatApprovalItem, ChatAssistantItem, ChatCheckpointDiff, ChatNoteMessage, ChatQuestionItem, ChatSubagentItem, ChatThinkingItem, ChatToolItem, ChatUnknownItem, ChatUserItem, ChatVisual, ChatWorkflow, ModelSelection } from '@adecore/agent-contracts';
2
+ import type { ChatThreadItem, ChatThreadTurn } from '../chat-sink.js';
2
3
  import type { CommandLook, CommandLookSent, ThreadCard, ToolLook } from './host.js';
3
4
  export type Look = CommandLook | ToolLook;
4
5
  export interface SubagentBranch {
5
6
  id: string;
6
7
  item: ChatSubagentItem;
7
- children: ChatItem[];
8
+ children: ChatThreadItem[];
8
9
  nested: SubagentBranch[];
9
10
  expanded: boolean;
10
11
  }
@@ -19,7 +20,7 @@ export type TimelineRow = {
19
20
  } | {
20
21
  kind: 'turn-start';
21
22
  id: string;
22
- turn: ChatTurnItem;
23
+ turn: ChatThreadTurn;
23
24
  label: string;
24
25
  } | {
25
26
  kind: 'assistant';
@@ -90,6 +91,11 @@ export type TimelineRow = {
90
91
  id: string;
91
92
  preTokens: number | null;
92
93
  postTokens?: number;
94
+ } | {
95
+ kind: 'unknown';
96
+ id: string;
97
+ item: ChatUnknownItem;
98
+ waits: boolean;
93
99
  } | {
94
100
  kind: 'selection-switch';
95
101
  id: string;
@@ -107,7 +113,7 @@ export type TimelineRow = {
107
113
  } | {
108
114
  kind: 'turn-fold';
109
115
  id: string;
110
- turn: ChatTurnItem;
116
+ turn: ChatThreadTurn;
111
117
  label: string;
112
118
  work: string[];
113
119
  hiddenCount: number;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { type ChatActions, type FileRef, type ShellCodeBlockContext, type ChatPlace, type SubagentTask, type TimelineFindOptions, type TimelineFind, type ComposerDictationProps, type ComposerHeaderSlotProps, type ComposerSlotProps, type ReferenceIconProps, type OutsideReference, type ComposerStatusDetail, type ComposerStatusItem, type SubagentSlotProps, type ThreadCard, type VisualHost, type HostMenuAction, type ReplyAuthor, type ChatHost, type UiMapSource, type UiModelViewProps, type CommandLook, type CommandLookCall, type CommandLookSent, type CommandLookMatch, type CommandName, type ToolLook, type ToolLookCall, type ToolLookMatch, ChatHostProvider, type AgentMark, type ChatHostLayer, useChatHost } from './host/host.js';
1
+ export { type ChatActions, type FileRef, type ShellCodeBlockContext, type ChatPlace, type SubagentTask, type TimelineFindOptions, type TimelineFind, type ComposerDictationProps, type ComposerHeaderSlotProps, type ComposerSlotProps, type ReferenceIconProps, type OutsideReference, type ComposerStatusDetail, type ComposerStatusItem, type SubagentSlotProps, type ThreadCard, type VisualHost, type HostMenuAction, type ReplyAuthor, type UnknownItemWords, type ChatHost, type UiMapSource, type UiModelViewProps, type CommandLook, type CommandLookCall, type CommandLookSent, type CommandLookMatch, type CommandName, type ToolLook, type ToolLookCall, type ToolLookMatch, ChatHostProvider, type AgentMark, type ChatHostLayer, useChatHost } from './host/host.js';
2
2
  export { type ChatScope, ChatScopeContext, useChatScope } from './scope.js';
3
3
  export { type ChatRequestMap, type ChatEventMap, type ChatTransportStatus, type ChatTransport, ChatTransportError, errorCode, isConnectionError } from './transport.js';
4
- export { portTransport, type PortTransport } from './port-transport.js';
4
+ export { portTransport, type PortTransport, type PortTransportOptions } from './port-transport.js';
5
5
  export { configureChatStorage } from './storage.js';
6
6
  export { type MountedEntry, MountedRegistry } from './mounted-registry.js';
7
7
  export { PROVIDERS_SECTION, USAGE_SECTION, settingsSection } from './settings/sections.js';
@@ -61,6 +61,7 @@ declare const _default: {
61
61
  'usage-limited': string;
62
62
  'budget-limited': string;
63
63
  complete: string;
64
+ unknown: string;
64
65
  };
65
66
  pill: string;
66
67
  checks_one: string;
@@ -74,6 +75,10 @@ declare const _default: {
74
75
  failed: string;
75
76
  };
76
77
  limit: {
78
+ other: {
79
+ pill: string;
80
+ title: string;
81
+ };
77
82
  usage: {
78
83
  pill: string;
79
84
  pillUntil: string;
@@ -154,6 +159,10 @@ declare const _default: {
154
159
  thoughtFor: string;
155
160
  thought: string;
156
161
  };
162
+ unknown: {
163
+ item: string;
164
+ request: string;
165
+ };
157
166
  note: {
158
167
  hide: string;
159
168
  show: string;
@@ -480,6 +489,9 @@ declare const _default: {
480
489
  };
481
490
  shell: string;
482
491
  monitor: string;
492
+ other: string;
493
+ others_one: string;
494
+ others_other: string;
483
495
  stop: string;
484
496
  stopFailed: string;
485
497
  };
@@ -535,6 +547,10 @@ declare const _default: {
535
547
  hint: string;
536
548
  short: string;
537
549
  };
550
+ unknown: {
551
+ label: string;
552
+ short: string;
553
+ };
538
554
  };
539
555
  pickers: {
540
556
  settings: {