@open-document/core 0.13.2 → 0.14.0

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.
Files changed (70) hide show
  1. package/dist/{build-CvsOak5B.js → build-CyBlmrjS.js} +1 -1
  2. package/dist/{check-CbUBwYmf.js → check-DUKDEem-.js} +3 -3
  3. package/dist/cli/bin.js +10 -21
  4. package/dist/{config-BWtOZ1jc.d.ts → config-cAV1OCuY.d.ts} +9 -1
  5. package/dist/{config-CltJJVsw.js → config-cNpYUpF6.js} +2746 -369
  6. package/dist/{context-CWgfsHoE.js → context-BPApOW9n.js} +1 -1
  7. package/dist/{dev-B8H2qT6G.js → dev-DrnOvsX3.js} +1 -1
  8. package/dist/{diff-BvIjjgnc.js → diff-BPMD2Knh.js} +2 -2
  9. package/dist/{export-DX30_s2q.js → export-DeVtL8aX.js} +3 -3
  10. package/dist/{import-DgsdJT5e.js → import-WAgWsuOv.js} +3 -2
  11. package/dist/index.d.ts +2 -2
  12. package/dist/ops/index.d.ts +3 -1
  13. package/dist/ops/index.js +2 -2
  14. package/dist/{ops-CSR5RlrE.js → ops-raK6424A.js} +2 -854
  15. package/dist/{preview-DYMUNjXL.js → preview-B8Vw9QCh.js} +1 -1
  16. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  17. package/dist/{templates-B5Tz0AKb.js → templates-D9jAFJ8R.js} +3 -3
  18. package/dist/vite/index.d.ts +1 -1
  19. package/dist/vite/index.js +1 -1
  20. package/package.json +1 -1
  21. package/skills/create-doc/SKILL.md +1 -1
  22. package/skills/doc-authoring/SKILL.md +6 -0
  23. package/src/app/app.tsx +2 -0
  24. package/src/app/components/agent/agent-dock.tsx +75 -0
  25. package/src/app/components/agent/agent-markdown.tsx +45 -0
  26. package/src/app/components/agent/agent-panel.tsx +690 -0
  27. package/src/app/components/agent/agent-presence.tsx +74 -0
  28. package/src/app/components/agent/composer.tsx +120 -0
  29. package/src/app/components/agent/connect-view.tsx +183 -0
  30. package/src/app/components/agent/history-view.tsx +134 -0
  31. package/src/app/components/agent/provider-logo.tsx +23 -0
  32. package/src/app/components/agent/transcript.tsx +609 -0
  33. package/src/app/components/comments/comments-panel.tsx +26 -2
  34. package/src/app/components/inspector/inspector.tsx +17 -0
  35. package/src/app/components/note-markdown.tsx +85 -0
  36. package/src/app/components/page-error-boundary.tsx +84 -0
  37. package/src/app/components/page-frame.tsx +2 -1
  38. package/src/app/components/panel/resize-handle.tsx +129 -0
  39. package/src/app/components/ui/button.tsx +97 -0
  40. package/src/app/components/ui/popover.tsx +144 -0
  41. package/src/app/components/ui/tooltip.tsx +123 -0
  42. package/src/app/lib/agent/use-agent.ts +543 -0
  43. package/src/app/lib/diagnostics.ts +13 -0
  44. package/src/app/lib/docx/from-dom.ts +91 -6
  45. package/src/app/lib/docx/ooxml.test.ts +58 -0
  46. package/src/app/lib/docx/ooxml.ts +58 -9
  47. package/src/app/lib/export-dom.ts +2 -1
  48. package/src/app/lib/export-pdf.ts +2 -1
  49. package/src/app/lib/i18n-ja/agent-panel.ts +107 -0
  50. package/src/app/lib/i18n-ja/agent.ts +9 -0
  51. package/src/app/lib/i18n-ja/index.ts +9 -1
  52. package/src/app/lib/i18n-ko/agent-panel.ts +106 -0
  53. package/src/app/lib/i18n-ko/agent.ts +9 -0
  54. package/src/app/lib/i18n-ko/index.ts +9 -1
  55. package/src/app/lib/i18n-zh-cn/agent-panel.ts +105 -0
  56. package/src/app/lib/i18n-zh-cn/agent.ts +9 -0
  57. package/src/app/lib/i18n-zh-cn/index.ts +9 -1
  58. package/src/app/lib/i18n-zh-tw/agent-panel.ts +105 -0
  59. package/src/app/lib/i18n-zh-tw/agent.ts +9 -0
  60. package/src/app/lib/i18n-zh-tw/index.ts +9 -1
  61. package/src/app/lib/note-markdown.ts +116 -0
  62. package/src/app/lib/toast.ts +50 -0
  63. package/src/app/lib/use-auto-grow.ts +15 -0
  64. package/src/app/lib/use-doc-titles.ts +28 -0
  65. package/src/app/lib/use-locale.ts +144 -0
  66. package/src/app/lib/utils.ts +4 -0
  67. package/src/app/routes/doc-preview.tsx +103 -0
  68. package/src/app/routes/doc.tsx +118 -11
  69. package/src/app/routes/home.tsx +43 -8
  70. package/src/app/styles.css +193 -0
@@ -0,0 +1,106 @@
1
+ // The agent panel's strings, keyed by the English text in `use-locale.ts`.
2
+ export const AGENT_PANEL: Record<string, string> = {
3
+ Agent: '에이전트',
4
+ Beta: '베타',
5
+ 'Early preview': '초기 미리보기',
6
+ 'Replies, edits and tool calls can occasionally fail or do something unexpected.':
7
+ '답변, 편집, 도구 호출이 가끔 실패하거나 예상과 다르게 동작할 수 있습니다.',
8
+ 'Open the agent panel': '에이전트 패널 열기',
9
+ 'Close agent panel': '에이전트 패널 닫기',
10
+ 'New chat': '새 채팅',
11
+ History: '기록',
12
+ 'No conversations yet.': '아직 대화가 없습니다.',
13
+ 'Delete conversation': '대화 삭제',
14
+ 'Other documents': '다른 문서',
15
+ 'Chats you start in this panel show up here.': '이 패널에서 시작한 채팅이 여기에 표시됩니다.',
16
+ Working: '작업 중',
17
+ 'Ask {provider} to create or edit documents…': '{provider}에게 문서 작성이나 편집을 요청하세요…',
18
+ Send: '보내기',
19
+ Stop: '중지',
20
+ 'Page {n}': '{n}쪽',
21
+ Selection: '선택 항목',
22
+ '{count} comment': '댓글 {count}개',
23
+ '{count} comments': '댓글 {count}개',
24
+ 'Apply comments': '댓글 반영',
25
+ 'Apply with {provider}': '{provider}로 반영',
26
+ 'Create a document with {provider}': '{provider}로 문서 만들기',
27
+ 'Draft a new document': '새 문서 초안 작성',
28
+ 'Opens a blank document; describe it and the agent drafts it section by section.':
29
+ '빈 문서를 엽니다. 내용을 설명하면 에이전트가 섹션별로 초안을 작성합니다.',
30
+ 'Apply pending comments': '남은 댓글 반영',
31
+ 'Resolves every @doc-comment marker in this document.':
32
+ '이 문서의 모든 @doc-comment 마커를 처리합니다.',
33
+ 'Create a theme': '테마 만들기',
34
+ 'Extracts or designs a reusable theme under themes/.':
35
+ 'themes/ 아래에 재사용할 테마를 추출하거나 디자인합니다.',
36
+ 'Edit this page': '이 페이지 편집',
37
+ 'Describe a change to the page you are viewing.': '보고 있는 페이지의 변경 사항을 설명하세요.',
38
+ 'What should we build?': '무엇을 만들까요?',
39
+ 'Describe a document, or pick a starting point.': '문서를 설명하거나 시작점을 고르세요.',
40
+ Continue: '계속',
41
+ Other: '기타',
42
+ 'Type your own answer': '직접 답변 입력',
43
+ Dismissed: '닫음',
44
+ 'Needs approval': '승인 필요',
45
+ Allow: '허용',
46
+ Deny: '거부',
47
+ Allowed: '허용됨',
48
+ Denied: '거부됨',
49
+ 'Auto-approve': '자동 승인',
50
+ 'Run commands without asking. Edits inside the workspace are always allowed.':
51
+ '묻지 않고 명령을 실행합니다. 작업 공간 안의 편집은 항상 허용됩니다.',
52
+ Stopped: '중지됨',
53
+ '{seconds}s': '{seconds}초',
54
+ Error: '오류',
55
+ 'Checking agents': '에이전트 확인 중',
56
+ 'The agent panel is disabled in open-doc.config.ts.':
57
+ 'open-doc.config.ts에서 에이전트 패널이 꺼져 있습니다.',
58
+ 'Connect an agent': '에이전트 연결',
59
+ 'Drive your coding agent from here instead of a terminal. Agents installed on this machine connect automatically and reuse their sign-in.':
60
+ '터미널 대신 여기에서 코딩 에이전트를 사용하세요. 이 컴퓨터에 설치된 에이전트는 자동으로 연결되고 기존 로그인을 그대로 씁니다.',
61
+ Connect: '연결',
62
+ Connecting: '연결 중',
63
+ Connected: '연결됨',
64
+ 'Adds {pkg} to this workspace with {pm}.': '{pm}로 이 작업 공간에 {pkg}을(를) 추가합니다.',
65
+ 'CLI found · v{version}': 'CLI 있음 · v{version}',
66
+ 'CLI found': 'CLI 있음',
67
+ 'CLI not found on PATH': 'PATH에서 CLI를 찾을 수 없음',
68
+ 'Install the {name} CLI and sign in once; the panel reuses its login.':
69
+ '{name} CLI를 설치하고 한 번 로그인하세요. 패널이 그 로그인을 그대로 씁니다.',
70
+ 'Install Codex first': '먼저 Codex를 설치하세요',
71
+ 'The panel drives the Codex CLI on this machine, and it was not found on your PATH. Install it, sign in once in a terminal with `codex`, then check again.':
72
+ '에이전트 패널은 이 컴퓨터의 Codex CLI를 사용하는데 PATH에서 찾지 못했습니다. 설치하고 터미널에서 `codex`로 한 번 로그인한 뒤 다시 확인하세요.',
73
+ 'Check again': '다시 확인',
74
+ Retry: '다시 시도',
75
+ '{name} connected': '{name} 연결됨',
76
+ 'Could not install {pkg}': '{pkg}을(를) 설치할 수 없습니다',
77
+ 'Manage agents': '에이전트 관리',
78
+ Back: '뒤로',
79
+ 'Could not send message': '메시지를 보낼 수 없습니다',
80
+ "What's this document about?": '어떤 문서인가요?',
81
+ 'Describe the topic, audience and tone. {provider} drafts it section by section while you watch.':
82
+ '주제, 독자, 어조를 설명하세요. {provider}가 섹션별로 작성하는 모습을 볼 수 있습니다.',
83
+ 'A two-page project brief on…': '…에 관한 두 쪽짜리 기획서',
84
+ 'Could not create a document': '문서를 만들 수 없습니다',
85
+ '{count} step': '{count}단계',
86
+ '{count} steps': '{count}단계',
87
+ Skip: '건너뛰기',
88
+ Copy: '복사',
89
+ Cancel: '취소',
90
+ 'Sending replaces the conversation after this message. Edits already made to files stay.':
91
+ '보내면 이 메시지 이후의 대화가 바뀝니다. 파일에 이미 적용된 편집은 그대로 남습니다.',
92
+ Default: '기본값',
93
+ Reasoning: '추론',
94
+ Auto: '자동',
95
+ Minimal: '최소',
96
+ Low: '낮음',
97
+ Medium: '보통',
98
+ High: '높음',
99
+ 'Extra high': '매우 높음',
100
+ Max: '최대',
101
+ '{provider} is editing': '{provider}가 편집 중',
102
+ Thinking: '생각 중',
103
+ 'Waiting for you': '입력을 기다리는 중',
104
+ 'Draft with agent': '에이전트로 초안 작성',
105
+ 'Resize the agent panel': '에이전트 패널 너비 조절',
106
+ };
@@ -0,0 +1,9 @@
1
+ export const AGENT: Record<string, string> = {
2
+ Agent: '에이전트',
3
+ 'Close the agent panel': '에이전트 패널 닫기',
4
+ 'Ask the agent': '에이전트에게 요청',
5
+ Ran: '실행',
6
+ 'This page could not be drawn': '이 페이지를 표시할 수 없습니다',
7
+ 'It is drawn again as soon as the source is saved.': '소스를 저장하면 다시 그려집니다.',
8
+ 'Apply with {agent}': '{agent}로 반영',
9
+ };
@@ -1,5 +1,13 @@
1
+ import { AGENT } from './agent';
2
+ import { AGENT_PANEL } from './agent-panel';
1
3
  import { BROWSER } from './browser';
2
4
  import { DOC } from './doc';
3
5
  import { PANELS } from './panels';
4
6
 
5
- export const KO: Record<string, string> = { ...BROWSER, ...DOC, ...PANELS };
7
+ export const KO: Record<string, string> = {
8
+ ...BROWSER,
9
+ ...DOC,
10
+ ...PANELS,
11
+ ...AGENT,
12
+ ...AGENT_PANEL,
13
+ };
@@ -0,0 +1,105 @@
1
+ // The agent panel's strings, keyed by the English text in `use-locale.ts`.
2
+ export const AGENT_PANEL: Record<string, string> = {
3
+ Agent: 'Agent',
4
+ Beta: 'Beta',
5
+ 'Early preview': '抢先体验版',
6
+ 'Replies, edits and tool calls can occasionally fail or do something unexpected.':
7
+ '回复、编辑或工具调用偶尔可能失败,或出现预期之外的结果。',
8
+ 'Open the agent panel': '打开 agent 面板',
9
+ 'Close agent panel': '关闭 agent 面板',
10
+ 'New chat': '新对话',
11
+ History: '对话记录',
12
+ 'No conversations yet.': '还没有任何对话。',
13
+ 'Delete conversation': '删除对话',
14
+ 'Other documents': '其他文档',
15
+ 'Chats you start in this panel show up here.': '在这个面板开始的对话会列在这里。',
16
+ Working: '进行中',
17
+ 'Ask {provider} to create or edit documents…': '请 {provider} 创建或编辑文档…',
18
+ Send: '发送',
19
+ Stop: '停止',
20
+ 'Page {n}': '第 {n} 页',
21
+ Selection: '选中元素',
22
+ '{count} comment': '{count} 条评论',
23
+ '{count} comments': '{count} 条评论',
24
+ 'Apply comments': '应用评论',
25
+ 'Apply with {provider}': '用 {provider} 应用',
26
+ 'Create a document with {provider}': '用 {provider} 创建文档',
27
+ 'Draft a new document': '起草一份新文档',
28
+ 'Opens a blank document; describe it and the agent drafts it section by section.':
29
+ '打开一份空白文档;描述内容后,agent 会一段一段写出来。',
30
+ 'Apply pending comments': '应用待处理的评论',
31
+ 'Resolves every @doc-comment marker in this document.':
32
+ '处理这份文档中所有的 @doc-comment 标记。',
33
+ 'Create a theme': '创建主题',
34
+ 'Extracts or designs a reusable theme under themes/.': '在 themes/ 下提取或设计可复用的主题。',
35
+ 'Edit this page': '编辑当前页',
36
+ 'Describe a change to the page you are viewing.': '描述你想对当前页面做的修改。',
37
+ 'What should we build?': '想做什么?',
38
+ 'Describe a document, or pick a starting point.': '描述一份文档,或选一个起点。',
39
+ Continue: '继续',
40
+ Other: '其他',
41
+ 'Type your own answer': '输入你自己的答案',
42
+ Dismissed: '已跳过',
43
+ 'Needs approval': '需要批准',
44
+ Allow: '允许',
45
+ Deny: '拒绝',
46
+ Allowed: '已允许',
47
+ Denied: '已拒绝',
48
+ 'Auto-approve': '自动批准',
49
+ 'Run commands without asking. Edits inside the workspace are always allowed.':
50
+ '不询问直接执行命令。工作区内的文件编辑始终允许。',
51
+ Stopped: '已停止',
52
+ '{seconds}s': '{seconds} 秒',
53
+ Error: '错误',
54
+ 'Checking agents': '正在检查 agent',
55
+ 'The agent panel is disabled in open-doc.config.ts.':
56
+ 'agent 面板已在 open-doc.config.ts 中禁用。',
57
+ 'Connect an agent': '连接 agent',
58
+ 'Drive your coding agent from here instead of a terminal. Agents installed on this machine connect automatically and reuse their sign-in.':
59
+ '直接在这里驱动你的 coding agent,无需切换到终端。这台电脑上已安装的 agent 会自动连接,并复用它的登录状态。',
60
+ Connect: '连接',
61
+ Connecting: '连接中',
62
+ Connected: '已连接',
63
+ 'Adds {pkg} to this workspace with {pm}.': '会用 {pm} 把 {pkg} 添加到这个工作区。',
64
+ 'CLI found · v{version}': '已找到 CLI · v{version}',
65
+ 'CLI found': '已找到 CLI',
66
+ 'CLI not found on PATH': 'PATH 中找不到 CLI',
67
+ 'Install the {name} CLI and sign in once; the panel reuses its login.':
68
+ '请安装 {name} CLI 并登录一次;面板会复用它的登录状态。',
69
+ 'Install Codex first': '请先安装 Codex',
70
+ 'The panel drives the Codex CLI on this machine, and it was not found on your PATH. Install it, sign in once in a terminal with `codex`, then check again.':
71
+ 'Agent 面板使用这台电脑上的 Codex CLI,但在 PATH 上找不到它。请先安装,并在终端用 `codex` 登录一次,再重新检查。',
72
+ 'Check again': '重新检查',
73
+ Retry: '重试',
74
+ '{name} connected': '{name} 已连接',
75
+ 'Could not install {pkg}': '无法安装 {pkg}',
76
+ 'Manage agents': '管理 agent',
77
+ Back: '返回',
78
+ 'Could not send message': '消息发送失败',
79
+ "What's this document about?": '这份文档要写什么?',
80
+ 'Describe the topic, audience and tone. {provider} drafts it section by section while you watch.':
81
+ '描述主题、读者和语气,{provider} 会一段一段写给你看。',
82
+ 'A two-page project brief on…': '一份两页的项目简介,主题是…',
83
+ 'Could not create a document': '无法创建文档',
84
+ '{count} step': '{count} 个步骤',
85
+ '{count} steps': '{count} 个步骤',
86
+ Skip: '跳过',
87
+ Copy: '复制',
88
+ Cancel: '取消',
89
+ 'Sending replaces the conversation after this message. Edits already made to files stay.':
90
+ '发送后会替换这条消息之后的对话,已改动的文件不会还原。',
91
+ Default: '默认',
92
+ Reasoning: '推理强度',
93
+ Auto: '自动',
94
+ Minimal: '最低',
95
+ Low: '低',
96
+ Medium: '中',
97
+ High: '高',
98
+ 'Extra high': '超高',
99
+ Max: '最高',
100
+ '{provider} is editing': '{provider} 正在编辑',
101
+ Thinking: '思考中',
102
+ 'Waiting for you': '等待你的回复',
103
+ 'Draft with agent': '用 Agent 起草',
104
+ 'Resize the agent panel': '调整 Agent 面板宽度',
105
+ };
@@ -0,0 +1,9 @@
1
+ export const AGENT: Record<string, string> = {
2
+ Agent: 'Agent',
3
+ 'Close the agent panel': '关闭 Agent 面板',
4
+ 'Ask the agent': '询问 Agent',
5
+ Ran: '运行',
6
+ 'This page could not be drawn': '这一页无法显示',
7
+ 'It is drawn again as soon as the source is saved.': '保存后就会重新绘制。',
8
+ 'Apply with {agent}': '交给 {agent} 处理',
9
+ };
@@ -1,5 +1,13 @@
1
+ import { AGENT } from './agent';
2
+ import { AGENT_PANEL } from './agent-panel';
1
3
  import { BROWSER } from './browser';
2
4
  import { DOC } from './doc';
3
5
  import { PANELS } from './panels';
4
6
 
5
- export const ZH_CN: Record<string, string> = { ...BROWSER, ...DOC, ...PANELS };
7
+ export const ZH_CN: Record<string, string> = {
8
+ ...BROWSER,
9
+ ...DOC,
10
+ ...PANELS,
11
+ ...AGENT,
12
+ ...AGENT_PANEL,
13
+ };
@@ -0,0 +1,105 @@
1
+ // The agent panel's strings, keyed by the English text in `use-locale.ts`.
2
+ export const AGENT_PANEL: Record<string, string> = {
3
+ Agent: 'Agent',
4
+ Beta: 'Beta',
5
+ 'Early preview': '搶先體驗版',
6
+ 'Replies, edits and tool calls can occasionally fail or do something unexpected.':
7
+ '回覆、編輯或工具呼叫偶爾可能失敗,或出現預期之外的結果。',
8
+ 'Open the agent panel': '開啟 agent 面板',
9
+ 'Close agent panel': '關閉 agent 面板',
10
+ 'New chat': '新對話',
11
+ History: '對話紀錄',
12
+ 'No conversations yet.': '還沒有任何對話。',
13
+ 'Delete conversation': '刪除對話',
14
+ 'Other documents': '其他文件',
15
+ 'Chats you start in this panel show up here.': '在這個面板開始的對話會列在這裡。',
16
+ Working: '進行中',
17
+ 'Ask {provider} to create or edit documents…': '請 {provider} 建立或編輯文件…',
18
+ Send: '送出',
19
+ Stop: '停止',
20
+ 'Page {n}': '第 {n} 頁',
21
+ Selection: '選取元件',
22
+ '{count} comment': '{count} 則留言',
23
+ '{count} comments': '{count} 則留言',
24
+ 'Apply comments': '套用留言',
25
+ 'Apply with {provider}': '用 {provider} 套用',
26
+ 'Create a document with {provider}': '用 {provider} 建立文件',
27
+ 'Draft a new document': '起草一份新文件',
28
+ 'Opens a blank document; describe it and the agent drafts it section by section.':
29
+ '開啟一份空白文件;描述內容後,agent 會一段一段寫出來。',
30
+ 'Apply pending comments': '套用待處理的留言',
31
+ 'Resolves every @doc-comment marker in this document.':
32
+ '處理這份文件中所有的 @doc-comment 標記。',
33
+ 'Create a theme': '建立主題',
34
+ 'Extracts or designs a reusable theme under themes/.': '在 themes/ 下萃取或設計可重用的主題。',
35
+ 'Edit this page': '編輯這一頁',
36
+ 'Describe a change to the page you are viewing.': '描述你想對目前頁面做的修改。',
37
+ 'What should we build?': '想做什麼?',
38
+ 'Describe a document, or pick a starting point.': '描述一份文件,或選一個起點。',
39
+ Continue: '繼續',
40
+ Other: '其他',
41
+ 'Type your own answer': '輸入你自己的答案',
42
+ Dismissed: '已略過',
43
+ 'Needs approval': '需要核准',
44
+ Allow: '允許',
45
+ Deny: '拒絕',
46
+ Allowed: '已允許',
47
+ Denied: '已拒絕',
48
+ 'Auto-approve': '自動核准',
49
+ 'Run commands without asking. Edits inside the workspace are always allowed.':
50
+ '不詢問就執行指令。工作區內的檔案編輯一律允許。',
51
+ Stopped: '已停止',
52
+ '{seconds}s': '{seconds} 秒',
53
+ Error: '錯誤',
54
+ 'Checking agents': '正在檢查 agent',
55
+ 'The agent panel is disabled in open-doc.config.ts.':
56
+ 'agent 面板已在 open-doc.config.ts 中停用。',
57
+ 'Connect an agent': '連接 agent',
58
+ 'Drive your coding agent from here instead of a terminal. Agents installed on this machine connect automatically and reuse their sign-in.':
59
+ '直接在這裡操作你的 coding agent,不用再切到終端機。這台電腦上已安裝的 agent 會自動連接,並沿用它的登入狀態。',
60
+ Connect: '連接',
61
+ Connecting: '連接中',
62
+ Connected: '已連接',
63
+ 'Adds {pkg} to this workspace with {pm}.': '會用 {pm} 把 {pkg} 加進這個工作區。',
64
+ 'CLI found · v{version}': '已找到 CLI · v{version}',
65
+ 'CLI found': '已找到 CLI',
66
+ 'CLI not found on PATH': 'PATH 中找不到 CLI',
67
+ 'Install the {name} CLI and sign in once; the panel reuses its login.':
68
+ '請安裝 {name} CLI 並登入一次;面板會沿用它的登入狀態。',
69
+ 'Install Codex first': '請先安裝 Codex',
70
+ 'The panel drives the Codex CLI on this machine, and it was not found on your PATH. Install it, sign in once in a terminal with `codex`, then check again.':
71
+ 'Agent 面板使用這台電腦上的 Codex CLI,但在 PATH 上找不到它。請先安裝,並在終端機用 `codex` 登入一次,再重新檢查。',
72
+ 'Check again': '重新檢查',
73
+ Retry: '重試',
74
+ '{name} connected': '{name} 已連接',
75
+ 'Could not install {pkg}': '無法安裝 {pkg}',
76
+ 'Manage agents': '管理 agent',
77
+ Back: '返回',
78
+ 'Could not send message': '訊息送出失敗',
79
+ "What's this document about?": '這份文件要寫什麼?',
80
+ 'Describe the topic, audience and tone. {provider} drafts it section by section while you watch.':
81
+ '描述主題、讀者和語氣,{provider} 會一段一段寫給你看。',
82
+ 'A two-page project brief on…': '一份兩頁的專案簡介,主題是…',
83
+ 'Could not create a document': '無法建立文件',
84
+ '{count} step': '{count} 個步驟',
85
+ '{count} steps': '{count} 個步驟',
86
+ Skip: '略過',
87
+ Copy: '複製',
88
+ Cancel: '取消',
89
+ 'Sending replaces the conversation after this message. Edits already made to files stay.':
90
+ '送出後會取代這則訊息之後的對話,已改動的檔案不會還原。',
91
+ Default: '預設',
92
+ Reasoning: '推理強度',
93
+ Auto: '自動',
94
+ Minimal: '最低',
95
+ Low: '低',
96
+ Medium: '中',
97
+ High: '高',
98
+ 'Extra high': '超高',
99
+ Max: '最高',
100
+ '{provider} is editing': '{provider} 正在編輯',
101
+ Thinking: '思考中',
102
+ 'Waiting for you': '等待你的回覆',
103
+ 'Draft with agent': '用 Agent 起草',
104
+ 'Resize the agent panel': '調整 Agent 面板寬度',
105
+ };
@@ -0,0 +1,9 @@
1
+ export const AGENT: Record<string, string> = {
2
+ Agent: 'Agent',
3
+ 'Close the agent panel': '關閉 Agent 面板',
4
+ 'Ask the agent': '詢問 Agent',
5
+ Ran: '執行',
6
+ 'This page could not be drawn': '這一頁無法顯示',
7
+ 'It is drawn again as soon as the source is saved.': '存檔後就會重新繪製。',
8
+ 'Apply with {agent}': '交給 {agent} 處理',
9
+ };
@@ -1,5 +1,13 @@
1
+ import { AGENT } from './agent';
2
+ import { AGENT_PANEL } from './agent-panel';
1
3
  import { BROWSER } from './browser';
2
4
  import { DOC } from './doc';
3
5
  import { PANELS } from './panels';
4
6
 
5
- export const ZH_TW: Record<string, string> = { ...BROWSER, ...DOC, ...PANELS };
7
+ export const ZH_TW: Record<string, string> = {
8
+ ...BROWSER,
9
+ ...DOC,
10
+ ...PANELS,
11
+ ...AGENT,
12
+ ...AGENT_PANEL,
13
+ };
@@ -0,0 +1,116 @@
1
+ export type NoteInline =
2
+ | { type: 'text'; text: string }
3
+ | { type: 'strong'; children: NoteInline[] }
4
+ | { type: 'em'; children: NoteInline[] }
5
+ | { type: 'code'; text: string };
6
+
7
+ export type NoteBlock =
8
+ | { type: 'paragraph'; lines: NoteInline[][] }
9
+ | { type: 'heading'; level: 1 | 2 | 3; children: NoteInline[] }
10
+ | { type: 'list'; ordered: boolean; items: NoteInline[][] };
11
+
12
+ const HEADING = /^(#{1,3})\s+(.*)$/;
13
+ // Ordered before the single-star branch so `**bold**` never parses as
14
+ // empty italics. Emphasis content must start and end with non-whitespace
15
+ // (CommonMark) so spaced stars like `2 * 3 … 5 * 4` never pair up, and `_`
16
+ // needs word boundaries to leave snake_case alone.
17
+ const INLINE =
18
+ /`([^`\n]+)`|\*\*(\S(?:[^\n]*?\S)?)\*\*|\*([^\s*](?:[^*\n]*[^\s*])?)\*|(?<![\w])_([^\s_](?:[^_\n]*[^\s_])?)_(?![\w])/g;
19
+
20
+ // Backslash-escaped punctuation is swapped for private-use characters before
21
+ // any block or inline matching, so an escaped delimiter can never open or
22
+ // close anything. Leaves swap them back — code spans keep the backslash,
23
+ // matching CommonMark's "no escapes inside code" rule.
24
+ const ESCAPABLE = '\\`*_#-.)';
25
+ const ESCAPE = /\\([\\`*_#\-.)])/g;
26
+ const HIDDEN = /[-]/g;
27
+
28
+ function hideEscapes(text: string): string {
29
+ return text
30
+ .replace(HIDDEN, '')
31
+ .replace(ESCAPE, (_, ch: string) => String.fromCharCode(0xe000 + ESCAPABLE.indexOf(ch)));
32
+ }
33
+
34
+ function restoreEscapes(text: string, keepBackslash: boolean): string {
35
+ return text.replace(HIDDEN, (ch) => {
36
+ const original = ESCAPABLE[ch.charCodeAt(0) - 0xe000];
37
+ return keepBackslash ? `\\${original}` : original;
38
+ });
39
+ }
40
+
41
+ function matchListItem(line: string): { ordered: boolean; content: string } | null {
42
+ const unordered = /^\s*[-*]\s+(.*)$/.exec(line);
43
+ if (unordered) return { ordered: false, content: unordered[1] };
44
+ const ordered = /^\s*\d{1,3}[.)]\s+(.*)$/.exec(line);
45
+ if (ordered) return { ordered: true, content: ordered[1] };
46
+ return null;
47
+ }
48
+
49
+ function parseInlineHidden(text: string): NoteInline[] {
50
+ const out: NoteInline[] = [];
51
+ const pushText = (raw: string) => {
52
+ if (raw) out.push({ type: 'text', text: restoreEscapes(raw, false) });
53
+ };
54
+ let last = 0;
55
+ for (const m of text.matchAll(INLINE)) {
56
+ pushText(text.slice(last, m.index));
57
+ if (m[1] !== undefined) out.push({ type: 'code', text: restoreEscapes(m[1], true) });
58
+ else if (m[2] !== undefined) out.push({ type: 'strong', children: parseInlineHidden(m[2]) });
59
+ else out.push({ type: 'em', children: parseInlineHidden(m[3] ?? m[4]) });
60
+ last = m.index + m[0].length;
61
+ }
62
+ pushText(text.slice(last));
63
+ return out;
64
+ }
65
+
66
+ export function parseInline(text: string): NoteInline[] {
67
+ return parseInlineHidden(hideEscapes(text));
68
+ }
69
+
70
+ export function parseNoteMarkdown(text: string): NoteBlock[] {
71
+ const lines = hideEscapes(text).split('\n');
72
+ const blocks: NoteBlock[] = [];
73
+ let i = 0;
74
+ while (i < lines.length) {
75
+ const trimmed = lines[i].trim();
76
+ if (trimmed === '') {
77
+ i++;
78
+ continue;
79
+ }
80
+ const heading = HEADING.exec(trimmed);
81
+ if (heading) {
82
+ blocks.push({
83
+ type: 'heading',
84
+ level: heading[1].length as 1 | 2 | 3,
85
+ children: parseInlineHidden(heading[2].trim()),
86
+ });
87
+ i++;
88
+ continue;
89
+ }
90
+ const item = matchListItem(lines[i]);
91
+ if (item) {
92
+ const items: NoteInline[][] = [];
93
+ while (i < lines.length) {
94
+ const next = matchListItem(lines[i]);
95
+ if (!next || next.ordered !== item.ordered) break;
96
+ items.push(parseInlineHidden(next.content.trim()));
97
+ i++;
98
+ }
99
+ blocks.push({ type: 'list', ordered: item.ordered, items });
100
+ continue;
101
+ }
102
+ // Paragraph lines keep leading whitespace (rendered with pre-wrap) so
103
+ // plain-text notes don't lose manual indentation or spacing.
104
+ const paragraph = [parseInlineHidden(lines[i].trimEnd())];
105
+ i++;
106
+ while (i < lines.length) {
107
+ const next = lines[i];
108
+ const nextTrimmed = next.trim();
109
+ if (nextTrimmed === '' || HEADING.test(nextTrimmed) || matchListItem(next)) break;
110
+ paragraph.push(parseInlineHidden(next.trimEnd()));
111
+ i++;
112
+ }
113
+ blocks.push({ type: 'paragraph', lines: paragraph });
114
+ }
115
+ return blocks;
116
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * A short notice in the corner of the window — the few the agent panel raises
3
+ * when something it started from a click fails or finishes. Drawn straight into
4
+ * the DOM rather than through a toast library, since the runtime ships to
5
+ * users; the call shape matches `sonner`'s so the panel reads the same.
6
+ */
7
+
8
+ type Kind = 'error' | 'success';
9
+ type Options = { description?: string };
10
+
11
+ const SHOWN_MS = 5000;
12
+
13
+ function host(): HTMLElement {
14
+ let el = document.getElementById('od-toasts');
15
+ if (!el) {
16
+ el = document.createElement('div');
17
+ el.id = 'od-toasts';
18
+ el.setAttribute('role', 'status');
19
+ el.setAttribute('aria-live', 'polite');
20
+ el.className =
21
+ 'pointer-events-none fixed right-4 bottom-4 z-[100] flex w-[320px] max-w-[calc(100vw-2rem)] flex-col gap-2';
22
+ document.body.append(el);
23
+ }
24
+ return el;
25
+ }
26
+
27
+ function show(kind: Kind, message: string, options?: Options): void {
28
+ if (typeof document === 'undefined') return;
29
+ const card = document.createElement('div');
30
+ card.className =
31
+ 'island-enter pointer-events-auto rounded-[8px] border border-hairline bg-popover px-3 py-2.5 text-[12.5px] text-popover-foreground shadow-floating';
32
+ card.dataset.kind = kind;
33
+ const title = document.createElement('p');
34
+ title.className = kind === 'error' ? 'font-medium text-destructive' : 'font-medium';
35
+ title.textContent = message;
36
+ card.append(title);
37
+ if (options?.description) {
38
+ const body = document.createElement('p');
39
+ body.className = 'mt-0.5 break-words text-[11.5px] text-muted-foreground';
40
+ body.textContent = options.description;
41
+ card.append(body);
42
+ }
43
+ host().append(card);
44
+ setTimeout(() => card.remove(), SHOWN_MS);
45
+ }
46
+
47
+ export const toast = {
48
+ error: (message: string, options?: Options) => show('error', message, options),
49
+ success: (message: string, options?: Options) => show('success', message, options),
50
+ };
@@ -0,0 +1,15 @@
1
+ import { type RefObject, useLayoutEffect } from 'react';
2
+
3
+ export function useAutoGrow(
4
+ ref: RefObject<HTMLTextAreaElement | null>,
5
+ value: string,
6
+ max: number,
7
+ ): void {
8
+ // biome-ignore lint/correctness/useExhaustiveDependencies: re-measure whenever the text changes
9
+ useLayoutEffect(() => {
10
+ const node = ref.current;
11
+ if (!node) return;
12
+ node.style.height = '0px';
13
+ node.style.height = `${Math.min(max, Math.max(40, node.scrollHeight))}px`;
14
+ }, [ref, value, max]);
15
+ }
@@ -0,0 +1,28 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import { docIds, loadDoc } from './docs';
3
+
4
+ /**
5
+ * Every document's display title, resolved once `enabled` first turns true —
6
+ * kept lazy since it imports every document module.
7
+ */
8
+ export function useDocTitles(enabled: boolean): Record<string, string> {
9
+ const [titles, setTitles] = useState<Record<string, string>>({});
10
+ const startedRef = useRef(false);
11
+
12
+ useEffect(() => {
13
+ if (!enabled || startedRef.current) return;
14
+ startedRef.current = true;
15
+ void Promise.all(
16
+ docIds.map(async (id): Promise<[string, string]> => {
17
+ try {
18
+ const mod = await loadDoc(id);
19
+ return [id, mod.meta?.title ?? id];
20
+ } catch {
21
+ return [id, id];
22
+ }
23
+ }),
24
+ ).then((entries) => setTitles(Object.fromEntries(entries)));
25
+ }, [enabled]);
26
+
27
+ return titles;
28
+ }