feat(operations): add create_project operation across agent, mcp, and cli (#529)

* feat(operations): add create_project operation across agent, mcp, and cli

* fix(api): remove legacy team creation endpoint

* fix(api): preserve ProjectInfo response on POST /teams/:teamId/projects
This commit is contained in:
Yiling-J
2026-11-13 11:43:08 +08:00
committed by GitHub
parent 97c2939b5e
commit c55804a548
20 changed files with 369 additions and 66 deletions
+26
View File
@@ -4,6 +4,7 @@ import {
copyAssets,
createComment,
createFolder,
createProject,
createVersionStack,
deleteAsset,
downloadAsset,
@@ -118,6 +119,31 @@ describe('shumai-cli', () => {
})
})
describe('project create', () => {
it('creates a project with positional name and optional --team', async () => {
const cli = setup()
cli.callOperation.mockResolvedValue({
id: 'p-new',
name: 'Summer Shoot',
teamId: 't1',
rootFolderId: 'root-new',
})
await cli.run('project', 'create', 'Summer Shoot')
expect(cli.callOperation).toHaveBeenCalledWith(createProject, { name: 'Summer Shoot' })
expect(cli.stdout()).toBe(
'Created project "Summer Shoot" (ID: p-new, rootFolderId: root-new)\n',
)
await cli.run('project', 'create', 'Team Shoot', '-t', 't2', '--json')
expect(cli.callOperation).toHaveBeenLastCalledWith(createProject, {
name: 'Team Shoot',
teamId: 't2',
})
})
})
describe('ls', () => {
it('lists a folder with the maximum page size, folders first', async () => {
const cli = setup()