@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.
- package/dist/{bootstrap-CW73oEYn.mjs → bootstrap-C15ZBOCC.mjs} +7 -6
- package/dist/cli/index.mjs +268 -480
- package/dist/{client-BViGcaUC-CZb2Svgh.mjs → client-RM_03B_l-DiEIa9xe.mjs} +53 -6
- package/dist/{client-DNiLcPEq-db3YS57z.mjs → client-gSnsRu5W-v_mC1sRY.mjs} +3 -3
- package/dist/{dist-B1GHzMLc.mjs → dist-1XGLJMOq.mjs} +163 -11
- package/dist/drizzle/0043_onboarding_completed_at.sql +32 -0
- package/dist/drizzle/0044_agent_avatar_color.sql +11 -0
- package/dist/drizzle/0045_agent_avatar_image.sql +17 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/{errors-CF5evtJt-B0NTIVPt.mjs → errors-LPcARA4K-Dbrptiyz.mjs} +2 -1
- package/dist/{feishu-30vUx69l.mjs → feishu-BGx71p5s.mjs} +1 -1
- package/dist/index.mjs +7 -7
- package/dist/invitation-CNv7gfFF-DOFZ75wb.mjs +4 -0
- package/dist/{invitation-Bg0TRiyx-BsZH4GCS.mjs → invitation-DZO4NX3P-BPxTeHf-.mjs} +2 -2
- package/dist/{saas-connect-Fgnnnola.mjs → saas-connect-DX3-nDs9.mjs} +830 -108
- package/dist/web/assets/index-BOK7e_td.css +1 -0
- package/dist/web/assets/{index-B7FIVwrn.js → index-BppGbmdT.js} +1 -1
- package/dist/web/assets/index-Is-7_y6O.js +416 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/invitation-C299fxkP-CZgGbsN_.mjs +0 -4
- package/dist/web/assets/index-DJbUySaH.css +0 -1
- package/dist/web/assets/index-DiDfVdIH.js +0 -421
|
@@ -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
|
|
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
|
|
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 `
|
|
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
|
|
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
|
|
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 `
|
|
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
|