@agent-team-foundation/first-tree-hub 0.3.2 → 0.3.4

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) {
@@ -167,7 +167,7 @@ function buildZodSchema(shape) {
167
167
  const zodShape = {};
168
168
  for (const [key, value] of Object.entries(shape)) if (isFieldDef(value)) zodShape[key] = value.schema;
169
169
  else if (isOptionalGroup(value)) zodShape[key] = buildZodSchema(value.shape).optional();
170
- else if (typeof value === "object" && value !== null) zodShape[key] = buildZodSchema(value).default({});
170
+ else if (typeof value === "object" && value !== null) zodShape[key] = buildZodSchema(value).prefault({});
171
171
  return z.object(zodShape);
172
172
  }
173
173
  function resetConfigMeta() {}
@@ -544,7 +544,7 @@ async function bootstrapToken(serverUrl, agentId, options = {}) {
544
544
  }
545
545
  const data = await res.json();
546
546
  if (options.saveTo === "agent" || !options.saveTo) {
547
- const configDir = join(homedir(), ".first-tree-hub", "agents", agentId);
547
+ const configDir = join(DEFAULT_CONFIG_DIR, "agents", agentId);
548
548
  const configPath = `${configDir}/agent.yaml`;
549
549
  mkdirSync(configDir, {
550
550
  recursive: true,