@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
package/vite.mjs
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
/**
|
|
6
|
+
* The package repo when the studio is linked from it (`studio/vite.mjs` there). An install from the
|
|
7
|
+
* registry has none: the declarations are the ones the installed `@theoremjs/agents` ships.
|
|
8
|
+
*/
|
|
9
|
+
const theoremaiRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
10
|
+
const linked = existsSync(path.join(theoremaiRoot, 'mod.ts'));
|
|
11
|
+
/** The package's own folder: `studio/` in the repo, or the installed package. */
|
|
12
|
+
const studioRoot = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
/**
|
|
14
|
+
* What the screen imports that comes from the host's install when the host has it, so there is
|
|
15
|
+
* one copy of each. A host that reaches the package by a link has only what it lists itself; the
|
|
16
|
+
* rest is the package's own copy, which only the package imports.
|
|
17
|
+
*/
|
|
18
|
+
const HOST_PACKAGES = [
|
|
19
|
+
'react',
|
|
20
|
+
'react-dom',
|
|
21
|
+
'@astryxdesign/core',
|
|
22
|
+
'@fontsource/figtree',
|
|
23
|
+
'@tabler/icons-react',
|
|
24
|
+
'monaco-editor',
|
|
25
|
+
'fflate',
|
|
26
|
+
];
|
|
27
|
+
const CODICONS = 'virtual:studio-codicons/';
|
|
28
|
+
/** Bump when the declaration shape changes, so a warm cache is not reused. */
|
|
29
|
+
const CACHE_VERSION = 1;
|
|
30
|
+
/**
|
|
31
|
+
* What a Vite build needs to show the studio screen (`@theoremjs/studio/ui`). `hostRoot` is the
|
|
32
|
+
* app that shows it; its install holds React and the design library.
|
|
33
|
+
*
|
|
34
|
+
* - The screen's packages resolve to the host's install where it has them, so there is one copy
|
|
35
|
+
* of each. Monaco, fflate, and zod are the package's own dependencies: an install from the
|
|
36
|
+
* registry puts them in the host, and a linked package keeps them beside itself.
|
|
37
|
+
* - `virtual:studio-codicons/*` is Monaco's icon sheets.
|
|
38
|
+
* - `virtual:studio-type-sources` is the declarations for the open agent's file. The Monaco
|
|
39
|
+
* worker typechecks that one file. It does not typecheck the kernel: these are the
|
|
40
|
+
* declarations for `@theoremjs/agents` (emitted from the repo when the package is linked from
|
|
41
|
+
* it, or the ones the installed package ships), plus the zod declarations that entry imports. Locale files and anything the entries do not reach are
|
|
42
|
+
* left out. The worker resolves a `.js` import in a declaration to the `.d.ts` beside it.
|
|
43
|
+
*/
|
|
44
|
+
export function studioVite({ hostRoot }) {
|
|
45
|
+
const virtual = '\0virtual:studio-type-sources';
|
|
46
|
+
const codicons = path.join(hostPackage(hostRoot, 'monaco-editor'), 'esm/vs/base/browser/ui/codicons/codicon');
|
|
47
|
+
return {
|
|
48
|
+
name: 'theorem-studio',
|
|
49
|
+
config() {
|
|
50
|
+
return { resolve: { dedupe: HOST_PACKAGES.filter((name) => installedFrom(hostRoot, name)) } };
|
|
51
|
+
},
|
|
52
|
+
resolveId(source) {
|
|
53
|
+
if (source === 'virtual:studio-type-sources')
|
|
54
|
+
return virtual;
|
|
55
|
+
if (source.startsWith(CODICONS))
|
|
56
|
+
return path.join(codicons, source.slice(CODICONS.length));
|
|
57
|
+
},
|
|
58
|
+
load(source) {
|
|
59
|
+
if (source !== virtual)
|
|
60
|
+
return;
|
|
61
|
+
const files = loadDeclarations(hostRoot);
|
|
62
|
+
addTree(files, hostPackage(hostRoot, 'zod'), 'file:///node_modules/zod', '.d.ts');
|
|
63
|
+
const reached = reachableDeclarations(files);
|
|
64
|
+
return `export const typeSources = ${JSON.stringify(reached)};\n`;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function loadDeclarations(hostRoot) {
|
|
69
|
+
if (!linked)
|
|
70
|
+
return installedDeclarations(hostRoot);
|
|
71
|
+
const cacheFile = path.join(hostRoot, 'node_modules/.vite/studio-declarations.json');
|
|
72
|
+
const stamp = sourceStamp();
|
|
73
|
+
const cached = readCache(cacheFile);
|
|
74
|
+
if (cached?.stamp === stamp)
|
|
75
|
+
return cached.files;
|
|
76
|
+
const files = emitDeclarations(hostRoot);
|
|
77
|
+
mkdirSync(path.dirname(cacheFile), { recursive: true });
|
|
78
|
+
writeFileSync(cacheFile, JSON.stringify({ stamp, files }));
|
|
79
|
+
return files;
|
|
80
|
+
}
|
|
81
|
+
function readCache(file) {
|
|
82
|
+
try {
|
|
83
|
+
return JSON.parse(readFileSync(file, 'utf8'));
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** Changes when the kernel sources the declarations are emitted from change. */
|
|
90
|
+
function sourceStamp() {
|
|
91
|
+
let newest = 0;
|
|
92
|
+
let count = 0;
|
|
93
|
+
const note = (file) => {
|
|
94
|
+
const stat = statSync(file);
|
|
95
|
+
count += 1;
|
|
96
|
+
if (stat.mtimeMs > newest)
|
|
97
|
+
newest = stat.mtimeMs;
|
|
98
|
+
};
|
|
99
|
+
note(path.join(theoremaiRoot, 'mod.ts'));
|
|
100
|
+
walk(path.join(theoremaiRoot, 'src'), (full) => {
|
|
101
|
+
if (full.endsWith('.ts') && !full.endsWith('.test.ts'))
|
|
102
|
+
note(full);
|
|
103
|
+
});
|
|
104
|
+
const zod = path.join(theoremaiRoot, 'node_modules/zod/index.d.ts');
|
|
105
|
+
note(zod);
|
|
106
|
+
return `${CACHE_VERSION}:${count}:${Math.round(newest)}`;
|
|
107
|
+
}
|
|
108
|
+
function walk(dir, visit) {
|
|
109
|
+
for (const name of readdirSync(dir)) {
|
|
110
|
+
if (name === 'node_modules')
|
|
111
|
+
continue;
|
|
112
|
+
const full = path.join(dir, name);
|
|
113
|
+
if (statSync(full).isDirectory())
|
|
114
|
+
walk(full, visit);
|
|
115
|
+
else
|
|
116
|
+
visit(full);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* `dir`'s files of one extension, keyed by `prefix` plus their path.
|
|
121
|
+
* Skips tests.
|
|
122
|
+
*/
|
|
123
|
+
function addTree(files, dir, prefix, extension) {
|
|
124
|
+
for (const name of readdirSync(dir)) {
|
|
125
|
+
if (name === 'node_modules' || name.endsWith('.test.ts'))
|
|
126
|
+
continue;
|
|
127
|
+
const full = path.join(dir, name);
|
|
128
|
+
const key = `${prefix}/${name}`;
|
|
129
|
+
if (statSync(full).isDirectory())
|
|
130
|
+
addTree(files, full, key, extension);
|
|
131
|
+
else if (name.endsWith(extension))
|
|
132
|
+
files[key] = readFileSync(full, 'utf8');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/** The public entry and the guardrails compiler, as `.d.ts`, under the paths the file imports. */
|
|
136
|
+
function emitDeclarations(hostRoot) {
|
|
137
|
+
const ts = loadTypeScript(hostRoot);
|
|
138
|
+
const options = {
|
|
139
|
+
declaration: true,
|
|
140
|
+
emitDeclarationOnly: true,
|
|
141
|
+
skipLibCheck: true,
|
|
142
|
+
strict: true,
|
|
143
|
+
target: ts.ScriptTarget.ES2022,
|
|
144
|
+
module: ts.ModuleKind.ESNext,
|
|
145
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
146
|
+
allowImportingTsExtensions: true,
|
|
147
|
+
rewriteRelativeImportExtensions: true,
|
|
148
|
+
jsx: ts.JsxEmit.ReactJSX,
|
|
149
|
+
};
|
|
150
|
+
const host = ts.createCompilerHost(options);
|
|
151
|
+
const written = new Map();
|
|
152
|
+
host.writeFile = (fileName, contents) => {
|
|
153
|
+
written.set(fileName, contents);
|
|
154
|
+
};
|
|
155
|
+
const program = ts.createProgram([
|
|
156
|
+
path.join(theoremaiRoot, 'mod.ts'),
|
|
157
|
+
path.join(theoremaiRoot, 'src/guardrails/compile-egress.ts'),
|
|
158
|
+
], options, host);
|
|
159
|
+
const diagnostics = [...ts.getPreEmitDiagnostics(program), ...program.emit().diagnostics];
|
|
160
|
+
const errors = diagnostics.filter((diagnostic) => diagnostic.category === ts.DiagnosticCategory.Error);
|
|
161
|
+
if (errors.length > 0) {
|
|
162
|
+
const text = errors
|
|
163
|
+
.slice(0, 8)
|
|
164
|
+
.map((diagnostic) => ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'))
|
|
165
|
+
.join('\n');
|
|
166
|
+
throw new Error(`Studio declarations failed to emit.\n${text}`);
|
|
167
|
+
}
|
|
168
|
+
const prefix = 'file:///node_modules/@theoremjs/agents';
|
|
169
|
+
const files = {};
|
|
170
|
+
for (const [fileName, contents] of written) {
|
|
171
|
+
const relative = path.relative(theoremaiRoot, fileName).split(path.sep).join('/');
|
|
172
|
+
files[`${prefix}/${relative}`] = rewriteTypeSpecifiers(contents);
|
|
173
|
+
}
|
|
174
|
+
return files;
|
|
175
|
+
}
|
|
176
|
+
/** The installed package's declarations, under the paths the open file imports them by. */
|
|
177
|
+
function installedDeclarations(hostRoot) {
|
|
178
|
+
const files = {};
|
|
179
|
+
addTree(files, path.join(hostPackage(hostRoot, '@theoremjs/agents'), 'esm'), 'file:///node_modules/@theoremjs/agents', '.d.ts');
|
|
180
|
+
return files;
|
|
181
|
+
}
|
|
182
|
+
/** Relative `.ts` specifiers become `.js`, which resolution reads as the `.d.ts`. */
|
|
183
|
+
function rewriteTypeSpecifiers(contents) {
|
|
184
|
+
return contents.replaceAll(/((?:from|import)\s*\(?\s*['"])(\.{1,2}\/[^'"]+?)\.ts(['"])/g, '$1$2.js$3');
|
|
185
|
+
}
|
|
186
|
+
/** A package's folder as `root` resolves it: in its own `node_modules`, or the nearest one above. */
|
|
187
|
+
export function installedFrom(root, name) {
|
|
188
|
+
let dir = root;
|
|
189
|
+
for (;;) {
|
|
190
|
+
const found = path.join(dir, 'node_modules', name);
|
|
191
|
+
if (existsSync(found))
|
|
192
|
+
return found;
|
|
193
|
+
const up = path.dirname(dir);
|
|
194
|
+
if (up === dir)
|
|
195
|
+
return undefined;
|
|
196
|
+
dir = up;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** A package's folder: the host's install when it has one, or the copy the studio package came with. */
|
|
200
|
+
export function hostPackage(hostRoot, name, ownRoot = studioRoot) {
|
|
201
|
+
const found = installedFrom(hostRoot, name) ?? installedFrom(ownRoot, name);
|
|
202
|
+
if (!found)
|
|
203
|
+
throw new Error(`studio: ${name} is not installed for ${hostRoot} or for the studio package`);
|
|
204
|
+
return found;
|
|
205
|
+
}
|
|
206
|
+
/** The host's TypeScript: the compiler its own build uses. */
|
|
207
|
+
function loadTypeScript(hostRoot) {
|
|
208
|
+
return createRequire(path.join(hostRoot, 'package.json'))('typescript');
|
|
209
|
+
}
|
|
210
|
+
const ENTRY_FILES = [
|
|
211
|
+
'file:///node_modules/@theoremjs/agents/mod.d.ts',
|
|
212
|
+
'file:///node_modules/@theoremjs/agents/src/guardrails/compile-egress.d.ts',
|
|
213
|
+
'file:///node_modules/zod/index.d.ts',
|
|
214
|
+
];
|
|
215
|
+
const SPECIFIER = /(?:from\s+|import\s*\(\s*|import\s+)['"]([^'"]+)['"]|\/\/\/\s*<reference\s+path=['"]([^'"]+)['"]/g;
|
|
216
|
+
/** The entries and every declaration they import. Nothing else is sent to the worker. */
|
|
217
|
+
function reachableDeclarations(files) {
|
|
218
|
+
const reached = {};
|
|
219
|
+
const pending = [...ENTRY_FILES];
|
|
220
|
+
const seen = new Set();
|
|
221
|
+
while (pending.length > 0) {
|
|
222
|
+
const key = pending.pop();
|
|
223
|
+
if (seen.has(key))
|
|
224
|
+
continue;
|
|
225
|
+
seen.add(key);
|
|
226
|
+
const contents = files[key];
|
|
227
|
+
if (contents === undefined) {
|
|
228
|
+
throw new Error(`Studio declarations are missing ${key}.`);
|
|
229
|
+
}
|
|
230
|
+
reached[key] = contents;
|
|
231
|
+
for (const specifier of specifiersIn(contents)) {
|
|
232
|
+
const next = resolveSpecifier(key, specifier, files);
|
|
233
|
+
if (next === undefined)
|
|
234
|
+
continue;
|
|
235
|
+
if (next === null) {
|
|
236
|
+
throw new Error(`Studio declarations: ${key} imports ${specifier}, which is not emitted.`);
|
|
237
|
+
}
|
|
238
|
+
pending.push(next);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return reached;
|
|
242
|
+
}
|
|
243
|
+
function specifiersIn(contents) {
|
|
244
|
+
return [...contents.matchAll(SPECIFIER)].map((match) => match[1] ?? match[2]);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* A relative import, or an import of the two packages these files are allowed
|
|
248
|
+
* to name. Other packages are not part of this file's types.
|
|
249
|
+
* `null` means the specifier should have been in `files` and was not.
|
|
250
|
+
*/
|
|
251
|
+
function resolveSpecifier(fromKey, specifier, files) {
|
|
252
|
+
// Error-message catalogues. The schema API does not need them, and each one
|
|
253
|
+
// would be parsed into the program through `export * as locales`.
|
|
254
|
+
if (specifier.includes('/locales/') || specifier.endsWith('/locales'))
|
|
255
|
+
return undefined;
|
|
256
|
+
if (specifier.startsWith('.'))
|
|
257
|
+
return resolveFile(new URL(specifier, fromKey).href, files);
|
|
258
|
+
if (specifier === 'zod' || specifier.startsWith('zod/')) {
|
|
259
|
+
const rest = specifier === 'zod' ? 'index.d.ts' : specifier.slice('zod/'.length);
|
|
260
|
+
return resolveFile(`file:///node_modules/zod/${rest}`, files);
|
|
261
|
+
}
|
|
262
|
+
if (specifier === '@theoremjs/agents' || specifier.startsWith('@theoremjs/agents/')) {
|
|
263
|
+
const rest = specifier === '@theoremjs/agents' ? 'mod.d.ts' : specifier.slice('@theoremjs/agents/'.length);
|
|
264
|
+
return resolveFile(`file:///node_modules/@theoremjs/agents/${rest}`, files);
|
|
265
|
+
}
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
function resolveFile(href, files) {
|
|
269
|
+
const candidates = [href];
|
|
270
|
+
if (href.endsWith('.js'))
|
|
271
|
+
candidates.push(`${href.slice(0, -3)}.d.ts`);
|
|
272
|
+
if (!href.endsWith('.d.ts')) {
|
|
273
|
+
candidates.push(`${href}.d.ts`);
|
|
274
|
+
candidates.push(`${href}/index.d.ts`);
|
|
275
|
+
}
|
|
276
|
+
return candidates.find((candidate) => candidate in files) ?? null;
|
|
277
|
+
}
|
package/workspace.d.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A workspace holds several agents and one library of tools they share. Each
|
|
3
|
+
* agent is a draft without the library: it names the tools it allows by key.
|
|
4
|
+
* Every draft helper still works on one agent through `agentDraft`, which puts
|
|
5
|
+
* its allowed tools back, and `withAgentDraft`, which takes them out again.
|
|
6
|
+
*/
|
|
7
|
+
import { type StudioDraft, type ToolSpecDraft, type ToolsDraft } from './draft.ts';
|
|
8
|
+
import type { StudioProvider } from './providers.ts';
|
|
9
|
+
import { type StudioNodeRef, type StudioTreeNode } from './tree.ts';
|
|
10
|
+
export declare const STUDIO_WORKSPACE_VERSION = 5;
|
|
11
|
+
export interface AgentToolsDraft extends ToolsDraft {
|
|
12
|
+
/** The library tools this agent allows, by `ToolSpecDraft.key`. */
|
|
13
|
+
allow: string[];
|
|
14
|
+
}
|
|
15
|
+
/** One agent: a draft without the tool library, plus its own key and allow list. */
|
|
16
|
+
export interface AgentDraft extends Omit<StudioDraft, 'toolSpecs' | 'tools' | 'providers'> {
|
|
17
|
+
key: string;
|
|
18
|
+
tools: AgentToolsDraft;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* What each agent and tool held when it joined the workspace, by key, and each provider, by id: an
|
|
22
|
+
* example as it loaded, or a new one as it was made. Reset puts one back. A tool that left the
|
|
23
|
+
* library keeps its start while an agent that started with it is still here, so resetting that
|
|
24
|
+
* agent brings the tool back.
|
|
25
|
+
*/
|
|
26
|
+
export interface WorkspaceStarts {
|
|
27
|
+
agents: Record<string, AgentDraft>;
|
|
28
|
+
tools: Record<string, ToolSpecDraft>;
|
|
29
|
+
providers: Record<string, StudioProvider>;
|
|
30
|
+
}
|
|
31
|
+
export interface StudioWorkspace {
|
|
32
|
+
v: typeof STUDIO_WORKSPACE_VERSION;
|
|
33
|
+
/** In the tree's order. */
|
|
34
|
+
agents: AgentDraft[];
|
|
35
|
+
/** The tools every agent picks from. */
|
|
36
|
+
toolSpecs: ToolSpecDraft[];
|
|
37
|
+
/** The providers every agent's models pick from. */
|
|
38
|
+
providers: StudioProvider[];
|
|
39
|
+
/** The open node's id. */
|
|
40
|
+
selected: string;
|
|
41
|
+
/** The agent the preview chats with, by key. */
|
|
42
|
+
chatWith: string;
|
|
43
|
+
starts: WorkspaceStarts;
|
|
44
|
+
}
|
|
45
|
+
/** An agent's node id: its root, or a facet or binding under it (`identity` is the root). */
|
|
46
|
+
export declare function agentNodeId(agentKey: string, inner?: string): string;
|
|
47
|
+
/** A single draft's node id, under `agentKey`. Tools carry no agent: every agent shares them. */
|
|
48
|
+
export declare function scopedNodeId(agentKey: string, id: string): string;
|
|
49
|
+
export type WorkspaceNodeRef = {
|
|
50
|
+
agent: string;
|
|
51
|
+
ref: StudioNodeRef;
|
|
52
|
+
} | {
|
|
53
|
+
tool: string;
|
|
54
|
+
} | {
|
|
55
|
+
provider: string;
|
|
56
|
+
};
|
|
57
|
+
/** What a workspace node id names; `undefined` when it names nothing there. */
|
|
58
|
+
export declare function workspaceNodeRef(workspace: StudioWorkspace, id: string): WorkspaceNodeRef | undefined;
|
|
59
|
+
/** One agent as a single draft: its tools are the library's it allows, in the order it allows them. */
|
|
60
|
+
export declare function agentDraft(workspace: StudioWorkspace, key: string): StudioDraft | undefined;
|
|
61
|
+
/** Makes what an agent holds now its start: for an example that links its agents after adding them. */
|
|
62
|
+
export declare function markAgentStart(workspace: StudioWorkspace, key: string): StudioWorkspace;
|
|
63
|
+
/**
|
|
64
|
+
* Writes one agent's draft back. Its tools go to the library: a changed tool
|
|
65
|
+
* changes there for every agent, a new one joins the library and this agent's
|
|
66
|
+
* allow list, and one the draft dropped leaves only this agent's allow list.
|
|
67
|
+
* `registered` updates the library for a tool the file defines and does not allow.
|
|
68
|
+
*/
|
|
69
|
+
export declare function withAgentDraft(workspace: StudioWorkspace, key: string, draft: StudioDraft, registered?: readonly ToolSpecDraft[]): StudioWorkspace;
|
|
70
|
+
/**
|
|
71
|
+
* A v1 single draft as a workspace: it becomes the one agent, its tools become
|
|
72
|
+
* the library and it allows them all, and the open node moves under it.
|
|
73
|
+
*/
|
|
74
|
+
export declare function workspaceFromDraft(draft: StudioDraft, selectedId?: string): StudioWorkspace;
|
|
75
|
+
/** A workspace with one blank agent. */
|
|
76
|
+
export declare function createBlankWorkspace(): StudioWorkspace;
|
|
77
|
+
/**
|
|
78
|
+
* One agent as the editor shows it: its own settings, with the whole library
|
|
79
|
+
* as its tools. Which of them it allows stays on the agent (`setToolAllowed`).
|
|
80
|
+
*/
|
|
81
|
+
export declare function libraryDraft(workspace: StudioWorkspace, key: string): StudioDraft | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Writes back a `libraryDraft`. Its tools become the library: a tool it
|
|
84
|
+
* dropped leaves every agent, and a tool it added is allowed on this agent.
|
|
85
|
+
*/
|
|
86
|
+
export declare function withLibraryDraft(workspace: StudioWorkspace, key: string, draft: StudioDraft): StudioWorkspace;
|
|
87
|
+
/**
|
|
88
|
+
* Appends `draft` as a new agent, with an id no other agent has. A tool whose
|
|
89
|
+
* name the library already has is shared, not copied; the rest join the library.
|
|
90
|
+
*/
|
|
91
|
+
export declare function addAgent(workspace: StudioWorkspace, draft?: StudioDraft): StudioWorkspace;
|
|
92
|
+
/** A copy of an agent right after it, allowing the same tools, with an id it doesn't share. */
|
|
93
|
+
export declare function duplicateAgent(workspace: StudioWorkspace, key: string): StudioWorkspace;
|
|
94
|
+
/**
|
|
95
|
+
* Removes an agent; the last one stays. Nothing is left pointing at it: the
|
|
96
|
+
* agent tools that ran it leave the library and every agent, and a model it
|
|
97
|
+
* summarised for goes back to summarising itself. The open node and the chat
|
|
98
|
+
* move to a neighbour when they were on it.
|
|
99
|
+
*/
|
|
100
|
+
export declare function removeAgent(workspace: StudioWorkspace, key: string): StudioWorkspace;
|
|
101
|
+
/** Allows or stops allowing a library tool on one agent. */
|
|
102
|
+
export declare function setToolAllowed(workspace: StudioWorkspace, agentKey: string, toolKey: string, allowed: boolean): StudioWorkspace;
|
|
103
|
+
/** Removes a tool from the library and from every agent that allowed it. */
|
|
104
|
+
export declare function removeLibraryTool(workspace: StudioWorkspace, toolKey: string): StudioWorkspace;
|
|
105
|
+
/** Whether every agent, tool, and provider is as it started, and no tool was added or removed. */
|
|
106
|
+
export declare function atStart(workspace: StudioWorkspace): boolean;
|
|
107
|
+
/** Makes what the workspace holds now its start: after a Save, the project's files hold it. */
|
|
108
|
+
export declare function startedHere(workspace: StudioWorkspace): StudioWorkspace;
|
|
109
|
+
/**
|
|
110
|
+
* Puts one agent back to its start: its own settings and the tools it allowed. The tools keep
|
|
111
|
+
* their edits, since other agents share them; one that left the library comes back as it started.
|
|
112
|
+
* Nothing else changes. An agent already at its start returns the same workspace.
|
|
113
|
+
*/
|
|
114
|
+
export declare function resetAgent(workspace: StudioWorkspace, key: string): StudioWorkspace;
|
|
115
|
+
/**
|
|
116
|
+
* Puts every agent, every library tool, and every provider back to its start, in one step. A tool that left the
|
|
117
|
+
* library comes back when an agent started out allowing it. An agent or a tool added here stays: it
|
|
118
|
+
* started as it is. A workspace already at its start is returned as it is.
|
|
119
|
+
*/
|
|
120
|
+
export declare function resetAll(workspace: StudioWorkspace): StudioWorkspace;
|
|
121
|
+
/**
|
|
122
|
+
* The files' workspace, opened again over the one the studio holds. An agent or a tool the studio
|
|
123
|
+
* already opened from the files keeps its key, so what is open, each conversation, and the
|
|
124
|
+
* settings agents share carry on. One the builder removed comes back under a new key.
|
|
125
|
+
*/
|
|
126
|
+
export declare function reopened(files: StudioWorkspace, before: StudioWorkspace): StudioWorkspace;
|
|
127
|
+
/**
|
|
128
|
+
* The builder's edits brought back over files that changed since they were made. What the builder
|
|
129
|
+
* changed or added stays as they left it, and what they did not touch is as the files hold it
|
|
130
|
+
* now. Every start is the files', so an edit made on the old files is one the new files do not
|
|
131
|
+
* hold. A tool the builder removed stays removed; an agent they removed comes back.
|
|
132
|
+
*/
|
|
133
|
+
export declare function rebased(edits: StudioWorkspace, files: StudioWorkspace): StudioWorkspace;
|
|
134
|
+
/**
|
|
135
|
+
* A project's files as the studio opened them, as a short text that stays the same until they
|
|
136
|
+
* change. An agent's or a tool's key is new on every open, so each is named by where it first
|
|
137
|
+
* stands. What is open and who the preview talks to are not part of it.
|
|
138
|
+
*/
|
|
139
|
+
export declare function filesPrint(workspace: StudioWorkspace): string;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the workspace holds edits the files it stands on do not: a change, or an agent or a
|
|
142
|
+
* tool added or removed. `files` is the print of those files.
|
|
143
|
+
*/
|
|
144
|
+
export declare function editedSince(workspace: StudioWorkspace, files: string): boolean;
|
|
145
|
+
/** One setting inside an agent, a tool, or a provider, as the fields that lead to it. Empty for the whole of it. */
|
|
146
|
+
export type SettingPath = readonly (string | number)[];
|
|
147
|
+
/** A setting the project's files changed. */
|
|
148
|
+
export interface FileUpdate {
|
|
149
|
+
kind: 'agent' | 'tool' | 'provider';
|
|
150
|
+
/** The agent's or the tool's key in the merged workspace, or the provider's id. */
|
|
151
|
+
key: string;
|
|
152
|
+
/** The agent's or the provider's id, or the tool's name, as the files hold it. */
|
|
153
|
+
name: string;
|
|
154
|
+
path: SettingPath;
|
|
155
|
+
}
|
|
156
|
+
/** A setting the builder and the files both changed, to different values. Undefined is a removal. */
|
|
157
|
+
export interface FileConflict extends FileUpdate {
|
|
158
|
+
mine: unknown;
|
|
159
|
+
theirs: unknown;
|
|
160
|
+
}
|
|
161
|
+
export interface FilesMerge {
|
|
162
|
+
/** The builder's edits over the files as they are now, with the builder's value at every conflict. */
|
|
163
|
+
workspace: StudioWorkspace;
|
|
164
|
+
/** What the files changed that the builder had not touched: it is as the files hold it. */
|
|
165
|
+
updated: FileUpdate[];
|
|
166
|
+
conflicts: FileConflict[];
|
|
167
|
+
/** The files as they are now, under the keys the workspace holds them by. */
|
|
168
|
+
files: StudioWorkspace;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The builder's edits merged with files that changed under them, setting by setting. What only
|
|
172
|
+
* the files changed is as the files hold it; what only the builder changed stays; what both
|
|
173
|
+
* changed to different values is a conflict, and the builder's value stands until they choose
|
|
174
|
+
* (`withFilesChosen`). Every start is the files', so what is left to save is the builder's edits.
|
|
175
|
+
*
|
|
176
|
+
* `before` is the files as the studio last read them. It tells an agent the files took away from
|
|
177
|
+
* one the builder added, and names the agents the builder removed, which keep no start. Without
|
|
178
|
+
* it nothing the studio holds is taken away, and an agent the builder removed comes back.
|
|
179
|
+
*/
|
|
180
|
+
export declare function mergedWithFiles(edits: StudioWorkspace, files: StudioWorkspace, before?: StudioWorkspace): FilesMerge;
|
|
181
|
+
/**
|
|
182
|
+
* A merge's workspace with the files' value at each conflict named in `theirs`, by its place in
|
|
183
|
+
* `merge.conflicts`. Every other conflict keeps the builder's value.
|
|
184
|
+
*/
|
|
185
|
+
export declare function withFilesChosen(merge: FilesMerge, theirs: readonly number[]): StudioWorkspace;
|
|
186
|
+
/**
|
|
187
|
+
* Puts one library tool back to its start, for every agent that allows it. Which agents allow it
|
|
188
|
+
* stays as it is. A tool already at its start returns the same workspace.
|
|
189
|
+
*/
|
|
190
|
+
export declare function resetLibraryTool(workspace: StudioWorkspace, toolKey: string): StudioWorkspace;
|
|
191
|
+
/** The workspace with one provider as `provider` holds it, by its id. Every agent's models read it. */
|
|
192
|
+
export declare function withProvider(workspace: StudioWorkspace, provider: StudioProvider): StudioWorkspace;
|
|
193
|
+
/** How many models run on the provider `id`, and across how many agents. */
|
|
194
|
+
export declare function providerUse(workspace: StudioWorkspace, id: string): {
|
|
195
|
+
models: number;
|
|
196
|
+
agents: number;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Who else calls the model `apiId` on the provider `id`, besides the model `bindingKey` of the
|
|
200
|
+
* agent `agentKey`: that agent's other models, by id, and the other agents, by name.
|
|
201
|
+
*/
|
|
202
|
+
export declare function modelSharers(workspace: Pick<StudioWorkspace, 'agents'>, agentKey: string, bindingKey: string, id: string, apiId: string): {
|
|
203
|
+
models: string[];
|
|
204
|
+
agents: string[];
|
|
205
|
+
};
|
|
206
|
+
/** A provider from the kernel definition `definition` under the first free id: what the + beside a provider picker adds. */
|
|
207
|
+
export declare function newProvider(taken: Iterable<string>, definition: string): StudioProvider;
|
|
208
|
+
/** Adds a provider for every agent's models to pick, and opens it. One whose id is taken changes nothing. */
|
|
209
|
+
export declare function addProvider(workspace: StudioWorkspace, provider: StudioProvider): StudioWorkspace;
|
|
210
|
+
/**
|
|
211
|
+
* Removes a provider no model runs on. One a model runs on stays: a model has no provider to fall
|
|
212
|
+
* to, so its models move first.
|
|
213
|
+
*/
|
|
214
|
+
export declare function removeProvider(workspace: StudioWorkspace, id: string): StudioWorkspace;
|
|
215
|
+
/**
|
|
216
|
+
* Renames the provider `from` to `to`, and every model that runs on it with it. A blank or taken
|
|
217
|
+
* `to` changes nothing. Only a provider the files do not hold yet is renamed: code names the others.
|
|
218
|
+
*/
|
|
219
|
+
export declare function renameProvider(workspace: StudioWorkspace, from: string, to: string): StudioWorkspace;
|
|
220
|
+
/** The providers that are as they started: the ones the project's files still say. */
|
|
221
|
+
export declare function providersAtStart(workspace: StudioWorkspace): string[];
|
|
222
|
+
/** Puts one provider back to its start. A provider already at its start returns the same workspace. */
|
|
223
|
+
export declare function resetProvider(workspace: StudioWorkspace, id: string): StudioWorkspace;
|
|
224
|
+
export interface WorkspaceTree {
|
|
225
|
+
/** One root per agent; its tools are picked in its Tools facet, not listed under it. */
|
|
226
|
+
agents: StudioTreeNode[];
|
|
227
|
+
/** The shared library. */
|
|
228
|
+
tools: StudioTreeNode[];
|
|
229
|
+
}
|
|
230
|
+
export declare function workspaceTree(workspace: StudioWorkspace): WorkspaceTree;
|