kingkont 0.2.0 → 0.3.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/README.md +13 -0
- package/bin/kingkont.js +29 -3
- package/package.json +2 -1
- package/skill/SKILL.md +84 -0
package/README.md
CHANGED
|
@@ -60,6 +60,19 @@ macOS) — переустановка приложения их не теряе
|
|
|
60
60
|
| Cut / Copy / Paste | `Cmd+X` / `Cmd+C` / `Cmd+V` |
|
|
61
61
|
| Esc | закрыть любую модалку |
|
|
62
62
|
|
|
63
|
+
## Скилл для Claude Code
|
|
64
|
+
|
|
65
|
+
Чтобы Claude Code в любой сессии умел запускать редактор для текущей папки:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx kingkont install-skill # для всех проектов: ~/.claude/skills/kingkont/
|
|
69
|
+
npx kingkont install-skill --project # только для текущего проекта: ./.claude/skills/kingkont/
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
После этого в новой сессии Claude Code достаточно сказать «открой kingkont»
|
|
73
|
+
или «запусти редактор» — Claude увидит скилл, выполнит `npx -y kingkont serve`
|
|
74
|
+
в текущей папке и подскажет URL для Chrome.
|
|
75
|
+
|
|
63
76
|
## Разработка
|
|
64
77
|
|
|
65
78
|
```bash
|
package/bin/kingkont.js
CHANGED
|
@@ -12,16 +12,37 @@ function showHelp() {
|
|
|
12
12
|
KingKont · Chatium — видео-редактор сериала
|
|
13
13
|
|
|
14
14
|
Запуск:
|
|
15
|
-
npx kingkont
|
|
16
|
-
npx kingkont serve
|
|
17
|
-
npx kingkont serve <path>
|
|
15
|
+
npx kingkont запустить Electron-приложение (рекомендуется)
|
|
16
|
+
npx kingkont serve запустить только HTTP-сервер; URL для Chrome
|
|
17
|
+
npx kingkont serve <path> то же, путь к проекту/cwd по умолчанию
|
|
18
|
+
npx kingkont install-skill установить Skill для Claude Code (~/.claude/skills/kingkont)
|
|
18
19
|
|
|
19
20
|
Опции:
|
|
20
21
|
--port <N> порт сервера (по умолчанию 17893)
|
|
22
|
+
--project install-skill: положить в .claude/skills/ текущей папки
|
|
21
23
|
--help, -h эта справка
|
|
22
24
|
`);
|
|
23
25
|
}
|
|
24
26
|
|
|
27
|
+
function installSkill() {
|
|
28
|
+
const fs = require('node:fs');
|
|
29
|
+
const os = require('node:os');
|
|
30
|
+
const isProject = args.includes('--project');
|
|
31
|
+
const dest = isProject
|
|
32
|
+
? path.resolve(process.cwd(), '.claude', 'skills', 'kingkont')
|
|
33
|
+
: path.join(os.homedir(), '.claude', 'skills', 'kingkont');
|
|
34
|
+
const src = path.join(root, 'skill', 'SKILL.md');
|
|
35
|
+
if (!fs.existsSync(src)) {
|
|
36
|
+
console.error('Шаблон SKILL.md не найден в пакете:', src);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
40
|
+
fs.copyFileSync(src, path.join(dest, 'SKILL.md'));
|
|
41
|
+
console.log(`✓ KingKont skill установлен: ${path.join(dest, 'SKILL.md')}`);
|
|
42
|
+
console.log(' В новой сессии Claude Code (или после /reload) скилл будет доступен:');
|
|
43
|
+
console.log(' попроси «открой kingkont» в папке проекта.');
|
|
44
|
+
}
|
|
45
|
+
|
|
25
46
|
if (args.includes('--help') || args.includes('-h')) {
|
|
26
47
|
showHelp();
|
|
27
48
|
process.exit(0);
|
|
@@ -30,6 +51,11 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
30
51
|
const portIdx = args.indexOf('--port');
|
|
31
52
|
const port = portIdx >= 0 ? parseInt(args[portIdx + 1], 10) : 17893;
|
|
32
53
|
|
|
54
|
+
if (args[0] === 'install-skill') {
|
|
55
|
+
installSkill();
|
|
56
|
+
process.exit(0);
|
|
57
|
+
}
|
|
58
|
+
|
|
33
59
|
if (args[0] === 'serve') {
|
|
34
60
|
// Только Node-сервер. FSAH-API в Chrome требует user-gesture для
|
|
35
61
|
// showDirectoryPicker — юзер сам выбирает папку через UI.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kingkont",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "KingKont · Chatium — нод-редактор сцен с AI-генерацией (картинки/видео/голос/SFX/музыка/текст)",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"assets/**/*",
|
|
15
15
|
"bin/**/*",
|
|
16
16
|
"scripts/**/*",
|
|
17
|
+
"skill/**/*",
|
|
17
18
|
"README.md"
|
|
18
19
|
],
|
|
19
20
|
"engines": {
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kingkont
|
|
3
|
+
description: Use this skill when the user asks to open the KingKont editor, edit scenes, work on a film/series project, or generate content (images, video, voice, SFX, music, text) for a movie project in the current folder. The skill starts the KingKont HTTP server on the current working directory and gives the user a localhost URL to open in Chrome.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# KingKont · Chatium — Skill
|
|
7
|
+
|
|
8
|
+
KingKont is a node-graph editor for film/series scenes with AI generation
|
|
9
|
+
(images via KIE, voice/SFX/music via ElevenLabs, text via OpenRouter).
|
|
10
|
+
Each "scene" is a folder on disk with `scene.json`, files live next to it.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
The user is working with a film/series project in the current folder and asks
|
|
15
|
+
to open the KingKont editor, edit scenes, view boards visually, or generate
|
|
16
|
+
media. Trigger phrases:
|
|
17
|
+
|
|
18
|
+
- "открой kingkont", "запусти kingkont", "open kingkont"
|
|
19
|
+
- "редактор сцен", "scene editor"
|
|
20
|
+
- "видео-редактор", "film editor"
|
|
21
|
+
- if the current folder contains `CLAUDE.md` mentioning "KingKont" or
|
|
22
|
+
has subfolders like `_characters/`, `_locations/` and `scene.json` files
|
|
23
|
+
— this is a KingKont project.
|
|
24
|
+
|
|
25
|
+
## How to launch
|
|
26
|
+
|
|
27
|
+
Run **in the current working directory** (the project root):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx -y kingkont serve
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
It will:
|
|
34
|
+
1. Auto-install `kingkont` from npm (if not cached).
|
|
35
|
+
2. Spawn the HTTP server on port 17893.
|
|
36
|
+
3. Print `▶ KingKont готов: http://localhost:17893/` when ready.
|
|
37
|
+
|
|
38
|
+
Then tell the user to open the URL in **Chrome / Edge / Brave** (Safari and
|
|
39
|
+
Firefox do not support the File System Access API needed to open project
|
|
40
|
+
folders). On macOS you can open it for the user:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
open -a "Google Chrome" "http://localhost:17893/"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The user clicks "Открыть проект" in the editor and selects the current
|
|
47
|
+
folder.
|
|
48
|
+
|
|
49
|
+
## Project structure (for reference)
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
<project root>/
|
|
53
|
+
├── CLAUDE.md # auto-created on first open, describes format
|
|
54
|
+
├── _characters/<name>/ # one board per character
|
|
55
|
+
├── _locations/<name>/ # one board per location
|
|
56
|
+
├── <scene name>/ # scenes live as folders in the root
|
|
57
|
+
│ ├── scene.json # all metadata (nodes, connections, timeline, history)
|
|
58
|
+
│ ├── clips/ # videos
|
|
59
|
+
│ ├── images/ # frames
|
|
60
|
+
│ ├── audio/ # mp3/wav
|
|
61
|
+
│ └── texts/ # .md files for text nodes
|
|
62
|
+
└── _deleted/ # trash; Cmd+Z restores
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`scene.json` is plain JSON, you can read/edit it directly.
|
|
66
|
+
|
|
67
|
+
## API keys
|
|
68
|
+
|
|
69
|
+
If the user hasn't set them, the editor will ask via Cmd+, modal:
|
|
70
|
+
- **KIE** for images/video
|
|
71
|
+
- **ElevenLabs** for voice/SFX/music
|
|
72
|
+
- **OpenRouter** for text and vision
|
|
73
|
+
|
|
74
|
+
Stored at `~/Library/Application Support/KingKont/settings.json` (macOS)
|
|
75
|
+
or `~/.config/KingKont/settings.json` (Linux).
|
|
76
|
+
|
|
77
|
+
## If user wants the Electron app instead of browser
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npx -y kingkont
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This launches the desktop Electron app (downloads electron@32 on first run,
|
|
84
|
+
≈70 MB).
|