@neurocode-ai/web 1.18.8
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 +54 -0
- package/astro.config.mjs +324 -0
- package/config.mjs +14 -0
- package/package.json +44 -0
- package/public/apple-touch-icon-v3.png +1 -0
- package/public/apple-touch-icon.png +1 -0
- package/public/favicon-96x96-v3.png +1 -0
- package/public/favicon-96x96.png +1 -0
- package/public/favicon-v3.ico +1 -0
- package/public/favicon-v3.svg +1 -0
- package/public/favicon.ico +1 -0
- package/public/favicon.svg +1 -0
- package/public/robots.txt +6 -0
- package/public/site.webmanifest +1 -0
- package/public/social-share-zen.png +1 -0
- package/public/social-share.png +1 -0
- package/public/theme.json +183 -0
- package/public/web-app-manifest-192x192.png +1 -0
- package/public/web-app-manifest-512x512.png +1 -0
- package/src/assets/lander/check.svg +2 -0
- package/src/assets/lander/copy.svg +2 -0
- package/src/assets/lander/screenshot-github.png +0 -0
- package/src/assets/lander/screenshot-splash.png +0 -0
- package/src/assets/lander/screenshot-vscode.png +0 -0
- package/src/assets/lander/screenshot.png +0 -0
- package/src/assets/logo-dark.svg +18 -0
- package/src/assets/logo-light.svg +18 -0
- package/src/assets/logo-ornate-dark.svg +18 -0
- package/src/assets/logo-ornate-light.svg +18 -0
- package/src/assets/web/web-homepage-active-session.png +0 -0
- package/src/assets/web/web-homepage-new-session.png +0 -0
- package/src/assets/web/web-homepage-see-servers.png +0 -0
- package/src/components/Footer.astro +125 -0
- package/src/components/Head.astro +54 -0
- package/src/components/Header.astro +136 -0
- package/src/components/Hero.astro +11 -0
- package/src/components/Lander.astro +721 -0
- package/src/components/LanguageSelect.astro +29 -0
- package/src/components/Share.tsx +644 -0
- package/src/components/SiteTitle.astro +59 -0
- package/src/components/icons/custom.tsx +87 -0
- package/src/components/icons/index.tsx +4454 -0
- package/src/components/share/common.tsx +128 -0
- package/src/components/share/content-bash.module.css +85 -0
- package/src/components/share/content-bash.tsx +67 -0
- package/src/components/share/content-code.module.css +26 -0
- package/src/components/share/content-code.tsx +30 -0
- package/src/components/share/content-diff.module.css +153 -0
- package/src/components/share/content-diff.tsx +240 -0
- package/src/components/share/content-error.module.css +64 -0
- package/src/components/share/content-error.tsx +25 -0
- package/src/components/share/content-markdown.module.css +154 -0
- package/src/components/share/content-markdown.tsx +74 -0
- package/src/components/share/content-text.module.css +63 -0
- package/src/components/share/content-text.tsx +38 -0
- package/src/components/share/copy-button.module.css +30 -0
- package/src/components/share/copy-button.tsx +36 -0
- package/src/components/share/part.module.css +428 -0
- package/src/components/share/part.tsx +816 -0
- package/src/components/share.module.css +832 -0
- package/src/content/docs/acp.mdx +156 -0
- package/src/content/docs/agents.mdx +781 -0
- package/src/content/docs/ar/acp.mdx +156 -0
- package/src/content/docs/ar/agents.mdx +754 -0
- package/src/content/docs/ar/cli.mdx +616 -0
- package/src/content/docs/ar/commands.mdx +322 -0
- package/src/content/docs/ar/config.mdx +685 -0
- package/src/content/docs/ar/custom-tools.mdx +196 -0
- package/src/content/docs/ar/ecosystem.mdx +78 -0
- package/src/content/docs/ar/enterprise.mdx +165 -0
- package/src/content/docs/ar/formatters.mdx +131 -0
- package/src/content/docs/ar/github.mdx +321 -0
- package/src/content/docs/ar/gitlab.mdx +195 -0
- package/src/content/docs/ar/go.mdx +224 -0
- package/src/content/docs/ar/ide.mdx +48 -0
- package/src/content/docs/ar/index.mdx +344 -0
- package/src/content/docs/ar/keybinds.mdx +194 -0
- package/src/content/docs/ar/lsp.mdx +207 -0
- package/src/content/docs/ar/mcp-servers.mdx +511 -0
- package/src/content/docs/ar/models.mdx +222 -0
- package/src/content/docs/ar/network.mdx +57 -0
- package/src/content/docs/ar/permissions.mdx +235 -0
- package/src/content/docs/ar/plugins.mdx +385 -0
- package/src/content/docs/ar/providers.mdx +1983 -0
- package/src/content/docs/ar/rules.mdx +180 -0
- package/src/content/docs/ar/sdk.mdx +463 -0
- package/src/content/docs/ar/server.mdx +287 -0
- package/src/content/docs/ar/share.mdx +127 -0
- package/src/content/docs/ar/skills.mdx +222 -0
- package/src/content/docs/ar/themes.mdx +369 -0
- package/src/content/docs/ar/tools.mdx +341 -0
- package/src/content/docs/ar/troubleshooting.mdx +299 -0
- package/src/content/docs/ar/tui.mdx +426 -0
- package/src/content/docs/ar/web.mdx +142 -0
- package/src/content/docs/ar/windows-wsl.mdx +113 -0
- package/src/content/docs/ar/zen.mdx +332 -0
- package/src/content/docs/bs/acp.mdx +156 -0
- package/src/content/docs/bs/agents.mdx +754 -0
- package/src/content/docs/bs/cli.mdx +614 -0
- package/src/content/docs/bs/commands.mdx +316 -0
- package/src/content/docs/bs/config.mdx +685 -0
- package/src/content/docs/bs/custom-tools.mdx +195 -0
- package/src/content/docs/bs/ecosystem.mdx +78 -0
- package/src/content/docs/bs/enterprise.mdx +165 -0
- package/src/content/docs/bs/formatters.mdx +124 -0
- package/src/content/docs/bs/github.mdx +311 -0
- package/src/content/docs/bs/gitlab.mdx +188 -0
- package/src/content/docs/bs/go.mdx +238 -0
- package/src/content/docs/bs/ide.mdx +47 -0
- package/src/content/docs/bs/index.mdx +323 -0
- package/src/content/docs/bs/keybinds.mdx +194 -0
- package/src/content/docs/bs/lsp.mdx +204 -0
- package/src/content/docs/bs/mcp-servers.mdx +482 -0
- package/src/content/docs/bs/models.mdx +201 -0
- package/src/content/docs/bs/network.mdx +51 -0
- package/src/content/docs/bs/permissions.mdx +228 -0
- package/src/content/docs/bs/plugins.mdx +371 -0
- package/src/content/docs/bs/providers.mdx +1993 -0
- package/src/content/docs/bs/rules.mdx +180 -0
- package/src/content/docs/bs/sdk.mdx +463 -0
- package/src/content/docs/bs/server.mdx +284 -0
- package/src/content/docs/bs/share.mdx +127 -0
- package/src/content/docs/bs/skills.mdx +222 -0
- package/src/content/docs/bs/themes.mdx +369 -0
- package/src/content/docs/bs/tools.mdx +341 -0
- package/src/content/docs/bs/troubleshooting.mdx +300 -0
- package/src/content/docs/bs/tui.mdx +432 -0
- package/src/content/docs/bs/web.mdx +142 -0
- package/src/content/docs/bs/windows-wsl.mdx +113 -0
- package/src/content/docs/bs/zen.mdx +350 -0
- package/src/content/docs/cli.mdx +733 -0
- package/src/content/docs/commands.mdx +323 -0
- package/src/content/docs/config.mdx +941 -0
- package/src/content/docs/custom-tools.mdx +196 -0
- package/src/content/docs/da/acp.mdx +156 -0
- package/src/content/docs/da/agents.mdx +755 -0
- package/src/content/docs/da/cli.mdx +617 -0
- package/src/content/docs/da/commands.mdx +323 -0
- package/src/content/docs/da/config.mdx +688 -0
- package/src/content/docs/da/custom-tools.mdx +196 -0
- package/src/content/docs/da/ecosystem.mdx +78 -0
- package/src/content/docs/da/enterprise.mdx +170 -0
- package/src/content/docs/da/formatters.mdx +131 -0
- package/src/content/docs/da/github.mdx +321 -0
- package/src/content/docs/da/gitlab.mdx +195 -0
- package/src/content/docs/da/go.mdx +238 -0
- package/src/content/docs/da/ide.mdx +48 -0
- package/src/content/docs/da/index.mdx +360 -0
- package/src/content/docs/da/keybinds.mdx +194 -0
- package/src/content/docs/da/lsp.mdx +208 -0
- package/src/content/docs/da/mcp-servers.mdx +511 -0
- package/src/content/docs/da/models.mdx +223 -0
- package/src/content/docs/da/network.mdx +57 -0
- package/src/content/docs/da/permissions.mdx +235 -0
- package/src/content/docs/da/plugins.mdx +389 -0
- package/src/content/docs/da/providers.mdx +1981 -0
- package/src/content/docs/da/rules.mdx +180 -0
- package/src/content/docs/da/sdk.mdx +463 -0
- package/src/content/docs/da/server.mdx +287 -0
- package/src/content/docs/da/share.mdx +128 -0
- package/src/content/docs/da/skills.mdx +222 -0
- package/src/content/docs/da/themes.mdx +369 -0
- package/src/content/docs/da/tools.mdx +341 -0
- package/src/content/docs/da/troubleshooting.mdx +300 -0
- package/src/content/docs/da/tui.mdx +426 -0
- package/src/content/docs/da/web.mdx +142 -0
- package/src/content/docs/da/windows-wsl.mdx +113 -0
- package/src/content/docs/da/zen.mdx +345 -0
- package/src/content/docs/de/acp.mdx +156 -0
- package/src/content/docs/de/agents.mdx +741 -0
- package/src/content/docs/de/cli.mdx +616 -0
- package/src/content/docs/de/commands.mdx +323 -0
- package/src/content/docs/de/config.mdx +684 -0
- package/src/content/docs/de/custom-tools.mdx +170 -0
- package/src/content/docs/de/ecosystem.mdx +78 -0
- package/src/content/docs/de/enterprise.mdx +170 -0
- package/src/content/docs/de/formatters.mdx +131 -0
- package/src/content/docs/de/github.mdx +321 -0
- package/src/content/docs/de/gitlab.mdx +195 -0
- package/src/content/docs/de/go.mdx +226 -0
- package/src/content/docs/de/ide.mdx +48 -0
- package/src/content/docs/de/index.mdx +356 -0
- package/src/content/docs/de/keybinds.mdx +194 -0
- package/src/content/docs/de/lsp.mdx +207 -0
- package/src/content/docs/de/mcp-servers.mdx +511 -0
- package/src/content/docs/de/models.mdx +223 -0
- package/src/content/docs/de/network.mdx +57 -0
- package/src/content/docs/de/permissions.mdx +235 -0
- package/src/content/docs/de/plugins.mdx +384 -0
- package/src/content/docs/de/providers.mdx +1987 -0
- package/src/content/docs/de/rules.mdx +190 -0
- package/src/content/docs/de/sdk.mdx +465 -0
- package/src/content/docs/de/server.mdx +291 -0
- package/src/content/docs/de/share.mdx +130 -0
- package/src/content/docs/de/skills.mdx +222 -0
- package/src/content/docs/de/themes.mdx +372 -0
- package/src/content/docs/de/tools.mdx +352 -0
- package/src/content/docs/de/troubleshooting.mdx +300 -0
- package/src/content/docs/de/tui.mdx +429 -0
- package/src/content/docs/de/web.mdx +142 -0
- package/src/content/docs/de/windows-wsl.mdx +115 -0
- package/src/content/docs/de/zen.mdx +327 -0
- package/src/content/docs/ecosystem.mdx +83 -0
- package/src/content/docs/enterprise.mdx +169 -0
- package/src/content/docs/es/acp.mdx +156 -0
- package/src/content/docs/es/agents.mdx +755 -0
- package/src/content/docs/es/cli.mdx +616 -0
- package/src/content/docs/es/commands.mdx +323 -0
- package/src/content/docs/es/config.mdx +685 -0
- package/src/content/docs/es/custom-tools.mdx +196 -0
- package/src/content/docs/es/ecosystem.mdx +78 -0
- package/src/content/docs/es/enterprise.mdx +170 -0
- package/src/content/docs/es/formatters.mdx +131 -0
- package/src/content/docs/es/github.mdx +321 -0
- package/src/content/docs/es/gitlab.mdx +195 -0
- package/src/content/docs/es/go.mdx +238 -0
- package/src/content/docs/es/ide.mdx +48 -0
- package/src/content/docs/es/index.mdx +345 -0
- package/src/content/docs/es/keybinds.mdx +194 -0
- package/src/content/docs/es/lsp.mdx +208 -0
- package/src/content/docs/es/mcp-servers.mdx +511 -0
- package/src/content/docs/es/models.mdx +223 -0
- package/src/content/docs/es/network.mdx +57 -0
- package/src/content/docs/es/permissions.mdx +235 -0
- package/src/content/docs/es/plugins.mdx +389 -0
- package/src/content/docs/es/providers.mdx +1989 -0
- package/src/content/docs/es/rules.mdx +180 -0
- package/src/content/docs/es/sdk.mdx +463 -0
- package/src/content/docs/es/server.mdx +287 -0
- package/src/content/docs/es/share.mdx +128 -0
- package/src/content/docs/es/skills.mdx +222 -0
- package/src/content/docs/es/themes.mdx +369 -0
- package/src/content/docs/es/tools.mdx +341 -0
- package/src/content/docs/es/troubleshooting.mdx +300 -0
- package/src/content/docs/es/tui.mdx +429 -0
- package/src/content/docs/es/web.mdx +142 -0
- package/src/content/docs/es/windows-wsl.mdx +113 -0
- package/src/content/docs/es/zen.mdx +345 -0
- package/src/content/docs/formatters.mdx +143 -0
- package/src/content/docs/fr/acp.mdx +156 -0
- package/src/content/docs/fr/agents.mdx +755 -0
- package/src/content/docs/fr/cli.mdx +617 -0
- package/src/content/docs/fr/commands.mdx +322 -0
- package/src/content/docs/fr/config.mdx +686 -0
- package/src/content/docs/fr/custom-tools.mdx +170 -0
- package/src/content/docs/fr/ecosystem.mdx +78 -0
- package/src/content/docs/fr/enterprise.mdx +165 -0
- package/src/content/docs/fr/formatters.mdx +131 -0
- package/src/content/docs/fr/github.mdx +322 -0
- package/src/content/docs/fr/gitlab.mdx +195 -0
- package/src/content/docs/fr/go.mdx +224 -0
- package/src/content/docs/fr/ide.mdx +48 -0
- package/src/content/docs/fr/index.mdx +344 -0
- package/src/content/docs/fr/keybinds.mdx +194 -0
- package/src/content/docs/fr/lsp.mdx +208 -0
- package/src/content/docs/fr/mcp-servers.mdx +511 -0
- package/src/content/docs/fr/models.mdx +222 -0
- package/src/content/docs/fr/network.mdx +57 -0
- package/src/content/docs/fr/permissions.mdx +235 -0
- package/src/content/docs/fr/plugins.mdx +384 -0
- package/src/content/docs/fr/providers.mdx +1996 -0
- package/src/content/docs/fr/rules.mdx +180 -0
- package/src/content/docs/fr/sdk.mdx +463 -0
- package/src/content/docs/fr/server.mdx +287 -0
- package/src/content/docs/fr/share.mdx +128 -0
- package/src/content/docs/fr/skills.mdx +222 -0
- package/src/content/docs/fr/themes.mdx +369 -0
- package/src/content/docs/fr/tools.mdx +341 -0
- package/src/content/docs/fr/troubleshooting.mdx +300 -0
- package/src/content/docs/fr/tui.mdx +429 -0
- package/src/content/docs/fr/web.mdx +142 -0
- package/src/content/docs/fr/windows-wsl.mdx +113 -0
- package/src/content/docs/fr/zen.mdx +327 -0
- package/src/content/docs/github.mdx +321 -0
- package/src/content/docs/gitlab.mdx +195 -0
- package/src/content/docs/go.mdx +238 -0
- package/src/content/docs/ide.mdx +48 -0
- package/src/content/docs/index.mdx +360 -0
- package/src/content/docs/it/acp.mdx +155 -0
- package/src/content/docs/it/agents.mdx +753 -0
- package/src/content/docs/it/cli.mdx +617 -0
- package/src/content/docs/it/commands.mdx +322 -0
- package/src/content/docs/it/config.mdx +685 -0
- package/src/content/docs/it/custom-tools.mdx +196 -0
- package/src/content/docs/it/ecosystem.mdx +78 -0
- package/src/content/docs/it/enterprise.mdx +165 -0
- package/src/content/docs/it/formatters.mdx +132 -0
- package/src/content/docs/it/github.mdx +321 -0
- package/src/content/docs/it/gitlab.mdx +195 -0
- package/src/content/docs/it/go.mdx +236 -0
- package/src/content/docs/it/ide.mdx +48 -0
- package/src/content/docs/it/index.mdx +344 -0
- package/src/content/docs/it/keybinds.mdx +194 -0
- package/src/content/docs/it/lsp.mdx +208 -0
- package/src/content/docs/it/mcp-servers.mdx +511 -0
- package/src/content/docs/it/models.mdx +222 -0
- package/src/content/docs/it/network.mdx +57 -0
- package/src/content/docs/it/permissions.mdx +235 -0
- package/src/content/docs/it/plugins.mdx +388 -0
- package/src/content/docs/it/providers.mdx +1964 -0
- package/src/content/docs/it/rules.mdx +180 -0
- package/src/content/docs/it/sdk.mdx +463 -0
- package/src/content/docs/it/server.mdx +284 -0
- package/src/content/docs/it/share.mdx +127 -0
- package/src/content/docs/it/skills.mdx +222 -0
- package/src/content/docs/it/themes.mdx +369 -0
- package/src/content/docs/it/tools.mdx +341 -0
- package/src/content/docs/it/troubleshooting.mdx +299 -0
- package/src/content/docs/it/tui.mdx +426 -0
- package/src/content/docs/it/web.mdx +142 -0
- package/src/content/docs/it/windows-wsl.mdx +113 -0
- package/src/content/docs/it/zen.mdx +345 -0
- package/src/content/docs/ja/acp.mdx +155 -0
- package/src/content/docs/ja/agents.mdx +751 -0
- package/src/content/docs/ja/cli.mdx +616 -0
- package/src/content/docs/ja/commands.mdx +322 -0
- package/src/content/docs/ja/config.mdx +684 -0
- package/src/content/docs/ja/custom-tools.mdx +196 -0
- package/src/content/docs/ja/ecosystem.mdx +78 -0
- package/src/content/docs/ja/enterprise.mdx +166 -0
- package/src/content/docs/ja/formatters.mdx +132 -0
- package/src/content/docs/ja/github.mdx +322 -0
- package/src/content/docs/ja/gitlab.mdx +195 -0
- package/src/content/docs/ja/go.mdx +224 -0
- package/src/content/docs/ja/ide.mdx +48 -0
- package/src/content/docs/ja/index.mdx +350 -0
- package/src/content/docs/ja/keybinds.mdx +194 -0
- package/src/content/docs/ja/lsp.mdx +208 -0
- package/src/content/docs/ja/mcp-servers.mdx +511 -0
- package/src/content/docs/ja/models.mdx +221 -0
- package/src/content/docs/ja/network.mdx +55 -0
- package/src/content/docs/ja/permissions.mdx +282 -0
- package/src/content/docs/ja/plugins.mdx +461 -0
- package/src/content/docs/ja/providers.mdx +1998 -0
- package/src/content/docs/ja/rules.mdx +179 -0
- package/src/content/docs/ja/sdk.mdx +463 -0
- package/src/content/docs/ja/server.mdx +282 -0
- package/src/content/docs/ja/share.mdx +128 -0
- package/src/content/docs/ja/skills.mdx +222 -0
- package/src/content/docs/ja/themes.mdx +667 -0
- package/src/content/docs/ja/tools.mdx +341 -0
- package/src/content/docs/ja/troubleshooting.mdx +300 -0
- package/src/content/docs/ja/tui.mdx +423 -0
- package/src/content/docs/ja/web.mdx +143 -0
- package/src/content/docs/ja/windows-wsl.mdx +116 -0
- package/src/content/docs/ja/zen.mdx +327 -0
- package/src/content/docs/keybinds.mdx +299 -0
- package/src/content/docs/ko/acp.mdx +156 -0
- package/src/content/docs/ko/agents.mdx +754 -0
- package/src/content/docs/ko/cli.mdx +616 -0
- package/src/content/docs/ko/commands.mdx +323 -0
- package/src/content/docs/ko/config.mdx +685 -0
- package/src/content/docs/ko/custom-tools.mdx +196 -0
- package/src/content/docs/ko/ecosystem.mdx +78 -0
- package/src/content/docs/ko/enterprise.mdx +165 -0
- package/src/content/docs/ko/formatters.mdx +132 -0
- package/src/content/docs/ko/github.mdx +321 -0
- package/src/content/docs/ko/gitlab.mdx +195 -0
- package/src/content/docs/ko/go.mdx +224 -0
- package/src/content/docs/ko/ide.mdx +48 -0
- package/src/content/docs/ko/index.mdx +344 -0
- package/src/content/docs/ko/keybinds.mdx +194 -0
- package/src/content/docs/ko/lsp.mdx +208 -0
- package/src/content/docs/ko/mcp-servers.mdx +511 -0
- package/src/content/docs/ko/models.mdx +223 -0
- package/src/content/docs/ko/network.mdx +57 -0
- package/src/content/docs/ko/permissions.mdx +235 -0
- package/src/content/docs/ko/plugins.mdx +388 -0
- package/src/content/docs/ko/providers.mdx +1984 -0
- package/src/content/docs/ko/rules.mdx +179 -0
- package/src/content/docs/ko/sdk.mdx +463 -0
- package/src/content/docs/ko/server.mdx +287 -0
- package/src/content/docs/ko/share.mdx +128 -0
- package/src/content/docs/ko/skills.mdx +222 -0
- package/src/content/docs/ko/themes.mdx +369 -0
- package/src/content/docs/ko/tools.mdx +341 -0
- package/src/content/docs/ko/troubleshooting.mdx +303 -0
- package/src/content/docs/ko/tui.mdx +425 -0
- package/src/content/docs/ko/web.mdx +142 -0
- package/src/content/docs/ko/windows-wsl.mdx +119 -0
- package/src/content/docs/ko/zen.mdx +327 -0
- package/src/content/docs/lsp.mdx +214 -0
- package/src/content/docs/mcp-servers.mdx +512 -0
- package/src/content/docs/models.mdx +223 -0
- package/src/content/docs/nb/acp.mdx +156 -0
- package/src/content/docs/nb/agents.mdx +754 -0
- package/src/content/docs/nb/cli.mdx +617 -0
- package/src/content/docs/nb/commands.mdx +323 -0
- package/src/content/docs/nb/config.mdx +688 -0
- package/src/content/docs/nb/custom-tools.mdx +196 -0
- package/src/content/docs/nb/ecosystem.mdx +78 -0
- package/src/content/docs/nb/enterprise.mdx +170 -0
- package/src/content/docs/nb/formatters.mdx +131 -0
- package/src/content/docs/nb/github.mdx +325 -0
- package/src/content/docs/nb/gitlab.mdx +195 -0
- package/src/content/docs/nb/go.mdx +238 -0
- package/src/content/docs/nb/ide.mdx +48 -0
- package/src/content/docs/nb/index.mdx +359 -0
- package/src/content/docs/nb/keybinds.mdx +194 -0
- package/src/content/docs/nb/lsp.mdx +208 -0
- package/src/content/docs/nb/mcp-servers.mdx +624 -0
- package/src/content/docs/nb/models.mdx +223 -0
- package/src/content/docs/nb/network.mdx +57 -0
- package/src/content/docs/nb/permissions.mdx +235 -0
- package/src/content/docs/nb/plugins.mdx +389 -0
- package/src/content/docs/nb/providers.mdx +1956 -0
- package/src/content/docs/nb/rules.mdx +180 -0
- package/src/content/docs/nb/sdk.mdx +463 -0
- package/src/content/docs/nb/server.mdx +287 -0
- package/src/content/docs/nb/share.mdx +128 -0
- package/src/content/docs/nb/skills.mdx +222 -0
- package/src/content/docs/nb/themes.mdx +369 -0
- package/src/content/docs/nb/tools.mdx +341 -0
- package/src/content/docs/nb/troubleshooting.mdx +225 -0
- package/src/content/docs/nb/tui.mdx +429 -0
- package/src/content/docs/nb/web.mdx +105 -0
- package/src/content/docs/nb/windows-wsl.mdx +113 -0
- package/src/content/docs/nb/zen.mdx +345 -0
- package/src/content/docs/network.mdx +57 -0
- package/src/content/docs/permissions.mdx +256 -0
- package/src/content/docs/pl/acp.mdx +158 -0
- package/src/content/docs/pl/agents.mdx +754 -0
- package/src/content/docs/pl/cli.mdx +617 -0
- package/src/content/docs/pl/commands.mdx +323 -0
- package/src/content/docs/pl/config.mdx +680 -0
- package/src/content/docs/pl/custom-tools.mdx +196 -0
- package/src/content/docs/pl/ecosystem.mdx +78 -0
- package/src/content/docs/pl/enterprise.mdx +170 -0
- package/src/content/docs/pl/formatters.mdx +131 -0
- package/src/content/docs/pl/github.mdx +321 -0
- package/src/content/docs/pl/gitlab.mdx +195 -0
- package/src/content/docs/pl/go.mdx +230 -0
- package/src/content/docs/pl/ide.mdx +48 -0
- package/src/content/docs/pl/index.mdx +347 -0
- package/src/content/docs/pl/keybinds.mdx +194 -0
- package/src/content/docs/pl/lsp.mdx +208 -0
- package/src/content/docs/pl/mcp-servers.mdx +511 -0
- package/src/content/docs/pl/models.mdx +223 -0
- package/src/content/docs/pl/network.mdx +57 -0
- package/src/content/docs/pl/permissions.mdx +235 -0
- package/src/content/docs/pl/plugins.mdx +385 -0
- package/src/content/docs/pl/providers.mdx +1986 -0
- package/src/content/docs/pl/rules.mdx +180 -0
- package/src/content/docs/pl/sdk.mdx +463 -0
- package/src/content/docs/pl/server.mdx +287 -0
- package/src/content/docs/pl/share.mdx +128 -0
- package/src/content/docs/pl/skills.mdx +222 -0
- package/src/content/docs/pl/themes.mdx +369 -0
- package/src/content/docs/pl/tools.mdx +341 -0
- package/src/content/docs/pl/troubleshooting.mdx +300 -0
- package/src/content/docs/pl/tui.mdx +429 -0
- package/src/content/docs/pl/web.mdx +142 -0
- package/src/content/docs/pl/windows-wsl.mdx +113 -0
- package/src/content/docs/pl/zen.mdx +344 -0
- package/src/content/docs/plugins.mdx +389 -0
- package/src/content/docs/policies.mdx +137 -0
- package/src/content/docs/providers.mdx +2501 -0
- package/src/content/docs/pt-br/acp.mdx +156 -0
- package/src/content/docs/pt-br/agents.mdx +755 -0
- package/src/content/docs/pt-br/cli.mdx +616 -0
- package/src/content/docs/pt-br/commands.mdx +322 -0
- package/src/content/docs/pt-br/config.mdx +687 -0
- package/src/content/docs/pt-br/custom-tools.mdx +196 -0
- package/src/content/docs/pt-br/ecosystem.mdx +78 -0
- package/src/content/docs/pt-br/enterprise.mdx +166 -0
- package/src/content/docs/pt-br/formatters.mdx +131 -0
- package/src/content/docs/pt-br/github.mdx +321 -0
- package/src/content/docs/pt-br/gitlab.mdx +195 -0
- package/src/content/docs/pt-br/go.mdx +238 -0
- package/src/content/docs/pt-br/ide.mdx +48 -0
- package/src/content/docs/pt-br/index.mdx +344 -0
- package/src/content/docs/pt-br/keybinds.mdx +194 -0
- package/src/content/docs/pt-br/lsp.mdx +208 -0
- package/src/content/docs/pt-br/mcp-servers.mdx +511 -0
- package/src/content/docs/pt-br/models.mdx +222 -0
- package/src/content/docs/pt-br/network.mdx +57 -0
- package/src/content/docs/pt-br/permissions.mdx +235 -0
- package/src/content/docs/pt-br/plugins.mdx +388 -0
- package/src/content/docs/pt-br/providers.mdx +1989 -0
- package/src/content/docs/pt-br/rules.mdx +180 -0
- package/src/content/docs/pt-br/sdk.mdx +463 -0
- package/src/content/docs/pt-br/server.mdx +284 -0
- package/src/content/docs/pt-br/share.mdx +127 -0
- package/src/content/docs/pt-br/skills.mdx +222 -0
- package/src/content/docs/pt-br/themes.mdx +369 -0
- package/src/content/docs/pt-br/tools.mdx +341 -0
- package/src/content/docs/pt-br/troubleshooting.mdx +299 -0
- package/src/content/docs/pt-br/tui.mdx +426 -0
- package/src/content/docs/pt-br/web.mdx +142 -0
- package/src/content/docs/pt-br/windows-wsl.mdx +113 -0
- package/src/content/docs/pt-br/zen.mdx +327 -0
- package/src/content/docs/references.mdx +157 -0
- package/src/content/docs/ru/acp.mdx +156 -0
- package/src/content/docs/ru/agents.mdx +754 -0
- package/src/content/docs/ru/cli.mdx +617 -0
- package/src/content/docs/ru/commands.mdx +323 -0
- package/src/content/docs/ru/config.mdx +685 -0
- package/src/content/docs/ru/custom-tools.mdx +170 -0
- package/src/content/docs/ru/ecosystem.mdx +78 -0
- package/src/content/docs/ru/enterprise.mdx +168 -0
- package/src/content/docs/ru/formatters.mdx +119 -0
- package/src/content/docs/ru/github.mdx +321 -0
- package/src/content/docs/ru/gitlab.mdx +195 -0
- package/src/content/docs/ru/go.mdx +238 -0
- package/src/content/docs/ru/ide.mdx +48 -0
- package/src/content/docs/ru/index.mdx +356 -0
- package/src/content/docs/ru/keybinds.mdx +194 -0
- package/src/content/docs/ru/lsp.mdx +207 -0
- package/src/content/docs/ru/mcp-servers.mdx +511 -0
- package/src/content/docs/ru/models.mdx +223 -0
- package/src/content/docs/ru/network.mdx +57 -0
- package/src/content/docs/ru/permissions.mdx +235 -0
- package/src/content/docs/ru/plugins.mdx +385 -0
- package/src/content/docs/ru/providers.mdx +1987 -0
- package/src/content/docs/ru/rules.mdx +180 -0
- package/src/content/docs/ru/sdk.mdx +463 -0
- package/src/content/docs/ru/server.mdx +287 -0
- package/src/content/docs/ru/share.mdx +128 -0
- package/src/content/docs/ru/skills.mdx +222 -0
- package/src/content/docs/ru/themes.mdx +369 -0
- package/src/content/docs/ru/tools.mdx +341 -0
- package/src/content/docs/ru/troubleshooting.mdx +300 -0
- package/src/content/docs/ru/tui.mdx +429 -0
- package/src/content/docs/ru/web.mdx +142 -0
- package/src/content/docs/ru/windows-wsl.mdx +113 -0
- package/src/content/docs/ru/zen.mdx +345 -0
- package/src/content/docs/rules.mdx +188 -0
- package/src/content/docs/sdk.mdx +463 -0
- package/src/content/docs/server.mdx +287 -0
- package/src/content/docs/share.mdx +128 -0
- package/src/content/docs/skills.mdx +222 -0
- package/src/content/docs/th/acp.mdx +156 -0
- package/src/content/docs/th/agents.mdx +744 -0
- package/src/content/docs/th/cli.mdx +618 -0
- package/src/content/docs/th/commands.mdx +320 -0
- package/src/content/docs/th/config.mdx +690 -0
- package/src/content/docs/th/custom-tools.mdx +196 -0
- package/src/content/docs/th/ecosystem.mdx +78 -0
- package/src/content/docs/th/enterprise.mdx +170 -0
- package/src/content/docs/th/formatters.mdx +131 -0
- package/src/content/docs/th/github.mdx +321 -0
- package/src/content/docs/th/gitlab.mdx +195 -0
- package/src/content/docs/th/go.mdx +224 -0
- package/src/content/docs/th/ide.mdx +48 -0
- package/src/content/docs/th/index.mdx +360 -0
- package/src/content/docs/th/keybinds.mdx +194 -0
- package/src/content/docs/th/lsp.mdx +208 -0
- package/src/content/docs/th/mcp-servers.mdx +511 -0
- package/src/content/docs/th/models.mdx +223 -0
- package/src/content/docs/th/network.mdx +57 -0
- package/src/content/docs/th/permissions.mdx +235 -0
- package/src/content/docs/th/plugins.mdx +389 -0
- package/src/content/docs/th/providers.mdx +2532 -0
- package/src/content/docs/th/rules.mdx +180 -0
- package/src/content/docs/th/sdk.mdx +463 -0
- package/src/content/docs/th/server.mdx +287 -0
- package/src/content/docs/th/share.mdx +128 -0
- package/src/content/docs/th/skills.mdx +222 -0
- package/src/content/docs/th/themes.mdx +369 -0
- package/src/content/docs/th/tools.mdx +341 -0
- package/src/content/docs/th/troubleshooting.mdx +300 -0
- package/src/content/docs/th/tui.mdx +429 -0
- package/src/content/docs/th/web.mdx +142 -0
- package/src/content/docs/th/windows-wsl.mdx +113 -0
- package/src/content/docs/th/zen.mdx +329 -0
- package/src/content/docs/themes.mdx +369 -0
- package/src/content/docs/tools.mdx +345 -0
- package/src/content/docs/tr/acp.mdx +156 -0
- package/src/content/docs/tr/agents.mdx +754 -0
- package/src/content/docs/tr/cli.mdx +617 -0
- package/src/content/docs/tr/commands.mdx +323 -0
- package/src/content/docs/tr/config.mdx +687 -0
- package/src/content/docs/tr/custom-tools.mdx +196 -0
- package/src/content/docs/tr/ecosystem.mdx +78 -0
- package/src/content/docs/tr/enterprise.mdx +170 -0
- package/src/content/docs/tr/formatters.mdx +131 -0
- package/src/content/docs/tr/github.mdx +321 -0
- package/src/content/docs/tr/gitlab.mdx +195 -0
- package/src/content/docs/tr/go.mdx +224 -0
- package/src/content/docs/tr/ide.mdx +48 -0
- package/src/content/docs/tr/index.mdx +347 -0
- package/src/content/docs/tr/keybinds.mdx +194 -0
- package/src/content/docs/tr/lsp.mdx +208 -0
- package/src/content/docs/tr/mcp-servers.mdx +511 -0
- package/src/content/docs/tr/models.mdx +223 -0
- package/src/content/docs/tr/network.mdx +57 -0
- package/src/content/docs/tr/permissions.mdx +235 -0
- package/src/content/docs/tr/plugins.mdx +388 -0
- package/src/content/docs/tr/providers.mdx +1988 -0
- package/src/content/docs/tr/rules.mdx +180 -0
- package/src/content/docs/tr/sdk.mdx +463 -0
- package/src/content/docs/tr/server.mdx +285 -0
- package/src/content/docs/tr/share.mdx +127 -0
- package/src/content/docs/tr/skills.mdx +222 -0
- package/src/content/docs/tr/themes.mdx +369 -0
- package/src/content/docs/tr/tools.mdx +341 -0
- package/src/content/docs/tr/troubleshooting.mdx +299 -0
- package/src/content/docs/tr/tui.mdx +427 -0
- package/src/content/docs/tr/web.mdx +142 -0
- package/src/content/docs/tr/windows-wsl.mdx +113 -0
- package/src/content/docs/tr/zen.mdx +327 -0
- package/src/content/docs/troubleshooting.mdx +314 -0
- package/src/content/docs/tui.mdx +427 -0
- package/src/content/docs/web.mdx +142 -0
- package/src/content/docs/windows-wsl.mdx +112 -0
- package/src/content/docs/zen.mdx +345 -0
- package/src/content/docs/zh-cn/acp.mdx +156 -0
- package/src/content/docs/zh-cn/agents.mdx +754 -0
- package/src/content/docs/zh-cn/cli.mdx +617 -0
- package/src/content/docs/zh-cn/commands.mdx +322 -0
- package/src/content/docs/zh-cn/config.mdx +683 -0
- package/src/content/docs/zh-cn/custom-tools.mdx +196 -0
- package/src/content/docs/zh-cn/ecosystem.mdx +78 -0
- package/src/content/docs/zh-cn/enterprise.mdx +165 -0
- package/src/content/docs/zh-cn/formatters.mdx +132 -0
- package/src/content/docs/zh-cn/github.mdx +321 -0
- package/src/content/docs/zh-cn/gitlab.mdx +194 -0
- package/src/content/docs/zh-cn/go.mdx +224 -0
- package/src/content/docs/zh-cn/ide.mdx +48 -0
- package/src/content/docs/zh-cn/index.mdx +343 -0
- package/src/content/docs/zh-cn/keybinds.mdx +194 -0
- package/src/content/docs/zh-cn/lsp.mdx +208 -0
- package/src/content/docs/zh-cn/mcp-servers.mdx +511 -0
- package/src/content/docs/zh-cn/models.mdx +222 -0
- package/src/content/docs/zh-cn/network.mdx +57 -0
- package/src/content/docs/zh-cn/permissions.mdx +235 -0
- package/src/content/docs/zh-cn/plugins.mdx +388 -0
- package/src/content/docs/zh-cn/providers.mdx +1949 -0
- package/src/content/docs/zh-cn/rules.mdx +180 -0
- package/src/content/docs/zh-cn/sdk.mdx +463 -0
- package/src/content/docs/zh-cn/server.mdx +284 -0
- package/src/content/docs/zh-cn/share.mdx +127 -0
- package/src/content/docs/zh-cn/skills.mdx +222 -0
- package/src/content/docs/zh-cn/themes.mdx +369 -0
- package/src/content/docs/zh-cn/tools.mdx +341 -0
- package/src/content/docs/zh-cn/troubleshooting.mdx +299 -0
- package/src/content/docs/zh-cn/tui.mdx +426 -0
- package/src/content/docs/zh-cn/web.mdx +142 -0
- package/src/content/docs/zh-cn/windows-wsl.mdx +112 -0
- package/src/content/docs/zh-cn/zen.mdx +327 -0
- package/src/content/docs/zh-tw/acp.mdx +156 -0
- package/src/content/docs/zh-tw/agents.mdx +754 -0
- package/src/content/docs/zh-tw/cli.mdx +617 -0
- package/src/content/docs/zh-tw/commands.mdx +322 -0
- package/src/content/docs/zh-tw/config.mdx +687 -0
- package/src/content/docs/zh-tw/custom-tools.mdx +196 -0
- package/src/content/docs/zh-tw/ecosystem.mdx +78 -0
- package/src/content/docs/zh-tw/enterprise.mdx +165 -0
- package/src/content/docs/zh-tw/formatters.mdx +132 -0
- package/src/content/docs/zh-tw/github.mdx +321 -0
- package/src/content/docs/zh-tw/gitlab.mdx +194 -0
- package/src/content/docs/zh-tw/go.mdx +224 -0
- package/src/content/docs/zh-tw/ide.mdx +48 -0
- package/src/content/docs/zh-tw/index.mdx +343 -0
- package/src/content/docs/zh-tw/keybinds.mdx +194 -0
- package/src/content/docs/zh-tw/lsp.mdx +208 -0
- package/src/content/docs/zh-tw/mcp-servers.mdx +511 -0
- package/src/content/docs/zh-tw/models.mdx +222 -0
- package/src/content/docs/zh-tw/network.mdx +57 -0
- package/src/content/docs/zh-tw/permissions.mdx +235 -0
- package/src/content/docs/zh-tw/plugins.mdx +388 -0
- package/src/content/docs/zh-tw/providers.mdx +1970 -0
- package/src/content/docs/zh-tw/rules.mdx +180 -0
- package/src/content/docs/zh-tw/sdk.mdx +463 -0
- package/src/content/docs/zh-tw/server.mdx +284 -0
- package/src/content/docs/zh-tw/share.mdx +127 -0
- package/src/content/docs/zh-tw/skills.mdx +222 -0
- package/src/content/docs/zh-tw/themes.mdx +369 -0
- package/src/content/docs/zh-tw/tools.mdx +341 -0
- package/src/content/docs/zh-tw/troubleshooting.mdx +299 -0
- package/src/content/docs/zh-tw/tui.mdx +426 -0
- package/src/content/docs/zh-tw/web.mdx +142 -0
- package/src/content/docs/zh-tw/windows-wsl.mdx +112 -0
- package/src/content/docs/zh-tw/zen.mdx +333 -0
- package/src/content/i18n/ar.json +75 -0
- package/src/content/i18n/bs.json +75 -0
- package/src/content/i18n/da.json +75 -0
- package/src/content/i18n/de.json +75 -0
- package/src/content/i18n/en.json +75 -0
- package/src/content/i18n/es.json +75 -0
- package/src/content/i18n/fr.json +75 -0
- package/src/content/i18n/it.json +75 -0
- package/src/content/i18n/ja.json +75 -0
- package/src/content/i18n/ko.json +75 -0
- package/src/content/i18n/nb.json +75 -0
- package/src/content/i18n/pl.json +75 -0
- package/src/content/i18n/pt-BR.json +75 -0
- package/src/content/i18n/ru.json +75 -0
- package/src/content/i18n/th.json +75 -0
- package/src/content/i18n/tr.json +75 -0
- package/src/content/i18n/zh-CN.json +75 -0
- package/src/content/i18n/zh-TW.json +75 -0
- package/src/content.config.ts +16 -0
- package/src/i18n/locales.ts +117 -0
- package/src/middleware.ts +94 -0
- package/src/pages/[...slug].md.ts +34 -0
- package/src/pages/s/[id].astro +164 -0
- package/src/styles/custom.css +405 -0
- package/src/types/lang-map.d.ts +27 -0
- package/src/types/starlight-virtual.d.ts +14 -0
- package/sst-env.d.ts +10 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
import map from "lang-map"
|
|
2
|
+
import { DateTime } from "luxon"
|
|
3
|
+
import { For, Show, Match, Switch, type JSX, createMemo, createSignal, type ParentProps } from "solid-js"
|
|
4
|
+
import {
|
|
5
|
+
IconHashtag,
|
|
6
|
+
IconSparkles,
|
|
7
|
+
IconGlobeAlt,
|
|
8
|
+
IconDocument,
|
|
9
|
+
IconPaperClip,
|
|
10
|
+
IconQueueList,
|
|
11
|
+
IconUserCircle,
|
|
12
|
+
IconCommandLine,
|
|
13
|
+
IconCheckCircle,
|
|
14
|
+
IconChevronDown,
|
|
15
|
+
IconChevronRight,
|
|
16
|
+
IconDocumentPlus,
|
|
17
|
+
IconPencilSquare,
|
|
18
|
+
IconRectangleStack,
|
|
19
|
+
IconMagnifyingGlass,
|
|
20
|
+
IconDocumentMagnifyingGlass,
|
|
21
|
+
} from "../icons"
|
|
22
|
+
import { IconMeta, IconRobot, IconOpenAI, IconGemini, IconAnthropic, IconBrain } from "../icons/custom"
|
|
23
|
+
import { ContentCode } from "./content-code"
|
|
24
|
+
import { ContentDiff } from "./content-diff"
|
|
25
|
+
import { ContentText } from "./content-text"
|
|
26
|
+
import { ContentBash } from "./content-bash"
|
|
27
|
+
import { ContentError } from "./content-error"
|
|
28
|
+
import { formatCount, formatDuration, formatNumber, normalizeLocale, useShareMessages } from "../share/common"
|
|
29
|
+
import { ContentMarkdown } from "./content-markdown"
|
|
30
|
+
import type { MessageV2 } from "opencode/session/message-v2"
|
|
31
|
+
import type { Diagnostic } from "vscode-languageserver-types"
|
|
32
|
+
|
|
33
|
+
import styles from "./part.module.css"
|
|
34
|
+
|
|
35
|
+
const MIN_DURATION = 2000
|
|
36
|
+
|
|
37
|
+
export interface PartProps {
|
|
38
|
+
index: number
|
|
39
|
+
message: MessageV2.Info
|
|
40
|
+
part: MessageV2.Part
|
|
41
|
+
last: boolean
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function Part(props: PartProps) {
|
|
45
|
+
const [copied, setCopied] = createSignal(false)
|
|
46
|
+
const id = createMemo(() => props.message.id + "-" + props.index)
|
|
47
|
+
const messages = useShareMessages()
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
class={styles.root}
|
|
52
|
+
id={id()}
|
|
53
|
+
data-component="part"
|
|
54
|
+
data-type={props.part.type}
|
|
55
|
+
data-role={props.message.role}
|
|
56
|
+
data-copied={copied() ? true : undefined}
|
|
57
|
+
>
|
|
58
|
+
<div data-component="decoration">
|
|
59
|
+
<div data-slot="anchor" title={messages.link_to_message}>
|
|
60
|
+
<a
|
|
61
|
+
href={`#${id()}`}
|
|
62
|
+
onClick={(e) => {
|
|
63
|
+
e.preventDefault()
|
|
64
|
+
const anchor = e.currentTarget
|
|
65
|
+
const hash = anchor.getAttribute("href") || ""
|
|
66
|
+
const { origin, pathname, search } = window.location
|
|
67
|
+
navigator.clipboard
|
|
68
|
+
.writeText(`${origin}${pathname}${search}${hash}`)
|
|
69
|
+
.catch((err) => console.error("Copy failed", err))
|
|
70
|
+
|
|
71
|
+
setCopied(true)
|
|
72
|
+
setTimeout(() => setCopied(false), 3000)
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
<Switch>
|
|
76
|
+
<Match when={props.message.role === "user" && props.part.type === "text"}>
|
|
77
|
+
<IconUserCircle width={18} height={18} />
|
|
78
|
+
</Match>
|
|
79
|
+
<Match when={props.message.role === "user" && props.part.type === "file"}>
|
|
80
|
+
<IconPaperClip width={18} height={18} />
|
|
81
|
+
</Match>
|
|
82
|
+
<Match
|
|
83
|
+
when={props.part.type === "step-start" && props.message.role === "assistant" && props.message.modelID}
|
|
84
|
+
>
|
|
85
|
+
{(model) => <ProviderIcon model={model()} size={18} />}
|
|
86
|
+
</Match>
|
|
87
|
+
<Match when={props.part.type === "reasoning" && props.message.role === "assistant"}>
|
|
88
|
+
<IconBrain width={18} height={18} />
|
|
89
|
+
</Match>
|
|
90
|
+
<Match when={props.part.type === "tool" && props.part.tool === "todowrite"}>
|
|
91
|
+
<IconQueueList width={18} height={18} />
|
|
92
|
+
</Match>
|
|
93
|
+
<Match when={props.part.type === "tool" && props.part.tool === "bash"}>
|
|
94
|
+
<IconCommandLine width={18} height={18} />
|
|
95
|
+
</Match>
|
|
96
|
+
<Match when={props.part.type === "tool" && props.part.tool === "edit"}>
|
|
97
|
+
<IconPencilSquare width={18} height={18} />
|
|
98
|
+
</Match>
|
|
99
|
+
<Match when={props.part.type === "tool" && props.part.tool === "write"}>
|
|
100
|
+
<IconDocumentPlus width={18} height={18} />
|
|
101
|
+
</Match>
|
|
102
|
+
<Match when={props.part.type === "tool" && props.part.tool === "read"}>
|
|
103
|
+
<IconDocument width={18} height={18} />
|
|
104
|
+
</Match>
|
|
105
|
+
<Match when={props.part.type === "tool" && props.part.tool === "grep"}>
|
|
106
|
+
<IconDocumentMagnifyingGlass width={18} height={18} />
|
|
107
|
+
</Match>
|
|
108
|
+
<Match when={props.part.type === "tool" && props.part.tool === "list"}>
|
|
109
|
+
<IconRectangleStack width={18} height={18} />
|
|
110
|
+
</Match>
|
|
111
|
+
<Match when={props.part.type === "tool" && props.part.tool === "glob"}>
|
|
112
|
+
<IconMagnifyingGlass width={18} height={18} />
|
|
113
|
+
</Match>
|
|
114
|
+
<Match when={props.part.type === "tool" && props.part.tool === "webfetch"}>
|
|
115
|
+
<IconGlobeAlt width={18} height={18} />
|
|
116
|
+
</Match>
|
|
117
|
+
<Match when={props.part.type === "tool" && props.part.tool === "task"}>
|
|
118
|
+
<IconRobot width={18} height={18} />
|
|
119
|
+
</Match>
|
|
120
|
+
<Match when={true}>
|
|
121
|
+
<IconSparkles width={18} height={18} />
|
|
122
|
+
</Match>
|
|
123
|
+
</Switch>
|
|
124
|
+
<IconHashtag width={18} height={18} />
|
|
125
|
+
<IconCheckCircle width={18} height={18} />
|
|
126
|
+
</a>
|
|
127
|
+
<span data-slot="tooltip">{messages.copied}</span>
|
|
128
|
+
</div>
|
|
129
|
+
<div data-slot="bar"></div>
|
|
130
|
+
</div>
|
|
131
|
+
<div data-component="content">
|
|
132
|
+
{props.message.role === "user" && props.part.type === "text" && (
|
|
133
|
+
<div data-component="user-text">
|
|
134
|
+
<ContentText text={props.part.text} expand={props.last} />
|
|
135
|
+
</div>
|
|
136
|
+
)}
|
|
137
|
+
{props.message.role === "assistant" && props.part.type === "text" && (
|
|
138
|
+
<div data-component="assistant-text">
|
|
139
|
+
<div data-component="assistant-text-markdown">
|
|
140
|
+
<ContentMarkdown expand={props.last} text={props.part.text} />
|
|
141
|
+
</div>
|
|
142
|
+
{props.last && props.message.role === "assistant" && props.message.time.completed && (
|
|
143
|
+
<Footer
|
|
144
|
+
title={DateTime.fromMillis(props.message.time.completed)
|
|
145
|
+
.setLocale(normalizeLocale(messages.locale))
|
|
146
|
+
.toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS)}
|
|
147
|
+
>
|
|
148
|
+
{DateTime.fromMillis(props.message.time.completed)
|
|
149
|
+
.setLocale(normalizeLocale(messages.locale))
|
|
150
|
+
.toLocaleString(DateTime.DATETIME_MED)}
|
|
151
|
+
</Footer>
|
|
152
|
+
)}
|
|
153
|
+
</div>
|
|
154
|
+
)}
|
|
155
|
+
{props.message.role === "assistant" && props.part.type === "reasoning" && (
|
|
156
|
+
<div data-component="tool">
|
|
157
|
+
<div data-component="tool-title">
|
|
158
|
+
<span data-slot="name">{messages.thinking}</span>
|
|
159
|
+
</div>
|
|
160
|
+
<Show when={props.part.text}>
|
|
161
|
+
<div data-component="assistant-reasoning">
|
|
162
|
+
<ResultsButton showCopy={messages.show_details} hideCopy={messages.hide_details}>
|
|
163
|
+
<div data-component="assistant-reasoning-markdown">
|
|
164
|
+
<ContentMarkdown expand text={props.part.text || messages.thinking_pending} />
|
|
165
|
+
</div>
|
|
166
|
+
</ResultsButton>
|
|
167
|
+
</div>
|
|
168
|
+
</Show>
|
|
169
|
+
</div>
|
|
170
|
+
)}
|
|
171
|
+
{props.message.role === "user" && props.part.type === "file" && (
|
|
172
|
+
<div data-component="attachment">
|
|
173
|
+
<div data-slot="copy">{messages.attachment}</div>
|
|
174
|
+
<div data-slot="filename">{props.part.filename}</div>
|
|
175
|
+
</div>
|
|
176
|
+
)}
|
|
177
|
+
{props.part.type === "step-start" && props.message.role === "assistant" && (
|
|
178
|
+
<div data-component="step-start">
|
|
179
|
+
<div data-slot="provider">{props.message.providerID}</div>
|
|
180
|
+
<div data-slot="model">{props.message.modelID}</div>
|
|
181
|
+
</div>
|
|
182
|
+
)}
|
|
183
|
+
{props.part.type === "tool" && props.part.state.status === "error" && (
|
|
184
|
+
<div data-component="tool" data-tool="error">
|
|
185
|
+
<ContentError>{formatErrorString(props.part.state.error, messages.error)}</ContentError>
|
|
186
|
+
<Spacer />
|
|
187
|
+
</div>
|
|
188
|
+
)}
|
|
189
|
+
{props.part.type === "tool" &&
|
|
190
|
+
props.part.state.status === "completed" &&
|
|
191
|
+
props.message.role === "assistant" && (
|
|
192
|
+
<>
|
|
193
|
+
<div data-component="tool" data-tool={props.part.tool}>
|
|
194
|
+
<Switch>
|
|
195
|
+
<Match when={props.part.tool === "grep"}>
|
|
196
|
+
<GrepTool
|
|
197
|
+
message={props.message}
|
|
198
|
+
id={props.part.id}
|
|
199
|
+
tool={props.part.tool}
|
|
200
|
+
state={props.part.state}
|
|
201
|
+
/>
|
|
202
|
+
</Match>
|
|
203
|
+
<Match when={props.part.tool === "glob"}>
|
|
204
|
+
<GlobTool
|
|
205
|
+
message={props.message}
|
|
206
|
+
id={props.part.id}
|
|
207
|
+
tool={props.part.tool}
|
|
208
|
+
state={props.part.state}
|
|
209
|
+
/>
|
|
210
|
+
</Match>
|
|
211
|
+
<Match when={props.part.tool === "list"}>
|
|
212
|
+
<ListTool
|
|
213
|
+
message={props.message}
|
|
214
|
+
id={props.part.id}
|
|
215
|
+
tool={props.part.tool}
|
|
216
|
+
state={props.part.state}
|
|
217
|
+
/>
|
|
218
|
+
</Match>
|
|
219
|
+
<Match when={props.part.tool === "read"}>
|
|
220
|
+
<ReadTool
|
|
221
|
+
message={props.message}
|
|
222
|
+
id={props.part.id}
|
|
223
|
+
tool={props.part.tool}
|
|
224
|
+
state={props.part.state}
|
|
225
|
+
/>
|
|
226
|
+
</Match>
|
|
227
|
+
<Match when={props.part.tool === "write"}>
|
|
228
|
+
<WriteTool
|
|
229
|
+
message={props.message}
|
|
230
|
+
id={props.part.id}
|
|
231
|
+
tool={props.part.tool}
|
|
232
|
+
state={props.part.state}
|
|
233
|
+
/>
|
|
234
|
+
</Match>
|
|
235
|
+
<Match when={props.part.tool === "edit"}>
|
|
236
|
+
<EditTool
|
|
237
|
+
message={props.message}
|
|
238
|
+
id={props.part.id}
|
|
239
|
+
tool={props.part.tool}
|
|
240
|
+
state={props.part.state}
|
|
241
|
+
/>
|
|
242
|
+
</Match>
|
|
243
|
+
<Match when={props.part.tool === "bash"}>
|
|
244
|
+
<BashTool
|
|
245
|
+
id={props.part.id}
|
|
246
|
+
tool={props.part.tool}
|
|
247
|
+
state={props.part.state}
|
|
248
|
+
message={props.message}
|
|
249
|
+
/>
|
|
250
|
+
</Match>
|
|
251
|
+
<Match when={props.part.tool === "todowrite"}>
|
|
252
|
+
<TodoWriteTool
|
|
253
|
+
message={props.message}
|
|
254
|
+
id={props.part.id}
|
|
255
|
+
tool={props.part.tool}
|
|
256
|
+
state={props.part.state}
|
|
257
|
+
/>
|
|
258
|
+
</Match>
|
|
259
|
+
<Match when={props.part.tool === "webfetch"}>
|
|
260
|
+
<WebFetchTool
|
|
261
|
+
message={props.message}
|
|
262
|
+
id={props.part.id}
|
|
263
|
+
tool={props.part.tool}
|
|
264
|
+
state={props.part.state}
|
|
265
|
+
/>
|
|
266
|
+
</Match>
|
|
267
|
+
<Match when={props.part.tool === "task"}>
|
|
268
|
+
<TaskTool
|
|
269
|
+
id={props.part.id}
|
|
270
|
+
tool={props.part.tool}
|
|
271
|
+
message={props.message}
|
|
272
|
+
state={props.part.state}
|
|
273
|
+
/>
|
|
274
|
+
</Match>
|
|
275
|
+
<Match when={true}>
|
|
276
|
+
<FallbackTool
|
|
277
|
+
message={props.message}
|
|
278
|
+
id={props.part.id}
|
|
279
|
+
tool={props.part.tool}
|
|
280
|
+
state={props.part.state}
|
|
281
|
+
/>
|
|
282
|
+
</Match>
|
|
283
|
+
</Switch>
|
|
284
|
+
</div>
|
|
285
|
+
<ToolFooter
|
|
286
|
+
time={DateTime.fromMillis(props.part.state.time.end)
|
|
287
|
+
.diff(DateTime.fromMillis(props.part.state.time.start))
|
|
288
|
+
.toMillis()}
|
|
289
|
+
/>
|
|
290
|
+
</>
|
|
291
|
+
)}
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
type ToolProps = {
|
|
298
|
+
id: MessageV2.ToolPart["id"]
|
|
299
|
+
tool: MessageV2.ToolPart["tool"]
|
|
300
|
+
state: MessageV2.ToolStateCompleted
|
|
301
|
+
message: MessageV2.Assistant
|
|
302
|
+
isLastPart?: boolean
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
interface Todo {
|
|
306
|
+
id: string
|
|
307
|
+
content: string
|
|
308
|
+
status: "pending" | "in_progress" | "completed"
|
|
309
|
+
priority: "low" | "medium" | "high"
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function stripWorkingDirectory(filePath?: string, workingDir?: string) {
|
|
313
|
+
if (filePath === undefined || workingDir === undefined) return filePath
|
|
314
|
+
|
|
315
|
+
const prefix = workingDir.endsWith("/") ? workingDir : workingDir + "/"
|
|
316
|
+
|
|
317
|
+
if (filePath === workingDir) {
|
|
318
|
+
return ""
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (filePath.startsWith(prefix)) {
|
|
322
|
+
return filePath.slice(prefix.length)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return filePath
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function getShikiLang(filename: string) {
|
|
329
|
+
const ext = filename.split(".").pop()?.toLowerCase() ?? ""
|
|
330
|
+
const langs = map.languages(ext)
|
|
331
|
+
const type = langs?.[0]?.toLowerCase()
|
|
332
|
+
|
|
333
|
+
const overrides: Record<string, string> = {
|
|
334
|
+
conf: "shellscript",
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
return type ? (overrides[type] ?? type) : "plaintext"
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function getDiagnostics(
|
|
341
|
+
diagnosticsByFile: Record<string, Diagnostic[]>,
|
|
342
|
+
currentFile: string,
|
|
343
|
+
label: string,
|
|
344
|
+
): JSX.Element[] {
|
|
345
|
+
const result: JSX.Element[] = []
|
|
346
|
+
|
|
347
|
+
if (diagnosticsByFile === undefined || diagnosticsByFile[currentFile] === undefined) return result
|
|
348
|
+
|
|
349
|
+
for (const d of diagnosticsByFile[currentFile]) {
|
|
350
|
+
if (d.severity !== 1) continue
|
|
351
|
+
|
|
352
|
+
const line = d.range.start.line + 1
|
|
353
|
+
const column = d.range.start.character + 1
|
|
354
|
+
|
|
355
|
+
result.push(
|
|
356
|
+
<pre>
|
|
357
|
+
<span data-color="red" data-marker="label">
|
|
358
|
+
{label}
|
|
359
|
+
</span>
|
|
360
|
+
<span data-color="dimmed" data-separator>
|
|
361
|
+
[{line}:{column}]
|
|
362
|
+
</span>
|
|
363
|
+
<span>{d.message}</span>
|
|
364
|
+
</pre>,
|
|
365
|
+
)
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return result
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function formatErrorString(error: string, label: string): JSX.Element {
|
|
372
|
+
const errorMarker = "Error: "
|
|
373
|
+
const startsWithError = error.startsWith(errorMarker)
|
|
374
|
+
|
|
375
|
+
return startsWithError ? (
|
|
376
|
+
<pre>
|
|
377
|
+
<span data-color="red" data-marker="label" data-separator>
|
|
378
|
+
{label}
|
|
379
|
+
</span>
|
|
380
|
+
<span>{error.slice(errorMarker.length)}</span>
|
|
381
|
+
</pre>
|
|
382
|
+
) : (
|
|
383
|
+
<pre>
|
|
384
|
+
<span data-color="dimmed">{error}</span>
|
|
385
|
+
</pre>
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export function TodoWriteTool(props: ToolProps) {
|
|
390
|
+
const messages = useShareMessages()
|
|
391
|
+
const priority: Record<Todo["status"], number> = {
|
|
392
|
+
in_progress: 0,
|
|
393
|
+
pending: 1,
|
|
394
|
+
completed: 2,
|
|
395
|
+
}
|
|
396
|
+
const todos = createMemo(() =>
|
|
397
|
+
((props.state.input?.todos ?? []) as Todo[]).slice().sort((a, b) => priority[a.status] - priority[b.status]),
|
|
398
|
+
)
|
|
399
|
+
const starting = () => todos().every((t: Todo) => t.status === "pending")
|
|
400
|
+
const finished = () => todos().every((t: Todo) => t.status === "completed")
|
|
401
|
+
|
|
402
|
+
return (
|
|
403
|
+
<>
|
|
404
|
+
<div data-component="tool-title">
|
|
405
|
+
<span data-slot="name">
|
|
406
|
+
<Switch fallback={messages.updating_plan}>
|
|
407
|
+
<Match when={starting()}>{messages.creating_plan}</Match>
|
|
408
|
+
<Match when={finished()}>{messages.completing_plan}</Match>
|
|
409
|
+
</Switch>
|
|
410
|
+
</span>
|
|
411
|
+
</div>
|
|
412
|
+
<Show when={todos().length > 0}>
|
|
413
|
+
<ul data-component="todos">
|
|
414
|
+
<For each={todos()}>
|
|
415
|
+
{(todo) => (
|
|
416
|
+
<li data-slot="item" data-status={todo.status}>
|
|
417
|
+
<span></span>
|
|
418
|
+
{todo.content}
|
|
419
|
+
</li>
|
|
420
|
+
)}
|
|
421
|
+
</For>
|
|
422
|
+
</ul>
|
|
423
|
+
</Show>
|
|
424
|
+
</>
|
|
425
|
+
)
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export function GrepTool(props: ToolProps) {
|
|
429
|
+
const messages = useShareMessages()
|
|
430
|
+
|
|
431
|
+
return (
|
|
432
|
+
<>
|
|
433
|
+
<div data-component="tool-title">
|
|
434
|
+
<span data-slot="name">Grep</span>
|
|
435
|
+
<span data-slot="target">“{props.state.input.pattern}”</span>
|
|
436
|
+
</div>
|
|
437
|
+
<div data-component="tool-result">
|
|
438
|
+
<Switch>
|
|
439
|
+
<Match when={props.state.metadata?.matches && props.state.metadata?.matches > 0}>
|
|
440
|
+
<ResultsButton
|
|
441
|
+
showCopy={formatCount(
|
|
442
|
+
props.state.metadata?.matches || 0,
|
|
443
|
+
messages.locale,
|
|
444
|
+
messages.match_one,
|
|
445
|
+
messages.match_other,
|
|
446
|
+
)}
|
|
447
|
+
>
|
|
448
|
+
<ContentText expand compact text={props.state.output} />
|
|
449
|
+
</ResultsButton>
|
|
450
|
+
</Match>
|
|
451
|
+
<Match when={props.state.output}>
|
|
452
|
+
<ContentText expand compact text={props.state.output} data-size="sm" data-color="dimmed" />
|
|
453
|
+
</Match>
|
|
454
|
+
</Switch>
|
|
455
|
+
</div>
|
|
456
|
+
</>
|
|
457
|
+
)
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export function ListTool(props: ToolProps) {
|
|
461
|
+
const path = createMemo(() =>
|
|
462
|
+
props.state.input?.path !== props.message.path.cwd
|
|
463
|
+
? stripWorkingDirectory(props.state.input?.path, props.message.path.cwd)
|
|
464
|
+
: props.state.input?.path,
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
return (
|
|
468
|
+
<>
|
|
469
|
+
<div data-component="tool-title">
|
|
470
|
+
<span data-slot="name">LS</span>
|
|
471
|
+
<span data-slot="target" title={props.state.input?.path}>
|
|
472
|
+
{path()}
|
|
473
|
+
</span>
|
|
474
|
+
</div>
|
|
475
|
+
<div data-component="tool-result">
|
|
476
|
+
<Switch>
|
|
477
|
+
<Match when={props.state.output}>
|
|
478
|
+
<ResultsButton>
|
|
479
|
+
<ContentText expand compact text={props.state.output} />
|
|
480
|
+
</ResultsButton>
|
|
481
|
+
</Match>
|
|
482
|
+
</Switch>
|
|
483
|
+
</div>
|
|
484
|
+
</>
|
|
485
|
+
)
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export function WebFetchTool(props: ToolProps) {
|
|
489
|
+
const messages = useShareMessages()
|
|
490
|
+
|
|
491
|
+
return (
|
|
492
|
+
<>
|
|
493
|
+
<div data-component="tool-title">
|
|
494
|
+
<span data-slot="name">Fetch</span>
|
|
495
|
+
<span data-slot="target">{props.state.input.url}</span>
|
|
496
|
+
</div>
|
|
497
|
+
<div data-component="tool-result">
|
|
498
|
+
<Switch>
|
|
499
|
+
<Match when={props.state.metadata?.error}>
|
|
500
|
+
<ContentError>{formatErrorString(props.state.output, messages.error)}</ContentError>
|
|
501
|
+
</Match>
|
|
502
|
+
<Match when={props.state.output}>
|
|
503
|
+
<ResultsButton>
|
|
504
|
+
<ContentCode lang={props.state.input.format || "text"} code={props.state.output} />
|
|
505
|
+
</ResultsButton>
|
|
506
|
+
</Match>
|
|
507
|
+
</Switch>
|
|
508
|
+
</div>
|
|
509
|
+
</>
|
|
510
|
+
)
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export function ReadTool(props: ToolProps) {
|
|
514
|
+
const messages = useShareMessages()
|
|
515
|
+
const filePath = createMemo(() => stripWorkingDirectory(props.state.input?.filePath, props.message.path.cwd))
|
|
516
|
+
|
|
517
|
+
return (
|
|
518
|
+
<>
|
|
519
|
+
<div data-component="tool-title">
|
|
520
|
+
<span data-slot="name">Read</span>
|
|
521
|
+
<span data-slot="target" title={props.state.input?.filePath}>
|
|
522
|
+
{filePath()}
|
|
523
|
+
</span>
|
|
524
|
+
</div>
|
|
525
|
+
<div data-component="tool-result">
|
|
526
|
+
<Switch>
|
|
527
|
+
<Match when={props.state.metadata?.error}>
|
|
528
|
+
<ContentError>{formatErrorString(props.state.output, messages.error)}</ContentError>
|
|
529
|
+
</Match>
|
|
530
|
+
<Match when={typeof props.state.metadata?.preview === "string"}>
|
|
531
|
+
<ResultsButton showCopy={messages.show_preview} hideCopy={messages.hide_preview}>
|
|
532
|
+
<ContentCode lang={getShikiLang(filePath() || "")} code={props.state.metadata?.preview} />
|
|
533
|
+
</ResultsButton>
|
|
534
|
+
</Match>
|
|
535
|
+
<Match when={typeof props.state.metadata?.preview !== "string" && props.state.output}>
|
|
536
|
+
<ResultsButton>
|
|
537
|
+
<ContentText expand compact text={props.state.output} />
|
|
538
|
+
</ResultsButton>
|
|
539
|
+
</Match>
|
|
540
|
+
</Switch>
|
|
541
|
+
</div>
|
|
542
|
+
</>
|
|
543
|
+
)
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export function WriteTool(props: ToolProps) {
|
|
547
|
+
const messages = useShareMessages()
|
|
548
|
+
const filePath = createMemo(() => stripWorkingDirectory(props.state.input?.filePath, props.message.path.cwd))
|
|
549
|
+
const diagnostics = createMemo(() =>
|
|
550
|
+
getDiagnostics(props.state.metadata?.diagnostics, props.state.input.filePath, messages.error),
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
return (
|
|
554
|
+
<>
|
|
555
|
+
<div data-component="tool-title">
|
|
556
|
+
<span data-slot="name">Write</span>
|
|
557
|
+
<span data-slot="target" title={props.state.input?.filePath}>
|
|
558
|
+
{filePath()}
|
|
559
|
+
</span>
|
|
560
|
+
</div>
|
|
561
|
+
<Show when={diagnostics().length > 0}>
|
|
562
|
+
<ContentError>{diagnostics()}</ContentError>
|
|
563
|
+
</Show>
|
|
564
|
+
<div data-component="tool-result">
|
|
565
|
+
<Switch>
|
|
566
|
+
<Match when={props.state.metadata?.error}>
|
|
567
|
+
<ContentError>{formatErrorString(props.state.output, messages.error)}</ContentError>
|
|
568
|
+
</Match>
|
|
569
|
+
<Match when={props.state.input?.content}>
|
|
570
|
+
<ResultsButton showCopy={messages.show_contents} hideCopy={messages.hide_contents}>
|
|
571
|
+
<ContentCode lang={getShikiLang(filePath() || "")} code={props.state.input?.content} />
|
|
572
|
+
</ResultsButton>
|
|
573
|
+
</Match>
|
|
574
|
+
</Switch>
|
|
575
|
+
</div>
|
|
576
|
+
</>
|
|
577
|
+
)
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export function EditTool(props: ToolProps) {
|
|
581
|
+
const messages = useShareMessages()
|
|
582
|
+
const filePath = createMemo(() => stripWorkingDirectory(props.state.input.filePath, props.message.path.cwd))
|
|
583
|
+
const diagnostics = createMemo(() =>
|
|
584
|
+
getDiagnostics(props.state.metadata?.diagnostics, props.state.input.filePath, messages.error),
|
|
585
|
+
)
|
|
586
|
+
|
|
587
|
+
return (
|
|
588
|
+
<>
|
|
589
|
+
<div data-component="tool-title">
|
|
590
|
+
<span data-slot="name">Edit</span>
|
|
591
|
+
<span data-slot="target" title={props.state.input?.filePath}>
|
|
592
|
+
{filePath()}
|
|
593
|
+
</span>
|
|
594
|
+
</div>
|
|
595
|
+
<div data-component="tool-result">
|
|
596
|
+
<Switch>
|
|
597
|
+
<Match when={props.state.metadata?.error}>
|
|
598
|
+
<ContentError>{formatErrorString(props.state.metadata?.message || "", messages.error)}</ContentError>
|
|
599
|
+
</Match>
|
|
600
|
+
<Match when={props.state.metadata?.diff}>
|
|
601
|
+
<div data-component="diff">
|
|
602
|
+
<ContentDiff diff={props.state.metadata?.diff} lang={getShikiLang(filePath() || "")} />
|
|
603
|
+
</div>
|
|
604
|
+
</Match>
|
|
605
|
+
</Switch>
|
|
606
|
+
</div>
|
|
607
|
+
<Show when={diagnostics().length > 0}>
|
|
608
|
+
<ContentError>{diagnostics()}</ContentError>
|
|
609
|
+
</Show>
|
|
610
|
+
</>
|
|
611
|
+
)
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
export function BashTool(props: ToolProps) {
|
|
615
|
+
return (
|
|
616
|
+
<ContentBash
|
|
617
|
+
command={props.state.input.command}
|
|
618
|
+
output={props.state.metadata.output ?? props.state.metadata?.stdout}
|
|
619
|
+
/>
|
|
620
|
+
)
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export function GlobTool(props: ToolProps) {
|
|
624
|
+
const messages = useShareMessages()
|
|
625
|
+
|
|
626
|
+
return (
|
|
627
|
+
<>
|
|
628
|
+
<div data-component="tool-title">
|
|
629
|
+
<span data-slot="name">Glob</span>
|
|
630
|
+
<span data-slot="target">“{props.state.input.pattern}”</span>
|
|
631
|
+
</div>
|
|
632
|
+
<Switch>
|
|
633
|
+
<Match when={props.state.metadata?.count && props.state.metadata?.count > 0}>
|
|
634
|
+
<div data-component="tool-result">
|
|
635
|
+
<ResultsButton
|
|
636
|
+
showCopy={formatCount(
|
|
637
|
+
props.state.metadata?.count || 0,
|
|
638
|
+
messages.locale,
|
|
639
|
+
messages.result_one,
|
|
640
|
+
messages.result_other,
|
|
641
|
+
)}
|
|
642
|
+
>
|
|
643
|
+
<ContentText expand compact text={props.state.output} />
|
|
644
|
+
</ResultsButton>
|
|
645
|
+
</div>
|
|
646
|
+
</Match>
|
|
647
|
+
<Match when={props.state.output}>
|
|
648
|
+
<ContentText expand text={props.state.output} data-size="sm" data-color="dimmed" />
|
|
649
|
+
</Match>
|
|
650
|
+
</Switch>
|
|
651
|
+
</>
|
|
652
|
+
)
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
interface ResultsButtonProps extends ParentProps {
|
|
656
|
+
showCopy?: string
|
|
657
|
+
hideCopy?: string
|
|
658
|
+
}
|
|
659
|
+
function ResultsButton(props: ResultsButtonProps) {
|
|
660
|
+
const [show, setShow] = createSignal(false)
|
|
661
|
+
const messages = useShareMessages()
|
|
662
|
+
|
|
663
|
+
return (
|
|
664
|
+
<>
|
|
665
|
+
<button type="button" data-component="button-text" data-more onClick={() => setShow((e) => !e)}>
|
|
666
|
+
<span>{show() ? props.hideCopy || messages.hide_results : props.showCopy || messages.show_results}</span>
|
|
667
|
+
<span data-slot="icon">
|
|
668
|
+
<Show when={show()} fallback={<IconChevronRight width={11} height={11} />}>
|
|
669
|
+
<IconChevronDown width={11} height={11} />
|
|
670
|
+
</Show>
|
|
671
|
+
</span>
|
|
672
|
+
</button>
|
|
673
|
+
<Show when={show()}>{props.children}</Show>
|
|
674
|
+
</>
|
|
675
|
+
)
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export function Spacer() {
|
|
679
|
+
return <div data-component="spacer"></div>
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function Footer(props: ParentProps<{ title: string }>) {
|
|
683
|
+
return (
|
|
684
|
+
<div data-component="content-footer" title={props.title}>
|
|
685
|
+
{props.children}
|
|
686
|
+
</div>
|
|
687
|
+
)
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
function ToolFooter(props: { time: number }) {
|
|
691
|
+
const messages = useShareMessages()
|
|
692
|
+
return (
|
|
693
|
+
props.time > MIN_DURATION && (
|
|
694
|
+
<Footer title={`${formatNumber(props.time, messages.locale)}ms`}>
|
|
695
|
+
{formatDuration(props.time, messages.locale)}
|
|
696
|
+
</Footer>
|
|
697
|
+
)
|
|
698
|
+
)
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function TaskTool(props: ToolProps) {
|
|
702
|
+
const messages = useShareMessages()
|
|
703
|
+
|
|
704
|
+
return (
|
|
705
|
+
<>
|
|
706
|
+
<div data-component="tool-title">
|
|
707
|
+
<span data-slot="name">Task</span>
|
|
708
|
+
<span data-slot="target">{props.state.input.description}</span>
|
|
709
|
+
</div>
|
|
710
|
+
<div data-component="tool-input">“{props.state.input.prompt}”</div>
|
|
711
|
+
<ResultsButton showCopy={messages.show_output} hideCopy={messages.hide_output}>
|
|
712
|
+
<div data-component="tool-output">
|
|
713
|
+
<ContentMarkdown expand text={props.state.output} />
|
|
714
|
+
</div>
|
|
715
|
+
</ResultsButton>
|
|
716
|
+
</>
|
|
717
|
+
)
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export function FallbackTool(props: ToolProps) {
|
|
721
|
+
return (
|
|
722
|
+
<>
|
|
723
|
+
<div data-component="tool-title">
|
|
724
|
+
<span data-slot="name">{props.tool}</span>
|
|
725
|
+
</div>
|
|
726
|
+
<div data-component="tool-args">
|
|
727
|
+
<For each={flattenToolArgs(props.state.input)}>
|
|
728
|
+
{(arg) => (
|
|
729
|
+
<>
|
|
730
|
+
<div></div>
|
|
731
|
+
<div>{arg[0]}</div>
|
|
732
|
+
<div>
|
|
733
|
+
{typeof arg[1] === "string" || typeof arg[1] === "number" || typeof arg[1] === "boolean"
|
|
734
|
+
? String(arg[1])
|
|
735
|
+
: arg[1] == null
|
|
736
|
+
? ""
|
|
737
|
+
: JSON.stringify(arg[1])}
|
|
738
|
+
</div>
|
|
739
|
+
</>
|
|
740
|
+
)}
|
|
741
|
+
</For>
|
|
742
|
+
</div>
|
|
743
|
+
<Switch>
|
|
744
|
+
<Match when={props.state.output}>
|
|
745
|
+
<div data-component="tool-result">
|
|
746
|
+
<ResultsButton>
|
|
747
|
+
<ContentText expand compact text={props.state.output} data-size="sm" data-color="dimmed" />
|
|
748
|
+
</ResultsButton>
|
|
749
|
+
</div>
|
|
750
|
+
</Match>
|
|
751
|
+
</Switch>
|
|
752
|
+
</>
|
|
753
|
+
)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// Converts nested objects/arrays into [path, value] pairs.
|
|
757
|
+
// E.g. {a:{b:{c:1}}, d:[{e:2}, 3]} => [["a.b.c",1], ["d[0].e",2], ["d[1]",3]]
|
|
758
|
+
function flattenToolArgs(obj: unknown, prefix: string = ""): Array<[string, unknown]> {
|
|
759
|
+
const entries: Array<[string, unknown]> = []
|
|
760
|
+
if (typeof obj !== "object" || obj === null) return entries
|
|
761
|
+
|
|
762
|
+
for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {
|
|
763
|
+
const path = prefix ? `${prefix}.${key}` : key
|
|
764
|
+
|
|
765
|
+
if (value !== null && typeof value === "object") {
|
|
766
|
+
if (Array.isArray(value)) {
|
|
767
|
+
value.forEach((item, index) => {
|
|
768
|
+
const arrayPath = `${path}[${index}]`
|
|
769
|
+
if (item !== null && typeof item === "object") {
|
|
770
|
+
entries.push(...flattenToolArgs(item, arrayPath))
|
|
771
|
+
} else {
|
|
772
|
+
entries.push([arrayPath, item])
|
|
773
|
+
}
|
|
774
|
+
})
|
|
775
|
+
} else {
|
|
776
|
+
entries.push(...flattenToolArgs(value, path))
|
|
777
|
+
}
|
|
778
|
+
} else {
|
|
779
|
+
entries.push([path, value])
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
return entries
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function getProvider(model: string) {
|
|
787
|
+
const lowerModel = model.toLowerCase()
|
|
788
|
+
|
|
789
|
+
if (/claude|anthropic/.test(lowerModel)) return "anthropic"
|
|
790
|
+
if (/gpt|o[1-4]|codex|openai/.test(lowerModel)) return "openai"
|
|
791
|
+
if (/gemini|palm|bard|google/.test(lowerModel)) return "gemini"
|
|
792
|
+
if (/llama|meta/.test(lowerModel)) return "meta"
|
|
793
|
+
|
|
794
|
+
return "any"
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
export function ProviderIcon(props: { model: string; size?: number }) {
|
|
798
|
+
const provider = getProvider(props.model)
|
|
799
|
+
const size = props.size || 16
|
|
800
|
+
return (
|
|
801
|
+
<Switch fallback={<IconSparkles width={size} height={size} />}>
|
|
802
|
+
<Match when={provider === "openai"}>
|
|
803
|
+
<IconOpenAI width={size} height={size} />
|
|
804
|
+
</Match>
|
|
805
|
+
<Match when={provider === "anthropic"}>
|
|
806
|
+
<IconAnthropic width={size} height={size} />
|
|
807
|
+
</Match>
|
|
808
|
+
<Match when={provider === "gemini"}>
|
|
809
|
+
<IconGemini width={size} height={size} />
|
|
810
|
+
</Match>
|
|
811
|
+
<Match when={provider === "meta"}>
|
|
812
|
+
<IconMeta width={size} height={size} />
|
|
813
|
+
</Match>
|
|
814
|
+
</Switch>
|
|
815
|
+
)
|
|
816
|
+
}
|