@agent-team-foundation/first-tree-hub 0.12.10 → 0.14.0

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.
@@ -552,6 +552,7 @@ const serverConfigSchema = defineConfig({
552
552
  host: field(z.string().default("127.0.0.1"), { env: "FIRST_TREE_HUB_HOST" }),
553
553
  publicUrl: field(z.string().optional(), { env: "FIRST_TREE_HUB_PUBLIC_URL" })
554
554
  },
555
+ workspace: { root: field(z.string().default(join(DEFAULT_DATA_DIR, "workspaces")), { env: "FIRST_TREE_HUB_WORKSPACES_ROOT" }) },
555
556
  secrets: {
556
557
  jwtSecret: field(z.string(), {
557
558
  env: "FIRST_TREE_HUB_JWT_SECRET",
@@ -690,19 +691,19 @@ function resolveServerUrl(flagValue) {
690
691
  const url = Reflect.get(server, "url");
691
692
  if (typeof url === "string" && url.length > 0) return url;
692
693
  }
693
- throw new Error("Server URL not configured.\n Provide via: --server <url>, FIRST_TREE_HUB_SERVER_URL env var, or\n first-tree-hub config set -c server.url <url>");
694
+ throw new Error("Server URL not configured.\n Provide via: --server <url>, FIRST_TREE_HUB_SERVER_URL env var, or\n first-tree-hub client config set server.url <url>");
694
695
  }
695
696
  /**
696
697
  * Resolve the current member access JWT from persisted credentials.
697
698
  *
698
699
  * Unified-user-token milestone: the CLI has a single credential store and a
699
- * single onboarding path (`first-tree-hub client connect`). The legacy
700
+ * single onboarding path (`first-tree-hub connect <token>`). The legacy
700
701
  * `FIRST_TREE_HUB_TOKEN` env var is no longer read — callers get a clear
701
- * error pointing at `client connect` instead.
702
+ * error pointing at `connect <token>` instead.
702
703
  */
703
704
  function resolveAccessToken() {
704
705
  const creds = loadCredentials();
705
- if (!creds) throw new Error("No credentials found. Run `first-tree-hub client connect <server-url>` to sign in.");
706
+ if (!creds) throw new Error("No credentials found. Run `first-tree-hub connect <token>` to sign in.");
706
707
  return creds.accessToken;
707
708
  }
708
709
  /**
@@ -783,7 +784,7 @@ const DEFAULT_MIN_VALIDITY_MS = 3e4;
783
784
  async function ensureFreshAccessToken(opts) {
784
785
  const minValidityMs = opts?.minValidityMs ?? DEFAULT_MIN_VALIDITY_MS;
785
786
  const creds = loadCredentials();
786
- if (!creds) throw new Error("No credentials found. Run `first-tree-hub client connect <server-url>` to sign in.");
787
+ if (!creds) throw new Error("No credentials found. Run `first-tree-hub connect <token>` to sign in.");
787
788
  if (!isTokenStale(creds.accessToken, minValidityMs)) return creds.accessToken;
788
789
  if (inflightRefresh) return inflightRefresh;
789
790
  inflightRefresh = (async () => {
@@ -830,7 +831,7 @@ function isTokenStale(token, minValidityMs) {
830
831
  * calls the file is empty, and a concurrent `loadCredentials()` (e.g. a
831
832
  * background daemon refreshing while the user runs a foreground CLI command)
832
833
  * reads "" → `JSON.parse` throws → we fall back to "no credentials" and
833
- * surface a misleading "run `client connect` again" error. write-to-temp +
834
+ * surface a misleading "run `connect <token>` again" error. write-to-temp +
834
835
  * rename gives readers an all-or-nothing view: they see the old file or the
835
836
  * new file, never a half-written one. Server-side the sliding-window design
836
837
  * already accepts last-writer-wins semantics for the refresh token itself