@jay-framework/stack-server-runtime 0.13.0 → 0.14.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.
- package/dist/index.d.ts +164 -106
- package/dist/index.js +789 -357
- package/package.json +13 -12
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import { ViteDevServer } from 'vite';
|
|
|
4
4
|
import { JayRoute } from '@jay-framework/stack-route-scanner';
|
|
5
5
|
import { WithValidations, JsonSchemaProperty, PluginManifest } from '@jay-framework/compiler-shared';
|
|
6
6
|
export { JsonSchemaProperty } from '@jay-framework/compiler-shared';
|
|
7
|
-
import { Contract, HeadlessContractInfo,
|
|
7
|
+
import { Contract, HeadlessContractInfo, DiscoveredHeadlessInstance, ForEachHeadlessInstance } from '@jay-framework/compiler-jay-html';
|
|
8
8
|
export { ForEachHeadlessInstance } from '@jay-framework/compiler-jay-html';
|
|
9
9
|
import { JayRollupConfig } from '@jay-framework/rollup-plugin';
|
|
10
|
-
import { TrackByMap } from '@jay-framework/view-state-merge';
|
|
11
10
|
import { Coordinate } from '@jay-framework/runtime';
|
|
11
|
+
import { TrackByMap } from '@jay-framework/view-state-merge';
|
|
12
12
|
|
|
13
13
|
interface DevServerPagePart {
|
|
14
14
|
compDefinition: AnyJayStackComponentDefinition;
|
|
@@ -45,6 +45,10 @@ interface LoadedPageParts {
|
|
|
45
45
|
headlessContracts: HeadlessContractInfo[];
|
|
46
46
|
/** Instance-only headless components (no key) for server-side phase orchestration */
|
|
47
47
|
headlessInstanceComponents: HeadlessInstanceComponent[];
|
|
48
|
+
/** Discovered <jay:xxx> instances from the jay-html (DL#109) */
|
|
49
|
+
discoveredInstances: DiscoveredHeadlessInstance[];
|
|
50
|
+
/** Discovered forEach <jay:xxx> instances from the jay-html (DL#109) */
|
|
51
|
+
forEachInstances: ForEachHeadlessInstance[];
|
|
48
52
|
}
|
|
49
53
|
interface LoadPagePartsOptions {
|
|
50
54
|
/**
|
|
@@ -53,21 +57,88 @@ interface LoadPagePartsOptions {
|
|
|
53
57
|
* Import resolution still uses the original jay-html's directory.
|
|
54
58
|
*/
|
|
55
59
|
preRenderedPath?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Pre-loaded jay-html content to use instead of reading from disk.
|
|
62
|
+
* When provided (e.g., from SlowRenderCache with cache tag already stripped),
|
|
63
|
+
* this content is used directly, avoiding an extra file read.
|
|
64
|
+
*/
|
|
65
|
+
preRenderedContent?: string;
|
|
56
66
|
}
|
|
57
67
|
declare function loadPageParts(vite: ViteDevServer, route: JayRoute, pagesBase: string, projectBase: string, jayRollupConfig: JayRollupConfig, options?: LoadPagePartsOptions): Promise<WithValidations<LoadedPageParts>>;
|
|
58
68
|
|
|
59
69
|
interface SlowlyChangingPhase {
|
|
60
|
-
runSlowlyForPage(pageParams: object, pageProps: PageProps, parts: Array<DevServerPagePart
|
|
70
|
+
runSlowlyForPage(pageParams: object, pageProps: PageProps, parts: Array<DevServerPagePart>, discoveredInstances?: DiscoveredHeadlessInstance[], headlessInstanceComponents?: HeadlessInstanceComponent[], jayHtmlPath?: string): Promise<AnySlowlyRenderResult>;
|
|
61
71
|
}
|
|
62
72
|
declare class DevSlowlyChangingPhase implements SlowlyChangingPhase {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
runSlowlyForPage(pageParams: UrlParams, pageProps: PageProps, parts: Array<DevServerPagePart
|
|
73
|
+
/** Cached loadParams results per route (jayHtmlPath → array of UrlParams[] per part) */
|
|
74
|
+
private loadParamsCache;
|
|
75
|
+
runSlowlyForPage(pageParams: UrlParams, pageProps: PageProps, parts: Array<DevServerPagePart>, discoveredInstances?: DiscoveredHeadlessInstance[], headlessInstanceComponents?: HeadlessInstanceComponent[], jayHtmlPath?: string): Promise<AnySlowlyRenderResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Invalidate the cached loadParams result for a given route.
|
|
78
|
+
* Called when source files change (page.ts, .jay-contract, .jay-html).
|
|
79
|
+
*/
|
|
80
|
+
invalidateLoadParamsCache(jayHtmlPath: string): void;
|
|
66
81
|
}
|
|
67
82
|
declare function runLoadParams<Refs extends object, SlowVS extends object, FastVS extends object, InteractiveVS extends object, Services extends Array<any>, Contexts extends Array<any>, PropsT extends object, Params extends UrlParams, CompCore extends JayComponentCore<PropsT, InteractiveVS>>(compDefinition: JayStackComponentDefinition<Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>, services: Services): Promise<void>;
|
|
68
83
|
declare function runSlowlyChangingRender<Refs extends object, SlowVS extends object, FastVS extends object, InteractiveVS extends object, Services extends Array<any>, Contexts extends Array<any>, PropsT extends object, Params extends UrlParams, CompCore extends JayComponentCore<PropsT, InteractiveVS>>(compDefinition: JayStackComponentDefinition<Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>): void;
|
|
69
84
|
|
|
70
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Server-side slow render orchestration for headless component instances.
|
|
87
|
+
*
|
|
88
|
+
* Given discovered instances (from discoverHeadlessInstances) and their
|
|
89
|
+
* component definitions, runs slowlyRender for each instance and collects
|
|
90
|
+
* the results for downstream consumers (pre-render pipeline, direct mode, fast phase).
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Data needed by the fast phase to render headless instances.
|
|
95
|
+
* Stored in carryForward.__instances so the fast phase can access it
|
|
96
|
+
* (both in pre-render and cached flows).
|
|
97
|
+
*/
|
|
98
|
+
interface InstancePhaseData {
|
|
99
|
+
/** Discovered instances with their props and coordinates */
|
|
100
|
+
discovered: Array<{
|
|
101
|
+
contractName: string;
|
|
102
|
+
props: Record<string, string>;
|
|
103
|
+
coordinate: Coordinate;
|
|
104
|
+
}>;
|
|
105
|
+
/** CarryForward per instance (keyed by coordinate path, e.g. "p1/product-card:0") */
|
|
106
|
+
carryForwards: Record<string, object>;
|
|
107
|
+
/** ForEach instances that need fast-phase per-item rendering */
|
|
108
|
+
forEachInstances?: ForEachHeadlessInstance[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Result of running slowlyRender for all discovered headless instances.
|
|
112
|
+
*/
|
|
113
|
+
interface InstanceSlowRenderResult {
|
|
114
|
+
/** Resolved data for each instance (for resolveHeadlessInstances pass 2) */
|
|
115
|
+
resolvedData: Array<{
|
|
116
|
+
coordinate: Coordinate;
|
|
117
|
+
contract: Contract;
|
|
118
|
+
slowViewState: Record<string, unknown>;
|
|
119
|
+
}>;
|
|
120
|
+
/** Per-instance slow ViewState keyed by coordinate (for direct mode merge) */
|
|
121
|
+
slowViewStates: Record<string, object>;
|
|
122
|
+
/** Phase data for the fast render phase */
|
|
123
|
+
instancePhaseData: InstancePhaseData;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Run slowlyRender for each discovered headless instance.
|
|
127
|
+
*
|
|
128
|
+
* Shared between preRenderJayHtml (pre-render path) and handleDirectRequest (direct path).
|
|
129
|
+
*/
|
|
130
|
+
declare function slowRenderInstances(discovered: DiscoveredHeadlessInstance[], headlessInstanceComponents: HeadlessInstanceComponent[]): Promise<InstanceSlowRenderResult | undefined>;
|
|
131
|
+
/**
|
|
132
|
+
* Validate that forEach headless instances do not have a slow phase.
|
|
133
|
+
*
|
|
134
|
+
* Components with slowlyRender cannot be used inside forEach because
|
|
135
|
+
* forEach items are only known at request time, after slow rendering completes.
|
|
136
|
+
*
|
|
137
|
+
* @returns Array of validation error messages (empty if all valid)
|
|
138
|
+
*/
|
|
139
|
+
declare function validateForEachInstances(forEachInstances: ForEachHeadlessInstance[], headlessInstanceComponents: HeadlessInstanceComponent[]): string[];
|
|
140
|
+
|
|
141
|
+
declare function renderFastChangingData(pageParams: object, pageProps: PageProps, carryForward: object, parts: Array<DevServerPagePart>, instancePhaseData?: InstancePhaseData, forEachInstances?: ForEachHeadlessInstance[], headlessInstanceComponents?: HeadlessInstanceComponent[], mergedSlowViewState?: object): Promise<AnyFastRenderResult>;
|
|
71
142
|
|
|
72
143
|
/**
|
|
73
144
|
* Action metadata loaded from .jay-action files.
|
|
@@ -497,8 +568,50 @@ interface GenerateClientScriptOptions {
|
|
|
497
568
|
*/
|
|
498
569
|
slowViewState?: object;
|
|
499
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Shared fragments generated by buildScriptFragments().
|
|
573
|
+
* Used by both generateClientScript() and generateHydrationScript().
|
|
574
|
+
*/
|
|
575
|
+
interface ScriptFragments {
|
|
576
|
+
partImports: string;
|
|
577
|
+
compositeParts: string;
|
|
578
|
+
pluginClientInitImports: string;
|
|
579
|
+
projectInitImport: string;
|
|
580
|
+
clientInitExecution: string;
|
|
581
|
+
automationImport: string;
|
|
582
|
+
slowViewStateDecl: string;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Build the shared script fragments used by both client and hydration scripts.
|
|
586
|
+
*/
|
|
587
|
+
declare function buildScriptFragments(parts: DevServerPagePart[], clientInitData: Record<string, Record<string, any>>, projectInit: ProjectClientInitInfo | undefined, pluginInits: PluginClientInitInfo[], options: GenerateClientScriptOptions): ScriptFragments;
|
|
588
|
+
/**
|
|
589
|
+
* Generate the automation wrapping code.
|
|
590
|
+
* @param mode - 'client' appends to DOM; 'hydrate' skips appendChild (DOM already present)
|
|
591
|
+
*/
|
|
592
|
+
declare function buildAutomationWrap(options: GenerateClientScriptOptions, mode: 'client' | 'hydrate'): string;
|
|
500
593
|
declare function generateClientScript(defaultViewState: object, fastCarryForward: object, parts: DevServerPagePart[], jayHtmlPath: string, trackByMap?: TrackByMap, clientInitData?: Record<string, Record<string, any>>, projectInit?: ProjectClientInitInfo, pluginInits?: PluginClientInitInfo[], options?: GenerateClientScriptOptions): string;
|
|
501
594
|
|
|
595
|
+
/**
|
|
596
|
+
* Invalidate the cached server element module for a jay-html file.
|
|
597
|
+
* Called when the source file changes (via file watcher).
|
|
598
|
+
*/
|
|
599
|
+
declare function invalidateServerElementCache(jayHtmlPath: string): void;
|
|
600
|
+
/**
|
|
601
|
+
* Invalidate all cached server element modules.
|
|
602
|
+
*/
|
|
603
|
+
declare function clearServerElementCache(): void;
|
|
604
|
+
/**
|
|
605
|
+
* Generate a complete SSR HTML page with server-rendered content and hydration script.
|
|
606
|
+
*
|
|
607
|
+
* Flow:
|
|
608
|
+
* 1. Load (or reuse cached) server element module
|
|
609
|
+
* 2. Execute renderToStream() to produce HTML
|
|
610
|
+
* 3. Build hydration script (uses ?jay-hydrate query for hydrate target)
|
|
611
|
+
* 4. Return full HTML page string
|
|
612
|
+
*/
|
|
613
|
+
declare function generateSSRPageHtml(vite: ViteDevServer, jayHtmlContent: string, jayHtmlFilename: string, jayHtmlDir: string, viewState: object, jayHtmlImportPath: string, parts: DevServerPagePart[], carryForward: object, trackByMap: TrackByMap, clientInitData: Record<string, Record<string, any>>, buildFolder: string, projectRoot: string, routeDir: string, tsConfigFilePath?: string, projectInit?: ProjectClientInitInfo, pluginInits?: PluginClientInitInfo[], options?: GenerateClientScriptOptions): Promise<string>;
|
|
614
|
+
|
|
502
615
|
/**
|
|
503
616
|
* Service registry for Jay Stack server-side dependency injection.
|
|
504
617
|
*
|
|
@@ -668,90 +781,35 @@ declare function getClientInitDataForKey(key: string): Record<string, any>;
|
|
|
668
781
|
*/
|
|
669
782
|
declare function clearClientInitData(): void;
|
|
670
783
|
|
|
671
|
-
/**
|
|
672
|
-
* Server-side slow render orchestration for headless component instances.
|
|
673
|
-
*
|
|
674
|
-
* Given discovered instances (from discoverHeadlessInstances) and their
|
|
675
|
-
* component definitions, runs slowlyRender for each instance and collects
|
|
676
|
-
* the results for downstream consumers (pre-render pipeline, direct mode, fast phase).
|
|
677
|
-
*/
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* Data needed by the fast phase to render headless instances.
|
|
681
|
-
* Stored in carryForward.__instances so the fast phase can access it
|
|
682
|
-
* (both in pre-render and cached flows).
|
|
683
|
-
*/
|
|
684
|
-
interface InstancePhaseData {
|
|
685
|
-
/** Discovered instances with their props and coordinates */
|
|
686
|
-
discovered: Array<{
|
|
687
|
-
contractName: string;
|
|
688
|
-
props: Record<string, string>;
|
|
689
|
-
coordinate: Coordinate;
|
|
690
|
-
}>;
|
|
691
|
-
/** CarryForward per instance (keyed by coordinate path, e.g. "p1/product-card:0") */
|
|
692
|
-
carryForwards: Record<string, object>;
|
|
693
|
-
/** ForEach instances that need fast-phase per-item rendering */
|
|
694
|
-
forEachInstances?: ForEachHeadlessInstance[];
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Result of running slowlyRender for all discovered headless instances.
|
|
698
|
-
*/
|
|
699
|
-
interface InstanceSlowRenderResult {
|
|
700
|
-
/** Resolved data for each instance (for resolveHeadlessInstances pass 2) */
|
|
701
|
-
resolvedData: Array<{
|
|
702
|
-
coordinate: Coordinate;
|
|
703
|
-
contract: Contract;
|
|
704
|
-
slowViewState: Record<string, unknown>;
|
|
705
|
-
}>;
|
|
706
|
-
/** Per-instance slow ViewState keyed by coordinate (for direct mode merge) */
|
|
707
|
-
slowViewStates: Record<string, object>;
|
|
708
|
-
/** Phase data for the fast render phase */
|
|
709
|
-
instancePhaseData: InstancePhaseData;
|
|
710
|
-
}
|
|
711
|
-
/**
|
|
712
|
-
* Run slowlyRender for each discovered headless instance.
|
|
713
|
-
*
|
|
714
|
-
* Shared between preRenderJayHtml (pre-render path) and handleDirectRequest (direct path).
|
|
715
|
-
*/
|
|
716
|
-
declare function slowRenderInstances(discovered: DiscoveredHeadlessInstance[], headlessInstanceComponents: HeadlessInstanceComponent[]): Promise<InstanceSlowRenderResult | undefined>;
|
|
717
|
-
/**
|
|
718
|
-
* Validate that forEach headless instances do not have a slow phase.
|
|
719
|
-
*
|
|
720
|
-
* Components with slowlyRender cannot be used inside forEach because
|
|
721
|
-
* forEach items are only known at request time, after slow rendering completes.
|
|
722
|
-
*
|
|
723
|
-
* @returns Array of validation error messages (empty if all valid)
|
|
724
|
-
*/
|
|
725
|
-
declare function validateForEachInstances(forEachInstances: ForEachHeadlessInstance[], headlessInstanceComponents: HeadlessInstanceComponent[]): string[];
|
|
726
|
-
|
|
727
784
|
/**
|
|
728
785
|
* Cache entry for pre-rendered jay-html
|
|
729
786
|
*/
|
|
730
787
|
interface SlowRenderCacheEntry {
|
|
731
788
|
/** Path to the pre-rendered jay-html file on disk */
|
|
732
789
|
preRenderedPath: string;
|
|
790
|
+
/** Pre-rendered jay-html content with cache metadata tag stripped */
|
|
791
|
+
preRenderedContent: string;
|
|
733
792
|
/** Slow ViewState that was baked into the jay-html */
|
|
734
793
|
slowViewState: object;
|
|
735
794
|
/** CarryForward data from slow rendering (passed to fast phase) */
|
|
736
795
|
carryForward: object;
|
|
737
|
-
/** Timestamp when this entry was created */
|
|
738
|
-
createdAt: number;
|
|
739
796
|
/** Source jay-html path (for debugging) */
|
|
740
797
|
sourcePath: string;
|
|
741
798
|
}
|
|
742
799
|
/**
|
|
743
|
-
*
|
|
800
|
+
* Filesystem-based cache for pre-rendered jay-html files.
|
|
744
801
|
*
|
|
745
|
-
*
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
802
|
+
* Cache metadata (slowViewState, carryForward) is embedded in the pre-rendered
|
|
803
|
+
* file as a `<script type="application/jay-cache">` tag. This means:
|
|
804
|
+
* - Cache survives dev server restart
|
|
805
|
+
* - The filesystem is the single source of truth
|
|
806
|
+
* - No in-memory map needed for cache entries
|
|
749
807
|
*
|
|
750
|
-
*
|
|
808
|
+
* On read, the script tag is extracted and stripped before returning content.
|
|
751
809
|
*/
|
|
752
810
|
declare class SlowRenderCache {
|
|
753
|
-
|
|
754
|
-
private
|
|
811
|
+
/** Maps source jay-html path → set of pre-rendered file paths (for invalidation) */
|
|
812
|
+
private pathToFiles;
|
|
755
813
|
private readonly cacheDir;
|
|
756
814
|
private readonly pagesRoot;
|
|
757
815
|
/**
|
|
@@ -760,22 +818,23 @@ declare class SlowRenderCache {
|
|
|
760
818
|
*/
|
|
761
819
|
constructor(cacheDir: string, pagesRoot: string);
|
|
762
820
|
/**
|
|
763
|
-
* Get a cached pre-rendered jay-html entry
|
|
821
|
+
* Get a cached pre-rendered jay-html entry by reading from disk.
|
|
822
|
+
* Returns undefined if the cache file doesn't exist or has no metadata tag.
|
|
764
823
|
*/
|
|
765
|
-
get(jayHtmlPath: string, params: Record<string, string>): SlowRenderCacheEntry | undefined
|
|
824
|
+
get(jayHtmlPath: string, params: Record<string, string>): Promise<SlowRenderCacheEntry | undefined>;
|
|
766
825
|
/**
|
|
767
|
-
* Store a pre-rendered jay-html entry
|
|
768
|
-
*
|
|
826
|
+
* Store a pre-rendered jay-html entry.
|
|
827
|
+
* Embeds metadata as a <script> tag and writes to disk.
|
|
828
|
+
* Returns the full cache entry with stripped content.
|
|
769
829
|
*/
|
|
770
|
-
set(jayHtmlPath: string, params: Record<string, string>, preRenderedJayHtml: string, slowViewState: object, carryForward: object): Promise<
|
|
830
|
+
set(jayHtmlPath: string, params: Record<string, string>, preRenderedJayHtml: string, slowViewState: object, carryForward: object): Promise<SlowRenderCacheEntry>;
|
|
771
831
|
/**
|
|
772
832
|
* Check if a pre-rendered entry exists for the given path and params
|
|
773
833
|
*/
|
|
774
|
-
has(jayHtmlPath: string, params: Record<string, string>): boolean
|
|
834
|
+
has(jayHtmlPath: string, params: Record<string, string>): Promise<boolean>;
|
|
775
835
|
/**
|
|
776
836
|
* Invalidate all cached entries for a given jay-html source path.
|
|
777
|
-
*
|
|
778
|
-
* Also deletes the cached files from disk.
|
|
837
|
+
* Deletes cached files from disk.
|
|
779
838
|
*/
|
|
780
839
|
invalidate(jayHtmlPath: string): Promise<void>;
|
|
781
840
|
/**
|
|
@@ -793,14 +852,23 @@ declare class SlowRenderCache {
|
|
|
793
852
|
* Clear all cached entries and delete cached files from disk
|
|
794
853
|
*/
|
|
795
854
|
clear(): Promise<void>;
|
|
796
|
-
/**
|
|
797
|
-
* Get the number of cached entries
|
|
798
|
-
*/
|
|
799
|
-
get size(): number;
|
|
800
855
|
/**
|
|
801
856
|
* Get all cached jay-html paths (for debugging/monitoring)
|
|
802
857
|
*/
|
|
803
858
|
getCachedPaths(): string[];
|
|
859
|
+
/**
|
|
860
|
+
* Compute the cache file path for a given jay-html path and params.
|
|
861
|
+
*/
|
|
862
|
+
private computeCachePath;
|
|
863
|
+
/**
|
|
864
|
+
* Track a pre-rendered file path for invalidation.
|
|
865
|
+
*/
|
|
866
|
+
private trackFile;
|
|
867
|
+
/**
|
|
868
|
+
* Scan the cache directory for files matching a route and delete them.
|
|
869
|
+
* Handles the startup case where pathToFiles is not populated from a previous session.
|
|
870
|
+
*/
|
|
871
|
+
private scanAndDeleteCacheFiles;
|
|
804
872
|
}
|
|
805
873
|
|
|
806
874
|
/**
|
|
@@ -812,18 +880,6 @@ declare class SlowRenderCache {
|
|
|
812
880
|
* @see Design Log #80 - Materializing Dynamic Contracts for Agentic Page Generation
|
|
813
881
|
*/
|
|
814
882
|
|
|
815
|
-
interface ContractIndexEntry {
|
|
816
|
-
plugin: string;
|
|
817
|
-
name: string;
|
|
818
|
-
type: 'static' | 'dynamic';
|
|
819
|
-
path: string;
|
|
820
|
-
metadata?: Record<string, unknown>;
|
|
821
|
-
}
|
|
822
|
-
interface ContractsIndex {
|
|
823
|
-
materialized_at: string;
|
|
824
|
-
jay_stack_version: string;
|
|
825
|
-
contracts: ContractIndexEntry[];
|
|
826
|
-
}
|
|
827
883
|
/** Action metadata entry in plugins-index.yaml */
|
|
828
884
|
interface ActionIndexEntry {
|
|
829
885
|
name: string;
|
|
@@ -831,20 +887,22 @@ interface ActionIndexEntry {
|
|
|
831
887
|
/** Path to the .jay-action file (relative to project root) */
|
|
832
888
|
path: string;
|
|
833
889
|
}
|
|
890
|
+
/** Contract entry within a plugin in plugins-index.yaml */
|
|
891
|
+
interface PluginContractEntry {
|
|
892
|
+
name: string;
|
|
893
|
+
type: 'static' | 'dynamic';
|
|
894
|
+
path: string;
|
|
895
|
+
metadata?: Record<string, unknown>;
|
|
896
|
+
}
|
|
834
897
|
/** Entry for plugins-index.yaml (Design Log #85) */
|
|
835
898
|
interface PluginsIndexEntry {
|
|
836
899
|
name: string;
|
|
837
900
|
path: string;
|
|
838
|
-
contracts:
|
|
839
|
-
name: string;
|
|
840
|
-
type: 'static' | 'dynamic';
|
|
841
|
-
path: string;
|
|
842
|
-
}>;
|
|
901
|
+
contracts: PluginContractEntry[];
|
|
843
902
|
/** Actions with .jay-action metadata (exposed to AI agents) */
|
|
844
903
|
actions?: ActionIndexEntry[];
|
|
845
904
|
}
|
|
846
905
|
interface PluginsIndex {
|
|
847
|
-
materialized_at: string;
|
|
848
906
|
jay_stack_version: string;
|
|
849
907
|
plugins: PluginsIndexEntry[];
|
|
850
908
|
}
|
|
@@ -859,7 +917,7 @@ interface MaterializeContractsOptions {
|
|
|
859
917
|
viteServer?: ViteSSRLoader;
|
|
860
918
|
}
|
|
861
919
|
interface MaterializeResult {
|
|
862
|
-
|
|
920
|
+
pluginsIndex: PluginsIndex;
|
|
863
921
|
staticCount: number;
|
|
864
922
|
dynamicCount: number;
|
|
865
923
|
outputDir: string;
|
|
@@ -874,7 +932,7 @@ declare function materializeContracts(options: MaterializeContractsOptions, serv
|
|
|
874
932
|
/**
|
|
875
933
|
* Lists contracts without writing files (for --list mode)
|
|
876
934
|
*/
|
|
877
|
-
declare function listContracts(options: MaterializeContractsOptions): Promise<
|
|
935
|
+
declare function listContracts(options: MaterializeContractsOptions): Promise<PluginsIndex>;
|
|
878
936
|
|
|
879
937
|
/**
|
|
880
938
|
* Plugin Scanner
|
|
@@ -1077,4 +1135,4 @@ declare function executePluginReferences(plugin: PluginWithReferences, options:
|
|
|
1077
1135
|
verbose?: boolean;
|
|
1078
1136
|
}): Promise<PluginReferencesResult>;
|
|
1079
1137
|
|
|
1080
|
-
export { type ActionDiscoveryOptions, type ActionDiscoveryResult, type ActionErrorResponse, type ActionExecutionResult, type ActionIndexEntry, type ActionMetadata, ActionRegistry, type ActionSchema, type
|
|
1138
|
+
export { type ActionDiscoveryOptions, type ActionDiscoveryResult, type ActionErrorResponse, type ActionExecutionResult, type ActionIndexEntry, type ActionMetadata, ActionRegistry, type ActionSchema, type DevServerPagePart, DevSlowlyChangingPhase, type GenerateClientScriptOptions, type HeadlessInstanceComponent, type InstancePhaseData, type InstanceSlowRenderResult, type LoadedPageParts, type MaterializeContractsOptions, type MaterializeResult, type PluginActionDiscoveryOptions, type PluginClientInitInfo, type PluginContractEntry, type PluginInitDiscoveryOptions, type PluginReferencesContext, type PluginReferencesHandler, type PluginReferencesResult, type PluginScanOptions, type PluginSetupContext, type PluginSetupHandler, type PluginSetupResult, type PluginWithInit, type PluginWithReferences, type PluginWithSetup, type PluginsIndex, type PluginsIndexEntry, type ProjectClientInitInfo, type RegisteredAction, type ScannedPlugin, type ScriptFragments, SlowRenderCache, type SlowRenderCacheEntry, type SlowlyChangingPhase, type ViteSSRLoader, actionRegistry, buildAutomationWrap, buildScriptFragments, clearActionRegistry, clearClientInitData, clearLifecycleCallbacks, clearServerElementCache, clearServiceRegistry, discoverAllPluginActions, discoverAndRegisterActions, discoverPluginActions, discoverPluginsWithInit, discoverPluginsWithReferences, discoverPluginsWithSetup, executeAction, executePluginReferences, executePluginServerInits, executePluginSetup, generateClientScript, generateSSRPageHtml, getActionCacheHeaders, getClientInitData, getClientInitDataForKey, getRegisteredAction, getRegisteredActionNames, getService, getServiceRegistry, hasAction, hasService, invalidateServerElementCache, listContracts, loadActionMetadata, loadPageParts, materializeContracts, onInit, onShutdown, parseActionMetadata, preparePluginClientInits, registerAction, registerService, renderFastChangingData, resolveActionMetadataPath, resolveServices, runInitCallbacks, runLoadParams, runShutdownCallbacks, runSlowlyChangingRender, scanPlugins, setClientInitData, slowRenderInstances, sortPluginsByDependencies, validateForEachInstances };
|