@agent-team-foundation/first-tree-hub 0.3.3 → 0.3.5
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-waEJYq3g.mjs → bootstrap-mhkpeOEc.mjs} +14 -6
- package/dist/cli/index.mjs +233 -343
- package/dist/{core-Bl6djdPd.mjs → core-CHL_dgzu.mjs} +304 -263
- package/dist/index.mjs +2 -2
- package/dist/web/assets/{index-BHn3RVzY.js → index-DhpjUi0Y.js} +68 -68
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-twds-ZHy.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
2
|
import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
4
3
|
import { dirname, join } from "node:path";
|
|
5
|
-
import { parse, stringify } from "yaml";
|
|
6
4
|
import { randomBytes } from "node:crypto";
|
|
7
|
-
import { homedir } from "node:os";
|
|
8
5
|
import { execSync } from "node:child_process";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { parse, stringify } from "yaml";
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
9
|
//#region ../shared/dist/config/index.mjs
|
|
10
10
|
/** Declare a config field with a Zod schema and optional metadata. */
|
|
11
11
|
function field(schema, options) {
|
|
@@ -72,7 +72,7 @@ const clientConfigSchema = defineConfig({
|
|
|
72
72
|
function getClientConfig() {
|
|
73
73
|
return getConfig();
|
|
74
74
|
}
|
|
75
|
-
const DEFAULT_HOME_DIR = join(homedir(), ".first-tree-hub");
|
|
75
|
+
const DEFAULT_HOME_DIR = process.env.FIRST_TREE_HUB_HOME ?? join(homedir(), ".first-tree-hub");
|
|
76
76
|
const DEFAULT_CONFIG_DIR = join(DEFAULT_HOME_DIR, "config");
|
|
77
77
|
const DEFAULT_DATA_DIR = join(DEFAULT_HOME_DIR, "data");
|
|
78
78
|
function isFieldDef(value) {
|
|
@@ -477,6 +477,14 @@ const serverConfigSchema = defineConfig({
|
|
|
477
477
|
max: field(z.number().default(100), { env: "FIRST_TREE_HUB_RATE_LIMIT_MAX" }),
|
|
478
478
|
loginMax: field(z.number().default(5), { env: "FIRST_TREE_HUB_RATE_LIMIT_LOGIN_MAX" }),
|
|
479
479
|
webhookMax: field(z.number().default(60), { env: "FIRST_TREE_HUB_RATE_LIMIT_WEBHOOK_MAX" })
|
|
480
|
+
}),
|
|
481
|
+
kael: optional({
|
|
482
|
+
endpoint: field(z.string(), { env: "KAEL_ENDPOINT" }),
|
|
483
|
+
apiKey: field(z.string(), {
|
|
484
|
+
env: "KAEL_API_KEY",
|
|
485
|
+
secret: true
|
|
486
|
+
}),
|
|
487
|
+
hubPublicUrl: field(z.string(), { env: "FIRST_TREE_HUB_PUBLIC_URL" })
|
|
480
488
|
})
|
|
481
489
|
});
|
|
482
490
|
//#endregion
|
|
@@ -544,7 +552,7 @@ async function bootstrapToken(serverUrl, agentId, options = {}) {
|
|
|
544
552
|
}
|
|
545
553
|
const data = await res.json();
|
|
546
554
|
if (options.saveTo === "agent" || !options.saveTo) {
|
|
547
|
-
const configDir = join(
|
|
555
|
+
const configDir = join(DEFAULT_CONFIG_DIR, "agents", agentId);
|
|
548
556
|
const configPath = `${configDir}/agent.yaml`;
|
|
549
557
|
mkdirSync(configDir, {
|
|
550
558
|
recursive: true,
|
|
@@ -580,4 +588,4 @@ async function checkBootstrapStatus(serverUrl, agentId) {
|
|
|
580
588
|
return await res.json();
|
|
581
589
|
}
|
|
582
590
|
//#endregion
|
|
583
|
-
export {
|
|
591
|
+
export { setConfigValue as S, readConfigFile as _, getGitHubUsername as a, resolveConfigReadonly as b, DEFAULT_CONFIG_DIR as c, agentConfigSchema as d, clientConfigSchema as f, loadAgents as g, initConfig as h, getGitHubToken as i, DEFAULT_DATA_DIR as l, getConfigValue as m, bootstrap_exports as n, resolveAgentToken as o, collectMissingPrompts as p, checkBootstrapStatus as r, resolveServerUrl as s, bootstrapToken as t, DEFAULT_HOME_DIR as u, resetConfig as v, serverConfigSchema as x, resetConfigMeta as y };
|