@narrative-os/cli 0.1.10 → 0.1.11
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 +10 -2
- package/dist/commands/version.d.ts +1 -0
- package/dist/commands/version.js +114 -0
- package/dist/index.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ nos continue <story-id>
|
|
|
28
28
|
|
|
29
29
|
| Command | Description |
|
|
30
30
|
|---------|-------------|
|
|
31
|
-
| `nos init` | Create a new story |
|
|
31
|
+
| `nos init` | Create a new story (interactive prompts) |
|
|
32
32
|
| `nos generate <id>` | Generate next chapter |
|
|
33
33
|
| `nos continue <id>` | Auto-generate remaining chapters |
|
|
34
34
|
| `nos status [id]` | View story status |
|
|
@@ -39,7 +39,15 @@ nos continue <story-id>
|
|
|
39
39
|
| `nos validate <id>` | Validate story consistency |
|
|
40
40
|
| `nos export <id>` | Export story to markdown |
|
|
41
41
|
| `nos delete <id>` | Delete a story |
|
|
42
|
-
| `nos config` | Configure LLM settings |
|
|
42
|
+
| `nos config` | Configure LLM settings (multi-model) |
|
|
43
|
+
| `nos version` | Show version information |
|
|
44
|
+
|
|
45
|
+
## Supported LLM Providers
|
|
46
|
+
|
|
47
|
+
- **OpenAI** - GPT-4o, GPT-4o-mini, GPT-4-turbo
|
|
48
|
+
- **DeepSeek** - deepseek-chat, deepseek-reasoner
|
|
49
|
+
- **Alibaba Cloud** - Qwen models (qwen-max, qwen-plus, qwen-turbo, text-embedding-v3)
|
|
50
|
+
- **ByteDance Ark** - Doubao models (doubao-pro-128k, doubao-lite-128k, doubao-embedding)
|
|
43
51
|
|
|
44
52
|
## Features
|
|
45
53
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function versionCommand(): void;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.versionCommand = versionCommand;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
// Get the directory of the current file (works in both ESM and CommonJS)
|
|
7
|
+
function getCurrentDir() {
|
|
8
|
+
try {
|
|
9
|
+
// For CommonJS
|
|
10
|
+
return __dirname;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// Fallback
|
|
14
|
+
return process.cwd();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function getPackageInfo(packageName) {
|
|
18
|
+
try {
|
|
19
|
+
// Try to find package in node_modules
|
|
20
|
+
const currentDir = getCurrentDir();
|
|
21
|
+
const possiblePaths = [
|
|
22
|
+
(0, path_1.join)(process.cwd(), 'node_modules', packageName, 'package.json'),
|
|
23
|
+
(0, path_1.join)(currentDir, '..', '..', 'node_modules', packageName, 'package.json'),
|
|
24
|
+
(0, path_1.join)(currentDir, '..', '..', '..', '..', 'node_modules', packageName, 'package.json'),
|
|
25
|
+
];
|
|
26
|
+
for (const pkgPath of possiblePaths) {
|
|
27
|
+
try {
|
|
28
|
+
const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, 'utf-8'));
|
|
29
|
+
return {
|
|
30
|
+
name: pkg.name,
|
|
31
|
+
version: pkg.version,
|
|
32
|
+
description: pkg.description,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function getCLIPackageInfo() {
|
|
46
|
+
try {
|
|
47
|
+
const currentDir = getCurrentDir();
|
|
48
|
+
const pkgPath = (0, path_1.join)(currentDir, '..', '..', 'package.json');
|
|
49
|
+
const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, 'utf-8'));
|
|
50
|
+
return {
|
|
51
|
+
name: pkg.name,
|
|
52
|
+
version: pkg.version,
|
|
53
|
+
description: pkg.description,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return { name: '@narrative-os/cli', version: 'unknown' };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function versionCommand() {
|
|
61
|
+
console.log('╔════════════════════════════════════════════════════════╗');
|
|
62
|
+
console.log('║ Narrative OS - Version Information ║');
|
|
63
|
+
console.log('╚════════════════════════════════════════════════════════╝\n');
|
|
64
|
+
// CLI Info
|
|
65
|
+
const cli = getCLIPackageInfo();
|
|
66
|
+
console.log('📦 CLI');
|
|
67
|
+
console.log(` Name: ${cli.name}`);
|
|
68
|
+
console.log(` Version: ${cli.version}`);
|
|
69
|
+
if (cli.description) {
|
|
70
|
+
console.log(` Desc: ${cli.description}`);
|
|
71
|
+
}
|
|
72
|
+
console.log();
|
|
73
|
+
// Engine Info
|
|
74
|
+
const engine = getPackageInfo('@narrative-os/engine');
|
|
75
|
+
;
|
|
76
|
+
if (engine) {
|
|
77
|
+
console.log('⚙️ Engine');
|
|
78
|
+
console.log(` Name: ${engine.name}`);
|
|
79
|
+
console.log(` Version: ${engine.version}`);
|
|
80
|
+
if (engine.description) {
|
|
81
|
+
console.log(` Desc: ${engine.description}`);
|
|
82
|
+
}
|
|
83
|
+
console.log();
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.log('⚙️ Engine: Not installed\n');
|
|
87
|
+
}
|
|
88
|
+
// Future modules (check if installed)
|
|
89
|
+
const futureModules = [
|
|
90
|
+
'@narrative-os/skills',
|
|
91
|
+
'@narrative-os/characters',
|
|
92
|
+
'@narrative-os/worlds',
|
|
93
|
+
'@narrative-os/plots',
|
|
94
|
+
];
|
|
95
|
+
const installedModules = futureModules
|
|
96
|
+
.map(name => getPackageInfo(name))
|
|
97
|
+
.filter((info) => info !== null);
|
|
98
|
+
if (installedModules.length > 0) {
|
|
99
|
+
console.log('🧩 Extension Modules');
|
|
100
|
+
for (const mod of installedModules) {
|
|
101
|
+
console.log(` • ${mod.name}@${mod.version}`);
|
|
102
|
+
}
|
|
103
|
+
console.log();
|
|
104
|
+
}
|
|
105
|
+
// Check for local development mode
|
|
106
|
+
const currentDir = getCurrentDir();
|
|
107
|
+
const isLocalDev = currentDir.includes('apps/cli');
|
|
108
|
+
if (isLocalDev) {
|
|
109
|
+
console.log('🛠️ Development Mode: Local source\n');
|
|
110
|
+
}
|
|
111
|
+
console.log('─────────────────────────────────────────────────────────');
|
|
112
|
+
console.log('For updates: npm install -g @narrative-os/cli@latest');
|
|
113
|
+
console.log('─────────────────────────────────────────────────────────');
|
|
114
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const read_js_1 = require("./commands/read.js");
|
|
|
14
14
|
const bible_js_1 = require("./commands/bible.js");
|
|
15
15
|
const state_js_1 = require("./commands/state.js");
|
|
16
16
|
const hint_js_1 = require("./commands/hint.js");
|
|
17
|
+
const version_js_1 = require("./commands/version.js");
|
|
17
18
|
(0, config_js_1.applyConfig)();
|
|
18
19
|
const program = new commander_1.Command();
|
|
19
20
|
program
|
|
@@ -130,4 +131,9 @@ program
|
|
|
130
131
|
.action((storyId) => {
|
|
131
132
|
(0, hint_js_1.showHint)({ storyId });
|
|
132
133
|
});
|
|
134
|
+
program
|
|
135
|
+
.command('version')
|
|
136
|
+
.alias('v')
|
|
137
|
+
.description('Show version information')
|
|
138
|
+
.action(version_js_1.versionCommand);
|
|
133
139
|
program.parse();
|