@artooi/ag-ui-web-component 0.22.0 → 0.23.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.
@@ -167,4 +167,20 @@ export declare const ICON_ATTACH = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" a
167
167
  export declare const ICON_VOICE = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M12 4a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V7a3 3 0 0 1 3-3z\"/><path d=\"M5 11v1a7 7 0 0 0 14 0v-1\"/><path d=\"M12 19v3\"/></svg>";
168
168
  /** The default launcher mark (a speech bubble), shown when the host slots none. */
169
169
  export declare const ICON_LAUNCHER = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H9l-5 4z\"/></svg>";
170
+ /**
171
+ * The attachment-chip type marks, one per coarse file family. Same contract as
172
+ * the chrome's glyphs above: static author-written markup on a 24x24 viewBox
173
+ * carrying the shared `glyph` class. A chip picks one by MIME family through
174
+ * `iconFor`; the MIME string selects a constant and is never interpolated into
175
+ * one, so nothing user- or server-supplied reaches the markup.
176
+ *
177
+ * The generic mark, for a family with nothing more specific to say.
178
+ */
179
+ export declare const ICON_FILE = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z\"/><path d=\"M14 3v5h5\"/></svg>";
180
+ /** An image attachment: a framed picture with a horizon and a sun. */
181
+ export declare const ICON_FILE_IMAGE = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"2.5\"/><circle cx=\"9\" cy=\"10\" r=\"1.5\"/><path d=\"M4.5 17.5 9 13.5l3.5 3 3-2.5 4.5 4\"/></svg>";
182
+ /** A PDF: the generic page, banded to read as a labelled document. */
183
+ export declare const ICON_FILE_PDF = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z\"/><path d=\"M14 3v5h5\"/><rect class=\"glyph--solid\" x=\"7.5\" y=\"13.5\" width=\"9\" height=\"4.5\" rx=\"1\"/></svg>";
184
+ /** A text document: the generic page, ruled. */
185
+ export declare const ICON_FILE_TEXT = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z\"/><path d=\"M14 3v5h5\"/><path d=\"M8.5 13.5h7M8.5 17h4.5\"/></svg>";
170
186
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,wEAAwE;AACxE,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAEpD,qCAAqC;AACrC,eAAO,MAAM,YAAY;aACvB,IAAI,EAAE,MAAM;aACZ,SAAS,EAAE,WAAW;CACd,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,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e,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,yHAAiH,CAAC;AAExI,yEAAyE;AACzE,eAAO,MAAM,SAAS,qJAAqI,CAAC;AAE5J,2CAA2C;AAC3C,eAAO,MAAM,WAAW,wJAAgJ,CAAC;AAEzK,yDAAyD;AACzD,eAAO,MAAM,UAAU,0MAA8L,CAAC;AAEtN,mFAAmF;AACnF,eAAO,MAAM,aAAa,2KAAmK,CAAC;AAE9L;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,0KAAgK,CAAC;AAEvL,sEAAsE;AACtE,eAAO,MAAM,eAAe,kOAA0M,CAAC;AAEvO,sEAAsE;AACtE,eAAO,MAAM,aAAa,iQAA2O,CAAC;AAEtQ,gDAAgD;AAChD,eAAO,MAAM,cAAc,8MAAkM,CAAC"}
@@ -136,10 +136,14 @@ export declare class AgUiChat extends HTMLElement {
136
136
  */
137
137
  getTools: () => Tool[];
138
138
  /**
139
- * Per-run context provider. Defaults to the compact page map (when a
140
- * {@link getPageMap} provider is set and {@link autoInjectPageMap} is on)
141
- * plus a one-line manifest of the files attached to the message being sent,
142
- * so the agent knows which `read_attachment` ids are available.
139
+ * Per-run context provider. Defaults to the compact page map, when a
140
+ * {@link getPageMap} provider is set and {@link autoInjectPageMap} is on.
141
+ *
142
+ * It used to append a one-line manifest of the message's attachments too.
143
+ * The server now derives that manifest from the refs riding the messages, so
144
+ * the client's copy only duplicated it, on exactly the turn a file was
145
+ * attached. Attachments still reach the agent; they reach it through the
146
+ * message, which is where they were already.
143
147
  */
144
148
  getContext: () => Context[];
145
149
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core/ag_ui_chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAsB,IAAI,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAS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AAW,CAAC,KAAK,EAAE,eAAe,EAErC;IAED,iBAAiB,IAAI,IAAI,CAgDxB;IAqCD;;;;;;;;;;;;;;OAcG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAK5B;IAED;;;;;;;OAOG;IACH,oBAAoB,IAAI,IAAI,CAK3B;IA4MD;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI,CAGxC;IAsHD,gFAAgF;IAChF,IAAI,SAAS,IAAI,OAAO,CAEvB;IAID,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAE3B;IAED;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAiBrC;IAED;;;;;OAKG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,qEAAqE;IACrE,eAAe,IAAI,IAAI,CAEtB;IAED;;;;;OAKG;IACH,WAAW,IAAI,IAAI,CAKlB;IA8JD;;;;;;;;;;OAUG;IACH,WAAW,IAAI,IAAI,CAGlB;IAED;;;;;;OAMG;IACH,eAAe,IAAI,IAAI,CAGtB;IAED;;;OAGG;IACH,OAAO,IAAI,IAAI,CASd;IA2ND;;;;;;;;;;OAUG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAkBhE;IAyeD;;;;;;;;;;;;;;;;;OAiBG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,SAAS,aAAa,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB5F;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAM9B;CAieF"}
package/dist/index.js CHANGED
@@ -40,6 +40,10 @@ var ICON_STOP = `<svg class="glyph glyph--solid" viewBox="0 0 24 24" aria-hidden
40
40
  var ICON_ATTACH = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M17 8.5V15a5 5 0 0 1-10 0V7a3 3 0 0 1 6 0v7.5a1 1 0 0 1-2 0V8.5"/></svg>`;
41
41
  var ICON_VOICE = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 4a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V7a3 3 0 0 1 3-3z"/><path d="M5 11v1a7 7 0 0 0 14 0v-1"/><path d="M12 19v3"/></svg>`;
42
42
  var ICON_LAUNCHER = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H9l-5 4z"/></svg>`;
43
+ var ICON_FILE = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>`;
44
+ var ICON_FILE_IMAGE = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><rect x="3.5" y="4.5" width="17" height="15" rx="2.5"/><circle cx="9" cy="10" r="1.5"/><path d="M4.5 17.5 9 13.5l3.5 3 3-2.5 4.5 4"/></svg>`;
45
+ var ICON_FILE_PDF = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/><rect class="glyph--solid" x="7.5" y="13.5" width="9" height="4.5" rx="1"/></svg>`;
46
+ var ICON_FILE_TEXT = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/><path d="M8.5 13.5h7M8.5 17h4.5"/></svg>`;
43
47
 
44
48
  // src/skills/fill_template.ts
45
49
  var PLACEHOLDER_RE = /\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g;
@@ -723,7 +727,7 @@ function renderChip(ref) {
723
727
  const icon = document.createElement("span");
724
728
  icon.className = "attachment-chip-icon";
725
729
  icon.setAttribute("part", "attachment-chip-icon");
726
- icon.textContent = iconFor(ref.mime);
730
+ icon.innerHTML = iconFor(ref.mime);
727
731
  icon.setAttribute("aria-hidden", "true");
728
732
  const name = document.createElement("span");
729
733
  name.className = "attachment-chip-name";
@@ -739,15 +743,15 @@ function renderChip(ref) {
739
743
  }
740
744
  function iconFor(mime) {
741
745
  if (mime.startsWith("image/")) {
742
- return "\u{1F5BC}";
746
+ return ICON_FILE_IMAGE;
743
747
  }
744
748
  if (mime === "application/pdf") {
745
- return "\u{1F4D5}";
749
+ return ICON_FILE_PDF;
746
750
  }
747
751
  if (mime.startsWith("text/")) {
748
- return "\u{1F4C4}";
752
+ return ICON_FILE_TEXT;
749
753
  }
750
- return "\u{1F4CE}";
754
+ return ICON_FILE;
751
755
  }
752
756
  function formatBytes(bytes) {
753
757
  if (bytes < 1024) {
@@ -913,7 +917,7 @@ var AttachmentTray = class {
913
917
  const icon = document.createElement("span");
914
918
  icon.className = "attachment-chip-icon";
915
919
  icon.setAttribute("part", "attachment-chip-icon");
916
- icon.textContent = iconFor(item.file.type);
920
+ icon.innerHTML = iconFor(item.file.type);
917
921
  icon.setAttribute("aria-hidden", "true");
918
922
  const name = document.createElement("span");
919
923
  name.className = "attachment-chip-name";
@@ -5919,11 +5923,25 @@ var STYLES = `
5919
5923
  display: contents;
5920
5924
  }
5921
5925
 
5926
+ /* The padding is the only separation the tray gets: its slot is display:
5927
+ contents, so the tray is a direct child of the .chat column, and that column
5928
+ sets no gap. The bottom value keeps a chip off the composer's top edge.
5929
+ The inline value here is only the default: the page placement overrides
5930
+ padding-inline further down to compute its reading-column gutter, and wins
5931
+ on specificity whichever way this declaration is written. Read the two
5932
+ together before changing either. */
5922
5933
  .attachment-tray {
5923
5934
  display: flex;
5924
5935
  flex-wrap: wrap;
5925
5936
  gap: 6px;
5926
- padding: 8px 12px 0;
5937
+ padding: 8px 12px;
5938
+ }
5939
+
5940
+ /* The tray sets the hidden property while empty, and an author display beats
5941
+ the UA stylesheet's rule for it, so without this the empty tray keeps
5942
+ laying out and its padding is permanent dead space above the composer. */
5943
+ .attachment-tray[hidden] {
5944
+ display: none;
5927
5945
  }
5928
5946
 
5929
5947
  .attachment-chips {
@@ -5959,15 +5977,29 @@ var STYLES = `
5959
5977
  overflow-wrap: anywhere;
5960
5978
  }
5961
5979
 
5980
+ /* A chip carries its own text colour because it carries its own background.
5981
+ The same chip renders in two places with opposite inherited colours: in the
5982
+ composer tray it inherits the panel's, but on a sent user bubble it inherits
5983
+ the user foreground, which is white on the stock light theme. Against the
5984
+ assistant surface underneath that was a 1.13:1 filename \u2014 invisible, and only
5985
+ the size stayed legible because it sets its own muted colour. Pair the colour
5986
+ with the background it belongs to, and both placements read the same.
5987
+ Overridden below for an errored chip, which must keep its red. */
5962
5988
  .attachment-chip {
5963
5989
  display: inline-flex;
5964
5990
  align-items: center;
5965
5991
  gap: 6px;
5992
+ /* Without this the 100% below caps the content box, so the chip still
5993
+ overflows its container by its own padding and border. Invisible while a
5994
+ character cap kept names short; routine once the container is what bounds
5995
+ the name. */
5996
+ box-sizing: border-box;
5966
5997
  max-width: 100%;
5967
5998
  padding: 4px 8px;
5968
5999
  border: 1px solid var(--_border);
5969
6000
  border-radius: 999px;
5970
6001
  background: var(--_assistant-bg);
6002
+ color: var(--_text);
5971
6003
  font-size: 0.85em;
5972
6004
  position: relative;
5973
6005
  }
@@ -5977,11 +6009,31 @@ var STYLES = `
5977
6009
  color: var(--_danger);
5978
6010
  }
5979
6011
 
6012
+ /* The type mark. Painted from currentColor, so it carries the chip's state
6013
+ with it and turns red along with an errored one; muted by opacity rather
6014
+ than a colour, which is what keeps that true. Sized from the chip's own text
6015
+ rather than --ag-ui-glyph-size, the way an icon holder's glyph takes the
6016
+ holder's size: the composer's 18px buttons would make a chip button-height. */
6017
+ .attachment-chip-icon {
6018
+ display: inline-flex;
6019
+ flex: none;
6020
+ opacity: 0.75;
6021
+ }
6022
+
6023
+ .attachment-chip-icon .glyph {
6024
+ width: 1.25em;
6025
+ height: 1.25em;
6026
+ }
6027
+
6028
+ /* No character cap: the chip is already max-width 100%, so its container is
6029
+ what bounds the name, and a fixed cap only truncated names the chip had room
6030
+ for. min-width: 0 is what lets the flex item shrink past its content, so the
6031
+ ellipsis appears at the container edge instead of the chip overflowing. */
5980
6032
  .attachment-chip-name {
5981
6033
  overflow: hidden;
5982
6034
  text-overflow: ellipsis;
5983
6035
  white-space: nowrap;
5984
- max-width: 14ch;
6036
+ min-width: 0;
5985
6037
  }
5986
6038
 
5987
6039
  .attachment-chip-size {
@@ -8057,14 +8109,17 @@ var AgUiChat = class extends HTMLElement {
8057
8109
  ...this.#toolRegistry.tools()
8058
8110
  ];
8059
8111
  /**
8060
- * Per-run context provider. Defaults to the compact page map (when a
8061
- * {@link getPageMap} provider is set and {@link autoInjectPageMap} is on)
8062
- * plus a one-line manifest of the files attached to the message being sent,
8063
- * so the agent knows which `read_attachment` ids are available.
8112
+ * Per-run context provider. Defaults to the compact page map, when a
8113
+ * {@link getPageMap} provider is set and {@link autoInjectPageMap} is on.
8114
+ *
8115
+ * It used to append a one-line manifest of the message's attachments too.
8116
+ * The server now derives that manifest from the refs riding the messages, so
8117
+ * the client's copy only duplicated it, on exactly the turn a file was
8118
+ * attached. Attachments still reach the agent; they reach it through the
8119
+ * message, which is where they were already.
8064
8120
  */
8065
8121
  getContext = () => [
8066
- ...createPageMapContext(this.getPageMap, this.autoInjectPageMap),
8067
- ...this.#attachmentContext()
8122
+ ...createPageMapContext(this.getPageMap, this.autoInjectPageMap)
8068
8123
  ];
8069
8124
  /**
8070
8125
  * Navigable routes the agent can jump to via the built-in `route.*` tools.
@@ -8196,8 +8251,6 @@ var AgUiChat = class extends HTMLElement {
8196
8251
  #voice = null;
8197
8252
  /** Whether the element is currently in the DOM; gates the connect-time warning. */
8198
8253
  #connected = false;
8199
- /** Refs attached to the message currently being sent (the context manifest). */
8200
- #runAttachments = [];
8201
8254
  #client = null;
8202
8255
  // Seed for the next client. Once one exists it owns the live value (the
8203
8256
  // agent applies STATE_SNAPSHOT / STATE_DELTA into it), so this is only the
@@ -8884,22 +8937,6 @@ var AgUiChat = class extends HTMLElement {
8884
8937
  }
8885
8938
  });
8886
8939
  }
8887
- /** The one-line manifest of the message's attachments, for the run context. */
8888
- #attachmentContext() {
8889
- if (this.#runAttachments.length === 0) {
8890
- return [];
8891
- }
8892
- const lines = this.#runAttachments.map(
8893
- (ref) => `- ${ref.name} (id: ${ref.id}, ${ref.mime || "unknown type"}, ${ref.size} bytes)`
8894
- );
8895
- return [
8896
- {
8897
- description: "Files the user attached to this message",
8898
- value: `${lines.join("\n")}
8899
- Use the read_attachment tool with an id to read a file's contents.`
8900
- }
8901
- ];
8902
- }
8903
8940
  /**
8904
8941
  * When `data-threads-url` is set, route thread enumeration / load / rename /
8905
8942
  * delete through that server endpoint (wrapping the current store as the
@@ -9279,7 +9316,6 @@ Use the read_attachment tool with an id to read a file's contents.`
9279
9316
  this.#toolCards.clear();
9280
9317
  this.#serverSettled.clear();
9281
9318
  this.#initialMessages = [];
9282
- this.#runAttachments = [];
9283
9319
  this.#attachTray?.clear();
9284
9320
  this.#messages.replaceChildren(this.#emptyWrap);
9285
9321
  this.#updateEmptyState();
@@ -9891,7 +9927,6 @@ Use the read_attachment tool with an id to read a file's contents.`
9891
9927
  if (attachments.length > 0) {
9892
9928
  bubble.appendChild(renderAttachmentChips(attachments));
9893
9929
  }
9894
- this.#runAttachments = attachments;
9895
9930
  this.dispatchEvent(
9896
9931
  new CustomEvent(SUBMIT_EVENT, {
9897
9932
  detail: { content, attachments },
@@ -10169,7 +10204,6 @@ Use the read_attachment tool with an id to read a file's contents.`
10169
10204
  this.#hidePending();
10170
10205
  this.#setRunning(false);
10171
10206
  this.#streamingBubble = null;
10172
- this.#runAttachments = [];
10173
10207
  for (const card of this.#toolCards.values()) {
10174
10208
  if (!card.settled) {
10175
10209
  card.settle(TOOL_CALL_STATUS.DONE, this.#strings.noResult);
@@ -10347,7 +10381,7 @@ function setControlValue(el, value) {
10347
10381
  }
10348
10382
 
10349
10383
  // src/version.ts
10350
- var VERSION = "0.22.0";
10384
+ var VERSION = "0.23.0";
10351
10385
  export {
10352
10386
  ATTACHMENT_EVENT,
10353
10387
  AgUiChat,