@mercury-fw/cli 0.59.2 → 0.60.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,16 @@
1
1
  # @mercury-fw/cli
2
2
 
3
+ ## 0.60.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4ac0457: Scaffolded apps now install with Bun's isolated linker (the default when workspaces are present). The Dockerfile's PATH step follows symlinks (`find -L`) so the CLI plugins' binaries are linked as before. The `bunfig.toml` that forced the hoisted layout is gone from new apps; existing apps keep theirs.
8
+
9
+ ### Patch Changes
10
+
11
+ - @mercury-fw/core@0.60.0
12
+ - @mercury-fw/utils@0.60.0
13
+
3
14
  ## 0.59.2
4
15
 
5
16
  ### Patch Changes
package/README.md CHANGED
@@ -53,7 +53,7 @@ Writes a new Mercury app into `<folder>`, which has to be missing or empty; the
53
53
  - which channels and which tool plugins to include (none is fine: the REPL always works);
54
54
  - the git remote for `origin`, which you can leave empty (most of the time it doesn't exist yet when you scaffold).
55
55
 
56
- It writes the `mercury.config.ts` for that selection, the persona, a `locales/` folder with an `en.json` for the texts people see (empty, or the starting formatter rules' own texts: `app.jira.no-issues` with Jira), the service and REPL entrypoints, a Dockerfile, a compose file with Qdrant, and an env example listing every variable the chosen pieces read. Its `package.json` declares `plugins/*` as workspaces, the place for the app's own plugins (each a package in `plugins/<name>`, which the image copies before installing), and a `test` script (`bun test`, the plugins' tests included); `bunfig.toml` keeps Bun's hoisted `node_modules`, which the workspaces would otherwise turn into links. A plugin that hands over lists comes wrapped in the formatter with a starting rule, yours to change.
56
+ It writes the `mercury.config.ts` for that selection, the persona, a `locales/` folder with an `en.json` for the texts people see (empty, or the starting formatter rules' own texts: `app.jira.no-issues` with Jira), the service and REPL entrypoints, a Dockerfile, a compose file with Qdrant, and an env example listing every variable the chosen pieces read. Its `package.json` declares `plugins/*` as workspaces, the place for the app's own plugins (each a package in `plugins/<name>`, which the image copies before installing), and a `test` script (`bun test`, the plugins' tests included); the workspaces make Bun install with its isolated linker, and the Dockerfile's PATH step follows the links it makes. A plugin that hands over lists comes wrapped in the formatter with a starting rule, yours to change.
57
57
 
58
58
  Then it runs `bun install` in the app and creates a git repository on `main` with a first commit (`bun.lock` included), adding `origin` when you gave one; nothing is pushed. Each step is best effort and never undoes the ones before it: an install that fails still leaves the app committed, without the lockfile, and the closing message says what to run. The repository is skipped when the folder is already inside one (an app created in a monorepo belongs to it). Whether git can commit is git's call: when it refuses (no identity, a hook) or isn't installed, the message reports why and lists the commands to finish by hand. `bun install` prints its own output as it runs.
59
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercury-fw/cli",
3
- "version": "0.59.2",
3
+ "version": "0.60.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.59.2",
45
- "@mercury-fw/utils": "0.59.2",
44
+ "@mercury-fw/core": "0.60.0",
45
+ "@mercury-fw/utils": "0.60.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.13.1",
53
53
  "@mercury-fw/directory-static": "0.1.2",
54
- "@mercury-fw/formatter": "0.59.2",
54
+ "@mercury-fw/formatter": "0.60.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-jira": "0.8.1",
package/src/render.ts CHANGED
@@ -13,7 +13,6 @@ import { CATALOG, type CatalogEntry, type EnvVar } from "./catalog.ts";
13
13
  import indexTs from "../template/src/index.ts.tpl" with { type: "text" };
14
14
  import replTs from "../template/src/repl.ts.tpl" with { type: "text" };
15
15
  import tsconfigJson from "../template/tsconfig.json.tpl" with { type: "text" };
16
- import bunfigToml from "../template/bunfig.toml.tpl" with { type: "text" };
17
16
  import gitignore from "../template/gitignore.tpl" with { type: "text" };
18
17
  import dockerignore from "../template/dockerignore.tpl" with { type: "text" };
19
18
  import dockerfile from "../template/Dockerfile.tpl" with { type: "text" };
@@ -86,7 +85,6 @@ export function renderApp(input: RenderInput): Map<string, string> {
86
85
  [".gitignore", gitignore],
87
86
  ["Dockerfile", dockerfile],
88
87
  ["README.md", renderReadme(input.name, channels, auth, tools, directory)],
89
- ["bunfig.toml", bunfigToml],
90
88
  ["docker-compose.yml", renderCompose(input.name, channels.some((c) => c.id === "http"), services)],
91
89
  ["locales/en.json", renderEnglish(tools)],
92
90
  ["mercury.config.ts", renderConfig(assistantName, input.role, channels, auth, tools, directory)],
@@ -423,7 +421,6 @@ ${directory ? `- Directory: ${directory.id}\n` : ""}
423
421
  - \`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.
424
422
  - \`src/index.ts\`: the service (channels, crons). \`src/repl.ts\`: an interactive terminal for trying things out.
425
423
  - \`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.
426
- - \`bunfig.toml\`: keeps Bun's hoisted \`node_modules\`, which the workspaces would otherwise turn into links the image's PATH step doesn't follow. Keep it.
427
424
  - \`.env.example\`: every variable the app reads. Copy it to \`.env\` and fill it in.
428
425
 
429
426
  ## Running it
@@ -15,15 +15,16 @@ WORKDIR /app
15
15
  # package.json's trustedDependencies); the binaries go on PATH. .packs/ holds
16
16
  # local tarballs when the app installs them (mfw local-packages), plugins/ the
17
17
  # app's own plugins (workspaces, whose postinstall needs their whole folder),
18
- # and each is skipped when it isn't there. bunfig.toml keeps Bun's hoisted
19
- # node_modules, which the workspaces would otherwise turn into symlinks.
20
- COPY --chown=mercury:mercury package.json bun.lock* bunfig.toml ./
18
+ # and each is skipped when it isn't there.
19
+ COPY --chown=mercury:mercury package.json bun.lock* ./
21
20
  COPY --chown=mercury:mercury .pack[s] ./.packs/
22
21
  COPY --chown=mercury:mercury plugin[s] ./plugins/
23
22
  RUN bun install --production && chown -R mercury:mercury node_modules
24
- # plugins/ made when the app has none, or find fails on it.
23
+ # plugins/ made when the app has none, or find fails on it. -L follows the
24
+ # symlinks of Bun's isolated linker, so the binaries inside node_modules/.bun
25
+ # are found through the package links.
25
26
  RUN mkdir -p /app/plugins \
26
- && find /app/node_modules/@mercury-fw /app/plugins -mindepth 3 -maxdepth 3 -path '*/bin/*' -type f -exec ln -sf {} /usr/local/bin/ \;
27
+ && find -L /app/node_modules/@mercury-fw /app/plugins -mindepth 3 -maxdepth 3 -path '*/bin/*' -type f -exec ln -sf {} /usr/local/bin/ \;
27
28
 
28
29
  COPY --chown=mercury:mercury mercury.config.ts ./
29
30
  COPY --chown=mercury:mercury locales ./locales
@@ -1,2 +0,0 @@
1
- [install]
2
- linker = "hoisted"