mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-19 14:16:29 +00:00
refactor(monorepo): decouple api and webui into workspaces packages
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bun
|
||||
import { temporalWorkflow } from './src/workflow/bun-temporal-plugin'
|
||||
import { temporalWorkflow } from './packages/workflow-core/src/bun-temporal-plugin'
|
||||
import { bunPluginPino } from 'bun-plugin-pino'
|
||||
import tailwindPlugin from 'bun-plugin-tailwind'
|
||||
import { existsSync } from 'fs'
|
||||
@@ -16,7 +16,7 @@ if (existsSync(outdir)) {
|
||||
}
|
||||
|
||||
await Bun.build({
|
||||
entrypoints: ['./src/index.ts'],
|
||||
entrypoints: ['./packages/api/src/index.ts'],
|
||||
target: 'bun',
|
||||
outdir: outdir,
|
||||
minify: false,
|
||||
@@ -27,7 +27,7 @@ await Bun.build({
|
||||
if (!config.resolve) config.resolve = {}
|
||||
if (!config.resolve.alias) config.resolve.alias = {}
|
||||
// @ts-ignore
|
||||
config.resolve.alias['@'] = resolve(process.cwd(), 'src')
|
||||
config.resolve.alias['@'] = resolve(process.cwd(), 'packages')
|
||||
return config
|
||||
},
|
||||
},
|
||||
@@ -40,6 +40,15 @@ await Bun.build({
|
||||
'@temporalio/client',
|
||||
'@temporalio/worker',
|
||||
'@temporalio/workflow',
|
||||
'@shumai/core',
|
||||
'@shumai/db',
|
||||
'@shumai/dtos',
|
||||
'@shumai/workflow-core',
|
||||
'@shumai/agent',
|
||||
'@shumai/transcode',
|
||||
'@shumai/worker-db',
|
||||
'@shumai/api',
|
||||
'@shumai/webui',
|
||||
],
|
||||
// compile: {
|
||||
// outfile: 'Shumai',
|
||||
|
||||
@@ -162,6 +162,24 @@
|
||||
"@temporalio/workflow": "^1.16.1",
|
||||
},
|
||||
},
|
||||
"packages/api": {
|
||||
"name": "@shumai/api",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@hono/zod-validator": "^0.7.6",
|
||||
"@shumai/agent": "workspace:*",
|
||||
"@shumai/core": "workspace:*",
|
||||
"@shumai/db": "workspace:*",
|
||||
"@shumai/dtos": "workspace:*",
|
||||
"@shumai/transcode": "workspace:*",
|
||||
"@shumai/worker-db": "workspace:*",
|
||||
"@shumai/workflow-core": "workspace:*",
|
||||
"better-auth": "^1.6.6",
|
||||
"hono": "^4.12.14",
|
||||
"pino": "^10.3.1",
|
||||
"zod": "^4.4.3",
|
||||
},
|
||||
},
|
||||
"packages/core": {
|
||||
"name": "@shumai/core",
|
||||
"version": "0.1.0",
|
||||
@@ -209,6 +227,13 @@
|
||||
"sharp": "^0.34.5",
|
||||
},
|
||||
},
|
||||
"packages/webui": {
|
||||
"name": "@shumai/webui",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@shumai/api": "workspace:*",
|
||||
},
|
||||
},
|
||||
"packages/worker-db": {
|
||||
"name": "@shumai/worker-db",
|
||||
"version": "0.1.0",
|
||||
@@ -1015,6 +1040,8 @@
|
||||
|
||||
"@shumai/agent": ["@shumai/agent@workspace:packages/agent"],
|
||||
|
||||
"@shumai/api": ["@shumai/api@workspace:packages/api"],
|
||||
|
||||
"@shumai/core": ["@shumai/core@workspace:packages/core"],
|
||||
|
||||
"@shumai/db": ["@shumai/db@workspace:packages/db"],
|
||||
@@ -1023,6 +1050,8 @@
|
||||
|
||||
"@shumai/transcode": ["@shumai/transcode@workspace:packages/transcode"],
|
||||
|
||||
"@shumai/webui": ["@shumai/webui@workspace:packages/webui"],
|
||||
|
||||
"@shumai/worker-db": ["@shumai/worker-db@workspace:packages/worker-db"],
|
||||
|
||||
"@shumai/workflow-core": ["@shumai/workflow-core@workspace:packages/workflow-core"],
|
||||
|
||||
+3
-2
@@ -71,9 +71,10 @@ export default tseslint.config(
|
||||
ignores: [
|
||||
'**/dist/**',
|
||||
'**/node_modules/**',
|
||||
'**/src/generated/**',
|
||||
'**/packages/db/src/generated/**',
|
||||
'**/packages/core/src/generated/**',
|
||||
'**/data/**',
|
||||
'**/src/ui/components/ui/**',
|
||||
'**/packages/webui/components/ui/**',
|
||||
],
|
||||
},
|
||||
js.configs.recommended,
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "bun run --hot src/index.ts serve",
|
||||
"dev": "bun run --hot packages/api/src/index.ts serve",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"test": "bun --bun vitest run",
|
||||
@@ -15,7 +15,7 @@
|
||||
"db:migrate": "bun run prisma migrate dev",
|
||||
"db:deploy": "bun run prisma migrate deploy",
|
||||
"generate-providers": "bun run scripts/generate-builtin-providers.ts",
|
||||
"worker": "bun src/index.ts worker",
|
||||
"worker": "bun packages/api/src/index.ts worker",
|
||||
"build": "bun run build.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createAgentSession, fieldsToTypeBoxSchema, type AutofillField } from '../index'
|
||||
import { DatabaseSessionStorage } from '../database-session-storage'
|
||||
import type { Prisma, Skill } from '@shumai/db'
|
||||
import { logger } from '@/logger'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { type AgentTool } from '@earendil-works/pi-agent-core'
|
||||
import { type ImageContent } from '@earendil-works/pi-ai'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { Type } from '@sinclair/typebox'
|
||||
import { type AgentTool } from '@earendil-works/pi-agent-core'
|
||||
import { type ImageContent, type TextContent } from '@earendil-works/pi-ai'
|
||||
import { detectSupportedMimeType } from '@/utils/mime'
|
||||
import { detectSupportedMimeType } from '@shumai/core/src/utils/mime'
|
||||
|
||||
const analyzeAssetMediaSchema = Type.Object({
|
||||
key: Type.String({
|
||||
|
||||
@@ -4,7 +4,7 @@ import { executeAgentToolWorkflow } from './utils'
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { detectSupportedMimeType } from '@/utils/mime'
|
||||
import { detectSupportedMimeType } from '@shumai/core/src/utils/mime'
|
||||
import { ulid } from 'ulid'
|
||||
|
||||
function getMimeType(filePath: string): string {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { executeAgentToolWorkflow } from './utils'
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { detectSupportedMimeType } from '@/utils/mime'
|
||||
import { detectSupportedMimeType } from '@shumai/core/src/utils/mime'
|
||||
import { ulid } from 'ulid'
|
||||
|
||||
function getMimeType(filePath: string): string {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logger'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
import { SandboxManager } from '@anthropic-ai/sandbox-runtime'
|
||||
import { type AgentTool, type AgentToolResult } from '@earendil-works/pi-agent-core'
|
||||
import { Type } from '@sinclair/typebox'
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "@shumai/api",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"dependencies": {
|
||||
"@shumai/core": "workspace:*",
|
||||
"@shumai/db": "workspace:*",
|
||||
"@shumai/dtos": "workspace:*",
|
||||
"@shumai/workflow-core": "workspace:*",
|
||||
"@shumai/agent": "workspace:*",
|
||||
"@shumai/transcode": "workspace:*",
|
||||
"@shumai/worker-db": "workspace:*",
|
||||
"hono": "^4.12.14",
|
||||
"@hono/zod-validator": "^0.7.6",
|
||||
"zod": "^4.4.3",
|
||||
"better-auth": "^1.6.6",
|
||||
"pino": "^10.3.1"
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@ import { Hono } from 'hono'
|
||||
import attachmentRoute from './attachment'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { AssetType } from '@shumai/db'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// any is used here because Hono's Context and Next types are complex to mock in vitest.mock
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
authMiddleware: async (c: any, next: any) => {
|
||||
@@ -4,7 +4,7 @@ import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/a
|
||||
import { Hono, Context, Next } from 'hono'
|
||||
import collectionRoute from './collection'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
authMiddleware: async (c: Context, next: Next) => {
|
||||
c.set('user', { id: 'user-1', name: 'Test User' })
|
||||
await next()
|
||||
@@ -6,7 +6,7 @@ import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { metadataService } from '@shumai/core/src/metadata/metadata'
|
||||
import { notificationService } from '@shumai/core/src/notification/notification'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { authzService, ResourceType, Permission } from '@shumai/core/src/authz/authz'
|
||||
|
||||
vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
@@ -24,7 +24,7 @@ vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
authMiddleware: async (c: Context, next: Next) => {
|
||||
c.set('user', { id: 'user1', name: 'Test User' })
|
||||
await next()
|
||||
@@ -4,7 +4,7 @@ import folderRoute from './folder'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { searchService } from '@shumai/core/src/search/search'
|
||||
import { authzService, ResourceType, Permission } from '@shumai/core/src/authz/authz'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
|
||||
vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
authzService: {
|
||||
@@ -20,7 +20,7 @@ vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
authMiddleware: async (c: any, next: any) => {
|
||||
c.set('user', { id: 'user1', name: 'Test User' })
|
||||
@@ -10,7 +10,7 @@ vi.mock('@shumai/core/src/invite/invite')
|
||||
vi.mock('@shumai/core/src/notification/notification')
|
||||
vi.mock('@shumai/core/src/authz/authz')
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
authMiddleware: async (
|
||||
c: Context<{ Variables: { user: { id: string; name: string } } }>,
|
||||
next: Next,
|
||||
@@ -4,7 +4,7 @@ import metadataRoute from './metadata'
|
||||
import { metadataService } from '@shumai/core/src/metadata/metadata'
|
||||
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
authMiddleware: async (
|
||||
c: Context<{ Variables: { user: { id: string; name: string } } }>,
|
||||
next: Next,
|
||||
@@ -5,7 +5,7 @@ import { notificationService } from '@shumai/core/src/notification/notification'
|
||||
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
|
||||
import { userMetadataService } from '@shumai/core/src/user-metadata/user-metadata'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
authMiddleware: async (
|
||||
c: Context<{ Variables: { user: { id: string; name: string } } }>,
|
||||
next: Next,
|
||||
@@ -5,7 +5,7 @@ import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/a
|
||||
import { projectService } from '@shumai/core/src/project/project'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
authMiddleware: async (
|
||||
c: Context<{ Variables: { user: { id: string; name: string } } }>,
|
||||
next: Next,
|
||||
@@ -4,7 +4,7 @@ import providerRoute from './provider'
|
||||
import { providerService } from '@shumai/core/src/provider/provider'
|
||||
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
authMiddleware: async (
|
||||
c: Context<{ Variables: { user: { id: string; name: string } } }>,
|
||||
next: Next,
|
||||
@@ -2,12 +2,12 @@ import { describe, expect, test, vi, beforeEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import shareRoute from './share'
|
||||
import publicShareRoute from './public-share'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { shareService } from '@shumai/core/src/share/share'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
authMiddleware: async (c: any, next: any) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -2,10 +2,10 @@ import { describe, expect, test, vi, beforeEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import skillRoute from './skill'
|
||||
import { skillService } from '@shumai/core/src/skill/skill'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { authzService, ResourceType, Permission } from '@shumai/core/src/authz/authz'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
authMiddleware: async (c: any, next: any) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import teamRoute from './team'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { teamService } from '@shumai/core/src/team/team'
|
||||
import { userMetadataService } from '@shumai/core/src/user-metadata/user-metadata'
|
||||
import { notificationService } from '@shumai/core/src/notification/notification'
|
||||
@@ -21,7 +21,7 @@ vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
authMiddleware: async (c: any, next: any) => {
|
||||
c.set('user', { id: 'user1', name: 'Test User' })
|
||||
@@ -1,13 +1,13 @@
|
||||
import { describe, expect, it, vi, beforeEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import uploadRoute from './upload'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { uploadService } from '@shumai/core/src/upload/upload'
|
||||
import type { CreateUploadTaskResponse, TaskInfo } from '@shumai/dtos'
|
||||
import type { PaginatedData } from '@shumai/core/src/pagination'
|
||||
import { authzService, ResourceType, Permission } from '@shumai/core/src/authz/authz'
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// We use any here because mocking Hono context and middleware
|
||||
// with full type safety is overly complex for these unit tests.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import versionStackRoute from './versionStack'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { versionStackService } from '@shumai/core/src/versionStack/versionStack'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { authzService, ResourceType, Permission } from '@shumai/core/src/authz/authz'
|
||||
@@ -21,7 +21,7 @@ vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@/api/middleware/auth', () => ({
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
authMiddleware: async (c: any, next: any) => {
|
||||
c.set('user', { id: 'user1', name: 'Test User' })
|
||||
@@ -1,17 +1,17 @@
|
||||
import { loadEnvConfig } from './env-loader'
|
||||
import { loadEnvConfig } from '@shumai/core/src/env-loader'
|
||||
loadEnvConfig(process.cwd(), process.env.NODE_ENV !== 'production')
|
||||
|
||||
const command = process.argv[2]
|
||||
|
||||
if (command === 'worker') {
|
||||
const { run } = await import('./cli/worker')
|
||||
const { run } = await import('./worker')
|
||||
run().catch((err) => {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
})
|
||||
} else {
|
||||
// Default or 'serve' command
|
||||
const { run } = await import('./cli/serve')
|
||||
const { run } = await import('./serve')
|
||||
run().catch((err) => {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
@@ -19,4 +19,4 @@ if (command === 'worker') {
|
||||
}
|
||||
|
||||
// Re-export AppType for frontend client.ts usage (type-only)
|
||||
export type { AppType } from './cli/serve'
|
||||
export type { AppType } from './serve'
|
||||
@@ -1,27 +1,27 @@
|
||||
import index from '@/ui/index.html'
|
||||
import index from '../../webui/index.html'
|
||||
|
||||
import type { Prisma } from '@shumai/db'
|
||||
import { Hono } from 'hono'
|
||||
import agentRoute from '@/api/agent'
|
||||
import attachmentRoute from '@/api/attachment'
|
||||
import authnRoute from '@/api/authn'
|
||||
import collectionRoute from '@/api/collection'
|
||||
import fileRoute from '@/api/file'
|
||||
import folderRoute from '@/api/folder'
|
||||
import inviteRoute from '@/api/invite'
|
||||
import metadataRoute from '@/api/metadata'
|
||||
import { authMiddleware } from '@/api/middleware/auth'
|
||||
import notificationRoute from '@/api/notification'
|
||||
import projectRoute from '@/api/project'
|
||||
import providerRoute from '@/api/provider'
|
||||
import publicInviteRoute from '@/api/public-invite'
|
||||
import publicShareRoute from '@/api/public-share'
|
||||
import s3Route from '@/api/s3'
|
||||
import shareRoute from '@/api/share'
|
||||
import skillRoute from '@/api/skill'
|
||||
import teamRoute from '@/api/team'
|
||||
import uploadRoute from '@/api/upload'
|
||||
import versionStackRoute from '@/api/versionStack'
|
||||
import agentRoute from './api/agent'
|
||||
import attachmentRoute from './api/attachment'
|
||||
import authnRoute from './api/authn'
|
||||
import collectionRoute from './api/collection'
|
||||
import fileRoute from './api/file'
|
||||
import folderRoute from './api/folder'
|
||||
import inviteRoute from './api/invite'
|
||||
import metadataRoute from './api/metadata'
|
||||
import { authMiddleware } from './api/middleware/auth'
|
||||
import notificationRoute from './api/notification'
|
||||
import projectRoute from './api/project'
|
||||
import providerRoute from './api/provider'
|
||||
import publicInviteRoute from './api/public-invite'
|
||||
import publicShareRoute from './api/public-share'
|
||||
import s3Route from './api/s3'
|
||||
import shareRoute from './api/share'
|
||||
import skillRoute from './api/skill'
|
||||
import teamRoute from './api/team'
|
||||
import uploadRoute from './api/upload'
|
||||
import versionStackRoute from './api/versionStack'
|
||||
import { metadataService } from '@shumai/core/src/metadata/metadata'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { workflowService } from '@shumai/workflow-core'
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0"
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
AssetUserInfo,
|
||||
} from '@shumai/dtos'
|
||||
import { type Asset, AssetStatus, AssetType, Prisma, type StorageKey } from '@shumai/db'
|
||||
import { logger } from '@/logger'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
import { PaginatedData, paginateQuery, PaginationParams } from '@shumai/core/src/pagination'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { generateKeyBetween } from 'jittered-fractional-indexing'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ import { teamService } from '@shumai/core/src/team/team'
|
||||
import { providerService } from './provider'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { ProviderConfigSerializable, providerModelSchema } from '@shumai/dtos'
|
||||
import { builtinProviders } from '@/generated/providers.generated'
|
||||
import { builtinProviders } from '@shumai/core/src/generated/providers.generated'
|
||||
import { z } from 'zod'
|
||||
|
||||
type ProviderModel = z.infer<typeof providerModelSchema>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { prisma } from '@shumai/db'
|
||||
import { ProviderConfigSerializable, providerModelSchema } from '@shumai/dtos'
|
||||
import { builtinProviders } from '@/generated/providers.generated'
|
||||
import { builtinProviders } from '@shumai/core/src/generated/providers.generated'
|
||||
import { z } from 'zod'
|
||||
|
||||
type ProviderModel = z.infer<typeof providerModelSchema>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AssetService, assetService } from '@shumai/core/src/asset/asset'
|
||||
import { AssetInfo } from '@shumai/dtos'
|
||||
import { SearchRequest } from '@shumai/dtos'
|
||||
import { PaginatedData, decodeCursor, encodeCursor, PageInfo } from '@shumai/core/src/pagination'
|
||||
import { generateSearchNgrams } from '@/utils/ngram'
|
||||
import { generateSearchNgrams } from '@shumai/core/src/utils/ngram'
|
||||
import { workflowService } from '@shumai/workflow-core'
|
||||
import { HTTPException } from 'hono/http-exception'
|
||||
import { SqlQueryBuilder } from './sql-query-builder'
|
||||
|
||||
@@ -4,7 +4,7 @@ import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import AdmZip from 'adm-zip'
|
||||
import * as crypto from 'crypto'
|
||||
import { ulid } from 'ulid'
|
||||
import { parseFrontmatter } from '@/utils/frontmatter'
|
||||
import { parseFrontmatter } from '@shumai/core/src/utils/frontmatter'
|
||||
|
||||
interface SkillFrontmatter extends Record<string, unknown> {
|
||||
name?: string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { hc } from 'hono/client'
|
||||
import type { AppType } from '@/index'
|
||||
import type { AppType } from '@shumai/api'
|
||||
import { useAuthStore } from '@/ui/stores/auth'
|
||||
|
||||
const customFetch = async (input: RequestInfo | URL, init?: RequestInit) => {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user