@arcadeai/hypotenuse 0.14.0 → 0.14.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.
@@ -343,7 +343,7 @@ import { Command } from "commander";
343
343
  // package.json
344
344
  var package_default = {
345
345
  name: "@arcadeai/hypotenuse",
346
- version: "0.14.0",
346
+ version: "0.14.1",
347
347
  description: "Hypotenuse \u2014 run coding agents on your machine for Linear agent sessions",
348
348
  type: "module",
349
349
  license: "Apache-2.0",
@@ -3598,6 +3598,13 @@ async function resolveProjectId(client, selector) {
3598
3598
  }
3599
3599
  }
3600
3600
  }
3601
+ async function onlyProject(client) {
3602
+ const { projects, pagination } = await client.request("GET", "/projects", { query: { page: 1, limit: 2 } });
3603
+ return {
3604
+ project: pagination.total === 1 ? projects[0] ?? null : null,
3605
+ total: pagination.total
3606
+ };
3607
+ }
3601
3608
 
3602
3609
  // src/api/url.ts
3603
3610
  import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
@@ -3752,10 +3759,14 @@ class CliContext {
3752
3759
  }
3753
3760
  async projectId() {
3754
3761
  const selector = this.options.project ?? this.env.HYPOTENUSE_PROJECT ?? (this.credentials.servers[this.server.origin]?.project != null ? String(this.credentials.servers[this.server.origin]?.project) : undefined);
3755
- if (!selector) {
3756
- throw new Error("No project selected. Pass --project <id|slug> or run `hypotenuse project use <id|slug>`.");
3757
- }
3758
- return resolveProjectId(this.signedInClient(), selector);
3762
+ if (selector)
3763
+ return resolveProjectId(this.signedInClient(), selector);
3764
+ const { project, total } = await onlyProject(this.signedInClient());
3765
+ if (project) {
3766
+ logger.info(`Using project ${project.slug}, the only one you are in.`);
3767
+ return project.id;
3768
+ }
3769
+ throw new Error(total === 0 ? "You are not in any project yet. Create one in the dashboard, or accept an invite." : "No project selected, and you are in several. Pass --project <id|slug> or run `hypotenuse project use <id|slug>`.");
3759
3770
  }
3760
3771
  }
3761
3772
  function contextFor(command) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcadeai/hypotenuse",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Hypotenuse — run coding agents on your machine for Linear agent sessions",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -17,7 +17,7 @@ server. It calls the same HTTP actions the dashboard does, as the person who sig
17
17
  - Lists take `--page` and `--limit` (default 25) and answer a
18
18
  `pagination: { page, limit, total, pages }` envelope.
19
19
  - Project-scoped commands act on `--project <id|slug>`, else `HYPOTENUSE_PROJECT`, else the project
20
- chosen with `hypotenuse project use`.
20
+ chosen with `hypotenuse project use`, else the person's only project when they are in just one.
21
21
  - The server is `--url`, else `HYPOTENUSE_URL`, else wherever `login` last signed in.
22
22
  - `HYPOTENUSE_NO_UPDATE_CHECK=1` turns off the background update notice.
23
23