Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'tiny-engine/docs/**'
- '.vitepress/**'
- 'tiny-pro'
- 'web-agent-enterprise'
workflow_dispatch: {} # 支持手动触发

permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'tiny-vue/examples/sites/demos/pc/webdoc/**'
- 'tiny-engine/docs/**'
- 'tiny-pro'
- 'web-agent-enterprise'
- '.vitepress/**'
workflow_dispatch: {} # 支持手动触发
repository_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-obs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'tiny-robot/docs/**'
- 'tiny-vue/examples/sites/demos/pc/webdoc/**'
- 'tiny-pro'
- 'web-agent-enterprise'
- '.vitepress/**'

workflow_dispatch:
Expand Down
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@
url = git@github.com:opentiny/tiny-pro.git
branch = dev
shallow = true
[submodule "web-agent-enterprise"]
path = web-agent-enterprise
url = git@github.com:opentiny/web-agent-enterprise.git
branch = develop
shallow = true
29 changes: 28 additions & 1 deletion .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@ import { isMermaidFence, renderMermaidFence } from './theme/markdown/mermaid'
import { tinyEditorDemoPlugin } from './theme/markdown/tiny-editor-demo'
import { tinyproDocsPlugin } from './theme/markdown/tinypro-docs'
import path from 'path'
import fs from 'node:fs'
import { fileURLToPath } from 'url'
import { createRewrites, loadSidebar } from './sidebar'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const rootDir = path.resolve(__dirname, '..')
// robot-wxt 的 tsconfig 继承 wxt 生成的配置,仓库里没有这份文件。
// 示意图组件在该目录下编译时,先补一个空配置,避免 Vite 解析失败。
const wxtTsconfig = path.join(rootDir, 'web-agent-enterprise/packages/robot-wxt/.wxt/tsconfig.json')
if (!fs.existsSync(wxtTsconfig)) {
fs.mkdirSync(path.dirname(wxtTsconfig), { recursive: true })
fs.writeFileSync(
wxtTsconfig,
JSON.stringify({ compilerOptions: { target: 'ESNext', module: 'ESNext', moduleResolution: 'Bundler', jsx: 'preserve' } })
)
}
const sidebar = await loadSidebar(rootDir)
const normalizePath = (path: string, targetStyle: 'windows' | 'linux' = 'linux') => {
if (targetStyle === 'windows') {
Expand Down Expand Up @@ -60,7 +71,23 @@ export default defineConfig({
'tiny-pro/template/**',
'tiny-pro/.github/**',
'tiny-pro/CONTRIBUTING.md',
'tiny-pro/docs/index.md'
'tiny-pro/docs/index.md',
// 私有单仓只发布 TinyRobot AI 助手用户文档,其余 Markdown 按目录排除。
'web-agent-enterprise/docs/**',
'web-agent-enterprise/.github/**',
'web-agent-enterprise/skills/**',
'web-agent-enterprise/AGENTS.md',
'web-agent-enterprise/CLAUDE.md',
'web-agent-enterprise/packages/agent-server/**',
'web-agent-enterprise/packages/mcp-services/**',
'web-agent-enterprise/packages/robot-client/**',
'web-agent-enterprise/packages/web-portal/**',
'web-agent-enterprise/packages/robot-wxt/specs/**',
'web-agent-enterprise/packages/robot-wxt/src/**',
'web-agent-enterprise/packages/robot-wxt/AGENTS.md',
'web-agent-enterprise/packages/robot-wxt/CLAUDE.md',
// 源站首页是另一套 VitePress home,本站从快速入门进入。
'web-agent-enterprise/packages/robot-wxt/docs/index.md'
],
base: process.env.VITEPRESS_BASE || '/',
head: [['link', { rel: 'icon', href: '/images/logo-mini.svg' }]],
Expand Down
10 changes: 10 additions & 0 deletions .vitepress/sidebar/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,15 @@ export const sidebarSources: SidebarSource[] = [
'permissions'
],
toLink: (rel) => `/tiny-pro/guide/${rel.replace(/\.md$/i, '')}`
},
{
kind: 'vitepress',
id: 'tiny-robot-ai',
pages: 'web-agent-enterprise/packages/robot-wxt/docs',
mount: '/tiny-robot-ai',
load: () =>
import('../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/config.mts').then(
(mod) => mod.default.themeConfig?.sidebar
)
}
]
3 changes: 2 additions & 1 deletion .vitepress/sidebar/rewrites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function createRewrites(rootDir: string): Record<string, string> {
...engineRewrites(rootDir),
...dirRewrites(rootDir, 'tiny-editor/packages/docs/fluent-editor/docs', 'tiny-editor'),
'web-agent/docs/:path*': 'web-agent/guide/:path*',
'tiny-pro/docs/:path*': 'tiny-pro/guide/:path*'
'tiny-pro/docs/:path*': 'tiny-pro/guide/:path*',
'web-agent-enterprise/packages/robot-wxt/docs/:path*': 'tiny-robot-ai/:path*'
}
}
32 changes: 32 additions & 0 deletions .vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,25 @@ const redirectMap = [
{
patterns: ['/tiny-pro/guide/role', '/tiny-pro/guide/role.html'],
target: '/tiny-pro/guide/permissions'
},
{
patterns: ['/tiny-robot-ai.html', '/tiny-robot-ai/', '/tiny-robot-ai/index.html'],
target: '/tiny-robot-ai/quick-start'
}
];

const docPath = (value: string) => value.split('#')[0].split('?')[0].replace(/\.html$/, '').replace(/\/$/, '')

const sidebarContainsPath = (item: any, path: string): boolean => {
if (item?.link && docPath(item.link) === docPath(path)) return true
return (item?.items || []).some((child: any) => sidebarContainsPath(child, path))
}

const sidebarGroupTitle = (items: any[], path: string): string => {
const matched = (items || []).find((item: any) => sidebarContainsPath(item, path))
return matched?.text || ''
}

const updateMultipleDocTitle = (basePath: string, nav: any[]) => {
const base = site.value?.base || '/'
const path = route.path.replace(new RegExp(`^${base}`), '/')
Expand Down Expand Up @@ -161,6 +177,16 @@ const updateDocTitle = () => {
const path = route.path.replace(new RegExp(`^${base}`), '/')
const cfg = themeConfig.value || {}

const legacyPrefix = '/tiny-robot-ai/ai-extension'
if (path === legacyPrefix || path.startsWith(`${legacyPrefix}/`)) {
const rest = path
.slice(legacyPrefix.length)
.replace(/^\//, '')
.replace(/\.html$/, '')
.replace(/\/$/, '')
router.go(!rest || rest === 'index' ? '/tiny-robot-ai/quick-start' : `/tiny-robot-ai/${rest}`)
}

for (const { patterns, target } of redirectMap) {
if (patterns.includes(path)) {
router.go(target);
Expand All @@ -173,6 +199,12 @@ const updateDocTitle = () => {
return
}

if (path.includes('/tiny-robot-ai/')) {
const sidebarConfig = cfg.sidebar?.['/tiny-robot-ai/'] || []
docTitle.value = sidebarGroupTitle(sidebarConfig, path) || '使用文档'
return
}

// next-sdk / tiny-vue / web-agent: 从对应 sidebar 的 guide 中寻找匹配项
if (path.includes('/next-sdk/') || path.includes('/tiny-vue/') || path.includes('/web-agent/')) {
const readSidebar = (keys: string[]) => {
Expand Down
11 changes: 11 additions & 0 deletions .vitepress/theme/components/CustomHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ const getActiveNavTab = () => {
"tiny-editor": ["/demo/", "/api/", "/modules/"],
"web-agent": ["/web-agent/"],
"tiny-pro": ["/tiny-pro/"],
"tiny-robot-ai": ["/tiny-robot-ai/"],
};

const segments = productPathMap[activeProductTab.value] || [];
Expand Down Expand Up @@ -437,6 +438,14 @@ const productTabs = computed(() => [
activeProductTab.value === "tiny-robot" ? "active" : "normal"
}-tiny-robot.svg`,
},
{
key: "tiny-robot-ai",
name: "AI Extension",
link: `${prefix}tiny-robot-ai/quick-start`,
src: `${prefix}images/logo-${
activeProductTab.value === "tiny-robot-ai" ? "active" : "normal"
}-tiny-robot-ai.svg`,
},
{
key: "tiny-vue",
name: "TinyVue",
Expand Down Expand Up @@ -498,6 +507,8 @@ watch(
activeProductTab.value = "next-sdk";
} else if (path.includes("/genui-sdk/")) {
activeProductTab.value = "genui-sdk";
} else if (path.includes("/tiny-robot-ai/")) {
activeProductTab.value = "tiny-robot-ai";
} else if (path.includes("/tiny-robot/")) {
activeProductTab.value = "tiny-robot";
} else if (path.includes("/tiny-vue/")) {
Expand Down
12 changes: 10 additions & 2 deletions .vitepress/theme/entity/nav-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,21 @@ class TinyProNavTab extends NavTab {
}
}

class TinyRobotAiNavTab extends NavTab {
getTabs(): TabItem[] {
return [{ key: 'guide', name: '使用文档', link: '/tiny-robot-ai/quick-start' }]
}
}

const navTabClassMap: Record<string, NavTabConstructor> = {
'next-sdk': NextSdkNavTab,
'tiny-vue': TinyVueNavTab,
'tiny-engine': TinyEngineNavTab,
'genui-sdk': GenuiSdkNavTab,
'tiny-editor': TinyEditorNavTab,
'web-agent': WebAgentNavTab,
'tiny-pro': TinyProNavTab
'tiny-pro': TinyProNavTab,
'tiny-robot-ai': TinyRobotAiNavTab
}

const navPathMap: Record<string, string> = {
Expand All @@ -122,7 +129,8 @@ const navPathMap: Record<string, string> = {
'genui-sdk': '/genui-sdk/',
'tiny-editor': '/tiny-editor/',
'web-agent': '/web-agent/',
'tiny-pro': '/tiny-pro/'
'tiny-pro': '/tiny-pro/',
'tiny-robot-ai': '/tiny-robot-ai/'
}

const NavTabFactory = (activeProductTab: string, route: any, site: any, themeConfig: any) => {
Expand Down
2 changes: 2 additions & 0 deletions .vitepress/theme/home/components/HeroSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const hotSearches = [
{ text: "SDK Server 基础使用文档", url: `${prefix}next-sdk/webmcp-sdk/webmcp-server.html` },
{ text: "NEXT-SDKs API", url: `${prefix}next-sdk/webmcp-sdk/global-tools` },
{ text: "TinyRobot 快速开始", url: `${prefix}tiny-robot/guide/quick-start` },
{ text: "TinyRobot AI 快速入门", url: `${prefix}tiny-robot-ai/quick-start` },
];

// 四分类卡片
Expand Down Expand Up @@ -218,6 +219,7 @@ const categoryCards = [
{ text: "NEXT-SDKs", url: "/next-sdk/guide/quick-start.html" },
{ text: "GenUI SDK", url: "/genui-sdk/guide/quick-start.html" },
{ text: "TinyRobot", url: "/tiny-robot/guide/quick-start.html" },
{ text: "AI Extension", url: "/tiny-robot-ai/quick-start.html" },
{ text: "TinyVue", url: "/tiny-vue/guide/installation.html" },
{ text: "TinyEditor", url: "/tiny-editor/guide/quick-start.html" },
{ text: "TinyEngine", url: "/tiny-engine/guide/quick-start.html" },
Expand Down
10 changes: 10 additions & 0 deletions .vitepress/theme/home/components/ProductSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ const productCards = [
{ text: "迁移指南", url: "/tiny-robot/migration/bubble-migration" },
],
},
{
name: "AI Extension",
badge: "NEW",
desc: "TinyRobot AI助手",
icon: `${prefix}images/logo-active-tiny-robot-ai.svg`,
links: [
{ text: "快速入门", url: "/tiny-robot-ai/quick-start" },
{ text: "安装指南", url: "/tiny-robot-ai/install" },
],
},
{
name: "NEXT-SDKs",
desc: "前端智能应用开发工具包",
Expand Down
21 changes: 19 additions & 2 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import Layout from './Layout.vue'
import HomePage from './home/index.vue'
import CustomTable from './components/CustomTable.vue'
import MermaidBlock from './components/MermaidBlock.vue'
import BuiltinSkillActionsDiagram from '../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/theme/components/BuiltinSkillActionsDiagram.vue'
import CustomModelRequestDiagram from '../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/theme/components/CustomModelRequestDiagram.vue'
import QuotaReminderDiagram from '../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/theme/components/QuotaReminderDiagram.vue'
import RequestPathDiagram from '../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/theme/components/RequestPathDiagram.vue'
import SkillImportDiagram from '../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/theme/components/SkillImportDiagram.vue'
import SkillSelectionDiagram from '../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/theme/components/SkillSelectionDiagram.vue'
import '../../web-agent-enterprise/packages/robot-wxt/docs/.vitepress/theme/diagrams.css'
import '@opentiny/tiny-robot-style'
import '@opentiny/fluent-editor/style.css'
import {nextTick, watch} from 'vue';
Expand All @@ -16,6 +23,10 @@ import { insertFurion } from './insert-furion'
import './medium-zoom.css';
import './style.css'

function isTinyRobotComponentPath(path: string) {
return /\/tiny-robot(\/|\.html|$)/.test(path)
}

declare global {
interface Window {
__SW_REGISTERED__?: boolean
Expand All @@ -40,6 +51,12 @@ export default {
app.component('HomePage', HomePage)
app.component('CustomTable', CustomTable)
app.component('MermaidBlock', MermaidBlock)
app.component('RequestPathDiagram', RequestPathDiagram)
app.component('CustomModelRequestDiagram', CustomModelRequestDiagram)
app.component('SkillSelectionDiagram', SkillSelectionDiagram)
app.component('SkillImportDiagram', SkillImportDiagram)
app.component('BuiltinSkillActionsDiagram', BuiltinSkillActionsDiagram)
app.component('QuotaReminderDiagram', QuotaReminderDiagram)
enhanceAppWithTabs(app)
},
Layout,
Expand All @@ -55,7 +72,7 @@ export default {
}
if (typeof window !== 'undefined'){
zoom = mediumZoom('.main img', {background: 'var(--vp-c-bg)'})
if (route.path.includes('tiny-robot')) {
if (isTinyRobotComponentPath(route.path)) {
document.body.classList.remove('hide-code-playground');
} else {
document.body.classList.add('hide-code-playground');
Expand Down Expand Up @@ -143,7 +160,7 @@ function listenCodePlaygroundEvent() {
files,
extraImports,
})
if (route.path.includes('tiny-robot')) {
if (isTinyRobotComponentPath(route.path)) {
const playgroundUrl =
import.meta.env.VITE_TINY_ROBOT_PLAYGROUND_URL || `${import.meta.env.BASE_URL}/tiny-robot/playground/`
window.open(playgroundUrl.replace(/(?<!:)\/\/+/g, '/') + store.serialize(), '_blank')
Expand Down
41 changes: 22 additions & 19 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,29 +132,33 @@ body,
color: rgb(23, 23, 23);
}

.VPSidebarItem.is-active .link {
.VPSidebarItem.is-active > .item > .link {
background-color: #f5faff;
font-weight: 600;
}

.VPSidebarItem.is-active.level-1 .text {
.main-content .VPSidebarItem:is(.level-1, .level-2, .level-3) > .item > .text,
.main-content .VPSidebarItem:is(.level-1, .level-2, .level-3) > .item > .link > .text {
font-weight: 400;
}

.main-content .VPSidebarItem.has-active > .item > .text,
.main-content .VPSidebarItem.has-active > .item > .link > .text {
font-weight: 600;
}

.VPSidebarItem.level-1.is-link.is-active.has-active > .item .link > .text {
.main-content .VPSidebarItem.is-link.is-active:is(.level-1, .level-2, .level-3) > .item > .link > .text {
color: #1476ff;
font-weight: 600;
}

.main-content .VPSidebarItem.is-active .VPSidebarItem:not(.is-active) > .item > .link > .text {
color: var(--vp-c-text-2);
font-weight: 400;
}

.VPSidebarItem.level-2.is-active .item .indicator {
width: 0;
}
.VPSidebarItem.level-2.is-active.has-active .item .link .text {
color: #1476ff;
font-weight: 600;
}
.VPSidebarItem.level-2.is-active.has-active .item .link:hover .text {
color: #1476ff;
font-weight: 600;
}
/* 暗色主题侧边栏项目样式增强 */
.dark .VPSidebarItem .link:hover {
background: #262626;
Expand All @@ -165,15 +169,14 @@ body,
.dark .VPSidebarItem.level-2.is-link > .item .link:hover .text {
color: #e6e6e6;
}
.dark .VPSidebarItem.level-2.is-active.has-active .item .link:hover .text {
color: #1476ff;
font-weight: 600;
.dark .main-content .VPSidebarItem.is-link.is-active:is(.level-1, .level-2, .level-3) > .item > .link > .text {
color: #5291ff;
}
.dark .VPSidebarItem.is-active .link {
background-color: #152a47;
.dark .main-content .VPSidebarItem.is-active .VPSidebarItem:not(.is-active) > .item > .link > .text {
color: var(--vp-c-text-2);
}
.dark .VPSidebarItem.level-1.is-link.is-active.has-active > .item .link > .text {
color: #5291ff;
.dark .VPSidebarItem.is-active > .item > .link {
background-color: #152a47;
}
.main-content .group {
margin-top: 22px;
Expand Down
Loading
Loading