@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,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: กฎ
|
|
3
|
+
description: ตั้งค่าคำแนะนำที่กำหนดเองสำหรับ opencode
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
คุณสามารถให้คำแนะนำที่กำหนดเองแก่ opencode ได้โดยการสร้างไฟล์ `AGENTS.md` ซึ่งคล้ายกับกฎของเคอร์เซอร์ ประกอบด้วยคำแนะนำที่จะรวมอยู่ในบริบทของ LLM เพื่อปรับแต่งลักษณะการทำงานสำหรับโครงการเฉพาะของคุณ
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## เริ่มต้น
|
|
11
|
+
|
|
12
|
+
หากต้องการสร้างไฟล์ `AGENTS.md` ใหม่ คุณสามารถเรียกใช้คำสั่ง `/init` ใน opencode
|
|
13
|
+
|
|
14
|
+
:::tip
|
|
15
|
+
คุณควรคอมมิตไฟล์ `AGENTS.md` ของโปรเจ็กต์ของคุณไปที่ Git
|
|
16
|
+
:::
|
|
17
|
+
|
|
18
|
+
การดำเนินการนี้จะสแกนโปรเจ็กต์ของคุณและเนื้อหาทั้งหมดเพื่อทำความเข้าใจว่าโปรเจ็กต์เกี่ยวกับอะไร และสร้างไฟล์ `AGENTS.md` ด้วย สิ่งนี้ช่วยให้ opencode นำทางโครงการได้ดีขึ้น
|
|
19
|
+
|
|
20
|
+
หากคุณมีไฟล์ `AGENTS.md` อยู่แล้ว ระบบจะพยายามเพิ่มไฟล์ดังกล่าว
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ตัวอย่าง
|
|
25
|
+
|
|
26
|
+
คุณสามารถสร้างไฟล์นี้ด้วยตนเองได้ นี่คือตัวอย่างบางสิ่งที่คุณสามารถใส่ลงในไฟล์ `AGENTS.md`
|
|
27
|
+
|
|
28
|
+
```markdown title="AGENTS.md"
|
|
29
|
+
# SST v3 Monorepo Project
|
|
30
|
+
|
|
31
|
+
This is an SST v3 monorepo with TypeScript. The project uses bun workspaces for package management.
|
|
32
|
+
|
|
33
|
+
## Project Structure
|
|
34
|
+
|
|
35
|
+
- `packages/` - Contains all workspace packages (functions, core, web, etc.)
|
|
36
|
+
- `infra/` - Infrastructure definitions split by service (storage.ts, api.ts, web.ts)
|
|
37
|
+
- `sst.config.ts` - Main SST configuration with dynamic imports
|
|
38
|
+
|
|
39
|
+
## Code Standards
|
|
40
|
+
|
|
41
|
+
- Use TypeScript with strict mode enabled
|
|
42
|
+
- Shared code goes in `packages/core/` with proper exports configuration
|
|
43
|
+
- Functions go in `packages/functions/`
|
|
44
|
+
- Infrastructure should be split into logical files in `infra/`
|
|
45
|
+
|
|
46
|
+
## Monorepo Conventions
|
|
47
|
+
|
|
48
|
+
- Import shared modules using workspace names: `@my-app/core/example`
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
เรากำลังเพิ่มคำแนะนำเฉพาะโครงการที่นี่ และจะมีการแชร์กับทีมของคุณ
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## ประเภท
|
|
56
|
+
|
|
57
|
+
opencode ยังรองรับการอ่านไฟล์ `AGENTS.md` จากหลาย ๆ ที่ และสิ่งนี้มีจุดประสงค์ที่แตกต่างกัน
|
|
58
|
+
|
|
59
|
+
### โครงการ
|
|
60
|
+
|
|
61
|
+
วาง `AGENTS.md` ในรูทโปรเจ็กต์ของคุณสำหรับกฎเฉพาะโปรเจ็กต์ สิ่งเหล่านี้ใช้เฉพาะเมื่อคุณทำงานในไดเร็กทอรีนี้หรือไดเร็กทอรีย่อยเท่านั้น
|
|
62
|
+
|
|
63
|
+
### ทั่วโลก
|
|
64
|
+
|
|
65
|
+
คุณยังสามารถมีกฎสากลในไฟล์ `~/.config/opencode/AGENTS.md` สิ่งนี้จะนำไปใช้กับเซสชัน opencode ทั้งหมด
|
|
66
|
+
|
|
67
|
+
เนื่องจากสิ่งนี้ไม่ได้ผูกมัดกับ Git หรือแชร์กับทีมของคุณ เราขอแนะนำให้ใช้สิ่งนี้เพื่อระบุกฎส่วนบุคคลที่ LLM ควรปฏิบัติตาม
|
|
68
|
+
|
|
69
|
+
### ความเข้ากันได้กับ Claude Code
|
|
70
|
+
|
|
71
|
+
สำหรับผู้ใช้ที่ย้ายจาก Claude Code นั้น OpenCode รองรับรูปแบบไฟล์ของ Claude Code เป็นทางเลือก:
|
|
72
|
+
|
|
73
|
+
- **กฎของโครงการ**: `CLAUDE.md` ในไดเรกทอรีโครงการของคุณ (ใช้หากไม่มี `AGENTS.md`)
|
|
74
|
+
- **กฎสากล**: `~/.claude/CLAUDE.md` (ใช้หากไม่มี `~/.config/opencode/AGENTS.md`)
|
|
75
|
+
- **ทักษะ**: `~/.claude/skills/` — ดูรายละเอียด [ทักษะตัวแทน](/docs/skills/)
|
|
76
|
+
|
|
77
|
+
หากต้องการปิดใช้งานความเข้ากันได้ของ Claude Code ให้ตั้งค่าหนึ่งในตัวแปรสภาพแวดล้อมเหล่านี้:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
export OPENCODE_DISABLE_CLAUDE_CODE=1 # Disable all .claude support
|
|
81
|
+
export OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1 # Disable only ~/.claude/CLAUDE.md
|
|
82
|
+
export OPENCODE_DISABLE_CLAUDE_CODE_SKILLS=1 # Disable only .claude/skills
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## ลำดับความสำคัญ
|
|
88
|
+
|
|
89
|
+
เมื่อ opencode เริ่มต้นขึ้น มันจะค้นหาไฟล์กฎตามลำดับนี้:
|
|
90
|
+
|
|
91
|
+
1. **ไฟล์ในเครื่อง** โดยการสำรวจจากไดเรกทอรีปัจจุบัน (`AGENTS.md`, `CLAUDE.md`)
|
|
92
|
+
2. **ไฟล์ทั่วโลก** ที่ `~/.config/opencode/AGENTS.md`
|
|
93
|
+
3. **Claude Code files** ที่ `~/.claude/CLAUDE.md` (ยกเว้นปิดการใช้งาน)
|
|
94
|
+
|
|
95
|
+
ไฟล์ที่ตรงกันไฟล์แรกจะชนะในแต่ละหมวดหมู่ ตัวอย่างเช่น หากคุณมีทั้ง `AGENTS.md` และ `CLAUDE.md` ระบบจะใช้เฉพาะ `AGENTS.md` ในทำนองเดียวกัน `~/.config/opencode/AGENTS.md` จะมีความสำคัญมากกว่า `~/.claude/CLAUDE.md`
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## คำแนะนำที่กำหนดเอง
|
|
100
|
+
|
|
101
|
+
คุณสามารถระบุไฟล์คำแนะนำที่กำหนดเองได้ใน `opencode.json` หรือ `~/.config/opencode/opencode.json` ทั่วโลก สิ่งนี้ช่วยให้คุณและทีมของคุณสามารถนำกฎที่มีอยู่กลับมาใช้ใหม่ได้ แทนที่จะต้องทำซ้ำกฎเหล่านั้นกับ AGENTS.md
|
|
102
|
+
|
|
103
|
+
ตัวอย่าง:
|
|
104
|
+
|
|
105
|
+
```json title="opencode.json"
|
|
106
|
+
{
|
|
107
|
+
"$schema": "https://opencode.ai/config.json",
|
|
108
|
+
"instructions": ["CONTRIBUTING.md", "docs/guidelines.md", ".cursor/rules/*.md"]
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
คุณยังสามารถใช้ URL ระยะไกลเพื่อโหลดคำแนะนำจากเว็บได้
|
|
113
|
+
|
|
114
|
+
```json title="opencode.json"
|
|
115
|
+
{
|
|
116
|
+
"$schema": "https://opencode.ai/config.json",
|
|
117
|
+
"instructions": ["https://raw.githubusercontent.com/my-org/shared-rules/main/style.md"]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
คำแนะนำระยะไกลจะถูกดึงออกมาโดยหมดเวลา 5 วินาที
|
|
122
|
+
|
|
123
|
+
ไฟล์คำสั่งทั้งหมดจะรวมกับไฟล์ `AGENTS.md` ของคุณ
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## การอ้างอิงไฟล์ภายนอก
|
|
128
|
+
|
|
129
|
+
แม้ว่า opencode จะไม่แยกวิเคราะห์การอ้างอิงไฟล์ใน `AGENTS.md` โดยอัตโนมัติ แต่คุณสามารถใช้ฟังก์ชันที่คล้ายกันได้สองวิธี:
|
|
130
|
+
|
|
131
|
+
### ใช้ opencode.json
|
|
132
|
+
|
|
133
|
+
แนวทางที่แนะนำคือการใช้ฟิลด์ `instructions` ใน `opencode.json`:
|
|
134
|
+
|
|
135
|
+
```json title="opencode.json"
|
|
136
|
+
{
|
|
137
|
+
"$schema": "https://opencode.ai/config.json",
|
|
138
|
+
"instructions": ["docs/development-standards.md", "test/testing-guidelines.md", "packages/*/AGENTS.md"]
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### คำแนะนำแบบแมนนวลใน AGENTS.md
|
|
143
|
+
|
|
144
|
+
คุณสามารถสอนให้ opencode อ่านไฟล์ภายนอกได้โดยการให้คำแนะนำที่ชัดเจนใน `AGENTS.md` ของคุณ นี่เป็นตัวอย่างที่เป็นประโยชน์:
|
|
145
|
+
|
|
146
|
+
```markdown title="AGENTS.md"
|
|
147
|
+
# TypeScript Project Rules
|
|
148
|
+
|
|
149
|
+
## External File Loading
|
|
150
|
+
|
|
151
|
+
CRITICAL: When you encounter a file reference (e.g., @rules/general.md), use your Read tool to load it on a need-to-know basis. They're relevant to the SPECIFIC task at hand.
|
|
152
|
+
|
|
153
|
+
Instructions:
|
|
154
|
+
|
|
155
|
+
- Do NOT preemptively load all references - use lazy loading based on actual need
|
|
156
|
+
- When loaded, treat content as mandatory instructions that override defaults
|
|
157
|
+
- Follow references recursively when needed
|
|
158
|
+
|
|
159
|
+
## Development Guidelines
|
|
160
|
+
|
|
161
|
+
For TypeScript code style and best practices: @docs/typescript-guidelines.md
|
|
162
|
+
For React component architecture and hooks patterns: @docs/react-patterns.md
|
|
163
|
+
For REST API design and error handling: @docs/api-standards.md
|
|
164
|
+
For testing strategies and coverage requirements: @test/testing-guidelines.md
|
|
165
|
+
|
|
166
|
+
## General Guidelines
|
|
167
|
+
|
|
168
|
+
Read the following file immediately as it's relevant to all workflows: @rules/general-guidelines.md.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
แนวทางนี้ช่วยให้คุณ:
|
|
172
|
+
|
|
173
|
+
- สร้างไฟล์กฎแบบโมดูลาร์ที่สามารถนำมาใช้ซ้ำได้
|
|
174
|
+
- แชร์กฎระหว่างโปรเจ็กต์ผ่าน symlink หรือโมดูลย่อย git
|
|
175
|
+
- เขียน AGENTS.md ให้กระชับโดยอ้างอิงหลักเกณฑ์โดยละเอียด
|
|
176
|
+
- ตรวจสอบให้แน่ใจว่า opencode จะโหลดไฟล์เมื่อจำเป็นสำหรับงานเฉพาะเท่านั้น
|
|
177
|
+
|
|
178
|
+
:::tip
|
|
179
|
+
สำหรับ monorepos หรือโปรเจ็กต์ที่มีมาตรฐานร่วมกัน การใช้ `opencode.json` ที่มีรูปแบบ glob (เช่น `packages/*/AGENTS.md`) จะสามารถบำรุงรักษาได้ดีกว่าคำสั่งแบบแมนนวล
|
|
180
|
+
:::
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SDK
|
|
3
|
+
description: ไคลเอนต์ JS ประเภทที่ปลอดภัยสำหรับเซิร์ฟเวอร์ opencode
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import config from "../../../../config.mjs"
|
|
7
|
+
export const typesUrl = `${config.github}/blob/dev/packages/sdk/js/src/gen/types.gen.ts`
|
|
8
|
+
|
|
9
|
+
opencode JS/TS SDK จัดเตรียมไคลเอ็นต์ประเภทที่ปลอดภัยสำหรับการโต้ตอบกับเซิร์ฟเวอร์
|
|
10
|
+
ใช้เพื่อสร้างการบูรณาการและควบคุม opencode โดยทางโปรแกรม
|
|
11
|
+
|
|
12
|
+
[เรียนรู้เพิ่มเติม](/docs/server) เกี่ยวกับวิธีการทำงานของเซิร์ฟเวอร์ ตัวอย่างเช่น ลองดู [โครงการ](/docs/ecosystem#โครงการ) ที่สร้างโดยชุมชน
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## ติดตั้ง
|
|
17
|
+
|
|
18
|
+
ติดตั้ง SDK จาก npm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @opencode-ai/sdk
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## สร้างไคลเอนต์
|
|
27
|
+
|
|
28
|
+
สร้างอินสแตนซ์ของ opencode:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import { createOpencode } from "@opencode-ai/sdk"
|
|
32
|
+
|
|
33
|
+
const { client } = await createOpencode()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
สิ่งนี้จะเริ่มต้นทั้งเซิร์ฟเวอร์และไคลเอนต์
|
|
37
|
+
|
|
38
|
+
#### ตัวเลือก
|
|
39
|
+
|
|
40
|
+
| ตัวเลือก | Type | คำอธิบาย | ค่าเริ่มต้น |
|
|
41
|
+
| ---------- | ------------- | ------------------------------------------- | ----------- |
|
|
42
|
+
| `hostname` | `string` | ชื่อโฮสต์ของเซิร์ฟเวอร์ | `127.0.0.1` |
|
|
43
|
+
| `port` | `number` | พอร์ตเซิร์ฟเวอร์ | `4096` |
|
|
44
|
+
| `signal` | `AbortSignal` | ยกเลิกสัญญาณสำหรับการยกเลิก | `undefined` |
|
|
45
|
+
| `timeout` | `number` | หมดเวลาเป็น ms สำหรับการเริ่มต้นเซิร์ฟเวอร์ | `5000` |
|
|
46
|
+
| `config` | `Config` | วัตถุการกำหนดค่า | `{}` |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## การกำหนดค่า
|
|
51
|
+
|
|
52
|
+
คุณสามารถส่งผ่านออบเจ็กต์การกำหนดค่าเพื่อปรับแต่งลักษณะการทำงานได้ อินสแตนซ์ยังคงรับ `opencode.json` ของคุณ แต่คุณสามารถแทนที่หรือเพิ่มการกำหนดค่าแบบอินไลน์ได้:
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
import { createOpencode } from "@opencode-ai/sdk"
|
|
56
|
+
|
|
57
|
+
const opencode = await createOpencode({
|
|
58
|
+
hostname: "127.0.0.1",
|
|
59
|
+
port: 4096,
|
|
60
|
+
config: {
|
|
61
|
+
model: "anthropic/claude-3-5-sonnet-20241022",
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
console.log(`Server running at ${opencode.server.url}`)
|
|
66
|
+
|
|
67
|
+
opencode.server.close()
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## ลูกค้าเท่านั้น
|
|
71
|
+
|
|
72
|
+
หากคุณมีอินสแตนซ์ opencode ที่ทำงานอยู่แล้ว คุณสามารถสร้างอินสแตนซ์ไคลเอ็นต์เพื่อเชื่อมต่อได้:
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
import { createOpencodeClient } from "@opencode-ai/sdk"
|
|
76
|
+
|
|
77
|
+
const client = createOpencodeClient({
|
|
78
|
+
baseUrl: "http://localhost:4096",
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### ตัวเลือก
|
|
83
|
+
|
|
84
|
+
| ตัวเลือก | Type | คำอธิบาย | ค่าเริ่มต้น |
|
|
85
|
+
| --------------- | ---------- | ---------------------------------------- | ----------------------- |
|
|
86
|
+
| `baseUrl` | `string` | URL ของเซิร์ฟเวอร์ | `http://localhost:4096` |
|
|
87
|
+
| `fetch` | `function` | การใช้งานการดึงข้อมูลแบบกำหนดเอง | `globalThis.fetch` |
|
|
88
|
+
| `parseAs` | `string` | Methodการแยกวิเคราะห์การตอบสนอง | `auto` |
|
|
89
|
+
| `responseStyle` | `string` | รูปแบบการคืนสินค้า: `data` หรือ `fields` | `fields` |
|
|
90
|
+
| `throwOnError` | `boolean` | โยนข้อผิดพลาดแทนการส่งคืน | `false` |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## ประเภท
|
|
95
|
+
|
|
96
|
+
SDK มีคำจำกัดความ TypeScript สำหรับ API ประเภททั้งหมด นำเข้าโดยตรง:
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import type { Session, Message, Part } from "@opencode-ai/sdk"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
ทุกประเภทสร้างขึ้นจากข้อกำหนด OpenAPI ของเซิร์ฟเวอร์และมีอยู่ใน <a href={typesUrl}>ไฟล์ประเภท</a>
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## ข้อผิดพลาด
|
|
107
|
+
|
|
108
|
+
SDK อาจทำให้เกิดข้อผิดพลาดที่คุณสามารถจับและจัดการได้:
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
try {
|
|
112
|
+
await client.session.get({ path: { id: "invalid-id" } })
|
|
113
|
+
} catch (error) {
|
|
114
|
+
console.error("Failed to get session:", (error as Error).message)
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## ผลลัพธ์แบบมีโครงสร้าง
|
|
121
|
+
|
|
122
|
+
คุณสามารถร้องขอผลลัพธ์ JSON แบบมีโครงสร้างจากโมเดลได้โดยระบุ `format` ด้วย JSON schema โมเดลจะใช้เครื่องมือ `StructuredOutput` เพื่อส่งคืน JSON ที่ผ่านการตรวจสอบความถูกต้องซึ่งตรงกับสคีมาของคุณ
|
|
123
|
+
|
|
124
|
+
### การใช้งานพื้นฐาน
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
const result = await client.session.prompt({
|
|
128
|
+
path: { id: sessionId },
|
|
129
|
+
body: {
|
|
130
|
+
parts: [{ type: "text", text: "Research Anthropic and provide company info" }],
|
|
131
|
+
format: {
|
|
132
|
+
type: "json_schema",
|
|
133
|
+
schema: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {
|
|
136
|
+
company: { type: "string", description: "Company name" },
|
|
137
|
+
founded: { type: "number", description: "Year founded" },
|
|
138
|
+
products: {
|
|
139
|
+
type: "array",
|
|
140
|
+
items: { type: "string" },
|
|
141
|
+
description: "Main products",
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
required: ["company", "founded"],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
// Access the structured output
|
|
151
|
+
console.log(result.data.info.structured_output)
|
|
152
|
+
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### ประเภทรูปแบบผลลัพธ์
|
|
156
|
+
|
|
157
|
+
| ประเภท | คำอธิบาย |
|
|
158
|
+
| ------------- | ----------------------------------------------------------------- |
|
|
159
|
+
| `text` | ค่าเริ่มต้น การตอบสนองข้อความมาตรฐาน (ไม่มีผลลัพธ์แบบมีโครงสร้าง) |
|
|
160
|
+
| `json_schema` | ส่งคืน JSON ที่ผ่านการตรวจสอบความถูกต้องซึ่งตรงกับสคีมาที่ระบุ |
|
|
161
|
+
|
|
162
|
+
### รูปแบบ JSON Schema
|
|
163
|
+
|
|
164
|
+
เมื่อใช้ `type: 'json_schema'` ให้ระบุ:
|
|
165
|
+
|
|
166
|
+
| ฟิลด์ | Type | คำอธิบาย |
|
|
167
|
+
| ------------ | --------------- | --------------------------------------------------------------------- |
|
|
168
|
+
| `type` | `'json_schema'` | จำเป็น ระบุโหมด JSON schema |
|
|
169
|
+
| `schema` | `object` | จำเป็น วัตถุ JSON Schema ที่กำหนดโครงสร้างผลลัพธ์ |
|
|
170
|
+
| `retryCount` | `number` | ไม่จำเป็น จำนวนการลองใหม่สำหรับการตรวจสอบความถูกต้อง (ค่าเริ่มต้น: 2) |
|
|
171
|
+
|
|
172
|
+
### การจัดการข้อผิดพลาด
|
|
173
|
+
|
|
174
|
+
หากโมเดลล้มเหลวในการสร้างผลลัพธ์แบบมีโครงสร้างที่ถูกต้องหลังจากลองใหม่ครบทุกครั้ง การตอบสนองจะรวม `StructuredOutputError`:
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
if (result.data.info.error?.name === "StructuredOutputError") {
|
|
178
|
+
console.error("Failed to produce structured output:", result.data.info.error.message)
|
|
179
|
+
console.error("Attempts:", result.data.info.error.retries)
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### แนวปฏิบัติที่ดีที่สุด
|
|
184
|
+
|
|
185
|
+
1. **ระบุคำอธิบายที่ชัดเจน** ในคุณสมบัติสคีมาของคุณเพื่อช่วยให้โมเดลเข้าใจว่าข้อมูลใดที่ต้องดึงออกมา
|
|
186
|
+
2. **ใช้ `required`** เพื่อระบุฟิลด์ที่ต้องมี
|
|
187
|
+
3. **รักษาสคีมาให้โฟกัส** - สคีมาที่ซ้อนกันซับซ้อนอาจยากสำหรับโมเดลในการกรอกให้ถูกต้อง
|
|
188
|
+
4. **ตั้งค่า `retryCount` ที่เหมาะสม** - เพิ่มสำหรับสคีมาที่ซับซ้อน ลดลงสำหรับสคีมาที่เรียบง่าย
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## API
|
|
193
|
+
|
|
194
|
+
SDK เปิดเผย API ของเซิร์ฟเวอร์ทั้งหมดผ่านไคลเอ็นต์ประเภทที่ปลอดภัย
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
### ทั่วโลก
|
|
199
|
+
|
|
200
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
201
|
+
| ----------------- | ------------------------------------ | ------------------------------------ |
|
|
202
|
+
| `global.health()` | ตรวจสอบสภาพและเวอร์ชันของเซิร์ฟเวอร์ | `{ healthy: true, version: string }` |
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
#### ตัวอย่าง
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
const health = await client.global.health()
|
|
210
|
+
console.log(health.data.version)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### แอป
|
|
216
|
+
|
|
217
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
218
|
+
| -------------- | ----------------------------- | -------------------------------------------- |
|
|
219
|
+
| `app.log()` | เขียนรายการบันทึก | `boolean` |
|
|
220
|
+
| `app.agents()` | รายชื่อตัวแทนที่มีอยู่ทั้งหมด | <a href={typesUrl}><code>ตัวแทน[]</code></a> |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
#### ตัวอย่าง
|
|
225
|
+
|
|
226
|
+
```javascript
|
|
227
|
+
// Write a log entry
|
|
228
|
+
await client.app.log({
|
|
229
|
+
body: {
|
|
230
|
+
service: "my-app",
|
|
231
|
+
level: "info",
|
|
232
|
+
message: "Operation completed",
|
|
233
|
+
},
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
// List available agents
|
|
237
|
+
const agents = await client.app.agents()
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### โครงการ
|
|
243
|
+
|
|
244
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
245
|
+
| ------------------- | ------------------------ | --------------------------------------------- |
|
|
246
|
+
| `project.list()` | แสดงรายการโครงการทั้งหมด | <a href={typesUrl}><code>Project[]</code></a> |
|
|
247
|
+
| `project.current()` | รับโครงการปัจจุบัน | <a href={typesUrl}><code>Project</code></a> |
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
#### ตัวอย่าง
|
|
252
|
+
|
|
253
|
+
```javascript
|
|
254
|
+
// List all projects
|
|
255
|
+
const projects = await client.project.list()
|
|
256
|
+
|
|
257
|
+
// Get current project
|
|
258
|
+
const currentProject = await client.project.current()
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
### เส้นทาง
|
|
264
|
+
|
|
265
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
266
|
+
| ------------ | ------------------ | ---------------------------------------- |
|
|
267
|
+
| `path.get()` | รับเส้นทางปัจจุบัน | <a href={typesUrl}><code>Path</code></a> |
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
#### ตัวอย่าง
|
|
272
|
+
|
|
273
|
+
```javascript
|
|
274
|
+
// Get current path information
|
|
275
|
+
const pathInfo = await client.path.get()
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
### การกำหนดค่า
|
|
281
|
+
|
|
282
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
283
|
+
| -------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
284
|
+
| `config.get()` | รับข้อมูลการกำหนดค่า | <a href={typesUrl}><code>กำหนดค่า</code></a> |
|
|
285
|
+
| `config.providers()` | ผู้ให้บริการรายชื่อและโมเดลเริ่มต้น | `{ providers: `<a href={typesUrl}><code>ผู้ให้บริการ[]</code></a>`, default: { [key: string]: string } }` |
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
#### ตัวอย่าง
|
|
290
|
+
|
|
291
|
+
```javascript
|
|
292
|
+
const config = await client.config.get()
|
|
293
|
+
|
|
294
|
+
const { providers, default: defaults } = await client.config.providers()
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
### เซสชัน
|
|
300
|
+
|
|
301
|
+
| Method | คำอธิบาย | หมายเหตุ |
|
|
302
|
+
| ---------------------------------------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
303
|
+
| `session.list()` | แสดงรายการเซสชัน | ส่งคืน <a href={typesUrl}><code>เซสชัน[]</code></a> |
|
|
304
|
+
| `session.get({ path })` | รับเซสชัน | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
|
305
|
+
| `session.children({ path })` | แสดงรายการเซสชันย่อย | ส่งคืน <a href={typesUrl}><code>เซสชัน[]</code></a> |
|
|
306
|
+
| `session.create({ body })` | สร้างเซสชัน | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
|
307
|
+
| `session.delete({ path })` | ลบเซสชัน | ส่งคืน `boolean` |
|
|
308
|
+
| `session.update({ path, body })` | อัปเดตคุณสมบัติเซสชัน | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
|
309
|
+
| `session.init({ path, body })` | วิเคราะห์แอปและสร้าง `AGENTS.md` | ส่งคืน `boolean` |
|
|
310
|
+
| `session.abort({ path })` | ยกเลิกเซสชันที่ทำงานอยู่ | ส่งคืน `boolean` |
|
|
311
|
+
| `session.share({ path })` | แบ่งปันเซสชั่น | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
|
312
|
+
| `session.unshare({ path })` | เลิกแชร์เซสชัน | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
|
313
|
+
| `session.summarize({ path, body })` | สรุปเซสชัน | ส่งคืน `boolean` |
|
|
314
|
+
| `session.messages({ path })` | แสดงรายการข้อความในเซสชัน | ส่งคืน `{ info: `<a href={typesUrl}><code>ข้อความ</code></a>`, parts: `<a href={typesUrl}><code>ส่วน[]</code></a>`}[]` |
|
|
315
|
+
| `session.message({ path })` | รับรายละเอียดข้อความ | ส่งคืน `{ info: `<a href={typesUrl}><code>ข้อความ</code></a>`, parts: `<a href={typesUrl}><code>ส่วน[]</code></a>`}` |
|
|
316
|
+
| `session.prompt({ path, body })` | ส่งข้อความแจ้ง | `body.noReply: true` ส่งคืน UserMessage (บริบทเท่านั้น) ค่าเริ่มต้นส่งคืน <a href={typesUrl}><code>AssistantMessage</code></a> พร้อมการตอบสนองของ AI รองรับ `body.outputFormat` สำหรับ [ผลลัพธ์แบบมีโครงสร้าง](#ผลลัพธ์แบบมีโครงสร้าง) |
|
|
317
|
+
| `session.command({ path, body })` | ส่งคำสั่งไปยังเซสชั่น | ส่งคืน `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>ส่วน[]</code></a>`}` |
|
|
318
|
+
| `session.shell({ path, body })` | รันคำสั่ง shell | ส่งคืน <a href={typesUrl}><code>AssistantMessage</code></a> |
|
|
319
|
+
| `session.revert({ path, body })` | คืนค่าข้อความ | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
|
320
|
+
| `session.unrevert({ path })` | คืนค่าข้อความที่เปลี่ยนกลับ | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
|
321
|
+
| `postSessionByIdPermissionsByPermissionId({ path, body })` | ตอบสนองต่อการร้องขอการอนุญาต | ส่งคืน `boolean` |
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
#### ตัวอย่าง
|
|
326
|
+
|
|
327
|
+
```javascript
|
|
328
|
+
// Create and manage sessions
|
|
329
|
+
const session = await client.session.create({
|
|
330
|
+
body: { title: "My session" },
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
const sessions = await client.session.list()
|
|
334
|
+
|
|
335
|
+
// Send a prompt message
|
|
336
|
+
const result = await client.session.prompt({
|
|
337
|
+
path: { id: session.id },
|
|
338
|
+
body: {
|
|
339
|
+
model: { providerID: "anthropic", modelID: "claude-3-5-sonnet-20241022" },
|
|
340
|
+
parts: [{ type: "text", text: "Hello!" }],
|
|
341
|
+
},
|
|
342
|
+
})
|
|
343
|
+
|
|
344
|
+
// Inject context without triggering AI response (useful for plugins)
|
|
345
|
+
await client.session.prompt({
|
|
346
|
+
path: { id: session.id },
|
|
347
|
+
body: {
|
|
348
|
+
noReply: true,
|
|
349
|
+
parts: [{ type: "text", text: "You are a helpful assistant." }],
|
|
350
|
+
},
|
|
351
|
+
})
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
### ไฟล์
|
|
357
|
+
|
|
358
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
359
|
+
| ------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
360
|
+
| `find.text({ query })` | ค้นหาข้อความในไฟล์ | อาร์เรย์ของวัตถุที่ตรงกับ `path`, `lines`, `line_number`, `absolute_offset`, `submatches` |
|
|
361
|
+
| `find.files({ query })` | ค้นหาไฟล์และไดเร็กทอรีตามชื่อ | `string[]` (paths) |
|
|
362
|
+
| `find.symbols({ query })` | ค้นหาสัญลักษณ์พื้นที่ทำงาน | <a href={typesUrl}><code>Symbol[]</code></a> |
|
|
363
|
+
| `file.read({ query })` | อ่านไฟล์ | `{ type: "raw" \| "patch", content: string }` |
|
|
364
|
+
| `file.status({ query? })` | รับสถานะสำหรับไฟล์ที่ถูกติดตาม | <a href={typesUrl}><code>File[]</code></a> |
|
|
365
|
+
|
|
366
|
+
`find.files` รองรับช่องค้นหาเพิ่มเติมบางช่อง:
|
|
367
|
+
|
|
368
|
+
- `type`: `"file"` หรือ `"directory"`
|
|
369
|
+
- `directory`: แทนที่รูทโปรเจ็กต์สำหรับการค้นหา
|
|
370
|
+
- `limit`: ผลลัพธ์สูงสุด (1–200)
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
#### ตัวอย่าง
|
|
375
|
+
|
|
376
|
+
```javascript
|
|
377
|
+
// Search and read files
|
|
378
|
+
const textResults = await client.find.text({
|
|
379
|
+
query: { pattern: "function.*opencode" },
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
const files = await client.find.files({
|
|
383
|
+
query: { query: "*.ts", type: "file" },
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
const directories = await client.find.files({
|
|
387
|
+
query: { query: "packages", type: "directory", limit: 20 },
|
|
388
|
+
})
|
|
389
|
+
|
|
390
|
+
const content = await client.file.read({
|
|
391
|
+
query: { path: "src/index.ts" },
|
|
392
|
+
})
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
### TUI
|
|
398
|
+
|
|
399
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
400
|
+
| ------------------------------ | ------------------------------ | ---------- |
|
|
401
|
+
| `tui.appendPrompt({ body })` | เพิ่มข้อความต่อท้ายข้อความแจ้ง | `boolean` |
|
|
402
|
+
| `tui.openHelp()` | เปิดกล่องโต้ตอบความช่วยเหลือ | `boolean` |
|
|
403
|
+
| `tui.openSessions()` | เปิดตัวเลือกเซสชัน | `boolean` |
|
|
404
|
+
| `tui.openThemes()` | เปิดตัวเลือกธีม | `boolean` |
|
|
405
|
+
| `tui.openModels()` | เปิดตัวเลือกรุ่น | `boolean` |
|
|
406
|
+
| `tui.submitPrompt()` | ส่งข้อความแจ้งปัจจุบัน | `boolean` |
|
|
407
|
+
| `tui.clearPrompt()` | ล้างข้อความแจ้ง | `boolean` |
|
|
408
|
+
| `tui.executeCommand({ body })` | ดำเนินการคำสั่ง | `boolean` |
|
|
409
|
+
| `tui.showToast({ body })` | แสดงการแจ้งเตือนขนมปังปิ้ง | `boolean` |
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
#### ตัวอย่าง
|
|
414
|
+
|
|
415
|
+
```javascript
|
|
416
|
+
// Control TUI interface
|
|
417
|
+
await client.tui.appendPrompt({
|
|
418
|
+
body: { text: "Add this to prompt" },
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
await client.tui.showToast({
|
|
422
|
+
body: { message: "Task completed", variant: "success" },
|
|
423
|
+
})
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
### การรับรองความถูกต้อง
|
|
429
|
+
|
|
430
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
431
|
+
| ------------------- | ----------------------------------------- | ---------- |
|
|
432
|
+
| `auth.set({ ... })` | ตั้งค่าข้อมูลประจำตัวการรับรองความถูกต้อง | `boolean` |
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
#### ตัวอย่าง
|
|
437
|
+
|
|
438
|
+
```javascript
|
|
439
|
+
await client.auth.set({
|
|
440
|
+
path: { id: "anthropic" },
|
|
441
|
+
body: { type: "api", key: "your-api-key" },
|
|
442
|
+
})
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
### กิจกรรม
|
|
448
|
+
|
|
449
|
+
| Method | คำอธิบาย | การตอบสนอง |
|
|
450
|
+
| ------------------- | ------------------------------- | ------------------------------- |
|
|
451
|
+
| `event.subscribe()` | สตรีมเหตุการณ์ที่เซิร์ฟเวอร์ส่ง | สตรีมเหตุการณ์ที่เซิร์ฟเวอร์ส่ง |
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
#### ตัวอย่าง
|
|
456
|
+
|
|
457
|
+
```javascript
|
|
458
|
+
// Listen to real-time events
|
|
459
|
+
const events = await client.event.subscribe()
|
|
460
|
+
for await (const event of events.stream) {
|
|
461
|
+
console.log("Event:", event.type, event.properties)
|
|
462
|
+
}
|
|
463
|
+
```
|