create-windy 0.3.4 → 0.3.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.
- package/README.md +20 -3
- package/dist/cli.js +582 -109
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
- package/template/AGENTS.md +4 -0
- package/template/README.md +18 -11
- package/template/apps/server/src/application-services.ts +16 -0
- package/template/apps/server/src/data-governance/export/authorization-port.test.ts +5 -1
- package/template/apps/server/src/data-governance/export/drizzle-repository.integration.test.ts +2 -0
- package/template/apps/server/src/data-governance/export/drizzle-repository.ts +1 -0
- package/template/apps/server/src/data-governance/export/job-runtime.test.ts +3 -1
- package/template/apps/server/src/data-governance/export/job-runtime.ts +53 -14
- package/template/apps/server/src/data-governance/export/ndjson-stream.ts +8 -0
- package/template/apps/server/src/data-governance/export/postgres-recovery.integration.test.ts +2 -0
- package/template/apps/server/src/data-governance/export/renderer-job-runtime.test.ts +235 -0
- package/template/apps/server/src/data-governance/export/renderer-runtime.ts +293 -0
- package/template/apps/server/src/data-governance/export/renderer-selection.test.ts +67 -0
- package/template/apps/server/src/data-governance/export/repository.test.ts +2 -0
- package/template/apps/server/src/data-governance/export/request-fingerprint.test.ts +13 -0
- package/template/apps/server/src/data-governance/export/request-fingerprint.ts +2 -0
- package/template/apps/server/src/data-governance/export/routes.ts +11 -1
- package/template/apps/server/src/data-governance/export/service-support.ts +61 -4
- package/template/apps/server/src/data-governance/export/service.ts +8 -2
- package/template/apps/server/src/data-governance/export/types.ts +27 -0
- package/template/apps/server/src/index.ts +1 -0
- package/template/apps/server/src/jobs/artifact-service.test.ts +14 -2
- package/template/apps/server/src/jobs/artifact-service.ts +10 -0
- package/template/apps/server/src/jobs/drizzle-execution-repository.ts +17 -18
- package/template/apps/server/src/jobs/drizzle-execution.integration.test.ts +19 -1
- package/template/apps/server/src/jobs/drizzle-mappers.ts +3 -1
- package/template/apps/server/src/jobs/drizzle-recovery-repository.ts +49 -2
- package/template/apps/server/src/jobs/execution-repository.ts +17 -0
- package/template/apps/server/src/jobs/in-memory-control.ts +135 -0
- package/template/apps/server/src/jobs/in-memory-execution.ts +34 -65
- package/template/apps/server/src/jobs/worker.ts +27 -3
- package/template/apps/server/src/module-host/governed-export-route-support.ts +24 -5
- package/template/apps/server/src/module-host/governed-export-routes.test.ts +5 -1
- package/template/apps/server/src/module-host/governed-export-routes.ts +1 -2
- package/template/apps/server/src/module-host/governed-renderer-registration.test.ts +247 -0
- package/template/apps/server/src/module-host/governed-resources.test.ts +1 -0
- package/template/apps/server/src/module-host/governed-resources.ts +56 -0
- package/template/apps/server/src/module-host/http-runtime.ts +3 -0
- package/template/apps/server/src/module-host/job-port.test.ts +262 -0
- package/template/apps/server/src/module-host/job-port.ts +334 -0
- package/template/apps/server/src/module-host/request-context.ts +14 -26
- package/template/apps/server/src/module-host/route-installer.ts +11 -0
- package/template/apps/web/src/app/business-routes.ts +22 -0
- package/template/apps/web/src/components/common/AccessSnapshotBoundary.vue +112 -0
- package/template/apps/web/src/components/common/AccessSnapshotBoundary.webtest.ts +130 -0
- package/template/apps/web/src/components/common/AccessSnapshotNotice.vue +117 -0
- package/template/apps/web/src/composables/access-snapshot-change.ts +131 -0
- package/template/apps/web/src/composables/access-snapshot-change.webtest.ts +103 -0
- package/template/apps/web/src/composables/useAccessSnapshot.ts +48 -2
- package/template/apps/web/src/composables/useAccessSnapshot.webtest.ts +54 -0
- package/template/apps/web/src/composables/useAccessSnapshotMonitor.ts +42 -0
- package/template/apps/web/src/layout/AppShell.vue +28 -25
- package/template/apps/web/src/layout/AppShell.webtest.ts +1 -0
- package/template/apps/web/src/router/business-routes.ts +68 -0
- package/template/apps/web/src/router/business-routes.webtest.ts +85 -0
- package/template/apps/web/src/router/index.ts +7 -0
- package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +12 -0
- package/template/apps/web/src/services/access-api.ts +5 -1
- package/template/apps/web/src/services/access-api.webtest.ts +35 -0
- package/template/docs/architecture/ai-egress.md +12 -9
- package/template/docs/architecture/durable-jobs.md +7 -1
- package/template/docs/architecture/foundation-infrastructure.md +163 -0
- package/template/docs/architecture/module-host.md +115 -0
- package/template/docs/architecture/server-module-interface.md +39 -0
- package/template/docs/architecture/web-access-snapshot-resilience.md +60 -0
- package/template/docs/development/business-web-routes.md +66 -0
- package/template/docs/development/custom-login-page.md +3 -3
- package/template/docs/development/module-lifecycle.md +71 -0
- package/template/docs/operations/observability.md +5 -1
- package/template/docs/platform/agent-runtime.md +6 -6
- package/template/docs/platform/agent-tool-sandbox.md +58 -0
- package/template/docs/platform/document-ai-runtime.md +204 -0
- package/template/docs/platform/governed-export-renderers.md +132 -0
- package/template/docs/platform/navigation-registry.md +5 -0
- package/template/docs/platform/organization-membership.md +2 -1
- package/template/docs/platform/speech-ai-runtime.md +156 -0
- package/template/docs/platform/system-crud-api.md +7 -1
- package/template/docs/platform/vision-ai-runtime.md +97 -0
- package/template/docs/platform/web-system-crud.md +6 -0
- package/template/packages/config/package.json +1 -1
- package/template/packages/database/drizzle/0042_puzzling_rumiko_fujikawa.sql +27 -0
- package/template/packages/database/drizzle/meta/0042_snapshot.json +8541 -0
- package/template/packages/database/drizzle/meta/_journal.json +7 -0
- package/template/packages/database/package.json +1 -1
- package/template/packages/database/src/schema/durable-jobs.ts +1 -0
- package/template/packages/database/src/schema/governed-exports.ts +15 -0
- package/template/packages/database/src/schema-governed-exports.test.ts +21 -1
- package/template/packages/jobs/package.json +1 -1
- package/template/packages/jobs/src/handlers.ts +1 -0
- package/template/packages/jobs/src/types.ts +1 -0
- package/template/packages/modules/package.json +1 -1
- package/template/packages/server-sdk/index.ts +11 -0
- package/template/packages/server-sdk/package.json +1 -1
- package/template/packages/server-sdk/src/data-governance-registration.ts +46 -0
- package/template/packages/server-sdk/src/jobs-port.ts +69 -0
- package/template/packages/server-sdk/src/request-context.ts +2 -2
- package/template/packages/shared/package.json +1 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Speech AI Runtime
|
|
2
|
+
|
|
3
|
+
更新时间:2026-07-27。
|
|
4
|
+
|
|
5
|
+
Windy 的首个 Speech Runtime 只提供基于授权 `ArtifactRef` 的批量转写。实时 ASR、
|
|
6
|
+
TTS 和 Dictation 不在本切片内。业务模块持有音频资产、原消息关系、人工校正、翻译和
|
|
7
|
+
业务状态;平台持有身份授权、Operation 路由、运行时协议、配额与审计。
|
|
8
|
+
|
|
9
|
+
未安装或未配置 Speech Server 时,Speech Operation 稳定返回
|
|
10
|
+
`CAPABILITY_UNAVAILABLE`,不会回落到文本 Agent,也不阻止普通业务、Document 或文本
|
|
11
|
+
Agent 启动。
|
|
12
|
+
|
|
13
|
+
## 安全调用链
|
|
14
|
+
|
|
15
|
+
1. 业务模块注册音频资源的 `ModuleResourceFileAccessPolicy`,从 project-owned
|
|
16
|
+
Repository 回查 `resourceId`、`fileId` 与当前 Actor 的真实关系。
|
|
17
|
+
2. 模块路由调用 `context.aiArtifacts.issue(...)` 换取加密、短时、opaque
|
|
18
|
+
`ArtifactRef`。
|
|
19
|
+
3. `@southwind-ai/ai-client/speech` 只把 Artifact 与领域选项提交到同源 Southwind
|
|
20
|
+
Server。
|
|
21
|
+
4. Server 重新检查 Feature、Permission、License、数据范围、能力摘要和 Artifact
|
|
22
|
+
元数据,并按 Actor + Operation 作用域化幂等键。
|
|
23
|
+
5. Speech Server 从自身固定的内网 Artifact Endpoint 下载源文件;请求不能指定 URL。
|
|
24
|
+
6. Speech Server 使用 FFmpeg 把常见音频/视频容器归一化为 16 kHz、单声道、
|
|
25
|
+
PCM S16LE WAV,再调用已配置的本地/内网 Adapter。
|
|
26
|
+
|
|
27
|
+
禁止业务 Server 运行 Whisper/ASR/转码进程、直连语音 Provider,或把音频、Base64、
|
|
28
|
+
Blob Key、宿主路径、模型名、Endpoint 和 Secret 交给文本 Agent。
|
|
29
|
+
|
|
30
|
+
## Manifest 与 Module Handler
|
|
31
|
+
|
|
32
|
+
`kind=speech` Operation 必须声明:
|
|
33
|
+
|
|
34
|
+
- Feature、Permission、Audit、输入/输出 Schema;
|
|
35
|
+
- `speech.transcribe.batch` 及需要的 `speech.normalize`、`speech.vad`、
|
|
36
|
+
`speech.timestamps` capability;
|
|
37
|
+
- 数据分类、Deployment 与 Provider 出网策略;
|
|
38
|
+
- 输入/输出字节、处理时长、最大稳定分段数 `maxUnits` 和媒体时长
|
|
39
|
+
`maxMediaDurationSeconds`。
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const operation = {
|
|
43
|
+
key: "evidence.audio.transcribe",
|
|
44
|
+
kind: "speech",
|
|
45
|
+
featureKey: "evidence.audio.transcribe",
|
|
46
|
+
permissionKey: "evidence.audio.transcribe.execute",
|
|
47
|
+
auditAction: "evidence.audio.transcribe.execute",
|
|
48
|
+
inputSchemaKey: "evidence.audio.transcribe.input.v1",
|
|
49
|
+
outputSchemaKey: "evidence.audio.transcribe.output.v1",
|
|
50
|
+
requiredCapabilities: [
|
|
51
|
+
"speech.transcribe.batch",
|
|
52
|
+
"speech.normalize",
|
|
53
|
+
"speech.vad",
|
|
54
|
+
"speech.timestamps",
|
|
55
|
+
],
|
|
56
|
+
allowedToolKeys: [],
|
|
57
|
+
dataClassification: "sensitive",
|
|
58
|
+
execution: "background",
|
|
59
|
+
providerEgress: { mode: "forbidden" },
|
|
60
|
+
limits: {
|
|
61
|
+
maxDurationSeconds: 1800,
|
|
62
|
+
maxInputBytes: 512 * 1024 * 1024,
|
|
63
|
+
maxOutputBytes: 32 * 1024 * 1024,
|
|
64
|
+
maxUnits: 100000,
|
|
65
|
+
maxMediaDurationSeconds: 8 * 60 * 60,
|
|
66
|
+
},
|
|
67
|
+
} as const;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
同一 Operation 注册 `prepareSpeech`。Handler 只校验并收敛语言、VAD 与时间戳等领域
|
|
71
|
+
选项,不选择模型或 Deployment。受控出网时,选项先经过
|
|
72
|
+
`providerDataPolicy.inputFields` 裁剪/DLP;完全断网时 Adapter 仍只接受本地/内网地址。
|
|
73
|
+
|
|
74
|
+
## 输入、输出与事件
|
|
75
|
+
|
|
76
|
+
首批接受 FFmpeg 可探测且 MIME 属于 allowlist 的 MP3、M4A/MP4、WAV、OGG、FLAC、
|
|
77
|
+
WebM 音频或含音轨的视频。归一化失败、时长超限或内容损坏都返回稳定错误,不把 FFmpeg
|
|
78
|
+
stderr 暴露给业务。
|
|
79
|
+
|
|
80
|
+
选项:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
{
|
|
84
|
+
language?: string;
|
|
85
|
+
vad?: {
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
minSpeechMs?: number;
|
|
88
|
+
maxSilenceMs?: number;
|
|
89
|
+
};
|
|
90
|
+
timestamps?: "segment" | "word";
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Adapter 返回的分段会被 Runtime 重新校验和规范化:
|
|
95
|
+
|
|
96
|
+
- 稳定 ID 为 `segment-000001` 递增;
|
|
97
|
+
- segment 与 word 时间戳单调、非负且不超过素材时长;
|
|
98
|
+
- 文本不能为空,置信度必须在 0–1;
|
|
99
|
+
- 分段总数受 `maxUnits` 与 Runtime 双重配额约束;
|
|
100
|
+
- 输出只保留标量 metadata,并明确记录归一化格式。
|
|
101
|
+
|
|
102
|
+
事件协议:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
run.started
|
|
106
|
+
speech.segment.completed
|
|
107
|
+
run.completed | run.failed | run.cancelled
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
每个事件有单调 sequence。客户端断线后用 cursor 恢复;取消会写入终态并取消归一化或
|
|
111
|
+
Adapter 协程。相同幂等键和相同语义返回原 Run,语义漂移返回 `RUN_CONFLICT`。
|
|
112
|
+
|
|
113
|
+
## 结果 Artifact
|
|
114
|
+
|
|
115
|
+
完成后提供两个互补接口:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
GET /api/speech/runs/:runId/result
|
|
119
|
+
GET /api/speech/runs/:runId/artifact
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`result` 返回结构化转写及 Artifact 元数据;`artifact` 返回 Speech Server 持久化的同一
|
|
123
|
+
canonical JSON 字节流,包含 `content-length` 与 `x-content-sha256`。Artifact 下载仍需
|
|
124
|
+
平台 Run 所有权授权,使用 `private, no-store`,不暴露 Speech Server 路径或数据库。
|
|
125
|
+
|
|
126
|
+
结果包含 `durationMs`、可选语言、稳定 segments、词级时间戳、置信度和 metadata。
|
|
127
|
+
业务可以在通过输出 Schema 后把结果导入自己的事实表、保存来源回链并进入人工校正;
|
|
128
|
+
平台不会替业务保存消息关系或翻译状态。
|
|
129
|
+
|
|
130
|
+
## 部署
|
|
131
|
+
|
|
132
|
+
选择 `system.agent` 的 Starter 会分发独立 Speech Server。配置:
|
|
133
|
+
|
|
134
|
+
```dotenv
|
|
135
|
+
PLATFORM_ENABLE_AI=true
|
|
136
|
+
AGENT_SERVER_INTERNAL_TOKEN=<随机内部令牌>
|
|
137
|
+
AI_ARTIFACT_ENCRYPTION_SECRET=<至少 32 字符>
|
|
138
|
+
SPEECH_SERVER_URL=http://speech-server:8091
|
|
139
|
+
SPEECH_ARTIFACT_URL=http://server:9747/api/internal/ai/artifacts
|
|
140
|
+
SPEECH_ADAPTER_URL=http://asr.internal:9001
|
|
141
|
+
SPEECH_ADAPTER_TOKEN=<可选内部令牌>
|
|
142
|
+
SPEECH_ADAPTER_CAPABILITIES=speech.transcribe.batch,speech.normalize,speech.vad,speech.timestamps
|
|
143
|
+
SPEECH_MAX_UNITS=100000
|
|
144
|
+
SPEECH_MAX_MEDIA_DURATION_SECONDS=86400
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
受控 Provider 还需配置 `SPEECH_DEPLOYMENT_KEY`,且必须与 Manifest 完全一致。启动:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
bun run dev:speech
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Speech Server 自有 SQLite 保存 Run、cursor、终态转写和结果 Artifact,适合单副本。
|
|
154
|
+
健康检查需要内部 Bearer Token,只返回 capability 与非敏感 limits。Adapter、FFmpeg
|
|
155
|
+
或 FFprobe 不可用时返回 unavailable;完全断网 profile 使用已包含 FFmpeg 的镜像和
|
|
156
|
+
本地/内网 ASR Adapter,运行时不需要公网。
|
|
@@ -95,7 +95,13 @@ GET /api/system/audit-logs
|
|
|
95
95
|
- 配置 `DATABASE_URL` 后,系统资源使用 Drizzle Repository,启动时会按 `id` / `key` 幂等写入默认种子数据,不覆盖已有记录。
|
|
96
96
|
- Feature Flag 是受控资源:Key 和元数据由 Module Manifest 幂等同步,API 只允许修改 `enabled` / `visible`,不提供创建、导入或删除入口。Manifest 移除的 Key 会归档保留历史状态。
|
|
97
97
|
- Feature Guard 在配置数据库时按请求、按 Key 读取运行态;同一请求缓存结果,下一请求重新读取。开发无数据库时回退 Manifest,生产无数据库或读取失败时 fail closed。
|
|
98
|
-
- CRUD 成功和权限拒绝会先进入进程内审计 sink;配置 `DATABASE_URL` 后由可靠写入器写入 PostgreSQL `audit_logs`。普通事件持续失败时业务继续并告警;用户、角色、License 与 Feature Flag
|
|
98
|
+
- CRUD 成功和权限拒绝会先进入进程内审计 sink;配置 `DATABASE_URL` 后由可靠写入器写入 PostgreSQL `audit_logs`。普通事件持续失败时业务继续并告警;用户、角色、License 与 Feature Flag 等关键变更必须落库或进入本地原子恢复队列。
|
|
99
|
+
|
|
100
|
+
<!-- @windy-module system.audit begin -->
|
|
101
|
+
|
|
102
|
+
策略、状态和恢复步骤见 [平台审计可靠写入](./audit-reliability.md)。
|
|
103
|
+
<!-- @windy-module system.audit end -->
|
|
104
|
+
|
|
99
105
|
- 密码登录、服务端会话、退出和吊销已闭环;通用用户 CRUD 不读写或返回密码 hash,密码更新走受权限保护的认证 API。
|
|
100
106
|
|
|
101
107
|
<!-- @windy-module system.license begin -->
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Vision AI Runtime
|
|
2
|
+
|
|
3
|
+
更新时间:2026-07-27。
|
|
4
|
+
|
|
5
|
+
Windy 的首个 Vision 切片在现有 Agent canonical Run 上增加受治理的图片 Artifact 输入,
|
|
6
|
+
用于图片内容理解和结构化视觉提取。它不新增由业务选择模型的 `vision` kind:
|
|
7
|
+
`agent.vision.*` 仍是 `kind=agent` 的流式语义;`document.parse.multimodal` 仍是
|
|
8
|
+
`kind=document` 的异步页级语义。相同 VLM Deployment 可以承载两者,但不能混用
|
|
9
|
+
路由、结果契约或业务状态。
|
|
10
|
+
|
|
11
|
+
## 不变量
|
|
12
|
+
|
|
13
|
+
- 浏览器和业务模块只提交平台签发的 opaque `ArtifactRef`,不能提交 URL、Base64、
|
|
14
|
+
BlobStore Key、宿主路径、模型名或 Provider Endpoint。
|
|
15
|
+
- Southwind Server 在 Feature、Permission、License、数据范围通过后重新打开资源,
|
|
16
|
+
校验 MIME、字节数与 SHA-256,再为 Agent Server 轮换短时引用。
|
|
17
|
+
- Agent Server 只从固定 `AI_ARTIFACT_URL` 内网入口读取图片,拒绝调用方 URL。
|
|
18
|
+
- 只接受 JPEG、PNG、WebP;解码后强制检查图片数量、总字节与单图像素。
|
|
19
|
+
- 图片解码后统一转成无 EXIF/ICC/文件名的 PNG,再作为 OpenAI-compatible
|
|
20
|
+
`image_url` typed content part 发送;不会拼接进文本 Prompt。
|
|
21
|
+
- 每次 Provider attempt 都要求 `artifact-content` allowlist、执行字段 DLP,并记录
|
|
22
|
+
Deployment、Operation、Run、attempt、分类、发送字节和 allow/redact/reject 决策。
|
|
23
|
+
|
|
24
|
+
## Manifest
|
|
25
|
+
|
|
26
|
+
Vision Operation 必须显式声明输入模态、能力和双重资源上限:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
{
|
|
30
|
+
key: "evidence.image.inspect",
|
|
31
|
+
kind: "agent",
|
|
32
|
+
inputModalities: ["text", "image"],
|
|
33
|
+
requiredCapabilities: ["text-generation", "vision"],
|
|
34
|
+
providerEgress: {
|
|
35
|
+
mode: "configured-endpoint",
|
|
36
|
+
deploymentKey: "ai.openai-compatible"
|
|
37
|
+
},
|
|
38
|
+
providerDataPolicy: {
|
|
39
|
+
inputFields: [/* project-owned JSON Pointer allowlist */],
|
|
40
|
+
envelopeFields: [
|
|
41
|
+
{ field: "instructions", classification: "internal", dlpAction: "reject" },
|
|
42
|
+
{ field: "user-prompt", classification: "internal", dlpAction: "redact" },
|
|
43
|
+
{ field: "artifact-content", classification: "sensitive", dlpAction: "reject" },
|
|
44
|
+
{ field: "output-schema", classification: "internal", dlpAction: "reject" },
|
|
45
|
+
{ field: "provider-output", classification: "sensitive", dlpAction: "redact" }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
limits: {
|
|
49
|
+
maxDurationSeconds: 120,
|
|
50
|
+
maxInputBytes: 32 * 1024 * 1024,
|
|
51
|
+
maxOutputBytes: 1024 * 1024,
|
|
52
|
+
maxArtifacts: 8,
|
|
53
|
+
maxPixelsPerArtifact: 24_000_000
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
未声明 `image`、数量或像素上限时,Manifest 组合直接失败。运行时还会把
|
|
59
|
+
`kind=agent`、`inputModalities` 和 `requiredCapabilities` 发给 Agent Server;当前
|
|
60
|
+
Deployment 缺少任一项时返回 `MODEL_ROUTE_UNAVAILABLE`,不能静默落到文本模型。
|
|
61
|
+
|
|
62
|
+
## 结构化输出
|
|
63
|
+
|
|
64
|
+
Module Handler 可以在执行计划中提供受限 JSON Schema:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
return {
|
|
68
|
+
instructions: "只根据图片中可见内容提取,不推测身份。",
|
|
69
|
+
userPrompt: "提取票据字段并标出无法确认的值。",
|
|
70
|
+
outputSchema: {
|
|
71
|
+
type: "object",
|
|
72
|
+
additionalProperties: false,
|
|
73
|
+
required: ["fields"],
|
|
74
|
+
properties: {
|
|
75
|
+
fields: { type: "array", items: { type: "object" } },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
平台限制 Schema 为 256 KiB,并以 Manifest `outputSchemaKey` 关联审计。Agent Server
|
|
82
|
+
通过 OpenAI-compatible `response_format=json_schema` 发送,终态前再次用 JSON Schema
|
|
83
|
+
校验;无效 JSON 或不匹配结果以 `OUTPUT_VALIDATION_FAILED` 结束,不能把未经校验的对象
|
|
84
|
+
交给业务。业务仍须用 `AgentOperation.parseOutput` 收窄远端值并保存来源回链、人工复核
|
|
85
|
+
和领域状态。
|
|
86
|
+
|
|
87
|
+
## 部署
|
|
88
|
+
|
|
89
|
+
```dotenv
|
|
90
|
+
AI_ARTIFACT_URL=http://server:9747/api/internal/ai/artifacts
|
|
91
|
+
AI_PROVIDER_CAPABILITIES=text-generation,vision
|
|
92
|
+
AI_PROVIDER_INPUT_MODALITIES=text,image
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
VLM 可以是 localhost、内网或经 allowlist 授权的 HTTPS Deployment。完全断网环境使用
|
|
96
|
+
本地/内网 OpenAI-compatible VLM;图片回取与 Provider 调用均不需要公网。未配置 VLM
|
|
97
|
+
能力时普通文本 Agent、Document、Speech 和非 AI 业务继续独立运行。
|
|
@@ -89,7 +89,13 @@ VITE_DEV_ADMIN_TOKEN=<显式开发 Token>
|
|
|
89
89
|
- 系统资源表和字典后台任务表加载时保留表头与列宽,并显示带 `animate-pulse` 的骨架行;加载失败和空数据仍使用各自独立状态。
|
|
90
90
|
- 全局水印与业务页面范围默认开启。管理员在“全局设置”中维护总开关、低/中/高密度,并勾选用户名、姓名、手机号、邮箱或最多 80 个字符的自定义内容;保存写入审计并立即成为所有用户的只读策略。客户端按旋转文本包围盒自动计算平铺尺寸与安全间距,长内容和高密度模式也不会相互重叠。用户应用端不提供开关,也不使用 localStorage。`system.watermark` Feature 控制最终生效态,管理区另需 `system.watermark.read/manage` 权限。水印使用专用审计顶层覆盖 Sidebar、Drawer、Overlay 和 Modal,同时保持 `pointer-events-none`。服务端只向当前用户自己的会话响应补充这些身份字段。
|
|
91
91
|
- 站内通知由 PostgreSQL `platform_notifications`、`notification_revisions`、`notification_reads` 和 `notification_favorites` 持久化;管理人员可在 `/system/notifications` 广播发布、修改、查看版本历史和归档,用户从 Header 收件箱阅读正文并幂等写入相互独立的已读、收藏回执。修改会生成带服务端时间和 Actor 的完整不可变快照,无内容变化不增加版本。普通用户 API 支持关键词、分类、已读和收藏的服务端组合筛选,列表与 `total` 使用同一可见性范围。归档是生命周期操作,不物理删除通知、版本或回执。
|
|
92
|
+
|
|
93
|
+
<!-- @windy-module system.bulk-data begin -->
|
|
94
|
+
|
|
92
95
|
- 字典页已切换为后台 NDJSON 导入导出,展示本人任务状态、进度、重试和终态文件下载;其它系统资源仍保留小数据同步 JSON 入口。详细契约见 [批量导入导出后台任务](./bulk-data-jobs.md)。当前 artifact 存在 10 MiB、50,000 行和 256 KiB 单行上限,扩大容量前需要对象存储 Adapter。
|
|
96
|
+
|
|
97
|
+
<!-- @windy-module system.bulk-data end -->
|
|
98
|
+
|
|
93
99
|
- 审计日志配置 `DATABASE_URL` 后读取 PostgreSQL `audit_logs`。可靠写入器提供有界重试、降级状态、关键事件本地恢复队列和健康信息;页面仍只读,且不会展示恢复队列中的事件正文。
|
|
94
100
|
- 运维页的定时任务来自真实代码注册和 PostgreSQL 状态,不允许在线编辑任务代码。当前基线的 `stale` 只做观察告警和人工处置提示,不会自动终止或重试。
|
|
95
101
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
ALTER TABLE "durable_job_artifacts" ADD COLUMN "metadata" jsonb;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "governed_export_requests" ADD COLUMN "renderer" jsonb;--> statement-breakpoint
|
|
3
|
+
UPDATE "governed_export_requests"
|
|
4
|
+
SET "renderer" = jsonb_build_object(
|
|
5
|
+
'formatKey', 'ndjson',
|
|
6
|
+
'templateKey', 'system.governed-export.ndjson',
|
|
7
|
+
'templateVersion', '1',
|
|
8
|
+
'inputSchemaKey', 'system.governed-export.record.v1',
|
|
9
|
+
'contentType', 'application/x-ndjson',
|
|
10
|
+
'filenameExtension', 'ndjson',
|
|
11
|
+
'maxRecords', 50000,
|
|
12
|
+
'maxOutputBytes', 10485760,
|
|
13
|
+
'timeoutSeconds', 900
|
|
14
|
+
)
|
|
15
|
+
WHERE "renderer" IS NULL;--> statement-breakpoint
|
|
16
|
+
UPDATE "durable_job_artifacts" AS artifact
|
|
17
|
+
SET "metadata" = jsonb_build_object(
|
|
18
|
+
'formatKey', request."renderer" ->> 'formatKey',
|
|
19
|
+
'templateKey', request."renderer" ->> 'templateKey',
|
|
20
|
+
'templateVersion', request."renderer" ->> 'templateVersion',
|
|
21
|
+
'inputSchemaKey', request."renderer" ->> 'inputSchemaKey'
|
|
22
|
+
)
|
|
23
|
+
FROM "governed_export_requests" AS request
|
|
24
|
+
WHERE request."durable_job_id" = artifact."job_id"
|
|
25
|
+
AND artifact."kind" = 'governed-export'
|
|
26
|
+
AND artifact."metadata" IS NULL;--> statement-breakpoint
|
|
27
|
+
ALTER TABLE "governed_export_requests" ALTER COLUMN "renderer" SET NOT NULL;
|