@nan0web/ui 1.12.2 → 3.1.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 (160) hide show
  1. package/README.md +18 -355
  2. package/package.json +36 -22
  3. package/src/Component/index.js +1 -5
  4. package/src/Model/Element.js +183 -0
  5. package/src/Model/index.js +2 -2
  6. package/src/Theme/AppTheme.js +19 -0
  7. package/src/Theme/CustomTheme.js +32 -0
  8. package/src/Theme/DarkLightTheme.js +34 -0
  9. package/src/Theme/Theme.js +25 -0
  10. package/src/Theme/atoms/Avatar.js +20 -0
  11. package/src/Theme/atoms/Badge.js +28 -0
  12. package/src/Theme/atoms/Button.js +88 -0
  13. package/src/Theme/atoms/Checkbox.js +26 -0
  14. package/src/Theme/atoms/Input.js +28 -0
  15. package/src/Theme/atoms/Radio.js +26 -0
  16. package/src/Theme/atoms/Select.js +16 -0
  17. package/src/Theme/atoms/TextArea.js +17 -0
  18. package/src/Theme/atoms/Typography.js +26 -0
  19. package/src/Theme/atoms/index.js +11 -0
  20. package/src/Theme/createTheme.js +22 -0
  21. package/src/Theme/index.js +20 -0
  22. package/src/Theme/molecules/Card.js +24 -0
  23. package/src/Theme/molecules/index.js +3 -0
  24. package/src/Theme/organisms/Modal.js +24 -0
  25. package/src/Theme/organisms/index.js +3 -0
  26. package/src/Theme/presets/HighContrastTheme.js +65 -0
  27. package/src/Theme/presets/NightTheme.js +66 -0
  28. package/src/Theme/presets/index.js +4 -0
  29. package/src/Theme/tokens.js +115 -0
  30. package/src/core/InputAdapter.js +1 -2
  31. package/src/core/Intent.js +22 -8
  32. package/src/core/Message/Message.js +3 -0
  33. package/src/core/OutputAdapter.js +9 -13
  34. package/src/core/index.js +7 -4
  35. package/src/core/resolvePositionalArgs.js +51 -0
  36. package/src/domain/Content.js +5 -5
  37. package/src/domain/Document.js +1 -1
  38. package/src/domain/HeroModel.js +1 -1
  39. package/src/domain/ModelAsApp.js +310 -20
  40. package/src/domain/ModelAsApp.story.js +117 -0
  41. package/src/domain/app/GalleryCommand.js +9 -8
  42. package/src/domain/app/{GalleryRenderIntent.js → GalleryRenderCommand.js} +20 -20
  43. package/src/domain/app/IntentAuditor.js +53 -0
  44. package/src/domain/app/JsIntentAuditor.js +145 -0
  45. package/src/domain/app/PyIntentAuditor.js +144 -0
  46. package/src/domain/app/SnapshotAuditor.js +82 -86
  47. package/src/domain/app/SnapshotRunner.js +1 -1
  48. package/src/domain/app/UIApp.js +12 -21
  49. package/src/domain/components/ShellModel.js +2 -2
  50. package/src/index.js +38 -10
  51. package/src/inspect.js +4 -0
  52. package/src/testing/SnapshotRunner.js +2 -1
  53. package/src/utils/format.js +21 -0
  54. package/src/utils/processI18n.js +27 -0
  55. package/src/utils/resolveContext.js +79 -0
  56. package/types/Component/index.d.ts +1 -5
  57. package/types/Model/Element.d.ts +87 -0
  58. package/types/Model/index.d.ts +2 -2
  59. package/types/Theme/AppTheme.d.ts +14 -0
  60. package/types/Theme/CustomTheme.d.ts +21 -0
  61. package/types/Theme/DarkLightTheme.d.ts +16 -0
  62. package/types/Theme/Theme.d.ts +18 -0
  63. package/types/Theme/atoms/Avatar.d.ts +14 -0
  64. package/types/Theme/atoms/Badge.d.ts +22 -0
  65. package/types/Theme/atoms/Button.d.ts +144 -0
  66. package/types/Theme/atoms/Checkbox.d.ts +20 -0
  67. package/types/Theme/atoms/Input.d.ts +22 -0
  68. package/types/Theme/atoms/Radio.d.ts +20 -0
  69. package/types/Theme/atoms/Select.d.ts +15 -0
  70. package/types/Theme/atoms/TextArea.d.ts +17 -0
  71. package/types/Theme/atoms/Typography.d.ts +47 -0
  72. package/types/Theme/atoms/index.d.ts +10 -0
  73. package/types/Theme/createTheme.d.ts +7 -0
  74. package/types/Theme/index.d.ts +10 -0
  75. package/types/Theme/molecules/Card.d.ts +18 -0
  76. package/types/Theme/molecules/index.d.ts +2 -0
  77. package/types/Theme/organisms/Modal.d.ts +18 -0
  78. package/types/Theme/organisms/index.d.ts +2 -0
  79. package/types/Theme/presets/HighContrastTheme.d.ts +2 -0
  80. package/types/Theme/presets/NightTheme.d.ts +2 -0
  81. package/types/Theme/presets/index.d.ts +3 -0
  82. package/types/Theme/tokens.d.ts +119 -0
  83. package/types/core/Intent.d.ts +10 -7
  84. package/types/core/Message/Message.d.ts +3 -0
  85. package/types/core/OutputAdapter.d.ts +2 -4
  86. package/types/core/index.d.ts +5 -2
  87. package/types/core/resolvePositionalArgs.d.ts +24 -0
  88. package/types/docs/README.md.d.ts +1 -0
  89. package/types/domain/Content.d.ts +2 -2
  90. package/types/domain/Document.d.ts +4 -3
  91. package/types/domain/FooterModel.d.ts +2 -1
  92. package/types/domain/HeroModel.d.ts +2 -2
  93. package/types/domain/ModelAsApp.d.ts +49 -5
  94. package/types/domain/ModelAsApp.story.d.ts +1 -0
  95. package/types/domain/app/GalleryCommand.d.ts +6 -37
  96. package/types/domain/app/GalleryRenderCommand.d.ts +27 -0
  97. package/types/domain/app/IntentAuditor.d.ts +23 -0
  98. package/types/domain/app/JsIntentAuditor.d.ts +22 -0
  99. package/types/domain/app/PyIntentAuditor.d.ts +22 -0
  100. package/types/domain/app/SnapshotAuditor.d.ts +34 -25
  101. package/types/domain/app/SnapshotRunner.d.ts +2 -2
  102. package/types/domain/app/UIApp.d.ts +14 -11
  103. package/types/domain/components/ShellModel.d.ts +1 -5
  104. package/types/index.d.ts +10 -10
  105. package/types/inspect.d.ts +4 -0
  106. package/types/testing/verifySnapshot.d.ts +1 -1
  107. package/types/utils/format.d.ts +5 -0
  108. package/types/utils/processI18n.d.ts +8 -0
  109. package/types/utils/resolveContext.d.ts +21 -0
  110. package/src/App/Command/DepsCommand.js +0 -24
  111. package/src/App/Core/CoreApp.js +0 -125
  112. package/src/App/Core/UI.js +0 -63
  113. package/src/App/Core/Widget.js +0 -61
  114. package/src/App/Core/index.js +0 -11
  115. package/src/App/Scenario.js +0 -45
  116. package/src/App/User/Command/Message.js +0 -3
  117. package/src/App/User/Command/index.js +0 -5
  118. package/src/App/User/UserApp.js +0 -85
  119. package/src/App/User/UserUI.js +0 -20
  120. package/src/App/User/index.js +0 -9
  121. package/src/App/index.js +0 -14
  122. package/src/Component/Process/Input.js +0 -63
  123. package/src/Component/Process/Process.js +0 -24
  124. package/src/Component/Process/index.js +0 -5
  125. package/src/Component/Welcome/Input.js +0 -48
  126. package/src/Component/Welcome/Welcome.js +0 -22
  127. package/src/Component/Welcome/index.js +0 -5
  128. package/src/Frame/Frame.js +0 -608
  129. package/src/Frame/Props.js +0 -96
  130. package/src/StdIn.js +0 -100
  131. package/src/StdOut.js +0 -95
  132. package/src/View/RenderOptions.js +0 -48
  133. package/src/View/View.js +0 -306
  134. package/src/core/Message/index.js +0 -6
  135. package/types/App/Command/DepsCommand.d.ts +0 -14
  136. package/types/App/Core/CoreApp.d.ts +0 -70
  137. package/types/App/Core/UI.d.ts +0 -38
  138. package/types/App/Core/Widget.d.ts +0 -39
  139. package/types/App/Core/index.d.ts +0 -10
  140. package/types/App/Scenario.d.ts +0 -26
  141. package/types/App/User/Command/Message.d.ts +0 -2
  142. package/types/App/User/Command/index.d.ts +0 -3
  143. package/types/App/User/UserApp.d.ts +0 -41
  144. package/types/App/User/UserUI.d.ts +0 -9
  145. package/types/App/User/index.d.ts +0 -8
  146. package/types/App/index.d.ts +0 -12
  147. package/types/Component/Process/Input.d.ts +0 -48
  148. package/types/Component/Process/Process.d.ts +0 -13
  149. package/types/Component/Process/index.d.ts +0 -4
  150. package/types/Component/Welcome/Input.d.ts +0 -34
  151. package/types/Component/Welcome/Welcome.d.ts +0 -13
  152. package/types/Component/Welcome/index.d.ts +0 -4
  153. package/types/Frame/Frame.d.ts +0 -186
  154. package/types/Frame/Props.d.ts +0 -77
  155. package/types/StdIn.d.ts +0 -62
  156. package/types/StdOut.d.ts +0 -52
  157. package/types/View/RenderOptions.d.ts +0 -29
  158. package/types/View/View.d.ts +0 -124
  159. package/types/core/Message/index.d.ts +0 -4
  160. package/types/domain/app/GalleryRenderIntent.d.ts +0 -31
@@ -0,0 +1,17 @@
1
+ declare const _default: {
2
+ height: string;
3
+ borderRadius: string;
4
+ borderWidth: string;
5
+ borderColor: string;
6
+ fontSize: string;
7
+ paddingX: string;
8
+ paddingY: string;
9
+ fontFamily: string;
10
+ };
11
+ export default _default;
12
+ /**
13
+ * Theme definition for TextArea atom.
14
+ */
15
+ export type TextAreaTheme = {
16
+ height: string;
17
+ };
@@ -0,0 +1,47 @@
1
+ declare const _default: {
2
+ variants: {
3
+ h1: {
4
+ fontSize: string;
5
+ fontWeight: string;
6
+ };
7
+ h2: {
8
+ fontSize: string;
9
+ fontWeight: string;
10
+ };
11
+ h3: {
12
+ fontSize: string;
13
+ fontWeight: string;
14
+ };
15
+ h4: {
16
+ fontSize: string;
17
+ fontWeight: string;
18
+ };
19
+ h5: {
20
+ fontSize: string;
21
+ fontWeight: string;
22
+ };
23
+ h6: {
24
+ fontSize: string;
25
+ fontWeight: string;
26
+ };
27
+ body: {
28
+ fontSize: string;
29
+ fontWeight: string;
30
+ };
31
+ small: {
32
+ fontSize: string;
33
+ fontWeight: string;
34
+ };
35
+ caption: {
36
+ fontSize: string;
37
+ fontWeight: string;
38
+ };
39
+ };
40
+ };
41
+ export default _default;
42
+ /**
43
+ * Theme definition for Typography atom.
44
+ */
45
+ export type TypographyTheme = {
46
+ variants: any;
47
+ };
@@ -0,0 +1,10 @@
1
+ import Avatar from './Avatar.js';
2
+ import Badge from './Badge.js';
3
+ import Button from './Button.js';
4
+ import Checkbox from './Checkbox.js';
5
+ import Input from './Input.js';
6
+ import Radio from './Radio.js';
7
+ import Select from './Select.js';
8
+ import TextArea from './TextArea.js';
9
+ import Typography from './Typography.js';
10
+ export { Avatar, Badge, Button, Checkbox, Input, Radio, Select, TextArea, Typography };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Creates a theme instance with merged configuration.
3
+ *
4
+ * @param {Partial<import('./Theme.js').ThemeConfig>} overrides
5
+ * @returns {import('./Theme.js').ThemeConfig}
6
+ */
7
+ export function createTheme(overrides?: Partial<import("./Theme.js").ThemeConfig>): import("./Theme.js").ThemeConfig;
@@ -0,0 +1,10 @@
1
+ export default Theme;
2
+ import Theme from './Theme.js';
3
+ import CustomTheme from './CustomTheme.js';
4
+ import { getUserTheme } from './CustomTheme.js';
5
+ import AppTheme from './AppTheme.js';
6
+ import DarkLightTheme from './DarkLightTheme.js';
7
+ import HighContrastTheme from './presets/HighContrastTheme.js';
8
+ import NightTheme from './presets/NightTheme.js';
9
+ import { createTheme } from './createTheme.js';
10
+ export { Theme, CustomTheme, getUserTheme, AppTheme, DarkLightTheme, HighContrastTheme, NightTheme, createTheme };
@@ -0,0 +1,18 @@
1
+ declare const _default: {
2
+ borderRadius: string;
3
+ boxShadow: string;
4
+ padding: string;
5
+ backgroundColor: string;
6
+ borderColor: string;
7
+ };
8
+ export default _default;
9
+ /**
10
+ * Theme definition for Card molecule.
11
+ */
12
+ export type CardTheme = {
13
+ borderRadius: string;
14
+ boxShadow: string;
15
+ padding: string;
16
+ backgroundColor: string;
17
+ borderColor: string;
18
+ };
@@ -0,0 +1,2 @@
1
+ export { Card };
2
+ import Card from './Card.js';
@@ -0,0 +1,18 @@
1
+ declare const _default: {
2
+ overlayBackground: string;
3
+ borderRadius: string;
4
+ boxShadow: string;
5
+ padding: string;
6
+ backgroundColor: string;
7
+ };
8
+ export default _default;
9
+ /**
10
+ * Theme definition for Modal organism.
11
+ */
12
+ export type ModalTheme = {
13
+ overlayBackground: string;
14
+ borderRadius: string;
15
+ boxShadow: string;
16
+ padding: string;
17
+ backgroundColor: string;
18
+ };
@@ -0,0 +1,2 @@
1
+ export { Modal };
2
+ import Modal from './Modal.js';
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../Theme.js").ThemeConfig;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../Theme.js").ThemeConfig;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import HighContrastTheme from './HighContrastTheme.js';
2
+ import NightTheme from './NightTheme.js';
3
+ export { HighContrastTheme, NightTheme };
@@ -0,0 +1,119 @@
1
+ export namespace tokens {
2
+ export namespace space {
3
+ let xs: string;
4
+ let sm: string;
5
+ let md: string;
6
+ let lg: string;
7
+ let xl: string;
8
+ }
9
+ export namespace radius {
10
+ export let none: string;
11
+ let sm_1: string;
12
+ export { sm_1 as sm };
13
+ let md_1: string;
14
+ export { md_1 as md };
15
+ let lg_1: string;
16
+ export { lg_1 as lg };
17
+ export let full: string;
18
+ }
19
+ export namespace border {
20
+ namespace width {
21
+ let sm_2: string;
22
+ export { sm_2 as sm };
23
+ let md_2: string;
24
+ export { md_2 as md };
25
+ }
26
+ namespace color {
27
+ let _default: string;
28
+ export { _default as default };
29
+ export let muted: string;
30
+ export let error: string;
31
+ }
32
+ }
33
+ export namespace color_1 {
34
+ export let text: string;
35
+ export let background: string;
36
+ export let primary: string;
37
+ export let success: string;
38
+ export let warning: string;
39
+ let error_1: string;
40
+ export { error_1 as error };
41
+ }
42
+ export { color_1 as color };
43
+ export namespace font {
44
+ let family: string;
45
+ namespace size {
46
+ let xs_1: string;
47
+ export { xs_1 as xs };
48
+ let sm_3: string;
49
+ export { sm_3 as sm };
50
+ export let base: string;
51
+ let lg_2: string;
52
+ export { lg_2 as lg };
53
+ let xl_1: string;
54
+ export { xl_1 as xl };
55
+ }
56
+ namespace weight {
57
+ let normal: string;
58
+ let medium: string;
59
+ let bold: string;
60
+ }
61
+ }
62
+ export namespace shadow {
63
+ let sm_4: string;
64
+ export { sm_4 as sm };
65
+ let md_3: string;
66
+ export { md_3 as md };
67
+ let lg_3: string;
68
+ export { lg_3 as lg };
69
+ }
70
+ export namespace breakpoint {
71
+ let xs_2: string;
72
+ export { xs_2 as xs };
73
+ let sm_5: string;
74
+ export { sm_5 as sm };
75
+ let md_4: string;
76
+ export { md_4 as md };
77
+ let lg_4: string;
78
+ export { lg_4 as lg };
79
+ let xl_2: string;
80
+ export { xl_2 as xl };
81
+ export let xxl: string;
82
+ }
83
+ export namespace container {
84
+ let sm_6: string;
85
+ export { sm_6 as sm };
86
+ let md_5: string;
87
+ export { md_5 as md };
88
+ let lg_5: string;
89
+ export { lg_5 as lg };
90
+ let xl_3: string;
91
+ export { xl_3 as xl };
92
+ let xxl_1: string;
93
+ export { xxl_1 as xxl };
94
+ }
95
+ export namespace zIndex {
96
+ let dropdown: number;
97
+ let sticky: number;
98
+ let fixed: number;
99
+ let modalBackdrop: number;
100
+ let modal: number;
101
+ let popover: number;
102
+ let tooltip: number;
103
+ }
104
+ export let opacity: {
105
+ 0: string;
106
+ 10: string;
107
+ 25: string;
108
+ 50: string;
109
+ 75: string;
110
+ 90: string;
111
+ 100: string;
112
+ };
113
+ export namespace transition {
114
+ export let fast: string;
115
+ let medium_1: string;
116
+ export { medium_1 as medium };
117
+ export let slow: string;
118
+ }
119
+ }
@@ -44,11 +44,14 @@ export function ask(field: string, schema: object | Function): AskIntent;
44
44
  * @returns {ProgressIntent}
45
45
  */
46
46
  export function progress(message: string, value?: number, optionsOrTotalOrId?: ProgressOptions | number | string, id?: string): ProgressIntent;
47
- export function log(level: any, message: any, data?: {}): {
48
- type: string;
49
- level: any;
50
- message: any;
51
- };
47
+ /**
48
+ * Lgs a message if level is greater or equal the current view level.
49
+ * @param {LogLevel} level
50
+ * @param {string} message
51
+ * @param {object} [data={}]
52
+ * @returns {LogIntent}
53
+ */
54
+ export function log(level: LogLevel, message: string, data?: object): LogIntent;
52
55
  /**
53
56
  * Create a render intent.
54
57
  * @param {string} component - Component name (e.g. 'App.Layout.Header').
@@ -115,7 +118,7 @@ export function agent(task: string, context?: AgentContext): AgentIntent;
115
118
  /**
116
119
  * @typedef {'info' | 'warn' | 'error' | 'success'} ShowLevel
117
120
  */
118
- /** @typedef {ShowLevel} LogLevel */
121
+ /** @typedef {ShowLevel | 'debug'} LogLevel */
119
122
  /**
120
123
  * Model emits a show message. No response expected.
121
124
  * Message MUST come from the Model (i18n static field value).
@@ -333,7 +336,7 @@ export type ProgressIntent = {
333
336
  options?: ProgressOptions | undefined;
334
337
  };
335
338
  export type ShowLevel = "info" | "warn" | "error" | "success";
336
- export type LogLevel = ShowLevel;
339
+ export type LogLevel = ShowLevel | "debug";
337
340
  /**
338
341
  * Model emits a show message. No response expected.
339
342
  * Message MUST come from the Model (i18n static field value).
@@ -14,6 +14,9 @@
14
14
  *
15
15
  * @class UiMessage
16
16
  * @extends Message
17
+ * @property {Record<string, any>} head - Message head.
18
+ * @property {boolean} isValid - True if message is valid.
19
+ * @property {Date} time - Creation timestamp.
17
20
  *
18
21
  * @example
19
22
  * class UserLoginMessage extends UiMessage {
@@ -9,10 +9,10 @@ declare class OutputAdapter extends Event {
9
9
  /**
10
10
  * Renders a message to the user.
11
11
  *
12
- * @param {OutputMessage|FormMessage} message - Message to render.
12
+ * @param {object} message - Message to render.
13
13
  * @throws {Error} If not overridden by a subclass.
14
14
  */
15
- render(message: OutputMessage | FormMessage): void;
15
+ render(message: object): void;
16
16
  /**
17
17
  * Shows progress of a long‑running operation.
18
18
  *
@@ -29,5 +29,3 @@ declare class OutputAdapter extends Event {
29
29
  stop(): void;
30
30
  }
31
31
  import Event from '@nan0web/event/oop';
32
- import OutputMessage from './Message/OutputMessage.js';
33
- import FormMessage from './Form/Message.js';
@@ -1,14 +1,17 @@
1
1
  export { default as InputAdapter } from "./InputAdapter.js";
2
2
  export { default as OutputAdapter } from "./OutputAdapter.js";
3
+ export { default as FormInput } from "./Form/Input.js";
3
4
  export { default as UiMessage } from "./Message/Message.js";
4
5
  export { default as FormMessage } from "./Form/Message.js";
5
- export { default as FormInput } from "./Form/Input.js";
6
- export { default as UiAdapter } from "./UiAdapter.js";
6
+ export { default as OutputMessage } from "./Message/OutputMessage.js";
7
7
  export { IntentErrorModel } from "./IntentErrorModel.js";
8
8
  export { runGenerator } from "./GeneratorRunner.js";
9
9
  export { MaskHandler } from "./MaskHandler.js";
10
10
  export { LayoutModel } from "../domain/LayoutModel.js";
11
11
  export type Intent = import("./Intent.js").Intent;
12
+ export type ShowLevel = import("./Intent.js").ShowLevel;
13
+ export type ShowIntent = import("./Intent.js").ShowIntent;
14
+ export type ShowData = import("./Intent.js").ShowData;
12
15
  export type AskResponse = import("./Intent.js").AskResponse;
13
16
  export type AskOptions = import("./InputAdapter.js").AskOptions;
14
17
  import UIStream from './Stream.js';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Resolves positional CLI arguments into named model fields.
3
+ *
4
+ * Scans a Model class for `static` field descriptors with `positional: true`.
5
+ * The order of positional fields follows the declaration order of static properties
6
+ * (guaranteed by JavaScript spec for non-integer keys).
7
+ *
8
+ * @example
9
+ * class MyModel {
10
+ * static source = { help: 'Source path', default: '.', positional: true }
11
+ * static target = { help: 'Target path', default: 'out', positional: true }
12
+ * static quiet = { help: 'Quiet mode', default: false, type: 'boolean' }
13
+ * }
14
+ *
15
+ * const data = resolvePositionalArgs(MyModel, ['src/', 'dist/'])
16
+ * // → { source: 'src/', target: 'dist/' }
17
+ *
18
+ * @param {typeof Model} ModelClass - The Model class with static field descriptors.
19
+ * @param {string[]} args - Positional arguments from the CLI (e.g., process.argv positionals).
20
+ * @param {Object} [existing={}] - Existing named options (take priority over positionals).
21
+ * @returns {Object} Merged data object with positional args resolved to named fields.
22
+ */
23
+ export function resolvePositionalArgs(ModelClass: typeof Model, args?: string[], existing?: any): any;
24
+ import { Model } from '@nan0web/types';
@@ -0,0 +1 @@
1
+ export {};
@@ -173,9 +173,9 @@ export class Content extends Model {
173
173
  };
174
174
  /**
175
175
  * @param {ContentData | string} [data={}]
176
- * @param {import('@nan0web/types').ModelOptions} [options={}]
176
+ * @param {Partial<import('@nan0web/types').ModelOptions>} [options={}]
177
177
  */
178
- constructor(data?: ContentData | string, options?: import("@nan0web/types").ModelOptions);
178
+ constructor(data?: ContentData | string, options?: Partial<import("@nan0web/types").ModelOptions>);
179
179
  /** @type {string|undefined} Content */ content: string | undefined;
180
180
  /** @type {Array<Content>|undefined} Children */ children: Array<Content> | undefined;
181
181
  }
@@ -20,15 +20,15 @@ export class Document extends Model {
20
20
  };
21
21
  static langs: {
22
22
  type: string;
23
- model: any;
23
+ model: typeof Language;
24
24
  help: string;
25
25
  };
26
26
  /**
27
27
  *
28
28
  * @param {Partial<Document>} [data]
29
- * @param {import('@nan0web/types').ModelOptions} [options]
29
+ * @param {Partial<import('@nan0web/types').ModelOptions>} [options]
30
30
  */
31
- constructor(data?: Partial<Document>, options?: import("@nan0web/types").ModelOptions);
31
+ constructor(data?: Partial<Document>, options?: Partial<import("@nan0web/types").ModelOptions>);
32
32
  /** @type {string} Title */ title: string;
33
33
  /** @type {Array<Content>} Content */ content: Array<Content>;
34
34
  /** @type {Array<Content>} Layout configuration */ $content: Array<Content>;
@@ -38,3 +38,4 @@ export class Document extends Model {
38
38
  import { Model } from '@nan0web/types';
39
39
  import { Content } from './Content.js';
40
40
  import Navigation from './Navigation.js';
41
+ import { Language } from '@nan0web/i18n';
@@ -38,7 +38,7 @@ export class FooterModel extends Model {
38
38
  static langs: {
39
39
  help: string;
40
40
  type: string;
41
- hint: any;
41
+ hint: typeof Language;
42
42
  default: never[];
43
43
  };
44
44
  /**
@@ -60,3 +60,4 @@ export class FooterModel extends Model {
60
60
  }
61
61
  import { Model } from '@nan0web/types';
62
62
  import Navigation from './Navigation.js';
63
+ import { Language } from '@nan0web/i18n';
@@ -32,9 +32,9 @@ export class HeroModel extends Model {
32
32
  };
33
33
  /**
34
34
  * @param {Partial<HeroModel | Record<string, any>>} [data={}]
35
- * @param {import('@nan0web/types').ModelOptions} [options={}]
35
+ * @param {Partial<import('@nan0web/types').ModelOptions>} [options={}]
36
36
  */
37
- constructor(data?: Partial<HeroModel | Record<string, any>>, options?: import("@nan0web/types").ModelOptions);
37
+ constructor(data?: Partial<HeroModel | Record<string, any>>, options?: Partial<import("@nan0web/types").ModelOptions>);
38
38
  /** @type {string} Top small badge text ior icon */ badge: string;
39
39
  /** @type {string} Hero heading */ title: string;
40
40
  /** @type {string} Hero secondary text */ subtitle: string;
@@ -1,23 +1,67 @@
1
- /** @typedef {import('@nan0web/types').ModelOptions & { adapter: InputAdapter }} ModelAsAppOptions */
1
+ /**
2
+ * @typedef {Object} AppOptions
3
+ * @property {InputAdapter} adapter
4
+ * @property {string} parentPath
5
+ * @property {boolean} _isExplicit
6
+ */
7
+ /** @typedef {import('@nan0web/types').ModelOptions & AppOptions} ModelAsAppOptions */
2
8
  /**
3
9
  * The model with a run generator.
10
+ * @property {boolean} help Show help
4
11
  */
5
12
  export class ModelAsApp extends Model {
13
+ static help: {
14
+ help: string;
15
+ default: boolean;
16
+ };
17
+ /**
18
+ * Execute the model programmatically without a UI adapter.
19
+ * @param {any} [data]
20
+ * @param {Partial<ModelAsAppOptions>} [options]
21
+ * @returns {Promise<any>}
22
+ */
23
+ static execute(data?: any, options?: Partial<ModelAsAppOptions>): Promise<any>;
6
24
  /**
7
25
  * @param {Partial<ModelAsApp> | Record<string, any>} [data={}]
8
26
  * @param {Partial<ModelAsAppOptions>} [options={}]
9
27
  */
10
28
  constructor(data?: Partial<ModelAsApp> | Record<string, any>, options?: Partial<ModelAsAppOptions>);
11
- /** @returns {ModelAsAppOptions} */
12
- get _(): ModelAsAppOptions;
29
+ /** @type {boolean} Show help */ help: boolean;
30
+ _: {
31
+ adapter: InputAdapter;
32
+ parentPath: string;
33
+ _isExplicit: boolean;
34
+ db: import("@nan0web/db").default | null | undefined;
35
+ plugins: Record<string, any>;
36
+ t: import("../../../types/types/utils/TFunction.js").TFunction;
37
+ };
38
+ /**
39
+ * Instantiates a subcommand if the value matches one of the options.
40
+ * @param {string} key - Field name.
41
+ * @param {any} val - Current value (string, class, or instance).
42
+ * @param {any} [data={}] - Data to pass to the new instance.
43
+ * @returns {any} Instantiated subcommand or original value.
44
+ */
45
+ _instantiateSubCommand(key: string, val: any, data?: any): any;
46
+ /**
47
+ * Generate help text for the model
48
+ * @param {string} [parentPath]
49
+ * @returns {string}
50
+ */
51
+ generateHelp(parentPath?: string): string;
13
52
  /**
53
+ * Default execution generator.
54
+ * Automatically delegates to the first instantiated subcommand field.
55
+ *
14
56
  * @returns {AsyncGenerator<import('@nan0web/ui').Intent, import('@nan0web/ui').ResultIntent, any>}
15
57
  */
16
58
  run(): AsyncGenerator<import("@nan0web/ui").Intent, import("@nan0web/ui").ResultIntent, any>;
17
- #private;
18
59
  }
19
- export type ModelAsAppOptions = import("@nan0web/types").ModelOptions & {
60
+ export type AppOptions = {
20
61
  adapter: InputAdapter;
62
+ parentPath: string;
63
+ _isExplicit: boolean;
21
64
  };
65
+ export type ModelAsAppOptions = import("@nan0web/types").ModelOptions & AppOptions;
22
66
  import { Model } from '@nan0web/types';
23
67
  import { InputAdapter } from '../core/InputAdapter.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -6,50 +6,19 @@ export class GalleryCommand extends ModelAsApp {
6
6
  static action: {
7
7
  type: string;
8
8
  help: string;
9
- options: (typeof SnapshotAuditor | typeof GalleryRenderIntent)[];
10
- default: string;
9
+ options: (typeof SnapshotAuditor | typeof GalleryRenderCommand)[];
10
+ default: typeof SnapshotAuditor;
11
11
  positional: boolean;
12
12
  };
13
13
  /**
14
14
  * @param {Partial<GalleryCommand> | Record<string, any>} [data={}]
15
- * @param {import('@nan0web/types').ModelOptions} [options={}]
15
+ * @param {Partial<import('@nan0web/types').ModelOptions>} [options={}]
16
16
  */
17
- constructor(data?: Partial<GalleryCommand> | Record<string, any>, options?: import("@nan0web/types").ModelOptions);
18
- /** @type {string} */ action: string;
17
+ constructor(data?: Partial<GalleryCommand> | Record<string, any>, options?: Partial<import("@nan0web/types").ModelOptions>);
18
+ /** @type {typeof SnapshotAuditor | typeof GalleryRenderCommand} */ action: typeof SnapshotAuditor | typeof GalleryRenderCommand;
19
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
20
  }
52
21
  export default GalleryCommand;
53
22
  import { ModelAsApp } from '../ModelAsApp.js';
54
23
  import SnapshotAuditor from './SnapshotAuditor.js';
55
- import GalleryRenderIntent from './GalleryRenderIntent.js';
24
+ import GalleryRenderCommand from './GalleryRenderCommand.js';
@@ -0,0 +1,27 @@
1
+ export class GalleryRenderCommand extends ModelAsApp {
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
+ * @param {Partial<GalleryRenderCommand> | Record<string, any>} [data={}]
20
+ * @param {Partial<import('@nan0web/types').ModelOptions>} [options={}]
21
+ */
22
+ constructor(data?: Partial<GalleryRenderCommand> | Record<string, any>, options?: Partial<import("@nan0web/types").ModelOptions>);
23
+ /** @type {string} */ dataDir: string;
24
+ /** @type {string} */ dir: string;
25
+ }
26
+ export default GalleryRenderCommand;
27
+ import { ModelAsApp } from '../index.js';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * IntentAuditor — Base model for OLMUI Intent hygiene audits.
3
+ * Polymorphically delegates execution to JS or Python subclasses.
4
+ */
5
+ export class IntentAuditor extends AuditorModel {
6
+ static UI: {
7
+ title: string;
8
+ description: string;
9
+ icon: string;
10
+ starting: string;
11
+ auditPassed: string;
12
+ auditFailed: string;
13
+ doneSuccess: string;
14
+ doneErrors: string;
15
+ errorDb: string;
16
+ errorConsoleLeak: string;
17
+ errorProcessLeak: string;
18
+ errorPrintLeak: string;
19
+ errorSysWriteLeak: string;
20
+ };
21
+ }
22
+ export default IntentAuditor;
23
+ import { AuditorModel } from '@nan0web/inspect/domain/AuditorModel';