@cloudflare/think 0.9.1 → 0.11.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 +10 -17
- package/dist/{chat-sdk-Bb93yaZh.js → chat-sdk-D6cUghsQ.js} +33 -8
- package/dist/chat-sdk-D6cUghsQ.js.map +1 -0
- package/dist/cli/index.js +718 -55
- package/dist/cli/index.js.map +1 -1
- package/dist/{codegen-CuPdJRpV.js → codegen-DlA2QQuU.js} +6 -38
- package/dist/codegen-DlA2QQuU.js.map +1 -0
- package/dist/{config-D512sQYg.d.ts → config-CD7hqncK.d.ts} +5 -5
- package/dist/extensions/index.js +1 -1
- package/dist/framework/index.d.ts +17 -62
- package/dist/framework/index.js +3 -57
- package/dist/{think-CwxWGsX1.d.ts → index-D_S5mETO.d.ts} +1643 -688
- package/dist/{manager-BPndMP_6.js → manager-CSk5htym.js} +7 -7
- package/dist/{manager-BPndMP_6.js.map → manager-CSk5htym.js.map} +1 -1
- package/dist/{manifest-CpB-xngB.d.ts → manifest-DK5HuGga.d.ts} +16 -18
- package/dist/messengers/index.d.ts +59 -55
- package/dist/messengers/index.js +2 -2
- package/dist/messengers/telegram.d.ts +4 -4
- package/dist/messengers/telegram.js +1 -1
- package/dist/react.d.ts +79 -0
- package/dist/react.js +28 -0
- package/dist/react.js.map +1 -0
- package/dist/server-entry.d.ts +1 -1
- package/dist/server-entry.js +1 -1
- package/dist/server-entry.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-D27LthTc.js +1 -0
- package/dist/studio/assets/angular-ts-DtNL2gQ7.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-BgEcDqM0.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-CstbRF9e.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-CLG-7epG.js +1 -0
- package/dist/studio/assets/bsl-BkkzgIyY.js +1 -0
- package/dist/studio/assets/c-CssQqwxO.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-CjmzHCjg.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-B_rqYPkp.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-5YyZJlb7.js +1 -0
- package/dist/studio/assets/crystal-D7uKze0i.js +1 -0
- package/dist/studio/assets/csharp-Ct8U2NOr.js +1 -0
- package/dist/studio/assets/css-k9oPgg7G.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-CGgsSt0x.js +1 -0
- package/dist/studio/assets/elixir-BX_d5Evo.js +1 -0
- package/dist/studio/assets/elm-DENxDm5e.js +1 -0
- package/dist/studio/assets/emacs-lisp-C9PiwqqW.js +1 -0
- package/dist/studio/assets/erb-DvYOup03.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-BsAdTS5A.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-e0h98Z67.js +1 -0
- package/dist/studio/assets/glimmer-ts-C9s5Kv8m.js +1 -0
- package/dist/studio/assets/glsl-CCiyeTRs.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-BRtHwsqk.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-Dnt0QXHh.js +1 -0
- package/dist/studio/assets/haml-EXGmzuB1.js +1 -0
- package/dist/studio/assets/handlebars-CzyBIDJE.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-CQUFKLNu.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-BAT8b_VM.js +1 -0
- package/dist/studio/assets/html-derivative-7tkS-r6F.js +1 -0
- package/dist/studio/assets/http-Cgka02Qq.js +1 -0
- package/dist/studio/assets/hurl-Cbkh8WEw.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-D6n8vpkp.js +390 -0
- package/dist/studio/assets/index-DkGWw6ES.css +2 -0
- package/dist/studio/assets/ini-B5eOa1yu.js +1 -0
- package/dist/studio/assets/java-DrRKiUno.js +1 -0
- package/dist/studio/assets/javascript-9LAnHOxD.js +1 -0
- package/dist/studio/assets/jinja-CqRt4prs.js +1 -0
- package/dist/studio/assets/jison-BX-IOQpJ.js +1 -0
- package/dist/studio/assets/json-dOrE-En8.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-BSTPfqWX.js +1 -0
- package/dist/studio/assets/julia-Dvz-BPmf.js +1 -0
- package/dist/studio/assets/just-BHQm0Atq.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-CxdhxuXv.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-D-hM-Q_F.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-5qtqjLHq.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-5FJaM2co.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-BhYW7lCG.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-CWM2EB-u.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-rtAXrRye.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-DQSmaN9U.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-B54AdcaE.js +1 -0
- package/dist/studio/assets/php-DpvTxCny.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-Cyffw0Ho.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-CxRetSkO.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-CXWRxrXc.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-BJzI-zc9.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-dqxdfrnE.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-BW7eKYj4.js +1 -0
- package/dist/studio/assets/ruby-D5Npyj8-.js +1 -0
- package/dist/studio/assets/rust-Cfkwpbl8.js +1 -0
- package/dist/studio/assets/sas-DZLppjul.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-CbqoxyAe.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-CFHqBeXu.js +1 -0
- package/dist/studio/assets/shellsession-CbZDA4Bf.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-PImjtV58.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-DhGo8urW.js +1 -0
- package/dist/studio/assets/ssh-config-BgfXC-Er.js +1 -0
- package/dist/studio/assets/stata-CjHWbU2v.js +1 -0
- package/dist/studio/assets/stylus-B6D30XZt.js +1 -0
- package/dist/studio/assets/surrealql-o8Qr4t56.js +1 -0
- package/dist/studio/assets/svelte-DlSIyEV1.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-qizfwU1w.js +1 -0
- package/dist/studio/assets/terraform-DswuEJGm.js +1 -0
- package/dist/studio/assets/tex-Ca7T661H.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-DUmjLkgl.js +1 -0
- package/dist/studio/assets/tsv-sltzmVWM.js +1 -0
- package/dist/studio/assets/tsx-CfwgIqHW.js +1 -0
- package/dist/studio/assets/turtle-ByJddavk.js +1 -0
- package/dist/studio/assets/twig-D7NAYUBY.js +1 -0
- package/dist/studio/assets/typescript-Bbz9oX-P.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-html-CcxTb_Jn.js +1 -0
- package/dist/studio/assets/vue-vYpz06zQ.js +1 -0
- package/dist/studio/assets/vue-vine-DW4RqCKF.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-R4LZ_u4f.js +1 -0
- package/dist/studio/assets/xsl-CS-xzp3L.js +1 -0
- package/dist/studio/assets/yaml-CqDWbYXd.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.d.ts +2 -2
- package/dist/think.js +8292 -2
- package/dist/think.js.map +1 -0
- package/dist/tools/extensions.js +1 -1
- package/dist/tools/workspace.js +2 -2
- package/dist/tools/workspace.js.map +1 -1
- package/dist/{types-codegen-B6c5KpYH.js → types-codegen-C-9yeFao.js} +9 -33
- package/dist/types-codegen-C-9yeFao.js.map +1 -0
- package/dist/vite.d.ts +12 -5
- package/dist/vite.js +73 -1
- package/dist/vite.js.map +1 -1
- package/dist/workflows.d.ts +1 -1
- package/docs/actions.md +297 -0
- package/docs/channels.md +185 -0
- package/docs/client-tools.md +233 -0
- package/docs/getting-started.md +314 -0
- package/docs/index.md +1272 -0
- package/docs/lifecycle-hooks.md +839 -0
- package/docs/messengers.md +197 -0
- package/docs/programmatic-submissions.md +206 -0
- package/docs/sub-agents.md +520 -0
- package/docs/tools.md +582 -0
- package/docs/workflows.md +217 -0
- package/package.json +57 -10
- package/dist/chat-sdk-Bb93yaZh.js.map +0 -1
- package/dist/codegen-CuPdJRpV.js.map +0 -1
- package/dist/framework/index.js.map +0 -1
- package/dist/think-2nHHEcY3.js +0 -6446
- package/dist/think-2nHHEcY3.js.map +0 -1
- package/dist/types-codegen-B6c5KpYH.js.map +0 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Think Messengers
|
|
2
|
+
|
|
3
|
+
Use messengers when a Think agent should receive and reply to Chat SDK webhooks
|
|
4
|
+
directly. Think owns the webhook route, durable reply fiber, conversation
|
|
5
|
+
routing, and streamed delivery back to the provider.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Install the Think package and the provider adapter you use:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @cloudflare/think agents ai @chat-adapter/telegram
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Provider adapters are exported from provider-specific subpaths so unused
|
|
16
|
+
adapters are not bundled into your Worker.
|
|
17
|
+
|
|
18
|
+
## Telegram
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { Think } from "@cloudflare/think";
|
|
22
|
+
import { ThinkMessengerStateAgent } from "@cloudflare/think/messengers";
|
|
23
|
+
import telegramMessenger from "@cloudflare/think/messengers/telegram";
|
|
24
|
+
|
|
25
|
+
export { ThinkMessengerStateAgent };
|
|
26
|
+
|
|
27
|
+
export class SupportAgent extends Think<Env> {
|
|
28
|
+
getMessengers() {
|
|
29
|
+
return {
|
|
30
|
+
telegram: telegramMessenger({
|
|
31
|
+
token: this.env.TELEGRAM_BOT_TOKEN,
|
|
32
|
+
userName: "support_bot",
|
|
33
|
+
secretToken: this.env.TELEGRAM_WEBHOOK_SECRET_TOKEN
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
With the default `telegram` key, register the Telegram webhook at:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
https://<your-worker>/messengers/telegram/webhook
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`telegramMessenger()` requires `secretToken` in webhook mode unless you pass a
|
|
47
|
+
custom `verifyWebhook` function or explicitly opt out with
|
|
48
|
+
`verifyWebhook: false`.
|
|
49
|
+
|
|
50
|
+
If one Think agent owns multiple Telegram bots, give each provider a distinct
|
|
51
|
+
Chat SDK adapter name:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
{
|
|
55
|
+
support: telegramMessenger({
|
|
56
|
+
adapterName: "support-telegram",
|
|
57
|
+
token: this.env.SUPPORT_TELEGRAM_BOT_TOKEN,
|
|
58
|
+
userName: "support_bot",
|
|
59
|
+
secretToken: this.env.SUPPORT_TELEGRAM_WEBHOOK_SECRET_TOKEN
|
|
60
|
+
}),
|
|
61
|
+
sales: telegramMessenger({
|
|
62
|
+
adapterName: "sales-telegram",
|
|
63
|
+
token: this.env.SALES_TELEGRAM_BOT_TOKEN,
|
|
64
|
+
userName: "sales_bot",
|
|
65
|
+
secretToken: this.env.SALES_TELEGRAM_WEBHOOK_SECRET_TOKEN
|
|
66
|
+
})
|
|
67
|
+
};
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Duplicate adapter names fail during startup so providers cannot overwrite each
|
|
71
|
+
other in the shared Chat SDK runtime.
|
|
72
|
+
|
|
73
|
+
## Routing
|
|
74
|
+
|
|
75
|
+
The root Think agent handles messenger webhook routes after framework sub-agent
|
|
76
|
+
routing and Think internal routes, but before user-defined `onRequest` fallback.
|
|
77
|
+
Messenger routes are root-only. Defining `getMessengers()` on a sub-agent class
|
|
78
|
+
does not create webhook routes for that sub-agent.
|
|
79
|
+
|
|
80
|
+
By default, Think replies to direct messages and mentions. New mentions subscribe
|
|
81
|
+
the Chat SDK thread so later mentions in the same thread are still observed, but
|
|
82
|
+
ordinary subscribed-thread messages and button actions are ignored unless you
|
|
83
|
+
opt in:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
telegramMessenger({
|
|
87
|
+
token: this.env.TELEGRAM_BOT_TOKEN,
|
|
88
|
+
userName: "support_bot",
|
|
89
|
+
secretToken: this.env.TELEGRAM_WEBHOOK_SECRET_TOKEN,
|
|
90
|
+
respondTo: ["direct-message", "mention", "subscribed-thread", "action"]
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Action events are converted into Think user messages with the action id, value,
|
|
95
|
+
source message id, and initiating user. Use `getMessengerContext()?.action`
|
|
96
|
+
inside hooks or tools when you need provider-specific action details. Actions
|
|
97
|
+
are opt-in so interactive cards do not accidentally trigger model turns.
|
|
98
|
+
|
|
99
|
+
## Conversation Targets
|
|
100
|
+
|
|
101
|
+
The default conversation mode is one Think sub-agent per Chat SDK thread. This
|
|
102
|
+
keeps group chats, direct messages, and channels from sharing memory
|
|
103
|
+
accidentally.
|
|
104
|
+
|
|
105
|
+
Use the root agent as the conversation when all messenger traffic should share
|
|
106
|
+
one Think session:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
telegramMessenger({
|
|
110
|
+
token: this.env.TELEGRAM_BOT_TOKEN,
|
|
111
|
+
userName: "support_bot",
|
|
112
|
+
secretToken: this.env.TELEGRAM_WEBHOOK_SECRET_TOKEN,
|
|
113
|
+
conversation: "self"
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use a resolver when routing depends on tenant, channel, thread, or user:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
telegramMessenger({
|
|
121
|
+
token: this.env.TELEGRAM_BOT_TOKEN,
|
|
122
|
+
userName: "support_bot",
|
|
123
|
+
secretToken: this.env.TELEGRAM_WEBHOOK_SECRET_TOKEN,
|
|
124
|
+
conversation(event) {
|
|
125
|
+
return {
|
|
126
|
+
target: "subagent",
|
|
127
|
+
name: `tenant:${event.thread.channelId ?? event.thread.id}`
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## State
|
|
134
|
+
|
|
135
|
+
Messenger state is backed by `agents/chat-sdk`. Export
|
|
136
|
+
`ThinkMessengerStateAgent` from the Worker module so sub-agent routing can
|
|
137
|
+
resolve it. Production applications do not need a separate Durable Object
|
|
138
|
+
binding or migration for this facet-only state class. Test harnesses may still
|
|
139
|
+
need explicit bindings.
|
|
140
|
+
|
|
141
|
+
## Delivery and Recovery
|
|
142
|
+
|
|
143
|
+
Think replies with the streamed `chat()` path. The root agent starts an
|
|
144
|
+
idempotent managed fiber, resolves the conversation target, calls
|
|
145
|
+
`target.chat(message, callback)`, and lets the provider delivery policy post or
|
|
146
|
+
edit visible messages.
|
|
147
|
+
|
|
148
|
+
Recovery snapshots store only serializable event and Chat SDK thread data. If a
|
|
149
|
+
restart happens before streaming starts, Think can replay the answer. If a
|
|
150
|
+
restart happens after streaming starts, Think posts the configured interruption
|
|
151
|
+
message instead of risking a duplicate partial answer.
|
|
152
|
+
|
|
153
|
+
Delivery errors use a generic user-facing message by default so internal
|
|
154
|
+
exception details are not posted into external chats. Override
|
|
155
|
+
`delivery.errorResponseText` when you want a custom safe message.
|
|
156
|
+
|
|
157
|
+
## Messenger Context
|
|
158
|
+
|
|
159
|
+
During a messenger turn, `getMessengerContext()` returns provider, thread,
|
|
160
|
+
author, message, capabilities, and attachment metadata for the initiating event.
|
|
161
|
+
Use it from prompts, tools, or hooks that need channel-specific behavior.
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
const messenger = this.getMessengerContext();
|
|
165
|
+
if (messenger?.thread.isDirectMessage === false) {
|
|
166
|
+
// Adjust behavior for group chats.
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Custom Chat SDK Adapters
|
|
171
|
+
|
|
172
|
+
Use `chatSdkMessenger()` for providers that do not have a Think helper yet:
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
chatSdkMessenger({
|
|
176
|
+
adapter,
|
|
177
|
+
provider: "custom",
|
|
178
|
+
userName: "custom_bot",
|
|
179
|
+
verifyWebhook(request) {
|
|
180
|
+
return request.headers.get("x-custom-signature") === expectedSignature;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Every custom messenger must provide `verifyWebhook` or explicitly use
|
|
186
|
+
`verifyWebhook: false`.
|
|
187
|
+
|
|
188
|
+
## Advanced Manual Ingress
|
|
189
|
+
|
|
190
|
+
The `examples/think-chat-sdk` example demonstrates the Think-native
|
|
191
|
+
`getMessengers()` path with a small Vite dashboard that inspects the root Think
|
|
192
|
+
conversation over the Agent websocket.
|
|
193
|
+
|
|
194
|
+
The `examples/chat-sdk-messenger` example demonstrates a larger manual ingress
|
|
195
|
+
agent with an admin dashboard, menu handling, and application-owned reply
|
|
196
|
+
fibers. Use `getMessengers()` for the simple Think-native path. Use the example
|
|
197
|
+
when you need to own the Chat SDK runtime and control-plane UI yourself.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Programmatic Submissions
|
|
2
|
+
|
|
3
|
+
Use `submitMessages()` when a caller needs to start a Think turn, return
|
|
4
|
+
quickly, retry safely, and inspect the result later.
|
|
5
|
+
|
|
6
|
+
`saveMessages()` waits for the turn to finish. `submitMessages()` durably accepts
|
|
7
|
+
the turn and returns a submission record before inference runs.
|
|
8
|
+
|
|
9
|
+
For a broader comparison with `chat()`, `saveMessages()`, and agent tools, see
|
|
10
|
+
[Choosing a turn API](./index.md#choosing-a-turn-api).
|
|
11
|
+
|
|
12
|
+
Declarative scheduled prompt tasks use the same durable submission path under
|
|
13
|
+
the hood. Use `getScheduledTasks()` when the trigger is recurring and
|
|
14
|
+
code-declared; use `submitMessages()` directly when an external caller or
|
|
15
|
+
webhook creates one-off work.
|
|
16
|
+
|
|
17
|
+
## Why this exists
|
|
18
|
+
|
|
19
|
+
Webhook handlers, RPC callers, and parent Workers often have strict timeout
|
|
20
|
+
limits. If they call `saveMessages()` and time out, they cannot tell whether the
|
|
21
|
+
turn was never accepted, is queued, is running, or already completed. Retrying
|
|
22
|
+
can duplicate a user message and start a second turn.
|
|
23
|
+
|
|
24
|
+
`submitMessages()` creates a durable acceptance boundary:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
const submission = await this.submitMessages(
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
id: crypto.randomUUID(),
|
|
31
|
+
role: "user",
|
|
32
|
+
parts: [{ type: "text", text: "Process webhook event 123" }]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
{ idempotencyKey: "webhook-event-123" }
|
|
36
|
+
);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The caller can return `submission.submissionId` immediately. Later, call
|
|
40
|
+
`inspectSubmission(submissionId)` or `listSubmissions()` to inspect status.
|
|
41
|
+
|
|
42
|
+
## API
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const submission = await this.submitMessages(messages, {
|
|
46
|
+
submissionId: "optional-stable-id",
|
|
47
|
+
idempotencyKey: "external-job-id",
|
|
48
|
+
metadata: { source: "webhook" }
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`submitMessages()` accepts serializable `UIMessage[]` values. It does not accept
|
|
53
|
+
the function form supported by `saveMessages((messages) => ...)`, because
|
|
54
|
+
durable submissions persist work before execution and cannot store closures.
|
|
55
|
+
The array must contain at least one message.
|
|
56
|
+
|
|
57
|
+
## Statuses
|
|
58
|
+
|
|
59
|
+
| Status | Meaning |
|
|
60
|
+
| ----------- | ---------------------------------------------- |
|
|
61
|
+
| `pending` | Accepted and waiting for its turn |
|
|
62
|
+
| `running` | Claimed by the agent and executing |
|
|
63
|
+
| `completed` | The Think turn completed successfully |
|
|
64
|
+
| `aborted` | The submission was cancelled |
|
|
65
|
+
| `skipped` | Turn state was reset before the submission ran |
|
|
66
|
+
| `error` | Execution failed or recovery was unsafe |
|
|
67
|
+
|
|
68
|
+
## Idempotent retries
|
|
69
|
+
|
|
70
|
+
Pass an `idempotencyKey` from your external system. Retrying with the same key
|
|
71
|
+
returns the existing submission with `accepted: false` instead of inserting
|
|
72
|
+
duplicate messages:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
const first = await this.submitMessages(messages, {
|
|
76
|
+
idempotencyKey: payload.id
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const retry = await this.submitMessages(messages, {
|
|
80
|
+
idempotencyKey: payload.id
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// retry.submissionId === first.submissionId
|
|
84
|
+
// retry.accepted === false
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If you pass both `submissionId` and `idempotencyKey`, they must identify the same
|
|
88
|
+
submission. If they point at different existing rows, `submitMessages()` throws
|
|
89
|
+
instead of choosing one identity over the other.
|
|
90
|
+
|
|
91
|
+
## Inspect, list, and cancel
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
const current = await this.inspectSubmission(submission.submissionId);
|
|
95
|
+
|
|
96
|
+
const active = await this.listSubmissions({
|
|
97
|
+
status: ["pending", "running"]
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
await this.cancelSubmission(submission.submissionId, "No longer needed");
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Use `cancelSubmission(submissionId)` for durable cancellation. This works across
|
|
104
|
+
Worker and Durable Object RPC boundaries, unlike `AbortSignal`.
|
|
105
|
+
|
|
106
|
+
Completed submission records are retained until you delete them:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
await this.deleteSubmissions({
|
|
110
|
+
status: ["completed", "error", "aborted"],
|
|
111
|
+
completedBefore: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Session behavior
|
|
116
|
+
|
|
117
|
+
Think stores accepted submissions in a submission ledger first. It appends the
|
|
118
|
+
submitted messages to the conversation `Session` only when the submission starts
|
|
119
|
+
executing. This preserves FIFO turn semantics: later accepted submissions are
|
|
120
|
+
not visible to the model until their own turn starts.
|
|
121
|
+
|
|
122
|
+
If you cancel a submission before its messages have been applied, including one
|
|
123
|
+
that has been claimed but is still waiting for its turn, those messages are not
|
|
124
|
+
persisted to the conversation.
|
|
125
|
+
|
|
126
|
+
If the chat is cleared or turn state is reset before a pending submission runs,
|
|
127
|
+
that submission is marked `skipped`.
|
|
128
|
+
|
|
129
|
+
## Compared with `saveMessages`
|
|
130
|
+
|
|
131
|
+
Use `saveMessages()` when the caller can wait for the full turn:
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
const result = await this.saveMessages(messages);
|
|
135
|
+
// result.status is final
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Use `submitMessages()` when timeout ambiguity would make retries unsafe:
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
const result = await this.submitMessages(messages, { idempotencyKey });
|
|
142
|
+
// result.status is the accepted submission state
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`waitUntilStable()` is still useful when the caller needs to avoid accepting new
|
|
146
|
+
work while the current chat UI is mid-turn. It is not required for durable
|
|
147
|
+
admission: accepted submissions are serialized by Think and do not append their
|
|
148
|
+
messages to the session until their own turn starts.
|
|
149
|
+
|
|
150
|
+
## Compared with Workflows
|
|
151
|
+
|
|
152
|
+
Use `submitMessages()` for one durable Think chat turn.
|
|
153
|
+
|
|
154
|
+
Use Workflows for multi-step orchestration: retries per step, long waits,
|
|
155
|
+
external events, human approvals, or pipelines that may trigger Think as one
|
|
156
|
+
part of a larger process.
|
|
157
|
+
|
|
158
|
+
Use `startFiber()` when the durable unit is agent-owned side-effect work around
|
|
159
|
+
a turn, such as accepting a webhook once, restoring a serialized chat thread,
|
|
160
|
+
and posting a visible reply. `submitMessages()` owns Think's message/session
|
|
161
|
+
admission; `startFiber()` owns the surrounding application job.
|
|
162
|
+
|
|
163
|
+
## Layering with `startFiber()`
|
|
164
|
+
|
|
165
|
+
Use the two APIs together when the external job is larger than the Think turn
|
|
166
|
+
itself:
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
await this.startFiber(
|
|
170
|
+
"reply-to-webhook",
|
|
171
|
+
async (ctx) => {
|
|
172
|
+
ctx.stash({ webhookId, threadId });
|
|
173
|
+
|
|
174
|
+
const submission = await this.submitMessages(messages, {
|
|
175
|
+
idempotencyKey: `turn:${webhookId}`,
|
|
176
|
+
metadata: { threadId }
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
await postVisibleReply(threadId, submission.submissionId);
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
idempotencyKey: `webhook:${webhookId}`,
|
|
183
|
+
waitForCompletion: true
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The outer managed fiber answers: "Did this webhook job get accepted, recovered,
|
|
189
|
+
cancelled, or resolved?" The inner submission answers: "Did this Think turn get
|
|
190
|
+
admitted to the session and complete?" Keep those boundaries separate. Do not
|
|
191
|
+
replace Think's internal `chatRecovery` fibers with managed fibers unless the
|
|
192
|
+
work is an application-owned job that callers need to inspect or dedupe.
|
|
193
|
+
|
|
194
|
+
Workflows can compose with this API:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
const submission = await this.agent.submitMessages(messages, {
|
|
198
|
+
idempotencyKey: event.payload.jobId
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Example
|
|
203
|
+
|
|
204
|
+
See [Think Durable Submissions](https://github.com/cloudflare/agents/tree/main/examples/think-submissions/README.md) for
|
|
205
|
+
a full dashboard that shows immediate ACKs, idempotent retry, queue status, and
|
|
206
|
+
cancellation.
|