openprompt-lang 1.2.2 → 1.2.4
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/package.json +1 -1
- package/src/commands/init-core.js +33 -8
- package/src/mcp-server.js +1 -1
package/package.json
CHANGED
|
@@ -14,24 +14,49 @@ export async function init(options) {
|
|
|
14
14
|
const interactive = options.interactive !== false && !!process.stdin.isTTY
|
|
15
15
|
const dryRun = options.dryRun || false
|
|
16
16
|
|
|
17
|
+
const cwd = process.cwd()
|
|
18
|
+
const isInitialized = existsSync(join(cwd, "prompt-lang.json")) || existsSync(join(cwd, ".openprompt"))
|
|
19
|
+
|
|
17
20
|
if (interactive && !options.existing && !options.name && !options.preset && !options.stack) {
|
|
18
21
|
console.log(chalk.cyan("\n🧙 openPrompt-Lang — Inicialización\n"))
|
|
19
22
|
|
|
23
|
+
const choices = []
|
|
24
|
+
|
|
25
|
+
if (isInitialized) {
|
|
26
|
+
choices.push({ name: chalk.yellow(" Actualizar/Reconstruir la integración (Rebuild)"), value: "rebuild" })
|
|
27
|
+
choices.push(new inquirer.Separator())
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
choices.push({ name: chalk.green(" Nuevo proyecto — Crear desde cero"), value: "new" })
|
|
31
|
+
choices.push({
|
|
32
|
+
name: chalk.blue(" Proyecto existente — Configurar OPL en proyecto ya iniciado"),
|
|
33
|
+
value: "existing",
|
|
34
|
+
})
|
|
35
|
+
choices.push({
|
|
36
|
+
name: chalk.magenta(" Entorno Académico — Biblioteca de conocimiento / Estudio"),
|
|
37
|
+
value: "knowledge",
|
|
38
|
+
})
|
|
39
|
+
|
|
20
40
|
const { projectType } = await inquirer.prompt([
|
|
21
41
|
{
|
|
22
42
|
type: "list",
|
|
23
43
|
name: "projectType",
|
|
24
|
-
message: "¿Qué tipo de proyecto?",
|
|
25
|
-
choices
|
|
26
|
-
{ name: chalk.green(" Nuevo proyecto — Crear desde cero"), value: "new" },
|
|
27
|
-
{
|
|
28
|
-
name: chalk.blue(" Proyecto existente — Configurar OPL en proyecto ya iniciado"),
|
|
29
|
-
value: "existing",
|
|
30
|
-
},
|
|
31
|
-
],
|
|
44
|
+
message: isInitialized ? "Este proyecto ya tiene OPL. ¿Qué deseas hacer?" : "¿Qué tipo de proyecto?",
|
|
45
|
+
choices,
|
|
32
46
|
},
|
|
33
47
|
])
|
|
34
48
|
|
|
49
|
+
if (projectType === "rebuild") {
|
|
50
|
+
options.rebuild = true
|
|
51
|
+
options.dir = cwd
|
|
52
|
+
return initExisting(options)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (projectType === "knowledge") {
|
|
56
|
+
const { initKnowledgeRepo } = await import("./opl-init-knowledge.js")
|
|
57
|
+
return initKnowledgeRepo(options)
|
|
58
|
+
}
|
|
59
|
+
|
|
35
60
|
if (projectType === "existing") return initExisting(options)
|
|
36
61
|
}
|
|
37
62
|
|
package/src/mcp-server.js
CHANGED
|
@@ -19,7 +19,7 @@ function getServerVersion() {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const SUPPORTED_PROTOCOL_VERSIONS = ["2025-03-26", "2024-11-05"]
|
|
22
|
+
const SUPPORTED_PROTOCOL_VERSIONS = ["2025-03-26", "2024-11-05", "1.0", "1.0.0", "0.1.0"]
|
|
23
23
|
const LATEST_PROTOCOL_VERSION = SUPPORTED_PROTOCOL_VERSIONS[0]
|
|
24
24
|
|
|
25
25
|
const SERVER_INFO = {
|