@audiofool/moondog 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -157
- package/package.json +5 -4
- package/src/i18n/screen/es.mjs +2 -1
- package/src/i18n/screen/ja.mjs +2 -1
- package/src/i18n/screen/pt.mjs +2 -1
- package/src/i18n/screen/zh.mjs +2 -1
- package/src/integrations/web/moondog-web.mjs +57 -0
- package/src/integrations/web/web-research.mjs +23 -6
- package/src/integrations/web/web-result.mjs +1 -0
- package/src/runtime/pi/agent-runtime.mjs +3 -2
- package/src/runtime/pi/configured-runtime.mjs +1 -1
- package/src/runtime/pi/memory-agent-runtime.mjs +1 -1
- package/src/runtime/pi/model-roles.mjs +18 -1
- package/src/runtime/pi/model-settings.mjs +32 -3
- package/src/runtime/pi/moondog-model.mjs +2 -1
- package/src/runtime/pi/profile-build-runtime.mjs +1 -1
- package/src/runtime/pi/public-model-catalog.mjs +1 -1
- package/src/surfaces/cli/brand-components.mjs +2 -2
- package/src/surfaces/cli/command-completions.mjs +1 -1
- package/src/surfaces/cli/model-roles-command.mjs +2 -2
- package/src/surfaces/cli/tui.mjs +4 -0
package/README.md
CHANGED
|
@@ -4,27 +4,42 @@
|
|
|
4
4
|
|
|
5
5
|
<h1 align="center">Moondog</h1>
|
|
6
6
|
|
|
7
|
-
<p align="center">Version 0.3.
|
|
7
|
+
<p align="center">Version 0.3.1</p>
|
|
8
8
|
|
|
9
9
|
<p align="center"><strong>On the air, just for you.</strong></p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<
|
|
12
|
+
<picture>
|
|
13
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/demo/moondog-desktop-dark.png">
|
|
14
|
+
<img src="assets/demo/moondog-desktop-light.png" width="1000" alt="Moondog's desktop window: a request for a late train home, the host's answer with three songs, and the player with the cover of Last Tram Home and two songs up next">
|
|
15
|
+
</picture>
|
|
13
16
|
</p>
|
|
14
17
|
|
|
15
|
-
<p align="center"><sub>The
|
|
18
|
+
<p align="center"><sub>The desktop app, with a made-up listener. The <a href="https://moondog.audiofool.ai">project page</a> plays the whole scene.</sub></p>
|
|
16
19
|
|
|
17
|
-
Moondog is a radio host just for you
|
|
18
|
-
It reads the history your music services already keep,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
It shows its work, and your data stays on your machine.
|
|
22
|
-
The room is built on [Pi](https://github.com/earendil-works/pi).
|
|
20
|
+
Moondog is a radio host just for you.
|
|
21
|
+
It reads the history your music services already keep, learns your taste from it, and plays music for you on Spotify, Apple Music, or NetEase Music.
|
|
22
|
+
Ask it for something, and it answers like a host: what it picked, and why each song is there.
|
|
23
|
+
On a Mac it can also go on air with music it makes itself.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
There are two clients on one core: a desktop app and a listening room in your terminal.
|
|
26
|
+
They share your profile, settings, sign-ins, and conversations.
|
|
27
|
+
Your profile works without a model, an API key, or a music-service login, and your data stays on your machine.
|
|
28
|
+
The agent is built on [Pi](https://github.com/earendil-works/pi).
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
## Get Moondog
|
|
31
|
+
|
|
32
|
+
| Where | How |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Mac, Apple silicon | Download the signed, notarized app from the [project page](https://moondog.audiofool.ai) or [Releases](https://github.com/Audiofool934/moondog/releases/latest). |
|
|
35
|
+
| Windows, x64 | A test build from the same places. It is not code-signed yet, so SmartScreen asks before it opens. |
|
|
36
|
+
| Terminal, macOS or Linux | `npm install --global @audiofool/moondog`, then `moondog`. Needs Node.js 22.19.0 or newer. |
|
|
37
|
+
|
|
38
|
+
The desktop app updates itself, on a Stable or Beta channel you choose in Settings › About.
|
|
39
|
+
The terminal updates with `moondog update` or `/update`, on the npm `latest` or `beta` channel.
|
|
40
|
+
See [updating and release channels](docs/UPDATES.md).
|
|
41
|
+
|
|
42
|
+
To run from this checkout:
|
|
28
43
|
|
|
29
44
|
```bash
|
|
30
45
|
git clone https://github.com/Audiofool934/moondog.git
|
|
@@ -33,65 +48,36 @@ npm ci
|
|
|
33
48
|
npm start
|
|
34
49
|
```
|
|
35
50
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
The source version supports `moondog update` and `/update`, with stable (`latest`) and preview (`beta`) channels.
|
|
40
|
-
Startup checks show a quiet notification; installation happens only when you request it.
|
|
41
|
-
See [updating and release channels](docs/UPDATES.md), including the one-time upgrade needed for the older npm 0.1.0 package.
|
|
42
|
-
|
|
43
|
-
## On your Mac
|
|
44
|
-
|
|
45
|
-
[Moondog desktop](app/README.md) is a native window on the same core as the terminal room, with build targets for macOS (Apple silicon), Windows (x64), and Linux (x64).
|
|
46
|
-
It shares your profile, settings, sign-ins, and conversations with `moondog`, and draws its own conversation, now playing, and up next.
|
|
47
|
-
Download the notarized build for Apple silicon from the [project page](https://moondog.audiofool.ai), or run it from this checkout with `cd app && npm ci && npm start`.
|
|
48
|
-
It updates itself, on a Stable or Beta channel you choose in Settings.
|
|
49
|
-
The Windows and Linux desktop builds use Spotify playback and Apple Music previews; full Apple Music songs and reading the Music app require macOS.
|
|
50
|
-
Windows support applies to the desktop app; the terminal launcher and its updater remain supported on macOS and Linux.
|
|
51
|
-
|
|
52
|
-
The [project page](https://moondog.audiofool.ai) plays a short scene in this window, in a browser, with a made-up listener ([how](site/README.md)).
|
|
53
|
-
|
|
54
|
-
## The sleeve
|
|
51
|
+
`npm run demo` shows the agent at work on fictional data, with no sign-in at all.
|
|
52
|
+
`cd app && npm ci && npm start` opens the desktop app; [app/README.md](app/README.md) covers its builds for macOS, Windows, and Linux.
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
Nothing in the terminal is a picture.
|
|
58
|
-
On a wide screen the record sits beside the title, with the wordmark level with the dog's eye.
|
|
59
|
-
On a tall or narrow screen the record stacks above the title.
|
|
60
|
-
Moondog uses whichever arrangement leaves the record larger.
|
|
61
|
-
A lyric rests midway between the record and the input box, with room on both sides.
|
|
62
|
-
The input asks what you have been listening to.
|
|
54
|
+
## Where it plays
|
|
63
55
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
| Service | What you get |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| Apple Music | Whole songs in the Mac app with a subscription; 30-second previews elsewhere, each with a link to the full song. |
|
|
59
|
+
| Spotify | Playback on your active device, after you connect your account. |
|
|
60
|
+
| NetEase Music | Whole songs through NetEase's own `ncm-cli`, for listeners in mainland China. |
|
|
67
61
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
`/theme terminal` keeps your own colors.
|
|
72
|
-
The only other colors are the six from the prism on *The Dark Side of the Moon*.
|
|
73
|
-
Red means a step failed, orange is a caution, green confirms, and the spectrum shows while Moondog is working.
|
|
62
|
+
Pick the service beside the send button, or with `/service` in the terminal.
|
|
63
|
+
Moondog also sees what you already play: the song and playlist in the Music app on a Mac, or on Spotify's active device, so “more like this playlist” needs no names.
|
|
64
|
+
The Windows build plays Spotify and Apple Music previews; whole Apple Music songs and reading the Music app need macOS.
|
|
74
65
|
|
|
75
|
-
|
|
66
|
+
## A model to talk through
|
|
76
67
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
| Listening profile | `/taste` |
|
|
80
|
-
| Import your music | `/import` |
|
|
81
|
-
| Appearance | `/theme` |
|
|
82
|
-
| Help & commands | `/help` |
|
|
68
|
+
Testers with an invite code can use Moondog's own model, with no account and no API key.
|
|
69
|
+
Enter the code in Settings, or type `/invite <code>` in the terminal.
|
|
83
70
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
Or bring your own.
|
|
72
|
+
GLM, Kimi, DeepSeek, Grok, GPT, Claude, Gemini, and OpenRouter are built in, and OpenAI takes your ChatGPT subscription or an API key.
|
|
73
|
+
Any service that speaks OpenAI's or Anthropic's API can be added by its address, in Settings or with `/endpoint`.
|
|
74
|
+
You can switch models in the middle of a conversation, or change settings by asking, such as the model or the language it replies in.
|
|
75
|
+
The [model setup guide](docs/TERMINAL_GUIDE.md#enable-agent-conversation) lists each provider.
|
|
89
76
|
|
|
90
77
|
## Bring your history
|
|
91
78
|
|
|
92
|
-
|
|
93
|
-
Moondog shows you what is inside before anything is saved.
|
|
94
|
-
When the import finishes, your profile opens in the same TUI session.
|
|
79
|
+
Import in the desktop app's Settings › Import, or drop the file on its window; in the terminal, type `/import`.
|
|
80
|
+
Moondog shows you what is inside before anything is saved, and the original files are never touched.
|
|
95
81
|
|
|
96
82
|
| Service | What you can bring |
|
|
97
83
|
| --- | --- |
|
|
@@ -102,22 +88,11 @@ When the import finishes, your profile opens in the same TUI session.
|
|
|
102
88
|
| QQ Music and NetEase | Any public playlist, from its share link. |
|
|
103
89
|
| ListenBrainz | A saved listens file. |
|
|
104
90
|
|
|
105
|
-
A Spotify ZIP can also go straight in.
|
|
106
|
-
|
|
107
|
-
```text
|
|
108
|
-
/import "/path/to/spotify-history.zip"
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Importing the same file twice changes nothing, and your original files are never touched.
|
|
112
|
-
Apple's privacy download, and full QQ or NetEase listening history, are not supported yet.
|
|
113
91
|
The [terminal guide](docs/TERMINAL_GUIDE.md#import-and-inspect-listening-history) has every format.
|
|
114
92
|
|
|
115
|
-
With a connected
|
|
93
|
+
With a model connected, Moondog writes a reading of everything you imported, usually in a few minutes.
|
|
116
94
|
It names the threads in your listening, keeps what you played apart from what you saved, and marks its interpretations as interpretations.
|
|
117
95
|
A second pass checks the draft for contradictions and invented claims, and the build fixes what it finds before saving.
|
|
118
|
-
Use `/profile saved` to read it and `/profile explain 1` to trace a finding to its evidence, including after restarting.
|
|
119
|
-
New imports or corrections mark it for an update; a cancelled build keeps its draft and your previous reading.
|
|
120
|
-
The builder sends a compact summary of your music evidence to your configured model when you ask for it.
|
|
121
96
|
|
|
122
97
|
## Your profile
|
|
123
98
|
|
|
@@ -125,113 +100,74 @@ The profile says what you played, and what that cannot prove.
|
|
|
125
100
|
Playing a song a lot does not, on its own, establish how much it matters to you.
|
|
126
101
|
|
|
127
102
|
<p align="center">
|
|
128
|
-
<img src="assets/demo/moondog-tui-profile.png" width="1000" alt="The listening profile for the fictional track Midnight Lines by Mara Vale, with the plays
|
|
103
|
+
<img src="assets/demo/moondog-tui-profile.png" width="1000" alt="The listening profile in the terminal for the fictional track Midnight Lines by Mara Vale, with the plays, what they cannot tell, and how sure Moondog is">
|
|
129
104
|
</p>
|
|
130
105
|
|
|
131
|
-
<p align="center"><sub>
|
|
106
|
+
<p align="center"><sub>The terminal's profile, with fictional data: the evidence, and the limit of that evidence.</sub></p>
|
|
132
107
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
| Make a choice | Choose **I like this** (Like) or **Keep it out** (Avoid), and the profile updates in place. You can also say it to the agent, for example “never play this again”. |
|
|
138
|
-
| Change your mind | Choose **Undo my choice**, and the original listening history never changes. |
|
|
139
|
-
| Find more like this | Start an editable request for three songs, from the track you picked. |
|
|
140
|
-
|
|
141
|
-
Type `/taste report` for the long view.
|
|
142
|
-
It walks the years one song at a time, names songs that went quiet and songs that came back, and ends on the dark side of the moon: what play counts can never tell anyone.
|
|
143
|
-
You can save that report as a private page that works offline.
|
|
144
|
-
|
|
145
|
-
## An agent, when you want one
|
|
146
|
-
|
|
147
|
-
Sign in with `/auth`, then pick a model with `/model`.
|
|
148
|
-
GLM, Kimi, DeepSeek, Grok, GPT, Claude, Gemini, and OpenRouter are there.
|
|
149
|
-
OpenAI takes your ChatGPT subscription or an API key.
|
|
150
|
-
In the Mac app, any service that speaks OpenAI's or Anthropic's API can be added as an endpoint by its address, and `/endpoint` does it in the terminal.
|
|
151
|
-
You can switch models in the middle of a conversation.
|
|
152
|
-
The [model setup guide](docs/TERMINAL_GUIDE.md#enable-agent-conversation) lists each provider and the environment variable it reads.
|
|
153
|
-
`/model roles` shows the models and services behind side tasks: a vision model for images, and the web search service.
|
|
154
|
-
Moondog takes images too: an image path in your message in the terminal, or a pasted or dropped image in the Mac app.
|
|
155
|
-
You can also change settings in your own words, such as which model answers or the language it replies in.
|
|
156
|
-
|
|
157
|
-
While an answer is on the way, each step appears in the conversation as it starts.
|
|
158
|
-
The steps stay above the reply, with a count of what finished, what failed, and what was not confirmed.
|
|
159
|
-
The agent can use musical knowledge and web research to find candidates, then verify the recordings on Spotify before playing or queueing them.
|
|
160
|
-
Without Spotify, it plays 30-second Apple Music previews from the terminal instead, each next to a link to the full song.
|
|
161
|
-
With NetEase Music, it plays whole songs through NetEase's own `ncm-cli`.
|
|
162
|
-
In the Mac app, Apple Music plays whole songs with a subscription.
|
|
163
|
-
`/service` chooses where Moondog plays.
|
|
164
|
-
It also sees what you already play: the song and playlist in the Music app on a Mac, or on Spotify's active device, so “more like this playlist” needs no names.
|
|
165
|
-
macOS asks once before Moondog may read the Music app.
|
|
166
|
-
For example, “Pon doce de salsa clásica a la cola” asks it to add up to twelve verified songs directly; your history guides the choice without limiting it to your library.
|
|
167
|
-
What it reads about the wider music world stays separate from what it knows about you.
|
|
168
|
-
Under a queue or a set of songs, one line names the mix: how many you know well, how many come back after a while, and how many are new to you.
|
|
169
|
-
Songs Moondog chose for you do not count as your own taste.
|
|
170
|
-
|
|
171
|
-
| Optional connection | What it adds |
|
|
172
|
-
| --- | --- |
|
|
173
|
-
| A model through Pi | Conversation, discovery, and playlists built together. |
|
|
174
|
-
| A web search service | `/web` lookups with links to their sources, through DeepSeek (`/auth deepseek`, which also reads pages), Brave Search (`/auth brave`), or your own signed-in Codex CLI. |
|
|
175
|
-
| Spotify sign-in | Playback, and playlists made only when you ask. |
|
|
176
|
-
| NetEase Music | Whole songs through its own `ncm-cli`, for listeners in mainland China. |
|
|
108
|
+
Open it from Taste in the desktop app's sidebar (⌥⌘T), or with `/taste` in the terminal.
|
|
109
|
+
Find a song or artist, see why it is there, and choose **I like this** or **Keep it out**; the profile updates in place, and **Undo my choice** puts it back.
|
|
110
|
+
You can also say it to the host, for example “never play this again”.
|
|
111
|
+
`/taste report` walks the years one song at a time and ends on what play counts can never tell anyone; you can keep it as a private page that works offline.
|
|
177
112
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
113
|
+
## On the air
|
|
114
|
+
|
|
115
|
+
Ask for music in your own words, in any of ten languages.
|
|
116
|
+
Each step shows in the conversation as it happens, and the host checks every recording on your service before it plays or queues it.
|
|
117
|
+
What it reads about the wider music world stays separate from what it knows about you, and songs it chose for you do not count as your own taste.
|
|
118
|
+
Under a set of songs, one line names the mix: how many you know well, how many come back after a while, and how many are new to you.
|
|
184
119
|
|
|
185
|
-
|
|
120
|
+
- **Up next.** The desktop player shows the queue: play a song now, or take one out. When it runs low, the host offers a few picks.
|
|
121
|
+
- **Your library.** Saved songs, your playlists, and the tracks Moondog made sit side by side. Import a Spotify, Apple Music, NetEase Music, or QQ Music playlist by its link, and export a playlist to Spotify.
|
|
122
|
+
- **Music it makes.** On an Apple silicon Mac, Moondog makes instrumental tracks offline with Stable Audio 3, powered by Stability AI. Set it up once in Settings › Playback, or with `/generation download medium`, after you agree to its licenses.
|
|
123
|
+
- **On Air.** Press the On Air mark, ⌃⌘O, or type `/onair`, and Moondog keeps making music from your taste until you stop it.
|
|
186
124
|
|
|
187
|
-
|
|
188
|
-
`/library save` keeps what is playing, and `/library play Night drive` plays a playlist on the service you chose.
|
|
189
|
-
`/library import <link>` copies a Spotify, Apple Music, NetEase Music or QQ Music playlist into it.
|
|
190
|
-
A playlist you made on Spotify also shapes your taste; for any other one, you decide.
|
|
191
|
-
`/library export Night drive` puts a copy of a playlist on Spotify, and exporting it again updates that copy.
|
|
125
|
+
## The terminal room
|
|
192
126
|
|
|
193
|
-
|
|
127
|
+
<p align="center">
|
|
128
|
+
<img src="assets/demo/moondog-tui-home.png" width="1000" alt="Moondog's listening room in the terminal, in charcoal: the record sleeve drawn in characters beside the wordmark, a four-line tracklist, and the line Where have you been">
|
|
129
|
+
</p>
|
|
194
130
|
|
|
195
|
-
|
|
196
|
-
`/generation download medium` sets it up after you agree to its licenses, and `/generation on` turns it on.
|
|
197
|
-
Ask for a track, or type `/onair` and Moondog keeps making music from your taste until you stop it.
|
|
131
|
+
<p align="center"><sub>The real terminal room, in charcoal, with fictional data.</sub></p>
|
|
198
132
|
|
|
199
|
-
|
|
133
|
+
The terminal opens on a record sleeve drawn in characters, with a lyric from music you have played.
|
|
134
|
+
Moondog asks [LRCLIB](https://lrclib.net/) for the original words only, and sends nothing about you.
|
|
135
|
+
The room is black and white, like the moon: `/theme paper`, `/theme charcoal`, or `/theme terminal` for your own colors.
|
|
136
|
+
Tab on an empty input steps onto the tracklist, and Ctrl+P searches every command.
|
|
200
137
|
|
|
201
|
-
| Command
|
|
138
|
+
| Command | What it does |
|
|
202
139
|
| --- | --- |
|
|
203
140
|
| `/taste` | Open your profile. |
|
|
204
|
-
|
|
|
205
|
-
| Tab in the profile | Switch between All, Tracks, Artists, and Your choices. |
|
|
206
|
-
| Tab on the sleeve | Step onto the tracklist, then press Escape to return to the line you were writing. |
|
|
207
|
-
| Esc | Go back, and the draft stays put. |
|
|
208
|
-
| Ctrl+P | Search every command. |
|
|
209
|
-
| Page Up, Page Down | Move through the conversation while the header, the draft, and the status line stay put. |
|
|
210
|
-
| Up and Down in the draft | Recall what you typed in this conversation. |
|
|
211
|
-
| Enter while Moondog is working | Queue the next message. It sends when this one finishes. |
|
|
212
|
-
| `/resume`, `/new` | Pick up a saved conversation, or start a fresh one. |
|
|
213
|
-
| `/home` | Back to the sleeve, without clearing the conversation. |
|
|
214
|
-
| `/skip`, `/stop` | Skip to the next song preview or stream track, or stop them. |
|
|
141
|
+
| `/import` | Bring your history. |
|
|
215
142
|
| `/library` | Your saved songs and playlists. |
|
|
216
143
|
| `/onair` | Go on air, or come off it. |
|
|
144
|
+
| `/skip`, `/stop` | Skip to the next song or stream track, or stop. |
|
|
145
|
+
| `/resume`, `/new` | Pick up a saved conversation, or start a fresh one. |
|
|
217
146
|
| `/rewind`, `/branch` | Change an earlier message, or go on in a new conversation. |
|
|
218
|
-
| `/
|
|
219
|
-
| `/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
147
|
+
| `/home` | Back to the sleeve, without clearing the conversation. |
|
|
148
|
+
| `/help` | Everything else. |
|
|
149
|
+
|
|
150
|
+
The [terminal guide](docs/TERMINAL_GUIDE.md) has every command and key.
|
|
151
|
+
|
|
152
|
+
## Your data
|
|
223
153
|
|
|
224
|
-
|
|
225
|
-
|
|
154
|
+
Your profile never touches the network.
|
|
155
|
+
The agent talks only to the services you set up, and the profile builder sends a compact summary of your music evidence to your model only when you ask for a build.
|
|
156
|
+
Web search sends the question or the link you give it, and nothing from your profile, history, or files.
|
|
157
|
+
An image you attach goes to the model that reads it.
|
|
158
|
+
A Spotify ZIP does not need a Spotify sign-in.
|
|
159
|
+
Read the [connection and data details](docs/TERMINAL_GUIDE.md) before you connect anything.
|
|
226
160
|
|
|
227
161
|
## Further
|
|
228
162
|
|
|
229
163
|
- [Terminal guide](docs/TERMINAL_GUIDE.md): import formats, commands, appearance, models, Spotify, memory, and your local data.
|
|
164
|
+
- [Desktop app](app/README.md): the window, its keys, builds, and updates.
|
|
165
|
+
- [Project page](site/README.md): how the page plays the scene in the app's real window, in a browser, on made-up data.
|
|
230
166
|
- [Private Tasteprint](docs/PRIVATE_TASTEPRINT.md): what the evidence can support, and what a report reveals about you.
|
|
231
167
|
- [Product charter](docs/PRODUCT_CHARTER.md) and [public roadmap](docs/ROADMAP.md): where Moondog is headed, and what it will not do.
|
|
232
168
|
- [Voice](docs/VOICE.md): how Moondog talks, and where Pink Floyd shows up.
|
|
233
169
|
- [The listening loop](docs/LISTENING_LOOP.md): how the agent keeps your choices, your recent listening, and its own picks apart.
|
|
234
|
-
- [The agent harness](docs/AGENT_HARNESS.md): how the tools keep the model's part small, so every supported model can play what you ask
|
|
170
|
+
- [The agent harness](docs/AGENT_HARNESS.md): how the tools keep the model's part small, so every supported model can play what you ask.
|
|
235
171
|
- [Runtime architecture](docs/ADR_0001_AGENT_RUNTIME_AND_CLI.md) and [data contracts](contracts/README.md): how the pieces fit together.
|
|
236
172
|
- [Contribution guide](CONTRIBUTING.md): local setup, checks, and how private data is kept out.
|
|
237
173
|
- [Release status](docs/PUBLIC_RELEASE_READINESS.md): what is published, and what the checks cover.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audiofool/moondog",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A local-first AI radio host, just for you.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -66,12 +66,13 @@
|
|
|
66
66
|
"test": "node --test tests/contracts/*.test.mjs tests/core/*.test.mjs tests/importers/*.test.mjs tests/runtime/*.test.mjs gateway/tests/*.test.mjs"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@earendil-works/pi-agent-core": "1.0
|
|
70
|
-
"@earendil-works/pi-ai": "1.0
|
|
71
|
-
"@earendil-works/pi-tui": "1.0
|
|
69
|
+
"@earendil-works/pi-agent-core": "1.6.0",
|
|
70
|
+
"@earendil-works/pi-ai": "1.6.0",
|
|
71
|
+
"@earendil-works/pi-tui": "1.6.0",
|
|
72
72
|
"ajv": "8.20.0",
|
|
73
73
|
"ajv-formats": "3.0.1",
|
|
74
74
|
"plist": "5.0.0",
|
|
75
|
+
"typebox": "1.3.27",
|
|
75
76
|
"yauzl": "3.4.0"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
package/src/i18n/screen/es.mjs
CHANGED
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
"Esc returns to your next thought.": "Esc vuelve a tu siguiente idea.",
|
|
22
22
|
"What have you been listening to?": "¿Qué has estado escuchando?",
|
|
23
23
|
"A song, a playlist, or what to play next.": "Una canción, una playlist o qué poner después.",
|
|
24
|
-
"
|
|
24
|
+
"On the air, just for you.": "Al aire, solo para ti.",
|
|
25
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` - let Moondog make music on this Mac, or stop\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.": "# Tu sala de escucha\n\n## 01 / Escucha y descubre\n\nEscribe para hablar de música, pedir una playlist o explorar.\nPara hablar, Moondog necesita un modelo: `/auth` inicia sesión y `/model` elige uno.\nMientras llega una respuesta, cada paso aparece en la conversación y el pie de página indica el que está en curso.\n\n- `/taste` - tu perfil: abre cualquier canción o artista para ver por qué está ahí\n- `/taste report` - el panorama completo en una página\n- `/import` - trae tu historial, tu biblioteca o una playlist\n- `/library` - tus canciones guardadas y tus listas\n- `/generation on|off` - deja que Moondog haga música en este Mac, o para\n- `/onair` - sal al aire, o deja de estarlo\n- `/lyrics` - la letra de la portada; `/lyrics sync` busca más\n- `/service` - elige dónde pongo la música: Spotify, Apple Music o NetEase\n- `/spotify` - reproduce, añade a la cola y crea playlists en Spotify\n- Pide pasar la reproducción a tu iPhone, tu ordenador u otro dispositivo de Spotify por su nombre\n- `/web search <búsqueda>` o `/web read <url>` - consulta sitios de música públicos\n\n## 02 / Hazlo tuyo\n\n- `/profile` - el mismo perfil que `/taste`\n- `/profile corrections` - todo lo que me has dicho\n- `/profile retract <id>` - deshaz una de esas elecciones\n- `/profile help` - todos los comandos del perfil\n- `/remember <texto>`, `/memory`, `/forget <id>` - lo que recuerdo entre conversaciones\n\n## 03 / Por la sala\n\n- `/home` - vuelve a la portada; la conversación se queda\n- `/theme paper|charcoal|terminal|auto` - cambia el aspecto\n- `/art braille|ascii|off` - cambia la ilustración\n- `/motion on|off` - activa o desactiva la animación\n- `/commands` o Ctrl+P - busca cualquier comando; tu mensaje no se pierde\n- Re Pág y Av Pág desplazan la conversación. La cabecera y tu borrador no se mueven\n- Arriba y Abajo en el borrador recuperan lo que escribiste en esta conversación\n- `/resume` - retoma una conversación guardada (escribe para filtrar, Enter la abre)\n- `/new` - empieza de cero; esta conversación queda guardada\n- `/rewind` o Alt+R - edita un mensaje anterior en esta conversación; los mensajes siguientes se reemplazan\n- `/branch` - sigue desde aquí en una conversación nueva; esta queda guardada\n- `/status`, `/sources`, `/tools`, `/doctor` - mira qué está conectado y funcionando\n- `/reload` - recarga los ajustes del modelo y los inicios de sesión\n- `/model roles` - mira qué usan las tareas auxiliares: el modelo que lee imágenes y el servicio de búsqueda web\n- `/effort` - elige cuánto piensa el modelo\n- `/endpoint add` o `/endpoint remove <id>` - añade un servicio de modelos por su dirección, o quítalo\n- `/update [--check] [--channel latest|beta]` - busca una versión nueva, o cierra esta sala e instálala\n- `/help all` - todos los comandos, incluidos los de la terminal\n- `/language` - elige el idioma de Moondog\n- `/quit` - salir\n\nTab lleva al menú de la pantalla de inicio. Esc vuelve a la escritura.\nEnter envía y Mayús+Enter empieza una línea nueva.\nTab o Enter aceptan una sugerencia.\nCtrl+C detiene una petición al modelo o a la web, o sale si no hay nada en marcha.\nEn el perfil, escribe para filtrar, Tab cambia de lista y Enter muestra lo que puedes hacer.\nCtrl+R lo actualiza y Ctrl+O abre el informe completo.\nTu perfil funciona sin modelo.\nPon entre comillas las rutas, títulos y nombres con espacios.",
|
|
26
26
|
"Listening profile": "Perfil de escucha",
|
|
27
27
|
"Profile": "Perfil",
|
|
@@ -1182,4 +1182,5 @@ export default {
|
|
|
1182
1182
|
"Moondog's tracks stay here; Spotify can't hold them.": "Las pistas de Moondog se quedan aquí; Spotify no puede guardarlas.",
|
|
1183
1183
|
"Export a playlist": "Exportar una lista",
|
|
1184
1184
|
"{count} songs went over.": { one: "Se envió {count} canción.", other: "Se enviaron {count} canciones." },
|
|
1185
|
+
"Vision and web search are back on auto, where Moondog sees images and searches the web itself. `/model roles` shows them.": "La visión y la búsqueda web vuelven a automático: Moondog ve las imágenes y busca en la web por sí mismo. `/model roles` las muestra.",
|
|
1185
1186
|
};
|
package/src/i18n/screen/ja.mjs
CHANGED
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
"Esc returns to your next thought.": "Esc で入力に戻ります。",
|
|
22
22
|
"What have you been listening to?": "最近は何を聴いていますか?",
|
|
23
23
|
"A song, a playlist, or what to play next.": "曲、プレイリスト、次にかけるもの。",
|
|
24
|
-
"
|
|
24
|
+
"On the air, just for you.": "あなただけに、オンエア中。",
|
|
25
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` - let Moondog make music on this Mac, or stop\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` - 全体像を 1 ページで\n- `/import` - 履歴、ライブラリ、プレイリストを取り込む\n- `/library` - 保存した曲とプレイリスト\n- `/generation on|off` - この Mac で Moondog に音楽を作らせる、または止める\n- `/onair` - オンエアを始める、または終える\n- `/lyrics` - ジャケットの歌詞。`/lyrics sync` でさらに探します\n- `/service` - 音楽をどこで流すかを選ぶ: Spotify、Apple Music、NetEase\n- `/spotify` - Spotify で再生、キューへの追加、プレイリスト作成\n- iPhone やパソコンなど、Spotify デバイスの名前を言えば再生先を切り替えます\n- `/web search <キーワード>` または `/web read <URL>` - 公開の音楽サイトで調べる\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 はモデルや Web へのリクエストを止めます。何も動いていなければ終了します。\nプロフィールでは、入力で絞り込み、Tab でリストを切り替え、Enter でできることを表示します。\nCtrl+R で更新、Ctrl+O で完全なレポートを開きます。\nプロフィールはモデルなしでも使えます。\nスペースを含むパス、タイトル、名前は引用符で囲んでください。",
|
|
26
26
|
"Listening profile": "リスニングプロフィール",
|
|
27
27
|
"Profile": "プロフィール",
|
|
@@ -1182,4 +1182,5 @@ export default {
|
|
|
1182
1182
|
"Moondog's tracks stay here; Spotify can't hold them.": "Moondog が作った曲はここに残ります。Spotify には置けません。",
|
|
1183
1183
|
"Export a playlist": "プレイリストを書き出す",
|
|
1184
1184
|
"{count} songs went over.": { one: "{count} 曲を送りました。", other: "{count} 曲を送りました。" },
|
|
1185
|
+
"Vision and web search are back on auto, where Moondog sees images and searches the web itself. `/model roles` shows them.": "ビジョンとウェブ検索を自動に戻しました。Moondog が自分で画像を見て、ウェブを検索します。`/model roles` で確認できます。",
|
|
1185
1186
|
};
|
package/src/i18n/screen/pt.mjs
CHANGED
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
"Esc returns to your next thought.": "Esc volta para o seu próximo pensamento.",
|
|
22
22
|
"What have you been listening to?": "O que você tem ouvido?",
|
|
23
23
|
"A song, a playlist, or what to play next.": "Uma música, uma playlist ou o que tocar depois.",
|
|
24
|
-
"
|
|
24
|
+
"On the air, just for you.": "No ar, só para você.",
|
|
25
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` - let Moondog make music on this Mac, or stop\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.": "# Sua sala de escuta\n\n## 01 / Ouça e descubra\n\nDigite para conversar sobre música, pedir uma playlist ou explorar.\nPara conversar, o Moondog precisa de um modelo: `/auth` faz o login e `/model` escolhe um.\nEnquanto a resposta chega, cada passo aparece na conversa, e o rodapé mostra o que está em andamento.\n\n- `/taste` - seu perfil: abra qualquer música ou artista para ver por que está ali\n- `/taste report` - o panorama completo em uma página\n- `/import` - traga seu histórico, sua biblioteca ou uma playlist\n- `/library` - suas músicas salvas e playlists\n- `/generation on|off` - deixe o Moondog fazer música neste Mac, ou pare\n- `/onair` - entre no ar, ou saia\n- `/lyrics` - a letra na capa; `/lyrics sync` busca mais\n- `/service` - escolha onde eu toco a música: Spotify, Apple Music ou NetEase\n- `/spotify` - toque, adicione à fila e crie playlists no Spotify\n- Peça para passar a reprodução para o seu iPhone, computador ou outro dispositivo do Spotify pelo nome\n- `/web search <busca>` ou `/web read <url>` - pesquise em sites públicos de música\n\n## 02 / Deixe com a sua cara\n\n- `/profile` - o mesmo perfil de `/taste`\n- `/profile corrections` - tudo o que você me disse\n- `/profile retract <id>` - desfaça uma dessas escolhas\n- `/profile help` - todos os comandos do perfil\n- `/remember <texto>`, `/memory`, `/forget <id>` - o que eu lembro entre conversas\n\n## 03 / Pela sala\n\n- `/home` - volta para a capa do disco; a conversa continua\n- `/theme paper|charcoal|terminal|auto` - muda o visual\n- `/art braille|ascii|off` - muda a ilustração\n- `/motion on|off` - liga ou desliga a animação\n- `/commands` ou Ctrl+P - busca qualquer comando; sua mensagem não se perde\n- Page Up e Page Down rolam a conversa. O cabeçalho e o rascunho ficam no lugar\n- Para cima e para baixo no rascunho recuperam o que você digitou nesta conversa\n- `/resume` - retome uma conversa salva (digite para filtrar, Enter abre)\n- `/new` - comece do zero; esta conversa fica salva\n- `/rewind` ou Alt+R - edita uma mensagem anterior nesta conversa; as mensagens seguintes são substituídas\n- `/branch` - continua daqui em uma conversa nova; esta fica salva\n- `/status`, `/sources`, `/tools`, `/doctor` - veja o que está conectado e funcionando\n- `/reload` - recarrega as configurações do modelo e os logins\n- `/model roles` - veja o que as tarefas auxiliares usam: o modelo que lê imagens e o serviço de busca na web\n- `/effort` - escolha quanto o modelo pensa\n- `/endpoint add` ou `/endpoint remove <id>` - adicione um serviço de modelos pelo endereço, ou remova-o\n- `/update [--check] [--channel latest|beta]` - procura uma versão nova, ou fecha esta sala e instala\n- `/help all` - todos os comandos, inclusive os do terminal\n- `/language` - escolha o idioma do Moondog\n- `/quit` - sair\n\nNa tela inicial, Tab vai para o menu. Esc volta para a digitação.\nEnter envia, e Shift+Enter começa uma nova linha.\nTab ou Enter aceitam uma sugestão.\nCtrl+C interrompe um pedido ao modelo ou à web, ou sai quando nada está rodando.\nNo perfil, digite para filtrar, Tab troca de lista e Enter mostra o que você pode fazer.\nCtrl+R atualiza e Ctrl+O abre o relatório completo.\nSeu perfil funciona sem modelo.\nColoque entre aspas caminhos, títulos e nomes com espaços.",
|
|
26
26
|
"Listening profile": "Perfil de escuta",
|
|
27
27
|
"Profile": "Perfil",
|
|
@@ -1182,4 +1182,5 @@ export default {
|
|
|
1182
1182
|
"Moondog's tracks stay here; Spotify can't hold them.": "As faixas do Moondog ficam aqui; o Spotify não pode guardá-las.",
|
|
1183
1183
|
"Export a playlist": "Exportar uma playlist",
|
|
1184
1184
|
"{count} songs went over.": { one: "{count} música foi enviada.", other: "{count} músicas foram enviadas." },
|
|
1185
|
+
"Vision and web search are back on auto, where Moondog sees images and searches the web itself. `/model roles` shows them.": "A visão e a pesquisa na web voltaram ao automático: o Moondog vê imagens e pesquisa na web por conta própria. `/model roles` mostra isso.",
|
|
1185
1186
|
};
|
package/src/i18n/screen/zh.mjs
CHANGED
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
"Esc returns to your next thought.": "Esc 回到输入。",
|
|
22
22
|
"What have you been listening to?": "最近在听什么?",
|
|
23
23
|
"A song, a playlist, or what to play next.": "一首歌、一个歌单,或者接下来放什么。",
|
|
24
|
-
"
|
|
24
|
+
"On the air, just for you.": "只为你,正在播出。",
|
|
25
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` - let Moondog make music on this Mac, or stop\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` - 让 Moondog 在这台 Mac 上做音乐,或停下\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路径、标题和名字里有空格时,请加上引号。",
|
|
26
26
|
"Listening profile": "聆听资料",
|
|
27
27
|
"Profile": "资料",
|
|
@@ -1182,4 +1182,5 @@ export default {
|
|
|
1182
1182
|
"Moondog's tracks stay here; Spotify can't hold them.": "Moondog 做的曲目留在这里,Spotify 放不了它们。",
|
|
1183
1183
|
"Export a playlist": "导出歌单",
|
|
1184
1184
|
"{count} songs went over.": { one: "发过去 {count} 首。", other: "发过去 {count} 首。" },
|
|
1185
|
+
"Vision and web search are back on auto, where Moondog sees images and searches the web itself. `/model roles` shows them.": "视觉和网络搜索已改回自动,由 Moondog 自己看图、上网搜索。`/model roles` 可以查看。",
|
|
1185
1186
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { clip, createWebOperations, failure, requestWebService, searchSources, webLimits, webResult } from "./web-result.mjs";
|
|
2
|
+
|
|
3
|
+
// Moondog's own web search and page reading, through the same gateway and invite code as the
|
|
4
|
+
// Moondog model (see gateway/). Which service searches behind the gateway is the gateway's business.
|
|
5
|
+
// POST {gateway}/web/search { query, count } -> { results: [{ title, url, snippet, published_at }] }
|
|
6
|
+
// POST {gateway}/web/read { url } -> { status: "found", title, content } | { status: "unavailable" }
|
|
7
|
+
const limits = Object.freeze({ queryChars: 400, results: 10, searchTimeoutMs: 20_000, readTimeoutMs: 60_000 });
|
|
8
|
+
|
|
9
|
+
// The gateway's refusals, in the listener's terms. A search counts against the same daily allowance
|
|
10
|
+
// as the model.
|
|
11
|
+
function serviceError(status, body) {
|
|
12
|
+
const code = String(body?.error?.code ?? "");
|
|
13
|
+
if (code === "invite_invalid" || code === "invite_revoked") return failure("web_key_rejected", "Moondog's invite code no longer works. Enter a new one in Settings > Model.");
|
|
14
|
+
if (code === "beta_ended") return failure("web_service_failed", "The Moondog model's test period has ended, and its web search with it.");
|
|
15
|
+
if (code === "daily_allowance_used" || code === "beta_capacity_reached") {
|
|
16
|
+
return failure("web_quota_exhausted", "Today's Moondog allowance is used up, web search included. It starts again at midnight, Beijing time.");
|
|
17
|
+
}
|
|
18
|
+
if (status === 429) return failure("web_rate_limited", "Moondog's web search is limiting requests right now. Try again in a moment.");
|
|
19
|
+
if (status === 400) return failure("web_input_invalid", "Moondog's web search did not accept the request.");
|
|
20
|
+
return failure("web_service_failed", `Moondog's web search failed with HTTP ${status}. Try again in a moment.`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function createMoondogWebResearch({ baseUrl, apiKey, fetch: fetchImpl = globalThis.fetch, now = () => new Date() } = {}) {
|
|
24
|
+
const call = (operation, body, signal, timeoutMs) => requestWebService(fetchImpl, `${baseUrl}/web/${operation}`, {
|
|
25
|
+
name: "Moondog", method: "POST", signal, timeoutMs, body: JSON.stringify(body),
|
|
26
|
+
headers: { authorization: `Bearer ${apiKey}`, "content-type": "application/json", accept: "application/json" },
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
async function search(query, signal) {
|
|
30
|
+
const { status, body } = await call("search", { query, count: limits.results }, signal, limits.searchTimeoutMs);
|
|
31
|
+
if (status !== 200) throw serviceError(status, body);
|
|
32
|
+
if (!Array.isArray(body?.results)) throw failure("web_output_invalid", "Moondog's web search returned an unreadable result.");
|
|
33
|
+
const sources = searchSources(body.results);
|
|
34
|
+
return webResult({ provider: "moondog", kind: "search", status: sources.length ? "found" : "not_found", sources, retrievedAt: now().toISOString() });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function read(url, signal) {
|
|
38
|
+
const { status, body } = await call("read", { url }, signal, limits.readTimeoutMs);
|
|
39
|
+
if (status !== 200) throw serviceError(status, body);
|
|
40
|
+
const retrievedAt = now().toISOString();
|
|
41
|
+
const text = body?.status === "found" && typeof body.content === "string" ? body.content.trim() : "";
|
|
42
|
+
if (!text) {
|
|
43
|
+
return webResult({ provider: "moondog", kind: "read", status: "unavailable", retrievedAt,
|
|
44
|
+
summary: "Moondog could not get readable text from this page. It may be down, blocked, or not a text page." });
|
|
45
|
+
}
|
|
46
|
+
const title = typeof body.title === "string" && body.title.trim() ? clip(body.title.trim(), 300) : url;
|
|
47
|
+
return webResult({ provider: "moondog", kind: "read", status: "found", retrievedAt,
|
|
48
|
+
summary: clip(text, webLimits.fullTextChars), truncated: text.length > webLimits.fullTextChars,
|
|
49
|
+
sources: [{ title, url, snippet: "", published_at: null }] });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return createWebOperations({
|
|
53
|
+
now, queryChars: limits.queryChars,
|
|
54
|
+
unavailable: () => apiKey ? null : failure("web_key_missing", "Moondog's web search needs an invite code. Enter one in Settings > Model."),
|
|
55
|
+
run: (kind, value, signal) => kind === "search" ? search(value, signal) : read(value, signal),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { readModelRoles } from "../../runtime/pi/model-roles.mjs";
|
|
2
|
+
import { moondogModelUrl, readInvite } from "../../runtime/pi/moondog-model.mjs";
|
|
2
3
|
import { createPersistentCredentialStore } from "../../runtime/pi/persistent-credential-store.mjs";
|
|
3
4
|
import { createBraveWebResearch } from "./brave-web.mjs";
|
|
4
5
|
import { createCodexWebResearch } from "./codex-web.mjs";
|
|
5
6
|
import { createDeepSeekWebResearch } from "./deepseek-web.mjs";
|
|
7
|
+
import { createMoondogWebResearch } from "./moondog-web.mjs";
|
|
6
8
|
import { failure, webProviderName } from "./web-result.mjs";
|
|
7
9
|
|
|
8
10
|
// Search goes to the first backend that is set up; reading needs a backend that can open pages.
|
|
11
|
+
// Moondog's own comes first: a listener with an invite code has it without a key of their own.
|
|
9
12
|
// The web search role in Settings (model-roles.json) picks one instead, and MOONDOG_WEB_SEARCH_PROVIDER
|
|
10
13
|
// and MOONDOG_WEB_READ_PROVIDER pick over that. As in Hermes Agent, a call that fails on the chosen
|
|
11
14
|
// backend is tried once more on each other backend that is set up, so one service being down or out
|
|
12
15
|
// of credit doesn't leave the agent without the web.
|
|
13
|
-
const order = Object.freeze({ search: ["deepseek", "brave", "codex"], read: ["deepseek", "codex"] });
|
|
16
|
+
const order = Object.freeze({ search: ["moondog", "deepseek", "brave", "codex"], read: ["moondog", "deepseek", "codex"] });
|
|
14
17
|
// Failures that another backend would only repeat.
|
|
15
18
|
const final = new Set(["web_cancelled", "web_input_invalid", "web_url_invalid"]);
|
|
16
|
-
const providerIds = Object.freeze({ deepseek: "deepseek", brave: "brave", codex: "codex_cli" });
|
|
19
|
+
const providerIds = Object.freeze({ moondog: "moondog", deepseek: "deepseek", brave: "brave", codex: "codex_cli" });
|
|
17
20
|
const keys = Object.freeze({
|
|
18
21
|
deepseek: { credential: "deepseek", variable: "DEEPSEEK_API_KEY" },
|
|
19
22
|
brave: { credential: "brave", variable: "BRAVE_SEARCH_API_KEY" },
|
|
20
23
|
});
|
|
21
24
|
|
|
22
25
|
export const webSetupText = [
|
|
26
|
+
"- `/invite <code>` - Moondog's own search and page reading, on your invite code's daily allowance",
|
|
23
27
|
"- `/auth deepseek` - DeepSeek Search and Fetch: search and page reading, $0.75 per 1,000 requests each",
|
|
24
28
|
"- `/auth brave` - Brave Search: search only, with a free monthly credit",
|
|
25
29
|
"- Install the Codex CLI and run `codex login` - search and reading through your ChatGPT plan",
|
|
@@ -40,6 +44,7 @@ export async function createWebResearch({
|
|
|
40
44
|
fetch = globalThis.fetch,
|
|
41
45
|
createCodex = createCodexWebResearch,
|
|
42
46
|
readRoles = readModelRoles,
|
|
47
|
+
readCode = readInvite,
|
|
43
48
|
now,
|
|
44
49
|
} = {}) {
|
|
45
50
|
let current = { backends: {}, choices: {}, found: {} };
|
|
@@ -52,11 +57,15 @@ export async function createWebResearch({
|
|
|
52
57
|
return kept?.publicStatus().state === "configured" ? kept : createCodex({ environment, now });
|
|
53
58
|
}
|
|
54
59
|
const kept = previous?.backends[name] && previous.found[name]?.key === found[name]?.key;
|
|
55
|
-
|
|
60
|
+
if (kept) return previous.backends[name];
|
|
61
|
+
if (name === "moondog") return createMoondogWebResearch({ baseUrl: moondogModelUrl(environment), apiKey: found.moondog?.key, fetch, now });
|
|
62
|
+
return { deepseek: createDeepSeekWebResearch, brave: createBraveWebResearch }[name]({ apiKey: found[name]?.key, fetch, now });
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
async function load(previous) {
|
|
66
|
+
const invite = await readCode(environment).catch(() => null);
|
|
59
67
|
const found = {
|
|
68
|
+
moondog: invite?.code ? { key: invite.code, source: "your invite code" } : null,
|
|
60
69
|
deepseek: await readKey(credentials, environment, keys.deepseek),
|
|
61
70
|
brave: await readKey(credentials, environment, keys.brave),
|
|
62
71
|
};
|
|
@@ -89,7 +98,16 @@ export async function createWebResearch({
|
|
|
89
98
|
return names;
|
|
90
99
|
}
|
|
91
100
|
|
|
101
|
+
// Settings, an invite code or a key can change in another window or the terminal, so each call
|
|
102
|
+
// reads them again first. A backend whose key did not change is kept.
|
|
103
|
+
async function reload() {
|
|
104
|
+
const previous = current;
|
|
105
|
+
current = await load(previous);
|
|
106
|
+
for (const [name, entry] of Object.entries(previous.backends)) if (current.backends[name] !== entry) entry.close();
|
|
107
|
+
}
|
|
108
|
+
|
|
92
109
|
async function research(kind, input, options) {
|
|
110
|
+
await reload();
|
|
93
111
|
const first = backend(kind);
|
|
94
112
|
const name = current.choices[kind].name;
|
|
95
113
|
let failed;
|
|
@@ -116,6 +134,7 @@ export async function createWebResearch({
|
|
|
116
134
|
|
|
117
135
|
/** Each service, whether it is set up for each operation, and which one the role chose; for Settings. */
|
|
118
136
|
async function services() {
|
|
137
|
+
await reload();
|
|
119
138
|
const role = (await readRoles(environment).catch(() => ({}))).web_search?.service ?? null;
|
|
120
139
|
current.backends.codex ??= await backendFor("codex", current.found, null);
|
|
121
140
|
const codex = current.backends.codex.publicStatus().state === "configured";
|
|
@@ -174,9 +193,7 @@ export async function createWebResearch({
|
|
|
174
193
|
read: (input, options) => research("read", input, options),
|
|
175
194
|
/** Reads keys and settings again, after /auth or /reload. */
|
|
176
195
|
async refresh() {
|
|
177
|
-
|
|
178
|
-
current = await load(previous);
|
|
179
|
-
for (const [name, entry] of Object.entries(previous.backends)) if (current.backends[name] !== entry) entry.close();
|
|
196
|
+
await reload();
|
|
180
197
|
return publicStatus();
|
|
181
198
|
},
|
|
182
199
|
close: closeAll,
|
|
@@ -14,6 +14,7 @@ export const webLimits = Object.freeze({
|
|
|
14
14
|
|
|
15
15
|
// What each backend's text is, so the agent can tell a search engine's snippet from a model's summary.
|
|
16
16
|
const backends = Object.freeze({
|
|
17
|
+
moondog: { name: "Moondog", evidence: "provider_api_response", content: { search: "search_engine_results", read: "fetched_page_text" } },
|
|
17
18
|
codex_cli: { name: "Codex CLI", evidence: "native_web_operation_observed", content: { search: "model_generated_web_summary", read: "model_generated_web_summary" } },
|
|
18
19
|
deepseek: { name: "DeepSeek", evidence: "provider_api_response", content: { search: "search_engine_results", read: "fetched_page_text" } },
|
|
19
20
|
brave: { name: "Brave Search", evidence: "provider_api_response", content: { search: "search_engine_results" } },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Agent } from "@earendil-works/pi-agent-core";
|
|
2
|
-
import { createInitialSystemMessage, getCurrentSystemMessage, toToolDeclaration
|
|
2
|
+
import { createInitialSystemMessage, getCurrentSystemMessage, toToolDeclaration } from "@earendil-works/pi-ai";
|
|
3
|
+
import { Type } from "typebox";
|
|
3
4
|
import { readFileSync } from "node:fs";
|
|
4
5
|
import { LOCALES, messageLocale, translator } from "../../i18n/index.mjs";
|
|
5
6
|
import { PROFILE_SECTIONS, TRAJECTORIES } from "../../profile/profile-exploration.mjs";
|
|
@@ -7733,7 +7734,7 @@ export class PiAgentRuntime {
|
|
|
7733
7734
|
this.runtimeStatus = {
|
|
7734
7735
|
state: "configured",
|
|
7735
7736
|
adapter: "pi_agent_core",
|
|
7736
|
-
pi_version: "1.0
|
|
7737
|
+
pi_version: "1.6.0",
|
|
7737
7738
|
provider,
|
|
7738
7739
|
model: modelId,
|
|
7739
7740
|
...(effort ? { effort, thinking_level: thinkingLevel } : {}),
|
|
@@ -2,6 +2,7 @@ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
import { isMoondogProvider } from "./moondog-model.mjs";
|
|
5
6
|
import { resolveMoondogAuthFile } from "./persistent-credential-store.mjs";
|
|
6
7
|
|
|
7
8
|
// What each model is for, after Hermes Agent's main model and auxiliary tasks: one chat model answers,
|
|
@@ -12,6 +13,10 @@ import { resolveMoondogAuthFile } from "./persistent-credential-store.mjs";
|
|
|
12
13
|
//
|
|
13
14
|
// kind "model" is a provider and model from the catalog; kind "service" is a web service by id.
|
|
14
15
|
// A "planned" role holds its place in the settings and in this file, but nothing can choose it yet.
|
|
16
|
+
//
|
|
17
|
+
// Moondog's own model sees images and has Moondog's own web search, so choosing it as the chat model
|
|
18
|
+
// puts vision and web search back on auto, where both use Moondog's (see followChatModel). The
|
|
19
|
+
// listener can choose others again after.
|
|
15
20
|
export const MODEL_ROLES = Object.freeze([
|
|
16
21
|
Object.freeze({ id: "chat", kind: "model", state: "enabled", stored: "settings" }),
|
|
17
22
|
Object.freeze({ id: "vision", kind: "model", state: "enabled", input: "image" }),
|
|
@@ -19,7 +24,7 @@ export const MODEL_ROLES = Object.freeze([
|
|
|
19
24
|
Object.freeze({ id: "audio", kind: "model", state: "planned", input: "audio" }),
|
|
20
25
|
]);
|
|
21
26
|
|
|
22
|
-
export const WEB_SERVICES = Object.freeze(["deepseek", "brave", "codex"]);
|
|
27
|
+
export const WEB_SERVICES = Object.freeze(["moondog", "deepseek", "brave", "codex"]);
|
|
23
28
|
|
|
24
29
|
const ROLES_VERSION = 1;
|
|
25
30
|
const printable = (value, max) => typeof value === "string" && value.length > 0 && value.length <= max && !/[\p{C}\s]/u.test(value);
|
|
@@ -91,6 +96,18 @@ export async function readModelRoles(environment = process.env) {
|
|
|
91
96
|
return roles;
|
|
92
97
|
}
|
|
93
98
|
|
|
99
|
+
/**
|
|
100
|
+
* The roles a new chat model brings with it. Moondog's own model puts vision and web search on auto,
|
|
101
|
+
* where vision uses the model itself and web search Moondog's own. Returns the roles it changed.
|
|
102
|
+
*/
|
|
103
|
+
export async function followChatModel(selection, environment = process.env) {
|
|
104
|
+
if (!isMoondogProvider(selection?.provider)) return [];
|
|
105
|
+
const saved = await readModelRoles(environment).catch(() => ({}));
|
|
106
|
+
const changed = ["vision", "web_search"].filter((roleId) => saved[roleId]);
|
|
107
|
+
for (const roleId of changed) await writeModelRole(roleId, null, environment);
|
|
108
|
+
return changed;
|
|
109
|
+
}
|
|
110
|
+
|
|
94
111
|
// One change at a time, so two quick choices never lose either.
|
|
95
112
|
let writing = Promise.resolve();
|
|
96
113
|
/** Saves one role's choice; null puts it back on auto. */
|
|
@@ -10,7 +10,7 @@ import { isEndpointProvider, removeEndpoint, saveEndpoint } from "./custom-endpo
|
|
|
10
10
|
import { LEGACY_MODEL_ALIASES } from "./model-catalog.mjs";
|
|
11
11
|
import { readConversationModels, readModelList, sameModel, writeConversationModel, writeModelList } from "./model-list.mjs";
|
|
12
12
|
import { isMoondogProvider, MOONDOG_MODEL, MOONDOG_PROVIDER, removeInvite, saveInvite } from "./moondog-model.mjs";
|
|
13
|
-
import { MODEL_ROLES, modelRole, readModelRoles, writeModelRole } from "./model-roles.mjs";
|
|
13
|
+
import { followChatModel, MODEL_ROLES, modelRole, readModelRoles, writeModelRole } from "./model-roles.mjs";
|
|
14
14
|
import { chatgptProviderId } from "./provider-registry.mjs";
|
|
15
15
|
import { createPersistentCredentialStore } from "./persistent-credential-store.mjs";
|
|
16
16
|
import { getPublicPiModelCatalog } from "./public-model-catalog.mjs";
|
|
@@ -254,6 +254,16 @@ export function createModelSettings({
|
|
|
254
254
|
}
|
|
255
255
|
},
|
|
256
256
|
|
|
257
|
+
// A new default chat model brings its roles with it: Moondog's own puts vision and web search on
|
|
258
|
+
// auto, where both use Moondog's. Returns the roles it changed.
|
|
259
|
+
async followChat(selection) {
|
|
260
|
+
try {
|
|
261
|
+
return await followChatModel(selection, environment);
|
|
262
|
+
} catch (error) {
|
|
263
|
+
throw moondogError(error) ?? failure("model_roles_invalid", "Moondog could not save its model roles.");
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
|
|
257
267
|
// The model each conversation was given in the window's menu, and a change to one: null gives a
|
|
258
268
|
// conversation back to the default.
|
|
259
269
|
conversationModels: () => readConversationModels(environment),
|
|
@@ -274,6 +284,22 @@ export function createModelSettings({
|
|
|
274
284
|
}
|
|
275
285
|
},
|
|
276
286
|
|
|
287
|
+
// Puts the menu's models in the order given. A model the order leaves out keeps its place after
|
|
288
|
+
// the ones it names, and a model the menu lacks is not added.
|
|
289
|
+
async setOrder(order) {
|
|
290
|
+
const entries = await menu(await current());
|
|
291
|
+
const wanted = (Array.isArray(order) ? order : [])
|
|
292
|
+
.map(entry => ({ provider: String(entry?.provider ?? "").trim().toLowerCase(), model: String(entry?.model ?? "").trim() }))
|
|
293
|
+
.map(entry => entries.find(kept => sameModel(kept, entry)))
|
|
294
|
+
.filter(Boolean);
|
|
295
|
+
const next = [...wanted, ...entries.filter(entry => !wanted.some(kept => sameModel(kept, entry)))];
|
|
296
|
+
try {
|
|
297
|
+
await writeModelList(next, environment);
|
|
298
|
+
} catch (error) {
|
|
299
|
+
throw moondogError(error) ?? failure("model_list_invalid", "Moondog could not save its model list.");
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
|
|
277
303
|
// A new endpoint whose model IDs were typed goes straight into the menu with them; listed ones
|
|
278
304
|
// wait to be chosen, since an endpoint such as OpenRouter lists hundreds.
|
|
279
305
|
async saveEndpoint(input) {
|
|
@@ -295,7 +321,7 @@ export function createModelSettings({
|
|
|
295
321
|
// Saves an invite code for Moondog's own model once the gateway takes it, and puts the model in
|
|
296
322
|
// the menu. It becomes the default when no model is chosen yet or the chosen one can't answer,
|
|
297
323
|
// so a listener with only a code can talk at once. Returns { label, dailyTokens, usedToday,
|
|
298
|
-
// becameDefault }, never the code.
|
|
324
|
+
// becameDefault }, never the code. As the default, it brings its vision and web search along.
|
|
299
325
|
async saveInvite(value) {
|
|
300
326
|
let allowance;
|
|
301
327
|
try {
|
|
@@ -310,7 +336,10 @@ export function createModelSettings({
|
|
|
310
336
|
const answers = Boolean(selection) && Boolean(await withAuth(source).checkAuth(selection.provider).catch(() => undefined));
|
|
311
337
|
const becameDefault = !answers;
|
|
312
338
|
try {
|
|
313
|
-
if (becameDefault)
|
|
339
|
+
if (becameDefault) {
|
|
340
|
+
await writePiRuntimeSelection(own, environment);
|
|
341
|
+
await followChatModel(own, environment);
|
|
342
|
+
}
|
|
314
343
|
const entries = await menu(becameDefault ? own : selection);
|
|
315
344
|
await writeModelList(entries.some(entry => sameModel(entry, own)) ? entries : [...entries, own].slice(0, 40), environment);
|
|
316
345
|
} catch (error) {
|
|
@@ -132,7 +132,8 @@ export function addMoondogModel(models, invite, environment = process.env) {
|
|
|
132
132
|
id: MOONDOG_PROVIDER, name: "Moondog", baseUrl,
|
|
133
133
|
models: [{
|
|
134
134
|
id: MOONDOG_MODEL, name: "Moondog", provider: MOONDOG_PROVIDER, api: "openai-completions", baseUrl,
|
|
135
|
-
|
|
135
|
+
// The gateway passes images through, so vision on auto is the model itself.
|
|
136
|
+
reasoning: false, input: ["text", "image"],
|
|
136
137
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
137
138
|
contextWindow: 128_000, maxTokens: 8192,
|
|
138
139
|
}],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LOCALES } from "../../i18n/index.mjs";
|
|
2
2
|
import { Agent } from "@earendil-works/pi-agent-core";
|
|
3
|
-
import { Type } from "
|
|
3
|
+
import { Type } from "typebox";
|
|
4
4
|
import { createConfiguredRuntime } from "./configured-runtime.mjs";
|
|
5
5
|
import { createModelConnectionError, createModelFetch, isModelConnectionFailure, safeProviderErrorMessage } from "./model-transport.mjs";
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ import { addMoondogModel, readInvite } from "./moondog-model.mjs";
|
|
|
8
8
|
import { acquirePrivateFileLock, resolveMoondogAuthFile } from "./persistent-credential-store.mjs";
|
|
9
9
|
import { supportedPiProviderIds } from "./provider-registry.mjs";
|
|
10
10
|
|
|
11
|
-
export const PI_CATALOG_VERSION = "1.0
|
|
11
|
+
export const PI_CATALOG_VERSION = "1.6.0";
|
|
12
12
|
const MAX_BYTES = 2 * 1024 * 1024;
|
|
13
13
|
const MAX_MODELS = 2000;
|
|
14
14
|
const FRESH_MS = 4 * 60 * 60 * 1000;
|
|
@@ -383,7 +383,7 @@ export class RecordSleeve {
|
|
|
383
383
|
};
|
|
384
384
|
if (rows < 7 || width < 34 || this.artMode === "off") {
|
|
385
385
|
const compact = withNote([hang(theme.bold("MOONDOG ◎")),
|
|
386
|
-
...(rows >= 9 && width >= 30 ? [hang(theme.muted(tr("
|
|
386
|
+
...(rows >= 9 && width >= 30 ? [hang(theme.muted(tr("On the air, just for you."))), ""] : []),
|
|
387
387
|
...tracklist(theme, { focused, selected, columns: width }),
|
|
388
388
|
], Math.max(1, width - 2), rows);
|
|
389
389
|
const top = Math.max(0, Math.floor((rows - compact.length) / 2));
|
|
@@ -395,7 +395,7 @@ export class RecordSleeve {
|
|
|
395
395
|
? renderMoondogWordmark().map(theme.text) : [theme.bold(roomy ? "M O O N D O G" : "MOONDOG")];
|
|
396
396
|
const copyBlock = (columns, budget, roomy, note = true, reserve = roomy) => (note ? withNote : (lines) => lines)([
|
|
397
397
|
...title(columns, budget, roomy).map(hang),
|
|
398
|
-
...(budget >= 12 ? [...wrapDescription(tr("
|
|
398
|
+
...(budget >= 12 ? [...wrapDescription(tr("On the air, just for you."), columns).map((line) => hang(theme.muted(line))), ""] : [""]),
|
|
399
399
|
...tracklist(theme, { focused, selected, columns: columns + 2 }),
|
|
400
400
|
...(reserve ? ["", ...actionNote(focused ? homeActions[selected].description : "", columns).map((line) => hang(theme.muted(line)))] : []),
|
|
401
401
|
], columns, budget);
|
|
@@ -160,7 +160,7 @@ export function withCommandCompletions(commands, {
|
|
|
160
160
|
.map((provider) => ({ value: provider.id, label: provider.id, description: provider.name })) : [],
|
|
161
161
|
},
|
|
162
162
|
model: {
|
|
163
|
-
argumentHint: "[provider] [model] | refresh [provider] | roles | vision auto|<provider> <model> | web auto|deepseek|brave|codex",
|
|
163
|
+
argumentHint: "[provider] [model] | refresh [provider] | roles | vision auto|<provider> <model> | web auto|moondog|deepseek|brave|codex",
|
|
164
164
|
choices: (previous) => {
|
|
165
165
|
const available = providers().filter((provider) => provider.modelCount > 0);
|
|
166
166
|
const asChoice = (provider) => ({ value: provider.id, label: provider.id, description: provider.name });
|
|
@@ -5,7 +5,7 @@ import { MODEL_ROLES, WEB_SERVICES } from "../../runtime/pi/model-roles.mjs";
|
|
|
5
5
|
export const MODEL_ROLE_WORDS = Object.freeze({ roles: null, vision: "vision", web: "web_search", audio: "audio" });
|
|
6
6
|
|
|
7
7
|
const titles = { chat: "Chat", vision: "Vision", web_search: "Web search", audio: "Audio" };
|
|
8
|
-
const usage = "Usage: /model roles, /model vision auto|<provider> <model>, or /model web auto|deepseek|brave|codex.";
|
|
8
|
+
const usage = "Usage: /model roles, /model vision auto|<provider> <model>, or /model web auto|moondog|deepseek|brave|codex.";
|
|
9
9
|
|
|
10
10
|
const modelName = (choice) => `${choice.name ?? choice.model} (${choice.providerName ?? choice.provider})`;
|
|
11
11
|
|
|
@@ -29,7 +29,7 @@ export function formatModelRoles(roles) {
|
|
|
29
29
|
const lines = roles.map((role) => `- ${titles[role.id] ?? role.id}: ${describe(role)}`);
|
|
30
30
|
return `# Chat and auxiliary models\n\n${lines.join("\n")}\n\n` +
|
|
31
31
|
"`/model vision <provider> <model>` gives images a model of their own, and `/model vision auto` gives them back to the chat model when it can see.\n" +
|
|
32
|
-
"`/model web deepseek|brave|codex` picks the web search service, and `/model web auto` takes the first one set up.";
|
|
32
|
+
"`/model web moondog|deepseek|brave|codex` picks the web search service, and `/model web auto` takes the first one set up.";
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export async function runModelRolesCommand({ args = [], modelSettings, webResearch } = {}) {
|
package/src/surfaces/cli/tui.mjs
CHANGED
|
@@ -25,6 +25,7 @@ import { serviceKeyProviders, supportedAuthProviderIds } from "../../runtime/pi/
|
|
|
25
25
|
import { EFFORT_LEVELS, EFFORT_SCALE } from "../../runtime/pi/runtime-settings.mjs";
|
|
26
26
|
import { runtimeBehindSelection } from "../../runtime/pi/runtime-selection.mjs";
|
|
27
27
|
import { MODEL_ROLE_WORDS } from "./model-roles-command.mjs";
|
|
28
|
+
import { followChatModel } from "../../runtime/pi/model-roles.mjs";
|
|
28
29
|
import { imagesFromText } from "../../runtime/pi/image-input.mjs";
|
|
29
30
|
import {
|
|
30
31
|
formatLocalResult,
|
|
@@ -1582,6 +1583,8 @@ export async function runMoondogTui({
|
|
|
1582
1583
|
setBusy(true);
|
|
1583
1584
|
setFooter(tr("Loading {model}...", { model: `${providerId}/${modelId}` }));
|
|
1584
1585
|
const status = await replaceRuntime(runtimeSelection(providerId, modelId, runtimeStatus.effort));
|
|
1586
|
+
// Moondog's own model brings its vision and web search, as choosing it in the window does.
|
|
1587
|
+
const followed = await followChatModel({ provider: providerId, model: modelId }, environment).catch(() => []);
|
|
1585
1588
|
say(
|
|
1586
1589
|
status.state === "configured"
|
|
1587
1590
|
? tr("Now talking through `{model}`. This conversation and what I remember carry over.", { model: `${providerId}/${modelId}` })
|
|
@@ -1589,6 +1592,7 @@ export async function runMoondogTui({
|
|
|
1589
1592
|
? tr("Saved `{model}`, but you're not signed in yet. Run `/auth {provider}` to connect it.", { model: `${providerId}/${modelId}`, provider: providerId })
|
|
1590
1593
|
: tr("Saved `{model}`, but I can't reach it yet (`{reason}`).", { model: `${providerId}/${modelId}`, reason: status.reason }),
|
|
1591
1594
|
);
|
|
1595
|
+
if (followed.length) say(tr("Vision and web search are back on auto, where Moondog sees images and searches the web itself. `/model roles` shows them."));
|
|
1592
1596
|
setFooter(
|
|
1593
1597
|
status.state === "configured" ? tr("Model ready.") : tr("Model saved, not connected yet."),
|
|
1594
1598
|
status.state === "configured" ? success : warning,
|