@pattern-stack/codegen 0.11.0 → 0.12.1

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 (37) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/runtime/subsystems/index.d.ts +7 -3
  3. package/dist/runtime/subsystems/index.js +993 -19
  4. package/dist/runtime/subsystems/index.js.map +1 -1
  5. package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.d.ts +25 -0
  6. package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js +34 -0
  7. package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js.map +1 -0
  8. package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.d.ts +53 -0
  9. package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js +13 -0
  10. package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js.map +1 -0
  11. package/dist/runtime/subsystems/integration/execute-integration.use-case.js.map +1 -1
  12. package/dist/runtime/subsystems/integration/index.d.ts +3 -1
  13. package/dist/runtime/subsystems/integration/index.js +35 -0
  14. package/dist/runtime/subsystems/integration/index.js.map +1 -1
  15. package/dist/runtime/subsystems/integration/integration-cursor-store.drizzle-backend.js.map +1 -1
  16. package/dist/runtime/subsystems/integration/integration-run-recorder.drizzle-backend.js.map +1 -1
  17. package/dist/runtime/subsystems/integration/integration.module.js.map +1 -1
  18. package/dist/runtime/subsystems/integration/integration.tokens.d.ts +14 -1
  19. package/dist/runtime/subsystems/integration/integration.tokens.js +2 -0
  20. package/dist/runtime/subsystems/integration/integration.tokens.js.map +1 -1
  21. package/dist/runtime/subsystems/observability/index.js.map +1 -1
  22. package/dist/runtime/subsystems/observability/observability.module.js.map +1 -1
  23. package/dist/runtime/subsystems/observability/observability.service.js.map +1 -1
  24. package/dist/src/cli/index.js +1100 -108
  25. package/dist/src/cli/index.js.map +1 -1
  26. package/dist/src/index.d.ts +48 -0
  27. package/dist/src/index.js +99 -3
  28. package/dist/src/index.js.map +1 -1
  29. package/package.json +9 -1
  30. package/runtime/subsystems/index.ts +15 -0
  31. package/runtime/subsystems/integration/entity-change-source-registry.memory.ts +40 -0
  32. package/runtime/subsystems/integration/entity-change-source-registry.protocol.ts +59 -0
  33. package/runtime/subsystems/integration/index.ts +9 -0
  34. package/runtime/subsystems/integration/integration.tokens.ts +14 -0
  35. package/templates/entity/new/clean-lite-ps/entity.ejs.t +12 -3
  36. package/templates/entity/new/clean-lite-ps/prompt-extension.js +212 -29
  37. package/templates/entity/new/backend/modules/core/integration-source.providers.ejs.t +0 -18
package/CHANGELOG.md CHANGED
@@ -4,6 +4,93 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.12.1] — 2026-05-31
8
+
9
+ Track D (provider/adapter integration codegen) discoverability fix. The 0.12.0
10
+ generator wiring is correct and shipped — provider + adapter emission runs as a
11
+ post-step of `codegen entity new` whenever `definitions/providers/*.yaml` exist
12
+ — but nothing in the CLI surfaced that, so consumers searched `--help` for a
13
+ `provider` / `integration` / `gen` command, found none, and mistook a working
14
+ feature for a publish gap. Docs-and-help only; no generator behavior changed.
15
+
16
+ ### Changed
17
+
18
+ - **`codegen entity new --help`** now documents every post-generation step it
19
+ runs (event / bridge / orchestration / **provider + adapter (Track D)**
20
+ codegen), including Track D's trigger (`definitions/providers/*.yaml`), output
21
+ paths (`<backendSrc>/integrations/{providers,}`), emit-once semantics, and an
22
+ explicit note that there is no standalone `provider` / `integration` / `gen`
23
+ command — Track D is driven entirely by re-running `entity new`.
24
+ - **`codegen entity` summary hints** now surface a Track D regen hint when the
25
+ project has a providers directory — a discoverability path that does not
26
+ require reading `entity new --help`.
27
+ - **Integration domain skill** (`protocols-and-ports.md`, `SKILL.md`) documents
28
+ the Track D invocation, the skip-when-no-providers-dir behavior, and that the
29
+ generated scaffold (not the `.d.ts`) is ground truth for adapter port shape.
30
+
31
+ ## [0.12.0] — 2026-05-31
32
+
33
+ Integration codegen retarget (RFC-0001): a **provider/adapter/surface** model
34
+ for integration codegen, plus a **surface-package framework**. Additive over
35
+ 0.11.0 — new declarative inputs and emitted artifacts; existing entity codegen
36
+ is unchanged. The one breaking item (the ADR-033.2 per-entity provider tuples)
37
+ has no consumers. Consumers adopt by adding `definitions/providers/*.yaml` and
38
+ regenerating. Ships alongside four independently-versioned **surface packages**
39
+ (`@pattern-stack/codegen-{crm,calendar,mail,transcript}`) at `0.1.1`. (Their
40
+ initial `0.1.0` release peer-depended on `@pattern-stack/codegen` `^0.11.0`,
41
+ which predates the `./subsystems` export they require; `0.1.1` corrects the peer
42
+ to `^0.12.0`. The peer source fix merged with 0.12.0 but the version bump was
43
+ missed — this completes it.)
44
+
45
+ ### ⚠ BREAKING CHANGES
46
+
47
+ - **ADR-033.2 per-entity provider tuples removed.** The
48
+ `<entity>-integration-source.providers.ts` emission (`<ENTITY>_PROVIDERS`
49
+ const + `<Entity>Provider` type) is deleted. Its replacement is the
50
+ surface-scoped, codegen-owned typed view at
51
+ `src/integrations/<surface>/types.generated.ts` (`<Surface>Provider` /
52
+ `<Surface>Entity` unions + a `(provider, entity)` validity map) — a single
53
+ source of provider truth. ADR-033.2 is superseded by RFC-0001. No published
54
+ consumers depend on the tuples.
55
+
56
+ ### Added
57
+
58
+ - **Track C — surface-package framework (ADR-036).** First-class L2 *surface
59
+ packages* shipping type-shaped ports + DI tokens + an L3 composing port per
60
+ integration surface:
61
+ - **L1** — `IEntityChangeSourceRegistry` (entity-keyed change-source
62
+ resolver) + `MemoryEntityChangeSourceRegistry` + the
63
+ `ENTITY_CHANGE_SOURCE_REGISTRY` token, in the integration subsystem;
64
+ exported across the package boundary via `@pattern-stack/codegen/subsystems`.
65
+ - **`@pattern-stack/codegen-crm`** — L2 CRM ports (`IFieldDefinitionReader`,
66
+ `IPicklistReader`, `IAssociationReader`), the `CrmCapabilities` descriptor,
67
+ and the L3 entity-agnostic **`CrmPort`** composing port + `assertCrmAdapter`
68
+ conformance helper (on the `/testing` subpath).
69
+ - **`@pattern-stack/codegen-{calendar,mail,transcript}`** — incremental-read
70
+ interaction surfaces (`CalendarPort` / `MailPort` / `TranscriptPort`,
71
+ canonical types, capability descriptors). Independently versioned (`0.1.1`).
72
+ - **Track D — provider/adapter integration codegen (RFC-0001).**
73
+ - `definitions/providers/<provider>.yaml` — providers as first-class
74
+ declarative artifacts (slug, auth strategy, client, surfaces); Zod schema +
75
+ validator with a **pre-flight import-path check** (a missing
76
+ strategy/client export fails `cdp gen`, not NestJS boot), surface
77
+ cross-check, and slug-uniqueness.
78
+ - Emits, per provider × surface: a `<provider>.provider.module.ts`, an
79
+ **emit-once** `<provider>-<surface>.adapter.ts` scaffold (sentinel-guarded,
80
+ author-owned after first emit), fully codegen-owned adapter modules +
81
+ barrels, a per-surface registry (`<SURFACE>_ADAPTER_CONTRIBUTIONS` →
82
+ `<SURFACE>_ENTITY_SOURCES`, folding into the L1 registry), and the
83
+ `types.generated.ts` typed view.
84
+ - Optional entity-YAML **`surface:`** field — the declarative input the
85
+ provider/adapter emission groups entities by.
86
+ - **`context:` output-folder grouping (#403).** An optional top-level entity
87
+ `context:` nests its generated module folder under that segment
88
+ (`<modules>/<context>/<plural>/`); no context → flat (byte-identical to
89
+ before).
90
+ - **Multi-package release.** `just publish` publishes the root plus every
91
+ opted-in `packages/*` (those declaring `publishConfig.access: public`) at its
92
+ own independent version, skipping versions already on npm.
93
+
7
94
  ## [0.11.0] — 2026-05-30
8
95
 
9
96
  Vocabulary rename per **ADR-0005 (swe-brain `.ai-docs/decisions/ADR-0005-rename-sync-to-integration.md`)**:
@@ -19,6 +19,12 @@ export { IObservability } from './observability/observability.protocol.js';
19
19
  export { OBSERVABILITY, OBSERVABILITY_MODULE_OPTIONS } from './observability/observability.tokens.js';
20
20
  export { ObservabilityModule, ObservabilityModuleOptions } from './observability/observability.module.js';
21
21
  export { ObservabilityError } from './observability/observability-errors.js';
22
+ export { IChangeSource } from './integration/integration-change-source.protocol.js';
23
+ export { CursorSnapshot } from './integration/integration-cursor-store.protocol.js';
24
+ export { IntegrationRunSummary } from './integration/integration-run-recorder.protocol.js';
25
+ export { IEntityChangeSourceRegistry, UnknownEntityError } from './integration/entity-change-source-registry.protocol.js';
26
+ export { MemoryEntityChangeSourceRegistry } from './integration/entity-change-source-registry.memory.js';
27
+ export { ENTITY_CHANGE_SOURCE_REGISTRY } from './integration/integration.tokens.js';
22
28
  export { AuthCredentials, AuthResolveOptions, IAuthStrategy } from './auth/protocols/auth-strategy.js';
23
29
  export { IEncryptionKey } from './auth/protocols/encryption-key.js';
24
30
  export { IOAuthStateStore, OAuthStateError, OAuthStateRecord } from './auth/protocols/oauth-state-store.js';
@@ -36,8 +42,6 @@ export { MemoryOAuthStateStore } from './auth/backends/state-store.memory-backen
36
42
  export { DrizzleOAuthStateStore } from './auth/backends/state-store.drizzle-backend.js';
37
43
  export { AuthController } from './auth/controllers/auth.controller.js';
38
44
  export { AuthModule } from './auth/auth.module.js';
39
- export { CursorSnapshot } from './integration/integration-cursor-store.protocol.js';
40
- export { IntegrationRunSummary } from './integration/integration-run-recorder.protocol.js';
41
45
  export { StatusHistogram } from './bridge/bridge.protocol.js';
42
46
  import '../types/drizzle.js';
43
47
  import 'drizzle-orm/node-postgres';
@@ -47,7 +51,7 @@ import 'drizzle-orm/pg-core';
47
51
  import 'drizzle-orm';
48
52
  import '../../job-orchestrator.protocol-CHOEqBDk.js';
49
53
  import './events/generated/types.js';
50
- import '../base-classes/tenant-context.js';
51
54
  import './integration/integration-field-diff.protocol.js';
52
55
  import 'zod';
56
+ import '../base-classes/tenant-context.js';
53
57
  import './bridge/bridge-delivery.schema.js';