@mercury-fw/cli 0.59.1 → 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 +21 -0
- package/README.md +3 -1
- package/package.json +15 -15
- package/src/render.ts +0 -3
- package/template/Dockerfile.tpl +6 -5
- package/template/bunfig.toml.tpl +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
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
|
+
|
|
14
|
+
## 0.59.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- f631dd5: README: a link to the package's page on Mercury's documentation site (https://lucabro81.github.io/mercury-fw/), published from this release on. The HTTP channel's README points to the HTTP API reference there, and the core's memory section to the page that explains it.
|
|
19
|
+
- Updated dependencies [f631dd5]
|
|
20
|
+
- Updated dependencies [3b67dd6]
|
|
21
|
+
- @mercury-fw/core@0.59.2
|
|
22
|
+
- @mercury-fw/utils@0.59.2
|
|
23
|
+
|
|
3
24
|
## 0.59.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`mfw`, the command-line tool of [Mercury](https://github.com/lucabro81/mercury-fw): it creates an app, then runs it. Every command except `create` works from inside an app, meaning its folder or any folder under it (the one holding `mercury.config.ts`), and wraps the `docker compose` calls that app needs, so you don't have to remember them; each section below says which calls those are. New commands get documented here as they're added.
|
|
4
4
|
|
|
5
|
+
On Mercury's documentation site: [the `mfw` reference](https://lucabro81.github.io/mercury-fw/reference/cli/).
|
|
6
|
+
|
|
5
7
|
## Table of contents
|
|
6
8
|
|
|
7
9
|
- [Getting it](#getting-it)
|
|
@@ -51,7 +53,7 @@ Writes a new Mercury app into `<folder>`, which has to be missing or empty; the
|
|
|
51
53
|
- which channels and which tool plugins to include (none is fine: the REPL always works);
|
|
52
54
|
- the git remote for `origin`, which you can leave empty (most of the time it doesn't exist yet when you scaffold).
|
|
53
55
|
|
|
54
|
-
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);
|
|
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.
|
|
55
57
|
|
|
56
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.
|
|
57
59
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercury-fw/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,24 +41,24 @@
|
|
|
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.60.0",
|
|
45
|
+
"@mercury-fw/utils": "0.60.0",
|
|
46
46
|
"commander": "^15.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@mercury-fw/auth-oidc": "0.2.
|
|
50
|
-
"@mercury-fw/auth-static": "0.2.
|
|
51
|
-
"@mercury-fw/channel-google-chat": "0.11.
|
|
52
|
-
"@mercury-fw/channel-http": "0.13.
|
|
53
|
-
"@mercury-fw/directory-static": "0.1.
|
|
54
|
-
"@mercury-fw/formatter": "0.
|
|
55
|
-
"@mercury-fw/plugin-atlassian-admin": "0.5.
|
|
56
|
-
"@mercury-fw/plugin-bitbucket": "0.6.
|
|
57
|
-
"@mercury-fw/plugin-jira": "0.8.
|
|
58
|
-
"@mercury-fw/plugin-web-search": "0.4.
|
|
59
|
-
"@mercury-fw/plugin-zitadel": "0.5.
|
|
49
|
+
"@mercury-fw/auth-oidc": "0.2.1",
|
|
50
|
+
"@mercury-fw/auth-static": "0.2.2",
|
|
51
|
+
"@mercury-fw/channel-google-chat": "0.11.1",
|
|
52
|
+
"@mercury-fw/channel-http": "0.13.1",
|
|
53
|
+
"@mercury-fw/directory-static": "0.1.2",
|
|
54
|
+
"@mercury-fw/formatter": "0.60.0",
|
|
55
|
+
"@mercury-fw/plugin-atlassian-admin": "0.5.1",
|
|
56
|
+
"@mercury-fw/plugin-bitbucket": "0.6.1",
|
|
57
|
+
"@mercury-fw/plugin-jira": "0.8.1",
|
|
58
|
+
"@mercury-fw/plugin-web-search": "0.4.1",
|
|
59
|
+
"@mercury-fw/plugin-zitadel": "0.5.1",
|
|
60
60
|
"@mercury-fw/typescript-config": "*",
|
|
61
|
-
"@mercury-fw/web-search-searxng": "0.1.
|
|
61
|
+
"@mercury-fw/web-search-searxng": "0.1.1",
|
|
62
62
|
"@types/bun": "^1.4.2",
|
|
63
63
|
"typescript": "^6.0.3"
|
|
64
64
|
}
|
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
|
package/template/Dockerfile.tpl
CHANGED
|
@@ -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.
|
|
19
|
-
|
|
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
|
package/template/bunfig.toml.tpl
DELETED