vault-cortex 0.4.0 → 0.4.2
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/dist/bin.js +2 -1
- package/dist/messages.js +29 -10
- package/dist/prompts.js +2 -0
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { minimumNodeVersion, satisfiesMinimum } from "./node-version.js";
|
|
5
|
-
const
|
|
5
|
+
const pkg = JSON.parse(readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf8"));
|
|
6
|
+
const { version, engines } = pkg;
|
|
6
7
|
// npm only warns (EBADENGINE) on an engines mismatch but runs the CLI anyway,
|
|
7
8
|
// which would surface as a cryptic crash inside a dependency. Fail with a
|
|
8
9
|
// clear message instead — and only import dependency-laden code after the
|
package/dist/messages.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { styleText } from "node:util";
|
|
2
|
-
// Strip styling when stdout isn't a color TTY (piped output,
|
|
2
|
+
// Strip styling when stdout isn't a color TTY (piped output, CI) or NO_COLOR
|
|
3
|
+
// is set (any value, including empty — per the NO_COLOR spec) so
|
|
3
4
|
// captured/redirected output stays plain — no stray escape codes in copied
|
|
4
5
|
// commands or logs.
|
|
5
|
-
const paint = (style, text) => process.stdout.isTTY && !process.env
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
6
|
+
const paint = (style, text) => process.stdout.isTTY && !("NO_COLOR" in process.env)
|
|
7
|
+
? styleText(style, text)
|
|
8
|
+
: text;
|
|
9
|
+
const RULE_WIDTH = 56;
|
|
10
|
+
const topRule = (label) => paint("dim", `╭── ${label} ${"─".repeat(Math.max(0, RULE_WIDTH - label.length - 6))}╮`);
|
|
11
|
+
const bottomRule = () => paint("dim", `╰${"─".repeat(RULE_WIDTH - 2)}╯`);
|
|
12
|
+
const sectionRule = (label) => paint("dim", `── ${label} ${"─".repeat(Math.max(0, RULE_WIDTH - label.length - 4))}`);
|
|
10
13
|
const composeUpCommand = (targetDir) => `cd ${targetDir} && docker compose up -d`;
|
|
11
14
|
const startServerLine = (targetDir) => `Start the server:\n ${composeUpCommand(targetDir)}`;
|
|
12
15
|
/** Remote start line: running, blocked on the missing sync token, or ready to start. */
|
|
@@ -75,10 +78,12 @@ export const buildLocalConnectMessage = (params) => {
|
|
|
75
78
|
// that claude.ai can't reach localhost at all and Claude Desktop needs the
|
|
76
79
|
// mcp-remote bridge (the dialog rejects http, but mcp-remote exempts
|
|
77
80
|
// localhost, so no --allow-http).
|
|
78
|
-
const connectMessage = `${
|
|
81
|
+
const connectMessage = `${topRule("Connect")}
|
|
79
82
|
|
|
80
83
|
${startLine}
|
|
81
84
|
|
|
85
|
+
${sectionRule("MCP client")}
|
|
86
|
+
|
|
82
87
|
${connectUrlBlock(`${baseUrl}/mcp`, tokenLine)}
|
|
83
88
|
|
|
84
89
|
${connectGuidance(`${baseUrl}/mcp`)}
|
|
@@ -93,15 +98,21 @@ it with mcp-remote:
|
|
|
93
98
|
"--header", "Authorization: Bearer <token above>"]
|
|
94
99
|
}
|
|
95
100
|
|
|
101
|
+
${sectionRule("Non-OAuth")}
|
|
102
|
+
|
|
96
103
|
${curlGuidance(`${baseUrl}/mcp`)}
|
|
97
104
|
|
|
98
105
|
${smokeTest(`${baseUrl}/healthz`)}
|
|
99
106
|
|
|
107
|
+
${sectionRule("Settings")}
|
|
108
|
+
|
|
100
109
|
Optional settings (timezone, memory folder, port, logging) are commented
|
|
101
110
|
out in ${targetDir}/.env — uncomment, set a value, then apply with
|
|
102
111
|
"docker compose up -d" (restart alone does not re-read .env).
|
|
103
112
|
|
|
104
|
-
Full docs: https://github.com/aliasunder/vault-cortex/blob/main/deploy/local/README.md
|
|
113
|
+
Full docs: https://github.com/aliasunder/vault-cortex/blob/main/deploy/local/README.md
|
|
114
|
+
|
|
115
|
+
${bottomRule()}`;
|
|
105
116
|
return connectMessage;
|
|
106
117
|
};
|
|
107
118
|
/**
|
|
@@ -135,24 +146,32 @@ Claude Desktop only accept https URLs — set up HTTPS for those clients
|
|
|
135
146
|
(see the HTTPS section in the remote guide).`;
|
|
136
147
|
// Flush-left on purpose: this is printed as plain text (see paint), so
|
|
137
148
|
// leading whitespace would render as literal indentation.
|
|
138
|
-
const connectMessage = `${
|
|
149
|
+
const connectMessage = `${topRule("Connect")}
|
|
139
150
|
|
|
140
151
|
${startLine}
|
|
141
152
|
|
|
153
|
+
${sectionRule("MCP client")}
|
|
154
|
+
|
|
142
155
|
${connectUrlBlock(`${publicUrl}/mcp`, tokenLine)}
|
|
143
156
|
|
|
144
157
|
${clientGuidance}
|
|
145
158
|
|
|
159
|
+
${sectionRule("Non-OAuth")}
|
|
160
|
+
|
|
146
161
|
${curlGuidance(`${publicUrl}/mcp`)}
|
|
147
162
|
|
|
148
163
|
${smokeTest(`${publicUrl}/healthz`)}
|
|
149
164
|
|
|
165
|
+
${sectionRule("Settings")}
|
|
166
|
+
|
|
150
167
|
Optional settings (timezone, memory folder, port, logging, sync
|
|
151
168
|
behavior) are commented out in ${targetDir}/.env — uncomment, set a
|
|
152
169
|
value, then apply with "docker compose up -d" (restart alone does not
|
|
153
170
|
re-read .env).
|
|
154
171
|
|
|
155
172
|
For HTTPS options (API Gateway, Caddy, Cloudflare Tunnel), see:
|
|
156
|
-
https://github.com/aliasunder/vault-cortex/blob/main/deploy/remote/README.md#https-access
|
|
173
|
+
https://github.com/aliasunder/vault-cortex/blob/main/deploy/remote/README.md#https-access
|
|
174
|
+
|
|
175
|
+
${bottomRule()}`;
|
|
157
176
|
return connectMessage;
|
|
158
177
|
};
|
package/dist/prompts.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as clack from "@clack/prompts";
|
|
2
2
|
// User pressed ctrl-C mid-prompt: 130 = 128 + SIGINT, the shell convention.
|
|
3
|
+
// clack.isCancel is a type guard (value is symbol), so after the early exit
|
|
4
|
+
// TypeScript narrows `value` to `T` — no assertion needed.
|
|
3
5
|
const exitOnCancel = (value) => {
|
|
4
6
|
if (clack.isCancel(value)) {
|
|
5
7
|
clack.cancel("Cancelled.");
|