xonecode 0.1.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.
Files changed (187) hide show
  1. package/README.md +167 -0
  2. package/dist/agent/authEnDisco.js +56 -0
  3. package/dist/agent/authEnDisco.js.map +1 -0
  4. package/dist/agent/configEnDisco.js +109 -0
  5. package/dist/agent/configEnDisco.js.map +1 -0
  6. package/dist/agent/crearProyecto.js +34 -0
  7. package/dist/agent/crearProyecto.js.map +1 -0
  8. package/dist/agent/entorno.js +124 -0
  9. package/dist/agent/entorno.js.map +1 -0
  10. package/dist/agent/guionizado.js +53 -0
  11. package/dist/agent/guionizado.js.map +1 -0
  12. package/dist/agent/instantanea.js +129 -0
  13. package/dist/agent/instantanea.js.map +1 -0
  14. package/dist/agent/interrupts.js +83 -0
  15. package/dist/agent/interrupts.js.map +1 -0
  16. package/dist/agent/mensajes.js +24 -0
  17. package/dist/agent/mensajes.js.map +1 -0
  18. package/dist/agent/modelos.js +42 -0
  19. package/dist/agent/modelos.js.map +1 -0
  20. package/dist/agent/normalizar.js +20 -0
  21. package/dist/agent/normalizar.js.map +1 -0
  22. package/dist/agent/perfiles.js +103 -0
  23. package/dist/agent/perfiles.js.map +1 -0
  24. package/dist/agent/proyecto.js +107 -0
  25. package/dist/agent/proyecto.js.map +1 -0
  26. package/dist/agent/puente.js +142 -0
  27. package/dist/agent/puente.js.map +1 -0
  28. package/dist/agent/resumenDeTool.js +48 -0
  29. package/dist/agent/resumenDeTool.js.map +1 -0
  30. package/dist/agent/skills.js +65 -0
  31. package/dist/agent/skills.js.map +1 -0
  32. package/dist/agent/textoDeTool.js +113 -0
  33. package/dist/agent/textoDeTool.js.map +1 -0
  34. package/dist/agent/turnoReal.js +173 -0
  35. package/dist/agent/turnoReal.js.map +1 -0
  36. package/dist/agent/verificador.js +65 -0
  37. package/dist/agent/verificador.js.map +1 -0
  38. package/dist/agent/xoneAgent.js +106 -0
  39. package/dist/agent/xoneAgent.js.map +1 -0
  40. package/dist/bin.js +9 -0
  41. package/dist/bin.js.map +1 -0
  42. package/dist/cli/aprobar.js +82 -0
  43. package/dist/cli/aprobar.js.map +1 -0
  44. package/dist/cli/config.js +133 -0
  45. package/dist/cli/config.js.map +1 -0
  46. package/dist/cli/consola.js +346 -0
  47. package/dist/cli/consola.js.map +1 -0
  48. package/dist/cli/describe.js +53 -0
  49. package/dist/cli/describe.js.map +1 -0
  50. package/dist/cli/doctor.js +45 -0
  51. package/dist/cli/doctor.js.map +1 -0
  52. package/dist/cli/main.js +520 -0
  53. package/dist/cli/main.js.map +1 -0
  54. package/dist/cli/markdown.js +90 -0
  55. package/dist/cli/markdown.js.map +1 -0
  56. package/dist/cli/run.js +164 -0
  57. package/dist/cli/run.js.map +1 -0
  58. package/dist/cli/spinner.js +89 -0
  59. package/dist/cli/spinner.js.map +1 -0
  60. package/dist/cli/stdio.js +193 -0
  61. package/dist/cli/stdio.js.map +1 -0
  62. package/dist/cli/tema.js +40 -0
  63. package/dist/cli/tema.js.map +1 -0
  64. package/dist/cli/verify.js +62 -0
  65. package/dist/cli/verify.js.map +1 -0
  66. package/dist/core/bitacora.js +30 -0
  67. package/dist/core/bitacora.js.map +1 -0
  68. package/dist/core/config.js +236 -0
  69. package/dist/core/config.js.map +1 -0
  70. package/dist/core/contextos.js +56 -0
  71. package/dist/core/contextos.js.map +1 -0
  72. package/dist/core/deps.js +51 -0
  73. package/dist/core/deps.js.map +1 -0
  74. package/dist/core/diff.js +79 -0
  75. package/dist/core/diff.js.map +1 -0
  76. package/dist/core/esqueleto.js +366 -0
  77. package/dist/core/esqueleto.js.map +1 -0
  78. package/dist/core/events.js +2 -0
  79. package/dist/core/events.js.map +1 -0
  80. package/dist/core/modelos.js +85 -0
  81. package/dist/core/modelos.js.map +1 -0
  82. package/dist/core/notify.js +106 -0
  83. package/dist/core/notify.js.map +1 -0
  84. package/dist/core/ports.js +114 -0
  85. package/dist/core/ports.js.map +1 -0
  86. package/dist/core/turno.js +127 -0
  87. package/dist/core/turno.js.map +1 -0
  88. package/dist/vendor/hitl.js +103 -0
  89. package/dist/vendor/hitl.js.map +1 -0
  90. package/dist/vendor/skillLoaders/catalog.js +74 -0
  91. package/dist/vendor/skillLoaders/catalog.js.map +1 -0
  92. package/dist/vendor/tokenTracking.js +58 -0
  93. package/dist/vendor/tokenTracking.js.map +1 -0
  94. package/package.json +41 -0
  95. package/skills/xone-debugging/SKILL.md +52 -0
  96. package/skills/xone-debugging/references/faq.md +561 -0
  97. package/skills/xone-debugging/references/troubleshooting-y-glosario.md +429 -0
  98. package/skills/xone-development/SKILL.md +105 -0
  99. package/skills/xone-development/references/anti-patrones.md +94 -0
  100. package/skills/xone-development/references/css/atributos-por-categoria.md +509 -0
  101. package/skills/xone-development/references/css/buenas-practicas-y-parser.md +419 -0
  102. package/skills/xone-development/references/css/dinamicos-cascada-y-componentes.md +550 -0
  103. package/skills/xone-development/references/css/patrones-material-y-temas.md +1140 -0
  104. package/skills/xone-development/references/css/propiedades-y-herencia.md +885 -0
  105. package/skills/xone-development/references/css/selectores-unidades-colores.md +840 -0
  106. package/skills/xone-development/references/datos/appdata-referencia-ampliada.md +457 -0
  107. package/skills/xone-development/references/datos/appdata.md +611 -0
  108. package/skills/xone-development/references/datos/http-sqlmanager-y-crypto.md +720 -0
  109. package/skills/xone-development/references/datos/http.md +366 -0
  110. package/skills/xone-development/references/datos/oauth2-y-replica.md +156 -0
  111. package/skills/xone-development/references/device/biometria-imagedrawing-y-otros.md +544 -0
  112. package/skills/xone-development/references/device/objetos-de-dispositivo.md +583 -0
  113. package/skills/xone-development/references/device/systemsettings-referencia-ampliada.md +396 -0
  114. package/skills/xone-development/references/device/systemsettings-y-permisos.md +342 -0
  115. package/skills/xone-development/references/fundamentos/conceptos-clave.md +695 -0
  116. package/skills/xone-development/references/fundamentos/configuracion-app-xml-ini-mappings.md +668 -0
  117. package/skills/xone-development/references/fundamentos/errores-comunes.md +312 -0
  118. package/skills/xone-development/references/fundamentos/navegacion-convenciones-y-primer-proyecto.md +576 -0
  119. package/skills/xone-development/references/fundamentos/plataforma-y-anatomia-de-proyecto.md +387 -0
  120. package/skills/xone-development/references/indice-completo.md +77 -0
  121. package/skills/xone-development/references/javascript/coleccion-error-y-usuario.md +260 -0
  122. package/skills/xone-development/references/javascript/debugging-y-best-practices.md +245 -0
  123. package/skills/xone-development/references/javascript/metodos-de-los-controles.md +556 -0
  124. package/skills/xone-development/references/javascript/metodos-nativos-de-la-vista.md +114 -0
  125. package/skills/xone-development/references/javascript/motor-js-y-contexto-de-ejecucion.md +319 -0
  126. package/skills/xone-development/references/javascript/objeto-ai-llm-en-dispositivo.md +358 -0
  127. package/skills/xone-development/references/javascript/objetos-creables-a-m.md +527 -0
  128. package/skills/xone-development/references/javascript/objetos-creables-n-z.md +385 -0
  129. package/skills/xone-development/references/javascript/patrones-criticos-seguridad-y-rendimiento.md +595 -0
  130. package/skills/xone-development/references/javascript/patrones-de-navegacion-datos-y-codigo.md +751 -0
  131. package/skills/xone-development/references/javascript/patrones-de-ui-voz-integracion-y-seguridad.md +701 -0
  132. package/skills/xone-development/references/javascript/plantillas-y-funciones-utilitarias.md +647 -0
  133. package/skills/xone-development/references/javascript/self-y-dataobject.md +449 -0
  134. package/skills/xone-development/references/javascript/singletons-globales.md +361 -0
  135. package/skills/xone-development/references/javascript/ui-catalogo-de-metodos.md +464 -0
  136. package/skills/xone-development/references/javascript/ui-gps-camara-y-multimedia.md +506 -0
  137. package/skills/xone-development/references/javascript/ui-navegacion-mensajes-y-vista.md +422 -0
  138. package/skills/xone-development/references/resumen-js-datos-dispositivo.md +80 -0
  139. package/skills/xone-development/references/resumen-xml-y-css.md +74 -0
  140. package/skills/xone-development/references/tipos-de-prop.md +28 -0
  141. package/skills/xone-development/references/xml-ui/asfilter-visibilidad-eventos-y-macros.md +576 -0
  142. package/skills/xone-development/references/xml-ui/atributos-coll-group-frame.md +235 -0
  143. package/skills/xone-development/references/xml-ui/atributos-method-macro-script-event-app.md +244 -0
  144. package/skills/xone-development/references/xml-ui/atributos-prop.md +439 -0
  145. package/skills/xone-development/references/xml-ui/contents-y-macros.md +392 -0
  146. package/skills/xone-development/references/xml-ui/errores-comunes-xml.md +245 -0
  147. package/skills/xone-development/references/xml-ui/estructura-y-nodo-coll.md +326 -0
  148. package/skills/xone-development/references/xml-ui/eventos-ciclo-de-vida-e-interaccion.md +704 -0
  149. package/skills/xone-development/references/xml-ui/eventos-sistema-login-y-personalizados.md +944 -0
  150. package/skills/xone-development/references/xml-ui/layouts-herencia-y-buenas-practicas.md +618 -0
  151. package/skills/xone-development/references/xml-ui/mapas.md +685 -0
  152. package/skills/xone-development/references/xml-ui/mappings-y-colecciones-separadas.md +148 -0
  153. package/skills/xone-development/references/xml-ui/nodos-group-y-frame.md +666 -0
  154. package/skills/xone-development/references/xml-ui/patrones-de-pantalla.md +643 -0
  155. package/skills/xone-development/references/xml-ui/prop-atributos-y-condiciones.md +298 -0
  156. package/skills/xone-development/references/xml-ui/prop-tipos-basicos.md +493 -0
  157. package/skills/xone-development/references/xml-ui/prop-tipos-combos-y-controles.md +664 -0
  158. package/skills/xone-development/references/xml-ui/prop-tipos-listas-y-mapas.md +412 -0
  159. package/skills/xone-plan-builder/SKILL.md +183 -0
  160. package/skills/xone-plan-builder/agents/openai.yaml +5 -0
  161. package/skills/xone-plan-builder/references/TASKS-FORMAT.md +132 -0
  162. package/skills/xone-project-generator/SKILL.md +111 -0
  163. package/skills/xone-project-generator/references/canonical-sizes.md +292 -0
  164. package/skills/xone-project-generator/references/colecciones-base.md +16 -0
  165. package/skills/xone-project-generator/references/convenciones-de-nombres.md +16 -0
  166. package/skills/xone-project-generator/references/ejemplos-por-sector-y-prohibiciones.md +140 -0
  167. package/skills/xone-project-generator/references/fase-3-estilos-css.md +597 -0
  168. package/skills/xone-project-generator/references/fase-6-colecciones.md +762 -0
  169. package/skills/xone-project-generator/references/fase-7-asfilter-e-integraciones.md +142 -0
  170. package/skills/xone-project-generator/references/fase-7-entidades-y-estructura-de-pantalla.md +494 -0
  171. package/skills/xone-project-generator/references/fase-7-plantilla-consola.md +477 -0
  172. package/skills/xone-project-generator/references/fase-7-plantillas-de-pantalla.md +302 -0
  173. package/skills/xone-project-generator/references/fase-7-viewmodes-graficos-y-listas.md +681 -0
  174. package/skills/xone-project-generator/references/fase-7-viewmodes-mapa-y-calendario.md +479 -0
  175. package/skills/xone-project-generator/references/fases-0-2-analisis-y-modelo-de-datos.md +350 -0
  176. package/skills/xone-project-generator/references/fases-10-12-readmes-y-validacion.md +194 -0
  177. package/skills/xone-project-generator/references/fases-4-5-estructura-y-configuracion.md +587 -0
  178. package/skills/xone-project-generator/references/fases-8-9-eventos-y-javascript.md +861 -0
  179. package/skills/xone-project-generator/references/flujo-de-generacion.md +67 -0
  180. package/skills/xone-project-generator/references/plantillas-estandar.md +98 -0
  181. package/skills/xone-project-generator/references/tamanos-canonicos.md +49 -0
  182. package/skills/xone-review/SKILL.md +189 -0
  183. package/skills/xone-spec-builder/SKILL.md +235 -0
  184. package/skills/xone-spec-builder/agents/openai.yaml +5 -0
  185. package/skills/xone-spec-builder/references/ADR-FORMAT.md +55 -0
  186. package/skills/xone-spec-builder/references/CONTEXT-FORMAT.md +42 -0
  187. package/skills/xone-spec-builder/references/PLAN-FORMAT.md +120 -0
@@ -0,0 +1,366 @@
1
+ /**
2
+ * El esqueleto de un proyecto XOne mínimo, como DATOS y sin tocar el disco.
3
+ *
4
+ * Todo el contenido sale del «Hola Mundo» de la documentación XOne
5
+ * (`xone-help-docs`, topico 01 §9 y guia de UI §8.2): **nada inventado**. XOne
6
+ * ignora en silencio lo desconocido, así que un atributo o una función
7
+ * inventada no da error — da un bug mudo, y un esqueleto recién creado que no
8
+ * arranca sería la peor primera impresión posible.
9
+ *
10
+ * La escritura en disco vive en `agent/crearProyecto.ts`: aquí solo se DECIDE
11
+ * qué ficheros hay y qué llevan dentro, que es exactamente lo que se puede
12
+ * probar sin conexión, sin simulador y sin clave (el invariante de `npm test`).
13
+ */
14
+ /**
15
+ * Las carpetas del runtime, VACÍAS y a propósito:
16
+ *
17
+ * - `bd/`: el `gestion.db` lo GENERA el simulador; un `.db` escrito a mano no
18
+ * sería una base de datos, sería un fichero que estorba.
19
+ * - `icons/`: los PNG no se pueden generar aquí (salen de Material Icons
20
+ * convertidos con cairosvg). La carpeta existe porque `app.ini` la declara.
21
+ * - `files/`: la carpeta de archivos dinámicos del runtime.
22
+ */
23
+ export function carpetasDelEsqueleto() {
24
+ return ["bd", "icons", "files"];
25
+ }
26
+ export function generarEsqueleto(datos) {
27
+ const { nombre, titulo, orientacion, login } = datos;
28
+ const appXml = `<?xml version="1.0" encoding="utf-8" standalone="yes"?>
29
+ <xml>
30
+ <app
31
+ prefix="gen"
32
+ version="1.0.0"
33
+ debug="true"
34
+ autologon="${login ? "false" : "true"}"
35
+ screen-orientation="${orientacion}"
36
+ resolution-width="1080"
37
+ resolution-height="1920"
38
+ scale-fontsize="true"
39
+ android-font-factor="10"
40
+ default-language="javascript">
41
+
42
+ <connection name="main" connstring="bd/gestion.db" />
43
+
44
+ <entry-point>
45
+ <item name="EntradaApp" conditions="" />
46
+ </entry-point>
47
+ ${login ? `
48
+ <!-- Pantalla de login -->
49
+ <login-coll>
50
+ <item name="Login" conditions="" />
51
+ </login-coll>
52
+ ` : ""}
53
+ <style url="default.css" encoding="UTF-8" />
54
+ <include file="functions.js" language="javascript" encoding="UTF-8"/>
55
+ </app>
56
+ </xml>
57
+ `;
58
+ const appIni = `Name=${nombre}
59
+ Title=${titulo}
60
+ Caption=${titulo}
61
+ Icon=app_icon.png
62
+ IconFolder=icons
63
+ FilesFolder=files
64
+ HideSplash=false
65
+ `;
66
+ // Regla crítica de XOne: aquí SOLO Empresas y Usuarios. Las colecciones de
67
+ // negocio van en `.xne` separados, y esa es justamente la primera conversación
68
+ // que el agente puede tener con el usuario sobre su proyecto.
69
+ const mappingsXne = `<?xml version="1.0" encoding="utf-8"?>
70
+ <xml>
71
+ <app prefix="gen" version="1.0.0" debug="true" default-language="javascript">
72
+ <style url="default.css" />
73
+ </app>
74
+
75
+ <collprops type="general">
76
+ <coll name="Empresas"
77
+ sql="SELECT * FROM ##PREF##Empresas"
78
+ objname="Empresas"
79
+ updateobj="Empresas"
80
+ loadall="true">
81
+ <group name="General" id="1">
82
+ <prop name="ID" type="N" visible="0" />
83
+ <prop name="CODIGO" type="N" visible="7" />
84
+ <prop name="NOMBRE" type="T" visible="7" fieldsize="150" />
85
+ <prop name="ROWID" type="T" visible="0" fieldsize="32" />
86
+ </group>
87
+ </coll>
88
+
89
+ <coll name="Usuarios"
90
+ sql="SELECT * FROM ##PREF##Usuarios"
91
+ objname="Usuarios"
92
+ updateobj="Usuarios"
93
+ loadall="true">
94
+ <group name="General" id="1">
95
+ <prop name="ID" type="N" visible="0" />
96
+ <prop name="CODIGO" type="N" visible="7" />
97
+ <prop name="NOMBRE" type="T" visible="7" fieldsize="100" />
98
+ <prop name="ID_EMPRESA" type="N" visible="7"
99
+ mapcol="Empresas" mapfld="ID" />
100
+ <prop name="LOGIN" type="T" visible="7" fieldsize="50" />
101
+ <prop name="PASSWORD" type="X" visible="0" fieldsize="100" />
102
+ <prop name="ROWID" type="T" visible="0" fieldsize="32" />
103
+ </group>
104
+ </coll>
105
+ </collprops>
106
+ </xml>
107
+ `;
108
+ const defaultCss = `/* Configuracion global */
109
+ prop {
110
+ fontname: Roboto-Regular.ttf;
111
+ fontsize: 10;
112
+ labelbox: false;
113
+ label-wrap: true;
114
+ text-border: false;
115
+ }
116
+
117
+ coll {
118
+ notab: true;
119
+ show-toolbar: false;
120
+ group-swipe: false;
121
+ editmask: 0;
122
+ }
123
+
124
+ /* Clases de layout */
125
+ .frameHeader {
126
+ width: 100%;
127
+ height: 120p;
128
+ bgcolor: #2196F3;
129
+ align: center;
130
+ }
131
+
132
+ .frameBody {
133
+ width: 100%;
134
+ height: 100%;
135
+ scroll: true;
136
+ bgcolor: #FFFFFF;
137
+ }
138
+
139
+ /* Clases de botones */
140
+ .btnPrimario {
141
+ width: 90%;
142
+ height: 50p;
143
+ bgcolor: #2196F3;
144
+ forecolor: #FFFFFF;
145
+ border-corner-radius: 8;
146
+ text-align: center;
147
+ fontsize: 14;
148
+ }
149
+
150
+ /* Clases de texto */
151
+ .textoTitulo {
152
+ fontsize: 18;
153
+ forecolor: #212121;
154
+ text-align: center;
155
+ }
156
+
157
+ .textoSubtitulo {
158
+ fontsize: 14;
159
+ forecolor: #757575;
160
+ text-align: center;
161
+ }
162
+
163
+ /* Grupos sin pestana */
164
+ .groupNoTab {
165
+ tab-visible: false;
166
+ }
167
+ `;
168
+ const functionsJs = `/**
169
+ * Funciones globales - ${titulo}
170
+ */
171
+
172
+ /**
173
+ * Verifica si un valor esta vacio
174
+ */
175
+ function isEmpty(val) {
176
+ return val === undefined || val === null || val === "";
177
+ }
178
+
179
+ /**
180
+ * Muestra un mensaje de confirmacion Si/No
181
+ */
182
+ function confirmar(mensaje, titulo) {
183
+ titulo = titulo || "Confirmar";
184
+ var nResult = ui.msgBox(mensaje, titulo, 4);
185
+ return nResult == 6;
186
+ }
187
+
188
+ /**
189
+ * Muestra un toast simple
190
+ */
191
+ function mostrarToast(mensaje) {
192
+ ui.showToast(mensaje);
193
+ }
194
+
195
+ /**
196
+ * Cierra la pantalla actual
197
+ */
198
+ function cerrarPantalla() {
199
+ var window = ui.getView(self);
200
+ if (window) {
201
+ window.exit();
202
+ }
203
+ }
204
+ ${login ? `
205
+ /**
206
+ * Login contra la coleccion Usuarios (patron de seguridad del wiki)
207
+ */
208
+ function realizarLogin() {
209
+ if (!validarRequerido(self.MAP_EMAIL, "Email")) return;
210
+ if (!validarRequerido(self.MAP_PASSWORD, "Contrasena")) return;
211
+
212
+ ui.showWaitDialog("Iniciando sesion...");
213
+
214
+ var collUsuarios = appData.getCollection("Usuarios");
215
+ var usuario = collUsuarios.findObject(
216
+ "LOGIN = '" + self.MAP_EMAIL + "'"
217
+ );
218
+
219
+ ui.hideWaitDialog();
220
+
221
+ if (usuario) {
222
+ if (usuario.PASSWORD == self.MAP_PASSWORD) {
223
+ appData.setGlobalMacro("##USERID##", usuario.ID);
224
+ appData.setGlobalMacro("##USERNAME##", usuario.NOMBRE);
225
+ ui.showToast("Bienvenido, " + usuario.NOMBRE);
226
+ ui.openMenu("MenuPrincipal", self);
227
+ } else {
228
+ ui.showToast("Credenciales incorrectas");
229
+ }
230
+ } else {
231
+ ui.showToast("Usuario no encontrado");
232
+ }
233
+ }
234
+
235
+ function validarRequerido(valor, nombre) {
236
+ if (!valor || valor.toString().length == 0) {
237
+ ui.showToast("El campo " + nombre + " es obligatorio");
238
+ return false;
239
+ }
240
+ return true;
241
+ }
242
+ ` : ""}`;
243
+ const entradaAppXne = `<?xml version="1.0" encoding="utf-8"?>
244
+ <coll name="EntradaApp" title="${titulo}"
245
+ special="true" notab="true" show-toolbar="false">
246
+
247
+ <create>
248
+ <action name="runscript">
249
+ <script language="javascript">
250
+ // Ir directamente al menu
251
+ ui.openMenu("MenuPrincipal", self);
252
+ </script>
253
+ </action>
254
+ </create>
255
+
256
+ <group name="grpPrincipal" id="1" class="groupNoTab">
257
+ <frame name="frmBody" class="frameBody">
258
+ <prop name="lblCargando" type="TL" visible="7"
259
+ width="100%" height="50p" align="center"
260
+ class="textoTitulo" title="Cargando..."/>
261
+ </frame>
262
+ </group>
263
+
264
+ <onback>
265
+ <action name="runscript">
266
+ <script language="javascript">
267
+ if (confirmar("Desea salir?", "Salir")) {
268
+ appData.exit();
269
+ }
270
+ </script>
271
+ </action>
272
+ </onback>
273
+ </coll>
274
+ `;
275
+ // MenuPrincipal no es opcional en la práctica: el EntradaApp documentado lo
276
+ // abre con ui.openMenu, así que sin él la app recién creada nacería rota.
277
+ const menuPrincipalXne = `<?xml version="1.0" encoding="utf-8"?>
278
+ <coll name="MenuPrincipal" title="Menu Principal"
279
+ special="true" notab="true" show-toolbar="false">
280
+
281
+ <group name="grpMenu" id="1" class="groupNoTab">
282
+ <frame name="frmHeader" class="frameHeader">
283
+ <prop name="lblTitulo" type="TL" visible="7"
284
+ width="100%" height="60p" align="center"
285
+ forecolor="#FFFFFF" fontsize="20"
286
+ title="${titulo}"/>
287
+ </frame>
288
+
289
+ <frame name="frmBody" class="frameBody">
290
+ <prop name="lblMensaje" type="TL" visible="7"
291
+ width="100%" height="80p" align="center"
292
+ class="textoTitulo" tmargin="40p"
293
+ title="Bienvenido a tu proyecto XOne!"/>
294
+
295
+ <prop name="btnSaludo" type="B" visible="7"
296
+ width="80%" height="50p" align="center"
297
+ class="btnPrimario" title="Saludar" tmargin="40p"
298
+ onclick="ui.showToast('Hola desde XOne!');" />
299
+ </frame>
300
+ </group>
301
+
302
+ <onback>
303
+ <action name="runscript">
304
+ <script language="javascript">
305
+ if (confirmar("Desea salir de la aplicacion?", "Salir")) {
306
+ appData.exit();
307
+ }
308
+ </script>
309
+ </action>
310
+ </onback>
311
+ </coll>
312
+ `;
313
+ const ficheros = [
314
+ { ruta: "app.xml", contenido: appXml },
315
+ { ruta: "app.ini", contenido: appIni },
316
+ { ruta: "mappings.xne", contenido: mappingsXne },
317
+ { ruta: "default.css", contenido: defaultCss },
318
+ { ruta: "functions.js", contenido: functionsJs },
319
+ { ruta: "EntradaApp.xne", contenido: entradaAppXne },
320
+ { ruta: "MenuPrincipal.xne", contenido: menuPrincipalXne },
321
+ ];
322
+ if (login) {
323
+ ficheros.push({ ruta: "Login.xne", contenido: loginXne() });
324
+ }
325
+ return ficheros;
326
+ }
327
+ /**
328
+ * La pantalla de login del patrón del wiki (topico 05 §9.1). Llama a
329
+ * `realizarLogin()`, que va en `functions.js` cuando el proyecto lleva login —
330
+ * la pantalla y el JS son del mismo patrón, no una mezcla.
331
+ */
332
+ function loginXne() {
333
+ return `<coll name="Login" title="Iniciar Sesion"
334
+ notab="true" show-toolbar="false">
335
+
336
+ <create>
337
+ <script>
338
+ self.MAP_EMAIL = "";
339
+ self.MAP_PASSWORD = "";
340
+ </script>
341
+ </create>
342
+
343
+ <group name="grpPrincipal" id="1" class="groupNoTab">
344
+ <frame name="frmFormulario" width="100%" bgcolor="#FFFFFF">
345
+ <prop name="MAP_EMAIL" type="T" visible="7"
346
+ width="90%" height="56p" align="center"
347
+ hint="tu@email.com"/>
348
+ <prop name="MAP_PASSWORD" type="X" visible="7"
349
+ width="90%" height="56p" align="center"
350
+ hint="Tu contrasena"/>
351
+ <prop name="btnLogin" type="B" visible="7"
352
+ width="90%" height="56p" align="center" tmargin="30p"
353
+ title="Iniciar Sesion"
354
+ onclick="realizarLogin();" />
355
+ </frame>
356
+ </group>
357
+
358
+ <onback>
359
+ <script>
360
+ cerrarPantalla();
361
+ </script>
362
+ </onback>
363
+ </coll>
364
+ `;
365
+ }
366
+ //# sourceMappingURL=esqueleto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esqueleto.js","sourceRoot":"","sources":["../../src/core/esqueleto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkBH;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAuB;IACtD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAErD,MAAM,MAAM,GAAG;;;;;;qBAMI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;8BACf,WAAW;;;;;;;;;;;;EAYvC,KAAK,CAAC,CAAC,CAAC;;;;;CAKT,CAAC,CAAC,CAAC,EAAE;;;;;CAKL,CAAC;IAEA,MAAM,MAAM,GAAG,QAAQ,MAAM;QACvB,MAAM;UACJ,MAAM;;;;;CAKf,CAAC;IAEA,2EAA2E;IAC3E,+EAA+E;IAC/E,8DAA8D;IAC9D,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCrB,CA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;;;;;;;;;;;;;;CA+BR,CAAC;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/core/events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,85 @@
1
+ export const PAPELES = ["rapido", "trabajo", "afilado"];
2
+ export const PROVEEDORES = [
3
+ "gemini", "openai", "anthropic", "ollama",
4
+ ];
5
+ /**
6
+ * Los modelos por omisión de cada papel.
7
+ *
8
+ * `rapido` es el que corre en TODOS los turnos, así que es el que más veces se paga en la
9
+ * vida del agente: arranca abajo y solo se sube con una medición delante. `afilado` es
10
+ * para el juez, que es quien decide si algo está bien — ahí un modelo flojo cuesta más de
11
+ * lo que ahorra.
12
+ *
13
+ * Ollama por omisión, y a propósito: el usuario tiene modelos locales con tool-calling y
14
+ * los frontier de pago no son la vía por defecto de este laboratorio.
15
+ */
16
+ export const POR_OMISION = {
17
+ rapido: { proveedor: "ollama", modelo: "glm-5.3-flash:cloud" },
18
+ trabajo: { proveedor: "ollama", modelo: "glm-5.3-flash:cloud" },
19
+ afilado: { proveedor: "ollama", modelo: "kimi-k3:cloud" },
20
+ };
21
+ export class ModeloMalEscrito extends Error {
22
+ }
23
+ /**
24
+ * `proveedor/modelo` → sus dos partes.
25
+ *
26
+ * El separador es la PRIMERA barra, no la última: un id de Ollama puede llevar barras
27
+ * (`library/qwen3:8b`) y partir por la última dejaría el proveedor con basura. Se valida
28
+ * el proveedor contra la lista en vez de aceptar cualquier cosa, porque un proveedor mal
29
+ * escrito no falla al parsear: falla mucho después, al construir el cliente, con un error
30
+ * que no menciona la bandera.
31
+ */
32
+ export function parsear(texto) {
33
+ const corte = texto.indexOf("/");
34
+ if (corte <= 0 || corte === texto.length - 1) {
35
+ throw new ModeloMalEscrito(`«${texto}» no tiene la forma proveedor/modelo. Proveedores: ${PROVEEDORES.join(", ")}`);
36
+ }
37
+ const proveedor = texto.slice(0, corte);
38
+ const modelo = texto.slice(corte + 1);
39
+ if (!PROVEEDORES.includes(proveedor)) {
40
+ throw new ModeloMalEscrito(`proveedor «${proveedor}» desconocido. Los que hay: ${PROVEEDORES.join(", ")}`);
41
+ }
42
+ return { proveedor: proveedor, modelo };
43
+ }
44
+ /**
45
+ * Qué modelo le toca a cada papel, y de dónde salió.
46
+ *
47
+ * Precedencia, de más fuerte a más débil, evaluada papel a papel: porPapel > bandera
48
+ * > entorno > proyecto > global > omisión. Los dos primeros escalones son de CLÍ y
49
+ * preceden a cualquier fichero. Entre ficheros manda el RANGO (proyecto gana a global),
50
+ * y solo DENTRO de un mismo fichero manda la especificidad (modelos.<papel> gana a
51
+ * modelo): el campo general de un fichero de rango superior nunca pierde contra el
52
+ * campo específico de uno inferior.
53
+ */
54
+ export function resolver(fuentes = {}) {
55
+ const salida = {};
56
+ for (const papel of PAPELES) {
57
+ // El primero que existe gana; el resto no se mira.
58
+ if (fuentes.porPapel?.[papel]) {
59
+ salida[papel] = { ...parsear(fuentes.porPapel[papel]), origen: "bandera" };
60
+ }
61
+ else if (fuentes.bandera) {
62
+ salida[papel] = { ...parsear(fuentes.bandera), origen: "bandera" };
63
+ }
64
+ else if (fuentes.entorno?.XONECODE_MODELO) {
65
+ salida[papel] = { ...parsear(fuentes.entorno.XONECODE_MODELO), origen: "entorno" };
66
+ }
67
+ else if (fuentes.proyecto?.modelos?.[papel]) {
68
+ salida[papel] = { ...parsear(fuentes.proyecto.modelos[papel]), origen: "proyecto" };
69
+ }
70
+ else if (fuentes.proyecto?.modelo) {
71
+ salida[papel] = { ...parsear(fuentes.proyecto.modelo), origen: "proyecto" };
72
+ }
73
+ else if (fuentes.global?.modelos?.[papel]) {
74
+ salida[papel] = { ...parsear(fuentes.global.modelos[papel]), origen: "global" };
75
+ }
76
+ else if (fuentes.global?.modelo) {
77
+ salida[papel] = { ...parsear(fuentes.global.modelo), origen: "global" };
78
+ }
79
+ else {
80
+ salida[papel] = { ...POR_OMISION[papel], origen: "omision" };
81
+ }
82
+ }
83
+ return salida;
84
+ }
85
+ //# sourceMappingURL=modelos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelos.js","sourceRoot":"","sources":["../../src/core/modelos.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAInF,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ;CACjC,CAAC;AASX;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAA4D;IAClF,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,qBAAqB,EAAE;IAC9D,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,qBAAqB,EAAE;IAC/D,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE;CAC1D,CAAC;AAEF,MAAM,OAAO,gBAAiB,SAAQ,KAAK;CAAG;AAE9C;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,gBAAgB,CACxB,IAAI,KAAK,sDAAsD,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxF,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACtC,IAAI,CAAE,WAAiC,CAAC,QAAQ,CAAC,SA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I,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;YACpC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QAC9E,CAAC;aAAM,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QAClF,CAAC;aAAM,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QAC1E,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * La política de ruido: una línea por RACHA de la misma tool, no por llamada.
3
+ *
4
+ * Es del TURNO: se construye al empezar el turno y muere con él. Un colapsador de proceso
5
+ * contaría las llamadas de todos los turnos juntos.
6
+ *
7
+ * La línea lleva ICONO por familia (`→` leer, `←` escribir, `✱` buscar) y VERBO en
8
+ * español, no el nombre crudo de la tool — «→ lee app.xne» cuenta lo mismo que
9
+ * «🔧 read_file» y se lee a la primera, que es lo que llena los 100-300 s de un turno.
10
+ * Una tool desconocida no se disfraza: `⚙` y su nombre tal cual, porque un nombre que
11
+ * no está en el mapa puede significar cualquier cosa (una tool MCP de Studio, por
12
+ * ejemplo) y inventarle un verbo sería mentir.
13
+ *
14
+ * Devuelve una LISTA de líneas, nunca una cadena con dos pegadas: cuando una racha se
15
+ * cierra Y otra tool arranca en el mismo evento —el caso normal de "tres read_file y luego
16
+ * un glob"— hay DOS cosas que decir, y quien pinta escribe tantas líneas como haya.
17
+ */
18
+ /** Qué icono abre la línea, por familia. Sin entrada: `⚙`, genérico. */
19
+ const ICONO = {
20
+ read_file: "→",
21
+ ls: "→",
22
+ write_file: "←",
23
+ edit_file: "←",
24
+ glob: "✱",
25
+ grep: "✱",
26
+ };
27
+ /** El verbo de cada tool conocida, en español. */
28
+ const VERBO = {
29
+ read_file: "lee",
30
+ ls: "lista",
31
+ write_file: "escribe",
32
+ edit_file: "edita",
33
+ glob: "busca",
34
+ grep: "busca",
35
+ };
36
+ /** `→ lee app.xne` para una conocida; `⚙ studio_edit_file` para el resto. */
37
+ function frase(nombre, detalle) {
38
+ const icono = ICONO[nombre];
39
+ if (icono === undefined)
40
+ return `⚙ ${nombre}`;
41
+ const verbo = VERBO[nombre];
42
+ return detalle === undefined || detalle === "" ? `${icono} ${verbo}` : `${icono} ${verbo} ${detalle}`;
43
+ }
44
+ /**
45
+ * La lista de ficheros del cierre: los tres primeros y «y N más» — el número completo
46
+ * ya lo dijo el `×N`, la lista es para reconocer, no para leerla entera. El mismo
47
+ * fichero dos veces (relecturas) se cuenta una.
48
+ */
49
+ function listaDe(detalles) {
50
+ const unicos = [...new Set(detalles)];
51
+ if (unicos.length <= 3)
52
+ return unicos.join(", ");
53
+ return `${unicos.slice(0, 3).join(", ")} y ${unicos.length - 3} más`;
54
+ }
55
+ export class Colapsador {
56
+ nombre = "";
57
+ cuenta = 0;
58
+ detalles = [];
59
+ /** Las líneas que toca escribir por este evento, EN ORDEN. 0, 1 o 2. */
60
+ lineas(evento) {
61
+ const salida = [];
62
+ if (evento.error) {
63
+ // Cierra la racha en curso y canta el error aparte, sin colapsar.
64
+ const pendiente = this.cerrarRacha();
65
+ if (pendiente)
66
+ salida.push(pendiente);
67
+ salida.push(`✗ ${frase(evento.nombre, evento.detalle).slice(2)}: ${evento.error}`);
68
+ return salida;
69
+ }
70
+ if (evento.nombre === this.nombre) {
71
+ this.cuenta++;
72
+ if (evento.detalle !== undefined)
73
+ this.detalles.push(evento.detalle);
74
+ return salida; // misma racha: calla
75
+ }
76
+ const pendiente = this.cerrarRacha();
77
+ if (pendiente)
78
+ salida.push(pendiente);
79
+ this.nombre = evento.nombre;
80
+ this.cuenta = 1;
81
+ this.detalles = evento.detalle === undefined ? [] : [evento.detalle];
82
+ salida.push(frase(evento.nombre, evento.detalle));
83
+ return salida;
84
+ }
85
+ /** La cuenta de la última racha. Se llama al terminar el turno, incluso si reventó. */
86
+ cierre() {
87
+ return this.cerrarRacha();
88
+ }
89
+ cerrarRacha() {
90
+ // Una racha de 1 ya se anunció al abrirla: repetirla como "×1" es ruido.
91
+ if (this.cuenta <= 1) {
92
+ this.reiniciar();
93
+ return null;
94
+ }
95
+ const base = frase(this.nombre);
96
+ const cierre = this.detalles.length > 0 ? `${base} ×${this.cuenta} — ${listaDe(this.detalles)}` : `${base} ×${this.cuenta}`;
97
+ this.reiniciar();
98
+ return cierre;
99
+ }
100
+ reiniciar() {
101
+ this.nombre = "";
102
+ this.cuenta = 0;
103
+ this.detalles = [];
104
+ }
105
+ }
106
+ //# sourceMappingURL=notify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notify.js","sourceRoot":"","sources":["../../src/core/notify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAcH,wEAAwE;AACxE,MAAM,KAAK,GAA2B;IACpC,SAAS,EAAE,GAAG;IACd,EAAE,EAAE,GAAG;IACP,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,GAAG;IACd,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,kDAAkD;AAClD,MAAM,KAAK,GAA2B;IACpC,SAAS,EAAE,KAAK;IAChB,EAA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