@trydecember/cli 0.3.10 → 0.3.12

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/README.md CHANGED
@@ -14,19 +14,7 @@ December is an AI coding assistant that lives in your terminal. It understands y
14
14
 
15
15
  ### Get Started
16
16
 
17
- #### Standalone Installer (macOS & Linux)
18
-
19
- ```bash
20
- curl -fsSL https://cli.trydecember.com | bash
21
- ```
22
-
23
- #### Standalone Installer (Windows PowerShell)
24
-
25
- ```powershell
26
- irm https://cli.trydecember.com/ps1 | iex
27
- ```
28
-
29
- #### NPM Package
17
+ 1. Install December:
30
18
 
31
19
  ```bash
32
20
  npm install -g @trydecember/cli
package/dist/december.js CHANGED
@@ -23149,7 +23149,7 @@ var init_env = __esm(() => {
23149
23149
  init_zod();
23150
23150
  env3 = createEnv({
23151
23151
  server: {
23152
- ENV: exports_external.enum(["DEV", "TEST", "PROD"]).default("DEV"),
23152
+ NODE_ENV: exports_external.enum(["development", "test", "production"]).default("development"),
23153
23153
  PORT: exports_external.coerce.number().default(3000),
23154
23154
  LOG_LEVEL: exports_external.enum(["debug", "info", "warn", "error"]).default("info"),
23155
23155
  DATABASE_URL: exports_external.string().optional(),
@@ -23166,8 +23166,15 @@ var init_env = __esm(() => {
23166
23166
  clientPrefix: "",
23167
23167
  client: {},
23168
23168
  runtimeEnv: process.env,
23169
- emptyStringAsUndefined: true
23169
+ emptyStringAsUndefined: true,
23170
+ onValidationError: (error3) => {
23171
+ console.error("Shared environment validation error:", error3);
23172
+ throw new Error("Invalid shared environment variables");
23173
+ }
23170
23174
  });
23175
+ if (env3.NODE_ENV === "production" && env3.JWT_SECRET === "default-dev-jwt-secret") {
23176
+ throw new Error("JWT_SECRET must be configured with a secure secret in production.");
23177
+ }
23171
23178
  });
23172
23179
 
23173
23180
  // ../../packages/shared/src/truncate.ts
@@ -118438,11 +118445,11 @@ var require_codegen = __commonJS(function(exports) {
118438
118445
  const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`;
118439
118446
  return `${varKind} ${this.name}${rhs};` + _n;
118440
118447
  }
118441
- optimizeNames(names, constants2) {
118448
+ optimizeNames(names, constants3) {
118442
118449
  if (!names[this.name.str])
118443
118450
  return;
118444
118451
  if (this.rhs)
118445
- this.rhs = optimizeExpr(this.rhs, names, constants2);
118452
+ this.rhs = optimizeExpr(this.rhs, names, constants3);
118446
118453
  return this;
118447
118454
  }
118448
118455
  get names() {
@@ -118460,10 +118467,10 @@ var require_codegen = __commonJS(function(exports) {
118460
118467
  render({ _n }) {
118461
118468
  return `${this.lhs} = ${this.rhs};` + _n;
118462
118469
  }
118463
- optimizeNames(names, constants2) {
118470
+ optimizeNames(names, constants3) {
118464
118471
  if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
118465
118472
  return;
118466
- this.rhs = optimizeExpr(this.rhs, names, constants2);
118473
+ this.rhs = optimizeExpr(this.rhs, names, constants3);
118467
118474
  return this;
118468
118475
  }
118469
118476
  get names() {
@@ -118529,8 +118536,8 @@ var require_codegen = __commonJS(function(exports) {
118529
118536
  optimizeNodes() {
118530
118537
  return `${this.code}` ? this : undefined;
118531
118538
  }
118532
- optimizeNames(names, constants2) {
118533
- this.code = optimizeExpr(this.code, names, constants2);
118539
+ optimizeNames(names, constants3) {
118540
+ this.code = optimizeExpr(this.code, names, constants3);
118534
118541
  return this;
118535
118542
  }
118536
118543
  get names() {
@@ -118560,12 +118567,12 @@ var require_codegen = __commonJS(function(exports) {
118560
118567
  }
118561
118568
  return nodes.length > 0 ? this : undefined;
118562
118569
  }
118563
- optimizeNames(names, constants2) {
118570
+ optimizeNames(names, constants3) {
118564
118571
  const { nodes } = this;
118565
118572
  let i2 = nodes.length;
118566
118573
  while (i2--) {
118567
118574
  const n = nodes[i2];
118568
- if (n.optimizeNames(names, constants2))
118575
+ if (n.optimizeNames(names, constants3))
118569
118576
  continue;
118570
118577
  subtractNames(names, n.names);
118571
118578
  nodes.splice(i2, 1);
@@ -118622,12 +118629,12 @@ var require_codegen = __commonJS(function(exports) {
118622
118629
  return;
118623
118630
  return this;
118624
118631
  }
118625
- optimizeNames(names, constants2) {
118632
+ optimizeNames(names, constants3) {
118626
118633
  var _a7;
118627
- this.else = (_a7 = this.else) === null || _a7 === undefined ? undefined : _a7.optimizeNames(names, constants2);
118628
- if (!(super.optimizeNames(names, constants2) || this.else))
118634
+ this.else = (_a7 = this.else) === null || _a7 === undefined ? undefined : _a7.optimizeNames(names, constants3);
118635
+ if (!(super.optimizeNames(names, constants3) || this.else))
118629
118636
  return;
118630
- this.condition = optimizeExpr(this.condition, names, constants2);
118637
+ this.condition = optimizeExpr(this.condition, names, constants3);
118631
118638
  return this;
118632
118639
  }
118633
118640
  get names() {
@@ -118652,10 +118659,10 @@ var require_codegen = __commonJS(function(exports) {
118652
118659
  render(opts) {
118653
118660
  return `for(${this.iteration})` + super.render(opts);
118654
118661
  }
118655
- optimizeNames(names, constants2) {
118656
- if (!super.optimizeNames(names, constants2))
118662
+ optimizeNames(names, constants3) {
118663
+ if (!super.optimizeNames(names, constants3))
118657
118664
  return;
118658
- this.iteration = optimizeExpr(this.iteration, names, constants2);
118665
+ this.iteration = optimizeExpr(this.iteration, names, constants3);
118659
118666
  return this;
118660
118667
  }
118661
118668
  get names() {
@@ -118693,10 +118700,10 @@ var require_codegen = __commonJS(function(exports) {
118693
118700
  render(opts) {
118694
118701
  return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
118695
118702
  }
118696
- optimizeNames(names, constants2) {
118697
- if (!super.optimizeNames(names, constants2))
118703
+ optimizeNames(names, constants3) {
118704
+ if (!super.optimizeNames(names, constants3))
118698
118705
  return;
118699
- this.iterable = optimizeExpr(this.iterable, names, constants2);
118706
+ this.iterable = optimizeExpr(this.iterable, names, constants3);
118700
118707
  return this;
118701
118708
  }
118702
118709
  get names() {
@@ -118741,11 +118748,11 @@ var require_codegen = __commonJS(function(exports) {
118741
118748
  (_b = this.finally) === null || _b === undefined || _b.optimizeNodes();
118742
118749
  return this;
118743
118750
  }
118744
- optimizeNames(names, constants2) {
118751
+ optimizeNames(names, constants3) {
118745
118752
  var _a7, _b;
118746
- super.optimizeNames(names, constants2);
118747
- (_a7 = this.catch) === null || _a7 === undefined || _a7.optimizeNames(names, constants2);
118748
- (_b = this.finally) === null || _b === undefined || _b.optimizeNames(names, constants2);
118753
+ super.optimizeNames(names, constants3);
118754
+ (_a7 = this.catch) === null || _a7 === undefined || _a7.optimizeNames(names, constants3);
118755
+ (_b = this.finally) === null || _b === undefined || _b.optimizeNames(names, constants3);
118749
118756
  return this;
118750
118757
  }
118751
118758
  get names() {
@@ -119019,7 +119026,7 @@ var require_codegen = __commonJS(function(exports) {
119019
119026
  function addExprNames(names, from) {
119020
119027
  return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
119021
119028
  }
119022
- function optimizeExpr(expr, names, constants2) {
119029
+ function optimizeExpr(expr, names, constants3) {
119023
119030
  if (expr instanceof code_1.Name)
119024
119031
  return replaceName(expr);
119025
119032
  if (!canOptimize(expr))
@@ -119034,14 +119041,14 @@ var require_codegen = __commonJS(function(exports) {
119034
119041
  return items;
119035
119042
  }, []));
119036
119043
  function replaceName(n) {
119037
- const c = constants2[n.str];
119044
+ const c = constants3[n.str];
119038
119045
  if (c === undefined || names[n.str] !== 1)
119039
119046
  return n;
119040
119047
  delete names[n.str];
119041
119048
  return c;
119042
119049
  }
119043
119050
  function canOptimize(e2) {
119044
- return e2 instanceof code_1._Code && e2._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants2[c.str] !== undefined);
119051
+ return e2 instanceof code_1._Code && e2._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants3[c.str] !== undefined);
119045
119052
  }
119046
119053
  }
119047
119054
  function subtractNames(names, from) {
@@ -151422,7 +151429,7 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151422
151429
  kHTTPContext,
151423
151430
  kClosed
151424
151431
  } = require_symbols();
151425
- var constants2 = require_constants4();
151432
+ var constants3 = require_constants4();
151426
151433
  var EMPTY_BUF = Buffer.alloc(0);
151427
151434
  var FastBuffer = Buffer[Symbol.species];
151428
151435
  var removeAllListeners = util4.removeAllListeners;
@@ -151501,7 +151508,7 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151501
151508
  class Parser3 {
151502
151509
  constructor(client, socket, { exports: exports2 }) {
151503
151510
  this.llhttp = exports2;
151504
- this.ptr = this.llhttp.llhttp_alloc(constants2.TYPE.RESPONSE);
151511
+ this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE);
151505
151512
  this.client = client;
151506
151513
  this.socket = socket;
151507
151514
  this.timeout = null;
@@ -151594,11 +151601,11 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151594
151601
  currentParser = null;
151595
151602
  currentBufferRef = null;
151596
151603
  }
151597
- if (ret !== constants2.ERROR.OK) {
151604
+ if (ret !== constants3.ERROR.OK) {
151598
151605
  const data2 = chunk.subarray(llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr);
151599
- if (ret === constants2.ERROR.PAUSED_UPGRADE) {
151606
+ if (ret === constants3.ERROR.PAUSED_UPGRADE) {
151600
151607
  this.onUpgrade(data2);
151601
- } else if (ret === constants2.ERROR.PAUSED) {
151608
+ } else if (ret === constants3.ERROR.PAUSED) {
151602
151609
  this.paused = true;
151603
151610
  socket.unshift(data2);
151604
151611
  } else {
@@ -151621,10 +151628,10 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151621
151628
  } finally {
151622
151629
  currentParser = null;
151623
151630
  }
151624
- if (ret === constants2.ERROR.OK) {
151631
+ if (ret === constants3.ERROR.OK) {
151625
151632
  return null;
151626
151633
  }
151627
- if (ret === constants2.ERROR.PAUSED || ret === constants2.ERROR.PAUSED_UPGRADE) {
151634
+ if (ret === constants3.ERROR.PAUSED || ret === constants3.ERROR.PAUSED_UPGRADE) {
151628
151635
  this.paused = true;
151629
151636
  return null;
151630
151637
  }
@@ -151641,7 +151648,7 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151641
151648
  const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
151642
151649
  message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
151643
151650
  }
151644
- return new HTTPParserError(message, constants2.ERROR[ret], data2);
151651
+ return new HTTPParserError(message, constants3.ERROR[ret], data2);
151645
151652
  }
151646
151653
  destroy() {
151647
151654
  assert2(currentParser === null);
@@ -151820,7 +151827,7 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151820
151827
  socket[kBlocking] = false;
151821
151828
  client[kResume]();
151822
151829
  }
151823
- return pause ? constants2.ERROR.PAUSED : 0;
151830
+ return pause ? constants3.ERROR.PAUSED : 0;
151824
151831
  }
151825
151832
  onBody(buf) {
151826
151833
  const { client, socket, statusCode, maxResponseSize } = this;
@@ -151842,7 +151849,7 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151842
151849
  }
151843
151850
  this.bytesRead += buf.length;
151844
151851
  if (request.onData(buf) === false) {
151845
- return constants2.ERROR.PAUSED;
151852
+ return constants3.ERROR.PAUSED;
151846
151853
  }
151847
151854
  return 0;
151848
151855
  }
@@ -151879,13 +151886,13 @@ var require_client_h1 = __commonJS(function(exports, module3) {
151879
151886
  if (socket[kWriting]) {
151880
151887
  assert2(client[kRunning] === 0);
151881
151888
  util4.destroy(socket, new InformationalError("reset"));
151882
- return constants2.ERROR.PAUSED;
151889
+ return constants3.ERROR.PAUSED;
151883
151890
  } else if (!shouldKeepAlive) {
151884
151891
  util4.destroy(socket, new InformationalError("reset"));
151885
- return constants2.ERROR.PAUSED;
151892
+ return constants3.ERROR.PAUSED;
151886
151893
  } else if (socket[kReset] && client[kRunning] === 0) {
151887
151894
  util4.destroy(socket, new InformationalError("reset"));
151888
- return constants2.ERROR.PAUSED;
151895
+ return constants3.ERROR.PAUSED;
151889
151896
  } else if (client[kPipelining] == null || client[kPipelining] === 1) {
151890
151897
  setImmediate(client[kResume]);
151891
151898
  } else {
@@ -169023,9 +169030,9 @@ function openUrl(url2, execFn = cp2.exec, osPlatform = () => os4.platform(), osR
169023
169030
  var init_open = () => {};
169024
169031
 
169025
169032
  // src/auth/device.ts
169026
- async function loginViaDeviceCode(baseUrl = process.env.SERVER_URL || process.env.WEB_URL || "https://api.trydecember.com", onCodeGenerated) {
169033
+ async function loginViaDeviceCode(serverUrl = process.env.SERVER_URL || "https://api.trydecember.com", onCodeGenerated) {
169027
169034
  try {
169028
- const genRes = await fetch(`${baseUrl}/api/v1/auth/device/code`, {
169035
+ const genRes = await fetch(`${serverUrl}/api/v1/auth/device/code`, {
169029
169036
  method: "POST",
169030
169037
  headers: { "Content-Type": "application/json" }
169031
169038
  });
@@ -169049,7 +169056,7 @@ async function loginViaDeviceCode(baseUrl = process.env.SERVER_URL || process.en
169049
169056
  return;
169050
169057
  }
169051
169058
  try {
169052
- const tokenRes = await fetch(`${baseUrl}/api/v1/auth/device/token`, {
169059
+ const tokenRes = await fetch(`${serverUrl}/api/v1/auth/device/token`, {
169053
169060
  method: "POST",
169054
169061
  headers: { "Content-Type": "application/json" },
169055
169062
  body: JSON.stringify({ deviceCode })
@@ -170948,7 +170955,7 @@ var require_scan = __commonJS(function(exports, module3) {
170948
170955
 
170949
170956
  // ../../node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
170950
170957
  var require_parse7 = __commonJS(function(exports, module3) {
170951
- var constants2 = require_constants9();
170958
+ var constants3 = require_constants9();
170952
170959
  var utils = require_utils8();
170953
170960
  var {
170954
170961
  MAX_LENGTH,
@@ -170956,7 +170963,7 @@ var require_parse7 = __commonJS(function(exports, module3) {
170956
170963
  REGEX_NON_SPECIAL_CHARS,
170957
170964
  REGEX_SPECIAL_CHARS_BACKREF,
170958
170965
  REPLACEMENTS
170959
- } = constants2;
170966
+ } = constants3;
170960
170967
  var expandRange = (args, options) => {
170961
170968
  if (typeof options.expandRange === "function") {
170962
170969
  return options.expandRange(...args, options);
@@ -171162,7 +171169,7 @@ var require_parse7 = __commonJS(function(exports, module3) {
171162
171169
  if (options.maxExtglobRecursion === false) {
171163
171170
  return { risky: false };
171164
171171
  }
171165
- const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
171172
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants3.DEFAULT_MAX_EXTGLOB_RECURSION;
171166
171173
  const branches = splitTopLevel(body).map((branch) => branch.trim());
171167
171174
  if (branches.length > 1) {
171168
171175
  if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
@@ -171195,8 +171202,8 @@ var require_parse7 = __commonJS(function(exports, module3) {
171195
171202
  const tokens = [bos];
171196
171203
  const capture = opts.capture ? "" : "?:";
171197
171204
  const win32 = utils.isWindows(options);
171198
- const PLATFORM_CHARS = constants2.globChars(win32);
171199
- const EXTGLOB_CHARS = constants2.extglobChars(PLATFORM_CHARS);
171205
+ const PLATFORM_CHARS = constants3.globChars(win32);
171206
+ const EXTGLOB_CHARS = constants3.extglobChars(PLATFORM_CHARS);
171200
171207
  const {
171201
171208
  DOT_LITERAL,
171202
171209
  PLUS_LITERAL,
@@ -171900,7 +171907,7 @@ var require_parse7 = __commonJS(function(exports, module3) {
171900
171907
  NO_DOTS_SLASH,
171901
171908
  STAR,
171902
171909
  START_ANCHOR
171903
- } = constants2.globChars(win32);
171910
+ } = constants3.globChars(win32);
171904
171911
  const nodot = opts.dot ? NO_DOTS : NO_DOT;
171905
171912
  const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
171906
171913
  const capture = opts.capture ? "" : "?:";
@@ -171959,7 +171966,7 @@ var require_picomatch = __commonJS(function(exports, module3) {
171959
171966
  var scan = require_scan();
171960
171967
  var parse15 = require_parse7();
171961
171968
  var utils = require_utils8();
171962
- var constants2 = require_constants9();
171969
+ var constants3 = require_constants9();
171963
171970
  var isObject2 = (val2) => val2 && typeof val2 === "object" && !Array.isArray(val2);
171964
171971
  var picomatch = (glob2, options, returnState = false) => {
171965
171972
  if (Array.isArray(glob2)) {
@@ -172090,7 +172097,7 @@ var require_picomatch = __commonJS(function(exports, module3) {
172090
172097
  return /$^/;
172091
172098
  }
172092
172099
  };
172093
- picomatch.constants = constants2;
172100
+ picomatch.constants = constants3;
172094
172101
  module3.exports = picomatch;
172095
172102
  });
172096
172103
 
@@ -177323,7 +177330,7 @@ var init_yoga_wasm_base64_esm = __esm(() => {
177323
177330
  });
177324
177331
 
177325
177332
  // ../../node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/generated/YGEnums.js
177326
- var Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, constants2, YGEnums_default;
177333
+ var Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, constants3, YGEnums_default;
177327
177334
  var init_YGEnums = __esm(() => {
177328
177335
  Align = /* @__PURE__ */ function(Align2) {
177329
177336
  Align2[Align2["Auto"] = 0] = "Auto";
@@ -177451,7 +177458,7 @@ var init_YGEnums = __esm(() => {
177451
177458
  Wrap2[Wrap2["WrapReverse"] = 2] = "WrapReverse";
177452
177459
  return Wrap2;
177453
177460
  }({});
177454
- constants2 = {
177461
+ constants3 = {
177455
177462
  ALIGN_AUTO: Align.Auto,
177456
177463
  ALIGN_FLEX_START: Align.FlexStart,
177457
177464
  ALIGN_CENTER: Align.Center,
@@ -177525,7 +177532,7 @@ var init_YGEnums = __esm(() => {
177525
177532
  WRAP_WRAP: Wrap.Wrap,
177526
177533
  WRAP_WRAP_REVERSE: Wrap.WrapReverse
177527
177534
  };
177528
- YGEnums_default = constants2;
177535
+ YGEnums_default = constants3;
177529
177536
  });
177530
177537
 
177531
177538
  // ../../node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/wrapAssembly.js
@@ -265435,7 +265442,7 @@ function instantiateProvider(provider, apiKey) {
265435
265442
  return openaiProvider(`http://localhost:${process.env.SERVER_PORT}/api/v1`, apiKey);
265436
265443
  }
265437
265444
  const serverUrl = process.env.SERVER_URL || "https://api.trydecember.com";
265438
- const proxyUrl = `${serverUrl}/api/v1/cli`;
265445
+ const proxyUrl = `${serverUrl.replace(/\/+$/, "")}/api/v1/cli`;
265439
265446
  return openaiProvider(proxyUrl, apiKey);
265440
265447
  }
265441
265448
  }
@@ -267456,7 +267463,7 @@ import path20 from "node:path";
267456
267463
  // package.json
267457
267464
  var package_default = {
267458
267465
  name: "@trydecember/cli",
267459
- version: "0.3.10",
267466
+ version: "0.3.12",
267460
267467
  description: "AI coding agent for terminal and cloud.",
267461
267468
  homepage: "https://trydecember.com",
267462
267469
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trydecember/cli",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "AI coding agent for terminal and cloud.",
5
5
  "homepage": "https://trydecember.com",
6
6
  "repository": {