maka-agent 0.2.0-dev.29.20260912 → 0.2.0-dev.30.20260912
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/cli-core.js
CHANGED
|
@@ -22,6 +22,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
22
22
|
import { deriveMakaDataRoots, resolveMakaDataRoots } from './workspace-root.js';
|
|
23
23
|
import { configureRuntimeHostPeerClient, resolveRuntimeHostNativePath, } from './runtime-host-peer-artifact.js';
|
|
24
24
|
import { parseRuntimeHostCommand, parseRuntimeHostInstalledUpdateCommand, } from './runtime-host-cli.js';
|
|
25
|
+
import { sessionBundleHelpText } from './runtime-host-help.js';
|
|
25
26
|
import { resolveCliUiLocale } from './cli-ui-locale.js';
|
|
26
27
|
export const RELEASE_MAKA_CLI_LAUNCH_OPTIONS = {
|
|
27
28
|
dataProfileName: 'Maka',
|
|
@@ -52,16 +53,17 @@ export function parseMakaCliArgs(argv, version, cliCommand = RELEASE_MAKA_CLI_LA
|
|
|
52
53
|
return { kind: 'run', args: argv.slice(1) };
|
|
53
54
|
if (first === 'activate')
|
|
54
55
|
return { kind: 'activate', args: argv.slice(1) };
|
|
55
|
-
if (first === 'session-export')
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
if (first === 'session-export' || first === 'session-import') {
|
|
57
|
+
return argv[1] === '--help' || argv[1] === '-h'
|
|
58
|
+
? { kind: 'help', text: sessionBundleHelpText(cliCommand, first) }
|
|
59
|
+
: { kind: first, args: argv.slice(1) };
|
|
60
|
+
}
|
|
59
61
|
if (first === 'eval')
|
|
60
62
|
return { kind: 'eval', args: argv.slice(1) };
|
|
61
63
|
if (first === 'update')
|
|
62
|
-
return parseRuntimeHostInstalledUpdateCommand(argv.slice(1));
|
|
64
|
+
return parseRuntimeHostInstalledUpdateCommand(argv.slice(1), cliCommand);
|
|
63
65
|
if (first === 'runtime-host')
|
|
64
|
-
return parseRuntimeHostCommand(argv.slice(1));
|
|
66
|
+
return parseRuntimeHostCommand(argv.slice(1), cliCommand);
|
|
65
67
|
return {
|
|
66
68
|
kind: 'error',
|
|
67
69
|
message: `Unexpected argument: ${first ?? ''}`,
|
|
@@ -97,48 +99,23 @@ function helpText(cliCommand) {
|
|
|
97
99
|
'Launches the Maka terminal UI in the current working directory.',
|
|
98
100
|
'',
|
|
99
101
|
'Commands:',
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
` ${cliCommand} runtime-host service mesh status|create|invite|join|remove|leave|close|reconcile [options]`,
|
|
118
|
-
` ${cliCommand} runtime-host service retire --expected-service-id <id> --expected-root-path <path> --expected-root-id <id> [--allow-interrupt-active-tasks]`,
|
|
119
|
-
` ${cliCommand} runtime-host service check-update --target <latest|next|version> [--json]`,
|
|
120
|
-
` ${cliCommand} runtime-host service update [--target <latest|next|version>] --expected-service-id <id> --expected-root-path <path> --expected-root-id <id> [--allow-interrupt-active-tasks]`,
|
|
121
|
-
` ${cliCommand} runtime-host service update-policy [--target <manual|latest|next|version>] [--json]`,
|
|
122
|
-
` ${cliCommand} runtime-host service reconcile-update [--json]`,
|
|
123
|
-
` ${cliCommand} runtime-host access issue --principal <id> --grant <operation>`,
|
|
124
|
-
` ${cliCommand} runtime-host access issue --principal <id> --preset <desktop-client|terminal-client>`,
|
|
125
|
-
` ${cliCommand} runtime-host access connection-code [--name <name>] [--root <path>]`,
|
|
126
|
-
` ${cliCommand} runtime-host access list`,
|
|
127
|
-
` ${cliCommand} runtime-host access issue --kind capability-provider --principal <id>`,
|
|
128
|
-
` ${cliCommand} runtime-host access revoke --credential <id>`,
|
|
129
|
-
` ${cliCommand} runtime-host project list [--root <path>]`,
|
|
130
|
-
` ${cliCommand} runtime-host project add <path> [--prefer] [--root <path>]`,
|
|
131
|
-
` ${cliCommand} runtime-host plugin status|list|inspect|failures [--root <path>]`,
|
|
132
|
-
` ${cliCommand} runtime-host plugin install|uninstall|reload <target> [--root <path>]`,
|
|
133
|
-
` ${cliCommand} runtime-host plugin export <extension-id> <bundle-path> [--root <path>]`,
|
|
134
|
-
` ${cliCommand} runtime-host plugin apply <operations.json> [--root <path>]`,
|
|
135
|
-
` ${cliCommand} runtime-host plugin reconcile [--root <path>]`,
|
|
136
|
-
` ${cliCommand} runtime-host profile list`,
|
|
137
|
-
` ${cliCommand} runtime-host profile set --id <id> --name <name> --tls-url <wss-url> --expected-root <root-id> [--credential-env <name>]`,
|
|
138
|
-
` ${cliCommand} runtime-host profile set --id <id> --name <name> --ssh-destination <user@host> --ssh-remote-port <port> --expected-root <root-id> [--ssh-port <port>] [--credential-env <name>]`,
|
|
139
|
-
` ${cliCommand} runtime-host profile set --id <id> --name <name> --plaintext-url <ws-url> --acknowledge-plaintext --expected-root <root-id> [--credential-env <name>]`,
|
|
140
|
-
` ${cliCommand} runtime-host profile remove --id <id>`,
|
|
141
|
-
` ${cliCommand} runtime-host capability-provider serve --url <ws-url> --mcp-config <path> --expected-root <root-id>`,
|
|
102
|
+
...[
|
|
103
|
+
['', 'Start the TUI'],
|
|
104
|
+
['--acp', 'Serve ACP v1 over stdio (initialize, session/new, session/list)'],
|
|
105
|
+
['run ...', 'Run one non-interactive model turn'],
|
|
106
|
+
['-p ...', `Alias for ${cliCommand} run`],
|
|
107
|
+
['activate ...', 'Run one Cloud Session activation and emit JSONL'],
|
|
108
|
+
['eval ...', 'Run one declarative multi-arm experiment'],
|
|
109
|
+
['session-export ...', 'Write a Session bundle to a file'],
|
|
110
|
+
['session-import ...', 'Read a Session bundle back into a workspace'],
|
|
111
|
+
['update ...', 'Update this npm-global CLI and its local Runtime Host'],
|
|
112
|
+
['runtime-host ...', 'Serve and manage a Runtime Host'],
|
|
113
|
+
].map(([name, summary], _index, entries) => {
|
|
114
|
+
// A custom launcher ("npm run cli:dev --") is far wider than `maka`, so the
|
|
115
|
+
// column is measured, never assumed.
|
|
116
|
+
const width = Math.max(...entries.map(([other]) => `${cliCommand} ${other}`.trimEnd().length));
|
|
117
|
+
return ` ${`${cliCommand} ${name}`.trimEnd().padEnd(width + 2)}${summary}`;
|
|
118
|
+
}),
|
|
142
119
|
'',
|
|
143
120
|
'Options:',
|
|
144
121
|
' -h, --help Show help',
|
|
@@ -147,70 +124,8 @@ function helpText(cliCommand) {
|
|
|
147
124
|
' --resume <id> --cwd <path> Reopen a session after its directory moved',
|
|
148
125
|
' --host <profile-id> Connect the TUI to a saved Runtime Host profile',
|
|
149
126
|
' --project <project-id> Select an existing Project on a remote Host',
|
|
150
|
-
' MAKA_RUNTIME_HOST_ACCESS_CREDENTIAL Access credential used by runtime-host profile set',
|
|
151
|
-
'',
|
|
152
|
-
'Runtime Host serve options:',
|
|
153
|
-
' --root <path> Select the canonical data root',
|
|
154
|
-
' --project-root <label>=<path> Publish an absolute project directory root (repeatable)',
|
|
155
|
-
' --no-project-roots Disable remote project browsing and registration',
|
|
156
|
-
' --websocket-port <port> Enable an authenticated WebSocket listener',
|
|
157
|
-
' --websocket-host <host> Bind host (default: 127.0.0.1)',
|
|
158
|
-
' --websocket-path <path> Upgrade path (default: /runtime-host)',
|
|
159
|
-
' --tls-certificate <path> TLS certificate for WSS',
|
|
160
|
-
' --tls-private-key <path> TLS private key for WSS',
|
|
161
|
-
' --allow-insecure-remote Allow plaintext WebSocket access beyond loopback',
|
|
162
|
-
' --allow-origin <origin> Allow one browser Origin (repeatable)',
|
|
163
|
-
' --peer-native-path <path> Load the experimental direct-peer native module',
|
|
164
|
-
' --peer-key <path> Persist the direct-peer transport identity',
|
|
165
|
-
' --peer-id <id> Require an existing direct-peer transport identity',
|
|
166
|
-
' --peer-listen <multiaddr> Listen on a direct-peer address (repeatable)',
|
|
167
|
-
' --peer-coordination-relay <multiaddr> Use a DCUtR coordination relay (repeatable)',
|
|
168
|
-
' --json Emit one machine-readable ready event',
|
|
169
|
-
'',
|
|
170
|
-
'Managed Runtime Host service install options (Linux or macOS):',
|
|
171
|
-
' --root <path> Select the canonical data root',
|
|
172
|
-
' --project-root <label>=<path> Publish an absolute directory root (repeatable)',
|
|
173
|
-
' --no-project-roots Disable remote project browsing and registration',
|
|
174
|
-
' --websocket-port <port> Persist a loopback port (chosen automatically by default)',
|
|
175
|
-
' --websocket-path <path> Persist the upgrade path (default: /runtime-host)',
|
|
176
|
-
' --json Emit a machine-readable result',
|
|
177
|
-
'',
|
|
178
|
-
'Managed Runtime Host setup options (Linux or macOS):',
|
|
179
|
-
' --principal <id> Stable Client pairing identity',
|
|
180
|
-
' --preset <name> Pair a desktop-client or terminal-client',
|
|
181
|
-
' --root <path> Select the canonical data root',
|
|
182
|
-
' --project-root <label>=<path> Publish an absolute directory root (repeatable)',
|
|
183
|
-
' --no-project-roots Disable remote project browsing and registration',
|
|
184
|
-
' --websocket-port <port> Persist a loopback port (chosen automatically by default)',
|
|
185
|
-
' --websocket-path <path> Persist the upgrade path (default: /runtime-host)',
|
|
186
|
-
' --json Emit framed machine-readable progress and result records',
|
|
187
|
-
'',
|
|
188
|
-
'Managed Runtime Host direct-peer options:',
|
|
189
|
-
' --listen <multiaddr> Persist a listener address (repeatable)',
|
|
190
|
-
' --coordination-relay <addr> Prefer a Circuit Relay v2 address (repeatable)',
|
|
191
|
-
' --clear-coordination-relays Remove every manually configured relay',
|
|
192
|
-
' --automatic-relay-discovery Enable best-effort public relay discovery',
|
|
193
|
-
' --no-automatic-relay-discovery Disable public discovery and retain manual relays',
|
|
194
|
-
' --default-public-stun Use the packaged best-effort public STUN policy',
|
|
195
|
-
' --no-public-stun Disable public STUN and keep host candidates only',
|
|
196
|
-
' --webrtc-stun <stun-url> Use a custom STUN endpoint (repeatable)',
|
|
197
|
-
'',
|
|
198
|
-
'Runtime Host access issue options:',
|
|
199
|
-
' --root <path> Select the canonical data root',
|
|
200
|
-
' --kind <kind> remote-owner or capability-provider',
|
|
201
|
-
' --principal <id> Name the authenticated Client principal',
|
|
202
|
-
' --grant <operation> Grant one exact operation (repeatable)',
|
|
203
|
-
' --preset <name> Grant the desktop-client or terminal-client operation set',
|
|
204
|
-
' --publish-client-capabilities Allow Client Capability publication',
|
|
205
|
-
' --allow-host-paths Allow operations that submit Host paths',
|
|
206
|
-
' --capability-owner-credential <id> Bind a provider to one Client-bound owner credential',
|
|
207
127
|
'',
|
|
208
|
-
|
|
209
|
-
' --url <ws-url> Connect to an authenticated Runtime Host WebSocket',
|
|
210
|
-
' --mcp-config <path> Publish tools from an MCP configuration file',
|
|
211
|
-
' --expected-root <root-id> Pin the canonical Runtime Host root identity',
|
|
212
|
-
' --credential-env <name> Read the access credential from this environment variable',
|
|
213
|
-
' --client-identity <path> Persist the provider Client instance identity here',
|
|
128
|
+
`Run \`${cliCommand} <command> --help\` for a command's own options.`,
|
|
214
129
|
].join('\n');
|
|
215
130
|
}
|
|
216
131
|
export async function runMakaCli(argv = process.argv.slice(2), options = RELEASE_MAKA_CLI_LAUNCH_OPTIONS) {
|
package/dist/runtime-host-cli.js
CHANGED
|
@@ -21,7 +21,14 @@ import { isProductReleaseVersion, isSha512PackageIntegrity, } from '@maka/runtim
|
|
|
21
21
|
import { createRuntimeHostLegacyPosixOperatorCommand, decodeRuntimeHostPosixOperatorCommand, decodeRuntimeHostWebRtcStunPolicy, } from '@maka/runtime-host/operator';
|
|
22
22
|
import { canonicalProjectDirectoryRootSpec, isCanonicalRuntimeHostWebSocketPath, PROJECT_DIRECTORY_MAX_ROOTS, projectDirectoryPosixRootSpecValid, projectDirectoryRootSpecValid, } from '@maka/runtime-host/protocol';
|
|
23
23
|
import { hasEphemeralRuntimeHostPeerPort } from './runtime-host-peer-artifact.js';
|
|
24
|
-
|
|
24
|
+
import { installedUpdateHelpText, isRuntimeHostHelpTopic, runtimeHostCommandHelpText, runtimeHostHelpText, } from './runtime-host-help.js';
|
|
25
|
+
export function parseRuntimeHostCommand(argv, cliCommand = 'maka') {
|
|
26
|
+
if (!argv[0] || argv[0] === '--help' || argv[0] === '-h') {
|
|
27
|
+
return { kind: 'help', text: runtimeHostHelpText(cliCommand) };
|
|
28
|
+
}
|
|
29
|
+
if ((argv[1] === '--help' || argv[1] === '-h') && isRuntimeHostHelpTopic(argv[0])) {
|
|
30
|
+
return { kind: 'help', text: runtimeHostCommandHelpText(cliCommand, argv[0]) };
|
|
31
|
+
}
|
|
25
32
|
if (argv[0] === 'activate' || argv[0] === 'connect') {
|
|
26
33
|
return parseManagedRootFramedCommand(argv[0], argv.slice(1));
|
|
27
34
|
}
|
|
@@ -48,9 +55,7 @@ export function parseRuntimeHostCommand(argv) {
|
|
|
48
55
|
}
|
|
49
56
|
if (argv[0] === 'profile')
|
|
50
57
|
return parseProfileCommand(argv.slice(1));
|
|
51
|
-
return error(argv[0]
|
|
52
|
-
? `Unexpected runtime-host command: ${argv[0]}`
|
|
53
|
-
: 'runtime-host requires the activate, connect, serve, setup, service, access, project, plugin, profile, or capability-provider command');
|
|
58
|
+
return error(`Unexpected runtime-host command: ${argv[0]}`);
|
|
54
59
|
}
|
|
55
60
|
function parseManagedRootFramedCommand(action, argv) {
|
|
56
61
|
let rootId;
|
|
@@ -93,7 +98,10 @@ function parseManagedRootFramedCommand(action, argv) {
|
|
|
93
98
|
...(repairRootAfterRemount ? { repairRootAfterRemount: true } : {}),
|
|
94
99
|
};
|
|
95
100
|
}
|
|
96
|
-
export function parseRuntimeHostInstalledUpdateCommand(argv) {
|
|
101
|
+
export function parseRuntimeHostInstalledUpdateCommand(argv, cliCommand = 'maka') {
|
|
102
|
+
if (argv[0] === '--help' || argv[0] === '-h') {
|
|
103
|
+
return { kind: 'help', text: installedUpdateHelpText(cliCommand) };
|
|
104
|
+
}
|
|
97
105
|
let target;
|
|
98
106
|
let allowInterruptActiveTasks = false;
|
|
99
107
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
const SUBCOMMANDS = {
|
|
20
|
+
activate: {
|
|
21
|
+
summary: 'Run one framed activation against a managed root',
|
|
22
|
+
lines: (cliCommand) => [
|
|
23
|
+
` ${cliCommand} runtime-host activate --framed --root-id <id>`,
|
|
24
|
+
` ${cliCommand} runtime-host connect --framed --root-id <id>`,
|
|
25
|
+
'',
|
|
26
|
+
'Managed root options:',
|
|
27
|
+
' --framed Frame stdio for a supervising parent',
|
|
28
|
+
' --root-id <id> Pin the canonical Runtime Host root identity',
|
|
29
|
+
' --repair-root-after-remount Repair the root after its volume was remounted',
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
serve: {
|
|
33
|
+
summary: 'Run a Runtime Host service',
|
|
34
|
+
lines: (cliCommand) => [
|
|
35
|
+
` ${cliCommand} runtime-host serve [options] Run a Runtime Host service`,
|
|
36
|
+
'',
|
|
37
|
+
'Options:',
|
|
38
|
+
' --root <path> Select the canonical data root',
|
|
39
|
+
' --project-root <label>=<path> Publish an absolute project directory root (repeatable)',
|
|
40
|
+
' --no-project-roots Disable remote project browsing and registration',
|
|
41
|
+
' --websocket-port <port> Enable an authenticated WebSocket listener',
|
|
42
|
+
' --websocket-host <host> Bind host (default: 127.0.0.1)',
|
|
43
|
+
' --websocket-path <path> Upgrade path (default: /runtime-host)',
|
|
44
|
+
' --tls-certificate <path> TLS certificate for WSS',
|
|
45
|
+
' --tls-private-key <path> TLS private key for WSS',
|
|
46
|
+
' --allow-insecure-remote Allow plaintext WebSocket access beyond loopback',
|
|
47
|
+
' --allow-origin <origin> Allow one browser Origin (repeatable)',
|
|
48
|
+
' --peer-native-path <path> Load the experimental direct-peer native module',
|
|
49
|
+
' --peer-key <path> Persist the direct-peer transport identity',
|
|
50
|
+
' --peer-id <id> Require an existing direct-peer transport identity',
|
|
51
|
+
' --peer-listen <multiaddr> Listen on a direct-peer address (repeatable)',
|
|
52
|
+
' --peer-coordination-relay <multiaddr> Use a DCUtR coordination relay (repeatable)',
|
|
53
|
+
' --json Emit one machine-readable ready event',
|
|
54
|
+
'',
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
setup: {
|
|
58
|
+
summary: 'Provision a managed Runtime Host',
|
|
59
|
+
lines: (cliCommand) => [
|
|
60
|
+
` ${cliCommand} runtime-host setup --principal <id> --preset <desktop-client|terminal-client> [options]`,
|
|
61
|
+
'',
|
|
62
|
+
'Options (Linux or macOS):',
|
|
63
|
+
' --principal <id> Stable Client pairing identity',
|
|
64
|
+
' --preset <name> Pair a desktop-client or terminal-client',
|
|
65
|
+
' --root <path> Select the canonical data root',
|
|
66
|
+
' --project-root <label>=<path> Publish an absolute directory root (repeatable)',
|
|
67
|
+
' --no-project-roots Disable remote project browsing and registration',
|
|
68
|
+
' --websocket-port <port> Persist a loopback port (chosen automatically by default)',
|
|
69
|
+
' --websocket-path <path> Persist the upgrade path (default: /runtime-host)',
|
|
70
|
+
' --json Emit framed machine-readable progress and result records',
|
|
71
|
+
'',
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
service: {
|
|
75
|
+
summary: 'Install and operate the managed service',
|
|
76
|
+
lines: (cliCommand) => [
|
|
77
|
+
` ${cliCommand} runtime-host service install [options]`,
|
|
78
|
+
` ${cliCommand} runtime-host service configure (--project-root <label>=<path> ... | --no-project-roots) --expected-config-fingerprint <sha256:...> --expected-service-id <id> --expected-root-path <path> --expected-root-id <id> [--allow-interrupt-active-tasks]`,
|
|
79
|
+
` ${cliCommand} runtime-host service status|start|stop|restart|logs [--json]`,
|
|
80
|
+
` ${cliCommand} runtime-host service uninstall --expected-service-id <id> --expected-root-path <path> --expected-root-id <id> [--allow-interrupt-active-tasks]`,
|
|
81
|
+
` ${cliCommand} runtime-host service peer enable|disable|status|rotate|descriptor [options]`,
|
|
82
|
+
` ${cliCommand} runtime-host service mesh status|create|invite|join|remove|leave|close|reconcile [options]`,
|
|
83
|
+
` ${cliCommand} runtime-host service retire --expected-service-id <id> --expected-root-path <path> --expected-root-id <id> [--allow-interrupt-active-tasks]`,
|
|
84
|
+
` ${cliCommand} runtime-host service check-update --target <latest|next|version> [--json]`,
|
|
85
|
+
` ${cliCommand} runtime-host service update [--target <latest|next|version>] --expected-service-id <id> --expected-root-path <path> --expected-root-id <id> [--allow-interrupt-active-tasks]`,
|
|
86
|
+
` ${cliCommand} runtime-host service update-policy [--target <manual|latest|next|version>] [--json]`,
|
|
87
|
+
` ${cliCommand} runtime-host service reconcile-update [--json]`,
|
|
88
|
+
'',
|
|
89
|
+
'Install options (Linux or macOS):',
|
|
90
|
+
' --root <path> Select the canonical data root',
|
|
91
|
+
' --project-root <label>=<path> Publish an absolute directory root (repeatable)',
|
|
92
|
+
' --no-project-roots Disable remote project browsing and registration',
|
|
93
|
+
' --websocket-port <port> Persist a loopback port (chosen automatically by default)',
|
|
94
|
+
' --websocket-path <path> Persist the upgrade path (default: /runtime-host)',
|
|
95
|
+
' --json Emit a machine-readable result',
|
|
96
|
+
'',
|
|
97
|
+
'',
|
|
98
|
+
'Direct-peer options:',
|
|
99
|
+
' --listen <multiaddr> Persist a listener address (repeatable)',
|
|
100
|
+
' --coordination-relay <addr> Prefer a Circuit Relay v2 address (repeatable)',
|
|
101
|
+
' --clear-coordination-relays Remove every manually configured relay',
|
|
102
|
+
' --automatic-relay-discovery Enable best-effort public relay discovery',
|
|
103
|
+
' --no-automatic-relay-discovery Disable public discovery and retain manual relays',
|
|
104
|
+
' --default-public-stun Use the packaged best-effort public STUN policy',
|
|
105
|
+
' --no-public-stun Disable public STUN and keep host candidates only',
|
|
106
|
+
' --webrtc-stun <stun-url> Use a custom STUN endpoint (repeatable)',
|
|
107
|
+
'',
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
access: {
|
|
111
|
+
summary: 'Issue and revoke access credentials',
|
|
112
|
+
lines: (cliCommand) => [
|
|
113
|
+
` ${cliCommand} runtime-host access issue --principal <id> --grant <operation>`,
|
|
114
|
+
` ${cliCommand} runtime-host access issue --principal <id> --preset <desktop-client|terminal-client>`,
|
|
115
|
+
` ${cliCommand} runtime-host access connection-code [--name <name>] [--root <path>]`,
|
|
116
|
+
` ${cliCommand} runtime-host access list`,
|
|
117
|
+
` ${cliCommand} runtime-host access issue --kind capability-provider --principal <id>`,
|
|
118
|
+
` ${cliCommand} runtime-host access revoke --credential <id>`,
|
|
119
|
+
'',
|
|
120
|
+
'Issue options:',
|
|
121
|
+
' --root <path> Select the canonical data root',
|
|
122
|
+
' --kind <kind> remote-owner or capability-provider',
|
|
123
|
+
' --principal <id> Name the authenticated Client principal',
|
|
124
|
+
' --grant <operation> Grant one exact operation (repeatable)',
|
|
125
|
+
' --preset <name> Grant the desktop-client or terminal-client operation set',
|
|
126
|
+
' --publish-client-capabilities Allow Client Capability publication',
|
|
127
|
+
' --allow-host-paths Allow operations that submit Host paths',
|
|
128
|
+
' --capability-owner-credential <id> Bind a provider to one Client-bound owner credential',
|
|
129
|
+
'',
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
project: {
|
|
133
|
+
summary: 'Register project directory roots',
|
|
134
|
+
lines: (cliCommand) => [
|
|
135
|
+
` ${cliCommand} runtime-host project list [--root <path>]`,
|
|
136
|
+
` ${cliCommand} runtime-host project add <path> [--prefer] [--root <path>]`,
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
plugin: {
|
|
140
|
+
summary: 'Install and inspect plugins',
|
|
141
|
+
lines: (cliCommand) => [
|
|
142
|
+
` ${cliCommand} runtime-host plugin status|list|inspect|failures [--root <path>]`,
|
|
143
|
+
` ${cliCommand} runtime-host plugin install|uninstall|reload <target> [--root <path>]`,
|
|
144
|
+
` ${cliCommand} runtime-host plugin export <extension-id> <bundle-path> [--root <path>]`,
|
|
145
|
+
` ${cliCommand} runtime-host plugin apply <operations.json> [--root <path>]`,
|
|
146
|
+
` ${cliCommand} runtime-host plugin reconcile [--root <path>]`,
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
profile: {
|
|
150
|
+
summary: 'Save and select remote Host profiles',
|
|
151
|
+
lines: (cliCommand) => [
|
|
152
|
+
` ${cliCommand} runtime-host profile list`,
|
|
153
|
+
` ${cliCommand} runtime-host profile set --id <id> --name <name> --tls-url <wss-url> --expected-root <root-id> [--credential-env <name>]`,
|
|
154
|
+
` ${cliCommand} runtime-host profile set --id <id> --name <name> --ssh-destination <user@host> --ssh-remote-port <port> --expected-root <root-id> [--ssh-port <port>] [--credential-env <name>]`,
|
|
155
|
+
` ${cliCommand} runtime-host profile set --id <id> --name <name> --plaintext-url <ws-url> --acknowledge-plaintext --expected-root <root-id> [--credential-env <name>]`,
|
|
156
|
+
` ${cliCommand} runtime-host profile remove --id <id>`,
|
|
157
|
+
'',
|
|
158
|
+
'Environment:',
|
|
159
|
+
' MAKA_RUNTIME_HOST_ACCESS_CREDENTIAL Access credential used when --credential-env is omitted',
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
'capability-provider': {
|
|
163
|
+
summary: 'Publish MCP tools to a Host',
|
|
164
|
+
lines: (cliCommand) => [
|
|
165
|
+
` ${cliCommand} runtime-host capability-provider serve --url <ws-url> --mcp-config <path> --expected-root <root-id>`,
|
|
166
|
+
'',
|
|
167
|
+
'Options:',
|
|
168
|
+
' --url <ws-url> Connect to an authenticated Runtime Host WebSocket',
|
|
169
|
+
' --mcp-config <path> Publish tools from an MCP configuration file',
|
|
170
|
+
' --expected-root <root-id> Pin the canonical Runtime Host root identity',
|
|
171
|
+
' --credential-env <name> Read the access credential from this environment variable',
|
|
172
|
+
' --client-identity <path> Persist the provider Client instance identity here',
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
export function isRuntimeHostHelpTopic(value) {
|
|
177
|
+
return Object.hasOwn(SUBCOMMANDS, value);
|
|
178
|
+
}
|
|
179
|
+
/** Overview of the Runtime Host commands, one line each. */
|
|
180
|
+
export function runtimeHostHelpText(cliCommand) {
|
|
181
|
+
return [
|
|
182
|
+
`Usage: ${cliCommand} runtime-host <command> [options]`,
|
|
183
|
+
'',
|
|
184
|
+
'Serves and manages a Runtime Host: the background service that runs Sessions.',
|
|
185
|
+
'',
|
|
186
|
+
'Commands:',
|
|
187
|
+
...Object.entries(SUBCOMMANDS).map(([name, topic]) => ` ${name.padEnd(20)}${topic.summary}`),
|
|
188
|
+
'',
|
|
189
|
+
`Run \`${cliCommand} runtime-host <command> --help\` for its own options.`,
|
|
190
|
+
].join('\n');
|
|
191
|
+
}
|
|
192
|
+
/** A lone command line that only repeats the Usage grammar adds nothing to its screen. */
|
|
193
|
+
function withoutRedundantUsage(lines, usage) {
|
|
194
|
+
const rest = lines[0]?.trim().startsWith(usage) ? lines.slice(1) : lines;
|
|
195
|
+
const body = rest[0]?.trim() === '' ? rest.slice(1) : rest;
|
|
196
|
+
// A screen that still opens on command lines needs the heading its option
|
|
197
|
+
// sections already carry.
|
|
198
|
+
return body[0]?.startsWith(' ') && !body[0].trim().startsWith('-')
|
|
199
|
+
? ['Commands:', ...body]
|
|
200
|
+
: body;
|
|
201
|
+
}
|
|
202
|
+
/** Every command line and option belonging to one Runtime Host command. */
|
|
203
|
+
export function runtimeHostCommandHelpText(cliCommand, topic) {
|
|
204
|
+
return [
|
|
205
|
+
`Usage: ${cliCommand} runtime-host ${topic} [options]`,
|
|
206
|
+
'',
|
|
207
|
+
...withoutRedundantUsage(SUBCOMMANDS[topic].lines(cliCommand), `${cliCommand} runtime-host ${topic} [options]`),
|
|
208
|
+
].join('\n');
|
|
209
|
+
}
|
|
210
|
+
/** `maka update` manages the npm-global CLI, so it sits outside the Host topics. */
|
|
211
|
+
export function installedUpdateHelpText(cliCommand) {
|
|
212
|
+
return [
|
|
213
|
+
`Usage: ${cliCommand} update [options]`,
|
|
214
|
+
'',
|
|
215
|
+
'Updates this npm-global CLI and the Runtime Host it manages locally.',
|
|
216
|
+
'',
|
|
217
|
+
'Options:',
|
|
218
|
+
' --target <latest|next|version> Select the release to install',
|
|
219
|
+
' --allow-interrupt-active-tasks Update even while the Host has running work',
|
|
220
|
+
].join('\n');
|
|
221
|
+
}
|
|
222
|
+
/** Session bundles move a Session between workspaces; neither side takes flags beyond these. */
|
|
223
|
+
export function sessionBundleHelpText(cliCommand, command) {
|
|
224
|
+
return command === 'session-export'
|
|
225
|
+
? [
|
|
226
|
+
`Usage: ${cliCommand} session-export --workspace-root <dir> --session <id> --out <file.maka-session>`,
|
|
227
|
+
'',
|
|
228
|
+
'Writes one Session and its transcript to a portable bundle.',
|
|
229
|
+
'',
|
|
230
|
+
'Options:',
|
|
231
|
+
' --workspace-root <dir> Workspace holding the Session',
|
|
232
|
+
' --session <id> Session to export',
|
|
233
|
+
' --out <file> Bundle path to write',
|
|
234
|
+
].join('\n')
|
|
235
|
+
: [
|
|
236
|
+
`Usage: ${cliCommand} session-import --workspace-root <dir> --bundle <file.maka-session>`,
|
|
237
|
+
'',
|
|
238
|
+
'Reads a Session bundle back into a workspace.',
|
|
239
|
+
'',
|
|
240
|
+
'Options:',
|
|
241
|
+
' --workspace-root <dir> Workspace to import into',
|
|
242
|
+
' --bundle <file> Bundle path to read',
|
|
243
|
+
].join('\n');
|
|
244
|
+
}
|
|
Binary file
|