071faa482c
纳入 AGC Cargo workspace 的统一 rustfmt 检查与格式化入口 完成项目 TypeScript/Prettier 与 Rust 全量格式化 修复 Pingora expected executable 门禁的空白敏感误报 同步开发运维文档与 AGC skill pack 格式化忽略规则
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import type { ListRpgCreationWorksResponse } from '../../../packages/shared/src';
|
|
import {
|
|
requestRpgCreationRuntimeJson,
|
|
type RpgCreationRuntimeRequestOptions,
|
|
} from './rpgCreationRuntimeClient';
|
|
|
|
export async function listRpgCreationWorks(
|
|
options: RpgCreationRuntimeRequestOptions = {},
|
|
) {
|
|
const response =
|
|
await requestRpgCreationRuntimeJson<ListRpgCreationWorksResponse>(
|
|
'/custom-world/works',
|
|
{ method: 'GET' },
|
|
'读取创作作品列表失败',
|
|
options,
|
|
);
|
|
|
|
return Array.isArray(response?.items) ? response.items : [];
|
|
}
|
|
|
|
export async function deleteRpgCreationAgentSession(sessionId: string) {
|
|
const response =
|
|
await requestRpgCreationRuntimeJson<ListRpgCreationWorksResponse>(
|
|
`/custom-world/agent/sessions/${encodeURIComponent(sessionId)}`,
|
|
{ method: 'DELETE' },
|
|
'删除 RPG 草稿失败',
|
|
);
|
|
|
|
return Array.isArray(response?.items) ? response.items : [];
|
|
}
|
|
|
|
/**
|
|
* 工作包 D 把作品列表请求正式迁入 RPG 创作域 client。
|
|
*/
|
|
export const rpgCreationWorkClient = {
|
|
deleteAgentSession: deleteRpgCreationAgentSession,
|
|
listWorks: listRpgCreationWorks,
|
|
};
|