@tanstack/ai-devtools-core 0.4.3 → 0.4.5

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.
@@ -7221,8 +7221,10 @@ var _tmpl$222 = /* @__PURE__ */ template(`<div><span>System Prompts (<!>)`);
7221
7221
  var _tmpl$23 = /* @__PURE__ */ template(`<div><span>Model Options</span><div>`);
7222
7222
  var _tmpl$24 = /* @__PURE__ */ template(`<div><div><div><span></span><div></div></div><div></div><span>\u25B6</span></div><div><div><div></div></div></div><div><div>`);
7223
7223
  var _tmpl$25 = /* @__PURE__ */ template(`<span>\u{1F3AF} `);
7224
- var _tmpl$26 = /* @__PURE__ */ template(`<div><span>:</span><span></span><span>\u2192</span><span>`);
7225
- var _tmpl$27 = /* @__PURE__ */ template(`<span><span>`);
7224
+ var _tmpl$26 = /* @__PURE__ */ template(`<span title="Cached prompt tokens">\u{1F4BE} `);
7225
+ var _tmpl$27 = /* @__PURE__ */ template(`<span title="Reasoning tokens">\u{1F9E0} `);
7226
+ var _tmpl$28 = /* @__PURE__ */ template(`<div><span>:</span><span></span><span>\u2192</span><span>`);
7227
+ var _tmpl$29 = /* @__PURE__ */ template(`<span><span>`);
7226
7228
  function getApprovalStatus(toolCall) {
7227
7229
  if (toolCall.approvalApproved === true || toolCall.state === "approved") {
7228
7230
  return "approved";
@@ -8150,6 +8152,28 @@ var IterationCard = (props) => {
8150
8152
  return _el$94;
8151
8153
  })()
8152
8154
  }), null);
8155
+ insert(_el$67, createComponent(Show, {
8156
+ get when() {
8157
+ return iter().usage?.promptTokensDetails?.cachedTokens;
8158
+ },
8159
+ children: (cached) => (() => {
8160
+ var _el$96 = _tmpl$26(); _el$96.firstChild;
8161
+ insert(_el$96, () => cached().toLocaleString(), null);
8162
+ effect(() => className(_el$96, `${s().badge} ${s().badgeUsage}`));
8163
+ return _el$96;
8164
+ })()
8165
+ }), null);
8166
+ insert(_el$67, createComponent(Show, {
8167
+ get when() {
8168
+ return iter().usage?.completionTokensDetails?.reasoningTokens;
8169
+ },
8170
+ children: (reasoning) => (() => {
8171
+ var _el$98 = _tmpl$27(); _el$98.firstChild;
8172
+ insert(_el$98, () => reasoning().toLocaleString(), null);
8173
+ effect(() => className(_el$98, `${s().badge} ${s().badgeUsage}`));
8174
+ return _el$98;
8175
+ })()
8176
+ }), null);
8153
8177
  insert(_el$67, createComponent(Show, {
8154
8178
  get when() {
8155
8179
  return isActive();
@@ -8171,17 +8195,17 @@ var IterationCard = (props) => {
8171
8195
  return configDiffs();
8172
8196
  },
8173
8197
  children: (diff) => (() => {
8174
- var _el$96 = _tmpl$26(), _el$97 = _el$96.firstChild, _el$98 = _el$97.firstChild, _el$99 = _el$97.nextSibling, _el$100 = _el$99.nextSibling, _el$101 = _el$100.nextSibling;
8175
- insert(_el$97, () => diff.key, _el$98);
8176
- insert(_el$99, () => diff.from);
8177
- insert(_el$101, () => diff.to);
8198
+ var _el$100 = _tmpl$28(), _el$101 = _el$100.firstChild, _el$102 = _el$101.firstChild, _el$103 = _el$101.nextSibling, _el$104 = _el$103.nextSibling, _el$105 = _el$104.nextSibling;
8199
+ insert(_el$101, () => diff.key, _el$102);
8200
+ insert(_el$103, () => diff.from);
8201
+ insert(_el$105, () => diff.to);
8178
8202
  effect((_p$) => {
8179
8203
  var _v$58 = s().configDiffRow, _v$59 = s().configDiffKey, _v$60 = s().configDiffFrom, _v$61 = s().configDiffArrow, _v$62 = s().configDiffTo;
8180
- _v$58 !== _p$.e && className(_el$96, _p$.e = _v$58);
8181
- _v$59 !== _p$.t && className(_el$97, _p$.t = _v$59);
8182
- _v$60 !== _p$.a && className(_el$99, _p$.a = _v$60);
8183
- _v$61 !== _p$.o && className(_el$100, _p$.o = _v$61);
8184
- _v$62 !== _p$.i && className(_el$101, _p$.i = _v$62);
8204
+ _v$58 !== _p$.e && className(_el$100, _p$.e = _v$58);
8205
+ _v$59 !== _p$.t && className(_el$101, _p$.t = _v$59);
8206
+ _v$60 !== _p$.a && className(_el$103, _p$.a = _v$60);
8207
+ _v$61 !== _p$.o && className(_el$104, _p$.o = _v$61);
8208
+ _v$62 !== _p$.i && className(_el$105, _p$.i = _v$62);
8185
8209
  return _p$;
8186
8210
  }, {
8187
8211
  e: void 0,
@@ -8190,7 +8214,7 @@ var IterationCard = (props) => {
8190
8214
  o: void 0,
8191
8215
  i: void 0
8192
8216
  });
8193
- return _el$96;
8217
+ return _el$100;
8194
8218
  })()
8195
8219
  }));
8196
8220
  effect((_p$) => {
@@ -8218,19 +8242,19 @@ var IterationCard = (props) => {
8218
8242
  return toolNames();
8219
8243
  },
8220
8244
  children: (name) => (() => {
8221
- var _el$102 = _tmpl$27(), _el$103 = _el$102.firstChild;
8222
- insert(_el$102, name, _el$103);
8223
- insert(_el$103, () => toolInvocationCounts().get(name) || 0);
8245
+ var _el$106 = _tmpl$29(), _el$107 = _el$106.firstChild;
8246
+ insert(_el$106, name, _el$107);
8247
+ insert(_el$107, () => toolInvocationCounts().get(name) || 0);
8224
8248
  effect((_p$) => {
8225
8249
  var _v$63 = s().configToolChip, _v$64 = s().configToolChipCount;
8226
- _v$63 !== _p$.e && className(_el$102, _p$.e = _v$63);
8227
- _v$64 !== _p$.t && className(_el$103, _p$.t = _v$64);
8250
+ _v$63 !== _p$.e && className(_el$106, _p$.e = _v$63);
8251
+ _v$64 !== _p$.t && className(_el$107, _p$.t = _v$64);
8228
8252
  return _p$;
8229
8253
  }, {
8230
8254
  e: void 0,
8231
8255
  t: void 0
8232
8256
  });
8233
- return _el$102;
8257
+ return _el$106;
8234
8258
  })()
8235
8259
  }));
8236
8260
  effect((_p$) => {
@@ -8424,8 +8448,8 @@ var IterationCard = (props) => {
8424
8448
  delegateEvents(["click"]);
8425
8449
 
8426
8450
  // src/components/conversation/IterationTimeline.tsx
8427
- var _tmpl$28 = /* @__PURE__ */ template(`<div>`);
8428
- var _tmpl$29 = /* @__PURE__ */ template(`<div>No iterations recorded`);
8451
+ var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
8452
+ var _tmpl$210 = /* @__PURE__ */ template(`<div>No iterations recorded`);
8429
8453
  var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
8430
8454
  var _tmpl$43 = /* @__PURE__ */ template(`<pre>`);
8431
8455
  var _tmpl$53 = /* @__PURE__ */ template(`<div><div><span>#</span><span>`);
@@ -8484,20 +8508,20 @@ var IterationTimeline = (props) => {
8484
8508
  return result;
8485
8509
  });
8486
8510
  return (() => {
8487
- var _el$ = _tmpl$28();
8511
+ var _el$ = _tmpl$30();
8488
8512
  insert(_el$, createComponent(Show, {
8489
8513
  get when() {
8490
8514
  return props.iterations.length > 0;
8491
8515
  },
8492
8516
  get fallback() {
8493
8517
  return (() => {
8494
- var _el$3 = _tmpl$29();
8518
+ var _el$3 = _tmpl$210();
8495
8519
  effect(() => className(_el$3, s().noIterations));
8496
8520
  return _el$3;
8497
8521
  })();
8498
8522
  },
8499
8523
  get children() {
8500
- var _el$2 = _tmpl$28();
8524
+ var _el$2 = _tmpl$30();
8501
8525
  insert(_el$2, createComponent(Index, {
8502
8526
  get each() {
8503
8527
  return groups();
@@ -9028,7 +9052,7 @@ var UserMessageGroupCard = (props) => {
9028
9052
  })();
9029
9053
  };
9030
9054
  delegateEvents(["click"]);
9031
- var _tmpl$30 = /* @__PURE__ */ template(`<form data-testid=ai-devtools-fixture-save-popover><label><span>Fixture name</span><input data-testid=ai-devtools-fixture-name-input></label><div><button data-testid=ai-devtools-fixture-save-confirm type=submit>Save</button><button data-testid=ai-devtools-fixture-save-cancel type=button>Cancel`);
9055
+ var _tmpl$31 = /* @__PURE__ */ template(`<form data-testid=ai-devtools-fixture-save-popover><label><span>Fixture name</span><input data-testid=ai-devtools-fixture-name-input></label><div><button data-testid=ai-devtools-fixture-save-confirm type=submit>Save</button><button data-testid=ai-devtools-fixture-save-cancel type=button>Cancel`);
9032
9056
  var FixtureNamePopover = (props) => {
9033
9057
  const styles = useStyles();
9034
9058
  const [name, setName] = createSignal(props.defaultName);
@@ -9043,7 +9067,7 @@ var FixtureNamePopover = (props) => {
9043
9067
  props.onSave(trimmedName);
9044
9068
  };
9045
9069
  return (() => {
9046
- var _el$ = _tmpl$30(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
9070
+ var _el$ = _tmpl$31(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
9047
9071
  _el$.addEventListener("submit", (event) => {
9048
9072
  event.preventDefault();
9049
9073
  handleSave();
@@ -9077,9 +9101,9 @@ var FixtureNamePopover = (props) => {
9077
9101
  })();
9078
9102
  };
9079
9103
  delegateEvents(["input", "click"]);
9080
- var _tmpl$31 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-tool-fixture-form><div>Tool Fixture</div><div></div><label><span>Output JSON</span><textarea></textarea></label><div><button data-testid=ai-devtools-tool-fire type=button>Fire</button><button data-testid=ai-devtools-tool-save type=button>Save`);
9081
- var _tmpl$210 = /* @__PURE__ */ template(`<label><span>Input JSON</span><textarea>`);
9082
- var _tmpl$34 = /* @__PURE__ */ template(`<span>*`);
9104
+ var _tmpl$34 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-tool-fixture-form><div>Tool Fixture</div><div></div><label><span>Output JSON</span><textarea></textarea></label><div><button data-testid=ai-devtools-tool-fire type=button>Fire</button><button data-testid=ai-devtools-tool-save type=button>Save`);
9105
+ var _tmpl$211 = /* @__PURE__ */ template(`<label><span>Input JSON</span><textarea>`);
9106
+ var _tmpl$35 = /* @__PURE__ */ template(`<span>*`);
9083
9107
  var _tmpl$44 = /* @__PURE__ */ template(`<span>`);
9084
9108
  var _tmpl$54 = /* @__PURE__ */ template(`<label><span>`);
9085
9109
  var _tmpl$64 = /* @__PURE__ */ template(`<div>`);
@@ -9152,7 +9176,7 @@ var ToolFixtureForm = (props) => {
9152
9176
  setPendingSaveName(null);
9153
9177
  };
9154
9178
  return (() => {
9155
- var _el$ = _tmpl$31(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling;
9179
+ var _el$ = _tmpl$34(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling;
9156
9180
  insert(_el$3, () => props.tool.description || props.tool.name);
9157
9181
  insert(_el$, createComponent(Show, {
9158
9182
  get when() {
@@ -9160,7 +9184,7 @@ var ToolFixtureForm = (props) => {
9160
9184
  },
9161
9185
  get fallback() {
9162
9186
  return (() => {
9163
- var _el$0 = _tmpl$210(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling;
9187
+ var _el$0 = _tmpl$211(), _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling;
9164
9188
  _el$10.$$input = (event) => setRawInput(event.currentTarget.value);
9165
9189
  setAttribute(_el$10, "spellcheck", false);
9166
9190
  effect((_p$) => {
@@ -9191,7 +9215,7 @@ var ToolFixtureForm = (props) => {
9191
9215
  return field.required;
9192
9216
  },
9193
9217
  get children() {
9194
- var _el$13 = _tmpl$34();
9218
+ var _el$13 = _tmpl$35();
9195
9219
  effect(() => className(_el$13, styles().hookDetails.requiredMark));
9196
9220
  return _el$13;
9197
9221
  }
@@ -9483,9 +9507,9 @@ function isRecord2(value) {
9483
9507
  function normalizeText(value) {
9484
9508
  return value?.trim() ?? "";
9485
9509
  }
9486
- var _tmpl$35 = /* @__PURE__ */ template(`<div>`);
9487
- var _tmpl$211 = /* @__PURE__ */ template(`<section><div>Runs</div><div>No generation runs yet.`);
9488
- var _tmpl$36 = /* @__PURE__ */ template(`<div>No output yet.`);
9510
+ var _tmpl$36 = /* @__PURE__ */ template(`<div>`);
9511
+ var _tmpl$212 = /* @__PURE__ */ template(`<section><div>Runs</div><div>No generation runs yet.`);
9512
+ var _tmpl$37 = /* @__PURE__ */ template(`<div>No output yet.`);
9489
9513
  var _tmpl$45 = /* @__PURE__ */ template(`<article><header><div><div></div><div></div></div><div><span></span><span></span></div></header><div><div></div><div>`);
9490
9514
  var _tmpl$55 = /* @__PURE__ */ template(`<div role=button tabindex=0 data-testid=ai-devtools-generation-output><div></div><div><span></span><span>`);
9491
9515
  var _tmpl$65 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-output-modal-backdrop role=presentation><section data-testid=ai-devtools-output-modal role=dialog aria-modal=true><header><div><div></div><div></div></div><button type=button data-testid=ai-devtools-output-modal-close aria-label="Close output preview">x</button></header><div>`);
@@ -9514,7 +9538,7 @@ var GenerationPanel = (props) => {
9514
9538
  },
9515
9539
  get fallback() {
9516
9540
  return (() => {
9517
- var _el$2 = _tmpl$211(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
9541
+ var _el$2 = _tmpl$212(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
9518
9542
  effect((_p$) => {
9519
9543
  var _v$ = styles().hookDetails.section, _v$2 = styles().hookDetails.sectionTitle, _v$3 = styles().hookDetails.emptySmall;
9520
9544
  _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
@@ -9530,7 +9554,7 @@ var GenerationPanel = (props) => {
9530
9554
  })();
9531
9555
  },
9532
9556
  get children() {
9533
- var _el$ = _tmpl$35();
9557
+ var _el$ = _tmpl$36();
9534
9558
  use((element) => {
9535
9559
  runsContainer = element;
9536
9560
  }, _el$);
@@ -9580,13 +9604,13 @@ var GenerationPreview = (props) => {
9580
9604
  },
9581
9605
  get fallback() {
9582
9606
  return (() => {
9583
- var _el$6 = _tmpl$36();
9607
+ var _el$6 = _tmpl$37();
9584
9608
  effect(() => className(_el$6, styles().hookDetails.emptySmall));
9585
9609
  return _el$6;
9586
9610
  })();
9587
9611
  },
9588
9612
  get children() {
9589
- var _el$5 = _tmpl$35();
9613
+ var _el$5 = _tmpl$36();
9590
9614
  insert(_el$5, createComponent(For, {
9591
9615
  get each() {
9592
9616
  return outputs();
@@ -9708,7 +9732,7 @@ var GenerationRunCard = (props) => {
9708
9732
  return props.run.error;
9709
9733
  },
9710
9734
  children: (message) => (() => {
9711
- var _el$16 = _tmpl$35();
9735
+ var _el$16 = _tmpl$36();
9712
9736
  insert(_el$16, message);
9713
9737
  effect(() => className(_el$16, styles().hookDetails.errorText));
9714
9738
  return _el$16;
@@ -9885,7 +9909,7 @@ var OutputContent = (props) => {
9885
9909
  },
9886
9910
  get fallback() {
9887
9911
  return (() => {
9888
- var _el$31 = _tmpl$35();
9912
+ var _el$31 = _tmpl$36();
9889
9913
  insert(_el$31, createComponent(JsonTree, {
9890
9914
  get value() {
9891
9915
  return props.output.value;
@@ -9902,7 +9926,7 @@ var OutputContent = (props) => {
9902
9926
  })();
9903
9927
  },
9904
9928
  get children() {
9905
- var _el$30 = _tmpl$35();
9929
+ var _el$30 = _tmpl$36();
9906
9930
  insert(_el$30, () => props.output.text);
9907
9931
  effect(() => className(_el$30, props.compact ? styles().hookDetails.outputTileText : styles().hookDetails.outputModalText));
9908
9932
  return _el$30;
@@ -10038,7 +10062,7 @@ var ProgressMeter = (props) => {
10038
10062
  var JsonBlock = (props) => {
10039
10063
  const styles = useStyles();
10040
10064
  return (() => {
10041
- var _el$48 = _tmpl$35();
10065
+ var _el$48 = _tmpl$36();
10042
10066
  insert(_el$48, createComponent(JsonTree, {
10043
10067
  get value() {
10044
10068
  return props.value;
@@ -10318,9 +10342,9 @@ function isRecord3(value) {
10318
10342
  delegateEvents(["click"]);
10319
10343
 
10320
10344
  // src/components/hooks/HookDetails.tsx
10321
- var _tmpl$37 = /* @__PURE__ */ template(`<aside data-testid=ai-devtools-preview-pane><div>`);
10322
- var _tmpl$212 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-hook-detail><nav data-testid=ai-devtools-hook-tabs></nav><div><main data-testid=ai-devtools-primary-pane>`);
10323
- var _tmpl$38 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-dashboard-overview><header><div><div>Hooks Dashboard</div><div>Select a hook from the left or open one of the active hooks below.</div></div></header><div></div><div>`);
10345
+ var _tmpl$38 = /* @__PURE__ */ template(`<aside data-testid=ai-devtools-preview-pane><div>`);
10346
+ var _tmpl$213 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-hook-detail><nav data-testid=ai-devtools-hook-tabs></nav><div><main data-testid=ai-devtools-primary-pane>`);
10347
+ var _tmpl$39 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-dashboard-overview><header><div><div>Hooks Dashboard</div><div>Select a hook from the left or open one of the active hooks below.</div></div></header><div></div><div>`);
10324
10348
  var _tmpl$46 = /* @__PURE__ */ template(`<div>Open a page with TanStack AI hooks to inspect live state.`);
10325
10349
  var _tmpl$56 = /* @__PURE__ */ template(`<section data-testid=ai-devtools-overview-category><div><span></span><span>`);
10326
10350
  var _tmpl$66 = /* @__PURE__ */ template(`<span>running`);
@@ -10340,7 +10364,7 @@ var _tmpl$173 = /* @__PURE__ */ template(`<div><button type=button data-testid=a
10340
10364
  var _tmpl$182 = /* @__PURE__ */ template(`<div><span>`);
10341
10365
  var _tmpl$192 = /* @__PURE__ */ template(`<div><span></span><div>`);
10342
10366
  var _tmpl$202 = /* @__PURE__ */ template(`<div>No messages yet. Start a conversation to see messages here.`);
10343
- var _tmpl$213 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-tools><div></div><div>`);
10367
+ var _tmpl$214 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-tools><div></div><div>`);
10344
10368
  var _tmpl$223 = /* @__PURE__ */ template(`<div>No tools.`);
10345
10369
  var _tmpl$232 = /* @__PURE__ */ template(`<span>approval`);
10346
10370
  var _tmpl$242 = /* @__PURE__ */ template(`<button type=button data-testid=ai-devtools-tool-row><span>`);
@@ -10424,7 +10448,7 @@ var HookDetails = () => {
10424
10448
  });
10425
10449
  },
10426
10450
  children: (activeHook) => (() => {
10427
- var _el$ = _tmpl$212(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
10451
+ var _el$ = _tmpl$213(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
10428
10452
  insert(_el$, createComponent(HookHeader, {
10429
10453
  get hook() {
10430
10454
  return activeHook();
@@ -10548,7 +10572,7 @@ var HookDetails = () => {
10548
10572
  return showSecondaryPane();
10549
10573
  },
10550
10574
  get children() {
10551
- var _el$5 = _tmpl$37(), _el$6 = _el$5.firstChild;
10575
+ var _el$5 = _tmpl$38(), _el$6 = _el$5.firstChild;
10552
10576
  _el$5.addEventListener("mouseleave", () => setHoverTarget(null));
10553
10577
  _el$5.$$mouseover = (event) => setHoverTargetFromEvent(event, "preview", setHoverTarget);
10554
10578
  use((el) => {
@@ -10635,7 +10659,7 @@ var HookOverview = (props) => {
10635
10659
  })();
10636
10660
  },
10637
10661
  get children() {
10638
- var _el$7 = _tmpl$38(), _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$8.nextSibling, _el$11 = _el$10.nextSibling;
10662
+ var _el$7 = _tmpl$39(), _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$8.nextSibling, _el$11 = _el$10.nextSibling;
10639
10663
  insert(_el$10, createComponent(OverviewMetric, {
10640
10664
  label: "active hooks",
10641
10665
  get value() {
@@ -11420,7 +11444,7 @@ var ToolsView = (props) => {
11420
11444
  const selectedTool = createMemo(() => props.hook.tools.find((tool) => tool.name === selectedToolName()));
11421
11445
  const savedFixtures = createMemo(() => state.hooks.fixtures.filter((fixture) => fixture.hookId === props.hook.id || !!props.hook.threadId && fixture.threadId === props.hook.threadId).sort((a, b) => b.createdAt - a.createdAt));
11422
11446
  return (() => {
11423
- var _el$76 = _tmpl$213(), _el$77 = _el$76.firstChild, _el$78 = _el$77.nextSibling;
11447
+ var _el$76 = _tmpl$214(), _el$77 = _el$76.firstChild, _el$78 = _el$77.nextSibling;
11424
11448
  insert(_el$77, createComponent(Show, {
11425
11449
  get when() {
11426
11450
  return props.hook.tools.length > 0;
@@ -12017,7 +12041,7 @@ function formatTime2(timestamp) {
12017
12041
  delegateEvents(["mouseover", "click"]);
12018
12042
 
12019
12043
  // src/components/Shell.tsx
12020
- var _tmpl$39 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-panel><div><div data-testid=ai-devtools-left-panel style=min-width:150px;max-width:800px><div>AI Hooks</div></div><div></div><div data-testid=ai-devtools-right-panel style=flex:1>`);
12044
+ var _tmpl$40 = /* @__PURE__ */ template(`<div data-testid=ai-devtools-panel><div><div data-testid=ai-devtools-left-panel style=min-width:150px;max-width:800px><div>AI Hooks</div></div><div></div><div data-testid=ai-devtools-right-panel style=flex:1>`);
12021
12045
  function Devtools(props) {
12022
12046
  return createComponent(ThemeContextProvider, {
12023
12047
  get theme() {
@@ -12099,7 +12123,7 @@ function DevtoolsContent() {
12099
12123
  });
12100
12124
  return createComponent(MainPanel, {
12101
12125
  get children() {
12102
- var _el$ = _tmpl$39(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling;
12126
+ var _el$ = _tmpl$40(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling;
12103
12127
  insert(_el$, createComponent(Header, {
12104
12128
  get children() {
12105
12129
  return createComponent(HeaderLogo, {
@@ -2,7 +2,7 @@ import { constructCoreClass } from '@tanstack/devtools-utils/solid/class';
2
2
 
3
3
  // src/core.ts
4
4
  var [AiDevtoolsCore, AiDevtoolsCoreNoOp] = constructCoreClass(
5
- () => import('./Shell/DKCFIT6H.js')
5
+ () => import('./Shell/SPYBPW3X.js')
6
6
  );
7
7
 
8
8
  export { AiDevtoolsCore };
@@ -2,7 +2,7 @@ import { constructCoreClass } from '@tanstack/devtools-utils/solid/class';
2
2
 
3
3
  // src/core.ts
4
4
  var [AiDevtoolsCore, AiDevtoolsCoreNoOp] = constructCoreClass(
5
- () => import('./Shell/SLOX2TPU.js')
5
+ () => import('./Shell/3ITTEC6O.js')
6
6
  );
7
7
 
8
8
  export { AiDevtoolsCore };
@@ -2,7 +2,7 @@ import { constructCoreClass } from '@tanstack/devtools-utils/solid/class';
2
2
 
3
3
  // src/core.ts
4
4
  var [AiDevtoolsCore, AiDevtoolsCoreNoOp] = constructCoreClass(
5
- () => import('./Shell/Z6HLJOVZ.js')
5
+ () => import('./Shell/54VAGOHT.js')
6
6
  );
7
7
 
8
8
  export { AiDevtoolsCore };
package/dist/server.js CHANGED
@@ -2,7 +2,7 @@ import { constructCoreClass } from '@tanstack/devtools-utils/solid/class';
2
2
 
3
3
  // src/core.ts
4
4
  var [AiDevtoolsCore, AiDevtoolsCoreNoOp] = constructCoreClass(
5
- () => import('./Shell/Z6HLJOVZ.js')
5
+ () => import('./Shell/54VAGOHT.js')
6
6
  );
7
7
 
8
8
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/ai-devtools-core",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Core TanStack AI Devtools plugin for inspecting chat messages, tool calls, streams, and errors.",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -76,8 +76,8 @@
76
76
  "@tanstack/devtools-utils": "^0.4.0",
77
77
  "goober": "^2.1.18",
78
78
  "solid-js": "^1.9.10",
79
- "@tanstack/ai": "0.24.0",
80
- "@tanstack/ai-event-client": "0.4.3"
79
+ "@tanstack/ai": "0.26.0",
80
+ "@tanstack/ai-event-client": "0.5.1"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@vitest/coverage-v8": "4.0.14",
@@ -858,6 +858,26 @@ export const IterationCard: Component<IterationCardProps> = (props) => {
858
858
  </span>
859
859
  )}
860
860
  </Show>
861
+ <Show when={iter().usage?.promptTokensDetails?.cachedTokens}>
862
+ {(cached) => (
863
+ <span
864
+ class={`${s().badge} ${s().badgeUsage}`}
865
+ title="Cached prompt tokens"
866
+ >
867
+ 💾 {cached().toLocaleString()}
868
+ </span>
869
+ )}
870
+ </Show>
871
+ <Show when={iter().usage?.completionTokensDetails?.reasoningTokens}>
872
+ {(reasoning) => (
873
+ <span
874
+ class={`${s().badge} ${s().badgeUsage}`}
875
+ title="Reasoning tokens"
876
+ >
877
+ 🧠 {reasoning().toLocaleString()}
878
+ </span>
879
+ )}
880
+ </Show>
861
881
  <Show when={isActive()}>
862
882
  <span class={`${s().badge} ${s().badgeDuration}`}>⟳ streaming</span>
863
883
  </Show>
@@ -14,7 +14,7 @@ import {
14
14
  createClientToolCallMessage,
15
15
  shouldSkipClientAssistantPlaceholder,
16
16
  } from './message-event-utils'
17
- import type { ContentPartSource } from '@tanstack/ai'
17
+ import type { ContentPartSource, TokenUsage } from '@tanstack/ai'
18
18
  import type {
19
19
  DevtoolsToolFixtureApplyEvent,
20
20
  RunLifecycleEvent,
@@ -69,11 +69,8 @@ export interface ToolCall {
69
69
  duration?: number
70
70
  }
71
71
 
72
- interface TokenUsage {
73
- promptTokens: number
74
- completionTokens: number
75
- totalTokens: number
76
- }
72
+ // Re-export TokenUsage from @tanstack/ai for external consumers
73
+ export type { TokenUsage }
77
74
 
78
75
  export interface Message {
79
76
  id: string
@@ -5,4 +5,5 @@ export type {
5
5
  Conversation,
6
6
  Iteration,
7
7
  MiddlewareEvent,
8
+ TokenUsage,
8
9
  } from './ai-context'