@openprd/cli 0.1.10 → 0.1.18
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/.openprd/benchmarks/index.md +17 -15
- package/.openprd/benchmarks/sources.yaml +53 -1
- package/.openprd/changes/adaptive-project-framing/.openprd.yaml +2 -0
- package/.openprd/changes/adaptive-project-framing/design.md +47 -0
- package/.openprd/changes/adaptive-project-framing/proposal.md +35 -0
- package/.openprd/changes/adaptive-project-framing/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/adaptive-project-framing/task-events.jsonl +20 -0
- package/.openprd/changes/adaptive-project-framing/tasks.md +340 -0
- package/.openprd/changes/docs-anti-pollution-and-design-direction-review/.openprd.yaml +2 -0
- package/.openprd/changes/docs-anti-pollution-and-design-direction-review/design.md +34 -0
- package/.openprd/changes/docs-anti-pollution-and-design-direction-review/proposal.md +23 -0
- package/.openprd/changes/docs-anti-pollution-and-design-direction-review/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/docs-anti-pollution-and-design-direction-review/task-events.jsonl +14 -0
- package/.openprd/changes/docs-anti-pollution-and-design-direction-review/tasks.md +238 -0
- package/.openprd/changes/loop-isolated-worktree-commit/.openprd.yaml +2 -0
- package/.openprd/changes/loop-isolated-worktree-commit/design.md +53 -0
- package/.openprd/changes/loop-isolated-worktree-commit/proposal.md +38 -0
- package/.openprd/changes/loop-isolated-worktree-commit/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/loop-isolated-worktree-commit/task-events.jsonl +22 -0
- package/.openprd/changes/loop-isolated-worktree-commit/tasks.md +357 -0
- package/.openprd/changes/openprd/.openprd.yaml +2 -0
- package/.openprd/changes/openprd/design.md +46 -0
- package/.openprd/changes/openprd/proposal.md +36 -0
- package/.openprd/changes/openprd/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/openprd/task-events.jsonl +23 -0
- package/.openprd/changes/openprd/tasks.md +242 -0
- package/.openprd/changes/pm-human-in-the-loop/.openprd.yaml +2 -0
- package/.openprd/changes/pm-human-in-the-loop/design.md +38 -0
- package/.openprd/changes/pm-human-in-the-loop/proposal.md +29 -0
- package/.openprd/changes/pm-human-in-the-loop/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/pm-human-in-the-loop/task-events.jsonl +18 -0
- package/.openprd/changes/pm-human-in-the-loop/tasks.md +306 -0
- package/.openprd/changes/test-strategy-router/.openprd.yaml +2 -0
- package/.openprd/changes/test-strategy-router/design.md +65 -0
- package/.openprd/changes/test-strategy-router/proposal.md +45 -0
- package/.openprd/changes/test-strategy-router/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/test-strategy-router/task-events.jsonl +1 -0
- package/.openprd/changes/test-strategy-router/tasks.md +132 -0
- package/.openprd/changes/verify-boundaries-and-historical-refresh/.openprd.yaml +2 -0
- package/.openprd/changes/verify-boundaries-and-historical-refresh/design.md +28 -0
- package/.openprd/changes/verify-boundaries-and-historical-refresh/proposal.md +23 -0
- package/.openprd/changes/verify-boundaries-and-historical-refresh/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/verify-boundaries-and-historical-refresh/task-events.jsonl +11 -0
- package/.openprd/changes/verify-boundaries-and-historical-refresh/tasks.md +66 -0
- package/.openprd/changes/vibe-coding-dev-check/.openprd.yaml +2 -0
- package/.openprd/changes/vibe-coding-dev-check/design.md +37 -0
- package/.openprd/changes/vibe-coding-dev-check/proposal.md +28 -0
- package/.openprd/changes/vibe-coding-dev-check/specs/agent-requirements/spec.md +16 -0
- package/.openprd/changes/vibe-coding-dev-check/task-events.jsonl +18 -0
- package/.openprd/changes/vibe-coding-dev-check/tasks.md +306 -0
- package/.openprd/design/README.md +11 -6
- package/.openprd/design/README_EN.md +4 -1
- package/.openprd/design/active/asset-spec.md +6 -0
- package/.openprd/design/active/direction-plan.md +5 -5
- package/.openprd/design/active/selected-direction.md +2 -0
- package/.openprd/design/anti-slop.md +26 -1
- package/.openprd/design/assets/surface-presets.md +6 -0
- package/.openprd/design/checklists/ui-quality-gate.md +7 -0
- package/.openprd/design/lenses/frontend-lenses.md +28 -0
- package/.openprd/design/recipes/content-experience.md +8 -1
- package/.openprd/design/recipes/operational-tool.md +7 -0
- package/.openprd/design/recipes/product-launch.md +8 -1
- package/.openprd/design/templates/README.md +6 -3
- package/.openprd/design/templates/README_EN.md +6 -3
- package/.openprd/design/templates/ops-dashboard.html +8 -1
- package/.openprd/design/templates/product-launch.html +2 -1
- package/.openprd/design/themes/theme-catalog.json +23 -5
- package/.openprd/engagements/active/prd.md +103 -100
- package/.openprd/schema/prd.schema.yaml +15 -0
- package/.openprd/standards/config.json +7 -1
- package/.openprd/templates/base/intake.md +13 -0
- package/.openprd/templates/base/prd.md +15 -0
- package/AGENTS.md +14 -4
- package/README.md +107 -14
- package/README_EN.md +131 -13
- package/package.json +1 -1
- package/scripts/dev-check-wrapup-copy.mjs +46 -21
- package/skills/openprd-benchmark-router/SKILL.md +2 -1
- package/skills/openprd-diagram-review/SKILL.md +27 -2
- package/skills/openprd-diagram-review/references/explanation-svg-patterns.md +131 -0
- package/skills/openprd-discovery-loop/SKILL.md +2 -2
- package/skills/openprd-frontend-design/SKILL.md +44 -20
- package/skills/openprd-frontend-design/references/design-asset-contract.md +6 -0
- package/skills/openprd-frontend-design/references/direction-engine.md +29 -4
- package/skills/openprd-harness/SKILL.md +22 -16
- package/skills/openprd-quality/SKILL.md +10 -8
- package/skills/openprd-requirement-intake/SKILL.md +5 -3
- package/skills/openprd-requirement-intake/references/prd-template-lenses.md +2 -2
- package/skills/openprd-requirement-intake/references/startup-validation-lens.md +98 -13
- package/skills/openprd-router/SKILL.md +2 -1
- package/skills/openprd-shared/SKILL.md +27 -17
- package/skills/openprd-standards/SKILL.md +4 -2
- package/src/agent-canonical-content.js +808 -0
- package/src/agent-integration.js +259 -778
- package/src/brainstorm-artifacts.js +156 -8
- package/src/brainstorm-presentation.js +14 -4
- package/src/brainstorm.js +165 -2
- package/src/canvas-app.html.js +2910 -0
- package/src/canvas-i18n.js +274 -0
- package/src/canvas-workspace.js +2271 -0
- package/src/cli/args.js +72 -4
- package/src/cli/basic-print.js +3 -0
- package/src/cli/canvas-print.js +106 -0
- package/src/cli/doctor-print.js +20 -0
- package/src/cli/print.js +2 -0
- package/src/cli/quality-commands.js +222 -0
- package/src/cli/quality-print.js +37 -5
- package/src/cli/run-print.js +5 -0
- package/src/cli/workflow-print.js +3 -0
- package/src/codex-app-server-relay.js +251 -0
- package/src/codex-hook-runner-template.mjs +963 -65
- package/src/design-starter-support.js +2 -2
- package/src/design-starter.js +39 -3
- package/src/dev-standards.js +125 -10
- package/src/diagram-core.js +390 -171
- package/src/discovery.js +2 -8
- package/src/docs-compact.js +125 -0
- package/src/execution-strategy.js +1 -1
- package/src/fleet.js +9 -3
- package/src/guide.js +227 -0
- package/src/html-artifacts.js +825 -51
- package/src/knowledge.js +101 -20
- package/src/language-policy.js +63 -3
- package/src/learning-review.js +1 -1
- package/src/loop.js +1 -1
- package/src/openprd.js +68 -131
- package/src/openspec/change-validate.js +2 -2
- package/src/openspec/constants.js +6 -7
- package/src/openspec/execute.js +2 -2
- package/src/openspec/generate.js +318 -102
- package/src/openspec/migration.js +168 -0
- package/src/openspec/paths.js +1 -22
- package/src/prd-core.js +102 -3
- package/src/quality-html-artifact.js +30 -5
- package/src/quality-visual-review.js +257 -14
- package/src/quality.js +66 -18
- package/src/review-presentation.js +60 -0
- package/src/run-harness.js +41 -3
- package/src/session-evidence.js +363 -0
- package/src/standards.js +64 -0
- package/src/test-strategy.js +7 -4
- package/src/visual-compare-centering.js +622 -0
- package/src/visual-compare-core.js +1123 -0
- package/src/visual-compare.js +620 -698
- package/src/workspace-core.js +132 -4
- package/src/workspace-workflow.js +172 -10
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Core purpose
|
|
3
|
+
* Provide locale copy for the OpenPrd canvas browser app.
|
|
4
|
+
*
|
|
5
|
+
* Inputs
|
|
6
|
+
* Receives locale strings from browser/system preferences or explicit user
|
|
7
|
+
* choice.
|
|
8
|
+
*
|
|
9
|
+
* Outputs
|
|
10
|
+
* Normalized locale codes and UI copy dictionaries for the canvas shell.
|
|
11
|
+
*
|
|
12
|
+
* Positioning
|
|
13
|
+
* This module keeps presentation copy outside canvas-app.html.js so adding
|
|
14
|
+
* locales does not expand the browser template logic.
|
|
15
|
+
*
|
|
16
|
+
* Maintenance rules
|
|
17
|
+
* Keep labels short because the canvas topbar is dense. Add new locale keys to
|
|
18
|
+
* both Chinese and English together.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const CANVAS_LOCALE_STORAGE_KEY = 'openprd-canvas-locale';
|
|
22
|
+
const CANVAS_DEFAULT_LOCALE = 'zh-CN';
|
|
23
|
+
|
|
24
|
+
const CANVAS_LOCALES = {
|
|
25
|
+
'zh-CN': {
|
|
26
|
+
appSubtitle: '对话协同画布',
|
|
27
|
+
openingTitle: '正在打开 OpenPrd 画布',
|
|
28
|
+
openingBody: '画布会自动绑定当前对话记录。',
|
|
29
|
+
bootErrorTitle: '画布启动失败',
|
|
30
|
+
bootErrorBody: '请刷新页面;如果仍失败,把下面这段错误发给 Agent。',
|
|
31
|
+
loadingTitle: '正在同步画布',
|
|
32
|
+
loadingBody: '读取本次对话绑定的画布状态。',
|
|
33
|
+
loadErrorTitle: '画布加载失败',
|
|
34
|
+
canvasActionsTitle: '画布操作',
|
|
35
|
+
personalLibraryTitle: '个人素材库',
|
|
36
|
+
reviewBoardTitle: '评审协同',
|
|
37
|
+
reviewGuideStage: '第 {index}/{total} 步 · {title}',
|
|
38
|
+
reviewGuideNext: '下一步:{action}',
|
|
39
|
+
importReviewDirections: '导入评审方向',
|
|
40
|
+
importingReviewDirections: '正在导入...',
|
|
41
|
+
reviewDirectionsImported: '已把 {count} 个交互方向摆上画布,圈选批注后发送给 Codex。',
|
|
42
|
+
reviewDirectionsEmpty: '当前评审还没有交互方向,先让 Agent 生成 3 个方向。',
|
|
43
|
+
reviewDirectionsFailed: '暂时无法读取评审方向,请稍后再试。',
|
|
44
|
+
reviewDirectionSelectedTag: '已选定',
|
|
45
|
+
aiImageTemplatesTitle: 'AI 生图模板',
|
|
46
|
+
saveCanvas: '导出文件',
|
|
47
|
+
exportImage: '导出图片',
|
|
48
|
+
resetCanvas: '重置画布',
|
|
49
|
+
openLibrary: '个人素材库',
|
|
50
|
+
blankCard: '空白卡片',
|
|
51
|
+
savingCanvas: '正在导出文件...',
|
|
52
|
+
savedCanvas: '已导出到下载文件夹:{filename}',
|
|
53
|
+
openContainingFolder: '打开所在文件夹',
|
|
54
|
+
openingFolder: '正在打开...',
|
|
55
|
+
openFolderFailed: '暂时无法打开所在文件夹,请手动查看会话导出目录。',
|
|
56
|
+
exportingImage: '正在导出图片...',
|
|
57
|
+
exportedImage: '已导出到 {path}',
|
|
58
|
+
emptySceneExportBody: '画布里还没有可导出的内容。',
|
|
59
|
+
exportSelection: '导出选中内容',
|
|
60
|
+
sendToCodex: '发送给 Codex',
|
|
61
|
+
sendingToCodex: '正在发送',
|
|
62
|
+
downloadSelectedImage: '下载图片',
|
|
63
|
+
downloadingSelectedImage: '正在下载...',
|
|
64
|
+
downloadedSelectedImage: '已下载到下载文件夹:{filename}',
|
|
65
|
+
downloadSelectedImageFailed: '暂时无法下载选中图片,请稍后再试。',
|
|
66
|
+
sendDisabledTitle: '先在画布上选中一个或多个元素',
|
|
67
|
+
languageLabel: '语言',
|
|
68
|
+
currentConversationTitle: '当前对话',
|
|
69
|
+
copyThreadPrompt: '复制线程指令',
|
|
70
|
+
threadPromptCopied: '已复制线程指令,可粘贴到其他 Codex 对话中。',
|
|
71
|
+
threadPromptCopyFailed: '暂时无法复制,请手动复制线程 ID。',
|
|
72
|
+
threadPromptTemplate: '请在 Codex 中定位并操作这个 OpenPrd 画布绑定的对话线程。\n\n线程标题:{title}\n线程 ID:{id}\n\n请基于这个线程继续处理:<在这里补充你的具体指令>',
|
|
73
|
+
conversation: '对话',
|
|
74
|
+
placeholderText: '拖动空白卡片,或让 Agent 替换为图片',
|
|
75
|
+
libraryItemName: '素材 {index}',
|
|
76
|
+
libraryItemCount: '{count} 个元素',
|
|
77
|
+
insertedLibraryItem: '已添加到画布',
|
|
78
|
+
aiTemplateSquare: '头像 / 方图',
|
|
79
|
+
aiTemplatePortrait: '竖版卡片',
|
|
80
|
+
aiTemplateLandscape: '横版配图',
|
|
81
|
+
aiTemplateWide: '横版封面',
|
|
82
|
+
aiTemplateVertical: '手机竖图',
|
|
83
|
+
aiTemplateWechat: '公众号封面',
|
|
84
|
+
aiImageComposerTitle: 'AI 生图指令',
|
|
85
|
+
aiImageTemplateLabel: '画布卡片比例',
|
|
86
|
+
aiImageInstructionLabel: '生图指令',
|
|
87
|
+
aiImageInstructionPlaceholder: '描述你想生成的图片,例如:一张清爽的产品功能示意图,白色背景,蓝色主按钮,适合放在 PRD 里说明方案。',
|
|
88
|
+
createAiImageCard: '生成卡片',
|
|
89
|
+
imagePromptRequired: '先输入生图指令。',
|
|
90
|
+
imageRequestPrepared: '已创建 AI 生图卡片,指令已复制;Codex 可用 Image 2 生成后回填。',
|
|
91
|
+
imageRequestSent: '已创建 AI 生图卡片,并已发往当前 Codex 对话处理。',
|
|
92
|
+
imageRequestAgentBridge: '已创建 AI 生图卡片,自动发送暂不可用,已等待 Agent 接力发送。',
|
|
93
|
+
imageRequestPending: '已创建 AI 生图卡片,并正在发往当前 Codex 对话;如果长时间没有出现,请复制提示手动发送。',
|
|
94
|
+
imageRequestManualCopy: '已创建 AI 生图卡片,指令已写入卡片;Codex 可读取后生成并回填。',
|
|
95
|
+
agentBridgePending: '自动发送暂不可用,等待 Codex Agent 接力发送到当前对话。',
|
|
96
|
+
agentBridgeClaimed: 'Codex Agent 已领取,正在发送到当前对话。',
|
|
97
|
+
agentBridgeSent: 'Codex Agent 已前台发送到当前对话。',
|
|
98
|
+
agentBridgeFailed: 'Codex Agent 前台接力失败,请复制提示手动发送。',
|
|
99
|
+
aiGenerating: 'Codex 生成中...',
|
|
100
|
+
aiTemplateOnCanvas: '比例 {ratio},等待图片回填',
|
|
101
|
+
aiImagePromptIntro: '请使用 Codex 原生生图能力生成一张图片,并回填到 OpenPrd Canvas 的这张 AI 生图卡片。',
|
|
102
|
+
aiImagePromptMeta: '画布会话:{binding};卡片比例:{ratio};占位卡 ID:{placeholderId}',
|
|
103
|
+
aiImagePromptReturn: '生成完成后,请回填到当前画布里的这张占位卡,回填信息如下:',
|
|
104
|
+
selectedCount: '已选中 {count} 个元素',
|
|
105
|
+
sendBarHint: '预览选区截图,输入指令后发送给 Codex。',
|
|
106
|
+
composerTitle: '发送给 Codex',
|
|
107
|
+
previewLabel: '选区截图',
|
|
108
|
+
composerPreviewAlt: 'OpenPrd 画布选区截图',
|
|
109
|
+
instructionLabel: '指令',
|
|
110
|
+
instructionPlaceholder: '告诉 Codex 你希望怎么处理这张截图,例如:按这个标注调整图片、解释这里的问题、继续生成下一版。',
|
|
111
|
+
copiedTitle: '已准备好发送给 Codex',
|
|
112
|
+
copiedBody: '选区图片已保存,提示已复制到剪贴板。',
|
|
113
|
+
copiedBodyWithRelay: '选区图片已保存,提示已复制;当前 Codex Agent 可按交接记录转发到本线程。',
|
|
114
|
+
copyFailedTitle: '选区图片已保存',
|
|
115
|
+
copyFailedBody: '浏览器未允许写入剪贴板,请手动复制下面这段提示。',
|
|
116
|
+
sentBody: '选区截图和指令已保存,提示已复制。',
|
|
117
|
+
sentBodyWithRelay: '选区截图和指令已发往当前 Codex 对话处理。',
|
|
118
|
+
sentBodyAgentBridge: '自动发送暂不可用,选区截图和指令已加入 Codex Agent 接力队列。',
|
|
119
|
+
sentBodyPending: '选区截图和指令正在发往当前 Codex 对话;如果长时间没有出现,请复制提示手动发送。',
|
|
120
|
+
sendManualCopyBody: '选区截图和指令已保存;浏览器未允许复制,请点击复制提示。',
|
|
121
|
+
sendErrorTitle: '发送准备失败',
|
|
122
|
+
emptySelectionTitle: '请先选中画布元素',
|
|
123
|
+
emptySelectionBody: '多选或圈选元素后,再点击发送给 Codex。',
|
|
124
|
+
resetConfirm: '确定要清空当前画布吗?此操作会同步保存到本次对话画布。',
|
|
125
|
+
saveFailed: '暂时无法保存,请稍后再试。',
|
|
126
|
+
exportFailed: '暂时无法导出,请稍后再试。',
|
|
127
|
+
exportPathLabel: '图片路径',
|
|
128
|
+
promptLabel: '可发送提示',
|
|
129
|
+
copyPrompt: '复制提示',
|
|
130
|
+
dismiss: '关闭',
|
|
131
|
+
codexPromptDefaultInstruction: '请根据这个画布选区继续协同。',
|
|
132
|
+
codexPromptIntro: '画布选区截图:',
|
|
133
|
+
codexPromptMeta: '来源:OpenPrd Canvas;选区元素:{count};会话:{binding}',
|
|
134
|
+
},
|
|
135
|
+
en: {
|
|
136
|
+
appSubtitle: 'Conversation canvas',
|
|
137
|
+
openingTitle: 'Opening OpenPrd Canvas',
|
|
138
|
+
openingBody: 'The canvas is bound to the current conversation.',
|
|
139
|
+
bootErrorTitle: 'Canvas failed to start',
|
|
140
|
+
bootErrorBody: 'Refresh the page. If it still fails, send the error below to the agent.',
|
|
141
|
+
loadingTitle: 'Syncing canvas',
|
|
142
|
+
loadingBody: 'Reading the canvas state for this conversation.',
|
|
143
|
+
loadErrorTitle: 'Canvas failed to load',
|
|
144
|
+
canvasActionsTitle: 'Canvas actions',
|
|
145
|
+
personalLibraryTitle: 'Personal library',
|
|
146
|
+
reviewBoardTitle: 'Review board',
|
|
147
|
+
reviewGuideStage: 'Step {index}/{total} · {title}',
|
|
148
|
+
reviewGuideNext: 'Next: {action}',
|
|
149
|
+
importReviewDirections: 'Import design directions',
|
|
150
|
+
importingReviewDirections: 'Importing...',
|
|
151
|
+
reviewDirectionsImported: 'Placed {count} design directions on the canvas. Circle and annotate, then send to Codex.',
|
|
152
|
+
reviewDirectionsEmpty: 'No design directions in the current review yet. Ask the agent to generate 3 directions first.',
|
|
153
|
+
reviewDirectionsFailed: 'Could not load design directions. Try again later.',
|
|
154
|
+
reviewDirectionSelectedTag: 'Selected',
|
|
155
|
+
aiImageTemplatesTitle: 'AI image templates',
|
|
156
|
+
saveCanvas: 'Export file',
|
|
157
|
+
exportImage: 'Export image',
|
|
158
|
+
resetCanvas: 'Reset canvas',
|
|
159
|
+
openLibrary: 'Personal library',
|
|
160
|
+
blankCard: 'Blank card',
|
|
161
|
+
savingCanvas: 'Exporting file...',
|
|
162
|
+
savedCanvas: 'Exported to Downloads: {filename}',
|
|
163
|
+
openContainingFolder: 'Open folder',
|
|
164
|
+
openingFolder: 'Opening...',
|
|
165
|
+
openFolderFailed: 'Could not open the folder. Open the canvas export folder manually.',
|
|
166
|
+
exportingImage: 'Exporting image...',
|
|
167
|
+
exportedImage: 'Exported to {path}',
|
|
168
|
+
emptySceneExportBody: 'There is nothing on the canvas to export yet.',
|
|
169
|
+
exportSelection: 'Export selection',
|
|
170
|
+
sendToCodex: 'Send to Codex',
|
|
171
|
+
sendingToCodex: 'Sending',
|
|
172
|
+
downloadSelectedImage: 'Download image',
|
|
173
|
+
downloadingSelectedImage: 'Downloading...',
|
|
174
|
+
downloadedSelectedImage: 'Downloaded to Downloads: {filename}',
|
|
175
|
+
downloadSelectedImageFailed: 'Could not download the selected image. Try again in a moment.',
|
|
176
|
+
sendDisabledTitle: 'Select one or more canvas elements first',
|
|
177
|
+
languageLabel: 'Language',
|
|
178
|
+
currentConversationTitle: 'Current conversation',
|
|
179
|
+
copyThreadPrompt: 'Copy thread prompt',
|
|
180
|
+
threadPromptCopied: 'Thread prompt copied. You can paste it into another Codex conversation.',
|
|
181
|
+
threadPromptCopyFailed: 'Could not copy right now. Copy the thread ID manually.',
|
|
182
|
+
threadPromptTemplate: 'Please locate and work with this OpenPrd canvas conversation thread in Codex.\n\nThread title: {title}\nThread ID: {id}\n\nContinue with this thread: <add your instruction here>',
|
|
183
|
+
conversation: 'Conversation',
|
|
184
|
+
placeholderText: 'Drag this blank card, or ask the agent to replace it with an image',
|
|
185
|
+
libraryItemName: 'Library item {index}',
|
|
186
|
+
libraryItemCount: '{count} elements',
|
|
187
|
+
insertedLibraryItem: 'Added to canvas',
|
|
188
|
+
aiTemplateSquare: 'Avatar / square',
|
|
189
|
+
aiTemplatePortrait: 'Portrait card',
|
|
190
|
+
aiTemplateLandscape: 'Landscape image',
|
|
191
|
+
aiTemplateWide: 'Wide cover',
|
|
192
|
+
aiTemplateVertical: 'Phone vertical',
|
|
193
|
+
aiTemplateWechat: 'WeChat cover',
|
|
194
|
+
aiImageComposerTitle: 'AI image prompt',
|
|
195
|
+
aiImageTemplateLabel: 'Canvas card ratio',
|
|
196
|
+
aiImageInstructionLabel: 'Image prompt',
|
|
197
|
+
aiImageInstructionPlaceholder: 'Describe the image you want, such as: a clean product feature illustration, white background, blue primary button, suitable for a PRD.',
|
|
198
|
+
createAiImageCard: 'Create card',
|
|
199
|
+
imagePromptRequired: 'Enter an image prompt first.',
|
|
200
|
+
imageRequestPrepared: 'AI image card created. The prompt was copied; Codex can generate with Image 2 and fill it back in.',
|
|
201
|
+
imageRequestSent: 'AI image card created and sent to the current Codex conversation.',
|
|
202
|
+
imageRequestAgentBridge: 'AI image card created. Automatic sending is unavailable, so it is waiting for the Codex Agent relay.',
|
|
203
|
+
imageRequestPending: 'AI image card created and is being sent to the current Codex conversation. If it does not appear for a while, copy the prompt manually.',
|
|
204
|
+
imageRequestManualCopy: 'AI image card created. The prompt was stored on the card; Codex can read it and fill the image back in.',
|
|
205
|
+
agentBridgePending: 'Automatic sending is unavailable, so this is waiting for the Codex Agent to relay it into the current conversation.',
|
|
206
|
+
agentBridgeClaimed: 'The Codex Agent claimed this and is sending it into the current conversation.',
|
|
207
|
+
agentBridgeSent: 'The Codex Agent relayed this into the current conversation.',
|
|
208
|
+
agentBridgeFailed: 'The Codex Agent foreground relay failed. Copy the prompt manually.',
|
|
209
|
+
aiGenerating: 'Codex is generating...',
|
|
210
|
+
aiTemplateOnCanvas: 'Ratio {ratio}, waiting for image',
|
|
211
|
+
aiImagePromptIntro: 'Use Codex native image generation to create one image and fill this OpenPrd Canvas AI image card.',
|
|
212
|
+
aiImagePromptMeta: 'Canvas session: {binding}; card ratio: {ratio}; placeholder ID: {placeholderId}',
|
|
213
|
+
aiImagePromptReturn: 'When the image is ready, fill this placeholder card back into the current canvas with this information:',
|
|
214
|
+
selectedCount: '{count} selected',
|
|
215
|
+
sendBarHint: 'Preview the selection, add instructions, then send it to Codex.',
|
|
216
|
+
composerTitle: 'Send to Codex',
|
|
217
|
+
previewLabel: 'Selection image',
|
|
218
|
+
composerPreviewAlt: 'OpenPrd canvas selection image',
|
|
219
|
+
instructionLabel: 'Instruction',
|
|
220
|
+
instructionPlaceholder: 'Tell Codex what to do with this screenshot, such as adjust the image based on the markup, explain the issue, or generate the next version.',
|
|
221
|
+
copiedTitle: 'Ready to send to Codex',
|
|
222
|
+
copiedBody: 'The selection image was saved and the prompt was copied to your clipboard.',
|
|
223
|
+
copiedBodyWithRelay: 'The selection image was saved and the prompt was copied; the current Codex agent can relay the handoff into this thread.',
|
|
224
|
+
copyFailedTitle: 'Selection image saved',
|
|
225
|
+
copyFailedBody: 'The browser blocked clipboard access. Copy the prompt below manually.',
|
|
226
|
+
sentBody: 'The selection image and instruction were saved, and the prompt was copied.',
|
|
227
|
+
sentBodyWithRelay: 'The selection image and instruction were sent to the current Codex conversation.',
|
|
228
|
+
sentBodyAgentBridge: 'Automatic sending is unavailable, so the selection image and instruction were added to the Codex Agent relay queue.',
|
|
229
|
+
sentBodyPending: 'The selection image and instruction are being sent to the current Codex conversation. If they do not appear for a while, copy the prompt manually.',
|
|
230
|
+
sendManualCopyBody: 'The selection image and instruction were saved. The browser blocked clipboard access; use Copy prompt.',
|
|
231
|
+
sendErrorTitle: 'Could not prepare handoff',
|
|
232
|
+
emptySelectionTitle: 'Select canvas elements first',
|
|
233
|
+
emptySelectionBody: 'Select one or more elements, then send them to Codex.',
|
|
234
|
+
resetConfirm: 'Clear the current canvas? This will be saved to this conversation canvas.',
|
|
235
|
+
saveFailed: 'Could not save right now. Try again in a moment.',
|
|
236
|
+
exportFailed: 'Could not export right now. Try again in a moment.',
|
|
237
|
+
exportPathLabel: 'Image path',
|
|
238
|
+
promptLabel: 'Prompt to send',
|
|
239
|
+
copyPrompt: 'Copy prompt',
|
|
240
|
+
dismiss: 'Dismiss',
|
|
241
|
+
codexPromptDefaultInstruction: 'Please continue based on this canvas selection.',
|
|
242
|
+
codexPromptIntro: 'Canvas selection image:',
|
|
243
|
+
codexPromptMeta: 'Source: OpenPrd Canvas; selected elements: {count}; session: {binding}',
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
function normalizeCanvasLocale(locale) {
|
|
248
|
+
const value = String(locale ?? '').trim().toLowerCase();
|
|
249
|
+
if (value === 'en' || value.startsWith('en-')) {
|
|
250
|
+
return 'en';
|
|
251
|
+
}
|
|
252
|
+
if (value === 'zh' || value.startsWith('zh-')) {
|
|
253
|
+
return 'zh-CN';
|
|
254
|
+
}
|
|
255
|
+
return CANVAS_DEFAULT_LOCALE;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function defaultCanvasLocaleForLanguages(languages = []) {
|
|
259
|
+
const values = Array.isArray(languages) ? languages : [languages];
|
|
260
|
+
for (const value of values) {
|
|
261
|
+
if (String(value ?? '').trim()) {
|
|
262
|
+
return normalizeCanvasLocale(value);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return CANVAS_DEFAULT_LOCALE;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export {
|
|
269
|
+
CANVAS_DEFAULT_LOCALE,
|
|
270
|
+
CANVAS_LOCALE_STORAGE_KEY,
|
|
271
|
+
CANVAS_LOCALES,
|
|
272
|
+
defaultCanvasLocaleForLanguages,
|
|
273
|
+
normalizeCanvasLocale,
|
|
274
|
+
};
|