@happyvertical/smrt-types 0.40.65 → 0.40.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -10,9 +10,11 @@ Shared TypeScript type definitions. Prevents circular dependencies between packa
10
10
  | `module.ts` | `SmrtModuleMeta`, `ModuleUISlot`, `ModuleComponentType` — module registration and UI slots |
11
11
  | `user.ts` | `UserStatus`, `TenantStatus`, `MembershipStatus`, `SessionStatus`, `OverrideEffect` — status enums |
12
12
  | `identity.ts` | `User`, `Tenant`, `Role`, `Membership`, `SmrtEntityFields` — cross-package identity data contracts (runtime classes live in smrt-users, which `implements` these) |
13
+ | `knowledge.ts` | Additive schema-version-1 domain knowledge contracts shared by core generation and development tooling |
13
14
 
14
15
  ## Rules
15
16
 
16
17
  - **Zero runtime code**: only type definitions and enums
17
18
  - **Always `import type`**: use `import type { Signal }` to avoid runtime imports (except enums which have runtime values)
18
19
  - **Add shared types here**: if two+ packages need the same type, put it here instead of in `smrt-core`
20
+ - **Knowledge compatibility**: keep `DomainKnowledgeManifest.schemaVersion` at 1 for additive optional facts and preserve `DomainKnowledgeObject.methods: string[]`; structured signatures live in the optional `methodSignatures` sibling. Generators set `sensitiveFieldsExcluded: true`; readers must treat its absence as a legacy artifact that needs raw-manifest corroboration.
package/dist/index.d.ts CHANGED
@@ -163,6 +163,28 @@ export declare interface DomainKnowledgeConfig {
163
163
  risks?: string[];
164
164
  }
165
165
 
166
+ /** A field retained in the curated agent-facing object shape. */
167
+ export declare interface DomainKnowledgeField {
168
+ name: string;
169
+ type: string;
170
+ required?: boolean;
171
+ related?: string;
172
+ columnType?: string;
173
+ default?: unknown;
174
+ constraints?: DomainKnowledgeFieldConstraints;
175
+ readonly?: boolean;
176
+ transient?: boolean;
177
+ }
178
+
179
+ /** Validation constraints retained in the curated agent-facing field shape. */
180
+ export declare interface DomainKnowledgeFieldConstraints {
181
+ min?: number;
182
+ max?: number;
183
+ minLength?: number;
184
+ maxLength?: number;
185
+ pattern?: string;
186
+ }
187
+
166
188
  /** Result of a domain-knowledge freshness check (stale references, error/warning counts). */
167
189
  export declare interface DomainKnowledgeFreshnessResult {
168
190
  ok: boolean;
@@ -183,6 +205,8 @@ export declare interface DomainKnowledgeFreshnessResult {
183
205
  /** The package-level domain-knowledge artifact (`smrt-knowledge.json`) — the agent/developer contract. */
184
206
  export declare interface DomainKnowledgeManifest {
185
207
  schemaVersion: 1;
208
+ /** True when generation removed sensitive fields before projecting objects. */
209
+ sensitiveFieldsExcluded?: true;
186
210
  generatedAt: string;
187
211
  packageName?: string;
188
212
  packageVersion?: string;
@@ -215,6 +239,15 @@ export declare interface DomainKnowledgeManifest {
215
239
  moduleDocs?: DomainKnowledgeModuleDoc[];
216
240
  }
217
241
 
242
+ /** Additive structured signature; `methods: string[]` remains the compatibility surface. */
243
+ export declare interface DomainKnowledgeMethodSignature {
244
+ name: string;
245
+ async?: boolean;
246
+ static?: boolean;
247
+ params?: string[];
248
+ returns?: string;
249
+ }
250
+
218
251
  /**
219
252
  * A sibling module doc linked from a package's `AGENTS.md` (#2108).
220
253
  *
@@ -241,21 +274,13 @@ export declare interface DomainKnowledgeObject {
241
274
  packageName?: string;
242
275
  extends?: string;
243
276
  visibility?: string;
244
- fields: Array<{
245
- name: string;
246
- type: string;
247
- required?: boolean;
248
- related?: string;
249
- columnType?: string;
250
- }>;
251
- relationships: Array<{
252
- name: string;
253
- type: string;
254
- required?: boolean;
255
- related?: string;
256
- columnType?: string;
257
- }>;
277
+ fields: DomainKnowledgeField[];
278
+ relationships: DomainKnowledgeField[];
258
279
  methods: string[];
280
+ methodSignatures?: DomainKnowledgeMethodSignature[];
281
+ tenant?: DomainKnowledgeTenant;
282
+ tableStrategy?: 'cti' | 'sti';
283
+ conflictColumns?: string[];
259
284
  surfaces: DomainKnowledgeSurface[];
260
285
  relationshipFeatures: string[];
261
286
  tags: string[];
@@ -277,6 +302,13 @@ export declare interface DomainKnowledgeSurface {
277
302
  /** Kind of generated surface a knowledge entry describes (REST/CLI/MCP/AI). */
278
303
  export declare type DomainKnowledgeSurfaceKind = 'api' | 'cli' | 'mcp' | 'ai';
279
304
 
305
+ /** Normalized tenancy facts from `@smrt({ tenantScoped })`. */
306
+ export declare interface DomainKnowledgeTenant {
307
+ scoped: boolean;
308
+ mode?: 'required' | 'optional';
309
+ field?: string;
310
+ }
311
+
280
312
  /** User↔Tenant↔Role junction. Runtime class: `@happyvertical/smrt-users:Membership`. */
281
313
  export declare interface Membership extends SmrtEntityFields {
282
314
  userId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-types",
3
- "version": "0.40.65",
3
+ "version": "0.40.67",
4
4
  "description": "Shared type definitions for the HAVE SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",