@integrity-labs/agt-cli 0.16.0 → 0.16.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.
@@ -6895,7 +6895,7 @@ function provision(input, frameworkId = "openclaw") {
6895
6895
  import chalk3 from "chalk";
6896
6896
  import { existsSync as existsSync7, realpathSync } from "fs";
6897
6897
  import { join as join8 } from "path";
6898
- import { homedir as homedir6 } from "os";
6898
+ import { homedir as homedir6, userInfo } from "os";
6899
6899
  import { spawn as spawn3 } from "child_process";
6900
6900
 
6901
6901
  // src/lib/watchdog.ts
@@ -7086,6 +7086,20 @@ function table(headers, rows) {
7086
7086
  // src/commands/manager.ts
7087
7087
  function managerStartCommand(opts) {
7088
7088
  const json = isJsonMode();
7089
+ if (!process.env.HOME || !process.env.HOME.trim()) {
7090
+ const fallback = homedir6();
7091
+ process.env.HOME = fallback;
7092
+ if (!json) {
7093
+ info(`HOME was not set in the manager env \u2014 defaulting to ${fallback}.`);
7094
+ info(" This usually means the manager was launched without a user shell session.");
7095
+ info(" For reboot survival, install the supervisor: agt manager install");
7096
+ }
7097
+ }
7098
+ if (!process.env.USER || !process.env.USER.trim()) {
7099
+ const fallback = userInfo().username;
7100
+ process.env.USER = fallback;
7101
+ if (!json) info(`USER was not set in the manager env \u2014 defaulting to ${fallback}.`);
7102
+ }
7089
7103
  const apiKey = getApiKey();
7090
7104
  if (!apiKey) {
7091
7105
  const msg = "AGT_API_KEY is not set. Export it with your host API key (tlk_...)";
@@ -7346,7 +7360,11 @@ async function managerInstallCommand(opts = {}) {
7346
7360
  }
7347
7361
  }
7348
7362
  const env2 = {
7349
- AGT_HOST: getHost()
7363
+ AGT_HOST: getHost(),
7364
+ // ?? alone wouldn't catch `HOME=""` from a stripped systemd env.
7365
+ // Treat empty / whitespace-only as missing.
7366
+ HOME: process.env.HOME?.trim() || homedir6(),
7367
+ USER: process.env.USER?.trim() || userInfo().username
7350
7368
  };
7351
7369
  const apiKey = getApiKey();
7352
7370
  if (apiKey) env2.AGT_API_KEY = apiKey;
@@ -7454,4 +7472,4 @@ export {
7454
7472
  managerInstallCommand,
7455
7473
  managerUninstallCommand
7456
7474
  };
7457
- //# sourceMappingURL=chunk-LU6L2J32.js.map
7475
+ //# sourceMappingURL=chunk-ITLXAEXI.js.map