@mercury-fw/cli 0.28.1 → 0.28.3
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 +15 -0
- package/package.json +5 -5
- package/src/render.ts +26 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mercury-fw/cli
|
|
2
2
|
|
|
3
|
+
## 0.28.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5175e10: An app created with the HTTP channel publishes the surface's port on the host (`HTTP_SURFACE_PORT`, 4100 when unset), so it's reachable from outside the container; its README says where it listens and that it has no authentication.
|
|
8
|
+
- @mercury-fw/core@0.28.3
|
|
9
|
+
|
|
10
|
+
## 0.28.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 0c5bb5b: Dependencies at their latest minor: `ai` 7.0.126, `ai-sdk-ollama` 4.4.0, `zod` 4.6.5, `yaml` 2.9.1, `shell-quote` 1.11.0. A new app from `mfw create` runs Qdrant on its `v1` tag, which follows every 1.x release, instead of a fixed 1.19.0, and gets `@types/bun` `^1.4.2`.
|
|
15
|
+
- Updated dependencies [0c5bb5b]
|
|
16
|
+
- @mercury-fw/core@0.28.2
|
|
17
|
+
|
|
3
18
|
## 0.28.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercury-fw/cli",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"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.",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@clack/prompts": "^1.8.1",
|
|
39
|
-
"@mercury-fw/core": "0.28.
|
|
39
|
+
"@mercury-fw/core": "0.28.3",
|
|
40
40
|
"commander": "^15.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@mercury-fw/channel-google-chat": "0.1.2",
|
|
44
44
|
"@mercury-fw/channel-http": "0.1.0",
|
|
45
|
-
"@mercury-fw/formatter": "0.28.
|
|
45
|
+
"@mercury-fw/formatter": "0.28.3",
|
|
46
46
|
"@mercury-fw/plugin-atlassian-admin": "0.1.0",
|
|
47
47
|
"@mercury-fw/plugin-bitbucket": "0.1.0",
|
|
48
|
-
"@mercury-fw/plugin-jira": "0.1.
|
|
48
|
+
"@mercury-fw/plugin-jira": "0.1.1",
|
|
49
49
|
"@mercury-fw/typescript-config": "*",
|
|
50
|
-
"@types/bun": "^1.4.
|
|
50
|
+
"@types/bun": "^1.4.2",
|
|
51
51
|
"typescript": "^6.0.3"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/src/render.ts
CHANGED
|
@@ -70,7 +70,7 @@ export function renderApp(input: RenderInput): Map<string, string> {
|
|
|
70
70
|
[".gitignore", gitignore],
|
|
71
71
|
["Dockerfile", renderDockerfile(tools)],
|
|
72
72
|
["README.md", renderReadme(input.name, channels, tools)],
|
|
73
|
-
["docker-compose.yml", renderCompose(input.name, tools.length > 0)],
|
|
73
|
+
["docker-compose.yml", renderCompose(input.name, tools.length > 0, channels.some((c) => c.id === "http"))],
|
|
74
74
|
["markdown.d.ts", markdownDts],
|
|
75
75
|
["mercury.config.ts", renderConfig(channels, tools)],
|
|
76
76
|
["package.json", renderPackageJson(input.name, channels, tools, input.versions)],
|
|
@@ -277,7 +277,7 @@ function renderPackageJson(
|
|
|
277
277
|
dependencies,
|
|
278
278
|
// The CLI in the app itself, so `bunx mfw` runs the version that matches
|
|
279
279
|
// the framework the app depends on.
|
|
280
|
-
devDependencies: { "@mercury-fw/cli": `^${cli}`, "@types/bun": "^1.4.
|
|
280
|
+
devDependencies: { "@mercury-fw/cli": `^${cli}`, "@types/bun": "^1.4.2", typescript: "^6.0.3" },
|
|
281
281
|
};
|
|
282
282
|
const trusted = [...new Set([...tools.map((t) => t.package), ...[...channels, ...tools].flatMap((e) => e.trusts ?? [])])];
|
|
283
283
|
if (trusted.length > 0) {
|
|
@@ -318,8 +318,9 @@ function renderEnv(channels: CatalogEntry[], tools: CatalogEntry[]): string {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
/** `docker-compose.yml`: the app and Qdrant, with named volumes prefixed by the
|
|
321
|
-
* app's name; the CLI credentials volume only when a tool plugin was chosen
|
|
322
|
-
|
|
321
|
+
* app's name; the CLI credentials volume only when a tool plugin was chosen,
|
|
322
|
+
* the HTTP surface's port published on the host only with the HTTP channel. */
|
|
323
|
+
function renderCompose(name: string, hasTools: boolean, hasHttp: boolean): string {
|
|
323
324
|
const credentialsMount = hasTools
|
|
324
325
|
? [
|
|
325
326
|
" # The tool plugins' CLI credentials, on a volume so what a CLI writes back",
|
|
@@ -327,6 +328,13 @@ function renderCompose(name: string, hasTools: boolean): string {
|
|
|
327
328
|
" - cli-credentials:/home/mercury/.config",
|
|
328
329
|
]
|
|
329
330
|
: [];
|
|
331
|
+
const httpPort = hasHttp
|
|
332
|
+
? [
|
|
333
|
+
" # The HTTP surface, on the host: no authentication, keep it off the public network.",
|
|
334
|
+
" ports:",
|
|
335
|
+
' - "${HTTP_SURFACE_PORT:-4100}:${HTTP_SURFACE_PORT:-4100}"',
|
|
336
|
+
]
|
|
337
|
+
: [];
|
|
330
338
|
const credentialsVolume = hasTools ? [" cli-credentials:", ` name: ${name}_cli-credentials`] : [];
|
|
331
339
|
return [
|
|
332
340
|
"services:",
|
|
@@ -340,13 +348,14 @@ function renderCompose(name: string, hasTools: boolean): string {
|
|
|
340
348
|
" volumes:",
|
|
341
349
|
" - wiki-vault:/app/wiki-vault",
|
|
342
350
|
...credentialsMount,
|
|
351
|
+
...httpPort,
|
|
343
352
|
" extra_hosts:",
|
|
344
353
|
' - "host.docker.internal:host-gateway"',
|
|
345
354
|
" depends_on:",
|
|
346
355
|
" - qdrant",
|
|
347
356
|
"",
|
|
348
357
|
" qdrant:",
|
|
349
|
-
" image: qdrant/qdrant:v1
|
|
358
|
+
" image: qdrant/qdrant:v1",
|
|
350
359
|
" volumes:",
|
|
351
360
|
" - qdrant-data:/qdrant/storage",
|
|
352
361
|
"",
|
|
@@ -387,7 +396,18 @@ bunx mfw repl
|
|
|
387
396
|
\`\`\`
|
|
388
397
|
|
|
389
398
|
\`bun install\` here gives your editor, \`bun run typecheck\` and \`mfw\` the packages (tool plugins download their CLI binary as they install); the image installs its own copy when it builds. \`bunx mfw start\` builds the image and starts the app with Qdrant in the background, \`bunx mfw repl\` opens a terminal conversation with the assistant. \`bunx mfw --help\` lists the rest: stopping and restarting, logs, a shell in the container, the wiki and the memory, and resetting them.
|
|
390
|
-
${renderCredentialsSection(withCredentials(tools))}`;
|
|
399
|
+
${renderHttpSection(channels)}${renderCredentialsSection(withCredentials(tools))}`;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** The README section on the HTTP surface, for an app with the HTTP channel;
|
|
403
|
+
* nothing without it. */
|
|
404
|
+
function renderHttpSection(channels: CatalogEntry[]): string {
|
|
405
|
+
if (!channels.some((c) => c.id === "http")) return "";
|
|
406
|
+
return `
|
|
407
|
+
## HTTP surface
|
|
408
|
+
|
|
409
|
+
The HTTP channel listens on \`http://<host>:4100\`, the port in \`HTTP_SURFACE_PORT\` (the compose file publishes whatever port it holds on the host). It has no authentication: whoever reaches the port can talk to the assistant, so keep it on a network you trust.
|
|
410
|
+
`;
|
|
391
411
|
}
|
|
392
412
|
|
|
393
413
|
/** The README section on CLI credentials, for an app with tool plugins;
|