@theoremjs/studio 0.3.5-next.902.g334d23a → 0.3.5-next.906.g6f050f4
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/README.md +2 -0
- package/agreement.js +14 -22
- package/compile.js +4 -12
- package/cookbooks/catalog.d.ts +3 -2
- package/cookbooks/catalog.js +15 -14
- package/draft.d.ts +5 -4
- package/package.json +5 -5
- package/page/assets/{Badge-C0KjAK5l.js → Badge-BUFlIXVD.js} +1 -1
- package/page/assets/BottomSheet-v4keekfB.js +1 -0
- package/page/assets/Button-Bwkht0RI.js +1 -0
- package/page/assets/{Card-BUIbjVIe.js → Card-C6l0Ne1A.js} +1 -1
- package/page/assets/{Center-BVnAO8rr.js → Center-CPu_uP6i.js} +1 -1
- package/page/assets/CheckboxIndicator-BvfHW9OX.js +2 -0
- package/page/assets/CheckboxInput-Dd_tzCIt.js +2 -0
- package/page/assets/CodeBlock-QRlV-wmv.js +3 -0
- package/page/assets/CollapsibleGroup-483UEs5v.js +1 -0
- package/page/assets/ComponentIcon-75dIY9g7.js +1 -0
- package/page/assets/ConsoleFrame-CHnnxxNA.js +3 -0
- package/page/assets/DateInput-CYFXY_3W.js +1 -0
- package/page/assets/Dialog-tyH-Jv5A.js +1 -0
- package/page/assets/Divider-DzOWjyex.js +1 -0
- package/page/assets/{EmptyState-B_rMeBCn.js → EmptyState-DW-8doL9.js} +1 -1
- package/page/assets/Field-DvUFAlQ-.js +1 -0
- package/page/assets/FieldStatus-DOXgh0K8.js +1 -0
- package/page/assets/{HStack-D3i0gAme.js → HStack-B00ufja5.js} +1 -1
- package/page/assets/HoverCard-BgPoXy85.js +1 -0
- package/page/assets/Icon-Cd9sDRzY.js +48 -0
- package/page/assets/{IconButton-Crxt9XEq.js → IconButton-BenRR-zK.js} +1 -1
- package/page/assets/IconX-Cx51PGNB.js +1 -0
- package/page/assets/{ItemSwipeLayer-CVeHWmee.js → ItemSwipeLayer-DwHCHfiK.js} +1 -1
- package/page/assets/LayoutContent-BWpUj2Iy.js +1 -0
- package/page/assets/ListItem-C8WPxjPx.js +1 -0
- package/page/assets/{MenuBottomSheet-Kk5gIkzY.js → MenuBottomSheet-BR8JYBqn.js} +1 -1
- package/page/assets/MenuBottomSheetActionList-CZkxfDz5.js +1 -0
- package/page/assets/OverflowList-DDC9bnia.js +1 -0
- package/page/assets/{PanelSearchInput-CGk0XlVX.js → PanelSearchInput-CS1aeOUr.js} +1 -1
- package/page/assets/PowerSearchBottomSheet-DSkpQQys.js +1 -0
- package/page/assets/PressTracker-CEJ69JTB.js +1 -0
- package/page/assets/{ProgressBarMarkTooltip-BCgy6kk7.js → ProgressBarMarkTooltip-BTRXm_SP.js} +1 -1
- package/page/assets/{RankedBars-HSq4wPeA.js → RankedBars-C_arZO1h.js} +1 -1
- package/page/assets/{SchemaFields-DhHzB3cY.js → SchemaFields-DvOp5_M3.js} +1 -1
- package/page/assets/ScrollableArea-DgswAvfJ.js +1 -0
- package/page/assets/SegmentedControlItem-DLUgv9BP.js +1 -0
- package/page/assets/SidePanel-DcAhRInK.js +2 -0
- package/page/assets/Spinner-ObDlWHHD.js +1 -0
- package/page/assets/{Stack-BZiu21ta.js → Stack-3jR93LgR.js} +1 -1
- package/page/assets/StackItem-nWHq5y--.js +1 -0
- package/page/assets/Text-Cq4yqBpQ.js +2 -0
- package/page/assets/TextInput-DwHcdc-E.js +1 -0
- package/page/assets/TimestampHoverCard-CVXPEToD.js +1 -0
- package/page/assets/Token-CGIAH1hn.js +1 -0
- package/page/assets/TokenizerBottomSheet-DjiTJgA9.js +1 -0
- package/page/assets/{ToolResultCharts-BmoE9xfE.js → ToolResultCharts-t1kqy-J6.js} +1 -1
- package/page/assets/Toolbar-CkD1V_z_.js +1 -0
- package/page/assets/Tooltip-Rh2iV9Vn.js +1 -0
- package/page/assets/TraceInspector-CGGxz_g-.js +2 -0
- package/page/assets/{TraceOverview-DFi4TFKx.js → TraceOverview-C3RFiWfu.js} +3 -3
- package/page/assets/{VStack-BGVV0uKl.js → VStack-D1ZLA9g3.js} +1 -1
- package/page/assets/{_virtual_studio-type-sources-DndWNIpu.js → _virtual_studio-type-sources-CuPTbB69.js} +56 -15
- package/page/assets/animatedLayout-alPkNRf2.js +1 -0
- package/page/assets/boxHold-C4vf0eaW.js +1 -0
- package/page/assets/browser-connection-UWxIyv6u.js +1 -0
- package/page/assets/browser-engine-Ds0-ThtZ.js +16 -0
- package/page/assets/browser-transport-Dq9itWDy.js +2 -0
- package/page/assets/chainEventHandlers-BSZ5MWAl.js +1 -0
- package/page/assets/characters-Dp4H_dX7.js +1 -0
- package/page/assets/{tokens.stylex-a4pw9QVe.js → coarsePointer-B10KWVuz.js} +1 -1
- package/page/assets/compile-NWqVUG3a.js +4 -0
- package/page/assets/composeEventHandlers-CHIontwB.js +1 -0
- package/page/assets/{container.stylex-CkS70he6.js → container.stylex-CS4Pmkv3.js} +1 -1
- package/page/assets/devWarning-DxuplmRl.js +1 -0
- package/page/assets/disabledInteraction-u9yjM5Jo.js +1 -0
- package/page/assets/{embedding-space-view-D-Bnd0fH.js → embedding-space-view-3-qgFVUo.js} +1 -1
- package/page/assets/encode-files-Dc2wHsb6.js +1 -0
- package/page/assets/{export-agent-OANxVkvE.js → export-agent-Y0Y8mdbB.js} +3 -3
- package/page/assets/fieldParts-rVBtMOBE.js +1 -0
- package/page/assets/{focusOutline.stylex-LUQxyg0W.js → focusOutline.stylex-DXNeAcgS.js} +1 -1
- package/page/assets/{focusReturn-C7gRi2IE.js → focusReturn-DNKESCUc.js} +1 -1
- package/page/assets/focusableSelector-kxmVieoO.js +1 -0
- package/page/assets/fullEnglishFallback-Css2A5hC.js +1 -0
- package/page/assets/{getRadiusAndStrokeWidthFromDot-CFpiLWPo.js → getRadiusAndStrokeWidthFromDot-bzD-VA8b.js} +1 -1
- package/page/assets/groupItems-BLHEgC4O.js +1 -0
- package/page/assets/guardrail-health-BGyQi_jA.js +3 -0
- package/page/assets/guardrail-tester-DbR85sml.js +9 -0
- package/page/assets/haptics-5boj200r.js +1 -0
- package/page/assets/{highlightStyles-C7fXGwpK.js → highlightStyles-CJuQk9n5.js} +1 -1
- package/page/assets/holdEntranceInput-BRGRVT6b.js +1 -0
- package/page/assets/index-BvVj0JHm.css +1 -0
- package/page/assets/index-Cfhzi3KD.js +140 -0
- package/page/assets/{json-code-D2OkfSza.js → json-code-D2imJbsd.js} +1 -1
- package/page/assets/{labels-provider-26qkmR1c.js → labels-provider-CTjEbRdu.js} +2 -2
- package/page/assets/{live-messages-Df38_7Lx.js → live-messages-Bp_b714P.js} +1 -1
- package/page/assets/{map-token-CgKWabfH.js → map-token-BcCSmfJy.js} +1 -1
- package/page/assets/menuBottomSheet.stylex-BF-z_H3I.js +1 -0
- package/page/assets/modalOutlet-CNlIUlZC.js +1 -0
- package/page/assets/padding.stylex-Nfq09GFM.js +1 -0
- package/page/assets/press.stylex-aDT5uXq9.js +1 -0
- package/page/assets/projection-C57DLs2K.js +1 -0
- package/page/assets/prompt-row-eETPWTfK.js +76 -0
- package/page/assets/{read-map-BJqwz_gJ.js → read-map-C0E3pErZ.js} +1 -1
- package/page/assets/reader-C8mnJAB6.js +5 -0
- package/page/assets/registry-DJBxNVIO.js +1 -0
- package/page/assets/rubberBand-urxgJfJ0.js +1 -0
- package/page/assets/schema-D4bn5YDU.js +3 -0
- package/page/assets/scroll-74w_rjcI.js +1 -0
- package/page/assets/scrollView-DKN9Tc2s.js +1 -0
- package/page/assets/shaped-data-yrTrXPh4.js +25 -0
- package/page/assets/sharedResizeObserver-Ce0raAy-.js +1 -0
- package/page/assets/{stub-D6-YFRxO.js → stub-CZ_Xswg8.js} +1 -1
- package/page/assets/studio-code-pane-lxwvQgJE.js +8 -0
- package/page/assets/studio-console-BNOXf-xr.js +1 -0
- package/page/assets/studio-decision-C9oxa1xo.js +1 -0
- package/page/assets/studio-embedding-D8rA6MOH.js +2 -0
- package/page/assets/studio-host-console-XPl__wj7.js +2 -0
- package/page/assets/studio-labels-CUJQgb-k.js +3 -0
- package/page/assets/studio-live-B3gN-hIU.js +5 -0
- package/page/assets/studio-map-Cf2DHvn2.js +1 -0
- package/page/assets/{studio-trace-replay-CAW03Aol.js → studio-trace-replay-BCOqVguH.js} +3 -3
- package/page/assets/{studio-type-checker-CDfrrQ9W.js → studio-type-checker-BWW15y7M.js} +1 -1
- package/page/assets/textEntryTraits-C_EOnS4-.js +1 -0
- package/page/assets/tokenReferences-tYcl-8O-.js +1 -0
- package/page/assets/{tool-schema-lNJyGpcM.js → tool-schema-BMNs-MyH.js} +1 -1
- package/page/assets/touchHitArea.stylex-D2yrbNzX.js +1 -0
- package/page/assets/{trace-patterns-YZSpKAfw.js → trace-patterns-Bka_qf33.js} +1 -1
- package/page/assets/{trace-record-CmhXXllR.js → trace-record-CS_K7b8l.js} +1 -1
- package/page/assets/tree-D6WoHLJe.js +3 -0
- package/page/assets/{turn-client-BfkK4BN-.js → turn-client-8TS8z-jZ.js} +2 -2
- package/page/assets/types-D9SHTHld.js +1 -0
- package/page/assets/{use-one-call-KOcgOvF7.js → use-one-call-Ch9fKeMJ.js} +1 -1
- package/page/assets/use-second-ticker-C3VX4c6o.css +1 -0
- package/page/assets/useAdaptivePresentation-D53OuCPm.js +1 -0
- package/page/assets/useAnnounceRenderedText-C7Yqc9vL.js +1 -0
- package/page/assets/useCalendarSystem-Crg71MEB.js +1 -0
- package/page/assets/useClickableContainer-B08uXDf4.js +1 -0
- package/page/assets/useClipboard-CE6Krn40.js +1 -0
- package/page/assets/useDevWarning-WeXt8Pe8.js +1 -0
- package/page/assets/useDismissSearchOnTouchDrag-DJ9Di3hZ.js +1 -0
- package/page/assets/useFocusLeavingChange-xsJxlBAc.js +1 -0
- package/page/assets/useFocusTrap-DyznXJtp.js +1 -0
- package/page/assets/useGestureRecognizer-C1yNE90T.js +1 -0
- package/page/assets/useIsHydrating-DmtPcCGm.js +1 -0
- package/page/assets/useKeyboardHint-CV0b5BIQ.js +1 -0
- package/page/assets/useLayerDismissal-DwwLDEpO.js +1 -0
- package/page/assets/useListFormatter-BL-mfYUA.js +1 -0
- package/page/assets/useLocale-CPtOawsd.js +1 -0
- package/page/assets/useMediaQuery-Q9CwxYQy.js +1 -0
- package/page/assets/{useMenuOverflow-x8Ox3IyG.js → useMenuOverflow-C6hNF-rg.js} +1 -1
- package/page/assets/useMenuPress-Bjaz5nPC.js +1 -0
- package/page/assets/useMergedRefs-S6y2xAId.js +1 -0
- package/page/assets/usePressFeedback-DoNqlnA9.js +1 -0
- package/page/assets/useScrollLock-DGeH0BW_.js +1 -0
- package/page/assets/useScrollRegionProps-CnJi1TnL.js +1 -0
- package/page/assets/useScrollableArea-DLpP0enQ.js +1 -0
- package/page/assets/useTooltip-DQ4LKI-B.js +1 -0
- package/page/assets/useTranslator-BKF5qhFP.js +1 -0
- package/page/assets/{workspace-LbPd2mMU.js → workspace-CCtOtOGD.js} +1 -1
- package/page/index.html +112 -93
- package/prompt-doc.d.ts +21 -2
- package/prompt-doc.js +53 -2
- package/read-source.js +21 -34
- package/system-markup.d.ts +8 -11
- package/system-markup.js +20 -10
- package/ui/built/theme.css +43 -21
- package/ui/built/theme.css.d.ts +2 -2
- package/ui/built/theorem-studio.d.ts +2 -2
- package/ui/built/theorem-studio.js +42 -25
- package/ui/built/theorem-studio.variants.d.ts +2 -2
- package/ui/guardrail-health.js +1 -1
- package/ui/prompt-editor.d.ts +11 -7
- package/ui/prompt-editor.js +17 -11
- package/ui/prompt-row.d.ts +8 -3
- package/ui/prompt-row.js +34 -5
- package/ui/studio-save.js +1 -1
- package/page/assets/BaseTypeahead-CHXE162p.js +0 -1
- package/page/assets/BottomSheet-DoQyCSv5.js +0 -1
- package/page/assets/Button-Cb-mh6ml.js +0 -1
- package/page/assets/CheckboxIndicator-CWc5B_d1.js +0 -2
- package/page/assets/CheckboxInput-BrhD5W3u.js +0 -2
- package/page/assets/CodeBlock-B8SfIXyW.js +0 -3
- package/page/assets/CollapsibleGroup-YxyQ-UXo.js +0 -1
- package/page/assets/ConsoleFrame-6pxwtmj7.js +0 -3
- package/page/assets/DateInput-B9iV939o.js +0 -1
- package/page/assets/Dialog-BatAn-DX.js +0 -1
- package/page/assets/Field-BSCYng6A.js +0 -1
- package/page/assets/FieldStatus-D_97agai.js +0 -1
- package/page/assets/HoverCard-YEWLJPhx.js +0 -1
- package/page/assets/Icon-C9dlIB4I.js +0 -48
- package/page/assets/LayoutContent-NlcSjVn7.js +0 -1
- package/page/assets/ListItem-C80mhugw.js +0 -1
- package/page/assets/MenuBottomSheetActionList-BkRKLMkR.js +0 -1
- package/page/assets/OverflowList-T3oyz0uY.js +0 -1
- package/page/assets/ScrollableArea-Db8BBKVt.js +0 -1
- package/page/assets/SegmentedControlItem-DRVmwW9x.js +0 -1
- package/page/assets/SidePanel-7cMNIHsg.js +0 -2
- package/page/assets/Spinner-sCbvL2qs.js +0 -1
- package/page/assets/StackItem-ClAjT294.js +0 -1
- package/page/assets/Text-DfN1tSUL.js +0 -2
- package/page/assets/TextInput-CYSGEp-G.js +0 -1
- package/page/assets/TimestampHoverCard-0-rfsRpo.js +0 -1
- package/page/assets/Token-C0MCeuZZ.js +0 -1
- package/page/assets/TokenizerBottomSheet-CMErW59w.js +0 -1
- package/page/assets/Toolbar-R7By0ClV.js +0 -1
- package/page/assets/Tooltip-BO0yrDVt.js +0 -1
- package/page/assets/TraceInspector-B2-q3kdh.js +0 -1
- package/page/assets/browser-connection-BSNet_H3.js +0 -1
- package/page/assets/browser-engine-HY1MiOBw.js +0 -16
- package/page/assets/browser-transport-CqE21ewt.js +0 -2
- package/page/assets/browserClickWait-BSA4ZCzN.js +0 -1
- package/page/assets/chainEventHandlers-C6ttXGfW.js +0 -1
- package/page/assets/compile-DTDHCKfi.js +0 -2
- package/page/assets/devWarning-B-QAZEJI.js +0 -1
- package/page/assets/disabledInteraction-2qeNzu0m.js +0 -1
- package/page/assets/encode-files-DPDNany5.js +0 -1
- package/page/assets/fieldParts-DJZ7Rxcc.js +0 -1
- package/page/assets/focusableSelector-DXZeMU85.js +0 -1
- package/page/assets/guardrail-health-CwTKl0zG.js +0 -3
- package/page/assets/guardrail-tester-CKlDr0k_.js +0 -9
- package/page/assets/index-DoHtpQ_c.css +0 -1
- package/page/assets/index-OCKUpKmV.js +0 -150
- package/page/assets/isApplePlatform-BSwFAKoe.js +0 -1
- package/page/assets/menuBottomSheet.stylex-DRbZhkuJ.js +0 -1
- package/page/assets/plainDate-CE-glc6O.js +0 -1
- package/page/assets/prompt-row-DjQm0bw2.js +0 -75
- package/page/assets/reader-CR8x2duE.js +0 -5
- package/page/assets/registry-yn0Ipf-_.js +0 -1
- package/page/assets/schema-CvmO11hb.js +0 -3
- package/page/assets/shaped-data-D9qzQU2m.js +0 -25
- package/page/assets/sharedMutationObserver-BHa8gqlp.js +0 -1
- package/page/assets/stackItem.stylex-BkECao56.js +0 -1
- package/page/assets/studio-code-pane-C_AN-d0W.js +0 -10
- package/page/assets/studio-console-BjDwiYxB.js +0 -1
- package/page/assets/studio-decision-NFrI5pe7.js +0 -1
- package/page/assets/studio-embedding-lf-ItxLq.js +0 -2
- package/page/assets/studio-host-console-BPaTXrnv.js +0 -2
- package/page/assets/studio-labels-B_l5mKbZ.js +0 -3
- package/page/assets/studio-live-Babh_n6b.js +0 -5
- package/page/assets/studio-map-Ddk7GO_i.js +0 -1
- package/page/assets/textEntryTraits-C8qoTZ3W.js +0 -1
- package/page/assets/tree-DxJnvWmh.js +0 -3
- package/page/assets/types-YRukYg-4.js +0 -1
- package/page/assets/use-second-ticker-C09v74b0.css +0 -1
- package/page/assets/useAnnounceRenderedText-BWNmfFlE.js +0 -1
- package/page/assets/useBusyAnnouncement-DwJYqyJC.js +0 -1
- package/page/assets/useClickableContainer-dg6qYWze.js +0 -1
- package/page/assets/useClipboard-C7IeReFJ.js +0 -1
- package/page/assets/useFocusLeavingChange-CRkFJGdd.js +0 -1
- package/page/assets/useHighlightedOptionScroll-C7rzQTVc.js +0 -1
- package/page/assets/useIsHydrating-wiKgLSH8.js +0 -1
- package/page/assets/useKeyboardHint-B6oH_Cll.js +0 -1
- package/page/assets/useLayerDismissal-CqRa7y6J.js +0 -1
- package/page/assets/useLocale-DtI8SMic.js +0 -1
- package/page/assets/useMediaQuery-Dvkq1PZg.js +0 -1
- package/page/assets/useMenuPress-DM12OZUv.js +0 -1
- package/page/assets/useMergedRefs-DJD-JnFZ.js +0 -1
- package/page/assets/usePressFeedback-nkH67NDc.js +0 -1
- package/page/assets/useResolvedRequired-B-0WnbIo.js +0 -1
- package/page/assets/useScrollLock--U5R1vFj.js +0 -1
- package/page/assets/useScrollableArea-uSlz-RoI.js +0 -1
- package/page/assets/useSettledOpen-BJQ5dTsM.js +0 -1
- package/page/assets/useTooltip-NPYEayzZ.js +0 -1
- package/page/assets/useTranslator-CGZ-h6ng.js +0 -1
- /package/page/assets/{use-second-ticker-CDQ3LLWp.js → use-second-ticker-Dd57a-0O.js} +0 -0
package/read-source.js
CHANGED
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { assertToolSettings, DEFAULT_ALLOW_CONTINUE, DEFAULT_AUTO_CONTINUE, liveIngressChannelDefault, TheoremError, } from '@theoremjs/agents';
|
|
9
9
|
import { BOUNDARIES, DETECTORS, recordOf, resolveDetect, } from '@theoremjs/agents/guardrails';
|
|
10
|
-
import { PROFILE_GRAPH } from '@theoremjs/agents/kernel';
|
|
10
|
+
import { PROFILE_GRAPH, } from '@theoremjs/agents/kernel';
|
|
11
11
|
import { CONTEXT_SENDERS, profileFieldProblems, } from '@theoremjs/agents/schema';
|
|
12
12
|
import { canonical } from "./canonical.js";
|
|
13
13
|
import { createBlankDraft, defaultModelBinding, defaultToolSpec, draftKey, INLINE_LABELS, MODEL_LIMITS, STUDIO_PROFILE_TYPES, } from "./draft.js";
|
|
14
14
|
import { definitionFactory, definitionOfFactory, kernelDefinitions, } from "./providers.js";
|
|
15
15
|
import { stubOutputFromSchema } from "./stub.js";
|
|
16
|
-
import { parseSystemMarkup, WHEN_LINE } from "./system-markup.js";
|
|
17
16
|
import { STUDIO_TOOL_TYPE_MESSAGE, STUDIO_TOOL_TYPES } from "./types.js";
|
|
18
17
|
class ReadFail extends Error {
|
|
19
18
|
line;
|
|
@@ -550,45 +549,33 @@ function text(value, fallback = '') {
|
|
|
550
549
|
function whole(value) {
|
|
551
550
|
return typeof value === 'number' ? value : null;
|
|
552
551
|
}
|
|
553
|
-
|
|
552
|
+
/** A part of a prompt line, as written, or undefined when it is no part. */
|
|
553
|
+
function promptPart(part) {
|
|
554
|
+
if (typeof part === 'string')
|
|
555
|
+
return part;
|
|
556
|
+
if (isRecord(part) && typeof part.private === 'string')
|
|
557
|
+
return { private: part.private };
|
|
558
|
+
return undefined;
|
|
559
|
+
}
|
|
560
|
+
/** A prompt exactly as the file writes it: one text, or lines of text or parts. */
|
|
561
|
+
function promptLines(value) {
|
|
562
|
+
const srcMessage = 'The system prompt has to be text, or lines of text and { private } parts.';
|
|
554
563
|
if (value === undefined)
|
|
555
564
|
return '';
|
|
556
565
|
if (typeof value === 'string')
|
|
557
566
|
return value;
|
|
558
567
|
if (!Array.isArray(value))
|
|
559
568
|
throw new ReadFail(srcMessage, 1, 1);
|
|
560
|
-
return value
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
if (Array.isArray(part))
|
|
565
|
-
return markup(part, srcMessage);
|
|
566
|
-
if (isRecord(part) && typeof part.private === 'string')
|
|
567
|
-
return `{private: ${part.private}}`;
|
|
568
|
-
throw new ReadFail(srcMessage, 1, 1);
|
|
569
|
-
})
|
|
570
|
-
.join('');
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* A prompt as the draft holds it: its lines as one text, a blank line between them. A bare
|
|
574
|
-
* `{ private }` is no line, and a `when` line holding a blank line can't be told from two lines.
|
|
575
|
-
*/
|
|
576
|
-
function promptText(value) {
|
|
577
|
-
const srcMessage = 'The system prompt has to be text.';
|
|
578
|
-
const lines = Array.isArray(value) ? value : [value];
|
|
579
|
-
const texts = lines.map((line) => {
|
|
580
|
-
if (Array.isArray(value) && typeof line !== 'string' && !Array.isArray(line)) {
|
|
569
|
+
return value.map((line) => {
|
|
570
|
+
if (typeof line === 'string')
|
|
571
|
+
return line;
|
|
572
|
+
if (!Array.isArray(line))
|
|
581
573
|
throw new ReadFail(srcMessage, 1, 1);
|
|
582
|
-
|
|
583
|
-
return markup(line, srcMessage);
|
|
574
|
+
return line.map((part) => promptPart(part) ?? readFail(srcMessage));
|
|
584
575
|
});
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
throw new ReadFail('A "when" line in the system prompt can\'t hold a blank line.', 1, 1);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
return texts.join('\n\n');
|
|
576
|
+
}
|
|
577
|
+
function readFail(message) {
|
|
578
|
+
throw new ReadFail(message, 1, 1);
|
|
592
579
|
}
|
|
593
580
|
/** A file's options as rows, each keeping the key the row of its name had. */
|
|
594
581
|
function optionRows(value, isShownInChat, current) {
|
|
@@ -1042,7 +1029,7 @@ function identityOf(current, profile, type) {
|
|
|
1042
1029
|
agentId: text(profile.id),
|
|
1043
1030
|
profileType: type,
|
|
1044
1031
|
handle: text(identity.handle),
|
|
1045
|
-
system:
|
|
1032
|
+
system: promptLines(identity.system),
|
|
1046
1033
|
options: [
|
|
1047
1034
|
...optionRows(identity.options, false, current.options),
|
|
1048
1035
|
...optionRows(record(profile.inputs)?.options, true, current.options),
|
package/system-markup.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProfileSystem, SystemLine, SystemPrompt } from '@theoremjs/agents/kernel';
|
|
2
2
|
/**
|
|
3
3
|
* The studio's way to write a system prompt: the whole prompt as text, a blank
|
|
4
4
|
* line starting a new line, each private section wrapped as `{private: …}`.
|
|
@@ -10,20 +10,17 @@ type SystemMarkup = {
|
|
|
10
10
|
ok: false;
|
|
11
11
|
message: string;
|
|
12
12
|
};
|
|
13
|
-
declare const WHEN_LINE: RegExp;
|
|
14
|
-
/** A line as the profile holds it, without the white space at its ends. */
|
|
15
|
-
declare function promptLine(parts: readonly SystemPart[]): SystemPrompt | undefined;
|
|
16
13
|
/**
|
|
17
14
|
* A section closes at the `}` that balances its `{`, so braces inside it pair
|
|
18
15
|
* up as written, and a blank line inside it stays in it. Its text is trimmed;
|
|
19
16
|
* the text around it is kept as written, apart from the ends of each line.
|
|
20
17
|
*/
|
|
21
18
|
declare function parseSystemMarkup(text: string): SystemMarkup;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
declare function
|
|
19
|
+
/** A prompt's lines, as written; a blank prompt has none. */
|
|
20
|
+
declare function linesOf(system: ProfileSystem): SystemLine[];
|
|
21
|
+
/** A prompt as markup: its lines a blank line apart, each private part wrapped as written. */
|
|
22
|
+
declare function markupOf(system: ProfileSystem): string;
|
|
23
|
+
/** Whether two prompts are written the same, part for part. */
|
|
24
|
+
declare function sameWritten(a: ProfileSystem, b: ProfileSystem): boolean;
|
|
28
25
|
export type { SystemMarkup };
|
|
29
|
-
export {
|
|
26
|
+
export { linesOf, markupOf, parseSystemMarkup, sameWritten };
|
package/system-markup.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const OPEN = /\{\s*private\s*:/g;
|
|
2
2
|
const BLANK_LINE = /\n(?:[ \t]*\n)+/;
|
|
3
|
-
const WHEN_LINE = /^\s*when\s/;
|
|
4
3
|
/** A line as the profile holds it, without the white space at its ends. */
|
|
5
4
|
function promptLine(parts) {
|
|
6
5
|
const [first, ...rest] = parts;
|
|
@@ -68,13 +67,24 @@ function parseSystemMarkup(text) {
|
|
|
68
67
|
}),
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
/** A prompt's lines, as written; a blank prompt has none. */
|
|
71
|
+
function linesOf(system) {
|
|
72
|
+
if (typeof system === 'string')
|
|
73
|
+
return system.trim() ? [system] : [];
|
|
74
|
+
return [...system];
|
|
75
|
+
}
|
|
76
|
+
/** A prompt as markup: its lines a blank line apart, each private part wrapped as written. */
|
|
77
|
+
function markupOf(system) {
|
|
78
|
+
return linesOf(system)
|
|
79
|
+
.map((line) => typeof line === 'string'
|
|
80
|
+
? line
|
|
81
|
+
: line
|
|
82
|
+
.map((part) => (typeof part === 'string' ? part : `{private: ${part.private}}`))
|
|
83
|
+
.join(''))
|
|
84
|
+
.join('\n\n');
|
|
85
|
+
}
|
|
86
|
+
/** Whether two prompts are written the same, part for part. */
|
|
87
|
+
function sameWritten(a, b) {
|
|
88
|
+
return a === b || JSON.stringify(a) === JSON.stringify(b);
|
|
79
89
|
}
|
|
80
|
-
export {
|
|
90
|
+
export { linesOf, markupOf, parseSystemMarkup, sameWritten };
|
package/ui/built/theme.css
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @generated by `astryx theme build` — do not edit manually.
|
|
3
3
|
* Source: ui/studio-theme.ts
|
|
4
4
|
* Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
|
|
5
|
-
* CLI: @astryxdesign/cli@0.7.
|
|
6
|
-
* Core: @astryxdesign/core@0.7.
|
|
5
|
+
* CLI: @astryxdesign/cli@0.7.11
|
|
6
|
+
* Core: @astryxdesign/core@0.7.11
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
@layer reset, astryx-base, astryx-theme;
|
|
@@ -158,22 +158,23 @@
|
|
|
158
158
|
--_astryx-pre-tempo-duration-slow-min: 525ms;
|
|
159
159
|
--_astryx-pre-tempo-duration-slow: 700ms;
|
|
160
160
|
--_astryx-pre-tempo-duration-slow-max: 935ms;
|
|
161
|
+
--_astryx-motion-tempo: 1;
|
|
161
162
|
--font-family-body: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
162
163
|
--font-family-heading: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
163
164
|
--font-family-code: ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
164
165
|
--color-syntax-keyword: light-dark(#6b187c, #efa8ff);
|
|
165
166
|
--color-syntax-string: light-dark(#0b5615, #a4d6a3);
|
|
166
|
-
--color-syntax-comment: light-dark(#
|
|
167
|
+
--color-syntax-comment: light-dark(#525252, #b9b9b9);
|
|
167
168
|
--color-syntax-number: light-dark(#733100, #ffb37e);
|
|
168
169
|
--color-syntax-function: light-dark(#00458c, #a1caff);
|
|
169
170
|
--color-syntax-type: light-dark(#6b187c, #efa8ff);
|
|
170
171
|
--color-syntax-variable: light-dark(#111111, #e2e2e2);
|
|
171
|
-
--color-syntax-operator: light-dark(#
|
|
172
|
+
--color-syntax-operator: light-dark(#525252, #b9b9b9);
|
|
172
173
|
--color-syntax-constant: light-dark(#733100, #ffb37e);
|
|
173
174
|
--color-syntax-tag: light-dark(#8a0011, #ffaea7);
|
|
174
175
|
--color-syntax-attribute: light-dark(#584400, #eec448);
|
|
175
176
|
--color-syntax-property: light-dark(#005348, #90d7c8);
|
|
176
|
-
--color-syntax-punctuation: light-dark(#
|
|
177
|
+
--color-syntax-punctuation: light-dark(#525252, #b9b9b9);
|
|
177
178
|
--color-syntax-background: light-dark(#ffffff, #111111);
|
|
178
179
|
--color-syntax-added: color-mix(in srgb, var(--color-success-muted) 25%, transparent);
|
|
179
180
|
--color-syntax-removed: color-mix(in srgb, var(--color-error-muted) 25%, transparent);
|
|
@@ -186,7 +187,7 @@
|
|
|
186
187
|
--color-background-popover: light-dark(#ffffff, #1b1b1b);
|
|
187
188
|
--color-background-muted: light-dark(#f1f1f1, #1b1b1b);
|
|
188
189
|
--color-accent: light-dark(#1b1b1b, #f1f1f1);
|
|
189
|
-
--color-accent-muted: light-dark(#
|
|
190
|
+
--color-accent-muted: light-dark(#d4d4d4, #474747);
|
|
190
191
|
--color-neutral: light-dark(#0000000F, #ffffff1A);
|
|
191
192
|
--color-overlay: light-dark(#00000080, #000000CC);
|
|
192
193
|
--color-overlay-hover: light-dark(#05365914, #FFFFFF14);
|
|
@@ -289,6 +290,7 @@
|
|
|
289
290
|
--color-border-success: var(--color-text-success);
|
|
290
291
|
--color-border-warning: var(--color-text-warning);
|
|
291
292
|
--color-border-error: var(--color-text-error);
|
|
293
|
+
--duration-exit: var(--duration-fast);
|
|
292
294
|
--astryx-theme-neutral-color-status-fill-accent: light-dark(#0074e2, #6d9cfe);
|
|
293
295
|
}
|
|
294
296
|
|
|
@@ -404,6 +406,37 @@
|
|
|
404
406
|
line-height: var(--text-display-3-leading);
|
|
405
407
|
}
|
|
406
408
|
|
|
409
|
+
.astryx-item[data-selected="selected"] {
|
|
410
|
+
--color-text-secondary: light-dark(#474747, #c6c6c6);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.astryx-tree-list-item[data-selected="selected"] {
|
|
414
|
+
--color-text-secondary: light-dark(#474747, #c6c6c6);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.astryx-tree-list-item[data-selected="selected"] {
|
|
418
|
+
background-color: var(--color-overlay-pressed);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.astryx-file-input[data-mode="dropzone"] {
|
|
422
|
+
--color-text-secondary: light-dark(#474747, #c6c6c6);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.astryx-citation[data-variant="number"] {
|
|
426
|
+
--color-text-secondary: light-dark(#474747, #c6c6c6);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.astryx-citation:where(*) > [aria-hidden="true"] {
|
|
430
|
+
background-color: transparent;
|
|
431
|
+
border-width: 0;
|
|
432
|
+
border-radius: 0;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.astryx-citation:where(*) > [aria-hidden="true"] > img {
|
|
436
|
+
width: 100%;
|
|
437
|
+
height: 100%;
|
|
438
|
+
}
|
|
439
|
+
|
|
407
440
|
.astryx-button[data-variant="destructive"] {
|
|
408
441
|
background-color: var(--color-error-muted);
|
|
409
442
|
color: var(--color-on-error-muted);
|
|
@@ -537,17 +570,6 @@
|
|
|
537
570
|
content-visibility: hidden;
|
|
538
571
|
}
|
|
539
572
|
|
|
540
|
-
.astryx-citation:where(*) > [aria-hidden="true"] {
|
|
541
|
-
background-color: transparent;
|
|
542
|
-
border-width: 0;
|
|
543
|
-
border-radius: 0;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
.astryx-citation:where(*) > [aria-hidden="true"] > img {
|
|
547
|
-
width: 100%;
|
|
548
|
-
height: 100%;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
573
|
.astryx-chat-tool-calls:where(*) [role="button"][aria-expanded] > span:not(:first-child):not(:has(svg)) {
|
|
552
574
|
align-self: baseline;
|
|
553
575
|
}
|
|
@@ -605,10 +627,6 @@
|
|
|
605
627
|
padding-block: var(--spacing-3);
|
|
606
628
|
}
|
|
607
629
|
|
|
608
|
-
.astryx-tree-list-item[data-selected="selected"] {
|
|
609
|
-
background-color: var(--color-overlay-pressed);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
630
|
.astryx-tree-list-item-label {
|
|
613
631
|
min-width: 0;
|
|
614
632
|
overflow: hidden;
|
|
@@ -640,6 +658,10 @@
|
|
|
640
658
|
|
|
641
659
|
.astryx-heading[data-color="accent"] { color: var(--color-text-accent); }
|
|
642
660
|
|
|
661
|
+
.astryx-text[data-color="inherit"] { color: inherit; }
|
|
662
|
+
|
|
663
|
+
.astryx-heading[data-color="inherit"] { color: inherit; }
|
|
664
|
+
|
|
643
665
|
.astryx-text[data-size="4xs"] { font-size: var(--font-size-4xs); }
|
|
644
666
|
|
|
645
667
|
.astryx-text[data-size="3xs"] { font-size: var(--font-size-3xs); }
|
package/ui/built/theme.css.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @generated by `astryx theme build` — do not edit manually.
|
|
3
3
|
* Source: ui/studio-theme.ts
|
|
4
4
|
* Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
|
|
5
|
-
* CLI: @astryxdesign/cli@0.7.
|
|
6
|
-
* Core: @astryxdesign/core@0.7.
|
|
5
|
+
* CLI: @astryxdesign/cli@0.7.11
|
|
6
|
+
* Core: @astryxdesign/core@0.7.11
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export {};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @generated by `astryx theme build` — do not edit manually.
|
|
3
3
|
* Source: ui/studio-theme.ts
|
|
4
4
|
* Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
|
|
5
|
-
* CLI: @astryxdesign/cli@0.7.
|
|
6
|
-
* Core: @astryxdesign/core@0.7.
|
|
5
|
+
* CLI: @astryxdesign/cli@0.7.11
|
|
6
|
+
* Core: @astryxdesign/core@0.7.11
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/// <reference path="./theorem-studio.variants.d.ts" />
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* @generated by `astryx theme build` — do not edit manually.
|
|
3
3
|
* Source: ui/studio-theme.ts
|
|
4
4
|
* Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
|
|
5
|
-
* CLI: @astryxdesign/cli@0.7.
|
|
6
|
-
* Core: @astryxdesign/core@0.7.
|
|
5
|
+
* CLI: @astryxdesign/cli@0.7.11
|
|
6
|
+
* Core: @astryxdesign/core@0.7.11
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { theoremTheme } from '@theoremjs/react/ui/theme';
|
|
10
10
|
import { tablerIcons } from "@theoremjs/react/ui/icons";
|
|
11
11
|
const themeIcons = {...theoremTheme["icons"], ...tablerIcons};
|
|
12
12
|
/**
|
|
13
|
-
* theorem-studio theme — built by `npx @astryxdesign/cli@0.7.
|
|
13
|
+
* theorem-studio theme — built by `npx @astryxdesign/cli@0.7.11 theme build`
|
|
14
14
|
* Import the CSS file alongside this module:
|
|
15
15
|
*
|
|
16
16
|
* import { theoremStudioTheme } from './theorem-studio';
|
|
@@ -92,22 +92,23 @@ export const theoremStudioTheme = {
|
|
|
92
92
|
"--_astryx-pre-tempo-duration-slow-min": "525ms",
|
|
93
93
|
"--_astryx-pre-tempo-duration-slow": "700ms",
|
|
94
94
|
"--_astryx-pre-tempo-duration-slow-max": "935ms",
|
|
95
|
+
"--_astryx-motion-tempo": "1",
|
|
95
96
|
"--font-family-body": "Figtree, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
|
|
96
97
|
"--font-family-heading": "Figtree, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
|
|
97
98
|
"--font-family-code": "ui-monospace, \"SF Mono\", Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace",
|
|
98
99
|
"--color-syntax-keyword": "light-dark(#6b187c, #efa8ff)",
|
|
99
100
|
"--color-syntax-string": "light-dark(#0b5615, #a4d6a3)",
|
|
100
|
-
"--color-syntax-comment": "light-dark(#
|
|
101
|
+
"--color-syntax-comment": "light-dark(#525252, #b9b9b9)",
|
|
101
102
|
"--color-syntax-number": "light-dark(#733100, #ffb37e)",
|
|
102
103
|
"--color-syntax-function": "light-dark(#00458c, #a1caff)",
|
|
103
104
|
"--color-syntax-type": "light-dark(#6b187c, #efa8ff)",
|
|
104
105
|
"--color-syntax-variable": "light-dark(#111111, #e2e2e2)",
|
|
105
|
-
"--color-syntax-operator": "light-dark(#
|
|
106
|
+
"--color-syntax-operator": "light-dark(#525252, #b9b9b9)",
|
|
106
107
|
"--color-syntax-constant": "light-dark(#733100, #ffb37e)",
|
|
107
108
|
"--color-syntax-tag": "light-dark(#8a0011, #ffaea7)",
|
|
108
109
|
"--color-syntax-attribute": "light-dark(#584400, #eec448)",
|
|
109
110
|
"--color-syntax-property": "light-dark(#005348, #90d7c8)",
|
|
110
|
-
"--color-syntax-punctuation": "light-dark(#
|
|
111
|
+
"--color-syntax-punctuation": "light-dark(#525252, #b9b9b9)",
|
|
111
112
|
"--color-syntax-background": "light-dark(#ffffff, #111111)",
|
|
112
113
|
"--color-syntax-added": "color-mix(in srgb, var(--color-success-muted) 25%, transparent)",
|
|
113
114
|
"--color-syntax-removed": "color-mix(in srgb, var(--color-error-muted) 25%, transparent)",
|
|
@@ -120,7 +121,7 @@ export const theoremStudioTheme = {
|
|
|
120
121
|
"--color-background-popover": "light-dark(#ffffff, #1b1b1b)",
|
|
121
122
|
"--color-background-muted": "light-dark(#f1f1f1, #1b1b1b)",
|
|
122
123
|
"--color-accent": "light-dark(#1b1b1b, #f1f1f1)",
|
|
123
|
-
"--color-accent-muted": "light-dark(#
|
|
124
|
+
"--color-accent-muted": "light-dark(#d4d4d4, #474747)",
|
|
124
125
|
"--color-neutral": "light-dark(#0000000F, #ffffff1A)",
|
|
125
126
|
"--color-overlay": "light-dark(#00000080, #000000CC)",
|
|
126
127
|
"--color-overlay-hover": "light-dark(#05365914, #FFFFFF14)",
|
|
@@ -319,6 +320,40 @@ export const theoremStudioTheme = {
|
|
|
319
320
|
"lineHeight": "var(--text-display-3-leading)"
|
|
320
321
|
}
|
|
321
322
|
},
|
|
323
|
+
"item": {
|
|
324
|
+
"selected": {
|
|
325
|
+
"--color-text-secondary": "light-dark(#474747, #c6c6c6)"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"tree-list-item": {
|
|
329
|
+
"selected": {
|
|
330
|
+
"--color-text-secondary": "light-dark(#474747, #c6c6c6)"
|
|
331
|
+
},
|
|
332
|
+
"selected:selected": {
|
|
333
|
+
"backgroundColor": "var(--color-overlay-pressed)"
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"file-input": {
|
|
337
|
+
"mode:dropzone": {
|
|
338
|
+
"--color-text-secondary": "light-dark(#474747, #c6c6c6)"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"citation": {
|
|
342
|
+
"variant:number": {
|
|
343
|
+
"--color-text-secondary": "light-dark(#474747, #c6c6c6)"
|
|
344
|
+
},
|
|
345
|
+
"base": {
|
|
346
|
+
":where(*) > [aria-hidden=\"true\"]": {
|
|
347
|
+
"backgroundColor": "transparent",
|
|
348
|
+
"borderWidth": "0",
|
|
349
|
+
"borderRadius": "0"
|
|
350
|
+
},
|
|
351
|
+
":where(*) > [aria-hidden=\"true\"] > img": {
|
|
352
|
+
"width": "100%",
|
|
353
|
+
"height": "100%"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
},
|
|
322
357
|
"button": {
|
|
323
358
|
"variant:destructive": {
|
|
324
359
|
"backgroundColor": "var(--color-error-muted)",
|
|
@@ -442,19 +477,6 @@ export const theoremStudioTheme = {
|
|
|
442
477
|
}
|
|
443
478
|
}
|
|
444
479
|
},
|
|
445
|
-
"citation": {
|
|
446
|
-
"base": {
|
|
447
|
-
":where(*) > [aria-hidden=\"true\"]": {
|
|
448
|
-
"backgroundColor": "transparent",
|
|
449
|
-
"borderWidth": "0",
|
|
450
|
-
"borderRadius": "0"
|
|
451
|
-
},
|
|
452
|
-
":where(*) > [aria-hidden=\"true\"] > img": {
|
|
453
|
-
"width": "100%",
|
|
454
|
-
"height": "100%"
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
480
|
"chat-tool-calls": {
|
|
459
481
|
"base": {
|
|
460
482
|
":where(*) [role=\"button\"][aria-expanded] > span:not(:first-child):not(:has(svg))": {
|
|
@@ -523,11 +545,6 @@ export const theoremStudioTheme = {
|
|
|
523
545
|
"paddingBlock": "var(--spacing-3)"
|
|
524
546
|
}
|
|
525
547
|
},
|
|
526
|
-
"tree-list-item": {
|
|
527
|
-
"selected:selected": {
|
|
528
|
-
"backgroundColor": "var(--color-overlay-pressed)"
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
548
|
"tree-list-item-label": {
|
|
532
549
|
"base": {
|
|
533
550
|
"minWidth": "0",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @generated by `astryx theme build` — do not edit manually.
|
|
3
3
|
* Source: ui/studio-theme.ts
|
|
4
4
|
* Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
|
|
5
|
-
* CLI: @astryxdesign/cli@0.7.
|
|
6
|
-
* Core: @astryxdesign/core@0.7.
|
|
5
|
+
* CLI: @astryxdesign/cli@0.7.11
|
|
6
|
+
* Core: @astryxdesign/core@0.7.11
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
// Generated by astryx theme build
|
package/ui/guardrail-health.js
CHANGED
|
@@ -78,7 +78,7 @@ function shortLicense(license) {
|
|
|
78
78
|
}
|
|
79
79
|
/** A dataset's name, opening its source page, with its licence beside it. */
|
|
80
80
|
function DatasetName({ id, facts }) {
|
|
81
|
-
return (_jsxs(HStack, { gap: 1, align: "center", wrap: "wrap", children: [facts?.source ? (_jsx(Link, { href: facts.source, isExternalLink: true,
|
|
81
|
+
return (_jsxs(HStack, { gap: 1, align: "center", wrap: "wrap", children: [facts?.source ? (_jsx(Link, { href: facts.source, isExternalLink: true, children: id })) : (_jsx(Text, { type: "supporting", children: id })), facts?.license && (_jsx(Text, { type: "supporting", color: "secondary", children: shortLicense(facts.license) }))] }));
|
|
82
82
|
}
|
|
83
83
|
function RateCell({ now, before }) {
|
|
84
84
|
const moved = change(now, before);
|
package/ui/prompt-editor.d.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { RichTextEditor } from '@astryxdesign/richtext';
|
|
2
|
+
import type { ProfileSystem } from '@theoremjs/agents/kernel';
|
|
2
3
|
import { type ComponentProps } from 'react';
|
|
3
4
|
export type EditorStatus = ComponentProps<typeof RichTextEditor>['status'];
|
|
4
5
|
export type PromptEditorProps = {
|
|
5
|
-
/** The prompt as
|
|
6
|
-
value:
|
|
6
|
+
/** The prompt as the file writes it. */
|
|
7
|
+
value: ProfileSystem;
|
|
8
|
+
/** The prompt as the profile first opened, whose lines a change typed back is kept to. */
|
|
9
|
+
written?: ProfileSystem;
|
|
7
10
|
placeholder?: string;
|
|
8
11
|
status?: EditorStatus;
|
|
9
|
-
onChange: (next:
|
|
12
|
+
onChange: (next: ProfileSystem) => void;
|
|
10
13
|
};
|
|
11
14
|
/**
|
|
12
|
-
* The prompt with its private stretches and options in view. It is a view of the
|
|
13
|
-
* it writes back only when the prompt changes, so opening it never dirties the
|
|
14
|
-
*
|
|
15
|
+
* The prompt with its private stretches and options in view. It is a view of the prompt as
|
|
16
|
+
* written: it writes back only when the prompt changes, so opening it never dirties the
|
|
17
|
+
* draft, a line nobody touched stays as written, and a prompt changed from outside (another
|
|
18
|
+
* profile, a reload, a kept source) opens afresh.
|
|
15
19
|
*/
|
|
16
|
-
export declare function PromptEditor({ value, placeholder, status, onChange }: PromptEditorProps): import("react").JSX.Element;
|
|
20
|
+
export declare function PromptEditor({ value, written, placeholder, status, onChange }: PromptEditorProps): import("react").JSX.Element;
|
package/ui/prompt-editor.js
CHANGED
|
@@ -10,8 +10,9 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
|
|
|
10
10
|
import { $getSelectionStyleValueForProperty, $patchStyleText } from '@lexical/selection';
|
|
11
11
|
import { IconFilter, IconShareOff } from '@tabler/icons-react';
|
|
12
12
|
import { $getRoot, $getSelection, $isElementNode, $isRangeSelection, $isRootNode, $setSelection, $splitNode, } from 'lexical';
|
|
13
|
-
import { useCallback, useContext, useEffect, useRef, useState, } from 'react';
|
|
14
|
-
import { openedDoc, PRIVATE_NAME, PRIVATE_ON, promptMarkup,
|
|
13
|
+
import { useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
14
|
+
import { openedDoc, PRIVATE_NAME, PRIVATE_ON, promptMarkup, promptReader } from "../prompt-doc.js";
|
|
15
|
+
import { markupOf, sameWritten } from "../system-markup.js";
|
|
15
16
|
import { ChangeHeld } from "./inspector-context.js";
|
|
16
17
|
import { $isPromptLine, optionItems, PromptLineNode, PromptOptions } from "./prompt-line-node.js";
|
|
17
18
|
import './prompt-editor.css';
|
|
@@ -324,23 +325,28 @@ function OpenedEditor({ opened, placeholder, status, onEdit, }) {
|
|
|
324
325
|
} })] }));
|
|
325
326
|
}
|
|
326
327
|
/**
|
|
327
|
-
* The prompt with its private stretches and options in view. It is a view of the
|
|
328
|
-
* it writes back only when the prompt changes, so opening it never dirties the
|
|
329
|
-
*
|
|
328
|
+
* The prompt with its private stretches and options in view. It is a view of the prompt as
|
|
329
|
+
* written: it writes back only when the prompt changes, so opening it never dirties the
|
|
330
|
+
* draft, a line nobody touched stays as written, and a prompt changed from outside (another
|
|
331
|
+
* profile, a reload, a kept source) opens afresh.
|
|
330
332
|
*/
|
|
331
|
-
export function PromptEditor({ value, placeholder, status, onChange }) {
|
|
333
|
+
export function PromptEditor({ value, written, placeholder, status, onChange }) {
|
|
332
334
|
const [held, setHeld] = useState(value);
|
|
335
|
+
const [opened, setOpened] = useState(value);
|
|
333
336
|
const [opening, setOpening] = useState(0);
|
|
334
337
|
// why: a held change is still on screen; Change keeps it and the caret, Cancel reopens the prompt.
|
|
335
338
|
const isChangeHeld = useContext(ChangeHeld);
|
|
336
|
-
if (!isChangeHeld && !
|
|
339
|
+
if (!isChangeHeld && !sameWritten(value, held)) {
|
|
337
340
|
setHeld(value);
|
|
341
|
+
setOpened(value);
|
|
338
342
|
setOpening(opening + 1);
|
|
339
343
|
}
|
|
340
|
-
|
|
341
|
-
|
|
344
|
+
const read = useMemo(() => promptReader(written === undefined ? [opened] : [opened, written]), [opened, written]);
|
|
345
|
+
return (_jsx(OpenedEditor, { opened: markupOf(opened), placeholder: placeholder, status: status, onEdit: (text) => {
|
|
346
|
+
const next = read(text);
|
|
347
|
+
if (!next.ok || sameWritten(next.system, held))
|
|
342
348
|
return;
|
|
343
|
-
setHeld(next);
|
|
344
|
-
onChange(next);
|
|
349
|
+
setHeld(next.system);
|
|
350
|
+
onChange(next.system);
|
|
345
351
|
} }, opening));
|
|
346
352
|
}
|
package/ui/prompt-row.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import type { ProfileSystem } from '@theoremjs/agents/kernel';
|
|
1
2
|
import type { OptionDraft } from '../draft.ts';
|
|
2
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A profile's prompt: formatted, or as code, which is all a prompt the view can't hold can be.
|
|
5
|
+
* Both show the prompt as written and read back only what changed, so each line nobody touched
|
|
6
|
+
* stays as the file writes it.
|
|
7
|
+
*/
|
|
3
8
|
export declare function PromptRow({ value, options, rows, placeholder, onChange, }: {
|
|
4
|
-
value:
|
|
9
|
+
value: ProfileSystem;
|
|
5
10
|
options: readonly OptionDraft[];
|
|
6
11
|
rows: number;
|
|
7
12
|
placeholder?: string;
|
|
8
|
-
onChange: (next:
|
|
13
|
+
onChange: (next: ProfileSystem) => void;
|
|
9
14
|
}): import("react").JSX.Element;
|
package/ui/prompt-row.js
CHANGED
|
@@ -3,23 +3,52 @@ import { Icon } from '@astryxdesign/core/Icon';
|
|
|
3
3
|
import { ToggleButton } from '@astryxdesign/core/ToggleButton';
|
|
4
4
|
import { IconCode, IconEye } from '@tabler/icons-react';
|
|
5
5
|
import { useDeferredValue, useMemo, useState } from 'react';
|
|
6
|
-
import { promptDocProblem } from "../prompt-doc.js";
|
|
6
|
+
import { promptDocProblem, promptReader } from "../prompt-doc.js";
|
|
7
|
+
import { markupOf, sameWritten } from "../system-markup.js";
|
|
7
8
|
import { TextAreaRow, useFieldRow, WideRow } from "./inspector.js";
|
|
8
9
|
import { PromptEditor } from "./prompt-editor.js";
|
|
9
10
|
import { PromptOptions } from "./prompt-line-node.js";
|
|
10
11
|
const PATH = 'identity.system';
|
|
11
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* A profile's prompt: formatted, or as code, which is all a prompt the view can't hold can be.
|
|
14
|
+
* Both show the prompt as written and read back only what changed, so each line nobody touched
|
|
15
|
+
* stays as the file writes it.
|
|
16
|
+
*/
|
|
12
17
|
export function PromptRow({ value, options, rows, placeholder, onChange, }) {
|
|
13
18
|
const row = { label: 'Prompt', path: PATH, field: 'system' };
|
|
14
19
|
const { status, required } = useFieldRow(row);
|
|
15
20
|
const [wantsCode, setWantsCode] = useState(false);
|
|
21
|
+
const [written] = useState(value);
|
|
22
|
+
// why: text that doesn't read yet is the author's until it does, and the prompt still runs as it was.
|
|
23
|
+
const [typed, setTyped] = useState();
|
|
24
|
+
const shown = useMemo(() => markupOf(value), [value]);
|
|
25
|
+
const text = typed?.over === value ? typed.text : shown;
|
|
16
26
|
// why: the check converts the whole prompt, and a long one mustn't slow each keystroke.
|
|
17
|
-
const settled = useDeferredValue(
|
|
27
|
+
const settled = useDeferredValue(text);
|
|
18
28
|
const problem = useMemo(() => promptDocProblem(settled), [settled]);
|
|
29
|
+
const [forms] = useState(() => new Map());
|
|
30
|
+
const read = useMemo(() => promptReader([value, written], forms), [value, written, forms]);
|
|
31
|
+
const type = (next) => {
|
|
32
|
+
const result = read(next);
|
|
33
|
+
if (!result.ok || sameWritten(result.system, value)) {
|
|
34
|
+
setTyped({ text: next, over: value });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setTyped({ text: next, over: result.system });
|
|
38
|
+
onChange(result.system);
|
|
39
|
+
};
|
|
19
40
|
const isCode = wantsCode || problem !== undefined;
|
|
20
41
|
const toggle = (_jsx(ToggleButton, { label: "Code", tooltip: problem ?? (isCode ? 'Show formatted' : 'Show code'), size: "sm", isIconOnly: true, isDisabled: problem !== undefined, icon: _jsx(Icon, { icon: IconEye, size: "sm" }), pressedIcon: _jsx(Icon, { icon: IconCode, size: "sm" }), isPressed: isCode, onPressedChange: setWantsCode }));
|
|
21
42
|
if (isCode) {
|
|
22
|
-
|
|
43
|
+
const isRead = read(text).ok;
|
|
44
|
+
return (_jsx(TextAreaRow, { ...row, rows: rows, value: text, placeholder: placeholder, status: problem
|
|
45
|
+
? {
|
|
46
|
+
type: 'warning',
|
|
47
|
+
message: isRead
|
|
48
|
+
? problem
|
|
49
|
+
: `${problem} Until it reads, the agent runs with the prompt as it was.`,
|
|
50
|
+
}
|
|
51
|
+
: undefined, action: toggle, onChange: type }));
|
|
23
52
|
}
|
|
24
|
-
return (_jsx(WideRow, { label: row.label, path: row.path, isRequired: required, hasIssue: status !== undefined, action: toggle, children: _jsx(PromptOptions.Provider, { value: options, children: _jsx(PromptEditor, { value: value, placeholder: placeholder, status: status, onChange: onChange }) }) }));
|
|
53
|
+
return (_jsx(WideRow, { label: row.label, path: row.path, isRequired: required, hasIssue: status !== undefined, action: toggle, children: _jsx(PromptOptions.Provider, { value: options, children: _jsx(PromptEditor, { value: value, written: written, placeholder: placeholder, status: status, onChange: onChange }) }) }));
|
|
25
54
|
}
|
package/ui/studio-save.js
CHANGED
|
@@ -53,7 +53,7 @@ function alertsReport(project, unloaded) {
|
|
|
53
53
|
if (unheld.length)
|
|
54
54
|
lines.push('', `Cannot check against files: ${[...new Set(unheld)].join(' ')}`);
|
|
55
55
|
for (const each of differences) {
|
|
56
|
-
lines.push('', `${each.of} shows ${String(each.settings.length)} settings differently from files: ${settingAreas(each.settings, 12)}`);
|
|
56
|
+
lines.push('', `${each.of} shows ${String(each.settings.length)} ${each.settings.length === 1 ? 'setting' : 'settings'} differently from files: ${settingAreas(each.settings, 12)}`);
|
|
57
57
|
}
|
|
58
58
|
return lines.join('\n');
|
|
59
59
|
}
|