@theoremjs/studio 0.3.4-next.735.g8d504c6 → 0.3.4-next.753.g176c472
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/installed.mjs +10 -1
- package/label-areas.d.ts +5 -0
- package/label-areas.js +6 -0
- package/package.json +19 -4
- package/page/assets/Badge-D78MvW22.js +1 -0
- package/page/assets/{BottomSheet-Dbh6A5Vl.js → BottomSheet-CS905Wxu.js} +1 -1
- package/page/assets/Card-D_40unTk.js +1 -0
- package/page/assets/CheckboxInput-MMjt4mDv.js +2 -0
- package/page/assets/CodeBlock-DzXH_9DF.js +3 -0
- package/page/assets/CollapsibleGroup-D1qiJpkR.js +1 -0
- package/page/assets/ConsoleFrame-CqQsb1GZ.js +3 -0
- package/page/assets/DateInput-BvG86MuZ.js +1 -0
- package/page/assets/{Dialog-Sd04KQS2.js → Dialog-DUNBjHOI.js} +1 -1
- package/page/assets/{HoverCard-DMyWUvwP.js → HoverCard-DMHc1Gh1.js} +1 -1
- package/page/assets/Icon-3c9WmPTH.js +3 -0
- package/page/assets/{IconButton-DVUFx-8p.js → IconButton-BeI1pXEZ.js} +1 -1
- package/page/assets/IconFilter-BO98ezum.js +1 -0
- package/page/assets/IconHistory-VvDVN7WG.js +1 -0
- package/page/assets/{ItemSwipeLayer-Ckn4X6h9.js → ItemSwipeLayer-BzVkYf4E.js} +1 -1
- package/page/assets/{ListItem-QF7KFt0h.js → ListItem-MWWVygeh.js} +1 -1
- package/page/assets/MenuBottomSheet-BInvPU7g.js +1 -0
- package/page/assets/MenuBottomSheetActionList-CYZ56fty.js +1 -0
- package/page/assets/OverflowList-CoxIfkMv.js +1 -0
- package/page/assets/SchemaFields-Bd9lDE4d.js +1 -0
- package/page/assets/ScrollableArea-CZpbLBeP.js +1 -0
- package/page/assets/SidePanel-Bp_RI52Y.js +2 -0
- package/page/assets/{Text-BOqCfzZC.js → Text-B74VhVA7.js} +2 -2
- package/page/assets/TextInput-D1GkClqk.js +1 -0
- package/page/assets/{TimestampHoverCard-CDCVpEWM.js → TimestampHoverCard-BNDnoAyp.js} +1 -1
- package/page/assets/ToolResultCharts-CI9TdyAV.js +1 -0
- package/page/assets/Toolbar-RbTb26eP.js +1 -0
- package/page/assets/{Tooltip-BWs5DLrM.js → Tooltip-DrSpWxD8.js} +1 -1
- package/page/assets/TraceInspector-aObqeJHi.js +1 -0
- package/page/assets/{TraceOverview-DqCofwm4.js → TraceOverview-D5c_l1Ux.js} +4 -4
- package/page/assets/{_virtual_studio-type-sources-nXG6uotl.js → _virtual_studio-type-sources-Cc4WAdgD.js} +50 -17
- package/page/assets/browser-connection-159CdeHX.js +1 -0
- package/page/assets/browser-engine-DI5i0e2R.js +16 -0
- package/page/assets/browser-transport-Dh5ab7QT.js +45 -0
- package/page/assets/compile-iB2CAmRL.js +2 -0
- package/page/assets/{container.stylex-BmOi-8DQ.js → container.stylex-C2nFBhUj.js} +1 -1
- package/page/assets/{embedding-space-view-CN0VHXXH.js → embedding-space-view-JuXKDaFw.js} +1 -1
- package/page/assets/encode-files-CeZxxjYd.js +1 -0
- package/page/assets/{export-agent-BrN5vTz2.js → export-agent-Cd8Q-cK9.js} +3 -3
- package/page/assets/{fieldParts-CoOpDoax.js → fieldParts-Dtp1EoJQ.js} +1 -1
- package/page/assets/{focusOutline.stylex-BT0kfa4t.js → focusOutline.stylex-B9nWSXsG.js} +1 -1
- package/page/assets/guardrail-tester-CR-zyzhr.js +9 -0
- package/page/assets/highlightRanges-yrVxbmkN.js +51 -0
- package/page/assets/index-DakRjE8R.css +1 -0
- package/page/assets/index-Kvukosz3.js +149 -0
- package/page/assets/{labels-provider-uONlWExD.js → labels-provider-Dc-AJqPH.js} +2 -2
- package/page/assets/{live-messages-_FDpxQYF.js → live-messages-D-SPyR3e.js} +1 -1
- package/page/assets/menuItemRoles-Bod0knkp.js +1 -0
- package/page/assets/prompt-row-CE0EDTVb.js +71 -0
- package/page/assets/prompt-row-beoYzntJ.css +1 -0
- package/page/assets/reader-DtOL_I1x.js +5 -0
- package/page/assets/registry-DP0ArymS.js +1 -0
- package/page/assets/schema-Cv4HAfBT.js +3 -0
- package/page/assets/shaped-data-DCfLI4gb.js +21 -0
- package/page/assets/{stub-J0Ig6FyA.js → stub-REBz-ZC7.js} +1 -1
- package/page/assets/studio-code-pane-DCaWq57x.js +10 -0
- package/page/assets/{studio-console-BG1WmM3M.js → studio-console-bHQq_-86.js} +1 -1
- package/page/assets/studio-decision-BaoUot8U.js +1 -0
- package/page/assets/studio-embedding-BVMWcpVq.js +2 -0
- package/page/assets/studio-host-console-BfLdRxc9.js +2 -0
- package/page/assets/studio-labels-CNc-S7NH.js +3 -0
- package/page/assets/studio-live-DeDSZSSs.js +5 -0
- package/page/assets/studio-map-u2kDE0i4.js +1 -0
- package/page/assets/studio-trace-replay-BInKCErs.js +3 -0
- package/page/assets/{studio-type-checker-CF7Re1aY.js → studio-type-checker-JZuu4iVI.js} +1 -1
- package/page/assets/{tokens.stylex-DkHf0P9C.js → tokens.stylex-BpCwr7Mf.js} +1 -1
- package/page/assets/tool-schema-BwaPiLtT.js +17 -0
- package/page/assets/{trace-patterns-D6TbkLLr.js → trace-patterns-D5Rcl0G4.js} +1 -1
- package/page/assets/{trace-record-YSvR6YMe.js → trace-record--uEnDt_D.js} +1 -1
- package/page/assets/tree-CL4ETBd5.js +3 -0
- package/page/assets/{turn-client-Xn70kpoZ.js → turn-client-B3jV7UKH.js} +2 -2
- package/page/assets/types-BDx4pnrt.js +1 -0
- package/page/assets/use-one-call-D9ArlH1f.js +1 -0
- package/page/assets/use-second-ticker-DhbZ0Soz.js +1 -0
- package/page/assets/{useAnnounce-DTSHZvjg.js → useAnnounce-DOkF3CS1.js} +1 -1
- package/page/assets/useAnnounceRenderedText-aqUr1P16.js +1 -0
- package/page/assets/{useClipboard-CbN9bb4J.js → useClipboard-BC4cMFBa.js} +1 -1
- package/page/assets/useKeyboardHint-BBkDGjRh.js +1 -0
- package/page/assets/useLocale-D8GRz3lz.js +1 -0
- package/page/assets/useMenuDrillIn-tTYG6Wzi.js +1 -0
- package/page/assets/{useMenuPress-DLG1QOiE.js → useMenuPress-DPpqa6F7.js} +1 -1
- package/page/assets/{useResolvedRequired-DbsOcDqy.js → useResolvedRequired-68GOSl0j.js} +1 -1
- package/page/assets/{useTooltip-c097gL_-.js → useTooltip-BaCjTHk-.js} +1 -1
- package/page/assets/{workspace-Bfoebvk4.js → workspace-B6d08n7C.js} +1 -1
- package/page/index.html +53 -42
- package/prompt-doc.d.ts +24 -0
- package/prompt-doc.js +251 -0
- package/read-source.js +25 -33
- package/section-notes.d.ts +16 -2
- package/section-notes.js +16 -2
- package/server/runs.d.ts +17 -0
- package/server/runs.js +73 -0
- package/server/save-session.d.ts +4 -0
- package/server/save-session.js +10 -6
- package/server/serve.js +76 -12
- package/ui/built/theme.css +1 -1
- package/ui/built/theorem-studio.js +1 -1
- package/ui/inspector-context.d.ts +2 -0
- package/ui/inspector-context.js +2 -0
- package/ui/inspector.d.ts +44 -2
- package/ui/inspector.js +20 -9
- package/ui/lib/studio-watch.d.ts +6 -0
- package/ui/lib/studio-watch.js +16 -0
- package/ui/profile-editor.js +47 -40
- package/ui/prompt-editor.css +112 -0
- package/ui/prompt-editor.d.ts +16 -0
- package/ui/prompt-editor.js +315 -0
- package/ui/prompt-line-node.d.ts +29 -0
- package/ui/prompt-line-node.js +112 -0
- package/ui/prompt-row.d.ts +9 -0
- package/ui/prompt-row.js +25 -0
- package/ui/provider-editor.js +2 -1
- package/ui/studio-compare.js +48 -7
- package/ui/studio-save.d.ts +2 -0
- package/ui/studio-save.js +13 -5
- package/ui/studio-screen.js +18 -16
- package/ui/studio-theme.d.ts +1 -1
- package/ui/studio-theme.js +2 -0
- package/ui/studio-trace-replay.js +5 -5
- package/ui/studio.css +42 -14
- package/page/assets/Banner-BXQ3eMGX.js +0 -3
- package/page/assets/Card-DruykyeB.js +0 -1
- package/page/assets/CheckboxInput-CFZ_Wq8-.js +0 -2
- package/page/assets/CodeBlock-CfVOtDeO.js +0 -52
- package/page/assets/CollapsibleGroup-BsIYDnJR.js +0 -1
- package/page/assets/ConsoleFrame-DDSgPsZH.js +0 -3
- package/page/assets/DateInput-CalwZl6a.js +0 -1
- package/page/assets/Icon-BqkS-pIq.js +0 -3
- package/page/assets/IconEye-BB5aY-wQ.js +0 -1
- package/page/assets/MenuBottomSheet-CGBoKe8D.js +0 -1
- package/page/assets/SchemaFields-D7ClAIou.js +0 -1
- package/page/assets/ScrollableArea-ChTx-OVZ.js +0 -1
- package/page/assets/SegmentedControlItem-CZs-ycSA.js +0 -1
- package/page/assets/SidePanel-DEd3R1Q3.js +0 -2
- package/page/assets/ToolResultCharts-DiEXUaNn.js +0 -1
- package/page/assets/TraceInspector-CaNKb5tj.js +0 -1
- package/page/assets/browser-connection-Dm_C2k-h.js +0 -3
- package/page/assets/browser-engine-BfnMGcT2.js +0 -16
- package/page/assets/browser-transport-9tBHJSxP.js +0 -45
- package/page/assets/crypto-DbeKCGAB.js +0 -1
- package/page/assets/encode-files-BdORDAbw.js +0 -1
- package/page/assets/guardrail-tester-BrSKPdyb.js +0 -9
- package/page/assets/index-Boxd3JUw.js +0 -149
- package/page/assets/index-C9rhrCGT.css +0 -1
- package/page/assets/reader-CHvIE7jW.js +0 -5
- package/page/assets/shaped-data-B5yHkAzM.js +0 -21
- package/page/assets/studio-code-pane-B4bfZLeO.js +0 -10
- package/page/assets/studio-decision-Ck3RM4xV.js +0 -1
- package/page/assets/studio-embedding-pvHODyby.js +0 -2
- package/page/assets/studio-host-console-DAv2ocEl.js +0 -2
- package/page/assets/studio-labels-DLm-OIlS.js +0 -3
- package/page/assets/studio-live-BBVkUupj.js +0 -5
- package/page/assets/studio-map-DE4o1Dw6.js +0 -1
- package/page/assets/studio-trace-replay-DMnAw57P.js +0 -3
- package/page/assets/tool-schema-CAhMfN4z.js +0 -17
- package/page/assets/tree-sm5ci1wZ.js +0 -3
- package/page/assets/use-one-call-DJQhFDfz.js +0 -1
- package/page/assets/use-second-ticker-B_tRvZF_.js +0 -1
package/page/index.html
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23000'/%3E%3Cg transform='translate(4 4)' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4.5 18.5c2 0 3-1.2 4.2-3.4l2.6-5c1-1.9 2.1-3.1 4.2-3.1'/%3E%3Cpath d='M5.5 8.2c1.6-.9 3.2-.4 3.8 1.6l2.3 6.6c.6 1.7 2.1 2.4 3.9 1.7'/%3E%3Ccircle cx='19.5' cy='4.5' r='1.6' fill='%23fff' stroke='none'/%3E%3C/g%3E%3C/svg%3E"
|
|
11
11
|
/>
|
|
12
12
|
<title>theorem studio</title>
|
|
13
|
-
<script type="module" crossorigin src="/studio/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/studio/assets/index-Kvukosz3.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/studio/assets/rolldown-runtime-hePW80VL.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/studio/assets/themeProps-3IqahpCr.js">
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/tokens.stylex-
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/tokens.stylex-BpCwr7Mf.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/studio/assets/padding.stylex-B76907Zf.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/studio/assets/mergeProps-ptS-gIMz.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/studio/assets/VStack-CkVMcNiK.js">
|
|
@@ -22,73 +22,84 @@
|
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/studio/assets/devWarning-DxuplmRl.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/studio/assets/sharedResizeObserver-4U9Xq5Oq.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/studio/assets/preload-helper-DpV6A1kQ.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/Text-
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Text-B74VhVA7.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/studio/assets/useMediaQuery-BCT0NUeZ.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/Icon-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useAnnounce-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useTooltip-
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/Tooltip-
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useResolvedRequired-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/focusOutline.stylex-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/IconButton-
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Icon-3c9WmPTH.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useAnnounce-DOkF3CS1.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useTooltip-BaCjTHk-.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Tooltip-DrSpWxD8.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useResolvedRequired-68GOSl0j.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/focusOutline.stylex-B9nWSXsG.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/IconButton-BeI1pXEZ.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/studio/assets/focusableSelector-DXZeMU85.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/studio/assets/useDevWarning-Z9SoixOP.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/studio/assets/createReactComponent-CZwsv6DD.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/studio/assets/isRtlElement-BG33-k_H.js">
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/fieldParts-
|
|
39
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/fieldParts-Dtp1EoJQ.js">
|
|
39
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useAnnounceRenderedText-aqUr1P16.js">
|
|
40
40
|
<link rel="modulepreload" crossorigin href="/studio/assets/plainDate-BHiJcj7o.js">
|
|
41
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
42
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/Card-DruykyeB.js">
|
|
41
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/OverflowList-CoxIfkMv.js">
|
|
43
42
|
<link rel="modulepreload" crossorigin href="/studio/assets/useScrollableArea-DuF_pz9m.js">
|
|
44
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/ScrollableArea-
|
|
45
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
43
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/ScrollableArea-CZpbLBeP.js">
|
|
44
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/container.stylex-C2nFBhUj.js">
|
|
45
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Card-D_40unTk.js">
|
|
46
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/SidePanel-Bp_RI52Y.js">
|
|
46
47
|
<link rel="modulepreload" crossorigin href="/studio/assets/IconAlertTriangle-BqAEqqdU.js">
|
|
47
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/isRenderable-DHkzpAoQ.js">
|
|
48
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/labels-provider-uONlWExD.js">
|
|
49
48
|
<link rel="modulepreload" crossorigin href="/studio/assets/schemas-D7cgkv3L.js">
|
|
50
49
|
<link rel="modulepreload" crossorigin href="/studio/assets/host-patterns-F-KZIzkF.js">
|
|
51
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/shaped-data-
|
|
52
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/tool-schema-
|
|
50
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/shaped-data-DCfLI4gb.js">
|
|
51
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/tool-schema-BwaPiLtT.js">
|
|
53
52
|
<link rel="modulepreload" crossorigin href="/studio/assets/live-ingress-OuSlQ6q7.js">
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/tree-
|
|
55
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
56
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
57
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
53
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/tree-CL4ETBd5.js">
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/schema-Cv4HAfBT.js">
|
|
55
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/browser-connection-159CdeHX.js">
|
|
56
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/types-BDx4pnrt.js">
|
|
57
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/compile-iB2CAmRL.js">
|
|
58
58
|
<link rel="modulepreload" crossorigin href="/studio/assets/row-keys-WByP9Hsh.js">
|
|
59
59
|
<link rel="modulepreload" crossorigin href="/studio/assets/Center-CgO0c-qo.js">
|
|
60
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/IconFilter-BO98ezum.js">
|
|
60
61
|
<link rel="modulepreload" crossorigin href="/studio/assets/IconSearch-BTx66a40.js">
|
|
61
62
|
<link rel="modulepreload" crossorigin href="/studio/assets/trace-schema--4IGmLeE.js">
|
|
62
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/stub-
|
|
63
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/reader-
|
|
64
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
63
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/stub-REBz-ZC7.js">
|
|
64
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/reader-DtOL_I1x.js">
|
|
65
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/registry-DP0ArymS.js">
|
|
66
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/browser-transport-Dh5ab7QT.js">
|
|
65
67
|
<link rel="modulepreload" crossorigin href="/studio/assets/focusReturn-CTppP2k0.js">
|
|
66
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/isRenderable-DHkzpAoQ.js">
|
|
69
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/labels-provider-Dc-AJqPH.js">
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useLocale-D8GRz3lz.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/CheckboxInput-MMjt4mDv.js">
|
|
67
72
|
<link rel="modulepreload" crossorigin href="/studio/assets/useScrollLock-Dyf6PHJt.js">
|
|
68
73
|
<link rel="modulepreload" crossorigin href="/studio/assets/chainEventHandlers-C6ttXGfW.js">
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/Dialog-
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/useClipboard-
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
76
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
77
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
78
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Dialog-DUNBjHOI.js">
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useClipboard-BC4cMFBa.js">
|
|
76
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/highlightRanges-yrVxbmkN.js">
|
|
77
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/CodeBlock-DzXH_9DF.js">
|
|
78
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/HoverCard-DMHc1Gh1.js">
|
|
79
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/TextInput-D1GkClqk.js">
|
|
80
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/encode-files-CeZxxjYd.js">
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/turn-client-B3jV7UKH.js">
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/Badge-D78MvW22.js">
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/CollapsibleGroup-D1qiJpkR.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/studio-labels-CNc-S7NH.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/workspace-B6d08n7C.js">
|
|
80
86
|
<link rel="modulepreload" crossorigin href="/studio/assets/lent-keys-C32ems-I.js">
|
|
81
87
|
<link rel="modulepreload" crossorigin href="/studio/assets/editors-BJX_S59A.js">
|
|
82
88
|
<link rel="modulepreload" crossorigin href="/studio/assets/project-address-DjxPZuyn.js">
|
|
83
89
|
<link rel="modulepreload" crossorigin href="/studio/assets/people-CIsR0-5R.js">
|
|
84
90
|
<link rel="modulepreload" crossorigin href="/studio/assets/studio-session-ClF2iNCX.js">
|
|
85
91
|
<link rel="modulepreload" crossorigin href="/studio/assets/EmptyState-C_uF9Wyj.js">
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/use-second-ticker-DhbZ0Soz.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/menuItemRoles-Bod0knkp.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useMenuPress-DPpqa6F7.js">
|
|
87
95
|
<link rel="modulepreload" crossorigin href="/studio/assets/useAdaptivePresentation-Bma4-u1a.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useMenuDrillIn-tTYG6Wzi.js">
|
|
88
97
|
<link rel="modulepreload" crossorigin href="/studio/assets/useFocusReturnVisibility-BHKv5Jwr.js">
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/studio/assets/
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/useKeyboardHint-BBkDGjRh.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/ListItem-MWWVygeh.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/studio/assets/MenuBottomSheetActionList-CYZ56fty.js">
|
|
90
101
|
<link rel="stylesheet" crossorigin href="/studio/assets/use-second-ticker-GWBt83pd.css">
|
|
91
|
-
<link rel="stylesheet" crossorigin href="/studio/assets/index-
|
|
102
|
+
<link rel="stylesheet" crossorigin href="/studio/assets/index-DakRjE8R.css">
|
|
92
103
|
<style>html{color-scheme:dark}html,body{margin:0;background:#000}html[data-boot-pending],html[data-boot-pending] body{background:#262626}html[data-boot-pending] .astryx-app-shell{height:100dvh}html[data-boot-pending] .astryx-app-shell-sidenav{position:absolute;inset-block:0;inset-inline-start:0;z-index:0;width:3rem}html[data-boot-pending] #astryx-app-shell-main{position:relative;z-index:1;width:100%;height:100%;max-width:none;margin:0;border-radius:0;clip-path:none;background:#262626;color:#fff}html[data-boot-pending] #astryx-app-shell-main>:not([data-boot]){visibility:hidden}html[data-boot-pending] [data-boot]{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:#262626;color:#fff}</style>
|
|
93
104
|
<noscript> <style>html[data-boot-pending],html[data-boot-pending] body{background:#000}html[data-boot-pending] #astryx-app-shell-main>:not([data-boot]){visibility:visible !important}[data-boot]{display:none !important}</style>
|
|
94
105
|
</noscript>
|
package/prompt-doc.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SystemPrompt } from '@theoremjs/agents/kernel';
|
|
2
|
+
declare const PROMPT_LINE = "prompt-line";
|
|
3
|
+
declare const PRIVATE_NAME = "--private";
|
|
4
|
+
declare const PRIVATE_ON = "1";
|
|
5
|
+
/** The document for a prompt's lines, as the JSON the editor opens. */
|
|
6
|
+
declare function promptDoc(lines: readonly SystemPrompt[]): string;
|
|
7
|
+
/** The document for markup text that parses. */
|
|
8
|
+
declare function openedDoc(text: string): string | undefined;
|
|
9
|
+
/** The markup text for what the editor holds. */
|
|
10
|
+
declare function promptMarkup(json: string): string;
|
|
11
|
+
/** A `when`'s checks, each as `name is value`. */
|
|
12
|
+
declare const checksOf: (when: string | null) => string[];
|
|
13
|
+
/** One condition holds one value; picking the value it already has takes it off. */
|
|
14
|
+
declare function withCheck(when: string | null, name: string, value: string): string | null;
|
|
15
|
+
/** The `when` left once one check is off. */
|
|
16
|
+
declare const withoutCheck: (when: string | null, check: string) => string | null;
|
|
17
|
+
/** Whether two markup texts hold the same prompt, however each is written. */
|
|
18
|
+
declare function samePrompt(a: string, b: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Why this text can't open formatted, if it can't: its markup is broken, or the document would
|
|
21
|
+
* not give the same prompt back. Those stay in the code view, where every character is the author's.
|
|
22
|
+
*/
|
|
23
|
+
declare function promptDocProblem(text: string): string | undefined;
|
|
24
|
+
export { checksOf, openedDoc, PRIVATE_NAME, PRIVATE_ON, PROMPT_LINE, promptDoc, promptDocProblem, promptMarkup, samePrompt, withCheck, withoutCheck, };
|
package/prompt-doc.js
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { editorStateJSONToMarkdown, markdownToEditorStateJSON, } from '@astryxdesign/richtext/markdown';
|
|
2
|
+
import { parseSystemMarkup } from "./system-markup.js";
|
|
3
|
+
const PROMPT_LINE = 'prompt-line';
|
|
4
|
+
const PRIVATE_NAME = '--private';
|
|
5
|
+
const PRIVATE_ON = '1';
|
|
6
|
+
const PRIVATE_STYLE = `${PRIVATE_NAME}: ${PRIVATE_ON};`;
|
|
7
|
+
/** Marks a private stretch through Markdown, which has no words for one. */
|
|
8
|
+
const OPEN = '';
|
|
9
|
+
const CLOSE = '';
|
|
10
|
+
const MARKER = /([])/;
|
|
11
|
+
const BLOCK_START = /^(\s*(?:#{1,6} |[-*] |\d+\. ))/;
|
|
12
|
+
const OPEN_AFTER_START = /(^|\n)(\s*(?:#{1,6} |[-*] |\d+\. ))/g;
|
|
13
|
+
const OPEN_THEN_SPACE = /([ \t]+)/g;
|
|
14
|
+
const SPACE_THEN_CLOSE = /([ \t]+)/g;
|
|
15
|
+
const WHEN = /^when ([^:]+): ?/;
|
|
16
|
+
const isPrivateStyle = (style = '') => style.includes(PRIVATE_NAME);
|
|
17
|
+
function docNode(value) {
|
|
18
|
+
if (typeof value !== 'object' || value === null || !('type' in value)) {
|
|
19
|
+
throw new Error('The editor gave a node with no type.');
|
|
20
|
+
}
|
|
21
|
+
const { type } = value;
|
|
22
|
+
if (typeof type !== 'string')
|
|
23
|
+
throw new Error('The editor gave a node with no type.');
|
|
24
|
+
const children = 'children' in value && Array.isArray(value.children) ? value.children.map(docNode) : undefined;
|
|
25
|
+
return { ...value, type, ...(children ? { children } : {}) };
|
|
26
|
+
}
|
|
27
|
+
function rootOf(json) {
|
|
28
|
+
const parsed = JSON.parse(json);
|
|
29
|
+
if (typeof parsed !== 'object' || parsed === null || !('root' in parsed)) {
|
|
30
|
+
throw new Error('The editor gave a document with no root.');
|
|
31
|
+
}
|
|
32
|
+
return docNode(parsed.root);
|
|
33
|
+
}
|
|
34
|
+
/** One line's `when`, and its body with each private stretch between markers. */
|
|
35
|
+
function lineBody(line) {
|
|
36
|
+
const parts = typeof line === 'string' ? [line] : line;
|
|
37
|
+
const stretches = parts.map((part) => typeof part === 'string'
|
|
38
|
+
? { text: part, isPrivate: false }
|
|
39
|
+
: { text: part.private, isPrivate: true });
|
|
40
|
+
const [first] = stretches;
|
|
41
|
+
const match = first ? WHEN.exec(first.text) : null;
|
|
42
|
+
if (first && match)
|
|
43
|
+
first.text = first.text.slice(match[0].length);
|
|
44
|
+
const body = stretches
|
|
45
|
+
.map(({ text, isPrivate }) => {
|
|
46
|
+
if (!isPrivate)
|
|
47
|
+
return text;
|
|
48
|
+
const start = BLOCK_START.exec(text)?.[1] ?? '';
|
|
49
|
+
return `${start}${OPEN}${text.slice(start.length)}${CLOSE}`;
|
|
50
|
+
})
|
|
51
|
+
.join('');
|
|
52
|
+
return { when: match?.[1] ?? null, body };
|
|
53
|
+
}
|
|
54
|
+
/** The body's blocks, with each marker turned into the private style on the text it covers. */
|
|
55
|
+
function blocksOf(body) {
|
|
56
|
+
const root = rootOf(markdownToEditorStateJSON(body));
|
|
57
|
+
let inPrivate = false;
|
|
58
|
+
const walk = (node) => {
|
|
59
|
+
if (!node.children)
|
|
60
|
+
return;
|
|
61
|
+
node.children = node.children.flatMap((child) => {
|
|
62
|
+
if (child.type !== 'text') {
|
|
63
|
+
walk(child);
|
|
64
|
+
return [child];
|
|
65
|
+
}
|
|
66
|
+
return (child.text ?? '').split(MARKER).flatMap((piece) => {
|
|
67
|
+
if (piece === OPEN)
|
|
68
|
+
inPrivate = true;
|
|
69
|
+
if (piece === CLOSE)
|
|
70
|
+
inPrivate = false;
|
|
71
|
+
if (!piece || piece === OPEN || piece === CLOSE)
|
|
72
|
+
return [];
|
|
73
|
+
return [{ ...child, text: piece, style: inPrivate ? PRIVATE_STYLE : '' }];
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
walk(root);
|
|
78
|
+
return root;
|
|
79
|
+
}
|
|
80
|
+
const EMPTY_LINE = { type: 'paragraph', version: 1, children: [] };
|
|
81
|
+
/** The document for a prompt's lines, as the JSON the editor opens. */
|
|
82
|
+
function promptDoc(lines) {
|
|
83
|
+
const roots = lines.map(lineBody).map(({ when, body }) => ({ when, root: blocksOf(body) }));
|
|
84
|
+
const shell = roots[0]?.root ?? rootOf(markdownToEditorStateJSON(''));
|
|
85
|
+
// invariant: the editor refuses an empty root, so a blank prompt opens on an empty paragraph.
|
|
86
|
+
if (roots.length === 0)
|
|
87
|
+
return JSON.stringify({ root: { ...shell, children: [EMPTY_LINE] } });
|
|
88
|
+
const children = roots.flatMap(({ when, root }, at) => {
|
|
89
|
+
const blocks = root.children ?? [];
|
|
90
|
+
// why: lines side by side under one condition read as one stretch; `withWhen` writes it back.
|
|
91
|
+
const continues = when !== null && roots[at - 1]?.when === when;
|
|
92
|
+
return continues ? blocks : [{ type: PROMPT_LINE, version: 1, when }, ...blocks];
|
|
93
|
+
});
|
|
94
|
+
return JSON.stringify({ root: { ...shell, children } });
|
|
95
|
+
}
|
|
96
|
+
function leavesOf(nodes) {
|
|
97
|
+
return nodes.flatMap((node) => node.children
|
|
98
|
+
? leavesOf(node.children)
|
|
99
|
+
: typeof node.text === 'string'
|
|
100
|
+
? [{ siblings: nodes, node }]
|
|
101
|
+
: []);
|
|
102
|
+
}
|
|
103
|
+
const marker = (text) => ({
|
|
104
|
+
type: 'text',
|
|
105
|
+
version: 1,
|
|
106
|
+
text,
|
|
107
|
+
format: 0,
|
|
108
|
+
mode: 'normal',
|
|
109
|
+
style: '',
|
|
110
|
+
detail: 0,
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* A body with its `when` on each stretch a blank line starts, since markup ends a line there
|
|
114
|
+
* unless a private stretch holds it open.
|
|
115
|
+
*/
|
|
116
|
+
function withWhen(when, body) {
|
|
117
|
+
if (!when)
|
|
118
|
+
return body;
|
|
119
|
+
let held = false;
|
|
120
|
+
return body
|
|
121
|
+
.split('\n\n')
|
|
122
|
+
.map((chunk) => {
|
|
123
|
+
const starts = !held;
|
|
124
|
+
const opens = chunk.lastIndexOf(OPEN);
|
|
125
|
+
const closes = chunk.lastIndexOf(CLOSE);
|
|
126
|
+
if (opens !== closes)
|
|
127
|
+
held = opens > closes;
|
|
128
|
+
if (!starts)
|
|
129
|
+
return chunk;
|
|
130
|
+
return chunk.startsWith(OPEN)
|
|
131
|
+
? `${OPEN}when ${when}: ${chunk.slice(OPEN.length)}`
|
|
132
|
+
: `when ${when}: ${chunk}`;
|
|
133
|
+
})
|
|
134
|
+
.join('\n\n');
|
|
135
|
+
}
|
|
136
|
+
/** One line's blocks back as markup, with the markers in place of the private style. */
|
|
137
|
+
function lineMarkup(when, blocks, shell) {
|
|
138
|
+
const copy = structuredClone(blocks);
|
|
139
|
+
let inPrivate = false;
|
|
140
|
+
let last;
|
|
141
|
+
for (const leaf of leavesOf(copy)) {
|
|
142
|
+
const held = isPrivateStyle(leaf.node.style);
|
|
143
|
+
if (held && !inPrivate)
|
|
144
|
+
leaf.siblings.splice(leaf.siblings.indexOf(leaf.node), 0, marker(OPEN));
|
|
145
|
+
if (!held && inPrivate && last) {
|
|
146
|
+
last.siblings.splice(last.siblings.indexOf(last.node) + 1, 0, marker(CLOSE));
|
|
147
|
+
}
|
|
148
|
+
inPrivate = held;
|
|
149
|
+
leaf.node.style = '';
|
|
150
|
+
last = leaf;
|
|
151
|
+
}
|
|
152
|
+
if (inPrivate && last) {
|
|
153
|
+
last.siblings.splice(last.siblings.indexOf(last.node) + 1, 0, marker(CLOSE));
|
|
154
|
+
}
|
|
155
|
+
const body = editorStateJSONToMarkdown(JSON.stringify({ root: { ...shell, children: copy } }));
|
|
156
|
+
if (!body.trim())
|
|
157
|
+
return '';
|
|
158
|
+
// why: `{private: ` has to stand before a line's block mark for the mark to stay a mark, so the
|
|
159
|
+
// first private stretch of a block opens ahead of it.
|
|
160
|
+
const opened = body
|
|
161
|
+
.replace(OPEN_AFTER_START, (_, before, start) => `${before}${OPEN}${start}`)
|
|
162
|
+
// invariant: private text is trimmed, so the spaces at its edges stand outside it.
|
|
163
|
+
.replace(OPEN_THEN_SPACE, `$1${OPEN}`)
|
|
164
|
+
.replace(SPACE_THEN_CLOSE, `${CLOSE}$1`)
|
|
165
|
+
.replaceAll(`${OPEN}${CLOSE}`, '');
|
|
166
|
+
return withWhen(when, opened).replaceAll(OPEN, '{private: ').replaceAll(CLOSE, '}');
|
|
167
|
+
}
|
|
168
|
+
/** The document for markup text that parses. */
|
|
169
|
+
function openedDoc(text) {
|
|
170
|
+
const parsed = parseSystemMarkup(text);
|
|
171
|
+
return parsed.ok ? promptDoc(parsed.lines) : undefined;
|
|
172
|
+
}
|
|
173
|
+
/** The markup text for what the editor holds. */
|
|
174
|
+
function promptMarkup(json) {
|
|
175
|
+
const { children = [], ...shell } = rootOf(json);
|
|
176
|
+
const lines = [];
|
|
177
|
+
for (const node of children) {
|
|
178
|
+
if (node.type === PROMPT_LINE)
|
|
179
|
+
lines.push({ when: node.when, blocks: [] });
|
|
180
|
+
else if (lines.at(-1))
|
|
181
|
+
lines.at(-1)?.blocks.push(node);
|
|
182
|
+
else
|
|
183
|
+
lines.push({ when: null, blocks: [node] });
|
|
184
|
+
}
|
|
185
|
+
return lines
|
|
186
|
+
.map(({ when, blocks }) => lineMarkup(when, blocks, shell))
|
|
187
|
+
.filter(Boolean)
|
|
188
|
+
.join('\n\n');
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* A line as what it says and what it keeps private, with a private stretch's `when` and block mark
|
|
192
|
+
* outside it. Where those stand doesn't change what is sent, and the document keeps one place.
|
|
193
|
+
*/
|
|
194
|
+
function settledLine(line) {
|
|
195
|
+
const runs = [];
|
|
196
|
+
const add = (text, isPrivate) => {
|
|
197
|
+
const last = runs.at(-1);
|
|
198
|
+
if (last?.isPrivate === isPrivate)
|
|
199
|
+
last.text += text;
|
|
200
|
+
else if (text)
|
|
201
|
+
runs.push({ text, isPrivate });
|
|
202
|
+
};
|
|
203
|
+
(typeof line === 'string' ? [line] : line).forEach((part, at) => {
|
|
204
|
+
if (typeof part === 'string') {
|
|
205
|
+
add(part, false);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const when = at === 0 ? (WHEN.exec(part.private)?.[0] ?? '') : '';
|
|
209
|
+
const rest = part.private.slice(when.length);
|
|
210
|
+
const start = BLOCK_START.exec(rest)?.[1] ?? '';
|
|
211
|
+
add(`${when}${start}`, false);
|
|
212
|
+
add(rest.slice(start.length), true);
|
|
213
|
+
});
|
|
214
|
+
return runs;
|
|
215
|
+
}
|
|
216
|
+
/** A `when`'s checks, each as `name is value`. */
|
|
217
|
+
const checksOf = (when) => (when ? when.split(' and ') : []);
|
|
218
|
+
/** One condition holds one value; picking the value it already has takes it off. */
|
|
219
|
+
function withCheck(when, name, value) {
|
|
220
|
+
const check = `${name} is ${value}`;
|
|
221
|
+
const had = checksOf(when);
|
|
222
|
+
const rest = had.filter((each) => !each.startsWith(`${name} is `));
|
|
223
|
+
return (had.includes(check) ? rest : [...rest, check]).join(' and ') || null;
|
|
224
|
+
}
|
|
225
|
+
/** The `when` left once one check is off. */
|
|
226
|
+
const withoutCheck = (when, check) => checksOf(when)
|
|
227
|
+
.filter((each) => each !== check)
|
|
228
|
+
.join(' and ') || null;
|
|
229
|
+
/** Whether two markup texts hold the same prompt, however each is written. */
|
|
230
|
+
function samePrompt(a, b) {
|
|
231
|
+
if (a === b)
|
|
232
|
+
return true;
|
|
233
|
+
const left = parseSystemMarkup(a);
|
|
234
|
+
const right = parseSystemMarkup(b);
|
|
235
|
+
if (!left.ok || !right.ok)
|
|
236
|
+
return a === b;
|
|
237
|
+
return (JSON.stringify(left.lines.map(settledLine)) === JSON.stringify(right.lines.map(settledLine)));
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Why this text can't open formatted, if it can't: its markup is broken, or the document would
|
|
241
|
+
* not give the same prompt back. Those stay in the code view, where every character is the author's.
|
|
242
|
+
*/
|
|
243
|
+
function promptDocProblem(text) {
|
|
244
|
+
const parsed = parseSystemMarkup(text);
|
|
245
|
+
if (!parsed.ok)
|
|
246
|
+
return parsed.message;
|
|
247
|
+
if (samePrompt(promptMarkup(promptDoc(parsed.lines)), text))
|
|
248
|
+
return undefined;
|
|
249
|
+
return 'This prompt holds text the formatted view would change, so it stays in code.';
|
|
250
|
+
}
|
|
251
|
+
export { checksOf, openedDoc, PRIVATE_NAME, PRIVATE_ON, PROMPT_LINE, promptDoc, promptDocProblem, promptMarkup, samePrompt, withCheck, withoutCheck, };
|
package/read-source.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* come back through the same shapes that printer writes. Anything else is an
|
|
6
6
|
* error at that spot, and the draft is left alone.
|
|
7
7
|
*/
|
|
8
|
-
import { DEFAULT_ALLOW_CONTINUE, DEFAULT_AUTO_CONTINUE, liveIngressChannelDefault, } from '@theoremjs/agents';
|
|
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
10
|
import { PROFILE_GRAPH } from '@theoremjs/agents/kernel';
|
|
11
|
-
import { CONTEXT_SENDERS,
|
|
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";
|
|
@@ -293,6 +293,21 @@ function objectArg(args, src, message) {
|
|
|
293
293
|
src.fail(message);
|
|
294
294
|
return value;
|
|
295
295
|
}
|
|
296
|
+
/** Refuses, where it is written, a tool the kernel would not register. */
|
|
297
|
+
function refuseBadTool(tool, spans) {
|
|
298
|
+
try {
|
|
299
|
+
assertToolSettings({ ...tool, name: text(tool.name) });
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
if (!(error instanceof TheoremError))
|
|
303
|
+
throw error;
|
|
304
|
+
const named = spans
|
|
305
|
+
.filter((span) => new RegExp(`\\b${span.path}\\b`).test(error.message))
|
|
306
|
+
.sort((a, b) => b.path.length - a.path.length);
|
|
307
|
+
const at = named[0] ?? spans[0] ?? { line: 1, column: 1 };
|
|
308
|
+
throw new ReadFail(error.message, at.line, at.column);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
296
311
|
function registerToolCall(args, src, spans) {
|
|
297
312
|
const tool = objectArg(args, src, 'registerTool() needs the tool object.');
|
|
298
313
|
const type = tool.type;
|
|
@@ -301,6 +316,7 @@ function registerToolCall(args, src, spans) {
|
|
|
301
316
|
const at = spans.findLast((span) => span.path === 'type') ?? src.pos();
|
|
302
317
|
throw new ReadFail(STUDIO_TOOL_TYPE_MESSAGE, at.line, at.column);
|
|
303
318
|
}
|
|
319
|
+
refuseBadTool(tool, spans);
|
|
304
320
|
return { kind: 'registerTool', tool };
|
|
305
321
|
}
|
|
306
322
|
function namedCall(callee, args, src, spans) {
|
|
@@ -531,13 +547,6 @@ function parseModule(text, of = 'profile') {
|
|
|
531
547
|
function text(value, fallback = '') {
|
|
532
548
|
return typeof value === 'string' ? value : fallback;
|
|
533
549
|
}
|
|
534
|
-
function backgroundOf(value) {
|
|
535
|
-
if (value === 'always' || value === 'ask')
|
|
536
|
-
return value;
|
|
537
|
-
if (typeof value !== 'object' || value === null || !('afterMs' in value))
|
|
538
|
-
return undefined;
|
|
539
|
-
return typeof value.afterMs === 'number' ? { afterMs: value.afterMs } : undefined;
|
|
540
|
-
}
|
|
541
550
|
function whole(value) {
|
|
542
551
|
return typeof value === 'number' ? value : null;
|
|
543
552
|
}
|
|
@@ -896,7 +905,7 @@ function toolOf(spec, current, agentKeyOf) {
|
|
|
896
905
|
stubOutputJson: page ? current?.stubOutputJson : stubOf(type, spec),
|
|
897
906
|
answeredBy: page ? 'page' : undefined,
|
|
898
907
|
after: spec.after === true ? true : undefined,
|
|
899
|
-
background:
|
|
908
|
+
background: spec.background,
|
|
900
909
|
...toolRoute(spec),
|
|
901
910
|
agentKey: agentId ? agentKeyOf?.(agentId) : undefined,
|
|
902
911
|
maxCallsPerTurn: whole(spec.maxCallsPerTurn),
|
|
@@ -1238,33 +1247,16 @@ function profileTypeOf(profile) {
|
|
|
1238
1247
|
}
|
|
1239
1248
|
return type;
|
|
1240
1249
|
}
|
|
1241
|
-
/**
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
const options = fieldMeta(setting)?.options ?? [];
|
|
1247
|
-
for (const [path, value] of valuesAt(profile, setting.split('.'), [])) {
|
|
1248
|
-
if (value !== undefined && !options.includes(value)) {
|
|
1249
|
-
failAt(spans, path, `${JSON.stringify(value)} is not one of ${options.map((option) => `'${option}'`).join(', ')}.`);
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
/** Each value at `keys` in `value`, `*` standing for every key, with its path as written. */
|
|
1255
|
-
function valuesAt(value, keys, at) {
|
|
1256
|
-
const [key, ...rest] = keys;
|
|
1257
|
-
if (key === undefined)
|
|
1258
|
-
return [[at.join('.'), value]];
|
|
1259
|
-
if (!isRecord(value))
|
|
1260
|
-
return [];
|
|
1261
|
-
const next = key === '*' ? Object.keys(value) : [key];
|
|
1262
|
-
return next.flatMap((each) => valuesAt(value[each], rest, [...at, each]));
|
|
1250
|
+
/** Refuses, where it is written, a setting the kernel's catalog cannot hold. */
|
|
1251
|
+
function refuseUnheld(profile, spans) {
|
|
1252
|
+
const [problem] = profileFieldProblems(profile);
|
|
1253
|
+
if (problem)
|
|
1254
|
+
failAt(spans, problem.path, `${problem.path} ${problem.message}`);
|
|
1263
1255
|
}
|
|
1264
1256
|
function draftFrom(parsed, current, agentKeyOf) {
|
|
1265
1257
|
const profile = parsed.profile ?? {};
|
|
1266
1258
|
const type = profileTypeOf(profile);
|
|
1267
|
-
|
|
1259
|
+
refuseUnheld(profile, parsed.spans);
|
|
1268
1260
|
const byModelId = new Map(current.modelBindings.map((binding) => [binding.modelId, binding]));
|
|
1269
1261
|
const byToolName = new Map(current.toolSpecs.map((tool) => [tool.toolName, tool]));
|
|
1270
1262
|
const tools = record(profile.tools) ?? {};
|
package/section-notes.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/** What a section's title says on hover, where no one catalog field describes the section. */
|
|
2
|
+
declare const SECTION_HINTS: {
|
|
3
|
+
readonly profile: "What this profile is called, and what kind it is.";
|
|
4
|
+
readonly system: "What the model is told, and the conditions that decide which lines go out.";
|
|
5
|
+
readonly modelPolicy: "Which model runs by default, and whether it can be switched.";
|
|
6
|
+
readonly generation: "How this model writes its reply.";
|
|
7
|
+
readonly limits: "What a message may carry.";
|
|
8
|
+
readonly patterns: "Where this detector gets its patterns.";
|
|
9
|
+
readonly allow: "What this detector lets pass.";
|
|
10
|
+
readonly detector: "The detector you define: what it is called and its key.";
|
|
11
|
+
readonly contract: "What this tool takes and returns.";
|
|
12
|
+
readonly agent: "The agent this tool runs.";
|
|
13
|
+
readonly toolPolicy: "Who can call this tool, and whether it asks first.";
|
|
14
|
+
readonly connection: "How the studio reaches this provider.";
|
|
15
|
+
};
|
|
1
16
|
/**
|
|
2
17
|
* What a section of the studio's profile editor says that the catalog doc
|
|
3
18
|
* of the field it edits does not: how the editor works, and what the
|
|
@@ -7,7 +22,6 @@ declare const SECTION_NOTES: {
|
|
|
7
22
|
readonly models: "Add a model here, then select its binding in the tree to configure it.";
|
|
8
23
|
readonly 'models.decision': "A decision uses one model. Select its binding in the tree to configure it.";
|
|
9
24
|
readonly decisionModel: "This binding answers the questions configured under Decision.";
|
|
10
|
-
readonly system: "A blank line starts a new line. Wrap private text as {private: …}.";
|
|
11
25
|
readonly slots: "Each slot's picker sets what the preview sends. It is not saved in the profile.";
|
|
12
26
|
readonly context: "Preview is what the studio sends as the page. It is not saved in the profile.";
|
|
13
27
|
readonly compaction: "The studio's chat compacts only before a turn.";
|
|
@@ -31,4 +45,4 @@ declare const SECTION_NOTES: {
|
|
|
31
45
|
};
|
|
32
46
|
/** The note for `id`, each `{name}` in `fill` replaced by its value. */
|
|
33
47
|
declare function sectionNote(id: keyof typeof SECTION_NOTES, fill?: Readonly<Record<string, string>>): string;
|
|
34
|
-
export { sectionNote };
|
|
48
|
+
export { SECTION_HINTS, sectionNote };
|
package/section-notes.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/** What a section's title says on hover, where no one catalog field describes the section. */
|
|
2
|
+
const SECTION_HINTS = {
|
|
3
|
+
profile: 'What this profile is called, and what kind it is.',
|
|
4
|
+
system: 'What the model is told, and the conditions that decide which lines go out.',
|
|
5
|
+
modelPolicy: 'Which model runs by default, and whether it can be switched.',
|
|
6
|
+
generation: 'How this model writes its reply.',
|
|
7
|
+
limits: 'What a message may carry.',
|
|
8
|
+
patterns: 'Where this detector gets its patterns.',
|
|
9
|
+
allow: 'What this detector lets pass.',
|
|
10
|
+
detector: 'The detector you define: what it is called and its key.',
|
|
11
|
+
contract: 'What this tool takes and returns.',
|
|
12
|
+
agent: 'The agent this tool runs.',
|
|
13
|
+
toolPolicy: 'Who can call this tool, and whether it asks first.',
|
|
14
|
+
connection: 'How the studio reaches this provider.',
|
|
15
|
+
};
|
|
1
16
|
/**
|
|
2
17
|
* What a section of the studio's profile editor says that the catalog doc
|
|
3
18
|
* of the field it edits does not: how the editor works, and what the
|
|
@@ -7,7 +22,6 @@ const SECTION_NOTES = {
|
|
|
7
22
|
models: 'Add a model here, then select its binding in the tree to configure it.',
|
|
8
23
|
'models.decision': 'A decision uses one model. Select its binding in the tree to configure it.',
|
|
9
24
|
decisionModel: 'This binding answers the questions configured under Decision.',
|
|
10
|
-
system: 'A blank line starts a new line. Wrap private text as {private: …}.',
|
|
11
25
|
slots: "Each slot's picker sets what the preview sends. It is not saved in the profile.",
|
|
12
26
|
context: 'Preview is what the studio sends as the page. It is not saved in the profile.',
|
|
13
27
|
compaction: "The studio's chat compacts only before a turn.",
|
|
@@ -36,4 +50,4 @@ function sectionNote(id, fill = {}) {
|
|
|
36
50
|
note = note.replaceAll(`{${name}}`, value);
|
|
37
51
|
return note;
|
|
38
52
|
}
|
|
39
|
-
export { sectionNote };
|
|
53
|
+
export { SECTION_HINTS, sectionNote };
|
package/server/runs.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runs that are going on in the project's loads: turns and voice calls, while the page is
|
|
3
|
+
* joined to them. A load holds its runs in memory, so it is not replaced under one.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
export interface Runs {
|
|
8
|
+
/** Counts a run from now on. Answers how to end it: more than once is the same as once. */
|
|
9
|
+
begin(): () => void;
|
|
10
|
+
busy(): boolean;
|
|
11
|
+
/** Calls `then` when no run is going on: now, or in the same tick as the last one ends. */
|
|
12
|
+
whenIdle(then: () => void): void;
|
|
13
|
+
}
|
|
14
|
+
/** Keeps count of the runs. `idle` is called each time the last one ends. */
|
|
15
|
+
export declare function createRuns(idle: () => void): Runs;
|
|
16
|
+
/** `response` as it was, with `end` called when its body is read to the end, fails or is dropped. */
|
|
17
|
+
export declare function untilRead(response: Response, end: () => void): Response;
|