@happyvertical/smrt-content 0.51.32 → 0.51.34

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 (57) hide show
  1. package/dist/asset-associable.d.ts +1 -1
  2. package/dist/chunks/{content-query-RUQgufnT.js → content-query-CwPuga5L.js} +4 -4
  3. package/dist/chunks/{content-query-RUQgufnT.js.map → content-query-CwPuga5L.js.map} +1 -1
  4. package/dist/chunks/{content-versions-Bxfqtkj9.js → content-versions-0XKugPNA.js} +2 -2
  5. package/dist/chunks/{content-versions-Bxfqtkj9.js.map → content-versions-0XKugPNA.js.map} +1 -1
  6. package/dist/chunks/{contents-BjYewZHy.js → contents-DVD3XsjE.js} +2 -2
  7. package/dist/chunks/{contents-BjYewZHy.js.map → contents-DVD3XsjE.js.map} +1 -1
  8. package/dist/content-asset.d.ts +2 -1
  9. package/dist/content-assets.d.ts +2 -1
  10. package/dist/content-chat-handlers.d.ts +12 -12
  11. package/dist/content-chat-prompts.d.ts +2 -2
  12. package/dist/content-chat-route-helpers.d.ts +10 -0
  13. package/dist/content-chat-route-helpers.d.ts.map +1 -0
  14. package/dist/content-chat-session.d.ts +1 -1
  15. package/dist/content-contribution-attachment.d.ts +3 -2
  16. package/dist/content-contribution-config.d.ts +1 -1
  17. package/dist/content-contribution-revision.d.ts +3 -2
  18. package/dist/content-contribution-type.d.ts +3 -2
  19. package/dist/content-contribution.d.ts +6 -5
  20. package/dist/content-contributions.d.ts +7 -6
  21. package/dist/content-contributor.d.ts +3 -2
  22. package/dist/content-correction.d.ts +3 -2
  23. package/dist/content-feed-source.d.ts +3 -2
  24. package/dist/content-feed-sources.d.ts +3 -2
  25. package/dist/content-feed-sync.d.ts +3 -3
  26. package/dist/content-governance-assignment.d.ts +4 -3
  27. package/dist/content-governance-policy.d.ts +3 -2
  28. package/dist/content-governance-profile.d.ts +3 -2
  29. package/dist/content-governance.d.ts +3 -3
  30. package/dist/content-prompts.d.ts +4 -4
  31. package/dist/content-query.d.ts +23 -1
  32. package/dist/content-reference.d.ts +2 -1
  33. package/dist/content-references.d.ts +2 -1
  34. package/dist/content-review.d.ts +3 -2
  35. package/dist/content-reviews.d.ts +1 -1
  36. package/dist/content-types.d.ts +7 -1
  37. package/dist/content-version.d.ts +5 -4
  38. package/dist/content-versions.d.ts +2 -2
  39. package/dist/content.d.ts +19 -18
  40. package/dist/contents.d.ts +14 -13
  41. package/dist/index.d.ts +7 -0
  42. package/dist/index.js +4 -4
  43. package/dist/manifest.json +1 -1
  44. package/dist/mock-smrt-client.d.ts +7 -1
  45. package/dist/route-loaders.d.ts +1 -1
  46. package/dist/route-module.d.ts +31 -3
  47. package/dist/server/content-list-actions.d.ts +16 -6
  48. package/dist/server/content-list-data-surface.d.ts +3 -2
  49. package/dist/server/content-list-lifecycle.d.ts +12 -3
  50. package/dist/server.d.ts +7 -0
  51. package/dist/server.js +1 -1
  52. package/dist/smrt-knowledge.json +4 -4
  53. package/dist/thumbnail-generator.d.ts +14 -6
  54. package/dist/ui.d.ts +7 -1
  55. package/dist/utils.d.ts +1 -1
  56. package/dist/workbench.d.ts +32 -32
  57. package/package.json +17 -17
@@ -1,5 +1,6 @@
1
- import { SmrtCollectionOptions, SmrtCollection } from '@happyvertical/smrt-core';
2
- import { ContentFeedSource, ContentFeedSourceStatus } from './content-feed-source';
1
+ import type { SmrtCollectionOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtCollection } from '@happyvertical/smrt-core';
3
+ import { ContentFeedSource, type ContentFeedSourceStatus } from './content-feed-source';
3
4
  export interface ContentFeedSourceCollectionOptions extends SmrtCollectionOptions {
4
5
  }
5
6
  export declare class ContentFeedSourceCollection extends SmrtCollection<ContentFeedSource> {
@@ -1,6 +1,6 @@
1
- import { SmrtCollectionOptions } from '@happyvertical/smrt-core';
2
- import { ContentFeedSource } from './content-feed-source';
3
- import { ResolveHostname } from './safe-remote-url';
1
+ import { type SmrtCollectionOptions } from '@happyvertical/smrt-core';
2
+ import type { ContentFeedSource } from './content-feed-source';
3
+ import { type ResolveHostname } from './safe-remote-url';
4
4
  export interface ContentFeedSyncOptions extends SmrtCollectionOptions {
5
5
  fetch?: typeof fetch;
6
6
  maxItems?: number;
@@ -1,6 +1,7 @@
1
- import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
- import { FactContentRelationship } from '@happyvertical/smrt-facts';
3
- import { ContentGovernanceAssignmentDefinition } from './content-governance';
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtObject } from '@happyvertical/smrt-core';
3
+ import type { FactContentRelationship } from '@happyvertical/smrt-facts';
4
+ import { type ContentGovernanceAssignmentDefinition } from './content-governance';
4
5
  export interface ContentGovernanceAssignmentOptions extends SmrtObjectOptions {
5
6
  key?: string;
6
7
  label?: string;
@@ -1,5 +1,6 @@
1
- import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
- import { ContentReviewKind, ContentReviewPolicyDefinition } from './content-governance';
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtObject } from '@happyvertical/smrt-core';
3
+ import { type ContentReviewKind, type ContentReviewPolicyDefinition } from './content-governance';
3
4
  export interface ContentGovernancePolicyOptions extends SmrtObjectOptions {
4
5
  key?: string;
5
6
  label?: string;
@@ -1,5 +1,6 @@
1
- import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
- import { ContentGovernanceProfileDefinition, ContentReviewRequirement } from './content-governance';
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtObject } from '@happyvertical/smrt-core';
3
+ import { type ContentGovernanceProfileDefinition, type ContentReviewRequirement } from './content-governance';
3
4
  export interface ContentGovernanceProfileOptions extends SmrtObjectOptions {
4
5
  key?: string;
5
6
  label?: string;
@@ -1,6 +1,6 @@
1
- import { Fact, FactContentRelationship } from '@happyvertical/smrt-facts';
2
- import { DatabaseInterface } from '@happyvertical/sql';
3
- import { Content } from './content';
1
+ import type { Fact, FactContentRelationship } from '@happyvertical/smrt-facts';
2
+ import type { DatabaseInterface } from '@happyvertical/sql';
3
+ import type { Content } from './content';
4
4
  export type ContentReviewKind = 'facts' | 'safety' | 'custom';
5
5
  export type ContentReviewStatus = 'pending' | 'passed' | 'flagged' | 'failed' | 'waived';
6
6
  export type ContentReviewSeverity = 'info' | 'warning' | 'error';
@@ -1,7 +1,7 @@
1
- import { ResolvedPromptAI } from '@happyvertical/smrt-prompts';
2
- export declare const smrtContentReviewPrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
3
- export declare const smrtContentApplyCorrectionPrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
4
- export declare const smrtContentThumbnailAIGeneratePrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
1
+ import { type ResolvedPromptAI } from '@happyvertical/smrt-prompts';
2
+ export declare const smrtContentReviewPrompt: import("@happyvertical/smrt-prompts").PromptDefinition;
3
+ export declare const smrtContentApplyCorrectionPrompt: import("@happyvertical/smrt-prompts").PromptDefinition;
4
+ export declare const smrtContentThumbnailAIGeneratePrompt: import("@happyvertical/smrt-prompts").PromptDefinition;
5
5
  export declare function promptMessageOptions(ai: ResolvedPromptAI): {
6
6
  maxTokens?: number | undefined;
7
7
  temperature?: number | undefined;
@@ -1,4 +1,26 @@
1
- import { DataQueryFieldDescriptor, DataQueryResult, DataQueryRow, DataQuerySchema, DataQuerySort } from '@happyvertical/smrt-types';
1
+ /**
2
+ * Bounded, tenant-safe content data queries (#2452) over the canonical
3
+ * transport-neutral query protocol (#2444).
4
+ *
5
+ * `ContentList` (and any other consumer) sends a `DataQueryRequest`; this
6
+ * module normalizes it against a schema derived from the registered `Content`
7
+ * field metadata, executes it through `SmrtCollection.list/count/facets` — never
8
+ * raw SQL, never a full collection hydration — and returns a validated
9
+ * `DataQueryResult`.
10
+ *
11
+ * Three independent boundaries protect a read:
12
+ *
13
+ * 1. **Schema** — `buildContentQuerySchema()` declares the only field ids a
14
+ * caller may name. `sensitive`, `readPermission`-gated, transient,
15
+ * non-column-backed, tenant, and internal (`_`-prefixed) fields are never
16
+ * declared, so `normalizeDataQueryRequest()` rejects them outright.
17
+ * 2. **Collection** — every projection, order term, and predicate still passes
18
+ * through `SmrtCollection`, which independently refuses sensitive and
19
+ * permission-gated fields. A schema bug alone cannot expose a field.
20
+ * 3. **Scope** — trusted, server-derived conditions are ANDed into every branch
21
+ * of the caller's filter, so a request can only ever narrow the read.
22
+ */
23
+ import type { DataQueryFieldDescriptor, DataQueryResult, DataQueryRow, DataQuerySchema, DataQuerySort } from '@happyvertical/smrt-types';
2
24
  /** Registered qualified name of the STI base every content query reads. */
3
25
  export declare const CONTENT_QUERY_CLASS_NAME = "@happyvertical/smrt-content:Content";
4
26
  /** Row identity for every content query. Never a page or display index. */
@@ -1,4 +1,5 @@
1
- import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtObject } from '@happyvertical/smrt-core';
2
3
  export interface ContentReferenceOptions extends SmrtObjectOptions {
3
4
  sourceId?: string;
4
5
  targetId?: string;
@@ -1,4 +1,5 @@
1
- import { JunctionAttachOptions, SmrtCollectionOptions, SmrtJunction } from '@happyvertical/smrt-core';
1
+ import type { JunctionAttachOptions, SmrtCollectionOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtJunction } from '@happyvertical/smrt-core';
2
3
  import { ContentReference } from './content-reference';
3
4
  export interface ContentReferencesOptions extends SmrtCollectionOptions {
4
5
  }
@@ -1,5 +1,6 @@
1
- import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
- import { ContentReviewFinding, ContentReviewKind, ContentReviewStatus } from './content-governance';
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtObject } from '@happyvertical/smrt-core';
3
+ import type { ContentReviewFinding, ContentReviewKind, ContentReviewStatus } from './content-governance';
3
4
  export interface ContentReviewOptions extends SmrtObjectOptions {
4
5
  contentId?: string;
5
6
  contentVersionId?: string;
@@ -1,5 +1,5 @@
1
1
  import { SmrtCollection } from '@happyvertical/smrt-core';
2
- import { ContentReviewKind, ContentReviewResult } from './content-governance';
2
+ import type { ContentReviewKind, ContentReviewResult } from './content-governance';
3
3
  import { ContentReview } from './content-review';
4
4
  export declare class ContentReviewCollection extends SmrtCollection<ContentReview> {
5
5
  static readonly _itemClass: typeof ContentReview;
@@ -1,4 +1,10 @@
1
- import { Content, ContentOptions } from './content';
1
+ /**
2
+ * Content subclasses for STI (Single Table Inheritance)
3
+ *
4
+ * These classes inherit from Content and automatically use the shared
5
+ * contents table with _meta_type discriminator.
6
+ */
7
+ import { Content, type ContentOptions } from './content';
2
8
  /**
3
9
  * Article content type
4
10
  *
@@ -1,5 +1,6 @@
1
- import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
- import { ContentVersionKind } from './content-governance';
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtObject } from '@happyvertical/smrt-core';
3
+ import type { ContentVersionKind } from './content-governance';
3
4
  /**
4
5
  * Shape of the loosely-structured `metadata` JSON bag stored on a content
5
6
  * version. Known fields are typed; unrecognized keys remain accessible via the
@@ -45,7 +46,7 @@ export declare class ContentVersion extends SmrtObject {
45
46
  constructor(options?: ContentVersionOptions);
46
47
  getSnapshot(): Record<string, unknown>;
47
48
  getMetadata(): ContentVersionMetadata;
48
- getTransparency(): import('./content-transparency').ContentTransparencyData;
49
- getTransparencyAction(): Promise<import('./content-transparency').ContentTransparencyData>;
49
+ getTransparency(): import("./content-transparency").ContentTransparencyData;
50
+ getTransparencyAction(): Promise<import("./content-transparency").ContentTransparencyData>;
50
51
  }
51
52
  //# sourceMappingURL=content-version.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { SmrtCollection } from '@happyvertical/smrt-core';
2
- import { Content } from './content';
3
- import { CreateContentVersionOptions } from './content-governance';
2
+ import type { Content } from './content';
3
+ import type { CreateContentVersionOptions } from './content-governance';
4
4
  import { ContentVersion } from './content-version';
5
5
  export declare class ContentVersionCollection extends SmrtCollection<ContentVersion> {
6
6
  static readonly _itemClass: typeof ContentVersion;
package/dist/content.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { Asset } from '@happyvertical/smrt-assets';
2
- import { SmrtObjectOptions, SmrtSaveOptions, SmrtObject } from '@happyvertical/smrt-core';
3
- import { Fact, FactClaimSupportStatus, FactContent, FactContentRelationship, FactEvidenceStatus } from '@happyvertical/smrt-facts';
4
- import { Image } from '@happyvertical/smrt-images';
5
- import { AssetAssociable, MetadataAccessor } from './asset-associable';
6
- import { ContentBodyFormat } from './body-format';
7
- import { ContentGovernanceState, ContentReviewProfileEvaluation, CreateContentVersionOptions, IssueContentCorrectionOptions, ResolvedContentGovernance, RunContentReviewOptions } from './content-governance';
8
- import { ContentReview } from './content-review';
9
- import { ThumbnailOptions } from './thumbnail-generator';
1
+ import { type Asset } from '@happyvertical/smrt-assets';
2
+ import type { SmrtObjectOptions, SmrtSaveOptions } from '@happyvertical/smrt-core';
3
+ import { SmrtObject } from '@happyvertical/smrt-core';
4
+ import type { Fact, FactClaimSupportStatus, FactContent, FactContentRelationship, FactEvidenceStatus } from '@happyvertical/smrt-facts';
5
+ import type { Image } from '@happyvertical/smrt-images';
6
+ import type { AssetAssociable, MetadataAccessor } from './asset-associable';
7
+ import type { ContentBodyFormat } from './body-format';
8
+ import { type ContentGovernanceState, type ContentReviewProfileEvaluation, type CreateContentVersionOptions, type IssueContentCorrectionOptions, type ResolvedContentGovernance, type RunContentReviewOptions } from './content-governance';
9
+ import type { ContentReview } from './content-review';
10
+ import type { ThumbnailOptions } from './thumbnail-generator';
10
11
  type FactAuditSourceSelector = {
11
12
  sourceKind: string;
12
13
  sourceId: string;
@@ -583,8 +584,8 @@ export declare class Content extends SmrtObject implements AssetAssociable, Meta
583
584
  metadata: unknown;
584
585
  }[];
585
586
  }>;
586
- createVersion(options?: CreateContentVersionOptions): Promise<import('./content-version').ContentVersion>;
587
- getVersions(): Promise<import('./content-version').ContentVersion[]>;
587
+ createVersion(options?: CreateContentVersionOptions): Promise<import("./content-version").ContentVersion>;
588
+ getVersions(): Promise<import("./content-version").ContentVersion[]>;
588
589
  restoreFromVersion(versionNumber: number): Promise<Content>;
589
590
  getReviews(kind?: RunContentReviewOptions['kind']): Promise<ContentReview[]>;
590
591
  listReviews(options?: {
@@ -593,7 +594,7 @@ export declare class Content extends SmrtObject implements AssetAssociable, Meta
593
594
  findings: unknown;
594
595
  metadata: unknown;
595
596
  }[]>;
596
- getReviewRequirements(profileKey: string, governance?: ResolvedContentGovernance): Promise<import('./content-governance').ContentReviewRequirement[]>;
597
+ getReviewRequirements(profileKey: string, governance?: ResolvedContentGovernance): Promise<import("./content-governance").ContentReviewRequirement[]>;
597
598
  getGovernanceState(): Promise<ContentGovernanceState>;
598
599
  getGovernanceStateAction(): Promise<ContentGovernanceState>;
599
600
  listReviewProfilesAction(): Promise<ContentReviewProfileEvaluation[]>;
@@ -602,10 +603,10 @@ export declare class Content extends SmrtObject implements AssetAssociable, Meta
602
603
  profileKey?: string;
603
604
  }): Promise<ContentReviewProfileEvaluation>;
604
605
  isReadyForReviewProfile(profileKey: string): Promise<boolean>;
605
- getPublishedTransparency(): Promise<import('./content-transparency').ContentTransparencyData | null>;
606
- getPublishedTransparencyAction(): Promise<import('./content-transparency').ContentTransparencyData | null>;
607
- previewTransparency(): Promise<import('./content-transparency').ContentTransparencyData | null>;
608
- previewTransparencyAction(): Promise<import('./content-transparency').ContentTransparencyData | null>;
606
+ getPublishedTransparency(): Promise<import("./content-transparency").ContentTransparencyData | null>;
607
+ getPublishedTransparencyAction(): Promise<import("./content-transparency").ContentTransparencyData | null>;
608
+ previewTransparency(): Promise<import("./content-transparency").ContentTransparencyData | null>;
609
+ previewTransparencyAction(): Promise<import("./content-transparency").ContentTransparencyData | null>;
609
610
  runReview(options?: RunContentReviewOptions): Promise<ContentReview>;
610
611
  runReviewAction(options?: RunContentReviewOptions): Promise<{
611
612
  findings: unknown;
@@ -613,11 +614,11 @@ export declare class Content extends SmrtObject implements AssetAssociable, Meta
613
614
  }>;
614
615
  reviewFacts(options?: Omit<RunContentReviewOptions, 'kind'>): Promise<ContentReview>;
615
616
  reviewSafety(options?: Omit<RunContentReviewOptions, 'kind'>): Promise<ContentReview>;
616
- getCorrections(): Promise<import('./content-correction').ContentCorrection[]>;
617
+ getCorrections(): Promise<import("./content-correction").ContentCorrection[]>;
617
618
  listCorrections(): Promise<{
618
619
  metadata: unknown;
619
620
  }[]>;
620
- issueCorrection(options: IssueContentCorrectionOptions): Promise<import('./content-correction').ContentCorrection>;
621
+ issueCorrection(options: IssueContentCorrectionOptions): Promise<import("./content-correction").ContentCorrection>;
621
622
  issueCorrectionAction(options: IssueContentCorrectionOptions): Promise<{
622
623
  metadata: unknown;
623
624
  }>;
@@ -1,9 +1,10 @@
1
- import { SmrtCollectionOptions, SmrtCollection } from '@happyvertical/smrt-core';
2
- import { Image } from '@happyvertical/smrt-images';
3
- import { DataQueryResult } from '@happyvertical/smrt-types';
1
+ import type { SmrtCollectionOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtCollection } from '@happyvertical/smrt-core';
3
+ import type { Image } from '@happyvertical/smrt-images';
4
+ import type { DataQueryResult } from '@happyvertical/smrt-types';
4
5
  import { Content } from './content';
5
- import { ResolveHostname } from './safe-remote-url';
6
- import { ThumbnailStrategy } from './thumbnail-generator';
6
+ import { type ResolveHostname } from './safe-remote-url';
7
+ import type { ThumbnailStrategy } from './thumbnail-generator';
7
8
  /**
8
9
  * Options accepted by {@link Contents.generateMissingThumbnails}. Also reused
9
10
  * (as a `Partial`) for the `thumbnail` config block passed through the
@@ -83,7 +84,7 @@ export declare class Contents extends SmrtCollection<Content> {
83
84
  *
84
85
  * @returns Database interface
85
86
  */
86
- getDb(): import('@happyvertical/sql').DatabaseInterface;
87
+ getDb(): import("@happyvertical/sql").DatabaseInterface;
87
88
  /**
88
89
  * Initializes the collection
89
90
  *
@@ -150,7 +151,7 @@ export declare class Contents extends SmrtCollection<Content> {
150
151
  updatedAt?: string | null;
151
152
  key: string;
152
153
  label: string;
153
- kind: import('./content-governance').ContentReviewKind;
154
+ kind: import("./content-governance").ContentReviewKind;
154
155
  instructions: string;
155
156
  enabled?: boolean;
156
157
  metadata?: Record<string, unknown>;
@@ -164,7 +165,7 @@ export declare class Contents extends SmrtCollection<Content> {
164
165
  label: string;
165
166
  description?: string;
166
167
  enabled?: boolean;
167
- requirements: import('./content-governance').ContentReviewRequirement[];
168
+ requirements: import("./content-governance").ContentReviewRequirement[];
168
169
  metadata?: Record<string, unknown>;
169
170
  }[];
170
171
  assignments: {
@@ -182,21 +183,21 @@ export declare class Contents extends SmrtCollection<Content> {
182
183
  publicationProfileKey?: string | null;
183
184
  correctionProfileKey?: string | null;
184
185
  enforcePublishReadiness?: boolean;
185
- defaultFactRelationship?: import('@happyvertical/smrt-facts').FactContentRelationship;
186
+ defaultFactRelationship?: import("@happyvertical/smrt-facts").FactContentRelationship;
186
187
  metadata?: Record<string, unknown>;
187
188
  }[];
188
189
  };
189
190
  persisted: {
190
- policies: import('./content-governance').PersistedContentGovernancePolicyRecord[];
191
- profiles: import('./content-governance').PersistedContentGovernanceProfileRecord[];
192
- assignments: import('./content-governance').PersistedContentGovernanceAssignmentRecord[];
191
+ policies: import("./content-governance").PersistedContentGovernancePolicyRecord[];
192
+ profiles: import("./content-governance").PersistedContentGovernanceProfileRecord[];
193
+ assignments: import("./content-governance").PersistedContentGovernanceAssignmentRecord[];
193
194
  };
194
195
  }>;
195
196
  resolveGovernanceAction(options?: {
196
197
  type?: string;
197
198
  variant?: string | null;
198
199
  tenantId?: string | null;
199
- }): Promise<import('./content-governance').ResolvedContentGovernance>;
200
+ }): Promise<import("./content-governance").ResolvedContentGovernance>;
200
201
  /**
201
202
  * Mirrors content from a remote URL
202
203
  *
package/dist/index.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * STI content types (Article, ContentDocument, Mirror) with thumbnail generation
4
+ * strategies, content-owned asset relationships, and markdown serialization
5
+ * utilities.
6
+ */
7
+ import './__smrt-register__.js';
1
8
  export type { AssetAssociable, MetadataAccessor, } from './asset-associable';
2
9
  export { isAssetAssociable, isMetadataAccessor } from './asset-associable';
3
10
  export type { ContentBodyFormat, ContentBodyImage } from './body-format';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./chunks/rolldown-runtime-D7D4PA-g.js";
2
- import { $ as parseContentReviewResponse, A as normalizeContentTransparency, B as getAcceptedContentReviewStatuses, C as resolveContentTenantReadScope, F as smrtContentReviewPrompt, G as getContentReviewProfile, H as getContentReviewKind, I as smrtContentThumbnailAIGeneratePrompt, J as getEffectiveContentGovernanceConfig, K as getContentReviewProfileKeys, L as buildContentGovernanceAssignmentKey, M as ContentReference, N as promptMessageOptions, O as getQueryRows, P as smrtContentApplyCorrectionPrompt, R as buildContentReviewPrompt, S as mergeContentQueryScope, T as ThumbnailGenerator, U as getContentReviewPolicies, V as getContentGovernanceConfig, W as getContentReviewPolicy, X as hasStaticContentGovernancePolicy, Y as getFallbackPolicyKind, Z as hasStaticContentGovernanceProfile, _ as assertContentQuerySchema, a as CONTENT_QUERY_IDENTITY_FIELD, at as isAssetAssociable, b as clearContentQuerySchemaCache, c as CONTENT_QUERY_MIN_RESULT_BYTES, d as DATA_QUERY_MAX_JSON_DEPTH, et as resetContentGovernanceConfig, f as DATA_QUERY_MAX_JSON_STRING_LENGTH, g as MAX_CONTENT_QUERY_OR_BRANCHES, h as DATA_QUERY_MAX_WARNING_LENGTH, i as CONTENT_QUERY_EXCLUDED_FIELD_IDS, it as ContentAsset, j as ContentReferences, k as isMissingTableError, l as DATA_QUERY_FORBIDDEN_JSON_KEYS, m as DATA_QUERY_MAX_WARNINGS, n as CONTENT_QUERY_DEFAULT_PAGE_LIMIT, nt as resolveEffectiveContentGovernance, o as CONTENT_QUERY_MAX_PAGE_LIMIT, ot as isMetadataAccessor, p as DATA_QUERY_MAX_STRING_LENGTH, q as getContentReviewRequirements, r as CONTENT_QUERY_DEFAULT_SORT, rt as ContentAssetCollection, s as CONTENT_QUERY_MAX_RESULT_BYTES, t as CONTENT_QUERY_CLASS_NAME, tt as resolveConfiguredContentGovernance, u as DATA_QUERY_MAX_JSON_CONTAINER_ITEMS, v as buildContentQuerySchema, w as Content, x as executeContentQuery, y as buildDataQuerySchemaForClass, z as configureContentGovernance } from "./chunks/content-query-RUQgufnT.js";
2
+ import { $ as parseContentReviewResponse, A as normalizeContentTransparency, B as getAcceptedContentReviewStatuses, C as resolveContentTenantReadScope, F as smrtContentReviewPrompt, G as getContentReviewProfile, H as getContentReviewKind, I as smrtContentThumbnailAIGeneratePrompt, J as getEffectiveContentGovernanceConfig, K as getContentReviewProfileKeys, L as buildContentGovernanceAssignmentKey, M as ContentReference, N as promptMessageOptions, O as getQueryRows, P as smrtContentApplyCorrectionPrompt, R as buildContentReviewPrompt, S as mergeContentQueryScope, T as ThumbnailGenerator, U as getContentReviewPolicies, V as getContentGovernanceConfig, W as getContentReviewPolicy, X as hasStaticContentGovernancePolicy, Y as getFallbackPolicyKind, Z as hasStaticContentGovernanceProfile, _ as assertContentQuerySchema, a as CONTENT_QUERY_IDENTITY_FIELD, at as isAssetAssociable, b as clearContentQuerySchemaCache, c as CONTENT_QUERY_MIN_RESULT_BYTES, d as DATA_QUERY_MAX_JSON_DEPTH, et as resetContentGovernanceConfig, f as DATA_QUERY_MAX_JSON_STRING_LENGTH, g as MAX_CONTENT_QUERY_OR_BRANCHES, h as DATA_QUERY_MAX_WARNING_LENGTH, i as CONTENT_QUERY_EXCLUDED_FIELD_IDS, it as ContentAsset, j as ContentReferences, k as isMissingTableError, l as DATA_QUERY_FORBIDDEN_JSON_KEYS, m as DATA_QUERY_MAX_WARNINGS, n as CONTENT_QUERY_DEFAULT_PAGE_LIMIT, nt as resolveEffectiveContentGovernance, o as CONTENT_QUERY_MAX_PAGE_LIMIT, ot as isMetadataAccessor, p as DATA_QUERY_MAX_STRING_LENGTH, q as getContentReviewRequirements, r as CONTENT_QUERY_DEFAULT_SORT, rt as ContentAssetCollection, s as CONTENT_QUERY_MAX_RESULT_BYTES, t as CONTENT_QUERY_CLASS_NAME, tt as resolveConfiguredContentGovernance, u as DATA_QUERY_MAX_JSON_CONTAINER_ITEMS, v as buildContentQuerySchema, w as Content, x as executeContentQuery, y as buildDataQuerySchemaForClass, z as configureContentGovernance } from "./chunks/content-query-CwPuga5L.js";
3
3
  import { DEFAULT_CONTENT_BODY_FORMAT, bodyToEditorHtml, editorHtmlToBody, extractBodyImages, htmlToMarkdown, renderMarkdownToHtml, resolveBodyFormat, sanitizeHtml, stripHtml } from "./body-format.js";
4
4
  import { r as ContentCorrection, t as ContentCorrectionCollection } from "./chunks/content-corrections-CKuY-MSv.js";
5
5
  import { contentEditorAssistantContextToChatProps, createContentEditorAssistantContext, sanitizeContentEditorAssistantFieldUpdates } from "./content-editor-assistant.js";
6
- import { r as assertSafeRemoteUrl, t as Contents } from "./chunks/contents-BjYewZHy.js";
6
+ import { r as assertSafeRemoteUrl, t as Contents } from "./chunks/contents-DVD3XsjE.js";
7
7
  import { r as ContentReview, t as ContentReviewCollection } from "./chunks/content-reviews-D6o0zK8s.js";
8
- import { r as ContentVersion, t as ContentVersionCollection } from "./chunks/content-versions-Bxfqtkj9.js";
8
+ import { r as ContentVersion, t as ContentVersionCollection } from "./chunks/content-versions-0XKugPNA.js";
9
9
  import { evaluateContentPublishReadiness } from "./publish-readiness.js";
10
10
  import { ObjectRegistry, SmrtCollection, SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
11
11
  import { AssetCollection, AssetStatusCollection, AssetTypeCollection } from "@happyvertical/smrt-assets";
@@ -888,7 +888,7 @@ var ContentContribution = class extends SmrtObject {
888
888
  return ContentContributorCollection.create(this.options);
889
889
  }
890
890
  async getContentsCollection() {
891
- const { Contents } = await import("./chunks/contents-BjYewZHy.js").then((n) => n.n);
891
+ const { Contents } = await import("./chunks/contents-DVD3XsjE.js").then((n) => n.n);
892
892
  return Contents.create({ db: this.db });
893
893
  }
894
894
  async getAssetCollection() {
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-content",
5
- "packageVersion": "0.51.32",
5
+ "packageVersion": "0.51.34",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-content:ContentAsset": {
8
8
  "name": "contentasset",
@@ -1,4 +1,10 @@
1
- import { ContentTransparencyData as ContentTransparencyShape } from './content-transparency';
1
+ /**
2
+ * Mock SMRT Client for Content Service - Temporary implementation for demo purposes
3
+ *
4
+ * This replaces the missing @smrt/client virtual module with a working implementation
5
+ * that demonstrates the intended functionality.
6
+ */
7
+ import type { ContentTransparencyData as ContentTransparencyShape } from './content-transparency';
2
8
  export type ContentTransparencyData = ContentTransparencyShape;
3
9
  export interface ContentData {
4
10
  id?: string;
@@ -1,4 +1,4 @@
1
- import { LoadPublishedArticleRouteInput, PublishedContentArticleRouteData } from './svelte/routes/shared.js';
1
+ import type { LoadPublishedArticleRouteInput, PublishedContentArticleRouteData } from './svelte/routes/shared.js';
2
2
  export type ContentRouteLoadError = Error & {
3
3
  name: 'ContentRouteLoadError';
4
4
  status: number;
@@ -1,7 +1,35 @@
1
- import { SmrtRouteDefinition, SmrtRouteModule } from '@happyvertical/smrt-types';
2
- import { ContentRouteLoadError, isContentRouteLoadError, loadPublishedArticleRouteData } from './route-loaders.js';
1
+ /**
2
+ * Internal content route module
3
+ *
4
+ * Keeps the package's own page shells and loader helpers aligned without
5
+ * publishing a public `./routes` package contract.
6
+ *
7
+ * @example Package-local SvelteKit wrapper
8
+ * ```ts
9
+ * // src/routes/articles/[slug]/+page.ts
10
+ * import { error } from '@sveltejs/kit';
11
+ * import { CONTENT_ROUTE_MODULE, isContentRouteLoadError } from '../route-module.js';
12
+ *
13
+ * export async function load(event) {
14
+ * try {
15
+ * return await CONTENT_ROUTE_MODULE.routes.article.load?.({
16
+ * fetch: event.fetch,
17
+ * slug: event.params.slug,
18
+ * apiBasePath: '/api/v1',
19
+ * });
20
+ * } catch (cause) {
21
+ * if (isContentRouteLoadError(cause)) {
22
+ * throw error(cause.status, cause.message);
23
+ * }
24
+ * throw cause;
25
+ * }
26
+ * }
27
+ * ```
28
+ */
29
+ import type { SmrtRouteDefinition, SmrtRouteModule } from '@happyvertical/smrt-types';
30
+ import { type ContentRouteLoadError, isContentRouteLoadError, loadPublishedArticleRouteData } from './route-loaders.js';
3
31
  import { ContentContributionsRoute, ContentFactsRoute, ContentGovernanceRoute, ContentWorkspaceRoute, PublishedArticleRoute } from './svelte/routes/index.js';
4
- import { CONTENT_DEFAULT_ROUTE_NAVIGATION, CONTENT_ROUTE_IDS, CONTENT_ROUTE_META, ContentRouteId, ContentRouteNavigationItem, createContentRouteNavigation, LoadPublishedArticleRouteInput, PublishedContentArticleRouteData } from './svelte/routes/shared.js';
32
+ import { CONTENT_DEFAULT_ROUTE_NAVIGATION, CONTENT_ROUTE_IDS, CONTENT_ROUTE_META, type ContentRouteId, type ContentRouteNavigationItem, createContentRouteNavigation, type LoadPublishedArticleRouteInput, type PublishedContentArticleRouteData } from './svelte/routes/shared.js';
5
33
  export type { ContentRouteId, ContentRouteLoadError, ContentRouteNavigationItem, LoadPublishedArticleRouteInput, PublishedContentArticleRouteData, };
6
34
  export { CONTENT_DEFAULT_ROUTE_NAVIGATION, CONTENT_ROUTE_IDS, CONTENT_ROUTE_META, ContentContributionsRoute, ContentFactsRoute, ContentGovernanceRoute, ContentWorkspaceRoute, createContentRouteNavigation, isContentRouteLoadError, loadPublishedArticleRouteData, PublishedArticleRoute, };
7
35
  export interface ContentRouteDefinitions {
@@ -1,9 +1,19 @@
1
- import { PrincipalRun } from '@happyvertical/smrt-agents';
2
- import { createDataSurfaceActionAdapter, DataSurfaceActionAdapter, DataSurfaceActionStateStore, DataSurfaceBackgroundQueue, DataSurfaceServerActionContext, DataSurfaceServerActionRequest } from '@happyvertical/smrt-agents/server';
3
- import { DataQueryRequest, DataSurfaceActionResult, DataSurfaceDescriptor, DataSurfaceIdentity, DataSurfaceJsonObject, DataSurfaceJsonValue } from '@happyvertical/smrt-types';
4
- import { ContentBodyFormat } from '../body-format.js';
5
- import { Content } from '../content.js';
6
- import { ContentQueryCollection, ContentQueryScope } from '../content-query.js';
1
+ /**
2
+ * Principal-bound ContentList bulk workflows (#2453).
3
+ *
4
+ * The generic action adapter owns confirmation tokens, idempotency, principal
5
+ * execution, permission checks, per-row outcomes, and background acceptance.
6
+ * This module supplies the content-specific half: declarative workflows,
7
+ * canonical query resolution, row-revision binding, governance eligibility,
8
+ * and domain mutations.
9
+ */
10
+ import '@happyvertical/smrt-facts';
11
+ import { type PrincipalRun } from '@happyvertical/smrt-agents';
12
+ import { createDataSurfaceActionAdapter, type DataSurfaceActionAdapter, type DataSurfaceActionStateStore, type DataSurfaceBackgroundQueue, type DataSurfaceServerActionContext, type DataSurfaceServerActionRequest } from '@happyvertical/smrt-agents/server';
13
+ import type { DataQueryRequest, DataSurfaceActionResult, DataSurfaceDescriptor, DataSurfaceIdentity, DataSurfaceJsonObject, DataSurfaceJsonValue } from '@happyvertical/smrt-types';
14
+ import type { ContentBodyFormat } from '../body-format.js';
15
+ import type { Content } from '../content.js';
16
+ import { type ContentQueryCollection, type ContentQueryScope } from '../content-query.js';
7
17
  export declare const CONTENT_LIST_WORKFLOW_IDS: readonly ["move-to-trash", "mark-draft", "submit-review", "publish", "archive", "restore", "automated-review", "format-body", "categorize", "optimize"];
8
18
  export type ContentListWorkflowId = (typeof CONTENT_LIST_WORKFLOW_IDS)[number];
9
19
  export declare const CONTENT_LIST_LIFECYCLE_ACTION_IDS: readonly ["move-to-trash", "restore", "permanent-delete"];
@@ -1,5 +1,6 @@
1
- import { DataSurfaceDefinition, DataSurfaceExecutionContext, DataSurfaceSchema } from '@happyvertical/smrt-agents';
2
- import { ContentQueryCollection, ContentQueryScope } from '../content-query.js';
1
+ /** Principal-bound, silent ContentList query discovery and execution (#2456). */
2
+ import type { DataSurfaceDefinition, DataSurfaceExecutionContext, DataSurfaceSchema } from '@happyvertical/smrt-agents';
3
+ import { type ContentQueryCollection, type ContentQueryScope } from '../content-query.js';
3
4
  export declare const CONTENT_LIST_DATA_SURFACE_ID = "content-list";
4
5
  export declare const CONTENT_LIST_DATA_SURFACE_COLLECTION = "contents";
5
6
  export interface ContentListDataSurfaceOptions {
@@ -1,6 +1,15 @@
1
- import { DataSurfaceServerActionContext } from '@happyvertical/smrt-agents/server';
2
- import { DataSurfaceActionResult } from '@happyvertical/smrt-types';
3
- import { ContentListActionAdapter } from './content-list-actions.js';
1
+ /**
2
+ * Principal-bound HTTP boundary for ContentList lifecycle actions (#2454).
3
+ *
4
+ * Hosts supply authentication by resolving a DataSurface server context from
5
+ * the incoming Request. The service gates this dedicated endpoint to lifecycle
6
+ * actions, then delegates to the same content action adapter used by agents and
7
+ * bulk workflows so authorization, selection resolution, confirmation,
8
+ * idempotency, and audit metadata cannot diverge by caller.
9
+ */
10
+ import type { DataSurfaceServerActionContext } from '@happyvertical/smrt-agents/server';
11
+ import type { DataSurfaceActionResult } from '@happyvertical/smrt-types';
12
+ import { type ContentListActionAdapter } from './content-list-actions.js';
4
13
  export interface ContentListLifecycleService {
5
14
  invoke(request: unknown, context: DataSurfaceServerActionContext): Promise<DataSurfaceActionResult>;
6
15
  }
package/dist/server.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ /**
2
+ * SMRT Content Service Server
3
+ *
4
+ * Demonstrates auto-generated REST API from SMRT Content objects.
5
+ * No manual route definitions needed - everything is generated from @smrt() decorated classes.
6
+ */
7
+ import './__smrt-register__.js';
1
8
  declare function startServer(): Promise<{
2
9
  shutdown: () => Promise<void>;
3
10
  }>;
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as assertContentQuerySchema, t as CONTENT_QUERY_CLASS_NAME, v as buildContentQuerySchema, w as Content, x as executeContentQuery } from "./chunks/content-query-RUQgufnT.js";
1
+ import { _ as assertContentQuerySchema, t as CONTENT_QUERY_CLASS_NAME, v as buildContentQuerySchema, w as Content, x as executeContentQuery } from "./chunks/content-query-CwPuga5L.js";
2
2
  import { MAX_DATA_QUERY_PAGE_LIMIT, createDataQueryFingerprint, normalizeDataQueryRequest, startRestServer } from "@happyvertical/smrt-core";
3
3
  import { createHash } from "node:crypto";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-content",
6
- "packageVersion": "0.51.32",
6
+ "packageVersion": "0.51.34",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "a5a0a6349c25a0407c4cc9791748c2c7510c5049831e4ce9906dfbb25a1377ca",
11
- "packageJson": "d117b45b5d9417ece0007dc4e987140bd6d3790f9b7cf57b7afd060069b83b3c",
10
+ "manifest": "6cc4471e9e929c5ed86b336bcd11c989e4f7899ceae0848bc7aecb1d69266ad7",
11
+ "packageJson": "ef6b0a5292ac0921dcf0efb6f9a674ceb8b5af7ddb518bd71f917dc588f4fa0c",
12
12
  "agents": "f1162b24cd46ce87bae102e2a20de9bc15fdd8a0abb951f05bbf846bd61af3a3",
13
13
  "moduleDoc:agents/content-list.md": "e5e990d6688f2a89fe521741e9af6e202dad5fa827307c727cfb5db92a83145a"
14
14
  },
@@ -59,7 +59,7 @@
59
59
  "@types/node": "24.13.6",
60
60
  "svelte": "^5.57.1",
61
61
  "svelte-check": "^4.7.6",
62
- "typescript": "5.9.3",
62
+ "typescript": "6.0.3",
63
63
  "vite": "8.1.4",
64
64
  "vitest": "4.1.10"
65
65
  },
@@ -1,9 +1,17 @@
1
- import { AIClient, AIClientOptions } from '@happyvertical/ai';
2
- import { StaticMapProvider } from '@happyvertical/geo';
3
- import { HeadlineCardTemplate } from '@happyvertical/images';
4
- import { DatabaseConfig } from '@happyvertical/smrt-core';
5
- import { Image } from '@happyvertical/smrt-images';
6
- import { Content } from './content';
1
+ /**
2
+ * Thumbnail Generator for Content
3
+ *
4
+ * Generates thumbnail images for content using various strategies:
5
+ * - headline-card: Draws article title on branded background
6
+ * - static-map: Uses static maps API for location-based content
7
+ * - ai-generate: Uses AI image generation for creative thumbnails
8
+ */
9
+ import type { AIClient, AIClientOptions } from '@happyvertical/ai';
10
+ import { type StaticMapProvider } from '@happyvertical/geo';
11
+ import { type HeadlineCardTemplate } from '@happyvertical/images';
12
+ import type { DatabaseConfig } from '@happyvertical/smrt-core';
13
+ import type { Image } from '@happyvertical/smrt-images';
14
+ import type { Content } from './content';
7
15
  /**
8
16
  * Available thumbnail generation strategies
9
17
  */
package/dist/ui.d.ts CHANGED
@@ -1,4 +1,10 @@
1
- import { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';
1
+ /**
2
+ * Content Module UI Slot Declarations
3
+ *
4
+ * This file defines the UI extension points for the content module.
5
+ * UI components are implemented in the ./svelte subpath.
6
+ */
7
+ import type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';
2
8
  /**
3
9
  * Content module UI slots
4
10
  */
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Content } from './content';
1
+ import type { Content } from './content';
2
2
  /**
3
3
  * Converts a Content object to a string with YAML frontmatter
4
4
  *