@vcp-dev/contracts 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +848 -83
- package/dist/index.js +1 -1
- package/dist/launcher-prompt-templates.d.ts +72 -6
- package/dist/page-template.d.ts +2 -26
- package/dist/site-edit-version.d.ts +1 -1
- package/dist/site-extra-requirement.d.ts +2 -2
- package/dist/site-workflow-completions.d.ts +95 -0
- package/dist/step2-site-initialization.d.ts +400 -0
- package/dist/step5-keyword-library.d.ts +142 -0
- package/dist/step5-strategy.d.ts +2397 -3186
- package/dist/workspace-attachment.d.ts +62 -0
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Workspace 聊天图片附件合同。附件是独立边界(不进 input-context 资料轨):
|
|
4
|
+
* 消息 `parts` 里只放 AI SDK `file` part 引用,`url` 是附件读图路径;字节只存 S3。
|
|
5
|
+
* 设计见 docs/superpowers/specs/2026-09-09-workspace-chat-image-attachments-design.md。
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE = 4;
|
|
8
|
+
/** 每站 24h 内未绑定(尚未随消息发送)的附件上限,超过则上传 409。 */
|
|
9
|
+
export declare const MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE = 20;
|
|
10
|
+
export declare const WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS: number;
|
|
11
|
+
/** 压缩收敛目标(base64 长度)。比首轮参考图的 5MiB 紧:迭代循环每步都重发内联图。 */
|
|
12
|
+
export declare const WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES = 1000000;
|
|
13
|
+
export declare const WORKSPACE_ATTACHMENT_MEDIA_TYPES: readonly ["image/png", "image/jpeg", "image/webp"];
|
|
14
|
+
export declare const WorkspaceAttachmentMediaTypeSchema: z.ZodEnum<{
|
|
15
|
+
"image/png": "image/png";
|
|
16
|
+
"image/jpeg": "image/jpeg";
|
|
17
|
+
"image/webp": "image/webp";
|
|
18
|
+
}>;
|
|
19
|
+
export type WorkspaceAttachmentMediaType = z.infer<typeof WorkspaceAttachmentMediaTypeSchema>;
|
|
20
|
+
export declare const WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE: "WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT";
|
|
21
|
+
export declare const WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE: "WORKSPACE_ATTACHMENT_TOO_LARGE";
|
|
22
|
+
export declare const WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE: "WORKSPACE_ATTACHMENT_LIMIT";
|
|
23
|
+
export declare const WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE: "WORKSPACE_ATTACHMENT_BOUND";
|
|
24
|
+
export declare const WorkspaceAttachmentSchema: z.ZodObject<{
|
|
25
|
+
attachment_id: z.ZodString;
|
|
26
|
+
media_type: z.ZodEnum<{
|
|
27
|
+
"image/png": "image/png";
|
|
28
|
+
"image/jpeg": "image/jpeg";
|
|
29
|
+
"image/webp": "image/webp";
|
|
30
|
+
}>;
|
|
31
|
+
width: z.ZodNumber;
|
|
32
|
+
height: z.ZodNumber;
|
|
33
|
+
size_bytes: z.ZodNumber;
|
|
34
|
+
filename: z.ZodString;
|
|
35
|
+
image_url: z.ZodString;
|
|
36
|
+
created_at: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type WorkspaceAttachment = z.infer<typeof WorkspaceAttachmentSchema>;
|
|
39
|
+
/** 附件读图路径的唯一事实源;web / api / agent 三方都只认这个形状。 */
|
|
40
|
+
export declare function workspaceAttachmentImagePath(site_id: string, attachment_id: string): string;
|
|
41
|
+
export declare function parseWorkspaceAttachmentImagePath(url: string): {
|
|
42
|
+
site_id: string;
|
|
43
|
+
attachment_id: string;
|
|
44
|
+
} | null;
|
|
45
|
+
export interface WorkspaceAttachmentReference {
|
|
46
|
+
attachment_id: string;
|
|
47
|
+
site_id: string;
|
|
48
|
+
media_type: string;
|
|
49
|
+
filename: string;
|
|
50
|
+
url: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 从 UIMessage parts 读出附件引用:只认 `file` part 且 `url` 能解析成附件路径。
|
|
54
|
+
* 结构化入参而非 `AiSdkUiMessagePart`,避免与 index.ts 循环依赖。
|
|
55
|
+
*/
|
|
56
|
+
export declare function readWorkspaceAttachmentReferences(parts: readonly {
|
|
57
|
+
type: string;
|
|
58
|
+
mediaType?: unknown;
|
|
59
|
+
filename?: unknown;
|
|
60
|
+
url?: unknown;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
}[]): WorkspaceAttachmentReference[];
|