@mercury-fw/cli 0.65.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/package.json +5 -5
- package/src/render.ts +21 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @mercury-fw/cli
|
|
2
2
|
|
|
3
|
+
## 0.66.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f21aed8: - add `model` to `mercury.config.ts`: `think`, `temperature`, `topP`, `topK` for the main model, every call on it; a field left out uses the model's own value
|
|
8
|
+
- export `envNumber` and `envBoolean`: a config field's value from an environment variable, with a fallback
|
|
9
|
+
- the startup log names the model and its settings (`[model] <name>: think on, temperature 0.2`)
|
|
10
|
+
- `mfw create`: new apps declare `model` from `OLLAMA_THINK`, `OLLAMA_TEMPERATURE`, `OLLAMA_TOP_P`, `OLLAMA_TOP_K`, listed empty in the env example
|
|
11
|
+
- **Breaking:** the core no longer reads `OLLAMA_THINK`: set `model.think` in the config
|
|
12
|
+
- **Migration:** add to `mercury.config.ts` `import { envBoolean, envNumber } from "@mercury-fw/core";` and `model: { think: envBoolean("OLLAMA_THINK", true), temperature: envNumber("OLLAMA_TEMPERATURE"), topP: envNumber("OLLAMA_TOP_P"), topK: envNumber("OLLAMA_TOP_K") },`; add `OLLAMA_TEMPERATURE=`, `OLLAMA_TOP_P=`, `OLLAMA_TOP_K=` to the env example
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [f21aed8]
|
|
17
|
+
- @mercury-fw/core@0.66.0
|
|
18
|
+
- @mercury-fw/utils@0.66.0
|
|
19
|
+
|
|
20
|
+
## 0.65.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 9b2e1bf: - `mfw create`: the comment above the config's `version` and the app's README say what it shows, and no longer how to move the number: that's the app's own business.
|
|
25
|
+
- The `version` field's description says Mercury never changes it, with no advice on who does.
|
|
26
|
+
- Updated dependencies [9b2e1bf]
|
|
27
|
+
- @mercury-fw/core@0.65.1
|
|
28
|
+
- @mercury-fw/utils@0.65.1
|
|
29
|
+
|
|
3
30
|
## 0.65.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercury-fw/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"comment:shape": "The Mercury CLI (`mfw`). `mfw create <dir>` writes a new Mercury app from the template. The framework packages move in lockstep with it, so a new app gets them at the CLI's own version; plugins and channels at the registry's latest. The plugin and channel packages are devDependencies only for the catalog test. `main(argv)` is exported for create-mercury-agent.",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@clack/prompts": "^1.8.1",
|
|
44
|
-
"@mercury-fw/core": "0.
|
|
45
|
-
"@mercury-fw/utils": "0.
|
|
44
|
+
"@mercury-fw/core": "0.66.0",
|
|
45
|
+
"@mercury-fw/utils": "0.66.0",
|
|
46
46
|
"commander": "^15.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@mercury-fw/auth-oidc": "0.2.1",
|
|
50
50
|
"@mercury-fw/auth-static": "0.2.2",
|
|
51
51
|
"@mercury-fw/channel-google-chat": "0.11.1",
|
|
52
|
-
"@mercury-fw/channel-http": "0.14.
|
|
52
|
+
"@mercury-fw/channel-http": "0.14.1",
|
|
53
53
|
"@mercury-fw/directory-static": "0.1.2",
|
|
54
|
-
"@mercury-fw/formatter": "0.
|
|
54
|
+
"@mercury-fw/formatter": "0.66.0",
|
|
55
55
|
"@mercury-fw/plugin-atlassian-admin": "0.5.1",
|
|
56
56
|
"@mercury-fw/plugin-bitbucket": "0.6.1",
|
|
57
57
|
"@mercury-fw/plugin-confluence": "0.1.0",
|
package/src/render.ts
CHANGED
|
@@ -45,6 +45,10 @@ const CORE_ENV: EnvVar[] = [
|
|
|
45
45
|
value: "http://host.docker.internal:11434",
|
|
46
46
|
},
|
|
47
47
|
{ name: "OLLAMA_MODEL", comment: "Chat model the assistant runs on" },
|
|
48
|
+
{ name: "OLLAMA_THINK", comment: "false for a chat model that doesn't support thinking (empty: on)" },
|
|
49
|
+
{ name: "OLLAMA_TEMPERATURE", comment: "The chat model's temperature, from 0 up (empty: the model's own)" },
|
|
50
|
+
{ name: "OLLAMA_TOP_P", comment: "The chat model's top_p, above 0 and at most 1 (empty: the model's own)" },
|
|
51
|
+
{ name: "OLLAMA_TOP_K", comment: "The chat model's top_k, a whole number from 1 up (empty: the model's own)" },
|
|
48
52
|
{ name: "OLLAMA_EMBEDDING_MODEL", comment: "Embedding model for the episodic memory", value: "nomic-embed-text" },
|
|
49
53
|
{ name: "QDRANT_URL", comment: "Qdrant, the compose service", value: "http://qdrant:6333" },
|
|
50
54
|
{ name: "WIKI_VAULT_PATH", comment: "Wiki vault, the named volume's mount point", value: "/app/wiki-vault" },
|
|
@@ -55,12 +59,23 @@ const CORE_ENV: EnvVar[] = [
|
|
|
55
59
|
},
|
|
56
60
|
];
|
|
57
61
|
|
|
62
|
+
/** The config's `model` section: the main model's settings, each from its env variable (#355). */
|
|
63
|
+
const MODEL_SECTION = [
|
|
64
|
+
" // How the main model generates, each value from .env: left empty, the",
|
|
65
|
+
" // model's own applies (thinking stays on).",
|
|
66
|
+
" model: {",
|
|
67
|
+
' think: envBoolean("OLLAMA_THINK", true),',
|
|
68
|
+
' temperature: envNumber("OLLAMA_TEMPERATURE"),',
|
|
69
|
+
' topP: envNumber("OLLAMA_TOP_P"),',
|
|
70
|
+
' topK: envNumber("OLLAMA_TOP_K"),',
|
|
71
|
+
" },",
|
|
72
|
+
].join("\n");
|
|
73
|
+
|
|
58
74
|
/** Above the config's `version`: what it does, and what it doesn't. */
|
|
59
75
|
const VERSION_COMMENT = [
|
|
60
76
|
" // The app's version, from package.json: GET /version shows it next to the",
|
|
61
|
-
" // framework's, to anyone (no token). Mercury never
|
|
62
|
-
" //
|
|
63
|
-
" // line to show none.",
|
|
77
|
+
" // framework's, to anyone (no token). Mercury never changes it, and a new",
|
|
78
|
+
" // one shows once the app is rebuilt. Remove this line to show none.",
|
|
64
79
|
].join("\n");
|
|
65
80
|
|
|
66
81
|
const CONFIG_HEADER = `/**
|
|
@@ -224,7 +239,7 @@ function renderConfig(
|
|
|
224
239
|
): string {
|
|
225
240
|
const withRules = tools.filter((t) => t.formatter);
|
|
226
241
|
const imports = [
|
|
227
|
-
'import { defineMercuryConfig } from "@mercury-fw/core";',
|
|
242
|
+
'import { defineMercuryConfig, envBoolean, envNumber } from "@mercury-fw/core";',
|
|
228
243
|
'import en from "./locales/en.json";',
|
|
229
244
|
'import pkg from "./package.json";',
|
|
230
245
|
];
|
|
@@ -261,6 +276,7 @@ function renderConfig(
|
|
|
261
276
|
channelList,
|
|
262
277
|
...(auth ? [` auth: ${auth.exportName},`] : []),
|
|
263
278
|
...(directory ? [` directory: ${directory.exportName},`] : []),
|
|
279
|
+
MODEL_SECTION,
|
|
264
280
|
" i18n: { locales: { en } },",
|
|
265
281
|
VERSION_COMMENT,
|
|
266
282
|
" version: pkg.version,",
|
|
@@ -432,7 +448,7 @@ ${auth ? `- Auth: ${auth.id}\n` : ""}- Tool plugins: ${list(tools)}
|
|
|
432
448
|
${directory ? `- Directory: ${directory.id}\n` : ""}
|
|
433
449
|
## Layout
|
|
434
450
|
|
|
435
|
-
- \`mercury.config.ts\`: what the app is made of (tool plugins, channels, how their lists read) and the assistant's persona: its name, who it is and how it answers. Edit them freely. Its \`version\` is the one in \`package.json\`, which the HTTP channel's \`GET /version\` shows to anyone, no token needed: Mercury never
|
|
451
|
+
- \`mercury.config.ts\`: what the app is made of (tool plugins, channels, how their lists read) and the assistant's persona: its name, who it is and how it answers. Edit them freely. Its \`model\` section is how the chat model generates (thinking, temperature, top_p, top_k), each value from \`.env\`: left empty, the model's own applies. Its \`version\` is the one in \`package.json\`, which the HTTP channel's \`GET /version\` shows to anyone, no token needed: Mercury never changes it, and a new one shows once the app is rebuilt. Remove the line to show none.
|
|
436
452
|
- \`locales/\`: the texts people see, one file per language the assistant speaks. \`en.json\` overrides the English ones; add \`it.json\` (and \`it\` to \`i18n.locales\` in the config) for Italian, \`i18n.defaultLocale\` for the language people get when they haven't picked one, \`i18n.timeZone\` (an IANA name such as \`Europe/Rome\`) for the time zone of whoever saved none and whose app says none. The app's own texts (a formatter rule's) are \`app.\` keys, written in English in \`en.json\` and translated in every other file. Mercury logs at startup the keys a file is missing.
|
|
437
453
|
- \`src/index.ts\`: the service (channels, crons). \`src/repl.ts\`: an interactive terminal for trying things out.
|
|
438
454
|
- \`plugins/\`: the app's own plugins, when it has any: each one a package in a folder of its own (\`plugins/<name>\`, a workspace), listed in \`dependencies\` as \`workspace:*\` and declared in \`mercury.config.ts\`. \`bun run test\` runs their tests.
|