@vcp-dev/contracts 0.10.4 → 0.10.5

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.
@@ -29,6 +29,14 @@ export declare const ERROR_COPY: {
29
29
  readonly WORKSPACE_INITIAL_GENERATION_CHECK_FAILED: "Initial generation could not be verified. Please retry.";
30
30
  readonly WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED: "Initial generation could not finalize. Please retry.";
31
31
  readonly WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED: "Initial generation failed quality checks. Please regenerate the site.";
32
+ readonly WORKSPACE_CHECK_INCOMPLETE: "The check couldn't complete, so no page was delivered this round. Please regenerate the site.";
33
+ readonly WORKSPACE_RUN_RESUME_EXHAUSTED: "Generation was interrupted several times and stopped. Everything already saved is kept; you can regenerate the missing pages.";
34
+ readonly WORKSPACE_GENERATION_STOPPED: "You stopped this generation before any page was ready. Nothing was lost — start it again when you want.";
35
+ readonly WORKSPACE_FILL_IN_INTERRUPTED: "The fill-in run was interrupted and stopped. Your site is unchanged; select the targets again to retry.";
36
+ readonly WORKSPACE_RUN_LEASE_SUPERSEDED: "Another attempt took over this run, so this one stopped. Reload to see the current progress.";
37
+ readonly FILL_IN_NOT_AVAILABLE: "Fill-in is available after the site has been generated.";
38
+ readonly FILL_IN_TARGET_NOT_OMITTED: "One of the selected items is no longer listed as missing. Reload the omissions list and try again.";
39
+ readonly FILL_IN_TARGET_MODIFIED: "One of the selected items was changed or removed after generation, so it was not filled in. Your edits are kept.";
32
40
  readonly WORKSPACE_ITERATION_QUALITY_GATE_FAILED: "Quality check failed. The change was rolled back; try a smaller or more specific request.";
33
41
  readonly WORKSPACE_SOCKET_DEAD: "The workspace connection was lost. Please retry.";
34
42
  readonly WORKSPACE_RUN_CANCELLED: "The run was cancelled.";
@@ -64,6 +72,21 @@ export declare const ERROR_COPY: {
64
72
  readonly SANDBOX_RUNTIME_NOT_READY: "The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.";
65
73
  readonly GENERIC: "Something went wrong. Please try again.";
66
74
  };
75
+ /**
76
+ * 「这一轮是用户自己停下来的」那一组终态码。
77
+ *
78
+ * 两个码指向同一件事,只是入口不同:`WORKSPACE_RUN_CANCELLED` 来自
79
+ * `POST /agent-runs/workspace/cancel` 的硬取消,`WORKSPACE_GENERATION_STOPPED`
80
+ * 来自软停止(用户按停止、这一轮自己保存好已完成的页面后收尾,或租约已经不活
81
+ * 时由服务端补的终态)。界面必须对两者一视同仁:显示「已取消」终态、不提供
82
+ * 重试——把用户自己按的停止渲染成一条带重试按钮的错误,是在报一个不存在的故障。
83
+ *
84
+ * 只列一次,消费方按这里判定,避免某个分支只认其中一个码。
85
+ */
86
+ export declare const USER_STOPPED_RUN_ERROR_CODES: readonly ["WORKSPACE_RUN_CANCELLED", "WORKSPACE_GENERATION_STOPPED"];
87
+ export type UserStoppedRunErrorCode = (typeof USER_STOPPED_RUN_ERROR_CODES)[number];
88
+ /** 这个终态码是不是「用户自己停的」。空值一律 false。 */
89
+ export declare function isUserStoppedRunErrorCode(code: string | null | undefined): code is UserStoppedRunErrorCode;
67
90
  export declare const REFUSAL_COPY: {
68
91
  readonly UNDO_OR_ROLLBACK: "I can't roll back from chat. Use the version history at the top right to pick a restore point.";
69
92
  readonly HISTORY_RECALL: "Tell me what you'd like to change now—I'll work from the current page state.";
@@ -21,6 +21,26 @@ export declare const WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE: "WORKSP
21
21
  export declare const WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE: "WORKSPACE_ATTACHMENT_TOO_LARGE";
22
22
  export declare const WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE: "WORKSPACE_ATTACHMENT_LIMIT";
23
23
  export declare const WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE: "WORKSPACE_ATTACHMENT_BOUND";
24
+ /**
25
+ * 站点每小时网址截图次数上限。上传是免费的,截图消耗 Firecrawl credits:既有的
26
+ * 「每消息 4 张」与「24h 未发送 20 张」都不是按花钱次数设计的闸门,这条专门用来
27
+ * 兜住刷截图。
28
+ */
29
+ export declare const MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR = 10;
30
+ /** 频控窗口。 */
31
+ export declare const WORKSPACE_URL_CAPTURE_WINDOW_MS: number;
32
+ /** 网址不可截图(非 http(s) / 解析失败 / SSRF 拒绝)。 */
33
+ export declare const WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE: "WORKSPACE_ATTACHMENT_URL_REJECTED";
34
+ /** 目标不可达、被目标站拦截,或供应商没返回截图。 */
35
+ export declare const WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE: "WORKSPACE_ATTACHMENT_CAPTURE_FAILED";
36
+ /** 抓取供应商并发已满,稍后可重试。 */
37
+ export declare const WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE: "WORKSPACE_ATTACHMENT_CAPTURE_BUSY";
38
+ /** 截图超时。 */
39
+ export declare const WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE: "WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT";
40
+ /** 站点频控或租户日 credits 预算耗尽。 */
41
+ export declare const WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE: "WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_EXCEEDED";
42
+ /** 未配置抓取服务或对象存储,截图能力整体不可用。 */
43
+ export declare const WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE: "WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE";
24
44
  export declare const WorkspaceAttachmentSchema: z.ZodObject<{
25
45
  attachment_id: z.ZodString;
26
46
  media_type: z.ZodEnum<{
@@ -33,9 +53,16 @@ export declare const WorkspaceAttachmentSchema: z.ZodObject<{
33
53
  size_bytes: z.ZodNumber;
34
54
  filename: z.ZodString;
35
55
  image_url: z.ZodString;
56
+ source_url: z.ZodOptional<z.ZodString>;
36
57
  created_at: z.ZodString;
37
58
  }, z.core.$strict>;
38
59
  export type WorkspaceAttachment = z.infer<typeof WorkspaceAttachmentSchema>;
60
+ /** 网址截图请求体。`full_page` 缺省为真:整页截图。 */
61
+ export declare const WorkspaceAttachmentFromUrlRequestSchema: z.ZodObject<{
62
+ url: z.ZodString;
63
+ full_page: z.ZodOptional<z.ZodBoolean>;
64
+ }, z.core.$strict>;
65
+ export type WorkspaceAttachmentFromUrlRequest = z.infer<typeof WorkspaceAttachmentFromUrlRequestSchema>;
39
66
  /** 附件读图路径的唯一事实源;web / api / agent 三方都只认这个形状。 */
40
67
  export declare function workspaceAttachmentImagePath(site_id: string, attachment_id: string): string;
41
68
  export declare function parseWorkspaceAttachmentImagePath(url: string): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcp-dev/contracts",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {