@pattern-stack/codegen 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +51 -0
  3. package/consumer-skills/codegen/SKILL.md +32 -0
  4. package/consumer-skills/entities/SKILL.md +2 -0
  5. package/dist/{chunk-X6BP6LI5.js → chunk-235ZMMJR.js} +3 -3
  6. package/dist/{chunk-BK5ICA2F.js → chunk-4MVGAMUA.js} +4 -4
  7. package/dist/{chunk-2VGVSL2D.js → chunk-65MO75WM.js} +8 -8
  8. package/dist/{chunk-NXHL5YII.js → chunk-7LKAMLV4.js} +4 -4
  9. package/dist/{chunk-5RT7JGKT.js → chunk-7OVCARTQ.js} +4 -4
  10. package/dist/{chunk-EWYI5GGJ.js → chunk-AZLUWG5S.js} +13 -13
  11. package/dist/{chunk-RKNW56RU.js → chunk-B34G6PHD.js} +8 -8
  12. package/dist/{chunk-IN3EWFB4.js → chunk-BHZP6LOV.js} +4 -4
  13. package/dist/{chunk-W2UIDI3R.js → chunk-CLWBNXKF.js} +4 -4
  14. package/dist/{chunk-7MMS36AN.js → chunk-E6PLM6QG.js} +9 -9
  15. package/dist/{chunk-CFFTPWHM.js → chunk-F7KN3U6U.js} +44 -5
  16. package/dist/chunk-F7KN3U6U.js.map +1 -0
  17. package/dist/{chunk-VHAR2BGH.js → chunk-GM3RMJIJ.js} +4 -4
  18. package/dist/{chunk-R4BPUUB5.js → chunk-OZEPJGMA.js} +4 -4
  19. package/dist/{chunk-TBGTMALE.js → chunk-R6F6KFIL.js} +4 -4
  20. package/dist/{chunk-YZLBU6O2.js → chunk-SNH35CNA.js} +5 -5
  21. package/dist/{chunk-C5E7H553.js → chunk-VDL5CJ5C.js} +7 -7
  22. package/dist/{chunk-3A34R6CI.js → chunk-VNBC3VXM.js} +7 -7
  23. package/dist/{chunk-E45CSC33.js → chunk-XKWOJZZ4.js} +2 -2
  24. package/dist/{chunk-LQ6PYFU6.js → chunk-Z7PQCAVK.js} +4 -4
  25. package/dist/runtime/subsystems/auth/auth.module.js +4 -4
  26. package/dist/runtime/subsystems/auth/index.js +9 -9
  27. package/dist/runtime/subsystems/bridge/bridge-delivery-handler.js +2 -2
  28. package/dist/runtime/subsystems/bridge/bridge-delivery.drizzle-backend.js +2 -2
  29. package/dist/runtime/subsystems/bridge/bridge-outbox-drain-hook.js +6 -6
  30. package/dist/runtime/subsystems/bridge/bridge.module.js +16 -16
  31. package/dist/runtime/subsystems/bridge/event-flow.service.js +2 -2
  32. package/dist/runtime/subsystems/bridge/index.js +19 -19
  33. package/dist/runtime/subsystems/events/event-bus.drizzle-backend.js +3 -3
  34. package/dist/runtime/subsystems/events/event-bus.memory-backend.js +2 -2
  35. package/dist/runtime/subsystems/events/events.module.js +7 -7
  36. package/dist/runtime/subsystems/events/generated/bus.js +2 -2
  37. package/dist/runtime/subsystems/events/generated/index.js +2 -2
  38. package/dist/runtime/subsystems/events/index.js +10 -10
  39. package/dist/runtime/subsystems/index.js +78 -78
  40. package/dist/runtime/subsystems/jobs/index.js +29 -29
  41. package/dist/runtime/subsystems/jobs/job-orchestrator.bullmq-backend.js +5 -5
  42. package/dist/runtime/subsystems/jobs/job-orchestrator.drizzle-backend.js +3 -3
  43. package/dist/runtime/subsystems/jobs/job-run-service.drizzle-backend.js +3 -3
  44. package/dist/runtime/subsystems/jobs/job-run-service.memory-backend.js +2 -2
  45. package/dist/runtime/subsystems/jobs/job-worker.js +3 -3
  46. package/dist/runtime/subsystems/jobs/job-worker.module.js +10 -10
  47. package/dist/runtime/subsystems/jobs/jobs-domain.module.js +8 -8
  48. package/dist/runtime/subsystems/observability/index.js +3 -3
  49. package/dist/runtime/subsystems/observability/observability.module.js +3 -3
  50. package/dist/runtime/subsystems/observability/observability.service.js +2 -2
  51. package/dist/runtime/subsystems/storage/index.js +4 -4
  52. package/dist/runtime/subsystems/storage/storage.module.js +2 -2
  53. package/dist/src/cli/index.js +146 -11
  54. package/dist/src/cli/index.js.map +1 -1
  55. package/dist/src/index.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/chunk-CFFTPWHM.js.map +0 -1
  58. /package/dist/{chunk-X6BP6LI5.js.map → chunk-235ZMMJR.js.map} +0 -0
  59. /package/dist/{chunk-BK5ICA2F.js.map → chunk-4MVGAMUA.js.map} +0 -0
  60. /package/dist/{chunk-2VGVSL2D.js.map → chunk-65MO75WM.js.map} +0 -0
  61. /package/dist/{chunk-NXHL5YII.js.map → chunk-7LKAMLV4.js.map} +0 -0
  62. /package/dist/{chunk-5RT7JGKT.js.map → chunk-7OVCARTQ.js.map} +0 -0
  63. /package/dist/{chunk-EWYI5GGJ.js.map → chunk-AZLUWG5S.js.map} +0 -0
  64. /package/dist/{chunk-RKNW56RU.js.map → chunk-B34G6PHD.js.map} +0 -0
  65. /package/dist/{chunk-IN3EWFB4.js.map → chunk-BHZP6LOV.js.map} +0 -0
  66. /package/dist/{chunk-W2UIDI3R.js.map → chunk-CLWBNXKF.js.map} +0 -0
  67. /package/dist/{chunk-7MMS36AN.js.map → chunk-E6PLM6QG.js.map} +0 -0
  68. /package/dist/{chunk-VHAR2BGH.js.map → chunk-GM3RMJIJ.js.map} +0 -0
  69. /package/dist/{chunk-R4BPUUB5.js.map → chunk-OZEPJGMA.js.map} +0 -0
  70. /package/dist/{chunk-TBGTMALE.js.map → chunk-R6F6KFIL.js.map} +0 -0
  71. /package/dist/{chunk-YZLBU6O2.js.map → chunk-SNH35CNA.js.map} +0 -0
  72. /package/dist/{chunk-C5E7H553.js.map → chunk-VDL5CJ5C.js.map} +0 -0
  73. /package/dist/{chunk-3A34R6CI.js.map → chunk-VNBC3VXM.js.map} +0 -0
  74. /package/dist/{chunk-E45CSC33.js.map → chunk-XKWOJZZ4.js.map} +0 -0
  75. /package/dist/{chunk-LQ6PYFU6.js.map → chunk-Z7PQCAVK.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.19.0] — 2026-06-05
8
+
9
+ **Providers catalog emission + planned providers** (ADR-038 follow-on;
10
+ swe-brain consumer-test finding — the Connections surface hand-duplicated
11
+ provider knowledge that `definitions/providers/*.yaml` already owns).
12
+
13
+ ### Added
14
+
15
+ - **Frontend providers catalog (`generated/providers.ts`)** — emitted by the
16
+ frontend whole-set emitter when `definitions/providers/` exists (entity-only
17
+ consumers see no new file; the root barrel gains the export conditionally).
18
+ `PROVIDERS` (flat, slug-sorted) + `PROVIDER_CATALOG` (grouped by
19
+ `display.category` into the ordered `frontend.catalog.categories`). Providers
20
+ are gen-time knowledge — the catalog is emitted, not queried.
21
+ - **`display:` block on the provider schema** (`category`, `blurb`, `hint`) —
22
+ presentation metadata consumed only by the catalog emission; backend
23
+ provider/adapter codegen ignores it.
24
+ - **`status: active | planned` on the provider schema** (default `active`).
25
+ `planned` providers are roadmap stubs: catalog tile only — `auth`/`client`
26
+ optional, surface closed-set + import pre-flight cross-checks skipped (slug
27
+ uniqueness still enforced), and ALL backend emission (provider modules,
28
+ adapters, assemblies) filters them out. Flip to `active` when the
29
+ integration lands.
30
+ - **`frontend.catalog.categories`** in `codegen.config.yaml` — ordered display
31
+ groups (`id`, `name`, `blurb`) the catalog renders.
32
+
33
+ ### Changed
34
+
35
+ - `generateProviderModule` / `generateAdapterScaffold` now take
36
+ `ActiveProviderDefinition` (auth/client guaranteed); use the exported
37
+ `isActiveProvider` guard to narrow.
38
+
7
39
  ## [0.17.2] — 2026-06-04
8
40
 
9
41
  **Shutdown leak fix** (LISTEN-NOTIFY-2; swe-brain dogfood). With
package/README.md CHANGED
@@ -163,6 +163,7 @@ generated/
163
163
  entities/<entity>.ts createEntityHooks({ collection, api }) wiring
164
164
  store/index.ts createStore over the full set (+ resolvers, lookups)
165
165
  fields/<entity>.ts field metadata (FieldMeta, <entity>Fields)
166
+ providers.ts providers catalog — only when definitions/providers/ exists
166
167
  ```
167
168
 
168
169
  Entity types and Zod schemas are **imported** from `locations.dbEntities`
@@ -236,6 +237,56 @@ the **target entity's own YAML** via the registry — never re-pluralized from a
236
237
  string at emit time (so an explicit `plural:` like `person`→`persons` is honored
237
238
  by every consumer).
238
239
 
240
+ ### Providers catalog (`providers.ts`)
241
+
242
+ Providers are gen-time knowledge (`definitions/providers/<slug>.yaml`,
243
+ RFC-0001) — the provider set changes only when code deploys — so the frontend
244
+ catalog is **emitted, not queried**. When the project has provider definitions,
245
+ the emitter renders `generated/providers.ts`:
246
+
247
+ - `PROVIDERS` — every provider, flat (active + planned), slug-sorted:
248
+ `{ provider, name, planned, surfaces, blurb?, hint? }`. Join live rows on
249
+ `provider` (the canonical slug, e.g. `Connection.provider`).
250
+ - `PROVIDER_CATALOG` — grouped into `frontend.catalog.categories` (config
251
+ order) via each provider's `display.category`. Uncategorized providers
252
+ appear only in `PROVIDERS`.
253
+
254
+ Two provider-YAML additions feed it:
255
+
256
+ ```yaml
257
+ # definitions/providers/google.yaml (active — full definition)
258
+ slug: google
259
+ display_name: Google Workspace
260
+ display:
261
+ category: google-workspace # joins frontend.catalog.categories[].id
262
+ hint: connect # optional sub-line on an unconnected tile
263
+ surfaces: [calendar, mail, transcript]
264
+ auth: { ... } # required for active providers
265
+ client: { ... }
266
+
267
+ # definitions/providers/github.yaml (planned — roadmap stub)
268
+ slug: github
269
+ display_name: GitHub
270
+ status: planned # catalog tile only; NO backend emission,
271
+ display: # no auth/client required, surface + import
272
+ category: source-control # cross-checks skipped
273
+ surfaces: [source_control]
274
+ ```
275
+
276
+ ```yaml
277
+ # codegen.config.yaml — the ordered display groups
278
+ frontend:
279
+ catalog:
280
+ categories:
281
+ - id: source-control
282
+ name: Source Control & Issues
283
+ blurb: Repositories, pull requests, issues, and project planning
284
+ ```
285
+
286
+ When the integration for a `planned` provider lands, flip it to `status:
287
+ active` (or drop the key) and add `auth`/`client` — the definitions tree is
288
+ the integration roadmap.
289
+
239
290
  ## Integration Codegen (provider/adapter + assembly + read primitive)
240
291
 
241
292
  When an entity carries a `surface:` tag and `definitions/providers/*.yaml` exist,
@@ -55,6 +55,38 @@ generation run the two barrels are rewritten and you wire them into
55
55
  | React to an event with a durable async job (the event-to-job bridge) | the `bridge` skill |
56
56
  | Pull/push data from an external system (`IChangeSource` / `IIntegrationSink`) | the `integration` skill |
57
57
 
58
+ ## Frontend generation (`generate.frontend: true`)
59
+
60
+ When on, `entity new` (and `--all`) ends with a **whole-set frontend emitter**
61
+ (ADR-038): the complete data layer is rendered into
62
+ `locations.frontendGenerated` (default `apps/frontend/src/generated/`) from the
63
+ full entity set — REST api client, TanStack DB collections (per-entity
64
+ `sync: api | electric`), `createEntityHooks` wiring, field metadata, a
65
+ plural-keyed `createStore`, `config.ts`, `query-client.ts`, root barrel. Every
66
+ file is a complete write with a `@generated` banner; re-runs are byte-identical.
67
+
68
+ Non-obvious bits:
69
+
70
+ - **The dbEntities contract**: generated files import the plain `<Class>` type
71
+ AND a `<camel>Schema` Zod schema from `locations.dbEntities` per entity. If
72
+ the backend doesn't emit such a package (clean-lite-ps doesn't), the consumer
73
+ provides a shim barrel re-exporting each module's Output DTO.
74
+ - **The consumer mounts two providers** in the app root, both from generated
75
+ code: `QueryClientProvider(queryClient)` ▸ `EntityStoreProvider(store)`
76
+ (`EntityStoreProvider` from `@pattern-stack/frontend-patterns`).
77
+ - **Version pairing**: the emitted imports require
78
+ `@pattern-stack/frontend-patterns` + four TanStack packages — the exact
79
+ ranges are listed in the generated `index.ts` header comment.
80
+ - **Path aliases are assumed**: default imports use `@/…` (and your
81
+ `locations.*.import` values) — wire tsconfig `paths` + the bundler alias.
82
+ - **Providers catalog**: when `definitions/providers/` exists, the emitter also
83
+ renders `providers.ts` — `PROVIDERS` (flat) + `PROVIDER_CATALOG` (grouped by
84
+ each provider's `display.category` into `frontend.catalog.categories`).
85
+ Providers are gen-time knowledge: the catalog is emitted, never queried, and
86
+ never hand-duplicated in the frontend. `status: planned` provider YAMLs are
87
+ roadmap stubs — catalog tile only, no auth/client needed, skipped by all
88
+ backend emission.
89
+
58
90
  ## CLI quick reference
59
91
 
60
92
  ```bash
@@ -48,6 +48,8 @@ module — plus an entry in the `GENERATED_MODULES` and schema barrels.
48
48
  entity:
49
49
  name: account # singular snake_case
50
50
  pattern: Synced # Base | Synced | Activity | Metadata | Knowledge (or app-defined)
51
+ # sync: api # frontend collection mode (api | electric) — overrides
52
+ # # frontend.sync.mode; only meaningful with generate.frontend: true
51
53
 
52
54
  fields:
53
55
  name:
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  JobWorker
3
- } from "./chunk-C5E7H553.js";
3
+ } from "./chunk-VDL5CJ5C.js";
4
4
  import {
5
5
  JobsDomainModule
6
- } from "./chunk-EWYI5GGJ.js";
6
+ } from "./chunk-AZLUWG5S.js";
7
7
  import {
8
8
  BootValidationError,
9
9
  ReservedPoolViolationError
@@ -290,4 +290,4 @@ export {
290
290
  JobWorkerOrchestrator,
291
291
  JobWorkerModule
292
292
  };
293
- //# sourceMappingURL=chunk-X6BP6LI5.js.map
293
+ //# sourceMappingURL=chunk-235ZMMJR.js.map
@@ -1,12 +1,12 @@
1
- import {
2
- STORAGE
3
- } from "./chunk-NYBCQZC7.js";
4
1
  import {
5
2
  LocalStorageBackend
6
3
  } from "./chunk-JWNHNUYL.js";
7
4
  import {
8
5
  MemoryStorageBackend
9
6
  } from "./chunk-3SZFUTXE.js";
7
+ import {
8
+ STORAGE
9
+ } from "./chunk-NYBCQZC7.js";
10
10
  import {
11
11
  __decorateClass
12
12
  } from "./chunk-2E224ZSN.js";
@@ -37,4 +37,4 @@ StorageModule = __decorateClass([
37
37
  export {
38
38
  StorageModule
39
39
  };
40
- //# sourceMappingURL=chunk-BK5ICA2F.js.map
40
+ //# sourceMappingURL=chunk-4MVGAMUA.js.map
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  BRIDGE_DELIVERY_JOB_TYPE
3
- } from "./chunk-TBGTMALE.js";
3
+ } from "./chunk-R6F6KFIL.js";
4
4
  import {
5
5
  bridgeDelivery
6
6
  } from "./chunk-2TVVBC53.js";
7
- import {
8
- jobRuns
9
- } from "./chunk-OKXZ63IA.js";
10
- import {
11
- JOBS_LISTEN_NOTIFY
12
- } from "./chunk-ZPL74UQN.js";
13
7
  import {
14
8
  JOBS_WAKE_CHANNEL,
15
9
  pgNotify
16
10
  } from "./chunk-Q6LRJ4VI.js";
11
+ import {
12
+ JOBS_LISTEN_NOTIFY
13
+ } from "./chunk-ZPL74UQN.js";
17
14
  import {
18
15
  BRIDGE_REGISTRY
19
16
  } from "./chunk-4LH67P4U.js";
17
+ import {
18
+ jobRuns
19
+ } from "./chunk-OKXZ63IA.js";
20
20
  import {
21
21
  __decorateClass,
22
22
  __decorateParam
@@ -151,4 +151,4 @@ BridgeOutboxDrainHook = __decorateClass([
151
151
  export {
152
152
  BridgeOutboxDrainHook
153
153
  };
154
- //# sourceMappingURL=chunk-2VGVSL2D.js.map
154
+ //# sourceMappingURL=chunk-65MO75WM.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  EnvEncryptionKey
3
3
  } from "./chunk-IP4OO26U.js";
4
+ import {
5
+ DrizzleOAuthStateStore
6
+ } from "./chunk-N5OTOWTP.js";
4
7
  import {
5
8
  MemoryOAuthStateStore
6
9
  } from "./chunk-QLTJSCE6.js";
7
10
  import {
8
11
  AuthController
9
12
  } from "./chunk-SZVPIHWE.js";
10
- import {
11
- DrizzleOAuthStateStore
12
- } from "./chunk-N5OTOWTP.js";
13
13
  import {
14
14
  AUTH_OPTIONS,
15
15
  ENCRYPTION_KEY,
@@ -89,4 +89,4 @@ AuthModule = __decorateClass([
89
89
  export {
90
90
  AuthModule
91
91
  };
92
- //# sourceMappingURL=chunk-NXHL5YII.js.map
92
+ //# sourceMappingURL=chunk-7LKAMLV4.js.map
@@ -4,14 +4,14 @@ import {
4
4
  import {
5
5
  JOB_ORCHESTRATOR
6
6
  } from "./chunk-ZPL74UQN.js";
7
+ import {
8
+ EVENT_BUS
9
+ } from "./chunk-H5NH7KPE.js";
7
10
  import {
8
11
  BRIDGE_DELIVERY_REPO,
9
12
  BRIDGE_MULTI_TENANT,
10
13
  BRIDGE_REGISTRY
11
14
  } from "./chunk-4LH67P4U.js";
12
- import {
13
- EVENT_BUS
14
- } from "./chunk-H5NH7KPE.js";
15
15
  import {
16
16
  DRIZZLE
17
17
  } from "./chunk-U64T4YZE.js";
@@ -106,4 +106,4 @@ EventFlowService = __decorateClass([
106
106
  export {
107
107
  EventFlowService
108
108
  };
109
- //# sourceMappingURL=chunk-5RT7JGKT.js.map
109
+ //# sourceMappingURL=chunk-7OVCARTQ.js.map
@@ -1,24 +1,24 @@
1
- import {
2
- MemoryJobOrchestrator
3
- } from "./chunk-VQOAATIG.js";
4
- import {
5
- MemoryJobStepService
6
- } from "./chunk-PNZSGAB2.js";
7
1
  import {
8
2
  DrizzleJobRunService
9
- } from "./chunk-3A34R6CI.js";
3
+ } from "./chunk-VNBC3VXM.js";
10
4
  import {
11
5
  MemoryJobRunService
12
- } from "./chunk-IN3EWFB4.js";
13
- import {
14
- MemoryJobStore
15
- } from "./chunk-SNQ3TOWP.js";
6
+ } from "./chunk-BHZP6LOV.js";
16
7
  import {
17
8
  DrizzleJobStepService
18
9
  } from "./chunk-DV4RV2DC.js";
19
10
  import {
20
11
  DrizzleJobOrchestrator
21
- } from "./chunk-7MMS36AN.js";
12
+ } from "./chunk-E6PLM6QG.js";
13
+ import {
14
+ MemoryJobOrchestrator
15
+ } from "./chunk-VQOAATIG.js";
16
+ import {
17
+ MemoryJobStepService
18
+ } from "./chunk-PNZSGAB2.js";
19
+ import {
20
+ MemoryJobStore
21
+ } from "./chunk-SNQ3TOWP.js";
22
22
  import {
23
23
  BULLMQ_CONNECTION,
24
24
  BULLMQ_RESOLVED_CONFIG,
@@ -114,4 +114,4 @@ JobsDomainModule = __decorateClass([
114
114
  export {
115
115
  JobsDomainModule
116
116
  };
117
- //# sourceMappingURL=chunk-EWYI5GGJ.js.map
117
+ //# sourceMappingURL=chunk-AZLUWG5S.js.map
@@ -1,19 +1,19 @@
1
+ import {
2
+ clampEventLimit,
3
+ decodeEventCursor,
4
+ encodeEventCursor
5
+ } from "./chunk-UQ5EHOH2.js";
1
6
  import {
2
7
  EVENTS_WAKE_CHANNEL,
3
8
  PgNotifyListener,
4
9
  pgNotify
5
10
  } from "./chunk-Q6LRJ4VI.js";
6
- import {
7
- BRIDGE_OUTBOX_DRAIN_HOOK
8
- } from "./chunk-4LH67P4U.js";
9
11
  import {
10
12
  EVENTS_MODULE_OPTIONS
11
13
  } from "./chunk-H5NH7KPE.js";
12
14
  import {
13
- clampEventLimit,
14
- decodeEventCursor,
15
- encodeEventCursor
16
- } from "./chunk-UQ5EHOH2.js";
15
+ BRIDGE_OUTBOX_DRAIN_HOOK
16
+ } from "./chunk-4LH67P4U.js";
17
17
  import {
18
18
  domainEvents
19
19
  } from "./chunk-OFRRBC7M.js";
@@ -393,4 +393,4 @@ DrizzleEventBus = __decorateClass([
393
393
  export {
394
394
  DrizzleEventBus
395
395
  };
396
- //# sourceMappingURL=chunk-RKNW56RU.js.map
396
+ //# sourceMappingURL=chunk-B34G6PHD.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  MemoryJobStore
3
3
  } from "./chunk-SNQ3TOWP.js";
4
+ import {
5
+ MissingTenantIdError
6
+ } from "./chunk-T4BIIU5E.js";
4
7
  import {
5
8
  clampLimit,
6
9
  decodeKeysetCursor,
7
10
  encodeKeysetCursor,
8
11
  toJobRunSummary
9
12
  } from "./chunk-L3LZWWSX.js";
10
- import {
11
- MissingTenantIdError
12
- } from "./chunk-T4BIIU5E.js";
13
13
  import {
14
14
  JOBS_MULTI_TENANT,
15
15
  JOB_ORCHESTRATOR
@@ -209,4 +209,4 @@ function compareBy(a, b, order) {
209
209
  export {
210
210
  MemoryJobRunService
211
211
  };
212
- //# sourceMappingURL=chunk-IN3EWFB4.js.map
212
+ //# sourceMappingURL=chunk-BHZP6LOV.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  JOB_RUN_SERVICE
3
3
  } from "./chunk-ZPL74UQN.js";
4
- import {
5
- BRIDGE_DELIVERY_REPO
6
- } from "./chunk-4LH67P4U.js";
7
4
  import {
8
5
  EVENT_READ_PORT
9
6
  } from "./chunk-H5NH7KPE.js";
7
+ import {
8
+ BRIDGE_DELIVERY_REPO
9
+ } from "./chunk-4LH67P4U.js";
10
10
  import {
11
11
  INTEGRATION_CURSOR_STORE,
12
12
  INTEGRATION_RUN_RECORDER
@@ -181,4 +181,4 @@ ObservabilityService = __decorateClass([
181
181
  export {
182
182
  ObservabilityService
183
183
  };
184
- //# sourceMappingURL=chunk-W2UIDI3R.js.map
184
+ //# sourceMappingURL=chunk-CLWBNXKF.js.map
@@ -5,23 +5,23 @@ import {
5
5
  JobTypeNotFoundError,
6
6
  MissingTenantIdError
7
7
  } from "./chunk-T4BIIU5E.js";
8
+ import {
9
+ JOBS_WAKE_CHANNEL,
10
+ pgNotify
11
+ } from "./chunk-Q6LRJ4VI.js";
8
12
  import {
9
13
  keySelectorToTemplate,
10
14
  resolveJobKey
11
15
  } from "./chunk-7P5ODGLA.js";
12
- import {
13
- jobRuns,
14
- jobSteps,
15
- jobs
16
- } from "./chunk-OKXZ63IA.js";
17
16
  import {
18
17
  JOBS_LISTEN_NOTIFY,
19
18
  JOBS_MULTI_TENANT
20
19
  } from "./chunk-ZPL74UQN.js";
21
20
  import {
22
- JOBS_WAKE_CHANNEL,
23
- pgNotify
24
- } from "./chunk-Q6LRJ4VI.js";
21
+ jobRuns,
22
+ jobSteps,
23
+ jobs
24
+ } from "./chunk-OKXZ63IA.js";
25
25
  import {
26
26
  DRIZZLE
27
27
  } from "./chunk-U64T4YZE.js";
@@ -393,4 +393,4 @@ export {
393
393
  evaluateKeyTemplate,
394
394
  DrizzleJobOrchestrator
395
395
  };
396
- //# sourceMappingURL=chunk-7MMS36AN.js.map
396
+ //# sourceMappingURL=chunk-E6PLM6QG.js.map
@@ -1011,6 +1011,12 @@ var ClientSchema = z5.object({
1011
1011
  class: ImportRefSchema,
1012
1012
  base_url: z5.string().url("client.base_url must be an absolute URL")
1013
1013
  }).strict();
1014
+ var DisplaySchema = z5.object({
1015
+ category: z5.string().optional(),
1016
+ blurb: z5.string().optional(),
1017
+ // Sub-line shown on an unconnected ("available") tile.
1018
+ hint: z5.string().optional()
1019
+ }).strict();
1014
1020
  var ProviderDefinitionSchema = z5.object({
1015
1021
  // Provider id — the canonical string used as detection: keys, audit rows,
1016
1022
  // subscription rows. kebab/lower; unique across definitions/providers/
@@ -1020,19 +1026,49 @@ var ProviderDefinitionSchema = z5.object({
1020
1026
  "slug must be kebab-case lower (e.g. 'google', 'hubspot')"
1021
1027
  ),
1022
1028
  display_name: z5.string().optional(),
1023
- auth: AuthSchema,
1024
- client: ClientSchema,
1029
+ // Lifecycle: 'active' providers drive backend provider/adapter emission
1030
+ // and require auth + client. 'planned' providers are roadmap stubs — they
1031
+ // appear in the frontend catalog (as unconnectable tiles) but are skipped
1032
+ // by all backend emission and by the surface/import cross-checks, so a
1033
+ // stub can exist before its surface has entities or its strategy/client
1034
+ // are written.
1035
+ status: z5.enum(["active", "planned"]).default("active"),
1036
+ // Frontend catalog presentation (see DisplaySchema).
1037
+ display: DisplaySchema.optional(),
1038
+ // Required iff status === 'active'; see superRefine below.
1039
+ auth: AuthSchema.optional(),
1040
+ client: ClientSchema.optional(),
1025
1041
  // Surfaces this provider serves (ADR-0006: surfaces span contexts — one
1026
1042
  // Google OAuth feeds calendar+mail+transcript). Each must reference a real
1027
1043
  // `surface:` declared on some entity; that cross-check is in
1028
- // validate-providers.ts. Non-empty enforced here.
1044
+ // validate-providers.ts (skipped for 'planned'). Non-empty enforced here.
1029
1045
  surfaces: z5.array(z5.string()).min(1, "surfaces must list at least one surface"),
1030
1046
  // Optional auth lifecycle hints consumed by provider-module emission (D2).
1031
1047
  // `refresh_behavior` is left as a free string in D1 — its domain firms up
1032
1048
  // when D2 consumes it; carrying it now keeps the YAML lossless.
1033
1049
  token_lifetime: z5.number().int().positive().optional(),
1034
1050
  refresh_behavior: z5.string().optional()
1035
- }).strict();
1051
+ }).strict().superRefine((def, ctx) => {
1052
+ if (def.status === "active") {
1053
+ if (!def.auth) {
1054
+ ctx.addIssue({
1055
+ code: z5.ZodIssueCode.custom,
1056
+ message: "auth is required when status is 'active'",
1057
+ path: ["auth"]
1058
+ });
1059
+ }
1060
+ if (!def.client) {
1061
+ ctx.addIssue({
1062
+ code: z5.ZodIssueCode.custom,
1063
+ message: "client is required when status is 'active'",
1064
+ path: ["client"]
1065
+ });
1066
+ }
1067
+ }
1068
+ });
1069
+ function isActiveProvider(def) {
1070
+ return def.status !== "planned";
1071
+ }
1036
1072
 
1037
1073
  // src/utils/yaml-loader.ts
1038
1074
  function loadEntityFromYaml(filePath) {
@@ -1843,6 +1879,7 @@ function validateProviders(providers, opts) {
1843
1879
  }
1844
1880
  for (const { definition, filePath } of providers) {
1845
1881
  const { slug } = definition;
1882
+ if (definition.status === "planned") continue;
1846
1883
  for (const surface of definition.surfaces) {
1847
1884
  if (!knownSurfaces.has(surface)) {
1848
1885
  const known = [...knownSurfaces].sort().join(", ") || "(none declared)";
@@ -1864,6 +1901,7 @@ function validateProviders(providers, opts) {
1864
1901
  sourceRoot: opts.sourceRoot,
1865
1902
  aliases: opts.aliases
1866
1903
  };
1904
+ if (!isActiveProvider(definition)) continue;
1867
1905
  const refs = [
1868
1906
  { field: "auth.strategy", ref: definition.auth.strategy },
1869
1907
  { field: "client.class", ref: definition.client.class }
@@ -4064,6 +4102,7 @@ export {
4064
4102
  validateJunctionDefinition,
4065
4103
  safeValidateJunctionDefinition,
4066
4104
  parseImportRef,
4105
+ isActiveProvider,
4067
4106
  loadEntityFromYaml,
4068
4107
  loadEntitiesFromYaml,
4069
4108
  loadRelationshipFromYaml,
@@ -4124,4 +4163,4 @@ export {
4124
4163
  analyzeDomain,
4125
4164
  validateEntities
4126
4165
  };
4127
- //# sourceMappingURL=chunk-CFFTPWHM.js.map
4166
+ //# sourceMappingURL=chunk-F7KN3U6U.js.map