@agentproto/cli 0.1.0-alpha.9 → 0.1.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/README.md +4 -4
- package/dist/cli.mjs +33 -9
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +28 -6
- package/dist/index.mjs.map +1 -1
- package/dist/registry/builtins.mjs +1 -1
- package/dist/registry/manifest.mjs +1 -1
- package/dist/registry/plugins.mjs +1 -1
- package/dist/registry/runtime.mjs +1 -1
- package/dist/util/credentials.mjs +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/
|
|
|
24
24
|
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* @agentproto/cli v0.1.
|
|
27
|
+
* @agentproto/cli v0.1.1
|
|
28
28
|
* The `agentproto` binary — install / run / serve AIP-45 agent CLIs.
|
|
29
29
|
*/
|
|
30
30
|
|
|
@@ -6263,12 +6263,34 @@ async function runServe(args) {
|
|
|
6263
6263
|
port: { type: "string", short: "p" },
|
|
6264
6264
|
bind: { type: "string", short: "b" },
|
|
6265
6265
|
"allow-origin": { type: "string", multiple: true },
|
|
6266
|
-
interactive: { type: "boolean", short: "i" }
|
|
6266
|
+
interactive: { type: "boolean", short: "i" },
|
|
6267
|
+
profile: { type: "string" }
|
|
6267
6268
|
}
|
|
6268
6269
|
});
|
|
6269
6270
|
const cfg = await loadConfig();
|
|
6270
|
-
const
|
|
6271
|
-
const
|
|
6271
|
+
const profileName = values.profile ?? cfg.activeProfile;
|
|
6272
|
+
const profile = profileName ? cfg.profiles?.[profileName] : void 0;
|
|
6273
|
+
if (values.profile && !profile) {
|
|
6274
|
+
process.stderr.write(
|
|
6275
|
+
`agentproto serve: profile "${values.profile}" not found in ~/.agentproto/config.json. Available: ${cfg.profiles ? Object.keys(cfg.profiles).join(", ") || "(none)" : "(no profiles block)"}
|
|
6276
|
+
`
|
|
6277
|
+
);
|
|
6278
|
+
return 2;
|
|
6279
|
+
}
|
|
6280
|
+
if (cfg.activeProfile && !values.profile && !profile) {
|
|
6281
|
+
process.stderr.write(
|
|
6282
|
+
`agentproto serve: \u26A0 activeProfile="${cfg.activeProfile}" but no matching entry in profiles[]; falling back to top-level config.
|
|
6283
|
+
`
|
|
6284
|
+
);
|
|
6285
|
+
}
|
|
6286
|
+
if (profile && process.stdout.isTTY) {
|
|
6287
|
+
process.stdout.write(
|
|
6288
|
+
`agentproto serve: using profile "${profileName}"
|
|
6289
|
+
`
|
|
6290
|
+
);
|
|
6291
|
+
}
|
|
6292
|
+
const cfgDaemon = { ...cfg.daemon ?? {}, ...profile?.daemon ?? {} };
|
|
6293
|
+
const cfgTunnel = { ...cfg.tunnel ?? {}, ...profile?.tunnel ?? {} };
|
|
6272
6294
|
const workspace = resolve(
|
|
6273
6295
|
values.workspace ?? cfgDaemon.workspace ?? process.cwd()
|
|
6274
6296
|
);
|
|
@@ -6297,7 +6319,7 @@ async function runServe(args) {
|
|
|
6297
6319
|
}
|
|
6298
6320
|
const label = values.label ?? cfgDaemon.label ?? `${userInfo().username}@${hostname()}`;
|
|
6299
6321
|
const connectFlag = values.connect ?? (cfgTunnel.autoconnect && cfgTunnel.host ? cfgTunnel.host : void 0);
|
|
6300
|
-
let token = values.token ?? process.env.AGENTPROTO_TOKEN;
|
|
6322
|
+
let token = values.token ?? process.env.AGENTPROTO_TOKEN ?? cfgTunnel.token;
|
|
6301
6323
|
if (!token && connectFlag) {
|
|
6302
6324
|
const cred = await readHost(connectFlag);
|
|
6303
6325
|
if (cred) {
|
|
@@ -6492,7 +6514,7 @@ ${color.dim}\u2500\u2500 shutting down (${signal}) \u2500\u2500${color.reset}
|
|
|
6492
6514
|
async function runOneTunnel(opts, gateway, spawnPty, signal, reconnectState) {
|
|
6493
6515
|
if (!opts.connect) throw new Error("runOneTunnel: --connect not set");
|
|
6494
6516
|
const headers = {
|
|
6495
|
-
"user-agent": "
|
|
6517
|
+
"user-agent": `agentproto/${"0.1.1"}`
|
|
6496
6518
|
};
|
|
6497
6519
|
if (opts.token) headers.authorization = `Bearer ${opts.token}`;
|
|
6498
6520
|
const ws = new WebSocket(opts.connect, { headers });
|