@runtypelabs/persona 4.10.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-4ROVJ1gA.d.cts → types-DveIaNx6.d.cts} +11 -316
- package/dist/animations/{types-4ROVJ1gA.d.ts → types-DveIaNx6.d.ts} +11 -316
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/chunk-MMUPR2JW.js +1 -0
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/{context-mentions-7S5KVUTG.js → context-mentions-ONG7A7M6.js} +1 -1
- package/dist/context-mentions.d.cts +35 -316
- package/dist/context-mentions.d.ts +35 -316
- package/dist/index.cjs +67 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -317
- package/dist/index.d.ts +40 -317
- package/dist/index.global.js +55 -55
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +78 -78
- package/dist/index.js.map +1 -1
- package/dist/smart-dom-reader.d.cts +35 -316
- package/dist/smart-dom-reader.d.ts +35 -316
- package/dist/theme-editor-preview.cjs +66 -66
- package/dist/theme-editor-preview.d.cts +35 -316
- package/dist/theme-editor-preview.d.ts +35 -316
- package/dist/theme-editor-preview.js +55 -55
- package/dist/theme-editor.cjs +5 -5
- package/dist/theme-editor.d.cts +35 -316
- package/dist/theme-editor.d.ts +35 -316
- package/dist/theme-editor.js +9 -9
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/src/components/approval-bubble.ts +0 -1
- package/src/components/composer-parts.ts +19 -19
- package/src/components/context-mention-button.test.ts +5 -1
- package/src/components/context-mention-button.ts +6 -4
- package/src/components/header-builder.test.ts +3 -3
- package/src/components/header-parts.ts +14 -108
- package/src/components/message-bubble.test.ts +49 -0
- package/src/components/message-bubble.ts +8 -7
- package/src/components/reasoning-bubble.ts +0 -2
- package/src/components/tool-bubble.ts +0 -2
- package/src/generated/runtype-openapi-contract.ts +11 -317
- package/src/index-core.ts +7 -1
- package/src/runtime/host-layout.test.ts +94 -0
- package/src/runtime/host-layout.ts +9 -1
- package/src/runtime/init.test.ts +33 -0
- package/src/runtime/init.ts +4 -0
- package/src/styles/widget.css +118 -58
- package/src/theme-editor/sections.test.ts +33 -0
- package/src/theme-editor/sections.ts +10 -1
- package/src/types.ts +25 -0
- package/src/ui.attachments-drop.test.ts +2 -1
- package/src/ui.message-width.test.ts +407 -0
- package/src/ui.mount-fill-min-width.test.ts +81 -0
- package/src/ui.ts +158 -238
- package/src/utils/table-scroll-fade.test.ts +123 -0
- package/src/utils/table-scroll-fade.ts +75 -0
- package/src/utils/tooltip.test.ts +226 -0
- package/src/utils/tooltip.ts +245 -0
- package/dist/chunk-IPVK3KOM.js +0 -1
|
@@ -17,6 +17,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
17
17
|
completedAt?: string;
|
|
18
18
|
durationMs?: number;
|
|
19
19
|
executionId: string;
|
|
20
|
+
externalAgent?: {
|
|
21
|
+
contextId?: string;
|
|
22
|
+
taskId?: string;
|
|
23
|
+
};
|
|
20
24
|
failedSteps?: number;
|
|
21
25
|
finalOutput?: string;
|
|
22
26
|
iterations?: number;
|
|
@@ -31,6 +35,7 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
31
35
|
input: number;
|
|
32
36
|
output: number;
|
|
33
37
|
};
|
|
38
|
+
totalTokensUsed?: number;
|
|
34
39
|
type: "execution_complete";
|
|
35
40
|
}) | ({
|
|
36
41
|
blockReason?: string;
|
|
@@ -290,12 +295,17 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
290
295
|
stepId?: string;
|
|
291
296
|
success: boolean;
|
|
292
297
|
toolCallId: string;
|
|
298
|
+
toolCost?: number;
|
|
293
299
|
toolName?: string;
|
|
294
300
|
type: "tool_complete";
|
|
295
301
|
} | {
|
|
296
302
|
approvalId: string;
|
|
297
303
|
description?: string;
|
|
298
304
|
executionId: string;
|
|
305
|
+
externalAgent?: {
|
|
306
|
+
contextId?: string;
|
|
307
|
+
taskId?: string;
|
|
308
|
+
};
|
|
299
309
|
iteration?: number;
|
|
300
310
|
parameters?: Record<string, unknown>;
|
|
301
311
|
reason?: string;
|
|
@@ -363,326 +373,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
363
373
|
type: "custom";
|
|
364
374
|
value?: unknown;
|
|
365
375
|
};
|
|
366
|
-
type RuntypeFlowSSEEvent = {
|
|
367
|
-
executionContext?: Record<string, unknown>;
|
|
368
|
-
executionId?: string;
|
|
369
|
-
flowId: string;
|
|
370
|
-
flowName?: string;
|
|
371
|
-
input?: unknown;
|
|
372
|
-
seq?: number;
|
|
373
|
-
source?: string;
|
|
374
|
-
startedAt: string;
|
|
375
|
-
toolContext?: {
|
|
376
|
-
executionId: string;
|
|
377
|
-
stepId: string;
|
|
378
|
-
toolId: string;
|
|
379
|
-
};
|
|
380
|
-
totalSteps?: number;
|
|
381
|
-
type: "flow_start";
|
|
382
|
-
} | {
|
|
383
|
-
claudeManagedAgentId?: string;
|
|
384
|
-
completedAt?: string;
|
|
385
|
-
completedSteps?: number;
|
|
386
|
-
duration?: number;
|
|
387
|
-
executionContext?: Record<string, unknown>;
|
|
388
|
-
executionId?: string;
|
|
389
|
-
executionTime?: number;
|
|
390
|
-
failedSteps?: number;
|
|
391
|
-
finalOutput?: string;
|
|
392
|
-
flowId?: string;
|
|
393
|
-
flowName?: string;
|
|
394
|
-
output?: unknown;
|
|
395
|
-
seq?: number;
|
|
396
|
-
source?: string;
|
|
397
|
-
success?: boolean;
|
|
398
|
-
successfulSteps?: number;
|
|
399
|
-
toolContext?: {
|
|
400
|
-
executionId: string;
|
|
401
|
-
stepId: string;
|
|
402
|
-
toolId: string;
|
|
403
|
-
};
|
|
404
|
-
totalSteps?: number;
|
|
405
|
-
totalTokensUsed?: number;
|
|
406
|
-
type: "flow_complete";
|
|
407
|
-
} | ({
|
|
408
|
-
blockReason?: string;
|
|
409
|
-
code?: string;
|
|
410
|
-
error: string | {
|
|
411
|
-
code: string;
|
|
412
|
-
message: string;
|
|
413
|
-
stepId?: string;
|
|
414
|
-
stepType?: string;
|
|
415
|
-
};
|
|
416
|
-
executionId?: string;
|
|
417
|
-
executionTime?: number;
|
|
418
|
-
flowId?: string;
|
|
419
|
-
seq?: number;
|
|
420
|
-
timestamp?: string;
|
|
421
|
-
toolContext?: {
|
|
422
|
-
executionId: string;
|
|
423
|
-
stepId: string;
|
|
424
|
-
toolId: string;
|
|
425
|
-
};
|
|
426
|
-
type: "flow_error";
|
|
427
|
-
upgradeUrl?: string;
|
|
428
|
-
}) | ({
|
|
429
|
-
approvalId?: string;
|
|
430
|
-
awaitReason?: string;
|
|
431
|
-
awaitedAt: string;
|
|
432
|
-
crawlId?: string;
|
|
433
|
-
elicitation?: {
|
|
434
|
-
message: string;
|
|
435
|
-
mode: "form" | "url";
|
|
436
|
-
pauseCount?: number;
|
|
437
|
-
requestedSchema?: Record<string, unknown>;
|
|
438
|
-
serverName?: string;
|
|
439
|
-
url?: string;
|
|
440
|
-
};
|
|
441
|
-
executionId?: string;
|
|
442
|
-
flowId: string;
|
|
443
|
-
origin?: "webmcp" | "sdk";
|
|
444
|
-
pageOrigin?: string;
|
|
445
|
-
parameters?: Record<string, unknown>;
|
|
446
|
-
seq?: number;
|
|
447
|
-
stepId?: string;
|
|
448
|
-
timeout?: number;
|
|
449
|
-
toolCallId?: string;
|
|
450
|
-
toolId?: string;
|
|
451
|
-
toolName?: string;
|
|
452
|
-
type: "flow_await";
|
|
453
|
-
}) | {
|
|
454
|
-
estimatedTokens?: number;
|
|
455
|
-
executionId?: string;
|
|
456
|
-
id?: string;
|
|
457
|
-
index?: number;
|
|
458
|
-
name?: string;
|
|
459
|
-
outputVariable?: string;
|
|
460
|
-
seq?: number;
|
|
461
|
-
startedAt: string;
|
|
462
|
-
stepId?: string;
|
|
463
|
-
stepName?: string;
|
|
464
|
-
stepType?: string;
|
|
465
|
-
toolContext?: {
|
|
466
|
-
executionId: string;
|
|
467
|
-
stepId: string;
|
|
468
|
-
toolId: string;
|
|
469
|
-
};
|
|
470
|
-
totalSteps?: number;
|
|
471
|
-
type: "step_start";
|
|
472
|
-
} | {
|
|
473
|
-
delta?: string;
|
|
474
|
-
executionId?: string;
|
|
475
|
-
id?: string;
|
|
476
|
-
messageId?: string;
|
|
477
|
-
partId?: string;
|
|
478
|
-
seq?: number;
|
|
479
|
-
text?: string;
|
|
480
|
-
toolContext?: {
|
|
481
|
-
executionId: string;
|
|
482
|
-
stepId: string;
|
|
483
|
-
toolId: string;
|
|
484
|
-
};
|
|
485
|
-
toolId?: string;
|
|
486
|
-
type: "step_delta";
|
|
487
|
-
} | ({
|
|
488
|
-
completedAt?: string;
|
|
489
|
-
duration?: number;
|
|
490
|
-
durationMs?: number;
|
|
491
|
-
error?: string | null;
|
|
492
|
-
executionId?: string;
|
|
493
|
-
executionTime?: number;
|
|
494
|
-
id?: string;
|
|
495
|
-
index?: number;
|
|
496
|
-
name?: string;
|
|
497
|
-
output?: unknown;
|
|
498
|
-
result?: unknown;
|
|
499
|
-
seq?: number;
|
|
500
|
-
stepId?: string;
|
|
501
|
-
stepName?: string;
|
|
502
|
-
stepType?: string;
|
|
503
|
-
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
504
|
-
success?: boolean;
|
|
505
|
-
tokensUsed?: number;
|
|
506
|
-
toolContext?: {
|
|
507
|
-
executionId: string;
|
|
508
|
-
stepId: string;
|
|
509
|
-
toolId: string;
|
|
510
|
-
};
|
|
511
|
-
type: "step_complete";
|
|
512
|
-
unresolvedVariables?: Array<string>;
|
|
513
|
-
}) | {
|
|
514
|
-
error: string;
|
|
515
|
-
executionId?: string;
|
|
516
|
-
executionTime?: number;
|
|
517
|
-
id?: string;
|
|
518
|
-
index?: number;
|
|
519
|
-
name?: string;
|
|
520
|
-
seq?: number;
|
|
521
|
-
stepType?: string;
|
|
522
|
-
type: "step_error";
|
|
523
|
-
} | {
|
|
524
|
-
error?: string;
|
|
525
|
-
executionId?: string;
|
|
526
|
-
id: string;
|
|
527
|
-
index?: number;
|
|
528
|
-
name?: string;
|
|
529
|
-
seq?: number;
|
|
530
|
-
skippedAt: string;
|
|
531
|
-
stepType: string;
|
|
532
|
-
totalSteps: number;
|
|
533
|
-
type: "step_skip";
|
|
534
|
-
when: string;
|
|
535
|
-
} | ({
|
|
536
|
-
elicitation?: {
|
|
537
|
-
message: string;
|
|
538
|
-
mode: "form" | "url";
|
|
539
|
-
pauseCount?: number;
|
|
540
|
-
requestedSchema?: Record<string, unknown>;
|
|
541
|
-
serverName?: string;
|
|
542
|
-
url?: string;
|
|
543
|
-
};
|
|
544
|
-
executionId?: string;
|
|
545
|
-
reason?: string;
|
|
546
|
-
seq?: number;
|
|
547
|
-
type: "step_await";
|
|
548
|
-
[key: string]: unknown;
|
|
549
|
-
}) | ({
|
|
550
|
-
agentContext?: {
|
|
551
|
-
executionId: string;
|
|
552
|
-
iteration: number;
|
|
553
|
-
seq: number;
|
|
554
|
-
};
|
|
555
|
-
executionId?: string;
|
|
556
|
-
hiddenParameterNames?: Array<string>;
|
|
557
|
-
name?: string;
|
|
558
|
-
parameters?: Record<string, unknown>;
|
|
559
|
-
providerOptions?: Record<string, unknown>;
|
|
560
|
-
seq?: number;
|
|
561
|
-
startedAt?: string;
|
|
562
|
-
stepId?: string;
|
|
563
|
-
toolCallId?: string;
|
|
564
|
-
toolId?: string;
|
|
565
|
-
toolName?: string;
|
|
566
|
-
toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
|
|
567
|
-
type: "tool_start";
|
|
568
|
-
[key: string]: unknown;
|
|
569
|
-
}) | {
|
|
570
|
-
delta?: string;
|
|
571
|
-
executionId?: string;
|
|
572
|
-
seq?: number;
|
|
573
|
-
toolId?: string;
|
|
574
|
-
type: "tool_delta";
|
|
575
|
-
[key: string]: unknown;
|
|
576
|
-
} | {
|
|
577
|
-
delta: string;
|
|
578
|
-
executionId?: string;
|
|
579
|
-
seq?: number;
|
|
580
|
-
stepId?: string;
|
|
581
|
-
toolCallId?: string;
|
|
582
|
-
toolId?: string;
|
|
583
|
-
type: "tool_input_delta";
|
|
584
|
-
} | {
|
|
585
|
-
executionId?: string;
|
|
586
|
-
hiddenParameterNames?: Array<string>;
|
|
587
|
-
parameters: Record<string, unknown>;
|
|
588
|
-
providerOptions?: Record<string, unknown>;
|
|
589
|
-
seq?: number;
|
|
590
|
-
stepId?: string;
|
|
591
|
-
toolCallId?: string;
|
|
592
|
-
toolId?: string;
|
|
593
|
-
toolName?: string;
|
|
594
|
-
type: "tool_input_complete";
|
|
595
|
-
} | {
|
|
596
|
-
agentContext?: {
|
|
597
|
-
executionId: string;
|
|
598
|
-
iteration: number;
|
|
599
|
-
seq: number;
|
|
600
|
-
};
|
|
601
|
-
completedAt?: string;
|
|
602
|
-
error?: string;
|
|
603
|
-
executionId?: string;
|
|
604
|
-
executionTime?: number;
|
|
605
|
-
name?: string;
|
|
606
|
-
result?: unknown;
|
|
607
|
-
seq?: number;
|
|
608
|
-
stepId?: string;
|
|
609
|
-
success: boolean;
|
|
610
|
-
toolCallId?: string;
|
|
611
|
-
toolCost?: number;
|
|
612
|
-
toolId?: string;
|
|
613
|
-
toolName?: string;
|
|
614
|
-
type: "tool_complete";
|
|
615
|
-
} | {
|
|
616
|
-
agentContext?: {
|
|
617
|
-
executionId: string;
|
|
618
|
-
iteration: number;
|
|
619
|
-
seq: number;
|
|
620
|
-
};
|
|
621
|
-
error: string;
|
|
622
|
-
executionId?: string;
|
|
623
|
-
executionTime?: number;
|
|
624
|
-
failedAt?: string;
|
|
625
|
-
name: string;
|
|
626
|
-
seq?: number;
|
|
627
|
-
toolId: string;
|
|
628
|
-
type: "tool_error";
|
|
629
|
-
} | {
|
|
630
|
-
executionId?: string;
|
|
631
|
-
id: string;
|
|
632
|
-
seq?: number;
|
|
633
|
-
text: string;
|
|
634
|
-
type: "chunk";
|
|
635
|
-
} | {
|
|
636
|
-
executionId?: string;
|
|
637
|
-
seq?: number;
|
|
638
|
-
type: "text_start";
|
|
639
|
-
[key: string]: unknown;
|
|
640
|
-
} | {
|
|
641
|
-
executionId?: string;
|
|
642
|
-
seq?: number;
|
|
643
|
-
type: "text_end";
|
|
644
|
-
[key: string]: unknown;
|
|
645
|
-
} | {
|
|
646
|
-
executionId?: string;
|
|
647
|
-
seq?: number;
|
|
648
|
-
type: "reason_start";
|
|
649
|
-
[key: string]: unknown;
|
|
650
|
-
} | {
|
|
651
|
-
executionId?: string;
|
|
652
|
-
seq?: number;
|
|
653
|
-
type: "reason_delta";
|
|
654
|
-
[key: string]: unknown;
|
|
655
|
-
} | {
|
|
656
|
-
executionId?: string;
|
|
657
|
-
seq?: number;
|
|
658
|
-
type: "reason_complete";
|
|
659
|
-
[key: string]: unknown;
|
|
660
|
-
} | {
|
|
661
|
-
executionId?: string;
|
|
662
|
-
seq?: number;
|
|
663
|
-
type: "source";
|
|
664
|
-
[key: string]: unknown;
|
|
665
|
-
} | {
|
|
666
|
-
executionId?: string;
|
|
667
|
-
seq?: number;
|
|
668
|
-
type: "fallback_start";
|
|
669
|
-
[key: string]: unknown;
|
|
670
|
-
} | {
|
|
671
|
-
executionId?: string;
|
|
672
|
-
seq?: number;
|
|
673
|
-
type: "fallback_complete";
|
|
674
|
-
[key: string]: unknown;
|
|
675
|
-
} | {
|
|
676
|
-
executionId?: string;
|
|
677
|
-
seq?: number;
|
|
678
|
-
type: "fallback_exhausted";
|
|
679
|
-
[key: string]: unknown;
|
|
680
|
-
};
|
|
681
376
|
type RuntypeStreamEventOf<U, T extends string> = Extract<U, {
|
|
682
377
|
type: T;
|
|
683
378
|
}>;
|
|
684
379
|
type RuntypeTurnCompleteEvent = RuntypeStreamEventOf<RuntypeExecutionStreamEvent, "turn_complete">;
|
|
685
|
-
type RuntypeStepCompleteEvent = RuntypeStreamEventOf<
|
|
380
|
+
type RuntypeStepCompleteEvent = RuntypeStreamEventOf<RuntypeExecutionStreamEvent, "step_complete">;
|
|
686
381
|
type RuntypeStopReasonKind = NonNullable<RuntypeTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"]>;
|
|
687
382
|
|
|
688
383
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var zt=(e,t)=>{let n=document.createElement(e);return t&&(n.className=t),n};var Bt=()=>document.createDocumentFragment(),Ft=(e,t={},...n)=>{let o=document.createElement(e);if(t.className&&(o.className=t.className),t.text!==void 0&&(o.textContent=t.text),t.attrs)for(let[s,a]of Object.entries(t.attrs))o.setAttribute(s,a);if(t.style){let s=o.style,a=t.style;for(let c of Object.keys(a)){let l=a[c];l!=null&&(s[c]=l)}}let r=n.filter(s=>s!=null);return r.length>0&&o.append(...r),o},Kt=(...e)=>e.filter(Boolean).join(" ");import{Activity as A,ArrowDown as k,ArrowUp as P,ArrowUpRight as L,Bot as I,ChevronDown as R,ChevronUp as D,ChevronRight as H,ChevronLeft as O,Check as z,Clipboard as B,ClipboardCopy as F,CodeXml as K,Copy as W,File as U,FileCode as j,FileSpreadsheet as $,FileText as q,ImagePlus as V,Loader as X,LoaderCircle as G,Mic as _,Paperclip as Y,RefreshCw as Z,Search as J,Send as Q,ShieldAlert as ee,ShieldCheck as te,ShieldX as ne,Square as oe,ThumbsDown as re,ThumbsUp as ie,Upload as se,Volume2 as ae,X as le,User as ce,Mail as de,Phone as ue,Calendar as me,Clock as pe,Building as ge,MapPin as he,Lock as fe,Key as we,CreditCard as ye,AtSign as be,Hash as ve,Globe as xe,Link as Ce,CircleCheck as Se,CircleX as Ee,TriangleAlert as Te,Info as Me,Ban as Ne,Shield as Ae,ArrowLeft as ke,ArrowRight as Pe,ExternalLink as Le,Ellipsis as Ie,EllipsisVertical as Re,Menu as De,House as He,Plus as Oe,Minus as ze,Pencil as Be,Trash as Fe,Trash2 as Ke,Save as We,Download as Ue,Share as je,Funnel as $e,Settings as qe,RotateCw as Ve,Maximize as Xe,Minimize as Ge,ShoppingCart as _e,ShoppingBag as Ye,Package as Ze,Truck as Je,Tag as Qe,Gift as et,Receipt as tt,Wallet as nt,Store as ot,DollarSign as rt,Percent as it,Play as st,Pause as at,VolumeX as lt,Camera as ct,Image as dt,Film as ut,Headphones as mt,MessageCircle as pt,MessageSquare as gt,Bell as ht,Heart as ft,Star as wt,Eye as yt,EyeOff as bt,Bookmark as vt,CalendarDays as xt,History as Ct,Timer as St,Folder as Et,FolderOpen as Tt,Files as Mt,Sparkles as Nt,Zap as At,Sun as kt,Moon as Pt,Flag as Lt,Monitor as It,Smartphone as Rt}from"lucide";var Dt={activity:A,"arrow-down":k,"arrow-up":P,"arrow-up-right":L,bot:I,"chevron-down":R,"chevron-up":D,"chevron-right":H,"chevron-left":O,check:z,clipboard:B,"clipboard-copy":F,"code-xml":K,copy:W,file:U,"file-code":j,"file-spreadsheet":$,"file-text":q,"image-plus":V,loader:X,"loader-circle":G,mic:_,paperclip:Y,"refresh-cw":Z,search:J,send:Q,"shield-alert":ee,"shield-check":te,"shield-x":ne,square:oe,"thumbs-down":re,"thumbs-up":ie,upload:se,"volume-2":ae,x:le,user:ce,mail:de,phone:ue,calendar:me,clock:pe,building:ge,"map-pin":he,lock:fe,key:we,"credit-card":ye,"at-sign":be,hash:ve,globe:xe,link:Ce,"circle-check":Se,"circle-x":Ee,"triangle-alert":Te,info:Me,ban:Ne,shield:Ae,"arrow-left":ke,"arrow-right":Pe,"external-link":Le,ellipsis:Ie,"ellipsis-vertical":Re,menu:De,house:He,plus:Oe,minus:ze,pencil:Be,trash:Fe,"trash-2":Ke,save:We,download:Ue,share:je,funnel:$e,settings:qe,"rotate-cw":Ve,maximize:Xe,minimize:Ge,"shopping-cart":_e,"shopping-bag":Ye,package:Ze,truck:Je,tag:Qe,gift:et,receipt:tt,wallet:nt,store:ot,"dollar-sign":rt,percent:it,play:st,pause:at,"volume-x":lt,camera:ct,image:dt,film:ut,headphones:mt,"message-circle":pt,"message-square":gt,bell:ht,heart:ft,star:wt,eye:yt,"eye-off":bt,bookmark:vt,"calendar-days":xt,history:Ct,timer:St,folder:Et,"folder-open":Tt,files:Mt,sparkles:Nt,zap:At,sun:kt,moon:Pt,flag:Lt,monitor:It,smartphone:Rt},jt=(e,t=24,n="currentColor",o=2)=>{let r=Dt[e];return r?Ht(r,t,n,o):(console.warn(`Lucide icon "${e}" is not in the Persona registry. Add it to packages/widget/src/utils/icons.ts (see docs/icon-registry-shortlist.md).`),null)};function Ht(e,t,n,o){if(!Array.isArray(e))return null;let r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("width",String(t)),r.setAttribute("height",String(t)),r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("fill","none"),r.setAttribute("stroke",n),r.setAttribute("stroke-width",String(o)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("aria-hidden","true"),e.forEach(s=>{if(!Array.isArray(s)||s.length<2)return;let a=s[0],c=s[1];if(!c)return;let l=document.createElementNS("http://www.w3.org/2000/svg",a);Object.entries(c).forEach(([h,f])=>{h!=="stroke"&&l.setAttribute(h,String(f))}),r.appendChild(l)}),r}function qt(e){let t={trigger:e.trigger??"@",position:e.triggerPosition??"anywhere",allowSpaces:!1,sources:Array.isArray(e.sources)?e.sources:[],searchPlaceholder:e.searchPlaceholder,showButton:e.showButton!==!1,buttonIconName:e.buttonIconName,buttonTooltipText:e.buttonTooltipText},n=(e.triggers??[]).map(o=>({trigger:o.trigger,position:o.triggerPosition??"anywhere",allowSpaces:o.allowSpaces??!1,sources:Array.isArray(o.sources)?o.sources:[],searchPlaceholder:o.searchPlaceholder,showButton:o.showButton===!0,buttonIconName:o.buttonIconName,buttonTooltipText:o.buttonTooltipText}));return[t,...n]}function T(e){let t=e.getRootNode?.();return t instanceof ShadowRoot||t instanceof Document?t:e.ownerDocument??document}function b(e,t,n){let o=e instanceof Document?e.head:e,r=t.replace(/["\\]/g,"\\$&");if(o.querySelector(`style[data-persona-plugin-style="${r}"]`))return;let a=(e instanceof Document?e:e.ownerDocument??document).createElement("style");a.setAttribute("data-persona-plugin-style",t),a.textContent=n,o.appendChild(a)}function Xt(e,t,n){if(e instanceof Document||e instanceof ShadowRoot){b(e,t,n);return}let o=e;if(o.isConnected){b(T(o),t,n);return}let r=o.ownerDocument??document;b(r,t,n),queueMicrotask(()=>{let s=T(o);s!==r&&b(s,t,n)})}function Ot(e){let t=e.getRootNode?.();return t instanceof ShadowRoot?t:(e.ownerDocument??document).body}function Gt(e){let{anchor:t,content:n,placement:o="bottom-start",offset:r=6,matchAnchorWidth:s=!1,horizontalOffset:a,verticalOffset:c,zIndex:l=2147483e3,onOpen:h,onDismiss:f}=e,M=e.container??Ot(t),d=!1,w=null,v=()=>{if(!d)return;let i=t.getBoundingClientRect();n.style.position="fixed",s&&(n.style.minWidth=`${i.width}px`),a&&(n.style.maxWidth=`${i.width}px`);let m=n.getBoundingClientRect(),u=c?.()??null,y=u!=null?i.top+u:i.top,x=o==="top-start"||o==="top-end"?y-r-m.height:i.bottom+r,g=o==="bottom-end"||o==="top-end"?i.right-m.width:i.left,E=a?.()??null;if(E!=null){let N=Math.max(i.left,i.right-m.width);g=Math.min(Math.max(i.left+E,i.left),N)}n.style.top=`${x}px`,n.style.left=`${g}px`},p=()=>{d&&(d=!1,w&&(w(),w=null),n.remove())},S=()=>{if(d)return;d=!0,l!=null&&(n.style.zIndex=String(l)),M.appendChild(n),v();let i=(t.ownerDocument??document).defaultView??window,m=t.ownerDocument??document,u=()=>{if(!t.isConnected){p(),f?.("anchor-removed");return}v()},y=C=>{let g=typeof C.composedPath=="function"?C.composedPath():[];g.includes(n)||g.includes(t)||(p(),f?.("outside"))},x=i.setTimeout(()=>{m.addEventListener("pointerdown",y,!0)},0);i.addEventListener("scroll",u,!0),i.addEventListener("resize",u),w=()=>{i.clearTimeout(x),m.removeEventListener("pointerdown",y,!0),i.removeEventListener("scroll",u,!0),i.removeEventListener("resize",u)},h?.()};return{get isOpen(){return d},open:S,close:p,toggle:()=>d?p():S(),reposition:v,destroy:p}}function _t(e){return(typeof e.composedPath=="function"?e.composedPath():[]).some(n=>n instanceof HTMLElement&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.isContentEditable))}export{zt as a,Bt as b,Ft as c,Kt as d,jt as e,qt as f,Xt as g,Gt as h,_t as i};
|
package/dist/codegen.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var T=(e,r)=>{for(var n in r)$(e,n,{get:r[n],enumerable:!0})},M=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of I(r))!_.call(e,a)&&a!==n&&$(e,a,{get:()=>r[a],enumerable:!(s=v(r,a))||s.enumerable});return e};var R=e=>M($({},"__esModule",{value:!0}),e);var U={};T(U,{generateCodeSnippet:()=>k});module.exports=R(U);var x="4.
|
|
1
|
+
"use strict";var $=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var T=(e,r)=>{for(var n in r)$(e,n,{get:r[n],enumerable:!0})},M=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of I(r))!_.call(e,a)&&a!==n&&$(e,a,{get:()=>r[a],enumerable:!(s=v(r,a))||s.enumerable});return e};var R=e=>M($({},"__esModule",{value:!0}),e);var U={};T(U,{generateCodeSnippet:()=>k});module.exports=R(U);var x="4.11.0";var c=x;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function H(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var S=`({ text, message }: any) => {
|
|
2
2
|
const jsonSource = (message as any).rawContent || text || message.content;
|
|
3
3
|
if (!jsonSource || typeof jsonSource !== 'string') return null;
|
|
4
4
|
let cleanJson = jsonSource
|
package/dist/codegen.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var w="4.
|
|
1
|
+
var w="4.11.0";var c=w;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(i=>i.toString()).join(", ")}]`:e.toString()}function P(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var x=`({ text, message }: any) => {
|
|
2
2
|
const jsonSource = (message as any).rawContent || text || message.content;
|
|
3
3
|
if (!jsonSource || typeof jsonSource !== 'string') return null;
|
|
4
4
|
let cleanJson = jsonSource
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as S,
|
|
1
|
+
import{a as S,c as C,e as N,f as X,g as J,h as Z}from"./chunk-MMUPR2JW.js";import{b as ee}from"./chunk-UPO4GUFC.js";import{a as _,c as Y}from"./chunk-IO5VVUKP.js";function te(s){let{ref:e,config:t,onRemove:n}=s;if(t.renderMentionChip){let u="resolving",A,T=t.renderMentionChip({ref:e,status:u,payload:A,remove:n});return{get el(){return T},setStatus:(z,E)=>{if(z===u&&E===A)return;u=z,A=E;let B=t.renderMentionChip({ref:e,status:u,payload:A,remove:n});T.replaceWith(B),T=B}}}let i=e.iconName??t.chipIconName??"at-sign",o=C("div",{className:"persona-mention-chip",attrs:{"data-persona-mention-chip":"","data-status":"resolving",title:e.label}}),r=S("span","persona-mention-chip-icon"),d=u=>{r.replaceChildren();let A=N(u,13,"currentColor",2);A&&r.appendChild(A)};d(i);let a=S("span","persona-mention-chip-spinner"),l=C("span",{className:"persona-mention-chip-label",text:e.label}),x=C("button",{className:"persona-mention-chip-remove",attrs:{type:"button","aria-label":`Remove ${e.label} context`}}),p=N("x",11,"currentColor",2.5);return p?x.appendChild(p):x.textContent="\xD7",x.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),n()}),o.appendChild(a),o.appendChild(l),o.appendChild(x),{el:o,setStatus:u=>{o.setAttribute("data-status",u),u==="resolving"?(a.parentNode!==o&&o.insertBefore(a,l),r.parentNode===o&&r.remove(),o.setAttribute("title",e.label)):(a.parentNode===o&&a.remove(),r.parentNode!==o&&o.insertBefore(r,l),u==="error"?(d("triangle-alert"),o.setAttribute("title",`Couldn't add ${e.label} to context`)):(d(i),o.setAttribute("title",e.label)))}}}function ce(s){let e=0;for(let t of s.split(`
|
|
2
2
|
`)){let n=/^ {0,3}(`+)/.exec(t);n&&n[1].length>e&&(e=n[1].length)}return e}function Q(s,e){let t="`".repeat(Math.max(3,ce(e)+1));return`${t}${s}
|
|
3
3
|
${e}
|
|
4
4
|
${t}`}function de(s,e,t){return e.includes("</document_content>")?Q(s,e):`<document index="${t+1}">
|