taskair-cli 1.0.4 → 1.0.5

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/index.js +206 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -383,9 +383,14 @@ function ConfigUI({ initialApiUrl }) {
383
383
  <title>TaskAir CLI Authenticated</title>
384
384
  <style>
385
385
  body {
386
- background: #0D0D11;
386
+ background:
387
+ radial-gradient(ellipse 80% 60% at 50% -20%, rgba(123, 97, 255, 0.15) 0%, transparent 70%),
388
+ radial-gradient(ellipse 60% 50% at 80% 20%, rgba(0, 112, 243, 0.12) 0%, transparent 60%),
389
+ radial-gradient(ellipse 50% 40% at 20% 30%, rgba(0, 223, 216, 0.1) 0%, transparent 60%),
390
+ radial-gradient(ellipse 70% 40% at 60% 60%, rgba(235, 54, 127, 0.08) 0%, transparent 70%),
391
+ #0D0D11;
387
392
  color: #FFFFFF;
388
- font-family: -apple-system, BlinkMacSystemFont, sans-serif;
393
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
389
394
  display: flex;
390
395
  align-items: center;
391
396
  justify-content: center;
@@ -393,28 +398,120 @@ function ConfigUI({ initialApiUrl }) {
393
398
  margin: 0;
394
399
  }
395
400
  .card {
396
- background: #13131A;
397
- border: 1px solid #23232F;
398
- border-radius: 12px;
401
+ background: rgba(19, 19, 26, 0.8);
402
+ backdrop-filter: blur(12px);
403
+ -webkit-backdrop-filter: blur(12px);
404
+ border: 1px solid rgba(255, 255, 255, 0.08);
405
+ border-radius: 16px;
399
406
  padding: 40px;
400
407
  text-align: center;
401
- box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
408
+ box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
402
409
  max-width: 400px;
403
410
  width: 100%;
411
+ animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
404
412
  }
405
- h1 {
413
+ .logo-container {
414
+ background: #0D0D11;
415
+ border: 1px solid #1F1F2E;
416
+ border-radius: 8px;
417
+ padding: 8px 16px;
418
+ display: inline-flex;
419
+ align-items: center;
420
+ justify-content: center;
421
+ margin-bottom: 24px;
422
+ animation: pulseRing 2s infinite ease-in-out;
423
+ }
424
+ .text-logo {
425
+ display: inline-flex;
426
+ align-items: center;
427
+ gap: 6px;
428
+ text-decoration: none !important;
429
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
430
+ font-size: 16px;
431
+ font-weight: 600;
432
+ letter-spacing: -0.5px;
433
+ color: #FFFFFF;
434
+ transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
435
+ flex-shrink: 0;
436
+ }
437
+ .text-logo-brand {
438
+ transition: letter-spacing 0.3s ease, color 0.3s ease;
439
+ }
440
+ .text-logo-accent {
441
+ background: linear-gradient(135deg, #7B61FF, #0070f3);
442
+ -webkit-background-clip: text;
443
+ -webkit-text-fill-color: transparent;
444
+ }
445
+ .text-logo-spark {
406
446
  color: #7B61FF;
407
- margin-top: 0;
408
- font-size: 24px;
447
+ font-size: 11px;
448
+ opacity: 0.7;
449
+ transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, color 0.3s ease;
450
+ }
451
+ .text-logo:hover {
452
+ opacity: 0.95;
453
+ }
454
+ .text-logo:hover .text-logo-brand {
455
+ letter-spacing: 0.3px;
456
+ }
457
+ .text-logo:hover .text-logo-spark {
458
+ transform: scale(1.3) rotate(180deg);
459
+ opacity: 1;
460
+ color: #00dfd8;
461
+ }
462
+ .success-badge {
463
+ display: inline-flex;
464
+ align-items: center;
465
+ gap: 6px;
466
+ background: rgba(16, 185, 129, 0.1);
467
+ color: #10B981;
468
+ border: 1px solid rgba(16, 185, 129, 0.2);
469
+ padding: 6px 14px;
470
+ border-radius: 99px;
471
+ font-size: 13px;
472
+ font-weight: 500;
473
+ margin-bottom: 20px;
474
+ }
475
+ h1 {
476
+ color: #FFFFFF;
477
+ margin: 0 0 12px 0;
478
+ font-size: 22px;
479
+ font-weight: 600;
480
+ letter-spacing: -0.5px;
409
481
  }
410
482
  p {
411
483
  color: #A1A1B5;
412
484
  font-size: 14px;
485
+ line-height: 1.6;
486
+ margin: 0;
487
+ }
488
+ @keyframes fadeUp {
489
+ from { opacity: 0; transform: translateY(20px); }
490
+ to { opacity: 1; transform: translateY(0); }
491
+ }
492
+ @keyframes pulseRing {
493
+ 0% { transform: scale(1); box-shadow: 0 4px 14px rgba(123, 97, 255, 0.15); }
494
+ 50% { transform: scale(1.03); box-shadow: 0 6px 20px rgba(123, 97, 255, 0.35); }
495
+ 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(123, 97, 255, 0.15); }
413
496
  }
414
497
  </style>
415
498
  </head>
416
499
  <body>
417
500
  <div class="card">
501
+ <div class="logo-container">
502
+ <a href="#" class="text-logo">
503
+ <span class="text-logo-brand" style="color: #FFFFFF;">Task<span class="text-logo-accent">Air</span></span>
504
+ <span class="text-logo-spark">\u2726</span>
505
+ </a>
506
+ </div>
507
+ <div>
508
+ <div class="success-badge">
509
+ <svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.5" viewBox="0 0 24 24" style="margin-top: 1px;">
510
+ <polyline points="20 6 9 17 4 12"/>
511
+ </svg>
512
+ <span>CLI Connected</span>
513
+ </div>
514
+ </div>
418
515
  <h1>Authenticated Successfully</h1>
419
516
  <p>You can close this tab and return to your terminal.</p>
420
517
  </div>
@@ -1775,14 +1872,113 @@ function registerExport(program2) {
1775
1872
  });
1776
1873
  }
1777
1874
 
1875
+ // src/commands/upgrade.tsx
1876
+ import React15, { useState as useState12, useEffect as useEffect13 } from "react";
1877
+ import { Box as Box16, Text as Text16 } from "ink";
1878
+ import { exec as exec2 } from "child_process";
1879
+
1880
+ // src/lib/version.ts
1881
+ var CLI_VERSION = "1.0.5";
1882
+
1883
+ // src/commands/upgrade.tsx
1884
+ import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
1885
+ function isOutdated(current, latest) {
1886
+ const cParts = current.split(".").map(Number);
1887
+ const lParts = latest.split(".").map(Number);
1888
+ for (let i = 0; i < 3; i++) {
1889
+ const c = cParts[i] ?? 0;
1890
+ const l = lParts[i] ?? 0;
1891
+ if (l > c) return true;
1892
+ if (c > l) return false;
1893
+ }
1894
+ return false;
1895
+ }
1896
+ function UpgradeUI() {
1897
+ const [status, setStatus] = useState12("checking");
1898
+ const [latestVersion, setLatestVersion] = useState12("");
1899
+ const [errorMsg, setErrorMsg] = useState12("");
1900
+ useEffect13(() => {
1901
+ async function checkAndUpgrade() {
1902
+ try {
1903
+ const res = await fetch("https://registry.npmjs.org/taskair-cli/latest", {
1904
+ signal: AbortSignal.timeout(5e3)
1905
+ // 5s timeout
1906
+ });
1907
+ if (!res.ok) {
1908
+ throw new Error(`Failed to fetch latest version from npm registry. Status: ${res.status}`);
1909
+ }
1910
+ const data = await res.json();
1911
+ const latest = data.version || "1.0.4";
1912
+ setLatestVersion(latest);
1913
+ if (isOutdated(CLI_VERSION, latest)) {
1914
+ setStatus("upgrading");
1915
+ exec2("npm install -g taskair-cli", (error, stdout, stderr) => {
1916
+ if (error) {
1917
+ setErrorMsg(error.message || stderr || "Failed to install update");
1918
+ setStatus("error");
1919
+ } else {
1920
+ setStatus("success");
1921
+ }
1922
+ });
1923
+ } else {
1924
+ setStatus("up-to-date");
1925
+ }
1926
+ } catch (err) {
1927
+ setErrorMsg(err.message || "Network error checking for updates.");
1928
+ setStatus("error");
1929
+ }
1930
+ }
1931
+ checkAndUpgrade();
1932
+ }, []);
1933
+ return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", padding: 1, children: [
1934
+ /* @__PURE__ */ jsx16(MiniHeader, {}),
1935
+ /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "round", borderColor: "#7B61FF", paddingX: 2, paddingY: 1, marginTop: 1, children: [
1936
+ /* @__PURE__ */ jsx16(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { color: "cyan", bold: true, children: "\u2726 TaskAir Upgrade" }) }),
1937
+ status === "checking" && /* @__PURE__ */ jsx16(Spinner, { label: `Checking npm registry for updates... (Current: v${CLI_VERSION})`, type: "orbit" }),
1938
+ status === "upgrading" && /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", children: [
1939
+ /* @__PURE__ */ jsxs16(Text16, { color: "yellow", bold: true, children: [
1940
+ "\u2726 New version detected: v",
1941
+ CLI_VERSION,
1942
+ " \u2192 v",
1943
+ latestVersion
1944
+ ] }),
1945
+ /* @__PURE__ */ jsx16(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx16(Spinner, { label: "Upgrading globally via npm install -g taskair-cli...", type: "star", color: "yellow" }) })
1946
+ ] }),
1947
+ status === "success" && /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", children: [
1948
+ /* @__PURE__ */ jsx16(StatusBadge, { type: "success", message: `TaskAir CLI successfully upgraded to v${latestVersion}!` }),
1949
+ /* @__PURE__ */ jsx16(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx16(Text16, { color: "gray", children: "You are now running the latest space-grade build." }) })
1950
+ ] }),
1951
+ status === "up-to-date" && /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", children: [
1952
+ /* @__PURE__ */ jsx16(StatusBadge, { type: "success", message: `TaskAir CLI is already up to date (v${CLI_VERSION}).` }),
1953
+ /* @__PURE__ */ jsx16(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx16(Text16, { color: "gray", children: "No upgrade required at this time. Blast off! \u{1F680}" }) })
1954
+ ] }),
1955
+ status === "error" && /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", children: [
1956
+ /* @__PURE__ */ jsx16(StatusBadge, { type: "error", message: `Upgrade failed: ${errorMsg}` }),
1957
+ /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "column", children: [
1958
+ /* @__PURE__ */ jsx16(Text16, { color: "gray", children: "You can try upgrading manually by running:" }),
1959
+ /* @__PURE__ */ jsx16(Text16, { color: "cyan", bold: true, children: " npm install -g taskair-cli" }),
1960
+ /* @__PURE__ */ jsx16(Text16, { color: "gray", marginTop: 1, children: "If permission errors occur, run with administrative rights (sudo)." })
1961
+ ] })
1962
+ ] })
1963
+ ] })
1964
+ ] });
1965
+ }
1966
+ function registerUpgrade(program2) {
1967
+ program2.command("upgrade").description("Upgrade TaskAir CLI to the latest version").action(async () => {
1968
+ const { render } = await import("ink");
1969
+ render(React15.createElement(UpgradeUI));
1970
+ });
1971
+ }
1972
+
1778
1973
  // src/index.ts
1779
1974
  program.name("taskair").description(
1780
1975
  "\u2726 Space-themed task management with E2E encryption \xB7 AI-native \xB7 Privacy-first"
1781
- ).version("1.0.4", "-v, --version", "Output the current version").helpOption("-h, --help", "Display help information");
1976
+ ).version(CLI_VERSION, "-v, --version", "Output the current version").helpOption("-h, --help", "Display help information");
1782
1977
  registerConfig(program);
1783
1978
  registerLogin(program);
1784
1979
  registerLogout(program);
1785
1980
  registerWhoami(program);
1981
+ registerUpgrade(program);
1786
1982
  registerAdd(program);
1787
1983
  registerList(program);
1788
1984
  registerDone(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskair-cli",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Space-themed, privacy-first task management CLI with E2E encryption",
5
5
  "type": "module",
6
6
  "bin": {