mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 21:44:27 +00:00
feat(operations): add shared Operation layer for agent capabilities
Introduce @shumai/operations (pure definitions: Zod schemas, metadata, CLI hints) and @shumai/core/src/operations (implementOperation and the runOperation pipeline: validate, authorize, prepare, execute, validate output, audit). Migrate list_assets, create_folder, rename_asset, move_assets and delete_asset to Operations, and add list_projects. The agent now builds these tools from the registry, and the folder create/rename, file rename and reparent routes call the same Operations. Audit logs gain a nullable via column recording the surface. A lint rule keeps the Prisma client out of Operation implementations.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "audit_logs" ADD COLUMN "via" TEXT;
|
||||
@@ -1132,6 +1132,8 @@ model AuditLog {
|
||||
agentId String? @map("agent_id")
|
||||
projectId String? @map("project_id")
|
||||
itemId String? @map("item_id")
|
||||
/// Surface the action came through: api, agent, mcp, or cli. Null for actions recorded outside Operations.
|
||||
via String? @map("via")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
team Team @relation("TeamToAuditLog", fields: [teamId], references: [id], onDelete: Cascade)
|
||||
|
||||
Reference in New Issue
Block a user