@lotics/cli 0.171.0 → 0.172.0

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.
Files changed (2) hide show
  1. package/dist/src/cli.js +42 -5
  2. package/package.json +1 -1
package/dist/src/cli.js CHANGED
@@ -45696,7 +45696,17 @@ function resultSideEffects(result) {
45696
45696
  }
45697
45697
 
45698
45698
  // src/version.ts
45699
- var VERSION = "0.171.0";
45699
+ var VERSION = "0.172.0";
45700
+
45701
+ // src/timezone.ts
45702
+ function machineTimezone() {
45703
+ try {
45704
+ const zone = Intl.DateTimeFormat().resolvedOptions().timeZone;
45705
+ return zone !== void 0 && zone !== "" ? zone : void 0;
45706
+ } catch {
45707
+ return void 0;
45708
+ }
45709
+ }
45700
45710
 
45701
45711
  // src/docs_command.ts
45702
45712
  import fs5 from "node:fs";
@@ -71683,6 +71693,17 @@ function runTar(args, cwd) {
71683
71693
  });
71684
71694
  });
71685
71695
  }
71696
+ function npmIsInstalled() {
71697
+ return new Promise((resolve2) => {
71698
+ const probe = spawn2("npm", ["--version"], {
71699
+ shell: process.platform === "win32",
71700
+ stdio: "ignore",
71701
+ env: ipv4ChildEnv(process.env)
71702
+ });
71703
+ probe.on("error", () => resolve2(false));
71704
+ probe.on("exit", (code) => resolve2(code === 0));
71705
+ });
71706
+ }
71686
71707
  function runNpm(args, cwd) {
71687
71708
  const quiet = isMachineOutput();
71688
71709
  return new Promise((resolve2, reject2) => {
@@ -71714,12 +71735,27 @@ function runNpm(args, cwd) {
71714
71735
  proc.stdout?.on("data", collect);
71715
71736
  proc.stderr?.on("data", collect);
71716
71737
  }
71717
- proc.on("error", reject2);
71738
+ proc.on("error", (error52) => void failed(error52, null));
71718
71739
  proc.on("exit", (code) => {
71719
71740
  if (code === 0) {
71720
71741
  resolve2();
71721
71742
  return;
71722
71743
  }
71744
+ void failed(void 0, code);
71745
+ });
71746
+ async function failed(error52, code) {
71747
+ if (!await npmIsInstalled()) {
71748
+ reject2(
71749
+ new Error(
71750
+ "npm was not found, and building an app needs it.\n Install Node.js 18 or newer (npm comes with it), then run this again:\n https://nodejs.org/en/download\n The Lotics CLI itself needs no Node \u2014 only this build step does."
71751
+ )
71752
+ );
71753
+ return;
71754
+ }
71755
+ if (error52 !== void 0) {
71756
+ reject2(error52);
71757
+ return;
71758
+ }
71723
71759
  const tail = captured.slice(-NPM_LOG_TAIL_BYTES).trim();
71724
71760
  reject2(
71725
71761
  new Error(
@@ -71728,7 +71764,7 @@ function runNpm(args, cwd) {
71728
71764
  ${tail}`)
71729
71765
  )
71730
71766
  );
71731
- });
71767
+ }
71732
71768
  });
71733
71769
  }
71734
71770
  var NPM_LOG_TAIL_BYTES = 8e3;
@@ -103192,7 +103228,7 @@ Auth flags:
103192
103228
  signup/api-key write a self-contained ./.lotics/config.json
103193
103229
  (inline key) \u2014 for a hermetic worktree or CI.
103194
103230
  --name <name> (signup) Display name (defaults to email prefix)
103195
- --timezone <timezone> (signup) Workspace timezone (defaults to UTC, e.g. Asia/Ho_Chi_Minh)
103231
+ --timezone <timezone> (signup) Workspace timezone (defaults to this machine's, e.g. Asia/Ho_Chi_Minh)
103196
103232
 
103197
103233
  API keys are stored once per org as named profiles in ~/.lotics/config.json.
103198
103234
  Registering a second key adds a profile \u2014 it does not overwrite the first.
@@ -103234,7 +103270,8 @@ async function publicPost(path13, body) {
103234
103270
  async function signupAccount(args) {
103235
103271
  const body = { email: args.email };
103236
103272
  if (args.name) body.name = args.name;
103237
- if (args.timezone) body.timezone = args.timezone;
103273
+ const timezone = args.timezone ?? machineTimezone();
103274
+ if (timezone) body.timezone = timezone;
103238
103275
  const { ok, status, data: data2 } = await publicPost("/v1/cli/signup", body);
103239
103276
  if (!ok) {
103240
103277
  if (status === 409) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.171.0",
3
+ "version": "0.172.0",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {