@prohost/cli 0.12.3 → 0.12.4

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/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ Versions follow [semver](https://semver.org/). Publishing is automated: merging
4
4
  a version bump to `main` triggers `.github/workflows/npm-publish-cli.yml`, which
5
5
  builds via `prepack`, runs the suite, publishes, and tags `cli-v<version>`.
6
6
 
7
+ ## 0.12.4
8
+
9
+ - Refuse redirects on credentialed API writes and pairing requests, so a validated endpoint cannot replay keys or pairing codes to another destination. Direct HTTPS and local-loopback requests keep working.
10
+ - Reuse an existing usage or paired-agent key before reading implicit stdin. Explicit `usage connect --key -` still replaces the key from stdin; an unconnected pipe still supplies a key.
11
+
7
12
  ## 0.12.3
8
13
 
9
14
  - **A run stopped by the Claude usage limit says so.** It used to fail with
package/dist/agent/api.js CHANGED
@@ -65,6 +65,7 @@ export async function postJson(options, path, body, idempotencyKey, captureBody
65
65
  try {
66
66
  const response = await fetchImpl(`${options.baseUrl.replace(/\/+$/, '')}${path}`, {
67
67
  method: 'POST',
68
+ redirect: 'error',
68
69
  headers: {
69
70
  'Content-Type': 'application/json',
70
71
  'X-API-Key': options.apiKey,
@@ -127,6 +127,7 @@ export async function runPair(options) {
127
127
  try {
128
128
  response = await fetchImpl(`${baseUrl}${bound ? REDEEM_BOUND_PATH : REDEEM_PATH}`, {
129
129
  method: 'POST',
130
+ redirect: 'error',
130
131
  headers: { 'Content-Type': 'application/json', 'User-Agent': USER_AGENT },
131
132
  body: JSON.stringify({
132
133
  code: options.code,
@@ -88,8 +88,8 @@ export function renderDiscovery(result, env, dryRun) {
88
88
  /**
89
89
  * The key `connect` should store, in order: `--key -` (stdin, or a hidden
90
90
  * prompt at a terminal), a literal `--key <value>` (warned about), then
91
- * `$PROHOST_API_KEY`, then piped stdin, then — at a terminal, with no
92
- * credential to fall back on — a hidden prompt. `undefined` means "none given";
91
+ * `$PROHOST_API_KEY`, then an existing credential, then piped stdin or — at a
92
+ * terminal — a hidden prompt. `undefined` means "none given";
93
93
  * `null` means a usage error that has already been printed.
94
94
  */
95
95
  async function connectKey(flags, io, env) {
@@ -109,12 +109,12 @@ async function connectKey(flags, io, env) {
109
109
  }
110
110
  if (env.PROHOST_API_KEY)
111
111
  return env.PROHOST_API_KEY.trim();
112
- if (!stdin.isTTY)
113
- return readPipedKey(stdin);
114
- // At a terminal: prompt only when there is nothing to fall back on, so a
115
- // connected machine (or one with a paired agent) is not asked again.
112
+ // Implicit stdin can be an open pipe without any key writer. An explicit
113
+ // --key - above still deliberately replaces a stored credential.
116
114
  if (resolveUsageKey(env))
117
115
  return undefined;
116
+ if (!stdin.isTTY)
117
+ return readPipedKey(stdin);
118
118
  return prompt();
119
119
  }
120
120
  async function connectCommand(flags, io) {
package/dist/version.d.ts CHANGED
@@ -7,6 +7,6 @@
7
7
  * `package.json`, so a release bump that forgets this file fails the suite
8
8
  * instead of shipping a `User-Agent` that lies about which build is calling.
9
9
  */
10
- export declare const CLI_VERSION = "0.12.3";
10
+ export declare const CLI_VERSION = "0.12.4";
11
11
  /** Sent on every HTTP request the CLI makes back into ProhostAI. */
12
- export declare const USER_AGENT = "prohost-cli/0.12.3";
12
+ export declare const USER_AGENT = "prohost-cli/0.12.4";
package/dist/version.js CHANGED
@@ -7,6 +7,6 @@
7
7
  * `package.json`, so a release bump that forgets this file fails the suite
8
8
  * instead of shipping a `User-Agent` that lies about which build is calling.
9
9
  */
10
- export const CLI_VERSION = '0.12.3';
10
+ export const CLI_VERSION = '0.12.4';
11
11
  /** Sent on every HTTP request the CLI makes back into ProhostAI. */
12
12
  export const USER_AGENT = `prohost-cli/${CLI_VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prohost/cli",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "Run your own AI agent as a ProhostAI teammate, and stream your account's webhooks to your laptop.",
5
5
  "type": "module",
6
6
  "license": "MIT",