@40rty/ams-ui 0.3.2 → 0.4.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.
- package/dist/agent.js +5 -5
- package/dist/{chunk-MHUEIBJ3.js → chunk-GQURT3IR.js} +3 -47
- package/dist/{chunk-BFZ3YCUY.js → chunk-H6MSAD5M.js} +1 -40
- package/dist/{chunk-ORIOBWTD.js → chunk-PHXP2SKS.js} +5 -1
- package/dist/{chunk-OKP7MC72.js → chunk-RKPDCXL4.js} +241 -195
- package/dist/{chunk-TEPH476O.js → chunk-RMJDSHLA.js} +6 -36
- package/dist/hooks.js +4 -4
- package/dist/index.js +172 -338
- package/dist/presence.js +3 -4
- package/dist/shell.js +411 -537
- package/dist/thread-panel.js +3 -3
- package/dist/types/agent/presence/AgentAsk.d.ts +13 -0
- package/dist/types/agent/presence/index.d.ts +3 -1
- package/dist/types/agent/presence/read-data.d.ts +5 -0
- package/dist/types/components/ecommerce/cart/CartFoot.d.ts +1 -2
- package/dist/types/components/ecommerce/cart/CartLineRow.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/labels.d.ts +6 -0
- package/dist/types/shell/Composer.d.ts +1 -1
- package/dist/types/shell/ShellScaffold.d.ts +5 -2
- package/dist/types/shell/TurnAsk.d.ts +14 -0
- package/dist/types/shell/composer/AttachmentStrip.d.ts +1 -1
- package/dist/types/shell/dock-context.d.ts +1 -1
- package/dist/types/shell/index.d.ts +2 -2
- package/dist/types/shell/mobile/DefaultMobileShell.d.ts +4 -0
- package/dist/types/shell/mobile/IslandComposeGroup.d.ts +1 -1
- package/dist/types/shell/mobile/IslandInputBar.d.ts +1 -1
- package/dist/types/shell/mobile/MorphIsland.d.ts +1 -1
- package/dist/types/shell/mobile/PageComposerDock.d.ts +13 -0
- package/dist/types/shell/mobile/RestIsland.d.ts +1 -1
- package/dist/types/shell/slots.d.ts +1 -5
- package/package.json +3 -4
- package/dist/types/agent/presence/use-forget-fact.d.ts +0 -56
- package/dist/types/components/ecommerce/cart/use-cart-view.d.ts +0 -50
- package/dist/types/hooks/use-projection.d.ts +0 -24
- package/dist/types/shell/composer/heic-convert.d.ts +0 -6
- package/dist/types/shell/composer/useComposerAttachments.d.ts +0 -37
- package/dist/types/shell/composer/usePromptComposer.d.ts +0 -51
- package/dist/types/shell/use-dock-state.d.ts +0 -54
- package/dist/types/utils/use-is-seed-home.d.ts +0 -13
- package/dist/types/utils/use-safe-cart.d.ts +0 -17
- package/dist/types/utils/use-safe-facts.d.ts +0 -9
- package/dist/types/utils/use-safe-fourty-session.d.ts +0 -15
|
@@ -6,13 +6,10 @@ import {
|
|
|
6
6
|
factRegister,
|
|
7
7
|
readLabel,
|
|
8
8
|
useBandFacts,
|
|
9
|
-
useDismissedLabels,
|
|
10
|
-
useForgetFact,
|
|
11
|
-
useUndismissedFacts,
|
|
12
9
|
useVisibleFacts,
|
|
13
10
|
viewHasHeld,
|
|
14
11
|
viewIsEmpty
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RMJDSHLA.js";
|
|
16
13
|
import {
|
|
17
14
|
AnimatePresence,
|
|
18
15
|
motion,
|
|
@@ -98,7 +95,11 @@ var DEFAULT_LABELS = {
|
|
|
98
95
|
"Finding the balance",
|
|
99
96
|
"Starting from the top",
|
|
100
97
|
"Making room on the side"
|
|
101
|
-
]
|
|
98
|
+
],
|
|
99
|
+
ask: {
|
|
100
|
+
fallback: "Want me to do that?",
|
|
101
|
+
dismiss: "Dismiss"
|
|
102
|
+
}
|
|
102
103
|
},
|
|
103
104
|
menu: {
|
|
104
105
|
shopAll: (label) => `Shop all ${label}`
|
|
@@ -165,8 +166,41 @@ import {
|
|
|
165
166
|
usePresenceNotch,
|
|
166
167
|
useFormFactor
|
|
167
168
|
} from "@40rty/ams-sdk";
|
|
168
|
-
|
|
169
|
+
|
|
170
|
+
// src/agent/presence/AgentAsk.tsx
|
|
171
|
+
import { AGENT_ASK_SIGNAL, useConsumeStandingSignal, useFourtySession } from "@40rty/ams-sdk";
|
|
169
172
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
173
|
+
function AgentAsk() {
|
|
174
|
+
const standing = useConsumeStandingSignal(AGENT_ASK_SIGNAL);
|
|
175
|
+
const session = useFourtySession();
|
|
176
|
+
const labels = useLabels().presence.ask;
|
|
177
|
+
if (standing === null) return null;
|
|
178
|
+
const p = standing.payload;
|
|
179
|
+
const question = typeof p.ask === "string" && p.ask.length > 0 ? p.ask : labels.fallback;
|
|
180
|
+
const suggestions = Array.isArray(p.suggestions) ? p.suggestions.filter((x) => typeof x === "string" && x.length > 0) : [];
|
|
181
|
+
return /* @__PURE__ */ jsxs("div", { className: "fourty-ask", role: "status", "aria-live": "polite", children: [
|
|
182
|
+
/* @__PURE__ */ jsx2("p", { className: "fourty-ask__question", children: question }),
|
|
183
|
+
/* @__PURE__ */ jsxs("div", { className: "fourty-ask__actions", children: [
|
|
184
|
+
suggestions.map((s) => /* @__PURE__ */ jsx2(
|
|
185
|
+
"button",
|
|
186
|
+
{
|
|
187
|
+
type: "button",
|
|
188
|
+
className: "fourty-ask__reply",
|
|
189
|
+
onClick: () => {
|
|
190
|
+
session.dispatchSuggestionAction({ id: `ask-${standing.id}-${s}`, label: s, type: "message", payload: { text: s } });
|
|
191
|
+
standing.confirm();
|
|
192
|
+
},
|
|
193
|
+
children: s
|
|
194
|
+
},
|
|
195
|
+
s
|
|
196
|
+
)),
|
|
197
|
+
/* @__PURE__ */ jsx2("button", { type: "button", className: "fourty-ask__dismiss", onClick: standing.dismiss, "aria-label": labels.dismiss, children: "\xD7" })
|
|
198
|
+
] })
|
|
199
|
+
] });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/agent/presence/notch/PresenceNotch.tsx
|
|
203
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
170
204
|
function PresenceNotch({ widgets }) {
|
|
171
205
|
const { expanded, askStanding, lead, trail, drawerWidgets, openDrawerId, toggleDrawer, rootHandlers, rootRef } = usePresenceNotch(widgets);
|
|
172
206
|
const { isMobile } = useFormFactor();
|
|
@@ -180,15 +214,15 @@ function PresenceNotch({ widgets }) {
|
|
|
180
214
|
}, [widgets, openDrawerId, toggleDrawer]);
|
|
181
215
|
const renderWidget = (w) => {
|
|
182
216
|
const drawer = handles.get(w.id);
|
|
183
|
-
const node = drawer === void 0 ? /* @__PURE__ */
|
|
184
|
-
if (w.Drawer === void 0) return /* @__PURE__ */
|
|
185
|
-
return /* @__PURE__ */
|
|
217
|
+
const node = drawer === void 0 ? /* @__PURE__ */ jsx3(w.Component, { expanded }) : /* @__PURE__ */ jsx3(w.Component, { expanded, drawer });
|
|
218
|
+
if (w.Drawer === void 0) return /* @__PURE__ */ jsx3(React2.Fragment, { children: node }, w.id);
|
|
219
|
+
return /* @__PURE__ */ jsx3("div", { className: "fourty-notch__widget", children: node }, w.id);
|
|
186
220
|
};
|
|
187
221
|
return (
|
|
188
222
|
// `rootRef` marks where the notch ENDS: a press outside it closes an open
|
|
189
223
|
// drawer, so reaching back for the page is enough to put the brief away.
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ jsxs2("div", { className: "fourty-notch-root", ref: rootRef, ...rootHandlers, children: [
|
|
225
|
+
/* @__PURE__ */ jsxs2(
|
|
192
226
|
"div",
|
|
193
227
|
{
|
|
194
228
|
className: "fourty-notch",
|
|
@@ -197,17 +231,17 @@ function PresenceNotch({ widgets }) {
|
|
|
197
231
|
role: "region",
|
|
198
232
|
"aria-live": "polite",
|
|
199
233
|
children: [
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ jsx3("div", { className: "fourty-notch__lead", children: askStanding ? /* @__PURE__ */ jsx3(AgentAsk, {}) : lead.map(renderWidget) }),
|
|
235
|
+
/* @__PURE__ */ jsx3("div", { className: "fourty-notch__trail", children: trail.map(renderWidget) })
|
|
202
236
|
]
|
|
203
237
|
}
|
|
204
238
|
),
|
|
205
|
-
!isMobile && drawerWidgets.length > 0 && /* @__PURE__ */
|
|
239
|
+
!isMobile && drawerWidgets.length > 0 && /* @__PURE__ */ jsx3("div", { className: "fourty-notch__drawer-region", children: drawerWidgets.map((w) => {
|
|
206
240
|
const Drawer = w.Drawer;
|
|
207
241
|
if (Drawer === void 0) return null;
|
|
208
242
|
const open = openDrawerId === w.id;
|
|
209
243
|
const drawer = handles.get(w.id);
|
|
210
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ jsx3("div", { className: "fourty-notch__drawer", "data-open": open ? "true" : "false", "aria-hidden": !open, children: drawer === void 0 ? /* @__PURE__ */ jsx3(Drawer, { expanded: true }) : /* @__PURE__ */ jsx3(Drawer, { expanded: true, drawer }) }, w.id);
|
|
211
245
|
}) })
|
|
212
246
|
] })
|
|
213
247
|
);
|
|
@@ -350,7 +384,7 @@ var presenceClass = {
|
|
|
350
384
|
};
|
|
351
385
|
|
|
352
386
|
// src/agent/presence/parts.tsx
|
|
353
|
-
import { jsx as
|
|
387
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
354
388
|
var FALLBACK = "";
|
|
355
389
|
var SETTLE_EASE = [0.22, 1, 0.36, 1];
|
|
356
390
|
var enter = {
|
|
@@ -360,23 +394,23 @@ var enter = {
|
|
|
360
394
|
transition: { duration: 0.5, ease: SETTLE_EASE }
|
|
361
395
|
};
|
|
362
396
|
function Eyebrow({ children }) {
|
|
363
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ jsx4("span", { className: presenceClass.eyebrow, children });
|
|
364
398
|
}
|
|
365
399
|
function Rule() {
|
|
366
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: presenceClass.rule });
|
|
367
401
|
}
|
|
368
402
|
function Fallback() {
|
|
369
403
|
if (FALLBACK.length === 0) return null;
|
|
370
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ jsx4("span", { className: presenceClass.fallback, children: FALLBACK });
|
|
371
405
|
}
|
|
372
406
|
|
|
373
407
|
// src/agent/presence/swatch.tsx
|
|
374
408
|
import { colorHexOf } from "@40rty/ams-sdk";
|
|
375
|
-
import { jsx as
|
|
409
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
376
410
|
function colorSwatch(value) {
|
|
377
411
|
const hex = colorHexOf(value);
|
|
378
412
|
if (hex === null) return null;
|
|
379
|
-
return /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ jsx5("span", { className: presenceClass.swatch, style: { background: hex } });
|
|
380
414
|
}
|
|
381
415
|
|
|
382
416
|
// src/agent/presence/source-cards/card-shell.tsx
|
|
@@ -436,7 +470,7 @@ var CARD_SETTLE_MS = 260;
|
|
|
436
470
|
|
|
437
471
|
// src/agent/presence/source-cards/card-frame.tsx
|
|
438
472
|
import * as React3 from "react";
|
|
439
|
-
import { jsx as
|
|
473
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
440
474
|
var EXIT_TRANSITION = { duration: 0.62, ease: CARD_EASE };
|
|
441
475
|
var CARD_EXIT = {
|
|
442
476
|
chosen: { opacity: 0, scale: 1.1, y: -8, transition: EXIT_TRANSITION },
|
|
@@ -457,7 +491,7 @@ var CARD_POSE = {
|
|
|
457
491
|
var SourceCardFrame = React3.forwardRef(function SourceCardFrame2({ kind, state, size, slots, children }, ref) {
|
|
458
492
|
const box = slots === void 0 ? sourceCardBox(size) : sourceCardSpan(size, slots);
|
|
459
493
|
const pose = CARD_POSE[state];
|
|
460
|
-
return /* @__PURE__ */
|
|
494
|
+
return /* @__PURE__ */ jsxs3(
|
|
461
495
|
motion.div,
|
|
462
496
|
{
|
|
463
497
|
ref,
|
|
@@ -478,7 +512,7 @@ var SourceCardFrame = React3.forwardRef(function SourceCardFrame2({ kind, state,
|
|
|
478
512
|
},
|
|
479
513
|
children: [
|
|
480
514
|
children,
|
|
481
|
-
state === "chosen" && /* @__PURE__ */
|
|
515
|
+
state === "chosen" && /* @__PURE__ */ jsx6(
|
|
482
516
|
motion.span,
|
|
483
517
|
{
|
|
484
518
|
"aria-hidden": true,
|
|
@@ -503,7 +537,7 @@ var SourceCardFrame = React3.forwardRef(function SourceCardFrame2({ kind, state,
|
|
|
503
537
|
});
|
|
504
538
|
|
|
505
539
|
// src/agent/presence/source-cards/card-plate.tsx
|
|
506
|
-
import { jsx as
|
|
540
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
507
541
|
var PLATE_STYLE = {
|
|
508
542
|
loaded: {
|
|
509
543
|
background: ink(9),
|
|
@@ -543,7 +577,7 @@ function SourcePlate({
|
|
|
543
577
|
style,
|
|
544
578
|
children
|
|
545
579
|
}) {
|
|
546
|
-
return /* @__PURE__ */
|
|
580
|
+
return /* @__PURE__ */ jsxs4(
|
|
547
581
|
"div",
|
|
548
582
|
{
|
|
549
583
|
className: sourceCardClass.plate,
|
|
@@ -564,7 +598,7 @@ function SourcePlate({
|
|
|
564
598
|
...style
|
|
565
599
|
},
|
|
566
600
|
children: [
|
|
567
|
-
state === "missed" && mark ? /* @__PURE__ */
|
|
601
|
+
state === "missed" && mark ? /* @__PURE__ */ jsx7(
|
|
568
602
|
"span",
|
|
569
603
|
{
|
|
570
604
|
"aria-hidden": true,
|
|
@@ -579,7 +613,7 @@ function SourcePlate({
|
|
|
579
613
|
}
|
|
580
614
|
}
|
|
581
615
|
) : null,
|
|
582
|
-
state === "missed" ? null : /* @__PURE__ */
|
|
616
|
+
state === "missed" ? null : /* @__PURE__ */ jsx7(
|
|
583
617
|
"div",
|
|
584
618
|
{
|
|
585
619
|
style: {
|
|
@@ -600,7 +634,7 @@ function SourcePlate({
|
|
|
600
634
|
// src/agent/presence/source-cards/card-marks.tsx
|
|
601
635
|
import * as React4 from "react";
|
|
602
636
|
import { useGenerationStyle } from "@40rty/ams-sdk";
|
|
603
|
-
import { Fragment as Fragment2, jsx as
|
|
637
|
+
import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
604
638
|
function SourceImage({
|
|
605
639
|
imageUrl,
|
|
606
640
|
caption
|
|
@@ -612,10 +646,10 @@ function SourceImage({
|
|
|
612
646
|
const ref = React4.useCallback((node) => {
|
|
613
647
|
if (node !== null && node.complete && node.naturalWidth > 0) setLoaded(true);
|
|
614
648
|
}, []);
|
|
615
|
-
if (!usable) return /* @__PURE__ */
|
|
649
|
+
if (!usable) return /* @__PURE__ */ jsx8(Fragment2, { children: caption });
|
|
616
650
|
const blurUp = generation.image === "blur-up";
|
|
617
651
|
const seconds = generation.timings.imageResolveS;
|
|
618
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ jsx8(
|
|
619
653
|
"img",
|
|
620
654
|
{
|
|
621
655
|
ref,
|
|
@@ -638,7 +672,7 @@ function SourceImage({
|
|
|
638
672
|
);
|
|
639
673
|
}
|
|
640
674
|
function CaptionRule({ width, height }) {
|
|
641
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsx8(
|
|
642
676
|
"span",
|
|
643
677
|
{
|
|
644
678
|
"aria-hidden": true,
|
|
@@ -658,7 +692,7 @@ function RuledLines({
|
|
|
658
692
|
lines,
|
|
659
693
|
headline
|
|
660
694
|
}) {
|
|
661
|
-
return /* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ jsx8(
|
|
662
696
|
"div",
|
|
663
697
|
{
|
|
664
698
|
className: sourceCardClass.rules,
|
|
@@ -669,7 +703,7 @@ function RuledLines({
|
|
|
669
703
|
height: "100%",
|
|
670
704
|
width: "100%"
|
|
671
705
|
},
|
|
672
|
-
children: lines.map((line, i) => /* @__PURE__ */
|
|
706
|
+
children: lines.map((line, i) => /* @__PURE__ */ jsx8(
|
|
673
707
|
"span",
|
|
674
708
|
{
|
|
675
709
|
className: sourceCardClass.rule,
|
|
@@ -687,7 +721,7 @@ function RuledLines({
|
|
|
687
721
|
}
|
|
688
722
|
function CornerFold({ width, fold }) {
|
|
689
723
|
const length = Math.round(fold * Math.SQRT2);
|
|
690
|
-
return /* @__PURE__ */
|
|
724
|
+
return /* @__PURE__ */ jsx8(
|
|
691
725
|
"span",
|
|
692
726
|
{
|
|
693
727
|
"aria-hidden": true,
|
|
@@ -713,7 +747,7 @@ function RatingStars({
|
|
|
713
747
|
const gap = Math.max(1, Math.round(width * 0.05));
|
|
714
748
|
const star = Math.max(4, Math.floor((width - gap * (count - 1)) / count));
|
|
715
749
|
const filled = score === void 0 ? 0 : Math.min(count, Math.max(0, Math.round(score)));
|
|
716
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ jsx8("div", { className: sourceCardClass.pips, style: { display: "flex", gap, flexShrink: 0 }, children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx8(
|
|
717
751
|
"svg",
|
|
718
752
|
{
|
|
719
753
|
className: sourceCardClass.pip,
|
|
@@ -723,7 +757,7 @@ function RatingStars({
|
|
|
723
757
|
viewBox: "0 0 24 24",
|
|
724
758
|
"aria-hidden": true,
|
|
725
759
|
style: { display: "block", flexShrink: 0 },
|
|
726
|
-
children: /* @__PURE__ */
|
|
760
|
+
children: /* @__PURE__ */ jsx8(
|
|
727
761
|
"path",
|
|
728
762
|
{
|
|
729
763
|
d: STAR_PATH,
|
|
@@ -740,7 +774,7 @@ function RatingStars({
|
|
|
740
774
|
|
|
741
775
|
// src/agent/presence/source-cards/ProductSourceCard.tsx
|
|
742
776
|
import * as React5 from "react";
|
|
743
|
-
import { jsx as
|
|
777
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
744
778
|
var ProductSourceCard = React5.forwardRef(
|
|
745
779
|
function ProductSourceCard2({
|
|
746
780
|
source,
|
|
@@ -753,11 +787,11 @@ var ProductSourceCard = React5.forwardRef(
|
|
|
753
787
|
const box = sourceCardBox(size);
|
|
754
788
|
const state = sourceCardState(found, pending, chosen);
|
|
755
789
|
const imageUrl = source === void 0 ? void 0 : source.imageUrl;
|
|
756
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ jsx9(SourceCardFrame, { ref, kind: sourceKind, state, size, children: /* @__PURE__ */ jsx9(SourcePlate, { width: box.width, height: box.height, state, mark: true, children: /* @__PURE__ */ jsx9(
|
|
757
791
|
SourceImage,
|
|
758
792
|
{
|
|
759
793
|
imageUrl,
|
|
760
|
-
caption: /* @__PURE__ */
|
|
794
|
+
caption: /* @__PURE__ */ jsx9(CaptionRule, { width: box.width, height: box.height })
|
|
761
795
|
}
|
|
762
796
|
) }) });
|
|
763
797
|
}
|
|
@@ -768,7 +802,7 @@ var productSourceForm = {
|
|
|
768
802
|
|
|
769
803
|
// src/agent/presence/source-cards/CollectionSourceCard.tsx
|
|
770
804
|
import * as React6 from "react";
|
|
771
|
-
import { jsx as
|
|
805
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
772
806
|
var STEP_RATIO = 0.1;
|
|
773
807
|
var CollectionSourceCard = React6.forwardRef(
|
|
774
808
|
function CollectionSourceCard2({
|
|
@@ -787,8 +821,8 @@ var CollectionSourceCard = React6.forwardRef(
|
|
|
787
821
|
const missed = state === "missed";
|
|
788
822
|
const imageUrl = source === void 0 ? void 0 : source.imageUrl;
|
|
789
823
|
const hairline = ink(30);
|
|
790
|
-
return /* @__PURE__ */
|
|
791
|
-
(missed ? [1] : [2, 1]).map((depth) => /* @__PURE__ */
|
|
824
|
+
return /* @__PURE__ */ jsxs5(SourceCardFrame, { ref, kind: sourceKind, state, size, children: [
|
|
825
|
+
(missed ? [1] : [2, 1]).map((depth) => /* @__PURE__ */ jsx10(
|
|
792
826
|
SourcePlate,
|
|
793
827
|
{
|
|
794
828
|
width: face.width,
|
|
@@ -804,16 +838,16 @@ var CollectionSourceCard = React6.forwardRef(
|
|
|
804
838
|
},
|
|
805
839
|
depth
|
|
806
840
|
)),
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ jsxs5(SourcePlate, { width: face.width, height: face.height, state, mark: true, style: { zIndex: 1 }, children: [
|
|
842
|
+
/* @__PURE__ */ jsx10(SourceImage, { imageUrl, caption: null }),
|
|
843
|
+
/* @__PURE__ */ jsx10(
|
|
810
844
|
"span",
|
|
811
845
|
{
|
|
812
846
|
"aria-hidden": true,
|
|
813
847
|
style: { position: "absolute", left: 0, top: "50%", width: "100%", height: 1, background: hairline }
|
|
814
848
|
}
|
|
815
849
|
),
|
|
816
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ jsx10(
|
|
817
851
|
"span",
|
|
818
852
|
{
|
|
819
853
|
"aria-hidden": true,
|
|
@@ -830,7 +864,7 @@ var collectionSourceForm = {
|
|
|
830
864
|
|
|
831
865
|
// src/agent/presence/source-cards/ArticleSourceCard.tsx
|
|
832
866
|
import * as React7 from "react";
|
|
833
|
-
import { jsx as
|
|
867
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
834
868
|
function articleLines(size, weight) {
|
|
835
869
|
const headline = { width: 0.68, weight: weight + 1 };
|
|
836
870
|
const closer = { width: 0.44, weight };
|
|
@@ -857,7 +891,7 @@ var ArticleSourceCard = React7.forwardRef(
|
|
|
857
891
|
const box = sourceCardBox(size);
|
|
858
892
|
const state = sourceCardState(found, pending, chosen);
|
|
859
893
|
const pad = platePad(box.width);
|
|
860
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ jsx11(SourceCardFrame, { ref, kind: sourceKind, state, size, children: /* @__PURE__ */ jsx11(SourcePlate, { width: box.width, height: box.height, state, mark: true, children: /* @__PURE__ */ jsx11("div", { style: { position: "absolute", inset: pad }, children: /* @__PURE__ */ jsx11(RuledLines, { lines: articleLines(size, ruleWeight(size)), headline: true }) }) }) });
|
|
861
895
|
}
|
|
862
896
|
);
|
|
863
897
|
var articleSourceForm = {
|
|
@@ -866,7 +900,7 @@ var articleSourceForm = {
|
|
|
866
900
|
|
|
867
901
|
// src/agent/presence/source-cards/PolicySourceCard.tsx
|
|
868
902
|
import * as React8 from "react";
|
|
869
|
-
import { jsx as
|
|
903
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
870
904
|
var FOLD_RATIO = 0.32;
|
|
871
905
|
function policyLines(weight) {
|
|
872
906
|
return [
|
|
@@ -887,8 +921,8 @@ var PolicySourceCard = React8.forwardRef(
|
|
|
887
921
|
const state = sourceCardState(found, pending, chosen);
|
|
888
922
|
const pad = platePad(box.width);
|
|
889
923
|
const fold = Math.max(5, Math.round(box.width * FOLD_RATIO));
|
|
890
|
-
return /* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
924
|
+
return /* @__PURE__ */ jsxs6(SourceCardFrame, { ref, kind: sourceKind, state, size, children: [
|
|
925
|
+
/* @__PURE__ */ jsx12(
|
|
892
926
|
SourcePlate,
|
|
893
927
|
{
|
|
894
928
|
width: box.width,
|
|
@@ -898,10 +932,10 @@ var PolicySourceCard = React8.forwardRef(
|
|
|
898
932
|
style: {
|
|
899
933
|
clipPath: `polygon(0 0, ${box.width - fold}px 0, ${box.width}px ${fold}px, ${box.width}px ${box.height}px, 0 ${box.height}px)`
|
|
900
934
|
},
|
|
901
|
-
children: /* @__PURE__ */
|
|
935
|
+
children: /* @__PURE__ */ jsx12("div", { style: { position: "absolute", left: pad, right: pad, top: fold + pad, bottom: pad }, children: /* @__PURE__ */ jsx12(RuledLines, { lines: policyLines(ruleWeight(size)), headline: false }) })
|
|
902
936
|
}
|
|
903
937
|
),
|
|
904
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ jsx12(CornerFold, { width: box.width, fold })
|
|
905
939
|
] });
|
|
906
940
|
}
|
|
907
941
|
);
|
|
@@ -962,7 +996,7 @@ function reviewPassages(refs) {
|
|
|
962
996
|
}
|
|
963
997
|
|
|
964
998
|
// src/agent/presence/source-cards/ReviewSourceCard.tsx
|
|
965
|
-
import { jsx as
|
|
999
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
966
1000
|
var REVIEW_SLOTS = 5;
|
|
967
1001
|
var COLUMN_MAX = 5;
|
|
968
1002
|
var COLUMN_DWELL_MS = 900;
|
|
@@ -980,7 +1014,7 @@ function reviewLines(weight) {
|
|
|
980
1014
|
];
|
|
981
1015
|
}
|
|
982
1016
|
function Passage({ passage }) {
|
|
983
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ jsx13(
|
|
984
1018
|
"p",
|
|
985
1019
|
{
|
|
986
1020
|
style: {
|
|
@@ -992,7 +1026,7 @@ function Passage({ passage }) {
|
|
|
992
1026
|
color: ink(76),
|
|
993
1027
|
wordBreak: "break-word"
|
|
994
1028
|
},
|
|
995
|
-
children: passage.runs.map((run, i) => /* @__PURE__ */
|
|
1029
|
+
children: passage.runs.map((run, i) => /* @__PURE__ */ jsx13(
|
|
996
1030
|
"span",
|
|
997
1031
|
{
|
|
998
1032
|
"data-marked": run.marked ? "true" : "false",
|
|
@@ -1034,8 +1068,8 @@ var ReviewSourceCard = React9.forwardRef(
|
|
|
1034
1068
|
const viewport = LINE_H * COLUMN_LINES;
|
|
1035
1069
|
const framed = passages.some((passage) => passage.imageUrl !== void 0);
|
|
1036
1070
|
const thumb = current === void 0 ? void 0 : current.imageUrl;
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
framed && /* @__PURE__ */
|
|
1071
|
+
return /* @__PURE__ */ jsx13(SourceCardFrame, { ref, kind: sourceKind, state, size, slots: REVIEW_SLOTS, children: /* @__PURE__ */ jsx13(SourcePlate, { width: box.width, height: box.height, state, mark: true, children: /* @__PURE__ */ jsxs7("div", { style: { position: "absolute", inset: pad, display: "flex", gap: THUMB_GAP }, children: [
|
|
1072
|
+
framed && /* @__PURE__ */ jsx13("div", { style: { width: THUMB_W, height: interior, flexShrink: 0 }, children: thumb !== void 0 && /* @__PURE__ */ jsx13(
|
|
1039
1073
|
"img",
|
|
1040
1074
|
{
|
|
1041
1075
|
src: thumb,
|
|
@@ -1055,8 +1089,8 @@ var ReviewSourceCard = React9.forwardRef(
|
|
|
1055
1089
|
}
|
|
1056
1090
|
}
|
|
1057
1091
|
) }),
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ jsxs7("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: ROW_GAP }, children: [
|
|
1093
|
+
/* @__PURE__ */ jsx13(
|
|
1060
1094
|
RatingStars,
|
|
1061
1095
|
{
|
|
1062
1096
|
width: STAR_ROW_W,
|
|
@@ -1068,14 +1102,14 @@ var ReviewSourceCard = React9.forwardRef(
|
|
|
1068
1102
|
// the tool returned without prose. The ruled lines are the same
|
|
1069
1103
|
// statement the card has always made — "somebody's few
|
|
1070
1104
|
// sentences about a thing" — with nothing invented to fill them.
|
|
1071
|
-
/* @__PURE__ */
|
|
1072
|
-
) : /* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ jsx13("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsx13(RuledLines, { lines: reviewLines(ruleWeight(size)), headline: false }) })
|
|
1106
|
+
) : /* @__PURE__ */ jsx13("div", { style: { height: viewport, overflow: "hidden", position: "relative" }, children: /* @__PURE__ */ jsx13(
|
|
1073
1107
|
motion.div,
|
|
1074
1108
|
{
|
|
1075
1109
|
animate: { y: -at * viewport },
|
|
1076
1110
|
initial: false,
|
|
1077
1111
|
transition: still ? { duration: 0 } : { duration: 0.42, ease: CARD_EASE },
|
|
1078
|
-
children: passages.slice(0, COLUMN_MAX).map((passage) => /* @__PURE__ */
|
|
1112
|
+
children: passages.slice(0, COLUMN_MAX).map((passage) => /* @__PURE__ */ jsx13(Passage, { passage }, passage.key))
|
|
1079
1113
|
}
|
|
1080
1114
|
) })
|
|
1081
1115
|
] })
|
|
@@ -1110,12 +1144,12 @@ registerDefaultPresenceSourceForms();
|
|
|
1110
1144
|
// src/agent/presence/source-cards/SourceCard.tsx
|
|
1111
1145
|
import * as React10 from "react";
|
|
1112
1146
|
import { resolvePresenceSourceForm } from "@40rty/ams-sdk";
|
|
1113
|
-
import { jsx as
|
|
1147
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1114
1148
|
var PresenceSourceCard = React10.forwardRef(function PresenceSourceCard2({ source, records, sourceKind, size, found, pending, chosen }, ref) {
|
|
1115
1149
|
const def = resolvePresenceSourceForm(sourceKind);
|
|
1116
1150
|
if (def === void 0) return null;
|
|
1117
1151
|
const { Component } = def;
|
|
1118
|
-
return /* @__PURE__ */
|
|
1152
|
+
return /* @__PURE__ */ jsx14(
|
|
1119
1153
|
Component,
|
|
1120
1154
|
{
|
|
1121
1155
|
ref,
|
|
@@ -1273,7 +1307,7 @@ function siftDeck(sources, materialized, limit, admitted) {
|
|
|
1273
1307
|
}
|
|
1274
1308
|
|
|
1275
1309
|
// src/agent/presence/SourceSift.tsx
|
|
1276
|
-
import { jsx as
|
|
1310
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1277
1311
|
var SIFT_MAX_CARDS = {
|
|
1278
1312
|
band: 8,
|
|
1279
1313
|
compact: 5,
|
|
@@ -1297,7 +1331,7 @@ function siftRegionWidth(size) {
|
|
|
1297
1331
|
}
|
|
1298
1332
|
function CriterionPass({ seq }) {
|
|
1299
1333
|
if (seq === 0) return null;
|
|
1300
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ jsx15(
|
|
1301
1335
|
motion.span,
|
|
1302
1336
|
{
|
|
1303
1337
|
"aria-hidden": true,
|
|
@@ -1351,7 +1385,7 @@ function SourceSift({
|
|
|
1351
1385
|
const rest = Math.max(0, deck.read - deck.cards.length);
|
|
1352
1386
|
if (rest > 0) lastRest.current = rest;
|
|
1353
1387
|
const shownRest = rest > 0 ? rest : lastRest.current;
|
|
1354
|
-
const tail = /* @__PURE__ */
|
|
1388
|
+
const tail = /* @__PURE__ */ jsx15(
|
|
1355
1389
|
motion.span,
|
|
1356
1390
|
{
|
|
1357
1391
|
className: presenceClass.siftMore,
|
|
@@ -1362,7 +1396,7 @@ function SourceSift({
|
|
|
1362
1396
|
children: shownRest > 0 ? `+${shownRest}` : ""
|
|
1363
1397
|
}
|
|
1364
1398
|
);
|
|
1365
|
-
return /* @__PURE__ */
|
|
1399
|
+
return /* @__PURE__ */ jsxs8(
|
|
1366
1400
|
"div",
|
|
1367
1401
|
{
|
|
1368
1402
|
className: presenceClass.sift,
|
|
@@ -1370,14 +1404,14 @@ function SourceSift({
|
|
|
1370
1404
|
"data-resolving": live ? "false" : "true",
|
|
1371
1405
|
style: { gap: SIFT_TAIL_GAP[size] },
|
|
1372
1406
|
children: [
|
|
1373
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ jsxs8(
|
|
1374
1408
|
motion.div,
|
|
1375
1409
|
{
|
|
1376
1410
|
className: presenceClass.siftTrack,
|
|
1377
1411
|
animate: controls,
|
|
1378
1412
|
style: reserveTrack ? { gap: SOURCE_CARD_GAP[size], width: trackWidth(size) } : { gap: SOURCE_CARD_GAP[size] },
|
|
1379
1413
|
children: [
|
|
1380
|
-
/* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ jsx15(
|
|
1381
1415
|
AnimatePresence,
|
|
1382
1416
|
{
|
|
1383
1417
|
mode: "popLayout",
|
|
@@ -1386,7 +1420,7 @@ function SourceSift({
|
|
|
1386
1420
|
admitted.current = /* @__PURE__ */ new Map();
|
|
1387
1421
|
setResolving(false);
|
|
1388
1422
|
},
|
|
1389
|
-
children: deck.cards.map((card) => /* @__PURE__ */
|
|
1423
|
+
children: deck.cards.map((card) => /* @__PURE__ */ jsx15(
|
|
1390
1424
|
PresenceSourceCard,
|
|
1391
1425
|
{
|
|
1392
1426
|
source: card.ref,
|
|
@@ -1401,7 +1435,7 @@ function SourceSift({
|
|
|
1401
1435
|
))
|
|
1402
1436
|
}
|
|
1403
1437
|
),
|
|
1404
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ jsx15(CriterionPass, { seq: pass })
|
|
1405
1439
|
]
|
|
1406
1440
|
}
|
|
1407
1441
|
),
|
|
@@ -1411,12 +1445,15 @@ function SourceSift({
|
|
|
1411
1445
|
);
|
|
1412
1446
|
}
|
|
1413
1447
|
|
|
1448
|
+
// src/agent/presence/CompactRead.tsx
|
|
1449
|
+
import { useForgetFact } from "@40rty/ams-sdk";
|
|
1450
|
+
|
|
1414
1451
|
// src/agent/presence/FactChip.tsx
|
|
1415
1452
|
import {
|
|
1416
1453
|
presenceFactShape,
|
|
1417
1454
|
resolvePresenceFactForm
|
|
1418
1455
|
} from "@40rty/ams-sdk";
|
|
1419
|
-
import { jsx as
|
|
1456
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1420
1457
|
function resolveValueForm(fact) {
|
|
1421
1458
|
if (fact.scope !== void 0) {
|
|
1422
1459
|
const declared = resolvePresenceFactForm(fact.scope);
|
|
@@ -1428,7 +1465,7 @@ function resolveValueForm(fact) {
|
|
|
1428
1465
|
function FactChip({ fact, onForget }) {
|
|
1429
1466
|
const { brief } = useLabels().presence;
|
|
1430
1467
|
const { kind, form } = resolveValueForm(fact);
|
|
1431
|
-
return /* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ jsxs9(
|
|
1432
1469
|
motion.span,
|
|
1433
1470
|
{
|
|
1434
1471
|
className: presenceClass.fact,
|
|
@@ -1440,12 +1477,12 @@ function FactChip({ fact, onForget }) {
|
|
|
1440
1477
|
exit: { opacity: 0, scale: 0.92 },
|
|
1441
1478
|
transition: { duration: 0.3, ease: [0.22, 1, 0.36, 1] },
|
|
1442
1479
|
children: [
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
form === void 0 ? /* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ jsx16("span", { className: presenceClass.factLabel, children: fact.label }),
|
|
1481
|
+
form === void 0 ? /* @__PURE__ */ jsxs9("span", { className: presenceClass.factValue, children: [
|
|
1445
1482
|
colorSwatch(fact.value),
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
] }) : /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ jsx16("span", { className: presenceClass.factValueText, children: fact.value })
|
|
1484
|
+
] }) : /* @__PURE__ */ jsx16("span", { className: presenceClass.factValue, "data-form": "true", children: /* @__PURE__ */ jsx16(form.Component, { fact, kind }) }),
|
|
1485
|
+
/* @__PURE__ */ jsx16(
|
|
1449
1486
|
"button",
|
|
1450
1487
|
{
|
|
1451
1488
|
type: "button",
|
|
@@ -1470,10 +1507,10 @@ function sortFactsByTier(facts) {
|
|
|
1470
1507
|
}
|
|
1471
1508
|
|
|
1472
1509
|
// src/agent/presence/CompactRead.tsx
|
|
1473
|
-
import { jsx as
|
|
1510
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1474
1511
|
function CompactLead({ text }) {
|
|
1475
1512
|
if (text.trim().length === 0) return null;
|
|
1476
|
-
return /* @__PURE__ */
|
|
1513
|
+
return /* @__PURE__ */ jsx17("div", { className: "fourty-presence-read__compact-lead", children: /* @__PURE__ */ jsx17("span", { className: presenceClass.prose, "data-clamp": "1", children: text }) });
|
|
1477
1514
|
}
|
|
1478
1515
|
function CompactStream({
|
|
1479
1516
|
lead,
|
|
@@ -1483,9 +1520,9 @@ function CompactStream({
|
|
|
1483
1520
|
hiddenFacts = 0,
|
|
1484
1521
|
chipsOnly = false
|
|
1485
1522
|
}) {
|
|
1486
|
-
return /* @__PURE__ */
|
|
1487
|
-
!chipsOnly && /* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1523
|
+
return /* @__PURE__ */ jsxs10("div", { className: presenceClass.row, "data-compact": "true", children: [
|
|
1524
|
+
!chipsOnly && /* @__PURE__ */ jsx17(CompactLead, { text: lead }),
|
|
1525
|
+
/* @__PURE__ */ jsx17(
|
|
1489
1526
|
SourceSift,
|
|
1490
1527
|
{
|
|
1491
1528
|
sources,
|
|
@@ -1494,7 +1531,7 @@ function CompactStream({
|
|
|
1494
1531
|
size: "compact"
|
|
1495
1532
|
}
|
|
1496
1533
|
),
|
|
1497
|
-
/* @__PURE__ */
|
|
1534
|
+
/* @__PURE__ */ jsx17(
|
|
1498
1535
|
FactChips,
|
|
1499
1536
|
{
|
|
1500
1537
|
facts: [...facts].sort((a, b) => a.slot - b.slot).map((f) => f.fact),
|
|
@@ -1509,9 +1546,9 @@ function FactChips({
|
|
|
1509
1546
|
}) {
|
|
1510
1547
|
const { forget } = useForgetFact();
|
|
1511
1548
|
if (facts.length === 0) return null;
|
|
1512
|
-
return /* @__PURE__ */
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
more > 0 && /* @__PURE__ */
|
|
1549
|
+
return /* @__PURE__ */ jsxs10("div", { className: presenceClass.facts, "data-compact": "true", children: [
|
|
1550
|
+
/* @__PURE__ */ jsx17(AnimatePresence, { initial: false, children: facts.map((fact) => /* @__PURE__ */ jsx17(FactChip, { fact, onForget: forget }, factIdentity(fact))) }),
|
|
1551
|
+
more > 0 && /* @__PURE__ */ jsxs10("span", { className: presenceClass.factMore, children: [
|
|
1515
1552
|
"+",
|
|
1516
1553
|
more
|
|
1517
1554
|
] })
|
|
@@ -1556,15 +1593,15 @@ function bandRowTemplate(railWidth, deckWidth) {
|
|
|
1556
1593
|
|
|
1557
1594
|
// src/agent/presence/folded.tsx
|
|
1558
1595
|
import * as React12 from "react";
|
|
1559
|
-
import { jsx as
|
|
1596
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1560
1597
|
function Sep() {
|
|
1561
|
-
return /* @__PURE__ */
|
|
1598
|
+
return /* @__PURE__ */ jsx18("span", { "aria-hidden": true, className: presenceClass.factSep, "data-dot": "true", children: "\xB7" });
|
|
1562
1599
|
}
|
|
1563
1600
|
function FactChip2({ fact }) {
|
|
1564
1601
|
const swatch = colorSwatch(fact.value);
|
|
1565
|
-
return /* @__PURE__ */
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1602
|
+
return /* @__PURE__ */ jsxs11("span", { className: presenceClass.fact, "data-tier": fact.tier === "profile" ? "profile" : "session", children: [
|
|
1603
|
+
/* @__PURE__ */ jsx18("span", { className: presenceClass.factLabel, children: fact.label }),
|
|
1604
|
+
/* @__PURE__ */ jsxs11("span", { className: presenceClass.factValue, children: [
|
|
1568
1605
|
swatch,
|
|
1569
1606
|
fact.value
|
|
1570
1607
|
] })
|
|
@@ -1573,19 +1610,19 @@ function FactChip2({ fact }) {
|
|
|
1573
1610
|
function FoldedRead({ label, facts, text }) {
|
|
1574
1611
|
const shown = sortFactsByTier(facts).slice(0, 3);
|
|
1575
1612
|
const moreFacts = facts.length - shown.length;
|
|
1576
|
-
return /* @__PURE__ */
|
|
1577
|
-
label.length > 0 && /* @__PURE__ */
|
|
1578
|
-
label.length > 0 && /* @__PURE__ */
|
|
1579
|
-
shown.length > 0 ? /* @__PURE__ */
|
|
1580
|
-
shown.map((f, i) => /* @__PURE__ */
|
|
1581
|
-
i > 0 && /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ jsxs11("div", { className: presenceClass.row, "data-folded": "true", children: [
|
|
1614
|
+
label.length > 0 && /* @__PURE__ */ jsx18(Eyebrow, { children: label }),
|
|
1615
|
+
label.length > 0 && /* @__PURE__ */ jsx18(Rule, {}),
|
|
1616
|
+
shown.length > 0 ? /* @__PURE__ */ jsxs11("div", { className: presenceClass.facts, "data-folded": "true", children: [
|
|
1617
|
+
shown.map((f, i) => /* @__PURE__ */ jsxs11(React12.Fragment, { children: [
|
|
1618
|
+
i > 0 && /* @__PURE__ */ jsx18(Sep, {}),
|
|
1619
|
+
/* @__PURE__ */ jsx18(FactChip2, { fact: f })
|
|
1583
1620
|
] }, f.label)),
|
|
1584
|
-
moreFacts > 0 && /* @__PURE__ */
|
|
1621
|
+
moreFacts > 0 && /* @__PURE__ */ jsxs11("span", { className: presenceClass.factMore, children: [
|
|
1585
1622
|
"+",
|
|
1586
1623
|
moreFacts
|
|
1587
1624
|
] })
|
|
1588
|
-
] }) : /* @__PURE__ */
|
|
1625
|
+
] }) : /* @__PURE__ */ jsx18("span", { className: presenceClass.prose, "data-clamp": "1", children: text })
|
|
1589
1626
|
] });
|
|
1590
1627
|
}
|
|
1591
1628
|
function BriefHandle({
|
|
@@ -1593,7 +1630,7 @@ function BriefHandle({
|
|
|
1593
1630
|
onToggle
|
|
1594
1631
|
}) {
|
|
1595
1632
|
const { brief } = useLabels().presence;
|
|
1596
|
-
return /* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ jsx18(
|
|
1597
1634
|
motion.button,
|
|
1598
1635
|
{
|
|
1599
1636
|
type: "button",
|
|
@@ -1617,7 +1654,7 @@ import { usePresenceElements, usePresenceLiveTurn } from "@40rty/ams-sdk";
|
|
|
1617
1654
|
// src/agent/presence/BriefIdentity.tsx
|
|
1618
1655
|
import * as React13 from "react";
|
|
1619
1656
|
import { useVisitorName } from "@40rty/ams-sdk";
|
|
1620
|
-
import { jsx as
|
|
1657
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1621
1658
|
var SETTLE = [0.22, 1, 0.36, 1];
|
|
1622
1659
|
function NameField({
|
|
1623
1660
|
onCommit,
|
|
@@ -1638,7 +1675,7 @@ function NameField({
|
|
|
1638
1675
|
}
|
|
1639
1676
|
onCommit(next);
|
|
1640
1677
|
};
|
|
1641
|
-
return /* @__PURE__ */
|
|
1678
|
+
return /* @__PURE__ */ jsx19(
|
|
1642
1679
|
"input",
|
|
1643
1680
|
{
|
|
1644
1681
|
ref,
|
|
@@ -1665,7 +1702,7 @@ function BriefIdentity() {
|
|
|
1665
1702
|
const { identity } = useLabels().presence.brief;
|
|
1666
1703
|
const [editing, setEditing] = React13.useState(false);
|
|
1667
1704
|
if (editing) {
|
|
1668
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ jsx19("div", { className: presenceClass.identity, children: /* @__PURE__ */ jsx19(
|
|
1669
1706
|
NameField,
|
|
1670
1707
|
{
|
|
1671
1708
|
initial: name === null ? "" : name,
|
|
@@ -1677,7 +1714,7 @@ function BriefIdentity() {
|
|
|
1677
1714
|
}
|
|
1678
1715
|
) });
|
|
1679
1716
|
}
|
|
1680
|
-
return /* @__PURE__ */
|
|
1717
|
+
return /* @__PURE__ */ jsx19("div", { className: presenceClass.identity, children: name === null ? /* @__PURE__ */ jsx19(
|
|
1681
1718
|
"button",
|
|
1682
1719
|
{
|
|
1683
1720
|
type: "button",
|
|
@@ -1685,7 +1722,7 @@ function BriefIdentity() {
|
|
|
1685
1722
|
onClick: () => setEditing(true),
|
|
1686
1723
|
children: identity.invite
|
|
1687
1724
|
}
|
|
1688
|
-
) : /* @__PURE__ */
|
|
1725
|
+
) : /* @__PURE__ */ jsx19(
|
|
1689
1726
|
motion.button,
|
|
1690
1727
|
{
|
|
1691
1728
|
type: "button",
|
|
@@ -1701,7 +1738,8 @@ function BriefIdentity() {
|
|
|
1701
1738
|
}
|
|
1702
1739
|
|
|
1703
1740
|
// src/agent/presence/PresenceBrief.tsx
|
|
1704
|
-
import {
|
|
1741
|
+
import { useForgetFact as useForgetFact2, useUndismissedFacts } from "@40rty/ams-sdk";
|
|
1742
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1705
1743
|
var SETTLE2 = [0.22, 1, 0.36, 1];
|
|
1706
1744
|
function partition(facts) {
|
|
1707
1745
|
const recalled = [];
|
|
@@ -1718,20 +1756,20 @@ function Group({
|
|
|
1718
1756
|
onForget
|
|
1719
1757
|
}) {
|
|
1720
1758
|
if (facts.length === 0) return null;
|
|
1721
|
-
return /* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ jsxs12("section", { className: presenceClass.briefGroup, children: [
|
|
1760
|
+
/* @__PURE__ */ jsx20("header", { className: presenceClass.briefGroupHead, children: /* @__PURE__ */ jsx20("span", { className: presenceClass.eyebrow, children: title }) }),
|
|
1761
|
+
/* @__PURE__ */ jsx20("div", { className: presenceClass.facts, "data-editable": "true", "data-brief": "true", children: /* @__PURE__ */ jsx20(AnimatePresence, { initial: false, children: facts.map((f) => /* @__PURE__ */ jsx20(FactChip, { fact: f, onForget }, f.label)) }) })
|
|
1724
1762
|
] });
|
|
1725
1763
|
}
|
|
1726
1764
|
function PresenceBriefBody({ facts }) {
|
|
1727
|
-
const { forget } =
|
|
1765
|
+
const { forget } = useForgetFact2();
|
|
1728
1766
|
const { brief } = useLabels().presence;
|
|
1729
1767
|
const { recalled, inferred } = React14.useMemo(() => partition(facts), [facts]);
|
|
1730
1768
|
if (facts.length === 0) return null;
|
|
1731
|
-
return /* @__PURE__ */
|
|
1732
|
-
/* @__PURE__ */
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
1769
|
+
return /* @__PURE__ */ jsxs12("div", { className: presenceClass.brief, children: [
|
|
1770
|
+
/* @__PURE__ */ jsx20(BriefIdentity, {}),
|
|
1771
|
+
/* @__PURE__ */ jsx20(Group, { title: brief.recalled.title, facts: recalled, onForget: forget }),
|
|
1772
|
+
/* @__PURE__ */ jsx20(Group, { title: brief.inferred.title, facts: inferred, onForget: forget })
|
|
1735
1773
|
] });
|
|
1736
1774
|
}
|
|
1737
1775
|
function PresenceBriefDrawer() {
|
|
@@ -1743,14 +1781,14 @@ function PresenceBriefDrawer() {
|
|
|
1743
1781
|
);
|
|
1744
1782
|
const visible = useUndismissedFacts(view.facts);
|
|
1745
1783
|
if (visible.length === 0) return null;
|
|
1746
|
-
return /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsx20(
|
|
1747
1785
|
motion.div,
|
|
1748
1786
|
{
|
|
1749
1787
|
className: presenceClass.briefPanel,
|
|
1750
1788
|
initial: { opacity: 0 },
|
|
1751
1789
|
animate: { opacity: 1 },
|
|
1752
1790
|
transition: { duration: 0.24, ease: SETTLE2 },
|
|
1753
|
-
children: /* @__PURE__ */
|
|
1791
|
+
children: /* @__PURE__ */ jsx20(PresenceBriefBody, { facts: visible })
|
|
1754
1792
|
}
|
|
1755
1793
|
);
|
|
1756
1794
|
}
|
|
@@ -1779,48 +1817,49 @@ function useMeasuredHeight() {
|
|
|
1779
1817
|
}
|
|
1780
1818
|
|
|
1781
1819
|
// src/agent/presence/reads.tsx
|
|
1782
|
-
import {
|
|
1820
|
+
import { useForgetFact as useForgetFact3 } from "@40rty/ams-sdk";
|
|
1821
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1783
1822
|
function Thought({
|
|
1784
1823
|
text,
|
|
1785
1824
|
eyebrow,
|
|
1786
1825
|
compact = false
|
|
1787
1826
|
}) {
|
|
1788
1827
|
const hasEyebrow = eyebrow.length > 0;
|
|
1789
|
-
return /* @__PURE__ */
|
|
1790
|
-
hasEyebrow && /* @__PURE__ */
|
|
1791
|
-
hasEyebrow && !compact && /* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ jsxs13("div", { className: presenceClass.row, "data-compact": compact ? "true" : void 0, children: [
|
|
1829
|
+
hasEyebrow && /* @__PURE__ */ jsx21(Eyebrow, { children: eyebrow }),
|
|
1830
|
+
hasEyebrow && !compact && /* @__PURE__ */ jsx21(Rule, {}),
|
|
1831
|
+
/* @__PURE__ */ jsx21("span", { className: presenceClass.prose, children: text })
|
|
1793
1832
|
] });
|
|
1794
1833
|
}
|
|
1795
1834
|
function Dossier({ text, facts, eyebrow }) {
|
|
1796
1835
|
const hasEyebrow = eyebrow.length > 0;
|
|
1797
|
-
const { forget } =
|
|
1836
|
+
const { forget } = useForgetFact3();
|
|
1798
1837
|
const shown = facts;
|
|
1799
|
-
return /* @__PURE__ */
|
|
1800
|
-
hasEyebrow && /* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1838
|
+
return /* @__PURE__ */ jsxs13("div", { className: presenceClass.dossier, children: [
|
|
1839
|
+
hasEyebrow && /* @__PURE__ */ jsx21("div", { className: presenceClass.kicker, children: /* @__PURE__ */ jsx21(Eyebrow, { children: eyebrow }) }),
|
|
1840
|
+
/* @__PURE__ */ jsx21("span", { className: presenceClass.prose, children: text }),
|
|
1802
1841
|
shown.length > 0 && // ONE flat list — no group headers, no taxonomy. The long/short-term
|
|
1803
1842
|
// distinction is carried by the entries' MATERIAL (a durable fact's
|
|
1804
1843
|
// value is set: full weight, anchored hairline; a this-visit note is
|
|
1805
1844
|
// provisional: same shape, lighter register) and by ORDER (durable
|
|
1806
1845
|
// first). The surface never explains itself with labels.
|
|
1807
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ jsx21("div", { className: presenceClass.facts, children: /* @__PURE__ */ jsx21(AnimatePresence, { initial: false, children: sortFactsByTier(shown).map((f) => /* @__PURE__ */ jsx21(FactChip, { fact: f, onForget: forget }, f.label)) }) })
|
|
1808
1847
|
] });
|
|
1809
1848
|
}
|
|
1810
1849
|
|
|
1811
1850
|
// src/agent/presence/forms.tsx
|
|
1812
1851
|
import { registerPresenceForm } from "@40rty/ams-sdk";
|
|
1813
|
-
import { jsx as
|
|
1852
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1814
1853
|
function DossierForm({ frame, expanded }) {
|
|
1815
1854
|
const text = typeof frame.text === "string" ? frame.text : "";
|
|
1816
1855
|
const facts = useVisibleFacts(frame);
|
|
1817
1856
|
const label = readLabel(frame);
|
|
1818
|
-
return expanded ? /* @__PURE__ */
|
|
1857
|
+
return expanded ? /* @__PURE__ */ jsx22(Dossier, { text, facts, eyebrow: label }) : /* @__PURE__ */ jsx22(FoldedRead, { label, facts, text });
|
|
1819
1858
|
}
|
|
1820
1859
|
function ThoughtForm({ frame, expanded }) {
|
|
1821
1860
|
const text = typeof frame.text === "string" ? frame.text : "";
|
|
1822
1861
|
const label = readLabel(frame);
|
|
1823
|
-
return expanded ? /* @__PURE__ */
|
|
1862
|
+
return expanded ? /* @__PURE__ */ jsx22(Thought, { text, eyebrow: label }) : /* @__PURE__ */ jsx22(FoldedRead, { label, facts: [], text });
|
|
1824
1863
|
}
|
|
1825
1864
|
var registered2 = false;
|
|
1826
1865
|
function registerDefaultPresenceForms() {
|
|
@@ -1835,7 +1874,7 @@ registerDefaultPresenceForms();
|
|
|
1835
1874
|
import * as React20 from "react";
|
|
1836
1875
|
import {
|
|
1837
1876
|
usePresenceMaterialized,
|
|
1838
|
-
useFourtySession
|
|
1877
|
+
useFourtySession as useFourtySession2
|
|
1839
1878
|
} from "@40rty/ams-sdk";
|
|
1840
1879
|
import { useFormFactor as useFormFactor2 } from "@40rty/ams-sdk";
|
|
1841
1880
|
|
|
@@ -1875,6 +1914,7 @@ function useBandBeat(value, signature) {
|
|
|
1875
1914
|
|
|
1876
1915
|
// src/agent/presence/fact-slots.ts
|
|
1877
1916
|
import * as React17 from "react";
|
|
1917
|
+
import { useDismissedLabels } from "@40rty/ams-sdk";
|
|
1878
1918
|
function emptySlotRegistry(limit) {
|
|
1879
1919
|
return { slots: new Array(limit).fill(void 0), clock: 0 };
|
|
1880
1920
|
}
|
|
@@ -1999,7 +2039,7 @@ function useHeldSlotCount(slots, holdMs) {
|
|
|
1999
2039
|
|
|
2000
2040
|
// src/agent/presence/CriteriaRail.tsx
|
|
2001
2041
|
import * as React18 from "react";
|
|
2002
|
-
import { Fragment as Fragment4, jsx as
|
|
2042
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2003
2043
|
var CRITERION_EXIT_S = 0.16;
|
|
2004
2044
|
var CRITERION_ENTER_DELAY_S = 0.08;
|
|
2005
2045
|
var Criterion = React18.forwardRef(function Criterion2({ fact, slot, onOpenBrief }, ref) {
|
|
@@ -2010,13 +2050,13 @@ var Criterion = React18.forwardRef(function Criterion2({ fact, slot, onOpenBrief
|
|
|
2010
2050
|
}
|
|
2011
2051
|
if (ref !== null) ref.current = el;
|
|
2012
2052
|
}, [ref]);
|
|
2013
|
-
const content = /* @__PURE__ */
|
|
2014
|
-
/* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2053
|
+
const content = /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
2054
|
+
/* @__PURE__ */ jsx23("span", { className: presenceClass.factLabel, style: { lineHeight: `${CRITERION_LABEL_LINE}px` }, children: fact.label }),
|
|
2055
|
+
/* @__PURE__ */ jsxs14("span", { className: presenceClass.factValue, style: { lineHeight: `${CRITERION_VALUE_LINE}px` }, children: [
|
|
2016
2056
|
colorSwatch(fact.value),
|
|
2017
2057
|
fact.value
|
|
2018
2058
|
] }),
|
|
2019
|
-
/* @__PURE__ */
|
|
2059
|
+
/* @__PURE__ */ jsx23(
|
|
2020
2060
|
motion.span,
|
|
2021
2061
|
{
|
|
2022
2062
|
"aria-hidden": true,
|
|
@@ -2067,9 +2107,9 @@ var Criterion = React18.forwardRef(function Criterion2({ fact, slot, onOpenBrief
|
|
|
2067
2107
|
}
|
|
2068
2108
|
};
|
|
2069
2109
|
if (onOpenBrief === void 0) {
|
|
2070
|
-
return /* @__PURE__ */
|
|
2110
|
+
return /* @__PURE__ */ jsx23(motion.span, { ref: attach, ...common, children: content });
|
|
2071
2111
|
}
|
|
2072
|
-
return /* @__PURE__ */
|
|
2112
|
+
return /* @__PURE__ */ jsx23(
|
|
2073
2113
|
motion.button,
|
|
2074
2114
|
{
|
|
2075
2115
|
type: "button",
|
|
@@ -2089,12 +2129,12 @@ function MoreTail({
|
|
|
2089
2129
|
const { brief } = useLabels().presence;
|
|
2090
2130
|
const style = { gridColumn: lane, gridRow: 1 };
|
|
2091
2131
|
if (onOpenBrief === void 0) {
|
|
2092
|
-
return /* @__PURE__ */
|
|
2132
|
+
return /* @__PURE__ */ jsxs14("span", { className: presenceClass.factMore, style, children: [
|
|
2093
2133
|
"+",
|
|
2094
2134
|
count
|
|
2095
2135
|
] });
|
|
2096
2136
|
}
|
|
2097
|
-
return /* @__PURE__ */
|
|
2137
|
+
return /* @__PURE__ */ jsxs14(
|
|
2098
2138
|
"button",
|
|
2099
2139
|
{
|
|
2100
2140
|
type: "button",
|
|
@@ -2118,7 +2158,7 @@ function CriteriaRail({
|
|
|
2118
2158
|
onOpenBrief
|
|
2119
2159
|
}) {
|
|
2120
2160
|
const lanes = { tail: hidden > 0, handle: brief !== void 0 };
|
|
2121
|
-
return /* @__PURE__ */
|
|
2161
|
+
return /* @__PURE__ */ jsxs14(
|
|
2122
2162
|
"div",
|
|
2123
2163
|
{
|
|
2124
2164
|
className: presenceClass.criteria,
|
|
@@ -2127,7 +2167,7 @@ function CriteriaRail({
|
|
|
2127
2167
|
columnGap: CRITERION_GAP
|
|
2128
2168
|
},
|
|
2129
2169
|
children: [
|
|
2130
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ jsx23(AnimatePresence, { initial: false, children: facts.map(({ fact, slot }) => /* @__PURE__ */ jsx23(
|
|
2131
2171
|
Criterion,
|
|
2132
2172
|
{
|
|
2133
2173
|
fact,
|
|
@@ -2136,13 +2176,13 @@ function CriteriaRail({
|
|
|
2136
2176
|
},
|
|
2137
2177
|
factIdentity(fact)
|
|
2138
2178
|
)) }),
|
|
2139
|
-
lanes.tail && /* @__PURE__ */
|
|
2140
|
-
brief !== void 0 && /* @__PURE__ */
|
|
2179
|
+
lanes.tail && /* @__PURE__ */ jsx23(MoreTail, { count: hidden, onOpenBrief, lane: railTailLane(slots) }),
|
|
2180
|
+
brief !== void 0 && /* @__PURE__ */ jsx23(
|
|
2141
2181
|
"span",
|
|
2142
2182
|
{
|
|
2143
2183
|
className: presenceClass.railHandle,
|
|
2144
2184
|
style: { gridColumn: railHandleLane(slots, lanes), gridRow: 1 },
|
|
2145
|
-
children: /* @__PURE__ */
|
|
2185
|
+
children: /* @__PURE__ */ jsx23(BriefHandle, { open: brief.open, onToggle: brief.toggle })
|
|
2146
2186
|
}
|
|
2147
2187
|
)
|
|
2148
2188
|
]
|
|
@@ -2152,7 +2192,7 @@ function CriteriaRail({
|
|
|
2152
2192
|
|
|
2153
2193
|
// src/agent/presence/VoiceLine.tsx
|
|
2154
2194
|
import * as React19 from "react";
|
|
2155
|
-
import { jsx as
|
|
2195
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2156
2196
|
var WORD_FADE_S = 0.14;
|
|
2157
2197
|
var WORD_STAGGER_S = 0.014;
|
|
2158
2198
|
var SWEEP_MAX_S = 0.26;
|
|
@@ -2172,11 +2212,11 @@ function VoiceLine({ text, className, style, delay = 0 }) {
|
|
|
2172
2212
|
const parts = React19.useMemo(() => partsWithWordIndex(text), [text]);
|
|
2173
2213
|
const words = parts.length === 0 ? 0 : parts[parts.length - 1].word + 1;
|
|
2174
2214
|
const step = words <= 1 ? 0 : Math.min(WORD_STAGGER_S, SWEEP_MAX_S / words);
|
|
2175
|
-
if (reduce === true) return /* @__PURE__ */
|
|
2215
|
+
if (reduce === true) return /* @__PURE__ */ jsx24("span", { className, style, children: text });
|
|
2176
2216
|
return (
|
|
2177
2217
|
// Keyed by the sentence: a NEW read is a new arrival, so the stagger runs
|
|
2178
2218
|
// again from the left rather than the changed words popping in place.
|
|
2179
|
-
/* @__PURE__ */
|
|
2219
|
+
/* @__PURE__ */ jsx24("span", { className, style, children: parts.map(({ part, word }, i) => /* @__PURE__ */ jsx24(
|
|
2180
2220
|
motion.span,
|
|
2181
2221
|
{
|
|
2182
2222
|
initial: { opacity: 0 },
|
|
@@ -2190,7 +2230,7 @@ function VoiceLine({ text, className, style, delay = 0 }) {
|
|
|
2190
2230
|
}
|
|
2191
2231
|
|
|
2192
2232
|
// src/agent/presence/StreamRead.tsx
|
|
2193
|
-
import { jsx as
|
|
2233
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2194
2234
|
var DECK_SIZE = "compact";
|
|
2195
2235
|
function compositionSignature(view) {
|
|
2196
2236
|
const facts = view.facts.map((f) => `${f.label}=${f.value}`).join("|");
|
|
@@ -2228,14 +2268,14 @@ function PresenceStream({
|
|
|
2228
2268
|
tail: more > 0,
|
|
2229
2269
|
handle: brief !== void 0
|
|
2230
2270
|
});
|
|
2231
|
-
return /* @__PURE__ */
|
|
2271
|
+
return /* @__PURE__ */ jsx25("div", { className: presenceClass.stream, children: hasRow && /* @__PURE__ */ jsxs15(
|
|
2232
2272
|
"div",
|
|
2233
2273
|
{
|
|
2234
2274
|
className: presenceClass.row,
|
|
2235
2275
|
"data-tracks": "band",
|
|
2236
2276
|
style: { gridTemplateColumns: bandRowTemplate(railWidth, deckWidth), height: BAND_HEIGHT },
|
|
2237
2277
|
children: [
|
|
2238
|
-
/* @__PURE__ */
|
|
2278
|
+
/* @__PURE__ */ jsx25(
|
|
2239
2279
|
CriteriaRail,
|
|
2240
2280
|
{
|
|
2241
2281
|
facts: rowFacts,
|
|
@@ -2245,7 +2285,7 @@ function PresenceStream({
|
|
|
2245
2285
|
onOpenBrief
|
|
2246
2286
|
}
|
|
2247
2287
|
),
|
|
2248
|
-
/* @__PURE__ */
|
|
2288
|
+
/* @__PURE__ */ jsx25(
|
|
2249
2289
|
VoiceLine,
|
|
2250
2290
|
{
|
|
2251
2291
|
className: presenceClass.voiceLine,
|
|
@@ -2254,9 +2294,9 @@ function PresenceStream({
|
|
|
2254
2294
|
delay: bandRegionDelay("voice")
|
|
2255
2295
|
}
|
|
2256
2296
|
),
|
|
2257
|
-
/* @__PURE__ */
|
|
2258
|
-
rowFacts.length > 0 && hasDeck && /* @__PURE__ */
|
|
2259
|
-
/* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ jsxs15("div", { className: presenceClass.deck, style: { width: deckWidth }, children: [
|
|
2298
|
+
rowFacts.length > 0 && hasDeck && /* @__PURE__ */ jsx25("span", { "aria-hidden": true, className: presenceClass.gate }),
|
|
2299
|
+
/* @__PURE__ */ jsx25(
|
|
2260
2300
|
SourceSift,
|
|
2261
2301
|
{
|
|
2262
2302
|
sources: composed.sources,
|
|
@@ -2276,13 +2316,13 @@ function streamLeadLine(view) {
|
|
|
2276
2316
|
}
|
|
2277
2317
|
|
|
2278
2318
|
// src/agent/presence/PresenceFiller.tsx
|
|
2279
|
-
import { jsx as
|
|
2319
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2280
2320
|
function PresenceFiller() {
|
|
2281
|
-
return /* @__PURE__ */
|
|
2321
|
+
return /* @__PURE__ */ jsx26("span", { className: presenceClass.filler, "aria-hidden": "true" });
|
|
2282
2322
|
}
|
|
2283
2323
|
|
|
2284
2324
|
// src/agent/presence/AgentPresenceWidget.tsx
|
|
2285
|
-
import { jsx as
|
|
2325
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2286
2326
|
var SETTLE3 = [0.22, 1, 0.36, 1];
|
|
2287
2327
|
function AgentPresenceWidget({
|
|
2288
2328
|
expanded,
|
|
@@ -2294,7 +2334,7 @@ function AgentPresenceWidget({
|
|
|
2294
2334
|
idleContent
|
|
2295
2335
|
}) {
|
|
2296
2336
|
const materialized = usePresenceMaterialized();
|
|
2297
|
-
const { isRunning, isSubmitting } =
|
|
2337
|
+
const { isRunning, isSubmitting } = useFourtySession2();
|
|
2298
2338
|
const working = isRunning || isSubmitting;
|
|
2299
2339
|
const { isMobile } = useFormFactor2();
|
|
2300
2340
|
const [measureRef, height] = useMeasuredHeight();
|
|
@@ -2314,7 +2354,7 @@ function AgentPresenceWidget({
|
|
|
2314
2354
|
if (isMobile) {
|
|
2315
2355
|
let node2 = null;
|
|
2316
2356
|
if (!viewIsEmpty(view)) {
|
|
2317
|
-
node2 = expanded && hasHeld ? /* @__PURE__ */
|
|
2357
|
+
node2 = expanded && hasHeld ? /* @__PURE__ */ jsx27(PresenceBriefBody, { facts }) : /* @__PURE__ */ jsx27(
|
|
2318
2358
|
CompactStream,
|
|
2319
2359
|
{
|
|
2320
2360
|
lead: hasHeld ? streamLeadLine(view) : "",
|
|
@@ -2327,17 +2367,17 @@ function AgentPresenceWidget({
|
|
|
2327
2367
|
);
|
|
2328
2368
|
} else if (!working) {
|
|
2329
2369
|
if (idleContent !== void 0) node2 = idleContent;
|
|
2330
|
-
else if (!suppressIdleFallback) node2 = /* @__PURE__ */
|
|
2370
|
+
else if (!suppressIdleFallback) node2 = /* @__PURE__ */ jsx27(Fallback, {});
|
|
2331
2371
|
}
|
|
2332
|
-
return /* @__PURE__ */
|
|
2333
|
-
working && /* @__PURE__ */
|
|
2334
|
-
/* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ jsxs16("div", { className: presenceClass.root, "data-compact": "true", "data-working": working ? "true" : "false", children: [
|
|
2373
|
+
working && /* @__PURE__ */ jsx27(PresenceFiller, {}),
|
|
2374
|
+
/* @__PURE__ */ jsx27("div", { className: presenceClass.measure, children: /* @__PURE__ */ jsx27(AnimatePresence, { mode: "popLayout", initial: false, children: node2 !== null && /* @__PURE__ */ jsx27(motion.div, { className: presenceClass.frame, ...enter, children: node2 }, viewIsEmpty(view) ? "idle" : "stream") }) })
|
|
2335
2375
|
] });
|
|
2336
2376
|
}
|
|
2337
2377
|
let node = null;
|
|
2338
2378
|
let key = "idle";
|
|
2339
2379
|
if (!viewIsEmpty(view)) {
|
|
2340
|
-
node = /* @__PURE__ */
|
|
2380
|
+
node = /* @__PURE__ */ jsx27(
|
|
2341
2381
|
PresenceStream,
|
|
2342
2382
|
{
|
|
2343
2383
|
view,
|
|
@@ -2355,10 +2395,10 @@ function AgentPresenceWidget({
|
|
|
2355
2395
|
} else if (idleContent !== void 0) {
|
|
2356
2396
|
node = idleContent;
|
|
2357
2397
|
} else if (!suppressIdleFallback) {
|
|
2358
|
-
node = /* @__PURE__ */
|
|
2398
|
+
node = /* @__PURE__ */ jsx27(Fallback, {});
|
|
2359
2399
|
}
|
|
2360
2400
|
const bandHeight = BAND_HEIGHT;
|
|
2361
|
-
return /* @__PURE__ */
|
|
2401
|
+
return /* @__PURE__ */ jsxs16(
|
|
2362
2402
|
motion.div,
|
|
2363
2403
|
{
|
|
2364
2404
|
className: presenceClass.root,
|
|
@@ -2368,20 +2408,20 @@ function AgentPresenceWidget({
|
|
|
2368
2408
|
animate: staticBand ? void 0 : { height: bandHeight },
|
|
2369
2409
|
transition: snap ? { duration: 0 } : { duration: 0.7, ease: SETTLE3 },
|
|
2370
2410
|
children: [
|
|
2371
|
-
working && /* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
2411
|
+
working && /* @__PURE__ */ jsx27(PresenceFiller, {}),
|
|
2412
|
+
/* @__PURE__ */ jsx27("div", { ref: staticBand ? void 0 : measureRef, className: presenceClass.measure, children: /* @__PURE__ */ jsx27(AnimatePresence, { mode: "popLayout", initial: false, children: node !== null && /* @__PURE__ */ jsx27(motion.div, { className: presenceClass.frame, ...enter, children: node }, key) }) })
|
|
2373
2413
|
]
|
|
2374
2414
|
}
|
|
2375
2415
|
);
|
|
2376
2416
|
}
|
|
2377
2417
|
|
|
2378
2418
|
// src/agent/presence/DefaultNotch.tsx
|
|
2379
|
-
import { jsx as
|
|
2419
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2380
2420
|
var DEFAULT_NOTCH_WIDGETS = [
|
|
2381
2421
|
{ id: "read", zone: "lead", Component: AgentPresenceWidget }
|
|
2382
2422
|
];
|
|
2383
2423
|
function DefaultNotch() {
|
|
2384
|
-
return /* @__PURE__ */
|
|
2424
|
+
return /* @__PURE__ */ jsx28(PresenceNotch, { widgets: DEFAULT_NOTCH_WIDGETS });
|
|
2385
2425
|
}
|
|
2386
2426
|
|
|
2387
2427
|
// src/agent/presence/fact-forms/class-names.ts
|
|
@@ -2402,21 +2442,21 @@ var factFormClass = {
|
|
|
2402
2442
|
|
|
2403
2443
|
// src/agent/presence/fact-forms/baseline-forms.tsx
|
|
2404
2444
|
import { colorHexOf as colorHexOf2, factFigureParts } from "@40rty/ams-sdk";
|
|
2405
|
-
import { jsx as
|
|
2445
|
+
import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2406
2446
|
function BaselineColorFactForm({ fact }) {
|
|
2407
2447
|
const hex = colorHexOf2(fact.value);
|
|
2408
|
-
return /* @__PURE__ */
|
|
2409
|
-
hex !== null && /* @__PURE__ */
|
|
2410
|
-
/* @__PURE__ */
|
|
2448
|
+
return /* @__PURE__ */ jsxs17("span", { className: factFormClass.color, children: [
|
|
2449
|
+
hex !== null && /* @__PURE__ */ jsx29("span", { "aria-hidden": true, className: factFormClass.colorChip, style: { background: hex } }),
|
|
2450
|
+
/* @__PURE__ */ jsx29("span", { className: factFormClass.colorName, children: fact.value })
|
|
2411
2451
|
] });
|
|
2412
2452
|
}
|
|
2413
2453
|
function BaselineFigureFactForm({ fact }) {
|
|
2414
2454
|
const parts = factFigureParts(fact);
|
|
2415
|
-
if (parts === null) return /* @__PURE__ */
|
|
2416
|
-
return /* @__PURE__ */
|
|
2417
|
-
parts.before.length > 0 && /* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
parts.after.length > 0 && /* @__PURE__ */
|
|
2455
|
+
if (parts === null) return /* @__PURE__ */ jsx29("span", { className: factFormClass.figure, children: fact.value.trim() });
|
|
2456
|
+
return /* @__PURE__ */ jsxs17("span", { className: factFormClass.figure, children: [
|
|
2457
|
+
parts.before.length > 0 && /* @__PURE__ */ jsx29("span", { className: factFormClass.figureQualifier, children: parts.before }),
|
|
2458
|
+
/* @__PURE__ */ jsx29("span", { className: factFormClass.figureAmount, children: parts.figure }),
|
|
2459
|
+
parts.after.length > 0 && /* @__PURE__ */ jsx29("span", { className: factFormClass.figureQualifier, children: parts.after })
|
|
2420
2460
|
] });
|
|
2421
2461
|
}
|
|
2422
2462
|
|
|
@@ -2431,7 +2471,7 @@ function registerBaselineFactForms() {
|
|
|
2431
2471
|
// src/agent/presence/LayoutMorphSkeleton.tsx
|
|
2432
2472
|
import * as React21 from "react";
|
|
2433
2473
|
import { useDocumentVisible, useInterval } from "@40rty/ams-sdk";
|
|
2434
|
-
import { jsx as
|
|
2474
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2435
2475
|
var LAYOUT_ARCHETYPES = [
|
|
2436
2476
|
{ rects: [{ l: 0, t: 0, w: 100, h: 100 }] },
|
|
2437
2477
|
{
|
|
@@ -2487,10 +2527,10 @@ function useLayoutMorph(active) {
|
|
|
2487
2527
|
return { index, label, rects: archetype.rects };
|
|
2488
2528
|
}
|
|
2489
2529
|
function LayoutMorphSkeleton({ rects }) {
|
|
2490
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx30("div", { className: presenceClass.layoutMorph, "aria-hidden": true, children: Array.from({ length: TILE_SLOTS }, (_, i) => {
|
|
2491
2531
|
const on = i < rects.length;
|
|
2492
2532
|
const rect = on ? rects[i] : COLLAPSED;
|
|
2493
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ jsx30(
|
|
2494
2534
|
"div",
|
|
2495
2535
|
{
|
|
2496
2536
|
className: presenceClass.layoutMorphTile,
|
|
@@ -2509,7 +2549,7 @@ function LayoutMorphSkeleton({ rects }) {
|
|
|
2509
2549
|
|
|
2510
2550
|
// src/agent/presence/InlinePresenceRead.tsx
|
|
2511
2551
|
import { useAgentPresence, useAgentPresenceFresh } from "@40rty/ams-sdk";
|
|
2512
|
-
import { jsx as
|
|
2552
|
+
import { jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2513
2553
|
function InlinePresenceRead({
|
|
2514
2554
|
flowId,
|
|
2515
2555
|
compact = false
|
|
@@ -2520,16 +2560,20 @@ function InlinePresenceRead({
|
|
|
2520
2560
|
const readText = hasRead && frame !== null && typeof frame.text === "string" ? frame.text : "";
|
|
2521
2561
|
const morph = useLayoutMorph(true);
|
|
2522
2562
|
const statusText = readText.length > 0 ? readText : morph.label;
|
|
2523
|
-
return /* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2563
|
+
return /* @__PURE__ */ jsxs18("div", { className: presenceClass.loaderColumn, children: [
|
|
2564
|
+
/* @__PURE__ */ jsx31(LayoutMorphSkeleton, { rects: morph.rects }),
|
|
2565
|
+
/* @__PURE__ */ jsx31("div", { className: presenceClass.status, "aria-live": "polite", children: /* @__PURE__ */ jsx31(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx31(motion.span, { className: presenceClass.prose, ...enter, children: statusText }, statusText) }) })
|
|
2526
2566
|
] });
|
|
2527
2567
|
}
|
|
2528
2568
|
|
|
2569
|
+
// src/agent/presence/index.ts
|
|
2570
|
+
import { useForgetFact as useForgetFact4, useVisibleFactList } from "@40rty/ams-sdk";
|
|
2571
|
+
|
|
2529
2572
|
// src/agent/presence/KnowledgePeek.tsx
|
|
2530
2573
|
import * as React22 from "react";
|
|
2531
2574
|
import { usePresenceElements as usePresenceElements2, usePresenceLiveTurn as usePresenceLiveTurn2 } from "@40rty/ams-sdk";
|
|
2532
|
-
import {
|
|
2575
|
+
import { useUndismissedFacts as useUndismissedFacts2 } from "@40rty/ams-sdk";
|
|
2576
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2533
2577
|
function PresenceBriefRail() {
|
|
2534
2578
|
const elements = usePresenceElements2();
|
|
2535
2579
|
const liveTurnId = usePresenceLiveTurn2();
|
|
@@ -2537,9 +2581,9 @@ function PresenceBriefRail() {
|
|
|
2537
2581
|
() => derivePresenceView(elements, liveTurnId),
|
|
2538
2582
|
[elements, liveTurnId]
|
|
2539
2583
|
);
|
|
2540
|
-
const facts = useRetainedFacts(
|
|
2584
|
+
const facts = useRetainedFacts(useUndismissedFacts2(view.facts));
|
|
2541
2585
|
if (facts.length === 0) return null;
|
|
2542
|
-
return /* @__PURE__ */
|
|
2586
|
+
return /* @__PURE__ */ jsx32(FactChips, { facts });
|
|
2543
2587
|
}
|
|
2544
2588
|
|
|
2545
2589
|
export {
|
|
@@ -2604,5 +2648,7 @@ export {
|
|
|
2604
2648
|
registerBaselineFactForms,
|
|
2605
2649
|
LayoutMorphSkeleton,
|
|
2606
2650
|
InlinePresenceRead,
|
|
2607
|
-
PresenceBriefRail
|
|
2651
|
+
PresenceBriefRail,
|
|
2652
|
+
useForgetFact4 as useForgetFact,
|
|
2653
|
+
useVisibleFactList
|
|
2608
2654
|
};
|