@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.
- package/README.md +93 -0
- package/bin/cli.js +2 -0
- package/dist-node/bin.d.ts +2 -0
- package/dist-node/bin.d.ts.map +1 -0
- package/dist-node/bin.js +5 -0
- package/dist-node/bin.js.map +1 -0
- package/dist-node/cli.d.ts +41 -0
- package/dist-node/cli.d.ts.map +1 -0
- package/dist-node/cli.js +170 -0
- package/dist-node/cli.js.map +1 -0
- package/dist-node/index.d.ts +14 -0
- package/dist-node/index.d.ts.map +1 -0
- package/dist-node/index.js +40 -0
- package/dist-node/index.js.map +1 -0
- package/dist-node/init-lint.d.ts +43 -0
- package/dist-node/init-lint.d.ts.map +1 -0
- package/dist-node/init-lint.js +84 -0
- package/dist-node/init-lint.js.map +1 -0
- package/dist-node/manifest.d.ts +33 -0
- package/dist-node/manifest.d.ts.map +1 -0
- package/dist-node/manifest.js +59 -0
- package/dist-node/manifest.js.map +1 -0
- package/dist-node/materializer.d.ts +52 -0
- package/dist-node/materializer.d.ts.map +1 -0
- package/dist-node/materializer.js +194 -0
- package/dist-node/materializer.js.map +1 -0
- package/dist-node/package-root.d.ts +5 -0
- package/dist-node/package-root.d.ts.map +1 -0
- package/dist-node/package-root.js +17 -0
- package/dist-node/package-root.js.map +1 -0
- package/dist-node/payload.d.ts +22 -0
- package/dist-node/payload.d.ts.map +1 -0
- package/dist-node/payload.js +49 -0
- package/dist-node/payload.js.map +1 -0
- package/dist-node/pointer-hub.d.ts +22 -0
- package/dist-node/pointer-hub.d.ts.map +1 -0
- package/dist-node/pointer-hub.js +50 -0
- package/dist-node/pointer-hub.js.map +1 -0
- package/dist-node/publication.cli.d.ts +9 -0
- package/dist-node/publication.cli.d.ts.map +1 -0
- package/dist-node/publication.cli.js +17 -0
- package/dist-node/publication.cli.js.map +1 -0
- package/dist-node/publication.d.ts +23 -0
- package/dist-node/publication.d.ts.map +1 -0
- package/dist-node/publication.js +47 -0
- package/dist-node/publication.js.map +1 -0
- package/dist-node/reconcile.cli.d.ts +11 -0
- package/dist-node/reconcile.cli.d.ts.map +1 -0
- package/dist-node/reconcile.cli.js +39 -0
- package/dist-node/reconcile.cli.js.map +1 -0
- package/dist-node/reconcile.d.ts +30 -0
- package/dist-node/reconcile.d.ts.map +1 -0
- package/dist-node/reconcile.js +51 -0
- package/dist-node/reconcile.js.map +1 -0
- package/dist-node/ship/prompts/fix.md +22 -0
- package/dist-node/ship/prompts/implement.md +34 -0
- package/dist-node/ship/prompts/review.md +28 -0
- package/dist-node/ship/ship.agent.d.ts +22 -0
- package/dist-node/ship/ship.agent.d.ts.map +1 -0
- package/dist-node/ship/ship.agent.js +142 -0
- package/dist-node/ship/ship.agent.js.map +1 -0
- package/dist-node/ship/ship.args.d.ts +15 -0
- package/dist-node/ship/ship.args.d.ts.map +1 -0
- package/dist-node/ship/ship.args.js +93 -0
- package/dist-node/ship/ship.args.js.map +1 -0
- package/dist-node/ship/ship.context.d.ts +12 -0
- package/dist-node/ship/ship.context.d.ts.map +1 -0
- package/dist-node/ship/ship.context.js +3 -0
- package/dist-node/ship/ship.context.js.map +1 -0
- package/dist-node/ship/ship.d.ts +4 -0
- package/dist-node/ship/ship.d.ts.map +1 -0
- package/dist-node/ship/ship.js +221 -0
- package/dist-node/ship/ship.js.map +1 -0
- package/dist-node/ship/ship.mr.d.ts +9 -0
- package/dist-node/ship/ship.mr.d.ts.map +1 -0
- package/dist-node/ship/ship.mr.js +171 -0
- package/dist-node/ship/ship.mr.js.map +1 -0
- package/dist-node/ship/ship.output.d.ts +9 -0
- package/dist-node/ship/ship.output.d.ts.map +1 -0
- package/dist-node/ship/ship.output.js +21 -0
- package/dist-node/ship/ship.output.js.map +1 -0
- package/dist-node/ship/ship.tracker.d.ts +37 -0
- package/dist-node/ship/ship.tracker.d.ts.map +1 -0
- package/dist-node/ship/ship.tracker.js +220 -0
- package/dist-node/ship/ship.tracker.js.map +1 -0
- package/dist-node/version.cli.d.ts +9 -0
- package/dist-node/version.cli.d.ts.map +1 -0
- package/dist-node/version.cli.js +30 -0
- package/dist-node/version.cli.js.map +1 -0
- package/dist-node/version.d.ts +24 -0
- package/dist-node/version.d.ts.map +1 -0
- package/dist-node/version.js +76 -0
- package/dist-node/version.js.map +1 -0
- package/docs/adr/ADR-0000-proceso-y-formato-de-adrs.md +115 -0
- package/docs/adr/foundational/A-001-clean-architecture-4-capas.md +88 -0
- package/docs/adr/foundational/A-002-cqrs-semantico.md +58 -0
- package/docs/adr/foundational/A-003-tdd.md +97 -0
- package/docs/adr/foundational/A-005-either-return-custom-methods.md +80 -0
- package/docs/adr/foundational/A-006-feature-completion-criteria.md +47 -0
- package/docs/adr/foundational/A-007-data-contract-fail-fast.md +109 -0
- package/docs/adr/foundational/A-008-bounded-context-decomposition.md +130 -0
- package/docs/adr/foundational/A-009-use-case-taxonomy.md +99 -0
- package/docs/adr/foundational/A-010-propiedad-emision-eventos-dominio.md +95 -0
- package/docs/adr/foundational/A-011-characterization-first-refactoring.md +90 -0
- package/docs/adr/foundational/A-012-helm-mecanismo-primario-despliegue.md +67 -0
- package/docs/adr/foundational/A-013-contrato-settings-unica-fuente-configuracion.md +74 -0
- package/docs/adr/foundational/A-014-generacion-artefactos-despliegue-desde-contrato-settings.md +75 -0
- package/docs/adr/foundational/A-015-cloudevents-estandar-eventos.md +85 -0
- package/docs/adr/foundational/A-016-cicd-gitlab-pipeline-raiz-pipelines-modulares.md +92 -0
- package/docs/adr/foundational/A-017-taxonomia-repositorios-librerias-sistemas.md +93 -0
- package/docs/adr/foundational/A-018-practicas-build-imagenes-docker.md +85 -0
- package/docs/adr/foundational/A-019-convenciones-autoria-helm-charts.md +97 -0
- package/docs/adr/foundational/A-020-entorno-desarrollo-estandarizado-devcontainer.md +58 -0
- package/docs/adr/foundational/A-022-formato-reporte-tests-ctrf.md +55 -0
- package/docs/adr/foundational/A-023-composicion-bloques-prompt-agentes.md +65 -0
- package/docs/adr/foundational/A-024-features-slices-verticales-portables.md +41 -0
- package/docs/adr/foundational/A-025-anatomia-mecanica-feature-puertos-adaptadores-drivers.md +104 -0
- package/docs/adr/foundational/A-026-infraestructura-compartida.md +44 -0
- package/docs/adr/foundational/A-027-patron-wiring-entry-point.md +67 -0
- package/docs/adr/foundational/A-029-verbos-intencion-metodos-lado-negocio.md +54 -0
- package/docs/adr/foundational/A-030-global-development-tooling.md +52 -0
- package/docs/adr/foundational/A-031-ubiquitous-language.md +64 -0
- package/docs/adr/foundational/A-032-domain-artifact-documentation-format.md +128 -0
- package/docs/adr/foundational/A-033-estandar-mensajes-commit.md +127 -0
- package/docs/adr/foundational/A-034-canonical-skill-set.md +64 -0
- package/docs/adr/foundational/A-035-captura-ideas-reanclaje-candies.md +51 -0
- package/docs/adr/foundational/A-036-adopcion-wayfinder-ortogonalidad-labels.md +37 -0
- package/docs/adr/foundational/A-037-formalizacion-taxonomia-labels.md +98 -0
- package/docs/adr/foundational/A-038-issues-referencian-skills-nombre.md +54 -0
- package/docs/adr/foundational/A-039-pipeline-ship-issues-hijos-spec.md +64 -0
- package/docs/adr/foundational/A-040-punteros-configuracion-repo-skills.md +44 -0
- package/docs/adr/foundational/A-041-estrategia-de-ramas.md +45 -0
- package/docs/adr/foundational/A-042-formato-documentos-issue-tracker.md +78 -0
- package/docs/adr/foundational/A-043-vocabulario-etiquetas-adrs.md +42 -0
- package/docs/adr/foundational/A-044-composicion-funcional-procesos-operaciones.md +44 -0
- package/docs/adr/foundational/A-045-guardrails-aplicables-no-directrices.md +48 -0
- package/docs/adr/foundational/A-046-metricas-de-forma-y-legibilidad-del-codigo.md +50 -0
- package/docs/adr/foundational/A-047-dependencias-explicitas-sin-globales-ambientales.md +40 -0
- package/docs/adr/foundational/A-048-cobertura-minima-codigo.md +39 -0
- package/docs/adr/foundational/A-049-materializacion-bucle-guardrails-extension-nativa-pi.md +49 -0
- package/docs/adr/foundational/A-050-el-caso-de-uso-pide-al-dominio-no-lee-su-representacion.md +50 -0
- package/docs/adr/foundational/A-051-orden-imports-por-distancia.md +47 -0
- package/docs/adr/foundational/A-052-distribucion-metodologia-paquete-versionado.md +42 -0
- package/docs/adr/foundational/A-053-errores-compartidos-entre-features-dos-hogares-por-capa.md +43 -0
- package/docs/adr/foundational/A-054-contrato-costura-driver-port-raw-data-canal-error.md +65 -0
- package/docs/adr/foundational/index.md +98 -0
- package/docs/adr/index.md +19 -0
- package/docs/adr/python/P-001-dependencias-por-feature-fastapi-depends.md +63 -0
- package/docs/adr/python/P-002-inyeccion-token-por-request-sin-persistirlo.md +35 -0
- package/docs/adr/python/P-003-sqlalchemy-async-connection-pooling.md +59 -0
- package/docs/adr/python/P-004-serializer-json-custom-modelos-pydantic.md +47 -0
- package/docs/adr/python/P-005-patrones-pitfalls-nicegui.md +148 -0
- package/docs/adr/python/P-006-convenciones-pytest.md +96 -0
- package/docs/adr/python/P-007-ci-python-alineacion-poetry-version-unica.md +55 -0
- package/docs/adr/python/P-008-empaquetado-infraestructura-compartida-por-tecnologia.md +38 -0
- package/docs/adr/python/index.md +14 -0
- package/docs/adr/typescript/T-001-ddd-artifact-validation-zod-primitives.md +136 -0
- package/docs/adr/typescript/T-002-test-documentation-jsdoc.md +133 -0
- package/docs/adr/typescript/T-003-readme-formatting-domain-artifacts.md +51 -0
- package/docs/adr/typescript/T-005-input-optionality-use-case-not-entity.md +130 -0
- package/docs/adr/typescript/T-006-small-enums-inlined-zod-regex.md +77 -0
- package/docs/adr/typescript/T-007-controller-input-zod-schema.md +79 -0
- package/docs/adr/typescript/T-008-expressive-use-case-pipe.md +207 -0
- package/docs/adr/typescript/T-009-mdx-brace-escaping.md +80 -0
- package/docs/adr/typescript/T-010-stack-tooling-typescript-dominio.md +53 -0
- package/docs/adr/typescript/T-011-ultra-reporter-herramienta-canonica-documentacion.md +52 -0
- package/docs/adr/typescript/T-012-npm-workspaces-estructura-monorepo-clean-architecture.md +54 -0
- package/docs/adr/typescript/T-013-definicion-eventos-versionados-ultra-ddd.md +45 -0
- package/docs/adr/typescript/T-014-publicacion-distribucion-librerias-npm-semver.md +53 -0
- package/docs/adr/typescript/T-015-method-placement-definition.md +35 -0
- package/docs/adr/typescript/T-016-contrato-settings-zod.md +34 -0
- package/docs/adr/typescript/T-017-characterization-tests-golden-files.md +39 -0
- package/docs/adr/typescript/T-018-procedencia-campos-frontmatter.md +55 -0
- package/docs/adr/typescript/T-019-ultra-generator-herramienta-canonica-generacion.md +35 -0
- package/docs/adr/typescript/T-020-ultra-settings-herramienta-canonica-exportacion-despliegue.md +36 -0
- package/docs/adr/typescript/T-021-pipe-flujo-datos-operadores-semantica-contexto-inmutable.md +105 -0
- package/docs/adr/typescript/T-022-construction-is-execution-single-boundary.md +112 -0
- package/docs/adr/typescript/T-023-registry-cli-declara-dependencias-reales.md +84 -0
- package/docs/adr/typescript/T-024-paquete-ultra-agent-manifiesto-pi-peers-cli.md +39 -0
- package/docs/adr/typescript/T-025-publicacion-npm-trusted-publishing-procedencia.md +59 -0
- package/docs/adr/typescript/index.md +30 -0
- package/eslint/index.mjs +721 -0
- package/package.json +94 -0
- package/pi/extensions/handoff/README.md +92 -0
- package/pi/extensions/handoff/handoff-prompt.txt +9 -0
- package/pi/extensions/handoff/index.ts +296 -0
- package/pi/extensions/handoff/package.json +12 -0
- package/pi/extensions/qa-guardrail/README.md +108 -0
- package/pi/extensions/qa-guardrail/adapters/cli.ts +100 -0
- package/pi/extensions/qa-guardrail/adapters/eslint.ts +90 -0
- package/pi/extensions/qa-guardrail/adapters/registry.ts +45 -0
- package/pi/extensions/qa-guardrail/baseline.ts +74 -0
- package/pi/extensions/qa-guardrail/cerco.ts +134 -0
- package/pi/extensions/qa-guardrail/check.ts +185 -0
- package/pi/extensions/qa-guardrail/config.ts +189 -0
- package/pi/extensions/qa-guardrail/delta.ts +52 -0
- package/pi/extensions/qa-guardrail/feedback.ts +26 -0
- package/pi/extensions/qa-guardrail/index.ts +311 -0
- package/pi/extensions/qa-guardrail/nstop.ts +82 -0
- package/pi/extensions/qa-guardrail/package.json +12 -0
- package/pi/extensions/qa-guardrail/selection.ts +98 -0
- package/pi/extensions/qa-guardrail/types.ts +64 -0
- package/scripts/copy-assets.sh +10 -0
- package/scripts/reconcile-tags.sh +94 -0
- package/scripts/release-beta.sh +64 -0
- package/scripts/release-build.sh +53 -0
- package/scripts/release.sh +51 -0
- package/scripts/verify-adr-consistency.py +217 -0
- package/skills/code-review/SKILL.md +66 -0
- package/skills/codebase-design/SKILL.md +46 -0
- package/skills/configure-repo/SKILL.md +33 -0
- package/skills/diagnose-bug/SKILL.md +63 -0
- package/skills/domain-modeling/SKILL.md +56 -0
- package/skills/grill-me/SKILL.md +34 -0
- package/skills/i-have-an-idea/SKILL.md +166 -0
- package/skills/implement/SKILL.md +22 -0
- package/skills/research/SKILL.md +17 -0
- package/skills/ship/SKILL.md +26 -0
- package/skills/spike/SKILL.md +27 -0
- package/skills/tdd/SKILL.md +68 -0
- package/skills/tdd/references/deep-modules.md +53 -0
- package/skills/tdd/references/interface-design.md +74 -0
- package/skills/tdd/references/mocking.md +80 -0
- package/skills/tdd/references/refactoring.md +49 -0
- package/skills/tdd/references/tests.md +184 -0
- package/skills/to-specs/SKILL.md +141 -0
- package/skills/to-tasks/SKILL.md +143 -0
- package/skills/triage/SKILL.md +73 -0
- package/skills/ultra-generator/SKILL.md +263 -0
- package/skills/ultra-generator/references/aggregate-root.md +149 -0
- package/skills/ultra-generator/references/domain-event.md +174 -0
- package/skills/ultra-generator/references/entity.md +133 -0
- package/skills/ultra-generator/references/service.md +92 -0
- package/skills/ultra-generator/references/value-object.md +135 -0
- package/skills/wayfinder/SKILL.md +201 -0
- package/skills/workflow/SKILL.md +31 -0
- package/skills/writing-for-agents/SKILL-MECHANICS.md +32 -0
- package/skills/writing-for-agents/SKILL.md +86 -0
- package/skills/writing-for-agents/references/adrs.md +19 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../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AAE,CAAC;IACf,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEhB,OAAO;QACL,KAAK;QACL,OAAO;QACP,QAAQ;QACR,KAAK,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;KAC3E,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAC,QAAkB;IAClD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAa,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motor de `install`/`update`/`status` (A-052): materializa el espejo de ADRs
|
|
3
|
+
* (A/T/P + ADR-0000 + gate), el pointer hub y el manifiesto de versión en un
|
|
4
|
+
* directorio destino inyectable — el `cwd` del consumidor en producción, un
|
|
5
|
+
* directorio temporal en los tests. Es el módulo profundo: el CLI orquesta,
|
|
6
|
+
* este decide dónde y cómo se escribe.
|
|
7
|
+
*/
|
|
8
|
+
import { MANIFEST_RELATIVE_PATH } from "./manifest";
|
|
9
|
+
import { POINTER_HUB_RELATIVE_PATH } from "./pointer-hub";
|
|
10
|
+
export { MANIFEST_RELATIVE_PATH, POINTER_HUB_RELATIVE_PATH };
|
|
11
|
+
/** Carpeta de respaldos del espejo (docs/agents/backup, A-052 §5). */
|
|
12
|
+
export declare const BACKUP_RELATIVE_PATH = "docs/agents/backup";
|
|
13
|
+
export interface PayloadFile {
|
|
14
|
+
relativePath: string;
|
|
15
|
+
content: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Payload {
|
|
18
|
+
package: string;
|
|
19
|
+
version: string;
|
|
20
|
+
files: PayloadFile[];
|
|
21
|
+
}
|
|
22
|
+
export interface InstallResult {
|
|
23
|
+
mirrored: string[];
|
|
24
|
+
pointerHub: "written" | "kept";
|
|
25
|
+
agentSkills: "created" | "appended" | "kept";
|
|
26
|
+
}
|
|
27
|
+
export interface UpdateResult {
|
|
28
|
+
drift: string[];
|
|
29
|
+
added: string[];
|
|
30
|
+
removed: string[];
|
|
31
|
+
updated: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface StatusReport {
|
|
34
|
+
installed: boolean;
|
|
35
|
+
package: string;
|
|
36
|
+
version: string;
|
|
37
|
+
drift: string[];
|
|
38
|
+
added: string[];
|
|
39
|
+
removed: string[];
|
|
40
|
+
}
|
|
41
|
+
export declare class DriftError extends Error {
|
|
42
|
+
readonly files: string[];
|
|
43
|
+
constructor(files: string[]);
|
|
44
|
+
}
|
|
45
|
+
/** Recorre el árbol del paquete y devuelve los archivos a espejar. */
|
|
46
|
+
export declare function collectPayload(packageRoot: string, version: string): Payload;
|
|
47
|
+
export declare function install(dest: string, payload: Payload): InstallResult;
|
|
48
|
+
export declare function update(dest: string, payload: Payload, options?: {
|
|
49
|
+
reset?: boolean;
|
|
50
|
+
}): UpdateResult;
|
|
51
|
+
export declare function status(dest: string, payload: Payload): StatusReport;
|
|
52
|
+
//# sourceMappingURL=materializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materializer.d.ts","sourceRoot":"","sources":["../src/materializer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,EAKL,sBAAsB,EAEvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,yBAAyB,EAG1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,CAAC;AAE7D,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAIzD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE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|
2
|
+
/**
|
|
3
|
+
* Motor de `install`/`update`/`status` (A-052): materializa el espejo de ADRs
|
|
4
|
+
* (A/T/P + ADR-0000 + gate), el pointer hub y el manifiesto de versión en un
|
|
5
|
+
* directorio destino inyectable — el `cwd` del consumidor en producción, un
|
|
6
|
+
* directorio temporal en los tests. Es el módulo profundo: el CLI orquesta,
|
|
7
|
+
* este decide dónde y cómo se escribe.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DriftError = exports.BACKUP_RELATIVE_PATH = exports.POINTER_HUB_RELATIVE_PATH = exports.MANIFEST_RELATIVE_PATH = void 0;
|
|
11
|
+
exports.collectPayload = collectPayload;
|
|
12
|
+
exports.install = install;
|
|
13
|
+
exports.update = update;
|
|
14
|
+
exports.status = status;
|
|
15
|
+
const node_fs_1 = require("node:fs");
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const manifest_1 = require("./manifest");
|
|
18
|
+
Object.defineProperty(exports, "MANIFEST_RELATIVE_PATH", { enumerable: true, get: function () { return manifest_1.MANIFEST_RELATIVE_PATH; } });
|
|
19
|
+
const pointer_hub_1 = require("./pointer-hub");
|
|
20
|
+
Object.defineProperty(exports, "POINTER_HUB_RELATIVE_PATH", { enumerable: true, get: function () { return pointer_hub_1.POINTER_HUB_RELATIVE_PATH; } });
|
|
21
|
+
const payload_1 = require("./payload");
|
|
22
|
+
/** Carpeta de respaldos del espejo (docs/agents/backup, A-052 §5). */
|
|
23
|
+
exports.BACKUP_RELATIVE_PATH = "docs/agents/backup";
|
|
24
|
+
const PACKAGE_NAME = "@imolko/ultra-agent";
|
|
25
|
+
class DriftError extends Error {
|
|
26
|
+
constructor(files) {
|
|
27
|
+
super(`Deriva detectada en el espejo (ediciones del consumidor). Resuélvelo con ` +
|
|
28
|
+
`--reset (respaldará y restaurará) o restaura a mano:\n - ${files.join("\n - ")}`);
|
|
29
|
+
this.files = files;
|
|
30
|
+
this.name = "DriftError";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.DriftError = DriftError;
|
|
34
|
+
// ── E/S de bajo nivel ─────────────────────────────────────────────────────────
|
|
35
|
+
function writeEnsured(abs, content) {
|
|
36
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(abs), { recursive: true });
|
|
37
|
+
(0, node_fs_1.writeFileSync)(abs, content);
|
|
38
|
+
}
|
|
39
|
+
function copyEnsured(from, to) {
|
|
40
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(to), { recursive: true });
|
|
41
|
+
(0, node_fs_1.copyFileSync)(from, to);
|
|
42
|
+
}
|
|
43
|
+
/** Recorre un directorio devolviendo rutas relativas normalizadas. */
|
|
44
|
+
function walk(dir) {
|
|
45
|
+
const out = [];
|
|
46
|
+
if (!(0, node_fs_1.existsSync)(dir))
|
|
47
|
+
return out;
|
|
48
|
+
for (const entry of (0, node_fs_1.readdirSync)(dir, { withFileTypes: true })) {
|
|
49
|
+
const abs = (0, node_path_1.join)(dir, entry.name);
|
|
50
|
+
if (entry.isDirectory()) {
|
|
51
|
+
for (const sub of walk(abs))
|
|
52
|
+
out.push(`${entry.name}/${sub}`);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
out.push(entry.name);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
// ── Recolección del payload desde el paquete ─────────────────────────────────
|
|
61
|
+
/** Recorre el árbol del paquete y devuelve los archivos a espejar. */
|
|
62
|
+
function collectPayload(packageRoot, version) {
|
|
63
|
+
const adrFiles = walk((0, node_path_1.join)(packageRoot, "docs", "adr")).map((f) => `docs/adr/${f}`);
|
|
64
|
+
const candidates = [...adrFiles, payload_1.GATE_RELATIVE_PATH];
|
|
65
|
+
const files = [];
|
|
66
|
+
for (const relativePath of (0, payload_1.selectPayloadFiles)(candidates)) {
|
|
67
|
+
const abs = (0, node_path_1.join)(packageRoot, relativePath);
|
|
68
|
+
if (!(0, node_fs_1.existsSync)(abs))
|
|
69
|
+
continue;
|
|
70
|
+
files.push({ relativePath, content: (0, node_fs_1.readFileSync)(abs, "utf-8") });
|
|
71
|
+
}
|
|
72
|
+
return { package: PACKAGE_NAME, version, files };
|
|
73
|
+
}
|
|
74
|
+
// ── Manifiesto y pointer hub ─────────────────────────────────────────────────
|
|
75
|
+
function writeManifest(dest, payload) {
|
|
76
|
+
const manifest = {
|
|
77
|
+
package: payload.package,
|
|
78
|
+
version: payload.version,
|
|
79
|
+
installedAt: new Date().toISOString(),
|
|
80
|
+
files: (0, manifest_1.computeHashes)(payload.files),
|
|
81
|
+
};
|
|
82
|
+
writeEnsured((0, node_path_1.join)(dest, manifest_1.MANIFEST_RELATIVE_PATH), (0, manifest_1.serializeManifest)(manifest));
|
|
83
|
+
}
|
|
84
|
+
function readManifest(dest) {
|
|
85
|
+
const abs = (0, node_path_1.join)(dest, manifest_1.MANIFEST_RELATIVE_PATH);
|
|
86
|
+
if (!(0, node_fs_1.existsSync)(abs))
|
|
87
|
+
return null;
|
|
88
|
+
try {
|
|
89
|
+
return (0, manifest_1.parseManifest)((0, node_fs_1.readFileSync)(abs, "utf-8"));
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function hashesOnDisk(dest, paths) {
|
|
96
|
+
const hashes = {};
|
|
97
|
+
for (const path of paths) {
|
|
98
|
+
const abs = (0, node_path_1.join)(dest, path);
|
|
99
|
+
if ((0, node_fs_1.existsSync)(abs)) {
|
|
100
|
+
hashes[path] = (0, manifest_1.computeHashes)([{ relativePath: path, content: (0, node_fs_1.readFileSync)(abs, "utf-8") }])[path];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return hashes;
|
|
104
|
+
}
|
|
105
|
+
function writePointerHub(dest) {
|
|
106
|
+
const abs = (0, node_path_1.join)(dest, pointer_hub_1.POINTER_HUB_RELATIVE_PATH);
|
|
107
|
+
if ((0, node_fs_1.existsSync)(abs))
|
|
108
|
+
return "kept";
|
|
109
|
+
writeEnsured(abs, (0, pointer_hub_1.renderPointerHub)());
|
|
110
|
+
return "written";
|
|
111
|
+
}
|
|
112
|
+
function writeAgentSkillsAnchor(dest) {
|
|
113
|
+
const block = (0, pointer_hub_1.renderAgentSkillsBlock)();
|
|
114
|
+
const agents = (0, node_path_1.join)(dest, "AGENTS.md");
|
|
115
|
+
const claude = (0, node_path_1.join)(dest, "CLAUDE.md");
|
|
116
|
+
const target = (0, node_fs_1.existsSync)(agents) ? agents : (0, node_fs_1.existsSync)(claude) ? claude : agents;
|
|
117
|
+
const current = (0, node_fs_1.existsSync)(target) ? (0, node_fs_1.readFileSync)(target, "utf-8") : "";
|
|
118
|
+
if (current.includes("## Agent skills"))
|
|
119
|
+
return "kept";
|
|
120
|
+
const next = current.length === 0 ? block : current.endsWith("\n") ? `${current}\n${block}` : `${current}\n\n${block}`;
|
|
121
|
+
writeEnsured(target, next);
|
|
122
|
+
return current.length === 0 ? "created" : "appended";
|
|
123
|
+
}
|
|
124
|
+
// ── Operaciones públicas ─────────────────────────────────────────────────────
|
|
125
|
+
function install(dest, payload) {
|
|
126
|
+
const mirrored = [];
|
|
127
|
+
for (const file of payload.files) {
|
|
128
|
+
writeEnsured((0, node_path_1.join)(dest, file.relativePath), file.content);
|
|
129
|
+
mirrored.push(file.relativePath);
|
|
130
|
+
}
|
|
131
|
+
const pointerHub = writePointerHub(dest);
|
|
132
|
+
const agentSkills = writeAgentSkillsAnchor(dest);
|
|
133
|
+
writeManifest(dest, payload);
|
|
134
|
+
return { mirrored, pointerHub, agentSkills };
|
|
135
|
+
}
|
|
136
|
+
function update(dest, payload, options = {}) {
|
|
137
|
+
const installed = readManifest(dest);
|
|
138
|
+
if (!installed) {
|
|
139
|
+
install(dest, payload);
|
|
140
|
+
return {
|
|
141
|
+
drift: [],
|
|
142
|
+
added: payload.files.map((f) => f.relativePath),
|
|
143
|
+
removed: [],
|
|
144
|
+
updated: [],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const onDisk = hashesOnDisk(dest, Object.keys(installed.files));
|
|
148
|
+
const driftDiff = (0, manifest_1.diffHashes)(onDisk, installed.files);
|
|
149
|
+
const drift = [...driftDiff.modified, ...driftDiff.removed].sort();
|
|
150
|
+
if (drift.length > 0 && !options.reset) {
|
|
151
|
+
throw new DriftError(drift);
|
|
152
|
+
}
|
|
153
|
+
if (options.reset) {
|
|
154
|
+
for (const path of drift) {
|
|
155
|
+
const abs = (0, node_path_1.join)(dest, path);
|
|
156
|
+
if ((0, node_fs_1.existsSync)(abs))
|
|
157
|
+
copyEnsured(abs, (0, node_path_1.join)(dest, exports.BACKUP_RELATIVE_PATH, path));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const payloadHashes = (0, manifest_1.computeHashes)(payload.files);
|
|
161
|
+
const reconcile = (0, manifest_1.diffHashes)(payloadHashes, installed.files);
|
|
162
|
+
const added = reconcile.added;
|
|
163
|
+
const removed = reconcile.removed;
|
|
164
|
+
const updated = [...reconcile.modified, ...drift].sort();
|
|
165
|
+
for (const file of payload.files) {
|
|
166
|
+
writeEnsured((0, node_path_1.join)(dest, file.relativePath), file.content);
|
|
167
|
+
}
|
|
168
|
+
for (const path of removed) {
|
|
169
|
+
const abs = (0, node_path_1.join)(dest, path);
|
|
170
|
+
if ((0, node_fs_1.existsSync)(abs))
|
|
171
|
+
(0, node_fs_1.rmSync)(abs, { force: true });
|
|
172
|
+
}
|
|
173
|
+
writeManifest(dest, payload);
|
|
174
|
+
return { drift, added, removed, updated };
|
|
175
|
+
}
|
|
176
|
+
function status(dest, payload) {
|
|
177
|
+
const installed = readManifest(dest);
|
|
178
|
+
if (!installed) {
|
|
179
|
+
return { installed: false, package: payload.package, version: payload.version, drift: [], added: [], removed: [] };
|
|
180
|
+
}
|
|
181
|
+
const onDisk = hashesOnDisk(dest, Object.keys(installed.files));
|
|
182
|
+
const driftDiff = (0, manifest_1.diffHashes)(onDisk, installed.files);
|
|
183
|
+
const drift = [...driftDiff.modified, ...driftDiff.removed].sort();
|
|
184
|
+
const reconcile = (0, manifest_1.diffHashes)((0, manifest_1.computeHashes)(payload.files), installed.files);
|
|
185
|
+
return {
|
|
186
|
+
installed: true,
|
|
187
|
+
package: installed.package,
|
|
188
|
+
version: installed.version,
|
|
189
|
+
drift,
|
|
190
|
+
added: reconcile.added,
|
|
191
|
+
removed: reconcile.removed,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=materializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materializer.js","sourceRoot":"","sources":["../src/materializer.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA2GH,wCAYC;AA0DD,0BAYC;AAED,wBA2CC;AAED,wBAoBC;AA9PD,qCAQiB;AACjB,yCAA0C;AAC1C,yCAOoB;AAQX,uGAVP,iCAAsB,OAUO;AAP/B,+CAIuB;AAGU,0GAN/B,uCAAyB,OAM+B;AAF1D,uCAAmE;AAInE,sEAAsE;AACzD,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAmC3C,MAAa,UAAW,SAAQ,KAAK;IACnC,YAA4B,KAAe;QACzC,KAAK,CACH,2EAA2E;YACzE,6DAA6D,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CACtF,CAAC;QAJwB,UAAK,GAAL,KAAK,CAAU;QAKzC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF;AARD,gCAQC;AAED,iFAAiF;AAEjF,SAAS,YAAY,CAAC,GAAW,EAAE,OAAe;IAChD,IAAA,mBAAS,EAAC,IAAA,mBAAO,EAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,IAAA,uBAAa,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC9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,CAAC,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,IAAA,qBAAU,EAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC,QAAQ,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAEnE,MAAM,SAAS,GAAG,IAAA,qBAAU,EAAC,IAAA,wBAAa,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAE5E,OAAO;QACL,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,KAAK;QACL,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,OAAO,EAAE,SAAS,CAAC,OAAO;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Raíz del paquete (un nivel por encima de `src/` en dev y de `dist-node/` en runtime). */
|
|
2
|
+
export declare function packageRoot(): string;
|
|
3
|
+
/** Versión leída del `package.json` del paquete. */
|
|
4
|
+
export declare function readPackageVersion(): string;
|
|
5
|
+
//# sourceMappingURL=package-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-root.d.ts","sourceRoot":"","sources":["../src/package-root.ts"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.packageRoot = packageRoot;
|
|
4
|
+
exports.readPackageVersion = readPackageVersion;
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
/** Raíz del paquete (un nivel por encima de `src/` en dev y de `dist-node/` en runtime). */
|
|
8
|
+
function packageRoot() {
|
|
9
|
+
return (0, node_path_1.join)(__dirname, "..");
|
|
10
|
+
}
|
|
11
|
+
/** Versión leída del `package.json` del paquete. */
|
|
12
|
+
function readPackageVersion() {
|
|
13
|
+
const raw = (0, node_fs_1.readFileSync)((0, node_path_1.join)(packageRoot(), "package.json"), "utf-8");
|
|
14
|
+
const pkg = JSON.parse(raw);
|
|
15
|
+
return pkg.version ?? "0.0.0";
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=package-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-root.js","sourceRoot":"","sources":["../src/package-root.ts"],"names":[],"mappings":";;AAIA,kCAEC;AAGD,gDAIC;AAbD,yCAAiC;AACjC,qCAAuC;AAEvC,4FAA4F;AAC5F,SAAgB,WAAW;IACzB,OAAO,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,oDAAoD;AACpD,SAAgB,kBAAkB;IAChC,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,WAAW,EAAE,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IACvE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAyB,CAAC;IACpD,OAAO,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selección del contenido distribuible del paquete (A-052 §2): los tiers A, T y P
|
|
3
|
+
* (con sus índices), el meta-ADR ADR-0000, el índice raíz del registro y el gate de
|
|
4
|
+
* consistencia. El tier de proyecto de un consumidor concreto queda fuera.
|
|
5
|
+
*
|
|
6
|
+
* Funciones puras: reciben una lista de rutas relativas al paquete y devuelven la
|
|
7
|
+
* lista de archivos a espejar, sin E/S.
|
|
8
|
+
*/
|
|
9
|
+
/** Ruta relativa del gate de consistencia dentro del paquete (y del consumidor). */
|
|
10
|
+
export declare const GATE_RELATIVE_PATH = "scripts/verify-adr-consistency.py";
|
|
11
|
+
/**
|
|
12
|
+
* ¿Es un archivo del registro ADR canónico (tier A/T/P o ADR-0000 o índice raíz)?
|
|
13
|
+
* Un archivo `.md` en la raíz de `docs/adr/` con prefijo propio (p. ej. `G-`) es
|
|
14
|
+
* tier de proyecto y queda excluido.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isCanonicalAdr(relativePath: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Devuelve la lista de archivos a espejar (ADRs canónicos + gate), ordenada.
|
|
19
|
+
* Excluye el tier de proyecto y cualquier archivo que no sea payload.
|
|
20
|
+
*/
|
|
21
|
+
export declare function selectPayloadFiles(files: string[]): string[];
|
|
22
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../src/payload.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,sCAAsC,CAAC;AAQtE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAY5D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAM5D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Selección del contenido distribuible del paquete (A-052 §2): los tiers A, T y P
|
|
4
|
+
* (con sus índices), el meta-ADR ADR-0000, el índice raíz del registro y el gate de
|
|
5
|
+
* consistencia. El tier de proyecto de un consumidor concreto queda fuera.
|
|
6
|
+
*
|
|
7
|
+
* Funciones puras: reciben una lista de rutas relativas al paquete y devuelven la
|
|
8
|
+
* lista de archivos a espejar, sin E/S.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.GATE_RELATIVE_PATH = void 0;
|
|
12
|
+
exports.isCanonicalAdr = isCanonicalAdr;
|
|
13
|
+
exports.selectPayloadFiles = selectPayloadFiles;
|
|
14
|
+
/** Ruta relativa del gate de consistencia dentro del paquete (y del consumidor). */
|
|
15
|
+
exports.GATE_RELATIVE_PATH = "scripts/verify-adr-consistency.py";
|
|
16
|
+
const TIER_DIRS = ["foundational", "typescript", "python"];
|
|
17
|
+
function normalize(path) {
|
|
18
|
+
return path.replace(/\\/g, "/");
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* ¿Es un archivo del registro ADR canónico (tier A/T/P o ADR-0000 o índice raíz)?
|
|
22
|
+
* Un archivo `.md` en la raíz de `docs/adr/` con prefijo propio (p. ej. `G-`) es
|
|
23
|
+
* tier de proyecto y queda excluido.
|
|
24
|
+
*/
|
|
25
|
+
function isCanonicalAdr(relativePath) {
|
|
26
|
+
const path = normalize(relativePath);
|
|
27
|
+
for (const dir of TIER_DIRS) {
|
|
28
|
+
if (path.startsWith(`docs/adr/${dir}/`) && path.endsWith(".md")) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (/^docs\/adr\/ADR-0000[^/]*\.md$/.test(path))
|
|
33
|
+
return true;
|
|
34
|
+
if (path === "docs/adr/index.md")
|
|
35
|
+
return true;
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Devuelve la lista de archivos a espejar (ADRs canónicos + gate), ordenada.
|
|
40
|
+
* Excluye el tier de proyecto y cualquier archivo que no sea payload.
|
|
41
|
+
*/
|
|
42
|
+
function selectPayloadFiles(files) {
|
|
43
|
+
const selected = files.filter((file) => {
|
|
44
|
+
const path = normalize(file);
|
|
45
|
+
return isCanonicalAdr(path) || path === exports.GATE_RELATIVE_PATH;
|
|
46
|
+
});
|
|
47
|
+
return selected.s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CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hub de punteros neutral al harness (A-052 §6): plantilla de
|
|
3
|
+
* `docs/agents/repo-config.md` (cinco punteros con defaults Imolko) y del bloque
|
|
4
|
+
* `## Agent skills` que ancla `AGENTS.md`/`CLAUDE.md` al hub. Render puro: el
|
|
5
|
+
* materializador lo escribe a disco.
|
|
6
|
+
*/
|
|
7
|
+
/** Ruta relativa del hub dentro del consumidor (docs/agents/, A-052). */
|
|
8
|
+
export declare const POINTER_HUB_RELATIVE_PATH = "docs/agents/repo-config.md";
|
|
9
|
+
export interface RepoPointers {
|
|
10
|
+
adr_dir: string;
|
|
11
|
+
domain_dir: string;
|
|
12
|
+
issue_language: string;
|
|
13
|
+
tracker_cli: string;
|
|
14
|
+
ship_cmd: string;
|
|
15
|
+
}
|
|
16
|
+
/** Defaults Imolko — el hub los escribe; el consumidor edita solo si diverge. */
|
|
17
|
+
export declare const DEFAULT_POINTERS: RepoPointers;
|
|
18
|
+
/** Renderiza el contenido de `docs/agents/repo-config.md`. */
|
|
19
|
+
export declare function renderPointerHub(pointers?: RepoPointers): string;
|
|
20
|
+
/** Renderiza el bloque `## Agent skills` que ancla `AGENTS.md`/`CLAUDE.md` al hub. */
|
|
21
|
+
export declare function renderAgentSkillsBlock(): string;
|
|
22
|
+
//# sourceMappingURL=pointer-hub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer-hub.d.ts","sourceRoot":"","sources":["../src/pointer-hub.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,+BAA+B,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,YAM9B,CAAC;AAEF,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,QAAQ,GAAE,YAA+B,GAAG,MAAM,CAiBlF;AAED,sFAAsF;AACtF,wBAAgB,sBAAsB,IAAI,MAAM,CAQ/C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Hub de punteros neutral al harness (A-052 §6): plantilla de
|
|
4
|
+
* `docs/agents/repo-config.md` (cinco punteros con defaults Imolko) y del bloque
|
|
5
|
+
* `## Agent skills` que ancla `AGENTS.md`/`CLAUDE.md` al hub. Render puro: el
|
|
6
|
+
* materializador lo escribe a disco.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DEFAULT_POINTERS = exports.POINTER_HUB_RELATIVE_PATH = void 0;
|
|
10
|
+
exports.renderPointerHub = renderPointerHub;
|
|
11
|
+
exports.renderAgentSkillsBlock = renderAgentSkillsBlock;
|
|
12
|
+
/** Ruta relativa del hub dentro del consumidor (docs/agents/, A-052). */
|
|
13
|
+
exports.POINTER_HUB_RELATIVE_PATH = "docs/agents/repo-config.md";
|
|
14
|
+
/** Defaults Imolko — el hub los escribe; el consumidor edita solo si diverge. */
|
|
15
|
+
exports.DEFAULT_POINTERS = {
|
|
16
|
+
adr_dir: "docs/adr/",
|
|
17
|
+
domain_dir: "domain/",
|
|
18
|
+
issue_language: "es",
|
|
19
|
+
tracker_cli: "glab",
|
|
20
|
+
ship_cmd: "npx @imolko/ultra-agent ship",
|
|
21
|
+
};
|
|
22
|
+
/** Renderiza el contenido de `docs/agents/repo-config.md`. */
|
|
23
|
+
function renderPointerHub(pointers = exports.DEFAULT_POINTERS) {
|
|
24
|
+
const rows = Object.entries(pointers)
|
|
25
|
+
.map(([key, value]) => `| \`${key}\` | \`${value}\` |`)
|
|
26
|
+
.join("\n");
|
|
27
|
+
return [
|
|
28
|
+
"# Repo Config",
|
|
29
|
+
"",
|
|
30
|
+
"Punteros de configuración del repositorio. Los skills los leen en lugar de",
|
|
31
|
+
"hardcodear rutas (A-052). Escritos por `npx @imolko/ultra-agent install`;",
|
|
32
|
+
"edítalos solo si este repo diverge de los defaults Imolko.",
|
|
33
|
+
"",
|
|
34
|
+
"| Puntero | Valor |",
|
|
35
|
+
"|---------|-------|",
|
|
36
|
+
rows,
|
|
37
|
+
"",
|
|
38
|
+
].join("\n");
|
|
39
|
+
}
|
|
40
|
+
/** Renderiza el bloque `## Agent skills` que ancla `AGENTS.md`/`CLAUDE.md` al hub. */
|
|
41
|
+
function renderAgentSkillsBlock() {
|
|
42
|
+
return [
|
|
43
|
+
"## Agent skills",
|
|
44
|
+
"",
|
|
45
|
+
"Punteros del repositorio: [`docs/agents/repo-config.md`](./docs/agents/repo-config.md).",
|
|
46
|
+
"Metodología ultra: `npx @imolko/ultra-agent install` / `update` / `status`.",
|
|
47
|
+
"",
|
|
48
|
+
].join("\n");
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=pointer-hub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer-hub.js","sourceRoot":"","sources":["../src/pointer-hub.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAuBH,4CAiBC;AAGD,wDAQC;AAjDD,yEAAyE;AAC5D,QAAA,yBAAyB,GAAG,4BAA4B,CAAC;AAUtE,iFAAiF;AACpE,QAAA,gBAAgB,GAAiB;IAC5C,OAAO,EAAE,WAAW;IACpB,UAAU,EAAE,SAAS;IACrB,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,8BAA8B;CACzC,CAAC;AAEF,8DAA8D;AAC9D,SAAgB,gBAAgB,CAAC,WAAyB,wBAAgB;IACxE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SAClC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,GAAG,UAAU,KAAK,MAAM,CAAC;SACtD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;QACL,eAAe;QACf,EAAE;QACF,4EAA4E;QAC5E,2EAA2E;QAC3E,4DAA4D;QAC5D,EAAE;QACF,qBAAqB;QACrB,qBAAqB;QACrB,IAAI;QACJ,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,sFAAsF;AACtF,SAAgB,sBAAsB;IACpC,OAAO;QACL,iBAAiB;QACjB,EAAE;QACF,yFAAyF;QACzF,6EAA6E;QAC7E,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI de enrutado de publicación para los scripts de release (T-025).
|
|
3
|
+
*
|
|
4
|
+
* Uso: `node dist-node/publication.cli.js <id_token>` — decodifica el claim
|
|
5
|
+
* `runner_environment` del token OIDC y escribe `direct` o `staged` en stdout.
|
|
6
|
+
* Sale siempre con código 0: un token ausente o indescifrable enruta a `staged`.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=publication.cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publication.cli.d.ts","sourceRoot":"","sources":["../src/publication.cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI de enrutado de publicación para los scripts de release (T-025).
|
|
4
|
+
*
|
|
5
|
+
* Uso: `node dist-node/publication.cli.js <id_token>` — decodifica el claim
|
|
6
|
+
* `runner_environment` del token OIDC y escribe `direct` o `staged` en stdout.
|
|
7
|
+
* Sale siempre con código 0: un token ausente o indescifrable enruta a `staged`.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const publication_1 = require("./publication");
|
|
11
|
+
function main() {
|
|
12
|
+
const idToken = process.argv[2];
|
|
13
|
+
const runnerEnvironment = (0, publication_1.readRunnerEnvironment)(idToken);
|
|
14
|
+
process.stdout.write(`${(0, publication_1.publicationPath)(runnerEnvironment)}\n`);
|
|
15
|
+
}
|
|
16
|
+
main();
|
|
17
|
+
//# sourceMappingURL=publication.cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publication.cli.js","sourceRoot":"","sources":["../src/publication.cli.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,+CAAuE;AAEvE,SAAS,IAAI;IACX,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,iBAAiB,GAAG,IAAA,mCAAqB,EAAC,OAAO,CAAC,CAAC;IACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,6BAAe,EAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enrutado de publicación npm a partir del claim `runner_environment` del token
|
|
3
|
+
* OIDC (T-025): un runner alojado de GitLab publica directo con Trusted
|
|
4
|
+
* Publishing; cualquier otro entorno hace staging con un token stage-only.
|
|
5
|
+
*
|
|
6
|
+
* Funciones puras: ninguna toca el sistema de archivos ni el shell. El CLI
|
|
7
|
+
* (`publication.cli.ts`) las expone a los scripts de release; los tests las
|
|
8
|
+
* ejercen directamente sobre tokens JWT de ejemplo.
|
|
9
|
+
*/
|
|
10
|
+
export type PublicationPath = "direct" | "staged";
|
|
11
|
+
/**
|
|
12
|
+
* Decodifica el payload de un JWT (base64url) y devuelve el valor del claim
|
|
13
|
+
* `runner_environment`. Devuelve `undefined` si no hay token, si falta el claim
|
|
14
|
+
* o si el token no se puede decodificar (el camino seguro es el staging).
|
|
15
|
+
*/
|
|
16
|
+
export declare function readRunnerEnvironment(idToken: string | undefined): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Decide el camino de publicación: `direct` solo para runners alojados de
|
|
19
|
+
* GitLab (`gitlab-hosted`); `staged` para cualquier otro valor, incluido
|
|
20
|
+
* `undefined`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function publicationPath(runnerEnvironment: string | undefined): PublicationPath;
|
|
23
|
+
//# sourceMappingURL=publication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publication.d.ts","sourceRoot":"","sources":["../src/publication.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAIlD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAoBrF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,CAEtF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Enrutado de publicación npm a partir del claim `runner_environment` del token
|
|
4
|
+
* OIDC (T-025): un runner alojado de GitLab publica directo con Trusted
|
|
5
|
+
* Publishing; cualquier otro entorno hace staging con un token stage-only.
|
|
6
|
+
*
|
|
7
|
+
* Funciones puras: ninguna toca el sistema de archivos ni el shell. El CLI
|
|
8
|
+
* (`publication.cli.ts`) las expone a los scripts de release; los tests las
|
|
9
|
+
* ejercen directamente sobre tokens JWT de ejemplo.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.readRunnerEnvironment = readRunnerEnvironment;
|
|
13
|
+
exports.publicationPath = publicationPath;
|
|
14
|
+
const GITLAB_HOSTED = "gitlab-hosted";
|
|
15
|
+
/**
|
|
16
|
+
* Decodifica el payload de un JWT (base64url) y devuelve el valor del claim
|
|
17
|
+
* `runner_environment`. Devuelve `undefined` si no hay token, si falta el claim
|
|
18
|
+
* o si el token no se puede decodificar (el camino seguro es el staging).
|
|
19
|
+
*/
|
|
20
|
+
function readRunnerEnvironment(idToken) {
|
|
21
|
+
if (!idToken)
|
|
22
|
+
return undefined;
|
|
23
|
+
const parts = idToken.split(".");
|
|
24
|
+
if (parts.length !== 3)
|
|
25
|
+
return undefined;
|
|
26
|
+
const payload = parts[1];
|
|
27
|
+
if (!payload)
|
|
28
|
+
return undefined;
|
|
29
|
+
try {
|
|
30
|
+
const decoded = JSON.parse(Buffer.from(payload, "base64url").toString("utf-8"));
|
|
31
|
+
return typeof decoded.runner_environment === "string"
|
|
32
|
+
? decoded.runner_environment
|
|
33
|
+
: undefined;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Decide el camino de publicación: `direct` solo para runners alojados de
|
|
41
|
+
* GitLab (`gitlab-hosted`); `staged` para cualquier otro valor, incluido
|
|
42
|
+
* `undefined`.
|
|
43
|
+
*/
|
|
44
|
+
function publicationPath(runnerEnvironment) {
|
|
45
|
+
return runnerEnvironment === GITLAB_HOSTED ? "direct" : "staged";
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=publication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publication.js","sourceRoot":"","sources":["../src/publication.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAWH,sDAoBC;AAOD,0CAEC;AApCD,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,OAA2B;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAEzC,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CACzB,CAAC;QAE7B,OAAO,OAAO,OAAO,CAAC,kBAAkB,KAAK,QAAQ;YACnD,CAAC,CAAC,OAAO,CAAC,kBAAkB;YAC5B,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,iBAAqC;IACnE,OAAO,iBAAiB,KAAK,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI de reconciliación de etiquetas para los scripts de release (T-025).
|
|
3
|
+
*
|
|
4
|
+
* Uso: `node dist-node/reconcile.cli.js < entrada.json` — lee de stdin un JSON
|
|
5
|
+
* con `{ "published": [{ "version": string, "gitHead": string|null }], "existingTags": [string] }`
|
|
6
|
+
* y escribe en stdout un plan por línea, `version\tcommit`, para cada versión
|
|
7
|
+
* publicada que no tenga etiqueta. Las versiones sin `gitHead` se reportan en
|
|
8
|
+
* stderr y no se incluyen en los planes. Sale con 0 salvo entrada inválida.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=reconcile.cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.cli.d.ts","sourceRoot":"","sources":["../src/reconcile.cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI de reconciliación de etiquetas para los scripts de release (T-025).
|
|
4
|
+
*
|
|
5
|
+
* Uso: `node dist-node/reconcile.cli.js < entrada.json` — lee de stdin un JSON
|
|
6
|
+
* con `{ "published": [{ "version": string, "gitHead": string|null }], "existingTags": [string] }`
|
|
7
|
+
* y escribe en stdout un plan por línea, `version\tcommit`, para cada versión
|
|
8
|
+
* publicada que no tenga etiqueta. Las versiones sin `gitHead` se reportan en
|
|
9
|
+
* stderr y no se incluyen en los planes. Sale con 0 salvo entrada inválida.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const reconcile_1 = require("./reconcile");
|
|
14
|
+
function parseInput(raw) {
|
|
15
|
+
const parsed = JSON.parse(raw);
|
|
16
|
+
return {
|
|
17
|
+
published: Array.isArray(parsed.published) ? parsed.published : [],
|
|
18
|
+
existingTags: Array.isArray(parsed.existingTags) ? parsed.existingTags : [],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function main() {
|
|
22
|
+
let input;
|
|
23
|
+
try {
|
|
24
|
+
input = parseInput((0, node_fs_1.readFileSync)(0, "utf-8"));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
process.stderr.write('Entrada inválida: se espera JSON en stdin con { "published": [], "existingTags": [] }.\n');
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
for (const version of (0, reconcile_1.versionsWithoutGitHead)(input.published)) {
|
|
32
|
+
process.stderr.write(`Sin gitHead: ${version} (no se etiqueta)\n`);
|
|
33
|
+
}
|
|
34
|
+
for (const plan of (0, reconcile_1.missingTags)(input.published, input.existingTags)) {
|
|
35
|
+
process.stdout.write(`${plan.version}\t${plan.commit}\n`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
main();
|
|
39
|
+
//# sourceMappingURL=reconcile.cli.js.map
|