openprompt-lang 1.2.1 → 1.2.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openprompt-lang",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "PromptLang CLI — Context Engine de anotaciones para desarrollo asistido por IA",
5
5
  "type": "module",
6
6
  "main": "./bin/cli.js",
@@ -14,24 +14,40 @@ 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
+
20
36
  const { projectType } = await inquirer.prompt([
21
37
  {
22
38
  type: "list",
23
39
  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
- ],
40
+ message: isInitialized ? "Este proyecto ya tiene OPL. ¿Qué deseas hacer?" : "¿Qué tipo de proyecto?",
41
+ choices,
32
42
  },
33
43
  ])
34
44
 
45
+ if (projectType === "rebuild") {
46
+ options.rebuild = true
47
+ options.dir = cwd
48
+ return initExisting(options)
49
+ }
50
+
35
51
  if (projectType === "existing") return initExisting(options)
36
52
  }
37
53
 
@@ -28,7 +28,7 @@ function getServerVersion() {
28
28
  }
29
29
  }
30
30
 
31
- const SUPPORTED_PROTOCOL_VERSIONS = ["2024-11-05"]
31
+ const SUPPORTED_PROTOCOL_VERSIONS = ["2024-11-05", "1.0", "1.0.0", "0.1.0"]
32
32
  const LATEST_PROTOCOL_VERSION = SUPPORTED_PROTOCOL_VERSIONS[0]
33
33
 
34
34
  const SERVER_INFO = {
@@ -19,7 +19,7 @@ function getServerVersion() {
19
19
  }
20
20
  }
21
21
 
22
- const SUPPORTED_PROTOCOL_VERSIONS = ["2024-11-05"]
22
+ const SUPPORTED_PROTOCOL_VERSIONS = ["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 = {
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 = {