@hattoriai/poney 0.0.0-stage → 0.1.1
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 +23 -2
- package/bin/poney-mcp.mjs +3 -0
- package/bin/poney.mjs +3 -0
- package/brief-change.md +23 -0
- package/brief-tour.md +43 -0
- package/brief.md +133 -0
- package/dist/chunk-BCOS4LFB.js +1184 -0
- package/dist/chunk-BCOS4LFB.js.map +1 -0
- package/dist/chunk-TPJZDQG6.js +290 -0
- package/dist/chunk-TPJZDQG6.js.map +1 -0
- package/dist/chunk-YLKV6LIU.js +621 -0
- package/dist/chunk-YLKV6LIU.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +181 -0
- package/dist/cli.js.map +1 -0
- package/dist/hub-FERXNPJS.js +4 -0
- package/dist/hub-FERXNPJS.js.map +1 -0
- package/dist/live/types.d.ts +165 -0
- package/dist/live/types.js +3 -0
- package/dist/live/types.js.map +1 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +288 -0
- package/dist/mcp.js.map +1 -0
- package/dist/ops.d.ts +1575 -0
- package/dist/ops.js +3 -0
- package/dist/ops.js.map +1 -0
- package/dist/plugins/index.d.ts +94 -0
- package/dist/plugins/index.js +3 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/run-25PP2HWH.js +3 -0
- package/dist/run-25PP2HWH.js.map +1 -0
- package/dist/types-N-oiuMYy.d.ts +77 -0
- package/examples/tour.poney +195 -0
- package/examples/walkthrough.poney +644 -0
- package/package.json +76 -4
- package/studio/assets/abap-BdImnpbu.js +1 -0
- package/studio/assets/actionscript-3-B3316cI-.js +1 -0
- package/studio/assets/ada-BIOnG6TC.js +1 -0
- package/studio/assets/ahk-BrbAagtO.js +1 -0
- package/studio/assets/ahk2-8Zs4aa1G.js +1 -0
- package/studio/assets/andromeeda-C4gqWexZ.js +1 -0
- package/studio/assets/angular-html-D_SYSyRt.js +1 -0
- package/studio/assets/angular-ts-DGq0tZX5.js +1 -0
- package/studio/assets/apache-Pmp26Uib.js +1 -0
- package/studio/assets/apex-DhZFqWV2.js +1 -0
- package/studio/assets/apl-ChzvTHjC.js +1 -0
- package/studio/assets/applescript-Co6uUVPk.js +1 -0
- package/studio/assets/ara-BRHolxvo.js +1 -0
- package/studio/assets/asciidoc-CSVQ5wI8.js +1 -0
- package/studio/assets/asm-D_Q5rh1f.js +1 -0
- package/studio/assets/astro-DTjqU0_L.js +1 -0
- package/studio/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/studio/assets/awk-DMzUqQB5.js +1 -0
- package/studio/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/studio/assets/ayu-light-BA47KaF1.js +1 -0
- package/studio/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/studio/assets/ballerina-BFfxhgS-.js +1 -0
- package/studio/assets/bat-CickPsom.js +1 -0
- package/studio/assets/beancount-BgSHGh8x.js +1 -0
- package/studio/assets/berry-uYugtg8r.js +1 -0
- package/studio/assets/bibtex-CHM0blh-.js +1 -0
- package/studio/assets/bicep-Bmn6On1c.js +1 -0
- package/studio/assets/bird2-Bx8U0n9b.js +1 -0
- package/studio/assets/blade-k33SngOZ.js +1 -0
- package/studio/assets/bsl-DlhNcFeZ.js +1 -0
- package/studio/assets/c-BIGW1oBm.js +1 -0
- package/studio/assets/c3-Dp5svz6Z.js +1 -0
- package/studio/assets/cadence-Bv_4Rxtq.js +1 -0
- package/studio/assets/cairo-KRGpt6FW.js +1 -0
- package/studio/assets/catppuccin-frappe-CZL1YF0i.js +1 -0
- package/studio/assets/catppuccin-latte-DH-8KZSZ.js +1 -0
- package/studio/assets/catppuccin-macchiato-B7yYVSCf.js +1 -0
- package/studio/assets/catppuccin-mocha-Ct7hS0mc.js +1 -0
- package/studio/assets/chapel-DTp_pixX.js +1 -0
- package/studio/assets/clarity-Dn5IMItf.js +1 -0
- package/studio/assets/clojure-P80f7IUj.js +1 -0
- package/studio/assets/cmake-D1j8_8rp.js +1 -0
- package/studio/assets/cobol-BBKr1ja6.js +1 -0
- package/studio/assets/codeowners-Bp6g37R7.js +1 -0
- package/studio/assets/codeql-DsOJ9woJ.js +1 -0
- package/studio/assets/coffee-Ch7k5sss.js +1 -0
- package/studio/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/studio/assets/coq-BqXF5kFF.js +1 -0
- package/studio/assets/cpp-BMRokrvK.js +1 -0
- package/studio/assets/crystal-LUwhHfY5.js +1 -0
- package/studio/assets/csharp-B_TYUkTI.js +1 -0
- package/studio/assets/css-Z72CF80r.js +1 -0
- package/studio/assets/csv-fuZLfV_i.js +1 -0
- package/studio/assets/cue-D82EKSYY.js +1 -0
- package/studio/assets/cypher-COkxafJQ.js +1 -0
- package/studio/assets/d-85-TOEBH.js +1 -0
- package/studio/assets/dark-plus-C3mMm8J8.js +1 -0
- package/studio/assets/dart-CtKP3W-j.js +1 -0
- package/studio/assets/dax-CEL-wOlO.js +1 -0
- package/studio/assets/desktop-BmXAJ9_W.js +1 -0
- package/studio/assets/diff-D97Zzqfu.js +1 -0
- package/studio/assets/dist-_ey1iXf6.js +153 -0
- package/studio/assets/docker-BcOcwvcX.js +1 -0
- package/studio/assets/dotenv-De0Btta0.js +1 -0
- package/studio/assets/dracula-BzJJZx-M.js +1 -0
- package/studio/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/studio/assets/dream-maker-BtqSS_iP.js +1 -0
- package/studio/assets/edge-CJaD-t2L.js +1 -0
- package/studio/assets/elixir-DkJLSxtU.js +1 -0
- package/studio/assets/elk.bundled-Bw5WzyyE.js +26 -0
- package/studio/assets/elm-DbKCFpqz.js +1 -0
- package/studio/assets/emacs-lisp-DaIrSCgJ.js +1 -0
- package/studio/assets/erb-CSMaCouu.js +1 -0
- package/studio/assets/erlang-DsQrWhSR.js +1 -0
- package/studio/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/studio/assets/everforest-light-C8M2exoo.js +1 -0
- package/studio/assets/fennel-BYunw83y.js +1 -0
- package/studio/assets/fish-BvzEVeQv.js +1 -0
- package/studio/assets/fluent-C4IJs8-o.js +1 -0
- package/studio/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/studio/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/studio/assets/fsharp-CXgrBDvD.js +1 -0
- package/studio/assets/gdresource-TyuKm33G.js +1 -0
- package/studio/assets/gdscript-DqcFQ5yU.js +1 -0
- package/studio/assets/gdshader-DkwncUOv.js +1 -0
- package/studio/assets/genie-D0YGMca9.js +1 -0
- package/studio/assets/gherkin-DyxjwDmM.js +1 -0
- package/studio/assets/git-commit-F4YmCXRG.js +1 -0
- package/studio/assets/git-rebase-r7XF79zn.js +1 -0
- package/studio/assets/github-dark-DHJKELXO.js +1 -0
- package/studio/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/studio/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/studio/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/studio/assets/github-light-DAi9KRSo.js +1 -0
- package/studio/assets/github-light-default-D7oLnXFd.js +1 -0
- package/studio/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/studio/assets/gleam-BspZqrRM.js +1 -0
- package/studio/assets/glimmer-js-Drrc9bTt.js +1 -0
- package/studio/assets/glimmer-ts-zeybXsvi.js +1 -0
- package/studio/assets/glsl-DplSGwfg.js +1 -0
- package/studio/assets/gn-8iBmfbXw.js +1 -0
- package/studio/assets/gnuplot-DdkO51Og.js +1 -0
- package/studio/assets/go-C27-OAKa.js +1 -0
- package/studio/assets/graphql-ChdNCCLP.js +1 -0
- package/studio/assets/groovy-gcz8RCvz.js +1 -0
- package/studio/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/studio/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/studio/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/studio/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/studio/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/studio/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/studio/assets/hack-Ck6-gGSS.js +1 -0
- package/studio/assets/haml-GN_XdMnF.js +1 -0
- package/studio/assets/handlebars-DPT5vKgj.js +1 -0
- package/studio/assets/hanken-grotesk-latin-ext-wght-normal-Dg-wlmqe.woff2 +0 -0
- package/studio/assets/hanken-grotesk-latin-wght-normal-CaVRRdDk.woff2 +0 -0
- package/studio/assets/hanken-grotesk-vietnamese-wght-normal-CHiFlh_0.woff2 +0 -0
- package/studio/assets/haskell-Df6bDoY_.js +1 -0
- package/studio/assets/haxe-CfZj7gIn.js +1 -0
- package/studio/assets/hcl-BWvSN4gD.js +1 -0
- package/studio/assets/hjson-D5-asLiD.js +1 -0
- package/studio/assets/hlsl-D3lLCCz7.js +1 -0
- package/studio/assets/horizon-BUw7H-hv.js +1 -0
- package/studio/assets/horizon-bright-CUuTKBJd.js +1 -0
- package/studio/assets/houston-DnULxvSX.js +1 -0
- package/studio/assets/html-BlS82ilI.js +1 -0
- package/studio/assets/html-derivative-DZhk3IEZ.js +1 -0
- package/studio/assets/http-jrhK8wxY.js +1 -0
- package/studio/assets/hurl-irOxFIW8.js +1 -0
- package/studio/assets/hxml-2-FPmUDs.js +1 -0
- package/studio/assets/hy-DFXneXwc.js +1 -0
- package/studio/assets/imba-DGztddWO.js +1 -0
- package/studio/assets/index-B-C2JUUu.css +1 -0
- package/studio/assets/index-DOjop_HJ.js +889 -0
- package/studio/assets/ini-BEwlwnbL.js +1 -0
- package/studio/assets/java-CylS5w8V.js +1 -0
- package/studio/assets/javascript-wDzz0qaB.js +1 -0
- package/studio/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/studio/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/studio/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/studio/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/studio/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/studio/assets/jinja-DFQZVq3b.js +1 -0
- package/studio/assets/jison-wvAkD_A8.js +1 -0
- package/studio/assets/json-Cp-IABpG.js +1 -0
- package/studio/assets/json5-C9tS-k6U.js +1 -0
- package/studio/assets/jsonc-Des-eS-w.js +1 -0
- package/studio/assets/jsonl-DcaNXYhu.js +1 -0
- package/studio/assets/jsonnet-DFQXde-d.js +1 -0
- package/studio/assets/jssm-C2t-YnRu.js +1 -0
- package/studio/assets/jsx-g9-lgVsj.js +1 -0
- package/studio/assets/julia-Cu79e8SL.js +1 -0
- package/studio/assets/just-CMxyWJJc.js +1 -0
- package/studio/assets/kanagawa-dragon-BuwD2xS4.js +1 -0
- package/studio/assets/kanagawa-lotus-C3DzagqV.js +1 -0
- package/studio/assets/kanagawa-wave-DFGoQZhC.js +1 -0
- package/studio/assets/kdl-DV7GczEv.js +1 -0
- package/studio/assets/kotlin-BdnUsdx6.js +1 -0
- package/studio/assets/kusto-wEQ09or8.js +1 -0
- package/studio/assets/laserwave-DUszq2jm.js +1 -0
- package/studio/assets/latex-DJVikpzR.js +1 -0
- package/studio/assets/lean-BZvkOJ9d.js +1 -0
- package/studio/assets/less-B1dDrJ26.js +1 -0
- package/studio/assets/light-plus-B7mTdjB0.js +1 -0
- package/studio/assets/liquid-B-duXHXw.js +1 -0
- package/studio/assets/llvm-BZoOZj88.js +1 -0
- package/studio/assets/log-2UxHyX5q.js +1 -0
- package/studio/assets/logo-BtOb2qkB.js +1 -0
- package/studio/assets/lua-BaeVxFsk.js +1 -0
- package/studio/assets/luau-nOZpfvQi.js +1 -0
- package/studio/assets/make-CHLpvVh8.js +1 -0
- package/studio/assets/markdown-Cvjx9yec.js +1 -0
- package/studio/assets/marko-BYgDmDgU.js +1 -0
- package/studio/assets/material-theme-D5KoaKCx.js +1 -0
- package/studio/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/studio/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/studio/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/studio/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/studio/assets/matlab-D7o27uSR.js +1 -0
- package/studio/assets/mdc-DF4WjDMn.js +1 -0
- package/studio/assets/mdx-Cmh6b_Ma.js +1 -0
- package/studio/assets/mermaid-CQcHuHx7.js +1 -0
- package/studio/assets/min-dark-CafNBF8u.js +1 -0
- package/studio/assets/min-light-CTRr51gU.js +1 -0
- package/studio/assets/mipsasm-CKIfxQSi.js +1 -0
- package/studio/assets/mojo-DJz3ZmWd.js +1 -0
- package/studio/assets/monokai-CR4piiQ-.js +1 -0
- package/studio/assets/moonbit-Bag4Rp_g.js +1 -0
- package/studio/assets/move-el3G9tDJ.js +1 -0
- package/studio/assets/narrat-DRg8JJMk.js +1 -0
- package/studio/assets/nextflow-BCxp2Aob.js +1 -0
- package/studio/assets/nextflow-groovy-CedDknKX.js +1 -0
- package/studio/assets/nginx-BpAMiNFr.js +1 -0
- package/studio/assets/night-owl-C39BiMTA.js +1 -0
- package/studio/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/studio/assets/nim-nV83PyhX.js +1 -0
- package/studio/assets/nix-CwoSXNpI.js +1 -0
- package/studio/assets/nord-Ddv68eIx.js +1 -0
- package/studio/assets/nsis-BlV79W_Q.js +1 -0
- package/studio/assets/nushell-BXD5iret.js +1 -0
- package/studio/assets/objective-c-DXmwc3jG.js +1 -0
- package/studio/assets/objective-cpp-CLxacb5B.js +1 -0
- package/studio/assets/ocaml-C0hk2d4L.js +1 -0
- package/studio/assets/odin-BBf5iR-q.js +1 -0
- package/studio/assets/one-dark-pro-CxGP3dtY.js +1 -0
- package/studio/assets/one-light-C3Wv6jpd.js +1 -0
- package/studio/assets/openscad-C4EeE6gA.js +1 -0
- package/studio/assets/org-6a7ccXN_.js +1 -0
- package/studio/assets/pascal-D93ZcfNL.js +1 -0
- package/studio/assets/perl-5klg-GXX.js +1 -0
- package/studio/assets/php-DoruYMF0.js +1 -0
- package/studio/assets/pkl-u5AG7uiY.js +1 -0
- package/studio/assets/plastic-3e1v2bzS.js +1 -0
- package/studio/assets/plsql-ChMvpjG-.js +1 -0
- package/studio/assets/po-BTJTHyun.js +1 -0
- package/studio/assets/poimandres-CS3Unz2-.js +1 -0
- package/studio/assets/polar-C0HS_06l.js +1 -0
- package/studio/assets/postcss-CXtECtnM.js +1 -0
- package/studio/assets/powerquery-CEu0bR-o.js +1 -0
- package/studio/assets/powershell-Dd0kTxKP.js +1 -0
- package/studio/assets/prisma-Vru482bI.js +1 -0
- package/studio/assets/prolog-CbFg5uaA.js +1 -0
- package/studio/assets/proto-C7zT0LnQ.js +1 -0
- package/studio/assets/pug-BtYPkAgq.js +1 -0
- package/studio/assets/puppet-BMWR74SV.js +1 -0
- package/studio/assets/purescript-CklMAg4u.js +1 -0
- package/studio/assets/python-B6aJPvgy.js +1 -0
- package/studio/assets/qml-3beO22l8.js +1 -0
- package/studio/assets/qmldir-C8lEn-DE.js +1 -0
- package/studio/assets/qss-IeuSbFQv.js +1 -0
- package/studio/assets/r-Cf5RLm7j.js +1 -0
- package/studio/assets/racket-BqYA7rlc.js +1 -0
- package/studio/assets/raku-DXvB9xmW.js +1 -0
- package/studio/assets/razor-CyjPwjZj.js +1 -0
- package/studio/assets/rbs-CpoqiR4B.js +1 -0
- package/studio/assets/red-DMbB5_pp.js +1 -0
- package/studio/assets/reg-C-SQnVFl.js +1 -0
- package/studio/assets/regexp-CDVJQ6XC.js +1 -0
- package/studio/assets/rel-C3B-1QV4.js +1 -0
- package/studio/assets/riscv-BM1_JUlF.js +1 -0
- package/studio/assets/ron-D8l8udqQ.js +1 -0
- package/studio/assets/rose-pine-5qJOZa0Y.js +1 -0
- package/studio/assets/rose-pine-dawn-zx0QlTCp.js +1 -0
- package/studio/assets/rose-pine-moon-C9pEdX9L.js +1 -0
- package/studio/assets/rosmsg-BJDFO7_C.js +1 -0
- package/studio/assets/rst-CVOjT0e7.js +1 -0
- package/studio/assets/ruby-C8rp0wew.js +1 -0
- package/studio/assets/rust-DPvrY3IQ.js +1 -0
- package/studio/assets/sas-BGn39htG.js +1 -0
- package/studio/assets/sass-Cj5Yp3dK.js +1 -0
- package/studio/assets/scala-CqE71os6.js +1 -0
- package/studio/assets/scheme-C98Dy4si.js +1 -0
- package/studio/assets/scss-Cw6XMfVs.js +1 -0
- package/studio/assets/sdbl-DVxCFoDh.js +1 -0
- package/studio/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/studio/assets/shellscript-Yzrsuije.js +1 -0
- package/studio/assets/shellsession-BADoaaVG.js +1 -0
- package/studio/assets/slack-dark-BthQWCQV.js +1 -0
- package/studio/assets/slack-ochin-DqwNpetd.js +1 -0
- package/studio/assets/smalltalk-BOQMe2GC.js +1 -0
- package/studio/assets/smithy-cds9vsN8.js +1 -0
- package/studio/assets/snazzy-light-Bw305WKR.js +1 -0
- package/studio/assets/solarized-dark-UcubFVte.js +1 -0
- package/studio/assets/solarized-light-DCG28T6R.js +1 -0
- package/studio/assets/solidity-DijEV5ha.js +1 -0
- package/studio/assets/soy-zscZBeg6.js +1 -0
- package/studio/assets/sparql-rVzFXLq3.js +1 -0
- package/studio/assets/splunk-BtCnVYZw.js +1 -0
- package/studio/assets/sql-DkvoVjww.js +1 -0
- package/studio/assets/src-Br__iChL.js +88 -0
- package/studio/assets/ssh-config-_ykCGR6B.js +1 -0
- package/studio/assets/stata-DACIj5bg.js +1 -0
- package/studio/assets/stylus-BEDo0Tqx.js +1 -0
- package/studio/assets/surrealql-Cjom0U5J.js +1 -0
- package/studio/assets/svelte-D84K1R2Q.js +1 -0
- package/studio/assets/swift-C2oV4EkX.js +1 -0
- package/studio/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/studio/assets/system-verilog-0hqHdDBg.js +1 -0
- package/studio/assets/systemd-4A_iFExJ.js +1 -0
- package/studio/assets/talonscript-CkByrt1z.js +1 -0
- package/studio/assets/tasl-QIJgUcNo.js +1 -0
- package/studio/assets/tcl-dwOrl1Do.js +1 -0
- package/studio/assets/templ-Vpw5XpSW.js +1 -0
- package/studio/assets/terraform-BETggiCN.js +1 -0
- package/studio/assets/tex-D96PA37w.js +1 -0
- package/studio/assets/tokyo-night-hegEt444.js +1 -0
- package/studio/assets/toml-vGWfd6FD.js +1 -0
- package/studio/assets/ts-tags-Ls60c9xG.js +1 -0
- package/studio/assets/tsv-B_m7g4N7.js +1 -0
- package/studio/assets/tsx-COt5Ahok.js +1 -0
- package/studio/assets/turtle-BsS91CYL.js +1 -0
- package/studio/assets/twig-D9-LOF2p.js +1 -0
- package/studio/assets/typescript-BPQ3VLAy.js +1 -0
- package/studio/assets/typespec-ClX509-Q.js +1 -0
- package/studio/assets/typst-DamkJZ1Q.js +1 -0
- package/studio/assets/v-BGw2Nkan.js +1 -0
- package/studio/assets/vala-CsfeWuGM.js +1 -0
- package/studio/assets/vb-Cu-pLBUe.js +1 -0
- package/studio/assets/verilog-nZwndyjY.js +1 -0
- package/studio/assets/vesper-DRje8inN.js +1 -0
- package/studio/assets/vhdl-CeAyd5Ju.js +1 -0
- package/studio/assets/viml-CJc9bBzg.js +1 -0
- package/studio/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/studio/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/studio/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/studio/assets/vue-DSqPwMUe.js +1 -0
- package/studio/assets/vue-html-AaS7Mt5G.js +1 -0
- package/studio/assets/vue-vine-C0RcJ6UU.js +1 -0
- package/studio/assets/vyper-CDx5xZoG.js +1 -0
- package/studio/assets/wasm-Cey7Y6ql.js +1 -0
- package/studio/assets/wasm-MzD3tlZU.js +1 -0
- package/studio/assets/wenyan-BV7otONQ.js +1 -0
- package/studio/assets/wgsl-Dx-B1_4e.js +1 -0
- package/studio/assets/wikitext-BhOHFoWU.js +1 -0
- package/studio/assets/wit-5i3qLPDT.js +1 -0
- package/studio/assets/wolfram-lXgVvXCa.js +1 -0
- package/studio/assets/xml-sdJ4AIDG.js +1 -0
- package/studio/assets/xsl-CtQFsRM5.js +1 -0
- package/studio/assets/yaml-Buea-lGh.js +1 -0
- package/studio/assets/zenscript-DVFEvuxE.js +1 -0
- package/studio/assets/zig-VOosw3JB.js +1 -0
- package/studio/favicon.svg +7 -0
- package/studio/index.html +15 -0
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { attachOrStart } from './chunk-BCOS4LFB.js';
|
|
2
|
+
import { brief, example, schema, check, outline, excerpt } from './chunk-TPJZDQG6.js';
|
|
3
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { renderScenePng } from '@hattoriai/poney-render';
|
|
7
|
+
|
|
8
|
+
var { live, hub } = await attachOrStart();
|
|
9
|
+
var log = (...args) => console.error("[poney]", ...args);
|
|
10
|
+
var server = new McpServer(
|
|
11
|
+
{ name: "poney", version: "0.1.0" },
|
|
12
|
+
{
|
|
13
|
+
instructions: `Poney turns a JSON document into walkthroughs and diagrams that explain software to people: a "change" walkthrough explains one change; a "tour" teaches a codebase as it is. Call poney_guide once (topic "change" or "tour") to learn the format. Write a document, run poney_check with the repository until it is clean, look at each scene with poney_render, then poney_open to show it to the person. Use poney_read to see what they looked at, answered or wrote. To teach, loop: poney_wait for the person's next question, answer it with poney_reply (and, when a picture helps, a new scene opened with poney_open first), then wait again.`
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
var documentInput = {
|
|
17
|
+
document: z.any().optional().describe("The Poney document, as a JSON object or JSON text. Mermaid text is converted."),
|
|
18
|
+
path: z.string().optional().describe("Path of a .json (or Mermaid) file to read instead of `document`.")
|
|
19
|
+
};
|
|
20
|
+
var text = (t, isError = false) => ({ content: [{ type: "text", text: t }], isError });
|
|
21
|
+
async function inputOrLive(args) {
|
|
22
|
+
if (args.document !== void 0 || args.path) return args;
|
|
23
|
+
const { current } = await live.read();
|
|
24
|
+
return current === void 0 ? void 0 : { document: current };
|
|
25
|
+
}
|
|
26
|
+
async function dropped(next) {
|
|
27
|
+
const { current } = await live.read();
|
|
28
|
+
const open = current;
|
|
29
|
+
if (!open) return [];
|
|
30
|
+
const keep = /* @__PURE__ */ new Set([...next.walkthroughs.map((w) => `w:${w.id}`), ...next.views.map((v) => `v:${v.id}`)]);
|
|
31
|
+
return [
|
|
32
|
+
...(open.walkthroughs ?? []).filter((w) => !keep.has(`w:${w.id}`)).map((w) => `the walkthrough "${w.title ?? w.id}"`),
|
|
33
|
+
...(open.views ?? []).filter((v) => !keep.has(`v:${v.id}`)).map((v) => `the diagram "${v.title ?? v.id}"`)
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
var noWindow = () => `No Studio window is open. Ask the person to open ${live.studioUrl}.`;
|
|
37
|
+
server.registerTool(
|
|
38
|
+
"poney_guide",
|
|
39
|
+
{
|
|
40
|
+
title: "How to write a Poney walkthrough",
|
|
41
|
+
description: 'Returns the guide for writing a walkthrough (what each part is for, refs, limits, the check-and-render loop) and a complete valid example. Topic "change" explains one change (a commit, a pull request); topic "tour" teaches a codebase as it is. Read it before writing a document.',
|
|
42
|
+
inputSchema: { topic: z.enum(["change", "tour"]).optional().describe('"change" (default) or "tour".') },
|
|
43
|
+
annotations: { readOnlyHint: true }
|
|
44
|
+
},
|
|
45
|
+
async (args) => {
|
|
46
|
+
const topic = args.topic ?? "change";
|
|
47
|
+
return text(`${brief(topic)}
|
|
48
|
+
|
|
49
|
+
## Example
|
|
50
|
+
|
|
51
|
+
\`\`\`json
|
|
52
|
+
${example(topic)}\`\`\``);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
server.registerTool(
|
|
56
|
+
"poney_schema",
|
|
57
|
+
{
|
|
58
|
+
title: "Poney JSON Schema",
|
|
59
|
+
description: "Returns the JSON Schema (draft-07) of a Poney document, for structured output.",
|
|
60
|
+
inputSchema: {},
|
|
61
|
+
annotations: { readOnlyHint: true }
|
|
62
|
+
},
|
|
63
|
+
async () => text(JSON.stringify(schema()))
|
|
64
|
+
);
|
|
65
|
+
server.registerTool(
|
|
66
|
+
"poney_check",
|
|
67
|
+
{
|
|
68
|
+
title: "Check a Poney document",
|
|
69
|
+
description: "Validates a document and lints it for readability. Returns errors (the document is invalid) and warnings (it reads badly), each with its path and a hint for the fix, and the scenes it can render. Give `repo` (and `rev`, or `diff`) to also prove the code: in a change, every line shown is in the diff with the right number; in a tour, every excerpt is in its file at those lines; cited tests, and the files in `sourceRefs`, exist. Run it after every edit until there are no errors.",
|
|
70
|
+
inputSchema: {
|
|
71
|
+
...documentInput,
|
|
72
|
+
repo: z.string().optional().describe("Path of the git repository the code is in."),
|
|
73
|
+
rev: z.string().optional().describe('The commit, a range "base..head", or "working" for the files on disk. Default: HEAD.'),
|
|
74
|
+
diff: z.string().optional().describe("A unified diff to check the code against, instead of a repository.")
|
|
75
|
+
},
|
|
76
|
+
annotations: { readOnlyHint: true }
|
|
77
|
+
},
|
|
78
|
+
async (args) => {
|
|
79
|
+
const input = await inputOrLive(args);
|
|
80
|
+
if (!input) return text("Give a document or a path. Nothing is open in the Studio.", true);
|
|
81
|
+
const { result, report } = check(input, { repo: args.repo, rev: args.rev, diff: args.diff });
|
|
82
|
+
return text([report, result?.ok ? outline(result) : ""].filter(Boolean).join("\n\n"), !result?.ok);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
server.registerTool(
|
|
86
|
+
"poney_excerpt",
|
|
87
|
+
{
|
|
88
|
+
title: "Copy a code excerpt",
|
|
89
|
+
description: "Returns a code block for a scene's `code`: lines `from` to `to` of a file, copied exactly, with `start` set. Use it instead of retyping code, so the check finds every line where you say it is.",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
repo: z.string().describe("Path of the git repository."),
|
|
92
|
+
path: z.string().describe("File path, relative to the repository root."),
|
|
93
|
+
from: z.number().int().min(1),
|
|
94
|
+
to: z.number().int().min(1),
|
|
95
|
+
rev: z.string().optional().describe('A commit, or "working" for the file on disk. Default: HEAD.')
|
|
96
|
+
},
|
|
97
|
+
annotations: { readOnlyHint: true }
|
|
98
|
+
},
|
|
99
|
+
async (args) => {
|
|
100
|
+
const r = excerpt(args.repo, args.path, args.from, args.to, args.rev);
|
|
101
|
+
return r.error ? text(r.error, true) : text(JSON.stringify(r.block, null, 2));
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
server.registerTool(
|
|
105
|
+
"poney_render",
|
|
106
|
+
{
|
|
107
|
+
title: "Render a scene",
|
|
108
|
+
description: 'Draws one scene of a walkthrough (or a view) as a PNG, exactly as Poney Studio shows it, so you can see whether it makes its point. Without a document, renders what is open in the Studio. Scenes are named by id; "overview" is the picture next to the story.',
|
|
109
|
+
inputSchema: {
|
|
110
|
+
...documentInput,
|
|
111
|
+
walkthrough: z.string().optional().describe("Walkthrough id. Default: the first."),
|
|
112
|
+
scene: z.string().optional().describe('Scene id, or "overview". Default: the overview, else the first scene with a view.'),
|
|
113
|
+
view: z.string().optional().describe("Render a view by id instead of a scene."),
|
|
114
|
+
mode: z.enum(["before", "change", "after"]).optional().describe("Before the change, the change marked (default), or after."),
|
|
115
|
+
theme: z.enum(["light", "dark"]).optional()
|
|
116
|
+
},
|
|
117
|
+
annotations: { readOnlyHint: true }
|
|
118
|
+
},
|
|
119
|
+
async (args) => {
|
|
120
|
+
const input = await inputOrLive(args);
|
|
121
|
+
if (!input) return text("Give a document or a path. Nothing is open in the Studio.", true);
|
|
122
|
+
const { result, report } = check(input);
|
|
123
|
+
if (!result?.ok || !result.document) return text(`The document has errors; fix them first.
|
|
124
|
+
|
|
125
|
+
${report}`, true);
|
|
126
|
+
try {
|
|
127
|
+
const r = await renderScenePng(result.document, { walkthrough: args.walkthrough, scene: args.scene, view: args.view, mode: args.mode, theme: args.theme });
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{ type: "image", data: r.png.toString("base64"), mimeType: "image/png" },
|
|
131
|
+
{ type: "text", text: `${r.title} (${r.width}\xD7${r.height} px).${result.warnings.length ? `
|
|
132
|
+
|
|
133
|
+
${report}` : ""}` }
|
|
134
|
+
]
|
|
135
|
+
};
|
|
136
|
+
} catch (e) {
|
|
137
|
+
return text(e instanceof Error ? e.message : String(e), true);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
server.registerTool(
|
|
142
|
+
"poney_open",
|
|
143
|
+
{
|
|
144
|
+
title: "Open in Poney Studio",
|
|
145
|
+
description: "Checks a document and shows it live in Poney Studio for the person. Every open Studio window updates at once. Returns the address to give the person if no window is open yet. Call it again after each revision. It replaces the open document: to add to it, get it with poney_read (includeDocument: true) and open it with your additions.",
|
|
146
|
+
inputSchema: {
|
|
147
|
+
...documentInput,
|
|
148
|
+
replace: z.boolean().optional().describe("Set only when the person asked to remove walkthroughs or diagrams that are open now, or to start a new document.")
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
async (args) => {
|
|
152
|
+
if (args.document === void 0 && !args.path) return text("Give a document or a path.", true);
|
|
153
|
+
const { result, report } = check(args);
|
|
154
|
+
if (!result?.ok || !result.document) return text(`Not opened: the document has errors.
|
|
155
|
+
|
|
156
|
+
${report}`, true);
|
|
157
|
+
if (!args.replace) {
|
|
158
|
+
const lost = await dropped(result.document);
|
|
159
|
+
if (lost.length)
|
|
160
|
+
return text(
|
|
161
|
+
`Not opened: the open document has ${lost.join(", ")}, and this one leaves them out. Get the open document with poney_read (includeDocument: true), add your work to it, and open that. Set replace: true only if the person asked to remove them.`,
|
|
162
|
+
true
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
const { revision, viewers } = await live.open(JSON.parse(JSON.stringify(result.document)));
|
|
166
|
+
const where = viewers ? `Shown in ${viewers} open Studio window${viewers > 1 ? "s" : ""}.` : noWindow();
|
|
167
|
+
return text(`Opened revision ${revision}: "${result.document.walkthroughs[0]?.title ?? result.document.project.name}". ${where}${result.warnings.length ? `
|
|
168
|
+
|
|
169
|
+
${report}` : ""}`);
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
server.registerTool(
|
|
173
|
+
"poney_import",
|
|
174
|
+
{
|
|
175
|
+
title: "Import from the code",
|
|
176
|
+
description: 'Reads a source in a repository and adds what it finds to the document open in the Studio (or to a new one): "schema" reads the database schema (db/schema.rb, a .sql schema, schema.prisma) into tables, columns and foreign keys; "js-modules" reads JavaScript and TypeScript imports into modules and who imports whom. It only adds: what the document already has stays. Without an importer, lists the importers and what each would read in the repository. Use it to start from facts, then write the words and the walkthrough yourself.',
|
|
177
|
+
inputSchema: {
|
|
178
|
+
repo: z.string().describe("The repository folder."),
|
|
179
|
+
importer: z.string().optional().describe('"schema", "js-modules", or another installed importer. Leave out to list them.'),
|
|
180
|
+
path: z.string().optional().describe("A file to read instead of the one the importer finds, relative to the repository."),
|
|
181
|
+
store: z.string().optional().describe('For "schema": the id of the database entity the tables are stored in.')
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
async ({ repo, importer, path, store }) => {
|
|
185
|
+
const p = await import('./plugins/index.js');
|
|
186
|
+
if (!importer) {
|
|
187
|
+
const { importers, problems } = await p.available(repo);
|
|
188
|
+
return text([...importers.map((i) => `- ${i.id}: ${i.description} ${i.files.length ? `Would read ${i.files.join(", ")}.` : "Nothing to read in this repository."}`), ...problems].join("\n"));
|
|
189
|
+
}
|
|
190
|
+
try {
|
|
191
|
+
const { current } = await live.read();
|
|
192
|
+
const { document, summary } = await p.runImport(importer, repo, { into: current, path, store });
|
|
193
|
+
const { result, report } = check({ document });
|
|
194
|
+
if (!result?.ok) return text(`Not opened: the document has errors after the import.
|
|
195
|
+
|
|
196
|
+
${report}`, true);
|
|
197
|
+
const { revision, viewers } = await live.open(document);
|
|
198
|
+
return text(`${summary}
|
|
199
|
+
Opened revision ${revision}${viewers ? "" : `. ${noWindow()}`}. Give the new parts and tables plain summaries, then group them into views that explain something.`);
|
|
200
|
+
} catch (e) {
|
|
201
|
+
return text(e instanceof Error ? e.message : String(e), true);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
server.registerTool(
|
|
206
|
+
"poney_overlay",
|
|
207
|
+
{
|
|
208
|
+
title: "Live facts about the parts",
|
|
209
|
+
description: 'Reads live facts about the parts of the open document, through their source paths: "coverage" (the share of lines the tests run, from the last coverage report) or "churn" (commits in the last 90 days, from git). Without an overlay, lists them. Use the facts in your answers and as badges, e.g. a scene badge "34% tested", only as the overlay reports them.',
|
|
210
|
+
inputSchema: {
|
|
211
|
+
repo: z.string().describe("The repository folder."),
|
|
212
|
+
overlay: z.string().optional().describe('"coverage", "churn", or another installed overlay. Leave out to list them.')
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
async ({ repo, overlay }) => {
|
|
216
|
+
const p = await import('./plugins/index.js');
|
|
217
|
+
if (!overlay) {
|
|
218
|
+
const { overlays } = await p.available(repo);
|
|
219
|
+
return text(overlays.map((o) => `- ${o.id}: ${o.description} ${o.files.length ? `Would read ${o.files.join(", ")}.` : "Nothing to read in this repository."}`).join("\n"));
|
|
220
|
+
}
|
|
221
|
+
try {
|
|
222
|
+
const { current } = await live.read();
|
|
223
|
+
if (current === void 0) return text("No document is open in the Studio.", true);
|
|
224
|
+
return text(p.describeOverlay(await p.runOverlay(overlay, repo, current)));
|
|
225
|
+
} catch (e) {
|
|
226
|
+
return text(e instanceof Error ? e.message : String(e), true);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
server.registerTool(
|
|
231
|
+
"poney_wait",
|
|
232
|
+
{
|
|
233
|
+
title: "Wait for a question from the person",
|
|
234
|
+
description: 'Waits until the person asks a question in Poney Studio ("Ask the agent"), then returns it with where they were: the walkthrough, the scene, and what they selected. Returns questions you have not seen yet at once, if there are any. Returns an empty list when time runs out; call it again to keep listening. While you wait, the Studio tells the person you are listening.',
|
|
235
|
+
inputSchema: { timeoutSeconds: z.number().int().min(1).max(900).optional().describe("How long to wait. Default: 300.") },
|
|
236
|
+
annotations: { readOnlyHint: true }
|
|
237
|
+
},
|
|
238
|
+
async (args) => {
|
|
239
|
+
const { questions, viewers, place, answeredInStudio } = await live.waitForQuestions((args.timeoutSeconds ?? 300) * 1e3);
|
|
240
|
+
if (answeredInStudio)
|
|
241
|
+
return text("Nothing to wait for: an agent started by Poney Studio answers the person's questions, and each question reaches it as a new message. If that agent is you, end your turn now.");
|
|
242
|
+
if (!questions.length) return text(viewers ? "No question yet. Call poney_wait again to keep listening." : `No question yet. ${noWindow()}`);
|
|
243
|
+
return text(JSON.stringify({ questions, ...place }, null, 2));
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
server.registerTool(
|
|
247
|
+
"poney_reply",
|
|
248
|
+
{
|
|
249
|
+
title: "Answer the person in Poney Studio",
|
|
250
|
+
description: "Shows your answer in the thread in Poney Studio, under the person's question. Answer in plain words, short. When a picture helps, first add a scene to the document and open it with poney_open, then give its id in `scene`: the reply gets a link that takes the person there.",
|
|
251
|
+
inputSchema: {
|
|
252
|
+
text: z.string().min(1).describe("The answer. Plain text; blank lines separate paragraphs."),
|
|
253
|
+
inReplyTo: z.number().int().optional().describe("The id of the question it answers."),
|
|
254
|
+
walkthrough: z.string().optional().describe("The walkthrough of `scene`. Default: the one the person is reading."),
|
|
255
|
+
scene: z.string().optional().describe("A scene to show with the answer.")
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
async (args) => {
|
|
259
|
+
const { studio, viewers } = await live.read();
|
|
260
|
+
const m = await live.reply(args.text, { inReplyTo: args.inReplyTo, walkthrough: args.walkthrough ?? (args.scene ? studio?.walkthrough : void 0), scene: args.scene });
|
|
261
|
+
return text(`Replied (message ${m.id}).${viewers ? "" : " No Studio window is open; the person will see it when they open one."}`);
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
server.registerTool(
|
|
265
|
+
"poney_read",
|
|
266
|
+
{
|
|
267
|
+
title: "Read what the person sees",
|
|
268
|
+
description: "Returns what the person is doing in Poney Studio: the view and scene they are on, what they selected, their answers to questions, the notes they wrote for you, which scenes they marked as read, the last messages of the question thread, and the document itself if they changed it.",
|
|
269
|
+
inputSchema: { includeDocument: z.boolean().optional().describe("Also return the full document. Default: only when the person changed it.") },
|
|
270
|
+
annotations: { readOnlyHint: true }
|
|
271
|
+
},
|
|
272
|
+
async (args) => {
|
|
273
|
+
const r = await live.read();
|
|
274
|
+
if (!r.studio && !args.includeDocument) return text(r.viewers ? "A Studio window is open but has reported nothing yet." : noWindow());
|
|
275
|
+
const { document, ...rest } = r.studio ?? { document: void 0 };
|
|
276
|
+
const out = { viewers: r.viewers, ...rest, changedDocument: document !== void 0, thread: r.thread.slice(-20) };
|
|
277
|
+
if (document !== void 0 || args.includeDocument) out.document = document ?? r.current;
|
|
278
|
+
return text(JSON.stringify(out, null, 2));
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
log(hub ? `live hub on ${hub.server.url}; Studio at ${live.studioUrl}` : `attached to the live hub; Studio at ${live.studioUrl}`);
|
|
282
|
+
await server.connect(new StdioServerTransport());
|
|
283
|
+
process.on("SIGINT", () => {
|
|
284
|
+
hub?.server.stop();
|
|
285
|
+
process.exit(0);
|
|
286
|
+
});
|
|
287
|
+
//# sourceMappingURL=mcp.js.map
|
|
288
|
+
//# sourceMappingURL=mcp.js.map
|
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp.ts"],"names":[],"mappings":";;;;;;;AAmBA,IAAM,EAAE,IAAA,EAAM,GAAA,EAAI,GAAI,MAAM,aAAA,EAAc;AAC1C,IAAM,MAAM,CAAA,GAAI,IAAA,KAAoB,QAAQ,KAAA,CAAM,SAAA,EAAW,GAAG,IAAI,CAAA;AAEpE,IAAM,SAAS,IAAI,SAAA;AAAA,EACjB,EAAE,IAAA,EAAM,OAAA,EAAS,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AQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA","file":"mcp.js","sourcesContent":["/**\n * Poney MCP server.\n *\n * Gives an agent everything it needs to write walkthroughs and diagrams that\n * people read in Poney Studio: the guide and schema, a checker that explains\n * how to fix problems, a renderer so the agent can see its own pictures, and a\n * live link to the Studio — open a document for a person, read back what\n * they looked at, answered and wrote, and answer the questions they ask.\n *\n * Run: poney-mcp (stdio), or npm run mcp in the Poney repository. Logs go to stderr.\n */\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { z } from 'zod'\nimport { renderScenePng } from '@hattoriai/poney-render'\nimport { brief, check, example, excerpt, outline, schema, type Input, type Topic } from './ops'\nimport { attachOrStart } from './live/hub'\n\n// The live link: this process's own hub, or one already running (a Studio started with `poney studio`).\nconst { live, hub } = await attachOrStart()\nconst log = (...args: unknown[]) => console.error('[poney]', ...args)\n\nconst server = new McpServer(\n { name: 'poney', version: '0.1.0' },\n {\n instructions:\n 'Poney turns a JSON document into walkthroughs and diagrams that explain software to people: a \"change\" walkthrough explains one change; a \"tour\" teaches a codebase as it is. Call poney_guide once (topic \"change\" or \"tour\") to learn the format. Write a document, run poney_check with the repository until it is clean, look at each scene with poney_render, then poney_open to show it to the person. Use poney_read to see what they looked at, answered or wrote. To teach, loop: poney_wait for the person\\'s next question, answer it with poney_reply (and, when a picture helps, a new scene opened with poney_open first), then wait again.',\n },\n)\n\nconst documentInput = {\n document: z.any().optional().describe('The Poney document, as a JSON object or JSON text. Mermaid text is converted.'),\n path: z.string().optional().describe('Path of a .json (or Mermaid) file to read instead of `document`.'),\n}\n\nconst text = (t: string, isError = false) => ({ content: [{ type: 'text' as const, text: t }], isError })\n\n/** The document to work on: the one given, else what is open in the Studio. */\nasync function inputOrLive(args: Input): Promise<Input | undefined> {\n if (args.document !== undefined || args.path) return args\n const { current } = await live.read()\n return current === undefined ? undefined : { document: current }\n}\n\n/** The walkthroughs and diagrams of the open document that `next` leaves out. */\nasync function dropped(next: { walkthroughs: { id: string }[]; views: { id: string }[] }): Promise<string[]> {\n const { current } = await live.read()\n const open = current as { walkthroughs?: { id: string; title?: string }[]; views?: { id: string; title?: string }[] } | undefined\n if (!open) return []\n const keep = new Set([...next.walkthroughs.map((w) => `w:${w.id}`), ...next.views.map((v) => `v:${v.id}`)])\n return [\n ...(open.walkthroughs ?? []).filter((w) => !keep.has(`w:${w.id}`)).map((w) => `the walkthrough \"${w.title ?? w.id}\"`),\n ...(open.views ?? []).filter((v) => !keep.has(`v:${v.id}`)).map((v) => `the diagram \"${v.title ?? v.id}\"`),\n ]\n}\n\nconst noWindow = () => `No Studio window is open. Ask the person to open ${live.studioUrl}.`\n\nserver.registerTool(\n 'poney_guide',\n {\n title: 'How to write a Poney walkthrough',\n description:\n 'Returns the guide for writing a walkthrough (what each part is for, refs, limits, the check-and-render loop) and a complete valid example. Topic \"change\" explains one change (a commit, a pull request); topic \"tour\" teaches a codebase as it is. Read it before writing a document.',\n inputSchema: { topic: z.enum(['change', 'tour']).optional().describe('\"change\" (default) or \"tour\".') },\n annotations: { readOnlyHint: true },\n },\n async (args) => {\n const topic: Topic = args.topic ?? 'change'\n return text(`${brief(topic)}\\n\\n## Example\\n\\n\\`\\`\\`json\\n${example(topic)}\\`\\`\\``)\n },\n)\n\nserver.registerTool(\n 'poney_schema',\n {\n title: 'Poney JSON Schema',\n description: 'Returns the JSON Schema (draft-07) of a Poney document, for structured output.',\n inputSchema: {},\n annotations: { readOnlyHint: true },\n },\n async () => text(JSON.stringify(schema())),\n)\n\nserver.registerTool(\n 'poney_check',\n {\n title: 'Check a Poney document',\n description:\n 'Validates a document and lints it for readability. Returns errors (the document is invalid) and warnings (it reads badly), each with its path and a hint for the fix, and the scenes it can render. Give `repo` (and `rev`, or `diff`) to also prove the code: in a change, every line shown is in the diff with the right number; in a tour, every excerpt is in its file at those lines; cited tests, and the files in `sourceRefs`, exist. Run it after every edit until there are no errors.',\n inputSchema: {\n ...documentInput,\n repo: z.string().optional().describe('Path of the git repository the code is in.'),\n rev: z.string().optional().describe('The commit, a range \"base..head\", or \"working\" for the files on disk. Default: HEAD.'),\n diff: z.string().optional().describe('A unified diff to check the code against, instead of a repository.'),\n },\n annotations: { readOnlyHint: true },\n },\n async (args) => {\n const input = await inputOrLive(args)\n if (!input) return text('Give a document or a path. Nothing is open in the Studio.', true)\n const { result, report } = check(input, { repo: args.repo, rev: args.rev, diff: args.diff })\n return text([report, result?.ok ? outline(result) : ''].filter(Boolean).join('\\n\\n'), !result?.ok)\n },\n)\n\nserver.registerTool(\n 'poney_excerpt',\n {\n title: 'Copy a code excerpt',\n description: 'Returns a code block for a scene\\'s `code`: lines `from` to `to` of a file, copied exactly, with `start` set. Use it instead of retyping code, so the check finds every line where you say it is.',\n inputSchema: {\n repo: z.string().describe('Path of the git repository.'),\n path: z.string().describe('File path, relative to the repository root.'),\n from: z.number().int().min(1),\n to: z.number().int().min(1),\n rev: z.string().optional().describe('A commit, or \"working\" for the file on disk. Default: HEAD.'),\n },\n annotations: { readOnlyHint: true },\n },\n async (args) => {\n const r = excerpt(args.repo, args.path, args.from, args.to, args.rev)\n return r.error ? text(r.error, true) : text(JSON.stringify(r.block, null, 2))\n },\n)\n\nserver.registerTool(\n 'poney_render',\n {\n title: 'Render a scene',\n description:\n 'Draws one scene of a walkthrough (or a view) as a PNG, exactly as Poney Studio shows it, so you can see whether it makes its point. Without a document, renders what is open in the Studio. Scenes are named by id; \"overview\" is the picture next to the story.',\n inputSchema: {\n ...documentInput,\n walkthrough: z.string().optional().describe('Walkthrough id. Default: the first.'),\n scene: z.string().optional().describe('Scene id, or \"overview\". Default: the overview, else the first scene with a view.'),\n view: z.string().optional().describe('Render a view by id instead of a scene.'),\n mode: z.enum(['before', 'change', 'after']).optional().describe('Before the change, the change marked (default), or after.'),\n theme: z.enum(['light', 'dark']).optional(),\n },\n annotations: { readOnlyHint: true },\n },\n async (args) => {\n const input = await inputOrLive(args)\n if (!input) return text('Give a document or a path. Nothing is open in the Studio.', true)\n const { result, report } = check(input)\n if (!result?.ok || !result.document) return text(`The document has errors; fix them first.\\n\\n${report}`, true)\n try {\n const r = await renderScenePng(result.document, { walkthrough: args.walkthrough, scene: args.scene, view: args.view, mode: args.mode, theme: args.theme })\n return {\n content: [\n { type: 'image' as const, data: r.png.toString('base64'), mimeType: 'image/png' },\n { type: 'text' as const, text: `${r.title} (${r.width}×${r.height} px).${result.warnings.length ? `\\n\\n${report}` : ''}` },\n ],\n }\n } catch (e) {\n return text(e instanceof Error ? e.message : String(e), true)\n }\n },\n)\n\nserver.registerTool(\n 'poney_open',\n {\n title: 'Open in Poney Studio',\n description:\n 'Checks a document and shows it live in Poney Studio for the person. Every open Studio window updates at once. Returns the address to give the person if no window is open yet. Call it again after each revision. It replaces the open document: to add to it, get it with poney_read (includeDocument: true) and open it with your additions.',\n inputSchema: {\n ...documentInput,\n replace: z.boolean().optional().describe('Set only when the person asked to remove walkthroughs or diagrams that are open now, or to start a new document.'),\n },\n },\n async (args) => {\n if (args.document === undefined && !args.path) return text('Give a document or a path.', true)\n const { result, report } = check(args)\n if (!result?.ok || !result.document) return text(`Not opened: the document has errors.\\n\\n${report}`, true)\n // The person's work is not lost by accident: what is open stays unless they asked to remove it.\n if (!args.replace) {\n const lost = await dropped(result.document)\n if (lost.length)\n return text(\n `Not opened: the open document has ${lost.join(', ')}, and this one leaves them out. Get the open document with poney_read (includeDocument: true), add your work to it, and open that. Set replace: true only if the person asked to remove them.`,\n true,\n )\n }\n const { revision, viewers } = await live.open(JSON.parse(JSON.stringify(result.document)))\n const where = viewers ? `Shown in ${viewers} open Studio window${viewers > 1 ? 's' : ''}.` : noWindow()\n return text(`Opened revision ${revision}: \"${result.document.walkthroughs[0]?.title ?? result.document.project.name}\". ${where}${result.warnings.length ? `\\n\\n${report}` : ''}`)\n },\n)\n\nserver.registerTool(\n 'poney_import',\n {\n title: 'Import from the code',\n description:\n 'Reads a source in a repository and adds what it finds to the document open in the Studio (or to a new one): \"schema\" reads the database schema (db/schema.rb, a .sql schema, schema.prisma) into tables, columns and foreign keys; \"js-modules\" reads JavaScript and TypeScript imports into modules and who imports whom. It only adds: what the document already has stays. Without an importer, lists the importers and what each would read in the repository. Use it to start from facts, then write the words and the walkthrough yourself.',\n inputSchema: {\n repo: z.string().describe('The repository folder.'),\n importer: z.string().optional().describe('\"schema\", \"js-modules\", or another installed importer. Leave out to list them.'),\n path: z.string().optional().describe('A file to read instead of the one the importer finds, relative to the repository.'),\n store: z.string().optional().describe('For \"schema\": the id of the database entity the tables are stored in.'),\n },\n },\n async ({ repo, importer, path, store }) => {\n const p = await import('./plugins')\n if (!importer) {\n const { importers, problems } = await p.available(repo)\n return text([...importers.map((i) => `- ${i.id}: ${i.description} ${i.files.length ? `Would read ${i.files.join(', ')}.` : 'Nothing to read in this repository.'}`), ...problems].join('\\n'))\n }\n try {\n const { current } = await live.read()\n const { document, summary } = await p.runImport(importer, repo, { into: current, path, store })\n const { result, report } = check({ document })\n if (!result?.ok) return text(`Not opened: the document has errors after the import.\\n\\n${report}`, true)\n const { revision, viewers } = await live.open(document)\n return text(`${summary}\\nOpened revision ${revision}${viewers ? '' : `. ${noWindow()}`}. Give the new parts and tables plain summaries, then group them into views that explain something.`)\n } catch (e) {\n return text(e instanceof Error ? e.message : String(e), true)\n }\n },\n)\n\nserver.registerTool(\n 'poney_overlay',\n {\n title: 'Live facts about the parts',\n description:\n 'Reads live facts about the parts of the open document, through their source paths: \"coverage\" (the share of lines the tests run, from the last coverage report) or \"churn\" (commits in the last 90 days, from git). Without an overlay, lists them. Use the facts in your answers and as badges, e.g. a scene badge \"34% tested\", only as the overlay reports them.',\n inputSchema: {\n repo: z.string().describe('The repository folder.'),\n overlay: z.string().optional().describe('\"coverage\", \"churn\", or another installed overlay. Leave out to list them.'),\n },\n },\n async ({ repo, overlay }) => {\n const p = await import('./plugins')\n if (!overlay) {\n const { overlays } = await p.available(repo)\n return text(overlays.map((o) => `- ${o.id}: ${o.description} ${o.files.length ? `Would read ${o.files.join(', ')}.` : 'Nothing to read in this repository.'}`).join('\\n'))\n }\n try {\n const { current } = await live.read()\n if (current === undefined) return text('No document is open in the Studio.', true)\n return text(p.describeOverlay(await p.runOverlay(overlay, repo, current)))\n } catch (e) {\n return text(e instanceof Error ? e.message : String(e), true)\n }\n },\n)\n\nserver.registerTool(\n 'poney_wait',\n {\n title: 'Wait for a question from the person',\n description:\n 'Waits until the person asks a question in Poney Studio (\"Ask the agent\"), then returns it with where they were: the walkthrough, the scene, and what they selected. Returns questions you have not seen yet at once, if there are any. Returns an empty list when time runs out; call it again to keep listening. While you wait, the Studio tells the person you are listening.',\n inputSchema: { timeoutSeconds: z.number().int().min(1).max(900).optional().describe('How long to wait. Default: 300.') },\n annotations: { readOnlyHint: true },\n },\n async (args) => {\n const { questions, viewers, place, answeredInStudio } = await live.waitForQuestions((args.timeoutSeconds ?? 300) * 1000)\n if (answeredInStudio)\n return text('Nothing to wait for: an agent started by Poney Studio answers the person\\'s questions, and each question reaches it as a new message. If that agent is you, end your turn now.')\n if (!questions.length) return text(viewers ? 'No question yet. Call poney_wait again to keep listening.' : `No question yet. ${noWindow()}`)\n return text(JSON.stringify({ questions, ...place }, null, 2))\n },\n)\n\nserver.registerTool(\n 'poney_reply',\n {\n title: 'Answer the person in Poney Studio',\n description:\n 'Shows your answer in the thread in Poney Studio, under the person\\'s question. Answer in plain words, short. When a picture helps, first add a scene to the document and open it with poney_open, then give its id in `scene`: the reply gets a link that takes the person there.',\n inputSchema: {\n text: z.string().min(1).describe('The answer. Plain text; blank lines separate paragraphs.'),\n inReplyTo: z.number().int().optional().describe('The id of the question it answers.'),\n walkthrough: z.string().optional().describe('The walkthrough of `scene`. Default: the one the person is reading.'),\n scene: z.string().optional().describe('A scene to show with the answer.'),\n },\n },\n async (args) => {\n const { studio, viewers } = await live.read()\n const m = await live.reply(args.text, { inReplyTo: args.inReplyTo, walkthrough: args.walkthrough ?? (args.scene ? studio?.walkthrough : undefined), scene: args.scene })\n return text(`Replied (message ${m.id}).${viewers ? '' : ' No Studio window is open; the person will see it when they open one.'}`)\n },\n)\n\nserver.registerTool(\n 'poney_read',\n {\n title: 'Read what the person sees',\n description:\n 'Returns what the person is doing in Poney Studio: the view and scene they are on, what they selected, their answers to questions, the notes they wrote for you, which scenes they marked as read, the last messages of the question thread, and the document itself if they changed it.',\n inputSchema: { includeDocument: z.boolean().optional().describe('Also return the full document. Default: only when the person changed it.') },\n annotations: { readOnlyHint: true },\n },\n async (args) => {\n const r = await live.read()\n if (!r.studio && !args.includeDocument) return text(r.viewers ? 'A Studio window is open but has reported nothing yet.' : noWindow())\n const { document, ...rest } = r.studio ?? { document: undefined }\n const out: Record<string, unknown> = { viewers: r.viewers, ...rest, changedDocument: document !== undefined, thread: r.thread.slice(-20) }\n if (document !== undefined || args.includeDocument) out.document = document ?? r.current\n return text(JSON.stringify(out, null, 2))\n },\n)\n\nlog(hub ? `live hub on ${hub.server.url}; Studio at ${live.studioUrl}` : `attached to the live hub; Studio at ${live.studioUrl}`)\nawait server.connect(new StdioServerTransport())\nprocess.on('SIGINT', () => {\n hub?.server.stop()\n process.exit(0)\n})\n"]}
|