@imolko/ultra-agent 0.1.0-beta

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 (239) hide show
  1. package/README.md +93 -0
  2. package/bin/cli.js +2 -0
  3. package/dist-node/bin.d.ts +2 -0
  4. package/dist-node/bin.d.ts.map +1 -0
  5. package/dist-node/bin.js +5 -0
  6. package/dist-node/bin.js.map +1 -0
  7. package/dist-node/cli.d.ts +41 -0
  8. package/dist-node/cli.d.ts.map +1 -0
  9. package/dist-node/cli.js +170 -0
  10. package/dist-node/cli.js.map +1 -0
  11. package/dist-node/index.d.ts +14 -0
  12. package/dist-node/index.d.ts.map +1 -0
  13. package/dist-node/index.js +40 -0
  14. package/dist-node/index.js.map +1 -0
  15. package/dist-node/init-lint.d.ts +43 -0
  16. package/dist-node/init-lint.d.ts.map +1 -0
  17. package/dist-node/init-lint.js +84 -0
  18. package/dist-node/init-lint.js.map +1 -0
  19. package/dist-node/manifest.d.ts +33 -0
  20. package/dist-node/manifest.d.ts.map +1 -0
  21. package/dist-node/manifest.js +59 -0
  22. package/dist-node/manifest.js.map +1 -0
  23. package/dist-node/materializer.d.ts +52 -0
  24. package/dist-node/materializer.d.ts.map +1 -0
  25. package/dist-node/materializer.js +194 -0
  26. package/dist-node/materializer.js.map +1 -0
  27. package/dist-node/package-root.d.ts +5 -0
  28. package/dist-node/package-root.d.ts.map +1 -0
  29. package/dist-node/package-root.js +17 -0
  30. package/dist-node/package-root.js.map +1 -0
  31. package/dist-node/payload.d.ts +22 -0
  32. package/dist-node/payload.d.ts.map +1 -0
  33. package/dist-node/payload.js +49 -0
  34. package/dist-node/payload.js.map +1 -0
  35. package/dist-node/pointer-hub.d.ts +22 -0
  36. package/dist-node/pointer-hub.d.ts.map +1 -0
  37. package/dist-node/pointer-hub.js +50 -0
  38. package/dist-node/pointer-hub.js.map +1 -0
  39. package/dist-node/publication.cli.d.ts +9 -0
  40. package/dist-node/publication.cli.d.ts.map +1 -0
  41. package/dist-node/publication.cli.js +17 -0
  42. package/dist-node/publication.cli.js.map +1 -0
  43. package/dist-node/publication.d.ts +23 -0
  44. package/dist-node/publication.d.ts.map +1 -0
  45. package/dist-node/publication.js +47 -0
  46. package/dist-node/publication.js.map +1 -0
  47. package/dist-node/reconcile.cli.d.ts +11 -0
  48. package/dist-node/reconcile.cli.d.ts.map +1 -0
  49. package/dist-node/reconcile.cli.js +39 -0
  50. package/dist-node/reconcile.cli.js.map +1 -0
  51. package/dist-node/reconcile.d.ts +30 -0
  52. package/dist-node/reconcile.d.ts.map +1 -0
  53. package/dist-node/reconcile.js +51 -0
  54. package/dist-node/reconcile.js.map +1 -0
  55. package/dist-node/ship/prompts/fix.md +22 -0
  56. package/dist-node/ship/prompts/implement.md +34 -0
  57. package/dist-node/ship/prompts/review.md +28 -0
  58. package/dist-node/ship/ship.agent.d.ts +22 -0
  59. package/dist-node/ship/ship.agent.d.ts.map +1 -0
  60. package/dist-node/ship/ship.agent.js +142 -0
  61. package/dist-node/ship/ship.agent.js.map +1 -0
  62. package/dist-node/ship/ship.args.d.ts +15 -0
  63. package/dist-node/ship/ship.args.d.ts.map +1 -0
  64. package/dist-node/ship/ship.args.js +93 -0
  65. package/dist-node/ship/ship.args.js.map +1 -0
  66. package/dist-node/ship/ship.context.d.ts +12 -0
  67. package/dist-node/ship/ship.context.d.ts.map +1 -0
  68. package/dist-node/ship/ship.context.js +3 -0
  69. package/dist-node/ship/ship.context.js.map +1 -0
  70. package/dist-node/ship/ship.d.ts +4 -0
  71. package/dist-node/ship/ship.d.ts.map +1 -0
  72. package/dist-node/ship/ship.js +221 -0
  73. package/dist-node/ship/ship.js.map +1 -0
  74. package/dist-node/ship/ship.mr.d.ts +9 -0
  75. package/dist-node/ship/ship.mr.d.ts.map +1 -0
  76. package/dist-node/ship/ship.mr.js +171 -0
  77. package/dist-node/ship/ship.mr.js.map +1 -0
  78. package/dist-node/ship/ship.output.d.ts +9 -0
  79. package/dist-node/ship/ship.output.d.ts.map +1 -0
  80. package/dist-node/ship/ship.output.js +21 -0
  81. package/dist-node/ship/ship.output.js.map +1 -0
  82. package/dist-node/ship/ship.tracker.d.ts +37 -0
  83. package/dist-node/ship/ship.tracker.d.ts.map +1 -0
  84. package/dist-node/ship/ship.tracker.js +220 -0
  85. package/dist-node/ship/ship.tracker.js.map +1 -0
  86. package/dist-node/version.cli.d.ts +9 -0
  87. package/dist-node/version.cli.d.ts.map +1 -0
  88. package/dist-node/version.cli.js +30 -0
  89. package/dist-node/version.cli.js.map +1 -0
  90. package/dist-node/version.d.ts +24 -0
  91. package/dist-node/version.d.ts.map +1 -0
  92. package/dist-node/version.js +76 -0
  93. package/dist-node/version.js.map +1 -0
  94. package/docs/adr/ADR-0000-proceso-y-formato-de-adrs.md +115 -0
  95. package/docs/adr/foundational/A-001-clean-architecture-4-capas.md +88 -0
  96. package/docs/adr/foundational/A-002-cqrs-semantico.md +58 -0
  97. package/docs/adr/foundational/A-003-tdd.md +97 -0
  98. package/docs/adr/foundational/A-005-either-return-custom-methods.md +80 -0
  99. package/docs/adr/foundational/A-006-feature-completion-criteria.md +47 -0
  100. package/docs/adr/foundational/A-007-data-contract-fail-fast.md +109 -0
  101. package/docs/adr/foundational/A-008-bounded-context-decomposition.md +130 -0
  102. package/docs/adr/foundational/A-009-use-case-taxonomy.md +99 -0
  103. package/docs/adr/foundational/A-010-propiedad-emision-eventos-dominio.md +95 -0
  104. package/docs/adr/foundational/A-011-characterization-first-refactoring.md +90 -0
  105. package/docs/adr/foundational/A-012-helm-mecanismo-primario-despliegue.md +67 -0
  106. package/docs/adr/foundational/A-013-contrato-settings-unica-fuente-configuracion.md +74 -0
  107. package/docs/adr/foundational/A-014-generacion-artefactos-despliegue-desde-contrato-settings.md +75 -0
  108. package/docs/adr/foundational/A-015-cloudevents-estandar-eventos.md +85 -0
  109. package/docs/adr/foundational/A-016-cicd-gitlab-pipeline-raiz-pipelines-modulares.md +92 -0
  110. package/docs/adr/foundational/A-017-taxonomia-repositorios-librerias-sistemas.md +93 -0
  111. package/docs/adr/foundational/A-018-practicas-build-imagenes-docker.md +85 -0
  112. package/docs/adr/foundational/A-019-convenciones-autoria-helm-charts.md +97 -0
  113. package/docs/adr/foundational/A-020-entorno-desarrollo-estandarizado-devcontainer.md +58 -0
  114. package/docs/adr/foundational/A-022-formato-reporte-tests-ctrf.md +55 -0
  115. package/docs/adr/foundational/A-023-composicion-bloques-prompt-agentes.md +65 -0
  116. package/docs/adr/foundational/A-024-features-slices-verticales-portables.md +41 -0
  117. package/docs/adr/foundational/A-025-anatomia-mecanica-feature-puertos-adaptadores-drivers.md +104 -0
  118. package/docs/adr/foundational/A-026-infraestructura-compartida.md +44 -0
  119. package/docs/adr/foundational/A-027-patron-wiring-entry-point.md +67 -0
  120. package/docs/adr/foundational/A-029-verbos-intencion-metodos-lado-negocio.md +54 -0
  121. package/docs/adr/foundational/A-030-global-development-tooling.md +52 -0
  122. package/docs/adr/foundational/A-031-ubiquitous-language.md +64 -0
  123. package/docs/adr/foundational/A-032-domain-artifact-documentation-format.md +128 -0
  124. package/docs/adr/foundational/A-033-estandar-mensajes-commit.md +127 -0
  125. package/docs/adr/foundational/A-034-canonical-skill-set.md +64 -0
  126. package/docs/adr/foundational/A-035-captura-ideas-reanclaje-candies.md +51 -0
  127. package/docs/adr/foundational/A-036-adopcion-wayfinder-ortogonalidad-labels.md +37 -0
  128. package/docs/adr/foundational/A-037-formalizacion-taxonomia-labels.md +98 -0
  129. package/docs/adr/foundational/A-038-issues-referencian-skills-nombre.md +54 -0
  130. package/docs/adr/foundational/A-039-pipeline-ship-issues-hijos-spec.md +64 -0
  131. package/docs/adr/foundational/A-040-punteros-configuracion-repo-skills.md +44 -0
  132. package/docs/adr/foundational/A-041-estrategia-de-ramas.md +45 -0
  133. package/docs/adr/foundational/A-042-formato-documentos-issue-tracker.md +78 -0
  134. package/docs/adr/foundational/A-043-vocabulario-etiquetas-adrs.md +42 -0
  135. package/docs/adr/foundational/A-044-composicion-funcional-procesos-operaciones.md +44 -0
  136. package/docs/adr/foundational/A-045-guardrails-aplicables-no-directrices.md +48 -0
  137. package/docs/adr/foundational/A-046-metricas-de-forma-y-legibilidad-del-codigo.md +50 -0
  138. package/docs/adr/foundational/A-047-dependencias-explicitas-sin-globales-ambientales.md +40 -0
  139. package/docs/adr/foundational/A-048-cobertura-minima-codigo.md +39 -0
  140. package/docs/adr/foundational/A-049-materializacion-bucle-guardrails-extension-nativa-pi.md +49 -0
  141. package/docs/adr/foundational/A-050-el-caso-de-uso-pide-al-dominio-no-lee-su-representacion.md +50 -0
  142. package/docs/adr/foundational/A-051-orden-imports-por-distancia.md +47 -0
  143. package/docs/adr/foundational/A-052-distribucion-metodologia-paquete-versionado.md +42 -0
  144. package/docs/adr/foundational/A-053-errores-compartidos-entre-features-dos-hogares-por-capa.md +43 -0
  145. package/docs/adr/foundational/A-054-contrato-costura-driver-port-raw-data-canal-error.md +65 -0
  146. package/docs/adr/foundational/index.md +98 -0
  147. package/docs/adr/index.md +19 -0
  148. package/docs/adr/python/P-001-dependencias-por-feature-fastapi-depends.md +63 -0
  149. package/docs/adr/python/P-002-inyeccion-token-por-request-sin-persistirlo.md +35 -0
  150. package/docs/adr/python/P-003-sqlalchemy-async-connection-pooling.md +59 -0
  151. package/docs/adr/python/P-004-serializer-json-custom-modelos-pydantic.md +47 -0
  152. package/docs/adr/python/P-005-patrones-pitfalls-nicegui.md +148 -0
  153. package/docs/adr/python/P-006-convenciones-pytest.md +96 -0
  154. package/docs/adr/python/P-007-ci-python-alineacion-poetry-version-unica.md +55 -0
  155. package/docs/adr/python/P-008-empaquetado-infraestructura-compartida-por-tecnologia.md +38 -0
  156. package/docs/adr/python/index.md +14 -0
  157. package/docs/adr/typescript/T-001-ddd-artifact-validation-zod-primitives.md +136 -0
  158. package/docs/adr/typescript/T-002-test-documentation-jsdoc.md +133 -0
  159. package/docs/adr/typescript/T-003-readme-formatting-domain-artifacts.md +51 -0
  160. package/docs/adr/typescript/T-005-input-optionality-use-case-not-entity.md +130 -0
  161. package/docs/adr/typescript/T-006-small-enums-inlined-zod-regex.md +77 -0
  162. package/docs/adr/typescript/T-007-controller-input-zod-schema.md +79 -0
  163. package/docs/adr/typescript/T-008-expressive-use-case-pipe.md +207 -0
  164. package/docs/adr/typescript/T-009-mdx-brace-escaping.md +80 -0
  165. package/docs/adr/typescript/T-010-stack-tooling-typescript-dominio.md +53 -0
  166. package/docs/adr/typescript/T-011-ultra-reporter-herramienta-canonica-documentacion.md +52 -0
  167. package/docs/adr/typescript/T-012-npm-workspaces-estructura-monorepo-clean-architecture.md +54 -0
  168. package/docs/adr/typescript/T-013-definicion-eventos-versionados-ultra-ddd.md +45 -0
  169. package/docs/adr/typescript/T-014-publicacion-distribucion-librerias-npm-semver.md +53 -0
  170. package/docs/adr/typescript/T-015-method-placement-definition.md +35 -0
  171. package/docs/adr/typescript/T-016-contrato-settings-zod.md +34 -0
  172. package/docs/adr/typescript/T-017-characterization-tests-golden-files.md +39 -0
  173. package/docs/adr/typescript/T-018-procedencia-campos-frontmatter.md +55 -0
  174. package/docs/adr/typescript/T-019-ultra-generator-herramienta-canonica-generacion.md +35 -0
  175. package/docs/adr/typescript/T-020-ultra-settings-herramienta-canonica-exportacion-despliegue.md +36 -0
  176. package/docs/adr/typescript/T-021-pipe-flujo-datos-operadores-semantica-contexto-inmutable.md +105 -0
  177. package/docs/adr/typescript/T-022-construction-is-execution-single-boundary.md +112 -0
  178. package/docs/adr/typescript/T-023-registry-cli-declara-dependencias-reales.md +84 -0
  179. package/docs/adr/typescript/T-024-paquete-ultra-agent-manifiesto-pi-peers-cli.md +39 -0
  180. package/docs/adr/typescript/T-025-publicacion-npm-trusted-publishing-procedencia.md +59 -0
  181. package/docs/adr/typescript/index.md +30 -0
  182. package/eslint/index.mjs +721 -0
  183. package/package.json +94 -0
  184. package/pi/extensions/handoff/README.md +92 -0
  185. package/pi/extensions/handoff/handoff-prompt.txt +9 -0
  186. package/pi/extensions/handoff/index.ts +296 -0
  187. package/pi/extensions/handoff/package.json +12 -0
  188. package/pi/extensions/qa-guardrail/README.md +108 -0
  189. package/pi/extensions/qa-guardrail/adapters/cli.ts +100 -0
  190. package/pi/extensions/qa-guardrail/adapters/eslint.ts +90 -0
  191. package/pi/extensions/qa-guardrail/adapters/registry.ts +45 -0
  192. package/pi/extensions/qa-guardrail/baseline.ts +74 -0
  193. package/pi/extensions/qa-guardrail/cerco.ts +134 -0
  194. package/pi/extensions/qa-guardrail/check.ts +185 -0
  195. package/pi/extensions/qa-guardrail/config.ts +189 -0
  196. package/pi/extensions/qa-guardrail/delta.ts +52 -0
  197. package/pi/extensions/qa-guardrail/feedback.ts +26 -0
  198. package/pi/extensions/qa-guardrail/index.ts +311 -0
  199. package/pi/extensions/qa-guardrail/nstop.ts +82 -0
  200. package/pi/extensions/qa-guardrail/package.json +12 -0
  201. package/pi/extensions/qa-guardrail/selection.ts +98 -0
  202. package/pi/extensions/qa-guardrail/types.ts +64 -0
  203. package/scripts/copy-assets.sh +10 -0
  204. package/scripts/reconcile-tags.sh +94 -0
  205. package/scripts/release-beta.sh +64 -0
  206. package/scripts/release-build.sh +53 -0
  207. package/scripts/release.sh +51 -0
  208. package/scripts/verify-adr-consistency.py +217 -0
  209. package/skills/code-review/SKILL.md +66 -0
  210. package/skills/codebase-design/SKILL.md +46 -0
  211. package/skills/configure-repo/SKILL.md +33 -0
  212. package/skills/diagnose-bug/SKILL.md +63 -0
  213. package/skills/domain-modeling/SKILL.md +56 -0
  214. package/skills/grill-me/SKILL.md +34 -0
  215. package/skills/i-have-an-idea/SKILL.md +166 -0
  216. package/skills/implement/SKILL.md +22 -0
  217. package/skills/research/SKILL.md +17 -0
  218. package/skills/ship/SKILL.md +26 -0
  219. package/skills/spike/SKILL.md +27 -0
  220. package/skills/tdd/SKILL.md +68 -0
  221. package/skills/tdd/references/deep-modules.md +53 -0
  222. package/skills/tdd/references/interface-design.md +74 -0
  223. package/skills/tdd/references/mocking.md +80 -0
  224. package/skills/tdd/references/refactoring.md +49 -0
  225. package/skills/tdd/references/tests.md +184 -0
  226. package/skills/to-specs/SKILL.md +141 -0
  227. package/skills/to-tasks/SKILL.md +143 -0
  228. package/skills/triage/SKILL.md +73 -0
  229. package/skills/ultra-generator/SKILL.md +263 -0
  230. package/skills/ultra-generator/references/aggregate-root.md +149 -0
  231. package/skills/ultra-generator/references/domain-event.md +174 -0
  232. package/skills/ultra-generator/references/entity.md +133 -0
  233. package/skills/ultra-generator/references/service.md +92 -0
  234. package/skills/ultra-generator/references/value-object.md +135 -0
  235. package/skills/wayfinder/SKILL.md +201 -0
  236. package/skills/workflow/SKILL.md +31 -0
  237. package/skills/writing-for-agents/SKILL-MECHANICS.md +32 -0
  238. package/skills/writing-for-agents/SKILL.md +86 -0
  239. package/skills/writing-for-agents/references/adrs.md +19 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.cli.js","sourceRoot":"","sources":["../src/reconcile.cli.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAEH,qCAAuC;AACvC,2CAIqB;AAOrB,SAAS,UAAU,CAAC,GAAW;IAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B,CAAC;IAC1D,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;QAClE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;KAC5E,CAAC;AACJ,CAAC;AAED,SAAS,IAAI;IACX,IAAI,KAAqB,CAAC;IAC1B,IAAI,CAAC;QACH,KAAK,GAAG,UAAU,CAAC,IAAA,sBAAY,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,0FAA0F,CAC3F,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,IAAA,kCAAsB,EAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,OAAO,qBAAqB,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,IAAA,uBAAW,EAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QACpE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Reconciliación de etiquetas git desde el registry (T-025): cada versión
3
+ * publicada en npm que no tenga etiqueta git se etiqueta en el commit que la
4
+ * produjo, que npm expone como `gitHead`.
5
+ *
6
+ * Funciones puras: ninguna toca el sistema de archivos ni el shell. El CLI
7
+ * (`reconcile.cli.ts`) las expone a los scripts de release; los tests las
8
+ * ejercen directamente sobre listas de versiones y etiquetas.
9
+ */
10
+ export interface PublishedVersion {
11
+ version: string;
12
+ gitHead: string | undefined;
13
+ }
14
+ export interface TagPlan {
15
+ version: string;
16
+ commit: string;
17
+ }
18
+ /**
19
+ * Devuelve los planes `{version, commit}` de las versiones publicadas que no
20
+ * tienen etiqueta, preservando el orden de `published`. Las versiones sin
21
+ * `gitHead` no se incluyen: no hay commit al que anclar la etiqueta.
22
+ */
23
+ export declare function missingTags(published: PublishedVersion[], existingTags: string[]): TagPlan[];
24
+ /**
25
+ * Reporte de las versiones publicadas que no traen `gitHead`: indica una
26
+ * publicación que no salió de un checkout git y, por tanto, no puede
27
+ * reconciliarse con una etiqueta. Preserva el orden de `published`.
28
+ */
29
+ export declare function versionsWithoutGitHead(published: PublishedVersion[]): string[];
30
+ //# sourceMappingURL=reconcile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../src/reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAUD;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,gBAAgB,EAAE,EAC7B,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,EAAE,CAWX;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAQ9E"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /**
3
+ * Reconciliación de etiquetas git desde el registry (T-025): cada versión
4
+ * publicada en npm que no tenga etiqueta git se etiqueta en el commit que la
5
+ * produjo, que npm expone como `gitHead`.
6
+ *
7
+ * Funciones puras: ninguna toca el sistema de archivos ni el shell. El CLI
8
+ * (`reconcile.cli.ts`) las expone a los scripts de release; los tests las
9
+ * ejercen directamente sobre listas de versiones y etiquetas.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.missingTags = missingTags;
13
+ exports.versionsWithoutGitHead = versionsWithoutGitHead;
14
+ /**
15
+ * Considera que una versión trae `gitHead` solo si es una cadena no vacía. Un
16
+ * valor ausente o vacío significa que npm no registró el commit de origen.
17
+ */
18
+ function hasGitHead(item) {
19
+ return typeof item.gitHead === "string" && item.gitHead.length > 0;
20
+ }
21
+ /**
22
+ * Devuelve los planes `{version, commit}` de las versiones publicadas que no
23
+ * tienen etiqueta, preservando el orden de `published`. Las versiones sin
24
+ * `gitHead` no se incluyen: no hay commit al que anclar la etiqueta.
25
+ */
26
+ function missingTags(published, existingTags) {
27
+ const existing = new Set(existingTags);
28
+ const plans = [];
29
+ for (const item of published) {
30
+ if (!hasGitHead(item))
31
+ continue;
32
+ if (existing.has(item.version))
33
+ continue;
34
+ plans.push({ version: item.version, commit: item.gitHead });
35
+ }
36
+ return plans;
37
+ }
38
+ /**
39
+ * Reporte de las versiones publicadas que no traen `gitHead`: indica una
40
+ * publicación que no salió de un checkout git y, por tanto, no puede
41
+ * reconciliarse con una etiqueta. Preserva el orden de `published`.
42
+ */
43
+ function versionsWithoutGitHead(published) {
44
+ const result = [];
45
+ for (const item of published) {
46
+ if (!hasGitHead(item))
47
+ result.push(item.version);
48
+ }
49
+ return result;
50
+ }
51
+ //# sourceMappingURL=reconcile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../src/reconcile.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAyBH,kCAcC;AAOD,wDAQC;AA1CD;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAsB;IACxC,OAAO,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CACzB,SAA6B,EAC7B,YAAsB;IAEtB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,KAAK,GAAc,EAAE,CAAC;IAE5B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,SAAS;QAChC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,SAAS;QACzC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,SAA6B;IAClE,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: fix
3
+ description: Corrige los hallazgos de la revisión y deja los tests en verde.
4
+ tools: read, edit, write, bash, grep, find, ls
5
+ ---
6
+
7
+ # Fix
8
+
9
+ Eres un agente de corrección. Recibes los hallazgos de la revisión y los corriges.
10
+
11
+ ## Reglas
12
+
13
+ - Corrige cada hallazgo de la lista.
14
+ - Ejecuta el build y las pruebas; todo debe quedar en verde.
15
+ - No toques el tracker: no ejecutes `glab`.
16
+
17
+ ## Salida
18
+
19
+ Tu mensaje final debe **terminar** con UNA de estas dos líneas:
20
+
21
+ - `VERDICT: done` — hallazgos corregidos, tests en verde.
22
+ - `VERDICT: blocked` — no puedes corregir sin intervención humana; explica por qué.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: implement
3
+ description: Implementa un único issue hijo de un spec, con contexto fresco y enfocado.
4
+ tools: read, edit, write, bash, grep, find, ls
5
+ ---
6
+
7
+ # Implement
8
+
9
+ Eres un agente de implementación. En esta sesión implementas **un único issue hijo** y nada más.
10
+
11
+ ## Entrada
12
+
13
+ Recibirás tres piezas de contexto:
14
+
15
+ 1. El spec padre (PRD) — contexto general del esfuerzo.
16
+ 2. El issue hijo — lo **único** que debes implementar en esta sesión.
17
+ 3. El progreso reciente (comentarios del padre) — lo que ya se ha hecho.
18
+
19
+ ## Reglas
20
+
21
+ - Implementa exactamente lo que pide el issue hijo. Sigue su `# Alcance` y su `# Criterio de cierre` al pie de la letra.
22
+ - Si el `# Alcance` referencia un skill (ej. `/skill:ultra-generator`, `/skill:tdd`), úsalo como primera instrucción.
23
+ - No toques el tracker: no ejecutes `glab`, no cambies labels ni asignees. De eso se encarga el orquestador.
24
+ - Escribe código y pruebas con `/skill:tdd`, siguiendo los ADRs aplicables del registro.
25
+ - Ejecuta el build y las pruebas; deja todo en verde antes de terminar.
26
+
27
+ ## Salida
28
+
29
+ Cuando hayas terminado — o si no puedes avanzar —, tu mensaje final debe **terminar** con UNA de estas dos líneas, seguida de un resumen breve de lo hecho:
30
+
31
+ - `VERDICT: done` — implementado, build y tests en verde.
32
+ - `VERDICT: blocked` — no puedes completar sin intervención humana; explica por qué.
33
+
34
+ No emitas la línea `VERDICT` antes de haber terminado de verdad.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: review
3
+ description: Revisa el diff acumulado de un spec contra su PRD y los ADRs que lo gobiernan.
4
+ tools: read, grep, find, ls, bash
5
+ ---
6
+
7
+ # Review
8
+
9
+ Eres un revisor de código. Revisa el diff completo del working tree contra:
10
+
11
+ 1. El spec padre (PRD) — lo que se pidió.
12
+ 2. Los ADRs que gobiernan el área tocada (`docs/adr/`).
13
+ 3. Los `# Criterio de cierre` de los issues hijos implementados.
14
+
15
+ ## Qué revisar
16
+
17
+ - **Corrección**: ¿cumple el spec y los criterios de cierre?
18
+ - **Estándares**: ¿respeta los ADRs (arquitectura, TDD, completitud)?
19
+ - **Calidad**: ¿pruebas adecuadas, sin deuda evidente, sin código muerto?
20
+
21
+ ## Salida
22
+
23
+ Termina con una lista numerada de hallazgos (si los hay) y, en la última línea, UNA de estas dos:
24
+
25
+ - `VERDICT: clean` — sin hallazgos.
26
+ - `VERDICT: issues` — con la lista de hallazgos a corregir.
27
+
28
+ **No corrijas nada tú**: solo reporta. La corrección la hace otro agente.
@@ -0,0 +1,22 @@
1
+ export interface AgentResult {
2
+ verdict: string;
3
+ output: string;
4
+ exitCode: number;
5
+ }
6
+ export interface RunAgentInput {
7
+ phase: string;
8
+ contextFiles: string[];
9
+ task: string;
10
+ provider: string;
11
+ model: string;
12
+ }
13
+ /** Elimina un archivo o directorio temporal sin fallar si ya no existe. */
14
+ export declare function removePath(path: string): void;
15
+ /** Lee el prompt de fase desde el payload del paquete (no `cwd/.pi/agents/`). */
16
+ export declare function readAgentPrompt(name: string): string;
17
+ /** Procesa una línea JSON del stdout de pi; devuelve el delta de texto, si lo hay. */
18
+ export declare function handleOutputLine(line: string): string;
19
+ /** Extrae el veredicto final del texto del agente. */
20
+ export declare function extractVerdict(text: string): string;
21
+ export declare function runAgent(input: RunAgentInput): Promise<AgentResult>;
22
+ //# sourceMappingURL=ship.agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ship.agent.d.ts","sourceRoot":"","sources":["../../src/ship/ship.agent.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AASD,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE7C;AAID,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOpD;AAuCD,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWrD;AAED,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAkBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CA2CnE"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removePath = removePath;
4
+ exports.readAgentPrompt = readAgentPrompt;
5
+ exports.handleOutputLine = handleOutputLine;
6
+ exports.extractVerdict = extractVerdict;
7
+ exports.runAgent = runAgent;
8
+ const node_child_process_1 = require("node:child_process");
9
+ const node_fs_1 = require("node:fs");
10
+ const node_path_1 = require("node:path");
11
+ const node_os_1 = require("node:os");
12
+ const ship_output_1 = require("./ship.output");
13
+ const PI_RESOLVE_TIMEOUT_MS = 5000;
14
+ const TEXT_PREVIEW_LENGTH = 200;
15
+ const STDERR_TAIL_LENGTH = 500;
16
+ /** Elimina un archivo o directorio temporal sin fallar si ya no existe. */
17
+ function removePath(path) {
18
+ try {
19
+ (0, node_fs_1.rmSync)(path, { recursive: true, force: true });
20
+ }
21
+ catch { /* ignore */ }
22
+ }
23
+ // ── Agent prompt (modular: lives in the package payload, A-039) ───────────────
24
+ /** Lee el prompt de fase desde el payload del paquete (no `cwd/.pi/agents/`). */
25
+ function readAgentPrompt(name) {
26
+ const file = (0, node_path_1.join)(__dirname, "prompts", `${name}.md`);
27
+ const text = (0, node_fs_1.readFileSync)(file, "utf-8");
28
+ // Strip YAML frontmatter (--- ... ---); the body is the system prompt.
29
+ const match = text.match(/^---\n[\s\S]*?\n---\n?/);
30
+ return match ? text.slice(match[0].length).trim() : text.trim();
31
+ }
32
+ function preview(text) {
33
+ if (text.length <= TEXT_PREVIEW_LENGTH)
34
+ return text;
35
+ return `${text.slice(0, TEXT_PREVIEW_LENGTH)}...`;
36
+ }
37
+ function toolName(event) {
38
+ return event.toolName === undefined ? "?" : event.toolName;
39
+ }
40
+ function argText(event, key) {
41
+ const args = event.args;
42
+ if (args === undefined)
43
+ return "";
44
+ const value = args[key];
45
+ return value === undefined ? "" : value;
46
+ }
47
+ function toolLabel(event) {
48
+ const name = toolName(event);
49
+ if (name === "read")
50
+ return ` 📖 ${argText(event, "path")}`;
51
+ if (name === "edit")
52
+ return ` ✏️ ${argText(event, "path")}`;
53
+ if (name === "write")
54
+ return ` 📝 ${argText(event, "path")}`;
55
+ if (name === "bash")
56
+ return ` 💻 ${preview(argText(event, "command"))}`;
57
+ return "";
58
+ }
59
+ function logToolEvent(event) {
60
+ const label = toolLabel(event);
61
+ if (label.length > 0)
62
+ (0, ship_output_1.writeLine)(label);
63
+ }
64
+ function eventTextDelta(event) {
65
+ if (event.type === "message_update" && event.assistantMessageEvent?.type === "text_delta") {
66
+ return event.assistantMessageEvent.delta ?? "";
67
+ }
68
+ return "";
69
+ }
70
+ /** Procesa una línea JSON del stdout de pi; devuelve el delta de texto, si lo hay. */
71
+ function handleOutputLine(line) {
72
+ try {
73
+ const event = JSON.parse(line);
74
+ if (event.type === "tool_execution_start") {
75
+ logToolEvent(event);
76
+ return "";
77
+ }
78
+ return eventTextDelta(event);
79
+ }
80
+ catch {
81
+ return ""; // skip non-JSON lines
82
+ }
83
+ }
84
+ /** Extrae el veredicto final del texto del agente. */
85
+ function extractVerdict(text) {
86
+ const match = text.match(/VERDICT:\s*(done|blocked|clean|issues)/i);
87
+ return match ? match[1].toLowerCase() : "";
88
+ }
89
+ function makeAgentArgs(input, bodyFile) {
90
+ const args = [
91
+ "--mode", "json",
92
+ "--provider", input.provider,
93
+ "--model", input.model,
94
+ "--print",
95
+ "--no-session",
96
+ "--append-system-prompt", bodyFile,
97
+ ];
98
+ for (const file of input.contextFiles)
99
+ args.push(`@${file}`);
100
+ args.push(input.task);
101
+ return args;
102
+ }
103
+ // ── Sub-agent runner (fresh isolated pi per phase) ────────────────────────────
104
+ function runAgent(input) {
105
+ return new Promise((resolve, reject) => {
106
+ const body = readAgentPrompt(input.phase);
107
+ const tmpDir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "ship-"));
108
+ const bodyFile = (0, node_path_1.join)(tmpDir, "agent.md");
109
+ (0, node_fs_1.writeFileSync)(bodyFile, body);
110
+ const piBin = (0, node_child_process_1.execSync)("which pi", { encoding: "utf-8", timeout: PI_RESOLVE_TIMEOUT_MS }).trim();
111
+ const pi = (0, node_child_process_1.spawn)(piBin, makeAgentArgs(input, bodyFile), { stdio: ["pipe", "pipe", "pipe"] });
112
+ pi.stdin.end();
113
+ let lastAssistantText = "";
114
+ let stderr = "";
115
+ pi.stdout.on("data", (chunk) => {
116
+ const lines = chunk.toString().split("\n").filter((line) => line.trim().length > 0);
117
+ for (const line of lines) {
118
+ lastAssistantText += handleOutputLine(line);
119
+ }
120
+ });
121
+ pi.stderr.on("data", (chunk) => {
122
+ stderr += chunk.toString();
123
+ });
124
+ pi.on("close", (exitCode) => {
125
+ removePath(tmpDir);
126
+ const verdict = extractVerdict(lastAssistantText);
127
+ if (exitCode !== 0 && verdict.length === 0) {
128
+ (0, ship_output_1.writeError)(stderr.slice(-STDERR_TAIL_LENGTH));
129
+ }
130
+ resolve({
131
+ verdict,
132
+ output: lastAssistantText.trim(),
133
+ exitCode: exitCode ?? 1,
134
+ });
135
+ });
136
+ pi.on("error", (error) => {
137
+ removePath(tmpDir);
138
+ reject(error);
139
+ });
140
+ });
141
+ }
142
+ //# sourceMappingURL=ship.agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ship.agent.js","sourceRoot":"","sources":["../../src/ship/ship.agent.ts"],"names":[],"mappings":";;AAgCA,gCAEC;AAKD,0CAOC;AAwCD,4CAWC;AAGD,wCAGC;AAkBD,4BA2CC;AApKD,2DAAqD;AACrD,qCAA2E;AAC3E,yCAAiC;AACjC,qCAAiC;AACjC,+CAAsD;AAEtD,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAuB/B,2EAA2E;AAC3E,SAAgB,UAAU,CAAC,IAAY;IACrC,IAAI,CAAC;QAAC,IAAA,gBAAM,EA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KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3C,IAAA,wBAAU,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,CAAC;gBACN,OAAO;gBACP,MAAM,EAAE,iBAAiB,CAAC,IAAI,EAAE;gBAChC,QAAQ,EAAE,QAAQ,IAAI,CAAC;aACxB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;YAC9B,UAAU,CAAC,MAAM,CAAC,CAAC;YACnB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface ParsedArgs {
2
+ parentIid: number;
3
+ provider: string;
4
+ model: string;
5
+ maxIterations: number;
6
+ targetBranch: string;
7
+ }
8
+ export declare const DEFAULT_PROVIDER = "deepseek";
9
+ export declare const DEFAULT_MODEL = "deepseek-v4-pro";
10
+ export declare const DEFAULT_TARGET_BRANCH = "develop";
11
+ /** Parsea los argumentos crudos (sin `process.argv`) — puro, testable. */
12
+ export declare function parseArgv(argv: string[]): ParsedArgs;
13
+ export declare function parseArgs(): ParsedArgs;
14
+ export declare function usageText(): string;
15
+ //# sourceMappingURL=ship.args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ship.args.d.ts","sourceRoot":"","sources":["../../src/ship/ship.args.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAYD,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAC3C,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,eAAO,MAAM,qBAAqB,YAAY,CAAC;AA6B/C,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAmBpD;AAED,wBAAgB,SAAS,IAAI,UAAU,CAEtC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAoBlC"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_TARGET_BRANCH = exports.DEFAULT_MODEL = exports.DEFAULT_PROVIDER = void 0;
4
+ exports.parseArgv = parseArgv;
5
+ exports.parseArgs = parseArgs;
6
+ exports.usageText = usageText;
7
+ const ship_output_1 = require("./ship.output");
8
+ const VALUE_OPTIONS = [
9
+ "--parent-iid", "-p",
10
+ "--provider",
11
+ "--model", "-m",
12
+ "--max-iterations", "-i",
13
+ "--target-branch",
14
+ ];
15
+ const HELP_OPTIONS = ["--help", "-h"];
16
+ exports.DEFAULT_PROVIDER = "deepseek";
17
+ exports.DEFAULT_MODEL = "deepseek-v4-pro";
18
+ exports.DEFAULT_TARGET_BRANCH = "develop";
19
+ function firstArg(raw, names) {
20
+ for (const name of names) {
21
+ const value = raw[name];
22
+ if (value !== undefined)
23
+ return value;
24
+ }
25
+ return "";
26
+ }
27
+ function withDefault(value, fallback) {
28
+ return value.length === 0 ? fallback : value;
29
+ }
30
+ function toInt(text) {
31
+ const parsed = parseInt(text, 10);
32
+ return Number.isNaN(parsed) ? 0 : parsed;
33
+ }
34
+ function extractArgs(raw) {
35
+ return {
36
+ parentIid: toInt(firstArg(raw, ["--parent-iid", "-p"])),
37
+ provider: withDefault(firstArg(raw, ["--provider"]), exports.DEFAULT_PROVIDER),
38
+ model: withDefault(firstArg(raw, ["--model", "-m"]), exports.DEFAULT_MODEL),
39
+ maxIterations: toInt(firstArg(raw, ["--max-iterations", "-i"])),
40
+ targetBranch: withDefault(firstArg(raw, ["--target-branch"]), exports.DEFAULT_TARGET_BRANCH),
41
+ };
42
+ }
43
+ /** Parsea los argumentos crudos (sin `process.argv`) — puro, testable. */
44
+ function parseArgv(argv) {
45
+ const raw = {};
46
+ for (let idx = 0; idx < argv.length; idx++) {
47
+ const option = argv[idx];
48
+ if (HELP_OPTIONS.includes(option)) {
49
+ printUsage(0);
50
+ }
51
+ if (VALUE_OPTIONS.includes(option)) {
52
+ raw[option] = argv[idx + 1] ?? "";
53
+ idx++;
54
+ }
55
+ else {
56
+ (0, ship_output_1.writeError)(`Unknown option: ${option}`);
57
+ printUsage(1);
58
+ }
59
+ }
60
+ const parsed = extractArgs(raw);
61
+ if (parsed.parentIid === 0)
62
+ printUsage(1);
63
+ return parsed;
64
+ }
65
+ function parseArgs() {
66
+ return parseArgv(process.argv.slice(2));
67
+ }
68
+ function usageText() {
69
+ return `ship — implement a parent spec's child issues, review, fix, and open one MR.
70
+
71
+ Run: one unblocked child at a time (state::ready + exec::AFK), claimed and marked
72
+ completed on VERDICT: done. Then the full diff is reviewed, findings fixed (up to
73
+ 3 attempts, trusting the fix agent's verdict), and one MR per parent opened. No MR
74
+ is opened if no child completed; the MR's Closes lists only the completed children.
75
+ Leftover in-development children from an interrupted run are reset to ready on start.
76
+
77
+ Usage: ultra-agent ship --parent-iid <iid> [--provider <name>] [--model <id>]
78
+ [--max-iterations <n>] [--target-branch <branch>]
79
+
80
+ --parent-iid, -p The IID of the parent issue (spec/PRD)
81
+ --provider Provider name (default: ${exports.DEFAULT_PROVIDER})
82
+ --model, -m Model ID (default: ${exports.DEFAULT_MODEL})
83
+ --max-iterations, -i Safety cap on child issues (0 = unlimited)
84
+ --target-branch Target branch of the MR (default: ${exports.DEFAULT_TARGET_BRANCH})
85
+
86
+ Example:
87
+ ultra-agent ship -p 42`;
88
+ }
89
+ function printUsage(exitCode) {
90
+ (0, ship_output_1.writeLine)(usageText());
91
+ process.exit(exitCode);
92
+ }
93
+ //# sourceMappingURL=ship.args.js.map
@@ -0,0 +1 @@
1
+ {"version":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AAED,SAAgB,SAAS;IACvB,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAgB,SAAS;IACvB,OAAO;;;;;;;;;;;;gDAYuC,wBAAgB;2CACrB,qBAAa;;0DAEE,6BAAqB;;;yBAGtD,CAAC;AAC1B,CAAC;AAED,SAAS,UAAU,CAAC,QAAgB;IAClC,IAAA,uBAAS,EAAC,SAAS,EAAE,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Issue } from "./ship.tracker";
2
+ /** Estado compartido de una ejecución del pipeline ship (A-039). */
3
+ export interface ShipContext {
4
+ parentIid: number;
5
+ provider: string;
6
+ model: string;
7
+ maxIterations: number;
8
+ targetBranch: string;
9
+ projectEncoded: string;
10
+ parentIssue: Issue;
11
+ }
12
+ //# sourceMappingURL=ship.context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ship.context.d.ts","sourceRoot":"","sources":["../../src/ship/ship.context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,KAAK,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ship.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ship.context.js","sourceRoot":"","sources":["../../src/ship/ship.context.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { type ParsedArgs } from "./ship.args";
2
+ export declare function main(args: ParsedArgs): Promise<void>;
3
+ export declare function runShip(argv: string[]): Promise<void>;
4
+ //# sourceMappingURL=ship.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ship.d.ts","sourceRoot":"","sources":["../../src/ship/ship.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AA0NzD,wBAAsB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC1D;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3D"}