first-tree-staging 0.5.3-staging.78.1 → 0.5.3-staging.80.1

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,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as COMMAND_VERSION, c as documentContextSchema, d as print, f as setJsonMode, i as CLI_USER_AGENT, m as channelConfig, n as bindFeishuUser, o as attentionMetadataSchema, r as cliFetch, t as bindFeishuBot } from "../feishu-CkgQRaZF.mjs";
3
- import { $ as saveCredentials, A as getClientServiceStatus, B as handleClientOrgMismatch, C as checkBackgroundService, Ct as SessionRegistry, D as checkWebSocket, Dt as probeCapabilities, E as checkServerReachable, Et as discoverClaudeCodeSkills, F as restartClientService, H as showAttention, I as startClientService, J as ensureFreshAdminToken, L as stopClientService, M as isServiceSupported, N as isServiceUnitDriftDetected, O as printResults, Ot as applyClientLoggerConfig, Q as saveAgentConfig, S as checkAgentConfigs, St as SdkError, T as checkNodeVersion, Tt as cleanWorkspaces, U as AttentionRespondError, W as respondAttention, Y as loadCredentials, Z as resolveServerUrl, _t as resolveConfigReadonly, a as declineUpdate, at as removeLocalAgent, b as createApiNameResolver, bt as ClientUserMismatchError, c as detectInstallMode, ct as defaultConfigDir, d as reconcileLocalRuntimeProviders, dt as getConfigValue, et as raiseAttention, f as uploadAgentSkills, ft as initConfig, g as promptMissingFields, gt as resetConfigMeta, h as promptAddAgent, ht as resetConfig, i as createExecuteUpdate, it as formatStaleReason, j as installClientService, k as reconcileAgentConfigs, kt as configureClientLoggerForService, l as fetchLatestVersion, lt as defaultDataDir, mt as readConfigFile, n as decodeJwtPayload, nt as cancelAttention, o as promptUpdate, ot as agentConfigSchema, p as uploadClientCapabilities, pt as loadAgents, q as ensureFreshAccessToken, r as deriveHubUrlFromToken, rt as findStaleAliases, s as PACKAGE_NAME, st as clientConfigSchema, t as HubUrlDerivationError, tt as listAttentions, u as installGlobalLatest, ut as defaultHome, vt as setConfigValue, w as checkClientConfig, wt as buildMessageDocumentSnapshots, x as migrateLocalAgentDirs, xt as FirstTreeHubSDK, yt as ClientOrgMismatchError, z as ClientRuntime } from "../connect-token-DTOB6yq8.mjs";
3
+ import { $ as saveCredentials, A as getClientServiceStatus, B as handleClientOrgMismatch, C as checkBackgroundService, Ct as SessionRegistry, D as checkWebSocket, Dt as probeCapabilities, E as checkServerReachable, Et as discoverClaudeCodeSkills, F as restartClientService, H as showAttention, I as startClientService, J as ensureFreshAdminToken, L as stopClientService, M as isServiceSupported, N as isServiceUnitDriftDetected, O as printResults, Ot as applyClientLoggerConfig, Q as saveAgentConfig, S as checkAgentConfigs, St as SdkError, T as checkNodeVersion, Tt as cleanWorkspaces, U as AttentionRespondError, W as respondAttention, Y as loadCredentials, Z as resolveServerUrl, _t as resolveConfigReadonly, a as declineUpdate, at as removeLocalAgent, b as createApiNameResolver, bt as ClientUserMismatchError, c as detectInstallMode, ct as defaultConfigDir, d as reconcileLocalRuntimeProviders, dt as getConfigValue, et as raiseAttention, f as uploadAgentSkills, ft as initConfig, g as promptMissingFields, gt as resetConfigMeta, h as promptAddAgent, ht as resetConfig, i as createExecuteUpdate, it as formatStaleReason, j as installClientService, k as reconcileAgentConfigs, kt as configureClientLoggerForService, l as fetchLatestVersion, lt as defaultDataDir, mt as readConfigFile, n as decodeJwtPayload, nt as cancelAttention, o as promptUpdate, ot as agentConfigSchema, p as uploadClientCapabilities, pt as loadAgents, q as ensureFreshAccessToken, r as deriveHubUrlFromToken, rt as findStaleAliases, s as PACKAGE_NAME, st as clientConfigSchema, t as HubUrlDerivationError, tt as listAttentions, u as installGlobalLatest, ut as defaultHome, vt as setConfigValue, w as checkClientConfig, wt as buildMessageDocumentSnapshots, x as migrateLocalAgentDirs, xt as FirstTreeHubSDK, yt as ClientOrgMismatchError, z as ClientRuntime } from "../connect-token-kDraurL4.mjs";
4
4
  import { basename, dirname, join, relative, resolve } from "node:path";
5
5
  import { homedir, tmpdir } from "node:os";
6
6
  import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
@@ -16033,9 +16033,17 @@ function sleepSync(ms) {
16033
16033
  const SYSTEMD_UNIT = channelConfig.serviceUnitFile;
16034
16034
  const LAUNCHD_LABEL = channelConfig.launchdLabel;
16035
16035
  const SYSLOG_IDENT = channelConfig.launchdLabel;
16036
+ const SYSTEMD_BASE_PATH = [
16037
+ "/usr/local/bin",
16038
+ "/usr/bin",
16039
+ "/bin"
16040
+ ];
16036
16041
  function logDir() {
16037
16042
  return join(defaultHome(), "logs");
16038
16043
  }
16044
+ function systemdPathEnv() {
16045
+ return [dirname(process.execPath), ...SYSTEMD_BASE_PATH].filter((value, index, values) => values.indexOf(value) === index).join(":");
16046
+ }
16039
16047
  const PROXY_ENV_KEYS = [
16040
16048
  "http_proxy",
16041
16049
  "https_proxy",
@@ -16311,6 +16319,8 @@ function systemdUnitPath() {
16311
16319
  return join(process.env.XDG_CONFIG_HOME ?? join(homedir(), ".config"), "systemd", "user", SYSTEMD_UNIT);
16312
16320
  }
16313
16321
  function renderSystemdUnit(invocation, proxyEnv = collectProxyEnv()) {
16322
+ const execStart = invocation.kind === "bin" ? `${shellQuote(invocation.program)} daemon start --no-interactive` : `${shellQuote(invocation.program)} ${invocation.args.map(shellQuote).join(" ")} daemon start --no-interactive`;
16323
+ const homeEnv = `Environment=FIRST_TREE_HOME=${shellQuote(defaultHome())}\n`;
16314
16324
  return `[Unit]
16315
16325
  Description=First Tree Client
16316
16326
  StartLimitIntervalSec=300
@@ -16318,7 +16328,7 @@ StartLimitBurst=10
16318
16328
 
16319
16329
  [Service]
16320
16330
  Type=simple
16321
- ExecStart=${invocation.kind === "bin" ? `${shellQuote(invocation.program)} daemon start --no-interactive` : `${shellQuote(invocation.program)} ${invocation.args.map(shellQuote).join(" ")} daemon start --no-interactive`}
16331
+ ExecStart=${execStart}
16322
16332
  Restart=on-failure
16323
16333
  RestartSec=10
16324
16334
  SuccessExitStatus=0
@@ -16329,9 +16339,8 @@ TimeoutStopSec=30
16329
16339
  StandardOutput=journal
16330
16340
  StandardError=journal
16331
16341
  SyslogIdentifier=${SYSLOG_IDENT}
16332
- Environment=PATH=/usr/local/bin:/usr/bin:/bin
16333
- Environment=FIRST_TREE_SERVICE_MODE=1
16334
- ${`Environment=FIRST_TREE_HOME=${shellQuote(defaultHome())}\n`}${Object.entries(proxyEnv).map(([k, v]) => `Environment=${k}=${shellQuote(v)}\n`).join("")}[Install]
16342
+ ${`Environment=PATH=${shellQuote(systemdPathEnv())}\n`}Environment=FIRST_TREE_SERVICE_MODE=1
16343
+ ${homeEnv}${Object.entries(proxyEnv).map(([k, v]) => `Environment=${k}=${shellQuote(v)}\n`).join("")}[Install]
16335
16344
  WantedBy=default.target
16336
16345
  `;
16337
16346
  }
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { n as bindFeishuUser, p as status, t as bindFeishuBot, u as blank } from "./feishu-CkgQRaZF.mjs";
2
- import { A as getClientServiceStatus, B as handleClientOrgMismatch, D as checkWebSocket, E as checkServerReachable, F as restartClientService, G as AuthRefreshFailedError, H as showAttention, I as startClientService, J as ensureFreshAdminToken, K as AuthRefreshRateLimitedError, L as stopClientService, M as isServiceSupported, O as printResults, P as resolveCliInvocation, R as uninstallClientService, S as checkAgentConfigs, St as SdkError, T as checkNodeVersion, U as AttentionRespondError, V as rotateClientIdWithBackup, W as respondAttention, X as resolveAccessToken, Z as resolveServerUrl, _ as formatCheckReport, et as raiseAttention, g as promptMissingFields, h as promptAddAgent, j as installClientService, m as isInteractive, nt as cancelAttention, q as ensureFreshAccessToken, r as deriveHubUrlFromToken, t as HubUrlDerivationError, tt as listAttentions, v as onboardCheck, w as checkClientConfig, xt as FirstTreeHubSDK, y as onboardCreate, z as ClientRuntime } from "./connect-token-DTOB6yq8.mjs";
2
+ import { A as getClientServiceStatus, B as handleClientOrgMismatch, D as checkWebSocket, E as checkServerReachable, F as restartClientService, G as AuthRefreshFailedError, H as showAttention, I as startClientService, J as ensureFreshAdminToken, K as AuthRefreshRateLimitedError, L as stopClientService, M as isServiceSupported, O as printResults, P as resolveCliInvocation, R as uninstallClientService, S as checkAgentConfigs, St as SdkError, T as checkNodeVersion, U as AttentionRespondError, V as rotateClientIdWithBackup, W as respondAttention, X as resolveAccessToken, Z as resolveServerUrl, _ as formatCheckReport, et as raiseAttention, g as promptMissingFields, h as promptAddAgent, j as installClientService, m as isInteractive, nt as cancelAttention, q as ensureFreshAccessToken, r as deriveHubUrlFromToken, t as HubUrlDerivationError, tt as listAttentions, v as onboardCheck, w as checkClientConfig, xt as FirstTreeHubSDK, y as onboardCreate, z as ClientRuntime } from "./connect-token-kDraurL4.mjs";
3
3
  export { AttentionRespondError, AuthRefreshFailedError, AuthRefreshRateLimitedError, ClientRuntime, FirstTreeHubSDK, HubUrlDerivationError, SdkError, bindFeishuBot, bindFeishuUser, blank, cancelAttention, checkAgentConfigs, checkClientConfig, checkNodeVersion, checkServerReachable, checkWebSocket, deriveHubUrlFromToken, ensureFreshAccessToken, ensureFreshAdminToken, formatCheckReport, getClientServiceStatus, handleClientOrgMismatch, installClientService, isInteractive, isServiceSupported, listAttentions, onboardCheck, onboardCreate, printResults, promptAddAgent, promptMissingFields, raiseAttention, resolveAccessToken, resolveCliInvocation, resolveServerUrl, respondAttention, restartClientService, rotateClientIdWithBackup, showAttention, startClientService, status, stopClientService, uninstallClientService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "first-tree-staging",
3
- "version": "0.5.3-staging.78.1",
3
+ "version": "0.5.3-staging.80.1",
4
4
  "type": "module",
5
5
  "description": "First Tree — unified CLI for Context Tree onboarding, GitHub Scan automation, agent management, and Hub messaging. (Source-tree dev build; CI rewrites `name` and `bin` for prod / staging publishes — see docs/local-dev-isolation.md.)",
6
6
  "keywords": [
@@ -67,6 +67,7 @@
67
67
  "@first-tree/web": "workspace:*",
68
68
  "@types/node": "^22.16.0",
69
69
  "@types/semver": "^7.5.8",
70
+ "@vitest/coverage-v8": "3.2.4",
70
71
  "postgres": "^3.4.0",
71
72
  "tsdown": "^0.21.4",
72
73
  "tsx": "^4.21.0",