llmz 0.0.2 → 0.0.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.
- package/dist/chat.d.ts +17 -0
- package/dist/chunk-3U57H7GT.js +608 -0
- package/dist/{chunk-RB2L33ZR.js → chunk-4EWY34YA.js} +24 -24
- package/dist/{chunk-R2N2UUKC.cjs → chunk-4I7UPBLN.cjs} +14 -8
- package/dist/{chunk-YPOOKE3A.cjs → chunk-4QTK5ALH.cjs} +59 -28
- package/dist/{chunk-BKGPO722.cjs → chunk-5NVNEEYW.cjs} +55 -55
- package/dist/{chunk-DFZ6GX5C.js → chunk-5TRUJES5.js} +1 -1
- package/dist/{chunk-E2B5DRIC.cjs → chunk-6WT5VZBG.cjs} +362 -26
- package/dist/{chunk-7S3UY52U.js → chunk-7WRN4E42.js} +36 -8
- package/dist/{chunk-E5W3P7EO.cjs → chunk-EJRCDWBA.cjs} +64 -7
- package/dist/{chunk-VP6WWAE2.cjs → chunk-FIVFS4HG.cjs} +2 -2
- package/dist/{chunk-3T465BEW.js → chunk-HP7RKM25.js} +63 -6
- package/dist/{chunk-YUDUY7XW.cjs → chunk-HYVKY3W6.cjs} +23 -24
- package/dist/{chunk-PQN6HW7A.cjs → chunk-IKSIOIIP.cjs} +3 -3
- package/dist/{chunk-ZUAFUOUR.cjs → chunk-JDABP4SD.cjs} +3 -3
- package/dist/{chunk-RJHDQL4C.js → chunk-JKVVQN2P.js} +1 -1
- package/dist/{chunk-MSTBEKOQ.js → chunk-JQBT7UWN.js} +3 -3
- package/dist/{chunk-BOLDQGES.cjs → chunk-KMZDFWYZ.cjs} +3 -3
- package/dist/chunk-MU4LFVY7.cjs +608 -0
- package/dist/{chunk-7FIPXMZR.js → chunk-ORQP26SZ.js} +1 -1
- package/dist/{chunk-ENFB45AI.cjs → chunk-P7J2WCBB.cjs} +7 -7
- package/dist/{chunk-DILHJIMP.js → chunk-QBXIE6EY.js} +49 -18
- package/dist/{chunk-UVSOAH2H.js → chunk-QT4QF3YA.js} +1 -1
- package/dist/{chunk-6QDFMQHA.js → chunk-S6FOL2HY.js} +8 -2
- package/dist/{chunk-ZSRC3TN4.js → chunk-UNMKB2DA.js} +9 -10
- package/dist/{chunk-3CGLDS5T.cjs → chunk-UQOBUJIQ.cjs} +38 -10
- package/dist/{chunk-QPSUMPLP.js → chunk-WLUVY5QU.js} +345 -9
- package/dist/citations.d.ts +63 -0
- package/dist/component-R2Y74VUI.js +16 -0
- package/dist/component-TSNW3SC7.cjs +16 -0
- package/dist/component.d.ts +26 -17
- package/dist/component.default.d.ts +314 -8
- package/dist/context.d.ts +9 -6
- package/dist/dual-modes-UHNDHNIF.cjs +12 -0
- package/dist/dual-modes-ZUQKPJFH.js +12 -0
- package/dist/exit-KJ4COC5N.cjs +8 -0
- package/dist/exit-OIYZLBVJ.js +8 -0
- package/dist/exit.d.ts +6 -0
- package/dist/getter.d.ts +1 -1
- package/dist/index.cjs +256 -160
- package/dist/index.d.ts +7 -4
- package/dist/index.js +242 -146
- package/dist/{jsx-CJ2RBODH.js → jsx-AEHVFB3L.js} +2 -3
- package/dist/jsx-AJAXBWFE.cjs +13 -0
- package/dist/llmz-VDA4M42R.cjs +604 -0
- package/dist/llmz-YE5N54IU.js +604 -0
- package/dist/llmz.d.ts +8 -10
- package/dist/snapshots.d.ts +9 -1
- package/dist/tool-LY77IWV2.js +11 -0
- package/dist/tool-SWJYOR2Z.cjs +11 -0
- package/dist/tool.d.ts +34 -9
- package/dist/truncator-NYN7BGKJ.cjs +10 -0
- package/dist/truncator-WAL2GCUY.js +10 -0
- package/dist/types.d.ts +9 -1
- package/dist/typings-AIV2OASX.js +10 -0
- package/dist/typings-XR6CYHW4.cjs +10 -0
- package/dist/{utils-TS23YJPE.js → utils-L5GLCS3C.js} +2 -3
- package/dist/utils-QC4I2L6R.cjs +37 -0
- package/dist/vm-GJ5R72AP.cjs +12 -0
- package/dist/vm-ZUQOSRRM.js +12 -0
- package/dist/vm.d.ts +1 -1
- package/package.json +8 -6
- package/dist/chunk-A7BDFLAE.cjs +0 -30
- package/dist/chunk-C2TSWGYC.cjs +0 -91
- package/dist/chunk-Q4DEJGXD.js +0 -344
- package/dist/chunk-QZGFCB4T.cjs +0 -344
- package/dist/chunk-UG2GCPHF.js +0 -91
- package/dist/chunk-YSQDPG26.js +0 -30
- package/dist/component-DWBRHLEN.cjs +0 -9
- package/dist/component-R3ZAVXUC.js +0 -9
- package/dist/dual-modes-2VDEOJ5D.js +0 -13
- package/dist/dual-modes-3MH5N6RY.cjs +0 -13
- package/dist/exit-GYMXZZ4I.js +0 -9
- package/dist/exit-PQHMJEOG.cjs +0 -9
- package/dist/jsx-PPLE5YTB.cjs +0 -14
- package/dist/llmz-EGTGPSTX.cjs +0 -1049
- package/dist/llmz-WY74UVE3.js +0 -1049
- package/dist/tool-AY47ML65.cjs +0 -12
- package/dist/tool-WVIPESKN.js +0 -12
- package/dist/truncator-MTONQESU.js +0 -11
- package/dist/truncator-ZKPOW2I3.cjs +0 -11
- package/dist/typings-HTYLRNIC.js +0 -11
- package/dist/typings-QRJGGNUM.cjs +0 -11
- package/dist/utils-UR4IMUHC.cjs +0 -38
- package/dist/vm-4JFSZAMR.cjs +0 -13
- package/dist/vm-SMMA664M.js +0 -13
- package/patches/source-map-js@1.2.1.patch +0 -16
package/dist/index.js
CHANGED
|
@@ -1,34 +1,43 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
ListenExit,
|
|
3
|
+
Snapshot,
|
|
4
|
+
ThinkExit,
|
|
5
|
+
getValue
|
|
6
|
+
} from "./chunk-3U57H7GT.js";
|
|
7
|
+
import "./chunk-WLUVY5QU.js";
|
|
4
8
|
import {
|
|
5
9
|
Tool
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QBXIE6EY.js";
|
|
7
11
|
import {
|
|
8
12
|
formatTypings,
|
|
9
13
|
getTypings
|
|
10
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UNMKB2DA.js";
|
|
11
15
|
import {
|
|
12
16
|
CodeFormattingError,
|
|
13
17
|
SnapshotSignal,
|
|
14
18
|
ThinkSignal
|
|
15
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JKVVQN2P.js";
|
|
20
|
+
import "./chunk-JQBT7UWN.js";
|
|
16
21
|
import {
|
|
17
22
|
Exit
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
} from "./chunk-S6FOL2HY.js";
|
|
24
|
+
import {
|
|
25
|
+
Component,
|
|
26
|
+
assertValidComponent,
|
|
27
|
+
isAnyComponent,
|
|
28
|
+
isComponent
|
|
29
|
+
} from "./chunk-HP7RKM25.js";
|
|
30
|
+
import "./chunk-ORQP26SZ.js";
|
|
31
|
+
import "./chunk-QT4QF3YA.js";
|
|
22
32
|
import {
|
|
23
33
|
escapeString,
|
|
24
34
|
getMultilineComment,
|
|
25
35
|
isValidIdentifier
|
|
26
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-5TRUJES5.js";
|
|
27
37
|
import {
|
|
28
38
|
cloneDeep_default,
|
|
29
39
|
upperFirst_default
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-YSQDPG26.js";
|
|
40
|
+
} from "./chunk-7WRN4E42.js";
|
|
32
41
|
|
|
33
42
|
// src/objects.ts
|
|
34
43
|
import { z } from "@bpinternal/zui";
|
|
@@ -497,8 +506,143 @@ function embedPropertyValue(property) {
|
|
|
497
506
|
return "unknown";
|
|
498
507
|
}
|
|
499
508
|
|
|
509
|
+
// src/citations.ts
|
|
510
|
+
var RARE_SYMBOLS = {
|
|
511
|
+
ARROW_UP: "\u2191",
|
|
512
|
+
CIRCLE_BULLET: "\u30FB",
|
|
513
|
+
STAR_BULLET_FULL: "\u2605",
|
|
514
|
+
STAR_BULLET_EMPTY: "\u2606",
|
|
515
|
+
ARROW_BULLET: "\u2192",
|
|
516
|
+
SQUARE_BULLET: "\u25A0",
|
|
517
|
+
TRIANGLE_BULLET: "\u25BA",
|
|
518
|
+
OPENING_TAG: "\u3010",
|
|
519
|
+
CLOSING_TAG: "\u3011",
|
|
520
|
+
SS: "\xA7",
|
|
521
|
+
CROSS: "\u2020"
|
|
522
|
+
};
|
|
523
|
+
var CitationsManager = class {
|
|
524
|
+
_citations = /* @__PURE__ */ new Map();
|
|
525
|
+
_nextId = 0;
|
|
526
|
+
/**
|
|
527
|
+
* Registers a new source and returns the created Citation.
|
|
528
|
+
* @param source An object representing the source of the citation.
|
|
529
|
+
* @returns The created Citation.
|
|
530
|
+
*/
|
|
531
|
+
registerSource(source) {
|
|
532
|
+
const id = this._nextId++;
|
|
533
|
+
const tag = `${RARE_SYMBOLS.OPENING_TAG}${id}${RARE_SYMBOLS.CLOSING_TAG}`;
|
|
534
|
+
const citation = {
|
|
535
|
+
id,
|
|
536
|
+
source,
|
|
537
|
+
tag
|
|
538
|
+
};
|
|
539
|
+
this._citations.set(id, citation);
|
|
540
|
+
return citation;
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Extracts citations from the provided content and cleans the content of citation tags.
|
|
544
|
+
* Non-found citations are replaced with a special "Not Found" citation.
|
|
545
|
+
* @param content The string content containing citation tags.
|
|
546
|
+
* @returns An object containing the cleaned content and an array of found citations.
|
|
547
|
+
*/
|
|
548
|
+
extractCitations(content, replace) {
|
|
549
|
+
const citations = [];
|
|
550
|
+
const notFoundCitation = {
|
|
551
|
+
id: -1,
|
|
552
|
+
source: "Not Found",
|
|
553
|
+
tag: ""
|
|
554
|
+
};
|
|
555
|
+
const regex = new RegExp(`${RARE_SYMBOLS.OPENING_TAG}([\\d|\\w|\\s|,]{0,})${RARE_SYMBOLS.CLOSING_TAG}`, "ig");
|
|
556
|
+
let match;
|
|
557
|
+
const offsets = [];
|
|
558
|
+
while ((match = regex.exec(content)) !== null) {
|
|
559
|
+
const offset = match.index;
|
|
560
|
+
const length = match[0].length;
|
|
561
|
+
offsets.push({ start: offset, length });
|
|
562
|
+
const multi = (match[1] ?? "").split(/\D/g).map((s) => s.trim()).filter(Boolean).map((s) => parseInt(s, 10)).filter((s) => !isNaN(s) && s >= 0);
|
|
563
|
+
for (const citationId of multi) {
|
|
564
|
+
const citation = this._citations.get(citationId);
|
|
565
|
+
if (citation) {
|
|
566
|
+
citations.push({ ...citation, offset });
|
|
567
|
+
} else {
|
|
568
|
+
citations.push({ ...notFoundCitation, offset });
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
const entries = offsets.map((o) => ({
|
|
573
|
+
start: o.start,
|
|
574
|
+
length: o.length,
|
|
575
|
+
citations: citations.filter((x) => x.offset === o.start && x.id !== -1)
|
|
576
|
+
})).sort((a, b) => a.start - b.start);
|
|
577
|
+
let result = "";
|
|
578
|
+
let cursor = 0;
|
|
579
|
+
for (const { start, length, citations: citations2 } of entries) {
|
|
580
|
+
result += content.slice(cursor, start);
|
|
581
|
+
const replacement = citations2.map((citation) => replace ? replace(citation) : "").join("");
|
|
582
|
+
result += replacement;
|
|
583
|
+
cursor = start + length;
|
|
584
|
+
}
|
|
585
|
+
result += content.slice(cursor);
|
|
586
|
+
return { cleaned: result, citations };
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Strips citation tags from the provided content.
|
|
590
|
+
* @param content The string content containing citation tags.
|
|
591
|
+
* @returns The cleaned content without citation tags.
|
|
592
|
+
*/
|
|
593
|
+
static stripCitationTags(content) {
|
|
594
|
+
const regex = new RegExp(`${RARE_SYMBOLS.OPENING_TAG}([\\d|\\w|\\s|,]{0,})${RARE_SYMBOLS.CLOSING_TAG}?`, "g");
|
|
595
|
+
return content.replace(regex, "");
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Removes citations from a deeply nested plain object and returns a new object with citations removed.
|
|
599
|
+
* @param obj The plain object to process.
|
|
600
|
+
* @returns A tuple containing the new object and an array of extracted citations with paths.
|
|
601
|
+
*/
|
|
602
|
+
removeCitationsFromObject(obj) {
|
|
603
|
+
const result = [];
|
|
604
|
+
const processObject = (current, path) => {
|
|
605
|
+
if (typeof current === "string") {
|
|
606
|
+
const extraction = this.extractCitations(current);
|
|
607
|
+
if (extraction.citations.length > 0) {
|
|
608
|
+
result.push(...extraction.citations.map((citation) => ({ path, citation })));
|
|
609
|
+
}
|
|
610
|
+
return extraction.cleaned;
|
|
611
|
+
} else if (typeof current === "object" && current !== null) {
|
|
612
|
+
const newObject = Array.isArray(current) ? [] : {};
|
|
613
|
+
for (const key of Object.keys(current)) {
|
|
614
|
+
newObject[key] = processObject(current[key], `${path}.${key}`);
|
|
615
|
+
}
|
|
616
|
+
return newObject;
|
|
617
|
+
}
|
|
618
|
+
return current;
|
|
619
|
+
};
|
|
620
|
+
const newObj = processObject(obj, "root");
|
|
621
|
+
return [newObj, result];
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Re-adds citations to the cleaned content based on their offsets.
|
|
625
|
+
* @param cleaned The cleaned string without citation tags.
|
|
626
|
+
* @param citations The array of citations with offsets.
|
|
627
|
+
* @returns The string with citation tags re-added.
|
|
628
|
+
*/
|
|
629
|
+
reAddCitations(cleaned, citations) {
|
|
630
|
+
let content = cleaned;
|
|
631
|
+
citations.sort((a, b) => (a.offset ?? 0) - (b.offset ?? 0));
|
|
632
|
+
const adjustment = 0;
|
|
633
|
+
for (const citation of citations) {
|
|
634
|
+
if (citation.offset != null) {
|
|
635
|
+
const position = citation.offset + adjustment;
|
|
636
|
+
content = content.slice(0, position) + citation.tag + content.slice(position);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
return content;
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
|
|
500
643
|
// src/component.default.ts
|
|
501
|
-
|
|
644
|
+
import { z as z2 } from "@bpinternal/zui";
|
|
645
|
+
var Button = new Component({
|
|
502
646
|
type: "leaf",
|
|
503
647
|
description: "A button component that can perform actions when clicked",
|
|
504
648
|
name: "Button",
|
|
@@ -520,36 +664,15 @@ var Button = {
|
|
|
520
664
|
}
|
|
521
665
|
],
|
|
522
666
|
leaf: {
|
|
523
|
-
props:
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
name: "label",
|
|
533
|
-
type: "string",
|
|
534
|
-
description: "The text displayed on the button",
|
|
535
|
-
required: true
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
name: "value",
|
|
539
|
-
type: "string",
|
|
540
|
-
description: 'The postback value to send when the button is clicked. Required if action is "postback"',
|
|
541
|
-
required: false
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
name: "url",
|
|
545
|
-
type: "string",
|
|
546
|
-
description: 'The URL to open when the button is clicked. Required if action is "url"',
|
|
547
|
-
required: false
|
|
548
|
-
}
|
|
549
|
-
]
|
|
550
|
-
}
|
|
551
|
-
};
|
|
552
|
-
var Image = {
|
|
667
|
+
props: z2.object({
|
|
668
|
+
action: z2.enum(["say", "url", "postback"]).default("say").describe('The action to perform when the button is clicked. Can be "say", "url", or "postback"'),
|
|
669
|
+
label: z2.string().describe("The text displayed on the button"),
|
|
670
|
+
value: z2.string().optional().describe('The postback value to send when the button is clicked. Required if action is "postback"'),
|
|
671
|
+
url: z2.string().optional().describe('The URL to open when the button is clicked. Required if action is "url"')
|
|
672
|
+
})
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
var Image = new Component({
|
|
553
676
|
type: "leaf",
|
|
554
677
|
name: "Image",
|
|
555
678
|
description: "Displays an image from a URL.",
|
|
@@ -564,23 +687,13 @@ var Image = {
|
|
|
564
687
|
}
|
|
565
688
|
],
|
|
566
689
|
leaf: {
|
|
567
|
-
props:
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
description: "The URL of the image (must be valid)",
|
|
572
|
-
required: true
|
|
573
|
-
},
|
|
574
|
-
{
|
|
575
|
-
name: "alt",
|
|
576
|
-
type: "string",
|
|
577
|
-
description: "Alternative text describing the image",
|
|
578
|
-
required: false
|
|
579
|
-
}
|
|
580
|
-
]
|
|
690
|
+
props: z2.object({
|
|
691
|
+
url: z2.string().describe("The URL of the image (must be valid)"),
|
|
692
|
+
alt: z2.string().optional().describe("Alternative text describing the image")
|
|
693
|
+
})
|
|
581
694
|
}
|
|
582
|
-
};
|
|
583
|
-
var File = {
|
|
695
|
+
});
|
|
696
|
+
var File = new Component({
|
|
584
697
|
type: "leaf",
|
|
585
698
|
name: "File",
|
|
586
699
|
description: "Sends a downloadable file to the user.",
|
|
@@ -595,23 +708,13 @@ var File = {
|
|
|
595
708
|
}
|
|
596
709
|
],
|
|
597
710
|
leaf: {
|
|
598
|
-
props:
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
description: "The URL of the file (must be valid)",
|
|
603
|
-
required: true
|
|
604
|
-
},
|
|
605
|
-
{
|
|
606
|
-
name: "name",
|
|
607
|
-
type: "string",
|
|
608
|
-
description: "The display name of the file",
|
|
609
|
-
required: false
|
|
610
|
-
}
|
|
611
|
-
]
|
|
711
|
+
props: z2.object({
|
|
712
|
+
url: z2.string().describe("The URL of the file (must be valid)"),
|
|
713
|
+
name: z2.string().optional().describe("The display name of the file")
|
|
714
|
+
})
|
|
612
715
|
}
|
|
613
|
-
};
|
|
614
|
-
var Video = {
|
|
716
|
+
});
|
|
717
|
+
var Video = new Component({
|
|
615
718
|
type: "leaf",
|
|
616
719
|
name: "Video",
|
|
617
720
|
description: "Embeds a video from a URL.",
|
|
@@ -626,23 +729,13 @@ var Video = {
|
|
|
626
729
|
}
|
|
627
730
|
],
|
|
628
731
|
leaf: {
|
|
629
|
-
props:
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
description: "The URL of the video (must be valid)",
|
|
634
|
-
required: true
|
|
635
|
-
},
|
|
636
|
-
{
|
|
637
|
-
name: "title",
|
|
638
|
-
type: "string",
|
|
639
|
-
description: "Title for the video",
|
|
640
|
-
required: false
|
|
641
|
-
}
|
|
642
|
-
]
|
|
732
|
+
props: z2.object({
|
|
733
|
+
url: z2.string().describe("The URL of the video (must be valid)"),
|
|
734
|
+
title: z2.string().optional().describe("Title for the video")
|
|
735
|
+
})
|
|
643
736
|
}
|
|
644
|
-
};
|
|
645
|
-
var Audio = {
|
|
737
|
+
});
|
|
738
|
+
var Audio = new Component({
|
|
646
739
|
type: "leaf",
|
|
647
740
|
name: "Audio",
|
|
648
741
|
description: "Plays an audio clip from a URL.",
|
|
@@ -657,23 +750,13 @@ var Audio = {
|
|
|
657
750
|
}
|
|
658
751
|
],
|
|
659
752
|
leaf: {
|
|
660
|
-
props:
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
description: "The URL of the audio clip (must be valid)",
|
|
665
|
-
required: true
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
name: "title",
|
|
669
|
-
type: "string",
|
|
670
|
-
description: "Title for the audio clip",
|
|
671
|
-
required: false
|
|
672
|
-
}
|
|
673
|
-
]
|
|
753
|
+
props: z2.object({
|
|
754
|
+
url: z2.string().describe("The URL of the audio clip (must be valid)"),
|
|
755
|
+
title: z2.string().optional().describe("Title for the audio clip")
|
|
756
|
+
})
|
|
674
757
|
}
|
|
675
|
-
};
|
|
676
|
-
var Card = {
|
|
758
|
+
});
|
|
759
|
+
var Card = new Component({
|
|
677
760
|
type: "container",
|
|
678
761
|
name: "Card",
|
|
679
762
|
description: "A visual card component that can include an image and buttons.",
|
|
@@ -692,33 +775,23 @@ var Card = {
|
|
|
692
775
|
}
|
|
693
776
|
],
|
|
694
777
|
container: {
|
|
695
|
-
props:
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
description: "Title text (1\u2013250 characters)",
|
|
700
|
-
required: true
|
|
701
|
-
},
|
|
702
|
-
{
|
|
703
|
-
name: "subtitle",
|
|
704
|
-
type: "string",
|
|
705
|
-
description: "Optional subtitle for the card",
|
|
706
|
-
required: false
|
|
707
|
-
}
|
|
708
|
-
],
|
|
778
|
+
props: z2.object({
|
|
779
|
+
title: z2.string().min(1).max(250).describe("Title text (1\u2013250 characters)"),
|
|
780
|
+
subtitle: z2.string().optional().describe("Optional subtitle for the card")
|
|
781
|
+
}),
|
|
709
782
|
children: [
|
|
710
783
|
{
|
|
711
784
|
description: "Image (optional, max 1)",
|
|
712
|
-
component: Image
|
|
785
|
+
component: Image.definition
|
|
713
786
|
},
|
|
714
787
|
{
|
|
715
788
|
description: "Button (optional, up to 5)",
|
|
716
|
-
component: Button
|
|
789
|
+
component: Button.definition
|
|
717
790
|
}
|
|
718
791
|
]
|
|
719
792
|
}
|
|
720
|
-
};
|
|
721
|
-
var Carousel = {
|
|
793
|
+
});
|
|
794
|
+
var Carousel = new Component({
|
|
722
795
|
type: "container",
|
|
723
796
|
name: "Carousel",
|
|
724
797
|
description: "A virtual container for displaying 1 to 10 Card components as a carousel.",
|
|
@@ -742,16 +815,16 @@ var Carousel = {
|
|
|
742
815
|
}
|
|
743
816
|
],
|
|
744
817
|
container: {
|
|
745
|
-
props:
|
|
818
|
+
props: z2.object({}),
|
|
746
819
|
children: [
|
|
747
820
|
{
|
|
748
821
|
description: "Card component (required, 1\u201310 allowed)",
|
|
749
|
-
component: Card
|
|
822
|
+
component: Card.definition
|
|
750
823
|
}
|
|
751
824
|
]
|
|
752
825
|
}
|
|
753
|
-
};
|
|
754
|
-
var Text = {
|
|
826
|
+
});
|
|
827
|
+
var Text = new Component({
|
|
755
828
|
type: "default",
|
|
756
829
|
name: "Message",
|
|
757
830
|
aliases: ["Text", "Markdown"],
|
|
@@ -766,10 +839,10 @@ var Text = {
|
|
|
766
839
|
}
|
|
767
840
|
],
|
|
768
841
|
default: {
|
|
769
|
-
props:
|
|
842
|
+
props: z2.object({}),
|
|
770
843
|
children: []
|
|
771
844
|
}
|
|
772
|
-
};
|
|
845
|
+
});
|
|
773
846
|
var DefaultComponents = {
|
|
774
847
|
Button,
|
|
775
848
|
Image,
|
|
@@ -781,31 +854,54 @@ var DefaultComponents = {
|
|
|
781
854
|
Text
|
|
782
855
|
};
|
|
783
856
|
|
|
857
|
+
// src/chat.ts
|
|
858
|
+
var Chat = class {
|
|
859
|
+
handler;
|
|
860
|
+
transcript;
|
|
861
|
+
components;
|
|
862
|
+
constructor(props) {
|
|
863
|
+
this.handler = props.handler;
|
|
864
|
+
this.components = props.components;
|
|
865
|
+
this.transcript = props.transcript || [];
|
|
866
|
+
}
|
|
867
|
+
onExecutionDone(_result) {
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
|
|
784
871
|
// src/index.ts
|
|
785
|
-
var
|
|
786
|
-
const { executeContext
|
|
787
|
-
return
|
|
872
|
+
var execute = async (props) => {
|
|
873
|
+
const { executeContext } = await import("./llmz-YE5N54IU.js");
|
|
874
|
+
return executeContext(props);
|
|
788
875
|
};
|
|
789
876
|
var init = async () => {
|
|
790
|
-
await import("./llmz-
|
|
791
|
-
await import("./component-
|
|
792
|
-
await import("./tool-
|
|
793
|
-
await import("./exit-
|
|
794
|
-
await import("./jsx-
|
|
795
|
-
await import("./vm-
|
|
796
|
-
await import("./utils-
|
|
797
|
-
await import("./truncator-
|
|
798
|
-
await import("./typings-
|
|
799
|
-
await import("./dual-modes-
|
|
877
|
+
await import("./llmz-YE5N54IU.js");
|
|
878
|
+
await import("./component-R2Y74VUI.js");
|
|
879
|
+
await import("./tool-LY77IWV2.js");
|
|
880
|
+
await import("./exit-OIYZLBVJ.js");
|
|
881
|
+
await import("./jsx-AEHVFB3L.js");
|
|
882
|
+
await import("./vm-ZUQOSRRM.js");
|
|
883
|
+
await import("./utils-L5GLCS3C.js");
|
|
884
|
+
await import("./truncator-WAL2GCUY.js");
|
|
885
|
+
await import("./typings-AIV2OASX.js");
|
|
886
|
+
await import("./dual-modes-ZUQKPJFH.js");
|
|
800
887
|
};
|
|
801
888
|
export {
|
|
889
|
+
Chat,
|
|
890
|
+
CitationsManager,
|
|
891
|
+
Component,
|
|
802
892
|
DefaultComponents,
|
|
803
893
|
Exit,
|
|
894
|
+
ListenExit,
|
|
804
895
|
ObjectInstance,
|
|
805
896
|
Snapshot,
|
|
806
897
|
SnapshotSignal,
|
|
898
|
+
ThinkExit,
|
|
807
899
|
ThinkSignal,
|
|
808
900
|
Tool,
|
|
809
|
-
|
|
810
|
-
|
|
901
|
+
assertValidComponent,
|
|
902
|
+
execute,
|
|
903
|
+
getValue,
|
|
904
|
+
init,
|
|
905
|
+
isAnyComponent,
|
|
906
|
+
isComponent
|
|
811
907
|
};
|
|
@@ -3,9 +3,8 @@ import {
|
|
|
3
3
|
createJsxComponent,
|
|
4
4
|
isAnyJsxComponent,
|
|
5
5
|
isJsxComponent
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YSQDPG26.js";
|
|
6
|
+
} from "./chunk-ORQP26SZ.js";
|
|
7
|
+
import "./chunk-7WRN4E42.js";
|
|
9
8
|
export {
|
|
10
9
|
Jsx,
|
|
11
10
|
createJsxComponent,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkKMZDFWYZcjs = require('./chunk-KMZDFWYZ.cjs');
|
|
7
|
+
require('./chunk-UQOBUJIQ.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.Jsx = _chunkKMZDFWYZcjs.Jsx; exports.createJsxComponent = _chunkKMZDFWYZcjs.createJsxComponent; exports.isAnyJsxComponent = _chunkKMZDFWYZcjs.isAnyJsxComponent; exports.isJsxComponent = _chunkKMZDFWYZcjs.isJsxComponent;
|