@copilotkit/vue 1.57.1 → 1.57.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +3 -3
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.mjs +4 -4
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/{use-render-activity-message-CqtxiFSs.js → use-render-activity-message-BCoXRqzE.js} +230 -202
  7. package/dist/use-render-activity-message-BCoXRqzE.js.map +1 -0
  8. package/dist/use-render-activity-message-BRL1Rpl-.cjs.map +1 -1
  9. package/dist/v2/components/MCPAppsActivityRenderer.d.ts.map +1 -1
  10. package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts.map +1 -1
  11. package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -1
  12. package/dist/v2/components/a2ui/catalog.d.ts.map +1 -1
  13. package/dist/v2/hooks/use-interrupt.d.ts.map +1 -1
  14. package/dist/v2/hooks/use-render-activity-message.d.ts.map +1 -1
  15. package/dist/v2/index.mjs +1 -1
  16. package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts.map +1 -1
  17. package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -1
  18. package/package.json +24 -24
  19. package/src/hooks/use-frontend-tool.ts +2 -2
  20. package/src/v2/components/MCPAppsActivityRenderer.ts +1 -3
  21. package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +23 -11
  22. package/src/v2/components/a2ui/A2UICatalogContext.ts +5 -6
  23. package/src/v2/components/a2ui/catalog.ts +235 -210
  24. package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +2 -6
  25. package/src/v2/hooks/use-interrupt.ts +15 -10
  26. package/src/v2/hooks/use-render-activity-message.ts +7 -6
  27. package/src/v2/providers/CopilotChatConfigurationProvider.vue +1 -3
  28. package/src/v2/providers/CopilotKitProvider.types.ts +4 -1
  29. package/src/v2/providers/CopilotKitProvider.vue +7 -7
  30. package/dist/use-render-activity-message-CqtxiFSs.js.map +0 -1
@@ -123,9 +123,7 @@ class po {
123
123
  let i = !1;
124
124
  const o = setTimeout(() => {
125
125
  i || (i = !0, clearInterval(l), r.unsubscribe(), a(
126
- new Error(
127
- "[CopilotKit] Timed out waiting for agent to become idle"
128
- )
126
+ new Error("[CopilotKit] Timed out waiting for agent to become idle")
129
127
  ));
130
128
  }, 3e4), s = () => {
131
129
  i || (i = !0, clearTimeout(o), clearInterval(l), r.unsubscribe(), t());
@@ -668,7 +666,10 @@ function wo(e, n) {
668
666
  const s = rn({
669
667
  name: nn,
670
668
  args: ce.any(),
671
- render: ({ status: l, args: p }) => {
669
+ render: ({
670
+ status: l,
671
+ args: p
672
+ }) => {
672
673
  if (l === "complete") return null;
673
674
  const w = p, u = w?.items;
674
675
  if (Array.isArray(u) && u.length > 0) return null;
@@ -677,16 +678,12 @@ function wo(e, n) {
677
678
  }
678
679
  }), r = t.propRenderToolCalls;
679
680
  t.setRenderToolCalls([
680
- ...r.filter(
681
- (l) => l.name !== nn
682
- ),
681
+ ...r.filter((l) => l.name !== nn),
683
682
  s
684
683
  ]), o(() => {
685
684
  const l = t.propRenderToolCalls;
686
685
  t.setRenderToolCalls(
687
- l.filter(
688
- (p) => p.name !== nn
689
- )
686
+ l.filter((p) => p.name !== nn)
690
687
  ), ln.clear();
691
688
  });
692
689
  },
@@ -769,7 +766,14 @@ function xo(e) {
769
766
  r(),
770
767
  r()
771
768
  ]),
772
- p(64, 6, "#e4e4e7", void 0, s >= 1 ? 1 : 0.4, "opacity 0.5s")
769
+ p(
770
+ 64,
771
+ 6,
772
+ "#e4e4e7",
773
+ void 0,
774
+ s >= 1 ? 1 : 0.4,
775
+ "opacity 0.5s"
776
+ )
773
777
  ]
774
778
  ),
775
779
  // Skeleton lines
@@ -865,7 +869,9 @@ function xo(e) {
865
869
  ]
866
870
  ),
867
871
  // Keyframe styles
868
- y("style", `
872
+ y(
873
+ "style",
874
+ `
869
875
  @keyframes cpk-a2ui-fade {
870
876
  0%, 100% { opacity: 1; }
871
877
  50% { opacity: 0.5; }
@@ -874,7 +880,8 @@ function xo(e) {
874
880
  0% { background-position: 250% 0; }
875
881
  100% { background-position: -250% 0; }
876
882
  }
877
- `)
883
+ `
884
+ )
878
885
  ]);
879
886
  }
880
887
  function Ee(e, n, t) {
@@ -1257,95 +1264,110 @@ const Io = Ee(Ma, ({ props: e }) => {
1257
1264
  },
1258
1265
  [e.child ? n(e.child) : null]
1259
1266
  );
1260
- }), Vo = Ee(Ha, ({ props: e, state: n }) => {
1261
- const t = n.id, a = e.variant === "longText", i = e.variant === "number" ? "number" : e.variant === "obscured" ? "password" : "text", o = {
1262
- padding: "8px",
1263
- width: "100%",
1264
- border: e.validationErrors && e.validationErrors.length > 0 ? "1px solid red" : $t,
1265
- borderRadius: Jt,
1266
- boxSizing: "border-box"
1267
- }, s = e.validationErrors && e.validationErrors.length > 0;
1268
- return y(
1269
- "div",
1270
- {
1271
- style: {
1272
- display: "flex",
1273
- flexDirection: "column",
1274
- gap: "4px",
1275
- width: "100%",
1276
- margin: ot
1277
- }
1278
- },
1279
- [
1280
- e.label ? y(
1281
- "label",
1282
- { for: t, style: { fontSize: "14px", fontWeight: "bold" } },
1283
- e.label
1284
- ) : null,
1285
- a ? y("textarea", {
1286
- id: t,
1287
- style: o,
1288
- value: e.value || "",
1289
- onInput: (r) => e.setValue(r.target.value)
1290
- }) : y("input", {
1291
- id: t,
1292
- type: i,
1293
- style: o,
1294
- value: e.value || "",
1295
- onInput: (r) => e.setValue(r.target.value)
1296
- }),
1297
- s ? y(
1298
- "span",
1299
- { style: { fontSize: "12px", color: "red" } },
1300
- e.validationErrors[0]
1301
- ) : null
1302
- ]
1303
- );
1304
- }, () => ({ id: Qt() })), No = Ee(_a, ({ props: e, state: n }) => {
1305
- const t = n.id, a = e.validationErrors && e.validationErrors.length > 0;
1306
- return y(
1307
- "div",
1308
- {
1309
- style: { display: "flex", flexDirection: "column", margin: ot }
1310
- },
1311
- [
1312
- y(
1313
- "div",
1314
- { style: { display: "flex", alignItems: "center", gap: "8px" } },
1315
- [
1316
- y("input", {
1317
- id: t,
1318
- type: "checkbox",
1319
- checked: !!e.value,
1320
- onChange: (i) => e.setValue(i.target.checked),
1321
- style: {
1322
- cursor: "pointer",
1323
- outline: a ? "1px solid red" : "none"
1324
- }
1325
- }),
1326
- e.label ? y(
1327
- "label",
1328
- {
1329
- for: t,
1267
+ }), Vo = Ee(
1268
+ Ha,
1269
+ ({ props: e, state: n }) => {
1270
+ const t = n.id, a = e.variant === "longText", i = e.variant === "number" ? "number" : e.variant === "obscured" ? "password" : "text", o = {
1271
+ padding: "8px",
1272
+ width: "100%",
1273
+ border: e.validationErrors && e.validationErrors.length > 0 ? "1px solid red" : $t,
1274
+ borderRadius: Jt,
1275
+ boxSizing: "border-box"
1276
+ }, s = e.validationErrors && e.validationErrors.length > 0;
1277
+ return y(
1278
+ "div",
1279
+ {
1280
+ style: {
1281
+ display: "flex",
1282
+ flexDirection: "column",
1283
+ gap: "4px",
1284
+ width: "100%",
1285
+ margin: ot
1286
+ }
1287
+ },
1288
+ [
1289
+ e.label ? y(
1290
+ "label",
1291
+ {
1292
+ for: t,
1293
+ style: { fontSize: "14px", fontWeight: "bold" }
1294
+ },
1295
+ e.label
1296
+ ) : null,
1297
+ a ? y("textarea", {
1298
+ id: t,
1299
+ style: o,
1300
+ value: e.value || "",
1301
+ onInput: (r) => e.setValue(r.target.value)
1302
+ }) : y("input", {
1303
+ id: t,
1304
+ type: i,
1305
+ style: o,
1306
+ value: e.value || "",
1307
+ onInput: (r) => e.setValue(r.target.value)
1308
+ }),
1309
+ s ? y(
1310
+ "span",
1311
+ { style: { fontSize: "12px", color: "red" } },
1312
+ e.validationErrors[0]
1313
+ ) : null
1314
+ ]
1315
+ );
1316
+ },
1317
+ () => ({ id: Qt() })
1318
+ ), No = Ee(
1319
+ _a,
1320
+ ({ props: e, state: n }) => {
1321
+ const t = n.id, a = e.validationErrors && e.validationErrors.length > 0;
1322
+ return y(
1323
+ "div",
1324
+ {
1325
+ style: {
1326
+ display: "flex",
1327
+ flexDirection: "column",
1328
+ margin: ot
1329
+ }
1330
+ },
1331
+ [
1332
+ y(
1333
+ "div",
1334
+ { style: { display: "flex", alignItems: "center", gap: "8px" } },
1335
+ [
1336
+ y("input", {
1337
+ id: t,
1338
+ type: "checkbox",
1339
+ checked: !!e.value,
1340
+ onChange: (i) => e.setValue(i.target.checked),
1330
1341
  style: {
1331
1342
  cursor: "pointer",
1332
- color: a ? "red" : "inherit"
1343
+ outline: a ? "1px solid red" : "none"
1333
1344
  }
1334
- },
1335
- e.label
1336
- ) : null
1337
- ]
1338
- ),
1339
- a ? y(
1340
- "span",
1341
- {
1342
- style: { fontSize: "12px", color: "red", marginTop: "4px" }
1343
- },
1344
- e.validationErrors?.[0]
1345
- ) : null
1346
- ]
1347
- );
1348
- }, () => ({ id: Qt() })), zo = Ee(
1345
+ }),
1346
+ e.label ? y(
1347
+ "label",
1348
+ {
1349
+ for: t,
1350
+ style: {
1351
+ cursor: "pointer",
1352
+ color: a ? "red" : "inherit"
1353
+ }
1354
+ },
1355
+ e.label
1356
+ ) : null
1357
+ ]
1358
+ ),
1359
+ a ? y(
1360
+ "span",
1361
+ {
1362
+ style: { fontSize: "12px", color: "red", marginTop: "4px" }
1363
+ },
1364
+ e.validationErrors?.[0]
1365
+ ) : null
1366
+ ]
1367
+ );
1368
+ },
1369
+ () => ({ id: Qt() })
1370
+ ), zo = Ee(
1349
1371
  Wa,
1350
1372
  ({ props: e, context: n, state: t }) => {
1351
1373
  const a = Array.isArray(e.value) ? e.value : [], i = e.variant === "mutuallyExclusive", o = (r) => {
@@ -1439,93 +1461,101 @@ const Io = Ee(Ma, ({ props: e }) => {
1439
1461
  );
1440
1462
  },
1441
1463
  () => ({ filter: I("") })
1442
- ), Po = Ee(qa, ({ props: e, state: n }) => {
1443
- const t = n.id;
1444
- return y(
1445
- "div",
1446
- {
1447
- style: {
1448
- display: "flex",
1449
- flexDirection: "column",
1450
- gap: "4px",
1451
- margin: ot,
1452
- width: "100%"
1453
- }
1454
- },
1455
- [
1456
- y(
1457
- "div",
1458
- { style: { display: "flex", justifyContent: "space-between" } },
1459
- [
1460
- e.label ? y(
1461
- "label",
1462
- {
1463
- for: t,
1464
- style: { fontSize: "14px", fontWeight: "bold" }
1465
- },
1466
- e.label
1467
- ) : null,
1468
- y(
1469
- "span",
1470
- { style: { fontSize: "12px", color: "#666" } },
1471
- String(e.value)
1472
- )
1473
- ]
1474
- ),
1475
- y("input", {
1476
- id: t,
1477
- type: "range",
1478
- min: e.min ?? 0,
1479
- max: e.max,
1480
- value: e.value ?? 0,
1481
- onInput: (a) => e.setValue(Number(a.target.value)),
1482
- style: { width: "100%", cursor: "pointer" }
1483
- })
1484
- ]
1485
- );
1486
- }, () => ({ id: Qt() })), Ho = Ee(Ka, ({ props: e, state: n }) => {
1487
- const t = n.id;
1488
- let a = "datetime-local";
1489
- e.enableDate && !e.enableTime && (a = "date"), !e.enableDate && e.enableTime && (a = "time");
1490
- const i = {
1491
- padding: "8px",
1492
- width: "100%",
1493
- border: $t,
1494
- borderRadius: Jt,
1495
- boxSizing: "border-box"
1496
- };
1497
- return y(
1498
- "div",
1499
- {
1500
- style: {
1501
- display: "flex",
1502
- flexDirection: "column",
1503
- gap: "4px",
1504
- width: "100%",
1505
- margin: ot
1506
- }
1507
- },
1508
- [
1509
- e.label ? y(
1510
- "label",
1511
- {
1512
- for: t,
1513
- style: { fontSize: "14px", fontWeight: "bold" }
1514
- },
1515
- e.label
1516
- ) : null,
1517
- y("input", {
1518
- id: t,
1519
- type: a,
1520
- style: i,
1521
- value: e.value || "",
1522
- onInput: (o) => e.setValue(o.target.value),
1523
- min: typeof e.min == "string" ? e.min : void 0,
1524
- max: typeof e.max == "string" ? e.max : void 0
1525
- })
1526
- ]
1527
- );
1528
- }, () => ({ id: Qt() })), _o = [
1464
+ ), Po = Ee(
1465
+ qa,
1466
+ ({ props: e, state: n }) => {
1467
+ const t = n.id;
1468
+ return y(
1469
+ "div",
1470
+ {
1471
+ style: {
1472
+ display: "flex",
1473
+ flexDirection: "column",
1474
+ gap: "4px",
1475
+ margin: ot,
1476
+ width: "100%"
1477
+ }
1478
+ },
1479
+ [
1480
+ y(
1481
+ "div",
1482
+ { style: { display: "flex", justifyContent: "space-between" } },
1483
+ [
1484
+ e.label ? y(
1485
+ "label",
1486
+ {
1487
+ for: t,
1488
+ style: { fontSize: "14px", fontWeight: "bold" }
1489
+ },
1490
+ e.label
1491
+ ) : null,
1492
+ y(
1493
+ "span",
1494
+ { style: { fontSize: "12px", color: "#666" } },
1495
+ String(e.value)
1496
+ )
1497
+ ]
1498
+ ),
1499
+ y("input", {
1500
+ id: t,
1501
+ type: "range",
1502
+ min: e.min ?? 0,
1503
+ max: e.max,
1504
+ value: e.value ?? 0,
1505
+ onInput: (a) => e.setValue(Number(a.target.value)),
1506
+ style: { width: "100%", cursor: "pointer" }
1507
+ })
1508
+ ]
1509
+ );
1510
+ },
1511
+ () => ({ id: Qt() })
1512
+ ), Ho = Ee(
1513
+ Ka,
1514
+ ({ props: e, state: n }) => {
1515
+ const t = n.id;
1516
+ let a = "datetime-local";
1517
+ e.enableDate && !e.enableTime && (a = "date"), !e.enableDate && e.enableTime && (a = "time");
1518
+ const i = {
1519
+ padding: "8px",
1520
+ width: "100%",
1521
+ border: $t,
1522
+ borderRadius: Jt,
1523
+ boxSizing: "border-box"
1524
+ };
1525
+ return y(
1526
+ "div",
1527
+ {
1528
+ style: {
1529
+ display: "flex",
1530
+ flexDirection: "column",
1531
+ gap: "4px",
1532
+ width: "100%",
1533
+ margin: ot
1534
+ }
1535
+ },
1536
+ [
1537
+ e.label ? y(
1538
+ "label",
1539
+ {
1540
+ for: t,
1541
+ style: { fontSize: "14px", fontWeight: "bold" }
1542
+ },
1543
+ e.label
1544
+ ) : null,
1545
+ y("input", {
1546
+ id: t,
1547
+ type: a,
1548
+ style: i,
1549
+ value: e.value || "",
1550
+ onInput: (o) => e.setValue(o.target.value),
1551
+ min: typeof e.min == "string" ? e.min : void 0,
1552
+ max: typeof e.max == "string" ? e.max : void 0
1553
+ })
1554
+ ]
1555
+ );
1556
+ },
1557
+ () => ({ id: Qt() })
1558
+ ), _o = [
1529
1559
  Io,
1530
1560
  Ao,
1531
1561
  Ro,
@@ -1616,9 +1646,7 @@ function Go(e, n) {
1616
1646
  },
1617
1647
  { immediate: !0 }
1618
1648
  );
1619
- const a = c(() => n.includeSchema() ? JSON.stringify(
1620
- Ko(n.catalog())
1621
- ) : null);
1649
+ const a = c(() => n.includeSchema() ? JSON.stringify(Ko(n.catalog())) : null);
1622
1650
  L(
1623
1651
  [() => e.value, n.enabled, a],
1624
1652
  ([i, o, s], r, l) => {
@@ -2438,10 +2466,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2438
2466
  F(), v.value = E.value.a2uiEnabled, b.value = E.value.openGenerativeUIEnabled, S.value = E.value.licenseStatus, ne.value = !0;
2439
2467
  });
2440
2468
  const B = c(() => t.a2ui?.theme), H = c(() => t.a2ui?.catalog), ae = c(() => t.a2ui?.loadingComponent), we = c(() => t.a2ui?.includeSchema ?? !0);
2441
- wo(
2442
- E,
2443
- () => v.value
2444
- ), Go(E, {
2469
+ wo(E, () => v.value), Go(E, {
2445
2470
  enabled: () => v.value,
2446
2471
  catalog: () => t.a2ui?.catalog,
2447
2472
  includeSchema: () => t.a2ui?.includeSchema ?? !0
@@ -2594,9 +2619,7 @@ const hn = /* @__PURE__ */ se({
2594
2619
  () => n.agentId ?? a.value?.agentId ?? lt
2595
2620
  ), r = pt(), l = c(() => n.threadId ? n.threadId : a.value?.threadId ? a.value.threadId : r), p = c(() => (n.hasExplicitThreadId !== void 0 ? n.hasExplicitThreadId : !!n.threadId) || !!a.value?.hasExplicitThreadId), w = c(
2596
2621
  () => n.isModalDefaultOpen !== void 0
2597
- ), u = c(
2598
- () => n.isModalDefaultOpen ?? !0
2599
- ), d = I(
2622
+ ), u = c(() => n.isModalDefaultOpen ?? !0), d = I(
2600
2623
  a.value?.isModalOpen ?? u.value
2601
2624
  );
2602
2625
  function g(x) {
@@ -8615,7 +8638,10 @@ function ql(e = {}) {
8615
8638
  }
8616
8639
  }
8617
8640
  }).catch((w) => {
8618
- console.error("[CopilotKit] useInterrupt: failed to resume agent:", w);
8641
+ console.error(
8642
+ "[CopilotKit] useInterrupt: failed to resume agent:",
8643
+ w
8644
+ );
8619
8645
  });
8620
8646
  };
8621
8647
  L(
@@ -8820,9 +8846,9 @@ function Jl() {
8820
8846
  };
8821
8847
  }
8822
8848
  function Ql() {
8823
- const { copilotkit: e } = Ue(), n = Oe(), t = c(
8824
- () => n.value?.agentId ?? lt
8825
- ), a = c(() => [...e.value.renderActivityMessages]);
8849
+ const { copilotkit: e } = Ue(), n = Oe(), t = c(() => n.value?.agentId ?? lt), a = c(() => [
8850
+ ...e.value.renderActivityMessages
8851
+ ]);
8826
8852
  function i(s) {
8827
8853
  const r = a.value;
8828
8854
  if (!r.length)
@@ -8842,7 +8868,9 @@ function Ql() {
8842
8868
  `Failed to parse content for activity message '${s.activityType}':`,
8843
8869
  l.error
8844
8870
  ), null;
8845
- const p = e.value.getAgent(t.value);
8871
+ const p = e.value.getAgent(
8872
+ t.value
8873
+ );
8846
8874
  return {
8847
8875
  renderer: r.render,
8848
8876
  props: {
@@ -8924,4 +8952,4 @@ export {
8924
8952
  Dl as y,
8925
8953
  Nl as z
8926
8954
  };
8927
- //# sourceMappingURL=use-render-activity-message-CqtxiFSs.js.map
8955
+ //# sourceMappingURL=use-render-activity-message-BCoXRqzE.js.map