@automattic/agenttic-client 0.1.21 → 0.1.23

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.
@@ -0,0 +1,18 @@
1
+ const t = (n, ...i) => {
2
+ o() && console.log(`[agenttic-client] ${n}`, ...i);
3
+ };
4
+ function o() {
5
+ var n;
6
+ return typeof globalThis < "u" && "window" in globalThis && ((n = globalThis.window) == null ? void 0 : n.DEBUG) === "agenttic-client";
7
+ }
8
+ function l(n) {
9
+ return JSON.stringify(n, null, 2);
10
+ }
11
+ function e(n, ...i) {
12
+ console.log(`[agenttic-client] ${n}`, ...i);
13
+ }
14
+ export {
15
+ e as a,
16
+ l as f,
17
+ t as l
18
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"MockSalesGraph.d.ts","sourceRoot":"","sources":["../../src/mocks/MockSalesGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,SAAS;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,UAAU,mBAAmB;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAE,mBAAmB,CAkCzD,CAAC"}
1
+ {"version":3,"file":"MockSalesGraph.d.ts","sourceRoot":"","sources":["../../src/mocks/MockSalesGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,SAAS;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,UAAU,mBAAmB;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAE,mBAAmB,CA8BzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mockTools.d.ts","sourceRoot":"","sources":["../../src/mocks/mockTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,eAAO,MAAM,cAAc,GAAK,YAAY,CAAE,OAAO,EAAE,GAAG,KAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA+FzD,MAAM,QACR,GAAG,aACE,MAAM,cACL,MAAM;;;;CA8CpB,CAAC"}
1
+ {"version":3,"file":"mockTools.d.ts","sourceRoot":"","sources":["../../src/mocks/mockTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,eAAO,MAAM,cAAc,GAAK,YAAY,CAAE,OAAO,EAAE,GAAG,KAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA+FzD,MAAM,QACR,GAAG,aACE,MAAM,cACL,MAAM;;;;CA8CpB,CAAC"}
package/dist/mocks.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { l as cr } from "./logger-aKHbTlwk.js";
1
2
  import Te from "react";
2
- const gr = () => ({
3
+ const yr = () => ({
3
4
  selectedBlockClientId: "qwu2",
4
5
  currentPageContent: [
5
6
  {
@@ -195,7 +196,7 @@ const gr = () => ({
195
196
  ]
196
197
  }
197
198
  ]
198
- }), mr = (h) => ({
199
+ }), br = (w) => ({
199
200
  abilities: [
200
201
  {
201
202
  name: "demo/get-user-info",
@@ -229,10 +230,10 @@ const gr = () => ({
229
230
  idempotent: !0
230
231
  }
231
232
  },
232
- callback: async (_) => ({
233
+ callback: async (b) => ({
233
234
  name: "Demo User",
234
235
  email: "demo@example.com",
235
- preferences: _.includePreferences ? { theme: "dark", language: "en" } : void 0
236
+ preferences: b.includePreferences ? { theme: "dark", language: "en" } : void 0
236
237
  })
237
238
  }
238
239
  ],
@@ -275,26 +276,26 @@ const gr = () => ({
275
276
  }
276
277
  }
277
278
  ],
278
- executeTool: async (_, c, w, f) => {
279
- switch (console.log(`Executing tool: ${_}`, {
279
+ executeTool: async (b, c, m, E) => {
280
+ switch (cr("Executing tool: %s with args: %O", b, {
280
281
  args: c,
281
- messageId: w,
282
- toolCallId: f
283
- }), _) {
282
+ messageId: m,
283
+ toolCallId: E
284
+ }), b) {
284
285
  case "display_graph":
285
286
  if (!c.title || !c.data)
286
287
  return {
287
288
  result: "Error: Title and data are required for graph display",
288
289
  returnToAgent: !0
289
290
  };
290
- const { MockSalesGraph: E } = await Promise.resolve().then(() => pr);
291
- return h({
291
+ const { MockSalesGraph: k } = await Promise.resolve().then(() => vr);
292
+ return w({
292
293
  id: crypto.randomUUID(),
293
294
  role: "agent",
294
295
  content: [
295
296
  {
296
297
  type: "component",
297
- component: E,
298
+ component: k,
298
299
  componentProps: {
299
300
  title: c.title,
300
301
  data: c.data,
@@ -323,18 +324,18 @@ var H = { exports: {} }, F = {};
323
324
  * LICENSE file in the root directory of this source tree.
324
325
  */
325
326
  var ke;
326
- function cr() {
327
+ function fr() {
327
328
  if (ke) return F;
328
329
  ke = 1;
329
- var h = Te, y = Symbol.for("react.element"), _ = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, w = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
330
- function E(C, d, P) {
331
- var m, R = {}, T = null, V = null;
332
- P !== void 0 && (T = "" + P), d.key !== void 0 && (T = "" + d.key), d.ref !== void 0 && (V = d.ref);
333
- for (m in d) c.call(d, m) && !f.hasOwnProperty(m) && (R[m] = d[m]);
334
- if (C && C.defaultProps) for (m in d = C.defaultProps, d) R[m] === void 0 && (R[m] = d[m]);
335
- return { $$typeof: y, type: C, key: T, ref: V, props: R, _owner: w.current };
330
+ var w = Te, h = Symbol.for("react.element"), b = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, m = w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
331
+ function k(C, f, P) {
332
+ var g, _ = {}, T = null, V = null;
333
+ P !== void 0 && (T = "" + P), f.key !== void 0 && (T = "" + f.key), f.ref !== void 0 && (V = f.ref);
334
+ for (g in f) c.call(f, g) && !E.hasOwnProperty(g) && (_[g] = f[g]);
335
+ if (C && C.defaultProps) for (g in f = C.defaultProps, f) _[g] === void 0 && (_[g] = f[g]);
336
+ return { $$typeof: h, type: C, key: T, ref: V, props: _, _owner: m.current };
336
337
  }
337
- return F.Fragment = _, F.jsx = E, F.jsxs = E, F;
338
+ return F.Fragment = b, F.jsx = k, F.jsxs = k, F;
338
339
  }
339
340
  var $ = {};
340
341
  /**
@@ -347,17 +348,17 @@ var $ = {};
347
348
  * LICENSE file in the root directory of this source tree.
348
349
  */
349
350
  var Ce;
350
- function fr() {
351
+ function dr() {
351
352
  return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
352
- var h = Te, y = Symbol.for("react.element"), _ = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), E = Symbol.for("react.provider"), C = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), Q = Symbol.iterator, Se = "@@iterator";
353
+ var w = Te, h = Symbol.for("react.element"), b = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), C = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), Q = Symbol.iterator, Se = "@@iterator";
353
354
  function Oe(e) {
354
355
  if (e === null || typeof e != "object")
355
356
  return null;
356
357
  var r = Q && e[Q] || e[Se];
357
358
  return typeof r == "function" ? r : null;
358
359
  }
359
- var j = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
360
- function p(e) {
360
+ var j = w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
361
+ function d(e) {
361
362
  {
362
363
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
363
364
  t[n - 1] = arguments[n];
@@ -377,7 +378,7 @@ function fr() {
377
378
  var je = !1, xe = !1, Ie = !1, De = !1, Ae = !1, Z;
378
379
  Z = Symbol.for("react.module.reference");
379
380
  function Fe(e) {
380
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === f || Ae || e === w || e === P || e === m || De || e === V || je || xe || Ie || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === R || e.$$typeof === E || e.$$typeof === C || e.$$typeof === d || // This needs to include all possible module reference object
381
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === E || Ae || e === m || e === P || e === g || De || e === V || je || xe || Ie || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === _ || e.$$typeof === k || e.$$typeof === C || e.$$typeof === f || // This needs to include all possible module reference object
381
382
  // types supported by any Flight configuration anywhere since
382
383
  // we don't know which Flight build this will end up being used
383
384
  // with.
@@ -393,25 +394,25 @@ function fr() {
393
394
  function ee(e) {
394
395
  return e.displayName || "Context";
395
396
  }
396
- function k(e) {
397
+ function R(e) {
397
398
  if (e == null)
398
399
  return null;
399
- if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
400
+ if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
400
401
  return e.displayName || e.name || null;
401
402
  if (typeof e == "string")
402
403
  return e;
403
404
  switch (e) {
404
405
  case c:
405
406
  return "Fragment";
406
- case _:
407
+ case b:
407
408
  return "Portal";
408
- case f:
409
+ case E:
409
410
  return "Profiler";
410
- case w:
411
+ case m:
411
412
  return "StrictMode";
412
413
  case P:
413
414
  return "Suspense";
414
- case m:
415
+ case g:
415
416
  return "SuspenseList";
416
417
  }
417
418
  if (typeof e == "object")
@@ -419,18 +420,18 @@ function fr() {
419
420
  case C:
420
421
  var r = e;
421
422
  return ee(r) + ".Consumer";
422
- case E:
423
+ case k:
423
424
  var t = e;
424
425
  return ee(t._context) + ".Provider";
425
- case d:
426
+ case f:
426
427
  return $e(e, e.render, "ForwardRef");
427
- case R:
428
+ case _:
428
429
  var n = e.displayName || null;
429
- return n !== null ? n : k(e.type) || "Memo";
430
+ return n !== null ? n : R(e.type) || "Memo";
430
431
  case T: {
431
432
  var o = e, s = o._payload, i = o._init;
432
433
  try {
433
- return k(i(s));
434
+ return R(i(s));
434
435
  } catch {
435
436
  return null;
436
437
  }
@@ -497,7 +498,7 @@ function fr() {
497
498
  })
498
499
  });
499
500
  }
500
- D < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
501
+ D < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
501
502
  }
502
503
  }
503
504
  var L = j.ReactCurrentDispatcher, N;
@@ -545,40 +546,40 @@ function fr() {
545
546
  }), typeof Reflect == "object" && Reflect.construct) {
546
547
  try {
547
548
  Reflect.construct(i, []);
548
- } catch (g) {
549
- n = g;
549
+ } catch (v) {
550
+ n = v;
550
551
  }
551
552
  Reflect.construct(e, [], i);
552
553
  } else {
553
554
  try {
554
555
  i.call();
555
- } catch (g) {
556
- n = g;
556
+ } catch (v) {
557
+ n = v;
557
558
  }
558
559
  e.call(i.prototype);
559
560
  }
560
561
  } else {
561
562
  try {
562
563
  throw Error();
563
- } catch (g) {
564
- n = g;
564
+ } catch (v) {
565
+ n = v;
565
566
  }
566
567
  e();
567
568
  }
568
- } catch (g) {
569
- if (g && n && typeof g.stack == "string") {
570
- for (var a = g.stack.split(`
571
- `), v = n.stack.split(`
572
- `), l = a.length - 1, u = v.length - 1; l >= 1 && u >= 0 && a[l] !== v[u]; )
569
+ } catch (v) {
570
+ if (v && n && typeof v.stack == "string") {
571
+ for (var a = v.stack.split(`
572
+ `), p = n.stack.split(`
573
+ `), l = a.length - 1, u = p.length - 1; l >= 1 && u >= 0 && a[l] !== p[u]; )
573
574
  u--;
574
575
  for (; l >= 1 && u >= 0; l--, u--)
575
- if (a[l] !== v[u]) {
576
+ if (a[l] !== p[u]) {
576
577
  if (l !== 1 || u !== 1)
577
578
  do
578
- if (l--, u--, u < 0 || a[l] !== v[u]) {
579
- var b = `
579
+ if (l--, u--, u < 0 || a[l] !== p[u]) {
580
+ var y = `
580
581
  ` + a[l].replace(" at new ", " at ");
581
- return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && W.set(e, b), b;
582
+ return e.displayName && y.includes("<anonymous>") && (y = y.replace("<anonymous>", e.displayName)), typeof e == "function" && W.set(e, y), y;
582
583
  }
583
584
  while (l >= 1 && u >= 0);
584
585
  break;
@@ -607,14 +608,14 @@ function fr() {
607
608
  switch (e) {
608
609
  case P:
609
610
  return M("Suspense");
610
- case m:
611
+ case g:
611
612
  return M("SuspenseList");
612
613
  }
613
614
  if (typeof e == "object")
614
615
  switch (e.$$typeof) {
615
- case d:
616
+ case f:
616
617
  return We(e.render);
617
- case R:
618
+ case _:
618
619
  return Y(e.type, r, t);
619
620
  case T: {
620
621
  var n = e, o = n._payload, s = n._init;
@@ -642,14 +643,14 @@ function fr() {
642
643
  var a = void 0;
643
644
  try {
644
645
  if (typeof e[i] != "function") {
645
- var v = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
646
- throw v.name = "Invariant Violation", v;
646
+ var p = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
647
+ throw p.name = "Invariant Violation", p;
647
648
  }
648
649
  a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
649
650
  } catch (l) {
650
651
  a = l;
651
652
  }
652
- a && !(a instanceof Error) && (U(o), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), U(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, U(o), p("Failed %s type: %s", t, a.message), U(null));
653
+ a && !(a instanceof Error) && (U(o), d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), U(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, U(o), d("Failed %s type: %s", t, a.message), U(null));
653
654
  }
654
655
  }
655
656
  }
@@ -675,7 +676,7 @@ function fr() {
675
676
  }
676
677
  function pe(e) {
677
678
  if (Ge(e))
678
- return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ne(e)), de(e);
679
+ return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ne(e)), de(e);
679
680
  }
680
681
  var ve = j.ReactCurrentOwner, qe = {
681
682
  key: !0,
@@ -705,7 +706,7 @@ function fr() {
705
706
  function Xe(e, r) {
706
707
  {
707
708
  var t = function() {
708
- ge || (ge = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
709
+ ge || (ge = !0, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
709
710
  };
710
711
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
711
712
  get: t,
@@ -716,7 +717,7 @@ function fr() {
716
717
  function He(e, r) {
717
718
  {
718
719
  var t = function() {
719
- me || (me = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
720
+ me || (me = !0, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
720
721
  };
721
722
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
722
723
  get: t,
@@ -727,7 +728,7 @@ function fr() {
727
728
  var Qe = function(e, r, t, n, o, s, i) {
728
729
  var a = {
729
730
  // This tag allows us to uniquely identify this as a React Element
730
- $$typeof: y,
731
+ $$typeof: h,
731
732
  // Built-in properties that belong on the element
732
733
  type: e,
733
734
  key: r,
@@ -755,8 +756,8 @@ function fr() {
755
756
  };
756
757
  function Ze(e, r, t, n, o) {
757
758
  {
758
- var s, i = {}, a = null, v = null;
759
- t !== void 0 && (pe(t), a = "" + t), ze(r) && (pe(r.key), a = "" + r.key), Je(r) && (v = r.ref, Ke(r, o));
759
+ var s, i = {}, a = null, p = null;
760
+ t !== void 0 && (pe(t), a = "" + t), ze(r) && (pe(r.key), a = "" + r.key), Je(r) && (p = r.ref, Ke(r, o));
760
761
  for (s in r)
761
762
  A.call(r, s) && !qe.hasOwnProperty(s) && (i[s] = r[s]);
762
763
  if (e && e.defaultProps) {
@@ -764,30 +765,30 @@ function fr() {
764
765
  for (s in l)
765
766
  i[s] === void 0 && (i[s] = l[s]);
766
767
  }
767
- if (a || v) {
768
+ if (a || p) {
768
769
  var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
769
- a && Xe(i, u), v && He(i, u);
770
+ a && Xe(i, u), p && He(i, u);
770
771
  }
771
- return Qe(e, a, v, o, n, ve.current, i);
772
+ return Qe(e, a, p, o, n, ve.current, i);
772
773
  }
773
774
  }
774
- var J = j.ReactCurrentOwner, be = j.ReactDebugCurrentFrame;
775
+ var J = j.ReactCurrentOwner, ye = j.ReactDebugCurrentFrame;
775
776
  function x(e) {
776
777
  if (e) {
777
778
  var r = e._owner, t = Y(e.type, e._source, r ? r.type : null);
778
- be.setExtraStackFrame(t);
779
+ ye.setExtraStackFrame(t);
779
780
  } else
780
- be.setExtraStackFrame(null);
781
+ ye.setExtraStackFrame(null);
781
782
  }
782
783
  var z;
783
784
  z = !1;
784
785
  function K(e) {
785
- return typeof e == "object" && e !== null && e.$$typeof === y;
786
+ return typeof e == "object" && e !== null && e.$$typeof === h;
786
787
  }
787
- function ye() {
788
+ function be() {
788
789
  {
789
790
  if (J.current) {
790
- var e = k(J.current.type);
791
+ var e = R(J.current.type);
791
792
  if (e)
792
793
  return `
793
794
 
@@ -802,7 +803,7 @@ Check the render method of \`` + e + "`.";
802
803
  var he = {};
803
804
  function rr(e) {
804
805
  {
805
- var r = ye();
806
+ var r = be();
806
807
  if (!r) {
807
808
  var t = typeof e == "string" ? e : e.displayName || e.name;
808
809
  t && (r = `
@@ -822,7 +823,7 @@ Check the top-level render call using <` + t + ">.");
822
823
  return;
823
824
  he[t] = !0;
824
825
  var n = "";
825
- e && e._owner && e._owner !== J.current && (n = " It was passed a child from " + k(e._owner.type) + "."), x(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), x(null);
826
+ e && e._owner && e._owner !== J.current && (n = " It was passed a child from " + R(e._owner.type) + "."), x(e), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), x(null);
826
827
  }
827
828
  }
828
829
  function Ee(e, r) {
@@ -852,21 +853,21 @@ Check the top-level render call using <` + t + ">.");
852
853
  var t;
853
854
  if (typeof r == "function")
854
855
  t = r.propTypes;
855
- else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
856
+ else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
856
857
  // Inner props are checked in the reconciler.
857
- r.$$typeof === R))
858
+ r.$$typeof === _))
858
859
  t = r.propTypes;
859
860
  else
860
861
  return;
861
862
  if (t) {
862
- var n = k(r);
863
+ var n = R(r);
863
864
  Ue(t, e.props, "prop", n, e);
864
865
  } else if (r.PropTypes !== void 0 && !z) {
865
866
  z = !0;
866
- var o = k(r);
867
- p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
867
+ var o = R(r);
868
+ d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
868
869
  }
869
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
870
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
870
871
  }
871
872
  }
872
873
  function nr(e) {
@@ -874,11 +875,11 @@ Check the top-level render call using <` + t + ">.");
874
875
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
875
876
  var n = r[t];
876
877
  if (n !== "children" && n !== "key") {
877
- x(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), x(null);
878
+ x(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), x(null);
878
879
  break;
879
880
  }
880
881
  }
881
- e.ref !== null && (x(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), x(null));
882
+ e.ref !== null && (x(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), x(null));
882
883
  }
883
884
  }
884
885
  var Re = {};
@@ -888,34 +889,34 @@ Check the top-level render call using <` + t + ">.");
888
889
  if (!i) {
889
890
  var a = "";
890
891
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
891
- var v = er();
892
- v ? a += v : a += ye();
892
+ var p = er();
893
+ p ? a += p : a += be();
893
894
  var l;
894
- e === null ? l = "null" : q(e) ? l = "array" : e !== void 0 && e.$$typeof === y ? (l = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
895
+ e === null ? l = "null" : q(e) ? l = "array" : e !== void 0 && e.$$typeof === h ? (l = "<" + (R(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
895
896
  }
896
897
  var u = Ze(e, r, t, o, s);
897
898
  if (u == null)
898
899
  return u;
899
900
  if (i) {
900
- var b = r.children;
901
- if (b !== void 0)
901
+ var y = r.children;
902
+ if (y !== void 0)
902
903
  if (n)
903
- if (q(b)) {
904
- for (var I = 0; I < b.length; I++)
905
- Ee(b[I], e);
906
- Object.freeze && Object.freeze(b);
904
+ if (q(y)) {
905
+ for (var I = 0; I < y.length; I++)
906
+ Ee(y[I], e);
907
+ Object.freeze && Object.freeze(y);
907
908
  } else
908
- p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
909
+ d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
909
910
  else
910
- Ee(b, e);
911
+ Ee(y, e);
911
912
  }
912
913
  if (A.call(r, "key")) {
913
- var O = k(e), g = Object.keys(r).filter(function(ur) {
914
+ var O = R(e), v = Object.keys(r).filter(function(ur) {
914
915
  return ur !== "key";
915
- }), X = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
916
+ }), X = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
916
917
  if (!Re[O + X]) {
917
- var lr = g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}";
918
- p(`A props object containing a "key" prop is being spread into JSX:
918
+ var lr = v.length > 0 ? "{" + v.join(": ..., ") + ": ...}" : "{}";
919
+ d(`A props object containing a "key" prop is being spread into JSX:
919
920
  let props = %s;
920
921
  <%s {...props} />
921
922
  React keys must be passed directly to JSX without using spread:
@@ -936,38 +937,43 @@ React keys must be passed directly to JSX without using spread:
936
937
  $.Fragment = c, $.jsx = or, $.jsxs = sr;
937
938
  }()), $;
938
939
  }
939
- process.env.NODE_ENV === "production" ? H.exports = cr() : H.exports = fr();
940
+ process.env.NODE_ENV === "production" ? H.exports = fr() : H.exports = dr();
940
941
  var B = H.exports;
941
- const dr = ({
942
- title: h,
943
- data: y,
944
- timeframe: _
942
+ const pr = ({
943
+ title: w,
944
+ data: h
945
945
  }) => {
946
- y.map((f) => ({
947
- label: f.product,
948
- value: f.sales
949
- }));
950
- const c = y.reduce((f, E) => f + E.sales, 0), w = Math.round(c / y.length);
951
- return /* @__PURE__ */ B.jsxs("div", { style: { padding: "20px", background: "#f5f5f5", borderRadius: "8px" }, children: [
952
- /* @__PURE__ */ B.jsx("h3", { children: h }),
953
- /* @__PURE__ */ B.jsxs("p", { children: [
954
- "Total: $",
955
- c.toLocaleString(),
956
- " | Avg: $",
957
- w.toLocaleString()
958
- ] }),
959
- /* @__PURE__ */ B.jsx("ul", { style: { listStyle: "none", padding: 0 }, children: y.map((f) => /* @__PURE__ */ B.jsxs("li", { children: [
960
- f.product,
961
- ": $",
962
- f.sales.toLocaleString()
963
- ] }, f.product)) })
964
- ] });
965
- }, pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
946
+ const b = h.reduce((m, E) => m + E.sales, 0), c = Math.round(b / h.length);
947
+ return /* @__PURE__ */ B.jsxs(
948
+ "div",
949
+ {
950
+ style: {
951
+ padding: "20px",
952
+ background: "#f5f5f5",
953
+ borderRadius: "8px"
954
+ },
955
+ children: [
956
+ /* @__PURE__ */ B.jsx("h3", { children: w }),
957
+ /* @__PURE__ */ B.jsxs("p", { children: [
958
+ "Total: $",
959
+ b.toLocaleString(),
960
+ " | Avg: $",
961
+ c.toLocaleString()
962
+ ] }),
963
+ /* @__PURE__ */ B.jsx("ul", { style: { listStyle: "none", padding: 0 }, children: h.map((m) => /* @__PURE__ */ B.jsxs("li", { children: [
964
+ m.product,
965
+ ": $",
966
+ m.sales.toLocaleString()
967
+ ] }, m.product)) })
968
+ ]
969
+ }
970
+ );
971
+ }, vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
966
972
  __proto__: null,
967
- MockSalesGraph: dr
973
+ MockSalesGraph: pr
968
974
  }, Symbol.toStringTag, { value: "Module" }));
969
975
  export {
970
- dr as MockSalesGraph,
971
- gr as getClientContext,
972
- mr as getClientTools
976
+ pr as MockSalesGraph,
977
+ yr as getClientContext,
978
+ br as getClientTools
973
979
  };
@@ -5,7 +5,7 @@ export interface Suggestion {
5
5
  id: string;
6
6
  label: string;
7
7
  prompt?: string;
8
- action?: () => void | Promise<void>;
8
+ action?: () => boolean | Promise<boolean>;
9
9
  }
10
10
  export interface SubmitOptions {
11
11
  type?: ContentType;
@@ -1 +1 @@
1
- {"version":3,"file":"useAgentChat.d.ts","sourceRoot":"","sources":["../../src/react/useAgentChat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EACX,YAAY,EAEZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,MAAM,uBAAuB,CAAC;AAU/B,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,M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,MAAM,IAAI,CAAC;CAChC;AAWD;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,MAAM,EAAE,kBAAkB,GAAI,kBAAkB,CAiZ7E;AAED,eAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/agenttic-client",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "type": "module",
5
5
  "description": "A TypeScript client library for A2A (Agent2Agent) protocol communication",
6
6
  "main": "dist/index.js",