@agent-team-foundation/first-tree-hub 0.8.1 → 0.8.2
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-8nCntTrK.mjs → bootstrap-99vUYmLs.mjs} +26 -8
- package/dist/cli/index.mjs +8 -5
- package/dist/{core-BA5U1v9L.mjs → core-CNR-lUlr.mjs} +570 -322
- package/dist/esm-CYu4tXXn.mjs +1551 -0
- package/dist/execAsync-CP8iWV5b.mjs +10 -0
- package/dist/{feishu-D9JkMZnU.mjs → feishu-BOISS0DK.mjs} +1 -1
- package/dist/getMachineId-bsd-BB-fnFLA.mjs +26 -0
- package/dist/getMachineId-darwin-DAYWNsYK.mjs +23 -0
- package/dist/getMachineId-linux-BU7Fi6S0.mjs +19 -0
- package/dist/getMachineId-unsupported-BhWCxKBo.mjs +14 -0
- package/dist/getMachineId-win-H5RT49ov.mjs +25 -0
- package/dist/index.mjs +5 -3
- package/dist/logger-core-2yeIU1fc-B-__AsQO.mjs +111 -0
- package/dist/observability-CJzDFY_G-CmvgUuzc.mjs +33892 -0
- package/dist/observability-Xi-sEZI7.mjs +4 -0
- package/package.json +1 -1
- package/dist/rolldown-runtime-twds-ZHy.mjs +0 -14
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as __exportAll } from "./esm-CYu4tXXn.mjs";
|
|
2
|
+
import { a as logLevelSchema, i as logFormatSchema } from "./logger-core-2yeIU1fc-B-__AsQO.mjs";
|
|
2
3
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
3
4
|
import { dirname, join } from "node:path";
|
|
4
5
|
import { z } from "zod";
|
|
@@ -60,12 +61,7 @@ const clientConfigSchema = defineConfig({
|
|
|
60
61
|
auto: "client-id",
|
|
61
62
|
env: "FIRST_TREE_HUB_CLIENT_ID"
|
|
62
63
|
}) },
|
|
63
|
-
logLevel: field(
|
|
64
|
-
"debug",
|
|
65
|
-
"info",
|
|
66
|
-
"warn",
|
|
67
|
-
"error"
|
|
68
|
-
]).default("info"), { env: "FIRST_TREE_HUB_LOG_LEVEL" })
|
|
64
|
+
logLevel: field(logLevelSchema.default("info"), { env: "FIRST_TREE_HUB_LOG_LEVEL" })
|
|
69
65
|
});
|
|
70
66
|
const DEFAULT_HOME_DIR = process.env.FIRST_TREE_HUB_HOME ?? join(homedir(), ".first-tree-hub");
|
|
71
67
|
const DEFAULT_CONFIG_DIR = join(DEFAULT_HOME_DIR, "config");
|
|
@@ -473,7 +469,29 @@ const serverConfigSchema = defineConfig({
|
|
|
473
469
|
secret: true
|
|
474
470
|
}),
|
|
475
471
|
hubPublicUrl: field(z.string(), { env: "FIRST_TREE_HUB_PUBLIC_URL" })
|
|
476
|
-
})
|
|
472
|
+
}),
|
|
473
|
+
observability: {
|
|
474
|
+
logging: {
|
|
475
|
+
level: field(logLevelSchema.default("info"), { env: "FIRST_TREE_HUB_LOG_LEVEL" }),
|
|
476
|
+
format: field(logFormatSchema.default(process.env.NODE_ENV === "production" ? "json" : "pretty")),
|
|
477
|
+
bridgeToSpanLevel: field(z.enum([
|
|
478
|
+
"error",
|
|
479
|
+
"warn",
|
|
480
|
+
"off"
|
|
481
|
+
]).default("error"))
|
|
482
|
+
},
|
|
483
|
+
tracing: optional({
|
|
484
|
+
endpoint: field(z.string(), { env: "FIRST_TREE_HUB_OTEL_ENDPOINT" }),
|
|
485
|
+
headers: field(z.string().default(""), {
|
|
486
|
+
env: "FIRST_TREE_HUB_OTEL_HEADERS",
|
|
487
|
+
secret: true
|
|
488
|
+
}),
|
|
489
|
+
exporter: field(z.enum(["otlp-http", "otlp-grpc"]).default("otlp-http")),
|
|
490
|
+
serviceName: field(z.string().default("first-tree-hub")),
|
|
491
|
+
environment: field(z.string().default("development"), { env: "FIRST_TREE_HUB_OTEL_ENVIRONMENT" }),
|
|
492
|
+
sampleRate: field(z.number().min(0).max(1).default(1))
|
|
493
|
+
})
|
|
494
|
+
}
|
|
477
495
|
});
|
|
478
496
|
//#endregion
|
|
479
497
|
//#region src/core/bootstrap.ts
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import "../logger-core-2yeIU1fc-B-__AsQO.mjs";
|
|
3
|
+
import { C as setConfigValue, S as serverConfigSchema, _ as loadAgents, b as resetConfigMeta, c as saveCredentials, f as agentConfigSchema, g as initConfig, h as getConfigValue, 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, v as readConfigFile, y as resetConfig } from "../bootstrap-99vUYmLs.mjs";
|
|
4
|
+
import "../observability-CJzDFY_G-CmvgUuzc.mjs";
|
|
5
|
+
import { A as stopPostgres, C as checkServerReachable, F as SdkError, I as SessionRegistry, L as cleanWorkspaces, M as createOwner, P as FirstTreeHubSDK, R as applyClientLoggerConfig, S as checkServerHealth, T as printResults, _ as checkClientConfig, a as uninstallClientService, b as checkNodeVersion, c as promptAddAgent, d as loadOnboardState, f as onboardCheck, g as checkAgentConfigs, h as runMigrations, j as ClientRuntime, l as promptMissingFields, m as saveOnboardState, n as installClientService, o as startServer, p as onboardCreate, r as isServiceSupported, s as isInteractive, t as getClientServiceStatus, u as formatCheckReport, v as checkDatabase, w as checkWebSocket, x as checkServerConfig, y as checkDocker } from "../core-CNR-lUlr.mjs";
|
|
6
|
+
import { n as bindFeishuUser, t as bindFeishuBot } from "../feishu-BOISS0DK.mjs";
|
|
5
7
|
import { createRequire } from "node:module";
|
|
6
8
|
import { Command } from "commander";
|
|
7
9
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
@@ -874,6 +876,7 @@ function registerClientCommands(program) {
|
|
|
874
876
|
schema: clientConfigSchema,
|
|
875
877
|
role: "client"
|
|
876
878
|
});
|
|
879
|
+
applyClientLoggerConfig({ level: config.logLevel });
|
|
877
880
|
const agentsDir = join(DEFAULT_CONFIG_DIR, "agents");
|
|
878
881
|
const agents = loadAgents({
|
|
879
882
|
schema: agentConfigSchema,
|
|
@@ -1126,13 +1129,13 @@ function isSecretField(schema, dotPath) {
|
|
|
1126
1129
|
//#region src/commands/onboard.ts
|
|
1127
1130
|
async function promptMissing(args) {
|
|
1128
1131
|
if (!args.server) try {
|
|
1129
|
-
const { resolveServerUrl } = await import("../bootstrap-
|
|
1132
|
+
const { resolveServerUrl } = await import("../bootstrap-99vUYmLs.mjs").then((n) => n.t);
|
|
1130
1133
|
resolveServerUrl();
|
|
1131
1134
|
} catch {
|
|
1132
1135
|
args.server = await input({ message: "Hub server URL:" });
|
|
1133
1136
|
saveOnboardState(args);
|
|
1134
1137
|
}
|
|
1135
|
-
const { loadCredentials } = await import("../bootstrap-
|
|
1138
|
+
const { loadCredentials } = await import("../bootstrap-99vUYmLs.mjs").then((n) => n.t);
|
|
1136
1139
|
if (!loadCredentials()) throw new Error("No saved credentials. Run `first-tree-hub client connect <server-url>` before onboarding.");
|
|
1137
1140
|
if (!args.id) {
|
|
1138
1141
|
args.id = await input({ message: "Agent ID:" });
|