@machinal/mcp 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/README.md +22 -15
- package/package.json +1 -1
- package/skills/machinal-support/SKILL.md +1 -1
- package/src/bridge.mjs +3 -1
- package/src/cli.mjs +9 -7
- package/src/endpoints.mjs +3 -0
- package/src/opencode-workflow.mjs +13 -1
- package/src/presentation.mjs +3 -2
- package/src/runtime.mjs +1 -1
- package/src/setup-options.mjs +18 -13
- package/src/setup-stdio.mjs +3 -1
package/README.md
CHANGED
|
@@ -6,37 +6,42 @@ See the repository's [testing guide](../../docs/TESTING.md) for source-package a
|
|
|
6
6
|
|
|
7
7
|
## Quick start
|
|
8
8
|
|
|
9
|
-
Requires **Node.js 22.13+ (22.x) or 24+** and an installed agent client. Server needs
|
|
9
|
+
Requires **Node.js 22.13+ (22.x) or 24+** and an installed agent client. **Machinal Server** needs only a Machinal key with account/API access: its official endpoint is selected automatically, with no address question and no Docker/provider key on the client. **Custom server** is the advanced option for your own API URL. Independent local needs Docker/Compose v2, this version's source checkout, and your OpenRouter key/model settings: **no Machinal account, subscription, credits or PocketBase**. The npm package does not bundle the Go backend or guess an unpublished container image.
|
|
10
10
|
|
|
11
11
|
**Server: one Machinal key. Local: your OpenRouter key.** Hidden entry and opt-in Windows Credential Manager storage are supported for server keys. All three adapters can read the saved Windows key without a launcher. On macOS/Linux use your client environment/secret manager or optional keyed launcher. No key belongs in chat or command arguments.
|
|
12
12
|
|
|
13
13
|
**Migration compatibility:** existing `dal_…` keys, `DIRECTION_API_KEY` / `DIRECTION_API_ORIGIN` environment variables, and the previous Windows Credential Manager entry continue to work. New setups use `mach_…`, `MACHINAL_API_KEY` / `MACHINAL_API_ORIGIN`, and `Machinal/mcp.MACHINAL_API_KEY`; when both environment names are set, `MACHINAL_API_KEY` takes precedence. New keys are issued with the `mach_` prefix.
|
|
14
14
|
|
|
15
|
-
**
|
|
15
|
+
**Version 0.4.2:** use the pinned commands below to install this release from the `@machinal` scope:
|
|
16
|
+
|
|
17
|
+
OpenCode compatibility: production startup accepts the V2 skill-list response (`{ location, data }`) and legacy arrays. If optional skill discovery fails or changes shape, it emits a sanitized warning instead of preventing session setup. Regression tests cover both response shapes and discovery failures; the release gate tests the packed artifact as well.
|
|
16
18
|
|
|
17
19
|
```sh
|
|
18
20
|
npx @machinal/mcp setup
|
|
19
|
-
#
|
|
20
|
-
npx --yes @machinal/mcp@0.4.
|
|
21
|
-
npx --yes @machinal/mcp@0.4.
|
|
21
|
+
# Machinal Server: no URL entry, only your Machinal key:
|
|
22
|
+
npx --yes @machinal/mcp@0.4.2 setup --client opencode --mode server
|
|
23
|
+
npx --yes @machinal/mcp@0.4.2 setup --client codex --mode server
|
|
24
|
+
npx --yes @machinal/mcp@0.4.2 setup --client claude --scope global --mode server
|
|
22
25
|
# Independent local; the wizard asks for OpenRouter and model IDs:
|
|
23
|
-
npx --yes @machinal/mcp@0.4.
|
|
24
|
-
npx --yes @machinal/mcp@0.4.
|
|
26
|
+
npx --yes @machinal/mcp@0.4.2 setup --client codex --mode local --docker-dir /path/to/machinal
|
|
27
|
+
npx --yes @machinal/mcp@0.4.2 setup --client claude --mode local --docker-dir /path/to/machinal
|
|
28
|
+
# Your own deployment, explicitly selected:
|
|
29
|
+
npx --yes @machinal/mcp@0.4.2 setup --client opencode --mode custom --url https://YOUR-API/mcp
|
|
25
30
|
```
|
|
26
31
|
|
|
27
32
|
The wizard asks for:
|
|
28
33
|
|
|
29
34
|
1. **OpenCode V2**, **Claude Code**, or **Codex**.
|
|
30
35
|
2. Project or global scope (**Codex defaults to global**, because untrusted project config is ignored; other clients default to project).
|
|
31
|
-
3. **Server or
|
|
36
|
+
3. **Machinal Server**, **Local**, or **Custom server (advanced)**. Machinal Server automatically uses `https://api.machinal.app/mcp` and never asks for an address or starts Docker. Local builds an independent backend with loopback host publishing and separate volumes; its default is `http://127.0.0.1:8080/mcp`. Custom server asks for your own API URL, **not the frontend URL**, without offering localhost as a guessed hosted default.
|
|
32
37
|
4. Whether to install bundled editing, YAML recipe, scene and credit-awareness skills, and a default editing style.
|
|
33
|
-
5. **Server:** hidden Machinal key, reuse environment/saved key, or login later (`--defer-login`). Create keys at <https://
|
|
38
|
+
5. **Machinal Server:** hidden Machinal key, reuse environment/saved key, or login later (`--defer-login`). Create keys at <https://machinal.app/api-keys>; custom deployments use their own account website. **Local:** hidden `OPENROUTER_API_KEY`, required `OPENROUTER_MODEL`, optional scene/transcription model IDs, source checkout and explicit Docker approval. A device token is generated automatically; no local Machinal key is requested.
|
|
34
39
|
6. Windows Server mode: optionally remember a verified key in Credential Manager (default: no).
|
|
35
40
|
7. Optional client launch. `--no-launch` works even when login is deferred.
|
|
36
41
|
|
|
37
42
|
Setup preserves unrelated settings, backs up changed files and installs optional skills. Missing login/offline Server still permits adapter installation, with an explicit **unverified** service status. Verification uses initialization, tool discovery and read-only billing mode, never generation, rendering, provider calls or credit purchases. An API probe is never reported as a running client connection.
|
|
38
43
|
|
|
39
|
-
The
|
|
44
|
+
The official Machinal Server URL is fixed to the verified production endpoint `https://api.machinal.app/mcp`. Selecting it ignores stale `MACHINAL_API_ORIGIN` / `DIRECTION_API_ORIGIN` values, including localhost. Those environment variables remain defaults for Custom server. `--mode hosted` aliases Machinal Server. Explicit `--url` scripts, including legacy `--mode server --url ...` overrides, remain supported but are classified as Custom server when the URL differs from the official service. HTTP is accepted only on loopback; other endpoints need HTTPS. Redirects are refused. No remote mode starts Docker.
|
|
40
45
|
|
|
41
46
|
**Independent local does not mean free upstream AI.** Rendering uses your hardware; AI usage is charged directly by OpenRouter. Provider/device secrets live under `~/.config/machinal/local/` (or `$XDG_CONFIG_HOME/machinal/local/`), never `api/.env` or client config. Protect these files and backups: POSIX modes are private; Windows uses your filesystem ACLs. Reuse preserves the token/volumes; `--configure-local` explicitly changes provider settings. Installation grants no media-access, upload or AI-spending permission. Source-folder mounts still need separate approval.
|
|
42
47
|
|
|
@@ -66,8 +71,10 @@ The following bullets describe **advanced direct-HTTP compatibility** (`--transp
|
|
|
66
71
|
From this repository (no npm publication required):
|
|
67
72
|
|
|
68
73
|
```sh
|
|
69
|
-
#
|
|
70
|
-
node packages/mcp-installer/bin/machinal-mcp.mjs setup --
|
|
74
|
+
# Machinal Server needs no API URL:
|
|
75
|
+
node packages/mcp-installer/bin/machinal-mcp.mjs setup --client opencode --mode server
|
|
76
|
+
# A separately managed development API is a Custom server:
|
|
77
|
+
node packages/mcp-installer/bin/machinal-mcp.mjs setup --mode custom --url http://127.0.0.1:8080/mcp
|
|
71
78
|
# User's local Docker: offer build/start from this checkout if the API is offline:
|
|
72
79
|
node packages/mcp-installer/bin/machinal-mcp.mjs setup --mode local --docker-dir .
|
|
73
80
|
# Independent local, with OPENROUTER_API_KEY and OPENROUTER_MODEL supplied securely:
|
|
@@ -254,8 +261,8 @@ Windows protects stored credentials at rest, but this is **not isolation from ap
|
|
|
254
261
|
With `MACHINAL_API_KEY` already supplied securely in the environment:
|
|
255
262
|
|
|
256
263
|
```sh
|
|
257
|
-
npx @machinal/mcp setup --client opencode --scope project --mode
|
|
258
|
-
npx @machinal/mcp setup --client claude --scope global --mode
|
|
264
|
+
npx @machinal/mcp setup --client opencode --scope project --mode server --style cinematic --yes --no-launch
|
|
265
|
+
npx @machinal/mcp setup --client claude --scope global --mode server --no-skills --yes --no-launch
|
|
259
266
|
npx @machinal/mcp setup --client codex --mode local --docker-dir /path/to/machinal --start-docker --style tutorial --yes --no-launch
|
|
260
267
|
```
|
|
261
268
|
|
|
@@ -341,7 +348,7 @@ Test the npm executable/tarball path without publishing:
|
|
|
341
348
|
```sh
|
|
342
349
|
npm pack --dry-run
|
|
343
350
|
npm pack
|
|
344
|
-
npx --yes --package ./machinal-mcp-0.4.
|
|
351
|
+
npx --yes --package ./machinal-mcp-0.4.2.tgz machinal-mcp --help
|
|
345
352
|
```
|
|
346
353
|
|
|
347
354
|
The publish allowlist includes only selected `bin/*.mjs`, runtime/plugin source, portable skills, package metadata and this README. Package smoke tests reject project configs, nested agent installs, `.env`, media and old archives. No tests, local preferences or credentials are packaged.
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ This is an OS credential, **not a project file**. The integration reads its secr
|
|
|
32
32
|
|
|
33
33
|
## Recovery decisions
|
|
34
34
|
|
|
35
|
-
- **`key-rejected` / HTTP 401, or `no-usable-key`:** after the recovery attempt, offer `replace` through the secure native window. It links to <https://
|
|
35
|
+
- **`key-rejected` / HTTP 401, or `no-usable-key`:** after the recovery attempt, offer `replace` through the secure native window. It links to <https://machinal.app/api-keys>, verifies before changing the old credential and reconnects. Saving requires the user's separate approval; cancellation/rejection preserves the previous saved key. Do not open replacement automatically or request a key in chat.
|
|
36
36
|
- **`credential-store-unavailable`:** the vault could not be read; that is not evidence of an absent key. Retry under the same Windows account or explain the vault/access problem. Do not delete the credential or demand a replacement.
|
|
37
37
|
- **`connection-failed`:** check the approved URL, local API/container availability, TLS/network. A network failure is not a bad-key diagnosis. Do not start containers, install software or change endpoints without appropriate authorization.
|
|
38
38
|
- **`account-access` / HTTP 402 or 403:** check Premium/API access or origin restrictions. More keys do not fix account access.
|
package/src/bridge.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { parseEnv } from 'node:util';
|
|
|
5
5
|
import { normalizeEndpoint, validateAPIKey, isLoopbackEndpoint } from './connection.mjs';
|
|
6
6
|
import { createCredentialStore } from './credential-store.mjs';
|
|
7
7
|
import { VERSION } from './version.mjs';
|
|
8
|
+
import { MACHINAL_SERVER_URL } from './endpoints.mjs';
|
|
8
9
|
|
|
9
10
|
const MAX_REQUEST = 4 * 1024 * 1024;
|
|
10
11
|
const MAX_RESPONSE = 2 * 1024 * 1024;
|
|
@@ -81,9 +82,10 @@ export class MCPBridge {
|
|
|
81
82
|
|
|
82
83
|
status() {
|
|
83
84
|
return { ...this.state, transport: 'connected', mode: this.localConfig ? 'local' : 'server', endpoint: this.url,
|
|
85
|
+
service: this.localConfig ? 'Local' : this.url === MACHINAL_SERVER_URL ? 'Machinal Server' : 'Custom server',
|
|
84
86
|
toolCount: this.tools.length, nextAction: this.localConfig && this.state.status !== 'connected'
|
|
85
87
|
? 'Check the saved independent local profile and Docker services. Rerun setup --mode local if its generated device token is invalid; a Machinal login is not needed.' : this.state.status === 'login_required'
|
|
86
|
-
?
|
|
88
|
+
? `Run npx @machinal/mcp key set --url ${this.url} in a terminal, or provide MACHINAL_API_KEY in the client environment. Never paste it in chat.`
|
|
87
89
|
: this.state.status === 'connected' ? 'Ready.' : 'Check the configured API/container and network, then reconnect. Do not replace keys for network or account-access errors.' };
|
|
88
90
|
}
|
|
89
91
|
|
package/src/cli.mjs
CHANGED
|
@@ -15,8 +15,8 @@ import { createPromptUI } from './prompts.mjs';
|
|
|
15
15
|
const HELP = `machinal MCP setup (Node.js 22.13+ or 24+)
|
|
16
16
|
|
|
17
17
|
npx @machinal/mcp setup
|
|
18
|
-
npx @machinal/mcp setup --client opencode --
|
|
19
|
-
npx @machinal/mcp setup --client codex --mode
|
|
18
|
+
npx @machinal/mcp setup --client opencode --mode server
|
|
19
|
+
npx @machinal/mcp setup --client codex --mode custom --url https://YOUR-API/mcp
|
|
20
20
|
npx @machinal/mcp setup --client claude --mode local --docker-dir PATH
|
|
21
21
|
npx @machinal/mcp doctor --url https://YOUR-API/mcp
|
|
22
22
|
npx @machinal/mcp launch opencode
|
|
@@ -28,9 +28,9 @@ const HELP = `machinal MCP setup (Node.js 22.13+ or 24+)
|
|
|
28
28
|
Options for setup:
|
|
29
29
|
--client opencode|claude|codex
|
|
30
30
|
--scope project|global Default: global for Codex, project otherwise
|
|
31
|
-
--mode server|local
|
|
31
|
+
--mode server|local|custom Machinal Server | independent Local | custom API
|
|
32
32
|
--mode hosted Compatibility alias for server
|
|
33
|
-
--url URL
|
|
33
|
+
--url URL Custom server URL or optional local URL override
|
|
34
34
|
--docker-dir PATH Local: machinal source checkout
|
|
35
35
|
--start-docker Local: explicitly allow build/start if needed
|
|
36
36
|
--configure-local Explicitly replace saved local provider settings
|
|
@@ -41,7 +41,7 @@ Options for setup:
|
|
|
41
41
|
--style STYLE Named editorial profile (see below)
|
|
42
42
|
--no-skills Do not install the bundled agent skills
|
|
43
43
|
--replace-skills Back up and replace changed bundled files
|
|
44
|
-
--yes No confirmations; requires client
|
|
44
|
+
--yes No confirmations; requires --client
|
|
45
45
|
--no-launch Configure without launching the agent client
|
|
46
46
|
--verbose Show full setup, credit and authentication details
|
|
47
47
|
--help, -h Show help
|
|
@@ -56,7 +56,9 @@ Options for key delete:
|
|
|
56
56
|
Options for key set:
|
|
57
57
|
--url URL Verify MCP access before replacing the saved key
|
|
58
58
|
|
|
59
|
-
Server
|
|
59
|
+
Machinal Server uses https://api.machinal.app/mcp automatically; no URL prompt.
|
|
60
|
+
It reads MACHINAL_API_KEY, Windows Credential Manager, or hidden entry.
|
|
61
|
+
Custom server asks for your own API URL; --url also selects custom mode for legacy scripts.
|
|
60
62
|
Opt-in Windows saving uses Credential Manager, not plaintext client config.
|
|
61
63
|
Local mode asks for OPENROUTER_API_KEY and model settings, builds the source
|
|
62
64
|
checkout with Docker, and keeps private provider settings outside the project.
|
|
@@ -69,7 +71,7 @@ and reconnects discovery without retrying jobs. Host MCP badges belong to the cl
|
|
|
69
71
|
native Needs authentication labels require OAuth, not application API keys.
|
|
70
72
|
Codex defaults to global config; project settings require a trusted project.
|
|
71
73
|
No key is accepted in arguments or chat. Setup never generates media or spends AI credits.
|
|
72
|
-
Server keys: https://
|
|
74
|
+
Server keys: https://machinal.app/api-keys (your own website for self-hosting).
|
|
73
75
|
|
|
74
76
|
Styles: ${EDITING_STYLES.join(', ')}.
|
|
75
77
|
`;
|
|
@@ -3,6 +3,18 @@ const videoIntent = /\b(video|film|documentar\w*|cinematic\w*|montaj|reel|tiktok
|
|
|
3
3
|
const implementationIntent = /\b(renderer|plugin|bug|codul|code|test\w*|repar\w*|debug\w*|fix|refactor\w*)\b/iu;
|
|
4
4
|
const productionIntent = /\b(creează|creeaza|realizează|realizeaza|generează|genereaza|create|make|produce|render|randează|randeaza|editează|editeaza|edit)\b/iu;
|
|
5
5
|
|
|
6
|
+
async function availableProductionSkills(ctx) {
|
|
7
|
+
try {
|
|
8
|
+
const result = await ctx.skill.list();
|
|
9
|
+
const skills = Array.isArray(result) ? result : result?.data;
|
|
10
|
+
if (!Array.isArray(skills)) throw new TypeError('Unsupported skill list response');
|
|
11
|
+
return new Set(skills.filter(skill => typeof skill?.id === 'string').map(skill => skill.id));
|
|
12
|
+
} catch {
|
|
13
|
+
console.warn('[machinal] Automatic production skill discovery is unavailable; continuing without automatic skill attachment.');
|
|
14
|
+
return new Set();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
export async function installWorkflowStartup(ctx) {
|
|
7
19
|
if (ctx.skill?.transform) {
|
|
8
20
|
await ctx.skill.transform(editor => {
|
|
@@ -19,7 +31,7 @@ export async function installWorkflowStartup(ctx) {
|
|
|
19
31
|
const explicit = productionSkills.some(id => selected.has(id));
|
|
20
32
|
const text = (prompt.text ?? '').normalize('NFD').replace(/\p{M}/gu, '');
|
|
21
33
|
if (!explicit && !(videoIntent.test(text) && productionIntent.test(text) && !implementationIntent.test(text))) return;
|
|
22
|
-
const available =
|
|
34
|
+
const available = await availableProductionSkills(ctx);
|
|
23
35
|
for (const id of productionSkills) {
|
|
24
36
|
if (available.has(id) && !selected.has(id)) {
|
|
25
37
|
(prompt.skills ??= []).push({ id });
|
package/src/presentation.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { styleText } from 'node:util';
|
|
2
|
+
import { MACHINAL_APP_URL } from './endpoints.mjs';
|
|
2
3
|
|
|
3
|
-
export const API_KEYS_URL =
|
|
4
|
-
export const MEMBERSHIP_URL =
|
|
4
|
+
export const API_KEYS_URL = `${MACHINAL_APP_URL}/api-keys`;
|
|
5
|
+
export const MEMBERSHIP_URL = `${MACHINAL_APP_URL}/membership`;
|
|
5
6
|
export const DOCKER_URL = 'https://docs.docker.com/get-started/get-docker/';
|
|
6
7
|
|
|
7
8
|
export function terminalStyle({ stream = process.stdout, env = process.env } = {}) {
|
package/src/runtime.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { VERSION } from './version.mjs';
|
|
|
7
7
|
|
|
8
8
|
const ROOT = fileURLToPath(new URL('../', import.meta.url));
|
|
9
9
|
const FILES = ['bin/machinal-stdio.mjs', 'src/bridge.mjs', 'src/connection.mjs', 'src/credential-store.mjs',
|
|
10
|
-
'src/credits.mjs', 'src/errors.mjs', 'src/presentation.mjs', 'src/version.mjs', 'package.json'];
|
|
10
|
+
'src/credits.mjs', 'src/endpoints.mjs', 'src/errors.mjs', 'src/presentation.mjs', 'src/version.mjs', 'package.json'];
|
|
11
11
|
|
|
12
12
|
export function stateDirectory({ home = homedir(), env = process.env } = {}) {
|
|
13
13
|
return join(env.XDG_CONFIG_HOME || join(home, '.config'), 'machinal');
|
package/src/setup-options.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { InstallerError } from './errors.mjs';
|
|
2
2
|
import { isLoopbackEndpoint, normalizeEndpoint } from './connection.mjs';
|
|
3
3
|
import styleProfiles from '../skills/machinal-editing/references/styles.json' with { type: 'json' };
|
|
4
|
+
import { DEFAULT_LOCAL_URL, MACHINAL_SERVER_URL } from './endpoints.mjs';
|
|
4
5
|
|
|
5
|
-
export
|
|
6
|
+
export { DEFAULT_LOCAL_URL, MACHINAL_SERVER_URL };
|
|
6
7
|
export const EDITING_STYLES = styleProfiles.map((profile) => profile.id);
|
|
7
8
|
|
|
8
9
|
export async function chooseClient(value, { interactive, ui }) {
|
|
@@ -17,32 +18,36 @@ export async function chooseClient(value, { interactive, ui }) {
|
|
|
17
18
|
|
|
18
19
|
export async function chooseEndpoint(values, { env, interactive, ui }) {
|
|
19
20
|
let mode = values.mode === 'hosted' ? 'server' : values.mode;
|
|
20
|
-
if (mode && !['local', 'server'].includes(mode)) throw new InstallerError('Choose --mode local or
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
if (mode && !['local', 'server', 'custom'].includes(mode)) throw new InstallerError('Choose --mode server (Machinal Server), local or custom (--mode hosted is an alias for server).');
|
|
22
|
+
const customDefault = env.MACHINAL_API_ORIGIN || env.DIRECTION_API_ORIGIN;
|
|
23
|
+
if (!mode && values.url) mode = 'custom';
|
|
23
24
|
if (!mode && interactive && !values.url) {
|
|
24
|
-
mode = await ui.select({ message: 'API location', default:
|
|
25
|
-
{ name: '
|
|
26
|
-
{ name: 'Local
|
|
25
|
+
mode = await ui.select({ message: 'API location', default: 'server', choices: [
|
|
26
|
+
{ name: 'Machinal Server', value: 'server', short: 'Machinal Server', description: 'Official hosted service. Only your Machinal API key is needed.' },
|
|
27
|
+
{ name: 'Local', value: 'local', short: 'Local', description: 'Independent Docker backend with your own OpenRouter key.' },
|
|
28
|
+
{ name: 'Custom server (advanced)', value: 'custom', short: 'Custom server', description: 'Your own deployment. Enter its API URL.' },
|
|
27
29
|
] });
|
|
28
30
|
}
|
|
29
|
-
mode ??=
|
|
31
|
+
mode ??= customDefault ? 'custom' : 'server';
|
|
32
|
+
// An explicit legacy --url remains a custom deployment, never branded as the official service.
|
|
33
|
+
if (mode === 'server' && values.url && normalizeEndpoint(values.url) !== MACHINAL_SERVER_URL) mode = 'custom';
|
|
34
|
+
if (mode === 'server') return { mode, url: MACHINAL_SERVER_URL };
|
|
35
|
+
let rawURL = values.url || customDefault;
|
|
30
36
|
if (mode === 'local' && !values.url && (!rawURL || !isLoopbackEndpoint(normalizeEndpoint(rawURL)))) rawURL = DEFAULT_LOCAL_URL;
|
|
31
37
|
if (interactive && !values.url) {
|
|
32
38
|
rawURL = await ui.input({
|
|
33
|
-
message: mode === 'local' ? 'Local API URL' : '
|
|
34
|
-
default: rawURL
|
|
39
|
+
message: mode === 'local' ? 'Local API URL' : 'Custom server API URL (not the website)',
|
|
40
|
+
...(rawURL ? { default: rawURL } : {}), required: true,
|
|
35
41
|
validate: (value) => {
|
|
36
42
|
try {
|
|
37
43
|
const url = normalizeEndpoint(value);
|
|
38
|
-
return mode !== 'local' || isLoopbackEndpoint(url) || 'Local mode needs a loopback URL. Choose
|
|
44
|
+
return mode !== 'local' || isLoopbackEndpoint(url) || 'Local mode needs a loopback URL. Choose Custom server for your own remote API.';
|
|
39
45
|
} catch (error) { return error.message; }
|
|
40
46
|
},
|
|
41
47
|
});
|
|
42
48
|
}
|
|
43
|
-
if (!rawURL) throw new InstallerError('
|
|
49
|
+
if (!rawURL) throw new InstallerError('Custom server requires --url with your API origin. Use --mode server for Machinal Server without a URL.');
|
|
44
50
|
const url = normalizeEndpoint(rawURL);
|
|
45
|
-
mode ??= 'server';
|
|
46
51
|
if (mode === 'local' && !isLoopbackEndpoint(url)) {
|
|
47
52
|
throw new InstallerError('Local mode requires a loopback API URL. Use --mode server for a deployed HTTPS API.');
|
|
48
53
|
}
|
package/src/setup-stdio.mjs
CHANGED
|
@@ -37,10 +37,12 @@ export async function setupStdio(values, context) {
|
|
|
37
37
|
const client = await chooseClient(values.client, context);
|
|
38
38
|
const defaultScope = client === 'codex' ? 'global' : 'project';
|
|
39
39
|
const scope = values.scope ?? (interactive ? await ui.select({ message: 'Available in', default: defaultScope, choices: [
|
|
40
|
-
{ name: 'All my projects (recommended for Codex discovery)'
|
|
40
|
+
{ name: client === 'codex' ? 'All my projects (recommended for Codex discovery)' : 'All my projects', value: 'global' },
|
|
41
|
+
{ name: 'This project only', value: 'project' },
|
|
41
42
|
] }) : defaultScope);
|
|
42
43
|
if (scope === 'project' && dirname(resolve(cwd)) === resolve(cwd)) log('Warning: project setup is running at a drive/filesystem root. Its settings may apply to all descendant projects.');
|
|
43
44
|
const endpoint = await chooseEndpoint(values, context);
|
|
45
|
+
log(`Connection: ${{ server: 'Machinal Server', local: 'Local', custom: 'Custom server' }[endpoint.mode]}`);
|
|
44
46
|
const local = endpoint.mode === 'local';
|
|
45
47
|
if (!local && (values['docker-dir'] || values['start-docker'] || values['configure-local'])) throw new InstallerError('Docker/provider setup options require --mode local. Server mode never configures providers or Docker.');
|
|
46
48
|
if (local && (values['session-key'] || values['defer-login'])) throw new InstallerError('Local mode uses an automatically generated device token, not a Machinal login.');
|