@uibot/application 0.18.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,74 @@
1
+ import type { CreationContent, CreationRenderResult } from "@uibot/contracts";
2
+ import { type CreationRepository } from "./creation-store.js";
3
+ export interface CreationRenderReviewInput {
4
+ projectId: string;
5
+ runId: string;
6
+ artifactId: string;
7
+ revisionId: string;
8
+ requestId: string;
9
+ source: CreationContent;
10
+ signal: AbortSignal;
11
+ }
12
+ /** Trusted read-only renderer. It must not call models or business/data write ports. */
13
+ export interface CreationRenderReviewer {
14
+ review(input: CreationRenderReviewInput): Promise<CreationRenderResult>;
15
+ readCapture?(input: {
16
+ projectId: string;
17
+ runId: string;
18
+ requestId: string;
19
+ file: string;
20
+ }): Promise<Uint8Array>;
21
+ }
22
+ export declare function createCreationRenderReviewService(options: {
23
+ repository: CreationRepository;
24
+ reviewer?: CreationRenderReviewer;
25
+ }): {
26
+ review: (request: Request, projectId: string, runId: string) => Promise<Response>;
27
+ capture: (request: Request, projectId: string, runId: string) => Promise<Response>;
28
+ };
29
+ /** Copy only the shared bounded report fields from a trusted host renderer. */
30
+ export declare function creationRenderReport(identity: {
31
+ requestId: string;
32
+ revisionId: string;
33
+ sourceSha256: string;
34
+ }, result: CreationRenderResult): {
35
+ requestId: string;
36
+ revisionId: string;
37
+ sourceSha256: string;
38
+ recordedAt: string;
39
+ checksVersion: string;
40
+ status: "captured" | "failed" | "unavailable";
41
+ mode: "live-spec" | "sandboxed-html" | "static-spec-export" | "unsupported";
42
+ reason?: string;
43
+ stylesheetSha256?: string;
44
+ captures: {
45
+ path: string;
46
+ width: number;
47
+ height: number;
48
+ screenshotFile: string;
49
+ screenshotSha256: string;
50
+ htmlFile: string;
51
+ htmlSha256: string;
52
+ blockedRequests: number;
53
+ status: "captured" | "failed" | "unavailable";
54
+ findings: string[];
55
+ images?: {
56
+ sourceKind: "blob" | "inline" | "missing" | "remote";
57
+ referenceSha256: string;
58
+ alt?: string;
59
+ width: number;
60
+ height: number;
61
+ naturalWidth: number;
62
+ naturalHeight: number;
63
+ loaded: boolean;
64
+ }[];
65
+ omittedImages?: number;
66
+ scenario?: {
67
+ id: string;
68
+ label: string;
69
+ stepsSha256: string;
70
+ completedSteps: number;
71
+ totalSteps: number;
72
+ };
73
+ }[];
74
+ };
@@ -1,4 +1,11 @@
1
- import type { CreationRequirementFinding } from "@uibot/contracts";
1
+ import type { CreationProject, CreationRun, CreationRequirementFinding } from "@uibot/contracts";
2
+ /** Only the accepted edit base supplies history; unrelated references/runs never do. */
3
+ export declare function creationEditOrigin(project: CreationProject, run: CreationRun): {
4
+ run: CreationRun;
5
+ revision: import("@uibot/contracts").CreationRevision;
6
+ baseRevision: import("@uibot/contracts").CreationRevision;
7
+ } | undefined;
8
+ export declare function creationPriorFindings(project: CreationProject, run: CreationRun): CreationRequirementFinding[];
2
9
  export declare function readRequirementReport(content: string): {
3
10
  findings: CreationRequirementFinding[];
4
11
  state: "needs-repair" | "pending-confirmation";
@@ -1,5 +1,7 @@
1
1
  import type { createCreationBrandHandler } from "./creation-brand-http.js";
2
2
  import type { createCreationThemeHandler } from "./creation-theme-http.js";
3
+ import type { createCreationRenderReviewService } from "./creation-render-review.js";
4
+ import type { createCreationAestheticReviewService } from "./creation-aesthetic-review.js";
3
5
  import type { CreationContent, CreationProject, CreationRun, CreationRunInput } from "@uibot/contracts";
4
6
  import type { CreationDomainDefinition } from "./creation-domains.js";
5
7
  import { type CreationRepository } from "./creation-store.js";
@@ -8,11 +10,13 @@ import type { CreateCreationHandlerOptions, CreationModelBinding } from "./creat
8
10
  export interface CreationRouteContext {
9
11
  base: string;
10
12
  store: CreationRepository;
11
- options: Pick<CreateCreationHandlerOptions, "authorizeReconciliation" | "authorizeSnapshotImport" | "brandAssets" | "catalog" | "designGuides" | "domains">;
13
+ options: Pick<CreateCreationHandlerOptions, "authorizeReconciliation" | "authorizeSnapshotImport" | "brandAssets" | "catalog" | "designGuides" | "domains" | "renderReviewer" | "aestheticReview">;
12
14
  active: Map<string, AbortController>;
13
15
  runModels: Map<string, CreationModelBinding>;
14
16
  brandHandler: ReturnType<typeof createCreationBrandHandler>;
15
17
  themeHandler: ReturnType<typeof createCreationThemeHandler>;
18
+ renderReviewService: ReturnType<typeof createCreationRenderReviewService>;
19
+ aestheticReviewService: ReturnType<typeof createCreationAestheticReviewService>;
16
20
  currentModel: () => Promise<CreationModelBinding>;
17
21
  modelFor: (run: CreationRun) => Promise<CreationModelBinding>;
18
22
  domainFor: (kind: string, enabled?: boolean) => CreationDomainDefinition;
@@ -1,3 +1,9 @@
1
1
  import { type Catalog } from "@uibot/contracts";
2
2
  /** Shared Spec grammar and installed component catalog, independent of artifact kind. */
3
- export declare function creationSpecPrompt(catalog: Catalog): string;
3
+ export declare function creationSpecPrompt(catalog: Catalog, options?: {
4
+ compactDocumentation?: boolean;
5
+ localCollections?: boolean;
6
+ website?: boolean;
7
+ purpose?: "review";
8
+ }): string;
9
+ export declare const CREATION_SPEC_LOCAL_COLLECTIONS_PROMPT = "Studio preview supports explicit local-demo collections only: root connections:[{id:\"favorites\",type:\"Mock.Collection\",options:{seed:[]}}]. Seeds are inline JSON rows with unique string ids; no seedFile, URLs, secrets, database or server persistence. Rows are shared across pages within this preview session and cleared on recompile/reopen. Page state remains separate. Use this for cross-page favorites/application records instead of duplicate booleans. Request params:{connectionId:\"favorites\",request:{id:\"read\",connectionId:\"favorites\",payload:{operation:\"Find\",filter:{}}},responsePath:\"rows\",errorPath:\"error\"}. Declare rows/error state on each consuming page; run Find in page.lifecycle.onMount so revisiting refreshes data. Operations: Find/FindOne with filter; InsertOne with data (id optional); UpdateOne with filter:{id} and data; DeleteOne with filter:{id}. Request results go directly to responsePath. Request clears errorPath to null; use truthy error checks, never compare it with an empty string. Event expressions may appear inside request.payload.data/filter. After a write, refresh relevant rows with Find. Label data and submissions as local demonstrations, never sent to a real organization. This host-installed driver grants no external access.";
@@ -111,7 +111,7 @@ export declare class FileCreationRepository implements CreationRepository {
111
111
  }
112
112
  export declare function findCreationArtifact(project: CreationProject, id: string): CreationArtifact;
113
113
  export declare function findCreationRevision(project: CreationProject, reference: CreationReference): CreationRevision;
114
- export declare function appendCreationRevision(project: CreationProject, artifact: CreationArtifact, source: CreationContent, expectedRevisionId: string | null, extra?: Partial<Pick<CreationRevision, "references" | "sourceIds" | "runId" | "restoredFrom" | "brandRevisionId" | "themeRevisionId" | "copySources" | "factSources">>): CreationRevision;
114
+ export declare function appendCreationRevision(project: CreationProject, artifact: CreationArtifact, source: CreationContent, expectedRevisionId: string | null, extra?: Partial<Pick<CreationRevision, "references" | "sourceIds" | "runId" | "restoredFrom" | "brandRevisionId" | "themeRevisionId" | "copySources" | "factSources" | "application" | "applicationOperation">>): CreationRevision;
115
115
  export declare function readCreationDesignPreferences(value: unknown): CreationDesignPreferences;
116
116
  export declare function appendCreationSource(project: CreationProject, input: {
117
117
  title: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./compose-system-prompt.js";
2
2
  export * from "./ui-craft-baseline.js";
3
+ export * from "./creation-design-context.js";
3
4
  export * from "./composition.js";
4
5
  export * from "./discovery-protocol.js";
5
6
  export * from "./grounded-brief.js";