@artooi/ag-ui-web-component 0.42.0 → 0.43.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.
@@ -46,6 +46,13 @@ export interface ToolDispatchHost {
46
46
  * one the element serves.
47
47
  */
48
48
  readonly tenure: () => object;
49
+ /**
50
+ * The conversation on screen: an identity the element replaces every time it
51
+ * clears the transcript for another conversation, a handover included. Only
52
+ * ever compared, so a call can tell whether the conversation it was
53
+ * dispatched in is still the one it would draw into.
54
+ */
55
+ readonly conversation: () => object;
49
56
  }
50
57
  /**
51
58
  * Running the frontend tool calls a round produced, and answering the server's
@@ -87,7 +94,10 @@ export declare class ToolDispatch {
87
94
  * check that it has not. A Stop while the host's predicate is pending ends
88
95
  * the call there, and one while the card is open declines it. A handover
89
96
  * during any of the three leaves the call with no transcript to draw in and
90
- * no store to write to, so it does neither.
97
+ * no store to write to, so it does neither. Any other reset of the
98
+ * conversation -- New chat, a drawer switch, `reload()` -- leaves the call
99
+ * its store and its result but not the transcript, so it still settles and
100
+ * returns, and does not show the run waiting in a conversation it is not in.
91
101
  */
92
102
  execute(call: AgUiToolCall): Promise<ToolExecution | null>;
93
103
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"tool_dispatch.d.ts","sourceRoot":"","sources":["../../src/tools/tool_dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAG7E,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC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CAAC,UAAU,EAAE,MAAM,OAAO,EAAE,CAAC;IACrC,uDAAuD;IACvD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;IAC1D,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,MAAM,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,qBAAa,YAAY;;IAiBvB,YAAY,IAAI,EAAE,gBAAgB,EAEjC;IAED;;;;;;;;OAQG;IACH,aAAa,IAAI,IAAI,CAEpB;IAED;;;;;;;;OAQG;IACH,YAAY,IAAI,OAAO,EAAE,CAGxB;IAED;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA8P/D;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,iBAAiB,CACrB,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CA+F5C;CAqHF"}
@@ -37,8 +37,8 @@ export declare class VoiceInput {
37
37
  * a detached element.
38
38
  *
39
39
  * Disposal is final: nothing un-disposes an instance, and the host's next
40
- * wiring builds a new one. So the disposed flag alone tells a stale
41
- * continuation from a live one, and a clip already posted when this runs is
40
+ * wiring builds a new one. So the disposed flag alone tells a continuation
41
+ * that outlived the control from a live one, and a clip already posted when this runs is
42
42
  * dropped whenever its answer arrives.
43
43
  */
44
44
  dispose(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"voice_input.d.ts","sourceRoot":"","sources":["../../../src/ui/composer/voice_input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAExE,OAAO,EAAsB,KAAK,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S5B;IAsFD;;;;;;;;;;;OAWG;IACH,OAAO,IAAI,IAAI,CAQd;CAiFF"}
@@ -88,16 +88,21 @@ export interface ConversationHistoryHost {
88
88
  readonly releaseClient: () => void;
89
89
  /**
90
90
  * Whether an interaction is in flight, which the composer owns: from the
91
- * moment a send or a retry is taken, or a restore that will resume a run
92
- * starts loading, not only once its run has started.
91
+ * moment a send or a retry is taken, or a restore starts loading, not only
92
+ * once its run has started.
93
93
  */
94
94
  readonly running: () => boolean;
95
95
  /**
96
- * Hold the composer as a send holds it from the moment it is taken: a send
97
- * refuses, the built-in Send parks its turn, a Retry and a pick refuse. Let
98
- * go of when the run starts, by a Stop, or by {@link RunHold.release}.
96
+ * Hold the composer as a send holds it from the moment it is taken: the
97
+ * built-in Send parks its turn, a Retry and a pick refuse. Let go of when the
98
+ * run starts, by a Stop, or by {@link RunHold.release}.
99
+ *
100
+ * A host's send refuses too, unless `restored` is given: then the hold is a
101
+ * restore's with no run to resume, and a host's send waits for `restored` to
102
+ * settle and sends after it, with the conversation drawn. `restored` settles
103
+ * once that restore has ended, or has been stopped, and never rejects.
99
104
  */
100
- readonly holdRun: () => RunHold;
105
+ readonly holdRun: (restored: Promise<void> | null) => RunHold;
101
106
  /** Stop the in-flight run. */
102
107
  readonly cancelRun: () => void;
103
108
  /** Drop the in-memory run and transcript, leaving the thread untouched. */
@@ -109,8 +114,9 @@ export interface ConversationHistoryHost {
109
114
  * A hold {@link ConversationHistoryHost.holdRun} took.
110
115
  *
111
116
  * It says nothing about whether the restore that took it was stopped. A
112
- * restore asks its generation that, because a restore with no run to resume
113
- * holds nothing and can be stopped all the same -- see
117
+ * restore asks its generation that, because a host's send that waited on a
118
+ * restore with no run to resume takes the hold over from it, and a restore
119
+ * stopped by a newer one finds that one's hold in its place -- see
114
120
  * {@link ConversationHistory.rehydrate}.
115
121
  */
116
122
  interface RunHold {
@@ -226,16 +232,30 @@ export declare class ConversationHistory {
226
232
  * exclusion is held by "resumes with the landed page's result, and its card says
227
233
  * so" in `ag_ui_chat_reload_mid_run.test.ts`.
228
234
  *
229
- * **A restore that resumes holds the composer from before the load.** The
230
- * resume is a run, and it starts only once the store has answered. With a
231
- * remote store that is a real request, and a send, a Retry or a pick in it
232
- * was refused by nothing: each built the conversation's client before the
233
- * conversation had loaded, so a send went out carrying none of it and its
234
- * first save replaced the stored one, and the resume then ran on that same
235
- * client as a second run, answering a call the request no longer held. So
236
- * the composer is held as a send holds it, and the resume gives way to
237
- * nothing: what was typed parks behind the resumed run and goes out after its
238
- * answer, and a host's send or Retry is refused as it is behind any run.
235
+ * **Every restore holds the composer from before the load.** Until the
236
+ * store answers, the conversation's client can only be seeded from nothing.
237
+ * With a remote store that is a real request, and a send, a Retry or a pick
238
+ * in it was refused by nothing: each built the conversation's client before
239
+ * the conversation had loaded, so a send went out carrying none of it, its
240
+ * first save replaced the stored one, and the replay then drew the stored
241
+ * conversation under the new turn. The client stayed cached without it, so
242
+ * every later turn went out without it too. So the composer is held as a
243
+ * send holds it: what was typed parks and goes out after the replay, and a
244
+ * Retry and a pick are refused -- a Retry has nothing on screen to retry, and
245
+ * after the load it would re-ask the previous visit's last question.
246
+ *
247
+ * **A host's send waits for a restore with no run to resume.** It is
248
+ * usually a prompt fired as the element mounts, which no host could time
249
+ * against a load nothing announces, and refusing it would lose the turn.
250
+ * So it waits for this restore to end, taking the hold over as it does,
251
+ * and then sends with the conversation drawn above it; what the built-in
252
+ * Send parked goes out after its run. Stopped while it waits, it is dropped,
253
+ * as a send stopped by its own submit listener is.
254
+ *
255
+ * **A restore that resumes refuses a host's send instead.** The resume is a
256
+ * run, and the restore ends by starting it, so a send that waited would only
257
+ * reach that run and be refused there. The resume gives way to nothing: what
258
+ * was typed parks behind the resumed run and goes out after its answer.
239
259
  *
240
260
  * The other way round, the resume standing down for the send, was rejected.
241
261
  * The send that got in first had already gone out without the conversation,
@@ -248,8 +268,8 @@ export declare class ConversationHistory {
248
268
  * page can each come while the store answers, and from host code the restore
249
269
  * runs itself: the activity and tool renderers each replayed message draws
250
270
  * through, and `navigationResult`. From then on it draws nothing more and
251
- * resumes nothing. The hold cannot say so, because a restore with no run to
252
- * resume holds nothing. So the restore asks its generation, which clearing
271
+ * resumes nothing. The hold cannot say so, because a host's send that
272
+ * waited may hold it by then. So the restore asks its generation, which clearing
253
273
  * the conversation moves on as a newer restore does, and asks it after the
254
274
  * load, after each replayed message -- as a Retry asks after each one -- and
255
275
  * once more before the resume. Stopped by anything but the element leaving
@@ -257,10 +277,6 @@ export declare class ConversationHistory {
257
277
  * for the run it would have resumed -- unless what replaced it is a restore
258
278
  * of the same conversation, still current, which answers for that run
259
279
  * instead; see `#forgetStopped`.
260
- *
261
- * What a restore with no run to resume still does not do is refuse a send
262
- * made while it loads. That send goes out without the stored conversation,
263
- * and its save replaces it.
264
280
  */
265
281
  rehydrate(): Promise<void>;
266
282
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_history.d.ts","sourceRoot":"","sources":["../../../src/ui/history/conversation_history.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO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IAAI,CAElB;IAED;;;;;;;;OAQG;IACH,gBAAgB,IAAI,IAAI,CAGvB;IAED,6EAA6E;IAC7E,cAAc,IAAI,IAAI,CAgBrB;IASD,+DAA+D;IAC/D,UAAU,IAAI,IAAI,CAOjB;IAED,yEAAyE;IACzE,IAAI,IAAI,QAAQ,GAAG,IAAI,CAatB;IAED,mEAAmE;IACnE,WAAW,IAAI,IAAI,CAQlB;IAED,mEAAmE;IACnE,eAAe,IAAI,IAAI,CAKtB;IAED,0EAA0E;IACpE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUlD;IAED,kEAAkE;IAClE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAGlD;IAED,4EAA4E;IAC5E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAYnC;IAED,kEAAkE;IAC5D,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAMnC;IAWD;;;;;;;;;;;;;;;;;;OAkBG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAiJpE;IAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2EG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CA8H/B;IAsID;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyF7B;CA2DF"}
@@ -117,6 +117,11 @@ export interface UiStrings {
117
117
  continueNeedsTurn: string;
118
118
  /** Composer hint when a run continuation was picked while a run is in flight. */
119
119
  continueWhileRunning: string;
120
+ /**
121
+ * Composer hint when a run continuation was picked while the stored
122
+ * conversation is still loading.
123
+ */
124
+ continueWhileLoading: string;
120
125
  /** `aria-label` of the message textarea. */
121
126
  message: string;
122
127
  /** Placeholder of the message text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wC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IAGzB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IAGnB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAGlB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,EAAE,SA6IhC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CASvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artooi/ag-ui-web-component",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "description": "Framework-free <ag-ui-chat> Web Component over the AG-UI protocol. Drop-in chat sidebar with a pluggable client-side tool registry, DOM driver primitives, animations, and destructive-action confirmation modal.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -645,6 +645,26 @@ export class AgUiChat extends HTMLElement {
645
645
  * conversation the handover purged.
646
646
  */
647
647
  #tenure: object = {};
648
+ /**
649
+ * The conversation on screen: replaced every time the transcript is cleared
650
+ * for another one -- New chat, a drawer switch, deleting the active thread,
651
+ * `reload()`, re-insertion and a handover all pass through
652
+ * {@link #resetConversation} -- and captured by each frontend tool call as it
653
+ * is dispatched, so the call can tell whether the conversation it was drawn
654
+ * in is still the one showing.
655
+ *
656
+ * A call outlives the reset that stops its run. A handler cannot be aborted,
657
+ * and a card open at the time is declined, so the call resumes once the new
658
+ * conversation is showing; drawing the run's pending indicator then put it
659
+ * in a conversation with no run to take it down.
660
+ *
661
+ * Not {@link #tenure}, which only a handover replaces. A reset is not a
662
+ * change of principal: the call still belongs to someone this element
663
+ * serves, so it still settles its card, clears its checkpoint and returns
664
+ * its result, and only the drawing is skipped. The tenure checks end the
665
+ * call before any of that.
666
+ */
667
+ #conversation: object = {};
648
668
  /**
649
669
  * The remote store `data-threads-url` wrapped around the conversation store,
650
670
  * and the store inside it, so connecting again can wrap that store rather
@@ -676,9 +696,9 @@ export class AgUiChat extends HTMLElement {
676
696
  * requests, and the listener's turn drawn between the user's turn and its
677
697
  * answer. It is the gap a picked checkpoint closes by counting from the pick,
678
698
  * closed the same way for a send. A retry asks for its run the same way, so
679
- * it takes the same hold, and so does a restore that will resume a run, from
680
- * before it asks the store for the conversation, through the history host's
681
- * `holdRun`.
699
+ * it takes the same hold, and so does every restore, from before it asks the
700
+ * store for the conversation, through the history host's `holdRun`: until
701
+ * the store answers, the client can only be built from nothing.
682
702
  *
683
703
  * Let go of once the run starts, because `running` holds from then until the
684
704
  * run settles, and a send held past that would refuse a host's follow-up from
@@ -688,9 +708,18 @@ export class AgUiChat extends HTMLElement {
688
708
  * An object rather than a flag, so a send or a retry ending releases only
689
709
  * what it took. By the time either ends, the turn queued behind it has
690
710
  * usually taken the field for itself, and a Stop lets go of it for the next
691
- * send to take; the earlier one ending must release neither.
711
+ * send to take; the earlier one ending must release neither. It is also how
712
+ * {@link sendMessage} tells the one hold it waits on from all the others it
713
+ * refuses behind: see {@link #restoreHold}.
692
714
  */
693
715
  #sending: object | null = null;
716
+ /**
717
+ * The hold the latest restore with no run to resume took, and what settles
718
+ * once that restore has ended or been stopped; `null` when the latest
719
+ * restore will resume a run. Only meaningful while `#sending` is that hold:
720
+ * then a host's {@link sendMessage} waits for it rather than refusing.
721
+ */
722
+ #restoreHold: { readonly hold: object; readonly restored: Promise<void> } | null = null;
694
723
  /** The decision a run is suspended on, which a Stop abandons. */
695
724
  readonly #decision = new PendingDecision();
696
725
  /**
@@ -785,6 +814,8 @@ export class AgUiChat extends HTMLElement {
785
814
  // Read live and compared, the way each client compares the one it was
786
815
  // built with: see #tenure.
787
816
  tenure: () => this.#tenure,
817
+ // The same, for the conversation on screen: see #conversation.
818
+ conversation: () => this.#conversation,
788
819
  });
789
820
  this.#runHandlers = new RunHandlers({
790
821
  element: this,
@@ -945,25 +976,29 @@ export class AgUiChat extends HTMLElement {
945
976
  // A held send or retry is as much in flight to a pick as a run is: it has
946
977
  // asked this element's client for a run that has not started, and a
947
978
  // continuation started beside it was a second run in one conversation.
948
- // So is a restore that will resume a run, which holds through the same
949
- // field from before the store answers.
979
+ // So is a restore, which holds through the same field from before the
980
+ // store answers.
950
981
  running: () => this.#running || this.#sending !== null,
951
- // The hold a send takes, taken for a restore that will resume a run, so
952
- // what refuses a send held short of its run refuses one made while the
953
- // store is still answering: `sendMessage` returns, Send parks the turn,
954
- // a Retry and a pick refuse. The same field rather than a flag beside it,
955
- // because what lets go of a send's hold is right for this one too. The
956
- // resumed run starting lets go, in `#setRunning`, so there is no gap
957
- // after the resume is asked for, and a Stop does, in `#cancelRun`. A flag
958
- // the restore cleared itself would still be set when the resumed run
959
- // settles and sends the parked turn, so that send would be refused after
960
- // the turn had left the queue, and lost.
982
+ // The hold a send takes, taken for every restore, so what refuses a send
983
+ // held short of its run holds one made while the store is still
984
+ // answering: Send parks the turn, a Retry and a pick refuse, and
985
+ // `sendMessage` refuses behind a restore that will resume a run and waits
986
+ // for one that will not -- `restored` is what it waits on, given only for
987
+ // that kind. The same field rather than a flag beside it, because what
988
+ // lets go of a send's hold is right for this one too. The resumed run
989
+ // starting lets go, in `#setRunning`, so there is no gap after the resume
990
+ // is asked for, and a Stop does, in `#cancelRun`. A flag the restore
991
+ // cleared itself would still be set when the resumed run settles and
992
+ // sends the parked turn, so that send would be refused after the turn had
993
+ // left the queue, and lost.
961
994
  //
962
- // Whether the restore was stopped is not read off this hold, because one
963
- // with nothing to resume takes none; the restore asks its own generation.
964
- holdRun: () => {
995
+ // Whether the restore was stopped is not read off this hold, because a
996
+ // host's send that waited takes it over; the restore asks its own
997
+ // generation.
998
+ holdRun: (restored) => {
965
999
  const hold = {};
966
1000
  this.#sending = hold;
1001
+ this.#restoreHold = restored === null ? null : { hold, restored };
967
1002
  return {
968
1003
  release: () => {
969
1004
  if (this.#sending === hold) {
@@ -2047,6 +2082,9 @@ export class AgUiChat extends HTMLElement {
2047
2082
  // not draw into this one, put a new run's Stop back to Send, or report the
2048
2083
  // new conversation's tools as its own.
2049
2084
  this.#runHandlers.detach();
2085
+ // A frontend tool call of that run can resume later still, for the same
2086
+ // reason, and must not draw into this one either: see #conversation.
2087
+ this.#conversation = {};
2050
2088
  this.#clearTranscript();
2051
2089
  this.#history.forgetRestored();
2052
2090
  }
@@ -2086,9 +2124,12 @@ export class AgUiChat extends HTMLElement {
2086
2124
  * History is truncated to the most recent user message inclusive and the run
2087
2125
  * repeats, so the agent answers what it was asked rather than being told its
2088
2126
  * last answer was wrong. Returns `false` when there is nothing to retry, or
2089
- * while anything that refuses a send is in flight: a run, a send or another
2127
+ * while anything that holds a send is in flight: a run, a send or another
2090
2128
  * retry whose run has not started yet, a checkpoint continuation, or a
2091
- * reload's restore that will resume a run. Also `false` when host code it
2129
+ * restore of the stored conversation that is still loading. It does not wait
2130
+ * for a restore as a send does: nothing is on screen to retry yet, and after
2131
+ * the load it would re-ask the previous visit's last question. Also `false`
2132
+ * when host code it
2092
2133
  * runs before its run starts -- the store's save, or an activity or tool
2093
2134
  * renderer the replay draws through -- has stopped it by starting a new chat
2094
2135
  * or changing `user-key`. A tool or context provider that stops it does so
@@ -2866,23 +2907,68 @@ export class AgUiChat extends HTMLElement {
2866
2907
  * `attachments` are durable {@link AttachmentRef}s — what {@link attachFile}
2867
2908
  * resolves to and what {@link ATTACHMENT_EVENT} reports.
2868
2909
  *
2869
- * No-ops on an empty message, and while a run or a picked checkpoint's
2870
- * continuation is in flight, since a second concurrent run would orphan the
2871
- * first. A send is in flight from the moment it is taken rather than from
2872
- * its run's start, so this no-ops from a {@link SUBMIT_EVENT} listener and
2873
- * for a second call in the same task too.
2910
+ * Resolves `true` once the turn has been handed to the client for its run,
2911
+ * which is when the interaction settles, frontend-tool rounds included; a
2912
+ * run a tool or context provider then stops still counts, as it does for
2913
+ * {@link retryLastTurn}. Resolves `false` when nothing was sent.
2914
+ *
2915
+ * Nothing is sent for an empty message, nor while a run or a picked
2916
+ * checkpoint's continuation is in flight, since a second concurrent run
2917
+ * would orphan the first. A send is in flight from the moment it is taken
2918
+ * rather than from its run's start, so nothing is sent from a
2919
+ * {@link SUBMIT_EVENT} listener or for a second call in the same task
2920
+ * either. Nor with no `endpoint`, which says so in the transcript. Nor
2921
+ * behind a reload's restore that will resume a run a navigating tool
2922
+ * interrupted, since that restore ends by starting the run.
2923
+ *
2924
+ * **While the element restores a stored conversation with no run to resume
2925
+ * -- on connect, {@link reload}, a thread picked from the drawer, a change
2926
+ * from one `user-key` to another -- it waits, then sends.** The turn has to follow the
2927
+ * conversation it is part of: sent at once, it went out without it, the
2928
+ * conversation was then drawn under it, and its save replaced the stored
2929
+ * one. So the bubble, the {@link SUBMIT_EVENT} and the request all come after
2930
+ * the replay, by the length of the store's load. A New chat, a thread
2931
+ * switch, a change from one `user-key` to another, a reload or the element
2932
+ * leaving the page while it waits drops it, resolving `false`: the
2933
+ * conversation it was addressed to is no longer on screen. Leaving the page
2934
+ * resolves it only once the load answers or the element is back, since
2935
+ * that is when the restore learns it was stopped. A first `user-key` on an
2936
+ * anonymous conversation adopts it rather than replacing it, and stops
2937
+ * nothing. A second call while one waits is
2938
+ * refused, as a second call in the same task is.
2939
+ *
2874
2940
  * Unlike the built-in Send it does not queue: it returns, and the caller
2875
2941
  * keeps what it tried to send. Nor does it consult the tray -- what you pass
2876
2942
  * is what is sent.
2877
2943
  */
2878
- async sendMessage(content: string, attachments: readonly AttachmentRef[] = []): Promise<void> {
2879
- if (
2880
- this.#running ||
2881
- this.#sending !== null ||
2882
- this.#history.continuation !== null ||
2883
- (content === "" && attachments.length === 0)
2884
- ) {
2885
- return;
2944
+ async sendMessage(content: string, attachments: readonly AttachmentRef[] = []): Promise<boolean> {
2945
+ if (content === "" && attachments.length === 0) {
2946
+ return false;
2947
+ }
2948
+ const restore = this.#restoreHold;
2949
+ if (restore !== null && this.#sending === restore.hold) {
2950
+ // Taken over from the restore, so a second host call is refused, the
2951
+ // built-in Send parks behind this one rather than going first, and the
2952
+ // restore's own release when it ends lets go of nothing -- this send's
2953
+ // run settling, or its end, is what sends the parked turn.
2954
+ const waiting = {};
2955
+ this.#sending = waiting;
2956
+ await restore.restored;
2957
+ // Anything that stopped the restore let go of this too, by the Stop
2958
+ // that New chat, a thread switch, a principal handover, a reload and the
2959
+ // element leaving all reach. Otherwise let go of here and the guards
2960
+ // asked again from the top, as for a call made now.
2961
+ //
2962
+ // Removing this check fails "drops the waiting send and the queued turn
2963
+ // when New chat is pressed", among the other drop tests.
2964
+ if (this.#sending !== waiting) {
2965
+ return false;
2966
+ }
2967
+ this.#sending = null;
2968
+ return this.sendMessage(content, attachments);
2969
+ }
2970
+ if (this.#running || this.#sending !== null || this.#history.continuation !== null) {
2971
+ return false;
2886
2972
  }
2887
2973
  const send = {};
2888
2974
  this.#sending = send;
@@ -2905,9 +2991,13 @@ export class AgUiChat extends HTMLElement {
2905
2991
  // which let go of this send, and the turn would otherwise go out into the
2906
2992
  // conversation that replaced it, or from an element nothing can stop.
2907
2993
  if (this.#sending !== send) {
2908
- return;
2994
+ return false;
2909
2995
  }
2996
+ // Read where the request is made, which says why nothing was sent when
2997
+ // there is no endpoint to send to.
2998
+ const connected = this.endpoint !== "";
2910
2999
  await this.#client_send(content, attachments);
3000
+ return connected;
2911
3001
  } finally {
2912
3002
  // Still held here only if its run never started: no endpoint, or a
2913
3003
  // client or store that threw before asking for one. No run settles
@@ -64,6 +64,13 @@ export interface ToolDispatchHost {
64
64
  * one the element serves.
65
65
  */
66
66
  readonly tenure: () => object;
67
+ /**
68
+ * The conversation on screen: an identity the element replaces every time it
69
+ * clears the transcript for another conversation, a handover included. Only
70
+ * ever compared, so a call can tell whether the conversation it was
71
+ * dispatched in is still the one it would draw into.
72
+ */
73
+ readonly conversation: () => object;
67
74
  }
68
75
 
69
76
  /**
@@ -131,7 +138,10 @@ export class ToolDispatch {
131
138
  * check that it has not. A Stop while the host's predicate is pending ends
132
139
  * the call there, and one while the card is open declines it. A handover
133
140
  * during any of the three leaves the call with no transcript to draw in and
134
- * no store to write to, so it does neither.
141
+ * no store to write to, so it does neither. Any other reset of the
142
+ * conversation -- New chat, a drawer switch, `reload()` -- leaves the call
143
+ * its store and its result but not the transcript, so it still settles and
144
+ * returns, and does not show the run waiting in a conversation it is not in.
135
145
  */
136
146
  async execute(call: AgUiToolCall): Promise<ToolExecution | null> {
137
147
  // A skill load already rendered as a notice on the stream; it is never a
@@ -148,6 +158,7 @@ export class ToolDispatch {
148
158
  // chat had just moved to, leaving its own behind, and across a handover
149
159
  // it wrote into the next principal's store.
150
160
  const tenure = this.#host.tenure();
161
+ const conversation = this.#host.conversation();
151
162
  const threadId = this.#host.threadId();
152
163
  const card = this.#host.transcript.cardFor(call);
153
164
  this.#host.transcript.forgetCard(call.id);
@@ -270,7 +281,16 @@ export class ToolDispatch {
270
281
  if (!accepted) {
271
282
  const message = this.#host.strings().declinedAction;
272
283
  card.settle(TOOL_CALL_STATUS.DECLINED, message);
273
- this.#host.transcript.showPending();
284
+ // New chat or a drawer switch with the card open declines it too, and
285
+ // the indicator would land in the conversation that replaced this one,
286
+ // whose run is not this one and which nothing would take it down from.
287
+ // Only the drawing is skipped: the refusal is still this run's to send.
288
+ //
289
+ // Held by "draws nothing into the new chat when New chat declines the
290
+ // open card" in tool_dispatch.test.ts.
291
+ if (this.#host.conversation() === conversation) {
292
+ this.#host.transcript.showPending();
293
+ }
274
294
  // The one outcome with no error text and no server involvement at all:
275
295
  // a person said no in this browser. Nothing else records that, so
276
296
  // without the annotation the reload showed a green card for an action
@@ -332,7 +352,16 @@ export class ToolDispatch {
332
352
  }
333
353
  const content = JSON.stringify(result ?? null);
334
354
  card.settle(TOOL_CALL_STATUS.DONE, content);
335
- this.#host.transcript.showPending();
355
+ // The same check for a reset that is not a handover. The result is kept,
356
+ // as after a Stop, but the conversation on screen is not the one it was
357
+ // dispatched in, so the run is not shown waiting there.
358
+ //
359
+ // Held by "draws nothing into the new chat when a handler resolves after
360
+ // New chat" in tool_dispatch.test.ts, and for the other resets by the
361
+ // tests beside it.
362
+ if (this.#host.conversation() === conversation) {
363
+ this.#host.transcript.showPending();
364
+ }
336
365
  return { content };
337
366
  } catch (error) {
338
367
  // The same handover check as on success, and here it also guards a
@@ -358,7 +387,14 @@ export class ToolDispatch {
358
387
  // invisible from the host's side and is not one it can take back.
359
388
  const message = error instanceof Error ? error.message : String(error);
360
389
  card.settle(TOOL_CALL_STATUS.ERROR, message);
361
- this.#host.transcript.showPending();
390
+ // As on success: the failure is still reported, and not drawn as a run
391
+ // waiting in a conversation the call is no longer in.
392
+ //
393
+ // Held by "draws nothing into the new chat when a handler fails after
394
+ // New chat" in tool_dispatch.test.ts.
395
+ if (this.#host.conversation() === conversation) {
396
+ this.#host.transcript.showPending();
397
+ }
362
398
  return { content: `Error: ${message}`, error: message, outcome: TOOL_OUTCOME.FAILED };
363
399
  }
364
400
  }