@audiofool/moondog 0.4.0-beta.3 → 0.4.0-beta.4

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 (93) hide show
  1. package/README.md +19 -8
  2. package/package.json +1 -1
  3. package/scripts/moondog.mjs +95 -103
  4. package/src/core/apple-library-source-status.mjs +64 -18
  5. package/src/core/apple-projection-domain-services.mjs +63 -52
  6. package/src/core/capability-catalog.mjs +18 -2
  7. package/src/core/import-source-history.mjs +28 -0
  8. package/src/core/library-draft.mjs +16 -0
  9. package/src/core/library-names.mjs +12 -0
  10. package/src/core/library-store.mjs +361 -23
  11. package/src/core/listener-avoids.mjs +31 -0
  12. package/src/core/listening-action.mjs +41 -0
  13. package/src/core/listening-moment.mjs +67 -0
  14. package/src/core/listening-now.mjs +69 -28
  15. package/src/core/listening-profile-domain-services.mjs +28 -18
  16. package/src/core/listening-scope.mjs +119 -0
  17. package/src/core/moondog-application.mjs +1003 -267
  18. package/src/core/play-follower.mjs +73 -37
  19. package/src/core/portable-playlist.mjs +125 -0
  20. package/src/core/profile-discovery-draft.mjs +35 -0
  21. package/src/core/track-title.mjs +70 -4
  22. package/src/i18n/import-history.mjs +647 -0
  23. package/src/i18n/messages/de.mjs +3 -3
  24. package/src/i18n/messages/en.mjs +3 -3
  25. package/src/i18n/messages/es.mjs +3 -3
  26. package/src/i18n/messages/fr.mjs +3 -3
  27. package/src/i18n/messages/it.mjs +3 -3
  28. package/src/i18n/messages/ja.mjs +3 -3
  29. package/src/i18n/messages/ko.mjs +3 -3
  30. package/src/i18n/messages/pt.mjs +3 -3
  31. package/src/i18n/messages/zh-Hant.mjs +3 -3
  32. package/src/i18n/messages/zh.mjs +3 -3
  33. package/src/i18n/screen/es.mjs +89 -26
  34. package/src/i18n/screen/ja.mjs +88 -25
  35. package/src/i18n/screen/pt.mjs +89 -26
  36. package/src/i18n/screen/zh.mjs +88 -25
  37. package/src/importers/apple-music-library/import-batch.mjs +64 -32
  38. package/src/importers/apple-music-library/normalize.mjs +36 -6
  39. package/src/importers/apple-music-library/save-time.mjs +17 -0
  40. package/src/importers/zip-reader.mjs +24 -2
  41. package/src/integrations/apple-music/catalog-playlist-reader.mjs +111 -0
  42. package/src/integrations/apple-music/catalog.mjs +84 -25
  43. package/src/integrations/apple-music/song-id.mjs +13 -0
  44. package/src/integrations/apple-music/terminal-preview-player.mjs +154 -44
  45. package/src/integrations/listenbrainz/history-file.mjs +63 -35
  46. package/src/integrations/netease/ncm-cli-player.mjs +355 -68
  47. package/src/integrations/netease/queue-occurrence.mjs +138 -0
  48. package/src/integrations/playlist-links.mjs +93 -30
  49. package/src/integrations/public-playlists.mjs +21 -15
  50. package/src/integrations/spotify/account-data-history.mjs +9 -10
  51. package/src/integrations/spotify/account-data-profile.mjs +1 -0
  52. package/src/integrations/spotify/extended-streaming-history.mjs +57 -52
  53. package/src/integrations/spotify/history-archive.mjs +8 -18
  54. package/src/integrations/spotify/library-snapshot.mjs +2 -1
  55. package/src/integrations/spotify/service.mjs +29 -11
  56. package/src/integrations/spotify/web-api-client.mjs +2 -2
  57. package/src/integrations/stable-audio/local-generator.mjs +13 -5
  58. package/src/integrations/youtube-music/takeout.mjs +12 -8
  59. package/src/memory/local-memory-store.mjs +479 -27
  60. package/src/memory/reflection-worker.mjs +1 -0
  61. package/src/profile/apple-library-import.mjs +56 -2
  62. package/src/profile/history-import.mjs +58 -27
  63. package/src/profile/listener-corrections.mjs +2 -4
  64. package/src/profile/listener-profile-build.mjs +128 -45
  65. package/src/profile/listener-profile-store.mjs +25 -4
  66. package/src/profile/listener-profile-verification.mjs +11 -5
  67. package/src/profile/listener-profile-worker.mjs +24 -8
  68. package/src/profile/listening-history-store.mjs +944 -367
  69. package/src/profile/listening-profile-projection.mjs +123 -156
  70. package/src/profile/local-file-import.mjs +172 -0
  71. package/src/profile/moondog-suggestions.mjs +40 -11
  72. package/src/profile/profile-exploration.mjs +36 -6
  73. package/src/profile/recorded-measures.mjs +5 -0
  74. package/src/profile/spotify-archive-taste.mjs +41 -65
  75. package/src/runtime/pi/agent-runtime.mjs +360 -215
  76. package/src/runtime/pi/custom-endpoints.mjs +30 -8
  77. package/src/runtime/pi/memory-agent-runtime.mjs +43 -3
  78. package/src/runtime/pi/playback-rules.mjs +100 -0
  79. package/src/runtime/pi/profile-build-runtime.mjs +81 -24
  80. package/src/surfaces/cli/brand-components.mjs +9 -6
  81. package/src/surfaces/cli/command-completions.mjs +8 -1
  82. package/src/surfaces/cli/format-output.mjs +207 -34
  83. package/src/surfaces/cli/history-import-view.mjs +130 -21
  84. package/src/surfaces/cli/listenbrainz-command.mjs +7 -2
  85. package/src/surfaces/cli/listener-profile-command.mjs +67 -10
  86. package/src/surfaces/cli/listening-menu.mjs +3 -0
  87. package/src/surfaces/cli/profile-command.mjs +1 -0
  88. package/src/surfaces/cli/spotify-command.mjs +17 -25
  89. package/src/surfaces/cli/taste-period.mjs +22 -0
  90. package/src/surfaces/cli/taste-profile-model.mjs +52 -32
  91. package/src/surfaces/cli/tui.mjs +557 -170
  92. package/src/surfaces/html/tasteprint.mjs +181 -93
  93. package/src/surfaces/import-source-history.mjs +80 -0
@@ -1,6 +1,35 @@
1
1
  // Screen text in Simplified Chinese.
2
2
  // Keys are the English sentences in the source; scripts/i18n-strings.mjs lists them.
3
3
  export default {
4
+ "Type `/library ` and press Tab for more.": "输入 `/library ` 后按 Tab 查看更多操作。",
5
+ "Choose a playlist to play": "选择要播放的歌单",
6
+ "Write a playlist to disk": "将歌单导出为本地文件",
7
+ "Use /library export-files <destination folder>.": "请使用 /library export-files <目标文件夹>。",
8
+ "Choose a playlist to export": "选择要导出的歌单",
9
+ "Writing playlist files…": "正在写入歌单文件…",
10
+ "Exported {name}.": "已导出{name}。",
11
+ "Entries {entries} · songs with links {linked} · made tracks with audio {copied}": "共 {entries} 项 · 有链接的歌曲 {linked} 首 · 有音频的 Moondog 创作 {copied} 首",
12
+ "Missing audio {missing} · songs without links {unlinked}": "音频缺失 {missing} 首 · 无链接歌曲 {unlinked} 首",
13
+ "Song details or playlist artwork will be updated.": "将更新歌曲信息或歌单封面。",
14
+ "Updated song details or playlist artwork.": "已更新歌曲信息或歌单封面。",
15
+ "Refresh a linked playlist": "从来源刷新歌单",
16
+ "No linked playlist matches. Use `/library import <link>` to keep a copy.": "没有匹配的关联歌单。用 `/library import <link>` 保存一份副本。",
17
+ "Choose a linked playlist": "选择关联歌单",
18
+ "Add {added} · remove {removed}": "新增 {added} 首 · 移除 {removed} 首",
19
+ "Existing songs will change order.": "现有歌曲的顺序会变。",
20
+ "Existing songs will keep their order.": "现有歌曲会保留原有顺序。",
21
+ "{service} returned {read} of {songs}.": "{service} 共 {songs},读到了 {read} 首。",
22
+ "{service} returned {songs} without a total.": "从 {service} 读到了 {songs},来源未提供总数。",
23
+ "Partial playlist · {songs} available.": "只读到了部分歌单({songs})。",
24
+ "The source is incomplete. Only new songs will be added. Your current songs, their order, and tracks Moondog made stay.": "来源列表不完整,只会添加新歌。现有歌曲及其顺序和 Moondog 创作的曲目都会保留。",
25
+ "The source sets its songs in this copy. Songs you added here and tracks Moondog made stay.": "来源歌单的歌曲以来源为准。你在这里添加的歌曲和 Moondog 创作的曲目会保留。",
26
+ "No changes to apply.": "没有需要应用的更改。",
27
+ "Keep current copy": "保留当前副本",
28
+ "Apply refresh": "应用更新",
29
+ "Review playlist changes": "核对歌单更改",
30
+ "Refreshed {name}.": "已刷新 {name}。",
31
+ "Added {added} · removed {removed}.": "新增 {added} 首 · 移除 {removed} 首。",
32
+ "Existing songs were reordered.": "已调整现有歌曲的顺序。",
4
33
  "your listening room": "你的聆听室",
5
34
  "profile ready": "资料就绪",
6
35
  "local profile": "本地资料",
@@ -22,7 +51,7 @@ export default {
22
51
  "What have you been listening to?": "最近在听什么?",
23
52
  "A song, a playlist, or what to play next.": "一首歌、一个歌单,或者接下来放什么。",
24
53
  "On the air, just for you.": "只为你,正在播出。",
25
- "# Your listening room\n\n## 01 / Listen and discover\n\nJust type to talk about music, ask for a playlist, or go exploring.\nTo talk, Moondog needs a model: `/auth` signs you in, then `/model` picks one.\nWhile an answer is coming, each step shows in the conversation, and the footer names the one in progress.\n\n- `/taste` - your profile: open any song or artist to see why it's there\n- `/taste report` - the whole picture on one page\n- `/import` - bring in your history, your library, or a playlist\n- `/library` - your saved songs and playlists\n- `/generation on|off` - turn Stable Audio 3 on or off. Moondog can write a score when it is off\n- `/onair` - go on air, or come off it\n- `/lyrics` - the lyrics on the sleeve; `/lyrics sync` finds more\n- `/service` - choose where I play music: Spotify, Apple Music, or NetEase\n- `/spotify` - play, queue, and make playlists in Spotify\n- Ask to move playback onto your iPhone, computer, or another Spotify device by name\n- `/web search <query>` or `/web read <url>` - look things up on public music sites\n\n## 02 / Make it yours\n\n- `/profile` - the same profile as `/taste`\n- `/profile corrections` - everything you've told me\n- `/profile retract <id>` - undo one of those\n- `/profile help` - the full set of profile commands\n- `/remember <text>`, `/memory`, `/forget <id>` - what I remember between conversations\n\n## 03 / Around the room\n\n- `/home` - back to the record sleeve; the conversation stays\n- `/theme paper|charcoal|terminal|auto` - change the look\n- `/art braille|ascii|off` - change the artwork\n- `/motion on|off` - turn the animation on or off\n- `/commands` or Ctrl+P - search every command; your message stays put\n- Page Up and Page Down scroll the conversation. The header and your draft stay put\n- Up and Down in the draft recall what you typed in this conversation\n- `/resume` - pick up a saved conversation (type to filter, Enter opens)\n- `/new` - start fresh; this conversation stays saved\n- `/rewind` or Alt+R - edit an earlier message in place; the messages after it are replaced\n- `/branch` - go on from here in a new conversation; this one stays saved\n- `/status`, `/sources`, `/tools`, `/doctor` - see what's connected and working\n- `/reload` - reload model settings and sign-ins\n- `/model roles` - see what side tasks use: the model that reads images and the web search service\n- `/effort` - choose how hard the model thinks\n- `/endpoint add` or `/endpoint remove <id>` - add a model service by its address, or remove it\n- `/update [--check] [--channel latest|beta]` - check for a release, or close this room and install it\n- `/help all` - every command, including the ones for the shell\n- `/language` - choose the language Moondog uses\n- `/quit` - leave\n\nTab moves to the menu on the home screen. Esc goes back to typing.\nEnter sends, and Shift+Enter starts a new line.\nTab or Enter accepts a suggestion.\nCtrl+C stops a model or web request, or leaves when nothing is running.\nIn the profile, type to filter, Tab switches lists, and Enter shows what you can do.\nCtrl+R refreshes it and Ctrl+O opens the full report.\nYour profile works without a model.\nPut quotes around paths, titles, and names that have spaces.": "# 你的聆听室\n\n## 01 / 听歌与发现\n\n直接输入就能聊音乐、要一个歌单,或者随便逛逛。\n对话需要一个模型:`/auth` 登录,然后用 `/model` 选一个。\n回答生成时,每一步都会显示在对话里,底栏会标出正在进行的那一步。\n\n- `/taste` - 你的资料:打开任意歌曲或艺人,看看它为什么在这里\n- `/taste report` - 一页看完整体情况\n- `/import` - 导入你的历史、曲库或一个歌单\n- `/library` - 你收藏的歌和播放列表\n- `/generation on|off` - 开启或关闭 Stable Audio 3。关闭后,Moondog 仍可以写谱作曲\n- `/onair` - 开播,或下播\n- `/lyrics` - 封套上的歌词;`/lyrics sync` 找更多\n- `/service` - 选择我在哪里放音乐:Spotify、Apple Music 或网易云音乐\n- `/spotify` - 在 Spotify 里播放、加入队列、建歌单\n- 说出设备名,就能把播放切到你的 iPhone、电脑或其他 Spotify 设备\n- `/web search <关键词>` 或 `/web read <网址>` - 在公开音乐网站上查资料\n\n## 02 / 变成你的\n\n- `/profile` - 和 `/taste` 是同一份资料\n- `/profile corrections` - 你告诉过我的所有选择\n- `/profile retract <id>` - 撤销其中一项\n- `/profile help` - 资料相关的全部命令\n- `/remember <内容>`、`/memory`、`/forget <id>` - 我在对话之间记住的内容\n\n## 03 / 在房间里转转\n\n- `/home` - 回到唱片封套;对话还在\n- `/theme paper|charcoal|terminal|auto` - 换外观\n- `/art braille|ascii|off` - 换插画\n- `/motion on|off` - 打开或关闭动画\n- `/commands` 或 Ctrl+P - 搜索全部命令;你正在写的消息不会丢\n- Page Up 和 Page Down 滚动对话,顶栏和草稿保持不动\n- 在草稿里按上下键,可以找回本次对话中输入过的内容\n- `/resume` - 继续一段保存的对话(输入筛选,Enter 打开)\n- `/new` - 重新开始;这段对话会保存下来\n- `/rewind` 或 Alt+R - 就地编辑之前的一条消息;之后的消息会被替换\n- `/branch` - 从这里在新对话中继续;这段对话会保留\n- `/status`、`/sources`、`/tools`、`/doctor` - 看看哪些已连接、正常工作\n- `/reload` - 重新加载模型设置和登录\n- `/model roles` - 看看副任务在用什么:读图的模型和网页搜索服务\n- `/effort` - 选择模型思考的程度\n- `/endpoint add` 或 `/endpoint remove <id>` - 按地址添加模型服务,或移除它\n- `/update [--check] [--channel latest|beta]` - 检查新版本,或关闭聆听室并安装\n- `/help all` - 全部命令,包括终端里的\n- `/language` - 选择 Moondog 使用的语言\n- `/quit` - 离开\n\n在首页按 Tab 进入菜单,按 Esc 回到输入。\nEnter 发送,Shift+Enter 换行。\nTab 或 Enter 接受补全建议。\nCtrl+C 停止模型或网页请求;没有任务在运行时则退出。\n在资料页里,输入即可筛选,Tab 切换列表,Enter 查看可做的操作。\nCtrl+R 刷新,Ctrl+O 打开完整报告。\n没有模型,资料页也能用。\n路径、标题和名字里有空格时,请加上引号。",
54
+ "# Your listening room\n\n## 01 / Listen and discover\n\nJust type to talk about music, ask for a playlist, or go exploring.\nTo talk, Moondog needs a model: `/auth` signs you in, then `/model` picks one.\nWhile an answer is coming, each step shows in the conversation, and the footer names the one in progress.\n\n- `/taste` - your profile: open any song or artist to see why it's there\n- `/taste report` - the whole picture on one page\n- `/import` - bring in your history, your library, or a playlist\n- `/library` - your saved songs and playlists\n- `/generation on|off` - turn Stable Audio 3 on or off. Moondog can write a score when it is off\n- `/onair` - go on air, or come off it\n- `/lyrics` - the lyrics on the sleeve; `/lyrics sync` finds more\n- `/service` - choose where I play music: Spotify, Apple Music, or NetEase\n- `/spotify` - play, queue, and make playlists in Spotify\n- Ask to move playback onto your iPhone, computer, or another Spotify device by name\n- `/web search <query>` or `/web read <url>` - look things up on public music sites\n\n## 02 / Make it yours\n\n- `/profile` - the same profile as `/taste`\n- `/profile corrections` - everything you've told me\n- `/profile retract <id>` - undo one of those\n- `/profile help` - the full set of profile commands\n- `/remember <text>`, `/memory`, `/forget <id>` - what I remember between conversations\n\n## 03 / Around the room\n\n- `/home` - back to the record sleeve; the conversation stays\n- `/theme paper|charcoal|terminal|auto` - change the look\n- `/art braille|ascii|off` - change the artwork\n- `/motion on|off` - turn the animation on or off\n- `/commands` or Ctrl+P - search every command; your message stays put\n- Page Up and Page Down scroll the conversation. The header and your draft stay put\n- Up and Down in the draft recall what you typed in this conversation\n- `/resume` - pick up a saved conversation (type to filter, Enter opens)\n- `/new` - start fresh; this conversation stays saved\n- `/rewind` or Alt+R - edit an earlier message in place; the messages after it are replaced\n- `/branch` - go on from here in a new conversation; this one stays saved\n- `/status`, `/tools`, `/doctor` - see what's connected and working\n- `/sources [offset]` - see your import history\n- `/reload` - reload model settings and sign-ins\n- `/model roles` - see what side tasks use: the model that reads images and the web search service\n- `/effort` - choose how hard the model thinks\n- `/endpoint add` or `/endpoint remove <id>` - add a model service by its address, or remove it\n- `/update [--check] [--channel latest|beta]` - check for a release, or close this room and install it\n- `/help all` - every command, including the ones for the shell\n- `/language` - choose the language Moondog uses\n- `/quit` - leave\n\nTab moves to the menu on the home screen. Esc goes back to typing.\nEnter sends, and Shift+Enter starts a new line.\nTab or Enter accepts a suggestion.\nCtrl+C stops a model or web request, or leaves when nothing is running.\nIn the profile, type to filter, Tab switches lists, and Enter shows what you can do.\nCtrl+R refreshes it and Ctrl+O opens the full report.\nYour profile works without a model.\nPut quotes around paths, titles, and names that have spaces.": "# 你的聆听室\n\n## 01 / 听歌与发现\n\n直接输入就能聊音乐、要一个歌单,或者随便逛逛。\n对话需要一个模型:`/auth` 登录,然后用 `/model` 选一个。\n回答生成时,每一步都会显示在对话里,底栏会标出正在进行的那一步。\n\n- `/taste` - 你的资料:打开任意歌曲或艺人,看看它为什么在这里\n- `/taste report` - 一页看完整体情况\n- `/import` - 导入你的历史、曲库或一个歌单\n- `/library` - 你收藏的歌和播放列表\n- `/generation on|off` - 开启或关闭 Stable Audio 3。关闭后,Moondog 仍可以写谱作曲\n- `/onair` - 开播,或下播\n- `/lyrics` - 封套上的歌词;`/lyrics sync` 找更多\n- `/service` - 选择我在哪里放音乐:Spotify、Apple Music 或网易云音乐\n- `/spotify` - 在 Spotify 里播放、加入队列、建歌单\n- 说出设备名,就能把播放切到你的 iPhone、电脑或其他 Spotify 设备\n- `/web search <关键词>` 或 `/web read <网址>` - 在公开音乐网站上查资料\n\n## 02 / 变成你的\n\n- `/profile` - 和 `/taste` 是同一份资料\n- `/profile corrections` - 你告诉过我的所有选择\n- `/profile retract <id>` - 撤销其中一项\n- `/profile help` - 资料相关的全部命令\n- `/remember <内容>`、`/memory`、`/forget <id>` - 我在对话之间记住的内容\n\n## 03 / 在房间里转转\n\n- `/home` - 回到唱片封套;对话还在\n- `/theme paper|charcoal|terminal|auto` - 换外观\n- `/art braille|ascii|off` - 换插画\n- `/motion on|off` - 打开或关闭动画\n- `/commands` 或 Ctrl+P - 搜索全部命令;你正在写的消息不会丢\n- Page Up 和 Page Down 滚动对话,顶栏和草稿保持不动\n- 在草稿里按上下键,可以找回本次对话中输入过的内容\n- `/resume` - 继续一段保存的对话(输入筛选,Enter 打开)\n- `/new` - 重新开始;这段对话会保存下来\n- `/rewind` 或 Alt+R - 就地编辑之前的一条消息;之后的消息会被替换\n- `/branch` - 从这里在新对话中继续;这段对话会保留\n- `/status`、`/tools`、`/doctor` - 看看哪些已连接、正常工作\n- `/sources [offset]` - 查看导入记录\n- `/reload` - 重新加载模型设置和登录\n- `/model roles` - 看看副任务在用什么:读图的模型和网页搜索服务\n- `/effort` - 选择模型思考的程度\n- `/endpoint add` 或 `/endpoint remove <id>` - 按地址添加模型服务,或移除它\n- `/update [--check] [--channel latest|beta]` - 检查新版本,或关闭聆听室并安装\n- `/help all` - 全部命令,包括终端里的\n- `/language` - 选择 Moondog 使用的语言\n- `/quit` - 离开\n\n在首页按 Tab 进入菜单,按 Esc 回到输入。\nEnter 发送,Shift+Enter 换行。\nTab 或 Enter 接受补全建议。\nCtrl+C 停止模型或网页请求;没有任务在运行时则退出。\n在资料页里,输入即可筛选,Tab 切换列表,Enter 查看可做的操作。\nCtrl+R 刷新,Ctrl+O 打开完整报告。\n没有模型,资料页也能用。\n路径、标题和名字里有空格时,请加上引号。",
26
55
  "Listening profile": "聆听资料",
27
56
  "Profile": "资料",
28
57
  "See what your listening reveals. Tell me what I missed.": "看看你的聆听透露了什么,告诉我哪里没看到。",
@@ -102,7 +131,7 @@ export default {
102
131
  "{count} separate runs": "{count} 段连播",
103
132
  "Unknown year": "年份未知",
104
133
  "{count} new": "新增 {count} 首",
105
- "mostly {artist}": "主要是 {artist}",
134
+ "a leading artist was {artist}": "收听排名靠前的艺人有 {artist}",
106
135
  "Unknown season": "季度未知",
107
136
  "nothing in your history": "历史里没有记录",
108
137
  "top song {song}": "代表曲:{song}",
@@ -118,16 +147,17 @@ export default {
118
147
  "What I'm reading from": "我读取的来源",
119
148
  "Listening time is known for {count} of those plays": "其中 {count} 次播放有聆听时长",
120
149
  "What you told me": "你告诉我的",
121
- "Artists who stayed with you across the years": "多年来一直陪着你的艺人",
150
+ "Top artists across your recorded history": "整个收听记录中最常听的艺人",
122
151
  "Lately": "最近",
123
- "Who you've played most in the last {count} days": "过去 {count} 天里你听得最多的",
124
- "Who you've played most recently": "你最近听得最多的",
152
+ "{count} days ending {date} (UTC)": "截至 {date}(UTC)的 {count} 天",
153
+ "Final {count} days of recorded history": "收听记录的最后 {count} 天",
154
+ "Near the end of your recorded history": "收听记录的末段",
125
155
  "Year by year": "逐年回顾",
126
156
  "Seasons": "季度",
127
157
  "Your last twelve quarters. \"New\" means new to your history, not necessarily new to you.": "最近十二个季度。“新增”指你的历史里第一次出现,不一定是你第一次听到。",
128
158
  "The years, one track each": "每一年,一首歌",
129
- "Songs you used to play a lot that have gone quiet for {count}+ days": "以前常听、已经沉寂 {count}+ 天的歌",
130
- "Songs you used to play a lot that have gone quiet": "以前常听、后来沉寂的歌",
159
+ "Frequent plays followed by {count}+ days without a recorded play": "曾经常听,随后至少 {count} 天没有播放记录的歌曲",
160
+ "History through {date} (UTC)": "收听记录截至 {date}(UTC)",
131
161
  "Songs that found their way back after {count}+ days away": "沉寂 {count}+ 天之后又回来的歌",
132
162
  "Songs that found their way back after long gaps": "长时间沉寂之后又回来的歌",
133
163
  "Songs you played again right away": "你马上又重放的歌",
@@ -180,7 +210,7 @@ export default {
180
210
  "Memory": "记忆",
181
211
  "Right now I can't change anything in your music accounts.": "目前我不能修改你音乐账号里的任何内容。",
182
212
  "I can make changes in your connected accounts, and I always ask first.": "我可以修改你已连接的账号,并且每次都会先问你。",
183
- "# Every command\n\nFrom your shell:\n\n- `moondog --version` - show the installed version\n- `moondog update [--check] [--channel latest|beta]` - check for or install a published release\n- `moondog web status|search|read [arguments] [--json]` - look things up on public music sites through DeepSeek, Brave Search or the Codex CLI\n- `moondog demo-history --output <absolute-file.zip> [--json]` - make a fictional Spotify history ZIP to try the importer with\n- `moondog auth login <provider>` - sign in to a model provider; the key is typed out of sight; `openai --chatgpt` signs in with your ChatGPT subscription\n- `moondog auth status [provider]` - see which sign-ins are saved\n- `moondog auth logout <provider>` - sign out of a provider\n- `moondog spotify help` - set up and control Spotify\n- `moondog spotify login [client-id]` - connect Spotify in your browser\n- `moondog spotify now|devices|queue` - see what Spotify is playing, where, and what's next\n- `moondog spotify recent` - see what you played lately\n- `moondog spotify sync-recent` - add your latest plays to your profile\n- `moondog spotify sync-library` - add your Spotify library to your profile\n- `moondog spotify play|pause|next|previous` - control Spotify playback\n- `moondog listenbrainz import-history <listen-history.json>` - add a ListenBrainz listens file to your profile\n- `moondog catalog latest-single --artist <name> [--known-release <title> | --from <spotify-history.zip>]` - find an artist's latest single on Apple Music (US), no model needed\n- `moondog status [--json]` - see where things stand\n- `moondog taste [--json]` - your listening report\n- `moondog taste --html [--output <file.html>]` - save your report as a web page that works offline\n- `moondog taste --card [--output <file.html>]` - save a short recap you can check before sharing\n- `moondog taste --from <spotify-history.zip> --html` - a one-off report from a Spotify ZIP, without saving it\n- `moondog taste --from <account-data.zip> --from <extended-history.zip> --html` - a one-off report from both Spotify exports together\n- `moondog taste --from <spotify-history.zip> --save --html` - save the Spotify history, then show your full report\n- `moondog data inspect --scope <listening|apple|profile>` - see what's stored, and get the code needed to reset it\n- `moondog data export --scope <listening|apple|profile> --output <directory>` - export a copy, leaving the original alone\n- `moondog data reset --scope <listening|apple|profile> --confirm <token>` - set stored data aside (it is archived, not deleted)\n- `moondog profile build [--force]` - build or resume a saved profile with your connected model\n- `moondog profile saved [offset]` - read your saved profile\n- `moondog profile explain <number>` - trace a saved finding to its evidence\n- `moondog profile corrections [--all]` - everything you've told me, including earlier choices\n- `moondog profile correct --artist <name> (--like|--avoid)` - like an artist, or keep them out\n- `moondog profile correct --track <title> --by <artist> (--like|--avoid)` - like a track, or keep it out\n- `moondog profile retract <correction-id>` - undo one of your choices\n- `moondog demo --offline [--json]` - a demo with made-up data, no sign-in needed\n- `moondog demo [prompt] [--json]` - the same demo, talking through your model\n- `moondog ask <prompt>` - ask one question and exit\n- `moondog remember <text>` - ask me to remember something\n- `moondog forget <memory-id>` - forget something\n- `moondog memory reflect [--dry-run] [--json]` - let me think over recent conversations now\n- `moondog` - open the listening room\n\nInside the listening room:\n\n- `/update [--check] [--channel latest|beta]` - check for updates, or save and close this session to install one\n- `/status` or `/sources` - see where things stand\n- `/profile` or `/taste` - your profile, and why each song or artist is there\n- `/taste report` - the whole report on one page\n- `/profile build [--force]` - build or resume a saved reading; Ctrl+C keeps progress\n- `/profile saved [offset]` - read your saved profile\n- `/profile explain <number>` - inspect a saved finding's evidence\n- `/profile corrections [--all]` - everything you've told me\n- `/profile correct --track \"<title>\" --by \"<artist>\" (--like|--avoid)` - like a track, or keep it out\n- `/profile correct --artist \"<name>\" (--like|--avoid)` - like an artist, or keep them out\n- `/profile retract <correction-id>` - undo a choice\n- `/memory` - what I remember\n- `/tools` - what I can do right now\n- `/doctor` - check your setup\n- `/model` - pick the model I talk through\n- `/model <provider> <model>` - switch straight to a model\n- `/model refresh [provider]` - update public model choices; keep the selected model\n- `/model roles` - see what side tasks use: the model that reads images and the web search service\n- `/model vision auto|<provider> <model>` - choose the model that reads images\n- `/model web auto|deepseek|brave|codex` - choose the web search service\n- `/effort` - choose how hard the model thinks\n- `/auth [provider]` - sign in to a model provider\n- `/endpoint add` or `/endpoint remove <id>` - add a model service by its address, or remove it\n- `/web status|search|read` - look things up on public music sites\n- `/import [path]` - bring in your history, library, or a playlist\n- `/library` - your saved songs and playlists\n- `/library play <name>` - play a playlist\n- `/library save [playlist]` - keep the song playing now\n- `/library import <link>` - copy a playlist from a link\n- `/library export <name>` - send a playlist to Spotify\n- `/generation on|off` - turn Stable Audio 3 on or off. Moondog can write a score when it is off\n- `/generation download|use|remove|cancel` - set up a Stable Audio 3 model\n- `/onair` - go on air, or come off it\n- `/language` - choose the language Moondog uses\n- `/service [spotify|apple_music|netease]` - choose where I play music\n- `/spotify` - Spotify commands\n- `/spotify login [client-id]` - connect Spotify\n- `/spotify now|devices|queue` - see what's playing, where, and what's next\n- `/spotify recent|sync-recent` - see or save your latest plays\n- `/spotify import-history \"/path/to/spotify-history.zip\"` - add a Spotify ZIP, no sign-in needed\n- `/skip` or `/stop` - move to the next song preview or stream track, or stop them\n- `/home` - back to the record sleeve; the conversation stays\n- `/theme paper|charcoal|terminal|auto` - change the look\n- `/art braille|ascii|off` - change the artwork\n- `/motion on|off` - turn the animation on or off\n- `/lyrics` - the lyrics on the sleeve; `/lyrics sync` finds more\n- `/reload` - reload model settings and sign-ins\n- `/remember [kind] <text>` - ask me to remember something\n- `/forget <memory-id>` - forget something\n- `/rewind` or Alt+R - edit an earlier message in place; the messages after it are replaced\n- `/branch` - go on from here in a new conversation; this one stays saved\n- `/rewind latest` - edit the most recent message\n- `/resume` - pick up a saved conversation\n- `/resume <session-id>` - go straight to one\n- `/new` - start fresh; the last one stays saved\n- `/quit` - exit\n\nAnything you type that isn't a command goes to the model you picked with `/model`, or the one set in `MOONDOG_PROVIDER` and `MOONDOG_MODEL`.\nSign in with `/auth`, or set the provider's API key in your environment. `/auth openai` signs in with your ChatGPT subscription or an API key.\nOnce your profile is ready, I can search your library, explain what I see, and plan playlists with you.\nI can only control Spotify after `moondog spotify login`. I ask before I remove anything from your library, and I never post, send messages, or spend money.\nAsk me to move playback onto a device by name, such as your iPhone.": "# 全部命令\n\n在终端里:\n\n- `moondog --version` - 显示已安装的版本\n- `moondog update [--check] [--channel latest|beta]` - 检查或安装已发布的版本\n- `moondog web status|search|read [参数] [--json]` - 通过 DeepSeek、Brave Search 或 Codex CLI 在公开音乐网站上查资料\n- `moondog demo-history --output <绝对路径.zip> [--json]` - 生成一个虚构的 Spotify 历史 ZIP,用来试用导入\n- `moondog auth login <provider>` - 登录模型服务商;密钥输入时不显示,`openai --chatgpt` 用你的 ChatGPT 订阅登录\n- `moondog auth status [provider]` - 查看保存了哪些登录\n- `moondog auth logout <provider>` - 退出某个服务商\n- `moondog spotify help` - 设置并控制 Spotify\n- `moondog spotify login [client-id]` - 在浏览器里连接 Spotify\n- `moondog spotify now|devices|queue` - 查看 Spotify 正在放什么、在哪放、接下来是什么\n- `moondog spotify recent` - 查看你最近听了什么\n- `moondog spotify sync-recent` - 把最近的播放加入你的资料\n- `moondog spotify sync-library` - 把你的 Spotify 曲库加入你的资料\n- `moondog spotify play|pause|next|previous` - 控制 Spotify 播放\n- `moondog listenbrainz import-history <listen-history.json>` - 把 ListenBrainz 收听文件加入你的资料\n- `moondog catalog latest-single --artist <名字> [--known-release <标题> | --from <spotify-history.zip>]` - 在 Apple Music(美区)查找某位艺人的最新单曲,无需模型\n- `moondog status [--json]` - 查看当前状态\n- `moondog taste [--json]` - 你的聆听报告\n- `moondog taste --html [--output <文件.html>]` - 把报告保存为可离线打开的网页\n- `moondog taste --card [--output <文件.html>]` - 保存一份简短回顾,分享前可以先检查\n- `moondog taste --from <spotify-history.zip> --html` - 从一个 Spotify ZIP 生成一次性报告,不保存\n- `moondog taste --from <account-data.zip> --from <extended-history.zip> --html` - 从两份 Spotify 导出一起生成一次性报告\n- `moondog taste --from <spotify-history.zip> --save --html` - 保存 Spotify 历史,然后显示完整报告\n- `moondog data inspect --scope <listening|apple|profile>` - 查看保存了什么,并获取重置所需的代码\n- `moondog data export --scope <listening|apple|profile> --output <目录>` - 导出一份副本,原件保持不变\n- `moondog data reset --scope <listening|apple|profile> --confirm <代码>` - 把保存的数据移到一边(归档,不删除)\n- `moondog profile build [--force]` - 用已连接的模型生成或继续生成保存的资料\n- `moondog profile saved [偏移]` - 阅读你保存的资料\n- `moondog profile explain <编号>` - 追溯一条已保存发现的证据\n- `moondog profile corrections [--all]` - 你告诉过我的所有选择,包括早先的\n- `moondog profile correct --artist <名字> (--like|--avoid)` - 标记喜欢某位艺人,或不再推荐\n- `moondog profile correct --track <歌名> --by <艺人> (--like|--avoid)` - 标记喜欢某首歌,或不再推荐\n- `moondog profile retract <correction-id>` - 撤销你的一项选择\n- `moondog demo --offline [--json]` - 用虚构数据的演示,无需登录\n- `moondog demo [提示] [--json]` - 同样的演示,通过你的模型对话\n- `moondog ask <提示>` - 问一个问题后退出\n- `moondog remember <内容>` - 让我记住一件事\n- `moondog forget <memory-id>` - 忘掉一件事\n- `moondog memory reflect [--dry-run] [--json]` - 让我现在回顾最近的对话\n- `moondog` - 打开聆听室\n\n在聆听室里:\n\n- `/update [--check] [--channel latest|beta]` - 检查更新,或保存并关闭本次会话来安装\n- `/status` 或 `/sources` - 查看当前状态\n- `/profile` 或 `/taste` - 你的资料,以及每首歌、每位艺人为什么在这里\n- `/taste report` - 一页看完整份报告\n- `/profile build [--force]` - 生成或继续生成保存的解读;Ctrl+C 会保留进度\n- `/profile saved [偏移]` - 阅读你保存的资料\n- `/profile explain <编号>` - 查看一条已保存发现的证据\n- `/profile corrections [--all]` - 你告诉过我的所有选择\n- `/profile correct --track \"<歌名>\" --by \"<艺人>\" (--like|--avoid)` - 标记喜欢某首歌,或不再推荐\n- `/profile correct --artist \"<名字>\" (--like|--avoid)` - 标记喜欢某位艺人,或不再推荐\n- `/profile retract <correction-id>` - 撤销一项选择\n- `/memory` - 我记住的内容\n- `/tools` - 我现在能做什么\n- `/doctor` - 检查你的设置\n- `/model` - 选择我用来对话的模型\n- `/model <provider> <model>` - 直接切换到某个模型\n- `/model refresh [provider]` - 更新公开的模型列表;保留当前选择\n- `/model roles` - 看看副任务在用什么:读图的模型和网页搜索服务\n- `/model vision auto|<provider> <model>` - 选择读图的模型\n- `/model web auto|deepseek|brave|codex` - 选择网页搜索服务\n- `/effort` - 选择模型思考的程度\n- `/auth [provider]` - 登录模型服务商\n- `/endpoint add` 或 `/endpoint remove <id>` - 按地址添加模型服务,或移除它\n- `/web status|search|read` - 在公开音乐网站上查资料\n- `/import [路径]` - 导入你的历史、曲库或一个歌单\n- `/library` - 你收藏的歌和播放列表\n- `/library play <名称>` - 播放一个播放列表\n- `/library save [播放列表]` - 收藏正在放的歌\n- `/library import <链接>` - 从链接复制一个播放列表\n- `/library export <名字>` - 把一个播放列表发到 Spotify\n- `/generation on|off` - 开启或关闭 Stable Audio 3。关闭后,Moondog 仍可以写谱作曲\n- `/generation download|use|remove|cancel` - 设置 Stable Audio 3 模型\n- `/onair` - 开播,或下播\n- `/language` - 选择 Moondog 使用的语言\n- `/service [spotify|apple_music|netease]` - 选择我在哪里放音乐\n- `/spotify` - Spotify 命令\n- `/spotify login [client-id]` - 连接 Spotify\n- `/spotify now|devices|queue` - 查看正在放什么、在哪放、接下来是什么\n- `/spotify recent|sync-recent` - 查看或保存你最近的播放\n- `/spotify import-history \"/path/to/spotify-history.zip\"` - 加入一个 Spotify ZIP,无需登录\n- `/skip` 或 `/stop` - 跳到下一首试听或直播曲目,或停止它们\n- `/home` - 回到唱片封套;对话还在\n- `/theme paper|charcoal|terminal|auto` - 换外观\n- `/art braille|ascii|off` - 换插画\n- `/motion on|off` - 打开或关闭动画\n- `/lyrics` - 封套上的歌词;`/lyrics sync` 找更多\n- `/reload` - 重新加载模型设置和登录\n- `/remember [类型] <内容>` - 让我记住一件事\n- `/forget <memory-id>` - 忘掉一件事\n- `/rewind` 或 Alt+R - 就地编辑之前的一条消息;之后的消息会被替换\n- `/branch` - 从这里在新对话中继续;这段对话会保留\n- `/rewind latest` - 编辑最近的一条消息\n- `/resume` - 继续一段保存的对话\n- `/resume <session-id>` - 直接打开某一段\n- `/new` - 重新开始;上一段会保存下来\n- `/quit` - 退出\n\n你输入的非命令内容,会发给你用 `/model` 选的模型,或 `MOONDOG_PROVIDER` 和 `MOONDOG_MODEL` 指定的模型。\n用 `/auth` 登录,或在环境变量里设置服务商的 API 密钥。`/auth openai` 可以用 ChatGPT 订阅登录,也可以填 API 密钥。\n资料准备好之后,我可以搜索你的曲库、解释我看到的内容,并和你一起规划歌单。\n只有在 `moondog spotify login` 之后我才能控制 Spotify。从你的曲库移除东西之前我会先问你,而且我从不发帖、不发消息,也不花钱。\n说出设备名,比如你的 iPhone,我就能把播放切过去。",
213
+ "# Every command\n\nFrom your shell:\n\n- `moondog --version` - show the installed version\n- `moondog update [--check] [--channel latest|beta]` - check for or install a published release\n- `moondog web status|search|read [arguments] [--json]` - look things up on public music sites through DeepSeek, Brave Search or the Codex CLI\n- `moondog demo-history --output <absolute-file.zip> [--json]` - make a fictional Spotify history ZIP to try the importer with\n- `moondog auth login <provider>` - sign in to a model provider; the key is typed out of sight; `openai --chatgpt` signs in with your ChatGPT subscription\n- `moondog auth status [provider]` - see which sign-ins are saved\n- `moondog auth logout <provider>` - sign out of a provider\n- `moondog spotify help` - set up and control Spotify\n- `moondog spotify login [client-id]` - connect Spotify in your browser\n- `moondog spotify now|devices|queue` - see what Spotify is playing, where, and what's next\n- `moondog spotify recent` - see what you played lately\n- `moondog spotify sync-recent` - add your latest plays to your profile\n- `moondog spotify sync-library` - add your Spotify library to your profile\n- `moondog spotify play|pause|next|previous` - control Spotify playback\n- `moondog listenbrainz import-history <listen-history.json>` - add a ListenBrainz listens file to your profile\n- `moondog catalog latest-single --artist <name> [--known-release <title> | --from <spotify-history.zip>]` - find an artist's latest single on Apple Music (US), no model needed\n- `moondog status [--json]` - see where things stand\n- `moondog sources [offset] [--json]` - see your import history\n- `moondog taste [--json]` - your listening report\n- `moondog taste --html [--output <file.html>]` - save your report as a web page that works offline\n- `moondog taste --card [--output <file.html>]` - save a short recap you can check before sharing\n- `moondog taste --from <spotify-history.zip> --html` - a one-off report from a Spotify ZIP, without saving it\n- `moondog taste --from <account-data.zip> --from <extended-history.zip> --html` - a one-off report from both Spotify exports together\n- `moondog taste --from <spotify-history.zip> --save --html` - save the Spotify history, then show your full report\n- `moondog data inspect --scope <listening|apple|profile>` - see what's stored, and get the code needed to reset it\n- `moondog data export --scope <listening|apple|profile> --output <directory>` - export a copy, leaving the original alone\n- `moondog data reset --scope <listening|apple|profile> --confirm <token>` - set stored data aside (it is archived, not deleted)\n- `moondog profile build [--force]` - build or resume a saved profile with your connected model\n- `moondog profile saved [offset]` - read your saved profile\n- `moondog profile explain <number>` - trace a saved finding to its evidence\n- `moondog profile corrections [--all]` - everything you've told me, including earlier choices\n- `moondog profile correct --artist <name> (--like|--avoid)` - like an artist, or keep them out\n- `moondog profile correct --track <title> --by <artist> (--like|--avoid)` - like a track, or keep it out\n- `moondog profile retract <correction-id>` - undo one of your choices\n- `moondog demo --offline [--json]` - a demo with made-up data, no sign-in needed\n- `moondog demo [prompt] [--json]` - the same demo, talking through your model\n- `moondog ask <prompt>` - ask one question and exit\n- `moondog remember <text>` - ask me to remember something\n- `moondog forget <memory-id>` - forget something\n- `moondog memory reflect [--dry-run] [--json]` - let me think over recent conversations now\n- `moondog` - open the listening room\n\nInside the listening room:\n\n- `/update [--check] [--channel latest|beta]` - check for updates, or save and close this session to install one\n- `/status` - see where things stand\n- `/sources [offset]` - see your import history\n- `/profile` or `/taste` - your profile, and why each song or artist is there\n- `/taste report` - the whole report on one page\n- `/profile build [--force]` - build or resume a saved reading; Ctrl+C keeps progress\n- `/profile saved [offset]` - read your saved profile\n- `/profile explain <number>` - inspect a saved finding's evidence\n- `/profile corrections [--all]` - everything you've told me\n- `/profile correct --track \"<title>\" --by \"<artist>\" (--like|--avoid)` - like a track, or keep it out\n- `/profile correct --artist \"<name>\" (--like|--avoid)` - like an artist, or keep them out\n- `/profile retract <correction-id>` - undo a choice\n- `/memory` - what I remember\n- `/tools` - what I can do right now\n- `/doctor` - check your setup\n- `/model` - pick the model I talk through\n- `/model <provider> <model>` - switch straight to a model\n- `/model refresh [provider]` - update public model choices; keep the selected model\n- `/model roles` - see what side tasks use: the model that reads images and the web search service\n- `/model vision auto|<provider> <model>` - choose the model that reads images\n- `/model web auto|deepseek|brave|codex` - choose the web search service\n- `/effort` - choose how hard the model thinks\n- `/auth [provider]` - sign in to a model provider\n- `/endpoint add` or `/endpoint remove <id>` - add a model service by its address, or remove it\n- `/web status|search|read` - look things up on public music sites\n- `/import [path]` - bring in your history, library, or a playlist\n- `/library` - your saved songs and playlists\n- `/library play <name>` - play a playlist\n- `/library save [playlist]` - keep the song playing now\n- `/library import <link>` - copy a playlist from a link\n- `/library export <name>` - send a playlist to Spotify\n- `/generation on|off` - turn Stable Audio 3 on or off. Moondog can write a score when it is off\n- `/generation download|use|remove|cancel` - set up a Stable Audio 3 model\n- `/onair` - go on air, or come off it\n- `/language` - choose the language Moondog uses\n- `/service [spotify|apple_music|netease]` - choose where I play music\n- `/spotify` - Spotify commands\n- `/spotify login [client-id]` - connect Spotify\n- `/spotify now|devices|queue` - see what's playing, where, and what's next\n- `/spotify recent|sync-recent` - see or save your latest plays\n- `/spotify import-history \"/path/to/spotify-history.zip\"` - add a Spotify ZIP, no sign-in needed\n- `/skip` or `/stop` - skip the current track or stop playback (Spotify pauses its active device)\n- `/home` - back to the record sleeve; the conversation stays\n- `/theme paper|charcoal|terminal|auto` - change the look\n- `/art braille|ascii|off` - change the artwork\n- `/motion on|off` - turn the animation on or off\n- `/lyrics` - the lyrics on the sleeve; `/lyrics sync` finds more\n- `/reload` - reload model settings and sign-ins\n- `/remember [kind] <text>` - ask me to remember something\n- `/forget <memory-id>` - forget something\n- `/rewind` or Alt+R - edit an earlier message in place; the messages after it are replaced\n- `/branch` - go on from here in a new conversation; this one stays saved\n- `/rewind latest` - edit the most recent message\n- `/resume` - pick up a saved conversation\n- `/resume <session-id>` - go straight to one\n- `/new` - start fresh; the last one stays saved\n- `/quit` - exit\n\nAnything you type that isn't a command goes to the model you picked with `/model`, or the one set in `MOONDOG_PROVIDER` and `MOONDOG_MODEL`.\nSign in with `/auth`, or set the provider's API key in your environment. `/auth openai` signs in with your ChatGPT subscription or an API key.\nOnce your profile is ready, I can search your library, explain what I see, and plan playlists with you.\nI can only control Spotify after `moondog spotify login`. I ask before I remove anything from your library, and I never post, send messages, or spend money.\nAsk me to move playback onto a device by name, such as your iPhone.": "# 全部命令\n\n在终端里:\n\n- `moondog --version` - 显示已安装的版本\n- `moondog update [--check] [--channel latest|beta]` - 检查或安装已发布的版本\n- `moondog web status|search|read [参数] [--json]` - 通过 DeepSeek、Brave Search 或 Codex CLI 在公开音乐网站上查资料\n- `moondog demo-history --output <绝对路径.zip> [--json]` - 生成一个虚构的 Spotify 历史 ZIP,用来试用导入\n- `moondog auth login <provider>` - 登录模型服务商;密钥输入时不显示,`openai --chatgpt` 用你的 ChatGPT 订阅登录\n- `moondog auth status [provider]` - 查看保存了哪些登录\n- `moondog auth logout <provider>` - 退出某个服务商\n- `moondog spotify help` - 设置并控制 Spotify\n- `moondog spotify login [client-id]` - 在浏览器里连接 Spotify\n- `moondog spotify now|devices|queue` - 查看 Spotify 正在放什么、在哪放、接下来是什么\n- `moondog spotify recent` - 查看你最近听了什么\n- `moondog spotify sync-recent` - 把最近的播放加入你的资料\n- `moondog spotify sync-library` - 把你的 Spotify 曲库加入你的资料\n- `moondog spotify play|pause|next|previous` - 控制 Spotify 播放\n- `moondog listenbrainz import-history <listen-history.json>` - 把 ListenBrainz 收听文件加入你的资料\n- `moondog catalog latest-single --artist <名字> [--known-release <标题> | --from <spotify-history.zip>]` - 在 Apple Music(美区)查找某位艺人的最新单曲,无需模型\n- `moondog status [--json]` - 查看当前状态\n- `moondog sources [offset] [--json]` - 查看导入记录\n- `moondog taste [--json]` - 你的聆听报告\n- `moondog taste --html [--output <文件.html>]` - 把报告保存为可离线打开的网页\n- `moondog taste --card [--output <文件.html>]` - 保存一份简短回顾,分享前可以先检查\n- `moondog taste --from <spotify-history.zip> --html` - 从一个 Spotify ZIP 生成一次性报告,不保存\n- `moondog taste --from <account-data.zip> --from <extended-history.zip> --html` - 从两份 Spotify 导出一起生成一次性报告\n- `moondog taste --from <spotify-history.zip> --save --html` - 保存 Spotify 历史,然后显示完整报告\n- `moondog data inspect --scope <listening|apple|profile>` - 查看保存了什么,并获取重置所需的代码\n- `moondog data export --scope <listening|apple|profile> --output <目录>` - 导出一份副本,原件保持不变\n- `moondog data reset --scope <listening|apple|profile> --confirm <代码>` - 把保存的数据移到一边(归档,不删除)\n- `moondog profile build [--force]` - 用已连接的模型生成或继续生成保存的资料\n- `moondog profile saved [偏移]` - 阅读你保存的资料\n- `moondog profile explain <编号>` - 追溯一条已保存发现的证据\n- `moondog profile corrections [--all]` - 你告诉过我的所有选择,包括早先的\n- `moondog profile correct --artist <名字> (--like|--avoid)` - 标记喜欢某位艺人,或不再推荐\n- `moondog profile correct --track <歌名> --by <艺人> (--like|--avoid)` - 标记喜欢某首歌,或不再推荐\n- `moondog profile retract <correction-id>` - 撤销你的一项选择\n- `moondog demo --offline [--json]` - 用虚构数据的演示,无需登录\n- `moondog demo [提示] [--json]` - 同样的演示,通过你的模型对话\n- `moondog ask <提示>` - 问一个问题后退出\n- `moondog remember <内容>` - 让我记住一件事\n- `moondog forget <memory-id>` - 忘掉一件事\n- `moondog memory reflect [--dry-run] [--json]` - 让我现在回顾最近的对话\n- `moondog` - 打开聆听室\n\n在聆听室里:\n\n- `/update [--check] [--channel latest|beta]` - 检查更新,或保存并关闭本次会话来安装\n- `/status` - 查看当前状态\n- `/sources [offset]` - 查看导入记录\n- `/profile` 或 `/taste` - 你的资料,以及每首歌、每位艺人为什么在这里\n- `/taste report` - 一页看完整份报告\n- `/profile build [--force]` - 生成或继续生成保存的解读;Ctrl+C 会保留进度\n- `/profile saved [偏移]` - 阅读你保存的资料\n- `/profile explain <编号>` - 查看一条已保存发现的证据\n- `/profile corrections [--all]` - 你告诉过我的所有选择\n- `/profile correct --track \"<歌名>\" --by \"<艺人>\" (--like|--avoid)` - 标记喜欢某首歌,或不再推荐\n- `/profile correct --artist \"<名字>\" (--like|--avoid)` - 标记喜欢某位艺人,或不再推荐\n- `/profile retract <correction-id>` - 撤销一项选择\n- `/memory` - 我记住的内容\n- `/tools` - 我现在能做什么\n- `/doctor` - 检查你的设置\n- `/model` - 选择我用来对话的模型\n- `/model <provider> <model>` - 直接切换到某个模型\n- `/model refresh [provider]` - 更新公开的模型列表;保留当前选择\n- `/model roles` - 看看副任务在用什么:读图的模型和网页搜索服务\n- `/model vision auto|<provider> <model>` - 选择读图的模型\n- `/model web auto|deepseek|brave|codex` - 选择网页搜索服务\n- `/effort` - 选择模型思考的程度\n- `/auth [provider]` - 登录模型服务商\n- `/endpoint add` 或 `/endpoint remove <id>` - 按地址添加模型服务,或移除它\n- `/web status|search|read` - 在公开音乐网站上查资料\n- `/import [路径]` - 导入你的历史、曲库或一个歌单\n- `/library` - 你收藏的歌和播放列表\n- `/library play <名称>` - 播放一个播放列表\n- `/library save [播放列表]` - 收藏正在放的歌\n- `/library import <链接>` - 从链接复制一个播放列表\n- `/library export <名字>` - 把一个播放列表发到 Spotify\n- `/generation on|off` - 开启或关闭 Stable Audio 3。关闭后,Moondog 仍可以写谱作曲\n- `/generation download|use|remove|cancel` - 设置 Stable Audio 3 模型\n- `/onair` - 开播,或下播\n- `/language` - 选择 Moondog 使用的语言\n- `/service [spotify|apple_music|netease]` - 选择我在哪里放音乐\n- `/spotify` - Spotify 命令\n- `/spotify login [client-id]` - 连接 Spotify\n- `/spotify now|devices|queue` - 查看正在放什么、在哪放、接下来是什么\n- `/spotify recent|sync-recent` - 查看或保存你最近的播放\n- `/spotify import-history \"/path/to/spotify-history.zip\"` - 加入一个 Spotify ZIP,无需登录\n- `/skip` 或 `/stop` - 跳到下一首或停止播放(Spotify 会暂停当前设备)\n- `/home` - 回到唱片封套;对话还在\n- `/theme paper|charcoal|terminal|auto` - 换外观\n- `/art braille|ascii|off` - 换插画\n- `/motion on|off` - 打开或关闭动画\n- `/lyrics` - 封套上的歌词;`/lyrics sync` 找更多\n- `/reload` - 重新加载模型设置和登录\n- `/remember [类型] <内容>` - 让我记住一件事\n- `/forget <memory-id>` - 忘掉一件事\n- `/rewind` 或 Alt+R - 就地编辑之前的一条消息;之后的消息会被替换\n- `/branch` - 从这里在新对话中继续;这段对话会保留\n- `/rewind latest` - 编辑最近的一条消息\n- `/resume` - 继续一段保存的对话\n- `/resume <session-id>` - 直接打开某一段\n- `/new` - 重新开始;上一段会保存下来\n- `/quit` - 退出\n\n你输入的非命令内容,会发给你用 `/model` 选的模型,或 `MOONDOG_PROVIDER` 和 `MOONDOG_MODEL` 指定的模型。\n用 `/auth` 登录,或在环境变量里设置服务商的 API 密钥。`/auth openai` 可以用 ChatGPT 订阅登录,也可以填 API 密钥。\n资料准备好之后,我可以搜索你的曲库、解释我看到的内容,并和你一起规划歌单。\n只有在 `moondog spotify login` 之后我才能控制 Spotify。从你的曲库移除东西之前我会先问你,而且我从不发帖、不发消息,也不花钱。\n说出设备名,比如你的 iPhone,我就能把播放切过去。",
184
214
  "Apple Music library": "Apple Music 曲库",
185
215
  "Model": "模型",
186
216
  "Finding similar music": "查找相似的音乐",
@@ -206,13 +236,11 @@ export default {
206
236
  "Your library shows what you keep and what Spotify ranks highest for you. Recent plays are your latest 50. A history ZIP can add years of listening later.": "曲库显示你收藏了什么,以及 Spotify 认为你最常听什么。最近播放是最新的 50 次。之后可以用历史 ZIP 补上多年的聆听。",
207
237
  "Spotify recent listening": "Spotify 最近聆听",
208
238
  "Your latest plays, up to 50. Spotify doesn't say how long you listened here. A history ZIP can add the older ones later.": "你最近的播放,最多 50 次。这里 Spotify 不提供聆听时长。之后可以用历史 ZIP 补上更早的播放。",
209
- "Your library with loves, ratings, play counts and when you last played each song. It doesn't list every play.": "你的曲库,包括喜爱、评分、播放次数和每首歌最后一次播放的时间。它不会列出每一次播放。",
210
239
  "ListenBrainz history": "ListenBrainz 历史",
211
240
  "Your saved listens. Some don't say how long you listened, so they count as plays without minutes.": "你保存的收听记录。有些没有聆听时长,所以只算播放次数、不计分钟。",
212
241
  "Spotify Extended Streaming History": "Spotify 完整播放历史",
213
- "Every play in this file, with how long you listened and how each song started and ended.": "这个文件里的每一次播放,包括你听了多久、每首歌怎么开始和结束。",
214
242
  "Spotify Account Data": "Spotify 账户数据",
215
- "Your plays from the past year, plus your library and playlists. For older plays and listening time, use Extended streaming history.": "过去一年的播放,加上你的曲库和歌单。想要更早的播放和聆听时长,请用完整播放历史(Extended streaming history)。",
243
+ "Account Data includes recent plays and can include saved music and playlists. Extended streaming history can cover earlier years and includes more playback details.": "账户数据包括最近的播放记录,也可能包含已收藏的音乐和歌单。完整播放历史(Extended streaming history)可能涵盖更早的年份,并提供更详细的播放信息。",
216
244
  "Your library songs and YouTube Music plays, read in English or Chinese. Regular YouTube videos are left out. Google doesn't say how long you listened, and history you deleted or paused can't come back.": "你曲库里的歌和 YouTube Music 的播放,支持英文或中文导出。普通 YouTube 视频不计入。Google 不提供聆听时长,删除或暂停记录的历史也无法找回。",
217
245
  "{read} of {total} songs could be read; the service hides some. Only this playlist is added. It shows what you keep, not what you played, and it may not be one you made.": "读取到 {total} 首中的 {read} 首;平台隐藏了一部分。只会加入这个歌单。它显示的是你收藏了什么,而不是你听了什么,也不一定是你自己建的。",
218
246
  "{read} songs could be read; the service hides some. Only this playlist is added. It shows what you keep, not what you played, and it may not be one you made.": "读取到 {read} 首;平台隐藏了一部分。只会加入这个歌单。它显示的是你收藏了什么,而不是你听了什么,也不一定是你自己建的。",
@@ -419,6 +447,11 @@ export default {
419
447
  "measured": "测得",
420
448
  "interpretation": "解读",
421
449
  "your choice": "你的选择",
450
+ "Current choice": "当前选择",
451
+ "Choice removed since this reading": "本次解读后已撤回的选择",
452
+ "No active Likes or Avoids.": "当前没有标为喜欢或要求避开的歌曲或艺人。",
453
+ "Choice in v{version}": "v{version} 中的选择",
454
+ "No reading was saved. Use {prefix} build to try again.": "未保存解读。可用 {prefix} build 重试。",
422
455
  "checked; {count} concerns remain": "已检查;还有 {count} 个疑点",
423
456
  "from {count} plays": "来自 {count} 次播放",
424
457
  "type to filter ↑↓ choose enter select esc back": "输入筛选 ↑↓ 选择 enter 确定 esc 返回",
@@ -459,7 +492,7 @@ export default {
459
492
  "Your choice": "你的选择",
460
493
  "You said: I like this": "你说过:我喜欢",
461
494
  "You said: keep this out": "你说过:不再推荐",
462
- "Lately (last {count} days)": "最近(过去 {count} 天)",
495
+ "All recorded listening": "全部收听记录",
463
496
  "Across the years": "多年来",
464
497
  "Gone quiet": "已沉寂",
465
498
  "Came back": "又回来了",
@@ -505,13 +538,9 @@ export default {
505
538
  "Tracks": "歌曲",
506
539
  "Artists": "艺人",
507
540
  "Your choices": "你的选择",
508
- "you're not signed in to {provider}": "你还没有登录 {provider}",
509
541
  "Sign in with `/auth {provider}`.": "用 `/auth {provider}` 登录。",
510
- "no model is connected": "没有连接模型",
511
- "Type `/model` to pick one.": "输入 `/model` 选一个。",
512
542
  "I can't reach the model (`{reason}`)": "我连不上模型(`{reason}`)",
513
543
  "Type `/model` to pick another, or `/reload` to try again.": "输入 `/model` 换一个,或用 `/reload` 再试一次。",
514
- "Obscured by clouds. I can't talk yet because {why}.\n\n{next}\n\nYour profile doesn't need a model. `/taste`, `/import`, and `/help` all work right now.": "Obscured by clouds。我暂时还不能聊天,因为{why}。\n\n{next}\n\n你的资料不需要模型。`/taste`、`/import` 和 `/help` 现在都能用。",
515
544
  "Ready.": "就绪。",
516
545
  "↑ ↓ choose · enter open · esc type": "↑ ↓ 选择 · enter 打开 · esc 输入",
517
546
  "enter send · ctrl+p commands": "enter 发送 · ctrl+p 命令",
@@ -666,7 +695,12 @@ export default {
666
695
  "The profile's play count is unchanged.": "资料的播放次数没有变化。",
667
696
  "You've imported this library before, so nothing changed.": "你之前已经导入过这个曲库,所以没有变化。",
668
697
  "Already up to date. There was nothing new in this one.": "已是最新,这次没有新内容。",
669
- "{plays}, {duplicates} I already had.": "{plays},其中 {duplicates} 次之前已有。",
698
+ "Skipped {count} duplicate records.": "跳过了 {count} 条重复记录。",
699
+ "Listening on {date} (UTC).": "收听日期为 {date}(UTC)。",
700
+ "Listening from {first} to {last} (UTC).": "收听记录从 {first} 到 {last}(UTC)。",
701
+ "Imported on {date} (UTC).": "导入日期为 {date}(UTC)。",
702
+ "First import recorded on {date} (UTC).": "记录的首次导入日期为 {date}(UTC)。",
703
+ "Checked on {date} (UTC).": "核对日期为 {date}(UTC)。",
670
704
  "Also {items}": "另外,{items}",
671
705
  "## Your Apple Music library is in": "## 你的 Apple Music 曲库已导入",
672
706
  "## Your collection is in": "## 你的收藏已导入",
@@ -776,7 +810,7 @@ export default {
776
810
  "Stopped the lyric sync.": "已停止歌词同步。",
777
811
  "Cancelled.": "已取消。",
778
812
  "/{command} didn't work.": "/{command} 没成功。",
779
- "Your request is still here · /model connects a model first.": "你的请求还在 · 先用 /model 连接模型。",
813
+ "Your request is still here. Press Ctrl+P, then choose /model.": "你的请求还在。按 Ctrl+P,再选择 /model。",
780
814
  "Reading the room": "看看现场气氛",
781
815
  "Checking the request line": "看看点歌单",
782
816
  "Finding the groove": "找找律动",
@@ -822,8 +856,8 @@ export default {
822
856
  "Choose the model Moondog talks through": "选择 Moondog 对话使用的模型",
823
857
  "Look things up on public music sites": "在公开音乐网站上查资料",
824
858
  "Connect and control Spotify": "连接并控制 Spotify",
825
- "Skip to the next song preview or stream track": "跳到下一首试听或直播曲目",
826
- "Stop the song previews or the stream": "停止试听或直播",
859
+ "Skip to the next track": "跳到下一首",
860
+ "Stop playback or pause Spotify": "停止播放或暂停 Spotify",
827
861
  "Reload model settings and sign-ins": "重新加载模型设置和登录",
828
862
  "Ask Moondog to remember something": "让 Moondog 记住一件事",
829
863
  "Forget one memory by ID": "按 ID 忘掉一条记忆",
@@ -846,9 +880,8 @@ export default {
846
880
  "{count} saved songs, follows, or playlist entries.": "{count} 条收藏歌曲、关注或歌单条目。",
847
881
  "Saved {count} songs from your library. A library shows what you keep, not when you played it, so no plays were added.": "已保存曲库里的 {count} 首歌。曲库显示的是你收藏了什么,而不是什么时候听的,所以没有加入播放记录。",
848
882
  "Saved {count} new listening records.": "已保存 {count} 条新的聆听记录。",
849
- "{count} new plays": "{count} 次新播放",
850
883
  "{count} new plays.": "{count} 次新播放。",
851
- "Reconciled {count} overlapping records, keeping the more detailed listening evidence.": "已整理 {count} 条重复记录,保留了更详细的聆听证据。",
884
+ "Reconciled {count} overlapping records, keeping the more detailed listening evidence.": "有 {count} 条播放记录有简略和详细两个版本,已保留详细版本。",
852
885
  "{count} messages": "{count} 条消息",
853
886
  "{count} songs with lyrics": "{count} 首有歌词",
854
887
  "{count} instrumentals": "{count} 首纯音乐",
@@ -859,6 +892,7 @@ export default {
859
892
  "Check your music sources": "检查你的音乐来源",
860
893
  "Check your profile": "检查你的资料",
861
894
  "Check what I remember": "查看我记住的内容",
895
+ "Read a learned practice": '阅读一条学会的做法',
862
896
  "Check what I can do": "查看我能做什么",
863
897
  "Check the model connection": "检查模型连接",
864
898
  "Search your music library": "搜索你的音乐曲库",
@@ -887,6 +921,7 @@ export default {
887
921
  "Remember what you've told me": "记住你告诉我的",
888
922
  "Remember something you said": "记住你说过的一件事",
889
923
  "Forget something": "忘掉一件事",
924
+ "Update this listening session": "更新本次聆听安排",
890
925
  "Save your choice": "保存你的选择",
891
926
  "Check what Spotify is playing": "查看 Spotify 正在放什么",
892
927
  "See what's playing in detail": "查看正在播放的详情",
@@ -930,12 +965,22 @@ export default {
930
965
  "`{model}` is back to Moondog's default effort.": "`{model}` 已恢复为 Moondog 的默认思考级别。",
931
966
  "Effort saved.": "思考级别已保存。",
932
967
  "30-second previews from Apple Music": "来自 Apple Music 的 30 秒试听",
968
+ "Skipped on {service}.": "已在 {service} 跳到下一首。",
969
+ "Stopped playback on {service}.": "已停止 {service} 播放。",
970
+ "Paused playback on {service}.": "已暂停 {service} 播放。",
971
+ "Nothing is playing on {service}.": "{service} 当前没有播放音乐。",
972
+ "No next track on {service}.": "{service} 没有下一首。",
973
+ "Playback controls are unavailable for {service}.": "暂时无法控制 {service} 播放。",
974
+ "The playback service changed. Try again.": "播放服务已切换,请重试。",
975
+ "Playback stopped.": "播放已停止。",
976
+ "The first record is still being cut.": "第一张唱片还在刻录中。",
933
977
  "No previews are playing.": "现在没有在播放的试听。",
934
978
  "Previews stopped.": "试听已停止。",
935
979
  "Skipped.": "已跳过。",
936
980
  "loading": "加载中",
937
981
  "paused": "已暂停",
938
982
  "couldn't load": "加载失败",
983
+ "couldn't play": "未能播放",
939
984
  "None of these previews could load. Check your connection, then ask again.": "这些试听都没能加载。请检查网络连接后再试一次。",
940
985
  "Last.fm scrobbles": "Last.fm 聆听记录",
941
986
  "Your latest {count} scrobbles, the most Moondog reads at once, and your loved tracks.": "你最近的 {count} 条聆听记录(Moondog 一次最多读取这么多),以及你喜爱的曲目。",
@@ -993,6 +1038,7 @@ export default {
993
1038
  "Search with Brave Search": "用 Brave Search 搜索",
994
1039
  "Search with the Codex CLI": "用 Codex CLI 搜索",
995
1040
  "Play a playlist by name": "按名称播放一个播放列表",
1041
+ "Play a mix with its made tracks": "播放包含自制曲目的混合歌单",
996
1042
  "Keep the song playing now": "收藏正在放的歌",
997
1043
  "Copy a playlist from a link": "从链接复制一个播放列表",
998
1044
  "Remove an endpoint and its key": "移除接口和它的密钥",
@@ -1150,12 +1196,21 @@ export default {
1150
1196
  "Stable Audio 3's Python environment couldn't be set up. Check your connection, then use /generation download to try again.": "没能准备好 Stable Audio 3 的 Python 环境。检查网络连接,再用 /generation download 重试。",
1151
1197
  "The library isn't available here.": "这里用不了资料库。",
1152
1198
  "Saved": "收藏",
1153
- "Play one with `/library play <name>`, or keep the song playing now with `/library save`.": "用 `/library play <名字>` 播放一个,或者用 `/library save` 收藏正在播放的歌。",
1154
1199
  "No playlist is called “{name}”.": "没有叫“{name}”的播放列表。",
1155
1200
  "{name} has nothing in it yet.": "{name} 里还是空的。",
1156
1201
  "None of its songs could be found.": "里面的歌都没有找到。",
1157
1202
  "Playing {name}.": "正在播放 {name}。",
1158
- "Moondog's tracks were left out. They play with Apple Music chosen.": "Moondog 做的曲子没有放。选择 Apple Music 时才会播放它们。",
1203
+ "Use `/library play-mix <name>` to play a playlist once with Apple Music previews and full-length Moondog tracks.": "用 `/library play-mix <名字>` 临时播放一次歌单,既能听 Apple Music 试听片段,也能听 Moondog 创作的完整曲目。",
1204
+ "Apple Music songs play as 30-second previews. Moondog's tracks play in full.": "Apple Music 的歌播放 30 秒试听片段,Moondog 创作的曲子会完整播放。",
1205
+ "{count} tracks were unavailable.": "有 {count} 首无法播放。",
1206
+ "{count} later tracks are outside this queue.": "歌单后面还有 {count} 首未加入本次队列。",
1207
+ "No tracks in this batch could play.": "这批曲目都无法播放。",
1208
+ "The player hasn't confirmed a start for {name}.": "播放器尚未确认「{name}」是否已开始播放。",
1209
+ "Playback finished.": "播放已结束。",
1210
+ "{count} tracks couldn't play.": "有 {count} 首歌未能播放。",
1211
+ "{count} tracks are queued.": "有 {count} 首歌在队列中等待播放。",
1212
+ "{count} tracks finished.": "已播完 {count} 首歌。",
1213
+ "Moondog's tracks were left out. Use `/library play-mix <name>` to include them.": "这次没播 Moondog 做的曲子。用 `/library play-mix <名字>` 可以一起播放。",
1159
1214
  "Some songs couldn't be found.": "有些歌没有找到。",
1160
1215
  "Already in {name}.": "已经在“{name}”里了。",
1161
1216
  "Saved.": "已收藏。",
@@ -1173,7 +1228,15 @@ export default {
1173
1228
  "It couldn't shape your taste this time.": "这次没能把它加入你的口味画像。",
1174
1229
  "It doesn't shape your taste; add taste after the link if it should.": "它不会影响你的口味;如果需要,在链接后加 taste。",
1175
1230
  "Imported {name}.": "已导入“{name}”。",
1176
- "Use /library, /library play <name>, /library save [playlist], /library import <link>, or /library export <name>.": "用 /library、/library play <名字>、/library save [播放列表]、/library import <链接> 或 /library export <名字>。",
1231
+ "Browse albums": "浏览专辑",
1232
+ "No matching library items. Save songs or try a different search.": "资料库中没有匹配项。先收藏歌曲,或换个词搜索。",
1233
+ "Browse artists": "浏览艺人",
1234
+ "Browse playlists": "浏览歌单",
1235
+ "Leave the open sleeve": "关闭当前选择",
1236
+ "Next page": "下一页",
1237
+ "Previous page": "上一页",
1238
+ "Ask about this music · /library close to leave.": "可以问问这些音乐 · /library close 退出",
1239
+ "Use /library to see the available commands.": "输入 /library 查看可用命令。",
1177
1240
  "Import a playlist": "导入歌单",
1178
1241
  "Send a playlist to Spotify": "把一个播放列表发到 Spotify",
1179
1242
  "Sending {name} to Spotify…": "正在把“{name}”发到 Spotify…",
@@ -16,8 +16,9 @@ import {
16
16
  canonicalizeJson,
17
17
  findUnsafePersistedData,
18
18
  } from "../../../scripts/contract-semantics.mjs";
19
- import { validateAppleMusicImportRecords } from "./normalize.mjs";
19
+ import { previousAppleNormalization, validateAppleMusicImportRecords } from "./normalize.mjs";
20
20
  import { AppleMusicImportError } from "./parse-plist.mjs";
21
+ import { appleImportSaveTimePath, readAppleImportSaveTime } from "./save-time.mjs";
21
22
  import { isUuid } from "./stable-ids.mjs";
22
23
 
23
24
  const dataFileNames = [
@@ -80,7 +81,7 @@ function isPathInside(parent, candidate) {
80
81
  );
81
82
  }
82
83
 
83
- async function prepareOutputRoot(outputRoot, boundaryRoot) {
84
+ async function prepareOutputRoot(outputRoot, boundaryRoot, create) {
84
85
  if (typeof boundaryRoot !== "string" || boundaryRoot.trim() === "") {
85
86
  throw new TypeError("Import output boundary is required");
86
87
  }
@@ -91,6 +92,7 @@ async function prepareOutputRoot(outputRoot, boundaryRoot) {
91
92
  }
92
93
 
93
94
  const boundaryMetadata = await pathType(lexicalBoundary);
95
+ if (!boundaryMetadata && !create) return null;
94
96
  if (
95
97
  !boundaryMetadata?.isDirectory() ||
96
98
  boundaryMetadata.isSymbolicLink()
@@ -108,6 +110,7 @@ async function prepareOutputRoot(outputRoot, boundaryRoot) {
108
110
  current = path.join(current, segment);
109
111
  let metadata = await pathType(current);
110
112
  if (!metadata) {
113
+ if (!create) return null;
111
114
  try {
112
115
  await mkdir(current, { mode: 0o700 });
113
116
  } catch (cause) {
@@ -127,7 +130,7 @@ async function prepareOutputRoot(outputRoot, boundaryRoot) {
127
130
  }
128
131
  }
129
132
 
130
- await chmod(lexicalOutput, 0o700);
133
+ if (create) await chmod(lexicalOutput, 0o700);
131
134
  return realpath(lexicalOutput);
132
135
  }
133
136
 
@@ -209,18 +212,7 @@ async function verifyExistingBatch(
209
212
  }
210
213
  }
211
214
 
212
- export async function writeAppleMusicImportBatch(
213
- records,
214
- { outputRoot, boundaryRoot },
215
- ) {
216
- if (!isUuid(records?.manifest?.import_batch_id)) {
217
- fail("batch_id_invalid", "Import batch ID must be a UUID");
218
- }
219
- if (typeof outputRoot !== "string" || outputRoot.trim() === "") {
220
- throw new TypeError("Import output root is required");
221
- }
222
-
223
- await validateAppleMusicImportRecords(records);
215
+ function serializeBatch(records) {
224
216
  const files = buildFiles(records);
225
217
  const manifest = {
226
218
  ...records.manifest,
@@ -233,19 +225,49 @@ export async function writeAppleMusicImportBatch(
233
225
  `${JSON.stringify(manifest, null, 2)}\n`,
234
226
  "utf8",
235
227
  );
228
+ return { files, manifest, manifestBuffer };
229
+ }
230
+
231
+ export async function verifySavedAppleMusicBatch(records, batchDirectory, expected = serializeBatch(records)) {
232
+ let legacyUnclassified = false;
233
+ try {
234
+ await verifyExistingBatch(batchDirectory, expected.manifestBuffer, expected.files);
235
+ } catch (error) {
236
+ if (error?.code !== "existing_batch_conflict") throw error;
237
+ const previous = await previousAppleNormalization(records);
238
+ if (!previous) throw error;
239
+ expected = serializeBatch(previous);
240
+ await verifyExistingBatch(batchDirectory, expected.manifestBuffer, expected.files);
241
+ legacyUnclassified = true;
242
+ }
243
+ return { status: "unchanged", batchDirectoryName: records.manifest.import_batch_id, manifest: expected.manifest,
244
+ firstImportedAt: await readAppleImportSaveTime(batchDirectory), ...(legacyUnclassified ? { legacyUnclassified } : {}) };
245
+ }
236
246
 
237
- const resolvedOutputRoot = await prepareOutputRoot(outputRoot, boundaryRoot);
247
+ export async function writeAppleMusicImportBatch(
248
+ records,
249
+ { outputRoot, boundaryRoot },
250
+ ) {
251
+ if (!isUuid(records?.manifest?.import_batch_id)) {
252
+ fail("batch_id_invalid", "Import batch ID must be a UUID");
253
+ }
254
+ if (typeof outputRoot !== "string" || outputRoot.trim() === "") {
255
+ throw new TypeError("Import output root is required");
256
+ }
257
+
258
+ await validateAppleMusicImportRecords(records);
259
+ const expected = serializeBatch(records);
260
+ const { files, manifest, manifestBuffer } = expected;
261
+
262
+ const noMusic = !records.trackRefs.length && manifest.warning_counts.non_music_media_excluded > 0;
263
+ const resolvedOutputRoot = await prepareOutputRoot(outputRoot, boundaryRoot, !noMusic);
238
264
 
239
265
  const batchDirectoryName = records.manifest.import_batch_id;
240
- const batchDirectory = path.join(resolvedOutputRoot, batchDirectoryName);
241
- const existing = await pathType(batchDirectory);
242
- if (existing) {
243
- await verifyExistingBatch(batchDirectory, manifestBuffer, files);
244
- return {
245
- status: "unchanged",
246
- batchDirectoryName,
247
- manifest,
248
- };
266
+ const batchDirectory = resolvedOutputRoot && path.join(resolvedOutputRoot, batchDirectoryName);
267
+ const unchanged = () => verifySavedAppleMusicBatch(records, batchDirectory, expected);
268
+ if (batchDirectory && await pathType(batchDirectory)) return unchanged();
269
+ if (noMusic) {
270
+ fail("apple_library_no_music", "This export contains no music to import. No library snapshot was saved.");
249
271
  }
250
272
 
251
273
  const temporaryDirectory = path.join(
@@ -268,13 +290,9 @@ export async function writeAppleMusicImportBatch(
268
290
  await rename(temporaryDirectory, batchDirectory);
269
291
  } catch (cause) {
270
292
  await rm(temporaryDirectory, { recursive: true, force: true });
271
- if (cause?.code === "EEXIST" || cause?.code === "ENOTEMPTY") {
272
- await verifyExistingBatch(batchDirectory, manifestBuffer, files);
273
- return {
274
- status: "unchanged",
275
- batchDirectoryName,
276
- manifest,
277
- };
293
+ if (cause?.code === "EEXIST" || cause?.code === "ENOTEMPTY" ||
294
+ (process.platform === "win32" && cause?.code === "EPERM" && await pathType(batchDirectory))) {
295
+ return unchanged();
278
296
  }
279
297
  if (cause instanceof AppleMusicImportError) throw cause;
280
298
  fail("batch_write_failed", "Private import batch could not be written", {
@@ -282,9 +300,23 @@ export async function writeAppleMusicImportBatch(
282
300
  });
283
301
  }
284
302
 
303
+ // Only the process that installed the canonical batch publishes its first save time.
304
+ const firstImportedAt = new Date().toISOString();
305
+ const receipt = appleImportSaveTimePath(batchDirectory);
306
+ const temporaryReceipt = appleImportSaveTimePath(temporaryDirectory);
307
+ try {
308
+ await writePrivateFile(temporaryReceipt, Buffer.from(firstImportedAt + "\n", "utf8"));
309
+ await rename(temporaryReceipt, receipt);
310
+ } catch {
311
+ // A missing date must not turn an already saved library into a failed import.
312
+ await rm(temporaryReceipt, { force: true }).catch(() => {});
313
+ // A previously removed batch may have left its receipt here.
314
+ await rm(receipt, { force: true }).catch(() => {});
315
+ }
285
316
  return {
286
317
  status: "written",
287
318
  batchDirectoryName,
288
319
  manifest,
320
+ firstImportedAt,
289
321
  };
290
322
  }