@adhd/agent-store-prompts 2.1.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 (67) hide show
  1. package/drizzle/0000_third_nitro.sql +19 -0
  2. package/drizzle/0001_agents_and_taxonomy.sql +26 -0
  3. package/drizzle/0002_agent_components_junction.sql +13 -0
  4. package/drizzle/0003_usecase_context_rules.sql +31 -0
  5. package/drizzle/0004_composed_prompts.sql +10 -0
  6. package/drizzle/0005_warm_norman_osborn.sql +48 -0
  7. package/drizzle/0006_component_head_version_split.sql +78 -0
  8. package/drizzle/meta/0000_snapshot.json +137 -0
  9. package/drizzle/meta/0001_snapshot.json +302 -0
  10. package/drizzle/meta/0002_snapshot.json +381 -0
  11. package/drizzle/meta/0004_snapshot.json +594 -0
  12. package/drizzle/meta/0005_snapshot.json +594 -0
  13. package/drizzle/meta/0006_snapshot.json +672 -0
  14. package/drizzle/meta/_journal.json +55 -0
  15. package/package.json +51 -0
  16. package/src/db/client.d.ts +7 -0
  17. package/src/db/client.d.ts.map +1 -0
  18. package/src/db/client.js +24 -0
  19. package/src/db/client.js.map +1 -0
  20. package/src/db/migrate-runner.d.ts +31 -0
  21. package/src/db/migrate-runner.d.ts.map +1 -0
  22. package/src/db/migrate-runner.js +35 -0
  23. package/src/db/migrate-runner.js.map +1 -0
  24. package/src/db/migrate.d.ts +9 -0
  25. package/src/db/migrate.d.ts.map +1 -0
  26. package/src/db/migrate.js +13 -0
  27. package/src/db/migrate.js.map +1 -0
  28. package/src/db/schema.d.ts +997 -0
  29. package/src/db/schema.d.ts.map +1 -0
  30. package/src/db/schema.js +323 -0
  31. package/src/db/schema.js.map +1 -0
  32. package/src/index.d.ts +21 -0
  33. package/src/index.d.ts.map +1 -0
  34. package/src/index.js +23 -0
  35. package/src/index.js.map +1 -0
  36. package/src/seed/components.d.ts +23 -0
  37. package/src/seed/components.d.ts.map +1 -0
  38. package/src/seed/components.js +399 -0
  39. package/src/seed/components.js.map +1 -0
  40. package/src/seed/index.d.ts +30 -0
  41. package/src/seed/index.d.ts.map +1 -0
  42. package/src/seed/index.js +95 -0
  43. package/src/seed/index.js.map +1 -0
  44. package/src/seed/prompt-types.d.ts +17 -0
  45. package/src/seed/prompt-types.d.ts.map +1 -0
  46. package/src/seed/prompt-types.js +107 -0
  47. package/src/seed/prompt-types.js.map +1 -0
  48. package/src/store/agent-store.d.ts +113 -0
  49. package/src/store/agent-store.d.ts.map +1 -0
  50. package/src/store/agent-store.js +211 -0
  51. package/src/store/agent-store.js.map +1 -0
  52. package/src/store/component-store.d.ts +87 -0
  53. package/src/store/component-store.d.ts.map +1 -0
  54. package/src/store/component-store.js +305 -0
  55. package/src/store/component-store.js.map +1 -0
  56. package/src/store/composed-prompt-store.d.ts +72 -0
  57. package/src/store/composed-prompt-store.d.ts.map +1 -0
  58. package/src/store/composed-prompt-store.js +147 -0
  59. package/src/store/composed-prompt-store.js.map +1 -0
  60. package/src/store/composition-store.d.ts +117 -0
  61. package/src/store/composition-store.d.ts.map +1 -0
  62. package/src/store/composition-store.js +270 -0
  63. package/src/store/composition-store.js.map +1 -0
  64. package/src/store/usecase-store.d.ts +104 -0
  65. package/src/store/usecase-store.d.ts.map +1 -0
  66. package/src/store/usecase-store.js +158 -0
  67. package/src/store/usecase-store.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../packages/agent/agent-store-prompts/src/db/schema.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAC;AAgBH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3B,CAAC;AAoBF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkChC,CAAC"}
@@ -0,0 +1,323 @@
1
+ import { index, integer, primaryKey, sqliteTable, text, uniqueIndex, } from 'drizzle-orm/sqlite-core';
2
+ // ──────────────────────────────────────────────
3
+ // @adhd/agent-registry — table prefix: registry_
4
+ //
5
+ // Decision 1 (decisions.md): all tables in this package use the `registry_`
6
+ // prefix. Cross-package FKs are logical only (plain text columns, no
7
+ // .references() across prefixes). In-package FKs use .references() normally.
8
+ //
9
+ // Tables are added by later plan states:
10
+ // - lookup-and-component-schema → registry_prompt_types,
11
+ // registry_components (head) +
12
+ // registry_component_versions (history)
13
+ // - agents-table → registry_agents
14
+ // - composition-junction → registry_agent_components
15
+ // - usecase-and-context-rules → registry_context_rules
16
+ // - composed-prompts → registry_composed_prompts
17
+ //
18
+ // Decision 5 (decisions.md): component IDENTITY (registry_components, keyed by a
19
+ // single-column text PK `slug`) is split from component HISTORY
20
+ // (registry_component_versions, keyed by a single-column surrogate `version_id`).
21
+ // This makes `slug` and `version_id` real single-column PKs that downstream tables
22
+ // can target with ENFORCED Drizzle .references() FKs — the integrity the old
23
+ // (slug, version) composite-PK table could not provide.
24
+ // ──────────────────────────────────────────────
25
+ // ──────────────────────────────────────────────
26
+ // registry_prompt_types
27
+ //
28
+ // Lookup table for prompt component types. Text PK (slug), not a SQL enum —
29
+ // new types are added by inserting a row, no migration needed.
30
+ // [inv:lookup-not-enum] (decisions.md)
31
+ // ──────────────────────────────────────────────
32
+ export const promptTypesTable = sqliteTable('registry_prompt_types', {
33
+ slug: text('slug').primaryKey(),
34
+ description: text('description').notNull(),
35
+ isSystem: integer('is_system', { mode: 'boolean' }).notNull().default(false),
36
+ });
37
+ // ──────────────────────────────────────────────
38
+ // registry_components (component IDENTITY / head)
39
+ //
40
+ // Decision 5 (decisions.md): the IDENTITY half of the head/version split. One row
41
+ // per component slug. `slug` is a single-column TEXT PRIMARY KEY — this is the
42
+ // stable identity every other table FKs onto (which the old (slug, version)
43
+ // composite-PK table made impossible).
44
+ //
45
+ // `type` and `is_shared` are IDENTITY-level facts: they describe what the
46
+ // component IS, not what any particular revision says, so they live on the head
47
+ // row and do not change per version.
48
+ //
49
+ // `type` is an in-package FK → registry_prompt_types.slug (.references(), enforced).
50
+ // ──────────────────────────────────────────────
51
+ export const componentsTable = sqliteTable('registry_components', {
52
+ slug: text('slug').primaryKey(),
53
+ type: text('type')
54
+ .notNull()
55
+ .references(() => promptTypesTable.slug),
56
+ isShared: integer('is_shared', { mode: 'boolean' })
57
+ .notNull()
58
+ .default(false),
59
+ createdAt: text('created_at').notNull(),
60
+ }, (t) => ({
61
+ typeIdx: index('registry_components_type_idx').on(t.type),
62
+ }));
63
+ // ──────────────────────────────────────────────
64
+ // registry_component_versions (component HISTORY / audit)
65
+ //
66
+ // Decision 5 (decisions.md): the HISTORY half of the head/version split. One row
67
+ // per (slug, version). `version_id` is a single-column autoincrement SURROGATE
68
+ // PRIMARY KEY so a junction row's version_pin can be an ENFORCED FK to exactly one
69
+ // version row (a composite (slug, version) target could not be FK'd).
70
+ //
71
+ // Old versions are retained for audit/rollback — bumping a component writes a NEW
72
+ // row at max(version)+1 for the slug; it never mutates a prior row.
73
+ // [inv:version-retained] (decisions.md)
74
+ //
75
+ // `slug` is an in-package FK → registry_components.slug (.references(), enforced):
76
+ // a version row cannot exist without its head identity row.
77
+ // UNIQUE(slug, version) is a REAL unique index — it gives [inv:version-retained]
78
+ // its teeth (a duplicate (slug, version) write THROWS) and guarantees version_pin
79
+ // resolution is unambiguous.
80
+ // ──────────────────────────────────────────────
81
+ export const componentVersionsTable = sqliteTable('registry_component_versions', {
82
+ versionId: integer('version_id').primaryKey({ autoIncrement: true }),
83
+ slug: text('slug')
84
+ .notNull()
85
+ .references(() => componentsTable.slug),
86
+ version: integer('version').notNull().default(1),
87
+ content: text('content').notNull(),
88
+ createdAt: text('created_at').notNull(),
89
+ updatedAt: text('updated_at').notNull(),
90
+ }, (t) => ({
91
+ slugVersionUq: uniqueIndex('registry_component_versions_slug_version_uq').on(t.slug, t.version),
92
+ slugIdx: index('registry_component_versions_slug_idx').on(t.slug),
93
+ }));
94
+ // ──────────────────────────────────────────────
95
+ // registry_taxonomy_categories
96
+ //
97
+ // Hierarchical taxonomy for grouping agents. `position` (integer) replaces the
98
+ // `01-`/`02-` directory-prefix convention for ordering. `parent_slug` is a
99
+ // nullable self-FK enabling subcategory nesting (e.g. cto-system/).
100
+ // In-package self-FK: .references() is used normally within this prefix.
101
+ // ──────────────────────────────────────────────
102
+ export const taxonomyCategoriesTable = sqliteTable('registry_taxonomy_categories', {
103
+ slug: text('slug').primaryKey(),
104
+ name: text('name').notNull(),
105
+ description: text('description').notNull().default(''),
106
+ position: integer('position').notNull().default(0),
107
+ // nullable self-FK for subcategories
108
+ parentSlug: text('parent_slug').references(() => taxonomyCategoriesTable.slug),
109
+ }, (t) => ({
110
+ positionIdx: index('registry_taxonomy_categories_position_idx').on(t.position),
111
+ parentIdx: index('registry_taxonomy_categories_parent_idx').on(t.parentSlug),
112
+ }));
113
+ // ──────────────────────────────────────────────
114
+ // registry_agents
115
+ //
116
+ // Agent identity rows. Holds metadata only — no prompt text.
117
+ // `model_hint` is plain TEXT (a canonical model id); NOT an FK onto any
118
+ // provider table. Cross-package resolution happens at compile time in
119
+ // @adhd/agent-provider; Decision 1 forbids cross-package SQLite FKs.
120
+ // `taxonomy_category` is an in-package FK → registry_taxonomy_categories.slug.
121
+ // ──────────────────────────────────────────────
122
+ export const agentsTable = sqliteTable('registry_agents', {
123
+ slug: text('slug').primaryKey(),
124
+ displayName: text('display_name').notNull(),
125
+ description: text('description').notNull().default(''),
126
+ // 'draft' | 'active' | 'deprecated' — plain TEXT, not a SQL enum.
127
+ // New statuses are added by convention, no migration needed.
128
+ // [inv:lookup-not-enum] (contexts/_shared.md)
129
+ status: text('status').notNull().default('draft'),
130
+ // Canonical model id string resolved at compile time by @adhd/agent-provider.
131
+ // NO cross-package FK (Decision 1: decisions.md).
132
+ modelHint: text('model_hint'),
133
+ // In-package FK to registry_taxonomy_categories.slug.
134
+ taxonomyCategory: text('taxonomy_category').references(() => taxonomyCategoriesTable.slug),
135
+ // 'approve' | 'needs_work' — plain TEXT
136
+ defaultPosture: text('default_posture').notNull().default('needs_work'),
137
+ createdAt: text('created_at').notNull(),
138
+ updatedAt: text('updated_at').notNull(),
139
+ }, (t) => ({
140
+ statusIdx: index('registry_agents_status_idx').on(t.status),
141
+ categoryIdx: index('registry_agents_category_idx').on(t.taxonomyCategory),
142
+ }));
143
+ // ──────────────────────────────────────────────
144
+ // registry_use_cases (usecase-and-context-rules state)
145
+ //
146
+ // Seed data for the future suggestion engine (GOAL.md "Knowledge Graph").
147
+ // Represents named scenarios components can be tagged against — e.g. code-review,
148
+ // security-audit, data-migration. Annotation only; does NOT affect runtime composition.
149
+ // ──────────────────────────────────────────────
150
+ export const useCasesTable = sqliteTable('registry_use_cases', {
151
+ slug: text('slug').primaryKey(),
152
+ name: text('name').notNull(),
153
+ description: text('description').notNull().default(''),
154
+ });
155
+ // ──────────────────────────────────────────────
156
+ // registry_component_usage (usecase-and-context-rules state)
157
+ //
158
+ // Junction: (component_slug, use_case_slug) with an optional numeric weight.
159
+ // Records which prompt components are valuable in which scenarios.
160
+ // ANNOTATION ONLY — must NOT be on resolveComposition's hot path. This table
161
+ // informs the future suggestion engine (GOAL.md "Knowledge Graph"), not runtime assembly.
162
+ //
163
+ // component_slug is now an ENFORCED in-package FK → registry_components.slug
164
+ // (.references()). Decision 5's head/version split made registry_components.slug a
165
+ // single-column PK, so SQLite can enforce this — annotating a component that has no
166
+ // head identity row now THROWS instead of silently inserting an orphan.
167
+ // use_case_slug is an in-package FK → registry_use_cases.slug (.references() used normally).
168
+ // ──────────────────────────────────────────────
169
+ export const componentUsageTable = sqliteTable('registry_component_usage', {
170
+ componentSlug: text('component_slug')
171
+ .notNull()
172
+ .references(() => componentsTable.slug),
173
+ useCaseSlug: text('use_case_slug')
174
+ .notNull()
175
+ .references(() => useCasesTable.slug),
176
+ // Optional weight for future ranking/suggestion logic. Higher = more valuable.
177
+ weight: integer('weight'),
178
+ }, (t) => ({
179
+ pk: primaryKey({ columns: [t.componentSlug, t.useCaseSlug] }),
180
+ useCaseIdx: index('registry_component_usage_use_case_idx').on(t.useCaseSlug),
181
+ componentIdx: index('registry_component_usage_component_idx').on(t.componentSlug),
182
+ }));
183
+ // ──────────────────────────────────────────────
184
+ // registry_context_rules (usecase-and-context-rules state)
185
+ //
186
+ // Free-standing additive inclusion rules: "for agent X, when condition Y,
187
+ // additionally include component Z."
188
+ //
189
+ // Decision 3 (decisions.md): KEEP BOTH tables. This is DISTINCT from
190
+ // registry_agent_components.context_condition (junction-level). A junction row
191
+ // asks "is this already-attached component included?"; a context_rules row asks
192
+ // "does this agent gain a component it does NOT permanently own when Y holds?"
193
+ //
194
+ // Evaluation (Decision 3 §"Binding unification rules"):
195
+ // - Same JSON-predicate format as context_condition on the junction.
196
+ // - Same evaluator function: evaluateCondition() from composition-store.ts.
197
+ // - Resolution = (matching junction components) ∪ (components added by matching rules).
198
+ // - If the same component_slug arrives from both sources, the junction row wins for
199
+ // position / version_pin / is_required (the explicit attachment is authoritative).
200
+ // - A context_rules row can only ADD; it cannot make a junction row optional/required.
201
+ //
202
+ // position: an integer ordering key used when merging into Decision 2's total order.
203
+ // null = append at end (implementation detail for agent-compiler).
204
+ //
205
+ // agent_slug: logical FK → registry_agents.slug. In-package but we use .references()
206
+ // as it IS within the same prefix, so in-package FK rules apply (Decision 1 §3).
207
+ // component_slug: now an ENFORCED FK → registry_components.slug (Decision 5). A rule
208
+ // that adds a nonexistent component now THROWS at insert instead of silently
209
+ // creating an orphan additive rule.
210
+ // ──────────────────────────────────────────────
211
+ export const contextRulesTable = sqliteTable('registry_context_rules', {
212
+ id: integer('id').primaryKey({ autoIncrement: true }),
213
+ agentSlug: text('agent_slug')
214
+ .notNull()
215
+ .references(() => agentsTable.slug),
216
+ // JSON predicate in the same format as context_condition on the junction.
217
+ // Evaluated by evaluateCondition() (composition-store.ts) — same evaluator,
218
+ // never a separate one. [Decision 3: one predicate shape, one evaluator]
219
+ condition: text('condition').notNull(),
220
+ componentSlug: text('component_slug')
221
+ .notNull()
222
+ .references(() => componentsTable.slug),
223
+ // Position for merging into the Decision 2 total order. null = append.
224
+ position: integer('position'),
225
+ }, (t) => ({
226
+ agentIdx: index('registry_context_rules_agent_idx').on(t.agentSlug),
227
+ componentIdx: index('registry_context_rules_component_idx').on(t.componentSlug),
228
+ }));
229
+ // ──────────────────────────────────────────────
230
+ // registry_composed_prompts (composed-prompt-cache state)
231
+ //
232
+ // Cache + audit table for assembled prompts.
233
+ // [def:composed-prompt] (contexts/_shared.md)
234
+ //
235
+ // `context_hash` is the SHA-256 of the sorted-key JSON canonicalization of the
236
+ // runtime context map used at assembly time. Same inputs in any key order →
237
+ // identical hash. This makes (agent_slug, context_hash) an O(1) cache key.
238
+ // Index on (agent_slug, context_hash) supports the lookup hot-path.
239
+ //
240
+ // `component_versions` is a JSON map `{componentSlug: version}` recording the
241
+ // exact component version resolved during assembly — the audit trail GOAL.md
242
+ // "Audit Trail" depends on (Decision 4, decisions.md). A cache miss (or a new
243
+ // unpinned component advancing to a later version) triggers a new write.
244
+ //
245
+ // agent_slug is a LOGICAL FK only (no .references()) — cross-concern, same as
246
+ // the pattern in registry_context_rules for cross-prefix references. The store
247
+ // layer enforces the link at write time.
248
+ // ──────────────────────────────────────────────
249
+ export const composedPromptsTable = sqliteTable('registry_composed_prompts', {
250
+ id: integer('id').primaryKey({ autoIncrement: true }),
251
+ agentSlug: text('agent_slug').notNull(),
252
+ // SHA-256 of sorted-key JSON canonicalization of the context inputs.
253
+ // Same map with different key orderings → same hash. [ref: contextHash helper]
254
+ contextHash: text('context_hash').notNull(),
255
+ // The final flat assembled prompt text.
256
+ content: text('content').notNull(),
257
+ // JSON object: { [componentSlug]: version } — full audit record.
258
+ // Proves exactly which component versions produced this composed prompt.
259
+ componentVersions: text('component_versions').notNull(),
260
+ createdAt: text('created_at').notNull(),
261
+ }, (t) => ({
262
+ // O(1) cache lookup: (agent_slug, context_hash) index.
263
+ agentHashIdx: index('registry_composed_prompts_agent_hash_idx').on(t.agentSlug, t.contextHash),
264
+ }));
265
+ // ──────────────────────────────────────────────
266
+ // registry_agent_components (composition-junction state)
267
+ //
268
+ // Junction table binding agents to their ordered component set.
269
+ // [def:junction-row] (contexts/_shared.md)
270
+ //
271
+ // PK: (agent_slug, component_slug, position)
272
+ // - position is an ORDERING key, not a unique slot — multiple components MAY
273
+ // share the same position value (Decision 2: all-included, total order).
274
+ // - version_pin: null → resolve latest-at-resolve-time (Decision 4).
275
+ // int → a registry_component_versions.version_id — pin to exactly
276
+ // that version row (Decision 4 + Decision 5).
277
+ // - context_condition: nullable JSON predicate; null = always include.
278
+ // Evaluated by CompositionStore.resolveComposition per Decision 2:
279
+ // every key in the predicate must equal the corresponding context value.
280
+ // - is_required: true AND condition does not match → CompositionError thrown.
281
+ //
282
+ // THREE FKs, all DB-enforced (Decision 5):
283
+ // - agent_slug → registry_agents.slug (always-enforced).
284
+ // - component_slug → registry_components.slug (always-enforced): a junction row
285
+ // cannot reference a component that has no head identity row.
286
+ // - version_pin → registry_component_versions.version_id (NULLABLE-enforced):
287
+ // null = resolve latest at resolve-time; a non-null value MUST name an
288
+ // existing version row.
289
+ //
290
+ // Two SEPARATE FKs are used (component_slug always-enforced + version_pin
291
+ // nullable-enforced), NOT one composite FK: in SQLite a composite FK whose set of
292
+ // columns includes a NULL column is treated as satisfied (not enforced), so a
293
+ // composite (component_slug, version_pin) FK would lose enforcement for the common
294
+ // null-pin case. Splitting them keeps component_slug strictly enforced while
295
+ // letting version_pin be null-or-valid.
296
+ // ──────────────────────────────────────────────
297
+ export const agentComponentsTable = sqliteTable('registry_agent_components', {
298
+ agentSlug: text('agent_slug')
299
+ .notNull()
300
+ .references(() => agentsTable.slug),
301
+ componentSlug: text('component_slug')
302
+ .notNull()
303
+ .references(() => componentsTable.slug),
304
+ // Assembly ordering key — NOT a unique slot. Decision 2: position ASC
305
+ // is the primary sort; ties broken by (version DESC, component_slug ASC).
306
+ position: integer('position').notNull(),
307
+ // null = latest-at-resolve; integer = a registry_component_versions.version_id
308
+ // pinning that exact version row. [Decision 4 + Decision 5]
309
+ versionPin: integer('version_pin').references(() => componentVersionsTable.versionId),
310
+ // JSON predicate object as text, e.g. '{"ticket_type":"security"}'.
311
+ // null means always include. [def:context-condition]
312
+ contextCondition: text('context_condition'),
313
+ // 1 = required; if condition filters this row out → CompositionError.
314
+ isRequired: integer('is_required', { mode: 'boolean' })
315
+ .notNull()
316
+ .default(false),
317
+ }, (t) => ({
318
+ // Composite PK: (agent_slug, component_slug, position) per DATA_MODEL.md Domain 1.
319
+ pk: primaryKey({ columns: [t.agentSlug, t.componentSlug, t.position] }),
320
+ agentIdx: index('registry_agent_components_agent_idx').on(t.agentSlug),
321
+ positionIdx: index('registry_agent_components_position_idx').on(t.agentSlug, t.position),
322
+ }));
323
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../packages/agent/agent-store-prompts/src/db/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,IAAI,EACJ,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC,iDAAiD;AACjD,iDAAiD;AACjD,EAAE;AACF,4EAA4E;AAC5E,qEAAqE;AACrE,6EAA6E;AAC7E,EAAE;AACF,yCAAyC;AACzC,4DAA4D;AAC5D,kEAAkE;AAClE,2EAA2E;AAC3E,qDAAqD;AACrD,+DAA+D;AAC/D,4DAA4D;AAC5D,+DAA+D;AAC/D,EAAE;AACF,iFAAiF;AACjF,gEAAgE;AAChE,kFAAkF;AAClF,mFAAmF;AACnF,6EAA6E;AAC7E,wDAAwD;AACxD,iDAAiD;AAEjD,iDAAiD;AACjD,wBAAwB;AACxB,EAAE;AACF,4EAA4E;AAC5E,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0E;IAC1E,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACvC,+EAA+E;IAC/E,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,UAAU,CAC3C,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,CACvC;IACD,oEAAoE;IACpE,qDAAqD;IACrD,gBAAgB,EAAE,IAAI,CAAC,mBAAmB,CAAC;IAC3C,sEAAsE;IACtE,UAAU,EAAE,OAAO,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;SACpD,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;CAClB,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACN,mFAAmF;IACnF,EAAE,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvE,QAAQ,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,WAAW,EAAE,KAAK,CAAC,wCAAwC,CAAC,CAAC,EAAE,CAC7D,CAAC,CAAC,SAAS,EACX,CAAC,CAAC,QAAQ,CACX;CACF,CAAC,CACH,CAAC"}
package/src/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ export { sqlite, db } from './db/client.js';
2
+ export { runMigrations } from './db/migrate.js';
3
+ export { runMigrationsOn, MIGRATIONS_FOLDER } from './db/migrate-runner.js';
4
+ export * from './db/schema.js';
5
+ export { ComponentStore } from './store/component-store.js';
6
+ export type { PromptType, PromptComponent, ComponentCreateInput, ComponentListFilter, } from './store/component-store.js';
7
+ export { ComponentError } from './store/component-store.js';
8
+ export { AgentStore, TaxonomyStore } from './store/agent-store.js';
9
+ export type { Agent, AgentCreateInput, AgentUpdateInput, AgentListFilter, AgentStatus, AgentPosture, TaxonomyCategory, TaxonomyCategoryCreateInput, } from './store/agent-store.js';
10
+ export { AgentError } from './store/agent-store.js';
11
+ export { CompositionStore, CompositionError, evaluateCondition, } from './store/composition-store.js';
12
+ export type { CompositionContext, ResolvedComponent, } from './store/composition-store.js';
13
+ export { UseCaseStore, UseCaseError } from './store/usecase-store.js';
14
+ export type { UseCase, UseCaseCreateInput, ComponentUsageRow, ContextRule, ContextRuleCreateInput, } from './store/usecase-store.js';
15
+ export { ComposedPromptStore, ComposedPromptError, contextHash, } from './store/composed-prompt-store.js';
16
+ export type { ComposedPrompt, ComposedPromptWriteInput, } from './store/composed-prompt-store.js';
17
+ export { seed } from './seed/index.js';
18
+ export { PROMPT_TYPES } from './seed/prompt-types.js';
19
+ export { SEED_COMPONENTS } from './seed/components.js';
20
+ export type { SeedComponent } from './seed/components.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/agent/agent-store-prompts/src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,YAAY,EACV,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EACV,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EACV,OAAO,EACP,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,GACZ,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,cAAc,EACd,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
package/src/index.js ADDED
@@ -0,0 +1,23 @@
1
+ // @adhd/agent-registry — public barrel
2
+ // Each subsequent plan state adds exports here as tables and stores are added.
3
+ export { sqlite, db } from './db/client.js';
4
+ export { runMigrations } from './db/migrate.js';
5
+ export { runMigrationsOn, MIGRATIONS_FOLDER } from './db/migrate-runner.js';
6
+ export * from './db/schema.js';
7
+ // lookup-and-component-schema state: prompt types + components store
8
+ export { ComponentStore } from './store/component-store.js';
9
+ export { ComponentError } from './store/component-store.js';
10
+ // agent-and-taxonomy-schema state: agents + taxonomy_categories store
11
+ export { AgentStore, TaxonomyStore } from './store/agent-store.js';
12
+ export { AgentError } from './store/agent-store.js';
13
+ // composition-junction state: agent_components junction + CompositionStore
14
+ export { CompositionStore, CompositionError, evaluateCondition, } from './store/composition-store.js';
15
+ // usecase-and-context-rules state: use_cases, component_usage, context_rules + UseCaseStore
16
+ export { UseCaseStore, UseCaseError } from './store/usecase-store.js';
17
+ // composed-prompt-cache state: composed_prompts table + ComposedPromptStore + contextHash helper
18
+ export { ComposedPromptStore, ComposedPromptError, contextHash, } from './store/composed-prompt-store.js';
19
+ // seed-and-roundtrip state: idempotent DB seed function + seed data arrays
20
+ export { seed } from './seed/index.js';
21
+ export { PROMPT_TYPES } from './seed/prompt-types.js';
22
+ export { SEED_COMPONENTS } from './seed/components.js';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/agent/agent-store-prompts/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,+EAA+E;AAE/E,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,cAAc,gBAAgB,CAAC;AAE/B,qEAAqE;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAO5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,sEAAsE;AACtE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAWnE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,2EAA2E;AAC3E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AAMtC,4FAA4F;AAC5F,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAStE,iGAAiG;AACjG,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,GACZ,MAAM,kCAAkC,CAAC;AAM1C,2EAA2E;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * seed/components.ts
3
+ *
4
+ * Shared prompt components with REAL content from SEED_DATA.md §8 (§8.1–§8.11).
5
+ * Each entry becomes a registry_components head identity row plus a
6
+ * registry_component_versions history row at its canonical version (Decision 5),
7
+ * is_shared = true (unless noted otherwise).
8
+ *
9
+ * Source: docs/plan/agent-registry/SEED_DATA.md §8
10
+ */
11
+ export interface SeedComponent {
12
+ slug: string;
13
+ type: string;
14
+ version: number;
15
+ content: string;
16
+ isShared: boolean;
17
+ }
18
+ /**
19
+ * All shared prompt components that ship with @adhd/agent-registry.
20
+ * The seed function inserts these idempotently (ON CONFLICT DO NOTHING).
21
+ */
22
+ export declare const SEED_COMPONENTS: SeedComponent[];
23
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../../packages/agent/agent-store-prompts/src/seed/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,EA4a1C,CAAC"}