mindferry 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +182 -2
- package/README.zh-CN.md +165 -0
- package/bin/mindferry.mjs +301 -0
- package/examples/demo-en/chatgpt-conversations.json +72 -0
- package/examples/demo-en/chatgpt-copied.txt +8 -0
- package/examples/demo-en/claude-conversations.json +25 -0
- package/examples/demo-en/claude-memories.json +6 -0
- package/examples/demo-en/deepseek-conversations.json +39 -0
- package/examples/demo-en/gemini-MyActivity.json +18 -0
- package/examples/demo-en/grok-export.json +27 -0
- package/examples/exports/README.md +4 -0
- package/examples/exports/chatgpt-conversations.json +21 -0
- package/examples/exports/claude-conversations.json +13 -0
- package/examples/exports/claude-memories.json +3 -0
- package/examples/exports/deepseek-conversations.json +12 -0
- package/examples/exports/gemini-MyActivity.json +5 -0
- package/examples/exports/grok-export.json +11 -0
- package/examples/exports/open-webui-export.json +13 -0
- package/examples/scheduler/crontab.txt +2 -0
- package/examples/scheduler/io.github.mindferry.sync.plist +18 -0
- package/examples/single-chats/chatgpt-copied.txt +8 -0
- package/examples/single-chats/chatgpt-saved-page.html +4 -0
- package/examples/single-chats/claude-chat.md +7 -0
- package/package.json +55 -4
- package/src/connect.mjs +204 -0
- package/src/core/archive.mjs +144 -0
- package/src/core/card.mjs +64 -0
- package/src/core/classify.mjs +81 -0
- package/src/core/clients.mjs +63 -0
- package/src/core/errors.mjs +146 -0
- package/src/core/export.mjs +53 -0
- package/src/core/extract.mjs +183 -0
- package/src/core/generator.mjs +98 -0
- package/src/core/hub.mjs +637 -0
- package/src/core/llm.mjs +77 -0
- package/src/core/merge.mjs +95 -0
- package/src/core/profile.mjs +175 -0
- package/src/core/rules.mjs +88 -0
- package/src/core/store.mjs +109 -0
- package/src/core/text.mjs +82 -0
- package/src/demo.mjs +30 -0
- package/src/importers/index.mjs +366 -0
- package/src/importers/zip.mjs +48 -0
- package/src/mcp/server.mjs +272 -0
- package/src/remote.mjs +180 -0
- package/src/ui/server.mjs +281 -0
- package/src/ui/static/app.js +1037 -0
- package/src/ui/static/index.html +269 -0
- package/src/ui/static/logo.svg +16 -0
- package/src/ui/static/mascot-busy.svg +35 -0
- package/src/ui/static/mascot-happy.svg +27 -0
- package/src/ui/static/mascot-idle.svg +26 -0
- package/src/ui/static/mascot-oops.svg +26 -0
- package/src/ui/static/style.css +382 -0
- package/src/version.mjs +1 -0
- package/src/watch.mjs +80 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/* MindFerry — "温柔可爱又干净". Tokens first, then components.
|
|
2
|
+
System fonts only (works offline, no network requests). */
|
|
3
|
+
:root {
|
|
4
|
+
color-scheme: light;
|
|
5
|
+
--bg: #fbf7f2; --bg-deco: radial-gradient(600px 320px at 0 0, rgba(255, 170, 190, .16), transparent 70%), radial-gradient(640px 340px at 100% 0, rgba(140, 190, 255, .14), transparent 70%);
|
|
6
|
+
--panel: #ffffff; --panel-2: #f8f3ee; --text: #2c2630; --muted: #6e6573; --line: #ece4dc; --line-soft: #f2ece6;
|
|
7
|
+
--accent: #cc4470; --accent-ink: #ffffff; --accent-soft: #ffeaf0; --accent-strong: #b33d66; --accent-2: #ff8fa8;
|
|
8
|
+
--pink: #ff8fa8; --sky: #78b6ff; --mint: #5cc8a0; --sun: #ffc94d; --lav: #a594ff; --peach: #ffa877; --teal: #4fc3c8; --rose: #e78ad8;
|
|
9
|
+
--ok: #23865a; --warn: #9a5f00; --bad: #e0566e; --bad-soft: #fff0f2; --sun-soft: #fff6dc;
|
|
10
|
+
--chip: #f4eee9;
|
|
11
|
+
--radius-sm: 12px; --radius: 18px; --radius-lg: 24px;
|
|
12
|
+
--shadow: 0 1px 2px rgba(120, 80, 90, .05), 0 6px 20px rgba(120, 80, 90, .06);
|
|
13
|
+
--shadow-lg: 0 10px 40px rgba(120, 80, 90, .16);
|
|
14
|
+
--btn-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
|
|
15
|
+
--font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
|
|
16
|
+
--font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
|
|
17
|
+
font-family: var(--font);
|
|
18
|
+
}
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
:root {
|
|
21
|
+
color-scheme: dark;
|
|
22
|
+
--bg: #1c1a22; --bg-deco: radial-gradient(600px 320px at 0 0, rgba(255, 140, 170, .07), transparent 70%), radial-gradient(640px 340px at 100% 0, rgba(120, 170, 255, .07), transparent 70%); --panel: #26232d; --panel-2: #2d2a35; --text: #f3eef4; --muted: #b4aab8; --line: #393543; --line-soft: #312d3a;
|
|
23
|
+
--accent: #ff9db5; --accent-ink: #2a1520; --accent-soft: #3d2833; --accent-strong: #ffadc0; --accent-2: #ff9db5;
|
|
24
|
+
--ok: #6fd3a0; --warn: #f0b860; --bad: #ff8a9c; --bad-soft: #3a252b; --sun-soft: #3a3222;
|
|
25
|
+
--chip: #34303d;
|
|
26
|
+
--shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 20px rgba(0, 0, 0, .18);
|
|
27
|
+
--shadow-lg: 0 14px 50px rgba(0, 0, 0, .5);
|
|
28
|
+
--btn-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 22%, transparent);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
* { box-sizing: border-box; }
|
|
33
|
+
html { background: var(--bg); }
|
|
34
|
+
body { margin: 0; min-height: 100vh; background: var(--bg); background-image: var(--bg-deco); background-attachment: fixed; color: var(--text); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
|
|
35
|
+
h1, h2, h3, .brand { font-family: var(--font-round); }
|
|
36
|
+
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.005em; line-height: 1.35; }
|
|
37
|
+
h2 { font-size: 18px; margin: 30px 0 6px; }
|
|
38
|
+
h3 { font-size: 15px; margin: 18px 0 6px; }
|
|
39
|
+
code { background: var(--chip); padding: 1px 7px; border-radius: 7px; font-size: 12px; word-break: break-all; }
|
|
40
|
+
a { color: var(--accent-strong); text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
|
|
41
|
+
a:hover { text-decoration-color: currentColor; }
|
|
42
|
+
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
|
|
43
|
+
|
|
44
|
+
/* ---- header ---- */
|
|
45
|
+
.top { display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 5; }
|
|
46
|
+
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; white-space: nowrap; letter-spacing: -.01em; }
|
|
47
|
+
.brand img { border-radius: 9px; }
|
|
48
|
+
.brand-sub { font-weight: 500; font-size: 12.5px; color: var(--muted); background: var(--chip); padding: 1px 9px; border-radius: 99px; letter-spacing: 0; font-family: var(--font); }
|
|
49
|
+
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
|
|
50
|
+
nav button { border: 0; background: none; padding: 7px 15px; border-radius: 99px; color: var(--muted); cursor: pointer; font: inherit; white-space: nowrap; }
|
|
51
|
+
/* Hover only darkens the text, so only the current tab ever looks selected. */
|
|
52
|
+
nav button:hover { color: var(--text); border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }
|
|
53
|
+
@media (max-width: 1100px) { nav button { padding: 7px 9px; } .brand-sub { display: none; } }
|
|
54
|
+
@media (max-width: 900px) { .brand > span { display: none; } }
|
|
55
|
+
nav button.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
|
|
56
|
+
.top-actions { display: flex; gap: 6px; }
|
|
57
|
+
.demo-banner { background: var(--sun-soft); color: color-mix(in srgb, var(--warn) 75%, var(--text)); text-align: center; padding: 7px 12px; font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--sun) 30%, transparent); }
|
|
58
|
+
.demo-banner button { margin-left: 6px; }
|
|
59
|
+
|
|
60
|
+
main { max-width: 1100px; margin: 0 auto; padding: 26px 24px 40px; }
|
|
61
|
+
.tab { display: none; } .tab.active { display: block; animation: tabIn .16s ease-out; }
|
|
62
|
+
/* Movement only, never transparency: content is readable from the first frame, even in a background tab. */
|
|
63
|
+
@keyframes tabIn { from { transform: translateY(4px); } to { transform: none; } }
|
|
64
|
+
.hidden { display: none !important; }
|
|
65
|
+
.muted { color: var(--muted); } .small { font-size: 13.5px; }
|
|
66
|
+
|
|
67
|
+
/* ---- buttons & inputs ---- */
|
|
68
|
+
button { font: inherit; cursor: pointer; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--panel); color: var(--text); padding: 7px 15px; transition: border-color .15s, background .15s, transform .12s, box-shadow .15s; }
|
|
69
|
+
button:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
|
|
70
|
+
button:active { transform: translateY(1px); }
|
|
71
|
+
button:disabled { opacity: .5; cursor: default; transform: none; }
|
|
72
|
+
button:focus-visible, a:focus-visible, .drop:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
|
|
73
|
+
button.primary { background: var(--accent) linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0)); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; box-shadow: var(--btn-shadow); }
|
|
74
|
+
button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); border-color: transparent; }
|
|
75
|
+
button.big { font-size: 17px; padding: 13px 32px; border-radius: 99px; min-width: 168px; }
|
|
76
|
+
button.big-secondary { font-size: 15px; padding: 13px 16px; width: 100%; text-align: left; border-radius: var(--radius); display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); border-color: var(--line-soft); }
|
|
77
|
+
button.big-secondary:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
|
|
78
|
+
.btn-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; flex: none; }
|
|
79
|
+
.ico-paste { background: color-mix(in srgb, var(--sky) 20%, var(--panel)); color: color-mix(in srgb, var(--sky) 70%, var(--text)); }
|
|
80
|
+
.ico-demo { background: color-mix(in srgb, var(--sun) 28%, var(--panel)); color: color-mix(in srgb, var(--sun) 55%, var(--text)); }
|
|
81
|
+
button.ghost { background: transparent; }
|
|
82
|
+
button.small-btn { padding: 4px 12px; font-size: 13px; border-radius: 99px; }
|
|
83
|
+
button.link { border: 0; background: none; color: var(--accent-strong); padding: 0; }
|
|
84
|
+
button.link:hover { text-decoration: underline; }
|
|
85
|
+
button.danger { color: #fff; background: var(--bad); border-color: var(--bad); }
|
|
86
|
+
@media (prefers-color-scheme: dark) { button.danger { color: #2a1418; } }
|
|
87
|
+
.danger-title { color: var(--bad); }
|
|
88
|
+
select, input[type=search], input[type=number], textarea { font: inherit; padding: 7px 11px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); }
|
|
89
|
+
select:hover, input[type=search]:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
|
|
90
|
+
|
|
91
|
+
/* ---- toast (errors get Ferry with a gentle face) ---- */
|
|
92
|
+
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; max-width: min(720px, 92vw); padding: 13px 18px; border-radius: var(--radius); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); z-index: 20; animation: toastIn .3s cubic-bezier(.2, 1.2, .4, 1); }
|
|
93
|
+
.toast.error { background: var(--bad-soft) url(mascot-oops.svg) no-repeat 12px 50% / 48px; color: var(--text); border: 1.5px solid color-mix(in srgb, var(--bad) 35%, transparent); padding: 14px 18px 14px 70px; min-height: 72px; display: flex; align-items: center; flex-wrap: wrap; }
|
|
94
|
+
.toast-close { background: transparent; border: none; color: inherit; font-size: 18px; padding: 0 0 0 12px; line-height: 1; opacity: .7; }
|
|
95
|
+
.toast-close:hover { opacity: 1; }
|
|
96
|
+
.toast.error .toast-close { margin-left: auto; }
|
|
97
|
+
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
|
|
98
|
+
|
|
99
|
+
/* ---- first run ---- */
|
|
100
|
+
.welcome { text-align: center; padding: 18px 10px 8px; }
|
|
101
|
+
.welcome-ferry img { animation: float 4s ease-in-out infinite; }
|
|
102
|
+
.welcome h1 { font-size: 32px; margin-top: 4px; }
|
|
103
|
+
.lead { font-size: 17px; color: var(--muted); max-width: 660px; margin: 8px auto 22px; }
|
|
104
|
+
.three-steps { list-style: none; padding: 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0 0 8px; }
|
|
105
|
+
.three-steps li { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 12px; align-items: center; max-width: 310px; text-align: left; box-shadow: var(--shadow); }
|
|
106
|
+
.three-steps b { color: #fff; border-radius: 12px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-family: var(--font-round); background: var(--pink); }
|
|
107
|
+
.three-steps li:nth-child(2) b { background: var(--sky); }
|
|
108
|
+
.three-steps li:nth-child(3) b { background: var(--mint); }
|
|
109
|
+
|
|
110
|
+
/* ---- sync hero ---- */
|
|
111
|
+
.sync-bar { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 18px 26px 18px 18px; box-shadow: var(--shadow); }
|
|
112
|
+
.hero-text { flex: 1; min-width: 0; }
|
|
113
|
+
.hero-text p { margin: 2px 0; }
|
|
114
|
+
.hero-text #syncHint { line-height: 1.5; max-width: 640px; font-size: 13px; }
|
|
115
|
+
.sync-bar h1 { font-size: 25px; }
|
|
116
|
+
.hero-ferry { flex: none; width: 84px; height: 84px; border-radius: 22px; background: color-mix(in srgb, var(--sky) 14%, var(--panel)); display: grid; place-items: center; }
|
|
117
|
+
.hero-ferry img { grid-area: 1 / 1; width: 76px; height: 76px; }
|
|
118
|
+
.f-busy, .f-over { display: none; }
|
|
119
|
+
.sync-bar.busy .f-idle { display: none; }
|
|
120
|
+
.sync-bar.busy .f-busy { display: block; animation: sail 1.2s ease-in-out infinite; }
|
|
121
|
+
.sync-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
|
|
122
|
+
.sync-actions label { display: flex; align-items: center; gap: 8px; }
|
|
123
|
+
.sync-actions select { padding: 4px 10px; border-radius: 99px; font-size: 13px; }
|
|
124
|
+
.sync-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: color-mix(in srgb, var(--accent) 12%, transparent); opacity: 0; transition: opacity .2s; }
|
|
125
|
+
.sync-progress i { display: block; height: 100%; width: 35%; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--lav), var(--sky)); }
|
|
126
|
+
.sync-bar.busy .sync-progress { opacity: 1; }
|
|
127
|
+
.sync-bar.busy .sync-progress i { animation: progress 1.3s ease-in-out infinite; }
|
|
128
|
+
button.busy { opacity: 1; background-image: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255, 255, 255, .22) 10px 20px); background-size: 28px 28px; animation: stripes .8s linear infinite; }
|
|
129
|
+
@keyframes progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
|
|
130
|
+
@keyframes stripes { to { background-position: 28px 0; } }
|
|
131
|
+
@keyframes sail { 0%, 100% { transform: translate(-2px, 0) rotate(-2deg); } 50% { transform: translate(2px, -3px) rotate(2deg); } }
|
|
132
|
+
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
|
|
133
|
+
|
|
134
|
+
.conflicts { position: relative; margin-top: 14px; padding: 13px 18px 13px 46px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--sun) 45%, transparent); background: var(--sun-soft); }
|
|
135
|
+
.conflicts::before { content: ""; position: absolute; left: 16px; top: 16px; width: 18px; height: 18px; border-radius: 4px; background: var(--sun); transform: rotate(-8deg); box-shadow: 0 2px 0 color-mix(in srgb, var(--warn) 30%, transparent); }
|
|
136
|
+
.conflicts h4 { margin: 0 0 4px; color: color-mix(in srgb, var(--warn) 85%, var(--text)); font-family: var(--font-round); }
|
|
137
|
+
.conflicts ul { margin: 0; padding-left: 20px; }
|
|
138
|
+
.conflicts li { margin: 4px 0; }
|
|
139
|
+
|
|
140
|
+
/* ---- drop zone: opens up when a file is dragged over ---- */
|
|
141
|
+
.add-row { display: grid; grid-template-columns: 1fr 270px; gap: 16px; margin: 18px 0 4px; }
|
|
142
|
+
.drop { border: 2px dashed color-mix(in srgb, var(--accent-2) 45%, var(--line)); border-radius: var(--radius-lg); padding: 20px 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; background: color-mix(in srgb, var(--panel) 75%, transparent); text-align: center; min-height: 150px; transition: background .2s, border-color .2s, transform .25s cubic-bezier(.2, 1.4, .4, 1), box-shadow .25s, padding .25s; }
|
|
143
|
+
.drop:hover { border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); background: var(--panel); }
|
|
144
|
+
.drop.over { background: var(--accent-soft); border-style: solid; border-color: var(--accent); transform: scale(1.015); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow); padding-top: 26px; padding-bottom: 26px; }
|
|
145
|
+
.drop.over .f-idle, .drop.busy .f-idle, .drop.busy .f-over { display: none; }
|
|
146
|
+
.drop.over:not(.busy) .f-over { display: block; animation: hop .6s cubic-bezier(.2, 1.4, .4, 1); }
|
|
147
|
+
.drop.busy .f-busy { display: block; animation: sail 1.2s ease-in-out infinite; }
|
|
148
|
+
.drop.busy { border-style: solid; border-color: color-mix(in srgb, var(--sky) 60%, var(--line)); }
|
|
149
|
+
.drop strong { font-size: 17px; font-family: var(--font-round); }
|
|
150
|
+
.drop-icon { display: grid; line-height: 0; margin-bottom: 2px; }
|
|
151
|
+
.drop-icon img { grid-area: 1 / 1; }
|
|
152
|
+
.drop:hover .f-idle { animation: float 2.4s ease-in-out infinite; }
|
|
153
|
+
@keyframes hop { 0% { transform: translateY(6px) scale(.9); } 100% { transform: none; } }
|
|
154
|
+
.side-actions { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
|
|
155
|
+
.side-actions button.big-secondary { min-height: 64px; font-size: 15.5px; padding: 12px 16px; }
|
|
156
|
+
.side-actions a { padding-left: 8px; display: inline-flex; align-items: center; gap: 7px; }
|
|
157
|
+
.side-actions a::before { content: "?"; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 99px; font: 700 11px/1 var(--font-round); color: var(--accent-strong); background: var(--accent-soft); }
|
|
158
|
+
|
|
159
|
+
/* ---- AI chips (neutral initials, never vendor logos) ---- */
|
|
160
|
+
.ai-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
|
|
161
|
+
.ai-chip { --h: var(--pink); flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 9px; font: 700 12.5px/1 var(--font-round); letter-spacing: .02em; background: color-mix(in srgb, var(--h) 22%, var(--panel)); color: color-mix(in srgb, var(--h) 62%, var(--text)); }
|
|
162
|
+
.ai-c0 { --h: var(--pink); } .ai-c1 { --h: var(--sky); } .ai-c2 { --h: var(--mint); } .ai-c3 { --h: var(--sun); }
|
|
163
|
+
.ai-c4 { --h: var(--lav); } .ai-c5 { --h: var(--peach); } .ai-c6 { --h: var(--teal); } .ai-c7 { --h: var(--rose); }
|
|
164
|
+
|
|
165
|
+
/* ---- views + client cards ---- */
|
|
166
|
+
.views { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
|
|
167
|
+
.view { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); }
|
|
168
|
+
.view h3 { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 9px; font-family: var(--font); }
|
|
169
|
+
.view h3 b { color: var(--text); font-size: 15px; font-family: var(--font-round); }
|
|
170
|
+
.view ul { margin: 0; padding-left: 0; list-style: none; }
|
|
171
|
+
.view li { margin: 3px 0; padding-left: 16px; position: relative; font-size: 14px; }
|
|
172
|
+
.view li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--accent-2) 70%, var(--line)); }
|
|
173
|
+
.view li.private { color: var(--muted); padding-left: 0; font-size: 13px; }
|
|
174
|
+
.view li.private::before { display: none; }
|
|
175
|
+
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
|
|
176
|
+
.client { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
|
|
177
|
+
.client:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 10px 26px rgba(120, 80, 90, .08); }
|
|
178
|
+
.client h3 { margin: 0 0 2px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
|
|
179
|
+
.badge { font-size: 11.5px; font-weight: 550; padding: 2px 10px; border-radius: 99px; background: var(--chip); color: var(--muted); white-space: nowrap; border: 0; }
|
|
180
|
+
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
|
|
181
|
+
.badge.paused { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
|
|
182
|
+
.badge.all { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-strong); }
|
|
183
|
+
.badge.wait { background: color-mix(in srgb, var(--sun) 25%, transparent); color: color-mix(in srgb, var(--warn) 85%, var(--text)); }
|
|
184
|
+
button.badge { padding: 2px 10px; }
|
|
185
|
+
.stats { display: flex; gap: 14px; font-variant-numeric: tabular-nums; align-items: baseline; flex-wrap: wrap; }
|
|
186
|
+
.stats b { font-size: 19px; font-family: var(--font-round); }
|
|
187
|
+
.client .actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
|
|
188
|
+
.client .actions button { padding: 5px 12px; font-size: 13px; border-radius: 99px; }
|
|
189
|
+
.client .actions button.primary { box-shadow: none; }
|
|
190
|
+
.client .actions button.ghost { border-color: transparent; color: var(--muted); padding: 5px 8px; }
|
|
191
|
+
.client .actions button.ghost:hover { color: var(--text); background: var(--chip); }
|
|
192
|
+
.client .stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
|
|
193
|
+
.client .hint { flex-basis: 100%; }
|
|
194
|
+
.more { margin-top: 12px; }
|
|
195
|
+
.more summary { cursor: pointer; color: var(--accent-strong); padding: 6px 0; font-weight: 550; }
|
|
196
|
+
.more .grid { margin-top: 8px; }
|
|
197
|
+
.privacy { margin-top: 26px; text-align: center; }
|
|
198
|
+
|
|
199
|
+
/* ---- memory ---- */
|
|
200
|
+
.seg { display: inline-flex; background: var(--chip); border-radius: 99px; padding: 4px; margin-bottom: 12px; }
|
|
201
|
+
.seg button { border: 0; background: none; padding: 6px 16px; border-radius: 99px; }
|
|
202
|
+
.seg button.active { background: var(--panel); font-weight: 650; box-shadow: var(--shadow); }
|
|
203
|
+
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
|
|
204
|
+
.toolbar input { flex: 1; border-radius: 99px; padding-left: 16px; }
|
|
205
|
+
table.items { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
|
|
206
|
+
.items th, .items td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
|
|
207
|
+
.items tr:last-child td { border-bottom: 0; }
|
|
208
|
+
.items th { font-size: 12px; color: var(--muted); font-weight: 550; background: var(--panel-2); }
|
|
209
|
+
.items tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
|
|
210
|
+
.items td select { font-size: 13px; padding: 3px 8px; border-radius: 99px; }
|
|
211
|
+
.items tr.locked td:first-child { text-decoration: line-through; color: var(--muted); }
|
|
212
|
+
.sens-public { color: var(--ok); } .sens-personal { color: var(--accent-strong); } .sens-sensitive, .sens-uncertain { color: var(--warn); } .sens-secret { color: var(--bad); }
|
|
213
|
+
.tag-conflict { color: var(--warn); font-size: 12px; display: block; }
|
|
214
|
+
.empty, .empty-li { text-align: center; padding: 26px 10px 30px; color: var(--muted); }
|
|
215
|
+
.empty::before, .empty-li::before { content: ""; display: block; width: 88px; height: 88px; margin: 0 auto 6px; background: url(mascot-idle.svg) no-repeat center / contain; }
|
|
216
|
+
.chat-results { list-style: none; padding: 0; }
|
|
217
|
+
.chat-results li { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; }
|
|
218
|
+
.chat-results li.empty-li { background: none; border: 0; }
|
|
219
|
+
.chat-results .meta { font-size: 12px; color: var(--muted); }
|
|
220
|
+
|
|
221
|
+
/* ---- rules ---- */
|
|
222
|
+
.rules-layout { display: grid; grid-template-columns: 230px 1fr; gap: 16px; }
|
|
223
|
+
.side { list-style: none; margin: 0; padding: 0; }
|
|
224
|
+
.side li button { width: 100%; text-align: left; border: 1.5px solid transparent; background: none; padding: 7px 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; border-radius: 14px; }
|
|
225
|
+
.side li button:hover { background: var(--chip); }
|
|
226
|
+
.side li button.active { background: var(--panel); border-color: var(--line-soft); font-weight: 650; box-shadow: var(--shadow); }
|
|
227
|
+
.side .ai-chip { min-width: 24px; height: 24px; font-size: 11px; border-radius: 8px; }
|
|
228
|
+
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); }
|
|
229
|
+
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 6px; }
|
|
230
|
+
.preset { text-align: left; padding: 12px 14px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--panel); }
|
|
231
|
+
.preset.active { border-color: var(--accent); background: var(--accent-soft); }
|
|
232
|
+
.preset b { display: block; font-size: 15px; margin-bottom: 2px; font-family: var(--font-round); }
|
|
233
|
+
.preset span { font-size: 13px; color: var(--muted); }
|
|
234
|
+
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; margin: 8px 0 14px; }
|
|
235
|
+
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
|
|
236
|
+
|
|
237
|
+
/* ---- connect & settings ---- */
|
|
238
|
+
.connect-item { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
|
|
239
|
+
.connect-item header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
240
|
+
.connect-item h3 { margin: 0; display: flex; align-items: center; }
|
|
241
|
+
#ruleEditor > h3 { display: flex; align-items: center; margin-top: 0; }
|
|
242
|
+
.connect-item summary { cursor: pointer; margin-top: 6px; }
|
|
243
|
+
pre.snip { background: var(--panel-2); padding: 10px 12px; border-radius: var(--radius-sm); overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }
|
|
244
|
+
.export-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
|
|
245
|
+
.export-steps .card { padding: 12px 18px; }
|
|
246
|
+
.export-steps h3 { margin: 0 0 4px; }
|
|
247
|
+
.export-steps ol { margin: 4px 0 0; padding-left: 20px; }
|
|
248
|
+
.log { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow: auto; }
|
|
249
|
+
.log li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
|
|
250
|
+
.log li:last-child { border-bottom: 0; }
|
|
251
|
+
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
252
|
+
.pick button { border-radius: 99px; }
|
|
253
|
+
|
|
254
|
+
/* ---- dialogs ---- */
|
|
255
|
+
dialog { max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--panel); color: var(--text); width: min(760px, 94vw); padding: 22px 26px; box-shadow: var(--shadow-lg); }
|
|
256
|
+
dialog[open] { animation: dlgIn .28s cubic-bezier(.2, 1.2, .4, 1); }
|
|
257
|
+
@keyframes dlgIn { from { transform: translateY(10px) scale(.98); } to { transform: none; } }
|
|
258
|
+
dialog::backdrop { background: color-mix(in srgb, #2c2030 38%, transparent); backdrop-filter: blur(3px); }
|
|
259
|
+
dialog h3 { font-size: 19px; margin: 0 0 10px; }
|
|
260
|
+
dialog textarea { width: 100%; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical; }
|
|
261
|
+
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 14px 0 0; }
|
|
262
|
+
dialog menu button { border-radius: 99px; padding: 8px 18px; }
|
|
263
|
+
#pasteDialog textarea { font-family: var(--font); font-size: 14px; }
|
|
264
|
+
|
|
265
|
+
@media (max-width: 760px) {
|
|
266
|
+
.sync-bar { flex-direction: column; align-items: stretch; } .sync-actions { align-items: stretch; } .hero-ferry { display: none; }
|
|
267
|
+
.add-row { grid-template-columns: 1fr; } .rules-layout { grid-template-columns: 1fr; } .presets { grid-template-columns: 1fr; }
|
|
268
|
+
.brand-sub { display: none; } .top { gap: 10px; padding: 10px 12px; } main { padding: 14px; }
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* ---- big-text mode (html.big, zoom 1.4) ---- */
|
|
272
|
+
html.big .small, html.big .badge, html.big .brand-sub { font-size: 14px; }
|
|
273
|
+
html.big { --muted: #574e5b; }
|
|
274
|
+
@media (prefers-color-scheme: dark) { html.big { --muted: #d0c7d3; } }
|
|
275
|
+
html.big .top { padding: 8px 16px; gap: 12px; }
|
|
276
|
+
html.big .brand-sub { display: none; }
|
|
277
|
+
html.big nav button { padding: 6px 11px; }
|
|
278
|
+
html.big main { padding: 20px 18px 34px; }
|
|
279
|
+
html.big .add-row { grid-template-columns: 1fr 240px; }
|
|
280
|
+
html.big dialog { max-height: calc(100vh / 1.4 - 24px); padding: 16px 20px; }
|
|
281
|
+
html.big .gen-pick { max-height: 24vh; }
|
|
282
|
+
html.big .gen-preview textarea { min-height: 20vh; height: 24vh; }
|
|
283
|
+
html.big dialog h3 { margin-bottom: 4px; }
|
|
284
|
+
html.big .gen-top .row { margin: 2px 0; }
|
|
285
|
+
html.big .hero-ferry { width: 70px; height: 70px; } html.big .hero-ferry img { width: 62px; height: 62px; }
|
|
286
|
+
|
|
287
|
+
/* ---- sync done: a small celebration ---- */
|
|
288
|
+
.done { position: relative; overflow: hidden; display: flex; gap: 18px; align-items: center; background: linear-gradient(120deg, color-mix(in srgb, var(--pink) 13%, var(--panel)), color-mix(in srgb, var(--sky) 11%, var(--panel)) 60%, color-mix(in srgb, var(--mint) 12%, var(--panel))); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line-soft)); border-radius: var(--radius-lg); padding: 16px 22px; margin: 14px 0; box-shadow: var(--shadow); }
|
|
289
|
+
.done.nothing { background: var(--panel); border-color: var(--line-soft); }
|
|
290
|
+
.done h2 { margin: 0 0 2px; font-size: 20px; }
|
|
291
|
+
.done p { margin: 2px 0; }
|
|
292
|
+
.done .row { margin: 10px 0 2px; gap: 8px; }
|
|
293
|
+
.done .row button { border-radius: 99px; }
|
|
294
|
+
.done-mascot { flex: none; }
|
|
295
|
+
.done-body { position: relative; z-index: 1; }
|
|
296
|
+
.done.pop { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
|
|
297
|
+
.done.pop .mascot img { animation: bob 1.6s ease-in-out 2; }
|
|
298
|
+
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
|
|
299
|
+
.confetti i { position: absolute; top: -12px; width: 8px; height: 11px; border-radius: 3px; background: var(--pink); opacity: 0; }
|
|
300
|
+
.done.pop .confetti i { animation: confetti 1.6s cubic-bezier(.25, .6, .4, 1) forwards; }
|
|
301
|
+
.confetti i:nth-child(1) { left: 4%; top: -6px; animation-delay: .05s; }
|
|
302
|
+
.confetti i:nth-child(2) { left: 11%; top: 30%; background: var(--sun); animation-delay: .2s; border-radius: 99px; width: 8px; height: 8px; }
|
|
303
|
+
.confetti i:nth-child(3) { left: 14%; top: 70%; background: var(--sky); animation-delay: .1s; width: 6px; height: 12px; }
|
|
304
|
+
.confetti i:nth-child(4) { left: 64%; top: -10px; background: var(--mint); animation-delay: .3s; }
|
|
305
|
+
.confetti i:nth-child(5) { left: 70%; top: 52%; background: var(--lav); animation-delay: .12s; border-radius: 99px; width: 7px; height: 7px; }
|
|
306
|
+
.confetti i:nth-child(6) { left: 58%; top: 4%; background: var(--sun); animation-delay: .25s; width: 10px; height: 7px; }
|
|
307
|
+
.confetti i:nth-child(7) { left: 67%; top: 36%; background: var(--pink); animation-delay: .08s; }
|
|
308
|
+
.confetti i:nth-child(8) { left: 72%; top: -4px; background: var(--sky); animation-delay: .35s; border-radius: 99px; width: 9px; height: 9px; }
|
|
309
|
+
.confetti i:nth-child(9) { left: 77%; top: 18%; background: var(--mint); animation-delay: .15s; width: 6px; height: 12px; }
|
|
310
|
+
.confetti i:nth-child(10) { left: 82%; top: 2%; background: var(--lav); animation-delay: .28s; }
|
|
311
|
+
.confetti i:nth-child(11) { left: 86%; top: 40%; background: var(--peach); animation-delay: .06s; border-radius: 99px; width: 7px; height: 7px; }
|
|
312
|
+
.confetti i:nth-child(12) { left: 90%; top: 12%; background: var(--sun); animation-delay: .22s; }
|
|
313
|
+
.confetti i:nth-child(13) { left: 94%; top: -8px; background: var(--pink); animation-delay: .32s; width: 10px; height: 7px; }
|
|
314
|
+
.confetti i:nth-child(14) { left: 97%; top: 26%; background: var(--sky); animation-delay: .18s; }
|
|
315
|
+
@keyframes confetti { 0% { opacity: 0; transform: translateY(-14px) rotate(0); } 15% { opacity: .95; } 70% { opacity: .9; } 100% { opacity: 0; transform: translateY(110px) rotate(300deg); } }
|
|
316
|
+
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
|
|
317
|
+
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }
|
|
318
|
+
.mascot { display: inline-block; line-height: 0; }
|
|
319
|
+
.empty-state { text-align: center; padding: 28px 10px; color: var(--muted); }
|
|
320
|
+
.empty-state p { margin: 6px 0 0; }
|
|
321
|
+
|
|
322
|
+
/* ---- About me ---- */
|
|
323
|
+
.prof-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
|
|
324
|
+
.prof-head h2 { margin-bottom: 4px; }
|
|
325
|
+
.prof-head > div:first-child { max-width: 680px; }
|
|
326
|
+
.prof-body { margin-top: 14px; }
|
|
327
|
+
.prof-sec h3 { font-size: 15px; margin: 16px 0 6px; color: var(--accent-strong); display: flex; align-items: center; gap: 8px; }
|
|
328
|
+
.prof-sec h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sun); transform: rotate(-8deg); }
|
|
329
|
+
.prof-sec:first-child h3 { margin-top: 2px; }
|
|
330
|
+
.prof-sec ul { margin: 0; padding-left: 20px; }
|
|
331
|
+
.prof-sec li { margin: 4px 0; }
|
|
332
|
+
.prof-sec li::marker { color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
|
|
333
|
+
.prof-sec li button, .prof-body details li button { opacity: .6; transition: opacity .15s; margin-left: 6px; }
|
|
334
|
+
.prof-sec li:hover button, .prof-sec li:focus-within button, .prof-body details li button { opacity: 1; }
|
|
335
|
+
button.tiny { font-size: 12px; padding: 2px 10px; border-radius: 99px; }
|
|
336
|
+
|
|
337
|
+
/* ---- profile generator ---- */
|
|
338
|
+
dialog.wide { width: min(980px, 94vw); }
|
|
339
|
+
.gen-top { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
|
|
340
|
+
.gen-top .row { margin: 4px 0; gap: 10px; }
|
|
341
|
+
.gen-top select { border-radius: 99px; padding: 5px 12px; }
|
|
342
|
+
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
|
|
343
|
+
.chip { border-radius: 99px; padding: 5px 14px; }
|
|
344
|
+
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
|
|
345
|
+
.gen-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
|
|
346
|
+
@media (max-width: 760px) { .gen-cols { grid-template-columns: 1fr; } }
|
|
347
|
+
.gen-pick { max-height: 52vh; overflow: auto; padding-right: 4px; }
|
|
348
|
+
.gen-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 10px; margin: 0 0 10px; }
|
|
349
|
+
.gen-group legend { font-weight: 650; padding: 0 6px; font-family: var(--font-round); }
|
|
350
|
+
.gen-group.held { background: var(--panel-2); border-style: dashed; }
|
|
351
|
+
.gen-item { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: baseline; padding: 4px 0; }
|
|
352
|
+
.gen-item.locked { opacity: .6; }
|
|
353
|
+
.gen-item > span:not(.badge):not(.why) { min-width: 0; }
|
|
354
|
+
.gen-item .why { font-size: 12px; color: var(--muted); grid-column: 2 / 4; }
|
|
355
|
+
.badge.new { background: color-mix(in srgb, var(--sun) 35%, transparent); color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
|
|
356
|
+
.gen-preview textarea { width: 100%; min-height: 46vh; font-size: 13px; line-height: 1.6; }
|
|
357
|
+
.tiny-row { gap: 6px; margin: 0 0 8px; }
|
|
358
|
+
|
|
359
|
+
/* ---- reduced motion: keep every state, drop the movement ---- */
|
|
360
|
+
@media (prefers-reduced-motion: reduce) {
|
|
361
|
+
*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
|
|
362
|
+
.done.pop .confetti i { animation: none !important; }
|
|
363
|
+
.sync-bar.busy .sync-progress i { width: 100%; transform: none; background: repeating-linear-gradient(90deg, var(--pink) 0 12px, var(--sky) 12px 24px); }
|
|
364
|
+
.drop.over { transform: none; }
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* ---- v0.2 extras: next step, web connection, smarter tidy-up ---- */
|
|
368
|
+
.next-step { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 12px 18px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
|
|
369
|
+
.next-step span { flex: 1; min-width: 220px; }
|
|
370
|
+
.web-conn .row { align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
371
|
+
.wc-item { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
|
|
372
|
+
.wc-item .ai-name { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
|
|
373
|
+
.wc-url { flex: 1; min-width: 240px; font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); }
|
|
374
|
+
#smartCard select, #webConn select { margin-left: 4px; }
|
|
375
|
+
.copy-note { margin: 8px 0 0; color: var(--warn); }
|
|
376
|
+
.copy-fallback { width: 100%; margin-top: 8px; font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: var(--panel-2); color: var(--text); }
|
|
377
|
+
#itemRows td.small button.link { white-space: nowrap; }
|
|
378
|
+
|
|
379
|
+
/* Round-4 trial fixes */
|
|
380
|
+
.items td:last-child { white-space: nowrap; }
|
|
381
|
+
#genCopy { min-width: 10.5em; }
|
|
382
|
+
html.big dialog { max-height: calc((100vh - 32px) / 1.4); }
|
package/src/version.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = '0.2.0';
|
package/src/watch.mjs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Optional: watch the Downloads folder and import new official chat exports automatically.
|
|
2
|
+
// Off by default. Only files that appear after it was turned on are considered, only names that
|
|
3
|
+
// look like an AI export, and each file is imported once. Everything stays on this computer.
|
|
4
|
+
import { readdirSync, statSync, existsSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { homedir } from 'node:os';
|
|
7
|
+
import { importFile } from './importers/index.mjs';
|
|
8
|
+
import { isZip, listZip } from './importers/zip.mjs';
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
|
|
11
|
+
export const defaultWatchDir = () => join(homedir(), 'Downloads');
|
|
12
|
+
|
|
13
|
+
// File names the vendors use for exports (checked case-insensitively).
|
|
14
|
+
const NAME = /(conversations?|chatgpt|openai|claude|anthropic|takeout|gemini|grok|xai|deepseek|kimi|doubao|qwen|perplexity|copilot|mistral|le ?chat|open ?webui|chat[-_ ]?export|chat[-_ ]?history|data-\d{4}|memories)/i;
|
|
15
|
+
const EXT = /\.(zip|json|jsonl|csv|html?)$/i;
|
|
16
|
+
|
|
17
|
+
function looksLikeExport(path, name) {
|
|
18
|
+
if (!EXT.test(name)) return false;
|
|
19
|
+
if (NAME.test(name)) return true;
|
|
20
|
+
// Unnamed zips: peek inside for a conversations file.
|
|
21
|
+
if (/\.zip$/i.test(name)) {
|
|
22
|
+
try {
|
|
23
|
+
const buf = readFileSync(path);
|
|
24
|
+
return isZip(buf) && listZip(buf).some((e) => /conversations\.json$|MyActivity\.(json|html)$|chat.*\.json$/i.test(e.name));
|
|
25
|
+
} catch { return false; }
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class DownloadWatcher {
|
|
31
|
+
constructor(hub, { onImport = () => {}, intervalMs = 30000 } = {}) {
|
|
32
|
+
this.hub = hub;
|
|
33
|
+
this.onImport = onImport;
|
|
34
|
+
this.intervalMs = intervalMs;
|
|
35
|
+
this.timer = null;
|
|
36
|
+
this.busy = false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
start() {
|
|
40
|
+
if (this.timer) return;
|
|
41
|
+
this.timer = setInterval(() => this.scan().catch(() => {}), this.intervalMs);
|
|
42
|
+
this.timer.unref?.();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
stop() { clearInterval(this.timer); this.timer = null; }
|
|
46
|
+
|
|
47
|
+
/** One pass. Returns the files imported. */
|
|
48
|
+
async scan() {
|
|
49
|
+
const s = this.hub.read().settings || {};
|
|
50
|
+
if (!s.watchDownloads || this.busy) return [];
|
|
51
|
+
const dir = s.watchDir || defaultWatchDir();
|
|
52
|
+
if (!existsSync(dir)) return [];
|
|
53
|
+
const since = Date.parse(s.watchSince || 0) || 0;
|
|
54
|
+
const seen = new Set(s.watchSeen || []);
|
|
55
|
+
const done = [];
|
|
56
|
+
this.busy = true;
|
|
57
|
+
try {
|
|
58
|
+
for (const name of readdirSync(dir)) {
|
|
59
|
+
const path = join(dir, name);
|
|
60
|
+
let st;
|
|
61
|
+
try { st = statSync(path); } catch { continue; }
|
|
62
|
+
if (!st.isFile() || st.mtimeMs < since || Date.now() - st.mtimeMs < 5000) continue; // skip old and still-downloading files
|
|
63
|
+
const key = `${name}|${st.size}|${Math.round(st.mtimeMs)}`;
|
|
64
|
+
if (seen.has(key) || !looksLikeExport(path, name)) continue;
|
|
65
|
+
seen.add(key);
|
|
66
|
+
try {
|
|
67
|
+
const r = await importFile(this.hub, path, { sync: true });
|
|
68
|
+
done.push({ name, result: r });
|
|
69
|
+
this.onImport(name, r);
|
|
70
|
+
} catch (e) {
|
|
71
|
+
done.push({ name, error: e.code || String(e.message || e) });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
} finally {
|
|
75
|
+
this.busy = false;
|
|
76
|
+
if (done.length) await this.hub.store.update((st) => { st.settings.watchSeen = [...seen].slice(-500); });
|
|
77
|
+
}
|
|
78
|
+
return done;
|
|
79
|
+
}
|
|
80
|
+
}
|