mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 04:44:28 +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:
+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
|
||||
|
||||
Reference in New Issue
Block a user