@mercury-fw/cli 0.65.1 → 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 CHANGED
@@ -1,5 +1,22 @@
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
+
3
20
  ## 0.65.1
4
21
 
5
22
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercury-fw/cli",
3
- "version": "0.65.1",
3
+ "version": "0.66.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,8 +41,8 @@
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.65.1",
45
- "@mercury-fw/utils": "0.65.1",
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": {
@@ -51,7 +51,7 @@
51
51
  "@mercury-fw/channel-google-chat": "0.11.1",
52
52
  "@mercury-fw/channel-http": "0.14.1",
53
53
  "@mercury-fw/directory-static": "0.1.2",
54
- "@mercury-fw/formatter": "0.65.1",
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,6 +59,18 @@ 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",
@@ -223,7 +239,7 @@ function renderConfig(
223
239
  ): string {
224
240
  const withRules = tools.filter((t) => t.formatter);
225
241
  const imports = [
226
- 'import { defineMercuryConfig } from "@mercury-fw/core";',
242
+ 'import { defineMercuryConfig, envBoolean, envNumber } from "@mercury-fw/core";',
227
243
  'import en from "./locales/en.json";',
228
244
  'import pkg from "./package.json";',
229
245
  ];
@@ -260,6 +276,7 @@ function renderConfig(
260
276
  channelList,
261
277
  ...(auth ? [` auth: ${auth.exportName},`] : []),
262
278
  ...(directory ? [` directory: ${directory.exportName},`] : []),
279
+ MODEL_SECTION,
263
280
  " i18n: { locales: { en } },",
264
281
  VERSION_COMMENT,
265
282
  " version: pkg.version,",
@@ -431,7 +448,7 @@ ${auth ? `- Auth: ${auth.id}\n` : ""}- Tool plugins: ${list(tools)}
431
448
  ${directory ? `- Directory: ${directory.id}\n` : ""}
432
449
  ## Layout
433
450
 
434
- - \`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 changes it, and a new one shows once the app is rebuilt. Remove the line to show none.
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.
435
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.
436
453
  - \`src/index.ts\`: the service (channels, crons). \`src/repl.ts\`: an interactive terminal for trying things out.
437
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.