nexakit 0.10.0 → 0.13.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.
- package/README.md +13 -6
- package/assets/runtime/package-lock.json +415 -6
- package/bench/casos/arquitectura/alta-usuarios/base/controladores/usuarios.js +16 -0
- package/bench/casos/arquitectura/alta-usuarios/base/db.js +14 -0
- package/bench/casos/arquitectura/alta-usuarios/base/docs/adr/0003-capas.md +15 -0
- package/bench/casos/arquitectura/alta-usuarios/base/errores.js +3 -0
- package/bench/casos/arquitectura/alta-usuarios/base/repositorios/usuarios.js +14 -0
- package/bench/casos/arquitectura/alta-usuarios/base/servicios/usuarios.js +20 -0
- package/bench/casos/arquitectura/alta-usuarios/cambio/controladores/usuarios.js +47 -0
- package/bench/casos/arquitectura/alta-usuarios/cambio/repositorios/usuarios.js +21 -0
- package/bench/casos/arquitectura/alta-usuarios/cambio/servicios/perfil.js +14 -0
- package/bench/casos/arquitectura/alta-usuarios/esperado.json +53 -0
- package/bench/casos/arquitectura/pedidos-facturacion/base/docs/adr/0001-capas.md +18 -0
- package/bench/casos/arquitectura/pedidos-facturacion/base/src/aplicacion/confirmar.ts +8 -0
- package/bench/casos/arquitectura/pedidos-facturacion/base/src/dominio/pedido.ts +15 -0
- package/bench/casos/arquitectura/pedidos-facturacion/base/src/dominio/puertos.ts +6 -0
- package/bench/casos/arquitectura/pedidos-facturacion/base/src/infra/db.ts +14 -0
- package/bench/casos/arquitectura/pedidos-facturacion/base/src/main.ts +9 -0
- package/bench/casos/arquitectura/pedidos-facturacion/cambio/src/aplicacion/facturar.ts +19 -0
- package/bench/casos/arquitectura/pedidos-facturacion/cambio/src/dominio/informe.ts +7 -0
- package/bench/casos/arquitectura/pedidos-facturacion/cambio/src/dominio/pedido.ts +21 -0
- package/bench/casos/arquitectura/pedidos-facturacion/cambio/src/infra/db.ts +22 -0
- package/bench/casos/arquitectura/pedidos-facturacion/esperado.json +53 -0
- package/bench/casos/arquitectura/resumen-cliente/base/docs/adr/0001-capas.md +18 -0
- package/bench/casos/arquitectura/resumen-cliente/base/src/aplicacion/confirmar.ts +8 -0
- package/bench/casos/arquitectura/resumen-cliente/base/src/dominio/pedido.ts +15 -0
- package/bench/casos/arquitectura/resumen-cliente/base/src/dominio/puertos.ts +6 -0
- package/bench/casos/arquitectura/resumen-cliente/base/src/infra/db.ts +14 -0
- package/bench/casos/arquitectura/resumen-cliente/base/src/main.ts +9 -0
- package/bench/casos/arquitectura/resumen-cliente/cambio/src/aplicacion/resumen.ts +6 -0
- package/bench/casos/arquitectura/resumen-cliente/cambio/src/dominio/pedido.ts +33 -0
- package/bench/casos/arquitectura/resumen-cliente/cambio/src/dominio/puertos.ts +7 -0
- package/bench/casos/arquitectura/resumen-cliente/cambio/src/infra/db.ts +18 -0
- package/bench/casos/arquitectura/resumen-cliente/cambio/src/main.ts +14 -0
- package/bench/casos/arquitectura/resumen-cliente/esperado.json +23 -0
- package/bench/casos/documentacion/comentario-obsoleto/base/README.md +18 -0
- package/bench/casos/documentacion/comentario-obsoleto/base/src/usuarios.ts +35 -0
- package/bench/casos/documentacion/comentario-obsoleto/cambio/src/copia.ts +8 -0
- package/bench/casos/documentacion/comentario-obsoleto/cambio/src/usuarios.ts +43 -0
- package/bench/casos/documentacion/comentario-obsoleto/esperado.json +42 -0
- package/bench/casos/documentacion/reportes-config/base/README.md +23 -0
- package/bench/casos/documentacion/reportes-config/base/src/cli.js +33 -0
- package/bench/casos/documentacion/reportes-config/base/src/config.js +15 -0
- package/bench/casos/documentacion/reportes-config/base/src/envio.js +23 -0
- package/bench/casos/documentacion/reportes-config/cambio/src/cli.js +35 -0
- package/bench/casos/documentacion/reportes-config/cambio/src/config.js +15 -0
- package/bench/casos/documentacion/reportes-config/esperado.json +42 -0
- package/bench/casos/documentacion/tiempo-espera/base/README.md +10 -0
- package/bench/casos/documentacion/tiempo-espera/base/src/config.js +8 -0
- package/bench/casos/documentacion/tiempo-espera/cambio/README.md +10 -0
- package/bench/casos/documentacion/tiempo-espera/cambio/src/config.js +8 -0
- package/bench/casos/documentacion/tiempo-espera/esperado.json +16 -0
- package/bench/casos/pruebas/calendario-laboral/base/src/fechas.js +3 -0
- package/bench/casos/pruebas/calendario-laboral/base/test/fechas.test.js +7 -0
- package/bench/casos/pruebas/calendario-laboral/cambio/src/fechas.js +37 -0
- package/bench/casos/pruebas/calendario-laboral/cambio/test/calendario.test.js +31 -0
- package/bench/casos/pruebas/calendario-laboral/esperado.json +49 -0
- package/bench/casos/pruebas/fin-de-semana/base/src/fechas.js +3 -0
- package/bench/casos/pruebas/fin-de-semana/base/test/fechas.test.js +7 -0
- package/bench/casos/pruebas/fin-de-semana/cambio/src/fechas.js +8 -0
- package/bench/casos/pruebas/fin-de-semana/cambio/test/fines-de-semana.test.js +13 -0
- package/bench/casos/pruebas/fin-de-semana/esperado.json +16 -0
- package/bench/casos/pruebas/precios-carrito/base/src/precio.ts +3 -0
- package/bench/casos/pruebas/precios-carrito/base/test/precio.test.js +11 -0
- package/bench/casos/pruebas/precios-carrito/cambio/src/precio.ts +34 -0
- package/bench/casos/pruebas/precios-carrito/cambio/test/precio.test.js +42 -0
- package/bench/casos/pruebas/precios-carrito/esperado.json +42 -0
- package/bench/casos/rendimiento/boletin-correo/base/src/correo.html +1 -0
- package/bench/casos/rendimiento/boletin-correo/base/src/plantilla.ts +11 -0
- package/bench/casos/rendimiento/boletin-correo/cambio/src/envios.ts +44 -0
- package/bench/casos/rendimiento/boletin-correo/cambio/src/plantilla.ts +10 -0
- package/bench/casos/rendimiento/boletin-correo/esperado.json +42 -0
- package/bench/casos/rendimiento/clientes-por-lote/base/src/informe.js +8 -0
- package/bench/casos/rendimiento/clientes-por-lote/cambio/src/informe.js +6 -0
- package/bench/casos/rendimiento/clientes-por-lote/esperado.json +14 -0
- package/bench/casos/rendimiento/informe-ventas/base/src/informe.js +6 -0
- package/bench/casos/rendimiento/informe-ventas/base/src/tasas.json +1 -0
- package/bench/casos/rendimiento/informe-ventas/cambio/src/informe.js +33 -0
- package/bench/casos/rendimiento/informe-ventas/cambio/src/tasas.js +7 -0
- package/bench/casos/rendimiento/informe-ventas/esperado.json +42 -0
- package/bench/casos/seguridad/inyeccion-orden/base/src/respaldo.ts +13 -0
- package/bench/casos/seguridad/inyeccion-orden/cambio/src/respaldo.ts +69 -0
- package/bench/casos/seguridad/inyeccion-orden/esperado.json +42 -0
- package/bench/casos/seguridad/limpio-validacion/base/servidor.js +11 -0
- package/bench/casos/seguridad/limpio-validacion/cambio/servidor.js +39 -0
- package/bench/casos/seguridad/limpio-validacion/esperado.json +14 -0
- package/bench/casos/seguridad/servidor-archivos/base/servidor.js +21 -0
- package/bench/casos/seguridad/servidor-archivos/cambio/servidor.js +79 -0
- package/bench/casos/seguridad/servidor-archivos/esperado.json +42 -0
- package/bin/nexakit-fabrica-mcp.js +12 -0
- package/dist/fabrica/banco/casos.js +304 -0
- package/dist/fabrica/banco/ejecutar.js +483 -0
- package/dist/fabrica/banco/medir.js +120 -0
- package/dist/fabrica/cli.js +737 -0
- package/dist/fabrica/conectores/antigravity.js +1040 -0
- package/dist/fabrica/conectores/codex.js +967 -0
- package/dist/fabrica/conectores/tipos.js +8 -0
- package/dist/fabrica/config.js +44 -0
- package/dist/fabrica/consolidar.js +218 -0
- package/dist/fabrica/decision.js +210 -0
- package/dist/fabrica/diff.js +247 -0
- package/dist/fabrica/disco.js +356 -0
- package/dist/fabrica/ejecutor.js +597 -0
- package/dist/fabrica/encargo/candado.js +274 -0
- package/dist/fabrica/encargo/ejecutar.js +827 -0
- package/dist/fabrica/encargo/evidencia.js +308 -0
- package/dist/fabrica/encargo/parche.js +146 -0
- package/dist/fabrica/encargo/worktree.js +394 -0
- package/dist/fabrica/enrutador.js +425 -0
- package/dist/fabrica/errores.js +14 -0
- package/dist/fabrica/esquemas.js +57 -0
- package/dist/fabrica/estaciones.js +75 -0
- package/dist/fabrica/evidencia.js +406 -0
- package/dist/fabrica/indice.js +1 -0
- package/dist/fabrica/jsonrpc.js +274 -0
- package/dist/fabrica/lecciones.js +363 -0
- package/dist/fabrica/mcp.js +376 -0
- package/dist/fabrica/preferencias.js +56 -0
- package/dist/fabrica/protocolos/codex/AbsolutePathBuf.js +2 -0
- package/dist/fabrica/protocolos/codex/ApplyPatchApprovalResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/ClientInfo.js +2 -0
- package/dist/fabrica/protocolos/codex/ExecCommandApprovalParams.js +2 -0
- package/dist/fabrica/protocolos/codex/ExecCommandApprovalResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/ExecPolicyAmendment.js +2 -0
- package/dist/fabrica/protocolos/codex/FunctionCallOutputBody.js +2 -0
- package/dist/fabrica/protocolos/codex/FunctionCallOutputContentItem.js +2 -0
- package/dist/fabrica/protocolos/codex/ImageDetail.js +2 -0
- package/dist/fabrica/protocolos/codex/InitializeCapabilities.js +2 -0
- package/dist/fabrica/protocolos/codex/InitializeParams.js +2 -0
- package/dist/fabrica/protocolos/codex/InitializeResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/InputModality.js +2 -0
- package/dist/fabrica/protocolos/codex/LegacyAppPathString.js +2 -0
- package/dist/fabrica/protocolos/codex/NetworkPolicyAmendment.js +2 -0
- package/dist/fabrica/protocolos/codex/NetworkPolicyRuleAction.js +2 -0
- package/dist/fabrica/protocolos/codex/ParsedCommand.js +2 -0
- package/dist/fabrica/protocolos/codex/Personality.js +2 -0
- package/dist/fabrica/protocolos/codex/ReasoningEffort.js +2 -0
- package/dist/fabrica/protocolos/codex/ReasoningSummary.js +2 -0
- package/dist/fabrica/protocolos/codex/ReviewDecision.js +2 -0
- package/dist/fabrica/protocolos/codex/ThreadId.js +2 -0
- package/dist/fabrica/protocolos/codex/serde_json/JsonValue.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/AdditionalFileSystemPermissions.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/AdditionalNetworkPermissions.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ApprovalsReviewer.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/AskForApproval.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ByteRange.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/CommandAction.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/CommandExecutionApprovalDecision.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/CommandExecutionApprovalKind.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/CommandExecutionRequestApprovalParams.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/CommandExecutionRequestApprovalResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ConfigReadParams.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/CyberAccessProgram.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ExecPolicyAmendment.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/FileChangeApprovalDecision.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/FileChangeRequestApprovalResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/FileSystemAccessMode.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/FileSystemPath.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/FileSystemSandboxEntry.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/FileSystemSpecialPath.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/GrantedPermissionProfile.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ListMcpServerStatusParams.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/McpServerElicitationAction.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/McpServerElicitationRequestResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/McpServerStatusDetail.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/Model.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ModelAccessPrograms.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ModelAvailabilityNux.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ModelListParams.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ModelListResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ModelServiceTier.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ModelUpgradeInfo.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/MultiAgentVersion.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/NetworkAccess.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/NetworkApprovalContext.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/NetworkApprovalProtocol.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/NetworkPolicyAmendment.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/NetworkPolicyRuleAction.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/PermissionGrantScope.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/PermissionsRequestApprovalResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ReasoningEffortOption.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/SandboxMode.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/SandboxPolicy.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/TextElement.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ThreadSource.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ThreadStartParams.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ThreadStartSource.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ThreadTokenUsage.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ThreadTokenUsageUpdatedNotification.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/TokenUsageBreakdown.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ToolRequestUserInputAnswer.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/ToolRequestUserInputResponse.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/TurnInterruptParams.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/TurnStartParams.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/TurnToolOutput.js +2 -0
- package/dist/fabrica/protocolos/codex/v2/UserInput.js +2 -0
- package/dist/fabrica/rastro.js +487 -0
- package/dist/fabrica/sesion.js +230 -0
- package/dist/fabrica/tabla-modelos.json +29 -0
- package/dist/fabrica/veredictos.js +327 -0
- package/package.json +16 -8
- package/plugins/huellas.json +6 -6
- package/plugins/nexakit-lecciones/.claude-plugin/plugin.json +1 -1
- package/plugins/nexakit-lecciones/README.md +6 -5
- package/plugins/nexakit-lecciones/hooks/lecciones.js +29 -5
- package/plugins/nexakit-lecciones/hooks/register.js +7 -3
- package/plugins/nexakit-modelo/.claude-plugin/plugin.json +1 -1
- package/plugins/nexakit-modelo/hooks/barra.js +100 -4
- package/plugins/nexakit-modelo/hooks/decidir.js +2 -2
- package/plugins/nexakit-modelo/hooks/recomendar.js +1 -1
- package/plugins/nexakit-modelo/hooks/register.js +122 -7
- package/plugins/nexakit-modelo/tests/register.test.ts +301 -0
- package/plugins/niveles/.claude-plugin/plugin.json +1 -1
- package/plugins/niveles/agents/cazador-de-flakes.md +1 -0
- package/plugins/niveles/agents/cierre-de-memoria.md +1 -0
- package/plugins/niveles/agents/investigador.md +1 -0
- package/plugins/niveles/agents/nivel-alto.md +1 -0
- package/plugins/niveles/agents/nivel-exigente.md +1 -0
- package/plugins/niveles/agents/nivel-ligero.md +1 -0
- package/plugins/niveles/agents/nivel-normal.md +1 -0
- package/plugins/niveles/agents/revisor-de-calidad.md +1 -0
- package/plugins/niveles/agents/sincronizador-docs.md +1 -0
- package/plugins/niveles/agents/subir-al-repo.md +1 -0
- package/skills/elegir-modelo/SKILL.md +4 -3
- package/skills/elegir-modelo/modelos.mjs +100 -1
- package/skills/fabrica/SKILL.md +55 -0
- package/skills/gemini/SKILL.md +2 -3
- package/skills/quality-gate/SKILL.md +2 -2
- package/src/agent-models.js +6 -4
- package/src/antigravity-barra.js +64 -12
- package/src/antigravity-command.js +4 -2
- package/src/antigravity-models.js +61 -0
- package/src/antigravity-pre-tool.js +11 -3
- package/src/antigravity-recommendation.js +15 -9
- package/src/antigravity-setup.js +4 -31
- package/src/cli-executable.d.ts +11 -0
- package/src/codex-pre-tool.js +3 -3
- package/src/codex-recommendation.js +1 -2
- package/src/codex-setup.js +3 -20
- package/src/codex-team.js +31 -4
- package/src/fabrica/banco/casos.ts +315 -0
- package/src/fabrica/banco/ejecutar.ts +587 -0
- package/src/fabrica/banco/medir.ts +160 -0
- package/src/fabrica/cli.ts +781 -0
- package/src/fabrica/conectores/antigravity.ts +1090 -0
- package/src/fabrica/conectores/codex.ts +1013 -0
- package/src/fabrica/conectores/tipos.ts +54 -0
- package/src/fabrica/config.ts +43 -0
- package/src/fabrica/consolidar.ts +277 -0
- package/src/fabrica/decision.ts +285 -0
- package/src/fabrica/diff.ts +294 -0
- package/src/fabrica/disco.ts +380 -0
- package/src/fabrica/ejecutor.ts +716 -0
- package/src/fabrica/encargo/candado.ts +287 -0
- package/src/fabrica/encargo/ejecutar.ts +953 -0
- package/src/fabrica/encargo/evidencia.ts +301 -0
- package/src/fabrica/encargo/parche.ts +151 -0
- package/src/fabrica/encargo/worktree.ts +427 -0
- package/src/fabrica/enrutador.ts +494 -0
- package/src/fabrica/errores.ts +15 -0
- package/src/fabrica/esquemas.ts +92 -0
- package/src/fabrica/estaciones.ts +83 -0
- package/src/fabrica/evidencia.ts +445 -0
- package/src/fabrica/indice.ts +1 -0
- package/src/fabrica/jsonrpc.ts +314 -0
- package/src/fabrica/lecciones.ts +411 -0
- package/src/fabrica/mcp.ts +450 -0
- package/src/fabrica/preferencias.ts +66 -0
- package/src/fabrica/protocolos/codex/AbsolutePathBuf.ts +14 -0
- package/src/fabrica/protocolos/codex/ApplyPatchApprovalResponse.ts +6 -0
- package/src/fabrica/protocolos/codex/ClientInfo.ts +5 -0
- package/src/fabrica/protocolos/codex/ExecCommandApprovalParams.ts +16 -0
- package/src/fabrica/protocolos/codex/ExecCommandApprovalResponse.ts +6 -0
- package/src/fabrica/protocolos/codex/ExecPolicyAmendment.ts +12 -0
- package/src/fabrica/protocolos/codex/FunctionCallOutputBody.ts +6 -0
- package/src/fabrica/protocolos/codex/FunctionCallOutputContentItem.ts +10 -0
- package/src/fabrica/protocolos/codex/ImageDetail.ts +5 -0
- package/src/fabrica/protocolos/codex/InitializeCapabilities.ts +42 -0
- package/src/fabrica/protocolos/codex/InitializeParams.ts +7 -0
- package/src/fabrica/protocolos/codex/InitializeResponse.ts +20 -0
- package/src/fabrica/protocolos/codex/InputModality.ts +8 -0
- package/src/fabrica/protocolos/codex/LegacyAppPathString.ts +27 -0
- package/src/fabrica/protocolos/codex/NetworkPolicyAmendment.ts +6 -0
- package/src/fabrica/protocolos/codex/NetworkPolicyRuleAction.ts +5 -0
- package/src/fabrica/protocolos/codex/ParsedCommand.ts +12 -0
- package/src/fabrica/protocolos/codex/Personality.ts +8 -0
- package/src/fabrica/protocolos/codex/ReasoningEffort.ts +8 -0
- package/src/fabrica/protocolos/codex/ReasoningSummary.ts +10 -0
- package/src/fabrica/protocolos/codex/ReviewDecision.ts +10 -0
- package/src/fabrica/protocolos/codex/ThreadId.ts +10 -0
- package/src/fabrica/protocolos/codex/VERSION +1 -0
- package/src/fabrica/protocolos/codex/serde_json/JsonValue.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/AdditionalFileSystemPermissions.ts +15 -0
- package/src/fabrica/protocolos/codex/v2/AdditionalNetworkPermissions.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/ApprovalsReviewer.ts +12 -0
- package/src/fabrica/protocolos/codex/v2/AskForApproval.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/ByteRange.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/CommandAction.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/CommandExecutionApprovalDecision.ts +7 -0
- package/src/fabrica/protocolos/codex/v2/CommandExecutionApprovalKind.ts +8 -0
- package/src/fabrica/protocolos/codex/v2/CommandExecutionRequestApprovalParams.ts +51 -0
- package/src/fabrica/protocolos/codex/v2/CommandExecutionRequestApprovalResponse.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/ConfigReadParams.ts +11 -0
- package/src/fabrica/protocolos/codex/v2/CyberAccessProgram.ts +9 -0
- package/src/fabrica/protocolos/codex/v2/ExecPolicyAmendment.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/FileChangeApprovalDecision.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/FileChangeRequestApprovalResponse.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/FileSystemAccessMode.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/FileSystemPath.ts +7 -0
- package/src/fabrica/protocolos/codex/v2/FileSystemSandboxEntry.ts +7 -0
- package/src/fabrica/protocolos/codex/v2/FileSystemSpecialPath.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/GrantedPermissionProfile.ts +7 -0
- package/src/fabrica/protocolos/codex/v2/ListMcpServerStatusParams.ts +23 -0
- package/src/fabrica/protocolos/codex/v2/McpServerElicitationAction.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/McpServerElicitationRequestResponse.ts +17 -0
- package/src/fabrica/protocolos/codex/v2/McpServerStatusDetail.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/Model.ts +33 -0
- package/src/fabrica/protocolos/codex/v2/ModelAccessPrograms.ts +13 -0
- package/src/fabrica/protocolos/codex/v2/ModelAvailabilityNux.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/ModelListParams.ts +17 -0
- package/src/fabrica/protocolos/codex/v2/ModelListResponse.ts +11 -0
- package/src/fabrica/protocolos/codex/v2/ModelServiceTier.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/ModelUpgradeInfo.ts +9 -0
- package/src/fabrica/protocolos/codex/v2/MultiAgentVersion.ts +8 -0
- package/src/fabrica/protocolos/codex/v2/NetworkAccess.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/NetworkApprovalContext.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/NetworkApprovalProtocol.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/NetworkPolicyAmendment.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/NetworkPolicyRuleAction.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/PermissionGrantScope.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/PermissionsRequestApprovalResponse.ts +11 -0
- package/src/fabrica/protocolos/codex/v2/ReasoningEffortOption.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/SandboxMode.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/SandboxPolicy.ts +7 -0
- package/src/fabrica/protocolos/codex/v2/TextElement.ts +14 -0
- package/src/fabrica/protocolos/codex/v2/ThreadSource.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/ThreadStartParams.ts +22 -0
- package/src/fabrica/protocolos/codex/v2/ThreadStartSource.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/ThreadTokenUsage.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/ThreadTokenUsageUpdatedNotification.ts +6 -0
- package/src/fabrica/protocolos/codex/v2/TokenUsageBreakdown.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/ToolRequestUserInputAnswer.ts +8 -0
- package/src/fabrica/protocolos/codex/v2/ToolRequestUserInputResponse.ts +9 -0
- package/src/fabrica/protocolos/codex/v2/TurnInterruptParams.ts +5 -0
- package/src/fabrica/protocolos/codex/v2/TurnStartParams.ts +75 -0
- package/src/fabrica/protocolos/codex/v2/TurnToolOutput.ts +10 -0
- package/src/fabrica/protocolos/codex/v2/UserInput.ts +11 -0
- package/src/fabrica/rastro.ts +508 -0
- package/src/fabrica/sesion.ts +280 -0
- package/src/fabrica/tabla-modelos.json +29 -0
- package/src/fabrica/veredictos.ts +365 -0
- package/src/gemini-cli.js +15 -12
- package/src/gemini-tools.js +1 -1
- package/src/gemini-usage-store.js +32 -0
- package/src/instructions-block.js +69 -0
- package/src/lecciones-command.js +105 -4
- package/src/lecciones-instructions.js +178 -0
- package/src/legacy-repair.js +1 -1
- package/src/level-agents.js +5 -3
- package/src/memory-mcp-policy.js +1 -1
- package/src/missing-dependencies.js +5 -0
- package/src/model-command.d.ts +29 -0
- package/src/model-command.js +4 -27
- package/src/regla-ordenes-simples.d.ts +2 -0
- package/src/regla-ordenes-simples.js +4 -0
- package/src/review-instructions.js +69 -81
- package/src/safe-paths.js +38 -0
- package/src/setup-apply.js +24 -2
- package/src/setup-plan.js +57 -1
- package/src/setup-state.js +14 -0
- package/src/shell-quote.js +2 -0
- package/src/skill-recommendations.js +101 -28
- package/src/stable-command.js +2 -2
- package/src/stable-install.js +4 -2
- package/src/superpowers.js +0 -7
- package/src/task-document.js +59 -0
- package/src/terminal-text.js +2 -19
- package/src/toolkit-cli.js +63 -8
- package/src/toolkit-setup.js +192 -37
- package/templates/agent-team/README.md +7 -19
- package/bin/agent-task.js +0 -14
- package/bin/agent-toolkit-inbox.js +0 -14
- package/bin/agent-toolkit-mcp.js +0 -17
- package/schemas/agent-client-adapter.schema.json +0 -786
- package/schemas/agent-client-auth-diagnostic.schema.json +0 -801
- package/schemas/agent-client-isolated-variant.schema.json +0 -105
- package/schemas/agent-client-isolated-verification.schema.json +0 -99
- package/schemas/agent-client-managed-preferences-invocation.schema.json +0 -67
- package/schemas/agent-client-managed-preferences.schema.json +0 -63
- package/schemas/agent-client-native-diagnostics.schema.json +0 -85
- package/schemas/agent-client-native-evaluation.schema.json +0 -171
- package/schemas/agent-client-native-preflight.schema.json +0 -90
- package/schemas/agent-client-output.schema.json +0 -551
- package/schemas/agent-client-runtime-fixture.schema.json +0 -90
- package/schemas/agent-client-runtime-local.schema.json +0 -95
- package/schemas/agent-client-runtime.schema.json +0 -1288
- package/schemas/agent-client-selective-config.schema.json +0 -77
- package/schemas/agent-client-supervised-local.schema.json +0 -135
- package/schemas/agent-client-supervised.schema.json +0 -186
- package/schemas/agent-task-approvals.schema.json +0 -362
- package/schemas/agent-task-prepare.schema.json +0 -1324
- package/schemas/agent-task-verify.schema.json +0 -198
- package/schemas/task-workflow-plan-output.schema.json +0 -35
- package/skills/revisar/SKILL.md +0 -51
- package/src/claude-code-runner.js +0 -642
- package/src/client-adapter-plan.js +0 -271
- package/src/client-auth-diagnostic-parser.js +0 -211
- package/src/client-auth-diagnostic.js +0 -257
- package/src/client-isolated-variant.js +0 -106
- package/src/client-isolated-verification.js +0 -130
- package/src/client-local-platform.js +0 -14
- package/src/client-managed-preferences-invocation.js +0 -209
- package/src/client-managed-preferences.js +0 -78
- package/src/client-native-access.js +0 -134
- package/src/client-native-diagnostics.js +0 -253
- package/src/client-native-evaluation.js +0 -106
- package/src/client-native-preflight-files.js +0 -68
- package/src/client-native-preflight.js +0 -95
- package/src/client-output-parser.js +0 -278
- package/src/client-runtime-admission.js +0 -80
- package/src/client-runtime-coordinator.js +0 -70
- package/src/client-runtime-core.js +0 -92
- package/src/client-runtime-fixture-permit.js +0 -20
- package/src/client-runtime-fixture-protocol.js +0 -39
- package/src/client-runtime-state.js +0 -67
- package/src/client-runtime-store-files.js +0 -91
- package/src/client-runtime-store.js +0 -239
- package/src/client-runtime-supervisor.js +0 -146
- package/src/client-selective-config.js +0 -195
- package/src/client-selective-files.js +0 -126
- package/src/client-supervised-codes.js +0 -32
- package/src/client-supervised-contract.js +0 -52
- package/src/client-supervised-coordinator.js +0 -36
- package/src/client-supervised-permit.js +0 -20
- package/src/client-supervised-protocol.js +0 -37
- package/src/client-supervised-store.js +0 -167
- package/src/client-supervised-supervisor.js +0 -167
- package/src/client-supervised.js +0 -160
- package/src/codex-cli-runner.js +0 -358
- package/src/codex-delivery.js +0 -101
- package/src/memory-connection-artifacts.js +0 -192
- package/src/memory-connection-descriptor.js +0 -158
- package/src/memory-connection-diagnostic.js +0 -177
- package/src/memory-connection-files.js +0 -191
- package/src/memory-connection-manifest.js +0 -118
- package/src/memory-connection-package.js +0 -176
- package/src/memory-connection-plan.js +0 -217
- package/src/memory-connection-skill.js +0 -211
- package/src/memory-connection-toml.js +0 -153
- package/src/native/managed-preferences.c +0 -100
- package/src/native/managed-preferences.h +0 -17
- package/src/package-lock-path.js +0 -13
- package/src/peer-handoff.js +0 -27
- package/src/peer-inbox-cli.js +0 -211
- package/src/peer-review-mcp.js +0 -210
- package/src/peer-review-store.js +0 -532
- package/src/review-policy.js +0 -35
- package/src/revision-adapters.js +0 -158
- package/src/revision-context.js +0 -86
- package/src/revision-isolation.js +0 -222
- package/src/revision-process.js +0 -103
- package/src/revision-provenance.js +0 -89
- package/src/revision-snapshot.js +0 -120
- package/src/revision.js +0 -242
- package/src/runtime-fixtures/runtime-supervisor/child.cjs +0 -3
- package/src/runtime-fixtures/runtime-supervisor/fixture.cjs +0 -49
- package/src/runtime-fixtures/supervised/child.cjs +0 -3
- package/src/runtime-fixtures/supervised/fixture.cjs +0 -47
- package/src/task-approvals.js +0 -367
- package/src/task-cli.js +0 -79
- package/src/task-external-verifier.js +0 -584
- package/src/task-prepare-files.js +0 -115
- package/src/task-prepare.js +0 -180
- package/src/task-verify-cli.js +0 -67
- package/src/task-verify-files.js +0 -188
- package/src/task-verify.js +0 -118
- package/src/task-workflow-mcp.js +0 -544
- package/src/task-workflow-store.js +0 -254
- package/src/toolkit-commands-guide.js +0 -115
package/src/model-command.js
CHANGED
|
@@ -3,18 +3,17 @@ import path from 'node:path';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { getStaticTOMLValue, parseTOML } from 'toml-eslint-parser';
|
|
5
5
|
import { agentModels, familyOfModel } from './agent-models.js';
|
|
6
|
-
import {
|
|
7
|
-
import { runRevisionProcess } from './revision-process.js';
|
|
6
|
+
import { listAntigravityModels } from './antigravity-models.js';
|
|
8
7
|
import pkg from '../package.json' with { type: 'json' };
|
|
9
8
|
|
|
10
9
|
const ANTIGRAVITY_FAMILIES_BY_LEVEL = {
|
|
11
10
|
Ligero: ['flash', 'hydrogen'],
|
|
12
11
|
Normal: ['hydrogen', 'flash'],
|
|
13
|
-
Exigente: ['hydrogen', '
|
|
12
|
+
Exigente: ['hydrogen', 'flash', 'argon'],
|
|
14
13
|
Alto: ['carbon', 'argon'],
|
|
15
14
|
};
|
|
16
15
|
|
|
17
|
-
function recommendAntigravity(models, { level, effort }) {
|
|
16
|
+
export function recommendAntigravity(models, { level, effort }) {
|
|
18
17
|
const variants = models.filter(({ model, efforts }) => model.startsWith('gemini-') && efforts.includes(effort));
|
|
19
18
|
for (const family of ANTIGRAVITY_FAMILIES_BY_LEVEL[level]) {
|
|
20
19
|
const match = variants.find(({ model }) => familyOfModel(model) === family);
|
|
@@ -68,29 +67,7 @@ export async function inspectModels({
|
|
|
68
67
|
}
|
|
69
68
|
let antigravity = [],
|
|
70
69
|
error = null;
|
|
71
|
-
if (includeAntigravity) {
|
|
72
|
-
try {
|
|
73
|
-
let result;
|
|
74
|
-
if (runCommand) result = await runCommand('agy', ['models']);
|
|
75
|
-
else {
|
|
76
|
-
const cli = await resolveCliInvocation({ name: 'agy', environment });
|
|
77
|
-
result = await runRevisionProcess(
|
|
78
|
-
{ executable: cli.executable, args: [...cli.argsPrefix, 'models'], env: environment },
|
|
79
|
-
{ prompt: '', timeoutMs: 20000 },
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
if (result.status !== 0 || result.timedOut) throw new Error('No se pudo consultar agy models.');
|
|
83
|
-
antigravity = result.stdout.split('\n').flatMap((line) => {
|
|
84
|
-
const [model, label] = line.split('\t');
|
|
85
|
-
const effort = model?.match(/-(low|medium|high|xhigh|max)$/u)?.[1];
|
|
86
|
-
return model && label && effort
|
|
87
|
-
? [{ model, description: label, efforts: [effort], defaultEffort: effort }]
|
|
88
|
-
: [];
|
|
89
|
-
});
|
|
90
|
-
} catch (e) {
|
|
91
|
-
error = e.message;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
70
|
+
if (includeAntigravity) ({ models: antigravity, error } = await listAntigravityModels({ environment, runCommand }));
|
|
94
71
|
const codex = old.codex.models.map((item) => ({
|
|
95
72
|
...item,
|
|
96
73
|
defaultEffort: cache.models?.find((m) => m.slug === item.model)?.default_reasoning_level ?? null,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Regla común de los subagentes con shell: las órdenes que Claude Code no puede analizar (cd encadenado, `;`,
|
|
2
|
+
// paréntesis, subshells) hacen que pida permiso en cada llamada. Los agentes de plugins/niveles/agents/*.md
|
|
3
|
+
// llevan este mismo texto (lo comprueba test/regla-ordenes-simples.test.js); Codex lo recibe desde aquí.
|
|
4
|
+
export const REGLA_ORDENES_SIMPLES = 'Una orden por llamada al shell. Usa rutas absolutas en lugar de `cd`. No encadenes con `;`, `&&` ni `||`, y no uses paréntesis ni subshells `( … )`. Un `|` hacia `head`, `tail` o `grep` está permitido. Para leer y buscar, usa las herramientas de lectura y búsqueda en lugar de `cat`, `grep` o `ls` cuando existan. Las llamadas independientes se lanzan en paralelo, no encadenadas.';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { targets, readText, checkParent, proof as readProof, blockOf as findBlock, writeAtomic, hash } from './instructions-block.js';
|
|
4
4
|
const START = '<!-- nexakit:review:start -->',
|
|
5
5
|
END = '<!-- nexakit:review:end -->';
|
|
6
|
+
const proofPath = (home) => path.join(home, '.nexakit', 'review-instructions.json');
|
|
7
|
+
const proof = (home) => readProof(proofPath(home));
|
|
8
|
+
const blockOf = (text) => findBlock(text, START, END);
|
|
6
9
|
const BODY = `${START}
|
|
7
10
|
# Método de trabajo de nexakit
|
|
8
11
|
|
|
@@ -10,95 +13,71 @@ Para programar sigue el proceso de Superpowers (obligatorio): contexto y
|
|
|
10
13
|
memoria, diseño y plan proporcionales, rama, pruebas, implementación,
|
|
11
14
|
verificación y cierre con memoria. No hace falta un comando para empezar.
|
|
12
15
|
Sobre sus skills mandan: no borrar código existente sin acuerdo aunque el TDD
|
|
13
|
-
lo pida;
|
|
16
|
+
lo pida; commits locales en ramas de trabajo sin pedir permiso; push, PR,
|
|
17
|
+
fusión y memoria solo con autorización. Reutiliza un diseño
|
|
14
18
|
o plan ya aprobado. Antes de un PR, quality-gate. Modo tutor (la persona
|
|
15
19
|
escribe el código, un paso verificable cada vez) solo si lo pide.
|
|
16
20
|
|
|
17
21
|
Orquesta: tú entiendes, planificas, decides e integras; delega la ejecución en
|
|
18
22
|
subagentes de nivel (Claude: niveles:nivel-<nivel>; Codex: nivel_<nivel>; Antigravity: nivel-<nivel>):
|
|
19
|
-
ligero para comandos, búsquedas y
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
ligero para comandos, búsquedas y lecturas; exigente para pruebas, casos borde
|
|
24
|
+
o un fallo acotado; alto para un fallo sutil, seguridad o lo que exigente no
|
|
25
|
+
resolvió. Implementar con diseño claro (normal) y los cambios mecánicos de
|
|
26
|
+
código (ligero) no van a un subagente: se encargan primero, como dice el párrafo
|
|
27
|
+
siguiente. Trabaja tú solo lo que se hace en uno o dos pasos y la conversación
|
|
28
|
+
con la persona. Da a cada subagente un encargo autocontenido (objetivo, archivos,
|
|
29
|
+
criterio de hecho), lanza en paralelo los independientes y comprueba su informe
|
|
30
|
+
antes de darlo por bueno. Si el encargo necesita el mismo contexto que ya llevas, bifurca la
|
|
26
31
|
sesión (fork) en vez de crear un subagente nuevo. Usa elegir-modelo para nombres reales; nunca cambies el modelo de
|
|
27
32
|
la sesión por tu cuenta. Sin subagentes de nivel, trabaja tú.
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
(
|
|
31
|
-
~/.nexakit/nexakit
|
|
34
|
+
Encargos: implementar con diseño claro (normal) y los cambios mecánicos de
|
|
35
|
+
código (ligero) se hacen PRIMERO, sin preguntar, con fabrica_encargar (o
|
|
36
|
+
~/.nexakit/nexakit encargar) en Codex o Antigravity: trabajan en una copia
|
|
37
|
+
aislada y devuelven un diff. Usa niveles:nivel-normal solo si el encargo no es
|
|
38
|
+
posible (repo sin commits, otro encargo o recorrido en marcha, sin conector) o
|
|
39
|
+
ya falló, y entonces pon [sin encargo] en la descripción del subagente. Los
|
|
40
|
+
encargos van de uno en uno: no los sustituyas por subagentes para paralelizar;
|
|
41
|
+
mientras corre uno, prepara el siguiente o revisa. Revisas diff y resumen, lo
|
|
42
|
+
aplicas, pruebas e integras; si falla, lo resuelves con Claude. Lo exigente,
|
|
43
|
+
alto, de seguridad o de contexto largo sigue con subagentes de Claude. Revisa
|
|
44
|
+
el diff con al menos una IA distinta de la que lo escribió. No edites el repo
|
|
45
|
+
mientras corre un encargo. Informa en una línea qué IA hizo cada encargo;
|
|
46
|
+
--ordenes, con permiso de la persona (en Codex solo orientan).
|
|
47
|
+
Tras integrar o descartar un encargo, valóralo con fabrica_valorar_encargo
|
|
48
|
+
(aplicado, corregido o descartado).
|
|
49
|
+
|
|
50
|
+
La fábrica (revisión con varias IA) la lanzas tú, sin pedir permiso: al cerrar
|
|
51
|
+
una tarea con cambios de código y siempre antes de proponer o crear un PR, con
|
|
52
|
+
fabrica_proponer y después fabrica_lanzar con la huella de esa propuesta; sigue
|
|
53
|
+
la skill fabrica. Lee el resultado, corrige los hallazgos reales y registra los
|
|
54
|
+
veredictos, reales y falsos. Si el diff es trivial (solo documentación o pocas
|
|
55
|
+
líneas sin lógica), omítela y dilo en una línea. Si no hay servidor ni orden, o
|
|
56
|
+
falla, dilo en una línea y sigue: nunca bloquea el trabajo. Salvo que el recorrido
|
|
57
|
+
traiga órdenes del repo revisado (.nexakit/fabrica.json): entonces pide
|
|
58
|
+
aprobación. La persona también puede pedirla con /fabrica. Usa la orden estable ~/.nexakit/nexakit (Windows:
|
|
59
|
+
nexakit.cmd en esa carpeta).
|
|
32
60
|
|
|
33
61
|
Si una tarea larga queda a medias —pausa, cambio de IA, bloqueo o cierre— escribe o actualiza la nota de seguimiento con project-handoff; recomienda sesión nueva en los casos de project-handoff, y cierra el seguimiento al integrar con cerrar-memoria.
|
|
34
62
|
${END}`;
|
|
35
63
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const stat = await fs.lstat(file);
|
|
54
|
-
if (!stat.isFile() || stat.isSymbolicLink() || stat.size > 1024 * 1024)
|
|
55
|
-
throw new Error('Archivo de instrucciones o registro en conflicto.');
|
|
56
|
-
return await fs.readFile(file, 'utf8');
|
|
57
|
-
} catch (error) {
|
|
58
|
-
if (error.code === 'ENOENT') return null;
|
|
59
|
-
throw error;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async function checkParent(directory, create = false) {
|
|
63
|
-
const info = await fs.lstat(directory).catch((error) => {
|
|
64
|
-
if (error.code === 'ENOENT') return null;
|
|
65
|
-
throw error;
|
|
66
|
-
});
|
|
67
|
-
if (info && (!info.isDirectory() || info.isSymbolicLink()))
|
|
68
|
-
throw new Error('La carpeta de instrucciones o registro no es normal.');
|
|
69
|
-
if (!info && create) await fs.mkdir(directory, { recursive: true, mode: 0o700 });
|
|
70
|
-
}
|
|
71
|
-
async function proof(home) {
|
|
72
|
-
await checkParent(path.dirname(proofPath(home)));
|
|
73
|
-
const text = await readText(proofPath(home));
|
|
74
|
-
if (text === null) return {};
|
|
75
|
-
const records = JSON.parse(text);
|
|
76
|
-
if (!records || typeof records !== 'object' || Array.isArray(records))
|
|
77
|
-
throw new Error('Registro de instrucciones inválido.');
|
|
78
|
-
return records;
|
|
79
|
-
}
|
|
80
|
-
function blockOf(text) {
|
|
81
|
-
const a = text?.indexOf(START) ?? -1,
|
|
82
|
-
b = text?.indexOf(END) ?? -1;
|
|
83
|
-
if (a < 0 || b <= a || text.indexOf(START, a + START.length) >= 0 || text.indexOf(END, b + END.length) >= 0)
|
|
84
|
-
return null;
|
|
85
|
-
return text.slice(a, b + END.length);
|
|
86
|
-
}
|
|
87
|
-
async function writeAtomic(target, text, lock) {
|
|
88
|
-
await lock.assertHeld();
|
|
89
|
-
const stat = await fs.lstat(target).catch((error) => {
|
|
90
|
-
if (error.code === 'ENOENT') return null;
|
|
91
|
-
throw error;
|
|
92
|
-
});
|
|
93
|
-
const tmp = target + '.' + randomUUID();
|
|
94
|
-
await fs.writeFile(tmp, text, { flag: 'wx', mode: stat?.mode ?? 0o600 });
|
|
95
|
-
try {
|
|
96
|
-
await lock.assertHeld();
|
|
97
|
-
await fs.rename(tmp, target);
|
|
98
|
-
} finally {
|
|
99
|
-
await fs.rm(tmp, { force: true });
|
|
100
|
-
}
|
|
101
|
-
}
|
|
64
|
+
// SHA-256 of every block earlier versions of nexakit installed (from the history of this file), newest first. A block
|
|
65
|
+
// that matches one of them was written by nexakit even without its record in review-instructions.json, so it is
|
|
66
|
+
// replaced by the current one; any other text between the marks was edited by the person and is never touched.
|
|
67
|
+
const PREVIOUS_BODY_HASHES = new Set([
|
|
68
|
+
'9dea7d74a38ec4d4cd182e4dddb629e1cdc2d54a8eea049ea2aa31148119ce69', // b7e38ef: encargos en orden estricto
|
|
69
|
+
'0fbb927e1b8089c7d909699b0af48cc5308f2df1724f88158311b1969e0a2f98', // e673ad5: encargos primero (versión anterior al orden estricto)
|
|
70
|
+
'fec51a0095eaa4cf17b9c56fb4fb05d517ae44f15765ff19c9f19c1fb4dfc2f5', // 76502d3: fábrica autónoma sin aprobación previa
|
|
71
|
+
'68e39f959703ca1ae9523000206f25eee623d5461d92e1b5432d88715f6ca7e3', // b0fe4d4: fábrica autónoma al cerrar tareas
|
|
72
|
+
'986f429cf9e0625cc45d0ea1afb02ed45fe9c359ef1e32897b387dbb21bc1dde', // b42b5bf: fábrica solo a petición
|
|
73
|
+
'f1d67fb2be192ddcade136409ee59302e926c6bf41c883f6125ffb8075be41d5', // 3fa5d18: Antigravity en la orquesta
|
|
74
|
+
'b02861cef24be0e67afc1870d829f375ab752980babc30a98fa187736a5247a4', // f151a93: revisión bajo demanda e informes breves
|
|
75
|
+
'7f5be5b768fa60fcb785fae74492271772e4befcadf5e3d5dc60ba8203062391', // f3b8bca: subagentes de nivel
|
|
76
|
+
'f564df4f5f8bf8163a916261ed6fae969b66f58104cc8a03140027b1eb1da0fa', // 043432b: Superpowers obligatorio
|
|
77
|
+
'4841d522765b5630d1c8c079fb5bc0c3d6e687e937bae7654a4a020b3e684a2e', // c4761ab: traspaso y cierre
|
|
78
|
+
'a59f9d7f20e328a0e990566dee78e9fe90623598bc8bd85eb593808217aae123', // d815d60: revisión certificada
|
|
79
|
+
'b9ed8e99a370f760c46574fa0e1854768d35498eb70fc619337851843d97c32a', // d73e44a: revisión por sesión
|
|
80
|
+
]);
|
|
102
81
|
export async function planReviewInstructions(options = {}) {
|
|
103
82
|
const owned = await proof(options.homeDirectory),
|
|
104
83
|
items = [];
|
|
@@ -113,19 +92,28 @@ export async function planReviewInstructions(options = {}) {
|
|
|
113
92
|
}
|
|
114
93
|
const block = blockOf(before),
|
|
115
94
|
record = owned[item.target];
|
|
116
|
-
if (
|
|
95
|
+
if (before?.includes(START) && !block) {
|
|
117
96
|
items.push({ ...item, state: 'conflict' });
|
|
118
97
|
continue;
|
|
119
98
|
}
|
|
99
|
+
const blockHash = block && hash(block);
|
|
100
|
+
if (block && record?.blockHash !== blockHash && blockHash !== hash(BODY) && !PREVIOUS_BODY_HASHES.has(blockHash)) {
|
|
101
|
+
items.push({ ...item, state: 'conflict', reason: 'editado' });
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
120
104
|
const prefix = before === null ? '' : before.endsWith('\n') ? before + '\n' : before + '\n\n';
|
|
121
105
|
const after = block ? before.replace(block, BODY) : prefix + BODY + '\n';
|
|
106
|
+
// Without a record the block was recognized by its hash: what preceded it is unknown, so a later removal only
|
|
107
|
+
// takes the block out.
|
|
108
|
+
const known = record?.blockHash === blockHash || !block;
|
|
122
109
|
items.push({
|
|
123
110
|
...item,
|
|
124
111
|
before,
|
|
125
112
|
after,
|
|
126
113
|
state: after === before ? 'ready' : 'pending',
|
|
127
|
-
|
|
128
|
-
|
|
114
|
+
...(block && after !== before && { update: true }),
|
|
115
|
+
original: !known ? null : record ? record.original : before,
|
|
116
|
+
created: !known ? false : record ? record.created : before === null,
|
|
129
117
|
});
|
|
130
118
|
}
|
|
131
119
|
return { homeDirectory: options.homeDirectory, items };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
async function isDarwinSystemLink(current) {
|
|
5
|
+
if (process.platform !== 'darwin' || (current !== '/tmp' && current !== '/var')) return false;
|
|
6
|
+
return (await fs.realpath(current).catch(() => null)) === `/private${current}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Rechaza destinos con enlaces simbólicos en el propio destino o en sus ancestros.
|
|
11
|
+
* Con `allowDarwinSystemLinks` se toleran los enlaces de sistema de macOS (`/tmp` y `/var` hacia `/private`).
|
|
12
|
+
*/
|
|
13
|
+
export async function assertNoSymlinkAncestors(destination, { allowDarwinSystemLinks = false } = {}) {
|
|
14
|
+
const systemLink = async (current) => allowDarwinSystemLinks && isDarwinSystemLink(current);
|
|
15
|
+
let current = destination;
|
|
16
|
+
while (true) {
|
|
17
|
+
try {
|
|
18
|
+
const stat = await fs.lstat(current);
|
|
19
|
+
if (stat.isSymbolicLink() && !(await systemLink(current))) {
|
|
20
|
+
throw new Error('No se admiten enlaces simbólicos en el destino.');
|
|
21
|
+
}
|
|
22
|
+
if (current !== destination && !stat.isDirectory() && !(await systemLink(current))) {
|
|
23
|
+
throw new Error('El padre no es una carpeta.');
|
|
24
|
+
}
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (error.code !== 'ENOENT') throw error;
|
|
27
|
+
}
|
|
28
|
+
const parent = path.dirname(current);
|
|
29
|
+
if (parent === current) break;
|
|
30
|
+
current = parent;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Indica si `destination` es `root` o queda dentro de él. */
|
|
35
|
+
export const within = (root, destination) => {
|
|
36
|
+
const relative = path.relative(path.resolve(root), destination);
|
|
37
|
+
return relative === '' || (!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative));
|
|
38
|
+
};
|
package/src/setup-apply.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { planReviewInstructions, applyReviewInstructions } from './review-instructions.js';
|
|
2
|
+
import { planLeccionesInstructions, applyLeccionesInstructions } from './lecciones-instructions.js';
|
|
2
3
|
// Applies the confirmation, block by block, in the fixed order of setup-plan.js. The state is gathered again right
|
|
3
4
|
// before applying, so what changed meanwhile is respected. The first block that fails stops the run: what was
|
|
4
5
|
// applied stays, nothing is undone, and running `npx nexakit` again resumes from the real state.
|
|
@@ -20,7 +21,8 @@ import {
|
|
|
20
21
|
} from './skill-recommendations.js';
|
|
21
22
|
import { planStableCommand, writeStableCommand } from './stable-command.js';
|
|
22
23
|
import { ensureStableInstall, nexakitDir } from './stable-install.js';
|
|
23
|
-
import { packageVersion, setupToolkit } from './toolkit-setup.js';
|
|
24
|
+
import { applyFabricaMcp, packageVersion, setupToolkit } from './toolkit-setup.js';
|
|
25
|
+
import { staleTeamMarks, teamPlan, writeTeam } from './codex-team.js';
|
|
24
26
|
import { applyMod } from './mods.js';
|
|
25
27
|
import { applySuperpowers } from './superpowers.js';
|
|
26
28
|
|
|
@@ -144,6 +146,22 @@ export async function applySetup(
|
|
|
144
146
|
});
|
|
145
147
|
await applyReviewInstructions(plan, lock);
|
|
146
148
|
}),
|
|
149
|
+
'lecciones-instructions': () =>
|
|
150
|
+
withLock(homeDirectory, acquire, async (lock) => {
|
|
151
|
+
const plan = await planLeccionesInstructions({
|
|
152
|
+
homeDirectory,
|
|
153
|
+
environment,
|
|
154
|
+
codexHome,
|
|
155
|
+
agents: answers.agents,
|
|
156
|
+
});
|
|
157
|
+
await applyLeccionesInstructions(plan, lock);
|
|
158
|
+
}),
|
|
159
|
+
// Only the profiles proven again right now (old mark, same content) are rewritten; writeTeam keeps the old file.
|
|
160
|
+
'codex-agents': async () => {
|
|
161
|
+
const plan = await teamPlan({ codexHome });
|
|
162
|
+
const { migrable } = await staleTeamMarks(plan);
|
|
163
|
+
if (migrable.length) await writeTeam(plan, { update: true, names: migrable });
|
|
164
|
+
},
|
|
147
165
|
'memory-init': async () => {
|
|
148
166
|
const report = initializeMemory({
|
|
149
167
|
destination: memoryPath,
|
|
@@ -197,6 +215,9 @@ export async function applySetup(
|
|
|
197
215
|
acquire,
|
|
198
216
|
});
|
|
199
217
|
}
|
|
218
|
+
if (kind === 'fabrica-mcp') {
|
|
219
|
+
return applyFabricaMcp(agent, { homeDirectory, toolkitRoot, environment, codexHome, ...(runCommand && { runCommand }) });
|
|
220
|
+
}
|
|
200
221
|
if (kind === 'superpowers') {
|
|
201
222
|
return applySuperpowers(agent, state.superpowers?.[agent], { environment, ...(runCommand && { runCommand }) });
|
|
202
223
|
}
|
|
@@ -234,7 +255,8 @@ export async function applySetup(
|
|
|
234
255
|
// Superpowers comes from each agent's own marketplace: when that fails, the memory, the rules and the other
|
|
235
256
|
// agents are still worth leaving ready. The run ends as not ready and the final check lists it as pending.
|
|
236
257
|
// The mods come from the same kind of plugin marketplace: one that fails does not stop the rest either.
|
|
237
|
-
|
|
258
|
+
// The same for the MCP of the fábrica: the agent keeps its old MCP and the final check lists it as pending.
|
|
259
|
+
if (id.startsWith('superpowers:') || id.startsWith('mod:') || id.startsWith('fabrica-mcp:')) {
|
|
238
260
|
skipped.push({ id, message });
|
|
239
261
|
continue;
|
|
240
262
|
}
|
package/src/setup-plan.js
CHANGED
|
@@ -193,6 +193,41 @@ export function buildConfirmation(state, answers) {
|
|
|
193
193
|
}
|
|
194
194
|
for (const agent of globalBlocks) block(`global-skills:${agent}`, `Skills base en ${AGENT_NAMES[agent]}`);
|
|
195
195
|
|
|
196
|
+
// The MCP of the fábrica, with the agent's own CLI: registered or repaired, and the old MCP of an older install
|
|
197
|
+
// removed once nexakit-fabrica works.
|
|
198
|
+
for (const agent of agents) {
|
|
199
|
+
const action = state.fabricaMcp?.[agent];
|
|
200
|
+
if (!action) continue;
|
|
201
|
+
const name = AGENT_NAMES[agent];
|
|
202
|
+
if (action.bloqueado) {
|
|
203
|
+
const why = action.bloqueado === 'disabled' ? 'está desactivado' : 'es otro servidor';
|
|
204
|
+
add('!', `nexakit-fabrica ${why} en ${name}; no lo toco ni retiro el MCP antiguo ${action.antiguo}`);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (!state.agentsFound[agent]) {
|
|
208
|
+
if (action.retirar || action.reparar) add('!', `No encontré ${name}; no puedo preparar nexakit-fabrica en esa IA`);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (action.retirar) add('−', `Retirar el MCP antiguo ${action.retirar} de ${name}`);
|
|
212
|
+
if (action.registrar) add('+', `Registrar nexakit-fabrica en ${name}`);
|
|
213
|
+
if (action.reparar) add('↻', `Reparar nexakit-fabrica en ${name}`);
|
|
214
|
+
block(`fabrica-mcp:${agent}`, `MCP de la fábrica en ${name}`);
|
|
215
|
+
}
|
|
216
|
+
// Codex profiles nexakit wrote with an old mark: the same content is brought up to date, other content is not.
|
|
217
|
+
const codexAgents = agents.includes('codex') ? state.codexAgents : null;
|
|
218
|
+
if (codexAgents?.migrable.length) {
|
|
219
|
+
const count = codexAgents.migrable.length;
|
|
220
|
+
add('↻', `Actualizar la marca de ${count} ${plural(count, 'agente', 'agentes')} de Codex`);
|
|
221
|
+
block('codex-agents', 'Marca de los agentes de Codex');
|
|
222
|
+
}
|
|
223
|
+
if (codexAgents?.different.length) {
|
|
224
|
+
const count = codexAgents.different.length;
|
|
225
|
+
add(
|
|
226
|
+
'!',
|
|
227
|
+
`${count} ${plural(count, 'agente de Codex lleva', 'agentes de Codex llevan')} la marca antigua y otro contenido; no ${plural(count, 'lo', 'los')} toco (nexakit codex agentes --apply --actualizar)`,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
196
231
|
// Superpowers is required: the work process (brainstorming, plans, debugging, TDD, verification) comes from it.
|
|
197
232
|
const superpowers = state.superpowers ?? {};
|
|
198
233
|
const activeIn = [];
|
|
@@ -284,7 +319,12 @@ export function buildConfirmation(state, answers) {
|
|
|
284
319
|
instructionNames.has(item.name),
|
|
285
320
|
);
|
|
286
321
|
for (const item of instructionItems.filter((item) => item.state === 'conflict'))
|
|
287
|
-
add(
|
|
322
|
+
add(
|
|
323
|
+
'!',
|
|
324
|
+
item.reason === 'editado'
|
|
325
|
+
? `${item.name}: el bloque de nexakit está editado a mano; no lo toco`
|
|
326
|
+
: `${item.name}: las instrucciones existentes no se pueden actualizar; no las toco`,
|
|
327
|
+
);
|
|
288
328
|
const pendingInstructions = instructionItems.filter((item) => item.state === 'pending');
|
|
289
329
|
if (pendingInstructions.length) {
|
|
290
330
|
add(
|
|
@@ -293,6 +333,22 @@ export function buildConfirmation(state, answers) {
|
|
|
293
333
|
);
|
|
294
334
|
block('review-instructions', 'Reglas de trabajo de tus IA');
|
|
295
335
|
}
|
|
336
|
+
const leccionItems = (state.leccionesInstructions?.items ?? []).filter((item) => instructionNames.has(item.name));
|
|
337
|
+
for (const item of leccionItems.filter((item) => item.state === 'conflict'))
|
|
338
|
+
add(
|
|
339
|
+
'!',
|
|
340
|
+
item.reason === 'editado'
|
|
341
|
+
? `${item.name}: el bloque de lecciones de nexakit está editado a mano; no lo toco`
|
|
342
|
+
: `${item.name}: no se pueden compartir las lecciones; no lo toco`,
|
|
343
|
+
);
|
|
344
|
+
const pendingLecciones = leccionItems.filter((item) => item.state === 'pending');
|
|
345
|
+
if (pendingLecciones.length) {
|
|
346
|
+
add(
|
|
347
|
+
pendingLecciones.every((item) => item.remove) ? '−' : pendingLecciones.every((item) => item.update) ? '↻' : '+',
|
|
348
|
+
`Lecciones de nexakit en tus instrucciones de ${joinNames(pendingLecciones.map((item) => AGENT_NAMES[item.client]))}`,
|
|
349
|
+
);
|
|
350
|
+
block('lecciones-instructions', 'Lecciones compartidas con tus IA');
|
|
351
|
+
}
|
|
296
352
|
if (answersChanged && (blocks.length || state.savedAnswers)) {
|
|
297
353
|
// Saved first, before any block that can fail, so a retry starts from what the person decided.
|
|
298
354
|
blocks.unshift({ id: 'answers', label: 'Respuestas guardadas' });
|
package/src/setup-state.js
CHANGED
|
@@ -7,6 +7,7 @@ import { readCleanProjectAnswers } from './skill-recommendations.js';
|
|
|
7
7
|
import fs from 'node:fs/promises';
|
|
8
8
|
import os from 'node:os';
|
|
9
9
|
import { planReviewInstructions } from './review-instructions.js';
|
|
10
|
+
import { planLeccionesInstructions } from './lecciones-instructions.js';
|
|
10
11
|
import path from 'node:path';
|
|
11
12
|
import { pathToFileURL } from 'node:url';
|
|
12
13
|
import { connectMemory } from './connect.js';
|
|
@@ -30,6 +31,7 @@ import {
|
|
|
30
31
|
import { planStableCommand } from './stable-command.js';
|
|
31
32
|
import { inspectMods } from './mods.js';
|
|
32
33
|
import { inspectSuperpowers } from './superpowers.js';
|
|
34
|
+
import { teamMarks } from './codex-team.js';
|
|
33
35
|
import { compareVersions, readActualVersion } from './stable-install.js';
|
|
34
36
|
import {
|
|
35
37
|
TOOLKIT_ROOT,
|
|
@@ -263,6 +265,15 @@ export async function gatherSetupState({
|
|
|
263
265
|
}
|
|
264
266
|
|
|
265
267
|
const reviewInstructions = await planReviewInstructions({ homeDirectory, environment, codexHome });
|
|
268
|
+
const leccionesInstructions = await planLeccionesInstructions({ homeDirectory, environment, codexHome }).catch(() => ({ items: [] }));
|
|
269
|
+
// nexakit-fabrica per agent (register, repair, retire the old MCP). Registering needs the script: it exists, or
|
|
270
|
+
// the stable copy installed first in the same confirmation brings it.
|
|
271
|
+
const canRegister = setup.mcp.entryExists || stableCopy.needed;
|
|
272
|
+
const fabricaMcp = Object.fromEntries(
|
|
273
|
+
Object.entries(setup.mcp.fabrica).filter(([, action]) => canRegister || (!action.registrar && !action.reparar)),
|
|
274
|
+
);
|
|
275
|
+
// Codex profiles that still carry an old mark.
|
|
276
|
+
const codexAgents = await teamMarks({ codexHome });
|
|
266
277
|
const superpowers = await inspectSuperpowers({ agentsFound, runCommand, environment });
|
|
267
278
|
const mods = await inspectMods({ agentsFound, runCommand, environment, toolkitRoot });
|
|
268
279
|
return {
|
|
@@ -271,6 +282,9 @@ export async function gatherSetupState({
|
|
|
271
282
|
generators:await loadGeneratorsCatalog(),
|
|
272
283
|
cleanProject:await readCleanProjectAnswers(project.root),
|
|
273
284
|
reviewInstructions,
|
|
285
|
+
leccionesInstructions,
|
|
286
|
+
fabricaMcp,
|
|
287
|
+
codexAgents,
|
|
274
288
|
superpowers,
|
|
275
289
|
mods,
|
|
276
290
|
homeDirectory,
|