@danielfgray/pg-sourcerer 0.2.2 → 0.4.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 (307) hide show
  1. package/bin/pgsourcerer +2 -0
  2. package/dist/__tests__/fixtures/index.d.ts +15 -0
  3. package/dist/__tests__/fixtures/index.d.ts.map +1 -0
  4. package/dist/__tests__/fixtures/index.js +19 -0
  5. package/dist/__tests__/fixtures/index.js.map +1 -0
  6. package/dist/__tests__/fixtures/introspection.json +40522 -0
  7. package/dist/cli.d.ts +0 -1
  8. package/dist/cli.js +7 -46
  9. package/dist/cli.js.map +1 -1
  10. package/dist/config.d.ts +38 -5
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js +13 -2
  13. package/dist/config.js.map +1 -1
  14. package/dist/{lib/conjure.d.ts → conjure/index.d.ts} +62 -3
  15. package/dist/conjure/index.d.ts.map +1 -0
  16. package/dist/{lib/conjure.js → conjure/index.js} +124 -3
  17. package/dist/conjure/index.js.map +1 -0
  18. package/dist/conjure/signature.d.ts +85 -0
  19. package/dist/conjure/signature.d.ts.map +1 -0
  20. package/dist/conjure/signature.js +130 -0
  21. package/dist/conjure/signature.js.map +1 -0
  22. package/dist/conjure/types.d.ts +97 -0
  23. package/dist/conjure/types.d.ts.map +1 -0
  24. package/dist/conjure/types.js +206 -0
  25. package/dist/conjure/types.js.map +1 -0
  26. package/dist/errors.d.ts +114 -139
  27. package/dist/errors.d.ts.map +1 -1
  28. package/dist/errors.js +82 -36
  29. package/dist/errors.js.map +1 -1
  30. package/dist/generate.d.ts +45 -46
  31. package/dist/generate.d.ts.map +1 -1
  32. package/dist/generate.js +86 -59
  33. package/dist/generate.js.map +1 -1
  34. package/dist/hex/builder.d.ts +12 -0
  35. package/dist/hex/builder.d.ts.map +1 -0
  36. package/dist/hex/builder.js +64 -0
  37. package/dist/hex/builder.js.map +1 -0
  38. package/dist/hex/ddl.d.ts +53 -0
  39. package/dist/hex/ddl.d.ts.map +1 -0
  40. package/dist/hex/ddl.js +306 -0
  41. package/dist/hex/ddl.js.map +1 -0
  42. package/dist/hex/index.d.ts +105 -0
  43. package/dist/hex/index.d.ts.map +1 -0
  44. package/dist/hex/index.js +81 -0
  45. package/dist/hex/index.js.map +1 -0
  46. package/dist/hex/primitives.d.ts +23 -0
  47. package/dist/hex/primitives.d.ts.map +1 -0
  48. package/dist/hex/primitives.js +38 -0
  49. package/dist/hex/primitives.js.map +1 -0
  50. package/dist/hex/query.d.ts +116 -0
  51. package/dist/hex/query.d.ts.map +1 -0
  52. package/dist/hex/query.js +219 -0
  53. package/dist/hex/query.js.map +1 -0
  54. package/dist/hex/types.d.ts +287 -0
  55. package/dist/hex/types.d.ts.map +1 -0
  56. package/dist/hex/types.js +431 -0
  57. package/dist/hex/types.js.map +1 -0
  58. package/dist/index.d.ts +17 -25
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +33 -44
  61. package/dist/index.js.map +1 -1
  62. package/dist/init.d.ts.map +1 -1
  63. package/dist/init.js +76 -140
  64. package/dist/init.js.map +1 -1
  65. package/dist/ir/extensions/queries.d.ts +6 -6
  66. package/dist/ir/extensions/queries.d.ts.map +1 -1
  67. package/dist/ir/extensions/queries.js +6 -4
  68. package/dist/ir/extensions/queries.js.map +1 -1
  69. package/dist/ir/extensions/schema-builder.d.ts.map +1 -1
  70. package/dist/ir/extensions/schema-builder.js.map +1 -1
  71. package/dist/ir/index.d.ts.map +1 -1
  72. package/dist/ir/index.js.map +1 -1
  73. package/dist/ir/relation-graph.d.ts.map +1 -1
  74. package/dist/ir/relation-graph.js +8 -8
  75. package/dist/ir/relation-graph.js.map +1 -1
  76. package/dist/ir/semantic-ir.d.ts +38 -0
  77. package/dist/ir/semantic-ir.d.ts.map +1 -1
  78. package/dist/ir/semantic-ir.js +50 -2
  79. package/dist/ir/semantic-ir.js.map +1 -1
  80. package/dist/ir/smart-tags.d.ts.map +1 -1
  81. package/dist/ir/smart-tags.js.map +1 -1
  82. package/dist/lib/field-utils.d.ts.map +1 -1
  83. package/dist/lib/field-utils.js +7 -7
  84. package/dist/lib/field-utils.js.map +1 -1
  85. package/dist/lib/join-graph.d.ts +95 -0
  86. package/dist/lib/join-graph.d.ts.map +1 -0
  87. package/dist/lib/join-graph.js +305 -0
  88. package/dist/lib/join-graph.js.map +1 -0
  89. package/dist/lib/picker.d.ts +60 -0
  90. package/dist/lib/picker.d.ts.map +1 -0
  91. package/dist/lib/picker.js +325 -0
  92. package/dist/lib/picker.js.map +1 -0
  93. package/dist/plugins/arktype.d.ts +20 -24
  94. package/dist/plugins/arktype.d.ts.map +1 -1
  95. package/dist/plugins/arktype.js +462 -386
  96. package/dist/plugins/arktype.js.map +1 -1
  97. package/dist/plugins/effect/http.d.ts +7 -0
  98. package/dist/plugins/effect/http.d.ts.map +1 -0
  99. package/dist/plugins/effect/http.js +460 -0
  100. package/dist/plugins/effect/http.js.map +1 -0
  101. package/dist/plugins/effect/index.d.ts +22 -0
  102. package/dist/plugins/effect/index.d.ts.map +1 -0
  103. package/dist/plugins/effect/index.js +65 -0
  104. package/dist/plugins/effect/index.js.map +1 -0
  105. package/dist/plugins/effect/models.d.ts +6 -0
  106. package/dist/plugins/effect/models.d.ts.map +1 -0
  107. package/dist/plugins/effect/models.js +116 -0
  108. package/dist/plugins/effect/models.js.map +1 -0
  109. package/dist/plugins/effect/repos.d.ts +21 -0
  110. package/dist/plugins/effect/repos.d.ts.map +1 -0
  111. package/dist/plugins/effect/repos.js +131 -0
  112. package/dist/plugins/effect/repos.js.map +1 -0
  113. package/dist/plugins/effect/schemas.d.ts +7 -0
  114. package/dist/plugins/effect/schemas.d.ts.map +1 -0
  115. package/dist/plugins/effect/schemas.js +75 -0
  116. package/dist/plugins/effect/schemas.js.map +1 -0
  117. package/dist/plugins/effect/shared.d.ts +116 -0
  118. package/dist/plugins/effect/shared.d.ts.map +1 -0
  119. package/dist/plugins/effect/shared.js +164 -0
  120. package/dist/plugins/effect/shared.js.map +1 -0
  121. package/dist/plugins/http-elysia.d.ts +20 -27
  122. package/dist/plugins/http-elysia.d.ts.map +1 -1
  123. package/dist/plugins/http-elysia.js +350 -475
  124. package/dist/plugins/http-elysia.js.map +1 -1
  125. package/dist/plugins/http-express.d.ts +20 -31
  126. package/dist/plugins/http-express.d.ts.map +1 -1
  127. package/dist/plugins/http-express.js +281 -268
  128. package/dist/plugins/http-express.js.map +1 -1
  129. package/dist/plugins/http-hono.d.ts +17 -33
  130. package/dist/plugins/http-hono.d.ts.map +1 -1
  131. package/dist/plugins/http-hono.js +317 -341
  132. package/dist/plugins/http-hono.js.map +1 -1
  133. package/dist/plugins/http-orpc.d.ts +34 -33
  134. package/dist/plugins/http-orpc.d.ts.map +1 -1
  135. package/dist/plugins/http-orpc.js +345 -257
  136. package/dist/plugins/http-orpc.js.map +1 -1
  137. package/dist/plugins/http-trpc.d.ts +33 -35
  138. package/dist/plugins/http-trpc.d.ts.map +1 -1
  139. package/dist/plugins/http-trpc.js +337 -241
  140. package/dist/plugins/http-trpc.js.map +1 -1
  141. package/dist/plugins/kysely.d.ts +54 -59
  142. package/dist/plugins/kysely.d.ts.map +1 -1
  143. package/dist/plugins/kysely.js +826 -687
  144. package/dist/plugins/kysely.js.map +1 -1
  145. package/dist/plugins/sql-queries.d.ts +38 -44
  146. package/dist/plugins/sql-queries.d.ts.map +1 -1
  147. package/dist/plugins/sql-queries.js +497 -897
  148. package/dist/plugins/sql-queries.js.map +1 -1
  149. package/dist/plugins/types.d.ts +12 -20
  150. package/dist/plugins/types.d.ts.map +1 -1
  151. package/dist/plugins/types.js +84 -227
  152. package/dist/plugins/types.js.map +1 -1
  153. package/dist/plugins/valibot.d.ts +7 -44
  154. package/dist/plugins/valibot.d.ts.map +1 -1
  155. package/dist/plugins/valibot.js +376 -382
  156. package/dist/plugins/valibot.js.map +1 -1
  157. package/dist/plugins/zod.d.ts +20 -24
  158. package/dist/plugins/zod.d.ts.map +1 -1
  159. package/dist/plugins/zod.js +370 -367
  160. package/dist/plugins/zod.js.map +1 -1
  161. package/dist/runtime/emit.d.ts +64 -0
  162. package/dist/runtime/emit.d.ts.map +1 -0
  163. package/dist/runtime/emit.js +445 -0
  164. package/dist/runtime/emit.js.map +1 -0
  165. package/dist/runtime/errors.d.ts +36 -0
  166. package/dist/runtime/errors.d.ts.map +1 -0
  167. package/dist/runtime/errors.js +29 -0
  168. package/dist/runtime/errors.js.map +1 -0
  169. package/dist/runtime/file-assignment.d.ts +161 -0
  170. package/dist/runtime/file-assignment.d.ts.map +1 -0
  171. package/dist/runtime/file-assignment.js +195 -0
  172. package/dist/runtime/file-assignment.js.map +1 -0
  173. package/dist/runtime/orchestrator.d.ts +62 -0
  174. package/dist/runtime/orchestrator.d.ts.map +1 -0
  175. package/dist/runtime/orchestrator.js +99 -0
  176. package/dist/runtime/orchestrator.js.map +1 -0
  177. package/dist/runtime/registry.d.ts +268 -0
  178. package/dist/runtime/registry.d.ts.map +1 -0
  179. package/dist/runtime/registry.js +436 -0
  180. package/dist/runtime/registry.js.map +1 -0
  181. package/dist/runtime/types.d.ts +182 -0
  182. package/dist/runtime/types.d.ts.map +1 -0
  183. package/dist/runtime/types.js +2 -0
  184. package/dist/runtime/types.js.map +1 -0
  185. package/dist/runtime/validation.d.ts +41 -0
  186. package/dist/runtime/validation.d.ts.map +1 -0
  187. package/dist/runtime/validation.js +70 -0
  188. package/dist/runtime/validation.js.map +1 -0
  189. package/dist/services/config-loader.d.ts.map +1 -1
  190. package/dist/services/config-loader.js +15 -6
  191. package/dist/services/config-loader.js.map +1 -1
  192. package/dist/services/config.d.ts +55 -25
  193. package/dist/services/config.d.ts.map +1 -1
  194. package/dist/services/config.js +60 -34
  195. package/dist/services/config.js.map +1 -1
  196. package/dist/services/file-writer.d.ts +3 -3
  197. package/dist/services/file-writer.d.ts.map +1 -1
  198. package/dist/services/file-writer.js +6 -8
  199. package/dist/services/file-writer.js.map +1 -1
  200. package/dist/services/inflection.d.ts +126 -27
  201. package/dist/services/inflection.d.ts.map +1 -1
  202. package/dist/services/inflection.js +300 -72
  203. package/dist/services/inflection.js.map +1 -1
  204. package/dist/services/introspection.d.ts.map +1 -1
  205. package/dist/services/introspection.js +6 -6
  206. package/dist/services/introspection.js.map +1 -1
  207. package/dist/services/ir-builder.d.ts.map +1 -1
  208. package/dist/services/ir-builder.js +73 -77
  209. package/dist/services/ir-builder.js.map +1 -1
  210. package/dist/services/ir.d.ts.map +1 -1
  211. package/dist/services/ir.js.map +1 -1
  212. package/dist/services/pg-types.d.ts.map +1 -1
  213. package/dist/services/pg-types.js +3 -3
  214. package/dist/services/pg-types.js.map +1 -1
  215. package/dist/services/smart-tags-parser.d.ts.map +1 -1
  216. package/dist/services/smart-tags-parser.js +4 -4
  217. package/dist/services/smart-tags-parser.js.map +1 -1
  218. package/dist/services/type-hints.d.ts.map +1 -1
  219. package/dist/services/type-hints.js +1 -1
  220. package/dist/services/type-hints.js.map +1 -1
  221. package/dist/services/user-module-parser.d.ts +46 -0
  222. package/dist/services/user-module-parser.d.ts.map +1 -0
  223. package/dist/services/user-module-parser.js +181 -0
  224. package/dist/services/user-module-parser.js.map +1 -0
  225. package/dist/shared/converters.d.ts +60 -0
  226. package/dist/shared/converters.d.ts.map +1 -0
  227. package/dist/shared/converters.js +168 -0
  228. package/dist/shared/converters.js.map +1 -0
  229. package/dist/shared/query-types.d.ts +95 -0
  230. package/dist/shared/query-types.d.ts.map +1 -0
  231. package/dist/shared/query-types.js +9 -0
  232. package/dist/shared/query-types.js.map +1 -0
  233. package/dist/testing.d.ts +125 -37
  234. package/dist/testing.d.ts.map +1 -1
  235. package/dist/testing.js +134 -42
  236. package/dist/testing.js.map +1 -1
  237. package/dist/user-module.d.ts +86 -0
  238. package/dist/user-module.d.ts.map +1 -0
  239. package/dist/user-module.js +55 -0
  240. package/dist/user-module.js.map +1 -0
  241. package/package.json +10 -6
  242. package/dist/lib/conjure.d.ts.map +0 -1
  243. package/dist/lib/conjure.js.map +0 -1
  244. package/dist/lib/hex.d.ts +0 -119
  245. package/dist/lib/hex.d.ts.map +0 -1
  246. package/dist/lib/hex.js +0 -188
  247. package/dist/lib/hex.js.map +0 -1
  248. package/dist/plugins/effect.d.ts +0 -53
  249. package/dist/plugins/effect.d.ts.map +0 -1
  250. package/dist/plugins/effect.js +0 -1074
  251. package/dist/plugins/effect.js.map +0 -1
  252. package/dist/plugins/kysely/queries.d.ts +0 -92
  253. package/dist/plugins/kysely/queries.d.ts.map +0 -1
  254. package/dist/plugins/kysely/queries.js +0 -1169
  255. package/dist/plugins/kysely/queries.js.map +0 -1
  256. package/dist/plugins/kysely/shared.d.ts +0 -59
  257. package/dist/plugins/kysely/shared.d.ts.map +0 -1
  258. package/dist/plugins/kysely/shared.js +0 -247
  259. package/dist/plugins/kysely/shared.js.map +0 -1
  260. package/dist/plugins/kysely/types.d.ts +0 -22
  261. package/dist/plugins/kysely/types.d.ts.map +0 -1
  262. package/dist/plugins/kysely/types.js +0 -428
  263. package/dist/plugins/kysely/types.js.map +0 -1
  264. package/dist/services/artifact-store.d.ts +0 -65
  265. package/dist/services/artifact-store.d.ts.map +0 -1
  266. package/dist/services/artifact-store.js +0 -57
  267. package/dist/services/artifact-store.js.map +0 -1
  268. package/dist/services/core-providers.d.ts +0 -15
  269. package/dist/services/core-providers.d.ts.map +0 -1
  270. package/dist/services/core-providers.js +0 -23
  271. package/dist/services/core-providers.js.map +0 -1
  272. package/dist/services/emissions.d.ts +0 -103
  273. package/dist/services/emissions.d.ts.map +0 -1
  274. package/dist/services/emissions.js +0 -241
  275. package/dist/services/emissions.js.map +0 -1
  276. package/dist/services/execution.d.ts +0 -35
  277. package/dist/services/execution.d.ts.map +0 -1
  278. package/dist/services/execution.js +0 -86
  279. package/dist/services/execution.js.map +0 -1
  280. package/dist/services/file-builder.d.ts +0 -85
  281. package/dist/services/file-builder.d.ts.map +0 -1
  282. package/dist/services/file-builder.js +0 -112
  283. package/dist/services/file-builder.js.map +0 -1
  284. package/dist/services/plugin-meta.d.ts +0 -33
  285. package/dist/services/plugin-meta.d.ts.map +0 -1
  286. package/dist/services/plugin-meta.js +0 -24
  287. package/dist/services/plugin-meta.js.map +0 -1
  288. package/dist/services/plugin-runner.d.ts +0 -42
  289. package/dist/services/plugin-runner.d.ts.map +0 -1
  290. package/dist/services/plugin-runner.js +0 -84
  291. package/dist/services/plugin-runner.js.map +0 -1
  292. package/dist/services/plugin.d.ts +0 -421
  293. package/dist/services/plugin.d.ts.map +0 -1
  294. package/dist/services/plugin.js +0 -197
  295. package/dist/services/plugin.js.map +0 -1
  296. package/dist/services/resolution.d.ts +0 -38
  297. package/dist/services/resolution.d.ts.map +0 -1
  298. package/dist/services/resolution.js +0 -242
  299. package/dist/services/resolution.js.map +0 -1
  300. package/dist/services/service-registry.d.ts +0 -74
  301. package/dist/services/service-registry.d.ts.map +0 -1
  302. package/dist/services/service-registry.js +0 -61
  303. package/dist/services/service-registry.js.map +0 -1
  304. package/dist/services/symbols.d.ts +0 -144
  305. package/dist/services/symbols.d.ts.map +0 -1
  306. package/dist/services/symbols.js +0 -144
  307. package/dist/services/symbols.js.map +0 -1
@@ -0,0 +1,268 @@
1
+ import { Context, Effect, Schema } from "effect";
2
+ import type { Capability, SymbolDeclaration, SymbolRef, SymbolHandle } from "./types.js";
3
+ declare const SymbolCollision_base: Schema.TaggedErrorClass<SymbolCollision, "SymbolCollision", {
4
+ readonly _tag: Schema.tag<"SymbolCollision">;
5
+ } & {
6
+ message: typeof Schema.String;
7
+ capability: typeof Schema.String;
8
+ existingSymbol: typeof Schema.String;
9
+ newSymbol: typeof Schema.String;
10
+ }>;
11
+ /**
12
+ * Error thrown when two plugins try to register the same capability.
13
+ */
14
+ export declare class SymbolCollision extends SymbolCollision_base {
15
+ }
16
+ declare const CapabilityNotFound_base: Schema.TaggedErrorClass<CapabilityNotFound, "CapabilityNotFound", {
17
+ readonly _tag: Schema.tag<"CapabilityNotFound">;
18
+ } & {
19
+ message: typeof Schema.String;
20
+ capability: typeof Schema.String;
21
+ }>;
22
+ /**
23
+ * Error when trying to get a handle for an unregistered capability.
24
+ */
25
+ export declare class CapabilityNotFound extends CapabilityNotFound_base {
26
+ }
27
+ declare const CategoryConflict_base: Schema.TaggedErrorClass<CategoryConflict, "CategoryConflict", {
28
+ readonly _tag: Schema.tag<"CategoryConflict">;
29
+ } & {
30
+ message: typeof Schema.String;
31
+ category: typeof Schema.String;
32
+ existingProvider: typeof Schema.String;
33
+ newProvider: typeof Schema.String;
34
+ }>;
35
+ /**
36
+ * Error when multiple plugins try to provide the same capability category.
37
+ */
38
+ export declare class CategoryConflict extends CategoryConflict_base {
39
+ }
40
+ /**
41
+ * Creates a SymbolHandle that tracks cross-references.
42
+ *
43
+ * @param decl - The symbol being referenced
44
+ * @param metadata - Optional metadata from render phase (may include consume callback)
45
+ * @param onReference - Callback when ref() or call() is invoked (for import tracking)
46
+ */
47
+ export declare function createSymbolHandle(decl: SymbolDeclaration, metadata: unknown | undefined, onReference?: (capability: Capability) => void): SymbolHandle;
48
+ /**
49
+ * Service interface for SymbolRegistry - what plugins see.
50
+ */
51
+ export interface SymbolRegistryService {
52
+ /** Resolve a capability to its symbol reference */
53
+ readonly resolve: (capability: Capability) => SymbolRef | undefined;
54
+ /** Get a handle for importing another symbol (tracks cross-references) */
55
+ readonly import: (capability: Capability) => SymbolHandle;
56
+ /** Query for capabilities matching a prefix pattern */
57
+ readonly query: (pattern: string) => readonly SymbolDeclaration[];
58
+ /** Check if a capability is registered */
59
+ readonly has: (capability: Capability) => boolean;
60
+ /** Get rendered metadata for a capability */
61
+ readonly getMetadata: (capability: Capability) => unknown;
62
+ /**
63
+ * Get declarations owned by the current plugin.
64
+ * Returns only the symbols declared by this plugin in Phase 1.
65
+ */
66
+ readonly own: () => readonly SymbolDeclaration[];
67
+ /**
68
+ * Scope cross-reference tracking to a single symbol.
69
+ * All `import().ref()` calls within the callback are attributed
70
+ * only to the specified capability, not all plugin capabilities.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * for (const decl of registry.own()) {
75
+ * registry.forSymbol(decl.capability, () => {
76
+ * const queryFn = registry.import(`queries:kysely:${entityName}`);
77
+ * queryFn.ref(); // Only attributed to decl.capability
78
+ * });
79
+ * }
80
+ * ```
81
+ */
82
+ readonly forSymbol: <T>(capability: Capability, fn: () => T) => T;
83
+ }
84
+ declare const SymbolRegistry_base: Context.TagClass<SymbolRegistry, "SymbolRegistry", SymbolRegistryService>;
85
+ /**
86
+ * Effect Context tag for SymbolRegistry service.
87
+ * Plugins access this in render phase via `yield* SymbolRegistry`.
88
+ */
89
+ export declare class SymbolRegistry extends SymbolRegistry_base {
90
+ }
91
+ /**
92
+ * Internal registry implementation that tracks all declared symbols.
93
+ *
94
+ * Used during the two-phase plugin execution:
95
+ * 1. Declare phase: Plugins register symbols via register()
96
+ * 2. Render phase: Plugins lookup symbols via resolve()/import()
97
+ *
98
+ * During render phase, tracks cross-references between capabilities
99
+ * for import generation in the emit phase.
100
+ */
101
+ export declare class SymbolRegistryImpl {
102
+ private symbols;
103
+ private rendered;
104
+ private referenceCallbacks;
105
+ /**
106
+ * Category providers: Maps category name -> provider plugin name.
107
+ * e.g., "queries" -> "kysely", "schema" -> "zod"
108
+ * Used to resolve generic capability prefixes to implementation-specific ones.
109
+ */
110
+ private categoryProviders;
111
+ /**
112
+ * Cross-reference tracking: Maps source capability -> set of referenced capabilities.
113
+ * Populated during render phase when registry.import(cap).ref() is called.
114
+ */
115
+ private references;
116
+ /**
117
+ * Current capabilities being rendered. Set by orchestrator before calling render().
118
+ * When a handle's ref()/call() is invoked, edges are added from these to the target.
119
+ *
120
+ * When forSymbol() is active, this contains only the single scoped capability.
121
+ */
122
+ private currentCapabilities;
123
+ /**
124
+ * Declarations owned by the current plugin.
125
+ * Set by orchestrator before render phase.
126
+ */
127
+ private ownedDeclarations;
128
+ /**
129
+ * Stack for nested forSymbol() calls (though nesting is unusual).
130
+ * Stores the previous currentCapabilities to restore after forSymbol() completes.
131
+ */
132
+ private capabilityStack;
133
+ /**
134
+ * Register a symbol declaration. Called during declare phase.
135
+ * Returns Effect that fails with SymbolCollision if capability already registered.
136
+ */
137
+ register(decl: SymbolDeclaration): Effect.Effect<void, SymbolCollision>;
138
+ /**
139
+ * Store rendered output for a symbol. Called during render phase.
140
+ */
141
+ setRendered(capability: Capability, node: unknown, metadata?: unknown): void;
142
+ /**
143
+ * Get rendered metadata for a capability.
144
+ */
145
+ getRenderedMetadata(capability: Capability): unknown;
146
+ /**
147
+ * Register multiple declarations at once.
148
+ */
149
+ registerAll(decls: readonly SymbolDeclaration[]): Effect.Effect<void, SymbolCollision>;
150
+ /**
151
+ * Register a plugin as the provider for a capability category.
152
+ * Only one plugin can provide each category.
153
+ *
154
+ * @param category - Category name (e.g., "queries", "schema")
155
+ * @param pluginName - Name of the plugin providing this category
156
+ */
157
+ registerCategoryProvider(category: string, pluginName: string): Effect.Effect<void, CategoryConflict>;
158
+ /**
159
+ * Get the provider name for a category.
160
+ */
161
+ getCategoryProvider(category: string): string | undefined;
162
+ /**
163
+ * Resolve a generic capability to implementation-specific.
164
+ *
165
+ * Examples:
166
+ * - "queries:User:findById" → "queries:kysely:User:findById" (if kysely provides queries)
167
+ * - "schema:UserInsert" → "schema:zod:UserInsert" (if zod provides schema)
168
+ * - "queries:kysely:User:findById" → unchanged (already specific)
169
+ * - "type:User" → unchanged (no category provider needed)
170
+ */
171
+ resolveCapability(capability: Capability): Capability;
172
+ /**
173
+ * Resolve a capability to its symbol reference.
174
+ * Automatically resolves generic capabilities to implementation-specific.
175
+ * Returns undefined if not found.
176
+ */
177
+ resolve(capability: Capability): SymbolRef | undefined;
178
+ /**
179
+ * Check if a capability is registered.
180
+ * Automatically resolves generic capabilities to implementation-specific.
181
+ */
182
+ has(capability: Capability): boolean;
183
+ /**
184
+ * Register a callback to be invoked when a symbol is referenced.
185
+ * Used for import tracking across files.
186
+ */
187
+ onReference(capability: Capability, callback: (capability: Capability) => void): void;
188
+ /**
189
+ * Get a SymbolHandle for referencing another symbol.
190
+ * The handle tracks when ref()/call() are used for import generation.
191
+ * Automatically resolves generic capabilities to implementation-specific.
192
+ * Returns Effect that fails with CapabilityNotFound if not registered.
193
+ */
194
+ getHandle(capability: Capability): Effect.Effect<SymbolHandle, CapabilityNotFound>;
195
+ /**
196
+ * Get a SymbolHandle synchronously (for service interface).
197
+ * Automatically resolves generic capabilities to implementation-specific.
198
+ * Throws if not found.
199
+ */
200
+ import(capability: Capability): SymbolHandle;
201
+ /**
202
+ * Get all registered symbols.
203
+ */
204
+ all(): readonly SymbolDeclaration[];
205
+ /**
206
+ * Get symbols that match a capability pattern.
207
+ * Pattern uses simple prefix matching: "type:" matches all types.
208
+ * Note: For category-based queries, use the implementation-specific prefix
209
+ * (e.g., "queries:kysely:") or query by category pattern (e.g., "queries:").
210
+ */
211
+ query(pattern: string): readonly SymbolDeclaration[];
212
+ /**
213
+ * Get the declaration for a specific capability.
214
+ * Automatically resolves generic capabilities to implementation-specific.
215
+ */
216
+ get(capability: Capability): SymbolDeclaration | undefined;
217
+ /**
218
+ * Set the current capabilities being rendered.
219
+ * Called by orchestrator before each plugin's render() phase.
220
+ */
221
+ setCurrentCapabilities(caps: readonly Capability[]): void;
222
+ /**
223
+ * Clear current capabilities context.
224
+ * Called by orchestrator after each plugin's render() completes.
225
+ */
226
+ clearCurrentCapabilities(): void;
227
+ /**
228
+ * Set the declarations owned by the current plugin.
229
+ * Called by orchestrator before render phase.
230
+ */
231
+ setOwnedDeclarations(decls: readonly SymbolDeclaration[]): void;
232
+ /**
233
+ * Get declarations owned by the current plugin.
234
+ * Returns only the symbols declared by this plugin in Phase 1.
235
+ */
236
+ own(): readonly SymbolDeclaration[];
237
+ /**
238
+ * Scope cross-reference tracking to a single symbol.
239
+ * All `import().ref()` calls within the callback are attributed
240
+ * only to the specified capability.
241
+ *
242
+ * @param capability - The capability to scope refs to
243
+ * @param fn - Function to execute with scoped context
244
+ * @returns The result of fn()
245
+ */
246
+ forSymbol<T>(capability: Capability, fn: () => T): T;
247
+ /**
248
+ * Record a reference from current capabilities to target.
249
+ * Called internally when SymbolHandle.ref() or .call() is invoked.
250
+ */
251
+ private recordReference;
252
+ /**
253
+ * Get all capabilities referenced by a given capability.
254
+ */
255
+ getReferences(capability: Capability): readonly Capability[];
256
+ /**
257
+ * Get the full reference map for emit phase.
258
+ * Maps: source capability -> capabilities it references
259
+ */
260
+ getAllReferences(): ReadonlyMap<Capability, readonly Capability[]>;
261
+ /**
262
+ * Create a service instance that conforms to SymbolRegistryService.
263
+ * Used by orchestrator to provide the service to plugins.
264
+ */
265
+ toService(): SymbolRegistryService;
266
+ }
267
+ export {};
268
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/runtime/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;;;;;;;;;AAYzF;;GAEG;AACH,qBAAa,eAAgB,SAAQ,oBAKnC;CAAG;;;;;;;AAEL;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,uBAMvC;CAAG;;;;;;;;;AAEJ;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,qBAKpC;CAAG;AAeL;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,GAC7C,YAAY,CA0Bd;AAMD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,SAAS,GAAG,SAAS,CAAC;IAEpE,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,E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