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:
yiling
2026-10-26 11:36:36 +08:00
parent 47ee794ae4
commit 028fae0286
65 changed files with 2372 additions and 1149 deletions
+12
View File
@@ -154,6 +154,7 @@
"@shumai/core": "workspace:*",
"@shumai/db": "workspace:*",
"@shumai/dtos": "workspace:*",
"@shumai/operations": "workspace:*",
"@shumai/workflow-core": "workspace:*",
"adm-zip": "0.6.0",
"jittered-fractional-indexing": "1.0.1",
@@ -174,6 +175,7 @@
"@shumai/core": "workspace:*",
"@shumai/db": "workspace:*",
"@shumai/dtos": "workspace:*",
"@shumai/operations": "workspace:*",
"hono": "4.13.5",
"pino": "10.3.1",
"ulid": "3.0.2",
@@ -211,6 +213,7 @@
"@modelcontextprotocol/client": "2.0.0",
"@shumai/db": "workspace:*",
"@shumai/dtos": "workspace:*",
"@shumai/operations": "workspace:*",
"@sinclair/typebox": "0.34.52",
"adm-zip": "0.6.0",
"ai": "7.0.84",
@@ -280,6 +283,13 @@
"sharp": "0.35.4",
},
},
"packages/operations": {
"name": "@shumai/operations",
"version": "0.6.1",
"dependencies": {
"zod": "4.5.4",
},
},
"packages/tableprinter": {
"name": "@shumai/tableprinter",
"version": "0.6.1",
@@ -1109,6 +1119,8 @@
"@shumai/e2e": ["@shumai/e2e@workspace:packages/e2e"],
"@shumai/operations": ["@shumai/operations@workspace:packages/operations"],
"@shumai/premiere-uxp": ["@shumai/premiere-uxp@workspace:apps/premiere-uxp"],
"@shumai/tableprinter": ["@shumai/tableprinter@workspace:packages/tableprinter"],