Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(cindy-tools): bound publish status polling guidance

fmfsaisaia42f3a2ffae0
diff --git a/packages/cindy-tools/src/__tests__/ghostMcp.test.ts b/packages/cindy-tools/src/__tests__/ghostMcp.test.ts
index abff598006..16ceaf5452 100644
--- a/packages/cindy-tools/src/__tests__/ghostMcp.test.ts
+++ b/packages/cindy-tools/src/__tests__/ghostMcp.test.ts
@@ -1557,6 +1557,36 @@ describe("cindy_ghosts · ghost_forge(锻造)", () => {
).toMatchObject({ success: true });
});
+ it("registered forge_publish schema rejects file paths and accepts token only", () => {
+ const server = createCindyGhostsMcpServer(fakeDeps()) as unknown as {
+ _registeredTools: Record<
+ string,
+ {
+ inputSchema?: {
+ safeParse: (input: unknown) => { success: boolean };
+ };
+ } | undefined
+ >;
+ };
+ const inputSchema = server._registeredTools.ghost_forge_publish?.inputSchema;
+ expect(inputSchema).toBeDefined();
+ if (!inputSchema) throw new Error("ghost_forge_publish input schema 未注册");
+
+ // Excludes wiring the registered tool to a permissive or stale schema.
+ expect(inputSchema.safeParse({ file: "/tmp/arbitrary.cindy" }).success).toBe(
+ false,
+ );
+ expect(
+ inputSchema.safeParse({
+ token: "publish-token-1",
+ file: "/tmp/arbitrary.cindy",
+ }).success,
+ ).toBe(false);
+ expect(inputSchema.safeParse({ token: "publish-token-1" }).success).toBe(
+ true,
+ );
+ });
+
it("forge_publish_status 透传后台阶段", async () => {
const result = await handleForgePublishStatus(fakeDeps(), {
transferId: "transfer-1",
@@ -1582,6 +1612,20 @@ describe("cindy_ghosts · ghost_forge(锻造)", () => {
expect(publishDescription).toContain("仅企业组织成员可用");
expect(publishDescription).toContain("个人账号不可用");
});
+
+ it("forge_publish_status 在上传成功后收口,不守着轮询人工审核", () => {
+ const server = createCindyGhostsMcpServer(fakeDeps()) as unknown as {
+ _registeredTools: Record<string, { description?: string } | undefined>;
+ };
+ const description =
+ server._registeredTools.ghost_forge_publish_status?.description ?? "";
+
+ // Excludes guidance that keeps the Agent polling for an unbounded human review.
+ expect(description).toContain("status 变成 succeeded 即可");
+ expect(description).toContain("等待管理员审核并收口");
+ expect(description).toContain("等用户下次问起时再查一次");
+ expect(description).not.toContain("继续查到审核终态");
+ });
});
/**
diff --git a/packages/cindy-tools/src/ghost/mcpServer.ts b/packages/cindy-tools/src/ghost/mcpServer.ts
index 9dbbec4398..f48f760559 100644
--- a/packages/cindy-tools/src/ghost/mcpServer.ts
+++ b/packages/cindy-tools/src/ghost/mcpServer.ts
@@ -143,8 +143,8 @@ const D_GHOST_FORGE_PUBLISH = [
const D_GHOST_FORGE_PUBLISH_STATUS = [
"查询一次 ghost_forge_publish 后台传输的当前状态。transferId 来自 publish 的立即返回。",
- "status 变成 succeeded 之后 reviewStatus 仍可能从 pending 变为 approved / rejected,",
- "需要继续查到审核终态再向用户收口。errorCode / message 是自由字符串,读 message 向用户说明,",
+ "status 变成 succeeded 即可告知用户已提交、等待管理员审核并收口;不要守着轮询 reviewStatus,",
+ "等用户下次问起时再查一次。errorCode / message 是自由字符串,读 message 向用户说明,",
"不要按固定枚举分支。",
].join("\n");