@akanjs/cli 2.1.1-rc.0 → 2.1.1-rc.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,328 @@
1
1
  // @bun
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
32
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
2
33
  var __require = import.meta.require;
3
34
 
35
+ // node_modules/dayjs/dayjs.min.js
36
+ var require_dayjs_min = __commonJS((exports, module) => {
37
+ (function(t, e) {
38
+ typeof exports == "object" && typeof module != "undefined" ? module.exports = e() : typeof define == "function" && define.amd ? define(e) : (t = typeof globalThis != "undefined" ? globalThis : t || self).dayjs = e();
39
+ })(exports, function() {
40
+ var t = 1000, e = 60000, n = 3600000, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
41
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
42
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
43
+ } }, m = function(t2, e2, n2) {
44
+ var r2 = String(t2);
45
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
46
+ }, v = { s: m, z: function(t2) {
47
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
48
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
49
+ }, m: function t2(e2, n2) {
50
+ if (e2.date() < n2.date())
51
+ return -t2(n2, e2);
52
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
53
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
54
+ }, a: function(t2) {
55
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
56
+ }, p: function(t2) {
57
+ return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
58
+ }, u: function(t2) {
59
+ return t2 === undefined;
60
+ } }, g = "en", D = {};
61
+ D[g] = M;
62
+ var p = "$isDayjsObject", S = function(t2) {
63
+ return t2 instanceof _ || !(!t2 || !t2[p]);
64
+ }, w = function t2(e2, n2, r2) {
65
+ var i2;
66
+ if (!e2)
67
+ return g;
68
+ if (typeof e2 == "string") {
69
+ var s2 = e2.toLowerCase();
70
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
71
+ var u2 = e2.split("-");
72
+ if (!i2 && u2.length > 1)
73
+ return t2(u2[0]);
74
+ } else {
75
+ var a2 = e2.name;
76
+ D[a2] = e2, i2 = a2;
77
+ }
78
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
79
+ }, O = function(t2, e2) {
80
+ if (S(t2))
81
+ return t2.clone();
82
+ var n2 = typeof e2 == "object" ? e2 : {};
83
+ return n2.date = t2, n2.args = arguments, new _(n2);
84
+ }, b = v;
85
+ b.l = w, b.i = S, b.w = function(t2, e2) {
86
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
87
+ };
88
+ var _ = function() {
89
+ function M2(t2) {
90
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
91
+ }
92
+ var m2 = M2.prototype;
93
+ return m2.parse = function(t2) {
94
+ this.$d = function(t3) {
95
+ var { date: e2, utc: n2 } = t3;
96
+ if (e2 === null)
97
+ return new Date(NaN);
98
+ if (b.u(e2))
99
+ return new Date;
100
+ if (e2 instanceof Date)
101
+ return new Date(e2);
102
+ if (typeof e2 == "string" && !/Z$/i.test(e2)) {
103
+ var r2 = e2.match($2);
104
+ if (r2) {
105
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
106
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
107
+ }
108
+ }
109
+ return new Date(e2);
110
+ }(t2), this.init();
111
+ }, m2.init = function() {
112
+ var t2 = this.$d;
113
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
114
+ }, m2.$utils = function() {
115
+ return b;
116
+ }, m2.isValid = function() {
117
+ return !(this.$d.toString() === l);
118
+ }, m2.isSame = function(t2, e2) {
119
+ var n2 = O(t2);
120
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
121
+ }, m2.isAfter = function(t2, e2) {
122
+ return O(t2) < this.startOf(e2);
123
+ }, m2.isBefore = function(t2, e2) {
124
+ return this.endOf(e2) < O(t2);
125
+ }, m2.$g = function(t2, e2, n2) {
126
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
127
+ }, m2.unix = function() {
128
+ return Math.floor(this.valueOf() / 1000);
129
+ }, m2.valueOf = function() {
130
+ return this.$d.getTime();
131
+ }, m2.startOf = function(t2, e2) {
132
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
133
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
134
+ return r2 ? i2 : i2.endOf(a);
135
+ }, $3 = function(t3, e3) {
136
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
137
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
138
+ switch (f2) {
139
+ case h:
140
+ return r2 ? l2(1, 0) : l2(31, 11);
141
+ case c:
142
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
143
+ case o:
144
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
145
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
146
+ case a:
147
+ case d:
148
+ return $3(v2 + "Hours", 0);
149
+ case u:
150
+ return $3(v2 + "Minutes", 1);
151
+ case s:
152
+ return $3(v2 + "Seconds", 2);
153
+ case i:
154
+ return $3(v2 + "Milliseconds", 3);
155
+ default:
156
+ return this.clone();
157
+ }
158
+ }, m2.endOf = function(t2) {
159
+ return this.startOf(t2, false);
160
+ }, m2.$set = function(t2, e2) {
161
+ var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $3 = o2 === a ? this.$D + (e2 - this.$W) : e2;
162
+ if (o2 === c || o2 === h) {
163
+ var y2 = this.clone().set(d, 1);
164
+ y2.$d[l2]($3), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
165
+ } else
166
+ l2 && this.$d[l2]($3);
167
+ return this.init(), this;
168
+ }, m2.set = function(t2, e2) {
169
+ return this.clone().$set(t2, e2);
170
+ }, m2.get = function(t2) {
171
+ return this[b.p(t2)]();
172
+ }, m2.add = function(r2, f2) {
173
+ var d2, l2 = this;
174
+ r2 = Number(r2);
175
+ var $3 = b.p(f2), y2 = function(t2) {
176
+ var e2 = O(l2);
177
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
178
+ };
179
+ if ($3 === c)
180
+ return this.set(c, this.$M + r2);
181
+ if ($3 === h)
182
+ return this.set(h, this.$y + r2);
183
+ if ($3 === a)
184
+ return y2(1);
185
+ if ($3 === o)
186
+ return y2(7);
187
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$3] || 1, m3 = this.$d.getTime() + r2 * M3;
188
+ return b.w(m3, this);
189
+ }, m2.subtract = function(t2, e2) {
190
+ return this.add(-1 * t2, e2);
191
+ }, m2.format = function(t2) {
192
+ var e2 = this, n2 = this.$locale();
193
+ if (!this.isValid())
194
+ return n2.invalidDate || l;
195
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
196
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
197
+ }, d2 = function(t3) {
198
+ return b.s(s2 % 12 || 12, t3, "0");
199
+ }, $3 = f2 || function(t3, e3, n3) {
200
+ var r3 = t3 < 12 ? "AM" : "PM";
201
+ return n3 ? r3.toLowerCase() : r3;
202
+ };
203
+ return r2.replace(y, function(t3, r3) {
204
+ return r3 || function(t4) {
205
+ switch (t4) {
206
+ case "YY":
207
+ return String(e2.$y).slice(-2);
208
+ case "YYYY":
209
+ return b.s(e2.$y, 4, "0");
210
+ case "M":
211
+ return a2 + 1;
212
+ case "MM":
213
+ return b.s(a2 + 1, 2, "0");
214
+ case "MMM":
215
+ return h2(n2.monthsShort, a2, c2, 3);
216
+ case "MMMM":
217
+ return h2(c2, a2);
218
+ case "D":
219
+ return e2.$D;
220
+ case "DD":
221
+ return b.s(e2.$D, 2, "0");
222
+ case "d":
223
+ return String(e2.$W);
224
+ case "dd":
225
+ return h2(n2.weekdaysMin, e2.$W, o2, 2);
226
+ case "ddd":
227
+ return h2(n2.weekdaysShort, e2.$W, o2, 3);
228
+ case "dddd":
229
+ return o2[e2.$W];
230
+ case "H":
231
+ return String(s2);
232
+ case "HH":
233
+ return b.s(s2, 2, "0");
234
+ case "h":
235
+ return d2(1);
236
+ case "hh":
237
+ return d2(2);
238
+ case "a":
239
+ return $3(s2, u2, true);
240
+ case "A":
241
+ return $3(s2, u2, false);
242
+ case "m":
243
+ return String(u2);
244
+ case "mm":
245
+ return b.s(u2, 2, "0");
246
+ case "s":
247
+ return String(e2.$s);
248
+ case "ss":
249
+ return b.s(e2.$s, 2, "0");
250
+ case "SSS":
251
+ return b.s(e2.$ms, 3, "0");
252
+ case "Z":
253
+ return i2;
254
+ }
255
+ return null;
256
+ }(t3) || i2.replace(":", "");
257
+ });
258
+ }, m2.utcOffset = function() {
259
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
260
+ }, m2.diff = function(r2, d2, l2) {
261
+ var $3, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
262
+ return b.m(y2, m3);
263
+ };
264
+ switch (M3) {
265
+ case h:
266
+ $3 = D2() / 12;
267
+ break;
268
+ case c:
269
+ $3 = D2();
270
+ break;
271
+ case f:
272
+ $3 = D2() / 3;
273
+ break;
274
+ case o:
275
+ $3 = (g2 - v2) / 604800000;
276
+ break;
277
+ case a:
278
+ $3 = (g2 - v2) / 86400000;
279
+ break;
280
+ case u:
281
+ $3 = g2 / n;
282
+ break;
283
+ case s:
284
+ $3 = g2 / e;
285
+ break;
286
+ case i:
287
+ $3 = g2 / t;
288
+ break;
289
+ default:
290
+ $3 = g2;
291
+ }
292
+ return l2 ? $3 : b.a($3);
293
+ }, m2.daysInMonth = function() {
294
+ return this.endOf(c).$D;
295
+ }, m2.$locale = function() {
296
+ return D[this.$L];
297
+ }, m2.locale = function(t2, e2) {
298
+ if (!t2)
299
+ return this.$L;
300
+ var n2 = this.clone(), r2 = w(t2, e2, true);
301
+ return r2 && (n2.$L = r2), n2;
302
+ }, m2.clone = function() {
303
+ return b.w(this.$d, this);
304
+ }, m2.toDate = function() {
305
+ return new Date(this.valueOf());
306
+ }, m2.toJSON = function() {
307
+ return this.isValid() ? this.toISOString() : null;
308
+ }, m2.toISOString = function() {
309
+ return this.$d.toISOString();
310
+ }, m2.toString = function() {
311
+ return this.$d.toUTCString();
312
+ }, M2;
313
+ }(), Y = _.prototype;
314
+ return O.prototype = Y, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
315
+ Y[t2[1]] = function(e2) {
316
+ return this.$g(e2, t2[0], t2[1]);
317
+ };
318
+ }), O.extend = function(t2, e2) {
319
+ return t2.$i || (t2(e2, _, O), t2.$i = true), O;
320
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
321
+ return O(1000 * t2);
322
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
323
+ });
324
+ });
325
+
4
326
  // pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
5
327
  import path37 from "path";
6
328
 
@@ -9452,6 +9774,8 @@ import { useEffect as useEffect3, useState as useState3 } from "react";
9452
9774
  import { jsxDEV as jsxDEV2, Fragment as Fragment2 } from "react/jsx-dev-runtime";
9453
9775
  "use client";
9454
9776
  // pkgs/@akanjs/devkit/cloud/cloudApi.ts
9777
+ var import_dayjs = __toESM(require_dayjs_min(), 1);
9778
+
9455
9779
  class HttpClient2 {
9456
9780
  baseUrl;
9457
9781
  constructor(baseUrl) {
@@ -9481,10 +9805,10 @@ class CloudApi {
9481
9805
  this.api = new HttpClient2(`${host}/api`);
9482
9806
  this.#accessToken = accessToken ?? null;
9483
9807
  }
9484
- async uploadEnv(devProjectId, fileStream) {
9808
+ async uploadEnv(devProjectId, file) {
9485
9809
  const formData = new FormData;
9486
9810
  formData.append("devProjectId", devProjectId);
9487
- formData.append("fileStream", await new Response(fileStream).blob());
9811
+ formData.append("file", file);
9488
9812
  const response = await this.api.post(`/uploadEnv/${devProjectId}`, formData);
9489
9813
  return response.success;
9490
9814
  }
@@ -9501,9 +9825,9 @@ class CloudApi {
9501
9825
  this.#accessToken = {
9502
9826
  jwt: accessToken.jwt,
9503
9827
  refreshToken: accessToken.refreshToken,
9504
- expiresAt: new Date(accessToken.expiresAt)
9828
+ expiresAt: accessToken.expiresAt ? import_dayjs.default(accessToken.expiresAt) : null
9505
9829
  };
9506
- return accessToken;
9830
+ return this.#accessToken;
9507
9831
  }
9508
9832
  async refreshAuthToken() {
9509
9833
  const response = await this.api.post(`/refreshRemoteAuthToken`, {
@@ -9512,12 +9836,12 @@ class CloudApi {
9512
9836
  this.#accessToken = {
9513
9837
  jwt: response.jwt,
9514
9838
  refreshToken: response.refreshToken,
9515
- expiresAt: new Date(response.expiresAt)
9839
+ expiresAt: response.expiresAt ? import_dayjs.default(response.expiresAt) : null
9516
9840
  };
9517
- return response;
9841
+ return this.#accessToken;
9518
9842
  }
9519
9843
  #needRefreshToken() {
9520
- return !!(this.#accessToken?.expiresAt && this.#accessToken.expiresAt.getTime() < Date.now() - 1000 * 60 * 60);
9844
+ return !!this.#accessToken?.expiresAt?.isBefore(import_dayjs.default().add(1, "hour"));
9521
9845
  }
9522
9846
  }
9523
9847
  // pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
package/index.js CHANGED
@@ -1,7 +1,329 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
+ var __create = Object.create;
4
+ var __getProtoOf = Object.getPrototypeOf;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
13
+ var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
21
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
22
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
23
+ for (let key of __getOwnPropNames(mod))
24
+ if (!__hasOwnProp.call(to, key))
25
+ __defProp(to, key, {
26
+ get: __accessProp.bind(mod, key),
27
+ enumerable: true
28
+ });
29
+ if (canCache)
30
+ cache.set(mod, to);
31
+ return to;
32
+ };
33
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
34
  var __require = import.meta.require;
4
35
 
36
+ // node_modules/dayjs/dayjs.min.js
37
+ var require_dayjs_min = __commonJS((exports, module) => {
38
+ (function(t, e) {
39
+ typeof exports == "object" && typeof module != "undefined" ? module.exports = e() : typeof define == "function" && define.amd ? define(e) : (t = typeof globalThis != "undefined" ? globalThis : t || self).dayjs = e();
40
+ })(exports, function() {
41
+ var t = 1000, e = 60000, n = 3600000, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
42
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
43
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
44
+ } }, m = function(t2, e2, n2) {
45
+ var r2 = String(t2);
46
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
47
+ }, v = { s: m, z: function(t2) {
48
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
49
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
50
+ }, m: function t2(e2, n2) {
51
+ if (e2.date() < n2.date())
52
+ return -t2(n2, e2);
53
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
54
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
55
+ }, a: function(t2) {
56
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
57
+ }, p: function(t2) {
58
+ return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
59
+ }, u: function(t2) {
60
+ return t2 === undefined;
61
+ } }, g = "en", D = {};
62
+ D[g] = M;
63
+ var p = "$isDayjsObject", S = function(t2) {
64
+ return t2 instanceof _ || !(!t2 || !t2[p]);
65
+ }, w = function t2(e2, n2, r2) {
66
+ var i2;
67
+ if (!e2)
68
+ return g;
69
+ if (typeof e2 == "string") {
70
+ var s2 = e2.toLowerCase();
71
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
72
+ var u2 = e2.split("-");
73
+ if (!i2 && u2.length > 1)
74
+ return t2(u2[0]);
75
+ } else {
76
+ var a2 = e2.name;
77
+ D[a2] = e2, i2 = a2;
78
+ }
79
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
80
+ }, O = function(t2, e2) {
81
+ if (S(t2))
82
+ return t2.clone();
83
+ var n2 = typeof e2 == "object" ? e2 : {};
84
+ return n2.date = t2, n2.args = arguments, new _(n2);
85
+ }, b = v;
86
+ b.l = w, b.i = S, b.w = function(t2, e2) {
87
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
88
+ };
89
+ var _ = function() {
90
+ function M2(t2) {
91
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
92
+ }
93
+ var m2 = M2.prototype;
94
+ return m2.parse = function(t2) {
95
+ this.$d = function(t3) {
96
+ var { date: e2, utc: n2 } = t3;
97
+ if (e2 === null)
98
+ return new Date(NaN);
99
+ if (b.u(e2))
100
+ return new Date;
101
+ if (e2 instanceof Date)
102
+ return new Date(e2);
103
+ if (typeof e2 == "string" && !/Z$/i.test(e2)) {
104
+ var r2 = e2.match($2);
105
+ if (r2) {
106
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
107
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
108
+ }
109
+ }
110
+ return new Date(e2);
111
+ }(t2), this.init();
112
+ }, m2.init = function() {
113
+ var t2 = this.$d;
114
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
115
+ }, m2.$utils = function() {
116
+ return b;
117
+ }, m2.isValid = function() {
118
+ return !(this.$d.toString() === l);
119
+ }, m2.isSame = function(t2, e2) {
120
+ var n2 = O(t2);
121
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
122
+ }, m2.isAfter = function(t2, e2) {
123
+ return O(t2) < this.startOf(e2);
124
+ }, m2.isBefore = function(t2, e2) {
125
+ return this.endOf(e2) < O(t2);
126
+ }, m2.$g = function(t2, e2, n2) {
127
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
128
+ }, m2.unix = function() {
129
+ return Math.floor(this.valueOf() / 1000);
130
+ }, m2.valueOf = function() {
131
+ return this.$d.getTime();
132
+ }, m2.startOf = function(t2, e2) {
133
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
134
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
135
+ return r2 ? i2 : i2.endOf(a);
136
+ }, $3 = function(t3, e3) {
137
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
138
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
139
+ switch (f2) {
140
+ case h:
141
+ return r2 ? l2(1, 0) : l2(31, 11);
142
+ case c:
143
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
144
+ case o:
145
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
146
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
147
+ case a:
148
+ case d:
149
+ return $3(v2 + "Hours", 0);
150
+ case u:
151
+ return $3(v2 + "Minutes", 1);
152
+ case s:
153
+ return $3(v2 + "Seconds", 2);
154
+ case i:
155
+ return $3(v2 + "Milliseconds", 3);
156
+ default:
157
+ return this.clone();
158
+ }
159
+ }, m2.endOf = function(t2) {
160
+ return this.startOf(t2, false);
161
+ }, m2.$set = function(t2, e2) {
162
+ var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $3 = o2 === a ? this.$D + (e2 - this.$W) : e2;
163
+ if (o2 === c || o2 === h) {
164
+ var y2 = this.clone().set(d, 1);
165
+ y2.$d[l2]($3), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
166
+ } else
167
+ l2 && this.$d[l2]($3);
168
+ return this.init(), this;
169
+ }, m2.set = function(t2, e2) {
170
+ return this.clone().$set(t2, e2);
171
+ }, m2.get = function(t2) {
172
+ return this[b.p(t2)]();
173
+ }, m2.add = function(r2, f2) {
174
+ var d2, l2 = this;
175
+ r2 = Number(r2);
176
+ var $3 = b.p(f2), y2 = function(t2) {
177
+ var e2 = O(l2);
178
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
179
+ };
180
+ if ($3 === c)
181
+ return this.set(c, this.$M + r2);
182
+ if ($3 === h)
183
+ return this.set(h, this.$y + r2);
184
+ if ($3 === a)
185
+ return y2(1);
186
+ if ($3 === o)
187
+ return y2(7);
188
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$3] || 1, m3 = this.$d.getTime() + r2 * M3;
189
+ return b.w(m3, this);
190
+ }, m2.subtract = function(t2, e2) {
191
+ return this.add(-1 * t2, e2);
192
+ }, m2.format = function(t2) {
193
+ var e2 = this, n2 = this.$locale();
194
+ if (!this.isValid())
195
+ return n2.invalidDate || l;
196
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
197
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
198
+ }, d2 = function(t3) {
199
+ return b.s(s2 % 12 || 12, t3, "0");
200
+ }, $3 = f2 || function(t3, e3, n3) {
201
+ var r3 = t3 < 12 ? "AM" : "PM";
202
+ return n3 ? r3.toLowerCase() : r3;
203
+ };
204
+ return r2.replace(y, function(t3, r3) {
205
+ return r3 || function(t4) {
206
+ switch (t4) {
207
+ case "YY":
208
+ return String(e2.$y).slice(-2);
209
+ case "YYYY":
210
+ return b.s(e2.$y, 4, "0");
211
+ case "M":
212
+ return a2 + 1;
213
+ case "MM":
214
+ return b.s(a2 + 1, 2, "0");
215
+ case "MMM":
216
+ return h2(n2.monthsShort, a2, c2, 3);
217
+ case "MMMM":
218
+ return h2(c2, a2);
219
+ case "D":
220
+ return e2.$D;
221
+ case "DD":
222
+ return b.s(e2.$D, 2, "0");
223
+ case "d":
224
+ return String(e2.$W);
225
+ case "dd":
226
+ return h2(n2.weekdaysMin, e2.$W, o2, 2);
227
+ case "ddd":
228
+ return h2(n2.weekdaysShort, e2.$W, o2, 3);
229
+ case "dddd":
230
+ return o2[e2.$W];
231
+ case "H":
232
+ return String(s2);
233
+ case "HH":
234
+ return b.s(s2, 2, "0");
235
+ case "h":
236
+ return d2(1);
237
+ case "hh":
238
+ return d2(2);
239
+ case "a":
240
+ return $3(s2, u2, true);
241
+ case "A":
242
+ return $3(s2, u2, false);
243
+ case "m":
244
+ return String(u2);
245
+ case "mm":
246
+ return b.s(u2, 2, "0");
247
+ case "s":
248
+ return String(e2.$s);
249
+ case "ss":
250
+ return b.s(e2.$s, 2, "0");
251
+ case "SSS":
252
+ return b.s(e2.$ms, 3, "0");
253
+ case "Z":
254
+ return i2;
255
+ }
256
+ return null;
257
+ }(t3) || i2.replace(":", "");
258
+ });
259
+ }, m2.utcOffset = function() {
260
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
261
+ }, m2.diff = function(r2, d2, l2) {
262
+ var $3, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
263
+ return b.m(y2, m3);
264
+ };
265
+ switch (M3) {
266
+ case h:
267
+ $3 = D2() / 12;
268
+ break;
269
+ case c:
270
+ $3 = D2();
271
+ break;
272
+ case f:
273
+ $3 = D2() / 3;
274
+ break;
275
+ case o:
276
+ $3 = (g2 - v2) / 604800000;
277
+ break;
278
+ case a:
279
+ $3 = (g2 - v2) / 86400000;
280
+ break;
281
+ case u:
282
+ $3 = g2 / n;
283
+ break;
284
+ case s:
285
+ $3 = g2 / e;
286
+ break;
287
+ case i:
288
+ $3 = g2 / t;
289
+ break;
290
+ default:
291
+ $3 = g2;
292
+ }
293
+ return l2 ? $3 : b.a($3);
294
+ }, m2.daysInMonth = function() {
295
+ return this.endOf(c).$D;
296
+ }, m2.$locale = function() {
297
+ return D[this.$L];
298
+ }, m2.locale = function(t2, e2) {
299
+ if (!t2)
300
+ return this.$L;
301
+ var n2 = this.clone(), r2 = w(t2, e2, true);
302
+ return r2 && (n2.$L = r2), n2;
303
+ }, m2.clone = function() {
304
+ return b.w(this.$d, this);
305
+ }, m2.toDate = function() {
306
+ return new Date(this.valueOf());
307
+ }, m2.toJSON = function() {
308
+ return this.isValid() ? this.toISOString() : null;
309
+ }, m2.toISOString = function() {
310
+ return this.$d.toISOString();
311
+ }, m2.toString = function() {
312
+ return this.$d.toUTCString();
313
+ }, M2;
314
+ }(), Y = _.prototype;
315
+ return O.prototype = Y, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
316
+ Y[t2[1]] = function(e2) {
317
+ return this.$g(e2, t2[0], t2[1]);
318
+ };
319
+ }), O.extend = function(t2, e2) {
320
+ return t2.$i || (t2(e2, _, O), t2.$i = true), O;
321
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
322
+ return O(1000 * t2);
323
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
324
+ });
325
+ });
326
+
5
327
  // pkgs/@akanjs/devkit/aiEditor.ts
6
328
  import { input, select } from "@inquirer/prompts";
7
329
  import {
@@ -9450,6 +9772,8 @@ import { useEffect as useEffect3, useState as useState3 } from "react";
9450
9772
  import { jsxDEV as jsxDEV2, Fragment as Fragment2 } from "react/jsx-dev-runtime";
9451
9773
  "use client";
9452
9774
  // pkgs/@akanjs/devkit/cloud/cloudApi.ts
9775
+ var import_dayjs = __toESM(require_dayjs_min(), 1);
9776
+
9453
9777
  class HttpClient2 {
9454
9778
  baseUrl;
9455
9779
  constructor(baseUrl) {
@@ -9479,10 +9803,10 @@ class CloudApi {
9479
9803
  this.api = new HttpClient2(`${host}/api`);
9480
9804
  this.#accessToken = accessToken ?? null;
9481
9805
  }
9482
- async uploadEnv(devProjectId, fileStream) {
9806
+ async uploadEnv(devProjectId, file) {
9483
9807
  const formData = new FormData;
9484
9808
  formData.append("devProjectId", devProjectId);
9485
- formData.append("fileStream", await new Response(fileStream).blob());
9809
+ formData.append("file", file);
9486
9810
  const response = await this.api.post(`/uploadEnv/${devProjectId}`, formData);
9487
9811
  return response.success;
9488
9812
  }
@@ -9499,9 +9823,9 @@ class CloudApi {
9499
9823
  this.#accessToken = {
9500
9824
  jwt: accessToken.jwt,
9501
9825
  refreshToken: accessToken.refreshToken,
9502
- expiresAt: new Date(accessToken.expiresAt)
9826
+ expiresAt: accessToken.expiresAt ? import_dayjs.default(accessToken.expiresAt) : null
9503
9827
  };
9504
- return accessToken;
9828
+ return this.#accessToken;
9505
9829
  }
9506
9830
  async refreshAuthToken() {
9507
9831
  const response = await this.api.post(`/refreshRemoteAuthToken`, {
@@ -9510,12 +9834,12 @@ class CloudApi {
9510
9834
  this.#accessToken = {
9511
9835
  jwt: response.jwt,
9512
9836
  refreshToken: response.refreshToken,
9513
- expiresAt: new Date(response.expiresAt)
9837
+ expiresAt: response.expiresAt ? import_dayjs.default(response.expiresAt) : null
9514
9838
  };
9515
- return response;
9839
+ return this.#accessToken;
9516
9840
  }
9517
9841
  #needRefreshToken() {
9518
- return !!(this.#accessToken?.expiresAt && this.#accessToken.expiresAt.getTime() < Date.now() - 1000 * 60 * 60);
9842
+ return !!this.#accessToken?.expiresAt?.isBefore(import_dayjs.default().add(1, "hour"));
9519
9843
  }
9520
9844
  }
9521
9845
  // pkgs/@akanjs/cli/application/application.command.ts
@@ -10452,10 +10776,10 @@ class CloudRunner extends runner("cloud") {
10452
10776
  }
10453
10777
  async login() {
10454
10778
  const config = await getHostConfig();
10455
- const self = config.auth ? await getSelf(config.auth.token) : null;
10456
- if (self) {
10779
+ const self2 = config.auth ? await getSelf(config.auth.token) : null;
10780
+ if (self2) {
10457
10781
  Logger15.rawLog(chalk7.green(`
10458
- \u2713 Already logged in akan cloud as ${self.nickname}
10782
+ \u2713 Already logged in akan cloud as ${self2.nickname}
10459
10783
  `));
10460
10784
  return true;
10461
10785
  }
@@ -10485,12 +10809,12 @@ ${chalk7.green("\u27A4")} Authentication Required`));
10485
10809
  for (let i = 0;i < MAX_RETRY; i++) {
10486
10810
  const res = await fetch(`${akanCloudUrl}/user/getRemoteAuthToken/${remoteId}`);
10487
10811
  const { jwt } = await res.json();
10488
- const self2 = jwt ? await getSelf(jwt) : null;
10489
- if (jwt && self2) {
10490
- setHostConfig(akanCloudHost, { auth: { token: jwt, self: self2 } });
10812
+ const self3 = jwt ? await getSelf(jwt) : null;
10813
+ if (jwt && self3) {
10814
+ setHostConfig(akanCloudHost, { auth: { token: jwt, self: self3 } });
10491
10815
  Logger15.rawLog(chalk7.green(`\r\u2713 Authentication successful!`));
10492
10816
  Logger15.rawLog(chalk7.green.bold(`
10493
- \u2728 Welcome aboard, ${self2.nickname}!`));
10817
+ \u2728 Welcome aboard, ${self3.nickname}!`));
10494
10818
  Logger15.rawLog(chalk7.dim(`You're now ready to use Akan CLI!
10495
10819
  `));
10496
10820
  return true;
@@ -10640,8 +10964,8 @@ ${chalk7.green("\u27A4")} Authentication Required`));
10640
10964
  async downloadEnv(workspace) {
10641
10965
  const repoName = workspace.repoName;
10642
10966
  const config = await getHostConfig();
10643
- const self = config.auth ? await getSelf(config.auth.token) : null;
10644
- if (!self)
10967
+ const self2 = config.auth ? await getSelf(config.auth.token) : null;
10968
+ if (!self2)
10645
10969
  throw new Error("Not logged in");
10646
10970
  const res = await fetch(`${akanCloudUrl}/api/akasys/akasys/${repoName}`, {
10647
10971
  headers: { Authorization: `Bearer ${config.auth?.token}` }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "2.1.1-rc.0",
3
+ "version": "2.1.1-rc.1",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -35,7 +35,7 @@
35
35
  "@langchain/openai": "^1.4.6",
36
36
  "@tailwindcss/node": "^4.3.0",
37
37
  "@trapezedev/project": "^7.1.4",
38
- "akanjs": "2.1.1-rc.0",
38
+ "akanjs": "2.1.1-rc.1",
39
39
  "chalk": "^5.6.2",
40
40
  "commander": "^14.0.3",
41
41
  "daisyui": "^5.5.20",
package/typecheck.proc.js CHANGED
@@ -1,4 +1,35 @@
1
1
  // @bun
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
32
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
2
33
  var __require = import.meta.require;
3
34
 
4
35
  // pkgs/@akanjs/devkit/typeChecker.ts