@theoremjs/studio 0.0.0-stage → 0.3.2
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/LICENSE +21 -0
- package/README.md +295 -2
- package/agreement.d.ts +14 -0
- package/agreement.js +80 -0
- package/asks.d.ts +47 -0
- package/asks.js +54 -0
- package/browser-connection.d.ts +49 -0
- package/browser-connection.js +215 -0
- package/browser-engine.d.ts +11 -0
- package/browser-engine.js +11 -0
- package/browser-execution.d.ts +6 -0
- package/browser-execution.js +18 -0
- package/browser-live.d.ts +4 -0
- package/browser-live.js +132 -0
- package/browser-transport.d.ts +33 -0
- package/browser-transport.js +229 -0
- package/browser.d.ts +4 -0
- package/browser.js +4 -0
- package/canonical.d.ts +10 -0
- package/canonical.js +25 -0
- package/compile-workspace.d.ts +28 -0
- package/compile-workspace.js +295 -0
- package/compile.d.ts +65 -0
- package/compile.js +1605 -0
- package/concierge-demo.d.ts +17 -0
- package/concierge-demo.js +1230 -0
- package/conversation-key.d.ts +5 -0
- package/conversation-key.js +10 -0
- package/decision-example-images.d.ts +30 -0
- package/decision-example-images.js +30 -0
- package/deno.json +3 -0
- package/draft.d.ts +407 -0
- package/draft.js +505 -0
- package/editors.d.ts +29 -0
- package/editors.js +51 -0
- package/example-embedding-files.d.ts +11 -0
- package/example-embedding-files.js +20 -0
- package/example.d.ts +36 -0
- package/example.js +357 -0
- package/guardrail-probe.d.ts +100 -0
- package/guardrail-probe.js +722 -0
- package/held-credentials.d.ts +28 -0
- package/held-credentials.js +87 -0
- package/installed.mjs +40 -0
- package/lent-keys.d.ts +122 -0
- package/lent-keys.js +47 -0
- package/line-diff.d.ts +15 -0
- package/line-diff.js +41 -0
- package/live-connection.d.ts +22 -0
- package/live-connection.js +27 -0
- package/live-session-bridge.d.ts +15 -0
- package/live-session-bridge.js +202 -0
- package/map-line.d.ts +19 -0
- package/map-line.js +42 -0
- package/map.d.ts +154 -0
- package/map.js +525 -0
- package/media-accept.d.ts +19 -0
- package/media-accept.js +65 -0
- package/mod.d.ts +39 -0
- package/mod.js +33 -0
- package/origins.d.ts +52 -0
- package/origins.js +165 -0
- package/package.json +85 -4
- package/page/assets/Banner-BISz3nXA.js +2 -0
- package/page/assets/BottomSheet-BwfBDtje.js +1 -0
- package/page/assets/Card-Lp-0P5eL.js +1 -0
- package/page/assets/CardWall-CBRLdDZW.js +1 -0
- package/page/assets/Center-nHS1JSux.js +1 -0
- package/page/assets/CheckboxInput-Cj5pk-KI.js +2 -0
- package/page/assets/CodeBlock-C7XJ4ioE.js +51 -0
- package/page/assets/CollapsibleGroup-N7_SOjbm.js +2 -0
- package/page/assets/ContextMenu-CBu9H-9H.js +2 -0
- package/page/assets/DateInput-BGrQ5tPC.js +1 -0
- package/page/assets/Dialog-DELWQo-v.js +1 -0
- package/page/assets/EmptyState-C8W4JKBZ.js +1 -0
- package/page/assets/HoverCard-D1Y1ltWQ.js +1 -0
- package/page/assets/Icon-JrysT8aU.js +3 -0
- package/page/assets/IconAlertTriangle-BqAEqqdU.js +1 -0
- package/page/assets/IconButton-DlOGzJIX.js +1 -0
- package/page/assets/IconEye-BB5aY-wQ.js +1 -0
- package/page/assets/IconFileText-6zOFKKrF.js +1 -0
- package/page/assets/IconSearch-BTx66a40.js +1 -0
- package/page/assets/IconShield-DDOh7Gr5.js +1 -0
- package/page/assets/ItemSwipeLayer-Ckn4X6h9.js +1 -0
- package/page/assets/PaneState-BvA2tLQg.js +1 -0
- package/page/assets/PaneState-eUzUkNE8.css +1 -0
- package/page/assets/ScrollableArea-Ckugdj1N.js +1 -0
- package/page/assets/Section-DJ97F7QE.js +1 -0
- package/page/assets/SegmentedControlItem-h-aaXzyS.js +1 -0
- package/page/assets/SidePanel-BL32abk8.js +1 -0
- package/page/assets/StackItem-CQviqAfM.js +1 -0
- package/page/assets/Text-bum6zWWx.js +2 -0
- package/page/assets/TimestampHoverCard-DQIG0RZF.js +1 -0
- package/page/assets/ToolResultCharts-CgshSv9Q.js +1 -0
- package/page/assets/Tooltip-BH9xiRMl.js +1 -0
- package/page/assets/TraceInspector-_yZiz05W.js +1 -0
- package/page/assets/TraceOverview-BPO-HIYK.js +57 -0
- package/page/assets/VStack-CkVMcNiK.js +1 -0
- package/page/assets/_virtual_studio-type-sources-ByxqQaOG.js +12936 -0
- package/page/assets/arrive-DvbqpeRS.js +1 -0
- package/page/assets/browser-engine-CYq9DQAM.js +9 -0
- package/page/assets/browser-transport-D-2jDYe7.js +47 -0
- package/page/assets/codicon-DF1abBS2.ttf +0 -0
- package/page/assets/compile-egress-BSxOdX4K.js +23 -0
- package/page/assets/container.stylex-BmOi-8DQ.js +1 -0
- package/page/assets/createReactComponent-CZwsv6DD.js +1 -0
- package/page/assets/decision-example-images-CZGr7YIT.js +1 -0
- package/page/assets/devWarning-DxuplmRl.js +1 -0
- package/page/assets/editor-DjpsE8to.css +1 -0
- package/page/assets/editor.api-Cd3ViPQa.js +908 -0
- package/page/assets/editor.worker-6GY8RhDc.js +1 -0
- package/page/assets/editor.worker-BmdWdrHZ.js +33 -0
- package/page/assets/editors-BJX_S59A.js +1 -0
- package/page/assets/egress-automata-B5ZGE1mT.js +1 -0
- package/page/assets/embedding-space-view-CfQBPDxD.js +140 -0
- package/page/assets/encode-files-Bc3HJyAh.js +1 -0
- package/page/assets/export-agent-C3yyzXH8.js +43 -0
- package/page/assets/figtree-latin-400-normal-BD4aNku5.woff +0 -0
- package/page/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
- package/page/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
- package/page/assets/figtree-latin-500-normal-B_yy1phn.woff +0 -0
- package/page/assets/figtree-latin-600-normal-BM_oTo4n.woff +0 -0
- package/page/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
- package/page/assets/figtree-latin-700-normal-BCCt2T1q.woff +0 -0
- package/page/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
- package/page/assets/focusOutline.stylex-BT0kfa4t.js +1 -0
- package/page/assets/focusableSelector-DXZeMU85.js +1 -0
- package/page/assets/groupStyles-C7Ter7zC.js +1 -0
- package/page/assets/guardrail-tester-Gut5xK4a.js +9 -0
- package/page/assets/host-patterns-C9RMP16Q.js +1 -0
- package/page/assets/index-CvvmFKgS.js +105 -0
- package/page/assets/index-DOaHlqBo.css +1 -0
- package/page/assets/isRtlElement-BG33-k_H.js +1 -0
- package/page/assets/labels-provider-4TIWDvsE.js +3 -0
- package/page/assets/lent-keys-C32ems-I.js +1 -0
- package/page/assets/live-ingress-lDUGPwth.js +1 -0
- package/page/assets/live-messages-CnkL4GWi.js +1 -0
- package/page/assets/mergeProps-ptS-gIMz.js +1 -0
- package/page/assets/padding.stylex-B76907Zf.js +1 -0
- package/page/assets/preload-helper-DpV6A1kQ.js +1 -0
- package/page/assets/reader-BOCCYaRp.js +7 -0
- package/page/assets/register-CDgivxvX.js +2 -0
- package/page/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/page/assets/schemas-BQ9Jydzb.js +56 -0
- package/page/assets/shaped-data-BcarWqd5.js +16 -0
- package/page/assets/sharedResizeObserver-4U9Xq5Oq.js +1 -0
- package/page/assets/stub-DhdcU_Ew.js +471 -0
- package/page/assets/studio-code-pane-C_SAbcOa.js +8 -0
- package/page/assets/studio-console-DZwlEsvr.js +3 -0
- package/page/assets/studio-decision-B0FnCAXA.js +1 -0
- package/page/assets/studio-embedding-CmA51HVo.js +2 -0
- package/page/assets/studio-host-console-By7hqu2l.js +2 -0
- package/page/assets/studio-live-BrcVQcyV.js +1 -0
- package/page/assets/studio-map-B_xSia-z.js +1 -0
- package/page/assets/studio-map-Bb06Tw1F.css +1 -0
- package/page/assets/studio-monaco-CbKf90i6.css +1 -0
- package/page/assets/studio-monaco-xfyfezQS.js +34 -0
- package/page/assets/studio-ts.worker-B-EXG4Sv.js +67741 -0
- package/page/assets/studio-ts.worker-BXtW3z-O.js +1 -0
- package/page/assets/studio-type-checker-BOvxudki.js +23 -0
- package/page/assets/themeProps-3IqahpCr.js +1 -0
- package/page/assets/tokens.stylex-DkHf0P9C.js +1 -0
- package/page/assets/tool-schema-idaOe2nI.js +18 -0
- package/page/assets/trace-patterns-DnYJa0nI.js +1 -0
- package/page/assets/trace-record-C3zNksA_.js +1 -0
- package/page/assets/trace-schema-9CdEyG6Q.js +1 -0
- package/page/assets/tree-DqyAMsbI.js +3 -0
- package/page/assets/turn-client-Du3Um3Mg.js +2 -0
- package/page/assets/types-BhfXQCLx.js +1 -0
- package/page/assets/typescript-20GgZ8PJ.js +1 -0
- package/page/assets/use-one-call-Hcs8YBp1.js +1 -0
- package/page/assets/useAdaptivePresentation-BzmPCddb.js +1 -0
- package/page/assets/useClipboard-BgGRxRMJ.js +1 -0
- package/page/assets/useContainerReveal-BFy8N_QU.js +1 -0
- package/page/assets/useDevWarning-Z9SoixOP.js +1 -0
- package/page/assets/useLayerDismissal-B_G7IWpC.js +1 -0
- package/page/assets/useMediaQuery-BCT0NUeZ.js +1 -0
- package/page/assets/useScrollLock-Dyf6PHJt.js +1 -0
- package/page/assets/useScrollableArea-0NzdiBCq.js +1 -0
- package/page/assets/useTooltip-CJM_xhLB.js +1 -0
- package/page/assets/workspace-DZALqEDX.js +1 -0
- package/page/assets/zip-DTcEfps6.js +1 -0
- package/page/index.html +90 -0
- package/page.mjs +49 -0
- package/people.d.ts +87 -0
- package/people.js +110 -0
- package/policy.d.ts +43 -0
- package/policy.js +102 -0
- package/ports.d.mts +32 -0
- package/ports.mjs +85 -0
- package/probe-battery.d.ts +13 -0
- package/probe-battery.js +404 -0
- package/providers.d.ts +149 -0
- package/providers.js +306 -0
- package/read-source.d.ts +48 -0
- package/read-source.js +1301 -0
- package/read-steps.d.ts +23 -0
- package/read-steps.js +2 -0
- package/reader.d.ts +11 -0
- package/reader.js +11 -0
- package/registrations.d.ts +83 -0
- package/registrations.js +1 -0
- package/requirements.d.ts +22 -0
- package/requirements.js +38 -0
- package/run-payload-core.d.ts +28 -0
- package/run-payload-core.js +123 -0
- package/run-payload.d.ts +32 -0
- package/run-payload.js +26 -0
- package/runtime-scope.d.ts +84 -0
- package/runtime-scope.js +308 -0
- package/runtime.d.ts +84 -0
- package/runtime.js +387 -0
- package/section-notes.d.ts +33 -0
- package/section-notes.js +38 -0
- package/serve-page.mjs +96 -0
- package/server/draft-decide.d.ts +72 -0
- package/server/draft-decide.js +111 -0
- package/server/draft-embedding.d.ts +3 -0
- package/server/draft-embedding.js +35 -0
- package/server/draft-handler.d.ts +82 -0
- package/server/draft-handler.js +213 -0
- package/server/draft-probe.d.ts +14 -0
- package/server/draft-probe.js +61 -0
- package/server/draft-replies.d.ts +22 -0
- package/server/draft-replies.js +46 -0
- package/server/edited-session.d.ts +28 -0
- package/server/edited-session.js +83 -0
- package/server/edits.d.ts +38 -0
- package/server/edits.js +195 -0
- package/server/handler.d.ts +133 -0
- package/server/handler.js +598 -0
- package/server/lent-draft.d.ts +19 -0
- package/server/lent-draft.js +23 -0
- package/server/live.d.ts +15 -0
- package/server/live.js +96 -0
- package/server/open-editor.d.ts +63 -0
- package/server/open-editor.js +115 -0
- package/server/origins.d.ts +18 -0
- package/server/origins.js +330 -0
- package/server/project-source.d.ts +208 -0
- package/server/project-source.js +1042 -0
- package/server/project.d.ts +22 -0
- package/server/project.js +56 -0
- package/server/run-traces.d.ts +20 -0
- package/server/run-traces.js +96 -0
- package/server/save-new.d.ts +29 -0
- package/server/save-new.js +514 -0
- package/server/save-plan.d.ts +46 -0
- package/server/save-plan.js +1134 -0
- package/server/save-remove.d.ts +21 -0
- package/server/save-remove.js +528 -0
- package/server/save-session.d.ts +96 -0
- package/server/save-session.js +418 -0
- package/server/save-wire.d.ts +235 -0
- package/server/save-wire.js +8 -0
- package/server/save.d.ts +52 -0
- package/server/save.js +209 -0
- package/server/serve.d.ts +23 -0
- package/server/serve.js +413 -0
- package/server/test-connection.d.ts +17 -0
- package/server/test-connection.js +362 -0
- package/server/test-key.d.ts +2 -0
- package/server/test-key.js +83 -0
- package/server/watch.d.ts +28 -0
- package/server/watch.js +93 -0
- package/server/zod-edit.d.ts +74 -0
- package/server/zod-edit.js +558 -0
- package/server.d.ts +8 -0
- package/server.js +8 -0
- package/setups.mjs +170 -0
- package/shared-carry.d.ts +114 -0
- package/shared-carry.js +523 -0
- package/shared-settings.d.ts +34 -0
- package/shared-settings.js +70 -0
- package/source.d.ts +75 -0
- package/source.js +414 -0
- package/start.mjs +169 -0
- package/stream-lines.d.ts +9 -0
- package/stream-lines.js +27 -0
- package/stub.d.ts +6 -0
- package/stub.js +33 -0
- package/surface.d.ts +53 -0
- package/surface.js +631 -0
- package/system-markup.d.ts +20 -0
- package/system-markup.js +51 -0
- package/tool-schema.d.ts +23 -0
- package/tool-schema.js +69 -0
- package/tools.d.ts +16 -0
- package/tools.js +91 -0
- package/traces.d.ts +24 -0
- package/traces.js +29 -0
- package/transport.d.ts +57 -0
- package/transport.js +187 -0
- package/tree.d.ts +32 -0
- package/tree.js +83 -0
- package/types.d.ts +62 -0
- package/types.js +6 -0
- package/ui/acting-as-button.d.ts +2 -0
- package/ui/acting-as-button.js +16 -0
- package/ui/add-provider.d.ts +13 -0
- package/ui/add-provider.js +20 -0
- package/ui/boot-mark.css +53 -0
- package/ui/boot-mark.d.ts +19 -0
- package/ui/boot-mark.js +128 -0
- package/ui/boot-paint.d.ts +8 -0
- package/ui/boot-paint.js +8 -0
- package/ui/brand-icons.d.ts +57 -0
- package/ui/brand-icons.js +148 -0
- package/ui/built/theme.css +830 -0
- package/ui/built/theme.css.d.ts +9 -0
- package/ui/built/theorem-studio.d.ts +13 -0
- package/ui/built/theorem-studio.js +705 -0
- package/ui/built/theorem-studio.variants.d.ts +28 -0
- package/ui/code/monaco-contributions.d.ts +45 -0
- package/ui/code/studio-code.d.ts +7 -0
- package/ui/code/studio-code.js +253 -0
- package/ui/code/studio-monaco.d.ts +44 -0
- package/ui/code/studio-monaco.js +48 -0
- package/ui/code/studio-ts.worker.d.ts +1 -0
- package/ui/code/studio-ts.worker.js +16 -0
- package/ui/code/studio-type-checker.d.ts +12 -0
- package/ui/code/studio-type-checker.js +308 -0
- package/ui/code/studio-type-sources.d.ts +26 -0
- package/ui/confirm-write.d.ts +12 -0
- package/ui/confirm-write.js +45 -0
- package/ui/diff-block.d.ts +21 -0
- package/ui/diff-block.js +17 -0
- package/ui/figtree.css +59 -0
- package/ui/file-place.d.ts +4 -0
- package/ui/file-place.js +26 -0
- package/ui/guardrail-tester.d.ts +18 -0
- package/ui/guardrail-tester.js +248 -0
- package/ui/inspector-context.d.ts +119 -0
- package/ui/inspector-context.js +84 -0
- package/ui/inspector.d.ts +247 -0
- package/ui/inspector.js +284 -0
- package/ui/lib/acting-as.d.ts +25 -0
- package/ui/lib/acting-as.js +90 -0
- package/ui/lib/boot-sequence.d.ts +32 -0
- package/ui/lib/boot-sequence.js +57 -0
- package/ui/lib/export-agent.d.ts +11 -0
- package/ui/lib/export-agent.js +335 -0
- package/ui/lib/facet-icons.d.ts +20 -0
- package/ui/lib/facet-icons.js +21 -0
- package/ui/lib/panel-motion.d.ts +8 -0
- package/ui/lib/panel-motion.js +74 -0
- package/ui/lib/project-address.d.ts +14 -0
- package/ui/lib/project-address.js +24 -0
- package/ui/lib/project-starting.d.ts +13 -0
- package/ui/lib/project-starting.js +30 -0
- package/ui/lib/project-traces.d.ts +17 -0
- package/ui/lib/project-traces.js +54 -0
- package/ui/lib/read-map.d.ts +30 -0
- package/ui/lib/read-map.js +173 -0
- package/ui/lib/read-progress.d.ts +14 -0
- package/ui/lib/read-progress.js +12 -0
- package/ui/lib/refusal-lines.d.ts +3 -0
- package/ui/lib/refusal-lines.js +8 -0
- package/ui/lib/studio-activity.d.ts +5 -0
- package/ui/lib/studio-activity.js +17 -0
- package/ui/lib/studio-console.d.ts +27 -0
- package/ui/lib/studio-console.js +9 -0
- package/ui/lib/studio-conversation.d.ts +20 -0
- package/ui/lib/studio-conversation.js +130 -0
- package/ui/lib/studio-examples.d.ts +31 -0
- package/ui/lib/studio-examples.js +25 -0
- package/ui/lib/studio-labels.d.ts +6 -0
- package/ui/lib/studio-labels.js +13 -0
- package/ui/lib/studio-map-kept.d.ts +17 -0
- package/ui/lib/studio-map-kept.js +48 -0
- package/ui/lib/studio-open.d.ts +22 -0
- package/ui/lib/studio-open.js +54 -0
- package/ui/lib/studio-page.d.ts +33 -0
- package/ui/lib/studio-page.js +121 -0
- package/ui/lib/studio-prefs.d.ts +26 -0
- package/ui/lib/studio-prefs.js +87 -0
- package/ui/lib/studio-project.d.ts +106 -0
- package/ui/lib/studio-project.js +177 -0
- package/ui/lib/studio-restore.d.ts +49 -0
- package/ui/lib/studio-restore.js +251 -0
- package/ui/lib/studio-run-open.d.ts +15 -0
- package/ui/lib/studio-run-open.js +16 -0
- package/ui/lib/studio-session.d.ts +34 -0
- package/ui/lib/studio-session.js +17 -0
- package/ui/lib/studio-settings.d.ts +15 -0
- package/ui/lib/studio-settings.js +48 -0
- package/ui/lib/studio-store.d.ts +64 -0
- package/ui/lib/studio-store.js +391 -0
- package/ui/lib/studio-watch.d.ts +12 -0
- package/ui/lib/studio-watch.js +27 -0
- package/ui/lib/tab-fills.d.ts +6 -0
- package/ui/lib/tab-fills.js +14 -0
- package/ui/lib/tool-credentials.d.ts +3 -0
- package/ui/lib/tool-credentials.js +23 -0
- package/ui/lib/tool-probe.d.ts +19 -0
- package/ui/lib/tool-probe.js +104 -0
- package/ui/lib/type-icons.d.ts +35 -0
- package/ui/lib/type-icons.js +38 -0
- package/ui/lib/when-idle.d.ts +5 -0
- package/ui/lib/when-idle.js +14 -0
- package/ui/lib/zip.d.ts +5 -0
- package/ui/lib/zip.js +8 -0
- package/ui/map-token.css +11 -0
- package/ui/map-token.d.ts +17 -0
- package/ui/map-token.js +29 -0
- package/ui/mcp-icon.d.ts +6 -0
- package/ui/mcp-icon.js +8 -0
- package/ui/motion.css +113 -0
- package/ui/pan.d.ts +32 -0
- package/ui/pan.js +90 -0
- package/ui/profile-editor.d.ts +33 -0
- package/ui/profile-editor.js +2638 -0
- package/ui/provider-editor.d.ts +15 -0
- package/ui/provider-editor.js +92 -0
- package/ui/read-map.css +48 -0
- package/ui/read-map.d.ts +7 -0
- package/ui/read-map.js +163 -0
- package/ui/refusal-detail.d.ts +4 -0
- package/ui/refusal-detail.js +21 -0
- package/ui/shared-change.d.ts +9 -0
- package/ui/shared-change.js +28 -0
- package/ui/shell-motion.css +121 -0
- package/ui/shell-motion.d.ts +73 -0
- package/ui/shell-motion.js +194 -0
- package/ui/studio-code-pane.d.ts +19 -0
- package/ui/studio-code-pane.js +44 -0
- package/ui/studio-compare.d.ts +80 -0
- package/ui/studio-compare.js +326 -0
- package/ui/studio-conflicts.d.ts +17 -0
- package/ui/studio-conflicts.js +87 -0
- package/ui/studio-connection.d.ts +64 -0
- package/ui/studio-connection.js +286 -0
- package/ui/studio-decision.d.ts +6 -0
- package/ui/studio-decision.js +49 -0
- package/ui/studio-embedding.d.ts +6 -0
- package/ui/studio-embedding.js +30 -0
- package/ui/studio-host-console.d.ts +6 -0
- package/ui/studio-host-console.js +17 -0
- package/ui/studio-host.d.ts +73 -0
- package/ui/studio-host.js +12 -0
- package/ui/studio-live.d.ts +17 -0
- package/ui/studio-live.js +26 -0
- package/ui/studio-map.css +273 -0
- package/ui/studio-map.d.ts +17 -0
- package/ui/studio-map.js +397 -0
- package/ui/studio-nav.d.ts +24 -0
- package/ui/studio-nav.js +17 -0
- package/ui/studio-no-project.d.ts +5 -0
- package/ui/studio-no-project.js +9 -0
- package/ui/studio-run.css +76 -0
- package/ui/studio-run.d.ts +14 -0
- package/ui/studio-run.js +119 -0
- package/ui/studio-runner.d.ts +45 -0
- package/ui/studio-runner.js +187 -0
- package/ui/studio-save.d.ts +49 -0
- package/ui/studio-save.js +307 -0
- package/ui/studio-screen.d.ts +61 -0
- package/ui/studio-screen.js +2078 -0
- package/ui/studio-settings.d.ts +31 -0
- package/ui/studio-settings.js +288 -0
- package/ui/studio-shell.css +27 -0
- package/ui/studio-shell.d.ts +43 -0
- package/ui/studio-shell.js +87 -0
- package/ui/studio-theme.d.ts +7 -0
- package/ui/studio-theme.js +94 -0
- package/ui/studio.css +427 -0
- package/ui/theorem-mark.css +84 -0
- package/ui/theorem-mark.d.ts +22 -0
- package/ui/theorem-mark.js +21 -0
- package/vite.d.mts +30 -0
- package/vite.mjs +277 -0
- package/workspace.d.ts +230 -0
- package/workspace.js +1054 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Globals the package declarations mention. `lib.esnext.full` pulls in the DOM
|
|
3
|
+
* library, which is about 1.9MB of types, so the checker loads `es2022` and
|
|
4
|
+
* this file instead.
|
|
5
|
+
*/
|
|
6
|
+
const HOST_LIB = `interface AbortSignal {
|
|
7
|
+
readonly aborted: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface Headers {}
|
|
10
|
+
interface Request {}
|
|
11
|
+
interface RequestInit {
|
|
12
|
+
method?: string;
|
|
13
|
+
headers?: Headers;
|
|
14
|
+
body?: unknown;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}
|
|
17
|
+
interface Response {
|
|
18
|
+
ok: boolean;
|
|
19
|
+
status: number;
|
|
20
|
+
}
|
|
21
|
+
interface WebSocket {
|
|
22
|
+
close(code?: number, reason?: string): void;
|
|
23
|
+
}
|
|
24
|
+
interface URL {
|
|
25
|
+
href: string;
|
|
26
|
+
}
|
|
27
|
+
declare function fetch(input: string | URL | Request, init?: RequestInit): Promise<Response>;
|
|
28
|
+
`;
|
|
29
|
+
/** Package types for the open file. Call `stop` to terminate the worker. */
|
|
30
|
+
export function openTypeChecker(monaco, codeEditor, onReady) {
|
|
31
|
+
let stopped = false;
|
|
32
|
+
const isStopped = () => stopped;
|
|
33
|
+
const disposables = [];
|
|
34
|
+
const track = (value) => {
|
|
35
|
+
if (stopped)
|
|
36
|
+
value.dispose();
|
|
37
|
+
else
|
|
38
|
+
disposables.push(value);
|
|
39
|
+
return value;
|
|
40
|
+
};
|
|
41
|
+
void boot();
|
|
42
|
+
return {
|
|
43
|
+
stop() {
|
|
44
|
+
if (isStopped())
|
|
45
|
+
return;
|
|
46
|
+
stopped = true;
|
|
47
|
+
for (const item of disposables)
|
|
48
|
+
item.dispose();
|
|
49
|
+
disposables.length = 0;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
async function boot() {
|
|
53
|
+
const [{ default: TsWorker }, { typeSources }] = await Promise.all([
|
|
54
|
+
import('./studio-ts.worker?worker'),
|
|
55
|
+
import('virtual:studio-type-sources'),
|
|
56
|
+
]);
|
|
57
|
+
const model = codeEditor.getModel();
|
|
58
|
+
if (stopped || !model)
|
|
59
|
+
return;
|
|
60
|
+
const libs = { 'lib.host.d.ts': HOST_LIB, ...typeSources };
|
|
61
|
+
const extraLibs = {};
|
|
62
|
+
for (const [file, content] of Object.entries(libs)) {
|
|
63
|
+
extraLibs[file] = { content, version: 1 };
|
|
64
|
+
}
|
|
65
|
+
const client = track(monaco.editor.createWebWorker({
|
|
66
|
+
// The first message only wakes the worker. The second is its compiler options.
|
|
67
|
+
worker: Promise.resolve(new TsWorker()).then((worker) => {
|
|
68
|
+
worker.postMessage('ignore');
|
|
69
|
+
worker.postMessage({
|
|
70
|
+
compilerOptions: {
|
|
71
|
+
allowNonTsExtensions: true,
|
|
72
|
+
// ESNext selects `lib.esnext.full.d.ts`, which includes the DOM library.
|
|
73
|
+
target: 7,
|
|
74
|
+
lib: ['es2022', 'host'],
|
|
75
|
+
module: 99,
|
|
76
|
+
// Bundler. The public enum only lists Classic and NodeJs.
|
|
77
|
+
moduleResolution: 100,
|
|
78
|
+
strict: true,
|
|
79
|
+
noEmit: true,
|
|
80
|
+
skipLibCheck: true,
|
|
81
|
+
allowImportingTsExtensions: true,
|
|
82
|
+
paths: {
|
|
83
|
+
'@theoremjs/agents': ['file:///node_modules/@theoremjs/agents/mod.d.ts'],
|
|
84
|
+
'@theoremjs/agents/guardrails/compile': [
|
|
85
|
+
'file:///node_modules/@theoremjs/agents/src/guardrails/compile-egress.d.ts',
|
|
86
|
+
],
|
|
87
|
+
zod: ['file:///node_modules/zod/index.d.ts'],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
extraLibs,
|
|
91
|
+
inlayHintsOptions: {},
|
|
92
|
+
});
|
|
93
|
+
return worker;
|
|
94
|
+
}),
|
|
95
|
+
keepIdleModels: true,
|
|
96
|
+
}));
|
|
97
|
+
if (isStopped())
|
|
98
|
+
return;
|
|
99
|
+
const proxy = () => client.withSyncedResources([model.uri]);
|
|
100
|
+
const { languages } = monaco;
|
|
101
|
+
track(languages.registerCompletionItemProvider('typescript', {
|
|
102
|
+
triggerCharacters: ['.'],
|
|
103
|
+
provideCompletionItems: (textModel, position) => completions(languages, proxy, textModel, position),
|
|
104
|
+
resolveCompletionItem: (item) => resolveCompletion(languages, proxy, item),
|
|
105
|
+
}));
|
|
106
|
+
track(languages.registerHoverProvider('typescript', {
|
|
107
|
+
provideHover: (textModel, position) => hover(proxy, textModel, position),
|
|
108
|
+
}));
|
|
109
|
+
track(languages.registerSignatureHelpProvider('typescript', {
|
|
110
|
+
signatureHelpTriggerCharacters: ['(', ','],
|
|
111
|
+
provideSignatureHelp: (textModel, position) => signatureHelp(proxy, textModel, position),
|
|
112
|
+
}));
|
|
113
|
+
track(languages.registerDefinitionProvider('typescript', {
|
|
114
|
+
provideDefinition: (textModel, position) => definition(monaco, libs, track, proxy, textModel, position),
|
|
115
|
+
}));
|
|
116
|
+
if (isStopped())
|
|
117
|
+
return;
|
|
118
|
+
if (codeEditor.hasTextFocus()) {
|
|
119
|
+
codeEditor.trigger('studio', 'editor.action.triggerSuggest', {});
|
|
120
|
+
}
|
|
121
|
+
onReady();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async function completions(languages, proxy, model, position) {
|
|
125
|
+
try {
|
|
126
|
+
const word = model.getWordUntilPosition(position);
|
|
127
|
+
const offset = model.getOffsetAt(position);
|
|
128
|
+
const info = await (await proxy()).getCompletionsAtPosition(model.uri.toString(), offset);
|
|
129
|
+
if (!info)
|
|
130
|
+
return;
|
|
131
|
+
const suggestions = info.entries.map((entry) => {
|
|
132
|
+
const range = entry.replacementSpan
|
|
133
|
+
? spanToRange(model, entry.replacementSpan)
|
|
134
|
+
: {
|
|
135
|
+
startLineNumber: position.lineNumber,
|
|
136
|
+
startColumn: word.startColumn,
|
|
137
|
+
endLineNumber: position.lineNumber,
|
|
138
|
+
endColumn: word.endColumn,
|
|
139
|
+
};
|
|
140
|
+
const carry = { uri: model.uri, position, offset };
|
|
141
|
+
return {
|
|
142
|
+
...carry,
|
|
143
|
+
label: entry.name,
|
|
144
|
+
insertText: entry.name,
|
|
145
|
+
sortText: entry.sortText,
|
|
146
|
+
kind: completionKind(languages, entry.kind),
|
|
147
|
+
range,
|
|
148
|
+
tags: entry.kindModifiers?.includes('deprecated') === true
|
|
149
|
+
? [languages.CompletionItemTag.Deprecated]
|
|
150
|
+
: [],
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
return { suggestions };
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async function resolveCompletion(languages, proxy, item) {
|
|
160
|
+
const carry = item;
|
|
161
|
+
if (!carry.uri || !carry.position || carry.offset === undefined)
|
|
162
|
+
return item;
|
|
163
|
+
try {
|
|
164
|
+
const details = await (await proxy()).getCompletionEntryDetails(carry.uri.toString(), carry.offset, item.label);
|
|
165
|
+
if (!details)
|
|
166
|
+
return item;
|
|
167
|
+
return {
|
|
168
|
+
...item,
|
|
169
|
+
detail: parts(details.displayParts),
|
|
170
|
+
documentation: { value: documentation(details) },
|
|
171
|
+
kind: completionKind(languages, details.kind),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return item;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async function hover(proxy, model, position) {
|
|
179
|
+
try {
|
|
180
|
+
const info = await (await proxy()).getQuickInfoAtPosition(model.uri.toString(), model.getOffsetAt(position));
|
|
181
|
+
if (!info)
|
|
182
|
+
return;
|
|
183
|
+
const docs = documentation(info);
|
|
184
|
+
return {
|
|
185
|
+
range: spanToRange(model, info.textSpan),
|
|
186
|
+
contents: [
|
|
187
|
+
{ value: `\`\`\`typescript\n${parts(info.displayParts)}\n\`\`\`` },
|
|
188
|
+
...(docs ? [{ value: docs }] : []),
|
|
189
|
+
],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async function signatureHelp(proxy, model, position) {
|
|
197
|
+
try {
|
|
198
|
+
const info = await (await proxy()).getSignatureHelpItems(model.uri.toString(), model.getOffsetAt(position), {
|
|
199
|
+
triggerReason: { kind: 'invoked' },
|
|
200
|
+
});
|
|
201
|
+
if (!info)
|
|
202
|
+
return;
|
|
203
|
+
return {
|
|
204
|
+
value: {
|
|
205
|
+
activeSignature: info.selectedItemIndex,
|
|
206
|
+
activeParameter: info.argumentIndex,
|
|
207
|
+
signatures: info.items.map((item) => {
|
|
208
|
+
let label = parts(item.prefixDisplayParts);
|
|
209
|
+
const parameters = item.parameters.map((parameter, index) => {
|
|
210
|
+
const name = parts(parameter.displayParts);
|
|
211
|
+
label += name;
|
|
212
|
+
if (index < item.parameters.length - 1)
|
|
213
|
+
label += parts(item.separatorDisplayParts);
|
|
214
|
+
return {
|
|
215
|
+
label: name,
|
|
216
|
+
documentation: { value: parts(parameter.documentation) },
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
label += parts(item.suffixDisplayParts);
|
|
220
|
+
return { label, parameters, documentation: { value: parts(item.documentation) } };
|
|
221
|
+
}),
|
|
222
|
+
},
|
|
223
|
+
dispose() { },
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
async function definition(monaco, libs, track, proxy, model, position) {
|
|
231
|
+
try {
|
|
232
|
+
const entries = await (await proxy()).getDefinitionAtPosition(model.uri.toString(), model.getOffsetAt(position));
|
|
233
|
+
if (!entries)
|
|
234
|
+
return;
|
|
235
|
+
const locations = [];
|
|
236
|
+
for (const entry of entries) {
|
|
237
|
+
const target = modelFor(monaco, libs, track, entry.fileName);
|
|
238
|
+
if (!target)
|
|
239
|
+
continue;
|
|
240
|
+
locations.push({ uri: target.uri, range: spanToRange(target, entry.textSpan) });
|
|
241
|
+
}
|
|
242
|
+
return locations;
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function modelFor(monaco, libs, track, fileName) {
|
|
249
|
+
let uri;
|
|
250
|
+
try {
|
|
251
|
+
uri = monaco.Uri.parse(fileName);
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const existing = monaco.editor.getModel(uri);
|
|
257
|
+
if (existing)
|
|
258
|
+
return existing;
|
|
259
|
+
if (!(fileName in libs))
|
|
260
|
+
return;
|
|
261
|
+
return track(monaco.editor.createModel(libs[fileName], 'typescript', uri));
|
|
262
|
+
}
|
|
263
|
+
function spanToRange(model, span) {
|
|
264
|
+
const start = model.getPositionAt(span.start);
|
|
265
|
+
const end = model.getPositionAt(span.start + span.length);
|
|
266
|
+
return {
|
|
267
|
+
startLineNumber: start.lineNumber,
|
|
268
|
+
startColumn: start.column,
|
|
269
|
+
endLineNumber: end.lineNumber,
|
|
270
|
+
endColumn: end.column,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function parts(value) {
|
|
274
|
+
return value?.map((part) => part.text).join('') ?? '';
|
|
275
|
+
}
|
|
276
|
+
function documentation(info) {
|
|
277
|
+
let text = parts(info.documentation);
|
|
278
|
+
for (const tag of info.tags ?? []) {
|
|
279
|
+
const body = typeof tag.text === 'string' ? tag.text : parts(tag.text);
|
|
280
|
+
text += `\n\n*@${tag.name}*${body ? ` — ${body}` : ''}`;
|
|
281
|
+
}
|
|
282
|
+
return text;
|
|
283
|
+
}
|
|
284
|
+
/** The editor's kind for each kind the language service names; anything else is a property. */
|
|
285
|
+
const COMPLETION_KINDS = new Map([
|
|
286
|
+
['keyword', 'Keyword'],
|
|
287
|
+
['primitive type', 'Keyword'],
|
|
288
|
+
['var', 'Variable'],
|
|
289
|
+
['local var', 'Variable'],
|
|
290
|
+
['const', 'Variable'],
|
|
291
|
+
['let', 'Variable'],
|
|
292
|
+
['property', 'Field'],
|
|
293
|
+
['getter', 'Field'],
|
|
294
|
+
['setter', 'Field'],
|
|
295
|
+
['function', 'Function'],
|
|
296
|
+
['method', 'Function'],
|
|
297
|
+
['constructor', 'Function'],
|
|
298
|
+
['call', 'Function'],
|
|
299
|
+
['construct', 'Function'],
|
|
300
|
+
['index', 'Function'],
|
|
301
|
+
['enum', 'Enum'],
|
|
302
|
+
['module', 'Module'],
|
|
303
|
+
['class', 'Class'],
|
|
304
|
+
['interface', 'Interface'],
|
|
305
|
+
]);
|
|
306
|
+
function completionKind(languages, kind) {
|
|
307
|
+
return languages.CompletionItemKind[COMPLETION_KINDS.get(kind) ?? 'Property'];
|
|
308
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Vite virtual module emitted by the studio's plugin (`studio/vite.mjs`). */
|
|
2
|
+
declare module 'virtual:studio-type-sources' {
|
|
3
|
+
export const typeSources: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/** The editor core. The full `monaco-editor` entry also registers every other language. */
|
|
7
|
+
declare module 'monaco-editor/editor/editor.api' {
|
|
8
|
+
export const editor: typeof import('monaco-editor').editor;
|
|
9
|
+
export const languages: typeof import('monaco-editor').languages;
|
|
10
|
+
export const MarkerSeverity: typeof import('monaco-editor').MarkerSeverity;
|
|
11
|
+
export const Uri: typeof import('monaco-editor').Uri;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The TypeScript language service, separate from the editor widget. */
|
|
15
|
+
declare module 'monaco-editor/languages/features/typescript/register' {
|
|
16
|
+
export const typescriptDefaults: import('monaco-editor').typescript.LanguageServiceDefaults;
|
|
17
|
+
export const ScriptTarget: typeof import('monaco-editor').typescript.ScriptTarget;
|
|
18
|
+
export const ModuleKind: typeof import('monaco-editor').typescript.ModuleKind;
|
|
19
|
+
export const ModuleResolutionKind: typeof import('monaco-editor').typescript.ModuleResolutionKind;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module 'monaco-editor/languages/definitions/typescript/register';
|
|
23
|
+
|
|
24
|
+
/** Monaco's icon sheets, resolved by the studio's plugin. */
|
|
25
|
+
declare module 'virtual:studio-codicons/codicon.css';
|
|
26
|
+
declare module 'virtual:studio-codicons/codicon-modifiers.css';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type WriteAsk } from '../mod.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The stop before a real run of a tool that writes: the input it would send, and Cancel or Run.
|
|
5
|
+
* `confirm` answers once the builder chose; closing the dialog is Cancel. A second question while
|
|
6
|
+
* one is open is refused, so each run is one the builder read. A run the builder's settings say
|
|
7
|
+
* not to ask about goes ahead.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useConfirmWrite(): {
|
|
10
|
+
confirm: (ask: WriteAsk) => Promise<boolean>;
|
|
11
|
+
dialog: ReactNode;
|
|
12
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@astryxdesign/core/Button';
|
|
3
|
+
import { CodeBlock } from '@astryxdesign/core/CodeBlock';
|
|
4
|
+
import { Dialog, DialogHeader } from '@astryxdesign/core/Dialog';
|
|
5
|
+
import { HStack } from '@astryxdesign/core/HStack';
|
|
6
|
+
import { Layout, LayoutContent, LayoutFooter } from '@astryxdesign/core/Layout';
|
|
7
|
+
import { useCallback, useState } from 'react';
|
|
8
|
+
import { writeAskLine } from "../mod.js";
|
|
9
|
+
import { writeAsks } from "./lib/studio-prefs.js";
|
|
10
|
+
const DIALOG_WIDTH = 520;
|
|
11
|
+
/**
|
|
12
|
+
* The stop before a real run of a tool that writes: the input it would send, and Cancel or Run.
|
|
13
|
+
* `confirm` answers once the builder chose; closing the dialog is Cancel. A second question while
|
|
14
|
+
* one is open is refused, so each run is one the builder read. A run the builder's settings say
|
|
15
|
+
* not to ask about goes ahead.
|
|
16
|
+
*/
|
|
17
|
+
export function useConfirmWrite() {
|
|
18
|
+
const [open, setOpen] = useState();
|
|
19
|
+
const confirm = useCallback((ask) => new Promise((resolve) => {
|
|
20
|
+
if (!writeAsks(ask.access)) {
|
|
21
|
+
resolve(true);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
setOpen((current) => {
|
|
25
|
+
if (current) {
|
|
26
|
+
resolve(false);
|
|
27
|
+
return current;
|
|
28
|
+
}
|
|
29
|
+
return { ask, answer: resolve };
|
|
30
|
+
});
|
|
31
|
+
}), []);
|
|
32
|
+
const answer = (run) => {
|
|
33
|
+
open?.answer(run);
|
|
34
|
+
setOpen(undefined);
|
|
35
|
+
};
|
|
36
|
+
const dialog = (_jsx(Dialog, { isOpen: open !== undefined, purpose: "form", width: DIALOG_WIDTH, maxHeight: "80vh", onOpenChange: (isOpen) => {
|
|
37
|
+
if (!isOpen)
|
|
38
|
+
answer(false);
|
|
39
|
+
}, children: open && (_jsx(Layout, { header: _jsx(DialogHeader, { title: `Run ${open.ask.tool}?`, subtitle: writeAskLine(open.ask) }), content: _jsx(LayoutContent, { children: _jsx(CodeBlock, { code: open.ask.input, language: "json", title: "Input", size: "sm", isWrapped: true, maxHeight: 320 }) }), footer: _jsx(LayoutFooter, { children: _jsxs(HStack, { gap: 2, justify: "end", children: [_jsx(Button, { label: "Cancel", variant: "ghost", onClick: () => {
|
|
40
|
+
answer(false);
|
|
41
|
+
} }), _jsx(Button, { label: "Run", variant: open.ask.access === 'destructive' ? 'destructive' : 'primary', onClick: () => {
|
|
42
|
+
answer(true);
|
|
43
|
+
} })] }) }) })) }));
|
|
44
|
+
return { confirm, dialog };
|
|
45
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DiffLine } from '../mod.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Changed lines as a unified diff: removed lines red, added lines green, the lines both share
|
|
4
|
+
* between. `sides` names what the `-` and the `+` lines each are. `start` numbers the lines as
|
|
5
|
+
* the file had them. `kept` is the side that stands, and the other reads as set aside.
|
|
6
|
+
*/
|
|
7
|
+
export declare function DiffBlock({ title, lines, sides, start, kept, isWrapped, maxHeight, }: {
|
|
8
|
+
title?: string;
|
|
9
|
+
lines: readonly DiffLine[];
|
|
10
|
+
/** What the `-` lines and the `+` lines each are. */
|
|
11
|
+
sides?: {
|
|
12
|
+
removed: string;
|
|
13
|
+
added: string;
|
|
14
|
+
};
|
|
15
|
+
/** The one-based line of the file the first line is. Without it the lines are not numbered. */
|
|
16
|
+
start?: number;
|
|
17
|
+
kept?: '-' | '+';
|
|
18
|
+
/** Whether a long line wraps, for text read as prose. Code scrolls sideways. */
|
|
19
|
+
isWrapped?: boolean;
|
|
20
|
+
maxHeight?: string;
|
|
21
|
+
}): import("react").JSX.Element;
|
package/ui/diff-block.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const SIGN_LABEL = { ' ': undefined, '-': 'Removed', '+': 'Added' };
|
|
3
|
+
/**
|
|
4
|
+
* Changed lines as a unified diff: removed lines red, added lines green, the lines both share
|
|
5
|
+
* between. `sides` names what the `-` and the `+` lines each are. `start` numbers the lines as
|
|
6
|
+
* the file had them. `kept` is the side that stands, and the other reads as set aside.
|
|
7
|
+
*/
|
|
8
|
+
export function DiffBlock({ title, lines, sides, start, kept, isWrapped = false, maxHeight, }) {
|
|
9
|
+
const count = (sign) => lines.filter((line) => line.sign === sign).length;
|
|
10
|
+
// A line the change adds is not one the file had, so it takes no number.
|
|
11
|
+
let at = (start ?? 1) - 1;
|
|
12
|
+
return (_jsxs("figure", { className: "studio-diff", "data-wrapped": isWrapped, "data-kept": kept, children: [_jsxs("figcaption", { className: "studio-diff-head", children: [sides ? (_jsxs("span", { className: "studio-diff-sides", children: [_jsx("span", { "data-sign": "-", children: `− ${sides.removed}` }), _jsx("span", { "data-sign": "+", children: `+ ${sides.added}` })] })) : (_jsx("span", { className: "studio-diff-title", children: title })), _jsxs("span", { className: "studio-diff-count", children: [_jsx("span", { "data-sign": "+", children: `+${String(count('+'))}` }), _jsx("span", { "data-sign": "-", children: `−${String(count('-'))}` })] })] }), _jsx("div", { className: "studio-diff-lines", style: { maxHeight }, children: lines.map((line, index) => {
|
|
13
|
+
if (line.sign !== '+')
|
|
14
|
+
at += 1;
|
|
15
|
+
return (_jsxs("div", { className: "studio-diff-line", "data-sign": line.sign, children: [start !== undefined && (_jsx("span", { className: "studio-diff-number", "aria-hidden": true, children: line.sign === '+' ? '' : String(at) })), _jsx("span", { className: "studio-diff-sign", role: "img", "aria-label": SIGN_LABEL[line.sign], children: line.sign === '-' ? '−' : line.sign }), _jsx("code", { children: line.text || ' ' })] }, index));
|
|
16
|
+
}) })] }));
|
|
17
|
+
}
|
package/ui/figtree.css
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Figtree, self-hosted from @fontsource (Latin, the neutral theme's four weights), with its vertical
|
|
3
|
+
* metrics rebalanced. As shipped (ascent 950, descent 250 per 1000), capitals sit exactly centred
|
|
4
|
+
* in a line and lowercase sits 0.1em low, so text in a control reads as low. 900/300 keeps the
|
|
5
|
+
* line's height (1.2em) and raises the baseline 0.05em, splitting the difference: capitals 0.05em
|
|
6
|
+
* high, lowercase 0.05em low. Declared here rather than imported from @fontsource, whose faces
|
|
7
|
+
* can't take the overrides.
|
|
8
|
+
*/
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: "Figtree";
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-display: swap;
|
|
13
|
+
font-weight: 400;
|
|
14
|
+
src:
|
|
15
|
+
url("@fontsource/figtree/files/figtree-latin-400-normal.woff2") format("woff2"),
|
|
16
|
+
url("@fontsource/figtree/files/figtree-latin-400-normal.woff") format("woff");
|
|
17
|
+
ascent-override: 90%;
|
|
18
|
+
descent-override: 30%;
|
|
19
|
+
line-gap-override: 0%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: "Figtree";
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-display: swap;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
src:
|
|
28
|
+
url("@fontsource/figtree/files/figtree-latin-500-normal.woff2") format("woff2"),
|
|
29
|
+
url("@fontsource/figtree/files/figtree-latin-500-normal.woff") format("woff");
|
|
30
|
+
ascent-override: 90%;
|
|
31
|
+
descent-override: 30%;
|
|
32
|
+
line-gap-override: 0%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: "Figtree";
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-display: swap;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
src:
|
|
41
|
+
url("@fontsource/figtree/files/figtree-latin-600-normal.woff2") format("woff2"),
|
|
42
|
+
url("@fontsource/figtree/files/figtree-latin-600-normal.woff") format("woff");
|
|
43
|
+
ascent-override: 90%;
|
|
44
|
+
descent-override: 30%;
|
|
45
|
+
line-gap-override: 0%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@font-face {
|
|
49
|
+
font-family: "Figtree";
|
|
50
|
+
font-style: normal;
|
|
51
|
+
font-display: swap;
|
|
52
|
+
font-weight: 700;
|
|
53
|
+
src:
|
|
54
|
+
url("@fontsource/figtree/files/figtree-latin-700-normal.woff2") format("woff2"),
|
|
55
|
+
url("@fontsource/figtree/files/figtree-latin-700-normal.woff") format("woff");
|
|
56
|
+
ascent-override: 90%;
|
|
57
|
+
descent-override: 30%;
|
|
58
|
+
line-gap-override: 0%;
|
|
59
|
+
}
|
package/ui/file-place.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { HoverCard } from '@astryxdesign/core/HoverCard';
|
|
3
|
+
import { HStack } from '@astryxdesign/core/HStack';
|
|
4
|
+
import { useClipboard } from '@astryxdesign/core/hooks';
|
|
5
|
+
import { Icon } from '@astryxdesign/core/Icon';
|
|
6
|
+
import { IconButton } from '@astryxdesign/core/IconButton';
|
|
7
|
+
import { Text } from '@astryxdesign/core/Text';
|
|
8
|
+
import { IconCheck, IconCopy } from '@tabler/icons-react';
|
|
9
|
+
import { Fragment } from 'react';
|
|
10
|
+
import { askParts, shortPlace } from "../mod.js";
|
|
11
|
+
/** A line of a file by the file's name. Hovering shows where the file is, with a copy. */
|
|
12
|
+
function FilePlace({ place }) {
|
|
13
|
+
const { copy, isCopied } = useClipboard();
|
|
14
|
+
const full = `${place.file}:${String(place.line)}`;
|
|
15
|
+
return (_jsx(HoverCard, { label: full, touchTrigger: "tap", content: _jsxs(HStack, { gap: 2, vAlign: "center", children: [_jsx(Text, { type: "code", size: "sm", children: full }), _jsx(IconButton, { label: isCopied ? 'Copied' : 'Copy path', variant: "ghost", size: "sm", icon: _jsx(Icon, { icon: isCopied ? IconCheck : IconCopy, size: "sm" }), onClick: () => {
|
|
16
|
+
copy(full);
|
|
17
|
+
} })] }), children: shortPlace(place) }));
|
|
18
|
+
}
|
|
19
|
+
/** A question's line, with each file it names by its name. */
|
|
20
|
+
export function askLine(ask) {
|
|
21
|
+
let at = 0;
|
|
22
|
+
return askParts(ask).map((part) => {
|
|
23
|
+
at += 1;
|
|
24
|
+
return (_jsx(Fragment, { children: typeof part === 'string' ? part : _jsx(FilePlace, { place: part }) }, at));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type StudioRunPayload } from '../mod.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Sends texts across every guardrail boundary of the compiled agent and lists what its guardrails
|
|
4
|
+
* did with each, newest first. A sent text opens on its boundaries, and a boundary on what its
|
|
5
|
+
* trace says of guardrails. The model is scripted, so a probe spends no key.
|
|
6
|
+
*/
|
|
7
|
+
export declare function GuardrailTester({ payload, isWide, }: {
|
|
8
|
+
payload: StudioRunPayload;
|
|
9
|
+
isWide: boolean;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* The tester from a detector's page: the same probe of the open agent, read with the detector
|
|
13
|
+
* `only` alone. An answer shows for the sample and the draft it was sent with, and goes when
|
|
14
|
+
* either changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare function DetectorTester({ only }: {
|
|
17
|
+
only: string;
|
|
18
|
+
}): import("react").JSX.Element;
|