@a5c-ai/agent-mux-cli 0.4.0 → 0.4.1
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/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +4 -2
- package/dist/bootstrap.js.map +1 -1
- package/dist/commands/gateway/index.d.ts +6 -0
- package/dist/commands/gateway/index.d.ts.map +1 -0
- package/dist/commands/gateway/index.js +39 -0
- package/dist/commands/gateway/index.js.map +1 -0
- package/dist/commands/gateway/serve.d.ts +6 -0
- package/dist/commands/gateway/serve.d.ts.map +1 -0
- package/dist/commands/gateway/serve.js +67 -0
- package/dist/commands/gateway/serve.js.map +1 -0
- package/dist/commands/gateway/status.d.ts +3 -0
- package/dist/commands/gateway/status.d.ts.map +1 -0
- package/dist/commands/gateway/status.js +24 -0
- package/dist/commands/gateway/status.js.map +1 -0
- package/dist/commands/gateway/tokens.d.ts +3 -0
- package/dist/commands/gateway/tokens.d.ts.map +1 -0
- package/dist/commands/gateway/tokens.js +75 -0
- package/dist/commands/gateway/tokens.js.map +1 -0
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +50 -0
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/launch.d.ts +52 -0
- package/dist/commands/launch.d.ts.map +1 -0
- package/dist/commands/launch.js +580 -0
- package/dist/commands/launch.js.map +1 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +15 -11
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +164 -11
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +22 -3
- package/dist/commands/run.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-skill-paths.d.ts +1 -0
- package/dist/lib/agent-skill-paths.d.ts.map +1 -1
- package/dist/lib/agent-skill-paths.js +18 -2
- package/dist/lib/agent-skill-paths.js.map +1 -1
- package/dist/parse-args.d.ts.map +1 -1
- package/dist/parse-args.js +2 -0
- package/dist/parse-args.js.map +1 -1
- package/package.json +10 -4
package/dist/bootstrap.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The core `AdapterRegistry` starts empty — adapters must be explicitly
|
|
5
5
|
* registered. This module centralises that wiring so the CLI (and any
|
|
6
|
-
* consumer) gets all
|
|
6
|
+
* consumer) gets all built-in adapters with a single call.
|
|
7
7
|
*/
|
|
8
8
|
import type { AgentMuxClient } from '@a5c-ai/agent-mux-core';
|
|
9
9
|
/**
|
package/dist/bootstrap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AA0B7D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAgDpE"}
|
package/dist/bootstrap.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The core `AdapterRegistry` starts empty — adapters must be explicitly
|
|
5
5
|
* registered. This module centralises that wiring so the CLI (and any
|
|
6
|
-
* consumer) gets all
|
|
6
|
+
* consumer) gets all built-in adapters with a single call.
|
|
7
7
|
*/
|
|
8
|
-
import { ClaudeAdapter, ClaudeAgentSdkAdapter, CodexAdapter, CodexSdkAdapter, CodexWebSocketAdapter, DroidAdapter, AmpAdapter, GeminiAdapter, CopilotAdapter, CursorAdapter, OpenCodeAdapter, OpenCodeHttpAdapter, PiAdapter, PiSdkAdapter, OmpAdapter, OpenClawAdapter, HermesAdapter, AgentMuxRemoteAdapter, QwenAdapter, } from '@a5c-ai/agent-mux-adapters';
|
|
8
|
+
import { ClaudeAdapter, ClaudeAgentSdkAdapter, ClaudeRemoteControlAdapter, CodexAdapter, CodexSdkAdapter, CodexWebSocketAdapter, DroidAdapter, AmpAdapter, GeminiAdapter, CopilotAdapter, CursorAdapter, OpenCodeAdapter, OpenCodeHttpAdapter, PiAdapter, PiSdkAdapter, OmpAdapter, OpenClawAdapter, HermesAdapter, AgentMuxRemoteAdapter, QwenAdapter, BabysitterAdapter, } from '@a5c-ai/agent-mux-adapters';
|
|
9
9
|
/**
|
|
10
10
|
* Registers every built-in adapter on the given client's adapter registry.
|
|
11
11
|
* Safe to call multiple times — `register()` replaces existing entries.
|
|
@@ -14,6 +14,7 @@ export function registerBuiltInAdapters(client) {
|
|
|
14
14
|
const adapters = [
|
|
15
15
|
new ClaudeAdapter(),
|
|
16
16
|
new ClaudeAgentSdkAdapter(),
|
|
17
|
+
new ClaudeRemoteControlAdapter(),
|
|
17
18
|
new CodexAdapter(),
|
|
18
19
|
new CodexSdkAdapter(),
|
|
19
20
|
new CodexWebSocketAdapter(),
|
|
@@ -31,6 +32,7 @@ export function registerBuiltInAdapters(client) {
|
|
|
31
32
|
new HermesAdapter(),
|
|
32
33
|
new AgentMuxRemoteAdapter(),
|
|
33
34
|
new QwenAdapter(),
|
|
35
|
+
new BabysitterAdapter(),
|
|
34
36
|
];
|
|
35
37
|
// Prefer `registerBuiltIn` on the impl so the `source` shows as 'built-in';
|
|
36
38
|
// fall back to the public `register()` (which marks as 'plugin') for any
|
package/dist/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,WAAW,
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,0BAA0B,EAC1B,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAsB;IAC5D,MAAM,QAAQ,GAAwB;QACpC,IAAI,aAAa,EAAE;QACnB,IAAI,qBAAqB,EAAE;QAC3B,IAAI,0BAA0B,EAAE;QAChC,IAAI,YAAY,EAAE;QAClB,IAAI,eAAe,EAAE;QACrB,IAAI,qBAAqB,EAAE;QAC3B,IAAI,YAAY,EAAE;QAClB,IAAI,UAAU,EAAE;QAChB,IAAI,aAAa,EAAE;QACnB,IAAI,cAAc,EAAE;QACpB,IAAI,aAAa,EAAE;QACnB,IAAI,eAAe,EAAE;QACrB,IAAI,mBAAmB,EAAE;QACzB,IAAI,SAAS,EAAE;QACf,IAAI,YAAY,EAAE;QAClB,IAAI,UAAU,EAAE;QAChB,IAAI,eAAe,EAAE;QACrB,IAAI,aAAa,EAAE;QACnB,IAAI,qBAAqB,EAAE;QAC3B,IAAI,WAAW,EAAE;QACjB,IAAI,iBAAiB,EAAE;KACxB,CAAC;IAEF,4EAA4E;IAC5E,yEAAyE;IACzE,0EAA0E;IAC1E,MAAM,QAAQ,GAAG,MAAM,CAAC,QAGvB,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,IAAI,OAAO,QAAQ,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;gBACnD,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACpC,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,iEAAiE;YACjE,qEAAqE;YACrE,sCAAsC;YACtC,MAAM,IAAI,GAAI,OAA8B,CAAC,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC;YAC/E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,IAAI,KAAM,CAAW,CAAC,OAAO,IAAI,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentMuxClient } from '@a5c-ai/agent-mux-core';
|
|
2
|
+
import type { ParsedArgs } from '../../parse-args.js';
|
|
3
|
+
import type { FlagDef } from '../../parse-args.js';
|
|
4
|
+
export declare const GATEWAY_FLAGS: Record<string, FlagDef>;
|
|
5
|
+
export declare function gatewayCommand(_client: AgentMuxClient, args: ParsedArgs): Promise<number>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/gateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAQnD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAWjD,CAAC;AAEF,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB/F"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { flagBool } from '../../parse-args.js';
|
|
2
|
+
import { ExitCode } from '../../exit-codes.js';
|
|
3
|
+
import { printError, printJsonError } from '../../output.js';
|
|
4
|
+
import { serveGatewayCommand } from './serve.js';
|
|
5
|
+
import { gatewayStatusCommand } from './status.js';
|
|
6
|
+
import { gatewayTokensCommand } from './tokens.js';
|
|
7
|
+
export const GATEWAY_FLAGS = {
|
|
8
|
+
'config': { type: 'string' },
|
|
9
|
+
'host': { type: 'string' },
|
|
10
|
+
'port': { type: 'number' },
|
|
11
|
+
'webui': { type: 'string' },
|
|
12
|
+
'no-webui': { type: 'boolean' },
|
|
13
|
+
'url': { type: 'string' },
|
|
14
|
+
'name': { type: 'string' },
|
|
15
|
+
'ttl-ms': { type: 'number' },
|
|
16
|
+
'qr': { type: 'boolean' },
|
|
17
|
+
'id': { type: 'string' },
|
|
18
|
+
};
|
|
19
|
+
export async function gatewayCommand(_client, args) {
|
|
20
|
+
const sub = args.subcommand;
|
|
21
|
+
const jsonMode = flagBool(args.flags, 'json') === true;
|
|
22
|
+
if (sub === 'serve') {
|
|
23
|
+
return await serveGatewayCommand(args);
|
|
24
|
+
}
|
|
25
|
+
if (sub === 'status') {
|
|
26
|
+
return await gatewayStatusCommand(args);
|
|
27
|
+
}
|
|
28
|
+
if (sub === 'tokens') {
|
|
29
|
+
return await gatewayTokensCommand(args);
|
|
30
|
+
}
|
|
31
|
+
if (jsonMode) {
|
|
32
|
+
printJsonError('VALIDATION_ERROR', 'Missing subcommand. Available: serve, tokens, status');
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
printError('Missing subcommand. Available: serve, tokens, status');
|
|
36
|
+
}
|
|
37
|
+
return ExitCode.USAGE_ERROR;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/gateway/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC3B,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACzB,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAuB,EAAE,IAAgB;IAC5E,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC;IAC5B,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAEvD,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACpB,OAAO,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,OAAO,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,OAAO,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,cAAc,CAAC,kBAAkB,EAAE,sDAAsD,CAAC,CAAC;IAC7F,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,sDAAsD,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,QAAQ,CAAC,WAAW,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GatewayConfig } from '@a5c-ai/agent-mux-gateway';
|
|
2
|
+
import type { ParsedArgs } from '../../parse-args.js';
|
|
3
|
+
export declare const DEFAULT_GATEWAY_CONFIG_PATH: string;
|
|
4
|
+
export declare function loadGatewayConfig(configPath: string): Promise<Partial<GatewayConfig>>;
|
|
5
|
+
export declare function serveGatewayCommand(args: ParsedArgs): Promise<number>;
|
|
6
|
+
//# sourceMappingURL=serve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/commands/gateway/serve.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuC,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGpG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,eAAO,MAAM,2BAA2B,QAA4D,CAAC;AAErG,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAa3F;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAyC3E"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as fs from 'node:fs/promises';
|
|
2
|
+
import * as os from 'node:os';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { createGateway, resolveGatewayConfig } from '@a5c-ai/agent-mux-gateway';
|
|
5
|
+
import YAML from 'yaml';
|
|
6
|
+
import { flagBool, flagNum, flagStr } from '../../parse-args.js';
|
|
7
|
+
import { ExitCode } from '../../exit-codes.js';
|
|
8
|
+
import { printInfo, printJsonOk } from '../../output.js';
|
|
9
|
+
export const DEFAULT_GATEWAY_CONFIG_PATH = path.join(os.homedir(), '.amux', 'gateway', 'config.yml');
|
|
10
|
+
export async function loadGatewayConfig(configPath) {
|
|
11
|
+
try {
|
|
12
|
+
const raw = await fs.readFile(configPath, 'utf8');
|
|
13
|
+
if (configPath.endsWith('.json')) {
|
|
14
|
+
return JSON.parse(raw);
|
|
15
|
+
}
|
|
16
|
+
return YAML.parse(raw) ?? {};
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error.code === 'ENOENT') {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export async function serveGatewayCommand(args) {
|
|
26
|
+
const jsonMode = flagBool(args.flags, 'json') === true;
|
|
27
|
+
const configPath = flagStr(args.flags, 'config') ?? DEFAULT_GATEWAY_CONFIG_PATH;
|
|
28
|
+
const fileConfig = await loadGatewayConfig(configPath);
|
|
29
|
+
const config = resolveGatewayConfig({
|
|
30
|
+
...fileConfig,
|
|
31
|
+
host: flagStr(args.flags, 'host') ?? fileConfig.host,
|
|
32
|
+
port: flagNum(args.flags, 'port') ?? fileConfig.port,
|
|
33
|
+
webuiRoot: flagStr(args.flags, 'webui') ?? fileConfig.webuiRoot,
|
|
34
|
+
enableWebui: flagBool(args.flags, 'no-webui') === true ? false : (fileConfig.enableWebui ?? true),
|
|
35
|
+
});
|
|
36
|
+
const gateway = createGateway(config);
|
|
37
|
+
await gateway.start();
|
|
38
|
+
if (jsonMode) {
|
|
39
|
+
printJsonOk({
|
|
40
|
+
host: gateway.server.address.host,
|
|
41
|
+
port: gateway.server.address.port,
|
|
42
|
+
configPath,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
printInfo(`Gateway listening on http://${gateway.server.address.host}:${gateway.server.address.port}`);
|
|
47
|
+
}
|
|
48
|
+
await new Promise((resolve, reject) => {
|
|
49
|
+
let settled = false;
|
|
50
|
+
const finish = async () => {
|
|
51
|
+
if (settled)
|
|
52
|
+
return;
|
|
53
|
+
settled = true;
|
|
54
|
+
try {
|
|
55
|
+
await gateway.stop();
|
|
56
|
+
resolve();
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
reject(error);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
process.once('SIGINT', () => void finish());
|
|
63
|
+
process.once('SIGTERM', () => void finish());
|
|
64
|
+
});
|
|
65
|
+
return ExitCode.SUCCESS;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/commands/gateway/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAsB,MAAM,2BAA2B,CAAC;AACpG,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC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IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,OAAO,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/gateway/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAqB5E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { flagBool, flagStr } from '../../parse-args.js';
|
|
2
|
+
import { ExitCode } from '../../exit-codes.js';
|
|
3
|
+
import { printError, printJsonOk, printKeyValue } from '../../output.js';
|
|
4
|
+
export async function gatewayStatusCommand(args) {
|
|
5
|
+
const url = (flagStr(args.flags, 'url') ?? 'http://127.0.0.1:7878').replace(/\/+$/, '');
|
|
6
|
+
const response = await fetch(`${url}/healthz`);
|
|
7
|
+
if (!response.ok) {
|
|
8
|
+
printError(`Gateway health check failed: ${response.status}`);
|
|
9
|
+
return ExitCode.GENERAL_ERROR;
|
|
10
|
+
}
|
|
11
|
+
const payload = await response.json();
|
|
12
|
+
if (flagBool(args.flags, 'json') === true) {
|
|
13
|
+
printJsonOk(payload);
|
|
14
|
+
return ExitCode.SUCCESS;
|
|
15
|
+
}
|
|
16
|
+
printKeyValue([
|
|
17
|
+
['URL:', url],
|
|
18
|
+
['OK:', String(payload['ok'])],
|
|
19
|
+
['Version:', String(payload['serverVersion'] ?? '--')],
|
|
20
|
+
['Time:', String(payload['serverTime'] ?? '--')],
|
|
21
|
+
]);
|
|
22
|
+
return ExitCode.SUCCESS;
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C,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC;KACjD,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,OAAO,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/commands/gateway/tokens.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAqBtD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA6D5E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as os from 'node:os';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { MemoryTokenStore, SqliteTokenStore, resolveGatewayConfig } from '@a5c-ai/agent-mux-gateway';
|
|
4
|
+
import { flagBool, flagNum, flagStr } from '../../parse-args.js';
|
|
5
|
+
import { ExitCode } from '../../exit-codes.js';
|
|
6
|
+
import { printError, printJsonOk, printTable } from '../../output.js';
|
|
7
|
+
import { DEFAULT_GATEWAY_CONFIG_PATH, loadGatewayConfig } from './serve.js';
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
function resolveTokenStore(config) {
|
|
10
|
+
if (config.tokenStore)
|
|
11
|
+
return config.tokenStore;
|
|
12
|
+
if (config.tokenStoreKind === 'memory')
|
|
13
|
+
return new MemoryTokenStore();
|
|
14
|
+
return new SqliteTokenStore(config.tokenDbPath);
|
|
15
|
+
}
|
|
16
|
+
function renderQr(url, token) {
|
|
17
|
+
const qrcode = require('qrcode-terminal');
|
|
18
|
+
qrcode.generate(JSON.stringify({ url, token }), { small: true });
|
|
19
|
+
}
|
|
20
|
+
export async function gatewayTokensCommand(args) {
|
|
21
|
+
const jsonMode = flagBool(args.flags, 'json') === true;
|
|
22
|
+
const configPath = flagStr(args.flags, 'config') ?? DEFAULT_GATEWAY_CONFIG_PATH;
|
|
23
|
+
const config = resolveGatewayConfig(await loadGatewayConfig(configPath));
|
|
24
|
+
const store = resolveTokenStore(config);
|
|
25
|
+
const sub = args.positionals[0];
|
|
26
|
+
if (sub === 'list') {
|
|
27
|
+
const tokens = await store.list();
|
|
28
|
+
if (jsonMode) {
|
|
29
|
+
printJsonOk(tokens);
|
|
30
|
+
return ExitCode.SUCCESS;
|
|
31
|
+
}
|
|
32
|
+
printTable(['ID', 'Name', 'Created', 'Last Used', 'Revoked'], tokens.map((token) => [
|
|
33
|
+
token.id,
|
|
34
|
+
token.name,
|
|
35
|
+
new Date(token.createdAt).toISOString(),
|
|
36
|
+
token.lastUsedAt == null ? '--' : new Date(token.lastUsedAt).toISOString(),
|
|
37
|
+
token.revokedAt == null ? '--' : new Date(token.revokedAt).toISOString(),
|
|
38
|
+
]));
|
|
39
|
+
return ExitCode.SUCCESS;
|
|
40
|
+
}
|
|
41
|
+
if (sub === 'create') {
|
|
42
|
+
const name = flagStr(args.flags, 'name') ?? `token@${os.hostname()}`;
|
|
43
|
+
const created = await store.create({
|
|
44
|
+
name,
|
|
45
|
+
ttlMs: flagNum(args.flags, 'ttl-ms') ?? null,
|
|
46
|
+
});
|
|
47
|
+
if (jsonMode) {
|
|
48
|
+
printJsonOk(created);
|
|
49
|
+
return ExitCode.SUCCESS;
|
|
50
|
+
}
|
|
51
|
+
process.stdout.write(`Token: ${created.plaintext}\n`);
|
|
52
|
+
process.stdout.write(`ID: ${created.id}\n`);
|
|
53
|
+
if (flagBool(args.flags, 'qr') === true) {
|
|
54
|
+
renderQr(flagStr(args.flags, 'url') ?? 'http://127.0.0.1:7878', created.plaintext);
|
|
55
|
+
}
|
|
56
|
+
return ExitCode.SUCCESS;
|
|
57
|
+
}
|
|
58
|
+
if (sub === 'revoke') {
|
|
59
|
+
const id = args.positionals[1] ?? flagStr(args.flags, 'id');
|
|
60
|
+
if (!id) {
|
|
61
|
+
printError('Missing token id for revoke');
|
|
62
|
+
return ExitCode.USAGE_ERROR;
|
|
63
|
+
}
|
|
64
|
+
const revoked = await store.revoke(id);
|
|
65
|
+
if (jsonMode) {
|
|
66
|
+
printJsonOk({ revoked });
|
|
67
|
+
return ExitCode.SUCCESS;
|
|
68
|
+
}
|
|
69
|
+
process.stdout.write(revoked ? `Revoked ${id}\n` : `Token not found: ${id}\n`);
|
|
70
|
+
return revoked ? ExitCode.SUCCESS : ExitCode.GENERAL_ERROR;
|
|
71
|
+
}
|
|
72
|
+
printError('Missing or unknown tokens subcommand. Available: list, create, revoke');
|
|
73
|
+
return ExitCode.USAGE_ERROR;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/commands/gateway/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAsB,MAAM,2BAA2B,CAAC;AAGzH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,SAAS,iBAAiB,CAAC,MAAqB;IAC9C,IAAI,MAAM,CAAC,UAAU;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC;IAChD,IAAI,MAAM,CAAC,cAAc,KAAK,QAAQ;QAAE,OAAO,IAAI,gBAAgB,EAAE,C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C1B,CAAC;IAED,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC5D,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,6BAA6B,CAAC,CAAC;YAC1C,OAAO,QAAQ,CAAC,WAAW,CAAC;QAC9B,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,QAAQ,EAAE,CAAC;YACb,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YACzB,OAAO,QAAQ,CAAC,OAAO,CAAC;QAC1B,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;QAC/E,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC7D,CAAC;IAED,UAAU,CAAC,uEAAuE,CAAC,CAAC;IACpF,OAAO,QAAQ,CAAC,WAAW,CAAC;AAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgdH;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAMhD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
package/dist/commands/help.js
CHANGED
|
@@ -36,9 +36,11 @@ Commands:
|
|
|
36
36
|
mcp Manage MCP servers
|
|
37
37
|
skill Manage agent skills
|
|
38
38
|
agent Manage custom sub-agents
|
|
39
|
+
launch Launch a harness with provider config and stdin/stdout passthrough
|
|
39
40
|
detect-host Detect which agent harness we are running under
|
|
40
41
|
remote Install / update amux on a remote host
|
|
41
42
|
hooks Manage and dispatch unified agent hooks
|
|
43
|
+
gateway Run the browser/mobile gateway service
|
|
42
44
|
doctor Run environment health check
|
|
43
45
|
version Print version
|
|
44
46
|
help [command] Show help for a command
|
|
@@ -349,6 +351,54 @@ Examples:
|
|
|
349
351
|
amux hooks discover
|
|
350
352
|
amux hooks add --id trace-all --agent '*' --hook-type '*' --handler builtin --target trace
|
|
351
353
|
amux hooks install claude PreToolUse "amux hooks handle claude PreToolUse"
|
|
354
|
+
`,
|
|
355
|
+
launch: `amux launch - Launch a harness with provider/model config
|
|
356
|
+
|
|
357
|
+
Usage: amux launch <harness> [provider] [flags...]
|
|
358
|
+
|
|
359
|
+
Provider Flags:
|
|
360
|
+
--model, -m <model> Model identifier
|
|
361
|
+
--api-key <key> API key for the provider
|
|
362
|
+
--api-base <url> Custom API endpoint
|
|
363
|
+
--region <region> Cloud region (Bedrock, Vertex)
|
|
364
|
+
--project <id> Cloud project (Vertex, Foundry)
|
|
365
|
+
--transport, -t <proto> Wire protocol: anthropic, openai-chat, openai-responses, google
|
|
366
|
+
--auth-command <cmd> External command that emits a bearer token
|
|
367
|
+
|
|
368
|
+
Proxy Flags:
|
|
369
|
+
--with-proxy-if-needed Auto-launch amux-proxy if harness can't speak provider natively
|
|
370
|
+
--with-proxy Force proxy even if not needed
|
|
371
|
+
--no-proxy Disable proxy (error if needed)
|
|
372
|
+
--proxy-port <port> Proxy listen port (0=auto)
|
|
373
|
+
--proxy-log-level <level> Proxy log level (debug, info, warn, error)
|
|
374
|
+
|
|
375
|
+
Session Flags:
|
|
376
|
+
--prompt, -p <text> Non-interactive mode with prompt
|
|
377
|
+
--resume, -r <id> Resume session by ID
|
|
378
|
+
--session-id, -s <id> Explicit new session ID
|
|
379
|
+
--max-turns <n> Turn limit
|
|
380
|
+
--dry-run Print resolved plan as JSON, don't execute
|
|
381
|
+
|
|
382
|
+
Examples:
|
|
383
|
+
amux launch claude bedrock --region us-east-1
|
|
384
|
+
amux launch codex bedrock --with-proxy-if-needed -p "fix the bug"
|
|
385
|
+
amux launch gemini vertex --project my-proj --region us-central1
|
|
386
|
+
amux launch claude ollama --model qwen3:32b --with-proxy-if-needed
|
|
387
|
+
amux launch claude anthropic --dry-run
|
|
388
|
+
`,
|
|
389
|
+
gateway: `amux gateway - Gateway service and token management
|
|
390
|
+
|
|
391
|
+
Usage:
|
|
392
|
+
amux gateway serve [--config <path>] [--host <host>] [--port <port>] [--webui <path>] [--no-webui]
|
|
393
|
+
amux gateway tokens list [--config <path>]
|
|
394
|
+
amux gateway tokens create [--config <path>] [--name <name>] [--ttl-ms <ms>] [--qr] [--url <url>]
|
|
395
|
+
amux gateway tokens revoke <id> [--config <path>]
|
|
396
|
+
amux gateway status [--url <url>]
|
|
397
|
+
|
|
398
|
+
Examples:
|
|
399
|
+
amux gateway serve
|
|
400
|
+
amux gateway tokens create --name phone --qr
|
|
401
|
+
amux gateway status --url http://127.0.0.1:7878
|
|
352
402
|
`,
|
|
353
403
|
doctor: `amux doctor - Health check for amux environment
|
|
354
404
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,SAAS,WAAW;IAClB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,OAAQ,OAAO,CAAC,oBAAoB,CAA0B,CAAC,OAAO,IAAI,OAAO,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IAC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AAE;;;;;;;;;;;;;;;;;;;;;CAqBT;IACC,OAAO,EAAE;;;;;;;;;;;CAWV;IACC,MAAM,EAAE;;;;;;;;;;;;;;;;;;;CAmBT;IACC,GAAG,EAAE;;;;;;;;;;;;CAYN;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBR;IACC,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCT;IACC,OAAO,EAAE;;;;;;;;;;;;;CAaV;IACC,MAAM,EAAE;;;;;;;;;;;;;CAaT;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBR;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBR;CACA,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAgB;IACxC,IAAI,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,OAAO,IAAI,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `amux launch` command implementation.
|
|
3
|
+
*
|
|
4
|
+
* Resolves a launch plan for a given harness+provider combination,
|
|
5
|
+
* optionally spawns amux-proxy, then exec-forks the harness with
|
|
6
|
+
* stdin/stdout passthrough and proper signal forwarding.
|
|
7
|
+
*/
|
|
8
|
+
import type { AgentMuxClient } from '@a5c-ai/agent-mux-core';
|
|
9
|
+
import type { TransportId } from '@a5c-ai/agent-mux-core';
|
|
10
|
+
import type { ParsedArgs, FlagDef } from '../parse-args.js';
|
|
11
|
+
/** Launch-specific flag definitions (global flags like model/json/debug are excluded). */
|
|
12
|
+
export declare const LAUNCH_FLAGS: Record<string, FlagDef>;
|
|
13
|
+
export interface LaunchPlanInput {
|
|
14
|
+
harness: string;
|
|
15
|
+
provider?: string;
|
|
16
|
+
model?: string;
|
|
17
|
+
transport?: string;
|
|
18
|
+
apiKey?: string;
|
|
19
|
+
apiBase?: string;
|
|
20
|
+
region?: string;
|
|
21
|
+
project?: string;
|
|
22
|
+
resourceGroup?: string;
|
|
23
|
+
endpointName?: string;
|
|
24
|
+
authCommand?: string;
|
|
25
|
+
proxyMode: 'always' | 'if-needed' | 'never';
|
|
26
|
+
proxyPort?: number;
|
|
27
|
+
adapter?: {
|
|
28
|
+
translateProvider?(config: Record<string, unknown>): any;
|
|
29
|
+
};
|
|
30
|
+
providerArgs?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export interface ProxyPlan {
|
|
33
|
+
targetProvider: string;
|
|
34
|
+
targetModel: string;
|
|
35
|
+
exposedTransport: TransportId;
|
|
36
|
+
port: number;
|
|
37
|
+
}
|
|
38
|
+
export interface LaunchPlan {
|
|
39
|
+
harness: string;
|
|
40
|
+
provider: string;
|
|
41
|
+
transport: string;
|
|
42
|
+
model: string;
|
|
43
|
+
proxyNeeded: boolean;
|
|
44
|
+
proxyReason: string;
|
|
45
|
+
proxy?: ProxyPlan;
|
|
46
|
+
command: string;
|
|
47
|
+
args: string[];
|
|
48
|
+
env: Record<string, string>;
|
|
49
|
+
}
|
|
50
|
+
export declare function resolveLaunchPlan(input: LaunchPlanInput): LaunchPlan;
|
|
51
|
+
export declare function launchCommand(client: AgentMuxClient, args: ParsedArgs): Promise<number>;
|
|
52
|
+
//# sourceMappingURL=launch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/commands/launch.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK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