@agent-team-foundation/first-tree-hub 0.12.9 → 0.13.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-BCZC1ki6.mjs → bootstrap-Cya2OoHz.mjs} +7 -7
- package/dist/cli/index.mjs +268 -480
- package/dist/{client-OMwJMCQt-R1T06ZH6.mjs → client-BH4CmUL0-CybE3kuP.mjs} +92 -8
- package/dist/{client-CjGIGddS-BrpazWa3.mjs → client-h4KZ3b9o-CQyibXig.mjs} +3 -3
- package/dist/{dist-CnjqakXS.mjs → dist-C8yStx2L.mjs} +160 -36
- package/dist/drizzle/0041_notifications_dedup_key.sql +29 -0
- package/dist/drizzle/0042_notifications_drop_legacy_types.sql +36 -0
- package/dist/drizzle/0043_onboarding_completed_at.sql +32 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/{errors-CF5evtJt-B0NTIVPt.mjs → errors-LPcARA4K-Dbrptiyz.mjs} +2 -1
- package/dist/{feishu-DrnBbl8T.mjs → feishu-D_vnqC6a.mjs} +1 -1
- package/dist/index.mjs +7 -7
- package/dist/invitation-CNv7gfFF-D93KQte0.mjs +4 -0
- package/dist/{invitation-Bg0TRiyx-BsZH4GCS.mjs → invitation-DZO4NX3P-BPxTeHf-.mjs} +2 -2
- package/dist/{saas-connect-CXZhK485.mjs → saas-connect-Bb5LR4y6.mjs} +1499 -716
- package/dist/web/assets/{index-BPMrSv_A.js → index-CJcRUZ8l.js} +1 -1
- package/dist/web/assets/index-DL_9NFkt.js +421 -0
- package/dist/web/assets/index-DaWEZnjh.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/invitation-C299fxkP-KKslbta2.mjs +0 -4
- package/dist/web/assets/index-DxAYxUpz.css +0 -1
- package/dist/web/assets/index-ntmzuk5X.js +0 -421
|
@@ -598,7 +598,7 @@ const serverConfigSchema = defineConfig({
|
|
|
598
598
|
rateLimit: optional({
|
|
599
599
|
max: field(z.number().default(100), { env: "FIRST_TREE_HUB_RATE_LIMIT_MAX" }),
|
|
600
600
|
loginMax: field(z.number().default(5), { env: "FIRST_TREE_HUB_RATE_LIMIT_LOGIN_MAX" }),
|
|
601
|
-
webhookMax: field(z.number().default(
|
|
601
|
+
webhookMax: field(z.number().default(600), { env: "FIRST_TREE_HUB_RATE_LIMIT_WEBHOOK_MAX" }),
|
|
602
602
|
contextTreeSnapshotMax: field(z.number().default(6), { env: "FIRST_TREE_HUB_RATE_LIMIT_CONTEXT_TREE_SNAPSHOT_MAX" }),
|
|
603
603
|
agentMessageMax: field(z.number().default(30), { env: "FIRST_TREE_HUB_RATE_LIMIT_AGENT_MESSAGE_MAX" })
|
|
604
604
|
}),
|
|
@@ -690,19 +690,19 @@ function resolveServerUrl(flagValue) {
|
|
|
690
690
|
const url = Reflect.get(server, "url");
|
|
691
691
|
if (typeof url === "string" && url.length > 0) return url;
|
|
692
692
|
}
|
|
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
|
|
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 client config set server.url <url>");
|
|
694
694
|
}
|
|
695
695
|
/**
|
|
696
696
|
* Resolve the current member access JWT from persisted credentials.
|
|
697
697
|
*
|
|
698
698
|
* Unified-user-token milestone: the CLI has a single credential store and a
|
|
699
|
-
* single onboarding path (`first-tree-hub
|
|
699
|
+
* single onboarding path (`first-tree-hub connect <token>`). The legacy
|
|
700
700
|
* `FIRST_TREE_HUB_TOKEN` env var is no longer read — callers get a clear
|
|
701
|
-
* error pointing at `
|
|
701
|
+
* error pointing at `connect <token>` instead.
|
|
702
702
|
*/
|
|
703
703
|
function resolveAccessToken() {
|
|
704
704
|
const creds = loadCredentials();
|
|
705
|
-
if (!creds) throw new Error("No credentials found. Run `first-tree-hub
|
|
705
|
+
if (!creds) throw new Error("No credentials found. Run `first-tree-hub connect <token>` to sign in.");
|
|
706
706
|
return creds.accessToken;
|
|
707
707
|
}
|
|
708
708
|
/**
|
|
@@ -783,7 +783,7 @@ const DEFAULT_MIN_VALIDITY_MS = 3e4;
|
|
|
783
783
|
async function ensureFreshAccessToken(opts) {
|
|
784
784
|
const minValidityMs = opts?.minValidityMs ?? DEFAULT_MIN_VALIDITY_MS;
|
|
785
785
|
const creds = loadCredentials();
|
|
786
|
-
if (!creds) throw new Error("No credentials found. Run `first-tree-hub
|
|
786
|
+
if (!creds) throw new Error("No credentials found. Run `first-tree-hub connect <token>` to sign in.");
|
|
787
787
|
if (!isTokenStale(creds.accessToken, minValidityMs)) return creds.accessToken;
|
|
788
788
|
if (inflightRefresh) return inflightRefresh;
|
|
789
789
|
inflightRefresh = (async () => {
|
|
@@ -830,7 +830,7 @@ function isTokenStale(token, minValidityMs) {
|
|
|
830
830
|
* calls the file is empty, and a concurrent `loadCredentials()` (e.g. a
|
|
831
831
|
* background daemon refreshing while the user runs a foreground CLI command)
|
|
832
832
|
* reads "" → `JSON.parse` throws → we fall back to "no credentials" and
|
|
833
|
-
* surface a misleading "run `
|
|
833
|
+
* surface a misleading "run `connect <token>` again" error. write-to-temp +
|
|
834
834
|
* rename gives readers an all-or-nothing view: they see the old file or the
|
|
835
835
|
* new file, never a half-written one. Server-side the sliding-window design
|
|
836
836
|
* already accepts last-writer-wins semantics for the refresh token itself
|