knova-studio 1.3.1 → 1.3.2
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 +21 -46
- package/knova-command.md +4 -4
- package/knova.js +91 -47
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,58 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://knova.studio"><img src="https://knova.studio/landing/first.jpg" alt="Knova: a teacher at the chalkboard, learners listening" width="720"></a>
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
makes each section's pictures, animations and activities, and teaches every learner one step at a time. Nothing
|
|
5
|
-
reaches learners until you press Publish on Knova yourself.
|
|
5
|
+
# Knova Studio
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Build a Knova course by talking with Claude Code or Codex.**
|
|
8
8
|
|
|
9
|
-
You
|
|
10
|
-
|
|
11
|
-
Node.js (https://nodejs.org), which gives you `npx`.
|
|
9
|
+
You plan the lessons together in plain conversation. Knova makes the pictures and animations, and teaches each
|
|
10
|
+
learner one step at a time. Nothing reaches learners until you press Publish.
|
|
12
11
|
|
|
13
|
-
##
|
|
12
|
+
## Start in three steps
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
1. **Sign up** at [knova.studio/signup](https://knova.studio/signup).
|
|
15
|
+
2. **Run one command.** Open a terminal (you need Node.js) and paste:
|
|
16
16
|
|
|
17
|
-
```
|
|
18
|
-
npx knova-studio
|
|
19
|
-
```
|
|
17
|
+
```
|
|
18
|
+
npx knova-studio
|
|
19
|
+
```
|
|
20
20
|
|
|
21
|
-
It says
|
|
22
|
-
|
|
21
|
+
It says what it will add and asks first. Then log in to Knova in the page that opens.
|
|
22
|
+
3. **Start a course.** In Claude Code, restart it, then type `/knova` and your topic, for example
|
|
23
|
+
`/knova fractions for year 5`. In Codex, ask: "Build a Knova course about fractions for year 5".
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
Using Claude or ChatGPT in the browser? See [knova.studio/agents](https://knova.studio/agents).
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
- Codex: ask it, for example "Build a Knova course about fractions for year 5".
|
|
27
|
+
## Undo
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
happy, open the course link on Knova and press Publish.
|
|
29
|
+
`npx knova-studio --remove` takes Knova Studio off this computer again.
|
|
31
30
|
|
|
32
|
-
##
|
|
31
|
+
## Safe
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
`skills/knova` in `~/.claude`.
|
|
36
|
-
- Codex: type `codex mcp remove knova`.
|
|
37
|
-
- Your settings were copied before anything changed; the copies sit next to them, ending in `.knova-backup-<time>`.
|
|
38
|
-
|
|
39
|
-
## Details, for the curious
|
|
40
|
-
|
|
41
|
-
`npx knova-studio --details` shows the exact commands and files. `--yes` goes ahead without asking (it never runs
|
|
42
|
-
without a terminal otherwise).
|
|
43
|
-
|
|
44
|
-
- Claude Code: checks the plugin archive from https://knova.studio against a hash pinned in this installer (it refuses
|
|
45
|
-
on any difference). It writes its own marketplace file, built from the pinned address and hash, to
|
|
46
|
-
`~/.claude/knova-marketplace/` (or `$CLAUDE_CONFIG_DIR`), then runs
|
|
47
|
-
`claude plugin install knova --marketplace <that folder>`. Claude Code never reads a marketplace from the network.
|
|
48
|
-
The plugin connects Claude Code to Knova (the connection is named `plugin:knova:studio`) and adds a helper,
|
|
49
|
-
lesson-writer, that writes each section's lesson; an older Knova plugin is updated (an update from before 1.7.0
|
|
50
|
-
opens the log-in again, since the connection's name changed). Your `settings.json` is copied first.
|
|
51
|
-
- Claude Code `/knova`: writes the command to `~/.claude/skills/knova/SKILL.md` (or `$CLAUDE_CONFIG_DIR`), as your own
|
|
52
|
-
skill, so it shows as plain `/knova`. A `/knova` this installer wrote is kept up to date (the old one is copied
|
|
53
|
-
first); a knova skill of your own is left as it is. Updates come only from a new release of this installer with a
|
|
54
|
-
new pin.
|
|
55
|
-
- Codex: copies `~/.codex/config.toml` (or `$CODEX_HOME`), then runs `codex mcp add knova --url https://knova.studio/mcp`.
|
|
56
|
-
An existing `knova` entry that points elsewhere is left alone.
|
|
57
|
-
|
|
58
|
-
Only https://knova.studio is contacted. No dependencies, no install scripts. Safe to run again.
|
|
33
|
+
Only talks to knova.studio. Safe to run again. `npx knova-studio --details` shows every step.
|
package/knova-command.md
CHANGED
|
@@ -18,16 +18,16 @@ The user is most likely a teacher using Knova for the first time. A word they do
|
|
|
18
18
|
so they hear everything in their own words rather than in the names the tools and their fields use. With no topic given,
|
|
19
19
|
the course has nothing to start from, so what it is about is the first thing to learn from them, in one short question.
|
|
20
20
|
|
|
21
|
-
Before each
|
|
22
|
-
be, and it can change from
|
|
21
|
+
Before each lesson, ask the teacher: build it together, or shall I do it? Teachers differ in how involved they want to
|
|
22
|
+
be, and it can change from lesson to lesson; asking keeps them in charge of their own course.
|
|
23
23
|
|
|
24
|
-
Look back before you show. Read the outline before the teacher sees it, and each
|
|
24
|
+
Look back before you show. Read the outline before the teacher sees it, and each lesson before moving on, as a learner
|
|
25
25
|
meeting it would. A gap mended while drafting costs far less than a learner lost in it later.
|
|
26
26
|
|
|
27
27
|
The notes are how Knova keeps your intent. Knova speaks every lesson in its own voice and adapts it to each learner.
|
|
28
28
|
Notes that say why each idea sits where it does let it answer and explain the way you would.
|
|
29
29
|
|
|
30
|
-
The first time a
|
|
30
|
+
The first time a lesson needs more work, tell the teacher in one line what you are making better for their learners
|
|
31
31
|
(a question that gave its answer away, a word used before it was explained), and let the checklist step say you are
|
|
32
32
|
checking it as a learner would. A silent wait reads as stuck, and one line shows the care their course gets; a line for
|
|
33
33
|
every try would bury them. Who found it and how are Knova's insides: a teacher who hears "Knova's check" or "flagged"
|
package/knova.js
CHANGED
|
@@ -18,8 +18,8 @@ const PROD_ORIGIN = 'https://knova.studio';
|
|
|
18
18
|
// How a user runs this installer; npm's package name, said once here for the two messages that repeat it.
|
|
19
19
|
const COMMAND = 'npx knova-studio';
|
|
20
20
|
// The plugin's version and the hash of its bytes: a version's bytes never change, so both are pinned together.
|
|
21
|
-
const PLUGIN_VERSION = '2.2.
|
|
22
|
-
const PINNED_SHA256 = '
|
|
21
|
+
const PLUGIN_VERSION = '2.2.3';
|
|
22
|
+
const PINNED_SHA256 = '94be71055830564d4c87c87559c8f95a11987d1b210548246d22c59d419fb664';
|
|
23
23
|
const MIN_CLAUDE = [2, 1, 292];
|
|
24
24
|
// How Claude Code names the plugin's connection to Knova (plugin:<plugin>:<server>), and the version it took this name:
|
|
25
25
|
// a plugin older than that signed in under another name, so an update from it signs in again.
|
|
@@ -29,7 +29,7 @@ const MAX_BYTES = 1 << 20;
|
|
|
29
29
|
const HELP = `${PROD_ORIGIN}/help`;
|
|
30
30
|
// What a person needs before this can help them; said once here, for --help and for a computer with neither app.
|
|
31
31
|
const BEFORE = `You need a Knova account (sign up at ${PROD_ORIGIN}/signup) and Claude Code or Codex on this computer. ` +
|
|
32
|
-
`Using Claude or ChatGPT in the browser
|
|
32
|
+
`Using Claude or ChatGPT in the browser? See ${PROD_ORIGIN}/agents.`;
|
|
33
33
|
|
|
34
34
|
// A failure said by the one rule: `person` is a plain sentence with what to do; `machine` is the exact reason.
|
|
35
35
|
class Problem extends Error {
|
|
@@ -139,8 +139,10 @@ function installedKnova() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
const claudeDir = (env) => env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), '.claude');
|
|
143
|
+
|
|
142
144
|
function claudeClient(ep, env, version) {
|
|
143
|
-
const dir = env
|
|
145
|
+
const dir = claudeDir(env);
|
|
144
146
|
const folder = path.join(dir, 'knova-marketplace');
|
|
145
147
|
const file = path.join(folder, '.claude-plugin', 'marketplace.json');
|
|
146
148
|
if (older(version, MIN_CLAUDE)) {
|
|
@@ -152,7 +154,7 @@ function claudeClient(ep, env, version) {
|
|
|
152
154
|
const installed = installedKnova();
|
|
153
155
|
const pinned = PLUGIN_VERSION.split('.').map(Number);
|
|
154
156
|
if (installed !== null && !older(installed, pinned)) {
|
|
155
|
-
return { name: 'Claude Code', state: 'done', plan: '
|
|
157
|
+
return { name: 'Claude Code', state: 'done', plan: 'Already set up.',
|
|
156
158
|
details: `the Knova Studio plugin ${installed} is already installed` };
|
|
157
159
|
}
|
|
158
160
|
// The local marketplace always holds this installer's pinned entry, so an install and an update read the same,
|
|
@@ -169,19 +171,18 @@ function claudeClient(ep, env, version) {
|
|
|
169
171
|
};
|
|
170
172
|
const checked = `download the Knova Studio plugin from ${ep.origin} and check it is exactly the one this installer expects, ` +
|
|
171
173
|
`back up ${path.join(dir, 'settings.json')}, save the plugin's listing to ${file} (a different file there is backed up first)`;
|
|
172
|
-
const LOG_IN = 'A browser page then opens: log in to Knova (or sign up) and press Connect, so Claude Code can build courses in your account.';
|
|
173
174
|
const signIn = () => {
|
|
174
|
-
console.log(' Opening
|
|
175
|
+
console.log(' Opening Knova in your browser: log in and press Connect.');
|
|
175
176
|
if (run('claude', ['mcp', 'login', CONNECTION], { stdio: 'inherit' }).status !== 0) {
|
|
176
|
-
console.log(' The
|
|
177
|
-
|
|
177
|
+
console.log(' The log-in did not finish. To finish it later, open Claude Code, type /mcp, choose ' +
|
|
178
|
+
`${CONNECTION} and log in to Knova. No account yet? Sign up at ${PROD_ORIGIN}/signup.`);
|
|
178
179
|
}
|
|
179
180
|
};
|
|
180
181
|
if (installed !== null) {
|
|
181
182
|
const again = older(installed, CONNECTION_SINCE);
|
|
182
183
|
return {
|
|
183
184
|
name: 'Claude Code', state: 'todo', restart: true,
|
|
184
|
-
plan: `Update Knova Studio
|
|
185
|
+
plan: `Update Knova Studio.${again ? ' You will log in to Knova again.' : ''}`, login: again,
|
|
185
186
|
details: `update the Knova Studio plugin ${installed} → ${PLUGIN_VERSION}: ${checked}, ` +
|
|
186
187
|
'update it with "claude plugin marketplace update knova" and "claude plugin update knova@knova", ' +
|
|
187
188
|
`${again ? 'open the Knova sign-in in your browser again (this version connects to Knova under a new name), ' : ''}then restart Claude Code`,
|
|
@@ -195,7 +196,7 @@ function claudeClient(ep, env, version) {
|
|
|
195
196
|
}
|
|
196
197
|
return {
|
|
197
198
|
name: 'Claude Code', state: 'todo', restart: true,
|
|
198
|
-
plan:
|
|
199
|
+
plan: 'Add Knova Studio.', login: true,
|
|
199
200
|
details: `${checked}, install it with "claude plugin install knova --marketplace ${folder}", then open the Knova sign-in in your browser`,
|
|
200
201
|
async apply() {
|
|
201
202
|
await writeMarketplace();
|
|
@@ -211,20 +212,20 @@ function claudeClient(ep, env, version) {
|
|
|
211
212
|
const COMMAND_TEXT = fs.readFileSync(path.join(__dirname, 'knova-command.md'), 'utf8');
|
|
212
213
|
const COMMAND_MARK = 'Written by npx knova-studio.';
|
|
213
214
|
|
|
215
|
+
const commandFile = (env) => path.join(claudeDir(env), 'skills', 'knova', 'SKILL.md');
|
|
216
|
+
|
|
214
217
|
function commandStep(env) {
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
const name = 'The /knova command';
|
|
218
|
+
const file = commandFile(env);
|
|
219
|
+
const name = '/knova command';
|
|
218
220
|
const now = fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : null;
|
|
219
|
-
if (now === COMMAND_TEXT) return { name, state: 'done', plan: '
|
|
221
|
+
if (now === COMMAND_TEXT) return { name, state: 'done', plan: 'Already up to date.', details: `${file} is up to date` };
|
|
220
222
|
if (now !== null && !now.includes(COMMAND_MARK)) {
|
|
221
|
-
return { name, state: 'done', plan: 'You
|
|
223
|
+
return { name, state: 'done', plan: 'You have your own /knova, so it is left as it is.',
|
|
222
224
|
details: `${file} is your own knova skill, so it is left as it is (it answers /knova)` };
|
|
223
225
|
}
|
|
224
226
|
return {
|
|
225
227
|
name, state: 'todo', restart: true,
|
|
226
|
-
plan: now === null ? 'Add the
|
|
227
|
-
: 'Update the /knova command to the newest version (the old one is copied first).',
|
|
228
|
+
plan: now === null ? 'Add the command that starts a course.' : 'Update the command.',
|
|
228
229
|
details: `${now === null ? 'write' : 'update'} the /knova command at ${file}${now === null ? '' : ' (the old one is backed up)'}`,
|
|
229
230
|
async apply() {
|
|
230
231
|
backup(file);
|
|
@@ -239,17 +240,17 @@ function codexClient(ep, env) {
|
|
|
239
240
|
const section = fs.existsSync(file) ? tomlSection(fs.readFileSync(file, 'utf8'), 'knova') : null;
|
|
240
241
|
if (section !== null) {
|
|
241
242
|
if (new RegExp(`^url\\s*=\\s*["']${ep.mcp}["']\\s*$`, 'm').test(section)) {
|
|
242
|
-
return { name: 'Codex', state: 'done', plan: '
|
|
243
|
+
return { name: 'Codex', state: 'done', plan: 'Already set up.',
|
|
243
244
|
details: `[mcp_servers.knova] already points at ${ep.mcp}` };
|
|
244
245
|
}
|
|
245
246
|
return { name: 'Codex', state: 'blocked',
|
|
246
|
-
plan: 'Codex already has
|
|
247
|
-
`
|
|
247
|
+
plan: 'Codex already has something else named knova, so Codex is left as it is. To use Knova Studio there, ' +
|
|
248
|
+
`type codex mcp remove knova, then run ${COMMAND} again.`,
|
|
248
249
|
details: `${file} already has a different [mcp_servers.knova], left untouched:\n ${section.replace(/\n/g, '\n ')}` };
|
|
249
250
|
}
|
|
250
251
|
return {
|
|
251
252
|
name: 'Codex', state: 'todo',
|
|
252
|
-
plan: 'Add Knova Studio
|
|
253
|
+
plan: 'Add Knova Studio.', login: true,
|
|
253
254
|
details: `back up ${file}, add Knova with "codex mcp add knova --url ${ep.mcp}" (it opens the Knova sign-in in your browser)`,
|
|
254
255
|
async apply() {
|
|
255
256
|
backup(file);
|
|
@@ -258,6 +259,36 @@ function codexClient(ep, env) {
|
|
|
258
259
|
};
|
|
259
260
|
}
|
|
260
261
|
|
|
262
|
+
// `--remove`: the same steps in reverse, in the same shape, so one loop prints, asks and applies either. It removes only
|
|
263
|
+
// what this installer added: the plugin, the marketplace folder it wrote, a /knova it wrote, and Codex's own entry.
|
|
264
|
+
function removals(ep, env, claude, codex) {
|
|
265
|
+
const steps = [];
|
|
266
|
+
const folder = path.join(claudeDir(env), 'knova-marketplace');
|
|
267
|
+
const plugin = claude && installedKnova() !== null;
|
|
268
|
+
if (plugin || fs.existsSync(folder)) {
|
|
269
|
+
steps.push({ name: 'Claude Code', state: 'todo', plan: 'Remove Knova Studio.', restart: true,
|
|
270
|
+
details: `${plugin ? 'run "claude plugin uninstall knova", then ' : ''}delete ${folder}`,
|
|
271
|
+
async apply() {
|
|
272
|
+
if (plugin) must('claude', ['plugin', 'uninstall', 'knova'], CLI_FAILED('Claude Code'));
|
|
273
|
+
fs.rmSync(folder, { recursive: true, force: true });
|
|
274
|
+
} });
|
|
275
|
+
}
|
|
276
|
+
const file = commandFile(env);
|
|
277
|
+
if (fs.existsSync(file) && fs.readFileSync(file, 'utf8').includes(COMMAND_MARK)) {
|
|
278
|
+
steps.push({ name: '/knova command', state: 'todo', plan: 'Remove the command.', restart: true,
|
|
279
|
+
details: `delete ${path.dirname(file)}`,
|
|
280
|
+
async apply() { fs.rmSync(path.dirname(file), { recursive: true, force: true }); } });
|
|
281
|
+
}
|
|
282
|
+
const config = path.join(env.CODEX_HOME || path.join(os.homedir(), '.codex'), 'config.toml');
|
|
283
|
+
const section = codex && fs.existsSync(config) ? tomlSection(fs.readFileSync(config, 'utf8'), 'knova') : null;
|
|
284
|
+
if (section !== null && new RegExp(`^url\\s*=\\s*["']${ep.mcp}["']\\s*$`, 'm').test(section)) {
|
|
285
|
+
steps.push({ name: 'Codex', state: 'todo', plan: 'Remove Knova Studio.',
|
|
286
|
+
details: `back up ${config}, run "codex mcp remove knova"`,
|
|
287
|
+
async apply() { backup(config); must('codex', ['mcp', 'remove', 'knova'], CLI_FAILED('Codex')); } });
|
|
288
|
+
}
|
|
289
|
+
return steps;
|
|
290
|
+
}
|
|
291
|
+
|
|
261
292
|
const ask = (q) => new Promise((resolve) => {
|
|
262
293
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
263
294
|
rl.question(q, (a) => { rl.close(); resolve(/^y(es)?$/i.test(a.trim())); });
|
|
@@ -265,22 +296,26 @@ const ask = (q) => new Promise((resolve) => {
|
|
|
265
296
|
|
|
266
297
|
async function main(argv, env) {
|
|
267
298
|
if (argv.includes('--help') || argv.includes('-h')) {
|
|
268
|
-
console.log(`Usage: ${COMMAND} [--yes] [--details]\n\nAdds Knova Studio to Claude Code and Codex, whichever are on this computer, so you can build Knova courses by talking with them. It says what it will do and asks first.\n${BEFORE}\n --yes go ahead without asking\n --details also show the exact commands and files`);
|
|
299
|
+
console.log(`Usage: ${COMMAND} [--yes] [--details] [--remove]\n\nAdds Knova Studio to Claude Code and Codex, whichever are on this computer, so you can build Knova courses by talking with them. It says what it will do and asks first.\n${BEFORE}\n --yes go ahead without asking\n --details also show the exact commands and files\n --remove take Knova Studio off this computer again`);
|
|
269
300
|
return 0;
|
|
270
301
|
}
|
|
271
|
-
const flags = ['--yes', '-y', '--details'];
|
|
302
|
+
const flags = ['--yes', '-y', '--details', '--remove'];
|
|
272
303
|
const unknown = argv.filter((a) => !flags.includes(a));
|
|
273
304
|
if (unknown.length) { console.error(`${unknown[0]} is not something this installer knows. Type ${COMMAND} --help to see what it takes.`); return 2; }
|
|
274
|
-
const details = argv.includes('--details');
|
|
305
|
+
const details = argv.includes('--details'), remove = argv.includes('--remove');
|
|
275
306
|
let ep;
|
|
276
307
|
try { ep = endpoints(env); } catch (e) { console.error(e.message); return 2; }
|
|
277
308
|
|
|
278
|
-
const clients = [];
|
|
279
309
|
const claude = detect('claude'), codex = detect('codex');
|
|
280
|
-
|
|
281
|
-
if (
|
|
310
|
+
const clients = [];
|
|
311
|
+
if (remove) clients.push(...removals(ep, env, claude, codex));
|
|
312
|
+
else {
|
|
313
|
+
if (claude) clients.push(claudeClient(ep, env, claude), commandStep(env));
|
|
314
|
+
if (codex) clients.push(codexClient(ep, env));
|
|
315
|
+
}
|
|
282
316
|
if (!clients.length) {
|
|
283
|
-
console.log('Knova Studio
|
|
317
|
+
console.log(remove ? 'Knova Studio is not on this computer, so there is nothing to remove.' :
|
|
318
|
+
'Knova Studio works inside Claude Code or Codex, and this terminal cannot find either one.\n' +
|
|
284
319
|
` ${BEFORE}\n` +
|
|
285
320
|
' To get Claude Code: https://docs.claude.com/en/docs/claude-code/setup\n' +
|
|
286
321
|
' To get Codex: https://github.com/openai/codex\n' +
|
|
@@ -288,29 +323,33 @@ async function main(argv, env) {
|
|
|
288
323
|
return 0;
|
|
289
324
|
}
|
|
290
325
|
|
|
291
|
-
|
|
326
|
+
// One aligned table: the step's name, then what it does. The same widths carry the "Next" rows below.
|
|
327
|
+
const width = Math.max(...clients.map((c) => c.name.length));
|
|
328
|
+
const row = (name, text) => ` ${name.padEnd(width)} ${text}`;
|
|
329
|
+
const todo = clients.filter((c) => c.state === 'todo');
|
|
330
|
+
console.log(`\nKnova Studio ${remove ? 'removal' : 'setup'}\n`);
|
|
292
331
|
for (const c of clients) {
|
|
293
|
-
console.log(
|
|
294
|
-
|
|
295
|
-
if ((details || c.state === 'blocked') && c.details) console.log(` (${c.details})`);
|
|
332
|
+
console.log(row(c.name, c.plan));
|
|
333
|
+
if (details && c.details) console.log(` ${' '.repeat(width)} (${c.details})`);
|
|
296
334
|
}
|
|
297
|
-
|
|
335
|
+
if (todo.some((c) => c.login)) console.log('\nA browser page will open: log in to Knova and press Connect.');
|
|
298
336
|
let code = clients.some((c) => c.state === 'blocked') ? 1 : 0;
|
|
299
337
|
const done = [];
|
|
300
338
|
|
|
301
339
|
if (todo.length) {
|
|
302
340
|
if (!argv.includes('--yes') && !argv.includes('-y')) {
|
|
303
341
|
if (!process.stdin.isTTY) {
|
|
304
|
-
console.error('
|
|
305
|
-
|
|
342
|
+
console.error('\nNothing was changed: this needs your yes, and nobody can type one here. ' +
|
|
343
|
+
'Run it in a terminal window, or add --yes.');
|
|
306
344
|
return 1;
|
|
307
345
|
}
|
|
308
|
-
if (!(await ask('
|
|
346
|
+
if (!(await ask('\nGo ahead? Type y and press Enter: '))) { console.log('Nothing was changed.'); return 0; }
|
|
309
347
|
}
|
|
348
|
+
console.log('');
|
|
310
349
|
for (const c of todo) {
|
|
311
|
-
console.log(`${c.name}:`);
|
|
312
350
|
try {
|
|
313
351
|
await c.apply();
|
|
352
|
+
console.log(row(c.name, 'Done.'));
|
|
314
353
|
done.push(c);
|
|
315
354
|
} catch (e) {
|
|
316
355
|
console.error(` ${e instanceof Problem ? e.person : `${c.name} was not changed, because something went wrong. Run ${COMMAND} again; if it keeps happening, tell Knova at ${HELP}.`}`);
|
|
@@ -319,20 +358,25 @@ async function main(argv, env) {
|
|
|
319
358
|
}
|
|
320
359
|
}
|
|
321
360
|
}
|
|
322
|
-
if (copies.length) {
|
|
323
|
-
console.log(
|
|
324
|
-
|
|
361
|
+
if (details && copies.length) {
|
|
362
|
+
console.log('\nCopies of your settings, saved first:');
|
|
363
|
+
for (const f of copies) console.log(` ${f}`);
|
|
325
364
|
}
|
|
326
365
|
|
|
366
|
+
// Claude Code reads what it has installed only at start, so a change there ends with a restart.
|
|
367
|
+
const restart = done.some((c) => c.restart);
|
|
327
368
|
const ready = (name) => clients.some((c) => c.name === name && c.state !== 'blocked') &&
|
|
328
369
|
!clients.some((c) => c.name === name && c.state === 'todo' && !done.includes(c));
|
|
329
|
-
const
|
|
330
|
-
if (
|
|
331
|
-
|
|
332
|
-
|
|
370
|
+
const next = [];
|
|
371
|
+
if (remove) {
|
|
372
|
+
if (restart) next.push(['Claude Code', 'Restart it to finish.']);
|
|
373
|
+
} else {
|
|
374
|
+
if (claude && ready('Claude Code')) {
|
|
375
|
+
next.push(['Claude Code', `${restart ? 'Restart it, then t' : 'T'}ype /knova and your topic, for example: /knova fractions for year 5`]);
|
|
376
|
+
}
|
|
377
|
+
if (codex && ready('Codex')) next.push(['Codex', 'Ask: Build a Knova course about fractions for year 5']);
|
|
333
378
|
}
|
|
334
|
-
if (
|
|
335
|
-
if (lines.length) console.log(`\nNext:\n${lines.join('\n')}`);
|
|
379
|
+
if (next.length) console.log(`\nNext\n${next.map(([n, t]) => row(n, t)).join('\n')}`);
|
|
336
380
|
return code;
|
|
337
381
|
}
|
|
338
382
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knova-studio",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "Build Knova courses by talking with Claude Code or Codex
|
|
3
|
+
"version": "1.3.2",
|
|
4
|
+
"description": "Build Knova courses by talking with Claude Code or Codex. One command sets it up.",
|
|
5
|
+
"keywords": ["knova", "course", "teacher", "lesson", "claude-code", "codex"],
|
|
5
6
|
"bin": { "knova-studio": "knova.js" },
|
|
6
7
|
"files": ["knova.js", "knova-command.md", "README.md"],
|
|
7
8
|
"engines": { "node": ">=18" },
|