mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 12:08:25 +00:00
feat(agent): add nested agents.md support across backend and webui (#309)
* feat(agent): add nested agents.md support across backend and webui * fix(webui): update agentsmd route paths and unnest folder agentsmd route * fix(agent): flush agents.md autosave on close and address review feedback - Flush pending debounced AGENTS.md autosave on close/unmount so edits made within 750ms of navigating away are no longer silently lost - Serialize autosaves through a promise chain so an older in-flight request can never overwrite newer content on the server - Internationalize the hardcoded "Failed to save" and "Loading AGENTS.md..." strings (en + zh) - Validate that AGENTS.md is only stored on folder/root assets in AssetService, preventing bogus virtual paths for file assets - Cap updateAgentsMd content at 100k chars via Zod validation - Remove unused getAgentsMd/updateAgentsMd response DTO schemas - Drop unused teamId prop from AgentsMdEditor - Add tests: non-folder asset rejection, oversized content 400, and agent-chat workflow assetId passthrough * refactor(db): isolate AGENTS.md content in dedicated 1:1 AssetAgentMd table * style(webui): unify top bar button hover styles and add wand icon to agentsmd button * style(webui): update agentsmd button state colors and remove presence dot * fix(webui): fix close button overflow and stabilize debounced autosave in agentsmd editor * fix(webui): update debounce to 1s and await pending save before closing agentsmd editor * feat(webui): add terminal AGENTS.md breadcrumb on agentsmd editor page * fix(webui): use ScrollArea for markdown editor scrolling
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
generateSessionNameActivity,
|
||||
type GenerateSessionNameParams,
|
||||
getUserTeamInfoActivity,
|
||||
formatProjectContextPrompt,
|
||||
} from './agent'
|
||||
import * as piAgent from '../index'
|
||||
import { type AgentHarness, type Session } from '@earendil-works/pi-agent-core'
|
||||
@@ -2041,4 +2042,113 @@ describe('Agent Database Activities Integration', () => {
|
||||
expect(piAgent.createAgentSession).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe('Nested AGENTS.md prompt injection', () => {
|
||||
it('formatProjectContextPrompt formats context files into XML project_context block', () => {
|
||||
expect(formatProjectContextPrompt([])).toBe('')
|
||||
|
||||
const formatted = formatProjectContextPrompt([
|
||||
{ path: '/AGENTS.md', content: 'Root rules' },
|
||||
{ path: '/subfolder/AGENTS.md', content: 'Subfolder rules' },
|
||||
])
|
||||
|
||||
expect(formatted).toBe(
|
||||
'\n\n<project_context>\n\nProject-specific instructions and guidelines:\n\n<project_instructions path="/AGENTS.md">\nRoot rules\n</project_instructions>\n\n<project_instructions path="/subfolder/AGENTS.md">\nSubfolder rules\n</project_instructions>\n\n</project_context>',
|
||||
)
|
||||
})
|
||||
|
||||
it('agentChatActivity injects nested AGENTS.md instructions into systemPrompt', async () => {
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'User_Chat_Md', email: `chat-md-${Date.now()}@example.com` },
|
||||
})
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'Team_Chat_Md_' + Date.now() },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Project_Chat_Md', teamId: team.id },
|
||||
})
|
||||
const rootFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'Root',
|
||||
type: AssetType.root,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
await prisma.assetAgentMd.create({
|
||||
data: {
|
||||
assetId: rootFolder.id,
|
||||
content: '# Root Policy',
|
||||
},
|
||||
})
|
||||
const subfolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'subfolder',
|
||||
type: AssetType.folder,
|
||||
parentId: rootFolder.id,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
await prisma.assetAgentMd.create({
|
||||
data: {
|
||||
assetId: subfolder.id,
|
||||
content: '# Subfolder Policy',
|
||||
},
|
||||
})
|
||||
|
||||
const mockHarness = {
|
||||
subscribe: vi.fn(),
|
||||
prompt: vi.fn().mockResolvedValue({
|
||||
content: [{ type: 'text', text: 'Chat reply' }],
|
||||
usage: { input: 10, output: 20 },
|
||||
}),
|
||||
}
|
||||
const mockSession = {
|
||||
getEntries: vi.fn().mockResolvedValue([]),
|
||||
getStorage: vi.fn().mockReturnValue({ sessionId: 'mock-session-id' }),
|
||||
}
|
||||
|
||||
vi.mocked(piAgent.createAgentSession).mockResolvedValue({
|
||||
session: mockSession as unknown as Session<DatabaseSessionMetadata>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Mock AgentHarness instance for activity test
|
||||
harness: mockHarness as unknown as AgentHarness<any, any, any, any>,
|
||||
})
|
||||
|
||||
const context = {
|
||||
agent: { id: 'agent-1', provider: { name: 'google' }, modelRef: { modelId: 'gemini' } },
|
||||
dbProviders: [],
|
||||
teamSkills: [],
|
||||
allowedDomains: [],
|
||||
} as unknown as AgentExecutionContext
|
||||
|
||||
await agentChatActivity({
|
||||
teamId: team.id,
|
||||
agentId: 'agent-1',
|
||||
message: 'Hello',
|
||||
imageUrls: [],
|
||||
projectId: project.id,
|
||||
folderId: subfolder.id,
|
||||
assetId: subfolder.id,
|
||||
sessionId: 'mock-session-id',
|
||||
userId: user.id,
|
||||
context,
|
||||
})
|
||||
|
||||
expect(piAgent.createAgentSession).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
systemPrompt: expect.stringContaining('<project_context>'),
|
||||
}),
|
||||
)
|
||||
|
||||
const lastCall = vi.mocked(piAgent.createAgentSession).mock.calls.at(-1)
|
||||
const systemPromptArg = lastCall?.[0].systemPrompt as string
|
||||
expect(systemPromptArg).toContain(
|
||||
'<project_instructions path="/AGENTS.md">\n# Root Policy\n</project_instructions>',
|
||||
)
|
||||
expect(systemPromptArg).toContain(
|
||||
'<project_instructions path="/subfolder/AGENTS.md">\n# Subfolder Policy\n</project_instructions>',
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -65,6 +65,18 @@ export interface AgentExecutionContext {
|
||||
allowedDomains: string[]
|
||||
}
|
||||
|
||||
export function formatProjectContextPrompt(
|
||||
contextFiles: Array<{ path: string; content: string }>,
|
||||
): string {
|
||||
if (contextFiles.length === 0) return ''
|
||||
let prompt = '\n\n<project_context>\n\nProject-specific instructions and guidelines:\n\n'
|
||||
for (const { path: filePath, content } of contextFiles) {
|
||||
prompt += `<project_instructions path="${filePath}">\n${content}\n</project_instructions>\n\n`
|
||||
}
|
||||
prompt += '</project_context>'
|
||||
return prompt
|
||||
}
|
||||
|
||||
async function executeAgentPrompt(params: {
|
||||
taskId?: string
|
||||
teamId: string
|
||||
@@ -75,6 +87,7 @@ async function executeAgentPrompt(params: {
|
||||
sessionId?: string
|
||||
userId?: string
|
||||
projectId?: string
|
||||
assetId?: string
|
||||
userCommentId?: string | null
|
||||
tools?: AgentTool[]
|
||||
context: AgentExecutionContext
|
||||
@@ -114,6 +127,40 @@ When creating a file or version, you may attach metadata (for example, the AI mo
|
||||
// Note: params.agentsInstruction is no longer appended to systemPrompt here.
|
||||
// Instead, it is persisted as a custom message session entry in the conversation history below.
|
||||
|
||||
let targetAssetId = params.assetId
|
||||
if (!targetAssetId) {
|
||||
if (params.userCommentId) {
|
||||
const comment = await prisma.assetComment.findUnique({
|
||||
where: { id: params.userCommentId },
|
||||
select: { assetId: true },
|
||||
})
|
||||
if (comment?.assetId) {
|
||||
targetAssetId = comment.assetId
|
||||
}
|
||||
} else if (params.taskId) {
|
||||
const task = await prisma.workflowTask.findUnique({
|
||||
where: { id: params.taskId },
|
||||
select: { assetId: true },
|
||||
})
|
||||
if (task?.assetId) {
|
||||
targetAssetId = task.assetId
|
||||
}
|
||||
} else if (params.projectId) {
|
||||
const project = await prisma.project.findUnique({
|
||||
where: { id: params.projectId },
|
||||
select: { rootFolderId: true },
|
||||
})
|
||||
if (project?.rootFolderId) {
|
||||
targetAssetId = project.rootFolderId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const contextFiles = targetAssetId ? await assetService.getNestedAgentsMd(targetAssetId) : []
|
||||
if (contextFiles.length > 0) {
|
||||
systemPrompt += formatProjectContextPrompt(contextFiles)
|
||||
}
|
||||
|
||||
const modelConfig = agent.modelRef?.config
|
||||
if (modelConfig?.input) {
|
||||
systemPrompt += `\n\nYour current model supports the following input types: ${modelConfig.input.join(', ')}.`
|
||||
@@ -349,6 +396,7 @@ export interface AgentChatParams {
|
||||
imageUrls: string[]
|
||||
projectId: string
|
||||
folderId: string
|
||||
assetId?: string
|
||||
agentsInstruction?: string
|
||||
sessionId: string
|
||||
userId?: string
|
||||
@@ -414,6 +462,7 @@ export async function agentChatActivity(params: AgentChatParams) {
|
||||
sessionId,
|
||||
userId: params.userId,
|
||||
projectId: params.projectId,
|
||||
assetId: params.assetId || params.folderId,
|
||||
userCommentId: params.userCommentId,
|
||||
context: params.context,
|
||||
attachedAssets: params.attachedAssets,
|
||||
@@ -425,6 +474,8 @@ export interface AutofillAiParams {
|
||||
images: string[]
|
||||
fields: AutofillField[]
|
||||
context: AgentExecutionContext
|
||||
assetId?: string
|
||||
projectId?: string
|
||||
}
|
||||
|
||||
export async function autofillAiActivity(params: AutofillAiParams) {
|
||||
@@ -458,6 +509,8 @@ export async function autofillAiActivity(params: AutofillAiParams) {
|
||||
agentsInstruction: '',
|
||||
sessionId: undefined,
|
||||
userId: undefined,
|
||||
projectId: params.projectId,
|
||||
assetId: params.assetId,
|
||||
tools: [autofillTool],
|
||||
context: params.context,
|
||||
})
|
||||
|
||||
@@ -64,6 +64,7 @@ describe('Agent Autofill Workflow', () => {
|
||||
mockActivities.createCommentActivity.mockResolvedValue({ id: 'comment-placeholder-id' })
|
||||
mockActivities.getAssetActivity.mockResolvedValue({
|
||||
id: 'a1',
|
||||
projectId: 'p1',
|
||||
storageKey: { key: 'asset-key' },
|
||||
project: { id: 'p1', teamId: 't1' },
|
||||
mediaType: 'image/png',
|
||||
@@ -117,6 +118,9 @@ describe('Agent Autofill Workflow', () => {
|
||||
status: 'processing',
|
||||
})
|
||||
|
||||
// Verify asset fetched
|
||||
expect(mockActivities.getAssetActivity).toHaveBeenCalledWith('a1')
|
||||
|
||||
// Verify placeholder comment created
|
||||
expect(mockActivities.createCommentActivity).toHaveBeenCalledWith({
|
||||
assetId: 'a1',
|
||||
@@ -143,6 +147,8 @@ describe('Agent Autofill Workflow', () => {
|
||||
// Verify AI autofill called with mapped fields
|
||||
expect(mockActivities.autofillAiActivity).toHaveBeenCalledWith({
|
||||
teamId: 't1',
|
||||
assetId: 'a1',
|
||||
projectId: 'p1',
|
||||
images: ['/tmp/test-dir/1.webp'],
|
||||
fields: [
|
||||
{
|
||||
|
||||
@@ -135,6 +135,8 @@ export async function agentAutofillMedia(task: WorkflowTask): Promise<void> {
|
||||
const aiResult = await executeActivity(agentWorkerQueue, autofillAiActivity, {
|
||||
teamId,
|
||||
images: generatedFiles,
|
||||
assetId: asset.id,
|
||||
projectId: asset.projectId ?? undefined,
|
||||
fields: fields.map(
|
||||
(f: { key: string; config: Record<string, unknown>; description?: string | null }) => ({
|
||||
id: f.key,
|
||||
|
||||
@@ -150,6 +150,7 @@ describe('Agent Chat Workflow', () => {
|
||||
agentsInstruction: expectedInstruction1,
|
||||
sessionId: 'session-123',
|
||||
folderId: 'parent-folder-id',
|
||||
assetId: 'a1',
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
@@ -202,6 +202,7 @@ export async function agentChat(task: WorkflowTask): Promise<void> {
|
||||
imageUrls: attachmentImageUrls,
|
||||
projectId: payload.projectId,
|
||||
folderId,
|
||||
assetId: asset.id,
|
||||
agentsInstruction: instruction,
|
||||
sessionId,
|
||||
userId: payload.agent?.userId,
|
||||
|
||||
@@ -310,4 +310,59 @@ describe('folder api', () => {
|
||||
beforeIndex: 'index-1',
|
||||
})
|
||||
})
|
||||
|
||||
it('GET /folders/:folderId/agentsmd', async () => {
|
||||
vi.spyOn(assetService, 'getAgentsMd').mockResolvedValue('# Folder Guidelines')
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', folderRoute)
|
||||
const res = await app.request('/folders/test-id/agentsmd')
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const json = await res.json()
|
||||
expect(json.content).toBe('# Folder Guidelines')
|
||||
|
||||
expect(authzService.hasPermission).toHaveBeenCalledWith({
|
||||
user: { id: 'user1', name: 'Test User' },
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Asset,
|
||||
id: 'test-id',
|
||||
})
|
||||
expect(assetService.getAgentsMd).toHaveBeenCalledWith('test-id')
|
||||
})
|
||||
|
||||
it('PATCH /folders/:folderId/agentsmd', async () => {
|
||||
vi.spyOn(assetService, 'updateAgentsMd').mockResolvedValue({ content: '# Updated Guidelines' })
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', folderRoute)
|
||||
const res = await app.request('/folders/test-id/agentsmd', {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ content: '# Updated Guidelines' }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const json = await res.json()
|
||||
expect(json.content).toBe('# Updated Guidelines')
|
||||
|
||||
expect(authzService.hasPermission).toHaveBeenCalledWith({
|
||||
user: { id: 'user1', name: 'Test User' },
|
||||
permission: Permission.Admin,
|
||||
type: ResourceType.Asset,
|
||||
id: 'test-id',
|
||||
})
|
||||
expect(assetService.updateAgentsMd).toHaveBeenCalledWith('test-id', '# Updated Guidelines')
|
||||
})
|
||||
|
||||
it('PATCH /folders/:folderId/agentsmd rejects oversized content', async () => {
|
||||
const mockUpdate = vi.spyOn(assetService, 'updateAgentsMd').mockResolvedValue({ content: '' })
|
||||
const app = new Hono().use('*', authMiddleware).route('/', folderRoute)
|
||||
const res = await app.request('/folders/test-id/agentsmd', {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ content: 'x'.repeat(100_001) }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(400)
|
||||
expect(mockUpdate).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
updateFolderRequestSchema,
|
||||
deleteFoldersRequestSchema,
|
||||
restoreFoldersRequestSchema,
|
||||
updateAgentsMdRequestSchema,
|
||||
} from '@shumai/dtos'
|
||||
import { listChildrenRequestSchema, updateAssetOrderRequestSchema, AuditAction } from '@shumai/dtos'
|
||||
import { searchRequestSchema } from '@shumai/dtos'
|
||||
@@ -189,5 +190,48 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
const result = await searchService.search(folderId, req)
|
||||
return c.json(result)
|
||||
})
|
||||
.get('/folders/:folderId/agentsmd', async (c) => {
|
||||
const folderId = c.req.param('folderId')
|
||||
const user = c.get('user')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Asset,
|
||||
id: folderId,
|
||||
})
|
||||
|
||||
const content = await assetService.getAgentsMd(folderId)
|
||||
return c.json({ content })
|
||||
})
|
||||
.patch(
|
||||
'/folders/:folderId/agentsmd',
|
||||
zValidator('json', updateAgentsMdRequestSchema),
|
||||
async (c) => {
|
||||
const folderId = c.req.param('folderId')
|
||||
const user = c.get('user')
|
||||
const req = c.req.valid('json')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Admin,
|
||||
type: ResourceType.Asset,
|
||||
id: folderId,
|
||||
})
|
||||
|
||||
const res = await assetService.updateAgentsMd(folderId, req.content)
|
||||
|
||||
const ctx = await assetService.getAssetContext(folderId)
|
||||
await auditLogService.logAction({
|
||||
action: AuditAction.folder_update,
|
||||
teamId: ctx.teamId,
|
||||
userId: user.id,
|
||||
projectId: ctx.projectId,
|
||||
itemId: folderId,
|
||||
})
|
||||
|
||||
return c.json(res)
|
||||
},
|
||||
)
|
||||
|
||||
export default route
|
||||
|
||||
@@ -2830,4 +2830,204 @@ describe('AssetService — natural sort by name', () => {
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('AGENTS.md methods', () => {
|
||||
it('getAgentsMd returns null when no agentmd is set', async () => {
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'Team_AgentsMd_' + Date.now() },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Project_AgentsMd', teamId: team.id },
|
||||
})
|
||||
const folder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'Folder_No_Md',
|
||||
type: AssetType.folder,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
const content = await assetService.getAgentsMd(folder.id)
|
||||
expect(content).toBeNull()
|
||||
})
|
||||
|
||||
it('updateAgentsMd updates and getAgentsMd retrieves agentmd, and empty deletes', async () => {
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'Team_AgentsMd2_' + Date.now() },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Project_AgentsMd2', teamId: team.id },
|
||||
})
|
||||
const folder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'Folder_With_Md',
|
||||
type: AssetType.folder,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
const updateResult = await assetService.updateAgentsMd(folder.id, '# Custom Guidelines')
|
||||
expect(updateResult).toEqual({ content: '# Custom Guidelines' })
|
||||
|
||||
const content = await assetService.getAgentsMd(folder.id)
|
||||
expect(content).toBe('# Custom Guidelines')
|
||||
|
||||
let folderInfo = await assetService.getAsset({ assetId: folder.id })
|
||||
expect(folderInfo?.hasAgentsMd).toBe(true)
|
||||
|
||||
// Empty string deletes the record
|
||||
const clearResult = await assetService.updateAgentsMd(folder.id, ' ')
|
||||
expect(clearResult).toEqual({ content: '' })
|
||||
|
||||
const emptyContent = await assetService.getAgentsMd(folder.id)
|
||||
expect(emptyContent).toBeNull()
|
||||
|
||||
folderInfo = await assetService.getAsset({ assetId: folder.id })
|
||||
expect(folderInfo?.hasAgentsMd).toBe(false)
|
||||
})
|
||||
|
||||
it('getNestedAgentsMd traverses hierarchy from root to leaf and formats virtual paths', async () => {
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'Team_NestedMd_' + Date.now() },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Project_NestedMd', teamId: team.id },
|
||||
})
|
||||
|
||||
// 1. Root folder
|
||||
const rootFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'Root Folder',
|
||||
type: AssetType.root,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
await prisma.assetAgentMd.create({
|
||||
data: {
|
||||
assetId: rootFolder.id,
|
||||
content: '# Root Instructions\nFollow global rules.',
|
||||
},
|
||||
})
|
||||
|
||||
// 2. Subfolder 1: marketing (has agentmd)
|
||||
const marketingFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'marketing',
|
||||
type: AssetType.folder,
|
||||
parentId: rootFolder.id,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
await prisma.assetAgentMd.create({
|
||||
data: {
|
||||
assetId: marketingFolder.id,
|
||||
content: '# Marketing Instructions\nTone must be upbeat.',
|
||||
},
|
||||
})
|
||||
|
||||
// 3. Subfolder 2: campaigns (no agentmd)
|
||||
const campaignsFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'campaigns',
|
||||
type: AssetType.folder,
|
||||
parentId: marketingFolder.id,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
// 4. Subfolder 3: video-ads (has agentmd)
|
||||
const videoAdsFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'video-ads',
|
||||
type: AssetType.folder,
|
||||
parentId: campaignsFolder.id,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
await prisma.assetAgentMd.create({
|
||||
data: {
|
||||
assetId: videoAdsFolder.id,
|
||||
content: '# Video Ads Instructions\nInclude resolution tags.',
|
||||
},
|
||||
})
|
||||
|
||||
// 5. File inside video-ads
|
||||
const fileAsset = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'ad_clip.mp4',
|
||||
type: AssetType.file,
|
||||
parentId: videoAdsFolder.id,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
const nestedFromLeaf = await assetService.getNestedAgentsMd(fileAsset.id)
|
||||
expect(nestedFromLeaf).toEqual([
|
||||
{
|
||||
path: '/AGENTS.md',
|
||||
content: '# Root Instructions\nFollow global rules.',
|
||||
},
|
||||
{
|
||||
path: '/marketing/AGENTS.md',
|
||||
content: '# Marketing Instructions\nTone must be upbeat.',
|
||||
},
|
||||
{
|
||||
path: '/marketing/campaigns/video-ads/AGENTS.md',
|
||||
content: '# Video Ads Instructions\nInclude resolution tags.',
|
||||
},
|
||||
])
|
||||
|
||||
const nestedFromMarketing = await assetService.getNestedAgentsMd(marketingFolder.id)
|
||||
expect(nestedFromMarketing).toEqual([
|
||||
{
|
||||
path: '/AGENTS.md',
|
||||
content: '# Root Instructions\nFollow global rules.',
|
||||
},
|
||||
{
|
||||
path: '/marketing/AGENTS.md',
|
||||
content: '# Marketing Instructions\nTone must be upbeat.',
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
it('rejects get/update agentsmd on non-folder assets', async () => {
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'Team_AgentsMd_Type_' + Date.now() },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Project_AgentsMd_Type', teamId: team.id },
|
||||
})
|
||||
const rootFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'Root',
|
||||
type: AssetType.root,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
const fileAsset = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'doc.pdf',
|
||||
type: AssetType.file,
|
||||
parentId: rootFolder.id,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
await expect(assetService.getAgentsMd(fileAsset.id)).rejects.toThrow(
|
||||
'AGENTS.md can only be stored on folders',
|
||||
)
|
||||
await expect(assetService.updateAgentsMd(fileAsset.id, '# Nope')).rejects.toThrow(
|
||||
'AGENTS.md can only be stored on folders',
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1592,6 +1592,15 @@ export class AssetService {
|
||||
}
|
||||
}
|
||||
|
||||
const agentMdRecords =
|
||||
assets.length > 0
|
||||
? await this.prismaClient.assetAgentMd.findMany({
|
||||
where: { assetId: { in: assets.map((a) => a.id) } },
|
||||
select: { assetId: true },
|
||||
})
|
||||
: []
|
||||
const hasAgentMdSet = new Set(agentMdRecords.map((r) => r.assetId))
|
||||
|
||||
const result: AssetInfo[] = []
|
||||
for (const a of assets) {
|
||||
let latestVersion:
|
||||
@@ -1753,6 +1762,7 @@ export class AssetService {
|
||||
creator,
|
||||
fieldValues,
|
||||
sortIndex: a.sortIndex,
|
||||
hasAgentsMd: hasAgentMdSet.has(a.id),
|
||||
media: media as unknown as AssetInfo['media'],
|
||||
versionStack,
|
||||
})
|
||||
@@ -2164,6 +2174,108 @@ export class AssetService {
|
||||
completionLastChangedBy,
|
||||
}
|
||||
}
|
||||
|
||||
async getAgentsMd(assetId: string): Promise<string | null> {
|
||||
const asset = await this.prismaClient.asset.findUnique({
|
||||
where: { id: assetId },
|
||||
select: { type: true },
|
||||
})
|
||||
if (!asset) throw new Error('Asset not found')
|
||||
if (asset.type !== AssetType.folder && asset.type !== AssetType.root) {
|
||||
throw new Error('AGENTS.md can only be stored on folders')
|
||||
}
|
||||
const record = await this.prismaClient.assetAgentMd.findUnique({
|
||||
where: { assetId },
|
||||
select: { content: true },
|
||||
})
|
||||
return record?.content ?? null
|
||||
}
|
||||
|
||||
async updateAgentsMd(assetId: string, content: string): Promise<{ content: string }> {
|
||||
const asset = await this.prismaClient.asset.findUnique({
|
||||
where: { id: assetId },
|
||||
select: { id: true, type: true },
|
||||
})
|
||||
if (!asset) throw new Error('Asset not found')
|
||||
if (asset.type !== AssetType.folder && asset.type !== AssetType.root) {
|
||||
throw new Error('AGENTS.md can only be stored on folders')
|
||||
}
|
||||
const trimmed = content.trim()
|
||||
if (trimmed.length === 0) {
|
||||
await this.prismaClient.assetAgentMd.deleteMany({
|
||||
where: { assetId },
|
||||
})
|
||||
return { content: '' }
|
||||
}
|
||||
const record = await this.prismaClient.assetAgentMd.upsert({
|
||||
where: { assetId },
|
||||
create: { assetId, content },
|
||||
update: { content },
|
||||
select: { content: true },
|
||||
})
|
||||
return { content: record.content }
|
||||
}
|
||||
|
||||
async getNestedAgentsMd(assetId: string): Promise<Array<{ path: string; content: string }>> {
|
||||
let currentId: string | null = assetId
|
||||
const nodes: Array<{
|
||||
id: string
|
||||
name: string
|
||||
type: AssetType
|
||||
parentId: string | null
|
||||
}> = []
|
||||
|
||||
while (currentId) {
|
||||
const node: {
|
||||
id: string
|
||||
name: string
|
||||
type: AssetType
|
||||
parentId: string | null
|
||||
} | null = await this.prismaClient.asset.findUnique({
|
||||
where: { id: currentId },
|
||||
select: { id: true, name: true, type: true, parentId: true },
|
||||
})
|
||||
if (!node) break
|
||||
nodes.unshift(node)
|
||||
currentId = node.parentId
|
||||
}
|
||||
|
||||
if (nodes.length === 0) return []
|
||||
|
||||
const agentMds = await this.prismaClient.assetAgentMd.findMany({
|
||||
where: { assetId: { in: nodes.map((n) => n.id) } },
|
||||
select: { assetId: true, content: true },
|
||||
})
|
||||
const agentMdMap = new Map(agentMds.map((m) => [m.assetId, m.content]))
|
||||
|
||||
const results: Array<{ path: string; content: string }> = []
|
||||
let currentFolderPath = ''
|
||||
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const node = nodes[i]
|
||||
let virtualPath: string
|
||||
|
||||
if (node.type === AssetType.root || i === 0) {
|
||||
currentFolderPath = ''
|
||||
virtualPath = '/AGENTS.md'
|
||||
} else {
|
||||
currentFolderPath = currentFolderPath
|
||||
? `${currentFolderPath}/${node.name}`
|
||||
: `/${node.name}`
|
||||
virtualPath = `${currentFolderPath}/AGENTS.md`
|
||||
}
|
||||
|
||||
const content = agentMdMap.get(node.id)
|
||||
if (content && content.trim().length > 0) {
|
||||
results.push({
|
||||
path: virtualPath,
|
||||
content: content.trim(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return results
|
||||
}
|
||||
}
|
||||
|
||||
export const assetService = new AssetService()
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "assets" ADD COLUMN "agentmd" TEXT;
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `agentmd` on the `assets` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "assets" DROP COLUMN "agentmd";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "asset_agentmd" (
|
||||
"asset_id" TEXT NOT NULL,
|
||||
"content" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "asset_agentmd_pkey" PRIMARY KEY ("asset_id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "asset_agentmd" ADD CONSTRAINT "asset_agentmd_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -490,6 +490,7 @@ model Asset {
|
||||
shareLinkRootFolder ShareLink? @relation("ShareLinkToRootFolder")
|
||||
agentSessions AgentSession[] @relation("AssetToAgentSession")
|
||||
watermarkFiles WatermarkFile[] @relation("AssetToWatermarkFile")
|
||||
agentMd AssetAgentMd? @relation("AssetToAgentMd")
|
||||
|
||||
@@map("assets")
|
||||
@@index([type])
|
||||
@@ -537,6 +538,17 @@ model AssetMetadataValue {
|
||||
@@map("asset_metadata_values")
|
||||
}
|
||||
|
||||
model AssetAgentMd {
|
||||
assetId String @id @map("asset_id")
|
||||
content String @db.Text
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
asset Asset @relation("AssetToAgentMd", fields: [assetId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@map("asset_agentmd")
|
||||
}
|
||||
|
||||
model AssetComment {
|
||||
id String @id @default(ulid())
|
||||
message String?
|
||||
|
||||
+5
@@ -107,6 +107,11 @@ export type StorageKey = Prisma.StorageKeyModel
|
||||
*
|
||||
*/
|
||||
export type AssetMetadataValue = Prisma.AssetMetadataValueModel
|
||||
/**
|
||||
* Model AssetAgentMd
|
||||
*
|
||||
*/
|
||||
export type AssetAgentMd = Prisma.AssetAgentMdModel
|
||||
/**
|
||||
* Model AssetComment
|
||||
*
|
||||
|
||||
+5
@@ -131,6 +131,11 @@ export type StorageKey = Prisma.StorageKeyModel
|
||||
*
|
||||
*/
|
||||
export type AssetMetadataValue = Prisma.AssetMetadataValueModel
|
||||
/**
|
||||
* Model AssetAgentMd
|
||||
*
|
||||
*/
|
||||
export type AssetAgentMd = Prisma.AssetAgentMdModel
|
||||
/**
|
||||
* Model AssetComment
|
||||
*
|
||||
|
||||
+14
-4
File diff suppressed because one or more lines are too long
+87
-1
@@ -402,6 +402,7 @@ export const ModelName = {
|
||||
Asset: 'Asset',
|
||||
StorageKey: 'StorageKey',
|
||||
AssetMetadataValue: 'AssetMetadataValue',
|
||||
AssetAgentMd: 'AssetAgentMd',
|
||||
AssetComment: 'AssetComment',
|
||||
AssetCommentAttachment: 'AssetCommentAttachment',
|
||||
AssetEmbedding: 'AssetEmbedding',
|
||||
@@ -440,7 +441,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog"
|
||||
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetAgentMd" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -1776,6 +1777,80 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
AssetAgentMd: {
|
||||
payload: Prisma.$AssetAgentMdPayload<ExtArgs>
|
||||
fields: Prisma.AssetAgentMdFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.AssetAgentMdFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.AssetAgentMdFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.AssetAgentMdFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.AssetAgentMdFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.AssetAgentMdFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.AssetAgentMdCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.AssetAgentMdCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.AssetAgentMdCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.AssetAgentMdDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.AssetAgentMdUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.AssetAgentMdDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.AssetAgentMdUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.AssetAgentMdUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.AssetAgentMdUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetAgentMdPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.AssetAgentMdAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateAssetAgentMd>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.AssetAgentMdGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AssetAgentMdGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.AssetAgentMdCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AssetAgentMdCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
AssetComment: {
|
||||
payload: Prisma.$AssetCommentPayload<ExtArgs>
|
||||
fields: Prisma.AssetCommentFieldRefs
|
||||
@@ -3780,6 +3855,16 @@ export const AssetMetadataValueScalarFieldEnum = {
|
||||
export type AssetMetadataValueScalarFieldEnum = (typeof AssetMetadataValueScalarFieldEnum)[keyof typeof AssetMetadataValueScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetAgentMdScalarFieldEnum = {
|
||||
assetId: 'assetId',
|
||||
content: 'content',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AssetAgentMdScalarFieldEnum = (typeof AssetAgentMdScalarFieldEnum)[keyof typeof AssetAgentMdScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetCommentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
message: 'message',
|
||||
@@ -4652,6 +4737,7 @@ export type GlobalOmitConfig = {
|
||||
asset?: Prisma.AssetOmit
|
||||
storageKey?: Prisma.StorageKeyOmit
|
||||
assetMetadataValue?: Prisma.AssetMetadataValueOmit
|
||||
assetAgentMd?: Prisma.AssetAgentMdOmit
|
||||
assetComment?: Prisma.AssetCommentOmit
|
||||
assetCommentAttachment?: Prisma.AssetCommentAttachmentOmit
|
||||
assetEmbedding?: Prisma.AssetEmbeddingOmit
|
||||
|
||||
@@ -69,6 +69,7 @@ export const ModelName = {
|
||||
Asset: 'Asset',
|
||||
StorageKey: 'StorageKey',
|
||||
AssetMetadataValue: 'AssetMetadataValue',
|
||||
AssetAgentMd: 'AssetAgentMd',
|
||||
AssetComment: 'AssetComment',
|
||||
AssetCommentAttachment: 'AssetCommentAttachment',
|
||||
AssetEmbedding: 'AssetEmbedding',
|
||||
@@ -373,6 +374,16 @@ export const AssetMetadataValueScalarFieldEnum = {
|
||||
export type AssetMetadataValueScalarFieldEnum = (typeof AssetMetadataValueScalarFieldEnum)[keyof typeof AssetMetadataValueScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetAgentMdScalarFieldEnum = {
|
||||
assetId: 'assetId',
|
||||
content: 'content',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AssetAgentMdScalarFieldEnum = (typeof AssetAgentMdScalarFieldEnum)[keyof typeof AssetAgentMdScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetCommentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
message: 'message',
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ export type * from './models/WatermarkFile.ts'
|
||||
export type * from './models/Asset.ts'
|
||||
export type * from './models/StorageKey.ts'
|
||||
export type * from './models/AssetMetadataValue.ts'
|
||||
export type * from './models/AssetAgentMd.ts'
|
||||
export type * from './models/AssetComment.ts'
|
||||
export type * from './models/AssetCommentAttachment.ts'
|
||||
export type * from './models/AssetEmbedding.ts'
|
||||
|
||||
+284
@@ -361,6 +361,7 @@ export type AssetWhereInput = {
|
||||
shareLinkRootFolder?: Prisma.XOR<Prisma.ShareLinkNullableScalarRelationFilter, Prisma.ShareLinkWhereInput> | null
|
||||
agentSessions?: Prisma.AgentSessionListRelationFilter
|
||||
watermarkFiles?: Prisma.WatermarkFileListRelationFilter
|
||||
agentMd?: Prisma.XOR<Prisma.AssetAgentMdNullableScalarRelationFilter, Prisma.AssetAgentMdWhereInput> | null
|
||||
}
|
||||
|
||||
export type AssetOrderByWithRelationInput = {
|
||||
@@ -404,6 +405,7 @@ export type AssetOrderByWithRelationInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkOrderByWithRelationInput
|
||||
agentSessions?: Prisma.AgentSessionOrderByRelationAggregateInput
|
||||
watermarkFiles?: Prisma.WatermarkFileOrderByRelationAggregateInput
|
||||
agentMd?: Prisma.AssetAgentMdOrderByWithRelationInput
|
||||
}
|
||||
|
||||
export type AssetWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -451,6 +453,7 @@ export type AssetWhereUniqueInput = Prisma.AtLeast<{
|
||||
shareLinkRootFolder?: Prisma.XOR<Prisma.ShareLinkNullableScalarRelationFilter, Prisma.ShareLinkWhereInput> | null
|
||||
agentSessions?: Prisma.AgentSessionListRelationFilter
|
||||
watermarkFiles?: Prisma.WatermarkFileListRelationFilter
|
||||
agentMd?: Prisma.XOR<Prisma.AssetAgentMdNullableScalarRelationFilter, Prisma.AssetAgentMdWhereInput> | null
|
||||
}, "id" | "parentIdTargetId">
|
||||
|
||||
export type AssetOrderByWithAggregationInput = {
|
||||
@@ -544,6 +547,7 @@ export type AssetCreateInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateInput = {
|
||||
@@ -581,6 +585,7 @@ export type AssetUncheckedCreateInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUpdateInput = {
|
||||
@@ -618,6 +623,7 @@ export type AssetUpdateInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateInput = {
|
||||
@@ -655,6 +661,7 @@ export type AssetUncheckedUpdateInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateManyInput = {
|
||||
@@ -1191,6 +1198,20 @@ export type AssetUpdateOneRequiredWithoutMetadataValuesNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetUpdateToOneWithWhereWithoutMetadataValuesInput, Prisma.AssetUpdateWithoutMetadataValuesInput>, Prisma.AssetUncheckedUpdateWithoutMetadataValuesInput>
|
||||
}
|
||||
|
||||
export type AssetCreateNestedOneWithoutAgentMdInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCreateWithoutAgentMdInput, Prisma.AssetUncheckedCreateWithoutAgentMdInput>
|
||||
connectOrCreate?: Prisma.AssetCreateOrConnectWithoutAgentMdInput
|
||||
connect?: Prisma.AssetWhereUniqueInput
|
||||
}
|
||||
|
||||
export type AssetUpdateOneRequiredWithoutAgentMdNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCreateWithoutAgentMdInput, Prisma.AssetUncheckedCreateWithoutAgentMdInput>
|
||||
connectOrCreate?: Prisma.AssetCreateOrConnectWithoutAgentMdInput
|
||||
upsert?: Prisma.AssetUpsertWithoutAgentMdInput
|
||||
connect?: Prisma.AssetWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetUpdateToOneWithWhereWithoutAgentMdInput, Prisma.AssetUpdateWithoutAgentMdInput>, Prisma.AssetUncheckedUpdateWithoutAgentMdInput>
|
||||
}
|
||||
|
||||
export type AssetCreateNestedOneWithoutCommentsInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCreateWithoutCommentsInput, Prisma.AssetUncheckedCreateWithoutCommentsInput>
|
||||
connectOrCreate?: Prisma.AssetCreateOrConnectWithoutCommentsInput
|
||||
@@ -1341,6 +1362,7 @@ export type AssetCreateWithoutCreatorInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutCreatorInput = {
|
||||
@@ -1377,6 +1399,7 @@ export type AssetUncheckedCreateWithoutCreatorInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutCreatorInput = {
|
||||
@@ -1466,6 +1489,7 @@ export type AssetCreateWithoutTeamRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutTeamRootFolderInput = {
|
||||
@@ -1502,6 +1526,7 @@ export type AssetUncheckedCreateWithoutTeamRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutTeamRootFolderInput = {
|
||||
@@ -1554,6 +1579,7 @@ export type AssetUpdateWithoutTeamRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutTeamRootFolderInput = {
|
||||
@@ -1590,6 +1616,7 @@ export type AssetUncheckedUpdateWithoutTeamRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutProjectRootFolderInput = {
|
||||
@@ -1626,6 +1653,7 @@ export type AssetCreateWithoutProjectRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutProjectRootFolderInput = {
|
||||
@@ -1662,6 +1690,7 @@ export type AssetUncheckedCreateWithoutProjectRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutProjectRootFolderInput = {
|
||||
@@ -1703,6 +1732,7 @@ export type AssetCreateWithoutProjectShareRootInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutProjectShareRootInput = {
|
||||
@@ -1739,6 +1769,7 @@ export type AssetUncheckedCreateWithoutProjectShareRootInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutProjectShareRootInput = {
|
||||
@@ -1780,6 +1811,7 @@ export type AssetCreateWithoutProjectInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutProjectInput = {
|
||||
@@ -1816,6 +1848,7 @@ export type AssetUncheckedCreateWithoutProjectInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutProjectInput = {
|
||||
@@ -1873,6 +1906,7 @@ export type AssetUpdateWithoutProjectRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutProjectRootFolderInput = {
|
||||
@@ -1909,6 +1943,7 @@ export type AssetUncheckedUpdateWithoutProjectRootFolderInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithoutProjectShareRootInput = {
|
||||
@@ -1956,6 +1991,7 @@ export type AssetUpdateWithoutProjectShareRootInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutProjectShareRootInput = {
|
||||
@@ -1992,6 +2028,7 @@ export type AssetUncheckedUpdateWithoutProjectShareRootInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithWhereUniqueWithoutProjectInput = {
|
||||
@@ -2044,6 +2081,7 @@ export type AssetCreateWithoutShareLinkRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutShareLinkRootFolderInput = {
|
||||
@@ -2080,6 +2118,7 @@ export type AssetUncheckedCreateWithoutShareLinkRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutShareLinkRootFolderInput = {
|
||||
@@ -2132,6 +2171,7 @@ export type AssetUpdateWithoutShareLinkRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutShareLinkRootFolderInput = {
|
||||
@@ -2168,6 +2208,7 @@ export type AssetUncheckedUpdateWithoutShareLinkRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutWatermarkFilesInput = {
|
||||
@@ -2204,6 +2245,7 @@ export type AssetCreateWithoutWatermarkFilesInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutWatermarkFilesInput = {
|
||||
@@ -2240,6 +2282,7 @@ export type AssetUncheckedCreateWithoutWatermarkFilesInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutWatermarkFilesInput = {
|
||||
@@ -2292,6 +2335,7 @@ export type AssetUpdateWithoutWatermarkFilesInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutWatermarkFilesInput = {
|
||||
@@ -2328,6 +2372,7 @@ export type AssetUncheckedUpdateWithoutWatermarkFilesInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutChildrenInput = {
|
||||
@@ -2364,6 +2409,7 @@ export type AssetCreateWithoutChildrenInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutChildrenInput = {
|
||||
@@ -2400,6 +2446,7 @@ export type AssetUncheckedCreateWithoutChildrenInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutChildrenInput = {
|
||||
@@ -2441,6 +2488,7 @@ export type AssetCreateWithoutParentInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutParentInput = {
|
||||
@@ -2477,6 +2525,7 @@ export type AssetUncheckedCreateWithoutParentInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutParentInput = {
|
||||
@@ -2523,6 +2572,7 @@ export type AssetCreateWithoutSymlinksInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutSymlinksInput = {
|
||||
@@ -2559,6 +2609,7 @@ export type AssetUncheckedCreateWithoutSymlinksInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutSymlinksInput = {
|
||||
@@ -2600,6 +2651,7 @@ export type AssetCreateWithoutTargetInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutTargetInput = {
|
||||
@@ -2636,6 +2688,7 @@ export type AssetUncheckedCreateWithoutTargetInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutTargetInput = {
|
||||
@@ -2693,6 +2746,7 @@ export type AssetUpdateWithoutChildrenInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutChildrenInput = {
|
||||
@@ -2729,6 +2783,7 @@ export type AssetUncheckedUpdateWithoutChildrenInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithWhereUniqueWithoutParentInput = {
|
||||
@@ -2792,6 +2847,7 @@ export type AssetUpdateWithoutSymlinksInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutSymlinksInput = {
|
||||
@@ -2828,6 +2884,7 @@ export type AssetUncheckedUpdateWithoutSymlinksInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithWhereUniqueWithoutTargetInput = {
|
||||
@@ -2880,6 +2937,7 @@ export type AssetCreateWithoutStorageKeyInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutStorageKeyInput = {
|
||||
@@ -2916,6 +2974,7 @@ export type AssetUncheckedCreateWithoutStorageKeyInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutStorageKeyInput = {
|
||||
@@ -2978,6 +3037,7 @@ export type AssetCreateWithoutMetadataValuesInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutMetadataValuesInput = {
|
||||
@@ -3014,6 +3074,7 @@ export type AssetUncheckedCreateWithoutMetadataValuesInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutMetadataValuesInput = {
|
||||
@@ -3066,6 +3127,7 @@ export type AssetUpdateWithoutMetadataValuesInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutMetadataValuesInput = {
|
||||
@@ -3102,6 +3164,171 @@ export type AssetUncheckedUpdateWithoutMetadataValuesInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutAgentMdInput = {
|
||||
id?: string
|
||||
name?: string
|
||||
nameNgram?: Prisma.AssetCreatenameNgramInput | string[]
|
||||
type: $Enums.AssetType
|
||||
mediaType?: string | null
|
||||
fileCount?: number
|
||||
sizeByte?: bigint | number
|
||||
status: $Enums.AssetStatus
|
||||
transcodeTaskId?: string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
isDeleted?: boolean
|
||||
deletedAt?: Date | string | null
|
||||
sortIndex?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
parent?: Prisma.AssetCreateNestedOneWithoutChildrenInput
|
||||
children?: Prisma.AssetCreateNestedManyWithoutParentInput
|
||||
target?: Prisma.AssetCreateNestedOneWithoutSymlinksInput
|
||||
symlinks?: Prisma.AssetCreateNestedManyWithoutTargetInput
|
||||
storageKey?: Prisma.StorageKeyCreateNestedOneWithoutAssetsInput
|
||||
metadataValues?: Prisma.AssetMetadataValueCreateNestedManyWithoutAssetInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutAssetsInput
|
||||
task?: Prisma.TaskCreateNestedOneWithoutAssetsInput
|
||||
project?: Prisma.ProjectCreateNestedOneWithoutAssetsInput
|
||||
comments?: Prisma.AssetCommentCreateNestedManyWithoutAssetInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentCreateNestedManyWithoutAssetInput
|
||||
notifications?: Prisma.NotificationCreateNestedManyWithoutAssetInput
|
||||
embeddings?: Prisma.AssetEmbeddingCreateNestedManyWithoutAssetInput
|
||||
teamRootFolder?: Prisma.TeamCreateNestedOneWithoutRootFolderInput
|
||||
projectRootFolder?: Prisma.ProjectCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutAgentMdInput = {
|
||||
id?: string
|
||||
name?: string
|
||||
nameNgram?: Prisma.AssetCreatenameNgramInput | string[]
|
||||
type: $Enums.AssetType
|
||||
mediaType?: string | null
|
||||
fileCount?: number
|
||||
sizeByte?: bigint | number
|
||||
status: $Enums.AssetStatus
|
||||
transcodeTaskId?: string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
isDeleted?: boolean
|
||||
deletedAt?: Date | string | null
|
||||
sortIndex?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
parentId?: string | null
|
||||
targetId?: string | null
|
||||
storageKeyId?: string | null
|
||||
creatorId?: string | null
|
||||
taskId?: string | null
|
||||
projectId?: string | null
|
||||
children?: Prisma.AssetUncheckedCreateNestedManyWithoutParentInput
|
||||
symlinks?: Prisma.AssetUncheckedCreateNestedManyWithoutTargetInput
|
||||
metadataValues?: Prisma.AssetMetadataValueUncheckedCreateNestedManyWithoutAssetInput
|
||||
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutAssetInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentUncheckedCreateNestedManyWithoutAssetInput
|
||||
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutAssetInput
|
||||
embeddings?: Prisma.AssetEmbeddingUncheckedCreateNestedManyWithoutAssetInput
|
||||
teamRootFolder?: Prisma.TeamUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
projectRootFolder?: Prisma.ProjectUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutAgentMdInput = {
|
||||
where: Prisma.AssetWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.AssetCreateWithoutAgentMdInput, Prisma.AssetUncheckedCreateWithoutAgentMdInput>
|
||||
}
|
||||
|
||||
export type AssetUpsertWithoutAgentMdInput = {
|
||||
update: Prisma.XOR<Prisma.AssetUpdateWithoutAgentMdInput, Prisma.AssetUncheckedUpdateWithoutAgentMdInput>
|
||||
create: Prisma.XOR<Prisma.AssetCreateWithoutAgentMdInput, Prisma.AssetUncheckedCreateWithoutAgentMdInput>
|
||||
where?: Prisma.AssetWhereInput
|
||||
}
|
||||
|
||||
export type AssetUpdateToOneWithWhereWithoutAgentMdInput = {
|
||||
where?: Prisma.AssetWhereInput
|
||||
data: Prisma.XOR<Prisma.AssetUpdateWithoutAgentMdInput, Prisma.AssetUncheckedUpdateWithoutAgentMdInput>
|
||||
}
|
||||
|
||||
export type AssetUpdateWithoutAgentMdInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
nameNgram?: Prisma.AssetUpdatenameNgramInput | string[]
|
||||
type?: Prisma.EnumAssetTypeFieldUpdateOperationsInput | $Enums.AssetType
|
||||
mediaType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fileCount?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
sizeByte?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
status?: Prisma.EnumAssetStatusFieldUpdateOperationsInput | $Enums.AssetStatus
|
||||
transcodeTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
isDeleted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sortIndex?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
parent?: Prisma.AssetUpdateOneWithoutChildrenNestedInput
|
||||
children?: Prisma.AssetUpdateManyWithoutParentNestedInput
|
||||
target?: Prisma.AssetUpdateOneWithoutSymlinksNestedInput
|
||||
symlinks?: Prisma.AssetUpdateManyWithoutTargetNestedInput
|
||||
storageKey?: Prisma.StorageKeyUpdateOneWithoutAssetsNestedInput
|
||||
metadataValues?: Prisma.AssetMetadataValueUpdateManyWithoutAssetNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutAssetsNestedInput
|
||||
task?: Prisma.TaskUpdateOneWithoutAssetsNestedInput
|
||||
project?: Prisma.ProjectUpdateOneWithoutAssetsNestedInput
|
||||
comments?: Prisma.AssetCommentUpdateManyWithoutAssetNestedInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentUpdateManyWithoutAssetNestedInput
|
||||
notifications?: Prisma.NotificationUpdateManyWithoutAssetNestedInput
|
||||
embeddings?: Prisma.AssetEmbeddingUpdateManyWithoutAssetNestedInput
|
||||
teamRootFolder?: Prisma.TeamUpdateOneWithoutRootFolderNestedInput
|
||||
projectRootFolder?: Prisma.ProjectUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutAgentMdInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
nameNgram?: Prisma.AssetUpdatenameNgramInput | string[]
|
||||
type?: Prisma.EnumAssetTypeFieldUpdateOperationsInput | $Enums.AssetType
|
||||
mediaType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fileCount?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
sizeByte?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
status?: Prisma.EnumAssetStatusFieldUpdateOperationsInput | $Enums.AssetStatus
|
||||
transcodeTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
isDeleted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sortIndex?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
parentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
targetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
storageKeyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
children?: Prisma.AssetUncheckedUpdateManyWithoutParentNestedInput
|
||||
symlinks?: Prisma.AssetUncheckedUpdateManyWithoutTargetNestedInput
|
||||
metadataValues?: Prisma.AssetMetadataValueUncheckedUpdateManyWithoutAssetNestedInput
|
||||
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutAssetNestedInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentUncheckedUpdateManyWithoutAssetNestedInput
|
||||
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutAssetNestedInput
|
||||
embeddings?: Prisma.AssetEmbeddingUncheckedUpdateManyWithoutAssetNestedInput
|
||||
teamRootFolder?: Prisma.TeamUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
projectRootFolder?: Prisma.ProjectUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutCommentsInput = {
|
||||
@@ -3138,6 +3365,7 @@ export type AssetCreateWithoutCommentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutCommentsInput = {
|
||||
@@ -3174,6 +3402,7 @@ export type AssetUncheckedCreateWithoutCommentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutCommentsInput = {
|
||||
@@ -3226,6 +3455,7 @@ export type AssetUpdateWithoutCommentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutCommentsInput = {
|
||||
@@ -3262,6 +3492,7 @@ export type AssetUncheckedUpdateWithoutCommentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutCommentAttachmentsInput = {
|
||||
@@ -3298,6 +3529,7 @@ export type AssetCreateWithoutCommentAttachmentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutCommentAttachmentsInput = {
|
||||
@@ -3334,6 +3566,7 @@ export type AssetUncheckedCreateWithoutCommentAttachmentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutCommentAttachmentsInput = {
|
||||
@@ -3386,6 +3619,7 @@ export type AssetUpdateWithoutCommentAttachmentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutCommentAttachmentsInput = {
|
||||
@@ -3422,6 +3656,7 @@ export type AssetUncheckedUpdateWithoutCommentAttachmentsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutEmbeddingsInput = {
|
||||
@@ -3458,6 +3693,7 @@ export type AssetCreateWithoutEmbeddingsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutEmbeddingsInput = {
|
||||
@@ -3494,6 +3730,7 @@ export type AssetUncheckedCreateWithoutEmbeddingsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutEmbeddingsInput = {
|
||||
@@ -3546,6 +3783,7 @@ export type AssetUpdateWithoutEmbeddingsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutEmbeddingsInput = {
|
||||
@@ -3582,6 +3820,7 @@ export type AssetUncheckedUpdateWithoutEmbeddingsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutNotificationsInput = {
|
||||
@@ -3618,6 +3857,7 @@ export type AssetCreateWithoutNotificationsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutNotificationsInput = {
|
||||
@@ -3654,6 +3894,7 @@ export type AssetUncheckedCreateWithoutNotificationsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutNotificationsInput = {
|
||||
@@ -3706,6 +3947,7 @@ export type AssetUpdateWithoutNotificationsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutNotificationsInput = {
|
||||
@@ -3742,6 +3984,7 @@ export type AssetUncheckedUpdateWithoutNotificationsInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutTaskInput = {
|
||||
@@ -3778,6 +4021,7 @@ export type AssetCreateWithoutTaskInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutTaskInput = {
|
||||
@@ -3814,6 +4058,7 @@ export type AssetUncheckedCreateWithoutTaskInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutTaskInput = {
|
||||
@@ -3876,6 +4121,7 @@ export type AssetCreateWithoutAgentSessionsInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutAgentSessionsInput = {
|
||||
@@ -3912,6 +4158,7 @@ export type AssetUncheckedCreateWithoutAgentSessionsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedCreateNestedOneWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutAgentSessionsInput = {
|
||||
@@ -3964,6 +4211,7 @@ export type AssetUpdateWithoutAgentSessionsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutAgentSessionsInput = {
|
||||
@@ -4000,6 +4248,7 @@ export type AssetUncheckedUpdateWithoutAgentSessionsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateManyCreatorInput = {
|
||||
@@ -4059,6 +4308,7 @@ export type AssetUpdateWithoutCreatorInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutCreatorInput = {
|
||||
@@ -4095,6 +4345,7 @@ export type AssetUncheckedUpdateWithoutCreatorInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutCreatorInput = {
|
||||
@@ -4177,6 +4428,7 @@ export type AssetUpdateWithoutProjectInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutProjectInput = {
|
||||
@@ -4213,6 +4465,7 @@ export type AssetUncheckedUpdateWithoutProjectInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutProjectInput = {
|
||||
@@ -4318,6 +4571,7 @@ export type AssetUpdateWithoutParentInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutParentInput = {
|
||||
@@ -4354,6 +4608,7 @@ export type AssetUncheckedUpdateWithoutParentInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutParentInput = {
|
||||
@@ -4413,6 +4668,7 @@ export type AssetUpdateWithoutTargetInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutTargetInput = {
|
||||
@@ -4449,6 +4705,7 @@ export type AssetUncheckedUpdateWithoutTargetInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutTargetInput = {
|
||||
@@ -4531,6 +4788,7 @@ export type AssetUpdateWithoutStorageKeyInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutStorageKeyInput = {
|
||||
@@ -4567,6 +4825,7 @@ export type AssetUncheckedUpdateWithoutStorageKeyInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutStorageKeyInput = {
|
||||
@@ -4649,6 +4908,7 @@ export type AssetUpdateWithoutTaskInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutTaskInput = {
|
||||
@@ -4685,6 +4945,7 @@ export type AssetUncheckedUpdateWithoutTaskInput = {
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
agentMd?: Prisma.AssetAgentMdUncheckedUpdateOneWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutTaskInput = {
|
||||
@@ -4854,6 +5115,7 @@ export type AssetSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
shareLinkRootFolder?: boolean | Prisma.Asset$shareLinkRootFolderArgs<ExtArgs>
|
||||
agentSessions?: boolean | Prisma.Asset$agentSessionsArgs<ExtArgs>
|
||||
watermarkFiles?: boolean | Prisma.Asset$watermarkFilesArgs<ExtArgs>
|
||||
agentMd?: boolean | Prisma.Asset$agentMdArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.AssetCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["asset"]>
|
||||
|
||||
@@ -4962,6 +5224,7 @@ export type AssetInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
shareLinkRootFolder?: boolean | Prisma.Asset$shareLinkRootFolderArgs<ExtArgs>
|
||||
agentSessions?: boolean | Prisma.Asset$agentSessionsArgs<ExtArgs>
|
||||
watermarkFiles?: boolean | Prisma.Asset$watermarkFilesArgs<ExtArgs>
|
||||
agentMd?: boolean | Prisma.Asset$agentMdArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.AssetCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type AssetIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -5003,6 +5266,7 @@ export type $AssetPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
shareLinkRootFolder: Prisma.$ShareLinkPayload<ExtArgs> | null
|
||||
agentSessions: Prisma.$AgentSessionPayload<ExtArgs>[]
|
||||
watermarkFiles: Prisma.$WatermarkFilePayload<ExtArgs>[]
|
||||
agentMd: Prisma.$AssetAgentMdPayload<ExtArgs> | null
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -5442,6 +5706,7 @@ export interface Prisma__AssetClient<T, Null = never, ExtArgs extends runtime.Ty
|
||||
shareLinkRootFolder<T extends Prisma.Asset$shareLinkRootFolderArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$shareLinkRootFolderArgs<ExtArgs>>): Prisma.Prisma__ShareLinkClient<runtime.Types.Result.GetResult<Prisma.$ShareLinkPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
agentSessions<T extends Prisma.Asset$agentSessionsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$agentSessionsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AgentSessionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
watermarkFiles<T extends Prisma.Asset$watermarkFilesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$watermarkFilesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$WatermarkFilePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
agentMd<T extends Prisma.Asset$agentMdArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$agentMdArgs<ExtArgs>>): Prisma.Prisma__AssetAgentMdClient<runtime.Types.Result.GetResult<Prisma.$AssetAgentMdPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -6298,6 +6563,25 @@ export type Asset$watermarkFilesArgs<ExtArgs extends runtime.Types.Extensions.In
|
||||
distinct?: Prisma.WatermarkFileScalarFieldEnum | Prisma.WatermarkFileScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Asset.agentMd
|
||||
*/
|
||||
export type Asset$agentMdArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the AssetAgentMd
|
||||
*/
|
||||
select?: Prisma.AssetAgentMdSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the AssetAgentMd
|
||||
*/
|
||||
omit?: Prisma.AssetAgentMdOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.AssetAgentMdInclude<ExtArgs> | null
|
||||
where?: Prisma.AssetAgentMdWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Asset without action
|
||||
*/
|
||||
|
||||
+1265
File diff suppressed because it is too large
Load Diff
@@ -74,6 +74,7 @@ export const assetInfoSchema = z.object({
|
||||
sortIndex: z.string().optional().nullable(),
|
||||
startTime: z.number().optional().nullable(),
|
||||
endTime: z.number().optional().nullable(),
|
||||
hasAgentsMd: z.boolean().optional(),
|
||||
|
||||
media: z
|
||||
.object({
|
||||
|
||||
@@ -20,3 +20,8 @@ export const restoreFoldersRequestSchema = z.object({
|
||||
ids: z.array(z.string()),
|
||||
})
|
||||
export type RestoreFoldersRequest = z.infer<typeof restoreFoldersRequestSchema>
|
||||
|
||||
export const updateAgentsMdRequestSchema = z.object({
|
||||
content: z.string().max(100_000),
|
||||
})
|
||||
export type UpdateAgentsMdRequest = z.infer<typeof updateAgentsMdRequestSchema>
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import { usePermissions } from '@/ui/hooks/use-permissions'
|
||||
import { m } from '@/ui/paraglide/messages.js'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { AlertCircle, Check, Lock, Save, X } from 'lucide-react'
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { MarkdownEditor } from '../markdown-editor/markdown-editor'
|
||||
import { Button } from '../ui/button'
|
||||
import { Separator } from '../ui/separator'
|
||||
|
||||
export interface AgentsMdEditorProps {
|
||||
projectId: string
|
||||
assetId: string
|
||||
rootFolderId: string
|
||||
isRoot?: boolean
|
||||
}
|
||||
|
||||
export function AgentsMdEditor({ projectId, assetId, rootFolderId, isRoot }: AgentsMdEditorProps) {
|
||||
const navigate = useNavigate()
|
||||
const queryClient = useQueryClient()
|
||||
const { canAdmin } = usePermissions(projectId)
|
||||
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: ['folders', assetId, 'agentsmd'],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.folders[':folderId'].agentsmd.$get({
|
||||
param: { folderId: assetId },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to fetch agents.md')
|
||||
return await res.json()
|
||||
},
|
||||
})
|
||||
|
||||
const [content, setContent] = useState<string>('')
|
||||
const [isInitialized, setIsInitialized] = useState(false)
|
||||
const [saveStatus, setSaveStatus] = useState<'idle' | 'saving' | 'saved' | 'error'>('idle')
|
||||
const saveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
const clearSavedTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
const latestContentRef = useRef<string>('')
|
||||
const lastSavedContentRef = useRef<string | null>(null)
|
||||
// Serializes autosaves so a newer write can never be overwritten by an older
|
||||
// in-flight request completing out of order.
|
||||
const saveChainRef = useRef<Promise<unknown>>(Promise.resolve())
|
||||
|
||||
useEffect(() => {
|
||||
if (!isInitialized && data !== undefined) {
|
||||
const initial = data.content ?? ''
|
||||
setContent(initial)
|
||||
latestContentRef.current = initial
|
||||
lastSavedContentRef.current = initial
|
||||
setIsInitialized(true)
|
||||
}
|
||||
}, [data, isInitialized])
|
||||
|
||||
const [isClosing, setIsClosing] = useState(false)
|
||||
|
||||
const saveMutation = useMutation({
|
||||
mutationFn: async (newContent: string) => {
|
||||
const res = await client.api.folders[':folderId'].agentsmd.$patch({
|
||||
param: { folderId: assetId },
|
||||
json: { content: newContent },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to save agents.md')
|
||||
return await res.json()
|
||||
},
|
||||
onSuccess: (_, newContent) => {
|
||||
setSaveStatus('saved')
|
||||
lastSavedContentRef.current = newContent
|
||||
queryClient.setQueryData(['folders', assetId, 'agentsmd'], { content: newContent })
|
||||
queryClient.invalidateQueries({ queryKey: ['folders', assetId] })
|
||||
if (clearSavedTimeoutRef.current) {
|
||||
clearTimeout(clearSavedTimeoutRef.current)
|
||||
}
|
||||
clearSavedTimeoutRef.current = setTimeout(() => {
|
||||
setSaveStatus('idle')
|
||||
}, 2500)
|
||||
},
|
||||
onError: () => {
|
||||
setSaveStatus('error')
|
||||
},
|
||||
})
|
||||
|
||||
const saveMutationRef = useRef(saveMutation.mutateAsync)
|
||||
saveMutationRef.current = saveMutation.mutateAsync
|
||||
|
||||
const enqueueSave = useCallback(
|
||||
(textToSave: string) => {
|
||||
if (!canAdmin) return Promise.resolve()
|
||||
if (lastSavedContentRef.current === textToSave) {
|
||||
setSaveStatus('saved')
|
||||
return Promise.resolve()
|
||||
}
|
||||
setSaveStatus('saving')
|
||||
const p = saveChainRef.current
|
||||
.then(async () => {
|
||||
await saveMutationRef.current(textToSave)
|
||||
})
|
||||
.catch(() => {
|
||||
// Swallow so a failed save does not break the chain for later saves.
|
||||
// The mutation's onError handler already surfaces the failure.
|
||||
})
|
||||
saveChainRef.current = p
|
||||
return p
|
||||
},
|
||||
[canAdmin],
|
||||
)
|
||||
|
||||
const handleContentChange = useCallback(
|
||||
(newMarkdown: string) => {
|
||||
if (!canAdmin) return
|
||||
setContent(newMarkdown)
|
||||
latestContentRef.current = newMarkdown
|
||||
|
||||
if (saveTimeoutRef.current) {
|
||||
clearTimeout(saveTimeoutRef.current)
|
||||
}
|
||||
|
||||
setSaveStatus('saving')
|
||||
saveTimeoutRef.current = setTimeout(() => {
|
||||
saveTimeoutRef.current = null
|
||||
enqueueSave(newMarkdown)
|
||||
}, 1000)
|
||||
},
|
||||
[canAdmin, enqueueSave],
|
||||
)
|
||||
|
||||
// Flushes any pending debounced edits so they are not lost when the editor
|
||||
// unmounts (close button, folder-tree navigation, or route change).
|
||||
const flushPendingSave = useCallback(() => {
|
||||
if (saveTimeoutRef.current) {
|
||||
clearTimeout(saveTimeoutRef.current)
|
||||
saveTimeoutRef.current = null
|
||||
return enqueueSave(latestContentRef.current)
|
||||
}
|
||||
return saveChainRef.current
|
||||
}, [enqueueSave])
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
flushPendingSave()
|
||||
if (clearSavedTimeoutRef.current) {
|
||||
clearTimeout(clearSavedTimeoutRef.current)
|
||||
}
|
||||
}
|
||||
}, [flushPendingSave])
|
||||
|
||||
const handleClose = async () => {
|
||||
setIsClosing(true)
|
||||
try {
|
||||
flushPendingSave()
|
||||
await saveChainRef.current
|
||||
} catch {
|
||||
// Proceed with navigation even if error occurs
|
||||
} finally {
|
||||
if (isRoot || assetId === rootFolderId) {
|
||||
navigate({
|
||||
to: '/projects/$projectId',
|
||||
params: { projectId },
|
||||
})
|
||||
} else {
|
||||
navigate({
|
||||
to: '/projects/$projectId/folders/$folderId',
|
||||
params: { projectId, folderId: assetId },
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const rightToolbarContent = (
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
{canAdmin ? (
|
||||
<div className="flex items-center gap-1.5 text-xs shrink-0">
|
||||
{(saveStatus === 'saving' || isClosing) && (
|
||||
<span className="inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap">
|
||||
<Save className="h-3.5 w-3.5 shrink-0" />
|
||||
<span>{m.saving_ellipsis()}</span>
|
||||
</span>
|
||||
)}
|
||||
{saveStatus === 'saved' && !isClosing && (
|
||||
<span className="inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap">
|
||||
<Check className="h-3.5 w-3.5 shrink-0" />
|
||||
<span>{m.saved()}</span>
|
||||
</span>
|
||||
)}
|
||||
{saveStatus === 'error' && !isClosing && (
|
||||
<span className="inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap">
|
||||
<AlertCircle className="h-3.5 w-3.5 shrink-0" />
|
||||
<span>{m.agents_md_save_failed()}</span>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
className="inline-flex items-center gap-1 text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-md shrink-0"
|
||||
title={m.agents_md_readonly_hint()}
|
||||
>
|
||||
<Lock className="h-3 w-3 shrink-0" />
|
||||
<span>{m.read_only()}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Separator orientation="vertical" className="h-4 shrink-0" />
|
||||
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={handleClose}
|
||||
disabled={isClosing}
|
||||
className="h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0"
|
||||
title={m.close()}
|
||||
>
|
||||
<X className="h-4 w-4 mr-1 shrink-0" />
|
||||
<span>{m.close()}</span>
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
|
||||
if (isLoading || !isInitialized) {
|
||||
return (
|
||||
<div className="flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground">
|
||||
<Save className="h-4 w-4 animate-pulse mr-2" />
|
||||
<span>{m.agents_md_loading()}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex-1 flex flex-col h-full min-h-0 overflow-hidden">
|
||||
<MarkdownEditor
|
||||
value={content}
|
||||
onChange={handleContentChange}
|
||||
placeholder={m.agents_md_placeholder()}
|
||||
readOnly={!canAdmin}
|
||||
rightToolbarContent={rightToolbarContent}
|
||||
className="flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import { ChatbotSidebar } from '@/ui/components/chatbot-sidebar'
|
||||
import { FolderTree } from '@/ui/components/folder-tree'
|
||||
import { ResizeHandle } from '@/ui/components/resize-handle'
|
||||
import { useChatbotStore } from '@/ui/stores/chatbot'
|
||||
import { useTopNavStore } from '@/ui/stores/top-nav'
|
||||
import { useUiStore } from '@/ui/stores/ui'
|
||||
import type { AncestorFolder, AssetInfo } from '@shumai/dtos'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { AgentsMdEditor } from './agents-md-editor'
|
||||
|
||||
export interface AgentsMdManagerProps {
|
||||
teamId: string
|
||||
projectId: string
|
||||
projectName: string
|
||||
assetId: string
|
||||
rootFolderId: string
|
||||
isRoot?: boolean
|
||||
}
|
||||
|
||||
export default function AgentsMdManager({
|
||||
teamId,
|
||||
projectId,
|
||||
projectName,
|
||||
assetId,
|
||||
rootFolderId,
|
||||
isRoot,
|
||||
}: AgentsMdManagerProps) {
|
||||
const navigate = useNavigate()
|
||||
const [leftSidebarWidth, setLeftSidebarWidth] = useState(240)
|
||||
const [rightSidebarWidth, setRightSidebarWidth] = useState(360)
|
||||
const {
|
||||
fileListLeftSidebarCollapsed: isLeftSidebarCollapsed,
|
||||
setFileListLeftSidebarCollapsed: setIsLeftSidebarCollapsed,
|
||||
} = useUiStore()
|
||||
const { isChatbotOpen, setIsChatbotOpen } = useChatbotStore()
|
||||
|
||||
const { data: folderInfo } = useQuery({
|
||||
queryKey: ['folders', assetId],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.folders[':folderId'].$get({
|
||||
param: { folderId: assetId },
|
||||
})
|
||||
if (!res.ok) throw new Error('failed to fetch folder')
|
||||
return (await res.json()) as unknown as AssetInfo
|
||||
},
|
||||
enabled: !!assetId,
|
||||
})
|
||||
|
||||
const { setProjectState, clearProjectState } = useTopNavStore()
|
||||
|
||||
useEffect(() => {
|
||||
const isRootFolder = isRoot || assetId === rootFolderId
|
||||
const ancestors: AncestorFolder[] = isRootFolder
|
||||
? []
|
||||
: folderInfo?.name
|
||||
? [{ id: assetId, name: folderInfo.name }, ...(folderInfo?.ancestorFolders ?? [])]
|
||||
: (folderInfo?.ancestorFolders ?? [])
|
||||
|
||||
setProjectState({
|
||||
teamId,
|
||||
projectId,
|
||||
projectName,
|
||||
ancestorFolders: ancestors,
|
||||
currentAsset: { name: folderInfo?.name, type: 'folder' },
|
||||
isRootFolder: true,
|
||||
customTerminalBreadcrumb: 'AGENTS.md',
|
||||
onFolderClick: (id: string) => {
|
||||
navigate({
|
||||
to: '/projects/$projectId/folders/$folderId',
|
||||
params: { projectId, folderId: id },
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
return () => clearProjectState()
|
||||
}, [
|
||||
teamId,
|
||||
projectId,
|
||||
projectName,
|
||||
folderInfo?.ancestorFolders,
|
||||
folderInfo?.name,
|
||||
isRoot,
|
||||
assetId,
|
||||
rootFolderId,
|
||||
setProjectState,
|
||||
clearProjectState,
|
||||
navigate,
|
||||
])
|
||||
|
||||
return (
|
||||
<div className="flex-1 flex flex-col h-full overflow-hidden bg-background">
|
||||
<div className="flex-1 flex overflow-hidden relative">
|
||||
{!isLeftSidebarCollapsed && (
|
||||
<div
|
||||
className="md:hidden fixed inset-0 bg-black/50 z-40"
|
||||
onClick={() => setIsLeftSidebarCollapsed(true)}
|
||||
/>
|
||||
)}
|
||||
{isChatbotOpen && (
|
||||
<div
|
||||
className="md:hidden fixed inset-0 bg-black/50 z-40"
|
||||
onClick={() => setIsChatbotOpen(false)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{!isLeftSidebarCollapsed && (
|
||||
<>
|
||||
<div className="bg-background flex-shrink-0" style={{ width: leftSidebarWidth }}>
|
||||
<FolderTree
|
||||
teamId={teamId}
|
||||
projectId={projectId}
|
||||
projectName={projectName}
|
||||
rootFolderId={rootFolderId}
|
||||
selectedFolderId={assetId}
|
||||
ancestorFolders={folderInfo?.ancestorFolders ?? []}
|
||||
/>
|
||||
</div>
|
||||
<ResizeHandle
|
||||
onResize={(delta) => {
|
||||
setLeftSidebarWidth((prev) => Math.max(180, Math.min(400, prev + delta)))
|
||||
}}
|
||||
className="hidden md:block"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3">
|
||||
<AgentsMdEditor
|
||||
projectId={projectId}
|
||||
assetId={assetId}
|
||||
rootFolderId={rootFolderId}
|
||||
isRoot={isRoot}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{isChatbotOpen && (
|
||||
<>
|
||||
<ResizeHandle
|
||||
onResize={(delta) => {
|
||||
setRightSidebarWidth((prev) => Math.max(240, Math.min(600, prev - delta)))
|
||||
}}
|
||||
className="hidden md:block"
|
||||
/>
|
||||
<div
|
||||
style={{ width: rightSidebarWidth }}
|
||||
className="bg-background flex flex-col flex-shrink-0"
|
||||
>
|
||||
<ChatbotSidebar projectId={projectId} contextAssetId={assetId} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -53,6 +53,7 @@ interface BreadcrumbNavProps {
|
||||
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
|
||||
}
|
||||
isRootFolder: boolean
|
||||
customTerminalBreadcrumb?: string
|
||||
displayStyle?: 'card' | 'list'
|
||||
onDisplayStyleChange?: (style: 'card' | 'list') => void
|
||||
isLeftSidebarCollapsed?: boolean
|
||||
@@ -95,6 +96,7 @@ export function BreadcrumbNav({
|
||||
ancestorFolders,
|
||||
currentAsset,
|
||||
isRootFolder,
|
||||
customTerminalBreadcrumb,
|
||||
displayStyle,
|
||||
onDisplayStyleChange,
|
||||
isLeftSidebarCollapsed,
|
||||
@@ -219,7 +221,14 @@ export function BreadcrumbNav({
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
{!isRootFolder && !compareMode && (
|
||||
{customTerminalBreadcrumb ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<span className="text-muted-foreground">/</span>
|
||||
<span className="truncate rounded px-2 py-1 text-sm font-medium text-foreground">
|
||||
{customTerminalBreadcrumb}
|
||||
</span>
|
||||
</div>
|
||||
) : !isRootFolder && !compareMode ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<span className="text-muted-foreground">/</span>
|
||||
{currentAsset.type === 'folder' ? (
|
||||
@@ -385,7 +394,7 @@ export function BreadcrumbNav({
|
||||
</DropdownMenu>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
|
||||
@@ -4,6 +4,7 @@ import { m } from '@/ui/paraglide/messages.js'
|
||||
import type { AssetInfo, CollectionInfo, SearchCondition, SearchSort } from '@shumai/dtos'
|
||||
import { type FieldInfo as MetadataFieldInfo } from '@shumai/dtos'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import type { InferRequestType, InferResponseType } from 'hono/client'
|
||||
import { useState } from 'react'
|
||||
import { FieldsManager } from '../fields-manager'
|
||||
@@ -17,6 +18,7 @@ import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar'
|
||||
import { Button } from '../ui/button'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
||||
import { Separator } from '../ui/separator'
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
|
||||
type FileBrowserToolbarProps = {
|
||||
teamId: string
|
||||
@@ -55,6 +57,7 @@ export function FileBrowserToolbar({
|
||||
const [isMembersDialogOpen, setIsMembersDialogOpen] = useState(false)
|
||||
const [isFolderSelectorOpen, setIsFolderSelectorOpen] = useState(false)
|
||||
|
||||
const navigate = useNavigate()
|
||||
const activeFiltersCount = filterConditions.length
|
||||
const isCollection = !!collection
|
||||
const queryClient = useQueryClient()
|
||||
@@ -68,9 +71,23 @@ export function FileBrowserToolbar({
|
||||
if (!res.ok) throw new Error('failed to fetch folder')
|
||||
return (await res.json()) as unknown as AssetInfo
|
||||
},
|
||||
enabled: isCollection && !!assetId,
|
||||
enabled: !!assetId && !isRecentlyDeleted,
|
||||
})
|
||||
|
||||
const handleOpenAgentsMd = () => {
|
||||
if (assetId === rootFolderId) {
|
||||
navigate({
|
||||
to: '/projects/$projectId/agentsmd',
|
||||
params: { projectId },
|
||||
})
|
||||
} else {
|
||||
navigate({
|
||||
to: '/projects/$projectId/folders/$folderId/agentsmd',
|
||||
params: { projectId, folderId: assetId },
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const { data: members, refetch: refetchProjectMembers } = useQuery({
|
||||
queryKey: ['projects', projectId, 'members'],
|
||||
queryFn: async () => {
|
||||
@@ -225,11 +242,9 @@ export function FileBrowserToolbar({
|
||||
<div className="flex items-center gap-2 h-full">
|
||||
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<div>
|
||||
<Button variant="ghost" size="sm">
|
||||
{m.field()}
|
||||
</Button>
|
||||
</div>
|
||||
<Button variant="ghost" size="sm">
|
||||
{m.field()}
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-auto p-0" align="start">
|
||||
<FieldsManager
|
||||
@@ -254,11 +269,7 @@ export function FileBrowserToolbar({
|
||||
<>
|
||||
<Popover open={isFolderSelectorOpen} onOpenChange={setIsFolderSelectorOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="inline-flex items-center gap-2 px-3 py-2 hover:bg-primary/10 font-semibold rounded-xl cursor-pointer h-8 text-muted-foreground"
|
||||
>
|
||||
<Button variant="ghost" size="sm" className="text-muted-foreground">
|
||||
<span className="truncate max-w-[150px]">{folderInfo?.name || 'Loading...'}</span>
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
@@ -295,11 +306,7 @@ export function FileBrowserToolbar({
|
||||
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<Button
|
||||
variant={activeFiltersCount > 0 ? 'secondary' : 'ghost'}
|
||||
size="sm"
|
||||
className="inline-flex items-center gap-2 px-4 py-2 hover:bg-primary/10 font-semibold rounded-xl cursor-pointer h-8"
|
||||
>
|
||||
<Button variant={activeFiltersCount > 0 ? 'secondary' : 'ghost'} size="sm">
|
||||
<span>Filter</span>
|
||||
{activeFiltersCount > 0 && (
|
||||
<span className="ml-1 px-1.5 py-0.5 rounded-full text-[10px] font-mono font-bold bg-primary/50 border border-primary-foreground/20">
|
||||
@@ -333,20 +340,49 @@ export function FileBrowserToolbar({
|
||||
</Popover>
|
||||
</>
|
||||
) : (
|
||||
<Button
|
||||
onClick={() => setSearchDialogOpen(true)}
|
||||
disabled={isRecentlyDeleted}
|
||||
variant={activeFiltersCount > 0 ? 'secondary' : 'ghost'}
|
||||
size="sm"
|
||||
className="inline-flex items-center gap-2 px-4 py-2 hover:bg-primary/10 font-semibold rounded-xl cursor-pointer h-8"
|
||||
>
|
||||
<span>{m.search()}</span>
|
||||
{activeFiltersCount > 0 && (
|
||||
<span className="ml-1 px-1.5 py-0.5 rounded-full text-[10px] font-mono font-bold bg-primary/50 border border-primary-foreground/20">
|
||||
{activeFiltersCount}
|
||||
</span>
|
||||
<>
|
||||
<Button
|
||||
onClick={() => setSearchDialogOpen(true)}
|
||||
disabled={isRecentlyDeleted}
|
||||
variant={activeFiltersCount > 0 ? 'secondary' : 'ghost'}
|
||||
size="sm"
|
||||
>
|
||||
<span>{m.search()}</span>
|
||||
{activeFiltersCount > 0 && (
|
||||
<span className="ml-1 px-1.5 py-0.5 rounded-full text-[10px] font-mono font-bold bg-primary/50 border border-primary-foreground/20">
|
||||
{activeFiltersCount}
|
||||
</span>
|
||||
)}
|
||||
</Button>
|
||||
|
||||
{!isRecentlyDeleted && (
|
||||
<>
|
||||
<Separator orientation="vertical" />
|
||||
<Button
|
||||
onClick={handleOpenAgentsMd}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
title="AGENTS.md"
|
||||
className={cn(
|
||||
folderInfo?.hasAgentsMd ? 'text-foreground' : 'text-muted-foreground',
|
||||
)}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 -960 960 960"
|
||||
className={cn(
|
||||
'size-4',
|
||||
folderInfo?.hasAgentsMd ? 'text-primary' : 'text-muted-foreground',
|
||||
)}
|
||||
fill="currentColor"
|
||||
>
|
||||
<path d="m176-120-56-56 301-302-181-45 198-123-17-234 179 151 216-88-87 217 151 178-234-16-124 198-45-181-301 301Zm24-520-80-80 80-80 80 80-80 80Zm520 520-80-80 80-80 80 80-80 80Z" />
|
||||
</svg>
|
||||
<span>{m.agents_md()}</span>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
.shumai-editor-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
border: 1px solid var(--border, #e2e8f0);
|
||||
border-radius: 8px;
|
||||
background-color: var(--background, #ffffff);
|
||||
@@ -23,7 +25,7 @@
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.shumai-editor-toolbar button {
|
||||
.shumai-editor-toolbar-left button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -38,17 +40,17 @@
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.shumai-editor-toolbar button:hover:not(:disabled) {
|
||||
.shumai-editor-toolbar-left button:hover:not(:disabled) {
|
||||
background-color: var(--accent, #e2e8f0);
|
||||
color: var(--accent-foreground, #0f172a);
|
||||
}
|
||||
|
||||
.shumai-editor-toolbar button:disabled {
|
||||
.shumai-editor-toolbar-left button:disabled {
|
||||
opacity: 0.35;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.shumai-editor-toolbar button.active {
|
||||
.shumai-editor-toolbar-left button.active {
|
||||
background-color: var(--primary, #0f172a);
|
||||
color: var(--primary-foreground, #ffffff);
|
||||
}
|
||||
@@ -74,14 +76,14 @@
|
||||
|
||||
.shumai-editor-content-area {
|
||||
position: relative;
|
||||
min-height: 240px;
|
||||
min-height: 0;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.editor-input {
|
||||
min-height: 240px;
|
||||
min-height: 100%;
|
||||
padding: 16px;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
|
||||
@@ -24,6 +24,7 @@ import { AutoLinkNode, LinkNode } from '@lexical/link'
|
||||
import { ToolbarPlugin } from './toolbar'
|
||||
import { editorTheme } from './theme'
|
||||
import { EDITOR_TRANSFORMERS } from './transformers'
|
||||
import { ScrollArea } from '@/ui/components/ui/scroll-area'
|
||||
import './markdown-editor.css'
|
||||
|
||||
function MarkdownSyncPlugin({
|
||||
@@ -90,6 +91,7 @@ export interface MarkdownEditorProps {
|
||||
autoFocus?: boolean
|
||||
className?: string
|
||||
hideToolbar?: boolean
|
||||
rightToolbarContent?: React.ReactNode
|
||||
}
|
||||
|
||||
export function MarkdownEditor({
|
||||
@@ -101,6 +103,7 @@ export function MarkdownEditor({
|
||||
autoFocus = false,
|
||||
className = '',
|
||||
hideToolbar = false,
|
||||
rightToolbarContent,
|
||||
}: MarkdownEditorProps) {
|
||||
const initialConfig: InitialConfigType = {
|
||||
namespace: 'ShumaiWysiwygMarkdownEditor',
|
||||
@@ -126,13 +129,21 @@ export function MarkdownEditor({
|
||||
return (
|
||||
<div className={`shumai-editor-wrapper ${readOnly ? 'read-only' : ''} ${className}`}>
|
||||
<LexicalComposer initialConfig={initialConfig}>
|
||||
{!readOnly && !hideToolbar && <ToolbarPlugin />}
|
||||
<div className="shumai-editor-content-area">
|
||||
<RichTextPlugin
|
||||
contentEditable={<ContentEditable className="editor-input" />}
|
||||
placeholder={<div className="editor-placeholder">{placeholder}</div>}
|
||||
ErrorBoundary={LexicalErrorBoundary}
|
||||
/>
|
||||
{!readOnly && !hideToolbar ? (
|
||||
<ToolbarPlugin rightContent={rightToolbarContent} />
|
||||
) : rightToolbarContent ? (
|
||||
<div className="shumai-editor-toolbar flex items-center justify-end px-3 py-1.5 border-b">
|
||||
{rightToolbarContent}
|
||||
</div>
|
||||
) : null}
|
||||
<ScrollArea className="shumai-editor-content-area flex-1 min-h-0 w-full">
|
||||
<div className="relative min-h-full">
|
||||
<RichTextPlugin
|
||||
contentEditable={<ContentEditable className="editor-input" />}
|
||||
placeholder={<div className="editor-placeholder">{placeholder}</div>}
|
||||
ErrorBoundary={LexicalErrorBoundary}
|
||||
/>
|
||||
</div>
|
||||
<HistoryPlugin />
|
||||
<ListPlugin />
|
||||
<CheckListPlugin />
|
||||
@@ -141,7 +152,7 @@ export function MarkdownEditor({
|
||||
<MarkdownShortcutPlugin transformers={EDITOR_TRANSFORMERS} />
|
||||
<MarkdownSyncPlugin value={value} initialContent={initialContent} onChange={onChange} />
|
||||
{autoFocus && <AutoFocusPlugin />}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</LexicalComposer>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -83,7 +83,7 @@ function getSelectedNode(selection: RangeSelection): TextNode | ElementNode {
|
||||
}
|
||||
}
|
||||
|
||||
export function ToolbarPlugin() {
|
||||
export function ToolbarPlugin({ rightContent }: { rightContent?: React.ReactNode } = {}) {
|
||||
const [editor] = useLexicalComposerContext()
|
||||
const [canUndo, setCanUndo] = useState(false)
|
||||
const [canRedo, setCanRedo] = useState(false)
|
||||
@@ -296,194 +296,200 @@ export function ToolbarPlugin() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="shumai-editor-toolbar">
|
||||
{/* Undo / Redo */}
|
||||
<button
|
||||
type="button"
|
||||
disabled={!canUndo}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(UNDO_COMMAND, undefined)}
|
||||
title="Undo"
|
||||
aria-label="Undo"
|
||||
>
|
||||
<Undo2 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!canRedo}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(REDO_COMMAND, undefined)}
|
||||
title="Redo"
|
||||
aria-label="Redo"
|
||||
>
|
||||
<Redo2 className="h-4 w-4" />
|
||||
</button>
|
||||
<div className="shumai-editor-toolbar flex items-center justify-between">
|
||||
<div className="shumai-editor-toolbar-left flex items-center flex-wrap gap-1">
|
||||
{/* Undo / Redo */}
|
||||
<button
|
||||
type="button"
|
||||
disabled={!canUndo}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(UNDO_COMMAND, undefined)}
|
||||
title="Undo"
|
||||
aria-label="Undo"
|
||||
>
|
||||
<Undo2 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!canRedo}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(REDO_COMMAND, undefined)}
|
||||
title="Redo"
|
||||
aria-label="Redo"
|
||||
>
|
||||
<Redo2 className="h-4 w-4" />
|
||||
</button>
|
||||
|
||||
<div className="toolbar-divider" />
|
||||
<div className="toolbar-divider" />
|
||||
|
||||
{/* Block Type Dropdown */}
|
||||
<select value={blockType} onChange={handleBlockTypeChange} aria-label="Block formatting">
|
||||
<option value="paragraph">Normal</option>
|
||||
<option value="h1">Heading 1</option>
|
||||
<option value="h2">Heading 2</option>
|
||||
<option value="h3">Heading 3</option>
|
||||
<option value="bullet">Bullet List</option>
|
||||
<option value="number">Numbered List</option>
|
||||
<option value="check">Check List</option>
|
||||
<option value="quote">Quote</option>
|
||||
<option value="code">Code Block</option>
|
||||
</select>
|
||||
{/* Block Type Dropdown */}
|
||||
<select value={blockType} onChange={handleBlockTypeChange} aria-label="Block formatting">
|
||||
<option value="paragraph">Normal</option>
|
||||
<option value="h1">Heading 1</option>
|
||||
<option value="h2">Heading 2</option>
|
||||
<option value="h3">Heading 3</option>
|
||||
<option value="bullet">Bullet List</option>
|
||||
<option value="number">Numbered List</option>
|
||||
<option value="check">Check List</option>
|
||||
<option value="quote">Quote</option>
|
||||
<option value="code">Code Block</option>
|
||||
</select>
|
||||
|
||||
<div className="toolbar-divider" />
|
||||
<div className="toolbar-divider" />
|
||||
|
||||
{/* Inline Styles */}
|
||||
<button
|
||||
type="button"
|
||||
className={isBold ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')}
|
||||
title="Bold (Ctrl+B)"
|
||||
aria-label="Bold"
|
||||
>
|
||||
<Bold className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isItalic ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')}
|
||||
title="Italic (Ctrl+I)"
|
||||
aria-label="Italic"
|
||||
>
|
||||
<Italic className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isUnderline ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')}
|
||||
title="Underline (Ctrl+U)"
|
||||
aria-label="Underline"
|
||||
>
|
||||
<Underline className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isStrikethrough ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')}
|
||||
title="Strikethrough"
|
||||
aria-label="Strikethrough"
|
||||
>
|
||||
<Strikethrough className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isCode ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code')}
|
||||
title="Inline Code"
|
||||
aria-label="Inline Code"
|
||||
>
|
||||
<Code className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isLink ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={insertLink}
|
||||
title="Insert Link"
|
||||
aria-label="Link"
|
||||
>
|
||||
<LinkIcon className="h-4 w-4" />
|
||||
</button>
|
||||
{/* Inline Styles */}
|
||||
<button
|
||||
type="button"
|
||||
className={isBold ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')}
|
||||
title="Bold (Ctrl+B)"
|
||||
aria-label="Bold"
|
||||
>
|
||||
<Bold className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isItalic ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')}
|
||||
title="Italic (Ctrl+I)"
|
||||
aria-label="Italic"
|
||||
>
|
||||
<Italic className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isUnderline ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')}
|
||||
title="Underline (Ctrl+U)"
|
||||
aria-label="Underline"
|
||||
>
|
||||
<Underline className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isStrikethrough ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')}
|
||||
title="Strikethrough"
|
||||
aria-label="Strikethrough"
|
||||
>
|
||||
<Strikethrough className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isCode ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code')}
|
||||
title="Inline Code"
|
||||
aria-label="Inline Code"
|
||||
>
|
||||
<Code className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={isLink ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={insertLink}
|
||||
title="Insert Link"
|
||||
aria-label="Link"
|
||||
>
|
||||
<LinkIcon className="h-4 w-4" />
|
||||
</button>
|
||||
|
||||
<div className="toolbar-divider" />
|
||||
<div className="toolbar-divider" />
|
||||
|
||||
{/* Quick Insert / Block shortcuts */}
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'h1' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => formatHeading('h1')}
|
||||
title="H1"
|
||||
aria-label="Heading 1"
|
||||
>
|
||||
<Heading1 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'h2' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => formatHeading('h2')}
|
||||
title="H2"
|
||||
aria-label="Heading 2"
|
||||
>
|
||||
<Heading2 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'h3' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => formatHeading('h3')}
|
||||
title="H3"
|
||||
aria-label="Heading 3"
|
||||
>
|
||||
<Heading3 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'bullet' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatBulletList}
|
||||
title="Bullet List"
|
||||
aria-label="Bullet List"
|
||||
>
|
||||
<List className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'number' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatNumberedList}
|
||||
title="Numbered List"
|
||||
aria-label="Numbered List"
|
||||
>
|
||||
<ListOrdered className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'check' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatCheckList}
|
||||
title="Check List"
|
||||
aria-label="Check List"
|
||||
>
|
||||
<ListTodo className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'quote' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatQuote}
|
||||
title="Quote"
|
||||
aria-label="Quote"
|
||||
>
|
||||
<Quote className="h-4 w-4" />
|
||||
</button>
|
||||
{/* Quick Insert / Block shortcuts */}
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'h1' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => formatHeading('h1')}
|
||||
title="H1"
|
||||
aria-label="Heading 1"
|
||||
>
|
||||
<Heading1 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'h2' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => formatHeading('h2')}
|
||||
title="H2"
|
||||
aria-label="Heading 2"
|
||||
>
|
||||
<Heading2 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'h3' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={() => formatHeading('h3')}
|
||||
title="H3"
|
||||
aria-label="Heading 3"
|
||||
>
|
||||
<Heading3 className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'bullet' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatBulletList}
|
||||
title="Bullet List"
|
||||
aria-label="Bullet List"
|
||||
>
|
||||
<List className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'number' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatNumberedList}
|
||||
title="Numbered List"
|
||||
aria-label="Numbered List"
|
||||
>
|
||||
<ListOrdered className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'check' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatCheckList}
|
||||
title="Check List"
|
||||
aria-label="Check List"
|
||||
>
|
||||
<ListTodo className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={blockType === 'quote' ? 'active' : ''}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={formatQuote}
|
||||
title="Quote"
|
||||
aria-label="Quote"
|
||||
>
|
||||
<Quote className="h-4 w-4" />
|
||||
</button>
|
||||
|
||||
<div className="toolbar-divider" />
|
||||
<div className="toolbar-divider" />
|
||||
|
||||
{/* Clear formatting */}
|
||||
<button
|
||||
type="button"
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={clearFormatting}
|
||||
title="Clear Formatting"
|
||||
aria-label="Clear Formatting"
|
||||
>
|
||||
<RemoveFormatting className="h-4 w-4" />
|
||||
</button>
|
||||
{/* Clear formatting */}
|
||||
<button
|
||||
type="button"
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={clearFormatting}
|
||||
title="Clear Formatting"
|
||||
aria-label="Clear Formatting"
|
||||
>
|
||||
<RemoveFormatting className="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{rightContent && (
|
||||
<div className="flex items-center gap-2 ml-auto flex-shrink-0">{rightContent}</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -74,12 +74,7 @@ export function SortControl({ fields, sort, onSortChange, disabled }: SortContro
|
||||
return (
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<Button
|
||||
variant={sort ? 'secondary' : 'ghost'}
|
||||
size="sm"
|
||||
className="h-8"
|
||||
disabled={disabled}
|
||||
>
|
||||
<Button variant={sort ? 'secondary' : 'ghost'} size="sm" disabled={disabled}>
|
||||
{sort ? m.sorted_by({ field: currentField.label }) : m.sort_by()}
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
|
||||
@@ -20,6 +20,7 @@ export function TopNav() {
|
||||
ancestorFolders,
|
||||
currentAsset,
|
||||
isRootFolder,
|
||||
customTerminalBreadcrumb,
|
||||
fileId,
|
||||
downloadInfo,
|
||||
versions,
|
||||
@@ -35,6 +36,7 @@ export function TopNav() {
|
||||
} = projectState
|
||||
|
||||
const isFileView = !!fileId
|
||||
const isAgentsMd = !!customTerminalBreadcrumb
|
||||
|
||||
const isShareConfig = !!shareId && !isFileView
|
||||
|
||||
@@ -105,8 +107,11 @@ export function TopNav() {
|
||||
ancestorFolders={ancestorFolders}
|
||||
currentAsset={currentAsset}
|
||||
isRootFolder={isRootFolder}
|
||||
displayStyle={isFileView || isShareConfig ? undefined : displayStyle}
|
||||
onDisplayStyleChange={isFileView || isShareConfig ? undefined : onDisplayStyleChange}
|
||||
customTerminalBreadcrumb={customTerminalBreadcrumb}
|
||||
displayStyle={isFileView || isShareConfig || isAgentsMd ? undefined : displayStyle}
|
||||
onDisplayStyleChange={
|
||||
isFileView || isShareConfig || isAgentsMd ? undefined : onDisplayStyleChange
|
||||
}
|
||||
isLeftSidebarCollapsed={isLeftSidebarCollapsed}
|
||||
onLeftSidebarToggle={onLeftSidebarToggle}
|
||||
isRightSidebarCollapsed={isRightSidebarCollapsed}
|
||||
|
||||
@@ -1035,5 +1035,12 @@
|
||||
"preview_backdrop": "Preview Background",
|
||||
"dark_grid": "Dark Grid",
|
||||
"light_grid": "Light Grid",
|
||||
"sample_backdrop": "Sample Media"
|
||||
"sample_backdrop": "Sample Media",
|
||||
"saved": "Saved",
|
||||
"read_only": "Read-only",
|
||||
"agents_md": "AGENTS.md",
|
||||
"agents_md_placeholder": "Write guidelines and instructions for AI agents here...",
|
||||
"agents_md_readonly_hint": "Only project owners can edit AGENTS.md instructions.",
|
||||
"agents_md_save_failed": "Failed to save",
|
||||
"agents_md_loading": "Loading AGENTS.md..."
|
||||
}
|
||||
|
||||
@@ -1035,5 +1035,12 @@
|
||||
"preview_backdrop": "预览背景",
|
||||
"dark_grid": "深色网格",
|
||||
"light_grid": "浅色网格",
|
||||
"sample_backdrop": "示例媒体"
|
||||
"sample_backdrop": "示例媒体",
|
||||
"saved": "已保存",
|
||||
"read_only": "只读",
|
||||
"agents_md": "AGENTS.md",
|
||||
"agents_md_placeholder": "在此处为 AI Agent 编写项目或文件夹指引...",
|
||||
"agents_md_readonly_hint": "只有项目所有者可以编辑 AGENTS.md 指引。",
|
||||
"agents_md_save_failed": "保存失败",
|
||||
"agents_md_loading": "正在加载 AGENTS.md..."
|
||||
}
|
||||
|
||||
+7
@@ -980,4 +980,11 @@ export * from "./preview_backdrop.js";
|
||||
export * from "./dark_grid.js";
|
||||
export * from "./light_grid.js";
|
||||
export * from "./sample_backdrop.js";
|
||||
export * from "./saved.js";
|
||||
export * from "./read_only.js";
|
||||
export * from "./agents_md.js";
|
||||
export * from "./agents_md_placeholder.js";
|
||||
export * from "./agents_md_readonly_hint.js";
|
||||
export * from "./agents_md_save_failed.js";
|
||||
export * from "./agents_md_loading.js";
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
|
||||
+8
-1
@@ -981,4 +981,11 @@ export * from './aspect_1_1.js'
|
||||
export * from './preview_backdrop.js'
|
||||
export * from './dark_grid.js'
|
||||
export * from './light_grid.js'
|
||||
export * from './sample_backdrop.js'
|
||||
export * from './sample_backdrop.js'
|
||||
export * from './saved.js'
|
||||
export * from './read_only.js'
|
||||
export * from './agents_md.js'
|
||||
export * from './agents_md_placeholder.js'
|
||||
export * from './agents_md_readonly_hint.js'
|
||||
export * from './agents_md_save_failed.js'
|
||||
export * from './agents_md_loading.js'
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "AGENTS.md" |
|
||||
*
|
||||
* @param {Agents_MdInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md: ((inputs?: Agents_MdInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Agents_MdInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Agents_MdInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Agents_MdInputs */
|
||||
|
||||
const en_agents_md = /** @type {(inputs: Agents_MdInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`AGENTS.md`)
|
||||
};
|
||||
|
||||
const zh_agents_md = /** @type {(inputs: Agents_MdInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`AGENTS.md`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "AGENTS.md" |
|
||||
*
|
||||
* @param {Agents_MdInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md = /** @type {((inputs?: Agents_MdInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Agents_MdInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_agents_md(inputs)
|
||||
return zh_agents_md(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Loading AGENTS.md..." |
|
||||
*
|
||||
* @param {Agents_Md_LoadingInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_loading: ((inputs?: Agents_Md_LoadingInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Agents_Md_LoadingInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Agents_Md_LoadingInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Agents_Md_LoadingInputs */
|
||||
|
||||
const en_agents_md_loading = /** @type {(inputs: Agents_Md_LoadingInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Loading AGENTS.md...`)
|
||||
};
|
||||
|
||||
const zh_agents_md_loading = /** @type {(inputs: Agents_Md_LoadingInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`正在加载 AGENTS.md...`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Loading AGENTS.md..." |
|
||||
*
|
||||
* @param {Agents_Md_LoadingInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_loading = /** @type {((inputs?: Agents_Md_LoadingInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Agents_Md_LoadingInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_agents_md_loading(inputs)
|
||||
return zh_agents_md_loading(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Write guidelines and instructions for AI agents here..." |
|
||||
*
|
||||
* @param {Agents_Md_PlaceholderInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_placeholder: ((inputs?: Agents_Md_PlaceholderInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Agents_Md_PlaceholderInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Agents_Md_PlaceholderInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Agents_Md_PlaceholderInputs */
|
||||
|
||||
const en_agents_md_placeholder = /** @type {(inputs: Agents_Md_PlaceholderInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Write guidelines and instructions for AI agents here...`)
|
||||
};
|
||||
|
||||
const zh_agents_md_placeholder = /** @type {(inputs: Agents_Md_PlaceholderInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`在此处为 AI Agent 编写项目或文件夹指引...`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Write guidelines and instructions for AI agents here..." |
|
||||
*
|
||||
* @param {Agents_Md_PlaceholderInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_placeholder = /** @type {((inputs?: Agents_Md_PlaceholderInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Agents_Md_PlaceholderInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_agents_md_placeholder(inputs)
|
||||
return zh_agents_md_placeholder(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Only project owners can edit AGENTS.md instructions." |
|
||||
*
|
||||
* @param {Agents_Md_Readonly_HintInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_readonly_hint: ((inputs?: Agents_Md_Readonly_HintInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Agents_Md_Readonly_HintInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Agents_Md_Readonly_HintInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Agents_Md_Readonly_HintInputs */
|
||||
|
||||
const en_agents_md_readonly_hint = /** @type {(inputs: Agents_Md_Readonly_HintInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Only project owners can edit AGENTS.md instructions.`)
|
||||
};
|
||||
|
||||
const zh_agents_md_readonly_hint = /** @type {(inputs: Agents_Md_Readonly_HintInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`只有项目所有者可以编辑 AGENTS.md 指引。`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Only project owners can edit AGENTS.md instructions." |
|
||||
*
|
||||
* @param {Agents_Md_Readonly_HintInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_readonly_hint = /** @type {((inputs?: Agents_Md_Readonly_HintInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Agents_Md_Readonly_HintInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_agents_md_readonly_hint(inputs)
|
||||
return zh_agents_md_readonly_hint(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Failed to save" |
|
||||
*
|
||||
* @param {Agents_Md_Save_FailedInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_save_failed: ((inputs?: Agents_Md_Save_FailedInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Agents_Md_Save_FailedInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Agents_Md_Save_FailedInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Agents_Md_Save_FailedInputs */
|
||||
|
||||
const en_agents_md_save_failed = /** @type {(inputs: Agents_Md_Save_FailedInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Failed to save`)
|
||||
};
|
||||
|
||||
const zh_agents_md_save_failed = /** @type {(inputs: Agents_Md_Save_FailedInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`保存失败`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Failed to save" |
|
||||
*
|
||||
* @param {Agents_Md_Save_FailedInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const agents_md_save_failed = /** @type {((inputs?: Agents_Md_Save_FailedInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Agents_Md_Save_FailedInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_agents_md_save_failed(inputs)
|
||||
return zh_agents_md_save_failed(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Read-only" |
|
||||
*
|
||||
* @param {Read_OnlyInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const read_only: ((inputs?: Read_OnlyInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Read_OnlyInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Read_OnlyInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Read_OnlyInputs */
|
||||
|
||||
const en_read_only = /** @type {(inputs: Read_OnlyInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Read-only`)
|
||||
};
|
||||
|
||||
const zh_read_only = /** @type {(inputs: Read_OnlyInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`只读`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Read-only" |
|
||||
*
|
||||
* @param {Read_OnlyInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const read_only = /** @type {((inputs?: Read_OnlyInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Read_OnlyInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_read_only(inputs)
|
||||
return zh_read_only(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Saved" |
|
||||
*
|
||||
* @param {SavedInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const saved: ((inputs?: SavedInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<SavedInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type SavedInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} SavedInputs */
|
||||
|
||||
const en_saved = /** @type {(inputs: SavedInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Saved`)
|
||||
};
|
||||
|
||||
const zh_saved = /** @type {(inputs: SavedInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`已保存`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Saved" |
|
||||
*
|
||||
* @param {SavedInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const saved = /** @type {((inputs?: SavedInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<SavedInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_saved(inputs)
|
||||
return zh_saved(inputs)
|
||||
});
|
||||
@@ -19,6 +19,7 @@ import { Route as ProjectsProjectIdIndexRouteImport } from './routes/projects/$p
|
||||
import { Route as TeamsTeamIdSettingsRouteImport } from './routes/teams/$teamId/settings'
|
||||
import { Route as TeamsTeamIdDashboardRouteImport } from './routes/teams/$teamId/dashboard'
|
||||
import { Route as ProjectsProjectIdRecentlyDeletedRouteImport } from './routes/projects/$projectId/recently-deleted'
|
||||
import { Route as ProjectsProjectIdAgentsmdRouteImport } from './routes/projects/$projectId/agentsmd'
|
||||
import { Route as ProjectsProjectIdSharesIndexRouteImport } from './routes/projects/$projectId/shares/index'
|
||||
import { Route as ProjectsProjectIdCollectionsIndexRouteImport } from './routes/projects/$projectId/collections/index'
|
||||
import { Route as ShareShareIdFoldersFolderIdRouteImport } from './routes/share/$shareId/folders/$folderId'
|
||||
@@ -27,6 +28,7 @@ import { Route as ProjectsProjectIdSharesShareIdRouteImport } from './routes/pro
|
||||
import { Route as ProjectsProjectIdFoldersFolderIdRouteImport } from './routes/projects/$projectId/folders/$folderId'
|
||||
import { Route as ProjectsProjectIdFilesFileIdRouteImport } from './routes/projects/$projectId/files/$fileId'
|
||||
import { Route as ProjectsProjectIdCollectionsCollectionIdRouteImport } from './routes/projects/$projectId/collections/$collectionId'
|
||||
import { Route as ProjectsProjectIdFoldersFolderIdAgentsmdRouteImport } from './routes/projects/$projectId/folders/$folderId_.agentsmd'
|
||||
|
||||
const SignupRoute = SignupRouteImport.update({
|
||||
id: '/signup',
|
||||
@@ -80,6 +82,11 @@ const ProjectsProjectIdRecentlyDeletedRoute = ProjectsProjectIdRecentlyDeletedRo
|
||||
} as any).lazy(() =>
|
||||
import('./routes/projects/$projectId/recently-deleted.lazy').then((d) => d.Route),
|
||||
)
|
||||
const ProjectsProjectIdAgentsmdRoute = ProjectsProjectIdAgentsmdRouteImport.update({
|
||||
id: '/projects/$projectId/agentsmd',
|
||||
path: '/projects/$projectId/agentsmd',
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any).lazy(() => import('./routes/projects/$projectId/agentsmd.lazy').then((d) => d.Route))
|
||||
const ProjectsProjectIdSharesIndexRoute = ProjectsProjectIdSharesIndexRouteImport.update({
|
||||
id: '/projects/$projectId/shares/',
|
||||
path: '/projects/$projectId/shares/',
|
||||
@@ -129,12 +136,21 @@ const ProjectsProjectIdCollectionsCollectionIdRoute =
|
||||
} as any).lazy(() =>
|
||||
import('./routes/projects/$projectId/collections/$collectionId.lazy').then((d) => d.Route),
|
||||
)
|
||||
const ProjectsProjectIdFoldersFolderIdAgentsmdRoute =
|
||||
ProjectsProjectIdFoldersFolderIdAgentsmdRouteImport.update({
|
||||
id: '/projects/$projectId/folders/$folderId_/agentsmd',
|
||||
path: '/projects/$projectId/folders/$folderId/agentsmd',
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any).lazy(() =>
|
||||
import('./routes/projects/$projectId/folders/$folderId_.agentsmd.lazy').then((d) => d.Route),
|
||||
)
|
||||
|
||||
export interface FileRoutesByFullPath {
|
||||
'/': typeof IndexRoute
|
||||
'/login': typeof LoginRoute
|
||||
'/signup': typeof SignupRoute
|
||||
'/share/$shareId': typeof ShareShareIdRouteWithChildren
|
||||
'/projects/$projectId/agentsmd': typeof ProjectsProjectIdAgentsmdRoute
|
||||
'/projects/$projectId/recently-deleted': typeof ProjectsProjectIdRecentlyDeletedRoute
|
||||
'/teams/$teamId/dashboard': typeof TeamsTeamIdDashboardRoute
|
||||
'/teams/$teamId/settings': typeof TeamsTeamIdSettingsRoute
|
||||
@@ -149,11 +165,13 @@ export interface FileRoutesByFullPath {
|
||||
'/share/$shareId/folders/$folderId': typeof ShareShareIdFoldersFolderIdRoute
|
||||
'/projects/$projectId/collections/': typeof ProjectsProjectIdCollectionsIndexRoute
|
||||
'/projects/$projectId/shares/': typeof ProjectsProjectIdSharesIndexRoute
|
||||
'/projects/$projectId/folders/$folderId/agentsmd': typeof ProjectsProjectIdFoldersFolderIdAgentsmdRoute
|
||||
}
|
||||
export interface FileRoutesByTo {
|
||||
'/': typeof IndexRoute
|
||||
'/login': typeof LoginRoute
|
||||
'/signup': typeof SignupRoute
|
||||
'/projects/$projectId/agentsmd': typeof ProjectsProjectIdAgentsmdRoute
|
||||
'/projects/$projectId/recently-deleted': typeof ProjectsProjectIdRecentlyDeletedRoute
|
||||
'/teams/$teamId/dashboard': typeof TeamsTeamIdDashboardRoute
|
||||
'/teams/$teamId/settings': typeof TeamsTeamIdSettingsRoute
|
||||
@@ -168,6 +186,7 @@ export interface FileRoutesByTo {
|
||||
'/share/$shareId/folders/$folderId': typeof ShareShareIdFoldersFolderIdRoute
|
||||
'/projects/$projectId/collections': typeof ProjectsProjectIdCollectionsIndexRoute
|
||||
'/projects/$projectId/shares': typeof ProjectsProjectIdSharesIndexRoute
|
||||
'/projects/$projectId/folders/$folderId/agentsmd': typeof ProjectsProjectIdFoldersFolderIdAgentsmdRoute
|
||||
}
|
||||
export interface FileRoutesById {
|
||||
__root__: typeof rootRouteImport
|
||||
@@ -175,6 +194,7 @@ export interface FileRoutesById {
|
||||
'/login': typeof LoginRoute
|
||||
'/signup': typeof SignupRoute
|
||||
'/share/$shareId': typeof ShareShareIdRouteWithChildren
|
||||
'/projects/$projectId/agentsmd': typeof ProjectsProjectIdAgentsmdRoute
|
||||
'/projects/$projectId/recently-deleted': typeof ProjectsProjectIdRecentlyDeletedRoute
|
||||
'/teams/$teamId/dashboard': typeof TeamsTeamIdDashboardRoute
|
||||
'/teams/$teamId/settings': typeof TeamsTeamIdSettingsRoute
|
||||
@@ -189,6 +209,7 @@ export interface FileRoutesById {
|
||||
'/share/$shareId/folders/$folderId': typeof ShareShareIdFoldersFolderIdRoute
|
||||
'/projects/$projectId/collections/': typeof ProjectsProjectIdCollectionsIndexRoute
|
||||
'/projects/$projectId/shares/': typeof ProjectsProjectIdSharesIndexRoute
|
||||
'/projects/$projectId/folders/$folderId_/agentsmd': typeof ProjectsProjectIdFoldersFolderIdAgentsmdRoute
|
||||
}
|
||||
export interface FileRouteTypes {
|
||||
fileRoutesByFullPath: FileRoutesByFullPath
|
||||
@@ -197,6 +218,7 @@ export interface FileRouteTypes {
|
||||
| '/login'
|
||||
| '/signup'
|
||||
| '/share/$shareId'
|
||||
| '/projects/$projectId/agentsmd'
|
||||
| '/projects/$projectId/recently-deleted'
|
||||
| '/teams/$teamId/dashboard'
|
||||
| '/teams/$teamId/settings'
|
||||
@@ -211,11 +233,13 @@ export interface FileRouteTypes {
|
||||
| '/share/$shareId/folders/$folderId'
|
||||
| '/projects/$projectId/collections/'
|
||||
| '/projects/$projectId/shares/'
|
||||
| '/projects/$projectId/folders/$folderId/agentsmd'
|
||||
fileRoutesByTo: FileRoutesByTo
|
||||
to:
|
||||
| '/'
|
||||
| '/login'
|
||||
| '/signup'
|
||||
| '/projects/$projectId/agentsmd'
|
||||
| '/projects/$projectId/recently-deleted'
|
||||
| '/teams/$teamId/dashboard'
|
||||
| '/teams/$teamId/settings'
|
||||
@@ -230,12 +254,14 @@ export interface FileRouteTypes {
|
||||
| '/share/$shareId/folders/$folderId'
|
||||
| '/projects/$projectId/collections'
|
||||
| '/projects/$projectId/shares'
|
||||
| '/projects/$projectId/folders/$folderId/agentsmd'
|
||||
id:
|
||||
| '__root__'
|
||||
| '/'
|
||||
| '/login'
|
||||
| '/signup'
|
||||
| '/share/$shareId'
|
||||
| '/projects/$projectId/agentsmd'
|
||||
| '/projects/$projectId/recently-deleted'
|
||||
| '/teams/$teamId/dashboard'
|
||||
| '/teams/$teamId/settings'
|
||||
@@ -250,6 +276,7 @@ export interface FileRouteTypes {
|
||||
| '/share/$shareId/folders/$folderId'
|
||||
| '/projects/$projectId/collections/'
|
||||
| '/projects/$projectId/shares/'
|
||||
| '/projects/$projectId/folders/$folderId_/agentsmd'
|
||||
fileRoutesById: FileRoutesById
|
||||
}
|
||||
export interface RootRouteChildren {
|
||||
@@ -257,6 +284,7 @@ export interface RootRouteChildren {
|
||||
LoginRoute: typeof LoginRoute
|
||||
SignupRoute: typeof SignupRoute
|
||||
ShareShareIdRoute: typeof ShareShareIdRouteWithChildren
|
||||
ProjectsProjectIdAgentsmdRoute: typeof ProjectsProjectIdAgentsmdRoute
|
||||
ProjectsProjectIdRecentlyDeletedRoute: typeof ProjectsProjectIdRecentlyDeletedRoute
|
||||
TeamsTeamIdDashboardRoute: typeof TeamsTeamIdDashboardRoute
|
||||
TeamsTeamIdSettingsRoute: typeof TeamsTeamIdSettingsRoute
|
||||
@@ -268,6 +296,7 @@ export interface RootRouteChildren {
|
||||
ProjectsProjectIdSharesShareIdRoute: typeof ProjectsProjectIdSharesShareIdRoute
|
||||
ProjectsProjectIdCollectionsIndexRoute: typeof ProjectsProjectIdCollectionsIndexRoute
|
||||
ProjectsProjectIdSharesIndexRoute: typeof ProjectsProjectIdSharesIndexRoute
|
||||
ProjectsProjectIdFoldersFolderIdAgentsmdRoute: typeof ProjectsProjectIdFoldersFolderIdAgentsmdRoute
|
||||
}
|
||||
|
||||
declare module '@tanstack/react-router' {
|
||||
@@ -342,6 +371,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof ProjectsProjectIdRecentlyDeletedRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/projects/$projectId/agentsmd': {
|
||||
id: '/projects/$projectId/agentsmd'
|
||||
path: '/projects/$projectId/agentsmd'
|
||||
fullPath: '/projects/$projectId/agentsmd'
|
||||
preLoaderRoute: typeof ProjectsProjectIdAgentsmdRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/projects/$projectId/shares/': {
|
||||
id: '/projects/$projectId/shares/'
|
||||
path: '/projects/$projectId/shares'
|
||||
@@ -398,6 +434,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof ProjectsProjectIdCollectionsCollectionIdRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/projects/$projectId/folders/$folderId_/agentsmd': {
|
||||
id: '/projects/$projectId/folders/$folderId_/agentsmd'
|
||||
path: '/projects/$projectId/folders/$folderId/agentsmd'
|
||||
fullPath: '/projects/$projectId/folders/$folderId/agentsmd'
|
||||
preLoaderRoute: typeof ProjectsProjectIdFoldersFolderIdAgentsmdRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,6 +463,7 @@ const rootRouteChildren: RootRouteChildren = {
|
||||
LoginRoute: LoginRoute,
|
||||
SignupRoute: SignupRoute,
|
||||
ShareShareIdRoute: ShareShareIdRouteWithChildren,
|
||||
ProjectsProjectIdAgentsmdRoute: ProjectsProjectIdAgentsmdRoute,
|
||||
ProjectsProjectIdRecentlyDeletedRoute: ProjectsProjectIdRecentlyDeletedRoute,
|
||||
TeamsTeamIdDashboardRoute: TeamsTeamIdDashboardRoute,
|
||||
TeamsTeamIdSettingsRoute: TeamsTeamIdSettingsRoute,
|
||||
@@ -431,6 +475,7 @@ const rootRouteChildren: RootRouteChildren = {
|
||||
ProjectsProjectIdSharesShareIdRoute: ProjectsProjectIdSharesShareIdRoute,
|
||||
ProjectsProjectIdCollectionsIndexRoute: ProjectsProjectIdCollectionsIndexRoute,
|
||||
ProjectsProjectIdSharesIndexRoute: ProjectsProjectIdSharesIndexRoute,
|
||||
ProjectsProjectIdFoldersFolderIdAgentsmdRoute: ProjectsProjectIdFoldersFolderIdAgentsmdRoute,
|
||||
}
|
||||
export const routeTree = rootRouteImport
|
||||
._addFileChildren(rootRouteChildren)
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import AgentsMdManager from '@/ui/components/agents-md/agents-md-manager'
|
||||
import { ProjectFolderSkeleton } from '@/ui/components/loading-skeletons'
|
||||
import { useTeamContextStore } from '@/ui/stores/team-context'
|
||||
import { useQuery, useSuspenseQuery } from '@tanstack/react-query'
|
||||
import { createLazyFileRoute } from '@tanstack/react-router'
|
||||
import { useEffect } from 'react'
|
||||
import { projectInfoQueryOptions } from './agentsmd'
|
||||
|
||||
function ProjectAgentsMdPage() {
|
||||
const { projectId } = Route.useParams()
|
||||
const { teamId, ensureTeamIdForProject } = useTeamContextStore()
|
||||
|
||||
useEffect(() => {
|
||||
ensureTeamIdForProject(projectId)
|
||||
}, [projectId, ensureTeamIdForProject])
|
||||
|
||||
const { data: projectInfo } = useSuspenseQuery(projectInfoQueryOptions(projectId))
|
||||
|
||||
const rootFolderId = projectInfo?.rootFolder
|
||||
|
||||
const { data: rootFolder } = useQuery({
|
||||
queryKey: ['folders', rootFolderId!],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.folders[':folderId'].$get({
|
||||
param: { folderId: rootFolderId! },
|
||||
})
|
||||
if (!res.ok) throw new Error('failed to fetch folder')
|
||||
return await res.json()
|
||||
},
|
||||
enabled: !!rootFolderId,
|
||||
})
|
||||
|
||||
if (!teamId || !rootFolderId || !rootFolder) {
|
||||
return <ProjectFolderSkeleton />
|
||||
}
|
||||
|
||||
return (
|
||||
<AgentsMdManager
|
||||
teamId={teamId}
|
||||
projectId={projectId}
|
||||
projectName={projectInfo.name ?? ''}
|
||||
assetId={rootFolderId}
|
||||
rootFolderId={rootFolderId}
|
||||
isRoot={true}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export const Route = createLazyFileRoute('/projects/$projectId/agentsmd')({
|
||||
component: ProjectAgentsMdPage,
|
||||
})
|
||||
@@ -0,0 +1,20 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import { ProjectFolderSkeleton } from '@/ui/components/loading-skeletons'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const projectInfoQueryOptions = (projectId: string) => ({
|
||||
queryKey: ['projects', projectId],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.projects[':projectId'].$get({
|
||||
param: { projectId: projectId },
|
||||
})
|
||||
if (!res.ok) throw new Error('failed to fetch project')
|
||||
return await res.json()
|
||||
},
|
||||
})
|
||||
|
||||
export const Route = createFileRoute('/projects/$projectId/agentsmd')({
|
||||
loader: ({ context: { queryClient }, params: { projectId } }) =>
|
||||
queryClient.ensureQueryData(projectInfoQueryOptions(projectId)),
|
||||
pendingComponent: () => <ProjectFolderSkeleton />,
|
||||
})
|
||||
@@ -0,0 +1,52 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import AgentsMdManager from '@/ui/components/agents-md/agents-md-manager'
|
||||
import { ProjectFolderSkeleton } from '@/ui/components/loading-skeletons'
|
||||
import { useTeamContextStore } from '@/ui/stores/team-context'
|
||||
import { useQuery, useSuspenseQuery } from '@tanstack/react-query'
|
||||
import { createLazyFileRoute } from '@tanstack/react-router'
|
||||
import { useEffect } from 'react'
|
||||
import { projectInfoQueryOptions } from './$folderId_.agentsmd'
|
||||
|
||||
function FolderAgentsMdPage() {
|
||||
const { projectId, folderId } = Route.useParams()
|
||||
const { teamId, ensureTeamIdForProject } = useTeamContextStore()
|
||||
|
||||
useEffect(() => {
|
||||
ensureTeamIdForProject(projectId)
|
||||
}, [projectId, ensureTeamIdForProject])
|
||||
|
||||
const { data: projectInfo } = useSuspenseQuery(projectInfoQueryOptions(projectId))
|
||||
|
||||
const rootFolderId = projectInfo?.rootFolder
|
||||
|
||||
const { data: rootFolder } = useQuery({
|
||||
queryKey: ['folders', rootFolderId!],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.folders[':folderId'].$get({
|
||||
param: { folderId: rootFolderId! },
|
||||
})
|
||||
if (!res.ok) throw new Error('failed to fetch folder')
|
||||
return await res.json()
|
||||
},
|
||||
enabled: !!rootFolderId,
|
||||
})
|
||||
|
||||
if (!teamId || !rootFolderId || !rootFolder) {
|
||||
return <ProjectFolderSkeleton />
|
||||
}
|
||||
|
||||
return (
|
||||
<AgentsMdManager
|
||||
teamId={teamId}
|
||||
projectId={projectId}
|
||||
projectName={projectInfo.name ?? ''}
|
||||
assetId={folderId}
|
||||
rootFolderId={rootFolderId}
|
||||
isRoot={false}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export const Route = createLazyFileRoute('/projects/$projectId/folders/$folderId_/agentsmd')({
|
||||
component: FolderAgentsMdPage,
|
||||
})
|
||||
@@ -0,0 +1,20 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import { ProjectFolderSkeleton } from '@/ui/components/loading-skeletons'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const projectInfoQueryOptions = (projectId: string) => ({
|
||||
queryKey: ['projects', projectId],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.projects[':projectId'].$get({
|
||||
param: { projectId: projectId },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to fetch project')
|
||||
return await res.json()
|
||||
},
|
||||
})
|
||||
|
||||
export const Route = createFileRoute('/projects/$projectId/folders/$folderId_/agentsmd')({
|
||||
loader: ({ context: { queryClient }, params: { projectId } }) =>
|
||||
queryClient.ensureQueryData(projectInfoQueryOptions(projectId)),
|
||||
pendingComponent: () => <ProjectFolderSkeleton />,
|
||||
})
|
||||
@@ -13,6 +13,7 @@ export interface TopNavProjectState {
|
||||
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
|
||||
}
|
||||
isRootFolder: boolean
|
||||
customTerminalBreadcrumb?: string
|
||||
fileId?: string
|
||||
downloadInfo?: {
|
||||
originalKey?: string
|
||||
|
||||
Reference in New Issue
Block a user