@allternit/ix 0.1.0 → 0.1.1
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/README.md +6 -6
- package/dist/adapters/json-render.d.ts +5 -5
- package/dist/adapters/json-render.js +12 -12
- package/dist/collab/visual-editor.d.ts +1 -1
- package/dist/collab/visual-editor.js +4 -4
- package/dist/collab/visual-editor.js.map +1 -1
- package/dist/collab/yjs-adapter.d.ts +1 -1
- package/dist/collab/yjs-adapter.js +2 -2
- package/dist/collab/yjs-adapter.js.map +1 -1
- package/dist/collab/yjs-client.js +1 -1
- package/dist/collab/yjs-client.js.map +1 -1
- package/dist/collab/yjs-types.js +1 -1
- package/dist/collab/yjs-types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/pipeline/llm-to-ix.d.ts +5 -5
- package/dist/pipeline/llm-to-ix.d.ts.map +1 -1
- package/dist/pipeline/llm-to-ix.js +6 -6
- package/dist/react/renderer.d.ts +2 -2
- package/dist/react/renderer.js +3 -3
- package/dist/react/renderer.js.map +1 -1
- package/dist/renderer/renderer.d.ts +1 -1
- package/dist/renderer/renderer.js +1 -1
- package/dist/runtime/capsule-runtime.d.ts +1 -1
- package/dist/runtime/capsule-runtime.js +1 -1
- package/dist/sdk/api.d.ts +3 -3
- package/dist/sdk/api.js +3 -3
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +2 -2
- package/dist/sdk/react.d.ts +2 -2
- package/dist/sdk/react.js +2 -2
- package/dist/state/index.d.ts +1 -1
- package/dist/state/index.js +1 -1
- package/dist/state/store.d.ts +1 -1
- package/dist/state/store.js +3 -3
- package/dist/state/store.js.map +1 -1
- package/dist/svelte/index.d.ts +1 -1
- package/dist/svelte/index.js +1 -1
- package/dist/svelte/renderer.d.ts +3 -3
- package/dist/svelte/renderer.js +4 -4
- package/dist/svelte/renderer.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/vue/renderer.d.ts +3 -3
- package/dist/vue/renderer.js +5 -5
- package/dist/vue/renderer.js.map +1 -1
- package/package.json +8 -8
- package/dist/adapters/json-render.d.ts.bak +0 -211
- package/dist/adapters/json-render.js.bak +0 -576
- package/dist/catalog/registry.d.ts.bak +0 -65
- package/dist/catalog/registry.js.bak +0 -388
- package/dist/collab/capsule-registry.d.ts.bak +0 -114
- package/dist/collab/capsule-registry.js.bak +0 -271
- package/dist/collab/index.d.ts.bak +0 -21
- package/dist/collab/index.js.bak +0 -32
- package/dist/collab/visual-editor.d.ts.bak +0 -199
- package/dist/collab/visual-editor.js.bak +0 -259
- package/dist/collab/yjs-adapter.d.ts.bak +0 -95
- package/dist/collab/yjs-adapter.js.bak +0 -282
- package/dist/collab/yjs-client.d.ts.bak +0 -101
- package/dist/collab/yjs-client.js.bak +0 -193
- package/dist/collab/yjs-protocols.d.ts.bak +0 -128
- package/dist/collab/yjs-protocols.js.bak +0 -245
- package/dist/collab/yjs-types.d.ts.bak +0 -201
- package/dist/collab/yjs-types.js.bak +0 -45
- package/dist/index.d.ts.bak +0 -38
- package/dist/index.js.bak +0 -48
- package/dist/pipeline/llm-to-ix.d.ts.bak +0 -249
- package/dist/pipeline/llm-to-ix.js.bak +0 -992
- package/dist/react/index.d.ts.bak +0 -18
- package/dist/react/index.js.bak +0 -18
- package/dist/react/renderer.d.ts.bak +0 -47
- package/dist/react/renderer.js.bak +0 -420
- package/dist/renderer/renderer.d.ts.bak +0 -55
- package/dist/renderer/renderer.js.bak +0 -232
- package/dist/runtime/capsule-runtime.d.ts.bak +0 -227
- package/dist/runtime/capsule-runtime.js.bak +0 -563
- package/dist/runtime/policy-gates.d.ts.bak +0 -116
- package/dist/runtime/policy-gates.js.bak +0 -317
- package/dist/schema/ui-ir.d.ts.bak +0 -26
- package/dist/schema/ui-ir.js.bak +0 -51
- package/dist/sdk/api.d.ts.bak +0 -101
- package/dist/sdk/api.js.bak +0 -177
- package/dist/sdk/index.d.ts.bak +0 -9
- package/dist/sdk/index.js.bak +0 -10
- package/dist/sdk/react.d.ts.bak +0 -63
- package/dist/sdk/react.js.bak +0 -161
- package/dist/state/index.d.ts.bak +0 -8
- package/dist/state/index.js.bak +0 -8
- package/dist/state/patch.d.ts.bak +0 -73
- package/dist/state/patch.js.bak +0 -437
- package/dist/state/store.d.ts.bak +0 -50
- package/dist/state/store.js.bak +0 -246
- package/dist/svelte/index.d.ts.bak +0 -15
- package/dist/svelte/index.js.bak +0 -15
- package/dist/svelte/renderer.d.ts.bak +0 -35
- package/dist/svelte/renderer.js.bak +0 -317
- package/dist/types/index.d.ts.bak +0 -349
- package/dist/types/index.js.bak +0 -152
- package/dist/vue/index.d.ts.bak +0 -18
- package/dist/vue/index.js.bak +0 -18
- package/dist/vue/renderer.d.ts.bak +0 -46
- package/dist/vue/renderer.js.bak +0 -302
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* YJS Types - GAP-66
|
|
3
|
-
*
|
|
4
|
-
* Type definitions for collaborative editing
|
|
5
|
-
*/
|
|
6
|
-
import * as Y from 'yjs';
|
|
7
|
-
/**
|
|
8
|
-
* YJS Configuration
|
|
9
|
-
*/
|
|
10
|
-
export interface YjsConfig {
|
|
11
|
-
/** WebRTC signaling server URLs */
|
|
12
|
-
signalingUrls: string[];
|
|
13
|
-
/** STUN/TURN servers for NAT traversal */
|
|
14
|
-
iceServers: RTCIceServer[];
|
|
15
|
-
/** Prefix for room names */
|
|
16
|
-
roomPrefix: string;
|
|
17
|
-
/** Maximum number of peers per room */
|
|
18
|
-
maxPeers?: number;
|
|
19
|
-
/** Enable debug logging */
|
|
20
|
-
debug?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Collaboration Session
|
|
24
|
-
*/
|
|
25
|
-
export interface CollaborationSession {
|
|
26
|
-
/** Unique room identifier */
|
|
27
|
-
roomId: string;
|
|
28
|
-
/** Connected participants */
|
|
29
|
-
participants: Participant[];
|
|
30
|
-
/** YJS document */
|
|
31
|
-
doc: Y.Doc;
|
|
32
|
-
/** WebRTC provider */
|
|
33
|
-
provider: any;
|
|
34
|
-
/** Awareness instance */
|
|
35
|
-
awareness: any;
|
|
36
|
-
/** Session start time */
|
|
37
|
-
startedAt?: Date;
|
|
38
|
-
/** Last activity time */
|
|
39
|
-
lastActivity?: Date;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Participant in a collaboration session
|
|
43
|
-
*/
|
|
44
|
-
export interface Participant {
|
|
45
|
-
/** Unique participant ID */
|
|
46
|
-
id: string;
|
|
47
|
-
/** Display name */
|
|
48
|
-
name: string;
|
|
49
|
-
/** Color for cursor/selection highlighting */
|
|
50
|
-
color: string;
|
|
51
|
-
/** Current cursor position */
|
|
52
|
-
cursor?: CursorPosition;
|
|
53
|
-
/** Current selection range */
|
|
54
|
-
selection?: Range;
|
|
55
|
-
/** Client ID in YJS awareness */
|
|
56
|
-
clientId?: number;
|
|
57
|
-
/** Is this the local user */
|
|
58
|
-
isLocal?: boolean;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Cursor position in editor
|
|
62
|
-
*/
|
|
63
|
-
export interface CursorPosition {
|
|
64
|
-
/** X coordinate */
|
|
65
|
-
x: number;
|
|
66
|
-
/** Y coordinate */
|
|
67
|
-
y: number;
|
|
68
|
-
/** Line number (for text editors) */
|
|
69
|
-
line?: number;
|
|
70
|
-
/** Character position (for text editors) */
|
|
71
|
-
ch?: number;
|
|
72
|
-
/** Timestamp of last update */
|
|
73
|
-
timestamp?: number;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Selection range
|
|
77
|
-
*/
|
|
78
|
-
export interface Range {
|
|
79
|
-
/** Selection anchor (start) */
|
|
80
|
-
anchor: CursorPosition;
|
|
81
|
-
/** Selection head (end) */
|
|
82
|
-
head: CursorPosition;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* User state for awareness
|
|
86
|
-
*/
|
|
87
|
-
export interface UserState {
|
|
88
|
-
/** User ID */
|
|
89
|
-
id: string;
|
|
90
|
-
/** User name */
|
|
91
|
-
name: string;
|
|
92
|
-
/** User color */
|
|
93
|
-
color: string;
|
|
94
|
-
/** Current cursor */
|
|
95
|
-
cursor?: CursorPosition;
|
|
96
|
-
/** Current selection */
|
|
97
|
-
selection?: Range;
|
|
98
|
-
/** Status message */
|
|
99
|
-
status?: string;
|
|
100
|
-
/** Is user typing */
|
|
101
|
-
isTyping?: boolean;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Awareness changes event
|
|
105
|
-
*/
|
|
106
|
-
export interface AwarenessChanges {
|
|
107
|
-
/** Added client IDs */
|
|
108
|
-
added: number[];
|
|
109
|
-
/** Updated client IDs */
|
|
110
|
-
updated: number[];
|
|
111
|
-
/** Removed client IDs */
|
|
112
|
-
removed: number[];
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Shared document types
|
|
116
|
-
*/
|
|
117
|
-
export declare enum DocType {
|
|
118
|
-
TEXT = "text",
|
|
119
|
-
ARRAY = "array",
|
|
120
|
-
MAP = "map",
|
|
121
|
-
XML = "xml",
|
|
122
|
-
XML_FRAG = "xml-frag"
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Document operation types
|
|
126
|
-
*/
|
|
127
|
-
export declare enum OperationType {
|
|
128
|
-
INSERT = "insert",
|
|
129
|
-
DELETE = "delete",
|
|
130
|
-
UPDATE = "update",
|
|
131
|
-
FORMAT = "format"
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Document change event
|
|
135
|
-
*/
|
|
136
|
-
export interface DocChangeEvent {
|
|
137
|
-
/** Type of operation */
|
|
138
|
-
type: OperationType;
|
|
139
|
-
/** Target type */
|
|
140
|
-
targetType: DocType;
|
|
141
|
-
/** Target name */
|
|
142
|
-
targetName: string;
|
|
143
|
-
/** Change delta */
|
|
144
|
-
delta: any;
|
|
145
|
-
/** Origin of change */
|
|
146
|
-
origin: any;
|
|
147
|
-
/** Is local change */
|
|
148
|
-
isLocal: boolean;
|
|
149
|
-
/** Timestamp */
|
|
150
|
-
timestamp: Date;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Sync state for tracking document synchronization
|
|
154
|
-
*/
|
|
155
|
-
export interface SyncState {
|
|
156
|
-
/** Is currently syncing */
|
|
157
|
-
isSyncing: boolean;
|
|
158
|
-
/** Sync progress (0-100) */
|
|
159
|
-
progress: number;
|
|
160
|
-
/** Last sync time */
|
|
161
|
-
lastSync?: Date;
|
|
162
|
-
/** Sync errors */
|
|
163
|
-
errors: string[];
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Cursor style for rendering
|
|
167
|
-
*/
|
|
168
|
-
export interface CursorStyle {
|
|
169
|
-
/** Cursor color */
|
|
170
|
-
color: string;
|
|
171
|
-
/** Cursor width in pixels */
|
|
172
|
-
width?: number;
|
|
173
|
-
/** Show user name label */
|
|
174
|
-
showName?: boolean;
|
|
175
|
-
/** Animation class */
|
|
176
|
-
animationClass?: string;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Collaboration configuration
|
|
180
|
-
*/
|
|
181
|
-
export interface CollabConfig {
|
|
182
|
-
/** Enable real-time collaboration */
|
|
183
|
-
enabled: boolean;
|
|
184
|
-
/** Room ID for collaboration */
|
|
185
|
-
roomId: string;
|
|
186
|
-
/** YJS configuration */
|
|
187
|
-
yjs: YjsConfig;
|
|
188
|
-
/** Enable cursor tracking */
|
|
189
|
-
showCursors: boolean;
|
|
190
|
-
/** Enable selection tracking */
|
|
191
|
-
showSelections: boolean;
|
|
192
|
-
/** Enable user list */
|
|
193
|
-
showUsers: boolean;
|
|
194
|
-
/** Cursor style */
|
|
195
|
-
cursorStyle: CursorStyle;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Default collaboration configuration
|
|
199
|
-
*/
|
|
200
|
-
export declare const defaultCollabConfig: CollabConfig;
|
|
201
|
-
//# sourceMappingURL=yjs-types.d.ts.map
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// OWNER: T2-A4
|
|
2
|
-
/**
|
|
3
|
-
* Shared document types
|
|
4
|
-
*/
|
|
5
|
-
export var DocType;
|
|
6
|
-
(function (DocType) {
|
|
7
|
-
DocType["TEXT"] = "text";
|
|
8
|
-
DocType["ARRAY"] = "array";
|
|
9
|
-
DocType["MAP"] = "map";
|
|
10
|
-
DocType["XML"] = "xml";
|
|
11
|
-
DocType["XML_FRAG"] = "xml-frag";
|
|
12
|
-
})(DocType || (DocType = {}));
|
|
13
|
-
/**
|
|
14
|
-
* Document operation types
|
|
15
|
-
*/
|
|
16
|
-
export var OperationType;
|
|
17
|
-
(function (OperationType) {
|
|
18
|
-
OperationType["INSERT"] = "insert";
|
|
19
|
-
OperationType["DELETE"] = "delete";
|
|
20
|
-
OperationType["UPDATE"] = "update";
|
|
21
|
-
OperationType["FORMAT"] = "format";
|
|
22
|
-
})(OperationType || (OperationType = {}));
|
|
23
|
-
/**
|
|
24
|
-
* Default collaboration configuration
|
|
25
|
-
*/
|
|
26
|
-
export const defaultCollabConfig = {
|
|
27
|
-
enabled: true,
|
|
28
|
-
roomId: '',
|
|
29
|
-
yjs: {
|
|
30
|
-
signalingUrls: [],
|
|
31
|
-
iceServers: [],
|
|
32
|
-
roomPrefix: 'a2r',
|
|
33
|
-
maxPeers: 20,
|
|
34
|
-
debug: false,
|
|
35
|
-
},
|
|
36
|
-
showCursors: true,
|
|
37
|
-
showSelections: true,
|
|
38
|
-
showUsers: true,
|
|
39
|
-
cursorStyle: {
|
|
40
|
-
color: '#000000',
|
|
41
|
-
width: 2,
|
|
42
|
-
showName: true,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=yjs-types.js.map
|
package/dist/index.d.ts.bak
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A2R-IX (A2R Interface eXecution)
|
|
3
|
-
*
|
|
4
|
-
* Declarative UI generation with Vercel Labs json-render compatibility.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { createUIRenderer, jsonRenderAdapter } from '@allternit/ix';
|
|
9
|
-
*
|
|
10
|
-
* const ui = createUIRenderer({
|
|
11
|
-
* components: jsonRenderAdapter.components
|
|
12
|
-
* });
|
|
13
|
-
*
|
|
14
|
-
* ui.render({
|
|
15
|
-
* version: '1.0.0',
|
|
16
|
-
* components: [...],
|
|
17
|
-
* state: { variables: [...] },
|
|
18
|
-
* actions: [...]
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export type { UIRoot, UIComponent, UIState, UIAction, StateVariable, ComputedValue, StateBinding, EventHandler, RepeatBinding, ActionHandler, Expression, ValidationRule, PersistenceConfig, UIMetadata, CatalogEntry, PropSchema, UIPatch, CustomHandlerContext, CustomHandlerFn, } from './types';
|
|
23
|
-
export { ComponentCatalog, BUILT_INS, createDefaultCatalog, type CatalogComponent, type PropDefinition, } from './catalog/registry';
|
|
24
|
-
export { createStateStore, getStateStore, clearStateStore, type StateStore, type StateStoreConfig, } from './state/store';
|
|
25
|
-
export { applyPatch, applyPatchToStore, applyOperation, generatePatch, invertPatch, validatePatch, validateOperation, getValueAtPath, setValueAtPath, decodeJsonPointer, encodeJsonPointer, type JSONPatch, type JSONPatchOperation, type PatchResult, } from './state/patch';
|
|
26
|
-
export { jsonRenderAdapter, convertToJsonRender, convertFromJsonRender, globalHandlerRegistry, type JsonRenderNode, type JsonRenderComponent, type JsonRenderSchema, type CustomHandlerFn as JsonRenderHandlerFn, type HandlerRegistryEntry, } from './adapters/json-render';
|
|
27
|
-
export { createReactRenderer, type ReactRenderer, type ReactRendererConfig, } from './react/renderer';
|
|
28
|
-
export { createIXCapsule, IXCapsuleRegistry, globalCapsuleRegistry, type IXCapsule, type IXCapsuleConfig, type IXCapsuleEvent, type IXCapsuleMetrics, type IXAggregatedMetrics, type IXMetricsExport, } from './runtime/capsule-runtime';
|
|
29
|
-
export { createRateLimitGate, createActionAllowlistGate, createComponentRestrictionsGate, createStateValidationGate, createPropSanitizationGate, createResourceLimitGate, createAuditLogGate, composePolicyGates, createDefaultPolicyGates, type PolicyGate, type PolicyContext, type PolicyResult, } from './runtime/policy-gates';
|
|
30
|
-
export { convertLLMToIX, llmToIX, llmToIxPipeline, type LLMToIXOptions, type LLMToIXResult, type LlmToIxPipelineOptions, type LlmToIxPipelineResult, type IxRenderTree, type IxRenderNode, type IxTheme, } from './pipeline/llm-to-ix';
|
|
31
|
-
export * from './sdk';
|
|
32
|
-
export * from './collab';
|
|
33
|
-
export { evaluateExpression, UI_IR_VERSION, validateUIRoot, createEmptyRoot } from './types';
|
|
34
|
-
/** Package version */
|
|
35
|
-
export declare const VERSION = "0.1.0";
|
|
36
|
-
/** Default schema version */
|
|
37
|
-
export declare const SCHEMA_VERSION = "1.0.0";
|
|
38
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js.bak
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A2R-IX (A2R Interface eXecution)
|
|
3
|
-
*
|
|
4
|
-
* Declarative UI generation with Vercel Labs json-render compatibility.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { createUIRenderer, jsonRenderAdapter } from '@allternit/ix';
|
|
9
|
-
*
|
|
10
|
-
* const ui = createUIRenderer({
|
|
11
|
-
* components: jsonRenderAdapter.components
|
|
12
|
-
* });
|
|
13
|
-
*
|
|
14
|
-
* ui.render({
|
|
15
|
-
* version: '1.0.0',
|
|
16
|
-
* components: [...],
|
|
17
|
-
* state: { variables: [...] },
|
|
18
|
-
* actions: [...]
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
// Catalog
|
|
23
|
-
export { ComponentCatalog, BUILT_INS, createDefaultCatalog, } from './catalog/registry';
|
|
24
|
-
// State Store
|
|
25
|
-
export { createStateStore, getStateStore, clearStateStore, } from './state/store';
|
|
26
|
-
// JSON Patch Engine
|
|
27
|
-
export { applyPatch, applyPatchToStore, applyOperation, generatePatch, invertPatch, validatePatch, validateOperation, getValueAtPath, setValueAtPath, decodeJsonPointer, encodeJsonPointer, } from './state/patch';
|
|
28
|
-
// Vercel Labs json-render adapter
|
|
29
|
-
export { jsonRenderAdapter, convertToJsonRender, convertFromJsonRender, globalHandlerRegistry, } from './adapters/json-render';
|
|
30
|
-
// React Renderer
|
|
31
|
-
export { createReactRenderer, } from './react/renderer';
|
|
32
|
-
// Runtime
|
|
33
|
-
export { createIXCapsule, IXCapsuleRegistry, globalCapsuleRegistry, } from './runtime/capsule-runtime';
|
|
34
|
-
// Policy Gates
|
|
35
|
-
export { createRateLimitGate, createActionAllowlistGate, createComponentRestrictionsGate, createStateValidationGate, createPropSanitizationGate, createResourceLimitGate, createAuditLogGate, composePolicyGates, createDefaultPolicyGates, } from './runtime/policy-gates';
|
|
36
|
-
// LLM-to-IX Pipeline
|
|
37
|
-
export { convertLLMToIX, llmToIX, llmToIxPipeline, } from './pipeline/llm-to-ix';
|
|
38
|
-
// SDK
|
|
39
|
-
export * from './sdk';
|
|
40
|
-
// Collab / Visual Editor
|
|
41
|
-
export * from './collab';
|
|
42
|
-
// Utils
|
|
43
|
-
export { evaluateExpression, UI_IR_VERSION, validateUIRoot, createEmptyRoot } from './types';
|
|
44
|
-
/** Package version */
|
|
45
|
-
export const VERSION = '0.1.0';
|
|
46
|
-
/** Default schema version */
|
|
47
|
-
export const SCHEMA_VERSION = '1.0.0';
|
|
48
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LLM-to-IX Pipeline
|
|
3
|
-
*
|
|
4
|
-
* Converts LLM-generated UI descriptions to A2R-IX format.
|
|
5
|
-
*
|
|
6
|
-
* Supports multiple input formats:
|
|
7
|
-
* - Natural language descriptions
|
|
8
|
-
* - Vercel Labs json-render
|
|
9
|
-
* - JSX-like pseudo-code
|
|
10
|
-
* - Raw component trees
|
|
11
|
-
* - Markdown UI descriptions
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { llmToIxPipeline } from '@allternit/ix/pipeline';
|
|
16
|
-
*
|
|
17
|
-
* const result = llmToIxPipeline({
|
|
18
|
-
* input: llmOutput,
|
|
19
|
-
* options: {
|
|
20
|
-
* applyStyling: true,
|
|
21
|
-
* theme: 'default',
|
|
22
|
-
* generateIds: true,
|
|
23
|
-
* }
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* console.log(result.tree); // IxRenderTree
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
import type { UIRoot, StateVariable, UIState, UIAction, StateBinding, EventHandler, Expression, RepeatBinding } from '../types';
|
|
30
|
-
import type { JsonRenderSchema } from '../adapters/json-render';
|
|
31
|
-
export interface LLMToIXOptions {
|
|
32
|
-
/** Schema version to use */
|
|
33
|
-
version?: string;
|
|
34
|
-
/** Auto-generate component IDs */
|
|
35
|
-
generateIds?: boolean;
|
|
36
|
-
/** Validate against catalog */
|
|
37
|
-
validate?: boolean;
|
|
38
|
-
/** Infer state from bindings */
|
|
39
|
-
inferState?: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface LLMToIXResult {
|
|
42
|
-
/** Generated UI */
|
|
43
|
-
ui: UIRoot;
|
|
44
|
-
/** Warnings during conversion */
|
|
45
|
-
warnings: string[];
|
|
46
|
-
/** Inferred state variables */
|
|
47
|
-
inferredState: StateVariable[];
|
|
48
|
-
/** Confidence score (0-1) */
|
|
49
|
-
confidence: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* A2R-IX Theme Configuration
|
|
53
|
-
*/
|
|
54
|
-
export interface IxTheme {
|
|
55
|
-
/** Theme name */
|
|
56
|
-
name: string;
|
|
57
|
-
/** Color palette */
|
|
58
|
-
colors: {
|
|
59
|
-
primary: string;
|
|
60
|
-
secondary: string;
|
|
61
|
-
success: string;
|
|
62
|
-
warning: string;
|
|
63
|
-
error: string;
|
|
64
|
-
background: string;
|
|
65
|
-
surface: string;
|
|
66
|
-
text: string;
|
|
67
|
-
textMuted: string;
|
|
68
|
-
border: string;
|
|
69
|
-
};
|
|
70
|
-
/** Spacing scale */
|
|
71
|
-
spacing: {
|
|
72
|
-
xs: number;
|
|
73
|
-
sm: number;
|
|
74
|
-
md: number;
|
|
75
|
-
lg: number;
|
|
76
|
-
xl: number;
|
|
77
|
-
};
|
|
78
|
-
/** Typography */
|
|
79
|
-
typography: {
|
|
80
|
-
fontFamily: string;
|
|
81
|
-
fontSize: {
|
|
82
|
-
xs: string;
|
|
83
|
-
sm: string;
|
|
84
|
-
md: string;
|
|
85
|
-
lg: string;
|
|
86
|
-
xl: string;
|
|
87
|
-
};
|
|
88
|
-
fontWeight: {
|
|
89
|
-
normal: number;
|
|
90
|
-
medium: number;
|
|
91
|
-
semibold: number;
|
|
92
|
-
bold: number;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
/** Border radius */
|
|
96
|
-
borderRadius: {
|
|
97
|
-
sm: number;
|
|
98
|
-
md: number;
|
|
99
|
-
lg: number;
|
|
100
|
-
full: number;
|
|
101
|
-
};
|
|
102
|
-
/** Shadows */
|
|
103
|
-
shadows: {
|
|
104
|
-
sm: string;
|
|
105
|
-
md: string;
|
|
106
|
-
lg: string;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* IxRenderTree - Render-ready component tree with styling applied
|
|
111
|
-
*/
|
|
112
|
-
export interface IxRenderTree {
|
|
113
|
-
/** Schema version */
|
|
114
|
-
version: string;
|
|
115
|
-
/** Root components */
|
|
116
|
-
components: IxRenderNode[];
|
|
117
|
-
/** State definitions */
|
|
118
|
-
state: UIState;
|
|
119
|
-
/** Action handlers */
|
|
120
|
-
actions: UIAction[];
|
|
121
|
-
/** Applied theme */
|
|
122
|
-
theme?: IxTheme;
|
|
123
|
-
/** CSS styles */
|
|
124
|
-
styles?: Record<string, Record<string, string | number>>;
|
|
125
|
-
/** Metadata */
|
|
126
|
-
metadata?: {
|
|
127
|
-
title?: string;
|
|
128
|
-
description?: string;
|
|
129
|
-
generatedAt?: string;
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* IxRenderNode - Styled component node
|
|
134
|
-
*/
|
|
135
|
-
export interface IxRenderNode {
|
|
136
|
-
/** Unique node ID */
|
|
137
|
-
id: string;
|
|
138
|
-
/** Component type */
|
|
139
|
-
type: string;
|
|
140
|
-
/** Component props */
|
|
141
|
-
props: Record<string, unknown>;
|
|
142
|
-
/** Applied styles */
|
|
143
|
-
style: Record<string, string | number>;
|
|
144
|
-
/** CSS classes */
|
|
145
|
-
className?: string;
|
|
146
|
-
/** Child nodes */
|
|
147
|
-
children?: IxRenderNode[];
|
|
148
|
-
/** State bindings */
|
|
149
|
-
bindings?: StateBinding[];
|
|
150
|
-
/** Event handlers */
|
|
151
|
-
events?: EventHandler[];
|
|
152
|
-
/** Conditional render */
|
|
153
|
-
condition?: Expression;
|
|
154
|
-
/** Repeat/for loop */
|
|
155
|
-
repeat?: RepeatBinding;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Pipeline Options for llmToIxPipeline
|
|
159
|
-
*/
|
|
160
|
-
export interface LlmToIxPipelineOptions {
|
|
161
|
-
/** LLM output to parse */
|
|
162
|
-
input: unknown;
|
|
163
|
-
/** Pipeline options */
|
|
164
|
-
options?: {
|
|
165
|
-
/** Schema version */
|
|
166
|
-
version?: string;
|
|
167
|
-
/** Auto-generate component IDs */
|
|
168
|
-
generateIds?: boolean;
|
|
169
|
-
/** Validate against catalog */
|
|
170
|
-
validate?: boolean;
|
|
171
|
-
/** Infer state from bindings */
|
|
172
|
-
inferState?: boolean;
|
|
173
|
-
/** Apply A2R-IX styling */
|
|
174
|
-
applyStyling?: boolean;
|
|
175
|
-
/** Theme to use */
|
|
176
|
-
theme?: 'default' | 'minimal' | 'compact' | IxTheme;
|
|
177
|
-
/** Output format */
|
|
178
|
-
outputFormat?: 'tree' | 'ui-root' | 'json-render';
|
|
179
|
-
/** Debug mode */
|
|
180
|
-
debug?: boolean;
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Pipeline Result
|
|
185
|
-
*/
|
|
186
|
-
export interface LlmToIxPipelineResult {
|
|
187
|
-
/** Render tree */
|
|
188
|
-
tree: IxRenderTree;
|
|
189
|
-
/** Original UI root */
|
|
190
|
-
uiRoot: UIRoot;
|
|
191
|
-
/** Warnings */
|
|
192
|
-
warnings: string[];
|
|
193
|
-
/** Inferred state */
|
|
194
|
-
inferredState: StateVariable[];
|
|
195
|
-
/** Confidence score */
|
|
196
|
-
confidence: number;
|
|
197
|
-
/** Processing metrics */
|
|
198
|
-
metrics: {
|
|
199
|
-
parseTime: number;
|
|
200
|
-
transformTime: number;
|
|
201
|
-
styleTime: number;
|
|
202
|
-
totalTime: number;
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Convert LLM output to A2R-IX
|
|
207
|
-
*/
|
|
208
|
-
export declare function convertLLMToIX(input: unknown, options?: LLMToIXOptions): LLMToIXResult;
|
|
209
|
-
/**
|
|
210
|
-
* Detect input format
|
|
211
|
-
*/
|
|
212
|
-
declare function detectInputFormat(input: unknown): 'json-render' | 'jsx-like' | 'component-tree' | 'natural-language' | 'unknown';
|
|
213
|
-
/**
|
|
214
|
-
* LLM-to-IX Pipeline
|
|
215
|
-
*
|
|
216
|
-
* Main pipeline function that:
|
|
217
|
-
* 1. Parses LLM output (JSON or markdown)
|
|
218
|
-
* 2. Transforms to IX component tree
|
|
219
|
-
* 3. Applies A2R-IX styling
|
|
220
|
-
* 4. Returns IxRenderTree
|
|
221
|
-
*/
|
|
222
|
-
export declare function llmToIxPipeline(options: LlmToIxPipelineOptions): LlmToIxPipelineResult;
|
|
223
|
-
/**
|
|
224
|
-
* LLM-to-IX Pipeline API
|
|
225
|
-
*/
|
|
226
|
-
export declare const llmToIX: {
|
|
227
|
-
/**
|
|
228
|
-
* Convert LLM output to IX format
|
|
229
|
-
*/
|
|
230
|
-
convert: typeof convertLLMToIX;
|
|
231
|
-
/**
|
|
232
|
-
* Detect input format
|
|
233
|
-
*/
|
|
234
|
-
detectFormat: typeof detectInputFormat;
|
|
235
|
-
/**
|
|
236
|
-
* Check if input is valid json-render
|
|
237
|
-
*/
|
|
238
|
-
isJsonRender: (input: unknown) => input is JsonRenderSchema;
|
|
239
|
-
/**
|
|
240
|
-
* Quick convert from json-render
|
|
241
|
-
*/
|
|
242
|
-
fromJsonRender: (schema: JsonRenderSchema, options?: LLMToIXOptions) => LLMToIXResult;
|
|
243
|
-
/**
|
|
244
|
-
* Quick convert from JSX-like
|
|
245
|
-
*/
|
|
246
|
-
fromJSX: (jsx: string, options?: LLMToIXOptions) => LLMToIXResult;
|
|
247
|
-
};
|
|
248
|
-
export {};
|
|
249
|
-
//# sourceMappingURL=llm-to-ix.d.ts.map
|