feat(plugin): add annual summary plugin foundation

This commit is contained in:
digua committed 2026-08-18 14:29:38 +08:00
1 parent 2142a35a49
commit b00959fd5f
52 files changed
+2462 -662

No files matched your search

+5 -2
View File
@@ -45,7 +45,7 @@ import {
MergeSessionCache,
type SemanticIndexRuntime,
} from '@openchatlab/node-runtime'
import { registerSharedRoutes } from '@openchatlab/http-routes'
import { annualSummaryNodePlugin, registerSharedRoutes } from '@openchatlab/http-routes'
import type { HttpRouteContext } from '@openchatlab/http-routes'
import { registerImportRoutes } from './import'
import { openDirectoryPath, showPathInFolder } from './cache'
@@ -176,7 +176,10 @@ export function registerWebRoutes(
runAgentStream: ai.runAgentStream,
}),
},
ai ? { requireAi: true } : undefined
{
nodePlugins: [annualSummaryNodePlugin],
...(ai && { requireAi: true }),
}
)
// CLI-specific routes not yet migrated to @openchatlab/http-routes
+5 -2
View File
@@ -29,7 +29,7 @@ import {
import type { StreamImportDeps, SemanticIndexRuntime } from '@openchatlab/node-runtime'
import { getLoadablePath as getSqliteVecLoadablePath } from 'sqlite-vec'
import multipart from '@fastify/multipart'
import { registerSharedRoutes, registerAutomationRoutes } from '@openchatlab/http-routes'
import { annualSummaryNodePlugin, registerSharedRoutes, registerAutomationRoutes } from '@openchatlab/http-routes'
import { createApiServer } from '@openchatlab/http-routes/server'
import type { HttpRouteContext } from '@openchatlab/http-routes'
import { reloadTimer, stopTimer, type DataSourceManager, type PullEngine } from '@openchatlab/sync'
@@ -206,7 +206,10 @@ export async function startInternalServer(
devOrigin: process.env.ELECTRON_RENDERER_URL || 'http://localhost:13100',
})
registerSharedRoutes(newServer, ctx, { requireAi: true })
registerSharedRoutes(newServer, ctx, {
requireAi: true,
nodePlugins: [annualSummaryNodePlugin],
})
registerAutomationRoutes(newServer, ctx)
await newServer.listen({ port: 0, host: '127.0.0.1' })
+5
View File
@@ -17,6 +17,8 @@ import { handleWebWasmPageHide } from './runtime-lifecycle'
import { WebWasmSessionSync } from './session-sync'
import { useSessionStore } from '@/stores/session'
import { initializeWebWasmLocale } from './locale-bootstrap'
import { installInsightPluginRuntime } from '@/plugins/insight-vue'
import { webWasmInsightRuntime, webWasmUiHost } from '@/plugins/web-wasm'
import '@/assets/styles/main.css'
initializeWebWasmLocale()
@@ -50,6 +52,7 @@ async function start(): Promise<void> {
app.use(router)
app.use(ui)
app.use(i18n)
installInsightPluginRuntime(app, webWasmInsightRuntime)
const sessionStore = useSessionStore(pinia)
let refreshRequested = false
@@ -76,6 +79,8 @@ async function start(): Promise<void> {
handleWebWasmPageHide(event, () => {
unsubscribeSessionSync()
sessionSync.dispose()
webWasmInsightRuntime.disposeAll()
webWasmUiHost.locale.dispose()
runtime.dispose()
})
)
+1
View File
@@ -25,6 +25,7 @@ export const webWasmRoutes: RouteRecordRaw[] = [
path: 'time-investment',
name: 'insight-time-investment',
component: () => import('@/pages/insight/time-investment/index.vue'),
meta: { insightPageId: 'time-investment' },
},
],
},