@mutagent/cli 0.2.71 → 0.2.73
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 +2 -2
- package/dist/bin/cli.js +32 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -319,8 +319,8 @@ mutagent hooks import session.jsonl --dry-run # Upload Helix session transcrip
|
|
|
319
319
|
`mutagent install helix` downloads the Helix binary for macOS or Linux (x64 or arm64) from
|
|
320
320
|
`install.mutagent.io`, checks it against the published checksums, and writes
|
|
321
321
|
`~/.mutagent/bin/helix`. It never edits your shell rc files: when the directory is not on `PATH`,
|
|
322
|
-
it prints the line to add.
|
|
323
|
-
fails the install.
|
|
322
|
+
it prints the line to add. It also records the install (anonymously when you are not signed in);
|
|
323
|
+
that step never fails the install.
|
|
324
324
|
|
|
325
325
|
### Feedback
|
|
326
326
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -20353,11 +20353,12 @@ function assertSecureHost(host) {
|
|
|
20353
20353
|
return;
|
|
20354
20354
|
throw new MutagentError("INVALID_ARGUMENTS", `Refusing to install from ${host}: plaintext HTTP to a non-loopback host.`, "checksums.txt and the binary come from the same origin, so an attacker who can rewrite one can rewrite the other. Use an https:// MUTAGENT_INSTALL_HOST.");
|
|
20355
20355
|
}
|
|
20356
|
+
function installEnvFlags(env) {
|
|
20357
|
+
return { ci: Boolean(env.CI) || Boolean(env.GITHUB_ACTIONS), internal: env.MUTAGENT_INTERNAL === "1" };
|
|
20358
|
+
}
|
|
20356
20359
|
function helixInstallUserAgent(opts) {
|
|
20357
|
-
const {
|
|
20358
|
-
|
|
20359
|
-
const internal = env.MUTAGENT_INTERNAL === "1" ? 1 : 0;
|
|
20360
|
-
return `mutagent-cli/${opts.cliVersion} (helix-install; ${opts.platform}; ch=${opts.channel}; ci=${String(ci)}; internal=${String(internal)})`;
|
|
20360
|
+
const { ci, internal } = installEnvFlags(opts.env);
|
|
20361
|
+
return `mutagent-cli/${opts.cliVersion} (helix-install; ${opts.platform}; ch=${opts.channel}; ci=${ci ? "1" : "0"}; internal=${internal ? "1" : "0"})`;
|
|
20361
20362
|
}
|
|
20362
20363
|
async function fetchOrFail(fetchImpl, url, what, userAgent) {
|
|
20363
20364
|
let response;
|
|
@@ -20536,6 +20537,7 @@ async function installHelix(options, deps = {}) {
|
|
|
20536
20537
|
init_config();
|
|
20537
20538
|
init_organization_scope();
|
|
20538
20539
|
var TELEMETRY_TIMEOUT_MS = 1500;
|
|
20540
|
+
var ANONYMOUS_TELEMETRY_TIMEOUT_MS = 2000;
|
|
20539
20541
|
function resolveApiAuth() {
|
|
20540
20542
|
const apiKey = getApiKey();
|
|
20541
20543
|
const config = loadConfig();
|
|
@@ -20545,13 +20547,30 @@ function resolveApiAuth() {
|
|
|
20545
20547
|
async function reportInstall(event, deps = {}) {
|
|
20546
20548
|
try {
|
|
20547
20549
|
const auth = (deps.resolveAuth ?? resolveApiAuth)();
|
|
20548
|
-
|
|
20549
|
-
|
|
20550
|
+
const flags = installEnvFlags(deps.env ?? process.env);
|
|
20551
|
+
const fetchImpl = deps.fetchImpl ?? globalThis.fetch;
|
|
20552
|
+
if (!auth.apiKey) {
|
|
20553
|
+
const body = {
|
|
20554
|
+
source: "cli",
|
|
20555
|
+
version: event.version,
|
|
20556
|
+
channel: event.channel,
|
|
20557
|
+
platform: event.platform,
|
|
20558
|
+
...flags
|
|
20559
|
+
};
|
|
20560
|
+
const response = await fetchImpl(`${auth.apiBase}/api/helix/install-events`, {
|
|
20561
|
+
method: "POST",
|
|
20562
|
+
headers: { "Content-Type": "application/json" },
|
|
20563
|
+
body: JSON.stringify(body),
|
|
20564
|
+
signal: AbortSignal.timeout(deps.timeoutMs ?? ANONYMOUS_TELEMETRY_TIMEOUT_MS)
|
|
20565
|
+
});
|
|
20566
|
+
return response.ok ? "sent" : "failed";
|
|
20567
|
+
}
|
|
20550
20568
|
const body = {
|
|
20551
20569
|
...event,
|
|
20552
|
-
cliVersion: deps.cliVersion ?? process.env.CLI_VERSION ?? "unknown"
|
|
20570
|
+
cliVersion: deps.cliVersion ?? process.env.CLI_VERSION ?? "unknown",
|
|
20571
|
+
...flags
|
|
20553
20572
|
};
|
|
20554
|
-
const response = await
|
|
20573
|
+
const response = await fetchImpl(`${auth.apiBase}/api/helix/installs`, {
|
|
20555
20574
|
method: "POST",
|
|
20556
20575
|
headers: { "Content-Type": "application/json", "x-api-key": auth.apiKey, ...auth.headers },
|
|
20557
20576
|
body: JSON.stringify(body),
|
|
@@ -24033,8 +24052,8 @@ Success shape:
|
|
|
24033
24052
|
|
|
24034
24053
|
- \`version\` is what the installed binary printed for \`helix --version\`.
|
|
24035
24054
|
- \`pathLine\` is present only when \`onPath\` is false.
|
|
24036
|
-
- \`telemetry\` is \`sent
|
|
24037
|
-
changes the install result, so do not retry the install over it.
|
|
24055
|
+
- \`telemetry\` is \`sent\` or \`failed\` (the report is anonymous when not signed in);
|
|
24056
|
+
telemetry never changes the install result, so do not retry the install over it.
|
|
24038
24057
|
- \`aliasPath\` is absent when a regular file named \`mutagent-helix\` already
|
|
24039
24058
|
exists in the directory; the installer leaves that file alone.
|
|
24040
24059
|
|
|
@@ -26099,8 +26118,8 @@ AI Agent Directive:
|
|
|
26099
26118
|
This writes a binary to the user's machine: confirm with the user first.
|
|
26100
26119
|
Read binaryPath, version and onPath from --json. When onPath is false, show
|
|
26101
26120
|
the user pathLine; do not edit their shell rc files yourself.
|
|
26102
|
-
telemetry in --json is sent
|
|
26103
|
-
changes the install result.
|
|
26121
|
+
telemetry in --json is sent or failed (anonymous when not signed in); it
|
|
26122
|
+
never changes the install result.
|
|
26104
26123
|
Then tell the user to run helix in a project.
|
|
26105
26124
|
`).action(async (pkg, options) => {
|
|
26106
26125
|
const isJson = getJsonFlag(install);
|
|
@@ -38252,4 +38271,4 @@ if (process.env.CLI_VERSION) {
|
|
|
38252
38271
|
}
|
|
38253
38272
|
runCli(process.argv.slice(2), cliVersion);
|
|
38254
38273
|
|
|
38255
|
-
//# debugId=
|
|
38274
|
+
//# debugId=389E66258215409364756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutagent/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.73",
|
|
4
4
|
"description": "Bun-native CLI for the MutagenT AI platform - auth, provider config, and lifecycle-tool installer for AI-native workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "^8.7.2",
|
|
48
|
-
"@mutagent/sdk": "0.8.
|
|
48
|
+
"@mutagent/sdk": "0.8.34",
|
|
49
49
|
"@sinclair/typebox": "^0.34.0",
|
|
50
50
|
"chalk": "^5.3.0",
|
|
51
51
|
"commander": "^12.1.0",
|