@nan0web/ui 1.10.0 → 1.12.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 (101) hide show
  1. package/README.md +69 -3
  2. package/package.json +65 -29
  3. package/src/App/Command/DepsCommand.js +3 -4
  4. package/src/Frame/Props.js +12 -18
  5. package/src/InterfaceTemplate/InterfaceTemplate.js +9 -7
  6. package/src/Model/index.js +61 -6
  7. package/src/StdIn.js +2 -6
  8. package/src/cli.js +1 -0
  9. package/src/core/GeneratorRunner.js +67 -7
  10. package/src/core/InputAdapter.js +22 -5
  11. package/src/core/Intent.js +230 -18
  12. package/src/core/Message/Message.js +4 -7
  13. package/src/core/Message/OutputMessage.js +4 -9
  14. package/src/core/StreamEntry.js +20 -28
  15. package/src/core/index.js +4 -0
  16. package/src/domain/Content.js +198 -0
  17. package/src/domain/Document.js +25 -0
  18. package/src/domain/FooterModel.js +37 -19
  19. package/src/domain/HeaderModel.js +47 -21
  20. package/src/domain/HeroModel.js +24 -22
  21. package/src/domain/LayoutModel.js +43 -0
  22. package/src/domain/ModelAsApp.js +46 -0
  23. package/src/domain/SandboxModel.js +19 -16
  24. package/src/domain/app/GalleryCommand.js +53 -0
  25. package/src/domain/app/GalleryRenderIntent.js +77 -0
  26. package/src/domain/app/SnapshotAuditor.js +399 -0
  27. package/src/domain/app/SnapshotRunner.js +264 -0
  28. package/src/domain/app/UIApp.js +78 -0
  29. package/src/domain/components/BreadcrumbModel.js +10 -6
  30. package/src/domain/components/FeatureGridModel.js +62 -0
  31. package/src/domain/components/MarkdownModel.js +24 -0
  32. package/src/domain/components/ShellModel.js +243 -0
  33. package/src/domain/components/TableModel.js +10 -6
  34. package/src/domain/components/ToastModel.js +10 -6
  35. package/src/domain/components/index.js +3 -1
  36. package/src/domain/index.js +14 -4
  37. package/src/index.js +23 -2
  38. package/src/inspect.js +2 -0
  39. package/src/test/ScenarioAdapter.js +59 -0
  40. package/src/test/ScenarioTest.js +51 -0
  41. package/src/test/ScenarioTest.story.js +56 -0
  42. package/src/testing/CrashReporter.js +56 -0
  43. package/src/testing/GalleryGenerator.js +15 -71
  44. package/src/testing/LogicInspector.js +4 -4
  45. package/src/testing/SnapshotRunner.js +22 -0
  46. package/src/testing/SpecAdapter.js +114 -0
  47. package/src/testing/SpecRunner.js +121 -0
  48. package/src/testing/VisualAdapter.js +24 -19
  49. package/src/testing/index.js +5 -1
  50. package/src/testing/verifySnapshot.js +17 -0
  51. package/types/App/Command/DepsCommand.d.ts +0 -2
  52. package/types/Model/index.d.ts +56 -62
  53. package/types/StdIn.d.ts +3 -3
  54. package/types/cli.d.ts +1 -0
  55. package/types/core/GeneratorRunner.d.ts +14 -1
  56. package/types/core/InputAdapter.d.ts +50 -6
  57. package/types/core/Intent.d.ts +280 -32
  58. package/types/core/Message/Message.d.ts +2 -2
  59. package/types/core/Message/OutputMessage.d.ts +0 -2
  60. package/types/core/index.d.ts +4 -0
  61. package/types/domain/Content.d.ts +344 -0
  62. package/types/domain/Document.d.ts +40 -0
  63. package/types/domain/FooterModel.d.ts +22 -12
  64. package/types/domain/HeaderModel.d.ts +36 -13
  65. package/types/domain/HeroModel.d.ts +19 -17
  66. package/types/domain/LayoutModel.d.ts +34 -0
  67. package/types/domain/ModelAsApp.d.ts +23 -0
  68. package/types/domain/SandboxModel.d.ts +10 -0
  69. package/types/domain/app/GalleryCommand.d.ts +55 -0
  70. package/types/domain/app/GalleryRenderIntent.d.ts +31 -0
  71. package/types/domain/app/SnapshotAuditor.d.ts +99 -0
  72. package/types/domain/app/SnapshotRunner.d.ts +45 -0
  73. package/types/domain/app/UIApp.d.ts +60 -0
  74. package/types/domain/components/BreadcrumbModel.d.ts +6 -8
  75. package/types/domain/components/FeatureGridModel.d.ts +50 -0
  76. package/types/domain/components/MarkdownModel.d.ts +19 -0
  77. package/types/domain/components/ShellModel.d.ts +56 -0
  78. package/types/domain/components/TableModel.d.ts +4 -0
  79. package/types/domain/components/ToastModel.d.ts +4 -0
  80. package/types/domain/components/index.d.ts +3 -0
  81. package/types/domain/index.d.ts +10 -4
  82. package/types/index.d.ts +21 -1
  83. package/types/inspect.d.ts +2 -0
  84. package/types/test/ScenarioAdapter.d.ts +43 -0
  85. package/types/test/ScenarioTest.d.ts +24 -0
  86. package/types/test/ScenarioTest.story.d.ts +1 -0
  87. package/types/testing/CrashReporter.d.ts +13 -0
  88. package/types/testing/SnapshotRunner.d.ts +7 -0
  89. package/types/testing/SpecAdapter.d.ts +58 -0
  90. package/types/testing/SpecRunner.d.ts +41 -0
  91. package/types/testing/VisualAdapter.d.ts +0 -6
  92. package/types/testing/index.d.ts +5 -1
  93. package/types/testing/verifySnapshot.d.ts +14 -0
  94. package/src/testing/SnapshotInspector.js +0 -84
  95. package/types/App/Command/Options.d.ts +0 -43
  96. package/types/App/Command/index.d.ts +0 -8
  97. package/types/App/User/Command/Options.d.ts +0 -34
  98. package/types/core/Message/InputMessage.d.ts +0 -71
  99. package/types/domain/components/HeroModel.d.ts +0 -24
  100. package/types/domain/components/ShowcaseAppModel.d.ts +0 -32
  101. package/types/testing/SnapshotInspector.d.ts +0 -17
@@ -4,6 +4,16 @@
4
4
  */
5
5
  export class SandboxModel extends Model {
6
6
  static $id: string;
7
+ static UI: {
8
+ breadcrumb: string;
9
+ componentsHelp: string;
10
+ selectedComponentHelp: string;
11
+ selectedComponentPlaceholder: string;
12
+ themeFormatHelp: string;
13
+ selectComponentHelp: string;
14
+ configurePropertiesHelp: string;
15
+ exportFormatHelp: string;
16
+ };
7
17
  static components: {
8
18
  help: string;
9
19
  type: string;
@@ -0,0 +1,55 @@
1
+ export class GalleryCommand extends ModelAsApp {
2
+ static alias: string;
3
+ static UI: {
4
+ unknownAction: string;
5
+ };
6
+ static action: {
7
+ type: string;
8
+ help: string;
9
+ options: (typeof SnapshotAuditor | typeof GalleryRenderIntent)[];
10
+ default: string;
11
+ positional: boolean;
12
+ };
13
+ /**
14
+ * @param {Partial<GalleryCommand> | Record<string, any>} [data={}]
15
+ * @param {import('@nan0web/types').ModelOptions} [options={}]
16
+ */
17
+ constructor(data?: Partial<GalleryCommand> | Record<string, any>, options?: import("@nan0web/types").ModelOptions);
18
+ /** @type {string} */ action: string;
19
+ /** @type {string[]} */ _positionals: string[];
20
+ run(): AsyncGenerator<import("../../core/Intent.js").ShowIntent | (import("../../core/Intent.js").AskIntent & {
21
+ $value?: any;
22
+ $success?: boolean;
23
+ $files?: Record<string, string>;
24
+ $message?: string;
25
+ }) | (import("../../core/Intent.js").ProgressIntent & {
26
+ $value?: any;
27
+ $success?: boolean;
28
+ $files?: Record<string, string>;
29
+ $message?: string;
30
+ }) | (import("../../core/Intent.js").LogIntent & {
31
+ $value?: any;
32
+ $success?: boolean;
33
+ $files?: Record<string, string>;
34
+ $message?: string;
35
+ }) | (import("../../core/Intent.js").RenderIntent & {
36
+ $value?: any;
37
+ $success?: boolean;
38
+ $files?: Record<string, string>;
39
+ $message?: string;
40
+ }) | (import("../../core/Intent.js").AgentIntent & {
41
+ $value?: any;
42
+ $success?: boolean;
43
+ $files?: Record<string, string>;
44
+ $message?: string;
45
+ }) | (import("../../core/Intent.js").ResultIntent & {
46
+ $value?: any;
47
+ $success?: boolean;
48
+ $files?: Record<string, string>;
49
+ $message?: string;
50
+ }), any, any>;
51
+ }
52
+ export default GalleryCommand;
53
+ import { ModelAsApp } from '../ModelAsApp.js';
54
+ import SnapshotAuditor from './SnapshotAuditor.js';
55
+ import GalleryRenderIntent from './GalleryRenderIntent.js';
@@ -0,0 +1,31 @@
1
+ export class GalleryRenderIntent extends Model {
2
+ static alias: string;
3
+ static UI: {
4
+ rendering: string;
5
+ success: string;
6
+ failed: string;
7
+ };
8
+ static dataDir: {
9
+ type: string;
10
+ default: string;
11
+ help: string;
12
+ };
13
+ static dir: {
14
+ type: string;
15
+ default: string;
16
+ help: string;
17
+ };
18
+ /**
19
+
20
+ * @param {Partial<GalleryRenderIntent> | Record<string, any>} [data={}]
21
+
22
+ * @param {import('@nan0web/types').ModelOptions} [options={}]
23
+
24
+ */
25
+ constructor(data?: Partial<GalleryRenderIntent> | Record<string, any>, options?: import("@nan0web/types").ModelOptions);
26
+ /** @type {string} */ dataDir: string;
27
+ /** @type {string} */ dir: string;
28
+ run(): AsyncGenerator<import("../../core/Intent.js").ShowIntent, import("../../core/Intent.js").ResultIntent | undefined, unknown>;
29
+ }
30
+ export default GalleryRenderIntent;
31
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,99 @@
1
+ /**
2
+ * SnapshotAuditor — Zero-Hallucination Snapshot Validation (Model-as-Schema v2).
3
+ * Parses snapshots without evaluating the app logic and detects artifacts.
4
+ *
5
+ * @extends {AuditorModel}
6
+ */
7
+ export class SnapshotAuditor {
8
+ static alias: string;
9
+ static dir: {
10
+ type: string;
11
+ help: string;
12
+ positional: boolean;
13
+ default: string;
14
+ };
15
+ static data: {
16
+ type: string;
17
+ help: string;
18
+ default: string;
19
+ };
20
+ /** @type {Object<string, string>} Messages for UI */
21
+ static UI: {
22
+ [x: string]: string;
23
+ };
24
+ /** @type {string[]} Common UI components that can be empty in render */
25
+ static EXEMPT_EMPTY: string[];
26
+ /** @type {string[]} Critical JS artifacts to detect in snapshots */
27
+ static ARTIFACTS: string[];
28
+ /** @type {string[]} Words to ignore across all languages */
29
+ static EXEMPT_WORDS: string[];
30
+ /** @type {RegExp} Pattern for suspicious filenames */
31
+ static SUSPICIOUS_FILENAME: RegExp;
32
+ /** @type {number} Minimum filename length */
33
+ static MIN_FILENAME_LENGTH: number;
34
+ /**
35
+ * Extracts all valid words from an object into a Set.
36
+ * @param {any} obj Node to extract from.
37
+ * @param {Set<string>} set Set to populate.
38
+ */
39
+ static extractWords(obj: any, set: Set<string>): void;
40
+ /**
41
+ * Scans data directories to build a word set for each language.
42
+ * @param {any} fsDb FileSystem DB.
43
+ * @param {string} data
44
+ * @returns {Promise<Record<string, Set<string>>>}
45
+ */
46
+ static buildDictionaries(fsDb: any, data?: string): Promise<Record<string, Set<string>>>;
47
+ /**
48
+ * Inspects a single snapshot text.
49
+ * @param {string} content Content of the file.
50
+ * @param {string} locale Locale (uk, en).
51
+ * @param {string} filename Name of the file.
52
+ * @param {import('@nan0web/i18n').TFunction} t Translate function.
53
+ * @param {Record<string, Set<string>>} [dictionaries=undefined] Loaded dictionaries for mutual exclusion check.
54
+ * @returns {{ score: number, errors: string[] }}
55
+ */
56
+ static inspectText(content: string, locale: string, filename: string, t: any, dictionaries?: Record<string, Set<string>>): {
57
+ score: number;
58
+ errors: string[];
59
+ };
60
+ /**
61
+ * Recursively checks a parsed node.
62
+ * @param {any} node Node.
63
+ * @param {string} path JSON path.
64
+ * @param {{ locale: string, errors: string[], t: import('@nan0web/i18n').TFunction, dictionaries?: Record<string, Set<string>> }} context Context.
65
+ */
66
+ static checkNode(node: any, path: string, context: {
67
+ locale: string;
68
+ errors: string[];
69
+ t: any;
70
+ dictionaries?: Record<string, Set<string>>;
71
+ }): void;
72
+ /**
73
+ * Checks a string node.
74
+ * @param {string} str String.
75
+ * @param {string} path Path.
76
+ * @param {{ locale: string, errors: string[], t: import('@nan0web/i18n').TFunction, dictionaries?: Record<string, Set<string>> }} context Context.
77
+ */
78
+ static checkString(str: string, path: string, context: {
79
+ locale: string;
80
+ errors: string[];
81
+ t: any;
82
+ dictionaries?: Record<string, Set<string>>;
83
+ }): void;
84
+ /**
85
+ * @param {Partial<SnapshotAuditor> | Record<string, any>} [data={}]
86
+ * @param {Partial<import('@nan0web/types').ModelOptions>} [options={}]
87
+ */
88
+ constructor(data?: Partial<SnapshotAuditor> | Record<string, any>, options?: Partial<import("@nan0web/types").ModelOptions>);
89
+ /** @type {import('@nan0web/types').ModelOptions} */
90
+ options: import("@nan0web/types").ModelOptions;
91
+ /** @type {string} Target directory to audit */ dir: string;
92
+ /** @type {string} Directory to scan for dictionaries */ data: string;
93
+ /**
94
+ * Run the snapshot audit inside the target directory.
95
+ * @returns {AsyncGenerator<import('@nan0web/ui').Intent, any, any>}
96
+ */
97
+ run(): AsyncGenerator<import("@nan0web/ui").Intent, any, any>;
98
+ }
99
+ export default SnapshotAuditor;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * SnapshotRunner — Zero-Hallucination Snapshot Generation & Audit (Model-as-Schema v2).
3
+ * Operates entirely through DB-FS abstraction without raw FS/Path hardcodes.
4
+ */
5
+ export class SnapshotRunner extends Model {
6
+ static UI: {
7
+ generating: string;
8
+ saved: string;
9
+ auditFailed: string;
10
+ rootGallery: string;
11
+ localeTitle: string;
12
+ categoryTitle: string;
13
+ backText: string;
14
+ backLink: string;
15
+ galleryDescription: string;
16
+ };
17
+ static data: {
18
+ type: string;
19
+ help: string;
20
+ default: string;
21
+ };
22
+ static snapshotsDir: {
23
+ type: string;
24
+ help: string;
25
+ default: string;
26
+ };
27
+ /**
28
+ * @param {Partial<SnapshotRunner> | Record<string, any>} [data={}]
29
+ * @param {import('@nan0web/types').ModelOptions} [options={}]
30
+ */
31
+ constructor(data?: Partial<SnapshotRunner> | Record<string, any>, options?: import("@nan0web/types").ModelOptions);
32
+ /** @type {string} Directory containing snapshots */ snapshotsDir: string;
33
+ /** @type {string} Root data directory */ data: string;
34
+ /** @type {(compName: string) => string} */ getCategory: (compName: string) => string;
35
+ /** @type {(compName: string, varData: any) => AsyncGenerator<any>} */ createModelStream: (compName: string, varData: any) => AsyncGenerator<any>;
36
+ get db(): import("@nan0web/db").DB;
37
+ /**
38
+ * Recursive drop for directories via DB-FS.
39
+ * @param {string} uri
40
+ */
41
+ dropRecursive(uri: string): Promise<void>;
42
+ run(): AsyncGenerator<import("../../core/Intent.js").ShowIntent, import("../../core/Intent.js").ResultIntent, unknown>;
43
+ }
44
+ export default SnapshotRunner;
45
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,60 @@
1
+ export class UIApp extends ModelAsApp {
2
+ static command: {
3
+ type: string;
4
+ help: string;
5
+ options: (typeof SnapshotAuditor | typeof GalleryCommand)[];
6
+ default: string;
7
+ positional: boolean;
8
+ };
9
+ static UI: {
10
+ helpText: string;
11
+ unknownCommand: string;
12
+ };
13
+ static help: {
14
+ help: string;
15
+ default: boolean;
16
+ };
17
+ /**
18
+ * @param {Partial<UIApp> | Record<string, any>} [data={}]
19
+ * @param {import('@nan0web/types').ModelOptions} [options={}]
20
+ */
21
+ constructor(data?: Partial<UIApp> | Record<string, any>, options?: import("@nan0web/types").ModelOptions);
22
+ /** @type {string[]} */ _positionals: string[];
23
+ /** @type {string} Type of command to run */ command: string;
24
+ /** @type {boolean} Show help message */ help: boolean;
25
+ run(): AsyncGenerator<import("../../core/Intent.js").ShowIntent | (import("../../core/Intent.js").AskIntent & {
26
+ $value?: any;
27
+ $success?: boolean;
28
+ $files?: Record<string, string>;
29
+ $message?: string;
30
+ }) | (import("../../core/Intent.js").ProgressIntent & {
31
+ $value?: any;
32
+ $success?: boolean;
33
+ $files?: Record<string, string>;
34
+ $message?: string;
35
+ }) | (import("../../core/Intent.js").LogIntent & {
36
+ $value?: any;
37
+ $success?: boolean;
38
+ $files?: Record<string, string>;
39
+ $message?: string;
40
+ }) | (import("../../core/Intent.js").RenderIntent & {
41
+ $value?: any;
42
+ $success?: boolean;
43
+ $files?: Record<string, string>;
44
+ $message?: string;
45
+ }) | (import("../../core/Intent.js").AgentIntent & {
46
+ $value?: any;
47
+ $success?: boolean;
48
+ $files?: Record<string, string>;
49
+ $message?: string;
50
+ }) | (import("../../core/Intent.js").ResultIntent & {
51
+ $value?: any;
52
+ $success?: boolean;
53
+ $files?: Record<string, string>;
54
+ $message?: string;
55
+ }), any, any>;
56
+ }
57
+ export default UIApp;
58
+ import { ModelAsApp } from '../ModelAsApp.js';
59
+ import SnapshotAuditor from './SnapshotAuditor.js';
60
+ import GalleryCommand from './GalleryCommand.js';
@@ -24,6 +24,10 @@
24
24
  * Ctrl+C = always exit (adapter responsibility).
25
25
  */
26
26
  export class BreadcrumbModel extends Model {
27
+ static $id: string;
28
+ static UI: {
29
+ navigated: string;
30
+ };
27
31
  static items: {
28
32
  help: string;
29
33
  type: string;
@@ -136,16 +140,10 @@ export class BreadcrumbModel extends Model {
136
140
  */
137
141
  toDataPath(filename?: string): string;
138
142
  /**
139
- * Yields a log intent with the current breadcrumb path.
143
+ * Yields a show intent with the current breadcrumb path.
140
144
  * This is a "display-only" run — it shows the navigation state.
141
145
  */
142
- run(): AsyncGenerator<{
143
- type: string;
144
- level: string;
145
- message: string;
146
- component: string;
147
- model: BreadcrumbModel;
148
- }, {
146
+ run(): AsyncGenerator<import("../../core/Intent.js").ShowIntent, {
149
147
  type: string;
150
148
  data: {
151
149
  path: string;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * FeatureItemModel — OLMUI Component Model
3
+ * Represents a single features block entry with an icon, title, and description.
4
+ */
5
+ export class FeatureItemModel extends Model {
6
+ static $id: string;
7
+ static icon: {
8
+ help: string;
9
+ placeholder: string;
10
+ default: string;
11
+ };
12
+ static title: {
13
+ help: string;
14
+ placeholder: string;
15
+ default: string;
16
+ required: boolean;
17
+ };
18
+ static description: {
19
+ help: string;
20
+ placeholder: string;
21
+ default: string;
22
+ };
23
+ /**
24
+ * @param {Partial<FeatureItemModel>} data
25
+ */
26
+ constructor(data?: Partial<FeatureItemModel>);
27
+ /** @type {string} Icon name */ icon: string;
28
+ /** @type {string} Feature heading */ title: string;
29
+ /** @type {string} Feature description */ description: string;
30
+ }
31
+ /**
32
+ * FeatureGridModel — OLMUI Component Model
33
+ * Grid of features with icons and descriptions.
34
+ */
35
+ export class FeatureGridModel extends Model {
36
+ static $id: string;
37
+ static items: {
38
+ help: string;
39
+ type: string;
40
+ hint: typeof FeatureItemModel;
41
+ default: never[];
42
+ };
43
+ /**
44
+ * @param {Partial<FeatureGridModel>} data
45
+ */
46
+ constructor(data?: Partial<FeatureGridModel>);
47
+ /** @type {FeatureItemModel[]} List of features */
48
+ items: FeatureItemModel[];
49
+ }
50
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * MarkdownModel — OLMUI Model-as-Schema
3
+ * Represents a rich text block powered by Markdown.
4
+ */
5
+ export class MarkdownModel extends Model {
6
+ static $id: string;
7
+ static content: {
8
+ help: string;
9
+ type: string;
10
+ default: string;
11
+ };
12
+ /**
13
+ * @param {Partial<MarkdownModel> | Record<string, any>} data Model input data.
14
+ * @param {object} [options] Extended options
15
+ */
16
+ constructor(data?: Partial<MarkdownModel> | Record<string, any>, options?: object);
17
+ /** @type {string} Markdown content string */ content: string;
18
+ }
19
+ import { Model } from '@nan0web/types';
@@ -0,0 +1,56 @@
1
+ /**
2
+ * ShellModel — OLMUI Component Model for CLI Orchestration
3
+ * Canonical CLI entry that describes available operations as a schema.
4
+ */
5
+ export class ShellModel extends Model {
6
+ static $id: string;
7
+ static command: {
8
+ help: string;
9
+ type: string;
10
+ default: null;
11
+ positional: boolean;
12
+ options: {
13
+ label: string;
14
+ value: string;
15
+ }[];
16
+ required: boolean;
17
+ };
18
+ static data: {
19
+ help: string;
20
+ type: string;
21
+ default: string;
22
+ alias: string;
23
+ };
24
+ static index: {
25
+ help: string;
26
+ type: string;
27
+ default: string;
28
+ };
29
+ static locale: {
30
+ help: string;
31
+ type: string;
32
+ default: string;
33
+ };
34
+ static port: {
35
+ help: string;
36
+ type: string;
37
+ default: string;
38
+ };
39
+ /**
40
+ * @param {object} data
41
+ * @param {object} [options] External dependencies (AppRunner, SSRServer, etc.)
42
+ */
43
+ constructor(data?: object, options?: object);
44
+ /** @type {string|null} */ command: string | null;
45
+ /** @type {string} */ data: string;
46
+ /** @type {string} */ index: string;
47
+ /** @type {string} */ locale: string;
48
+ /** @type {string} */ port: string;
49
+ run(): AsyncGenerator<import("../../core/Intent.js").AskIntent | {
50
+ type: string;
51
+ level: any;
52
+ message: any;
53
+ }, any, unknown>;
54
+ #private;
55
+ }
56
+ import { Model } from '@nan0web/types';
@@ -3,6 +3,10 @@
3
3
  * Displays tabular string data in rows and columns.
4
4
  */
5
5
  export class TableModel extends Model {
6
+ static $id: string;
7
+ static UI: {
8
+ displayingTable: string;
9
+ };
6
10
  static columns: {
7
11
  help: string;
8
12
  type: string;
@@ -2,6 +2,10 @@
2
2
  * Model-as-Schema for Toast notification.
3
3
  */
4
4
  export class ToastModel extends Model {
5
+ static $id: string;
6
+ static UI: {
7
+ toastLog: string;
8
+ };
5
9
  static variant: {
6
10
  help: string;
7
11
  default: string;
@@ -28,3 +28,6 @@ export { FooterConfigModel } from "./FooterConfigModel.js";
28
28
  export { EmptyStateModel } from "./EmptyStateModel.js";
29
29
  export { BannerModel } from "./BannerModel.js";
30
30
  export { ProfileDropdownModel } from "./ProfileDropdownModel.js";
31
+ export { MarkdownModel } from "./MarkdownModel.js";
32
+ export { ShellModel } from "./ShellModel.js";
33
+ export { FeatureGridModel, FeatureItemModel } from "./FeatureGridModel.js";
@@ -1,7 +1,13 @@
1
+ export { ModelAsApp } from "./ModelAsApp.js";
1
2
  export { SandboxModel } from "./SandboxModel.js";
3
+ export { Content } from "./Content.js";
4
+ export { Document } from "./Document.js";
2
5
  export { ShowcaseAppModel } from "./ShowcaseAppModel.js";
3
6
  export { default as Navigation } from "./Navigation.js";
4
- export { default as HeaderModel } from "./HeaderModel.js";
5
- export { default as FooterModel } from "./FooterModel.js";
6
- export { default as HeroModel } from "./HeroModel.js";
7
- export { ButtonModel, ConfirmModel, InputModel, SpinnerModel, TableModel, ToastModel, SelectModel, AutocompleteModel, TreeModel, TabsModel, AccordionModel, GalleryModel, PriceModel, PricingModel, CommentModel, TestimonialModel, StatsItemModel, StatsModel, TimelineItemModel, TimelineModel, HeaderVisibilityModel, HeaderConfigModel, FooterVisibilityModel, FooterConfigModel, EmptyStateModel, BannerModel, ProfileDropdownModel } from "./components/index.js";
7
+ export { LayoutModel } from "./LayoutModel.js";
8
+ export { HeaderModel } from "./HeaderModel.js";
9
+ export { FooterModel } from "./FooterModel.js";
10
+ export { HeroModel } from "./HeroModel.js";
11
+ export { ShellModel } from "./components/ShellModel.js";
12
+ export type ModelAsAppOptions = import("./ModelAsApp.js").ModelAsAppOptions;
13
+ export { ButtonModel, ConfirmModel, InputModel, SpinnerModel, TableModel, ToastModel, SelectModel, AutocompleteModel, TreeModel, TabsModel, AccordionModel, GalleryModel, PriceModel, FeatureGridModel, FeatureItemModel, PricingModel, CommentModel, TestimonialModel, StatsItemModel, StatsModel, TimelineItemModel, TimelineModel, HeaderVisibilityModel, HeaderConfigModel, FooterVisibilityModel, FooterConfigModel, EmptyStateModel, BannerModel, ProfileDropdownModel } from "./components/index.js";
package/types/index.d.ts CHANGED
@@ -9,8 +9,29 @@ export { default as UiForm } from "./core/Form/Form.js";
9
9
  export { default as UiMessage } from "./core/Message/Message.js";
10
10
  export { default as UiStream } from "./core/Stream.js";
11
11
  export { default as UiAdapter } from "./core/UiAdapter.js";
12
+ export * from "./core/Intent.js";
13
+ export * from "./domain/index.js";
12
14
  export { IntentErrorModel } from "./core/IntentErrorModel.js";
13
15
  export { runGenerator } from "./core/GeneratorRunner.js";
16
+ export { buildNan0SpecFromTrace } from "./testing/CrashReporter.js";
17
+ export type LogLevel = import("./core/Intent.js").LogLevel;
18
+ export type ShowLevel = import("./core/Intent.js").ShowLevel;
19
+ export type FieldSchema = import("./core/Intent.js").FieldSchema;
20
+ export type Intent = import("./core/Intent.js").Intent;
21
+ export type IntentResponse = import("./core/Intent.js").IntentResponse;
22
+ export type AskIntent = import("./core/Intent.js").AskIntent;
23
+ export type ProgressIntent = import("./core/Intent.js").ProgressIntent;
24
+ export type ProgressOptions = import("./core/Intent.js").ProgressOptions;
25
+ export type LogIntent = import("./core/Intent.js").LogIntent;
26
+ export type ShowIntent = import("./core/Intent.js").ShowIntent;
27
+ export type RenderIntent = import("./core/Intent.js").RenderIntent;
28
+ export type ResultIntent = import("./core/Intent.js").ResultIntent;
29
+ export type IntentType = import("./core/Intent.js").IntentType;
30
+ export type AskResponse = import("./core/Intent.js").AskResponse;
31
+ export type AbortResponse = import("./core/Intent.js").AbortResponse;
32
+ export type ShowData = import("./core/Intent.js").ShowData;
33
+ export type AskOptions = import("./core/InputAdapter.js").AskOptions;
34
+ export type ModelAsAppOptions = import("./domain/index.js").ModelAsAppOptions;
14
35
  import Frame from './Frame/Frame.js';
15
36
  import FrameProps from './Frame/Props.js';
16
37
  import Locale from './Locale.js';
@@ -23,4 +44,3 @@ import Component from './Component/index.js';
23
44
  import App from './App/index.js';
24
45
  export { Frame, FrameProps, Locale, StdIn, StdOut, View, RenderOptions, Model, Component, App };
25
46
  export { default as Error, CancelError } from "./core/Error/index.js";
26
- export { validateIntent, ask, progress, log, result, INTENT_TYPES, isModelSchema } from "./core/Intent.js";
@@ -0,0 +1,2 @@
1
+ export * from "./testing/SnapshotRunner.js";
2
+ export * from "./testing/verifySnapshot.js";
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Deterministic Scenario Adapter for OLMUI Testing.
3
+ *
4
+ * Drives the Model generator through a predefined script of responses,
5
+ * enabling millisecond-fast verification of complex business logic.
6
+ */
7
+ export default class ScenarioAdapter extends InputAdapter {
8
+ /**
9
+ * @param {Array<{field: string, value: any, cancelled?: boolean}>} [scenario=[]]
10
+ */
11
+ constructor(scenario?: Array<{
12
+ field: string;
13
+ value: any;
14
+ cancelled?: boolean;
15
+ }>);
16
+ scenario: {
17
+ field: string;
18
+ value: any;
19
+ cancelled?: boolean;
20
+ }[];
21
+ intents: any[];
22
+ console: {
23
+ info: () => void;
24
+ warn: () => void;
25
+ error: () => void;
26
+ debug: () => void;
27
+ log: () => void;
28
+ };
29
+ /**
30
+ * @param {import('../core/Intent.js').AskIntent} intent
31
+ * @returns {Promise<import('../core/Intent.js').AskResponse>}
32
+ */
33
+ askIntent(intent: import("../core/Intent.js").AskIntent): Promise<import("../core/Intent.js").AskResponse>;
34
+ /** @param {import('../core/Intent.js').ProgressIntent} intent */
35
+ progressIntent(intent: import("../core/Intent.js").ProgressIntent): Promise<void>;
36
+ /** @param {import('../core/Intent.js').ShowIntent} intent */
37
+ showIntent(intent: import("../core/Intent.js").ShowIntent): Promise<void>;
38
+ /** @param {import('../core/Intent.js').RenderIntent} intent */
39
+ renderIntent(intent: import("../core/Intent.js").RenderIntent): Promise<void>;
40
+ /** @param {import('../core/Intent.js').ResultIntent} intent */
41
+ resultIntent(intent: import("../core/Intent.js").ResultIntent): Promise<void>;
42
+ }
43
+ import InputAdapter from '../core/InputAdapter.js';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Deterministic Scenario Test Runner.
3
+ * Orchestrates a model against a predefined scenario, mocking I/O immediately.
4
+ */
5
+ export class ScenarioTest {
6
+ /**
7
+ * Runs an application model with a specific set of answers.
8
+ *
9
+ * @param {typeof import('../domain/ModelAsApp.js').ModelAsApp} AppClass
10
+ * @param {Array<{field: string, value: any, cancelled?: boolean}>} scenario
11
+ * @param {any} [appData={}]
12
+ * @returns {Promise<{ value: any, intents: any[], error?: Error | undefined }>}
13
+ */
14
+ static run(AppClass: typeof import("../domain/ModelAsApp.js").ModelAsApp, scenario?: Array<{
15
+ field: string;
16
+ value: any;
17
+ cancelled?: boolean;
18
+ }>, appData?: any): Promise<{
19
+ value: any;
20
+ intents: any[];
21
+ error?: Error | undefined;
22
+ }>;
23
+ }
24
+ export default ScenarioTest;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file CrashReporter.js — Nan0Spec serialization.
3
+ */
4
+ /**
5
+ * Transforms an execution trace from GeneratorRunner into a strict Nan0Spec model
6
+ * ready to be saved as a .nan0 file for Crash Reporting and Integration Tests.
7
+ *
8
+ * @param {string} appName The name of the root model/app (e.g. 'ShoppingCartApp').
9
+ * @param {object} appData The initial data provided to the app.
10
+ * @param {import('../core/Intent.js').Intent[]} trace The array of intents executed.
11
+ * @returns {Array<object>} The serializable Nan0Spec array.
12
+ */
13
+ export function buildNan0SpecFromTrace(appName: string, appData: object, trace: import("../core/Intent.js").Intent[]): Array<object>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Legacy bridge for SnapshotRunner.
3
+ * @deprecated Use SnapshotRunner model from domain/app
4
+ */
5
+ export class SnapshotRunner {
6
+ static generateAndAudit(options: any): Promise<import("../core/Intent.js").ResultIntent>;
7
+ }