@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,471 @@
|
|
|
1
|
+
import{Bn as e,dr as t,i as n,o as r}from"./tool-schema-idaOe2nI.js";var i=e.filter(e=>e===`image/*`||e===`application/pdf`||e.startsWith(`text/`)),a=t.filter(e=>e===`audio/*`),o=`{
|
|
2
|
+
"User-Agent": "TheoremStudio/1.0 (travel demo; +https://github.com/masudl-hub/theoremai)"
|
|
3
|
+
}`,s=[`get_cat_fact`,`tell_joke`,`get_advice`,`random_dog_image`],c={geocode_city:{name:`Paris`},search_places:{q:`Paris`,limit:1},reverse_geocode:{lat:48.85,lon:2.35},get_weather:{latitude:48.85,longitude:2.35},get_sun_times:{lat:48.85,lng:2.35},convert_currency:{from:`USD`,to:`EUR`,amount:100},wikipedia_summary:{title:`Paris`},archive_text_search:{q:`mediatype:texts AND travel`,rows:1},lookup_postal_code:{country:`us`,postal:`90210`},get_pokemon:{name:`pikachu`},read_repo_file:{owner:`denoland`,repo:`std`,path:`README.md`},lookup_package:{name:`zod`},get_cat_fact:{},tell_joke:{},get_advice:{},random_dog_image:{}};function l(e){return c[e]}var u=`nominatim.openstreetmap.org, geocoding-api.open-meteo.com, api.open-meteo.com, api.frankfurter.dev, api.sunrise-sunset.org, api.zippopotam.us, en.wikipedia.org, archive.org, pokeapi.co, dog.ceo, api.adviceslip.com, catfact.ninja, official-joke-api.appspot.com, mcp.deepwiki.com, mcp.context7.com, learn.microsoft.com, docs.mcp.cloudflare.com, knowledge-mcp.global.api.aws, huggingface.co, mcp.docs.astro.build, mcp.exa.ai, raw.githubusercontent.com, registry.npmjs.org`,d=`Role: Elite, charismatic travel concierge.
|
|
4
|
+
|
|
5
|
+
Communication Standards:
|
|
6
|
+
- Readable Formatting: Use markdown where it helps the reader: short headings, bullet lists, bold for key names, and tables for side-by-side comparisons.
|
|
7
|
+
- Adaptive Pacing: Deliver high-signal, concise answers. Avoid overwhelming monologues; provide the immediate insight or recommendation first, then offer a natural next step.
|
|
8
|
+
|
|
9
|
+
Tool & Fact Grounding:
|
|
10
|
+
- Absolute Grounding: Ground all dynamic facts (weather, currency conversions, distances, geography, destination research) using available tools before answering. Never invent live data.
|
|
11
|
+
- Silent Execution: Never narrate tool calls, announce function names, or reference underlying APIs. Seamlessly integrate verified findings into your response.
|
|
12
|
+
- Complete Resolution: Execute multi-step tool chains silently to completion before delivering the synthesized answer.
|
|
13
|
+
|
|
14
|
+
Multimodal Understanding:
|
|
15
|
+
- Immediately extract actionable constraints (dates, flight times, locations, budgets) from provided images, documents, tickets, or audio, and weave them directly into your response.`;function f(){return{text:!0,attachmentsAccept:i,voiceAccept:a,maxFiles:5,maxBytes:10485760,maxTurnBytes:26214400}}var p=[{id:`tool-geocode-city`,data:{toolName:`geocode_city`,activity:`Finding {name}`,activityPast:`Found {results.0.name}`,request:`find {name}`,toolType:`http`,description:`Resolve a city or place name to coordinates using the Open-Meteo geocoding API.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://geocoding-api.open-meteo.com/v1/search?count=3`,method:`GET`,queryParams:[`name`],inputJson:`{
|
|
16
|
+
"type": "object",
|
|
17
|
+
"properties": {
|
|
18
|
+
"name": { "type": "string", "examples": ["Paris"], "description": "City or place name" }
|
|
19
|
+
},
|
|
20
|
+
"required": ["name"]
|
|
21
|
+
}`,outputJson:`{
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"results": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"name": { "type": "string" },
|
|
30
|
+
"latitude": { "type": "number" },
|
|
31
|
+
"longitude": { "type": "number" },
|
|
32
|
+
"country_code": { "type": "string" }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}`}},{id:`tool-search-places`,data:{toolName:`search_places`,activity:`Searching for {q}`,activityPast:`Searched for {q}`,request:`search for {q}`,toolType:`http`,description:`Search OpenStreetMap Nominatim for places (free alternative to paid maps APIs).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://nominatim.openstreetmap.org/search?format=json&addressdetails=1`,method:`GET`,headersJson:o,queryParams:[`q`,`limit`],inputJson:`{
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"q": { "type": "string", "examples": ["Paris"], "description": "Place search query" },
|
|
41
|
+
"limit": { "type": "number", "examples": [5], "description": "Max results (1-5)" }
|
|
42
|
+
},
|
|
43
|
+
"required": ["q"]
|
|
44
|
+
}`,outputJson:`{ "type": "array" }`}},{id:`tool-reverse-geocode`,data:{toolName:`reverse_geocode`,activity:`Finding this spot`,activityPast:`Found this spot`,request:`find this spot`,toolType:`http`,description:`Reverse geocode coordinates to a place label via OpenStreetMap Nominatim.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://nominatim.openstreetmap.org/reverse?format=json`,method:`GET`,headersJson:o,queryParams:[`lat`,`lon`],inputJson:`{
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"lat": { "type": "number", "examples": [48.85] },
|
|
48
|
+
"lon": { "type": "number", "examples": [2.35] }
|
|
49
|
+
},
|
|
50
|
+
"required": ["lat", "lon"]
|
|
51
|
+
}`,outputJson:`{ "type": "object" }`}},{id:`tool-get-weather`,data:{toolName:`get_weather`,activity:`Checking the weather`,activityPast:`Currently {current_weather.temperature}°C`,request:`check the weather`,toolType:`http`,description:`Fetch current weather and a 7-day forecast (highs, lows, chance of rain) for coordinates via Open-Meteo.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://api.open-meteo.com/v1/forecast?current_weather=true&daily=temperature_2m_max,temperature_2m_min,precipitation_probability_max&forecast_days=7&timezone=auto`,method:`GET`,queryParams:[`latitude`,`longitude`],inputJson:`{
|
|
52
|
+
"type": "object",
|
|
53
|
+
"properties": {
|
|
54
|
+
"latitude": { "type": "number", "examples": [48.85] },
|
|
55
|
+
"longitude": { "type": "number", "examples": [2.35] }
|
|
56
|
+
},
|
|
57
|
+
"required": ["latitude", "longitude"]
|
|
58
|
+
}`,outputJson:`{
|
|
59
|
+
"type": "object",
|
|
60
|
+
"properties": {
|
|
61
|
+
"current_weather": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"properties": {
|
|
64
|
+
"temperature": { "type": "number" },
|
|
65
|
+
"windspeed": { "type": "number" },
|
|
66
|
+
"weathercode": { "type": "number" },
|
|
67
|
+
"time": { "type": "string" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}`}},{id:`tool-sun-times`,data:{toolName:`get_sun_times`,activity:`Checking sunrise and sunset`,activityPast:`Checked sunrise and sunset`,request:`check sunrise and sunset`,toolType:`http`,description:`Sunrise, sunset, and day length for coordinates (sunrise-sunset.org).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://api.sunrise-sunset.org/json`,method:`GET`,queryParams:[`lat`,`lng`],inputJson:`{
|
|
72
|
+
"type": "object",
|
|
73
|
+
"properties": {
|
|
74
|
+
"lat": { "type": "number", "examples": [48.85] },
|
|
75
|
+
"lng": { "type": "number", "examples": [2.35] }
|
|
76
|
+
},
|
|
77
|
+
"required": ["lat", "lng"]
|
|
78
|
+
}`,outputJson:`{
|
|
79
|
+
"type": "object",
|
|
80
|
+
"properties": {
|
|
81
|
+
"results": { "type": "object" },
|
|
82
|
+
"status": { "type": "string" }
|
|
83
|
+
}
|
|
84
|
+
}`}},{id:`tool-convert-currency`,data:{toolName:`convert_currency`,activity:`Converting {amount} {from} to {to}`,activityPast:`Converted {amount} {from} to {to}`,request:`convert {amount} {from} to {to}`,toolType:`http`,description:`Convert an amount between ISO currencies using ECB reference rates.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://api.frankfurter.dev/v1/latest`,method:`GET`,queryParams:[`from`,`to`,`amount`],inputJson:`{
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"from": { "type": "string", "examples": ["USD"] },
|
|
88
|
+
"to": { "type": "string", "examples": ["EUR"] },
|
|
89
|
+
"amount": { "type": "number", "examples": [100] }
|
|
90
|
+
},
|
|
91
|
+
"required": ["from", "to", "amount"]
|
|
92
|
+
}`,outputJson:`{
|
|
93
|
+
"type": "object",
|
|
94
|
+
"properties": {
|
|
95
|
+
"amount": { "type": "number" },
|
|
96
|
+
"base": { "type": "string" },
|
|
97
|
+
"rates": { "type": "object" }
|
|
98
|
+
}
|
|
99
|
+
}`}},{id:`tool-convert-units`,data:{toolName:`convert_units`,activity:`Converting {value} {from} to {to}`,activityPast:`{value} {from} is {result} {to}`,request:`convert {value} {from} to {to}`,toolType:`function`,description:`Convert temperature (c/f/k) or distance (km/mi) locally — no network call.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],inputJson:`{
|
|
100
|
+
"type": "object",
|
|
101
|
+
"properties": {
|
|
102
|
+
"value": { "type": "number", "description": "Amount to convert", "examples": [20] },
|
|
103
|
+
"from": { "type": "string", "enum": ["c", "f", "k", "km", "mi"], "description": "Unit to convert from" },
|
|
104
|
+
"to": { "type": "string", "enum": ["c", "f", "k", "km", "mi"], "description": "Unit to convert to", "examples": ["f"] }
|
|
105
|
+
},
|
|
106
|
+
"required": ["value", "from", "to"]
|
|
107
|
+
}`,outputJson:`{
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {
|
|
110
|
+
"value": { "type": "number" },
|
|
111
|
+
"from": { "type": "string" },
|
|
112
|
+
"to": { "type": "string" },
|
|
113
|
+
"result": { "type": "number" }
|
|
114
|
+
},
|
|
115
|
+
"required": ["result"]
|
|
116
|
+
}`}},{id:`tool-haversine`,data:{toolName:`haversine_distance`,activity:`Measuring the distance`,activityPast:`{km} km apart`,request:`measure the distance`,toolType:`function`,description:`Great-circle distance between two lat/lon pairs in km and miles.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],inputJson:`{
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"lat1": { "type": "number", "minimum": -90, "maximum": 90, "description": "Start latitude", "examples": [48.85] },
|
|
120
|
+
"lon1": { "type": "number", "minimum": -180, "maximum": 180, "description": "Start longitude", "examples": [2.35] },
|
|
121
|
+
"lat2": { "type": "number", "minimum": -90, "maximum": 90, "description": "End latitude", "examples": [51.51] },
|
|
122
|
+
"lon2": { "type": "number", "minimum": -180, "maximum": 180, "description": "End longitude", "examples": [-0.13] }
|
|
123
|
+
},
|
|
124
|
+
"required": ["lat1", "lon1", "lat2", "lon2"]
|
|
125
|
+
}`,outputJson:`{
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"km": { "type": "number" },
|
|
129
|
+
"mi": { "type": "number" }
|
|
130
|
+
},
|
|
131
|
+
"required": ["km", "mi"]
|
|
132
|
+
}`}},{id:`tool-wikipedia`,data:{toolName:`wikipedia_summary`,activity:`Reading about {title}`,activityPast:`Read about {title}`,request:`read about {title}`,toolType:`http`,description:`Fetch the Wikipedia REST summary for a page title.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://en.wikipedia.org/api/rest_v1/page/summary/{title}`,method:`GET`,headersJson:o,pathParams:[`title`],inputJson:`{
|
|
133
|
+
"type": "object",
|
|
134
|
+
"properties": {
|
|
135
|
+
"title": { "type": "string", "examples": ["Paris"], "description": "Wikipedia page title, e.g. Paris" }
|
|
136
|
+
},
|
|
137
|
+
"required": ["title"]
|
|
138
|
+
}`,outputJson:`{
|
|
139
|
+
"type": "object",
|
|
140
|
+
"properties": {
|
|
141
|
+
"title": { "type": "string" },
|
|
142
|
+
"extract": { "type": "string" },
|
|
143
|
+
"description": { "type": "string" }
|
|
144
|
+
}
|
|
145
|
+
}`}},{id:`tool-archive-search`,data:{toolName:`archive_text_search`,activity:`Searching the archive`,activityPast:`Searched the archive`,request:`search the archive`,toolType:`http`,description:`Search Internet Archive texts (books) by title or keywords.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://archive.org/advancedsearch.php?output=json&fl[]=identifier&fl[]=title&fl[]=creator`,method:`GET`,queryParams:[`q`,`rows`],inputJson:`{
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"q": { "type": "string", "examples": ["mediatype:texts AND travel"] },
|
|
149
|
+
"rows": { "type": "number", "examples": [1] }
|
|
150
|
+
},
|
|
151
|
+
"required": ["q"]
|
|
152
|
+
}`,outputJson:`{ "type": "object" }`}},{id:`tool-postal`,data:{toolName:`lookup_postal_code`,activity:`Looking up {postal}`,activityPast:`Looked up {postal}`,request:`look up {postal}`,toolType:`http`,description:`Look up place names for a postal code via Zippopotam (no API key).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://api.zippopotam.us/{country}/{postal}`,method:`GET`,pathParams:[`country`,`postal`],inputJson:`{
|
|
153
|
+
"type": "object",
|
|
154
|
+
"properties": {
|
|
155
|
+
"country": { "type": "string", "examples": ["us"], "description": "ISO country code, e.g. us or fr" },
|
|
156
|
+
"postal": { "type": "string", "examples": ["90210"] }
|
|
157
|
+
},
|
|
158
|
+
"required": ["country", "postal"]
|
|
159
|
+
}`,outputJson:`{ "type": "object" }`}},{id:`tool-ask-deepwiki`,data:{toolName:`ask_repo_docs`,activity:`Checking the docs`,activityPast:`Checked the docs`,request:`check the docs`,toolType:`mcp`,description:`Ask questions about a public GitHub repo via DeepWiki MCP (Streamable HTTP).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://mcp.deepwiki.com/mcp`,mcpToolName:`ask_wiki_question`,inputJson:`{
|
|
160
|
+
"type": "object",
|
|
161
|
+
"properties": {
|
|
162
|
+
"repoName": { "type": "string", "description": "The GitHub repo, as owner/repo", "examples": ["sveltejs/kit"] },
|
|
163
|
+
"question": { "type": "string", "description": "What to ask about the repo", "maxLength": 2000, "examples": ["How does routing work?"] }
|
|
164
|
+
},
|
|
165
|
+
"required": ["repoName", "question"]
|
|
166
|
+
}`,outputJson:`{
|
|
167
|
+
"type": "object",
|
|
168
|
+
"properties": { "result": { "type": "string", "description": "Answer text from DeepWiki" } },
|
|
169
|
+
"required": ["result"]
|
|
170
|
+
}`}},{id:`tool-context7-resolve`,data:{toolName:`find_library`,activity:`Finding {libraryName}`,activityPast:`Found {libraryName}`,request:`find {libraryName}`,toolType:`mcp`,description:`Find a library's Context7 ID by name. Call before read_library_docs unless the user gave an ID like /vercel/next.js.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://mcp.context7.com/mcp`,mcpToolName:`resolve-library-id`,inputJson:`{
|
|
171
|
+
"type": "object",
|
|
172
|
+
"properties": {
|
|
173
|
+
"libraryName": { "type": "string", "description": "The library's official name", "maxLength": 100, "examples": ["Next.js"] },
|
|
174
|
+
"query": { "type": "string", "description": "What the user wants to do with it", "maxLength": 500, "examples": ["Set up middleware"] }
|
|
175
|
+
},
|
|
176
|
+
"required": ["libraryName", "query"]
|
|
177
|
+
}`,outputJson:`{ "type": "string", "description": "Matching libraries and their Context7 IDs" }`}},{id:`tool-context7-docs`,data:{toolName:`read_library_docs`,activity:`Reading the {libraryId} docs`,activityPast:`Read the {libraryId} docs`,request:`read the {libraryId} docs`,toolType:`mcp`,description:`Up-to-date docs and code examples for one library from Context7, for one topic per call.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://mcp.context7.com/mcp`,mcpToolName:`query-docs`,inputJson:`{
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"libraryId": { "type": "string", "description": "A Context7 ID from find_library, like /vercel/next.js", "maxLength": 200, "examples": ["/reactjs/react.dev"] },
|
|
181
|
+
"query": { "type": "string", "description": "One topic to look up", "maxLength": 500, "examples": ["useEffect cleanup"] }
|
|
182
|
+
},
|
|
183
|
+
"required": ["libraryId", "query"]
|
|
184
|
+
}`,outputJson:`{ "type": "string", "description": "Documentation excerpts and code examples" }`}},{id:`tool-microsoft-learn`,data:{toolName:`search_microsoft_docs`,activity:`Searching Microsoft Learn for {query}`,activityPast:`Found {results.0.title|nothing on Microsoft Learn}`,request:`search Microsoft Learn for {query}`,toolType:`mcp`,description:`Search official Microsoft and Azure documentation on Microsoft Learn.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://learn.microsoft.com/api/mcp`,mcpToolName:`microsoft_docs_search`,inputJson:`{
|
|
185
|
+
"type": "object",
|
|
186
|
+
"properties": {
|
|
187
|
+
"query": { "type": "string", "description": "A topic about a Microsoft or Azure product, service, or API", "maxLength": 500, "examples": ["Azure Functions timeout"] }
|
|
188
|
+
},
|
|
189
|
+
"required": ["query"]
|
|
190
|
+
}`,outputJson:`{
|
|
191
|
+
"type": "object",
|
|
192
|
+
"properties": {
|
|
193
|
+
"results": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": {
|
|
196
|
+
"type": "object",
|
|
197
|
+
"properties": {
|
|
198
|
+
"title": { "type": "string" },
|
|
199
|
+
"content": { "type": ["string", "null"] },
|
|
200
|
+
"contentUrl": { "type": "string" }
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}`}},{id:`tool-cloudflare-docs`,data:{toolName:`search_cloudflare_docs`,activity:`Searching Cloudflare docs for {query}`,activityPast:`Found {results.0.title|nothing in the Cloudflare docs}`,request:`search the Cloudflare docs for {query}`,toolType:`mcp`,description:`Search the Cloudflare developer documentation: Workers, R2, D1, Durable Objects, Zero Trust, and more.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://docs.mcp.cloudflare.com/mcp`,mcpToolName:`search_cloudflare_documentation`,inputJson:`{
|
|
206
|
+
"type": "object",
|
|
207
|
+
"properties": {
|
|
208
|
+
"query": { "type": "string", "description": "What to look up in the Cloudflare docs", "maxLength": 500, "examples": ["Durable Objects alarms"] }
|
|
209
|
+
},
|
|
210
|
+
"required": ["query"]
|
|
211
|
+
}`,outputJson:`{
|
|
212
|
+
"type": "object",
|
|
213
|
+
"properties": {
|
|
214
|
+
"results": {
|
|
215
|
+
"type": "array",
|
|
216
|
+
"items": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"properties": {
|
|
219
|
+
"title": { "type": "string" },
|
|
220
|
+
"url": { "type": "string" },
|
|
221
|
+
"text": { "type": "string" }
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"required": ["results"]
|
|
227
|
+
}`}},{id:`tool-aws-regions`,data:{toolName:`list_aws_regions`,activity:`Listing AWS regions`,activityPast:`Listed {content.result.length} AWS regions`,request:`list AWS regions`,toolType:`mcp`,description:`List every AWS region, with its code and name.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://knowledge-mcp.global.api.aws`,mcpToolName:`aws___list_regions`,inputJson:`{ "type": "object", "properties": {} }`,outputJson:`{
|
|
228
|
+
"type": "object",
|
|
229
|
+
"properties": {
|
|
230
|
+
"content": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"result": {
|
|
234
|
+
"type": "array",
|
|
235
|
+
"items": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"properties": {
|
|
238
|
+
"region_id": { "type": "string" },
|
|
239
|
+
"region_long_name": { "type": "string" }
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}`}},{id:`tool-aws-docs`,data:{toolName:`search_aws_docs`,activity:`Searching AWS docs for {search_phrase}`,activityPast:`Found {content.result.0.title|nothing in the AWS docs}`,request:`search the AWS docs for {search_phrase}`,toolType:`mcp`,description:`Search AWS documentation, blogs, and guides. Each result carries the matching page text.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://knowledge-mcp.global.api.aws`,mcpToolName:`aws___search_documentation`,inputJson:`{
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"search_phrase": { "type": "string", "description": "Keywords, with any error text verbatim", "maxLength": 500, "examples": ["Lambda cold start"] },
|
|
250
|
+
"limit": { "type": "integer", "description": "How many results", "minimum": 1, "maximum": 10 }
|
|
251
|
+
},
|
|
252
|
+
"required": ["search_phrase"]
|
|
253
|
+
}`,outputJson:`{
|
|
254
|
+
"type": "object",
|
|
255
|
+
"properties": {
|
|
256
|
+
"content": {
|
|
257
|
+
"type": "object",
|
|
258
|
+
"properties": {
|
|
259
|
+
"result": {
|
|
260
|
+
"type": "array",
|
|
261
|
+
"items": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"properties": {
|
|
264
|
+
"title": { "type": "string" },
|
|
265
|
+
"url": { "type": "string" },
|
|
266
|
+
"context": { "type": "string" }
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}`}},{id:`tool-hugging-face`,data:{toolName:`search_hugging_face`,activity:`Searching Hugging Face for {query}`,activityPast:`Searched Hugging Face for {query}`,request:`search Hugging Face for {query}`,toolType:`mcp`,description:`Search Hugging Face for models and datasets, with downloads, likes, task and a link for each.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://huggingface.co/mcp`,mcpToolName:`hub_repo_search`,inputJson:`{
|
|
274
|
+
"type": "object",
|
|
275
|
+
"properties": {
|
|
276
|
+
"query": { "type": "string", "description": "A model, dataset, or task to look for", "maxLength": 200, "examples": ["speech recognition"] },
|
|
277
|
+
"limit": { "type": "integer", "description": "How many results", "minimum": 1, "maximum": 10 }
|
|
278
|
+
},
|
|
279
|
+
"required": ["query"]
|
|
280
|
+
}`,outputJson:`{ "type": "string", "description": "Matching repositories, with their stats and links" }`}},{id:`tool-astro-docs`,data:{toolName:`search_astro_docs`,activity:`Searching the Astro docs for {query}`,activityPast:`Searched the Astro docs for {query}`,request:`search the Astro docs for {query}`,toolType:`mcp`,description:`Search the official Astro web framework documentation.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://mcp.docs.astro.build/mcp`,mcpToolName:`search_astro_docs`,inputJson:`{
|
|
281
|
+
"type": "object",
|
|
282
|
+
"properties": {
|
|
283
|
+
"query": { "type": "string", "description": "What to look up in the Astro docs", "maxLength": 500, "examples": ["content collections"] }
|
|
284
|
+
},
|
|
285
|
+
"required": ["query"]
|
|
286
|
+
}`,outputJson:`{
|
|
287
|
+
"type": "object",
|
|
288
|
+
"properties": {
|
|
289
|
+
"search_results": {
|
|
290
|
+
"type": "array",
|
|
291
|
+
"items": {
|
|
292
|
+
"type": "object",
|
|
293
|
+
"properties": {
|
|
294
|
+
"title": { "type": "string" },
|
|
295
|
+
"source_url": { "type": "string" },
|
|
296
|
+
"content": { "type": "string" }
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"required": ["search_results"]
|
|
302
|
+
}`}},{id:`tool-exa-search`,data:{toolName:`search_web`,activity:`Searching the web for {query}`,activityPast:`Searched the web for {query}`,request:`search the web for {query}`,toolType:`mcp`,description:`Search the web with Exa for current information, news, people, or companies. Describe the page you want, not just keywords.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],serverUrl:`https://mcp.exa.ai/mcp`,mcpToolName:`web_search_exa`,inputJson:`{
|
|
303
|
+
"type": "object",
|
|
304
|
+
"properties": {
|
|
305
|
+
"query": { "type": "string", "description": "A description of the ideal page", "minLength": 1, "maxLength": 500, "examples": ["blog post comparing Cloudflare Workers and AWS Lambda cold starts"] },
|
|
306
|
+
"numResults": { "type": "integer", "description": "How many results", "minimum": 1, "maximum": 10 }
|
|
307
|
+
},
|
|
308
|
+
"required": ["query"]
|
|
309
|
+
}`,outputJson:`{ "type": "string", "description": "Titles, links, and highlights from the top results" }`}},{id:`tool-discover-tools`,data:{toolName:`discover_tools`,toolType:`function`,description:`Discover bonus entertainment tools for this turn. Call before get_cat_fact, tell_joke, get_advice, or random_dog_image.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],inputJson:`{ "type": "object", "properties": {} }`,outputJson:`{
|
|
310
|
+
"type": "object",
|
|
311
|
+
"properties": {
|
|
312
|
+
"loaded": { "type": "array", "items": { "type": "string" } }
|
|
313
|
+
},
|
|
314
|
+
"required": ["loaded"]
|
|
315
|
+
}`,stubOutputJson:JSON.stringify({loaded:[...s]})}},{id:`tool-weather-label`,data:{toolName:`weather_code_label`,activity:`Reading the forecast`,activityPast:`Forecast: {label}`,request:`read the forecast`,toolType:`function`,description:`Translate an Open-Meteo WMO weathercode into a short label.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],inputJson:`{
|
|
316
|
+
"type": "object",
|
|
317
|
+
"properties": {
|
|
318
|
+
"weathercode": { "type": "integer", "description": "Open-Meteo WMO weather code", "examples": [2] }
|
|
319
|
+
},
|
|
320
|
+
"required": ["weathercode"]
|
|
321
|
+
}`,outputJson:`{
|
|
322
|
+
"type": "object",
|
|
323
|
+
"properties": {
|
|
324
|
+
"weathercode": { "type": "number" },
|
|
325
|
+
"label": { "type": "string" }
|
|
326
|
+
},
|
|
327
|
+
"required": ["label"]
|
|
328
|
+
}`}},{id:`tool-plan-day`,data:{toolName:`plan_day`,activity:`Planning a {focus} day in {destination}`,activityPast:`Planned your day in {destination}`,request:`plan a {focus} day in {destination}`,toolType:`function`,description:`Draft a simple day plan from destination context (studio stub).`,category:`demo`,access:`read-write`,permission:`auto`,loadTier:`T0`,paths:[`*`],inputJson:`{
|
|
329
|
+
"type": "object",
|
|
330
|
+
"properties": {
|
|
331
|
+
"destination": { "type": "string", "description": "City or region", "examples": ["Paris"] },
|
|
332
|
+
"focus": { "type": "string", "description": "What the day centres on, e.g. food or museums", "examples": ["museums"] }
|
|
333
|
+
},
|
|
334
|
+
"required": ["destination"]
|
|
335
|
+
}`,outputJson:`{
|
|
336
|
+
"type": "object",
|
|
337
|
+
"properties": {
|
|
338
|
+
"summary": { "type": "string" },
|
|
339
|
+
"stops": { "type": "array", "items": { "type": "string" } }
|
|
340
|
+
},
|
|
341
|
+
"required": ["summary", "stops"]
|
|
342
|
+
}`,stubOutputJson:`{
|
|
343
|
+
"summary": "A balanced day mixing local culture, a weather-aware outdoor block, and an easy evening.",
|
|
344
|
+
"stops": [
|
|
345
|
+
"Morning: coffee near the main square",
|
|
346
|
+
"Midday: flagship museum or gallery",
|
|
347
|
+
"Afternoon: walkable neighborhood based on weather",
|
|
348
|
+
"Evening: casual dinner with a local specialty"
|
|
349
|
+
]
|
|
350
|
+
}`}},{id:`tool-trip-budget`,data:{toolName:`trip_budget_estimate`,activity:`Estimating a {days}-day budget`,activityPast:`About {total} {currency} for {days} days`,request:`estimate a {days}-day budget`,toolType:`function`,description:`Estimate trip cost from days × per-diem (local math, no FX).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],inputJson:`{
|
|
351
|
+
"type": "object",
|
|
352
|
+
"properties": {
|
|
353
|
+
"days": { "type": "integer", "minimum": 1, "maximum": 30, "description": "Trip length in days", "examples": [5] },
|
|
354
|
+
"perDiem": { "type": "number", "minimum": 0, "description": "Daily budget", "examples": [150] },
|
|
355
|
+
"currency": { "type": "string", "description": "ISO currency code", "examples": ["EUR"] }
|
|
356
|
+
},
|
|
357
|
+
"required": ["days", "perDiem"]
|
|
358
|
+
}`,outputJson:`{
|
|
359
|
+
"type": "object",
|
|
360
|
+
"properties": {
|
|
361
|
+
"days": { "type": "number" },
|
|
362
|
+
"perDiem": { "type": "number" },
|
|
363
|
+
"currency": { "type": "string" },
|
|
364
|
+
"total": { "type": "number" }
|
|
365
|
+
},
|
|
366
|
+
"required": ["total"]
|
|
367
|
+
}`}},{id:`tool-packing`,data:{toolName:`packing_suggestions`,activity:`Packing for {activity}`,activityPast:`Packed for {activity}`,request:`pack for {activity}`,toolType:`function`,description:`Suggest a packing list from temperature and activity type.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],inputJson:`{
|
|
368
|
+
"type": "object",
|
|
369
|
+
"properties": {
|
|
370
|
+
"tempC": { "type": "number", "description": "Expected temperature in °C", "examples": [18] },
|
|
371
|
+
"activity": { "type": "string", "description": "What the trip is for, e.g. hiking or business", "examples": ["hiking"] }
|
|
372
|
+
},
|
|
373
|
+
"required": ["tempC"]
|
|
374
|
+
}`,outputJson:`{
|
|
375
|
+
"type": "object",
|
|
376
|
+
"properties": {
|
|
377
|
+
"tempC": { "type": "number" },
|
|
378
|
+
"activity": { "type": "string" },
|
|
379
|
+
"items": { "type": "array", "items": { "type": "string" } }
|
|
380
|
+
},
|
|
381
|
+
"required": ["items"]
|
|
382
|
+
}`}},{id:`tool-get-pokemon`,data:{toolName:`get_pokemon`,activity:`Looking up {name}`,activityPast:`Found {name}`,request:`look up {name}`,toolType:`http`,description:`Look up a Pokémon by name from the public PokéAPI.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://pokeapi.co/api/v2/pokemon/{name}`,method:`GET`,pathParams:[`name`],inputJson:`{
|
|
383
|
+
"type": "object",
|
|
384
|
+
"properties": {
|
|
385
|
+
"name": { "type": "string", "examples": ["pikachu"] }
|
|
386
|
+
},
|
|
387
|
+
"required": ["name"]
|
|
388
|
+
}`,outputJson:`{
|
|
389
|
+
"type": "object",
|
|
390
|
+
"properties": {
|
|
391
|
+
"name": { "type": "string" },
|
|
392
|
+
"height": { "type": "number" },
|
|
393
|
+
"weight": { "type": "number" }
|
|
394
|
+
}
|
|
395
|
+
}`}},{id:`tool-cat-fact`,data:{toolName:`get_cat_fact`,activity:`Finding a cat fact`,activityPast:`Found a cat fact`,request:`find a cat fact`,toolType:`http`,description:`Return a random cat fact (T2 — call discover_tools first).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T2`,paths:[`*`],endpoint:`https://catfact.ninja/fact?max_length=160`,method:`GET`,inputJson:`{ "type": "object", "properties": {} }`,outputJson:`{
|
|
396
|
+
"type": "object",
|
|
397
|
+
"properties": {
|
|
398
|
+
"fact": { "type": "string" },
|
|
399
|
+
"length": { "type": "number" }
|
|
400
|
+
},
|
|
401
|
+
"required": ["fact"]
|
|
402
|
+
}`}},{id:`tool-tell-joke`,data:{toolName:`tell_joke`,activity:`Thinking of a joke`,activityPast:`Found a joke`,request:`think of a joke`,toolType:`http`,description:`Tell a random joke (T2 — call discover_tools first).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T2`,paths:[`*`],endpoint:`https://official-joke-api.appspot.com/random_joke`,method:`GET`,inputJson:`{ "type": "object", "properties": {} }`,outputJson:`{
|
|
403
|
+
"type": "object",
|
|
404
|
+
"properties": {
|
|
405
|
+
"setup": { "type": "string" },
|
|
406
|
+
"punchline": { "type": "string" }
|
|
407
|
+
},
|
|
408
|
+
"required": ["setup", "punchline"]
|
|
409
|
+
}`}},{id:`tool-advice`,data:{toolName:`get_advice`,activity:`Finding some advice`,activityPast:`Found some advice`,request:`find some advice`,toolType:`http`,description:`Random travel-style advice slip (T2 — call discover_tools first).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T2`,paths:[`*`],endpoint:`https://api.adviceslip.com/advice`,method:`GET`,inputJson:`{ "type": "object", "properties": {} }`,outputJson:`{
|
|
410
|
+
"type": "object",
|
|
411
|
+
"properties": {
|
|
412
|
+
"slip": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"properties": {
|
|
415
|
+
"advice": { "type": "string" }
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}`}},{id:`tool-dog-image`,data:{toolName:`random_dog_image`,activity:`Fetching a dog`,activityPast:`Fetched a dog`,request:`fetch a dog`,toolType:`http`,description:`Random dog photo URL from dog.ceo (T2 — call discover_tools first).`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T2`,paths:[`*`],endpoint:`https://dog.ceo/api/breeds/image/random`,method:`GET`,inputJson:`{ "type": "object", "properties": {} }`,outputJson:`{
|
|
420
|
+
"type": "object",
|
|
421
|
+
"properties": {
|
|
422
|
+
"message": { "type": "string" },
|
|
423
|
+
"status": { "type": "string" }
|
|
424
|
+
},
|
|
425
|
+
"required": ["message"]
|
|
426
|
+
}`}},{id:`tool-read-repo-file`,data:{toolName:`read_repo_file`,activity:`Reading {path}`,activityPast:`Read {path}`,request:`read {path} in {owner}/{repo}`,toolType:`http`,description:`Read one text file from the default branch of a public GitHub repository, e.g. package.json or README.md.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://raw.githubusercontent.com/{owner}/{repo}/HEAD/{path}`,method:`GET`,pathParams:[`owner`,`repo`,`path`],inputJson:`{
|
|
427
|
+
"type": "object",
|
|
428
|
+
"properties": {
|
|
429
|
+
"owner": { "type": "string", "examples": ["denoland"], "description": "The repository's owner" },
|
|
430
|
+
"repo": { "type": "string", "examples": ["std"], "description": "The repository's name" },
|
|
431
|
+
"path": { "type": "string", "examples": ["README.md"], "description": "The file's path from the repository root, e.g. src/index.ts" }
|
|
432
|
+
},
|
|
433
|
+
"required": ["owner", "repo", "path"]
|
|
434
|
+
}`,outputJson:`{ "type": "string" }`}},{id:`tool-lookup-package`,data:{toolName:`lookup_package`,activity:`Looking up {name}`,activityPast:`Looked up {name}`,request:`look up {name}`,toolType:`http`,description:`Look up the latest published version of an npm package: its version, description, licence, and dependencies.`,category:`demo`,access:`read-only`,permission:`auto`,loadTier:`T0`,paths:[`*`],endpoint:`https://registry.npmjs.org/{name}/latest`,method:`GET`,pathParams:[`name`],inputJson:`{
|
|
435
|
+
"type": "object",
|
|
436
|
+
"properties": {
|
|
437
|
+
"name": { "type": "string", "examples": ["zod"], "description": "The package name, e.g. zod or @scope/name" }
|
|
438
|
+
},
|
|
439
|
+
"required": ["name"]
|
|
440
|
+
}`,outputJson:`{
|
|
441
|
+
"type": "object",
|
|
442
|
+
"properties": {
|
|
443
|
+
"name": { "type": "string" },
|
|
444
|
+
"version": { "type": "string" },
|
|
445
|
+
"description": { "type": "string" },
|
|
446
|
+
"license": { "type": "string" },
|
|
447
|
+
"dependencies": { "type": "object" },
|
|
448
|
+
"peerDependencies": { "type": "object" }
|
|
449
|
+
},
|
|
450
|
+
"required": ["name", "version"]
|
|
451
|
+
}`}}],m=[`geocode_city`,`search_places`,`reverse_geocode`,`lookup_postal_code`,`haversine_distance`,`get_weather`,`weather_code_label`,`get_sun_times`,`convert_currency`,`convert_units`,`plan_day`,`trip_budget_estimate`,`packing_suggestions`,`search_web`,`wikipedia_summary`,`discover_tools`,...s],h=[`ask_repo_docs`,`read_repo_file`,`lookup_package`,`find_library`,`read_library_docs`,`search_microsoft_docs`,`search_cloudflare_docs`,`list_aws_regions`,`search_aws_docs`,`search_hugging_face`,`search_astro_docs`,`search_web`,`wikipedia_summary`],g=[`get_weather`,`search_places`,`convert_currency`,`ask_repo_docs`,`random_dog_image`,`get_pokemon`,`archive_text_search`],_=`Role: Senior software architect who researches before advising.
|
|
452
|
+
|
|
453
|
+
Communication Standards:
|
|
454
|
+
- Readable Formatting: Use markdown where it helps the reader: short headings, bullet lists, code blocks for code, and tables for side-by-side comparisons.
|
|
455
|
+
- Answer First: Lead with the recommendation, then the reasons and the trade-offs. Name what you could not confirm.
|
|
456
|
+
|
|
457
|
+
Tool & Fact Grounding:
|
|
458
|
+
- Absolute Grounding: Ground claims about a library, a repository, a package version, or a cloud service in the tools before answering. Never invent an API, a version, or a default.
|
|
459
|
+
- Silent Execution: Never narrate tool calls or announce function names. Work findings into the answer.
|
|
460
|
+
- Complete Resolution: Finish multi-step research before you answer.
|
|
461
|
+
|
|
462
|
+
Audio briefings:
|
|
463
|
+
- When asked for a podcast, a briefing, or anything to listen to, write a short spoken script of what you found, in plain sentences with no markdown, and pass it to narrate. Then say in one line what the briefing covers.`,v=`Role: Elite, charismatic travel concierge, on a call.
|
|
464
|
+
|
|
465
|
+
Speaking:
|
|
466
|
+
- Speak in short, natural sentences. No lists, no markdown, no reading out of addresses, or codes unless asked.
|
|
467
|
+
- Give the recommendation first, then offer one next step.
|
|
468
|
+
|
|
469
|
+
Tool & Fact Grounding:
|
|
470
|
+
- Ground weather, currency, distances, and places in the tools before you answer. Never invent live data.
|
|
471
|
+
- Never name a tool or say that you are calling one.`;function y(){return p}function b(e){let t={},n=e.properties??{};for(let[e,r]of Object.entries(n)){let n=r.type;t[e]=n===`number`||n===`integer`?0:n===`boolean`?!1:n===`array`?[]:n===`object`?{}:`studio:${e}`}return Object.keys(t).length||(t.result=`studio stub`),t}function x(e,t){let i=l(e.trim());if(i)return i;let a=n(t,`Input`);return a.ok?r(a.schema):void 0}export{h as a,g as c,y as d,_ as i,v as l,b as n,d as o,u as r,m as s,x as t,f as u};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/studio-monaco-xfyfezQS.js","assets/editor.api-Cd3ViPQa.js","assets/preload-helper-DpV6A1kQ.js","assets/editor-DjpsE8to.css","assets/studio-monaco-CbKf90i6.css","assets/register-CDgivxvX.js","assets/studio-type-checker-BOvxudki.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{t as r}from"./preload-helper-DpV6A1kQ.js";import{Bt as i,D as a,T as o,Un as s,Vt as c,fr as l,k as u}from"./tool-schema-idaOe2nI.js";import{En as d,Sn as f,qt as p}from"./shaped-data-BcarWqd5.js";import{S as m,U as h,_ as g,h as _,m as v,v as y,y as b}from"./tree-DqyAMsbI.js";import{r as x}from"./live-ingress-lDUGPwth.js";import{n as S,t as C}from"./types-BhfXQCLx.js";import{n as w}from"./stub-DhdcU_Ew.js";import{F as T,M as E,k as ee,r as te}from"./workspace-DZALqEDX.js";import{t as ne}from"./PaneState-BvA2tLQg.js";import{K as re}from"./index-CvvmFKgS.js";var D=class extends Error{line;column;constructor(e,t,n){super(e),this.line=t,this.column=n}},ie=class{text;of;i=0;line=1;column=1;constructor(e,t=`profile`){this.text=e,this.of=t}get done(){return this.i>=this.text.length}pos(){return{line:this.line,column:this.column}}fail(e){throw new D(e,this.line,this.column)}peek(e=0){return this.text[this.i+e]??``}bump(){let e=this.text[this.i]??``;return this.i+=1,e===`
|
|
3
|
+
`?(this.line+=1,this.column=1):this.column+=1,e}skip(){for(;;){let e=this.peek();if(e===` `||e===` `||e===`
|
|
4
|
+
`||e===`\r`||e===``)this.bump();else if(e===`/`&&this.peek(1)===`/`)for(;!this.done&&this.peek()!==`
|
|
5
|
+
`;)this.bump();else if(e===`/`&&this.peek(1)===`*`){for(this.bump(),this.bump();!this.done&&(this.peek()!==`*`||this.peek(1)!==`/`);)this.bump();this.done&&this.fail(`This comment never closes.`),this.bump(),this.bump()}else return}}starts(e){return this.skip(),this.text.startsWith(e,this.i)}eat(e){if(!this.starts(e))return!1;for(let t=0;t<e.length;t+=1)this.bump();return!0}expect(e){this.eat(e)||this.fail(`Expected '${e}'.`)}ident(){this.skip();let e=this.peek();if(!/^[A-Za-z_$]/.test(e))return;let t=``;for(;/^[A-Za-z0-9_$]/.test(this.peek());)t+=this.bump();return t}expectIdent(){let e=this.ident();return e===void 0&&this.fail(`Expected a name.`),e}peekIdent(){return this.skip(),/^[A-Za-z_$][A-Za-z0-9_$]*/.exec(this.text.slice(this.i))?.[0]}rest(){return this.skip(),this.text.slice(this.i)}};function O(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function k(e){e.skip();let t=e.peek();t!==`'`&&t!==`"`&&e.fail(`Expected a string.`),e.bump();let n=``;for(;!e.done&&e.peek()!==t;){let t=e.bump();if(t!==`\\`){n+=t;continue}let r=e.bump(),i={n:`
|
|
6
|
+
`,r:`\r`,t:` `,"\\":`\\`,"'":`'`,'"':`"`};if(r in i)n+=i[r];else if(r===`u`){let t=``;for(let n=0;n<4;n+=1)t+=e.bump();n+=String.fromCharCode(Number.parseInt(t,16))}else n+=r}return e.peek()!==t&&e.fail(`This string never closes.`),e.bump(),n}function ae(e){e.skip();let t=e.pos(),n=``;for(e.peek()===`-`&&(n+=e.bump());/^[0-9.eE+-]/.test(e.peek())&&n.length<64;)n+=e.bump();let r=Number(n);if(!Number.isFinite(r))throw new D(`'${n}' is not a number.`,t.line,t.column);return r}function oe(e,t,n,r){let i=0;for(;!e.done;){if(r()&&i===0)return;let a=e.peek();a===`'`||a===`"`?k(e):(a!==``&&t.includes(a)?i+=1:a!==``&&n.includes(a)&&--i,e.bump())}}function se(e){oe(e,`<([{`,`>)]}`,()=>(e.skip(),e.peek()===`;`||e.peek()===`
|
|
7
|
+
`))}function ce(e){oe(e,`{([`,`})]`,()=>e.peek()===`;`),e.peek()===`;`&&e.bump()}function le(e,t,n){e.expect(`{`);let r={};for(;!e.eat(`}`);){e.eat(`...`)&&e.fail(`This file doesn't use spreads.`);let i=e.pos(),a;if(a=e.peek()===`'`||e.peek()===`"`?k(e):e.expectIdent(),a===`__proto__`)throw new D(`'__proto__' sets what an object inherits, not a setting.`,i.line,i.column);if(Object.hasOwn(r,a))throw new D(`'${a}' is set twice.`,i.line,i.column);let o=t?`${t}.${a}`:a;n.push({path:o,line:i.line,column:i.column}),e.expect(`:`),r[a]=F(e,o,n),e.eat(`,`),e.done&&e.fail(`This object never closes.`)}return r}function ue(e,t,n){e.expect(`[`);let r=[],i=0;for(;!e.eat(`]`);){e.eat(`...`)&&e.fail(`This file doesn't use spreads.`),e.skip();let a=e.pos(),o=t?`${t}.${String(i)}`:String(i);n.push({path:o,line:a.line,column:a.column}),r.push(F(e,o,n)),i+=1,e.eat(`,`),e.done&&e.fail(`This array never closes.`)}return r}function de(e,t,n){let[r]=t;return e!==`z.fromJSONSchema`&&n.fail(`The studio reads a schema as JSON Schema: z.fromJSONSchema({ ... }), not '${e}'.`),O(r)||n.fail(`z.fromJSONSchema() needs a schema.`),r}function A(e){return O(e)&&e.kind===`member`}function fe(e,t){return{kind:`member`,object:e,name:t}}function pe(e){if(typeof e.object==`string`)return`${e.object}.${e.name}`;if(A(e.object)){let t=pe(e.object);return t?`${t}.${e.name}`:void 0}}function j(e,t,n){let r=e[0];return O(r)||t.fail(n),r}function me(e,t,n){let r=j(e,t,`registerTool() needs the tool object.`),i=r.type,a=typeof i==`string`&&C.includes(i);if(i!==void 0&&!a){let e=n.findLast(e=>e.path===`type`)??t.pos();throw new D(S,e.line,e.column)}return{kind:`registerTool`,tool:r}}function he(e,t,n,r){if(n.of===`provider`){if(e!==`registerProvider`)return n.fail(`'${e}' isn't part of a provider's code.`);let[r,i={}]=t;return typeof r!=`string`&&n.fail(`registerProvider() needs the definition it registers from.`),(!O(i)||t.length>2)&&n.fail(`registerProvider() takes the definition and its settings.`),{kind:`provider`,definition:r,spec:i}}return e===`compileDetect`?j(t,n,`compileDetect() needs the detect object.`):e===`defineProfile`?j(t,n,`defineProfile() needs the profile object.`):e===`registerTool`?me(t,n,r):e===`registerStructured`?{kind:`registerStructured`,args:t}:e===`registerProfile`||e===`registerProvider`?{kind:e}:n.fail(`'${e}' isn't part of this file.`)}function ge(e,t,n){return(typeof t!=`string`||e.some(e=>typeof e!=`string`))&&n.fail(`.join() here joins lines of one string.`),e.join(t)}function _e(e,t,n){if(e.name===`join`&&Array.isArray(e.object))return ge(e.object,t[0],n);if(e.name===`resolve`&&e.object===`Promise`)return t[0];let r=pe(e);return r?.startsWith(`z.`)?de(r,t,n):n.fail(`This call isn't part of this file.`)}function ve(e,t,n,r){return typeof e==`string`?he(e,t,n,r):(A(e)||n.fail(`This call isn't part of this file.`),_e(e,t,n))}function ye(e){return/^(async\s*)?\(\s*\)\s*=>/.test(e.rest())}function be(e,t,n){return e.peekIdent()===`async`&&e.expectIdent(),e.expect(`(`),e.eat(`)`)||e.fail(`A handler here takes no arguments. It returns a fixed value.`),e.expect(`=>`),F(e,t,n)}var M=class{name;constructor(e){this.name=e}};function N(e){return e instanceof M?e.name:e}function P(e,t,n){return ye(e)?be(e,t,n):Se(xe(e,t,n),e,t,n)}function xe(e,t,n){e.skip();let r=e.peek();if(r===`'`||r===`"`)return k(e);if(r==="`"&&e.fail(`This file doesn't use template strings.`),r===`-`||/^[0-9]/.test(r))return ae(e);if(r===`{`)return le(e,t,n);if(r===`[`)return ue(e,t,n);if(r===`(`){e.bump();let r=P(e,t,n);return e.expect(`)`),r}let i=e.ident();return i===`true`?!0:i===`false`?!1:i===`null`?null:(i===void 0&&e.fail(`Expected a value.`),new M(i))}function F(e,t,n){e.skip();let r=e.pos(),i=P(e,t,n);if(!(i instanceof M))return i;if(i.name!==`undefined`)throw new D(`'${i.name}' is set somewhere else. Write its value here.`,r.line,r.column)}function Se(e,t,n,r){let i=e;for(;;)if(t.eat(`.`)){let e=t.expectIdent();i=fe(N(i),e)}else if(t.eat(`(`)){let e=r.length,a=[];for(;!t.eat(`)`);)a.push(N(P(t,n,r))),t.eat(`,`),t.done&&t.fail(`This call never closes.`);i=ve(N(i),a,t,r.slice(e))}else return A(i)&&t.fail(`This file doesn't stop on a property.`),i}function Ce(e,t){e.expectIdent();let n=e.expectIdent();e.expect(`=`);let r=P(e,``,t.spans);(e.eat(`satisfies`)||e.eat(`as`))&&se(e),e.eat(`;`),e.of===`provider`?e.fail(`A provider's code is its registerProvider() call and nothing else.`):n===`profile`?(O(r)||e.fail(`profile has to be the defineProfile() object.`),t.profile&&e.fail(`This file defines two profiles.`),t.profile=r):n===`questions`?(O(r)||e.fail(`questions has to be an object.`),t.questions=r):n===`images`&&(O(r)||e.fail(`images has to be an object.`),t.images=r)}function we(e,t){let n=P(e,``,t.spans);if(e.eat(`;`),O(n)){if(n.kind===`provider`&&typeof n.definition==`string`&&O(n.spec))t.provider&&e.fail(`This code registers two providers.`),t.provider={definition:n.definition,spec:n.spec};else if(n.kind===`registerTool`){let r=n.tool;O(r)||e.fail(`registerTool() needs the tool object.`),t.tools.push(r)}else if(n.kind===`registerStructured`){let[r,i]=Array.isArray(n.args)?n.args:[];(typeof r!=`string`||!O(i))&&e.fail(`registerStructured() needs an id and a spec.`),t.structured={id:r,spec:i}}}}function I(e,t=`profile`){let n=new ie(e,t),r={tools:[],spans:[]};for(n.skip();!n.done;n.skip())n.peekIdent()===`import`?(n.expectIdent(),ce(n)):(n.peekIdent()===`export`&&n.expectIdent(),n.peekIdent()===`const`?Ce(n,r):we(n,r));return t===`provider`?r.provider||n.fail(`This code needs registerProvider().`):r.profile||n.fail(`This file needs defineProfile().`),r}function L(e,t=``){return typeof e==`string`?e:t}function R(e){return typeof e==`number`?e:null}function Te(e,t){if(e===void 0)return``;if(typeof e==`string`)return e;if(!Array.isArray(e))throw new D(t,1,1);return e.map(e=>{if(typeof e==`string`)return e;if(O(e)&&typeof e.private==`string`)return`{private: ${e.private}}`;throw new D(t,1,1)}).join(``)}function z(e){return e===void 0?``:JSON.stringify(e,null,2)}function Ee(e,t){return T(e)===T(t)}function B(e){return O(e)?JSON.stringify(e,null,2):JSON.stringify(e)}function V(e){return Array.isArray(e)?e.map(e=>{if(!O(e)||typeof e.name!=`string`)throw new D(`A pattern needs a name.`,1,1);return Array.isArray(e.words)?{name:e.name,kind:`words`,pattern:``,flags:``,words:e.words.filter(e=>typeof e==`string`)}:{name:e.name,kind:`pattern`,pattern:L(e.pattern),flags:L(e.flags),words:[]}}):[]}function H(e){return O(e)?e:void 0}function U(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function W(e){return Array.isArray(e)?U(e):void 0}function G(e){return L(e)||void 0}function K(e){return Array.isArray(e)?U(e).join(`
|
|
8
|
+
`)||void 0:G(e)}function q(e,t,n){return O(e)?t(e):n}function De(e,t,n){if(!O(n))return;if(Array.isArray(n.names)){e.innocentNames=U(n.names);return}if(!(t in e.allow))return;let r=e.allow[t];r.hosts=U(n.hosts),r.fromTools=n.fromTools!==!1}function Oe(e,t,n){let r=H(n.at)??{};e.detect[t]={...e.detect[t],...r};let i=e.sources[t];i&&(n.theorem===!1&&(i.theorem=!1),i.patterns=V(n.patterns),i.hint=L(n.hint)),De(e,t,n.allow)}function ke(e,t){let n=d(f,()=>`ignore`);return O(t.at)&&Object.assign(n,t.at),{key:e,label:L(t.label),at:n,patterns:V(t.patterns),hint:L(t.hint)}}function Ae(e){let t=g().guardrails;if(!O(e))return t;let n={detect:structuredClone(t.detect),sources:structuredClone(t.sources),allow:structuredClone(t.allow),innocentNames:[...t.innocentNames]},r=[],i=new Set(p);for(let[t,a]of Object.entries(H(e.detect)??{}))O(a)&&(i.has(t)?Oe(n,t,a):r.push(ke(t,a)));let a=H(e.quota),o=H(e.blockedReply),s=H(e.network),c=H(e.taint);return{...t,...n,own:r,quotaEnabled:a!==void 0,quotaPerDay:R(a?.perDay),blockedReplyOnBlock:L(o?.onBlock),blockedReplyMaxRetries:R(o?.maxRetries),allowPrivateNetworks:s?.allowPrivateNetworks===!0,allowedHosts:U(s?.allowedHosts),allowedSchemes:U(s?.allowedSchemes),taintAfterRemoteRead:L(c?.afterRemoteRead),taintRemoteDestination:L(c?.remoteDestination)}}var je={"continue.instruction":(e,t)=>{e.turnBehaviour.continueInstruction=t},"canary.bind_note":(e,t)=>{e.guardrails.canaryBindNote=t},"quota.exhausted":(e,t)=>{e.guardrails.quotaMessage=t},"repair.default_guidance":(e,t)=>{e.outputs.repairGuidance=t},"egress.default_repair_guidance":(e,t)=>{e.guardrails.egressRepairGuidance=t},"egress.refusal":(e,t)=>{e.guardrails.egressRefusal=t}};function Me(e,t){if(!O(t))return;let n={};for(let[r,i]of Object.entries(t)){if(typeof i!=`string`)continue;let t=je[r];t?t(e,i):v[r]||(n[r]=i)}e.labels=n}function Ne(e,t,n,r,i){let a=n??y({modelId:e});if(!O(t))return{...a,modelId:e};let o=O(t.efforts)?Object.entries(t.efforts).map(([e,t])=>({alias:e,level:t})):[],s=O(t.compaction)?t.compaction:void 0,c=L(s?.profile),l=R(t.timeoutMs);return{...a,modelId:e,protocol:L(t.protocol,a.protocol),provider:L(t.provider,a.provider),apiId:L(t.apiId),options:H(t.options)??{},timeoutMs:l,efforts:o,defaultEffort:L(t.defaultEffort),allowEffortSelect:t.allowEffortSelect===!0,summaries:typeof t.summaries==`boolean`?t.summaries:null,maxOutputTokens:R(t.maxOutputTokens),temperature:typeof t.temperature==`number`?t.temperature:null,builtInTools:Array.isArray(t.builtInTools)?t.builtInTools.filter(e=>typeof e==`string`):[],keySlot:L(t.keySlot),fallbackKeySlot:L(t.fallbackKeySlot),compactTiming:L(s?.timing),compactMaxTokens:R(s?.maxTokens),compactAt:typeof s?.compactAt==`number`?s.compactAt:void 0,compactKeep:R(s?.previousExchanges),compactMeter:L(s?.meter),compactWith:c?Pe(c,r,`models.${e}.compaction.profile`,i):``}}function Pe(e,t,n,r){return t?t(e)??X(r,n,`'${e}' is not an agent here, so it can't write this model's summaries.`):``}function Fe(e,t){let n=t.output;if(e===`function`&&O(t.handler)&&O(n)&&!Ee(t.handler,w(n)))return z(t.handler)}function Ie(e){let t=H(e.mapping)??{};return{endpoint:G(e.endpoint),method:G(e.method),headersJson:O(e.headers)?z(e.headers):void 0,pathParams:W(t.pathParams),queryParams:W(t.queryParams),bodyParam:G(t.bodyParam),serverUrl:G(e.serverUrl),mcpToolName:G(e.mcpToolName)}}function Le(e){let t=H(e.auth)??{};return{authType:L(t.type),authSlot:G(t.slot),authService:G(t.service),authHeaderName:G(t.headerName),authHeaderPrefix:typeof t.headerPrefix==`string`?t.headerPrefix:void 0,authQueryParam:G(t.queryParam),authUnauthenticated:L(t.onUnauthenticated),authScopes:W(t.scopes),authClientId:G(t.clientId),authRedirectUri:G(t.redirectUri)}}function Re(e,t,n){let r=t??b(),i=L(e.type,r.toolType),a=H(e.labels)??{},o=L(e.profile),s=e.answeredBy===`page`;return{...r,key:t?.key??m(`tool`),toolName:L(e.name,r.toolName),toolType:i,description:L(e.description),category:L(e.category,`studio`),access:L(e.access,r.access),permission:L(e.permission,r.permission),loadTier:L(e.loadTier,r.loadTier),paths:W(e.paths)??[`*`],inputJson:e.input===void 0?r.inputJson:B(e.input),outputJson:e.output===void 0?r.outputJson:B(e.output),activity:K(a.activity),activityPast:K(a.activityPast),activityFailed:K(a.activityFailed),request:K(a.request),stubOutputJson:s?t?.stubOutputJson:Fe(i,e),answeredBy:s?`page`:void 0,...Ie(e),agentKey:o?n?.(o):void 0,maxCallsPerTurn:R(e.maxCallsPerTurn),...Le(e)}}function ze(e,t){let n=new Map(t.map(e=>[e.id,e]));return Object.entries(e).map(([e,t])=>{let r=n.get(e),i=O(t)?t:{},a=L(i.type,`choice`),o=i.criteria,s=Array.isArray(o)?o.map((e,t)=>({key:r?.criteria[t]?.key??m(`criterion`),label:``,text:L(e)})):O(o)?Object.entries(o).map(([e,t],n)=>({key:r?.criteria[n]?.key??m(`criterion`),label:e,text:L(t)})):[];return{key:r?.key??m(`question`),id:e,type:a,instructions:L(i.instructions),criteria:s,...a===`box`&&L(i.image)?{image:L(i.image)}:{}}})}function Be(e){if(!Array.isArray(e))return[];let t=[];for(let n of e)if(O(n)){if(typeof n.uri==`string`){let e=L(n.name);t.push({key:m(`reference`),uri:n.uri,...e?{name:e}:{}})}else typeof n.data==`string`&&t.push({key:m(`reference`),name:L(n.name),mimeType:L(n.mimeType),data:n.data})}return t}function Ve(e,t){return e?h.filter(n=>!n.optional||n.role===`branch`||!n.profileTypes.includes(e)?!1:n.profilePath in t).map(e=>e.id):g().included}function He(e,t,n,r){let i=[],a=new Set;for(let o of e){let e=Re(o,t.get(L(o.name)),n);if(e.toolName&&a.has(e.toolName)){let t=r.filter(e=>e.path===`name`)[i.length]??{line:1,column:1};throw new D(`'${e.toolName}' is registered twice.`,t.line,t.column)}e.toolName&&a.add(e.toolName),i.push(e)}return i}function Ue(e,t,n){if(t===void 0)return[];let r=n.findLast(e=>e.path===`tools.allow`)??{line:1,column:1};if(!Array.isArray(t))throw new D(`tools.allow has to be a list of tool names.`,r.line,r.column);let i=new Map(e.map(e=>[e.toolName,e])),a=[],o=new Set;for(let[e,s]of t.entries()){let t=n.find(t=>t.path===`tools.allow.${String(e)}`)??r;if(typeof s!=`string`||s.trim()===``)throw new D(`tools.allow names tools.`,t.line,t.column);if(o.has(s))throw new D(`'${s}' is listed twice in tools.allow.`,t.line,t.column);o.add(s);let c=i.get(s);if(!c)throw new D(`'${s}' is in tools.allow, and this file has no registerTool for it.`,t.line,t.column);a.push(c)}return a}function We(e,t,n){let r=H(t.identity)??{},i=r.systemByRole;return{...e,agentId:L(t.id),profileType:n,handle:L(r.handle),system:Te(r.system,`The system prompt has to be text.`),systemByRoleJson:O(i)||Array.isArray(i)?z(i):``}}function Ge(e){return{...O(e.providerContinuation)&&(e.providerContinuation.history===`provider`||e.providerContinuation.history===`stateless`)?{providerHistory:e.providerContinuation.history}:{},defaultModel:L(e.defaultModel),allowModelSelect:e.allowModelSelect===!0,maxSteps:R(e.maxSteps),key:L(e.key),fallbackKey:L(e.fallbackKey)}}function Ke(e){return s.includes(e)}function qe(e){let t=H(e.context);return{text:e.text!==!1,attachmentsAccept:U(H(e.attachments)?.accept),voiceAccept:U(H(e.voice)?.accept),maxFiles:R(e.maxFiles),maxBytes:R(e.maxBytes),maxTurnBytes:R(e.maxTurnBytes),limitsByMimeJson:z(e.limitsByMime),slotsJson:z(e.slots),contextFrom:U(t?.from).filter(Ke),contextMaxChars:R(t?.maxChars)}}function Je(e){return Object.fromEntries(Object.entries(e??{}).map(([e,t])=>[e,H(t)?.onFail===`fix`?`fix`:`drop`]))}function Ye(e,t){let n=t?.id??L(e?.structured),r=H(e?.streaming),i=H(e?.validation);return{mode:n?`structured`:`text`,schemaId:n,schemaJson:z(t?.spec.jsonSchema),streamMode:L(r?.mode),streamThoughts:r?.streamThoughts!==!1,validationEnabled:i!==void 0,maxRetries:R(i?.maxRetries),itemRules:Je(H(i?.items)),repairGuidance:``}}function Xe(e){let t=H(e.resumption),n=Array.isArray(t?.allowContinue)?t.allowContinue:[...i],r=Array.isArray(t?.autoContinue)?t.autoContinue:[...c];return{resumeEnabled:n.length>0||r.length>0,allowContinue:n,autoContinue:r,maxContinues:R(t?.maxContinues),continueInstruction:``,allowSteering:e.allowSteering!==!1,atStepLimit:e.atStepLimit===`answer`?`answer`:`stop`}}function Ze(e){let t=g().observability,n=typeof e.writeTo==`string`&&e.writeTo?e.writeTo:t.destination;return{...t,writeTo:e.writeTo!==!1&&n,destination:n,sampleRate:typeof e.sampleRate==`number`?e.sampleRate:t.sampleRate,include:{...t.include,...H(e.include)},scrub:{...t.scrub,...H(e.scrub)},retainForDays:R(e.retainForDays),rotateAfterMiB:R(e.rotateAfterMiB),resourceJson:z(e.resource)}}function Qe(e){return{aspectRatio:L(e.aspectRatio),resolution:L(e.resolution),mimeType:L(e.mimeType),quality:L(e.quality),background:L(e.background),n:R(e.n),seed:R(e.seed),outputCompression:R(e.outputCompression),includeText:e.includeText===!0,references:Be(e.references)}}function $e(e){return{voice:L(e.voice),style:L(e.style),speed:R(e.speed),format:L(e.format)}}function J(e,t){let n=e[t];return typeof n==`boolean`?n:x(t)}function et(e){let t=H(e.ingress)??{},n=H(e.vad)??{},r=H(e.contextCompression),i=H(r?.slidingWindow),a=H(e.transcription);return{ingressAudio:J(t,`audio`),ingressVideo:J(t,`video`),ingressText:J(t,`text`),voice:L(e.voice),sessionResumption:e.sessionResumption===!0,greeting:L(e.greeting),resumedPrompt:L(H(e.resumed)?.prompt),resumedAfterMs:R(H(e.resumed)?.afterMs),contextCompression:r!==void 0,compressionTriggerTokens:R(r?.triggerTokens),compressionTargetTokens:R(i?.targetTokens),transcriptionInput:a?.input===!0,transcriptionOutput:a?.output===!0,vadActivityHandling:L(n.activityHandling),vadStartSensitivity:L(n.startSensitivity),vadEndSensitivity:L(n.endSensitivity),vadPrefixPaddingMs:R(n.prefixPaddingMs),vadSilenceDurationMs:R(n.silenceDurationMs)}}function tt(e,t,n){let r=R(H(t.profile?.inputs)?.maxStateBytes);return{contract:L(e.contract),maxStateBytes:r,questions:t.questions?ze(t.questions,n.questions):[],images:t.images?nt(t.images,n.images):[]}}function nt(e,t){let n=new Map(t.map(e=>[e.name,e]));return Object.entries(e).map(([e,t])=>{let r=e.replace(/^<|>$/g,``),i=O(t)?t:{};return{key:n.get(r)?.key??m(`image`),name:r,mimeType:L(i.mimeType),data:L(i.data)}})}function rt(e){let t=L(e.type);if(t&&!_.includes(t))throw new D(`'${t}' is not a profile type.`,1,1);return t}var it=[`turnBehaviour.atStepLimit`,`outputs.validation.items.*.onFail`];function at(e,t){for(let n of it){let r=l(n)?.options??[];for(let[i,a]of Y(e,n.split(`.`),[]))a!==void 0&&!r.includes(a)&&X(t,i,`${JSON.stringify(a)} is not one of ${r.map(e=>`'${e}'`).join(`, `)}.`)}}function Y(e,t,n){let[r,...i]=t;return r===void 0?[[n.join(`.`),e]]:O(e)?(r===`*`?Object.keys(e):[r]).flatMap(t=>Y(e[t],i,[...n,t])):[]}function ot(e,t,n){let r=e.profile??{},i=rt(r);at(r,e.spans);let a=new Map(t.modelBindings.map(e=>[e.modelId,e])),o=new Map(t.toolSpecs.map(e=>[e.toolName,e])),s=H(r.tools)??{},c=H(r.inputs),l=H(r.outputs),u={...t,identity:We(t.identity,r,i),included:Ve(i,r),models:Ge(r),modelBindings:Object.entries(H(r.models)??{}).map(([t,r])=>Ne(t,r,a.get(t),n,e.spans)),tools:{t2Loader:L(s.t2Loader),parallel:s.parallel===!0},toolSpecs:[],inputs:c&&i!==`decision`?qe(c):t.inputs,outputs:l||e.structured?Ye(l,e.structured):t.outputs,turnBehaviour:q(r.turnBehaviour,Xe,t.turnBehaviour),guardrails:q(r.guardrails,Ae,t.guardrails),observability:q(r.observability,Ze,t.observability),image:q(r.image,Qe,t.image),speech:q(r.speech,$e,t.speech),live:q(r.live,et,t.live),decision:q(r.decision,n=>tt(n,e,t.decision),t.decision),labels:{}},d=He(e.tools,o,n,e.spans),f=Ue(d,s.allow,e.spans);u.toolSpecs=f;let p=new Set(f.map(e=>e.toolName));return u.tools.t2Loader&&!p.has(u.tools.t2Loader)&&(u.tools={...u.tools,t2Loader:``}),Me(u,r.labels),{draft:u,registered:d}}function st(e,t,n){try{let r=I(e),{draft:i,registered:a}=ot(r,t,n);return{ok:!0,draft:i,spans:r.spans,registered:a}}catch(e){if(e instanceof D)return{ok:!1,errors:[{message:e.message,line:e.line,column:e.column}]};throw e}}function X(e,t,n){let r=e.findLast(e=>e.path===t)??{line:1,column:1};throw new D(n,r.line,r.column)}var ct=new Set([`id`,`connection`,`keySlot`,`fallbackKeySlot`]);function lt(e,t,n){let{spec:r}=e;for(let e of Object.keys(r))ct.has(e)||X(n,e,`'${e}' isn't a provider setting the studio holds.`);r.id!==t.id&&X(n,`id`,`The id stays '${t.id}': models and code name the provider by it.`);let i=a(e.definition);if(!i){let t=u().flatMap(e=>o(e)??[]).join(`, `);X(n,``,`'${e.definition}' isn't one of the kernel's providers: ${t}.`)}let s=r.connection===void 0?{}:ut(r.connection,n),c=Object.keys(s).length===0&&t.connection===void 0,l={id:t.id,definition:i,...c?{}:{connection:s}};for(let e of[`keySlot`,`fallbackKeySlot`]){let t=r[e];t!==void 0&&(typeof t!=`string`&&X(n,e,`${e} names a key slot.`),l[e]=t)}return l}function ut(e,t){let n=`connection holds text settings here.`,r={};O(e)||X(t,`connection`,n);for(let[i,a]of Object.entries(e))typeof a!=`string`&&X(t,`connection`,n),r[i]=a;return r}function dt(e,t){try{let n=I(e,`provider`);if(!n.provider)throw new D(`This code needs registerProvider().`,1,1);return{ok:!0,provider:lt(n.provider,t,n.spans),spans:n.spans}}catch(e){if(e instanceof D)return{ok:!1,errors:[{message:e.message,line:e.line,column:e.column}]};throw e}}var Z=e(n(),1),Q=t(),ft=300,pt=2e3;function mt({editor:e,monaco:t,spans:n,errors:r},i){let a=e?.getModel();t&&a&&t.editor.setModelMarkers(a,`studio`,[...r.map(e=>$(t,e.line,e.column,e.message)),...gt(t,n,i)])}function ht({text:e,hold:t,isReadOnly:n=!1,issues:i,onApply:a}){let o=(0,Z.useRef)(null),s=(0,Z.useRef)(a),c=(0,Z.useRef)(e),l=(0,Z.useRef)(n);l.current=n;let u=(0,Z.useRef)(i),d=(0,Z.useRef)({spans:[],errors:[],setting:!1,dirty:!1});return s.current=a,c.current=e,u.current=i,(0,Z.useEffect)(()=>{let e=o.current;if(!e)return;let t={disposed:!1},n,i,a=0,f,p=!1,m=!1,h=()=>{a+=1,i&&clearTimeout(i),i=void 0,f?.stop(),f=void 0,p=!1,m=!1},g=t=>e.contains(t)?!0:t instanceof Element&&!!t.closest(`.suggest-widget, .parameter-hints-widget, .monaco-hover, .monaco-menu-container, .context-view`),_=()=>!!document.querySelector(`.suggest-widget.visible, .parameter-hints-widget.visible`),v,y=()=>{mt(d.current,u.current)};return(async()=>{let o=await r(()=>import(`./studio-monaco-xfyfezQS.js`),__vite__mapDeps([0,1,2,3,4]));await r(()=>import(`./register-CDgivxvX.js`),__vite__mapDeps([5,2,1,3]));let u=(await r(async()=>{let{default:e}=await import(`./editor.worker-6GY8RhDc.js`);return{default:e}},[])).default;if(self.MonacoEnvironment={getWorker(){return new u}},t.disposed||!e.isConnected)return;let b=document.documentElement.dataset.theme===`dark`||globalThis.matchMedia(`(prefers-color-scheme: dark)`).matches,x=o.Uri.parse(`file:///agent.ts`);o.editor.getModel(x)?.dispose();let S=o.editor.createModel(c.current,`typescript`,x),C=o.editor.create(e,{model:S,readOnly:l.current,language:`typescript`,theme:b?`vs-dark`:`vs`,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,wrappingIndent:`indent`,scrollBeyondLastLine:!1,automaticLayout:!0,fixedOverflowWidgets:!0,tabSize:2,padding:{top:12},quickSuggestions:{other:!0,comments:!1,strings:!0},suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:`on`,tabCompletion:`on`,wordBasedSuggestions:`currentDocument`,parameterHints:{enabled:!0},suggest:{preview:!0,showIcons:!0}});d.current.editor=C,d.current.monaco=o;let w=()=>{i&&clearTimeout(i),i=setTimeout(()=>{t.disposed||(_()?w():h())},pt)},T=()=>{if(f){m&&w();return}if(p)return;let e=a,n=()=>t.disposed||e!==a;p=!0,r(async()=>{let{openTypeChecker:e}=await import(`./studio-type-checker-BOvxudki.js`);return{openTypeChecker:e}},__vite__mapDeps([6,2])).then(({openTypeChecker:r})=>{if(n())return;let i=r(o,C,()=>{t.disposed||e!==a||(m=!0,w())});n()?i.stop():f=i}).catch(()=>{}).finally(()=>{e===a&&(p=!1)})};C.onKeyDown(e=>{let t=e.browserEvent;t.metaKey||t.ctrlKey||t.altKey||m&&w()});let E=e=>{let t=e.target;t instanceof Node&&!g(t)&&h()};document.addEventListener(`pointerdown`,E,!0),v=()=>{document.removeEventListener(`pointerdown`,E,!0)},C.onDidBlurEditorText(()=>{queueMicrotask(()=>{if(t.disposed||C.hasTextFocus())return;let e=document.activeElement;e&&g(e)||h()})}),C.onDidChangeModelContent(()=>{if(d.current.setting)return;T();let e=C.getValue();d.current.dirty=e!==c.current,n&&clearTimeout(n),n=setTimeout(()=>{let t=s.current(e);d.current.spans=t.spans,d.current.errors=t.errors,y()},ft)}),y()})(),()=>{t.disposed=!0,v?.(),h(),n&&clearTimeout(n);let e=d.current.editor?.getModel();d.current.editor?.dispose(),e?.dispose(),d.current.editor=void 0}},[]),(0,Z.useEffect)(()=>{let{editor:n}=d.current;n&&!t&&(d.current.dirty&&n.getValue()!==e||(n.getValue()===e||(d.current.setting=!0,n.setValue(e),d.current.setting=!1),d.current.dirty=!1))},[e,t]),(0,Z.useEffect)(()=>{d.current.editor?.updateOptions({readOnly:n})},[n]),(0,Z.useEffect)(()=>{mt(d.current,i)},[i]),(0,Q.jsx)(`div`,{ref:o,className:`studio-fill`})}function $(e,t,n,r){return{startLineNumber:t,startColumn:n,endLineNumber:t,endColumn:n+1,message:r,severity:e.MarkerSeverity.Error}}function gt(e,t,n){return n.flatMap(n=>{let r=n.field?`${n.nodeId}.${n.field}`:n.nodeId,i=t.find(e=>e.path===r)??(n.field?t.find(e=>e.path===n.field):void 0);return i?[$(e,i.line,i.column,n.message)]:[]})}function _t({source:e,blocked:t,issues:n,state:r}){let i=(0,Z.useRef)(e);e&&(i.current=e);let a=(0,Z.useCallback)(e=>{let t=te(r.workspace,r.focus);if(!t)return{errors:[{message:`No agent is open.`,line:1,column:1}],spans:[]};let n=st(e,{...t,toolSpecs:r.workspace.toolSpecs},e=>r.workspace.agents.find(t=>t.identity.agentId.trim()===e)?.key);return n.ok?(r.update(e=>ee(e,r.focus,n.draft,n.registered)),{errors:[],spans:n.spans}):{errors:n.errors,spans:[]}},[r]);return i.current?(0,Q.jsx)(`div`,{className:`studio-fill`,children:(0,Q.jsx)(ht,{text:e??i.current,hold:e==null,issues:n,onApply:a})}):(0,Q.jsx)(ne,{title:`No code yet`,description:`${t??``} to generate the TypeScript.`})}function vt({provider:e,issues:t,state:n,isEditable:r}){let i=(0,Z.useCallback)(t=>{let r=n.workspace.providers.find(t=>t.id===e.id);if(!r)return{errors:[{message:`No provider is open.`,line:1,column:1}],spans:[]};let i=dt(t,r);return i.ok?(n.update(e=>E(e,i.provider)),{errors:[],spans:i.spans}):{errors:i.errors,spans:[]}},[n,e.id]);return(0,Q.jsx)(`div`,{className:`studio-fill`,children:(0,Q.jsx)(ht,{text:re(e),hold:!1,isReadOnly:!r||o(e.definition)===void 0,issues:t,onApply:i},e.id)})}export{_t as CodeBody,vt as ProviderCode};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{l as r,n as i,t as a,u as o}from"./SegmentedControlItem-h-aaXzyS.js";import{t as s}from"./VStack-CkVMcNiK.js";import{n as c,t as l}from"./StackItem-CQviqAfM.js";import{c as u,u as d}from"./browser-transport-D-2jDYe7.js";import{p as f,v as p}from"./groupStyles-C7Ter7zC.js";import{r as m,t as ee}from"./IconButton-DlOGzJIX.js";import{a as h,g as te,i as ne,l as g,s as re,u as ie}from"./SidePanel-BL32abk8.js";import{t as _}from"./Text-bum6zWWx.js";import{n as v}from"./labels-provider-4TIWDvsE.js";import{n as ae,t as y}from"./Card-Lp-0P5eL.js";import{n as b}from"./ScrollableArea-Ckugdj1N.js";import{i as x}from"./Banner-BISz3nXA.js";import{a as oe}from"./arrive-DvbqpeRS.js";import{t as se}from"./Center-nHS1JSux.js";import{a as S,o as ce}from"./shaped-data-BcarWqd5.js";import{n as C}from"./trace-patterns-DnYJa0nI.js";import{Ot as le,S as ue,_ as w,g as T,h as de,o as fe,w as pe}from"./index-CvvmFKgS.js";var E=e(n(),1),me=new Set([`image/png`,`image/jpeg`]),D=`image/png,image/jpeg`;function he(e,t){let n=e.replace(/\.[^.]*$/,``).toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`image`,r=`<${n}>`;for(let e=2;t.includes(r);e+=1)r=`<${n}_${String(e)}>`;return r}async function O(e){if(!me.has(e.type))return null;let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return{mimeType:e.type,data:btoa(n)}}function k(e){return`data:${e.mimeType};base64,${e.data}`}function A(e,t){return typeof e==`string`?e===t:Array.isArray(e)?e.some(e=>A(e,t)):typeof e==`object`&&e?Object.values(e).some(e=>A(e,t)):!1}function j(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>A(t,e)))}function M(e,t,n){let r=he(e,[...Object.keys(t),...n.map(e=>`<${e}>`)]);return{key:r.slice(1,-1),reference:r}}function N(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function P(e,t){let{images:n,state:r}=t;for(let[i,a]of e){let{key:e,reference:o}=M(i.name,{...t.host,...n},Object.keys(r));n={...n,[o]:a},r={...r,[e]:o}}return{images:n,state:r}}function F(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=Array.isArray(n)?n[Number(e)]:n[e]}return n}function I(e,t,n){let r=Object.keys(e),i=n===void 0||n in e?n:F(t,n);return e[(typeof i==`string`&&i in e?i:void 0)??r.find(e=>A(t,e))??r[0]??``]}function L(e,t,n){return{x:e.left*t,y:e.top*n,width:(e.right-e.left)*t,height:(e.bottom-e.top)*n,line:Math.max(2,Math.round(Math.min(t,n)/200))}}var R=.45;async function ge(e,t,n){let r=new Image;r.src=e,await r.decode();let i=document.createElement(`canvas`);i.width=r.naturalWidth,i.height=r.naturalHeight;let a=i.getContext(`2d`);if(!a)return e;let o=L(t,i.width,i.height);return a.drawImage(r,0,0),a.fillStyle=n.shade,a.globalAlpha=R,a.beginPath(),a.rect(0,0,i.width,i.height),a.rect(o.x,o.y,o.width,o.height),a.fill(`evenodd`),a.globalAlpha=1,a.strokeStyle=n.outline,a.lineWidth=o.line,a.strokeRect(o.x,o.y,o.width,o.height),i.toDataURL(`image/png`)}function _e(e){let t=e.right-e.left,n=e.bottom-e.top;return{width:100/t,height:100/n,left:-e.left/t*100,top:-e.top/n*100}}function ve(e){return e.every(e=>typeof e==`string`)}function z(e){return e==null||typeof e==`string`?``:typeof e==`number`?0:typeof e==`boolean`?!1:Array.isArray(e)?[]:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,z(t)]))}function ye(e){let t=e[0];if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=Object.keys(t);return n.length===0||n.length>4||!e.every(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).join()===n.join()&&Object.values(e).every(e=>typeof e!=`object`||!e))?null:n.map(t=>{let n=e.map(e=>String(e[t]??``).length),r=Math.max(t.length,...n);return{key:t,weight:Math.min(4,Math.max(1,Math.round(r/10)))}})}var B=t();function be(e){return e===null?[]:Array.isArray(e)?e:[e]}function V(){let e=v(),[t,n]=(0,E.useState)(null);return{read:async e=>{n(null);let t=[];for(let r of be(e)){let e=await O(r);e?t.push([r,e]):n(r.name)}return t},status:t===null?void 0:{type:`error`,message:e(`@theorem.decision.image_bad`,{file:t})}}}function xe({onImages:e}){let t=v(),{read:n,status:r}=V();return(0,B.jsx)(T,{label:t(`@theorem.decision.add_image`),isLabelHidden:!0,mode:`dropzone`,isMultiple:!0,accept:D,value:null,placeholder:t(`@theorem.decision.add_image_hint`),status:r,statusVariant:`detached`,onChange:t=>{n(t).then(t=>{t.length>0&&e(t)})}})}var Se={search:()=>[],bootstrap:()=>[]},Ce=48;function H(e,t,n){return Math.min(Math.max(e.split(`
|
|
2
|
+
`).length,t),n)}var U=(0,E.createContext)({images:{},onImages:()=>{}});function we({value:e,label:t,isLabelHidden:n}){let r=v(),{images:i,onImages:a}=(0,E.useContext)(U),{read:o,status:s}=V(),[f,p]=(0,E.useState)(!1),m=Object.hasOwn(i,e)?k(i[e]):void 0;return(0,B.jsxs)(c,{gap:2,vAlign:`center`,children:[(0,B.jsx)(d,{src:m,alt:t,label:e,onClick:m?()=>p(!0):void 0}),m?(0,B.jsx)(u,{isOpen:f,onOpenChange:p,media:{src:m,alt:t,caption:e},hasZoom:!0}):null,(0,B.jsx)(l,{size:`fill`,children:(0,B.jsx)(T,{label:t,isLabelHidden:n,accept:D,value:null,placeholder:r(`@theorem.decision.replace_image`),status:s,statusVariant:`detached`,onChange:t=>{o(t).then(([t])=>{t&&a({...i,[e]:t[1]})})}})})]})}function W({value:e,onChange:t,label:n,isLabelHidden:r}){let{images:i}=(0,E.useContext)(U),[a]=(0,E.useState)(()=>typeof e==`string`&&(e.length>Ce||e.includes(`
|
|
3
|
+
`))),[o]=(0,E.useState)(()=>typeof e==`string`&&Object.hasOwn(i,e));if(o&&typeof e==`string`)return(0,B.jsx)(we,{value:e,label:n,isLabelHidden:r});if(typeof e==`boolean`)return(0,B.jsx)(de,{label:n,value:e,onChange:t});if(typeof e==`number`)return(0,B.jsx)(pe,{label:n,isLabelHidden:r,size:`sm`,value:e,isWheelEnabled:!1,onChange:t});if(e===null)return(0,B.jsx)(b,{label:n,isLabelHidden:r,size:`sm`,value:``,placeholder:`null`,isDisabled:!0,onChange:()=>{}});let s=String(e);return a?(0,B.jsx)(w,{label:n,isLabelHidden:r,size:`sm`,rows:H(s,2,12),value:s,onChange:t}):(0,B.jsx)(b,{label:n,isLabelHidden:r,size:`sm`,value:s,onChange:t})}function G({label:e,isRequired:t,description:n,children:r}){let i=(0,E.useId)();return(0,B.jsxs)(s,{gap:2,role:`group`,"aria-labelledby":i,children:[(0,B.jsx)(f,{label:e,inputID:``,labelID:i,isGroupLabel:!0,isRequired:t,description:n}),r]})}function K({children:e,...t}){return(0,B.jsx)(G,{...t,children:(0,B.jsx)(`div`,{style:{paddingInlineStart:12,borderInlineStart:`1px solid var(--color-border)`},children:e})})}function q({field:e,onAdd:t}){let n=v();return(0,B.jsx)(c,{children:(0,B.jsx)(m,{label:n(`@theorem.decision.add_item`,{field:e}),size:`sm`,variant:`ghost`,icon:(0,B.jsx)(le,{size:14}),onClick:t})})}function J({index:e,onRemove:t}){let n=v();return(0,B.jsx)(ee,{label:n(`@theorem.decision.remove_item`,{item:n(`@theorem.data.item`,{index:String(e+1)})}),size:`sm`,variant:`ghost`,icon:(0,B.jsx)(p,{size:14}),onClick:t})}function Y({value:e,onChange:t}){return(0,B.jsx)(s,{gap:3,children:Object.entries(e).map(([n,r])=>(0,B.jsx)(X,{label:S(n),value:r,onChange:r=>t({...e,[n]:r})},n))})}function Te({value:e,onChange:t,label:n}){let r=v(),i=oe(e);if(ve(e))return(0,B.jsx)(ue,{label:n,size:`sm`,value:e.map((e,t)=>({id:`${String(t)}:${e}`,label:e})),searchSource:Se,hasCreate:!0,debounceMs:0,placeholder:r(`@theorem.decision.add_value`),onChange:e=>t(e.map(e=>e.label))});let a=ye(e),o=(0,B.jsx)(q,{field:n,onAdd:()=>t([...e,z(e.at(-1))])}),u=n=>(0,B.jsx)(J,{index:n,onRemove:()=>{i.drop(n),t(e.filter((e,t)=>t!==n))}});if(a){let r={display:`grid`,gap:8,alignItems:`start`,gridTemplateColumns:`${a.map(e=>`minmax(0, ${String(e.weight)}fr)`).join(` `)} auto`},s=e;return(0,B.jsxs)(G,{label:n,children:[(0,B.jsxs)(`div`,{style:r,"aria-hidden":!0,children:[a.map(e=>(0,B.jsx)(_,{type:`supporting`,color:`secondary`,maxLines:1,children:S(e.key)},e.key)),(0,B.jsx)(`span`,{style:{width:28}})]}),i.rows.map(({index:e,key:n})=>{let i=s[e];return(0,B.jsxs)(`div`,{style:r,children:[a.map(n=>(0,B.jsx)(W,{label:`${S(n.key)} ${String(e+1)}`,isLabelHidden:!0,value:i[n.key]??null,onChange:r=>t(s.map((t,i)=>i===e?{...t,[n.key]:r}:t))},n.key)),u(e)]},n)}),o]})}return(0,B.jsx)(K,{label:n,children:(0,B.jsxs)(s,{gap:3,children:[i.rows.map(({item:n,index:i,key:a})=>{let o=r(`@theorem.data.item`,{index:String(i+1)}),s=n=>t(e.map((e,t)=>t===i?n:e));return(0,B.jsxs)(c,{gap:2,vAlign:`start`,children:[(0,B.jsx)(l,{size:`fill`,children:ce(n)?(0,B.jsx)(W,{label:o,isLabelHidden:!0,value:n,onChange:s}):(0,B.jsx)(X,{label:o,value:n,onChange:s})}),u(i)]},a)}),o]})})}function X({value:e,onChange:t,label:n}){return Array.isArray(e)?(0,B.jsx)(Te,{label:n,value:e,onChange:t}):typeof e==`object`&&e?(0,B.jsx)(K,{label:n,children:(0,B.jsx)(Y,{value:e,onChange:t})}):(0,B.jsx)(W,{label:n,value:e,onChange:t})}function Ee({value:e,onChange:t,label:n}){return typeof e==`object`&&e&&!Array.isArray(e)?(0,B.jsx)(Y,{value:e,onChange:t}):(0,B.jsx)(X,{label:n,value:e,onChange:t})}var De={"--theorem-console-card":`var(--color-background-muted)`},Z=`(width < 768px)`,Q=(0,E.createContext)(!0);function $(){return(0,E.useSyncExternalStore)(e=>{let t=globalThis.matchMedia(Z);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},()=>globalThis.matchMedia(Z).matches,()=>!1)}function Oe({flush:e,wide:t,maxWidth:n,children:r}){return(0,B.jsx)(s,{height:`100%`,paddingInline:3,style:e?De:void 0,children:(0,B.jsx)(y,{variant:`transparent`,height:`100%`,padding:0,style:e?{overflowY:`auto`}:{...re,overflowY:`auto`},children:(0,B.jsx)(se,{axis:`horizontal`,width:`100%`,minHeight:`100%`,children:(0,B.jsx)(s,{width:`100%`,maxWidth:t?void 0:n,gap:3,padding:4,children:r})})})})}function ke({inspector:e,maxWidth:t,flush:n=!1,columns:i=!1,requestLabel:a,className:s,style:c,children:l}){let u=(0,E.useRef)(null);return(0,B.jsx)(x,{inspector:e,children:(0,B.jsx)(o,{ref:u,height:`fill`,className:s,style:c,header:e.toggle?(0,B.jsx)(ie,{children:e.toggle}):void 0,content:(0,B.jsx)(r,{padding:0,isScrollable:!1,children:(0,B.jsx)(Ae,{layoutRef:u,flush:n,columns:i,maxWidth:t,requestLabel:a,children:l})})})})}function Ae({layoutRef:e,flush:t,columns:n,maxWidth:r,requestLabel:i,children:a}){let o=$(),s=E.Children.toArray(a).length,c=n&&s>1;return c&&!o?(0,B.jsx)(je,{requestLabel:i,basisWidth:e.current?.clientWidth??0,children:a}):(0,B.jsx)(Oe,{flush:t,wide:c,maxWidth:r,children:a})}function je({requestLabel:e=`Request`,basisWidth:t,children:n}){let i=v(),a=(0,E.useRef)(null),s=te({defaultSize:t>0?Math.round(t*.4):`40%`,minSize:280,maxSize:`70%`,containerRef:a}),[c,l]=E.Children.toArray(n),u={name:e,show:e,hide:e,resize:i(`@theorem.panel.resize`,{name:e})};return(0,B.jsx)(Q,{value:!1,children:(0,B.jsx)(o,{ref:a,height:`fill`,start:(0,B.jsx)(g,{side:`start`,className:`theorem-console-request`,labels:u,resizable:s,open:!0,children:(0,B.jsx)(h,{label:e,children:c})}),content:(0,B.jsx)(r,{padding:0,isScrollable:!1,children:(0,B.jsx)(ne,{inset:`beside`,className:`theorem-console-response`,children:l})})})})}function Me({children:e}){return(0,B.jsx)(y,{variant:`muted`,padding:0,className:`theorem-console-card`,style:C,children:(0,B.jsx)(Q,{value:!1,children:e})})}function Ne({label:e,fill:t=!1,children:n}){return(0,E.use)(Q)?(0,B.jsx)(y,{variant:`muted`,padding:t?0:4,className:`theorem-console-card`,style:C,children:t?n:(0,B.jsx)(s,{height:`100%`,gap:3,children:n})}):t?n:(0,B.jsx)(h,{label:e,padding:4,children:n})}function Pe(e){return t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e())}}function Fe({title:e,view:t,hasFields:n,onView:r,onRun:o,children:l}){let u=v(),d=(0,E.use)(Q),f=(0,B.jsxs)(s,{gap:3,padding:d?void 0:4,onKeyDown:Pe(o),children:[(0,B.jsxs)(c,{gap:2,hAlign:`between`,vAlign:`center`,children:[(0,B.jsx)(_,{type:`supporting`,color:`secondary`,as:`h3`,children:e}),(0,B.jsxs)(i,{label:u(`@theorem.decision.view`),size:`sm`,value:t,onChange:e=>{r(e===`json`?`json`:`fields`)},children:[(0,B.jsx)(a,{value:`fields`,label:u(`@theorem.decision.fields`),isDisabled:!n}),(0,B.jsx)(a,{value:`json`,label:u(`@theorem.data.json`)})]})]}),l]});return d?(0,B.jsx)(y,{variant:`muted`,padding:4,className:`theorem-console-card`,style:C,children:f}):f}var Ie={"--font-family-body":`var(--font-family-code)`};function Le({label:e,text:t,isInvalid:n,onChange:r}){return(0,B.jsx)(w,{label:e,isLabelHidden:!0,value:t,onChange:r,rows:H(t,8,24),hasSpellCheck:!1,status:n?{type:`error`}:void 0,controlStyle:Ie})}function Re({note:e,isReady:t,isRunning:n,runLabel:r,runningLabel:i,stopLabel:a,onRun:o,onStop:s}){return(0,B.jsxs)(c,{gap:3,hAlign:`between`,vAlign:`center`,children:[(0,B.jsx)(_,{type:`supporting`,color:`secondary`,style:t?void 0:{color:`var(--color-error)`},hasTabularNumbers:!0,children:e}),(0,B.jsxs)(c,{gap:2,vAlign:`center`,children:[n?(0,B.jsx)(m,{label:a,variant:`ghost`,onClick:s}):null,(0,B.jsx)(m,{label:n?i:r,variant:`primary`,isLoading:n,isDisabled:!t,onClick:o})]})]})}function ze(){let e=ae();return(0,E.useMemo)(()=>{let t=new Intl.NumberFormat(e,{style:`unit`,unit:`byte`,unitDisplay:`narrow`}),n=new Intl.NumberFormat(e,{style:`unit`,unit:`kilobyte`,unitDisplay:`narrow`,maximumFractionDigits:1});return e=>e<1024?t.format(e):n.format(e/1024)},[e])}function Be({payload:e,runtime:t=null,traces:n,onActivity:r},i,a){return(0,E.useMemo)(()=>{let o=t?a(e,t,{traces:n}):i(e,{traces:n});return r?fe(o,r):o},[e,t,n,r,i,a])}export{N as C,j as S,I as _,Fe as a,k as b,ze as c,G as d,J as f,xe as g,H as h,Le as i,q as l,U as m,ke as n,Ne as o,Ee as p,Me as r,Re as s,Be as t,K as u,_e as v,ge as x,P as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{n as r,o as i,p as a,s as o}from"./browser-transport-D-2jDYe7.js";import{n as s,t as c}from"./labels-provider-4TIWDvsE.js";import{a as l,t as u}from"./Banner-BISz3nXA.js";import{c as d}from"./reader-BOCCYaRp.js";import{p as f,u as p}from"./tree-DqyAMsbI.js";import{n as m,t as h}from"./PaneState-BvA2tLQg.js";import{C as g,S as _,a as v,c as y,g as b,i as x,m as S,n as C,o as w,p as T,s as E,t as D,y as O}from"./studio-console-DZwlEsvr.js";import{i as k,t as A}from"./use-one-call-Hcs8YBp1.js";import{$ as j,et as M,l as N}from"./index-CvvmFKgS.js";var P=(e,t,n,r)=>e.decide(n,t,r);function F(e){let{iface:t,describeFailure:n}=o(e),{call:r,...i}=A(e,`deciding`,P);return{iface:t,describeFailure:n,...i,decide:r}}var I=e(n(),1),L=t();function R(e,t){let n;try{n=JSON.parse(e)}catch{return{ok:!1,reason:`invalid_json`}}if(n===null)return{ok:!1,reason:`null_state`,state:n};let r=new TextEncoder().encode(JSON.stringify(n)).byteLength;return t!==void 0&&r>t?{ok:!1,reason:`too_large`,bytes:r,state:n}:{ok:!0,state:n,bytes:r}}function z(e,t,n,r){return t.ok?n===void 0?null:e(`@theorem.decision.state_size`,{size:r(t.bytes),limit:r(n)}):t.reason===`too_large`?e(`@theorem.decision.too_large`,{limit:r(n??0)}):e(t.reason===`invalid_json`?`@theorem.decision.invalid_json`:`@theorem.decision.null_state`)}function B(e){return e.failure||e.result?`settled`:e.status===`deciding`?`waiting`:`idle`}function V(e,t){let[n,r]=(0,I.useState)(e),i=R(n,t),[a,o]=(0,I.useState)(()=>i.state===void 0?`json`:`fields`);return{text:n,setText:r,check:i,shown:i.state===void 0?`json`:a,setView:o}}function H({form:e,iface:t,images:n,onImages:r,note:i,isRunning:a,onRun:o,onStop:c}){let l=s(),{text:u,setText:d,check:f,shown:p,setView:m}=e,h=t.questions.some(e=>e.type===`box`)||Object.keys(n).length>0,_=p===`fields`?f.state:void 0,y=g(_);return(0,L.jsxs)(v,{title:l(`@theorem.decision.state`),view:p,hasFields:f.state!==void 0,onView:m,onRun:o,children:[_===void 0?(0,L.jsx)(x,{label:l(`@theorem.decision.state`),text:u,isInvalid:!f.ok,onChange:d}):(0,L.jsx)(S,{value:{images:n,onImages:r},children:(0,L.jsx)(T,{label:l(`@theorem.decision.state`),value:_,onChange:e=>{d(JSON.stringify(e,null,2))}})}),h&&y?(0,L.jsx)(b,{onImages:e=>{let i=O(e,{images:n,host:t.images,state:y});r(i.images),d(JSON.stringify(i.state,null,2))}}):null,(0,L.jsx)(E,{note:i,isReady:f.ok,isRunning:a,runLabel:l(`@theorem.decision.decide`),runningLabel:l(`@theorem.decision.deciding`),stopLabel:l(`@theorem.decision.stop`),onRun:o,onStop:c})]})}function U({iface:e,decision:t,asked:n,onQuestion:r,questionText:i}){let a=s(),o=t.status===`deciding`;return(0,L.jsxs)(L.Fragment,{children:[t.failure?(0,L.jsx)(u,{status:`error`,role:`alert`,title:t.failure.error}):null,o&&!t.result?(0,L.jsx)(m,{label:a(`@theorem.decision.deciding`),since:t.startedAt}):null,t.result?(0,L.jsx)(k,{iface:e,result:t.result,asked:n,onQuestion:r,questionText:i,elapsedMs:t.elapsedMs,isStale:o}):null]})}function W(e,t,n,r,i){if(t===`idle`)return null;if(!e)return i;let a=t===`waiting`;return(0,L.jsx)(w,{label:n.answers,fill:a,children:a?(0,L.jsx)(m,{label:n.deciding,since:r}):i})}function G({transport:e,iface:t,decision:n,defaultState:r=`{}`,defaultImages:i,onQuestion:a,questionText:o,maxWidth:c=`960px`,trace:u,flush:d,columns:f=!1,className:p,style:m}){let h=s(),g=y(),v=V(r,t.maxStateBytes),{check:b}=v,[x,S]=(0,I.useState)(i??{}),[w,T]=(0,I.useState)(),E=l(t,e.traces,u);return(0,L.jsxs)(C,{inspector:E,maxWidth:c,flush:d,columns:f,requestLabel:h(`@theorem.decision.state`),className:p,style:m,children:[(0,L.jsx)(H,{form:v,iface:t,images:x,onImages:S,note:z(h,b,t.maxStateBytes,g),isRunning:n.status===`deciding`,onRun:()=>{if(!b.ok)return;let e=_(x,b.state);T({images:{...t.images,...e},state:b.state}),n.decide(b.state,Object.keys(e).length>0?e:void 0)},onStop:n.cancel}),W(f,B(n),{answers:h(`@theorem.decision.answers`),deciding:h(`@theorem.decision.deciding`)},n.startedAt,(0,L.jsx)(U,{iface:t,decision:n,asked:w,onQuestion:a,questionText:o}))]})}function K(e){let t=s(),n=F(e.transport);return n.describeFailure?(0,L.jsx)(h,{title:n.describeFailure.error}):n.iface?(0,L.jsx)(G,{...e,iface:n.iface,decision:n}):(0,L.jsx)(m,{label:t(`@theorem.chat.loading`)})}function q({endpoint:e,http:t,transport:n,theme:r,mode:a,labels:o,...s}){let l=(0,I.useRef)(t);l.current=t;let u=(0,I.useMemo)(()=>n??d({...l.current,endpoint:e}),[n,e]);return(0,L.jsx)(i,{theme:r,mode:a,children:(0,L.jsx)(c,{labels:o,children:(0,L.jsx)(K,{...s,transport:u})})})}var J;function Y(e){if(e.agentId===`pantry.jev`)return J??=M(),{defaultState:j,defaultImages:{...(0,I.use)(J)}};let{profile:t}=e;return{defaultState:(t.type===`decision`?Object.values(t.models)[0]:void 0)?.apiId.startsWith(`respan/`)?f:p}}function X(e){return typeof e==`string`?e:Array.isArray(e)?e.map(X).join(` `):Object.entries(e).map(([e,t])=>`${e}: ${X(t)}`).join(` `)}function Z(e){let t=D(e,a,r);return(0,L.jsx)(Q,{...e,transport:t})}function Q({payload:e,transport:t,trace:n,flush:r,columns:i,className:a}){let{open:o}=(0,I.useContext)(N),s=Y(e),{questions:c}=e,l=(0,I.useMemo)(()=>c&&Object.fromEntries(Object.entries(c).map(([e,t])=>[e,X(t.instructions)])),[c]);return(0,L.jsx)(q,{transport:t,...s,trace:n,flush:r,columns:i,className:a,onQuestion:o,questionText:l})}export{Q as DecisionView,Z as StudioDecision};
|