@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.
@@ -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(homedir(), ".first-tree-hub", "agents", agentId);
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 { resetConfig as _, getGitHubUsername as a, serverConfigSchema as b, DEFAULT_CONFIG_DIR as c, clientConfigSchema as d, collectMissingPrompts as f, readConfigFile as g, loadAgents as h, getGitHubToken as i, DEFAULT_DATA_DIR as l, initConfig as m, bootstrap_exports as n, resolveAgentToken as o, getConfigValue as p, checkBootstrapStatus as r, resolveServerUrl as s, bootstrapToken as t, agentConfigSchema as u, resetConfigMeta as v, setConfigValue as x, resolveConfigReadonly as y };
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 };