kingkont 0.7.4 → 0.7.6

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/package.json +28 -9
  2. package/updates.html +205 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.7.4",
4
- "description": "KingKont · Chatium нод-редактор сцен с AI-генерацией (картинки/видео/голос/SFX/музыка/текст)",
3
+ "version": "0.7.6",
4
+ "description": "KingKont \u00b7 Chatium \u2014 \u043d\u043e\u0434-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0446\u0435\u043d \u0441 AI-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438/\u0432\u0438\u0434\u0435\u043e/\u0433\u043e\u043b\u043e\u0441/SFX/\u043c\u0443\u0437\u044b\u043a\u0430/\u0442\u0435\u043a\u0441\u0442)",
5
5
  "main": "main.js",
6
6
  "bin": {
7
7
  "kingkont": "bin/kingkont.js"
@@ -16,12 +16,21 @@
16
16
  "bin/**/*",
17
17
  "scripts/**/*",
18
18
  "skill/**/*",
19
- "README.md"
19
+ "README.md",
20
+ "updates.html"
20
21
  ],
21
22
  "engines": {
22
23
  "node": ">=18"
23
24
  },
24
- "keywords": ["video-editor", "ai", "kie", "elevenlabs", "openrouter", "scene-editor", "electron"],
25
+ "keywords": [
26
+ "video-editor",
27
+ "ai",
28
+ "kie",
29
+ "elevenlabs",
30
+ "openrouter",
31
+ "scene-editor",
32
+ "electron"
33
+ ],
25
34
  "author": "Tim",
26
35
  "license": "UNLICENSED",
27
36
  "scripts": {
@@ -47,17 +56,27 @@
47
56
  "index.html",
48
57
  "settings.html",
49
58
  "assets/**/*",
50
- "package.json"
59
+ "package.json",
60
+ "updates.html"
51
61
  ],
52
62
  "extraResources": [
53
- { "from": ".env", "to": ".env" }
63
+ {
64
+ "from": ".env",
65
+ "to": ".env"
66
+ }
54
67
  ],
55
68
  "mac": {
56
69
  "category": "public.app-category.video",
57
70
  "target": "dmg",
58
71
  "icon": "assets/logo.icns"
59
72
  },
60
- "win": { "target": "nsis", "icon": "assets/logo-1024.png" },
61
- "linux": { "target": "AppImage", "icon": "assets/logo-1024.png" }
73
+ "win": {
74
+ "target": "nsis",
75
+ "icon": "assets/logo-1024.png"
76
+ },
77
+ "linux": {
78
+ "target": "AppImage",
79
+ "icon": "assets/logo-1024.png"
80
+ }
62
81
  }
63
- }
82
+ }
package/updates.html ADDED
@@ -0,0 +1,205 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Обновления</title>
7
+ <style>
8
+ :root {
9
+ --bg: #1a1a1a;
10
+ --card: #232323;
11
+ --border: #333;
12
+ --text: #e0e0e0;
13
+ --muted: #888;
14
+ --accent: #7c3aed;
15
+ --accent-hover: #6d28d9;
16
+ --ok: #16a34a;
17
+ }
18
+ * { box-sizing: border-box; }
19
+ html, body { height: 100%; }
20
+ body {
21
+ margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
22
+ background: var(--bg); color: var(--text); font-size: 13px;
23
+ -webkit-app-region: drag;
24
+ }
25
+ .wrap { padding: 24px 28px; max-height: 100vh; overflow: auto; -webkit-app-region: no-drag; }
26
+ h1 { margin: 0 0 4px 0; font-size: 18px; font-weight: 600; }
27
+ .sub { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
28
+ .card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
29
+
30
+ .versions { display: flex; gap: 24px; margin-bottom: 14px; }
31
+ .versions .v { flex: 1; }
32
+ .versions .v label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
33
+ .versions .v .num { font-size: 18px; font-family: ui-monospace, monospace; color: var(--text); }
34
+ .badge { display: inline-block; margin-left: 6px; padding: 2px 8px; font-size: 10px;
35
+ border-radius: 999px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.5px; }
36
+ .badge.ok { background: rgba(22,163,74,0.15); color: var(--ok); border: 1px solid rgba(22,163,74,0.4); }
37
+ .badge.new { background: rgba(124,58,237,0.18); color: #a78bfa; border: 1px solid rgba(124,58,237,0.5); }
38
+
39
+ .install-cmd {
40
+ background: #0e0e0e; border: 1px solid #2a2a2a; border-radius: 6px;
41
+ padding: 10px 14px; font-family: ui-monospace, monospace; font-size: 12px;
42
+ color: #aae06a; display: flex; align-items: center; gap: 10px; margin-top: 8px;
43
+ }
44
+ .install-cmd code { flex: 1; }
45
+ .install-cmd .copy {
46
+ padding: 4px 10px; font-size: 11px; background: #2a2a2a; color: var(--text);
47
+ border: 1px solid #3a3a3a; border-radius: 4px; cursor: pointer;
48
+ }
49
+ .install-cmd .copy:hover { background: #333; }
50
+
51
+ .changelog { font-size: 12px; color: #c4c4c4; line-height: 1.6; max-height: 240px; overflow-y: auto;
52
+ margin-top: 12px; padding: 10px 14px; background: #1c1c1c; border-radius: 6px; border: 1px solid #2a2a2a; }
53
+ .changelog .item { padding: 4px 0; }
54
+ .changelog .item .v { color: var(--muted); font-family: ui-monospace, monospace; margin-right: 6px; }
55
+
56
+ .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
57
+ button {
58
+ padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
59
+ border: 0; border-radius: 6px; transition: background 0.15s;
60
+ }
61
+ button.primary { background: var(--accent); color: #fff; }
62
+ button.primary:hover { background: var(--accent-hover); }
63
+ button.secondary { background: #333; color: var(--text); }
64
+ button.secondary:hover { background: #444; }
65
+ button:disabled { opacity: 0.5; cursor: wait; }
66
+
67
+ .spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #333;
68
+ border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite;
69
+ vertical-align: middle; margin-right: 6px; }
70
+ @keyframes spin { to { transform: rotate(360deg); } }
71
+
72
+ .error { color: #ef4444; font-size: 12px; margin-top: 12px; }
73
+ </style>
74
+ </head>
75
+ <body>
76
+ <div class="wrap">
77
+ <h1>Обновления KingKont</h1>
78
+ <div class="sub">Источник: <code>registry.npmjs.org/kingkont</code></div>
79
+
80
+ <div class="card">
81
+ <div class="versions">
82
+ <div class="v">
83
+ <label>Установлено</label>
84
+ <div class="num" id="vCurrent">—</div>
85
+ </div>
86
+ <div class="v">
87
+ <label>Доступно</label>
88
+ <div class="num" id="vLatest"><span class="spinner"></span></div>
89
+ </div>
90
+ </div>
91
+ <div id="updateBlock" style="display:none;">
92
+ <div style="display:flex; gap:8px; align-items:center; margin-top:6px;">
93
+ <button class="primary" id="installBtn" style="padding:8px 16px;">⬇ Установить и перезапустить</button>
94
+ <span style="color:#888; font-size:11px;">или вручную:</span>
95
+ </div>
96
+ <div class="install-cmd">
97
+ <code id="installCmd">npm i -g kingkont@latest</code>
98
+ <button class="copy" id="copyBtn">Скопировать</button>
99
+ </div>
100
+ <pre id="installLog" style="display:none; max-height:160px; overflow-y:auto; margin-top:10px;
101
+ font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.4;
102
+ background: #0e0e0e; border: 1px solid #2a2a2a; border-radius: 4px;
103
+ padding: 8px 10px; color: #aaa; white-space: pre-wrap; word-break: break-all;"></pre>
104
+ <div id="installDone" style="display:none; color: var(--ok); margin-top: 10px; font-size: 12px;">
105
+ ✓ Установлено! Можно перезапустить:
106
+ <button class="primary" id="relaunchBtn" style="padding:5px 12px; font-size:12px; margin-left:6px;">Перезапустить</button>
107
+ </div>
108
+ </div>
109
+ <div id="upToDate" style="display:none; color: var(--ok); font-size: 12px; margin-top: 6px;">
110
+ ✓ У вас последняя версия.
111
+ </div>
112
+ <div class="error" id="errMsg" style="display:none;"></div>
113
+ </div>
114
+
115
+ <div class="actions">
116
+ <button class="secondary" id="recheckBtn">Проверить ещё раз</button>
117
+ <button class="primary" id="closeBtn">Закрыть</button>
118
+ </div>
119
+ </div>
120
+
121
+ <script>
122
+ const $ = (id) => document.getElementById(id);
123
+
124
+ async function check() {
125
+ $('errMsg').style.display = 'none';
126
+ $('updateBlock').style.display = 'none';
127
+ $('upToDate').style.display = 'none';
128
+ $('vLatest').innerHTML = '<span class="spinner"></span>';
129
+ $('recheckBtn').disabled = true;
130
+ try {
131
+ const r = await window.appUpdates.check();
132
+ $('vCurrent').textContent = r.current;
133
+ $('vLatest').textContent = r.latest;
134
+ if (r.isNew) {
135
+ $('vLatest').insertAdjacentHTML('beforeend', '<span class="badge new">новая версия</span>');
136
+ $('updateBlock').style.display = '';
137
+ $('installCmd').textContent = `npm i -g kingkont@${r.latest}`;
138
+ } else {
139
+ $('vLatest').insertAdjacentHTML('beforeend', '<span class="badge ok">актуально</span>');
140
+ $('upToDate').style.display = '';
141
+ }
142
+ } catch (e) {
143
+ $('vLatest').textContent = '—';
144
+ $('errMsg').style.display = '';
145
+ $('errMsg').textContent = 'Не удалось проверить: ' + (e?.message || String(e));
146
+ } finally {
147
+ $('recheckBtn').disabled = false;
148
+ }
149
+ }
150
+
151
+ $('recheckBtn').addEventListener('click', check);
152
+ $('closeBtn').addEventListener('click', () => window.appUpdates.closeWindow());
153
+ $('copyBtn').addEventListener('click', async () => {
154
+ const cmd = $('installCmd').textContent;
155
+ try {
156
+ await navigator.clipboard.writeText(cmd);
157
+ const b = $('copyBtn');
158
+ const orig = b.textContent;
159
+ b.textContent = 'Скопировано';
160
+ setTimeout(() => { b.textContent = orig; }, 1500);
161
+ } catch {}
162
+ });
163
+
164
+ let _unsubLog = null;
165
+ $('installBtn').addEventListener('click', async () => {
166
+ const installBtn = $('installBtn');
167
+ const recheckBtn = $('recheckBtn');
168
+ const log = $('installLog');
169
+ const done = $('installDone');
170
+ installBtn.disabled = true; recheckBtn.disabled = true;
171
+ installBtn.textContent = 'Устанавливаю…';
172
+ done.style.display = 'none';
173
+ log.style.display = '';
174
+ log.textContent = '';
175
+ // Подписываемся на стрим вывода npm.
176
+ _unsubLog?.();
177
+ _unsubLog = window.appUpdates.onInstallOutput(({ stream, text }) => {
178
+ log.textContent += text;
179
+ log.scrollTop = log.scrollHeight;
180
+ if (stream === 'stderr') log.style.color = '#f88';
181
+ });
182
+ // Берём latest из текущей надписи (или пытаемся 'latest').
183
+ const targetMatch = $('installCmd').textContent.match(/kingkont@(\S+)/);
184
+ const target = targetMatch ? targetMatch[1] : 'latest';
185
+ try {
186
+ await window.appUpdates.install(target);
187
+ done.style.display = '';
188
+ installBtn.textContent = '✓ Установлено';
189
+ } catch (e) {
190
+ log.style.color = '#f88';
191
+ log.textContent += `\n[error] ${e?.message || String(e)}`;
192
+ installBtn.disabled = false;
193
+ installBtn.textContent = '⬇ Попробовать снова';
194
+ } finally {
195
+ recheckBtn.disabled = false;
196
+ _unsubLog?.();
197
+ _unsubLog = null;
198
+ }
199
+ });
200
+ $('relaunchBtn').addEventListener('click', () => window.appUpdates.relaunch());
201
+
202
+ check();
203
+ </script>
204
+ </body>
205
+ </html>