@cloudflare/think 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/index.js +498 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/{codegen-KnFnKp0C.js → codegen-CuPdJRpV.js} +2 -2
- package/dist/{codegen-KnFnKp0C.js.map → codegen-CuPdJRpV.js.map} +1 -1
- package/dist/framework/index.d.ts +4 -4
- package/dist/framework/index.js +3 -3
- package/dist/messengers/index.d.ts +54 -54
- package/dist/messengers/telegram.d.ts +4 -4
- package/dist/{project-D1o1-3dN.js → project-BHurFdu4.js} +2 -2
- package/dist/{project-D1o1-3dN.js.map → project-BHurFdu4.js.map} +1 -1
- package/dist/studio/assets/abap-CLvhMVsD.js +1 -0
- package/dist/studio/assets/actionscript-3--17pq3dv.js +1 -0
- package/dist/studio/assets/ada-C5qYipkI.js +1 -0
- package/dist/studio/assets/andromeeda-vGVdxbeo.js +1 -0
- package/dist/studio/assets/angular-html-z-TUogET.js +1 -0
- package/dist/studio/assets/angular-ts-DMGuEVeg.js +1 -0
- package/dist/studio/assets/apache-U0d_L8uA.js +1 -0
- package/dist/studio/assets/apex-CGTLDQj6.js +1 -0
- package/dist/studio/assets/apl-KvrEROqd.js +1 -0
- package/dist/studio/assets/applescript-CCn79oCD.js +1 -0
- package/dist/studio/assets/ara-4CJ0cIlV.js +1 -0
- package/dist/studio/assets/asciidoc-DE70LPWp.js +1 -0
- package/dist/studio/assets/asm-Cmm7eHzH.js +1 -0
- package/dist/studio/assets/astro-Bm_woEti.js +1 -0
- package/dist/studio/assets/aurora-x-CDeNXAV0.js +1 -0
- package/dist/studio/assets/awk-BWXHIvNe.js +1 -0
- package/dist/studio/assets/ayu-dark-DluEY0Gj.js +1 -0
- package/dist/studio/assets/ayu-light-C3h-C4tm.js +1 -0
- package/dist/studio/assets/ayu-mirage-Bqwy1Gya.js +1 -0
- package/dist/studio/assets/ballerina-B7ZEbQpA.js +1 -0
- package/dist/studio/assets/bat-Bo4NYOV-.js +1 -0
- package/dist/studio/assets/beancount-D-usSTwE.js +1 -0
- package/dist/studio/assets/berry-DKpUyyne.js +1 -0
- package/dist/studio/assets/bibtex-Ci_nEsc7.js +1 -0
- package/dist/studio/assets/bicep-CUHmPFLl.js +1 -0
- package/dist/studio/assets/bird2-C2hNVINV.js +1 -0
- package/dist/studio/assets/blade-BdCF3r89.js +1 -0
- package/dist/studio/assets/bsl-BkkzgIyY.js +1 -0
- package/dist/studio/assets/c-CDqDtkvZ.js +1 -0
- package/dist/studio/assets/c3-CnJL0r0V.js +1 -0
- package/dist/studio/assets/cadence-CQ2zXKGN.js +1 -0
- package/dist/studio/assets/cairo-DLTphjLi.js +1 -0
- package/dist/studio/assets/catppuccin-frappe-3VR1Za6u.js +1 -0
- package/dist/studio/assets/catppuccin-latte-DwIHMF0Q.js +1 -0
- package/dist/studio/assets/catppuccin-macchiato-DYnBP6_5.js +1 -0
- package/dist/studio/assets/catppuccin-mocha-DYhrFGRu.js +1 -0
- package/dist/studio/assets/clarity-SemFz856.js +1 -0
- package/dist/studio/assets/clojure-DqKBuwfJ.js +1 -0
- package/dist/studio/assets/cmake-Bj61d0ZC.js +1 -0
- package/dist/studio/assets/cobol-CeFM1vZz.js +1 -0
- package/dist/studio/assets/codeowners-C8r90Shi.js +1 -0
- package/dist/studio/assets/codeql-oeQT6MSM.js +1 -0
- package/dist/studio/assets/coffee-2ed6LBym.js +1 -0
- package/dist/studio/assets/common-lisp-Cv5bFMCO.js +1 -0
- package/dist/studio/assets/coq-BrsZFFmf.js +1 -0
- package/dist/studio/assets/cpp-Dj3nX0J4.js +1 -0
- package/dist/studio/assets/crystal-BsIYZMQ3.js +1 -0
- package/dist/studio/assets/csharp-Ct8U2NOr.js +1 -0
- package/dist/studio/assets/css-B48fnuoH.js +1 -0
- package/dist/studio/assets/csv-Dx-8-gkx.js +1 -0
- package/dist/studio/assets/cue-CE9AQfxI.js +1 -0
- package/dist/studio/assets/cypher-ClKdZ_lG.js +1 -0
- package/dist/studio/assets/d-qD-0Kul2.js +1 -0
- package/dist/studio/assets/dark-plus-Cs2F2srj.js +1 -0
- package/dist/studio/assets/dart-DkHntEIa.js +1 -0
- package/dist/studio/assets/dax-BkyTk9wS.js +1 -0
- package/dist/studio/assets/desktop-Dlh5hvp9.js +1 -0
- package/dist/studio/assets/diff-woXpYk--.js +1 -0
- package/dist/studio/assets/docker-IyjqRm3v.js +1 -0
- package/dist/studio/assets/dotenv-_5a1GRtc.js +1 -0
- package/dist/studio/assets/dracula-BHWKrbxM.js +1 -0
- package/dist/studio/assets/dracula-soft-5eyTD99u.js +1 -0
- package/dist/studio/assets/dream-maker-DW3nJb8Q.js +1 -0
- package/dist/studio/assets/edge-C7qt1aza.js +1 -0
- package/dist/studio/assets/elixir-CiTmwoQ3.js +1 -0
- package/dist/studio/assets/elm-exDZ-PRY.js +1 -0
- package/dist/studio/assets/emacs-lisp-C9PiwqqW.js +1 -0
- package/dist/studio/assets/erb-3fmfgt-Q.js +1 -0
- package/dist/studio/assets/erlang-Cphh6RMH.js +1 -0
- package/dist/studio/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/dist/studio/assets/everforest-light-Df2xbC6M.js +1 -0
- package/dist/studio/assets/fennel-DQxkIbk2.js +1 -0
- package/dist/studio/assets/fish-BJitypiv.js +1 -0
- package/dist/studio/assets/fluent-C03EYrpw.js +1 -0
- package/dist/studio/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
- package/dist/studio/assets/fortran-free-form-CYNrtFtB.js +1 -0
- package/dist/studio/assets/fsharp-D13ZGOAj.js +1 -0
- package/dist/studio/assets/gdresource-C0sCabJj.js +1 -0
- package/dist/studio/assets/gdscript-Cp2uCuqX.js +1 -0
- package/dist/studio/assets/gdshader-CBce3t8t.js +1 -0
- package/dist/studio/assets/genie-CV2tkWYe.js +1 -0
- package/dist/studio/assets/gherkin-DExj1W_8.js +1 -0
- package/dist/studio/assets/git-commit-BSykSTBG.js +1 -0
- package/dist/studio/assets/git-rebase-75I-C7zW.js +1 -0
- package/dist/studio/assets/github-dark-C-LZuMrd.js +1 -0
- package/dist/studio/assets/github-dark-default-DXG-b-1a.js +1 -0
- package/dist/studio/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
- package/dist/studio/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
- package/dist/studio/assets/github-light-EUqPIrTm.js +1 -0
- package/dist/studio/assets/github-light-default-BXViO-2h.js +1 -0
- package/dist/studio/assets/github-light-high-contrast-B68TUdTA.js +1 -0
- package/dist/studio/assets/gleam-CSRkHgEL.js +1 -0
- package/dist/studio/assets/glimmer-js-JjRzYRv8.js +1 -0
- package/dist/studio/assets/glimmer-ts-DcC_g6bi.js +1 -0
- package/dist/studio/assets/glsl-CHo__hpu.js +1 -0
- package/dist/studio/assets/gn-ilITqXS6.js +1 -0
- package/dist/studio/assets/gnuplot-7GGW24-e.js +1 -0
- package/dist/studio/assets/go-BJwz_mda.js +1 -0
- package/dist/studio/assets/graphql-J3cHpSdo.js +1 -0
- package/dist/studio/assets/groovy-CacY0gHj.js +1 -0
- package/dist/studio/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
- package/dist/studio/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
- package/dist/studio/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
- package/dist/studio/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
- package/dist/studio/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
- package/dist/studio/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
- package/dist/studio/assets/hack-or1FCnPg.js +1 -0
- package/dist/studio/assets/haml-uv3vtlo6.js +1 -0
- package/dist/studio/assets/handlebars--xrOP0sp.js +1 -0
- package/dist/studio/assets/haskell-D8IpX4py.js +1 -0
- package/dist/studio/assets/haxe-OTjmBuCE.js +1 -0
- package/dist/studio/assets/hcl-Dh228itO.js +1 -0
- package/dist/studio/assets/highlighted-body-OFNGDK62-D5UBAw6b.js +1 -0
- package/dist/studio/assets/hjson-CxZEssPk.js +1 -0
- package/dist/studio/assets/hlsl-Cvrh5tZx.js +1 -0
- package/dist/studio/assets/horizon-CE9ld1lL.js +1 -0
- package/dist/studio/assets/horizon-bright-Br1oVSNq.js +1 -0
- package/dist/studio/assets/houston-CsvMBhTu.js +1 -0
- package/dist/studio/assets/html-CWnTqWKh.js +1 -0
- package/dist/studio/assets/html-derivative-DWyLco-z.js +1 -0
- package/dist/studio/assets/http-BGB8mLqf.js +1 -0
- package/dist/studio/assets/hurl-BWdvIVUG.js +1 -0
- package/dist/studio/assets/hxml-B0Qn7Nwc.js +1 -0
- package/dist/studio/assets/hy-CZbG8q4J.js +1 -0
- package/dist/studio/assets/imba-DsUTQ-LC.js +1 -0
- package/dist/studio/assets/index-Cbb3GlZY.js +496 -0
- package/dist/studio/assets/index-DN9_cL01.css +2 -0
- package/dist/studio/assets/ini-B5eOa1yu.js +1 -0
- package/dist/studio/assets/java-BqyrPpKF.js +1 -0
- package/dist/studio/assets/javascript-D8Aej0xg.js +1 -0
- package/dist/studio/assets/jinja-SIORrXov.js +1 -0
- package/dist/studio/assets/jison-B2T4v51n.js +1 -0
- package/dist/studio/assets/json-BFdVRj9r.js +1 -0
- package/dist/studio/assets/json5-BR5RXkoi.js +1 -0
- package/dist/studio/assets/jsonc-CYpm1nAK.js +1 -0
- package/dist/studio/assets/jsonl-CmCQp5Yx.js +1 -0
- package/dist/studio/assets/jsonnet-CJTPZ8u_.js +1 -0
- package/dist/studio/assets/jssm-DXw9l8Rf.js +1 -0
- package/dist/studio/assets/jsx-w4r1xieS.js +1 -0
- package/dist/studio/assets/julia-BFBtDmmM.js +1 -0
- package/dist/studio/assets/just-CjAPsU_y.js +1 -0
- package/dist/studio/assets/kanagawa-dragon-CXtmUGW6.js +1 -0
- package/dist/studio/assets/kanagawa-lotus-BN08jTvb.js +1 -0
- package/dist/studio/assets/kanagawa-wave-CTweb8Dz.js +1 -0
- package/dist/studio/assets/kdl-CsD5j6eV.js +1 -0
- package/dist/studio/assets/kotlin-DhhofPvG.js +1 -0
- package/dist/studio/assets/kusto-BUv0MjJC.js +1 -0
- package/dist/studio/assets/laserwave-C_8bwKvT.js +1 -0
- package/dist/studio/assets/latex-CghDKqKz.js +1 -0
- package/dist/studio/assets/lean-CewbzKMR.js +1 -0
- package/dist/studio/assets/less-DVTAwKKz.js +1 -0
- package/dist/studio/assets/light-plus-DVQuIRkW.js +1 -0
- package/dist/studio/assets/liquid-Cp9loVkE.js +1 -0
- package/dist/studio/assets/llvm-Cm23YOpf.js +1 -0
- package/dist/studio/assets/log-BNLmms1o.js +1 -0
- package/dist/studio/assets/logo-Cluzi2Zq.js +1 -0
- package/dist/studio/assets/lua-HNnIDxnY.js +1 -0
- package/dist/studio/assets/luau-CNKltnaQ.js +1 -0
- package/dist/studio/assets/make-Dixweg8N.js +1 -0
- package/dist/studio/assets/markdown-BYOwaDjH.js +1 -0
- package/dist/studio/assets/marko-BXT10Apm.js +1 -0
- package/dist/studio/assets/material-theme-Bm3Qr25_.js +1 -0
- package/dist/studio/assets/material-theme-darker-2IIEA8gg.js +1 -0
- package/dist/studio/assets/material-theme-lighter-uhdI0v04.js +1 -0
- package/dist/studio/assets/material-theme-ocean-CHQ94UKr.js +1 -0
- package/dist/studio/assets/material-theme-palenight-B5W6OYN7.js +1 -0
- package/dist/studio/assets/matlab-D7qyCx1q.js +1 -0
- package/dist/studio/assets/mdc-CaiOz4_A.js +1 -0
- package/dist/studio/assets/mdx-DQZ5AkYe.js +1 -0
- package/dist/studio/assets/mermaid-Bk4SNUv9.js +1 -0
- package/dist/studio/assets/mermaid-GHXKKRXX-I2ZcYo7k.js +1 -0
- package/dist/studio/assets/min-dark-BSWPekZh.js +1 -0
- package/dist/studio/assets/min-light-DDpmG2fV.js +1 -0
- package/dist/studio/assets/mipsasm-BMqwQI7S.js +1 -0
- package/dist/studio/assets/mojo-BgCJLMeH.js +1 -0
- package/dist/studio/assets/monokai-CdkpiU2Y.js +1 -0
- package/dist/studio/assets/moonbit-CaWjb8XO.js +1 -0
- package/dist/studio/assets/move-B1IS1UjX.js +1 -0
- package/dist/studio/assets/narrat-_X_XdTYD.js +1 -0
- package/dist/studio/assets/nextflow-Bbiyy34d.js +1 -0
- package/dist/studio/assets/nextflow-groovy-Dc_ddanL.js +1 -0
- package/dist/studio/assets/nginx-DgYZ5SY9.js +1 -0
- package/dist/studio/assets/night-owl-DhmEMT88.js +1 -0
- package/dist/studio/assets/night-owl-light-eJ-hLW7d.js +1 -0
- package/dist/studio/assets/nim-CAMVX-MV.js +1 -0
- package/dist/studio/assets/nix-IvuFDN5E.js +1 -0
- package/dist/studio/assets/nord-Cb4Vim4T.js +1 -0
- package/dist/studio/assets/nushell-DcLAeLz5.js +1 -0
- package/dist/studio/assets/objective-c-D1A_Heim.js +1 -0
- package/dist/studio/assets/objective-cpp-BsSzOQcm.js +1 -0
- package/dist/studio/assets/ocaml-O90oeIOV.js +1 -0
- package/dist/studio/assets/odin-B1RWQWA5.js +1 -0
- package/dist/studio/assets/one-dark-pro-CLwyXe_n.js +1 -0
- package/dist/studio/assets/one-light-D7Lr4KcI.js +1 -0
- package/dist/studio/assets/openscad-BUDT5pXO.js +1 -0
- package/dist/studio/assets/pascal-4ZHwLPI5.js +1 -0
- package/dist/studio/assets/perl-Dc6Wp7SD.js +1 -0
- package/dist/studio/assets/php-DgLi8LNU.js +1 -0
- package/dist/studio/assets/pkl-ot-7Btpt.js +1 -0
- package/dist/studio/assets/plastic-DQwYfKfQ.js +1 -0
- package/dist/studio/assets/plsql-DGHpHOYJ.js +1 -0
- package/dist/studio/assets/po-BiJDBrnU.js +1 -0
- package/dist/studio/assets/poimandres-DRFjx7u4.js +1 -0
- package/dist/studio/assets/polar-C7UOKdEL.js +1 -0
- package/dist/studio/assets/postcss-BXeXVLqQ.js +1 -0
- package/dist/studio/assets/powerquery-DNMTfnFr.js +1 -0
- package/dist/studio/assets/powershell-DshXNtvi.js +1 -0
- package/dist/studio/assets/prisma-BsRQq5mF.js +1 -0
- package/dist/studio/assets/prolog-iXnhIJG7.js +1 -0
- package/dist/studio/assets/proto-DB4EqR-F.js +1 -0
- package/dist/studio/assets/pug-ZHFv4Vgd.js +1 -0
- package/dist/studio/assets/puppet-CDv2pdJW.js +1 -0
- package/dist/studio/assets/purescript-9MfHhQsQ.js +1 -0
- package/dist/studio/assets/python-gzcpVVnB.js +1 -0
- package/dist/studio/assets/qml-DU62cSZp.js +1 -0
- package/dist/studio/assets/qmldir-DCQb3MpD.js +1 -0
- package/dist/studio/assets/qss-Fe1Jh2GI.js +1 -0
- package/dist/studio/assets/r-BwU69RSh.js +1 -0
- package/dist/studio/assets/racket-DcIDlBhZ.js +1 -0
- package/dist/studio/assets/raku-B3gFvitq.js +1 -0
- package/dist/studio/assets/razor-BUgi_XZM.js +1 -0
- package/dist/studio/assets/red-CJ3rzSJv.js +1 -0
- package/dist/studio/assets/reg-CRGYupPL.js +1 -0
- package/dist/studio/assets/regexp-DuNhqfkW.js +1 -0
- package/dist/studio/assets/rel-BtDbiS_P.js +1 -0
- package/dist/studio/assets/riscv-Ckw8ddFX.js +1 -0
- package/dist/studio/assets/ron-VUp2lXgN.js +1 -0
- package/dist/studio/assets/rose-pine-BthvhNj6.js +1 -0
- package/dist/studio/assets/rose-pine-dawn-Dg85fqjY.js +1 -0
- package/dist/studio/assets/rose-pine-moon-hon4tzzS.js +1 -0
- package/dist/studio/assets/rosmsg-CAekHB0j.js +1 -0
- package/dist/studio/assets/rst-BB3BeaSy.js +1 -0
- package/dist/studio/assets/ruby-T0tkEfUZ.js +1 -0
- package/dist/studio/assets/rust-Cfkwpbl8.js +1 -0
- package/dist/studio/assets/sas-CMhZa3S0.js +1 -0
- package/dist/studio/assets/sass-DXrisJhu.js +1 -0
- package/dist/studio/assets/scala-DKOlJaKm.js +1 -0
- package/dist/studio/assets/scheme-DQCgrYNe.js +1 -0
- package/dist/studio/assets/scss-DtXjZ3vZ.js +1 -0
- package/dist/studio/assets/sdbl-bTVj8UrX.js +1 -0
- package/dist/studio/assets/shaderlab-TOUzSsQk.js +1 -0
- package/dist/studio/assets/shellscript-BESt-FLs.js +1 -0
- package/dist/studio/assets/shellsession-8irtvYxL.js +1 -0
- package/dist/studio/assets/slack-dark-DnToyrRv.js +1 -0
- package/dist/studio/assets/slack-ochin-B2OO5cIa.js +1 -0
- package/dist/studio/assets/smalltalk-B16xEiuN.js +1 -0
- package/dist/studio/assets/snazzy-light-4G7pJPwS.js +1 -0
- package/dist/studio/assets/solarized-dark-DV17i1UV.js +1 -0
- package/dist/studio/assets/solarized-light-DSh2HLQt.js +1 -0
- package/dist/studio/assets/solidity-CKzVLygQ.js +1 -0
- package/dist/studio/assets/soy-CIvhOgLR.js +1 -0
- package/dist/studio/assets/sparql-D_iOobhT.js +1 -0
- package/dist/studio/assets/splunk-BC2Px7Mm.js +1 -0
- package/dist/studio/assets/sql-obAOXh1G.js +1 -0
- package/dist/studio/assets/ssh-config-BgfXC-Er.js +1 -0
- package/dist/studio/assets/stata-D3OCK8xW.js +1 -0
- package/dist/studio/assets/stylus-B6D30XZt.js +1 -0
- package/dist/studio/assets/surrealql-Dk_bguB0.js +1 -0
- package/dist/studio/assets/svelte-C0-KQt-t.js +1 -0
- package/dist/studio/assets/swift-DonLKvLd.js +1 -0
- package/dist/studio/assets/synthwave-84-nFMaYfgc.js +1 -0
- package/dist/studio/assets/system-verilog-DJ5XKQeo.js +1 -0
- package/dist/studio/assets/systemd-BxMlprV5.js +1 -0
- package/dist/studio/assets/talonscript-CohzipZa.js +1 -0
- package/dist/studio/assets/tasl-DMoTqEGO.js +1 -0
- package/dist/studio/assets/tcl-CZd0xW_V.js +1 -0
- package/dist/studio/assets/templ-lg4nvF9H.js +1 -0
- package/dist/studio/assets/terraform-DswuEJGm.js +1 -0
- package/dist/studio/assets/tex-BNcQSX7R.js +1 -0
- package/dist/studio/assets/tokyo-night-oM2G3aXe.js +1 -0
- package/dist/studio/assets/toml-CcmNWLt0.js +1 -0
- package/dist/studio/assets/ts-tags-AgW9jVv0.js +1 -0
- package/dist/studio/assets/tsv-sltzmVWM.js +1 -0
- package/dist/studio/assets/tsx-CL8XyR3d.js +1 -0
- package/dist/studio/assets/turtle-ByJddavk.js +1 -0
- package/dist/studio/assets/twig-VkSbsH0Y.js +1 -0
- package/dist/studio/assets/typescript-BfD1znAG.js +1 -0
- package/dist/studio/assets/typespec-B88KGewJ.js +1 -0
- package/dist/studio/assets/typst-DI99ib-x.js +1 -0
- package/dist/studio/assets/v-DETTlOr0.js +1 -0
- package/dist/studio/assets/vala-zf12oZj6.js +1 -0
- package/dist/studio/assets/vb-Djn5o6TS.js +1 -0
- package/dist/studio/assets/verilog-CiiDBU1e.js +1 -0
- package/dist/studio/assets/vesper-D5bVUKB1.js +1 -0
- package/dist/studio/assets/vhdl-BroJfC0k.js +1 -0
- package/dist/studio/assets/viml-DvXPmvsu.js +1 -0
- package/dist/studio/assets/vitesse-black-fwtXNY1n.js +1 -0
- package/dist/studio/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/dist/studio/assets/vitesse-light-VbXTXTou.js +1 -0
- package/dist/studio/assets/vue-gv_2i8Vk.js +1 -0
- package/dist/studio/assets/vue-html-w3sbjuft.js +1 -0
- package/dist/studio/assets/vue-vine-C9sgcRlL.js +1 -0
- package/dist/studio/assets/vyper-CgoNMtux.js +1 -0
- package/dist/studio/assets/wasm-BnjxR4X6.js +1 -0
- package/dist/studio/assets/wasm-ByWQv1Qj.js +1 -0
- package/dist/studio/assets/wenyan-C8pVoKbM.js +1 -0
- package/dist/studio/assets/wgsl-BsKzXJz4.js +1 -0
- package/dist/studio/assets/wikitext-ClFFjSW2.js +1 -0
- package/dist/studio/assets/wit-DdvCle-K.js +1 -0
- package/dist/studio/assets/wolfram-DLL8P-h_.js +1 -0
- package/dist/studio/assets/xml-nNPxMKnG.js +1 -0
- package/dist/studio/assets/xsl-C7iHP36x.js +1 -0
- package/dist/studio/assets/yaml-Cq3YaG6o.js +1 -0
- package/dist/studio/assets/zenscript-BnlCZFoB.js +1 -0
- package/dist/studio/assets/zig-CMLA9XwU.js +1 -0
- package/dist/studio/index.html +23 -0
- package/dist/{think-CK0xW_QY.js → think-BYZXQ-vm.js} +89 -5
- package/dist/think-BYZXQ-vm.js.map +1 -0
- package/dist/{think-Cike7VBF.d.ts → think-i1Pkgb1R.d.ts} +198 -115
- package/dist/think.d.ts +2 -2
- package/dist/think.js +1 -1
- package/dist/tools/browser.d.ts +60 -9
- package/dist/tools/browser.js +13 -9
- package/dist/tools/browser.js.map +1 -1
- package/dist/vite.d.ts +7 -0
- package/dist/vite.js +74 -2
- package/dist/vite.js.map +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +22 -4
- package/dist/think-CK0xW_QY.js.map +0 -1
|
@@ -581,6 +581,35 @@ interface ChatOptions {
|
|
|
581
581
|
*/
|
|
582
582
|
onClientToolCall?: ClientToolExecutor;
|
|
583
583
|
}
|
|
584
|
+
/** Options for {@link Think.addMessages}. */
|
|
585
|
+
interface AddMessagesOptions {
|
|
586
|
+
/**
|
|
587
|
+
* Parent to attach the first message under. Omitted (`undefined`) attaches to
|
|
588
|
+
* the latest committed leaf at call time; `null` attaches at the root. An
|
|
589
|
+
* explicit id that does not exist throws (fail fast rather than silently
|
|
590
|
+
* misattaching). Subsequent messages in an array chain under the previous one.
|
|
591
|
+
*/
|
|
592
|
+
parentId?: string | null;
|
|
593
|
+
/**
|
|
594
|
+
* `"append"` (default) inserts new rows, idempotent by message id.
|
|
595
|
+
* `"upsert"` inserts, or updates in place when the id already exists (in which
|
|
596
|
+
* case `parentId` is ignored — re-parenting is not supported).
|
|
597
|
+
*
|
|
598
|
+
* Idempotency is by id against the whole session tree, not just the target
|
|
599
|
+
* path: if a message id already exists *anywhere* in history, `"append"` is a
|
|
600
|
+
* no-op for it (no new row, no re-parent) and `"upsert"` updates it in place
|
|
601
|
+
* wherever it lives. In both modes the next message in the array chains under
|
|
602
|
+
* that existing id, so passing already-present ids mid-array threads new
|
|
603
|
+
* messages onto the existing branch rather than forking a new one.
|
|
604
|
+
*/
|
|
605
|
+
mode?: "append" | "upsert";
|
|
606
|
+
/**
|
|
607
|
+
* Broadcast the change to connected clients. Default `true`. Has no effect
|
|
608
|
+
* when called from inside an active turn (e.g. a tool `execute`), where the
|
|
609
|
+
* live view is intentionally not touched until the next turn's sync.
|
|
610
|
+
*/
|
|
611
|
+
broadcast?: boolean;
|
|
612
|
+
}
|
|
584
613
|
type AgentToolChildRunStatus =
|
|
585
614
|
| "starting"
|
|
586
615
|
| "running"
|
|
@@ -1433,6 +1462,7 @@ declare class Think<
|
|
|
1433
1462
|
private _runBestEffortOnStartStep;
|
|
1434
1463
|
private _mediaEvictionRunning;
|
|
1435
1464
|
private _mediaEvictionScheduled;
|
|
1465
|
+
private _mediaEvictionObservedOversized;
|
|
1436
1466
|
/**
|
|
1437
1467
|
* Schedule a background media-eviction pass (see `mediaEviction`).
|
|
1438
1468
|
* Coalesces repeated requests; the timer fires after the current
|
|
@@ -1440,6 +1470,9 @@ declare class Think<
|
|
|
1440
1470
|
* boot and turn latency are unaffected.
|
|
1441
1471
|
*/
|
|
1442
1472
|
private _scheduleMediaEvictionPass;
|
|
1473
|
+
private _scheduleMediaEvictionAfterAppend;
|
|
1474
|
+
private _refreshMediaEvictionSignalFromCache;
|
|
1475
|
+
private _messageMayNeedMediaEviction;
|
|
1443
1476
|
private _warnedEvictionUnsupported;
|
|
1444
1477
|
/**
|
|
1445
1478
|
* Evict oversized inline media from aged stored messages (#1710).
|
|
@@ -2336,6 +2369,42 @@ declare class Think<
|
|
|
2336
2369
|
| ((currentMessages: UIMessage[]) => UIMessage[] | Promise<UIMessage[]>),
|
|
2337
2370
|
options?: SaveMessagesOptions
|
|
2338
2371
|
): Promise<SaveMessagesResult>;
|
|
2372
|
+
/**
|
|
2373
|
+
* Add messages to history WITHOUT starting a model turn.
|
|
2374
|
+
*
|
|
2375
|
+
* Distinct from {@link Think.saveMessages} (which runs a turn) and from
|
|
2376
|
+
* AIChatAgent's `persistMessages()` (which replaces/reconciles a flat array):
|
|
2377
|
+
* `addMessages` appends or upserts into the Session tree and never enqueues a
|
|
2378
|
+
* turn. Because it bypasses the turn queue, it never deadlocks — including
|
|
2379
|
+
* when called from inside a tool `execute` during an active turn.
|
|
2380
|
+
*
|
|
2381
|
+
* Array entries are appended **linearly**: the first attaches under the
|
|
2382
|
+
* resolved parent (the latest committed leaf by default, or `parentId`), and
|
|
2383
|
+
* each subsequent message attaches under the previous one, so imported history
|
|
2384
|
+
* stays a single path rather than a fan-out of siblings. Appends are
|
|
2385
|
+
* idempotent by message id; pass `{ mode: "upsert" }` to update an existing
|
|
2386
|
+
* message in place instead (upsert never re-parents). Any role may be written;
|
|
2387
|
+
* an `assistant` message added this way is inert transcript data (it does not
|
|
2388
|
+
* mark a completed turn or trigger auto-continuation).
|
|
2389
|
+
*
|
|
2390
|
+
* The live message cache stays coherent automatically (the Session keeps it
|
|
2391
|
+
* in sync on every write, branches included). Broadcast behaviour depends on
|
|
2392
|
+
* whether a turn is running:
|
|
2393
|
+
*
|
|
2394
|
+
* - **Out of a turn** (the supported pattern — "add context, then run a
|
|
2395
|
+
* turn"): the new messages are broadcast to connected clients immediately
|
|
2396
|
+
* (unless `broadcast: false`).
|
|
2397
|
+
* - **Inside a turn** (e.g. from a tool `execute`): no broadcast is sent, so a
|
|
2398
|
+
* full snapshot can't clobber the in-progress streamed message; the injected
|
|
2399
|
+
* messages ride along on the turn's next broadcast. The write is still
|
|
2400
|
+
* durable and visible to the running turn's next sync.
|
|
2401
|
+
*/
|
|
2402
|
+
addMessages(
|
|
2403
|
+
messages:
|
|
2404
|
+
| UIMessage[]
|
|
2405
|
+
| ((currentMessages: UIMessage[]) => UIMessage[] | Promise<UIMessage[]>),
|
|
2406
|
+
options?: AddMessagesOptions
|
|
2407
|
+
): Promise<void>;
|
|
2339
2408
|
private _runProgrammaticMessagesTurn;
|
|
2340
2409
|
/**
|
|
2341
2410
|
* Run a new LLM call following the last assistant message.
|
|
@@ -2411,6 +2480,19 @@ declare class Think<
|
|
|
2411
2480
|
*/
|
|
2412
2481
|
protected abortAllRequests(): void;
|
|
2413
2482
|
private _handleClear;
|
|
2483
|
+
/**
|
|
2484
|
+
* Stamp the allocated assistant id onto a new turn's `start` chunk so a chat
|
|
2485
|
+
* client builds the live-streamed message under the SAME id this agent
|
|
2486
|
+
* persists under. Providers that emit no `start.messageId` (e.g. Workers AI)
|
|
2487
|
+
* otherwise leave the client to generate its own id; the live stream and the
|
|
2488
|
+
* persisted message broadcast then can't reconcile by id, and the originating
|
|
2489
|
+
* tab briefly renders the turn twice before collapsing. Mirrors the fix in
|
|
2490
|
+
* `@cloudflare/ai-chat`. Continuations are skipped — they reuse the existing
|
|
2491
|
+
* assistant message via the `continuation` frame flag, so the id must not
|
|
2492
|
+
* change mid-message. The orphan-recovery path inherits the id from the
|
|
2493
|
+
* stored chunk, so it needs no separate stamping.
|
|
2494
|
+
*/
|
|
2495
|
+
private _alignStreamStartId;
|
|
2414
2496
|
private _streamResultToRpcCallback;
|
|
2415
2497
|
/**
|
|
2416
2498
|
* Whether storing this chunk should immediately flush the resumable-stream
|
|
@@ -3023,119 +3105,120 @@ declare class Think<
|
|
|
3023
3105
|
}
|
|
3024
3106
|
//#endregion
|
|
3025
3107
|
export {
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3108
|
+
TurnConfig as $,
|
|
3109
|
+
MessengerContext as $t,
|
|
3110
|
+
SkillSource$1 as A,
|
|
3111
|
+
toMessengerThread as At,
|
|
3112
|
+
Think as B,
|
|
3113
|
+
MessengerReplyStage as Bt,
|
|
3114
|
+
PrepareStepFunction$1 as C,
|
|
3115
|
+
defaultConversationName as Ct,
|
|
3116
|
+
SaveMessagesResult$1 as D,
|
|
3117
|
+
toMessengerAttachment as Dt,
|
|
3118
|
+
SaveMessagesOptions$1 as E,
|
|
3119
|
+
normalizeMessengers as Et,
|
|
3120
|
+
StreamCallback as F,
|
|
3121
|
+
MESSENGER_REPLY_FIBER_NAME as Ft,
|
|
3122
|
+
ThinkScheduledTasks as G,
|
|
3123
|
+
messengerReplyRecoveryMode as Gt,
|
|
3124
|
+
ThinkScheduledTask as H,
|
|
3125
|
+
TextStreamCallbackOptions as Ht,
|
|
3126
|
+
StreamableResult as I,
|
|
3127
|
+
MessengerDeliveryPolicy as It,
|
|
3128
|
+
ThinkTime as J,
|
|
3129
|
+
textDeltaFromStreamChunk as Jt,
|
|
3130
|
+
ThinkSubmissionInspection as K,
|
|
3131
|
+
messengerReplySnapshot as Kt,
|
|
3132
|
+
SubmitMessagesOptions as L,
|
|
3133
|
+
MessengerDeliverySurface as Lt,
|
|
3134
|
+
StepContext as M,
|
|
3135
|
+
EMPTY_MESSENGER_RESPONSE as Mt,
|
|
3136
|
+
StepResult as N,
|
|
3137
|
+
ERROR_MESSENGER_RESPONSE as Nt,
|
|
3138
|
+
Session$1 as O,
|
|
3139
|
+
toMessengerAuthor as Ot,
|
|
3140
|
+
StopCondition$1 as P,
|
|
3141
|
+
INTERRUPTED_MESSENGER_RESPONSE as Pt,
|
|
3142
|
+
ToolCallResultContext as Q,
|
|
3143
|
+
MessengerCapabilities as Qt,
|
|
3144
|
+
SubmitMessagesResult as R,
|
|
3145
|
+
MessengerDeliveryTarget as Rt,
|
|
3146
|
+
PrepareStepContext as S,
|
|
3147
|
+
defaultChatSdkEvent as St,
|
|
3148
|
+
ResolvedChatRecoveryConfig as T,
|
|
3149
|
+
idempotencyKeyForEvent as Tt,
|
|
3150
|
+
ThinkScheduledTaskContext as U,
|
|
3151
|
+
deliverMessengerReply as Ut,
|
|
3152
|
+
ThinkIntervalSchedule as V,
|
|
3153
|
+
TextStreamCallback as Vt,
|
|
3154
|
+
ThinkScheduledTaskSchedule as W,
|
|
3155
|
+
messengerReplyFailureMode as Wt,
|
|
3156
|
+
ToolCallContext as X,
|
|
3157
|
+
MessengerAttachment as Xt,
|
|
3158
|
+
ThinkWallClockSchedule as Y,
|
|
3159
|
+
MessengerAction as Yt,
|
|
3160
|
+
ToolCallDecision as Z,
|
|
3161
|
+
MessengerAuthor as Zt,
|
|
3162
|
+
FiberContext$1 as _,
|
|
3163
|
+
NormalizedMessengerDefinition as _t,
|
|
3164
|
+
ChatRecoveryConfig$1 as a,
|
|
3165
|
+
serializableMessengerEvent as an,
|
|
3166
|
+
defaultContextOverflowClassifier as at,
|
|
3167
|
+
MessageConcurrency$1 as b,
|
|
3168
|
+
ThinkMessengers as bt,
|
|
3169
|
+
ChatRecoveryOptions$1 as c,
|
|
3170
|
+
ChatSdkMessengerEventInput as ct,
|
|
3171
|
+
ChatStartEvent as d,
|
|
3172
|
+
MessengerConversationResolver as dt,
|
|
3173
|
+
MessengerEvent as en,
|
|
3174
|
+
TurnContext as et,
|
|
3175
|
+
ChunkContext as f,
|
|
3176
|
+
MessengerConversationTarget as ft,
|
|
3177
|
+
ExtensionConfig as g,
|
|
3178
|
+
MessengerThinkTarget as gt,
|
|
3179
|
+
DeleteSubmissionsOptions as h,
|
|
3180
|
+
MessengerThinkHost as ht,
|
|
3181
|
+
ChatOptions as i,
|
|
3182
|
+
messengerContextFromEvent as in,
|
|
3183
|
+
Workspace$1 as it,
|
|
3184
|
+
StepConfig as j,
|
|
3185
|
+
DeliverMessengerReplyOptions as jt,
|
|
3186
|
+
SkillRunContext as k,
|
|
3187
|
+
toMessengerMessage as kt,
|
|
3188
|
+
ChatRecoveryProgressContext as l,
|
|
3189
|
+
ChatSdkMessengerOptions as lt,
|
|
3190
|
+
ContextOverflowConfig as m,
|
|
3191
|
+
MessengerRespondTo as mt,
|
|
3192
|
+
ChatErrorClassification as n,
|
|
3193
|
+
MessengerMessage as nn,
|
|
3194
|
+
TypedToolCall$1 as nt,
|
|
3195
|
+
ChatRecoveryContext$1 as o,
|
|
3196
|
+
toMessengerUserMessage as on,
|
|
3197
|
+
defineScheduledTasks as ot,
|
|
3198
|
+
ChunkPart as p,
|
|
3199
|
+
MessengerDefinition as pt,
|
|
3200
|
+
ThinkSubmissionStatus as q,
|
|
3201
|
+
parseMessengerReplySnapshot as qt,
|
|
3202
|
+
ChatErrorContext as r,
|
|
3203
|
+
MessengerThread as rn,
|
|
3204
|
+
TypedToolResult as rt,
|
|
3205
|
+
ChatRecoveryExhaustedContext as s,
|
|
3206
|
+
MediaEvictionConfig as sn,
|
|
3207
|
+
skills as st,
|
|
3208
|
+
AddMessagesOptions as t,
|
|
3209
|
+
MessengerEventKind as tn,
|
|
3210
|
+
TurnInput as tt,
|
|
3211
|
+
ChatResponseResult$1 as u,
|
|
3212
|
+
MessengerConversationMode as ut,
|
|
3213
|
+
FiberRecoveryContext$1 as v,
|
|
3214
|
+
ThinkMessengerRuntime as vt,
|
|
3215
|
+
PrepareStepResult$1 as w,
|
|
3216
|
+
defineMessengers as wt,
|
|
3217
|
+
OnStartDegradation as x,
|
|
3218
|
+
chatSdkMessenger as xt,
|
|
3219
|
+
ListSubmissionsOptions as y,
|
|
3220
|
+
ThinkMessengerStateAgent as yt,
|
|
3221
|
+
TextStreamPart as z,
|
|
3222
|
+
MessengerReplySnapshot as zt
|
|
3140
3223
|
};
|
|
3141
|
-
//# sourceMappingURL=think-
|
|
3224
|
+
//# sourceMappingURL=think-i1Pkgb1R.d.ts.map
|
package/dist/think.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TurnConfig, A as SkillSource, B as Think, C as PrepareStepFunction, D as SaveMessagesResult, E as SaveMessagesOptions, F as StreamCallback, G as ThinkScheduledTasks, H as ThinkScheduledTask, I as StreamableResult, J as ThinkTime, K as ThinkSubmissionInspection, L as SubmitMessagesOptions, M as StepContext, N as StepResult, O as Session, P as StopCondition, Q as ToolCallResultContext, R as SubmitMessagesResult, S as PrepareStepContext, T as ResolvedChatRecoveryConfig, U as ThinkScheduledTaskContext, V as ThinkIntervalSchedule, W as ThinkScheduledTaskSchedule, X as ToolCallContext, Y as ThinkWallClockSchedule, Z as ToolCallDecision, _ as FiberContext, a as ChatRecoveryConfig, at as defaultContextOverflowClassifier, b as MessageConcurrency, c as ChatRecoveryOptions, d as ChatStartEvent, et as TurnContext, f as ChunkContext, g as ExtensionConfig, h as DeleteSubmissionsOptions, i as ChatOptions, it as Workspace, j as StepConfig, k as SkillRunContext, l as ChatRecoveryProgressContext, m as ContextOverflowConfig, n as ChatErrorClassification, nt as TypedToolCall, o as ChatRecoveryContext, ot as defineScheduledTasks, p as ChunkPart, q as ThinkSubmissionStatus, r as ChatErrorContext, rt as TypedToolResult, s as ChatRecoveryExhaustedContext, sn as MediaEvictionConfig, st as skills, t as AddMessagesOptions, tt as TurnInput, u as ChatResponseResult, v as FiberRecoveryContext, w as PrepareStepResult, x as OnStartDegradation, y as ListSubmissionsOptions, z as TextStreamPart } from "./think-i1Pkgb1R.js";
|
|
2
2
|
import { h as WorkspaceLike } from "./workspace-BZXdZcuw.js";
|
|
3
|
-
export { ChatErrorClassification, ChatErrorContext, ChatOptions, type ChatRecoveryConfig, type ChatRecoveryContext, type ChatRecoveryExhaustedContext, type ChatRecoveryOptions, type ChatRecoveryProgressContext, type ChatResponseResult, ChatStartEvent, ChunkContext, ChunkPart, ContextOverflowConfig, DeleteSubmissionsOptions, ExtensionConfig, type FiberContext, type FiberRecoveryContext, ListSubmissionsOptions, type MediaEvictionConfig, type MessageConcurrency, OnStartDegradation, PrepareStepContext, type PrepareStepFunction, type PrepareStepResult, type ResolvedChatRecoveryConfig, type SaveMessagesOptions, type SaveMessagesResult, Session, type SkillRunContext, type SkillSource, StepConfig, StepContext, type StepResult, type StopCondition, StreamCallback, StreamableResult, SubmitMessagesOptions, SubmitMessagesResult, type TextStreamPart, Think, ThinkIntervalSchedule, ThinkScheduledTask, ThinkScheduledTaskContext, ThinkScheduledTaskSchedule, ThinkScheduledTasks, ThinkSubmissionInspection, ThinkSubmissionStatus, ThinkTime, ThinkWallClockSchedule, ToolCallContext, ToolCallDecision, ToolCallResultContext, TurnConfig, TurnContext, TurnInput, type TypedToolCall, type TypedToolResult, Workspace, type WorkspaceLike, defaultContextOverflowClassifier, defineScheduledTasks, skills };
|
|
3
|
+
export { AddMessagesOptions, ChatErrorClassification, ChatErrorContext, ChatOptions, type ChatRecoveryConfig, type ChatRecoveryContext, type ChatRecoveryExhaustedContext, type ChatRecoveryOptions, type ChatRecoveryProgressContext, type ChatResponseResult, ChatStartEvent, ChunkContext, ChunkPart, ContextOverflowConfig, DeleteSubmissionsOptions, ExtensionConfig, type FiberContext, type FiberRecoveryContext, ListSubmissionsOptions, type MediaEvictionConfig, type MessageConcurrency, OnStartDegradation, PrepareStepContext, type PrepareStepFunction, type PrepareStepResult, type ResolvedChatRecoveryConfig, type SaveMessagesOptions, type SaveMessagesResult, Session, type SkillRunContext, type SkillSource, StepConfig, StepContext, type StepResult, type StopCondition, StreamCallback, StreamableResult, SubmitMessagesOptions, SubmitMessagesResult, type TextStreamPart, Think, ThinkIntervalSchedule, ThinkScheduledTask, ThinkScheduledTaskContext, ThinkScheduledTaskSchedule, ThinkScheduledTasks, ThinkSubmissionInspection, ThinkSubmissionStatus, ThinkTime, ThinkWallClockSchedule, ToolCallContext, ToolCallDecision, ToolCallResultContext, TurnConfig, TurnContext, TurnInput, type TypedToolCall, type TypedToolResult, Workspace, type WorkspaceLike, defaultContextOverflowClassifier, defineScheduledTasks, skills };
|
package/dist/think.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as defineScheduledTasks, i as defaultContextOverflowClassifier, n as Think, o as skills, r as Workspace, t as Session } from "./think-
|
|
1
|
+
import { a as defineScheduledTasks, i as defaultContextOverflowClassifier, n as Think, o as skills, r as Workspace, t as Session } from "./think-BYZXQ-vm.js";
|
|
2
2
|
export { Session, Think, Workspace, defaultContextOverflowClassifier, defineScheduledTasks, skills };
|
package/dist/tools/browser.d.ts
CHANGED
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
import { ToolSet } from "ai";
|
|
2
|
+
import {
|
|
3
|
+
QuickAction,
|
|
4
|
+
QuickActionBinary,
|
|
5
|
+
QuickActionBinding,
|
|
6
|
+
QuickActionCommonOptions,
|
|
7
|
+
QuickActionExtractInput,
|
|
8
|
+
QuickActionInput,
|
|
9
|
+
QuickActionPage,
|
|
10
|
+
QuickActionScrapeInput,
|
|
11
|
+
QuickActionScrapeResult,
|
|
12
|
+
QuickActionScreenshotInput,
|
|
13
|
+
QuickActionSnapshot,
|
|
14
|
+
browserContent,
|
|
15
|
+
browserExtract,
|
|
16
|
+
browserLinks,
|
|
17
|
+
browserMarkdown,
|
|
18
|
+
browserPdf,
|
|
19
|
+
browserScrape,
|
|
20
|
+
browserScreenshot,
|
|
21
|
+
browserSnapshot,
|
|
22
|
+
runQuickAction
|
|
23
|
+
} from "agents/browser";
|
|
2
24
|
import {
|
|
3
25
|
BrowserRuntime,
|
|
4
26
|
CreateBrowserToolsOptions,
|
|
5
|
-
|
|
27
|
+
CreateQuickActionToolsOptions,
|
|
28
|
+
QuickActionToolName,
|
|
29
|
+
createBrowserRuntime,
|
|
30
|
+
createQuickActionTools
|
|
6
31
|
} from "agents/browser/ai";
|
|
7
32
|
|
|
8
33
|
//#region src/tools/browser.d.ts
|
|
9
34
|
/**
|
|
10
35
|
* Create browser automation tools for Think agents.
|
|
11
36
|
*
|
|
12
|
-
* Returns
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
37
|
+
* Returns the durable `browser_execute` tool backed by a codemode runtime —
|
|
38
|
+
* the model writes TypeScript against the `cdp` connector (`cdp.send`,
|
|
39
|
+
* `cdp.attachToTarget`, `cdp.spec`, …); executions are recorded for
|
|
40
|
+
* abort-and-replay, and browser sessions are keyed by execution (they survive
|
|
41
|
+
* pauses and, in `reuse`/`dynamic` modes, span executions) — plus the stateless
|
|
42
|
+
* {@link createQuickActionTools | Quick Action} tools (`browser_markdown`,
|
|
43
|
+
* `browser_extract`, …) by default whenever a `browser` binding is present.
|
|
44
|
+
* Pass `quickActions: false` to omit them, or use `createQuickActionTools`
|
|
45
|
+
* directly for the stateless tools alone (no Worker Loader required).
|
|
18
46
|
*
|
|
19
47
|
* Setup checklist:
|
|
20
48
|
*
|
|
@@ -35,7 +63,7 @@ import {
|
|
|
35
63
|
*
|
|
36
64
|
* export class MyAgent extends Think<Env> {
|
|
37
65
|
* getModel() {
|
|
38
|
-
* return createWorkersAI({ binding: this.env.AI })("@cf/moonshotai/kimi-k2.
|
|
66
|
+
* return createWorkersAI({ binding: this.env.AI })("@cf/moonshotai/kimi-k2.7-code");
|
|
39
67
|
* }
|
|
40
68
|
*
|
|
41
69
|
* getTools() {
|
|
@@ -58,7 +86,30 @@ declare function createBrowserTools(
|
|
|
58
86
|
export {
|
|
59
87
|
type BrowserRuntime,
|
|
60
88
|
type CreateBrowserToolsOptions,
|
|
89
|
+
type CreateQuickActionToolsOptions,
|
|
90
|
+
type QuickAction,
|
|
91
|
+
type QuickActionBinary,
|
|
92
|
+
type QuickActionBinding,
|
|
93
|
+
type QuickActionCommonOptions,
|
|
94
|
+
type QuickActionExtractInput,
|
|
95
|
+
type QuickActionInput,
|
|
96
|
+
type QuickActionPage,
|
|
97
|
+
type QuickActionScrapeInput,
|
|
98
|
+
type QuickActionScrapeResult,
|
|
99
|
+
type QuickActionScreenshotInput,
|
|
100
|
+
type QuickActionSnapshot,
|
|
101
|
+
type QuickActionToolName,
|
|
102
|
+
browserContent,
|
|
103
|
+
browserExtract,
|
|
104
|
+
browserLinks,
|
|
105
|
+
browserMarkdown,
|
|
106
|
+
browserPdf,
|
|
107
|
+
browserScrape,
|
|
108
|
+
browserScreenshot,
|
|
109
|
+
browserSnapshot,
|
|
61
110
|
createBrowserRuntime,
|
|
62
|
-
createBrowserTools
|
|
111
|
+
createBrowserTools,
|
|
112
|
+
createQuickActionTools,
|
|
113
|
+
runQuickAction
|
|
63
114
|
};
|
|
64
115
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/tools/browser.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { browserContent, browserExtract, browserLinks, browserMarkdown, browserPdf, browserScrape, browserScreenshot, browserSnapshot, runQuickAction } from "agents/browser";
|
|
2
|
+
import { createBrowserRuntime, createBrowserTools as createBrowserTools$1, createQuickActionTools } from "agents/browser/ai";
|
|
2
3
|
//#region src/tools/browser.ts
|
|
3
4
|
/**
|
|
4
5
|
* Create browser automation tools for Think agents.
|
|
5
6
|
*
|
|
6
|
-
* Returns
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Returns the durable `browser_execute` tool backed by a codemode runtime —
|
|
8
|
+
* the model writes TypeScript against the `cdp` connector (`cdp.send`,
|
|
9
|
+
* `cdp.attachToTarget`, `cdp.spec`, …); executions are recorded for
|
|
10
|
+
* abort-and-replay, and browser sessions are keyed by execution (they survive
|
|
11
|
+
* pauses and, in `reuse`/`dynamic` modes, span executions) — plus the stateless
|
|
12
|
+
* {@link createQuickActionTools | Quick Action} tools (`browser_markdown`,
|
|
13
|
+
* `browser_extract`, …) by default whenever a `browser` binding is present.
|
|
14
|
+
* Pass `quickActions: false` to omit them, or use `createQuickActionTools`
|
|
15
|
+
* directly for the stateless tools alone (no Worker Loader required).
|
|
12
16
|
*
|
|
13
17
|
* Setup checklist:
|
|
14
18
|
*
|
|
@@ -29,7 +33,7 @@ import { createBrowserRuntime, createBrowserTools as createBrowserTools$1 } from
|
|
|
29
33
|
*
|
|
30
34
|
* export class MyAgent extends Think<Env> {
|
|
31
35
|
* getModel() {
|
|
32
|
-
* return createWorkersAI({ binding: this.env.AI })("@cf/moonshotai/kimi-k2.
|
|
36
|
+
* return createWorkersAI({ binding: this.env.AI })("@cf/moonshotai/kimi-k2.7-code");
|
|
33
37
|
* }
|
|
34
38
|
*
|
|
35
39
|
* getTools() {
|
|
@@ -49,6 +53,6 @@ function createBrowserTools(options) {
|
|
|
49
53
|
return createBrowserTools$1(options);
|
|
50
54
|
}
|
|
51
55
|
//#endregion
|
|
52
|
-
export { createBrowserRuntime, createBrowserTools };
|
|
56
|
+
export { browserContent, browserExtract, browserLinks, browserMarkdown, browserPdf, browserScrape, browserScreenshot, browserSnapshot, createBrowserRuntime, createBrowserTools, createQuickActionTools, runQuickAction };
|
|
53
57
|
|
|
54
58
|
//# sourceMappingURL=browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","names":["createBrowserToolsForAi"],"sources":["../../src/tools/browser.ts"],"sourcesContent":["import type { ToolSet } from \"ai\";\nimport {\n createBrowserRuntime,\n createBrowserTools as createBrowserToolsForAi,\n type BrowserRuntime,\n type CreateBrowserToolsOptions\n} from \"agents/browser/ai\";\n\nexport {\n createBrowserRuntime,\n type BrowserRuntime,\n type CreateBrowserToolsOptions\n};\n\n/**\n * Create browser automation tools for Think agents.\n *\n * Returns
|
|
1
|
+
{"version":3,"file":"browser.js","names":["createBrowserToolsForAi"],"sources":["../../src/tools/browser.ts"],"sourcesContent":["import type { ToolSet } from \"ai\";\nimport {\n createBrowserRuntime,\n createBrowserTools as createBrowserToolsForAi,\n createQuickActionTools,\n type BrowserRuntime,\n type CreateBrowserToolsOptions,\n type CreateQuickActionToolsOptions,\n type QuickActionToolName\n} from \"agents/browser/ai\";\n\nexport {\n createBrowserRuntime,\n type BrowserRuntime,\n type CreateBrowserToolsOptions\n};\n\n// Stateless Quick Action tools — re-exported so a Think agent can expose them\n// from `getTools()` with a single import, including the loader-free path\n// (`createQuickActionTools`) that needs only the `browser` binding.\nexport {\n createQuickActionTools,\n type CreateQuickActionToolsOptions,\n type QuickActionToolName\n};\nexport {\n browserContent,\n browserExtract,\n browserLinks,\n browserMarkdown,\n browserPdf,\n browserScrape,\n browserScreenshot,\n browserSnapshot,\n runQuickAction,\n type QuickAction,\n type QuickActionBinary,\n type QuickActionBinding,\n type QuickActionCommonOptions,\n type QuickActionExtractInput,\n type QuickActionInput,\n type QuickActionPage,\n type QuickActionScrapeInput,\n type QuickActionScrapeResult,\n type QuickActionScreenshotInput,\n type QuickActionSnapshot\n} from \"agents/browser\";\n\n/**\n * Create browser automation tools for Think agents.\n *\n * Returns the durable `browser_execute` tool backed by a codemode runtime —\n * the model writes TypeScript against the `cdp` connector (`cdp.send`,\n * `cdp.attachToTarget`, `cdp.spec`, …); executions are recorded for\n * abort-and-replay, and browser sessions are keyed by execution (they survive\n * pauses and, in `reuse`/`dynamic` modes, span executions) — plus the stateless\n * {@link createQuickActionTools | Quick Action} tools (`browser_markdown`,\n * `browser_extract`, …) by default whenever a `browser` binding is present.\n * Pass `quickActions: false` to omit them, or use `createQuickActionTools`\n * directly for the stateless tools alone (no Worker Loader required).\n *\n * Setup checklist:\n *\n * - `\"browser\": { \"binding\": \"BROWSER\" }` in wrangler.jsonc\n * - `\"worker_loaders\": [{ \"binding\": \"LOADER\" }]` in wrangler.jsonc\n * - export the runtime class from your worker entry:\n * `export { CodemodeRuntime } from \"@cloudflare/codemode\"`\n * (the `@cloudflare/codemode/vite` plugin does this automatically)\n *\n * Use {@link createBrowserRuntime} instead when you also need the runtime\n * handle (approvals, audit, `expirePaused`) or the connector's host-side\n * session helpers (`sessionInfo`, `closeSession`, `sweep`).\n *\n * @example\n * ```ts\n * import { Think } from \"@cloudflare/think\";\n * import { createBrowserTools } from \"@cloudflare/think/tools/browser\";\n *\n * export class MyAgent extends Think<Env> {\n * getModel() {\n * return createWorkersAI({ binding: this.env.AI })(\"@cf/moonshotai/kimi-k2.7-code\");\n * }\n *\n * getTools() {\n * return {\n * ...createBrowserTools({\n * ctx: this.ctx,\n * browser: this.env.BROWSER,\n * loader: this.env.LOADER,\n * session: { mode: \"dynamic\" }\n * }),\n * };\n * }\n * }\n * ```\n */\nexport function createBrowserTools(\n options: CreateBrowserToolsOptions\n): ToolSet {\n return createBrowserToolsForAi(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,SAAgB,mBACd,SACS;CACT,OAAOA,qBAAwB,OAAO;AACxC"}
|
package/dist/vite.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ interface ThinkVitePluginOptions extends ThinkWorkerConfigOptions {
|
|
|
11
11
|
files?: Record<string, string>;
|
|
12
12
|
manifest?: ThinkFrameworkManifest;
|
|
13
13
|
allowNonVirtualMain?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Register the dev-server `s` shortcut that launches Think Studio against the
|
|
16
|
+
* running instance. Defaults to `true` (only active when the prebuilt Studio
|
|
17
|
+
* bundle ships with this package and the dev server runs in an interactive
|
|
18
|
+
* TTY).
|
|
19
|
+
*/
|
|
20
|
+
studioShortcut?: boolean;
|
|
14
21
|
}
|
|
15
22
|
declare const THINK_EXPERIMENTAL_NOTICE: string;
|
|
16
23
|
declare function think(options?: ThinkVitePluginOptions): PluginOption[];
|
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { a as readWranglerConfig, c as createThinkWorkerConfig, d as diagnoseThinkWorkerConfig, l as createThinkWorkerDefaults, m as summarizeThinkManifest, o as resolveThinkManifest, p as mergeThinkWorkerConfig, s as watchWranglerConfigFiles, t as applyUserBindingNames } from "./project-
|
|
2
|
-
import { a as generateThinkRouterModule, i as generateThinkManifestModule, n as generateThinkConfigModule, o as generateThinkServerEntryModule, r as generateThinkEntry, t as generateThinkAgentsModule } from "./codegen-
|
|
1
|
+
import { a as readWranglerConfig, c as createThinkWorkerConfig, d as diagnoseThinkWorkerConfig, l as createThinkWorkerDefaults, m as summarizeThinkManifest, o as resolveThinkManifest, p as mergeThinkWorkerConfig, s as watchWranglerConfigFiles, t as applyUserBindingNames } from "./project-BHurFdu4.js";
|
|
2
|
+
import { a as generateThinkRouterModule, i as generateThinkManifestModule, n as generateThinkConfigModule, o as generateThinkServerEntryModule, r as generateThinkEntry, t as generateThinkAgentsModule } from "./codegen-CuPdJRpV.js";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { spawn } from "node:child_process";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
3
7
|
import agents from "agents/vite";
|
|
4
8
|
//#region src/framework/virtual.ts
|
|
5
9
|
function createVirtualModule(id) {
|
|
@@ -17,6 +21,24 @@ function createVirtualModule(id) {
|
|
|
17
21
|
}
|
|
18
22
|
//#endregion
|
|
19
23
|
//#region src/vite.ts
|
|
24
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
25
|
+
const STUDIO_INDEX = path.join(moduleDir, "studio", "index.html");
|
|
26
|
+
const CLI_ENTRY = path.join(moduleDir, "cli", "index.js");
|
|
27
|
+
/** Derive `host`/`protocol` of the running dev server for `think studio`. */
|
|
28
|
+
function devServerTarget(server) {
|
|
29
|
+
const local = server.resolvedUrls?.local?.[0];
|
|
30
|
+
if (local) try {
|
|
31
|
+
const url = new URL(local);
|
|
32
|
+
return {
|
|
33
|
+
host: url.host,
|
|
34
|
+
secure: url.protocol === "https:"
|
|
35
|
+
};
|
|
36
|
+
} catch {}
|
|
37
|
+
return {
|
|
38
|
+
host: `localhost:${server.config.server.port ?? 5173}`,
|
|
39
|
+
secure: false
|
|
40
|
+
};
|
|
41
|
+
}
|
|
20
42
|
const virtualModules = {
|
|
21
43
|
agents: createVirtualModule("virtual:think/agents"),
|
|
22
44
|
config: createVirtualModule("virtual:think/config"),
|
|
@@ -30,12 +52,62 @@ function think(options = {}) {
|
|
|
30
52
|
let config = null;
|
|
31
53
|
let manifest = options.manifest ?? null;
|
|
32
54
|
let warnedExperimental = false;
|
|
55
|
+
let studioChild = null;
|
|
33
56
|
const frameworkPlugin = {
|
|
34
57
|
name: "@cloudflare/think",
|
|
35
58
|
enforce: "pre",
|
|
36
59
|
configResolved(resolved) {
|
|
37
60
|
config = resolved;
|
|
38
61
|
},
|
|
62
|
+
configureServer(server) {
|
|
63
|
+
if (options.studioShortcut === false) return;
|
|
64
|
+
const launchStudio = () => {
|
|
65
|
+
if (!existsSync(STUDIO_INDEX) || !existsSync(CLI_ENTRY)) {
|
|
66
|
+
server.config.logger.warn("Think Studio isn't available — build @cloudflare/think to generate the Studio bundle.");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (studioChild && studioChild.exitCode === null) {
|
|
70
|
+
server.config.logger.info("Think Studio is already running.");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const { host, secure } = devServerTarget(server);
|
|
74
|
+
const args = [
|
|
75
|
+
CLI_ENTRY,
|
|
76
|
+
"studio",
|
|
77
|
+
"--host",
|
|
78
|
+
host,
|
|
79
|
+
"--root",
|
|
80
|
+
server.config.root
|
|
81
|
+
];
|
|
82
|
+
if (secure) args.push("--protocol", "wss");
|
|
83
|
+
server.config.logger.info(`\nLaunching Think Studio for ${host}…`);
|
|
84
|
+
studioChild = spawn(process.execPath, args, { stdio: [
|
|
85
|
+
"ignore",
|
|
86
|
+
"inherit",
|
|
87
|
+
"inherit"
|
|
88
|
+
] });
|
|
89
|
+
studioChild.on("exit", () => {
|
|
90
|
+
studioChild = null;
|
|
91
|
+
});
|
|
92
|
+
studioChild.on("error", (error) => {
|
|
93
|
+
server.config.logger.error(`Failed to launch Think Studio: ${error.message}`);
|
|
94
|
+
studioChild = null;
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const registerShortcut = () => {
|
|
98
|
+
server.bindCLIShortcuts({ customShortcuts: [{
|
|
99
|
+
key: "s",
|
|
100
|
+
description: "open Think Studio",
|
|
101
|
+
action: () => launchStudio()
|
|
102
|
+
}] });
|
|
103
|
+
};
|
|
104
|
+
if (server.httpServer?.listening) registerShortcut();
|
|
105
|
+
else server.httpServer?.once("listening", registerShortcut);
|
|
106
|
+
server.httpServer?.once("close", () => {
|
|
107
|
+
studioChild?.kill();
|
|
108
|
+
studioChild = null;
|
|
109
|
+
});
|
|
110
|
+
},
|
|
39
111
|
async buildStart() {
|
|
40
112
|
if (!warnedExperimental) {
|
|
41
113
|
warnedExperimental = true;
|