@agent-team-foundation/first-tree-hub 0.9.8 → 0.9.10
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-DWifXj9b.mjs → bootstrap-hh_PkTu6.mjs} +16 -0
- package/dist/cli/index.mjs +16 -6
- package/dist/{core-DKA6g1lL.mjs → core-BWaSYpXv.mjs} +1060 -60
- package/dist/drizzle/0023_clients_org_scoping.sql +40 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/{feishu-CRNUI05I.mjs → feishu-BJaN64iR.mjs} +2 -3
- package/dist/index.mjs +4 -4
- package/dist/web/assets/{index-Cp24nDIg.js → index-Cyvhyw0R.js} +1 -1
- package/dist/web/index.html +15 -1
- package/package.json +1 -1
|
@@ -590,6 +590,22 @@ const serverConfigSchema = defineConfig({
|
|
|
590
590
|
}),
|
|
591
591
|
hubPublicUrl: field(z.string(), { env: "FIRST_TREE_HUB_PUBLIC_URL" })
|
|
592
592
|
}),
|
|
593
|
+
feedback: optional({
|
|
594
|
+
repo: field(z.string(), { env: "HEARBACK_FEEDBACK_REPO" }),
|
|
595
|
+
githubToken: field(z.string(), {
|
|
596
|
+
env: "HEARBACK_GITHUB_TOKEN",
|
|
597
|
+
secret: true
|
|
598
|
+
}),
|
|
599
|
+
llm: optional({
|
|
600
|
+
apiKey: field(z.string(), {
|
|
601
|
+
env: "LLM_API_KEY",
|
|
602
|
+
secret: true
|
|
603
|
+
}),
|
|
604
|
+
baseUrl: field(z.string().optional(), { env: "LLM_BASE_URL" }),
|
|
605
|
+
model: field(z.string().optional(), { env: "LLM_MODEL" })
|
|
606
|
+
}),
|
|
607
|
+
trustProxyHeaders: field(z.boolean().default(false), { env: "HEARBACK_TRUST_PROXY_HEADERS" })
|
|
608
|
+
}),
|
|
593
609
|
observability: {
|
|
594
610
|
logging: {
|
|
595
611
|
level: field(logLevelSchema.default("info"), { env: "FIRST_TREE_HUB_LOG_LEVEL" }),
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "../observability-DV_fQKqV-CuLWzBxQ.mjs";
|
|
3
|
-
import { A as checkServerHealth, B as
|
|
3
|
+
import { $ as configureClientLoggerForService, A as checkServerHealth, B as createOwner, C as runMigrations, D as checkDocker, E as checkDatabase, G as setJsonMode, H as resolveReplyToFromEnv, I as stopPostgres, J as FirstTreeHubSDK, L as ClientRuntime, M as checkWebSocket, N as printResults, O as checkNodeVersion, Q as applyClientLoggerConfig, R as handleClientOrgMismatch, S as uninstallClientService, T as checkClientConfig, W as print, X as SessionRegistry, Y as SdkError, Z as cleanWorkspaces, _ as runHomeMigration, a as showServiceLogs, b as isServiceSupported, c as COMMAND_VERSION, d as promptMissingFields, f as formatCheckReport, g as saveOnboardState, h as onboardCreate, i as parseDuration, j as checkServerReachable, k as checkServerConfig, l as isInteractive, m as onboardCheck, n as declineUpdate, o as validateLevel, p as loadOnboardState, q as ClientOrgMismatchError, r as promptUpdate, s as startServer, t as createExecuteUpdate, u as promptAddAgent, v as getClientServiceStatus, w as checkAgentConfigs, y as installClientService } from "../core-BWaSYpXv.mjs";
|
|
4
4
|
import "../logger-core-BTmvdflj-DhdipBkV.mjs";
|
|
5
|
-
import { C as serverConfigSchema, _ as loadAgents, b as resetConfig, c as saveCredentials, d as DEFAULT_HOME_DIR, f as agentConfigSchema, g as initConfig, h as getConfigValue, i as loadCredentials, l as DEFAULT_CONFIG_DIR, n as ensureFreshAccessToken, o as resolveServerUrl, p as clientConfigSchema, r as ensureFreshAdminToken, s as saveAgentConfig, u as DEFAULT_DATA_DIR, w as setConfigValue, x as resetConfigMeta, y as readConfigFile } from "../bootstrap-
|
|
6
|
-
import { n as bindFeishuUser, t as bindFeishuBot } from "../feishu-
|
|
5
|
+
import { C as serverConfigSchema, _ as loadAgents, b as resetConfig, c as saveCredentials, d as DEFAULT_HOME_DIR, f as agentConfigSchema, g as initConfig, h as getConfigValue, i as loadCredentials, l as DEFAULT_CONFIG_DIR, n as ensureFreshAccessToken, o as resolveServerUrl, p as clientConfigSchema, r as ensureFreshAdminToken, s as saveAgentConfig, u as DEFAULT_DATA_DIR, w as setConfigValue, x as resetConfigMeta, y as readConfigFile } from "../bootstrap-hh_PkTu6.mjs";
|
|
6
|
+
import { n as bindFeishuUser, t as bindFeishuBot } from "../feishu-BJaN64iR.mjs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
9
9
|
import { Command } from "commander";
|
|
@@ -90,7 +90,7 @@ function registerAgentConfigCommands(parent) {
|
|
|
90
90
|
const { uuid } = await resolveAgentRecord(serverUrl, adminToken, agentName);
|
|
91
91
|
printConfig(await getCurrent(serverUrl, adminToken, uuid));
|
|
92
92
|
});
|
|
93
|
-
config.command("set-model <agent> <model>").description("Replace the model field (
|
|
93
|
+
config.command("set-model <agent> <model>").description("Replace the model field (alias: opus, sonnet, haiku — or a full id like claude-opus-4-7)").action(async (agentName, model) => {
|
|
94
94
|
const serverUrl = resolveServerUrl(process.env.FIRST_TREE_HUB_SERVER_URL);
|
|
95
95
|
const adminToken = await ensureFreshAdminToken();
|
|
96
96
|
const { uuid } = await resolveAgentRecord(serverUrl, adminToken, agentName);
|
|
@@ -951,6 +951,11 @@ function registerConnectCommand(parent) {
|
|
|
951
951
|
print.line("\n Cancelled.\n");
|
|
952
952
|
return;
|
|
953
953
|
}
|
|
954
|
+
if (error instanceof ClientOrgMismatchError) await handleClientOrgMismatch(error, {
|
|
955
|
+
managed: false,
|
|
956
|
+
configDir: DEFAULT_CONFIG_DIR,
|
|
957
|
+
rerunCommand: `first-tree-hub client connect ${serverUrl}${options.token ? " --token <token>" : ""}${options.service === false ? " --no-service" : ""}`
|
|
958
|
+
});
|
|
954
959
|
const msg = error instanceof Error ? error.message : String(error);
|
|
955
960
|
print.line(` Error: ${msg}\n`);
|
|
956
961
|
process.exit(1);
|
|
@@ -1006,6 +1011,11 @@ function registerClientCommands(program) {
|
|
|
1006
1011
|
process.on("SIGTERM", () => void shutdown());
|
|
1007
1012
|
await new Promise(() => {});
|
|
1008
1013
|
} catch (error) {
|
|
1014
|
+
if (error instanceof ClientOrgMismatchError) await handleClientOrgMismatch(error, {
|
|
1015
|
+
managed: options.interactive === false,
|
|
1016
|
+
configDir: DEFAULT_CONFIG_DIR,
|
|
1017
|
+
rerunCommand: "first-tree-hub client start"
|
|
1018
|
+
});
|
|
1009
1019
|
const msg = error instanceof Error ? error.message : String(error);
|
|
1010
1020
|
print.line(` Error: ${msg}\n`);
|
|
1011
1021
|
process.exit(1);
|
|
@@ -1252,13 +1262,13 @@ function isSecretField(schema, dotPath) {
|
|
|
1252
1262
|
//#region src/commands/onboard.ts
|
|
1253
1263
|
async function promptMissing(args) {
|
|
1254
1264
|
if (!args.server) try {
|
|
1255
|
-
const { resolveServerUrl } = await import("../bootstrap-
|
|
1265
|
+
const { resolveServerUrl } = await import("../bootstrap-hh_PkTu6.mjs").then((n) => n.t);
|
|
1256
1266
|
resolveServerUrl();
|
|
1257
1267
|
} catch {
|
|
1258
1268
|
args.server = await input({ message: "Hub server URL:" });
|
|
1259
1269
|
saveOnboardState(args);
|
|
1260
1270
|
}
|
|
1261
|
-
const { loadCredentials } = await import("../bootstrap-
|
|
1271
|
+
const { loadCredentials } = await import("../bootstrap-hh_PkTu6.mjs").then((n) => n.t);
|
|
1262
1272
|
if (!loadCredentials()) throw new Error("No saved credentials. Run `first-tree-hub client connect <server-url>` before onboarding.");
|
|
1263
1273
|
if (!args.id) {
|
|
1264
1274
|
args.id = await input({ message: "Agent ID:" });
|