@agent-team-foundation/first-tree-hub 0.9.1 → 0.9.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/cli/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "../logger-core-2yeIU1fc-B-__AsQO.mjs";
|
|
3
3
|
import { C as serverConfigSchema, _ as loadAgents, b as resetConfig, c as saveCredentials, 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-CWcBzk6C.mjs";
|
|
4
4
|
import "../observability-CJzDFY_G-CmvgUuzc.mjs";
|
|
5
|
-
import { A as printResults, B as SdkError, C as checkDatabase, D as checkServerHealth, E as checkServerConfig, F as stopPostgres, H as cleanWorkspaces, I as ClientRuntime, L as createOwner, O as checkServerReachable, S as checkClientConfig, T as checkNodeVersion, U as applyClientLoggerConfig, V as SessionRegistry, _ as isServiceSupported, a as COMMAND_VERSION, b as runMigrations, c as promptMissingFields, d as onboardCheck, f as onboardCreate, g as installClientService, h as getClientServiceStatus, i as startServer, k as checkWebSocket, l as formatCheckReport, m as runHomeMigration, n as declineUpdate, o as isInteractive, p as saveOnboardState, r as promptUpdate, s as promptAddAgent, t as createExecuteUpdate, u as loadOnboardState, w as checkDocker, x as checkAgentConfigs, y as uninstallClientService, z as FirstTreeHubSDK } from "../core-
|
|
5
|
+
import { A as printResults, B as SdkError, C as checkDatabase, D as checkServerHealth, E as checkServerConfig, F as stopPostgres, H as cleanWorkspaces, I as ClientRuntime, L as createOwner, O as checkServerReachable, S as checkClientConfig, T as checkNodeVersion, U as applyClientLoggerConfig, V as SessionRegistry, _ as isServiceSupported, a as COMMAND_VERSION, b as runMigrations, c as promptMissingFields, d as onboardCheck, f as onboardCreate, g as installClientService, h as getClientServiceStatus, i as startServer, k as checkWebSocket, l as formatCheckReport, m as runHomeMigration, n as declineUpdate, o as isInteractive, p as saveOnboardState, r as promptUpdate, s as promptAddAgent, t as createExecuteUpdate, u as loadOnboardState, w as checkDocker, x as checkAgentConfigs, y as uninstallClientService, z as FirstTreeHubSDK } from "../core-Y7M3d2aZ.mjs";
|
|
6
6
|
import { n as bindFeishuUser, t as bindFeishuBot } from "../feishu-GlaczcVf.mjs";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
@@ -15502,7 +15502,7 @@ function createPulseAggregator(options) {
|
|
|
15502
15502
|
* Returning a string (rather than undefined) keeps the welcome frame well-
|
|
15503
15503
|
* formed — the client treats the value advisorily.
|
|
15504
15504
|
*/
|
|
15505
|
-
function resolveCommandVersion(injected) {
|
|
15505
|
+
function resolveCommandVersion$1(injected) {
|
|
15506
15506
|
if (injected && injected.trim().length > 0) return injected;
|
|
15507
15507
|
try {
|
|
15508
15508
|
const pkg = createRequire(import.meta.url)("../package.json");
|
|
@@ -15523,7 +15523,7 @@ async function buildApp(config) {
|
|
|
15523
15523
|
const db = connectDatabase(config.database.url);
|
|
15524
15524
|
app.decorate("db", db);
|
|
15525
15525
|
app.decorate("config", config);
|
|
15526
|
-
const commandVersion = resolveCommandVersion(config.commandVersion);
|
|
15526
|
+
const commandVersion = resolveCommandVersion$1(config.commandVersion);
|
|
15527
15527
|
app.decorate("commandVersion", commandVersion);
|
|
15528
15528
|
app.log.info({ commandVersion }, "Hub server advertising command version");
|
|
15529
15529
|
const listenClient = postgres(config.database.url, { max: 1 });
|
|
@@ -15723,8 +15723,56 @@ async function buildApp(config) {
|
|
|
15723
15723
|
}
|
|
15724
15724
|
//#endregion
|
|
15725
15725
|
//#region src/core/version.ts
|
|
15726
|
-
|
|
15727
|
-
|
|
15726
|
+
/**
|
|
15727
|
+
* Version of the consumer-facing `@agent-team-foundation/first-tree-hub`
|
|
15728
|
+
* package. Read once at module load so the CLI, client runtime, and server
|
|
15729
|
+
* bootstrap all quote the same string.
|
|
15730
|
+
*
|
|
15731
|
+
* Path-based lookups (`require("../../package.json")`) do not survive the
|
|
15732
|
+
* tsdown bundle: the source lives at `src/core/version.ts` but every
|
|
15733
|
+
* emitted chunk lands in `dist/` — shifting the relative depth by one and
|
|
15734
|
+
* pointing at `packages/package.json` instead of our own manifest (the
|
|
15735
|
+
* v0.9.1 "Cannot find module ../../package.json" crash). Walk up from this
|
|
15736
|
+
* module's URL and accept the first `package.json` whose `name` matches, so
|
|
15737
|
+
* dev runs (`tsx src/cli/index.ts`) and the published bundle
|
|
15738
|
+
* (`dist/cli/index.mjs`) both resolve the same file.
|
|
15739
|
+
*/
|
|
15740
|
+
const PACKAGE_NAME$1 = "@agent-team-foundation/first-tree-hub";
|
|
15741
|
+
/**
|
|
15742
|
+
* Sentinel returned when the walker exhausts every parent directory without
|
|
15743
|
+
* finding our manifest. Deliberately NOT valid SemVer so the client-side
|
|
15744
|
+
* `UpdateManager` drops into its `semver.valid(current) === false` warn-and-
|
|
15745
|
+
* skip branch instead of treating it as `< target` and triggering a spurious
|
|
15746
|
+
* self-update loop (the scenario where the startup crash this module fixes
|
|
15747
|
+
* would otherwise quietly reincarnate as repeated `npm install -g @latest`).
|
|
15748
|
+
*/
|
|
15749
|
+
const UNRESOLVED_VERSION = "unknown";
|
|
15750
|
+
/**
|
|
15751
|
+
* Exported for tests. Walks up from `moduleUrl`'s directory looking for a
|
|
15752
|
+
* `package.json` whose `name` field equals {@link PACKAGE_NAME}. Returns
|
|
15753
|
+
* {@link UNRESOLVED_VERSION} as a last-resort fallback so the CLI never
|
|
15754
|
+
* crashes on a missing manifest.
|
|
15755
|
+
*/
|
|
15756
|
+
function resolveCommandVersion(moduleUrl = import.meta.url) {
|
|
15757
|
+
let dir = dirname(fileURLToPath(moduleUrl));
|
|
15758
|
+
for (let i = 0; i < 10; i++) {
|
|
15759
|
+
try {
|
|
15760
|
+
const pkg = JSON.parse(readFileSync(resolve(dir, "package.json"), "utf8"));
|
|
15761
|
+
if (pkg.name === PACKAGE_NAME$1 && typeof pkg.version === "string" && pkg.version.length > 0) return pkg.version;
|
|
15762
|
+
} catch (err) {
|
|
15763
|
+
const code = err.code;
|
|
15764
|
+
if (code !== "ENOENT" && code !== "ENOTDIR") {
|
|
15765
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
15766
|
+
process.stderr.write(`[first-tree-hub] warning: could not read ${dir}/package.json: ${message}\n`);
|
|
15767
|
+
}
|
|
15768
|
+
}
|
|
15769
|
+
const parent = dirname(dir);
|
|
15770
|
+
if (parent === dir) break;
|
|
15771
|
+
dir = parent;
|
|
15772
|
+
}
|
|
15773
|
+
return UNRESOLVED_VERSION;
|
|
15774
|
+
}
|
|
15775
|
+
const COMMAND_VERSION = resolveCommandVersion();
|
|
15728
15776
|
//#endregion
|
|
15729
15777
|
//#region src/core/server.ts
|
|
15730
15778
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./logger-core-2yeIU1fc-B-__AsQO.mjs";
|
|
2
2
|
import { a as resolveAccessToken, n as ensureFreshAccessToken, o as resolveServerUrl, r as ensureFreshAdminToken } from "./bootstrap-CWcBzk6C.mjs";
|
|
3
3
|
import "./observability-CJzDFY_G-CmvgUuzc.mjs";
|
|
4
|
-
import { A as printResults, B as SdkError, C as checkDatabase, D as checkServerHealth, E as checkServerConfig, F as stopPostgres, I as ClientRuntime, L as createOwner, M as status, N as ensurePostgres, O as checkServerReachable, P as isDockerAvailable, R as hasUser, S as checkClientConfig, T as checkNodeVersion, _ as isServiceSupported, b as runMigrations, c as promptMissingFields, d as onboardCheck, f as onboardCreate, g as installClientService, h as getClientServiceStatus, i as startServer, j as blank, k as checkWebSocket, l as formatCheckReport, m as runHomeMigration, o as isInteractive, s as promptAddAgent, v as resolveCliInvocation, w as checkDocker, x as checkAgentConfigs, y as uninstallClientService, z as FirstTreeHubSDK } from "./core-
|
|
4
|
+
import { A as printResults, B as SdkError, C as checkDatabase, D as checkServerHealth, E as checkServerConfig, F as stopPostgres, I as ClientRuntime, L as createOwner, M as status, N as ensurePostgres, O as checkServerReachable, P as isDockerAvailable, R as hasUser, S as checkClientConfig, T as checkNodeVersion, _ as isServiceSupported, b as runMigrations, c as promptMissingFields, d as onboardCheck, f as onboardCreate, g as installClientService, h as getClientServiceStatus, i as startServer, j as blank, k as checkWebSocket, l as formatCheckReport, m as runHomeMigration, o as isInteractive, s as promptAddAgent, v as resolveCliInvocation, w as checkDocker, x as checkAgentConfigs, y as uninstallClientService, z as FirstTreeHubSDK } from "./core-Y7M3d2aZ.mjs";
|
|
5
5
|
import { n as bindFeishuUser, t as bindFeishuBot } from "./feishu-GlaczcVf.mjs";
|
|
6
6
|
export { ClientRuntime, FirstTreeHubSDK, SdkError, bindFeishuBot, bindFeishuUser, blank, checkAgentConfigs, checkClientConfig, checkDatabase, checkDocker, checkNodeVersion, checkServerConfig, checkServerHealth, checkServerReachable, checkWebSocket, createOwner, ensureFreshAccessToken, ensureFreshAdminToken, ensurePostgres, formatCheckReport, getClientServiceStatus, hasUser, installClientService, isDockerAvailable, isInteractive, isServiceSupported, onboardCheck, onboardCreate, printResults, promptAddAgent, promptMissingFields, resolveAccessToken, resolveCliInvocation, resolveServerUrl, runHomeMigration, runMigrations, startServer, status, stopPostgres, uninstallClientService };
|