@40rty/ams-sdk 0.5.16 → 0.5.17
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/index.js +160 -177
- package/dist/types/sdk/src/canvas/index.d.ts +0 -1
- package/dist/types/sdk/src/host/host-modules.d.ts +1 -3
- package/dist/types/spacestation/src/catalog/catalog-schemas.d.ts +3 -2
- package/dist/types/spacestation/src/contracts/retrieval/core/platform-connector.d.ts +6 -0
- package/dist/types/spacestation/src/space/agent-directive.d.ts +4 -4
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +10 -0
- package/package.json +1 -1
- package/dist/types/sdk/src/canvas/hydration-notice.d.ts +0 -23
package/dist/index.js
CHANGED
|
@@ -151,7 +151,6 @@ __export(src_exports3, {
|
|
|
151
151
|
HostExportsSchema: () => HostExportsSchema,
|
|
152
152
|
HostImportsSchema: () => HostImportsSchema,
|
|
153
153
|
HostPayloadSchema: () => HostPayloadSchema,
|
|
154
|
-
HydrationNoticeProvider: () => HydrationNoticeProvider,
|
|
155
154
|
HydrationStateContext: () => HydrationStateContext,
|
|
156
155
|
HydratorProvider: () => HydratorProvider,
|
|
157
156
|
INITIAL_NAV_PRESENTATION: () => INITIAL_NAV_PRESENTATION,
|
|
@@ -656,7 +655,6 @@ __export(src_exports3, {
|
|
|
656
655
|
useHasLeftSeedHome: () => useHasLeftSeedHome,
|
|
657
656
|
useHistoryNav: () => useHistoryNav,
|
|
658
657
|
useHydrated: () => useHydrated,
|
|
659
|
-
useHydrationNotice: () => useHydrationNotice,
|
|
660
658
|
useHydrationState: () => useHydrationState,
|
|
661
659
|
useHydrators: () => useHydrators,
|
|
662
660
|
useInlineCompletion: () => useInlineCompletion,
|
|
@@ -4119,7 +4117,7 @@ function scopeOfAttributeKey(config, key) {
|
|
|
4119
4117
|
|
|
4120
4118
|
// ../spacestation/src/space/agent-directive.ts
|
|
4121
4119
|
import { z as z38 } from "zod";
|
|
4122
|
-
var MAX_ACTIVE_AGENT_DIRECTIVES =
|
|
4120
|
+
var MAX_ACTIVE_AGENT_DIRECTIVES = 20;
|
|
4123
4121
|
var AGENT_DIRECTIVE_KINDS = ["preference", "pairing", "order of things", "promise", "threshold"];
|
|
4124
4122
|
var AGENT_DIRECTIVE_SEVERITIES = ["a missed opportunity", "a problem", "unacceptable"];
|
|
4125
4123
|
var AGENT_DIRECTIVE_SOURCES = ["owner", "operator", "session-lesson"];
|
|
@@ -8103,7 +8101,6 @@ __export(canvas_exports, {
|
|
|
8103
8101
|
GENERATION_EASE: () => GENERATION_EASE,
|
|
8104
8102
|
GenerationStyleContext: () => GenerationStyleContext,
|
|
8105
8103
|
GenerationStyleProvider: () => GenerationStyleProvider,
|
|
8106
|
-
HydrationNoticeProvider: () => HydrationNoticeProvider,
|
|
8107
8104
|
INITIAL_NAV_PRESENTATION: () => INITIAL_NAV_PRESENTATION,
|
|
8108
8105
|
ITEM_IDENTITY_ATTR: () => ITEM_IDENTITY_ATTR,
|
|
8109
8106
|
ItemTransitionGroup: () => ItemTransitionGroup,
|
|
@@ -8165,7 +8162,6 @@ __export(canvas_exports, {
|
|
|
8165
8162
|
useGenerationStyle: () => useGenerationStyle,
|
|
8166
8163
|
useHasLeftSeedHome: () => useHasLeftSeedHome,
|
|
8167
8164
|
useHistoryNav: () => useHistoryNav,
|
|
8168
|
-
useHydrationNotice: () => useHydrationNotice,
|
|
8169
8165
|
useInteraction: () => useInteraction,
|
|
8170
8166
|
useIsSeedHome: () => useIsSeedHome,
|
|
8171
8167
|
useLayout: () => useLayout,
|
|
@@ -8209,19 +8205,8 @@ function CanvasTailMount({
|
|
|
8209
8205
|
return /* @__PURE__ */ jsx9(Tail, {});
|
|
8210
8206
|
}
|
|
8211
8207
|
|
|
8212
|
-
// src/canvas/hydration-notice.tsx
|
|
8213
|
-
import * as React27 from "react";
|
|
8214
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
8215
|
-
var HydrationNoticeContext = React27.createContext(null);
|
|
8216
|
-
function HydrationNoticeProvider({ notice, children }) {
|
|
8217
|
-
return /* @__PURE__ */ jsx10(HydrationNoticeContext.Provider, { value: notice, children });
|
|
8218
|
-
}
|
|
8219
|
-
function useHydrationNotice() {
|
|
8220
|
-
return React27.useContext(HydrationNoticeContext);
|
|
8221
|
-
}
|
|
8222
|
-
|
|
8223
8208
|
// src/canvas/GenerationStyleContext.tsx
|
|
8224
|
-
import { createContext as
|
|
8209
|
+
import { createContext as createContext12, useContext as useContext12 } from "react";
|
|
8225
8210
|
|
|
8226
8211
|
// src/canvas/generation-style.ts
|
|
8227
8212
|
var DEFAULT_GENERATION_TIMINGS = {
|
|
@@ -8247,19 +8232,19 @@ var DEFAULT_GENERATION_STYLE = {
|
|
|
8247
8232
|
var GENERATION_EASE = [0.76, 0, 0.24, 1];
|
|
8248
8233
|
|
|
8249
8234
|
// src/canvas/GenerationStyleContext.tsx
|
|
8250
|
-
var GenerationStyleContext =
|
|
8235
|
+
var GenerationStyleContext = createContext12(DEFAULT_GENERATION_STYLE);
|
|
8251
8236
|
var GenerationStyleProvider = GenerationStyleContext.Provider;
|
|
8252
8237
|
function useGenerationStyle() {
|
|
8253
|
-
return
|
|
8238
|
+
return useContext12(GenerationStyleContext);
|
|
8254
8239
|
}
|
|
8255
8240
|
|
|
8256
8241
|
// src/canvas/ShimmerSweep.tsx
|
|
8257
8242
|
import { motion, useReducedMotion } from "framer-motion";
|
|
8258
|
-
import { jsx as
|
|
8243
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
8259
8244
|
function ShimmerSweep({ durationS }) {
|
|
8260
8245
|
const reduce = useReducedMotion();
|
|
8261
8246
|
if (reduce === true) return null;
|
|
8262
|
-
return /* @__PURE__ */
|
|
8247
|
+
return /* @__PURE__ */ jsx10(
|
|
8263
8248
|
motion.div,
|
|
8264
8249
|
{
|
|
8265
8250
|
"aria-hidden": true,
|
|
@@ -8277,14 +8262,14 @@ function ShimmerSweep({ durationS }) {
|
|
|
8277
8262
|
}
|
|
8278
8263
|
|
|
8279
8264
|
// src/canvas/TransitionContext.tsx
|
|
8280
|
-
import
|
|
8265
|
+
import React27, { createContext as createContext13, useContext as useContext13 } from "react";
|
|
8281
8266
|
import { AnimatePresence, motion as motion2 } from "framer-motion";
|
|
8282
|
-
import { jsx as
|
|
8267
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
8283
8268
|
function FadeGroup({ children }) {
|
|
8284
|
-
return /* @__PURE__ */
|
|
8269
|
+
return /* @__PURE__ */ jsx11(AnimatePresence, { mode: "popLayout", initial: false, children });
|
|
8285
8270
|
}
|
|
8286
|
-
var FadeItem =
|
|
8287
|
-
return /* @__PURE__ */
|
|
8271
|
+
var FadeItem = React27.forwardRef(function FadeItem2({ id, children, style, className }, ref) {
|
|
8272
|
+
return /* @__PURE__ */ jsx11(
|
|
8288
8273
|
motion2.div,
|
|
8289
8274
|
{
|
|
8290
8275
|
ref,
|
|
@@ -8299,62 +8284,62 @@ var FadeTransition = {
|
|
|
8299
8284
|
Group: FadeGroup,
|
|
8300
8285
|
Item: FadeItem
|
|
8301
8286
|
};
|
|
8302
|
-
var TransitionContext =
|
|
8287
|
+
var TransitionContext = createContext13(FadeTransition);
|
|
8303
8288
|
function TransitionProvider({
|
|
8304
8289
|
transition,
|
|
8305
8290
|
children
|
|
8306
8291
|
}) {
|
|
8307
|
-
return /* @__PURE__ */
|
|
8292
|
+
return /* @__PURE__ */ jsx11(TransitionContext.Provider, { value: transition, children });
|
|
8308
8293
|
}
|
|
8309
8294
|
function useLayoutTransition() {
|
|
8310
|
-
return
|
|
8295
|
+
return useContext13(TransitionContext);
|
|
8311
8296
|
}
|
|
8312
8297
|
|
|
8313
8298
|
// src/canvas/canvas-arrangement.tsx
|
|
8314
|
-
import
|
|
8315
|
-
import { jsx as
|
|
8316
|
-
var CanvasArrangementContext =
|
|
8299
|
+
import React28, { createContext as createContext14, useContext as useContext14 } from "react";
|
|
8300
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
8301
|
+
var CanvasArrangementContext = createContext14({ arrangement: "stack", turnPages: false });
|
|
8317
8302
|
function CanvasArrangementProvider({
|
|
8318
8303
|
arrangement,
|
|
8319
8304
|
turnPages = false,
|
|
8320
8305
|
children
|
|
8321
8306
|
}) {
|
|
8322
|
-
const value =
|
|
8323
|
-
return /* @__PURE__ */
|
|
8307
|
+
const value = React28.useMemo(() => ({ arrangement, turnPages }), [arrangement, turnPages]);
|
|
8308
|
+
return /* @__PURE__ */ jsx12(CanvasArrangementContext.Provider, { value, children });
|
|
8324
8309
|
}
|
|
8325
8310
|
function useCanvasArrangement() {
|
|
8326
|
-
return
|
|
8311
|
+
return useContext14(CanvasArrangementContext);
|
|
8327
8312
|
}
|
|
8328
8313
|
|
|
8329
8314
|
// src/canvas/canvas-lead.tsx
|
|
8330
|
-
import * as
|
|
8331
|
-
import { jsx as
|
|
8315
|
+
import * as React29 from "react";
|
|
8316
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
8332
8317
|
var NO_LEAD = () => false;
|
|
8333
|
-
var CanvasLeadContext =
|
|
8318
|
+
var CanvasLeadContext = React29.createContext(null);
|
|
8334
8319
|
function CanvasLeadProvider(props) {
|
|
8335
|
-
const [target, setTarget] =
|
|
8336
|
-
const [leadId, setLeadId] =
|
|
8320
|
+
const [target, setTarget] = React29.useState(null);
|
|
8321
|
+
const [leadId, setLeadId] = React29.useState(null);
|
|
8337
8322
|
const listed = "types" in props ? props.types : props.except;
|
|
8338
8323
|
const only = "types" in props;
|
|
8339
|
-
const canLead =
|
|
8340
|
-
const value =
|
|
8341
|
-
return /* @__PURE__ */
|
|
8324
|
+
const canLead = React29.useCallback((type) => listed.includes(type) === only, [listed, only]);
|
|
8325
|
+
const value = React29.useMemo(() => ({ canLead, target, setTarget, leadId, setLeadId }), [canLead, target, leadId]);
|
|
8326
|
+
return /* @__PURE__ */ jsx13(CanvasLeadContext.Provider, { value, children: props.children });
|
|
8342
8327
|
}
|
|
8343
8328
|
function CanvasLeadSlot({ className }) {
|
|
8344
|
-
const lead =
|
|
8329
|
+
const lead = React29.useContext(CanvasLeadContext);
|
|
8345
8330
|
if (lead === null) throw new Error("<CanvasLeadSlot> must be rendered inside <CanvasLeadProvider>.");
|
|
8346
8331
|
const { setTarget } = lead;
|
|
8347
|
-
const ref =
|
|
8348
|
-
return /* @__PURE__ */
|
|
8332
|
+
const ref = React29.useCallback((el) => setTarget(el), [setTarget]);
|
|
8333
|
+
return /* @__PURE__ */ jsx13("div", { ref, className, "data-fourty-canvas-lead": "" });
|
|
8349
8334
|
}
|
|
8350
8335
|
function useCanvasLead() {
|
|
8351
|
-
const lead =
|
|
8336
|
+
const lead = React29.useContext(CanvasLeadContext);
|
|
8352
8337
|
return { present: lead !== null && lead.target !== null && lead.leadId !== null };
|
|
8353
8338
|
}
|
|
8354
8339
|
function useCanvasLeadTarget() {
|
|
8355
|
-
const lead =
|
|
8340
|
+
const lead = React29.useContext(CanvasLeadContext);
|
|
8356
8341
|
const setLeadId = lead === null ? null : lead.setLeadId;
|
|
8357
|
-
const report =
|
|
8342
|
+
const report = React29.useCallback((id) => {
|
|
8358
8343
|
if (setLeadId !== null) setLeadId(id);
|
|
8359
8344
|
}, [setLeadId]);
|
|
8360
8345
|
if (lead === null) return { canLead: NO_LEAD, target: null, report };
|
|
@@ -8362,21 +8347,21 @@ function useCanvasLeadTarget() {
|
|
|
8362
8347
|
}
|
|
8363
8348
|
|
|
8364
8349
|
// src/canvas/canvas-motion-style.tsx
|
|
8365
|
-
import { createContext as
|
|
8366
|
-
import { jsx as
|
|
8367
|
-
var CanvasMotionStyleContext =
|
|
8350
|
+
import { createContext as createContext16, useContext as useContext16 } from "react";
|
|
8351
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
8352
|
+
var CanvasMotionStyleContext = createContext16(null);
|
|
8368
8353
|
function CanvasMotionStyleProvider({ style, children }) {
|
|
8369
|
-
return /* @__PURE__ */
|
|
8354
|
+
return /* @__PURE__ */ jsx14(CanvasMotionStyleContext.Provider, { value: style, children });
|
|
8370
8355
|
}
|
|
8371
8356
|
function useCanvasMotionStyle() {
|
|
8372
|
-
return
|
|
8357
|
+
return useContext16(CanvasMotionStyleContext);
|
|
8373
8358
|
}
|
|
8374
8359
|
|
|
8375
8360
|
// src/canvas/ElementIdContext.ts
|
|
8376
|
-
import { createContext as
|
|
8377
|
-
var ElementIdContext =
|
|
8361
|
+
import { createContext as createContext17, useContext as useContext17 } from "react";
|
|
8362
|
+
var ElementIdContext = createContext17(null);
|
|
8378
8363
|
function useElementId() {
|
|
8379
|
-
return
|
|
8364
|
+
return useContext17(ElementIdContext);
|
|
8380
8365
|
}
|
|
8381
8366
|
|
|
8382
8367
|
// src/canvas/generation-entrance.ts
|
|
@@ -8636,22 +8621,22 @@ function deriveTurnChangeAnchor(prev, next) {
|
|
|
8636
8621
|
}
|
|
8637
8622
|
|
|
8638
8623
|
// src/canvas/canvas-outlet.tsx
|
|
8639
|
-
import { createContext as
|
|
8640
|
-
import { jsx as
|
|
8641
|
-
var CanvasOutletContext =
|
|
8624
|
+
import { createContext as createContext18, useContext as useContext18 } from "react";
|
|
8625
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
8626
|
+
var CanvasOutletContext = createContext18(null);
|
|
8642
8627
|
function CanvasOutletProvider({ canvas, children }) {
|
|
8643
|
-
return /* @__PURE__ */
|
|
8628
|
+
return /* @__PURE__ */ jsx15(CanvasOutletContext.Provider, { value: canvas, children });
|
|
8644
8629
|
}
|
|
8645
8630
|
function SpacefrontCanvas() {
|
|
8646
|
-
const Canvas =
|
|
8631
|
+
const Canvas = useContext18(CanvasOutletContext);
|
|
8647
8632
|
if (Canvas === null) {
|
|
8648
8633
|
throw new Error("<SpacefrontCanvas> must be rendered inside <Spacefront> \u2014 no engine has provided a canvas.");
|
|
8649
8634
|
}
|
|
8650
|
-
return /* @__PURE__ */
|
|
8635
|
+
return /* @__PURE__ */ jsx15(Canvas, {});
|
|
8651
8636
|
}
|
|
8652
8637
|
|
|
8653
8638
|
// src/canvas/item-motion/ItemTransitionGroup.tsx
|
|
8654
|
-
import
|
|
8639
|
+
import React31 from "react";
|
|
8655
8640
|
import { AnimatePresence as AnimatePresence2, motion as motion3, useReducedMotion as useReducedMotion2 } from "framer-motion";
|
|
8656
8641
|
|
|
8657
8642
|
// src/canvas/item-motion/classify-items.ts
|
|
@@ -8870,7 +8855,7 @@ function getActiveProfile() {
|
|
|
8870
8855
|
}
|
|
8871
8856
|
|
|
8872
8857
|
// src/canvas/item-motion/ItemTransitionGroup.tsx
|
|
8873
|
-
import { jsx as
|
|
8858
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
8874
8859
|
var ITEM_IDENTITY_ATTR = "data-flip-id";
|
|
8875
8860
|
function ItemTransitionGroup({
|
|
8876
8861
|
items,
|
|
@@ -8885,14 +8870,14 @@ function ItemTransitionGroup({
|
|
|
8885
8870
|
const profile = getActiveProfile();
|
|
8886
8871
|
const animated = reduce !== true;
|
|
8887
8872
|
const ids = items.map(getId);
|
|
8888
|
-
const prevIdsRef =
|
|
8889
|
-
const lastChangeRef =
|
|
8873
|
+
const prevIdsRef = React31.useRef(null);
|
|
8874
|
+
const lastChangeRef = React31.useRef(null);
|
|
8890
8875
|
const prevIds = prevIdsRef.current;
|
|
8891
8876
|
const freshChange = prevIds === null ? null : classifyItemChange(prevIds, ids);
|
|
8892
8877
|
if (freshChange !== null) {
|
|
8893
8878
|
lastChangeRef.current = freshChange;
|
|
8894
8879
|
}
|
|
8895
|
-
|
|
8880
|
+
React31.useEffect(() => {
|
|
8896
8881
|
prevIdsRef.current = ids;
|
|
8897
8882
|
});
|
|
8898
8883
|
const activeChange = lastChangeRef.current;
|
|
@@ -8905,7 +8890,7 @@ function ItemTransitionGroup({
|
|
|
8905
8890
|
const isGrid = itemClassName === void 0;
|
|
8906
8891
|
const outerClassName = isGrid ? "h-full" : itemClassName;
|
|
8907
8892
|
const innerClassName = isGrid ? "h-full" : void 0;
|
|
8908
|
-
return /* @__PURE__ */
|
|
8893
|
+
return /* @__PURE__ */ jsx16("div", { className, style, children: /* @__PURE__ */ jsx16(AnimatePresence2, { mode: "popLayout", initial: false, children: items.map((item) => {
|
|
8909
8894
|
const id = getId(item);
|
|
8910
8895
|
const identityAttr = { [ITEM_IDENTITY_ATTR]: id };
|
|
8911
8896
|
const isEntering = activeChange !== null && activeChange.entered.includes(id);
|
|
@@ -8915,7 +8900,7 @@ function ItemTransitionGroup({
|
|
|
8915
8900
|
// `itemClassName`/`itemStyle` size the wrapper for flex/snap
|
|
8916
8901
|
// layouts (carousel); grid layouts leave them unset and get
|
|
8917
8902
|
// `h-full` so the cell height reaches the card.
|
|
8918
|
-
/* @__PURE__ */
|
|
8903
|
+
/* @__PURE__ */ jsx16(
|
|
8919
8904
|
motion3.div,
|
|
8920
8905
|
{
|
|
8921
8906
|
...identityAttr,
|
|
@@ -8924,7 +8909,7 @@ function ItemTransitionGroup({
|
|
|
8924
8909
|
layout: animated ? "position" : void 0,
|
|
8925
8910
|
layoutDependency,
|
|
8926
8911
|
transition: animated ? layoutTransition : void 0,
|
|
8927
|
-
children: /* @__PURE__ */
|
|
8912
|
+
children: /* @__PURE__ */ jsx16(
|
|
8928
8913
|
motion3.div,
|
|
8929
8914
|
{
|
|
8930
8915
|
className: innerClassName,
|
|
@@ -9005,21 +8990,21 @@ __export(catalog_exports, {
|
|
|
9005
8990
|
});
|
|
9006
8991
|
|
|
9007
8992
|
// src/catalog/DebugContext.tsx
|
|
9008
|
-
import { createContext as
|
|
9009
|
-
import { jsx as
|
|
9010
|
-
var DebugContext =
|
|
8993
|
+
import { createContext as createContext19, useContext as useContext19 } from "react";
|
|
8994
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
8995
|
+
var DebugContext = createContext19(false);
|
|
9011
8996
|
function DebugProvider({
|
|
9012
8997
|
debug,
|
|
9013
8998
|
children
|
|
9014
8999
|
}) {
|
|
9015
|
-
return /* @__PURE__ */
|
|
9000
|
+
return /* @__PURE__ */ jsx17(DebugContext.Provider, { value: debug, children });
|
|
9016
9001
|
}
|
|
9017
9002
|
function useDebug() {
|
|
9018
|
-
return
|
|
9003
|
+
return useContext19(DebugContext);
|
|
9019
9004
|
}
|
|
9020
9005
|
|
|
9021
9006
|
// src/catalog/HydrationStateContext.tsx
|
|
9022
|
-
import { createContext as
|
|
9007
|
+
import { createContext as createContext20, useContext as useContext20 } from "react";
|
|
9023
9008
|
var DEFAULT_STATE = {
|
|
9024
9009
|
hasResolvedFields: false,
|
|
9025
9010
|
hydrating: false,
|
|
@@ -9029,47 +9014,47 @@ var DEFAULT_STATE = {
|
|
|
9029
9014
|
pendingCount: 0,
|
|
9030
9015
|
errors: []
|
|
9031
9016
|
};
|
|
9032
|
-
var HydrationStateContext =
|
|
9017
|
+
var HydrationStateContext = createContext20(DEFAULT_STATE);
|
|
9033
9018
|
function useHydrationState() {
|
|
9034
|
-
return
|
|
9019
|
+
return useContext20(HydrationStateContext);
|
|
9035
9020
|
}
|
|
9036
9021
|
|
|
9037
9022
|
// src/catalog/HydratorContext.tsx
|
|
9038
|
-
import { createContext as
|
|
9039
|
-
import { jsx as
|
|
9040
|
-
var HydratorContext =
|
|
9023
|
+
import { createContext as createContext21, useContext as useContext21 } from "react";
|
|
9024
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
9025
|
+
var HydratorContext = createContext21({});
|
|
9041
9026
|
function HydratorProvider({
|
|
9042
9027
|
hydrators,
|
|
9043
9028
|
children
|
|
9044
9029
|
}) {
|
|
9045
|
-
return /* @__PURE__ */
|
|
9030
|
+
return /* @__PURE__ */ jsx18(HydratorContext.Provider, { value: hydrators, children });
|
|
9046
9031
|
}
|
|
9047
9032
|
function useHydrators() {
|
|
9048
|
-
return
|
|
9033
|
+
return useContext21(HydratorContext);
|
|
9049
9034
|
}
|
|
9050
9035
|
|
|
9051
9036
|
// src/catalog/registry.tsx
|
|
9052
|
-
import { createContext as
|
|
9053
|
-
import { jsx as
|
|
9054
|
-
var RegistryContext =
|
|
9037
|
+
import { createContext as createContext22, useContext as useContext22 } from "react";
|
|
9038
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
9039
|
+
var RegistryContext = createContext22({});
|
|
9055
9040
|
function RegistryProvider({
|
|
9056
9041
|
registry: registry2,
|
|
9057
9042
|
children
|
|
9058
9043
|
}) {
|
|
9059
|
-
return /* @__PURE__ */
|
|
9044
|
+
return /* @__PURE__ */ jsx19(RegistryContext.Provider, { value: registry2, children });
|
|
9060
9045
|
}
|
|
9061
9046
|
function useRegistry() {
|
|
9062
|
-
return
|
|
9047
|
+
return useContext22(RegistryContext);
|
|
9063
9048
|
}
|
|
9064
|
-
var PackageLookupContext =
|
|
9049
|
+
var PackageLookupContext = createContext22(null);
|
|
9065
9050
|
function PackageLookupProvider({
|
|
9066
9051
|
lookup,
|
|
9067
9052
|
children
|
|
9068
9053
|
}) {
|
|
9069
|
-
return /* @__PURE__ */
|
|
9054
|
+
return /* @__PURE__ */ jsx19(PackageLookupContext.Provider, { value: lookup, children });
|
|
9070
9055
|
}
|
|
9071
9056
|
function usePackageLookup() {
|
|
9072
|
-
return
|
|
9057
|
+
return useContext22(PackageLookupContext);
|
|
9073
9058
|
}
|
|
9074
9059
|
function createAliasedRegistry(baseRegistry, aliases, getPackageComponent) {
|
|
9075
9060
|
return new Proxy(baseRegistry, {
|
|
@@ -9100,7 +9085,7 @@ function createAliasedRegistry(baseRegistry, aliases, getPackageComponent) {
|
|
|
9100
9085
|
}
|
|
9101
9086
|
|
|
9102
9087
|
// src/catalog/render-inline.tsx
|
|
9103
|
-
import
|
|
9088
|
+
import React34 from "react";
|
|
9104
9089
|
|
|
9105
9090
|
// src/catalog/prose-links.ts
|
|
9106
9091
|
var LINK = /\[([^\]\n]+)\]\(([^)\s]+)\)/g;
|
|
@@ -9126,8 +9111,8 @@ function proseRuns(text2) {
|
|
|
9126
9111
|
}
|
|
9127
9112
|
|
|
9128
9113
|
// src/catalog/render-inline.tsx
|
|
9129
|
-
import { jsx as
|
|
9130
|
-
var linkRenderer = (href, key) => /* @__PURE__ */
|
|
9114
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
9115
|
+
var linkRenderer = (href, key) => /* @__PURE__ */ jsx20(
|
|
9131
9116
|
"a",
|
|
9132
9117
|
{
|
|
9133
9118
|
className: "fourty-inline-link",
|
|
@@ -9143,7 +9128,7 @@ function linkifyText(text2, keyPrefix) {
|
|
|
9143
9128
|
return proseRuns(text2).flatMap((run, r) => {
|
|
9144
9129
|
if (run.href === void 0) return linkifyBareUrls(run.text, `${keyPrefix}-${String(r)}`);
|
|
9145
9130
|
return [
|
|
9146
|
-
/* @__PURE__ */
|
|
9131
|
+
/* @__PURE__ */ jsx20("a", { className: "fourty-inline-link", href: run.href, target: "_blank", rel: "noopener noreferrer", children: run.text }, `${keyPrefix}-${String(r)}-ll`)
|
|
9147
9132
|
];
|
|
9148
9133
|
});
|
|
9149
9134
|
}
|
|
@@ -9155,14 +9140,14 @@ function linkifyBareUrls(text2, keyPrefix) {
|
|
|
9155
9140
|
URL_RE.lastIndex = 0;
|
|
9156
9141
|
while ((match = URL_RE.exec(text2)) !== null) {
|
|
9157
9142
|
if (match.index > last) {
|
|
9158
|
-
out.push(/* @__PURE__ */
|
|
9143
|
+
out.push(/* @__PURE__ */ jsx20(React34.Fragment, { children: text2.slice(last, match.index) }, `${keyPrefix}-lt-${i++}`));
|
|
9159
9144
|
}
|
|
9160
9145
|
const href = match[0];
|
|
9161
9146
|
out.push(linkRenderer(href, `${keyPrefix}-lk-${i++}`));
|
|
9162
9147
|
last = match.index + href.length;
|
|
9163
9148
|
}
|
|
9164
9149
|
if (last < text2.length) {
|
|
9165
|
-
out.push(/* @__PURE__ */
|
|
9150
|
+
out.push(/* @__PURE__ */ jsx20(React34.Fragment, { children: text2.slice(last) }, `${keyPrefix}-lt-${i++}`));
|
|
9166
9151
|
}
|
|
9167
9152
|
return out;
|
|
9168
9153
|
}
|
|
@@ -9175,8 +9160,8 @@ function renderInline(text2, keyPrefix) {
|
|
|
9175
9160
|
while ((match = re.exec(text2)) !== null) {
|
|
9176
9161
|
if (match.index > last) out.push(...linkifyText(text2.slice(last, match.index), `${keyPrefix}-t-${i++}`));
|
|
9177
9162
|
const bold = match[1];
|
|
9178
|
-
if (bold !== void 0) out.push(/* @__PURE__ */
|
|
9179
|
-
else out.push(/* @__PURE__ */
|
|
9163
|
+
if (bold !== void 0) out.push(/* @__PURE__ */ jsx20("strong", { children: bold }, `${keyPrefix}-b-${i++}`));
|
|
9164
|
+
else out.push(/* @__PURE__ */ jsx20("em", { children: match[2] }, `${keyPrefix}-i-${i++}`));
|
|
9180
9165
|
last = match.index + match[0].length;
|
|
9181
9166
|
}
|
|
9182
9167
|
if (last < text2.length) out.push(...linkifyText(text2.slice(last), `${keyPrefix}-t-${i++}`));
|
|
@@ -9184,7 +9169,7 @@ function renderInline(text2, keyPrefix) {
|
|
|
9184
9169
|
}
|
|
9185
9170
|
|
|
9186
9171
|
// src/catalog/component-library.ts
|
|
9187
|
-
import * as
|
|
9172
|
+
import * as React35 from "react";
|
|
9188
9173
|
function displayNameOf(Inner) {
|
|
9189
9174
|
if (typeof Inner === "string") return Inner;
|
|
9190
9175
|
if (typeof Inner.displayName === "string" && Inner.displayName.length > 0) return Inner.displayName;
|
|
@@ -9193,7 +9178,7 @@ function displayNameOf(Inner) {
|
|
|
9193
9178
|
}
|
|
9194
9179
|
function adaptComponent(Inner) {
|
|
9195
9180
|
function Adapted(props) {
|
|
9196
|
-
return
|
|
9181
|
+
return React35.createElement(Inner, props);
|
|
9197
9182
|
}
|
|
9198
9183
|
Adapted.displayName = displayNameOf(Inner);
|
|
9199
9184
|
return Adapted;
|
|
@@ -9590,7 +9575,7 @@ function useConsumeStandingSignal(type) {
|
|
|
9590
9575
|
}
|
|
9591
9576
|
|
|
9592
9577
|
// src/widgets/presence/use-presence-notch.ts
|
|
9593
|
-
import * as
|
|
9578
|
+
import * as React36 from "react";
|
|
9594
9579
|
var SETTLE_DWELL_MS = 4e3;
|
|
9595
9580
|
var HOVER_CLOSE_MS = 240;
|
|
9596
9581
|
var HOVER_BOUNCE_WINDOW_MS = 800;
|
|
@@ -9598,21 +9583,21 @@ var BOUNCE_PX = 2;
|
|
|
9598
9583
|
function usePresenceNotch(widgets) {
|
|
9599
9584
|
const askStanding = useStandingOfType(AGENT_ASK_SIGNAL) !== null;
|
|
9600
9585
|
const { isRunning } = useAgentPresence();
|
|
9601
|
-
const [hovered, setHovered] =
|
|
9602
|
-
const [openDrawerId, setOpenDrawerId] =
|
|
9603
|
-
const rootRef =
|
|
9604
|
-
const toggleDrawer =
|
|
9586
|
+
const [hovered, setHovered] = React36.useState(false);
|
|
9587
|
+
const [openDrawerId, setOpenDrawerId] = React36.useState(null);
|
|
9588
|
+
const rootRef = React36.useRef(null);
|
|
9589
|
+
const toggleDrawer = React36.useCallback((id) => {
|
|
9605
9590
|
setOpenDrawerId((current2) => current2 === id ? null : id);
|
|
9606
9591
|
}, []);
|
|
9607
|
-
const closeTimer =
|
|
9608
|
-
const cancelClose =
|
|
9592
|
+
const closeTimer = React36.useRef(null);
|
|
9593
|
+
const cancelClose = React36.useCallback(() => {
|
|
9609
9594
|
if (closeTimer.current !== null) {
|
|
9610
9595
|
clearTimeout(closeTimer.current);
|
|
9611
9596
|
closeTimer.current = null;
|
|
9612
9597
|
}
|
|
9613
9598
|
}, []);
|
|
9614
|
-
const lastLeaveRef =
|
|
9615
|
-
const openHover =
|
|
9599
|
+
const lastLeaveRef = React36.useRef(null);
|
|
9600
|
+
const openHover = React36.useCallback((e) => {
|
|
9616
9601
|
const last = lastLeaveRef.current;
|
|
9617
9602
|
if (last !== null && Date.now() - last.t < HOVER_BOUNCE_WINDOW_MS && Math.abs(e.clientX - last.x) <= BOUNCE_PX && Math.abs(e.clientY - last.y) <= BOUNCE_PX) {
|
|
9618
9603
|
return;
|
|
@@ -9620,7 +9605,7 @@ function usePresenceNotch(widgets) {
|
|
|
9620
9605
|
cancelClose();
|
|
9621
9606
|
setHovered(true);
|
|
9622
9607
|
}, [cancelClose]);
|
|
9623
|
-
const scheduleClose =
|
|
9608
|
+
const scheduleClose = React36.useCallback((e) => {
|
|
9624
9609
|
lastLeaveRef.current = { x: e.clientX, y: e.clientY, t: Date.now() };
|
|
9625
9610
|
cancelClose();
|
|
9626
9611
|
closeTimer.current = setTimeout(() => {
|
|
@@ -9628,8 +9613,8 @@ function usePresenceNotch(widgets) {
|
|
|
9628
9613
|
setHovered(false);
|
|
9629
9614
|
}, HOVER_CLOSE_MS);
|
|
9630
9615
|
}, [cancelClose]);
|
|
9631
|
-
|
|
9632
|
-
|
|
9616
|
+
React36.useEffect(() => cancelClose, [cancelClose]);
|
|
9617
|
+
React36.useEffect(() => {
|
|
9633
9618
|
if (openDrawerId === null) return;
|
|
9634
9619
|
const onKey = (e) => {
|
|
9635
9620
|
if (e.key === "Escape") setOpenDrawerId(null);
|
|
@@ -9637,7 +9622,7 @@ function usePresenceNotch(widgets) {
|
|
|
9637
9622
|
window.addEventListener("keydown", onKey);
|
|
9638
9623
|
return () => window.removeEventListener("keydown", onKey);
|
|
9639
9624
|
}, [openDrawerId]);
|
|
9640
|
-
|
|
9625
|
+
React36.useEffect(() => {
|
|
9641
9626
|
if (openDrawerId === null) return;
|
|
9642
9627
|
const onDown = (e) => {
|
|
9643
9628
|
const root = rootRef.current;
|
|
@@ -9649,8 +9634,8 @@ function usePresenceNotch(widgets) {
|
|
|
9649
9634
|
document.addEventListener("pointerdown", onDown);
|
|
9650
9635
|
return () => document.removeEventListener("pointerdown", onDown);
|
|
9651
9636
|
}, [openDrawerId]);
|
|
9652
|
-
const [active, setActive] =
|
|
9653
|
-
|
|
9637
|
+
const [active, setActive] = React36.useState(false);
|
|
9638
|
+
React36.useEffect(() => {
|
|
9654
9639
|
if (isRunning) {
|
|
9655
9640
|
setActive(true);
|
|
9656
9641
|
return;
|
|
@@ -9810,7 +9795,7 @@ function presenceFactShape(fact) {
|
|
|
9810
9795
|
}
|
|
9811
9796
|
|
|
9812
9797
|
// src/widgets/presence/use-optimistic-facts.ts
|
|
9813
|
-
import * as
|
|
9798
|
+
import * as React37 from "react";
|
|
9814
9799
|
function readEntries(data) {
|
|
9815
9800
|
if (typeof data !== "object" || data === null || !("entries" in data)) return [];
|
|
9816
9801
|
const raw = data.entries;
|
|
@@ -9829,7 +9814,7 @@ function writeOptimisticFact(entries3, fact) {
|
|
|
9829
9814
|
}
|
|
9830
9815
|
function useOptimisticFactOverlay(flowId) {
|
|
9831
9816
|
const entries3 = readEntries(useAgentFlow(flowId));
|
|
9832
|
-
return
|
|
9817
|
+
return React37.useMemo(
|
|
9833
9818
|
() => ({
|
|
9834
9819
|
entries: entries3,
|
|
9835
9820
|
add: (fact) => setFlowOutput(flowId, { entries: writeOptimisticFact(entries3, fact) })
|
|
@@ -9838,8 +9823,8 @@ function useOptimisticFactOverlay(flowId) {
|
|
|
9838
9823
|
);
|
|
9839
9824
|
}
|
|
9840
9825
|
function useReconcileOptimisticFacts(flowId, readIdentity) {
|
|
9841
|
-
const seenRef =
|
|
9842
|
-
|
|
9826
|
+
const seenRef = React37.useRef(null);
|
|
9827
|
+
React37.useEffect(() => {
|
|
9843
9828
|
if (readIdentity === null) return;
|
|
9844
9829
|
if (seenRef.current === null) {
|
|
9845
9830
|
seenRef.current = readIdentity;
|
|
@@ -10011,10 +9996,10 @@ __export(chat_exports, {
|
|
|
10011
9996
|
});
|
|
10012
9997
|
|
|
10013
9998
|
// src/chat/chat-context.ts
|
|
10014
|
-
import { createContext as
|
|
10015
|
-
var FourtyChatContext =
|
|
9999
|
+
import { createContext as createContext23, useContext as useContext23 } from "react";
|
|
10000
|
+
var FourtyChatContext = createContext23(null);
|
|
10016
10001
|
function useFourtyChat() {
|
|
10017
|
-
const ctx =
|
|
10002
|
+
const ctx = useContext23(FourtyChatContext);
|
|
10018
10003
|
if (!ctx) throw new Error("useFourtyChat must be used inside <FourtyChatProvider>");
|
|
10019
10004
|
return ctx;
|
|
10020
10005
|
}
|
|
@@ -10251,34 +10236,34 @@ __export(interaction_exports, {
|
|
|
10251
10236
|
});
|
|
10252
10237
|
|
|
10253
10238
|
// src/interaction/withInteractionTracking.tsx
|
|
10254
|
-
import
|
|
10255
|
-
import { jsx as
|
|
10256
|
-
var InteractionContext =
|
|
10239
|
+
import React38, { createContext as createContext24, useContext as useContext24 } from "react";
|
|
10240
|
+
import { jsx as jsx21, jsxs } from "react/jsx-runtime";
|
|
10241
|
+
var InteractionContext = createContext24(null);
|
|
10257
10242
|
function InteractionProvider({
|
|
10258
10243
|
onInteraction,
|
|
10259
10244
|
children
|
|
10260
10245
|
}) {
|
|
10261
|
-
return /* @__PURE__ */
|
|
10246
|
+
return /* @__PURE__ */ jsx21(InteractionContext.Provider, { value: onInteraction, children });
|
|
10262
10247
|
}
|
|
10263
10248
|
function useInteraction2() {
|
|
10264
|
-
return
|
|
10249
|
+
return useContext24(InteractionContext);
|
|
10265
10250
|
}
|
|
10266
10251
|
function withInteractionTracking(WrappedComponent, meta) {
|
|
10267
10252
|
function TrackedComponent(props) {
|
|
10268
|
-
return /* @__PURE__ */
|
|
10253
|
+
return /* @__PURE__ */ jsx21(
|
|
10269
10254
|
"div",
|
|
10270
10255
|
{
|
|
10271
10256
|
"data-tracked-component": meta.componentId,
|
|
10272
10257
|
"data-tracked-component-type": meta.componentType,
|
|
10273
10258
|
style: { display: "contents" },
|
|
10274
|
-
children: /* @__PURE__ */
|
|
10259
|
+
children: /* @__PURE__ */ jsx21(ComponentErrorBoundary, { componentId: meta.componentId, children: /* @__PURE__ */ jsx21(WrappedComponent, { ...props }) })
|
|
10275
10260
|
}
|
|
10276
10261
|
);
|
|
10277
10262
|
}
|
|
10278
10263
|
TrackedComponent.displayName = `Tracked(${WrappedComponent.displayName || WrappedComponent.name || "Component"})`;
|
|
10279
10264
|
return TrackedComponent;
|
|
10280
10265
|
}
|
|
10281
|
-
var ComponentErrorBoundary = class extends
|
|
10266
|
+
var ComponentErrorBoundary = class extends React38.Component {
|
|
10282
10267
|
constructor() {
|
|
10283
10268
|
super(...arguments);
|
|
10284
10269
|
__publicField(this, "state", { error: null });
|
|
@@ -10292,7 +10277,7 @@ var ComponentErrorBoundary = class extends React39.Component {
|
|
|
10292
10277
|
render() {
|
|
10293
10278
|
if (this.state.error) {
|
|
10294
10279
|
return /* @__PURE__ */ jsxs("div", { className: "fourty-component-error", role: "alert", "data-component-id": this.props.componentId, children: [
|
|
10295
|
-
/* @__PURE__ */
|
|
10280
|
+
/* @__PURE__ */ jsx21("strong", { children: this.props.componentId }),
|
|
10296
10281
|
": ",
|
|
10297
10282
|
this.state.error.message
|
|
10298
10283
|
] });
|
|
@@ -10352,14 +10337,14 @@ __export(utils_exports, {
|
|
|
10352
10337
|
import { useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
10353
10338
|
|
|
10354
10339
|
// src/utils/viewport-window.tsx
|
|
10355
|
-
import { createContext as
|
|
10356
|
-
import { jsx as
|
|
10357
|
-
var ViewportWindowContext =
|
|
10340
|
+
import { createContext as createContext25, useContext as useContext25 } from "react";
|
|
10341
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
10342
|
+
var ViewportWindowContext = createContext25(null);
|
|
10358
10343
|
function canAnswer(win) {
|
|
10359
10344
|
return win !== null && typeof win.matchMedia === "function";
|
|
10360
10345
|
}
|
|
10361
10346
|
function useViewportWindow() {
|
|
10362
|
-
const provided =
|
|
10347
|
+
const provided = useContext25(ViewportWindowContext);
|
|
10363
10348
|
if (provided !== null) return canAnswer(provided) ? provided : null;
|
|
10364
10349
|
const global = globalThis;
|
|
10365
10350
|
return canAnswer(global) ? global : null;
|
|
@@ -10368,7 +10353,7 @@ function ViewportWindowProvider({
|
|
|
10368
10353
|
value,
|
|
10369
10354
|
children
|
|
10370
10355
|
}) {
|
|
10371
|
-
return /* @__PURE__ */
|
|
10356
|
+
return /* @__PURE__ */ jsx22(ViewportWindowContext.Provider, { value, children });
|
|
10372
10357
|
}
|
|
10373
10358
|
|
|
10374
10359
|
// src/utils/use-form-factor.ts
|
|
@@ -10459,7 +10444,7 @@ function useInlineCompletion(opts) {
|
|
|
10459
10444
|
}
|
|
10460
10445
|
|
|
10461
10446
|
// src/utils/use-document-visible.ts
|
|
10462
|
-
import
|
|
10447
|
+
import React39 from "react";
|
|
10463
10448
|
function subscribe4(onChange) {
|
|
10464
10449
|
document.addEventListener("visibilitychange", onChange);
|
|
10465
10450
|
return () => document.removeEventListener("visibilitychange", onChange);
|
|
@@ -10471,15 +10456,15 @@ function getServerSnapshot() {
|
|
|
10471
10456
|
return true;
|
|
10472
10457
|
}
|
|
10473
10458
|
function useDocumentVisible() {
|
|
10474
|
-
return
|
|
10459
|
+
return React39.useSyncExternalStore(subscribe4, getSnapshot, getServerSnapshot);
|
|
10475
10460
|
}
|
|
10476
10461
|
|
|
10477
10462
|
// src/utils/use-interval.ts
|
|
10478
|
-
import
|
|
10463
|
+
import React40 from "react";
|
|
10479
10464
|
function useInterval(callback, ms, active = true) {
|
|
10480
|
-
const cbRef =
|
|
10465
|
+
const cbRef = React40.useRef(callback);
|
|
10481
10466
|
cbRef.current = callback;
|
|
10482
|
-
|
|
10467
|
+
React40.useEffect(() => {
|
|
10483
10468
|
if (!active) return;
|
|
10484
10469
|
const id = window.setInterval(() => cbRef.current(), ms);
|
|
10485
10470
|
return () => window.clearInterval(id);
|
|
@@ -10691,15 +10676,15 @@ function primedEntitiesFor(resolverKey) {
|
|
|
10691
10676
|
}
|
|
10692
10677
|
|
|
10693
10678
|
// src/preview/SpacefrontPreviewProvider.tsx
|
|
10694
|
-
import * as
|
|
10695
|
-
import { jsx as
|
|
10679
|
+
import * as React41 from "react";
|
|
10680
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10696
10681
|
var NOOP = () => {
|
|
10697
10682
|
};
|
|
10698
10683
|
var ASYNC_NOOP = () => Promise.resolve();
|
|
10699
10684
|
var VIEW = { page: { kind: "home" }, layout: EMPTY_SPEC, shell: EMPTY_SHELL };
|
|
10700
|
-
var PreviewContext =
|
|
10685
|
+
var PreviewContext = React41.createContext(null);
|
|
10701
10686
|
function usePreview() {
|
|
10702
|
-
const value =
|
|
10687
|
+
const value = React41.useContext(PreviewContext);
|
|
10703
10688
|
if (value === null) throw new Error("preview runtime used outside <SpacefrontPreviewProvider>");
|
|
10704
10689
|
return value;
|
|
10705
10690
|
}
|
|
@@ -10853,11 +10838,11 @@ var PRESENCE = {
|
|
|
10853
10838
|
usePresenceLiveTurn: () => usePreview().pending?.messageId
|
|
10854
10839
|
};
|
|
10855
10840
|
function SpacefrontPreviewProvider({ scene, onSend, children }) {
|
|
10856
|
-
const [sessionId] =
|
|
10857
|
-
const derived =
|
|
10858
|
-
const onSendRef =
|
|
10841
|
+
const [sessionId] = React41.useState(() => `preview-${Math.random().toString(36).slice(2)}`);
|
|
10842
|
+
const derived = React41.useMemo(() => derive(scene, sessionId), [scene, sessionId]);
|
|
10843
|
+
const onSendRef = React41.useRef(onSend);
|
|
10859
10844
|
onSendRef.current = onSend;
|
|
10860
|
-
const draft =
|
|
10845
|
+
const draft = React41.useMemo(() => {
|
|
10861
10846
|
let text2 = "";
|
|
10862
10847
|
const listeners14 = /* @__PURE__ */ new Set();
|
|
10863
10848
|
return {
|
|
@@ -10873,7 +10858,7 @@ function SpacefrontPreviewProvider({ scene, onSend, children }) {
|
|
|
10873
10858
|
}
|
|
10874
10859
|
};
|
|
10875
10860
|
}, []);
|
|
10876
|
-
const session =
|
|
10861
|
+
const session = React41.useMemo(() => {
|
|
10877
10862
|
const send = (text2) => {
|
|
10878
10863
|
draft.set("");
|
|
10879
10864
|
onSendRef.current?.(text2);
|
|
@@ -10925,15 +10910,15 @@ function SpacefrontPreviewProvider({ scene, onSend, children }) {
|
|
|
10925
10910
|
const qId = question === null ? null : question.id;
|
|
10926
10911
|
const qText = question === null ? "" : question.text;
|
|
10927
10912
|
const qReplies = question === null ? "" : list(question.replies).join("\0");
|
|
10928
|
-
const raised =
|
|
10929
|
-
|
|
10913
|
+
const raised = React41.useRef(0);
|
|
10914
|
+
React41.useEffect(() => {
|
|
10930
10915
|
if (qId === null) return;
|
|
10931
10916
|
raised.current += 1;
|
|
10932
10917
|
const id = `${qId}-${raised.current}`;
|
|
10933
10918
|
raiseStanding(AGENT_ASK_SIGNAL, id, { ask: qText, suggestions: qReplies === "" ? [] : qReplies.split("\0") }, sessionId);
|
|
10934
10919
|
return () => resolveStanding(id, sessionId);
|
|
10935
10920
|
}, [qId, qText, qReplies, sessionId]);
|
|
10936
|
-
return /* @__PURE__ */
|
|
10921
|
+
return /* @__PURE__ */ jsx23(PreviewContext.Provider, { value: derived, children: /* @__PURE__ */ jsx23(FourtySessionContext.Provider, { value: session, children: /* @__PURE__ */ jsx23(FourtyRuntimeProvider, { value: RUNTIME, children: /* @__PURE__ */ jsx23(PresenceRuntimeProvider, { value: PRESENCE, children }) }) }) });
|
|
10937
10922
|
}
|
|
10938
10923
|
|
|
10939
10924
|
// src/verticals/commerce/index.ts
|
|
@@ -11077,7 +11062,7 @@ registerEntityPageKind("search", {
|
|
|
11077
11062
|
});
|
|
11078
11063
|
|
|
11079
11064
|
// src/verticals/commerce/commerce-context.tsx
|
|
11080
|
-
import { createContext as
|
|
11065
|
+
import { createContext as createContext27, useContext as useContext27 } from "react";
|
|
11081
11066
|
var INERT_COMMERCE_RUNTIME = {
|
|
11082
11067
|
useCart: () => {
|
|
11083
11068
|
throw new Error("useCart must be used within a <CommerceProvider>");
|
|
@@ -11118,12 +11103,12 @@ var INERT_COMMERCE_RUNTIME = {
|
|
|
11118
11103
|
// No store, no plans: a price line simply shows no installment offer.
|
|
11119
11104
|
useInstallmentOffer: () => void 0
|
|
11120
11105
|
};
|
|
11121
|
-
var FourtyCommerceRuntimeContext =
|
|
11106
|
+
var FourtyCommerceRuntimeContext = createContext27(
|
|
11122
11107
|
INERT_COMMERCE_RUNTIME
|
|
11123
11108
|
);
|
|
11124
11109
|
var FourtyCommerceRuntimeProvider = FourtyCommerceRuntimeContext.Provider;
|
|
11125
11110
|
function useCommerceRuntime() {
|
|
11126
|
-
return
|
|
11111
|
+
return useContext27(FourtyCommerceRuntimeContext);
|
|
11127
11112
|
}
|
|
11128
11113
|
function useCart() {
|
|
11129
11114
|
return useCommerceRuntime().useCart();
|
|
@@ -11897,7 +11882,7 @@ function useCartDrawer() {
|
|
|
11897
11882
|
}
|
|
11898
11883
|
|
|
11899
11884
|
// src/verticals/commerce/cart/use-cart-view.ts
|
|
11900
|
-
import
|
|
11885
|
+
import React42 from "react";
|
|
11901
11886
|
|
|
11902
11887
|
// src/verticals/commerce/cart/queued-discount-codes.ts
|
|
11903
11888
|
import { useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
@@ -11956,7 +11941,7 @@ registerSessionScopedClear(() => {
|
|
|
11956
11941
|
// src/verticals/commerce/cart/use-cart-view.ts
|
|
11957
11942
|
function useCartView(cart, onCheckout) {
|
|
11958
11943
|
const analytics = useOptionalAnalyticsSink();
|
|
11959
|
-
const [exitPending, setExitPending] =
|
|
11944
|
+
const [exitPending, setExitPending] = React42.useState(null);
|
|
11960
11945
|
const lines = cart === null ? [] : cart.lines;
|
|
11961
11946
|
const count = lines.reduce((sum, l) => sum + l.quantity, 0);
|
|
11962
11947
|
const totalsPending = lines.some((l) => isPendingCartLine(l));
|
|
@@ -11967,7 +11952,7 @@ function useCartView(cart, onCheckout) {
|
|
|
11967
11952
|
const backendTotal = cart !== null && cart.total !== void 0 ? cart.total.amount : void 0;
|
|
11968
11953
|
const discountAmount = backendTotal !== void 0 && backendTotal < subtotal ? subtotal - backendTotal : 0;
|
|
11969
11954
|
const effectiveTotal = backendTotal !== void 0 ? backendTotal : subtotal;
|
|
11970
|
-
const navigateToExit =
|
|
11955
|
+
const navigateToExit = React42.useCallback((url, kind) => {
|
|
11971
11956
|
const result = navigateToExternalCommerceUrl(url);
|
|
11972
11957
|
if (kind === "checkout") recordVisitorCheckoutExit(analytics, result);
|
|
11973
11958
|
if (result === "new-tab") {
|
|
@@ -11984,7 +11969,7 @@ function useCartView(cart, onCheckout) {
|
|
|
11984
11969
|
setExitPending(null);
|
|
11985
11970
|
}
|
|
11986
11971
|
}, [analytics]);
|
|
11987
|
-
const handleCheckout =
|
|
11972
|
+
const handleCheckout = React42.useCallback(() => {
|
|
11988
11973
|
if (lines.length === 0 || exitPending !== null) return;
|
|
11989
11974
|
setExitPending("checkout");
|
|
11990
11975
|
if (onCheckout) {
|
|
@@ -12004,7 +11989,7 @@ function useCartView(cart, onCheckout) {
|
|
|
12004
11989
|
}
|
|
12005
11990
|
navigateToExit(cart?.checkoutUrl, "checkout");
|
|
12006
11991
|
}, [lines.length, exitPending, onCheckout, cart, navigateToExit]);
|
|
12007
|
-
const handleGoToStore =
|
|
11992
|
+
const handleGoToStore = React42.useCallback(() => {
|
|
12008
11993
|
if (lines.length === 0 || exitPending !== null) return;
|
|
12009
11994
|
setExitPending("store");
|
|
12010
11995
|
navigateToExit(cart?.storeCartUrl, "store");
|
|
@@ -12092,7 +12077,7 @@ registerSessionScopedClear(() => {
|
|
|
12092
12077
|
});
|
|
12093
12078
|
|
|
12094
12079
|
// src/verticals/commerce/cart/use-cart-line-row.ts
|
|
12095
|
-
import * as
|
|
12080
|
+
import * as React43 from "react";
|
|
12096
12081
|
|
|
12097
12082
|
// src/verticals/commerce/use-commerce-actions.ts
|
|
12098
12083
|
import { useCallback as useCallback23 } from "react";
|
|
@@ -12138,19 +12123,19 @@ var SPOTLIGHT_MAX_AGE_MS = 3e4;
|
|
|
12138
12123
|
function useCartLineRow(line, opts) {
|
|
12139
12124
|
const actions = useCommerceActions();
|
|
12140
12125
|
const drawerFocus = useCartDrawerFocus();
|
|
12141
|
-
const rowRef =
|
|
12126
|
+
const rowRef = React43.useRef(null);
|
|
12142
12127
|
const pending2 = isPendingCartLine(line);
|
|
12143
12128
|
const navigable = actions !== null && !pending2 && line.productId.length > 0;
|
|
12144
12129
|
const onNavigated = opts === void 0 ? void 0 : opts.onNavigated;
|
|
12145
|
-
const navigatedRef =
|
|
12130
|
+
const navigatedRef = React43.useRef(onNavigated);
|
|
12146
12131
|
navigatedRef.current = onNavigated;
|
|
12147
|
-
const navigate =
|
|
12132
|
+
const navigate = React43.useCallback(() => {
|
|
12148
12133
|
if (actions === null) return;
|
|
12149
12134
|
actions.navigateToProduct(line.productId, line.title);
|
|
12150
12135
|
const done = navigatedRef.current;
|
|
12151
12136
|
if (done !== void 0) done();
|
|
12152
12137
|
}, [actions, line.productId, line.title]);
|
|
12153
|
-
const interaction =
|
|
12138
|
+
const interaction = React43.useMemo(() => {
|
|
12154
12139
|
if (!navigable) return void 0;
|
|
12155
12140
|
return {
|
|
12156
12141
|
onClick: navigate,
|
|
@@ -12165,7 +12150,7 @@ function useCartLineRow(line, opts) {
|
|
|
12165
12150
|
};
|
|
12166
12151
|
}, [navigable, navigate]);
|
|
12167
12152
|
const spotlightKey = drawerFocus !== null && !pending2 && line.productId.length > 0 && drawerFocus.productId === line.productId && Date.now() - drawerFocus.at < SPOTLIGHT_MAX_AGE_MS ? drawerFocus.at : null;
|
|
12168
|
-
|
|
12153
|
+
React43.useEffect(() => {
|
|
12169
12154
|
if (spotlightKey === null) return;
|
|
12170
12155
|
const node = rowRef.current;
|
|
12171
12156
|
if (node === null) return;
|
|
@@ -12310,7 +12295,7 @@ function pickColorCount(product) {
|
|
|
12310
12295
|
}
|
|
12311
12296
|
|
|
12312
12297
|
// src/verticals/commerce/product/use-look-card.ts
|
|
12313
|
-
import * as
|
|
12298
|
+
import * as React44 from "react";
|
|
12314
12299
|
|
|
12315
12300
|
// src/verticals/commerce/variant/variant-option-axes.ts
|
|
12316
12301
|
function carriesValue(variant, name, value) {
|
|
@@ -12520,8 +12505,8 @@ function useLookCard({
|
|
|
12520
12505
|
const session = useFourtySession();
|
|
12521
12506
|
const addFlash = useSuccessFlash({ duration: 1200 });
|
|
12522
12507
|
const locale = useSpaceLocale();
|
|
12523
|
-
const [pending2, setPending] =
|
|
12524
|
-
const clean =
|
|
12508
|
+
const [pending2, setPending] = React44.useState(null);
|
|
12509
|
+
const clean = React44.useMemo(
|
|
12525
12510
|
() => (Array.isArray(products) ? products : []).filter(
|
|
12526
12511
|
(p) => p !== null && p !== void 0 && typeof p === "object"
|
|
12527
12512
|
),
|
|
@@ -12876,7 +12861,7 @@ function useContentActions() {
|
|
|
12876
12861
|
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
12877
12862
|
|
|
12878
12863
|
// package.json
|
|
12879
|
-
var version = "0.5.
|
|
12864
|
+
var version = "0.5.17";
|
|
12880
12865
|
|
|
12881
12866
|
// src/host/host-modules.ts
|
|
12882
12867
|
import * as react from "react";
|
|
@@ -12937,7 +12922,7 @@ function loadEngine(apiUrl) {
|
|
|
12937
12922
|
}
|
|
12938
12923
|
|
|
12939
12924
|
// src/host/Spacefront.tsx
|
|
12940
|
-
import { jsx as
|
|
12925
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
12941
12926
|
function Spacefront(props) {
|
|
12942
12927
|
const [engine, setEngine] = useState19(null);
|
|
12943
12928
|
const [failure, setFailure] = useState19(null);
|
|
@@ -12959,7 +12944,7 @@ function Spacefront(props) {
|
|
|
12959
12944
|
if (failure !== null) throw failure;
|
|
12960
12945
|
if (engine === null) return null;
|
|
12961
12946
|
const EngineRoot = engine.EngineRoot;
|
|
12962
|
-
return /* @__PURE__ */
|
|
12947
|
+
return /* @__PURE__ */ jsx24(EngineRoot, { ...props });
|
|
12963
12948
|
}
|
|
12964
12949
|
|
|
12965
12950
|
// src/npm.ts
|
|
@@ -13108,7 +13093,6 @@ export {
|
|
|
13108
13093
|
HostExportsSchema,
|
|
13109
13094
|
HostImportsSchema,
|
|
13110
13095
|
HostPayloadSchema,
|
|
13111
|
-
HydrationNoticeProvider,
|
|
13112
13096
|
HydrationStateContext,
|
|
13113
13097
|
HydratorProvider,
|
|
13114
13098
|
INITIAL_NAV_PRESENTATION,
|
|
@@ -13615,7 +13599,6 @@ export {
|
|
|
13615
13599
|
useHasLeftSeedHome,
|
|
13616
13600
|
useHistoryNav,
|
|
13617
13601
|
useHydrated,
|
|
13618
|
-
useHydrationNotice,
|
|
13619
13602
|
useHydrationState,
|
|
13620
13603
|
useHydrators,
|
|
13621
13604
|
useInlineCompletion,
|
|
@@ -2,7 +2,6 @@ export { FourtyRuntimeProvider, useFourtyRuntime, useOptionalFourtyRuntime, } fr
|
|
|
2
2
|
export { useTurn, useStream, useTurnAsk, useDisplayedLayout, useFourtyShell, useAgentDriven, useReasoning, useSessionState, useSessionId, useSessionMessages, useFacts, useConversationMessages, usePendingMessage, useCurrentMessageIndex, useSelectMessage, useExplicitTurnId, useExplicitTurnSelection, useHistoryNav, useCanvasBack, useCanvasViewBack, useCanvasForward, useConversationState, useSuggestionsWithDefaults, useComposerPlaceholder, useComposerPlaceholderRotation, useLayout, useFocalEntityId, useInteraction, useConversations, useHasLeftSeedHome, useVisitorName, } from './runtime-hooks';
|
|
3
3
|
export type { TurnInfo, HistoryNav, CanvasBack, CanvasForward, ConversationState, RuntimeSessionState, FourtyRuntime, InteractionActions, VisitorName, ExplicitTurnSelection, } from './runtime-types';
|
|
4
4
|
export { CanvasTailProvider, useCanvasTail, CanvasTailMount, type CanvasTailComponent, } from './canvas-tail';
|
|
5
|
-
export { HydrationNoticeProvider, useHydrationNotice, type HydrationNoticeProps, type HydrationNoticeComponent, } from './hydration-notice';
|
|
6
5
|
export { GenerationStyleContext, GenerationStyleProvider, useGenerationStyle, } from './GenerationStyleContext';
|
|
7
6
|
export { ShimmerSweep, type ShimmerSweepProps } from './ShimmerSweep';
|
|
8
7
|
export { FadeTransition, TransitionProvider, useLayoutTransition, type LayoutTransitionItemProps, type LayoutTransitionGroupProps, type LayoutTransition, } from './TransitionContext';
|
|
@@ -167,8 +167,6 @@ export declare const HOST_MODULES: {
|
|
|
167
167
|
CanvasTailProvider: typeof sdk.CanvasTailProvider;
|
|
168
168
|
useCanvasTail: typeof sdk.useCanvasTail;
|
|
169
169
|
CanvasTailMount: typeof sdk.CanvasTailMount;
|
|
170
|
-
HydrationNoticeProvider: typeof sdk.HydrationNoticeProvider;
|
|
171
|
-
useHydrationNotice: typeof sdk.useHydrationNotice;
|
|
172
170
|
GenerationStyleContext: react.Context<sdk.GenerationStyle>;
|
|
173
171
|
GenerationStyleProvider: react.Provider<sdk.GenerationStyle>;
|
|
174
172
|
useGenerationStyle: typeof sdk.useGenerationStyle;
|
|
@@ -2783,7 +2781,7 @@ export declare const HOST_MODULES: {
|
|
|
2783
2781
|
AGENT_DIRECTIVE_SEVERITIES: readonly ["a missed opportunity", "a problem", "unacceptable"];
|
|
2784
2782
|
AGENT_DIRECTIVE_SOURCES: readonly ["owner", "operator", "session-lesson"];
|
|
2785
2783
|
AGENT_DIRECTIVE_STATUSES: readonly ["proposed", "active", "rejected", "retired"];
|
|
2786
|
-
MAX_ACTIVE_AGENT_DIRECTIVES:
|
|
2784
|
+
MAX_ACTIVE_AGENT_DIRECTIVES: 20;
|
|
2787
2785
|
DEFAULT_SPACE_LOCALE: "en-US";
|
|
2788
2786
|
SpaceLocaleSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
|
2789
2787
|
textDirectionOf: typeof spacestation.textDirectionOf;
|
|
@@ -36,8 +36,9 @@ export interface CatalogEntryStructural {
|
|
|
36
36
|
alwaysInclude?: boolean;
|
|
37
37
|
/** The component ASKS the visitor something (a quiz, an interview card):
|
|
38
38
|
* once one has been on the canvas, no later turn may introduce another
|
|
39
|
-
* (`@fourty/agent` `layout/spent-ask-guard.ts`)
|
|
40
|
-
* `asks
|
|
39
|
+
* (`@fourty/agent` `layout/spent-ask-guard.ts`), and a turn that places
|
|
40
|
+
* one leads its page with it (`layout/asks-lead.ts`). Set from the
|
|
41
|
+
* manifest's `asks: true` frontmatter by `applyManifests`. */
|
|
41
42
|
asks?: boolean;
|
|
42
43
|
/** When the LLM should select this component. */
|
|
43
44
|
whenToUse?: string;
|
|
@@ -46,4 +46,10 @@ export interface PlatformConnector<TDomains = unknown> {
|
|
|
46
46
|
* The runner falls back to "no enrichment" silently.
|
|
47
47
|
*/
|
|
48
48
|
resolveEntities?(ids: ReadonlyArray<string>): Promise<ReadonlyMap<string, EntityRegistryEntry>>;
|
|
49
|
+
/**
|
|
50
|
+
* The `resolved()` kinds `resolveEntities` answers. An id of any other kind
|
|
51
|
+
* is absent from its result because it was never looked up — not because
|
|
52
|
+
* the store lacks it — so a caller asking "does this exist?" asks only these.
|
|
53
|
+
*/
|
|
54
|
+
readonly resolvableKinds?: readonly string[];
|
|
49
55
|
}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* list; only `AgentDirective` reaches the prompt.
|
|
14
14
|
*/
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
-
/** At most this many ACTIVE directives per space
|
|
17
|
-
*
|
|
18
|
-
* is pasted in, the prompt just gets longer. */
|
|
19
|
-
export declare const MAX_ACTIVE_AGENT_DIRECTIVES =
|
|
16
|
+
/** At most this many ACTIVE directives per space (raised from 12 in 2026-11,
|
|
17
|
+
* when live spaces hit the limit). Prose is where a cap rots silently: nothing
|
|
18
|
+
* throws when one more rule is pasted in, the prompt just gets longer. */
|
|
19
|
+
export declare const MAX_ACTIVE_AGENT_DIRECTIVES = 20;
|
|
20
20
|
/** What KIND of directive — how an evidence report tells a preference from a
|
|
21
21
|
* promise. */
|
|
22
22
|
export declare const AGENT_DIRECTIVE_KINDS: readonly ["preference", "pairing", "order of things", "promise", "threshold"];
|
|
@@ -225,6 +225,16 @@ export type TraceDiagnostic = {
|
|
|
225
225
|
stage: 'layout_generation';
|
|
226
226
|
element: string;
|
|
227
227
|
elementType: string;
|
|
228
|
+
}
|
|
229
|
+
/** The turn placed an `asks` card (a quiz, an interview card, a planner)
|
|
230
|
+
* below another block on its page. Moved to lead by the asks-leads repair
|
|
231
|
+
* (`layout/asks-lead.ts`) after the stream — a soft model fault: the card is
|
|
232
|
+
* the turn's question, and below a long block the visitor never reaches it. */
|
|
233
|
+
| {
|
|
234
|
+
kind: 'asks_card_led';
|
|
235
|
+
stage: 'layout_generation';
|
|
236
|
+
rootKey: string;
|
|
237
|
+
children: string[];
|
|
228
238
|
} | {
|
|
229
239
|
kind: 'render_sanitized';
|
|
230
240
|
stage: 'layout_generation';
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* THE HYDRATION-FAILURE NOTICE SLOT — what the canvas shows the visitor when
|
|
4
|
-
* an element's entities could not be loaded.
|
|
5
|
-
*
|
|
6
|
-
* The engine (`@fourty/react`) decides WHEN a notice is due; it does not own
|
|
7
|
-
* the WORDS, because words are in the space's language and the label set lives
|
|
8
|
-
* in the UI layer the engine cannot import. So the engine asks this slot, and
|
|
9
|
-
* the spacefront mounts the UI's notice into it (`SpaceFront`). No provider ⇒
|
|
10
|
-
* no notice, never an English one.
|
|
11
|
-
*/
|
|
12
|
-
export interface HydrationNoticeProps {
|
|
13
|
-
/** Entities that resolved to nothing (deleted, unpublished) — the count shown. */
|
|
14
|
-
unavailableCount: number;
|
|
15
|
-
/** A hydrator threw: the content is unknown, not merely missing. */
|
|
16
|
-
hasErrors: boolean;
|
|
17
|
-
}
|
|
18
|
-
export type HydrationNoticeComponent = React.ComponentType<HydrationNoticeProps>;
|
|
19
|
-
export declare function HydrationNoticeProvider({ notice, children }: {
|
|
20
|
-
notice: HydrationNoticeComponent;
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
}): React.ReactElement;
|
|
23
|
-
export declare function useHydrationNotice(): HydrationNoticeComponent | null;
|