@fugood/bricks-cli 2.25.0-beta.62 → 2.25.0-beta.64
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/lib/1010.js +1 -0
- package/lib/1178.js +1 -0
- package/lib/1215.js +1 -0
- package/lib/1708.js +9 -0
- package/lib/1759.js +1 -0
- package/lib/1936.js +1 -0
- package/lib/2151.js +1 -0
- package/lib/{209.js → 2209.js} +3 -3
- package/lib/2247.js +1 -0
- package/lib/2486.js +1 -0
- package/lib/2557.js +1 -0
- package/lib/{223.js → 3223.js} +1 -1
- package/lib/3332.js +13 -0
- package/lib/3690.js +1 -0
- package/lib/3774.js +44 -0
- package/lib/3976.js +14 -0
- package/lib/4305.js +1 -0
- package/lib/4456.js +3 -0
- package/lib/{192.js → 4479.js} +4 -4
- package/lib/4530.js +22 -0
- package/lib/4642.js +9 -0
- package/lib/4685.js +1202 -0
- package/lib/5212.js +1 -0
- package/lib/{658.js → 5658.js} +1 -1
- package/lib/5785.js +1 -0
- package/lib/6194.js +3 -0
- package/lib/6370.js +1 -0
- package/lib/6645.js +1 -0
- package/lib/6818.js +1 -0
- package/lib/7111.js +2 -0
- package/lib/7456.js +1 -0
- package/lib/7511.js +1 -0
- package/lib/7574.js +1 -0
- package/lib/7648.js +1 -0
- package/lib/8026.js +1 -0
- package/lib/{117.js → 8117.js} +2 -2
- package/lib/8166.js +1 -0
- package/lib/853.js +1 -0
- package/lib/915.js +4 -4
- package/lib/9320.js +3 -0
- package/lib/{387.js → 9387.js} +1 -1
- package/lib/9405.js +1 -0
- package/lib/9430.js +1 -0
- package/lib/{583.js → 9583.js} +1 -1
- package/lib/9663.js +1 -0
- package/lib/{866.js → 9866.js} +1 -1
- package/lib/9940.js +19 -0
- package/lib/index.js +17 -17
- package/lib/simulator-host-bridge.cjs +1 -0
- package/lib/simulator-main.mjs +3 -3
- package/package.json +5 -5
- package/lib/10.js +0 -1
- package/lib/111.js +0 -2
- package/lib/166.js +0 -1
- package/lib/178.js +0 -1
- package/lib/212.js +0 -1
- package/lib/215.js +0 -1
- package/lib/247.js +0 -1
- package/lib/274.js +0 -16
- package/lib/305.js +0 -1
- package/lib/306.js +0 -1
- package/lib/320.js +0 -3
- package/lib/332.js +0 -13
- package/lib/358.js +0 -1
- package/lib/370.js +0 -1
- package/lib/405.js +0 -1
- package/lib/430.js +0 -1
- package/lib/456.js +0 -3
- package/lib/479.js +0 -1231
- package/lib/486.js +0 -1
- package/lib/511.js +0 -1
- package/lib/557.js +0 -1
- package/lib/574.js +0 -1
- package/lib/645.js +0 -1
- package/lib/648.js +0 -1
- package/lib/663.js +0 -1
- package/lib/690.js +0 -1
- package/lib/708.js +0 -9
- package/lib/75.js +0 -1
- package/lib/759.js +0 -1
- package/lib/785.js +0 -1
- package/lib/818.js +0 -1
- package/lib/917.js +0 -1
- package/lib/936.js +0 -1
- package/lib/940.js +0 -19
package/lib/708.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id=708;export const __rspack_esm_ids=[708];export const __webpack_modules__={37495(n,e,t){t.r(e),t.d(e,{postinstall:()=>z,checkProjectAssets:()=>j});var a,r,i,o,s,l,c,p,d,u,m,h,g,y,f,v=t(68832),b=t(99436),A=t(51455),E=t(73024),D=t(48161),k=t(76760),T=t(34618),C=t(53241),_=(a=b(function*(n){try{return yield(0,A.stat)(n),!0}catch{return!1}}),function(n){return a.apply(this,arguments)}),S=(r=b(function*(n,e){var t,a;if(yield _(n)){try{a=JSON.parse((yield(0,A.readFile)(n,"utf-8")))}catch{console.warn(`Skipping .mcp.json update; ${n} is not valid JSON`);return}(t=a&&"object"==typeof a?a:{mcpServers:{}}).mcpServers&&"object"==typeof t.mcpServers||(t.mcpServers={}),t.mcpServers["bricks-ctor"]=e,delete t.mcpServers["bricks-project"]}else t={mcpServers:{"bricks-ctor":e}};yield(0,A.writeFile)(n,`${JSON.stringify(t,null,2)}
|
|
2
|
-
`),console.log(`Updated ${n}`)}),function(n,e){return r.apply(this,arguments)}),L={"index.ts":"export type * from './types'\n\nexport { makeId } from './utils/id'\nexport { generateDataCalculationMapEditorInfo } from './utils/calc'\nexport { linkData, useSystemData, createCanvasIdRef } from './utils/data'\nexport { templateEventPropsMap } from './utils/event-props'\n","types/animation.d.ts":"export type Easing =\n | ''\n | 'easeInSine'\n | 'easeOutSine'\n | 'easeInOutSine'\n | 'easeInQuad'\n | 'easeOutQuad'\n | 'easeInOutQuad'\n | 'easeInCubic'\n | 'easeOutCubic'\n | 'easeInOutCubic'\n | 'easeInQuart'\n | 'easeOutQuart'\n | 'easeInOutQuart'\n | 'easeInQuint'\n | 'easeOutQuint'\n | 'easeInOutQuint'\n | 'easeInExpo'\n | 'easeOutExpo'\n | 'easeInOutExpo'\n | 'easeInCirc'\n | 'easeOutCirc'\n | 'easeInOutCirc'\n | 'easeInBack'\n | 'easeOutBack'\n | 'easeInOutBack'\n | 'easeInElastic'\n | 'easeOutElastic'\n | 'easeInOutElastic'\n | 'easeInBounce'\n | 'easeOutBounce'\n | 'easeInOutBounce'\n | string // Support format like 'cubic-bezier(x1, y1, x2, y2)'\n\nexport interface AnimationTimingConfig {\n __type: 'AnimationTimingConfig'\n toValue: number // BRICKS Grid unit\n duration: number // ms\n easing: Easing\n delay: number // ms\n isInteraction: boolean\n}\n\nexport interface AnimationSpringConfig {\n __type: 'AnimationSpringConfig'\n toValue: number // BRICKS Grid unit\n // Use one spring parameter family: tension/friction, speed/bounciness,\n // or stiffness/damping/mass.\n friction?: number\n tension?: number\n speed?: number\n bounciness?: number\n stiffness?: number\n damping?: number\n mass?: number\n velocity?: number\n delay?: number\n isInteraction?: boolean\n overshootClamping?: boolean\n restDisplacementThreshold?: number\n restSpeedThreshold?: number\n}\n\nexport interface AnimationDecayConfig {\n __type: 'AnimationDecayConfig'\n toValue: number // BRICKS Grid unit\n velocity: number\n deceleration: number\n isInteraction: boolean\n}\n\nexport interface AnimationDef {\n __typename: 'Animation'\n id: string\n alias?: string\n title?: string\n description?: string\n hideShortRef?: boolean\n runType?: 'once' | 'loop'\n property:\n | 'transform.translateX'\n | 'transform.translateY'\n | 'transform.scale'\n | 'transform.scaleX'\n | 'transform.scaleY'\n | 'transform.rotate'\n | 'transform.rotateX'\n | 'transform.rotateY'\n | 'opacity'\n config: AnimationTimingConfig | AnimationSpringConfig | AnimationDecayConfig\n}\n\nexport interface AnimationComposeDef {\n __typename: 'AnimationCompose'\n id: string\n alias?: string\n title: string\n description?: string\n hideShortRef?: boolean\n runType?: 'once' | 'loop'\n composeType: 'parallel' | 'sequence'\n items: Array<() => Animation>\n}\n\nexport type Animation = AnimationDef | AnimationComposeDef\n\n// Animation event handlers accept either a direct Animation or a getter that\n// returns one. The getter form is useful for lazy/forward references between\n// animations defined across files.\nexport type AnimationOrGetter = Animation | (() => Animation)\n\nexport interface AnimationBasicEvents {\n showStart?: AnimationOrGetter\n standby?: AnimationOrGetter\n breatheStart?: AnimationOrGetter\n}\n","types/automation.d.ts":"/**\n * Automation (Test) System Types\n *\n * This module defines TypeScript types for the BRICKS automation/testing system.\n * The automation system allows defining automated test sequences that can be\n * triggered on launch, anytime, or via cron schedules.\n */\n\nimport type { Subspace } from './subspace'\nimport type { Brick, Generator } from './common'\nimport type { Canvas } from './canvas'\nimport type { Data } from './data'\n\n// Entity reference types - can be string ID or getter function\nexport type SubspaceRef = string | (() => Subspace)\nexport type BrickRef = string | (() => Brick)\nexport type GeneratorRef = string | (() => Generator)\nexport type CanvasRef = string | (() => Canvas)\nexport type DataRef = string | (() => Data)\n\n// Variable types for test variables\nexport type TestVariableType = 'string' | 'number' | 'array' | 'object' | 'bool' | 'any'\n\n// Trigger types for when tests should run\nexport type TestTriggerType = 'launch' | 'anytime' | 'cron'\n\n// Jump condition operators for conditional test flow\nexport type JumpConditionOperator = '==' | '!=' | '>' | '>=' | '<' | '<='\n\n// Jump condition status types\nexport type JumpConditionStatus = 'finished' | 'failed'\n\n// Jump condition types\nexport type JumpConditionType = 'status' | 'variable'\n\n/**\n * Jump condition for controlling test case flow\n */\nexport interface TestCaseJumpCondition {\n type: JumpConditionType\n // For status-based conditions\n status?: JumpConditionStatus\n // For variable-based conditions\n variable?: string\n operator?: JumpConditionOperator\n value?: any\n // The test case to jump to (getter function for dynamic IDs or string for static IDs)\n jump_to?: string | (() => TestCase)\n}\n\n/**\n * Test variable definition\n */\nexport interface TestVariable {\n __typename: 'TestVariable'\n id: string\n name: string\n type: TestVariableType\n value: any\n}\n\n/**\n * Post delay rules for test cases\n */\nexport type PostDelayRule = 'include-action-time' | 'exclude-action-time'\n\n/**\n * Test method names (14 methods)\n */\nexport type TestMethodName =\n | 'brick_press'\n | 'brick_exists'\n | 'wait_until_brick_exists'\n | 'wait_until_event_trigger'\n | 'wait_until_canvas_change'\n | 'keydown'\n | 'keyup'\n | 'http_request'\n | 'assert_property'\n | 'wait_until_property_change'\n | 'execute_action'\n | 'execute_items_action'\n | 'match_screenshot'\n | 'delay'\n\n/**\n * Union type for all test method run arrays\n */\nexport type TestMethodRun =\n | TestMethodRunBrickPress\n | TestMethodRunBrickExists\n | TestMethodRunWaitUntilBrickExists\n | TestMethodRunWaitUntilEventTrigger\n | TestMethodRunWaitUntilCanvasChange\n | TestMethodRunKeydown\n | TestMethodRunKeyup\n | TestMethodRunHttpRequest\n | TestMethodRunAssertProperty\n | TestMethodRunWaitUntilPropertyChange\n | TestMethodRunExecuteAction\n | TestMethodRunExecuteItemsAction\n | TestMethodRunMatchScreenshot\n | TestMethodRunDelay\n\n// [methodName, subspaceId, brickId, options?]\nexport type TestMethodRunBrickPress = ['brick_press', SubspaceRef, BrickRef, Record<string, any>?]\n\n// [methodName, subspaceId, brickId, frame?]\nexport type TestMethodRunBrickExists = ['brick_exists', SubspaceRef, BrickRef, Record<string, any>?]\n\n// [methodName, subspaceId, brickId, timeout?, frame?]\nexport type TestMethodRunWaitUntilBrickExists = [\n 'wait_until_brick_exists',\n SubspaceRef,\n BrickRef,\n number?,\n Record<string, any>?,\n]\n\n// [methodName, subspaceId, senderId, eventKey, timeout?]\n// senderId can be brick or generator\nexport type TestMethodRunWaitUntilEventTrigger = [\n 'wait_until_event_trigger',\n SubspaceRef,\n BrickRef | GeneratorRef,\n string,\n number?,\n]\n\n// [methodName, subspaceId, canvasId, timeout?]\nexport type TestMethodRunWaitUntilCanvasChange = [\n 'wait_until_canvas_change',\n SubspaceRef,\n CanvasRef,\n number?,\n]\n\n// [methodName, keyCode, pressedKey?, flags?]\nexport type TestMethodRunKeydown = ['keydown', number, string?, number?]\n\n// [methodName, keyCode, pressedKey?, flags?]\nexport type TestMethodRunKeyup = ['keyup', number, string?, number?]\n\n// [methodName, url, options?]\nexport type TestMethodRunHttpRequest = ['http_request', string, Record<string, any>?]\n\n// [methodName, subspaceId, propertyId, value]\nexport type TestMethodRunAssertProperty = ['assert_property', SubspaceRef, DataRef, any]\n\n// [methodName, subspaceId, propertyId, value, timeout?]\nexport type TestMethodRunWaitUntilPropertyChange = [\n 'wait_until_property_change',\n SubspaceRef,\n DataRef,\n any,\n number?,\n]\n\n// [methodName, subspaceId, handler, action, params?, options?]\nexport type TestMethodRunExecuteAction = [\n 'execute_action',\n SubspaceRef,\n string,\n string,\n Record<string, any>?,\n Record<string, any>?,\n]\n\n/**\n * Items params targeting a brick inside a BRICK_ITEMS instance.\n * `itemsBrickId` is the item brick's configured ID inside the parent's\n * brickList/brickDetails; select the instance by `itemsDataId` or `itemsIndex`.\n */\nexport interface TestItemsParams {\n itemsMode?: 'list' | 'detail'\n itemsBrickId: string\n itemsDataId?: string\n itemsIndex?: number\n}\n\n// [methodName, subspaceId, parentId (BRICK_ITEMS), itemsParams, action, params?, options?]\nexport type TestMethodRunExecuteItemsAction = [\n 'execute_items_action',\n SubspaceRef,\n BrickRef,\n TestItemsParams,\n string,\n Record<string, any>?,\n Record<string, any>?,\n]\n\n// [methodName, screenshotName, threshold?, maxRetry?]\nexport type TestMethodRunMatchScreenshot = ['match_screenshot', string, number?, number?]\n\n// [methodName, subspaceId?, propertyId?, defaultValue?]\nexport type TestMethodRunDelay = ['delay', SubspaceRef?, DataRef?, number?]\n\n/**\n * Test case definition\n */\nexport interface TestCase {\n __typename: 'TestCase'\n id: string\n name: string\n hideShortRef?: boolean\n run: TestMethodRun\n exit_on_failed: boolean\n commented: boolean\n pre_delay: number\n post_delay: number\n post_delay_rule?: PostDelayRule\n jump_cond: TestCaseJumpCondition[]\n}\n\n/**\n * Local sync mode for tests\n */\nexport type LocalSyncMode = 'main-only' | 'minor-only'\n\n/**\n * Automation test definition\n */\nexport interface AutomationTest {\n __typename: 'AutomationTest'\n id: string\n alias?: string\n title: string\n hideShortRef?: boolean\n timeout: number\n trigger_type?: TestTriggerType\n cron?: string // Cron expression when trigger_type is 'cron'\n skip_trigger_type_check?: boolean\n local_sync?: LocalSyncMode\n cases: TestCase[]\n variables: TestVariable[]\n meta?: Record<string, any>\n}\n\n/**\n * Automation test map (a collection of tests)\n */\nexport interface AutomationTestMap {\n __typename: 'AutomationTestMap'\n id: string\n title: string\n hideShortRef?: boolean\n createdAt: number\n tests: AutomationTest[]\n}\n\n/**\n * Root automation map type (record of automation test maps by ID)\n */\nexport type AutomationMap = {\n [mapId: string]: AutomationTestMap\n}\n","types/brick-base.d.ts":"/* Auto generated by build script */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from './switch'\nimport type { Data, DataLink } from './data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from './animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from './common'\n\nexport interface BrickBasicProperty {\n /* The brick opacity (0 ~ 1) */\n opacity?: number | DataLink\n /* The brick background color */\n backgroundColor?: string | DataLink\n /* The brick border style */\n borderStyle?: 'solid' | 'dotted' | 'dashed' | DataLink\n /* The brick border width (top) */\n borderTopSize?: number | DataLink\n /* The brick border color (top) */\n borderTopColor?: string | DataLink\n /* The brick border radius (top left) */\n borderTopLeftRadius?: number | DataLink\n /* The brick border radius (top right) */\n borderTopRightRadius?: number | DataLink\n /* The brick border width (bottom) */\n borderBottomSize?: number | DataLink\n /* The brick border color (bottom) */\n borderBottomColor?: string | DataLink\n /* The brick border radius (bottom left) */\n borderBottomLeftRadius?: number | DataLink\n /* The brick border radius (bottom right) */\n borderBottomRightRadius?: number | DataLink\n /* The brick border width (left) */\n borderLeftSize?: number | DataLink\n /* The brick border color (bottom) */\n borderLeftColor?: string | DataLink\n /* The brick border width (right) */\n borderRightSize?: number | DataLink\n /* The brick border color (right) */\n borderRightColor?: string | DataLink\n /* The brick rotate (deg) */\n rotate?: number | DataLink\n /* The brick rotateX (deg) */\n rotateX?: number | DataLink\n /* The brick rotateY (deg) */\n rotateY?: number | DataLink\n /* The brick shadow color */\n shadowColor?: string | DataLink\n /* The brick shadow opacity (0 ~ 1) */\n shadowOpacity?: number | DataLink\n /* The brick shadow radius */\n shadowRadius?: number | DataLink\n /* The brick shadow offset width */\n shadowOffsetWidth?: number | DataLink\n /* The brick shadow offset height */\n shadowOffsetHeight?: number | DataLink\n /* Brick pressable.\n Disabled: Disabled even if event or animation is set. \n Bypass: Disable and bypass the touch event on the brick. */\n pressable?: 'enabled' | 'disabled' | 'bypass' | DataLink\n /* Delay in milliseconds before long press is triggered */\n delayLongPress?: number | DataLink\n}\n\nexport interface BrickBasicEvents {\n showStart?: Array<EventAction>\n switchUpdate?: Array<EventAction>\n standby?: Array<EventAction>\n}\n\nexport interface BrickBasicEventsForItem {\n showStart?: Array<EventActionForItem>\n switchUpdate?: Array<EventActionForItem>\n standby?: Array<EventActionForItem>\n}\n","types/bricks/Camera.d.ts":"/* Auto generated by build script\n *\n * Camera view with photo capture and barcode scanning capabilities\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Take picture on the Camera */\nexport type BrickCameraActionTakePicture = ActionWithParams & {\n __actionName: 'BRICK_CAMERA_TAKE_PICTURE'\n params?: Array<\n | {\n input: 'width'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'quality'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'base64'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mirrorImage'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Record video on the Camera */\nexport type BrickCameraActionRecord = ActionWithParams & {\n __actionName: 'BRICK_CAMERA_RECORD'\n params?: Array<\n | {\n input: 'quality'\n value?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mirrorVideo'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'videoBitrate'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxDuration'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxFileSize'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Record video on the Camera */\nexport type BrickCameraActionStopRecord = Action & {\n __actionName: 'BRICK_CAMERA_STOP_RECORD'\n}\n\n/* Focus the Camera at a specific point */\nexport type BrickCameraActionFocus = ActionWithParams & {\n __actionName: 'BRICK_CAMERA_FOCUS'\n params?: Array<\n | {\n input: 'focusX'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'focusY'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface BrickCameraDef {\n /*\nDefault property:\n{\n \"type\": \"back\",\n \"flashMode\": \"off\",\n \"captureAudio\": false,\n \"whiteBalance\": \"auto\",\n \"faceDetectionEnabled\": false,\n \"faceDetectionEventMode\": \"when-detected\"\n}\n */\n property?: BrickBasicProperty & {\n /* Camera type */\n type?: 'back' | 'front' | 'external' | DataLink\n /* Enable or disable camera */\n isActive?: boolean | DataLink\n /* Camera zoom */\n zoom?: number | DataLink\n /* Camera flash mode */\n flashMode?: 'off' | 'on' | 'torch' | 'auto' | DataLink\n /* Camera ratio (Unsupported ratio will be ignored) */\n ratio?: string | DataLink\n /* Capture audio when start recording */\n captureAudio?: boolean | DataLink\n /* Allows you to control the color temperature in your photos by cooling down or warming up the colors. */\n whiteBalance?:\n | 'auto'\n | 'sunny'\n | 'cloudy'\n | 'shadow'\n | 'incandescent'\n | 'fluorescent'\n | DataLink\n /* Enable face detection (Note: Barcode detection will be disabled when enabled) */\n faceDetectionEnabled?: boolean | DataLink\n /* Face detection event mode */\n faceDetectionEventMode?: 'when-detected' | 'interval' | DataLink\n /* Quality of take picture */\n pictureQuality?: number | DataLink\n /* Take picture format as base64 */\n pictureBase64?: boolean | DataLink\n /* Mirror image of take picture */\n pictureIsMirrorImage?: boolean | DataLink\n /* Quality of record video */\n recordQuality?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink\n /* Bitrate of record video (bit/s) */\n recordVideoBitrate?: number | DataLink\n /* Mirror video of record video */\n recordMirrorVideo?: boolean | DataLink\n /* Max duration of record video (s) */\n recordMaxDuration?: number | DataLink\n /* Max file size of record video (bytes) */\n recordMaxFileSize?: number | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the Camera state change */\n stateChange?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['stateChange']>>\n /* Event of the Camera record start */\n recordStart?: Array<EventAction>\n /* Event of the Camera record end */\n recordEnd?: Array<EventAction>\n /* Event of the Camera barcode read */\n barcodeRead?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['barcodeRead']>>\n /* Event of the Camera picture taken */\n pictureTaken?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Camera']['pictureTaken']>\n >\n /* Event of the Camera record finished */\n recordFinish?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Camera']['recordFinish']>\n >\n /* Event of the Camera mount error */\n mountError?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['mountError']>>\n }\n outlets?: {\n /* Camera device and format information */\n info?: () => Data<{ [key: string]: any }>\n /* Picture taken result */\n pictureTaken?: () => Data<{\n width?: number\n height?: number\n uri?: string\n base64?: string\n [key: string]: any\n }>\n /* Record video result */\n recordVideo?: () => Data<{\n uri?: string\n [key: string]: any\n }>\n /* Barcode read result */\n barcodeRead?: () => Data<{\n type?: string\n data?: string\n rawData?: string\n bounds?: {\n origin?: {\n x?: number\n y?: number\n [key: string]: any\n }\n size?: {\n width?: number\n height?: number\n [key: string]: any\n }\n [key: string]: any\n }\n [key: string]: any\n }>\n /* Faces detected result */\n faceDetected?: () => Data<Array<{ [key: string]: any }>>\n }\n animation?: AnimationBasicEvents & {\n stateChange?: AnimationOrGetter\n recordStart?: AnimationOrGetter\n recordEnd?: AnimationOrGetter\n barcodeRead?: AnimationOrGetter\n pictureTaken?: AnimationOrGetter\n recordFinish?: AnimationOrGetter\n mountError?: AnimationOrGetter\n }\n}\n\n/* Camera view with photo capture and barcode scanning capabilities */\nexport type BrickCamera = Brick &\n BrickCameraDef & {\n templateKey: 'BRICK_CAMERA'\n switches?: Array<\n SwitchDef &\n BrickCameraDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'info' | 'pictureTaken' | 'recordVideo' | 'barcodeRead' | 'faceDetected'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Chart.d.ts":"/* Auto generated by build script\n *\n * Chart brick, based on [Apache ECharts](https://echarts.apache.org/en/index.html).\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Data highlight */\nexport type BrickChartActionDataHighlight = ActionWithParams & {\n __actionName: 'BRICK_CHART_DATA_HIGHLIGHT'\n params?: Array<\n | {\n input: 'seriesName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Data downplay */\nexport type BrickChartActionDataDownplay = ActionWithParams & {\n __actionName: 'BRICK_CHART_DATA_DOWNPLAY'\n params?: Array<\n | {\n input: 'seriesName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Data select */\nexport type BrickChartActionDataSelect = ActionWithParams & {\n __actionName: 'BRICK_CHART_DATA_SELECT'\n params?: Array<\n | {\n input: 'seriesName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Data unselect */\nexport type BrickChartActionDataUnselect = ActionWithParams & {\n __actionName: 'BRICK_CHART_DATA_UNSELECT'\n params?: Array<\n | {\n input: 'seriesName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Data toggle select */\nexport type BrickChartActionDataToggleSelect = ActionWithParams & {\n __actionName: 'BRICK_CHART_DATA_TOGGLE_SELECT'\n params?: Array<\n | {\n input: 'seriesName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seriesIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Legend select */\nexport type BrickChartActionLegendSelect = ActionWithParams & {\n __actionName: 'BRICK_CHART_LEGEND_SELECT'\n params?: Array<{\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Legend unselect */\nexport type BrickChartActionLegendUnselect = ActionWithParams & {\n __actionName: 'BRICK_CHART_LEGEND_UNSELECT'\n params?: Array<{\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Legend toggle select */\nexport type BrickChartActionLegendToggleSelect = Action & {\n __actionName: 'BRICK_CHART_LEGEND_TOGGLE_SELECT'\n}\n\n/* Legend all select */\nexport type BrickChartActionLegendAllSelect = Action & {\n __actionName: 'BRICK_CHART_LEGEND_ALL_SELECT'\n}\n\n/* Legend inverse select */\nexport type BrickChartActionLegendInverseSelect = Action & {\n __actionName: 'BRICK_CHART_LEGEND_INVERSE_SELECT'\n}\n\n/* Tooltip show */\nexport type BrickChartActionTooltipShow = ActionWithParams & {\n __actionName: 'BRICK_CHART_TOOLTIP_SHOW'\n params?: Array<\n | {\n input: 'seriesIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Tooltip hide */\nexport type BrickChartActionTooltipHide = ActionWithParams & {\n __actionName: 'BRICK_CHART_TOOLTIP_HIDE'\n params?: Array<\n | {\n input: 'seriesIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface BrickChartDef {\n /*\nDefault property:\n{\n \"renderMode\": \"svg\",\n \"legendShow\": true,\n \"xAxisShow\": true,\n \"xAxisType\": \"category\",\n \"yAxisShow\": true,\n \"yAxisType\": \"value\",\n \"tooltipShow\": true,\n \"tooltipTrigger\": \"item\"\n}\n */\n property?: BrickBasicProperty & {\n /* The render mode */\n renderMode?: 'svg' | 'skia' | DataLink\n /* Theme. You can use https://echarts.apache.org/en/theme-builder.html to generate theme */\n themeEntry?: {} | DataLink\n /* Theme of URL (.json) */\n themeUrl?: string | DataLink\n /* Theme of MD5 */\n themeMd5?: string | DataLink\n /* Title text */\n titleText?: string | DataLink\n /* Subtitle text */\n titleSubtext?: string | DataLink\n /* Full configuration of title, see https://echarts.apache.org/en/option.html#title */\n titleOptions?: {} | DataLink\n /* Show legend */\n legendShow?: boolean | DataLink\n /* Legend data */\n legendData?: Array<string | DataLink> | DataLink\n /* Full configuration of legend, see https://echarts.apache.org/en/option.html#legend */\n legendOptions?: {} | DataLink\n /* Show grid */\n gridShow?: boolean | DataLink\n /* Full configuration of grid, see https://echarts.apache.org/en/option.html#grid */\n gridOptions?: {} | DataLink\n /* Dataset (see https://echarts.apache.org/en/option.html#dataset) */\n dataset?: Array<any> | DataLink\n /* Show x axis */\n xAxisShow?: boolean | DataLink\n /* Type of x axis */\n xAxisType?: 'category' | 'value' | 'time' | 'log' | DataLink\n /* Name of x axis */\n xAxisName?: string | DataLink\n /* Data of x axis */\n xAxisData?: Array<string | DataLink> | DataLink\n /* Full configuration of x axis, see https://echarts.apache.org/en/option.html#xAxis */\n xAxisOptions?: {} | DataLink\n /* Show y axis */\n yAxisShow?: boolean | DataLink\n /* Type of x axis */\n yAxisType?: 'value' | 'category' | 'time' | 'log' | DataLink\n /* Name of x axis */\n yAxisName?: string | DataLink\n /* Data of y axis */\n yAxisData?: Array<string | DataLink> | DataLink\n /* Full configuration of y axis, see https://echarts.apache.org/en/option.html#yAxis */\n yAxisOptions?: {} | DataLink\n /* Show axis pointer */\n axisPointerShow?: boolean | DataLink\n /* Full configuration of axis pointer, see https://echarts.apache.org/en/option.html#axisPointer */\n axisPointerOptions?: {} | DataLink\n /* data series (see https://echarts.apache.org/en/option.html#series-line) */\n series?: Array<any> | DataLink\n /* Show tooltip */\n tooltipShow?: boolean | DataLink\n /* Trigger type of tooltip */\n tooltipTrigger?: 'item' | 'axis' | 'none' | DataLink\n /* data series (see https://echarts.apache.org/en/option.html#tooltip) */\n tooltipOptions?: {} | DataLink\n /* Full configuration of options, see https://echarts.apache.org/en/option.html */\n options?: {} | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of chart render */\n onRender?: Array<EventAction>\n /* Event of data point on press */\n onPress?: Array<EventAction<string & keyof TemplateEventPropsMap['Chart']['onPress']>>\n /* Event of legend select changed */\n onLegendSelectChanged?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Chart']['onLegendSelectChanged']>\n >\n }\n animation?: AnimationBasicEvents & {\n onRender?: AnimationOrGetter\n onPress?: AnimationOrGetter\n onLegendSelectChanged?: AnimationOrGetter\n }\n}\n\n/* Chart brick, based on [Apache ECharts](https://echarts.apache.org/en/index.html). */\nexport type BrickChart = Brick &\n BrickChartDef & {\n templateKey: 'BRICK_CHART'\n switches?: Array<\n SwitchDef &\n BrickChartDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: ''\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/GenerativeMedia.d.ts":"/* Auto generated by build script\n *\n * Generative Media brick - Generate images and videos using AI\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface GenerativeMediaDef {\n /*\nDefault property:\n{\n \"enableCache\": true,\n \"type\": \"image\",\n \"resizeMode\": \"cover\",\n \"provider\": \"openai\",\n \"openaiModel\": \"dall-e-3\",\n \"freepikClassicImageSize\": \"square_1_1\",\n \"geminiVeoModel\": \"veo-3.1-generate-preview\",\n \"geminiVeoResolution\": \"720p\",\n \"geminiVeoDuration\": 8\n}\n */\n property?: BrickBasicProperty & {\n /* The text prompt to generate media from */\n prompt?: string | DataLink\n /* Enable cache */\n enableCache?: boolean | DataLink\n /* The type of media to generate (image or video) */\n type?: 'image' | 'video' | DataLink\n /* Default image to display when no generated image is available */\n defaultImage?: string | DataLink\n /* The hash of the default image */\n defaultImageHash?: string | DataLink\n /* The type of the default image hash */\n defaultImageHashType?: 'md5' | 'sha1' | 'sha256' | DataLink\n /* The Lottie animation to show while generating */\n loadingAnimation?: string | DataLink\n /* The Lottie animation to show when an error occurs */\n errorAnimation?: string | DataLink\n /* The resize mode for the generated media */\n resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink\n /* The API key for the generative media service */\n apiKey?: string | DataLink\n /* The AI provider to use for generation (openai, freepik-classic, deepai, or gemini) */\n provider?: 'openai' | 'freepik-classic' | 'deepai' | 'gemini' | DataLink\n /* OpenAI model to use for image generation */\n openaiModel?: 'dall-e-3' | 'gpt-image-1.5' | 'gpt-image-2' | DataLink\n /* OpenAI image size. DALL-E 3 uses 1024x1024, 1024x1792, or 1792x1024; GPT Image models use 1024x1024, 1024x1536, 1536x1024, auto, and GPT Image 2 supports larger listed sizes. */\n openaiSize?:\n | '1024x1024'\n | '1024x1792'\n | '1792x1024'\n | '1024x1536'\n | '1536x1024'\n | '2048x2048'\n | '2048x1152'\n | '3840x2160'\n | '2160x3840'\n | 'auto'\n | DataLink\n /* OpenAI image style for DALL-E 3 (vivid or natural) */\n openaiStyle?: 'vivid' | 'natural' | DataLink\n /* OpenAI image quality. DALL-E 3 uses standard or hd; GPT Image models use low, medium, high, or auto. */\n openaiQuality?: 'standard' | 'hd' | 'low' | 'medium' | 'high' | 'auto' | DataLink\n /* Freepik image size */\n freepikClassicImageSize?:\n | 'square_1_1'\n | 'classic_4_3'\n | 'traditional_3_4'\n | 'widescreen_16_9'\n | 'social_story_9_16'\n | 'smartphone_horizontal_20_9'\n | 'smartphone_vertical_9_20'\n | 'standard_3_2'\n | 'portrait_2_3'\n | 'horizontal_2_1'\n | 'vertical_1_2'\n | 'social_5_4'\n | 'social_post_4_5'\n | DataLink\n /* Freepik image style */\n freepikClassicStyle?:\n | 'photo'\n | 'digital-art'\n | '3d'\n | 'painting'\n | 'low-poly'\n | 'pixel-art'\n | 'anime'\n | 'cyberpunk'\n | 'comic'\n | 'vintage'\n | 'cartoon'\n | 'vector'\n | 'studio-shot'\n | 'dark'\n | 'sketch'\n | 'mockup'\n | '2000s-pone'\n | '70s-vibe'\n | 'watercolor'\n | 'art-nouveau'\n | 'origami'\n | 'surreal'\n | 'fantasy'\n | 'traditional-japan'\n | DataLink\n /* Freepik color scheme */\n freepikClassicStyleColor?:\n | 'b&w'\n | 'pastel'\n | 'sepia'\n | 'dramatic'\n | 'vibrant'\n | 'orange&teal'\n | 'film-filter'\n | 'split'\n | 'electric'\n | 'pastel-pink'\n | 'gold-glow'\n | 'autumn'\n | 'muted-green'\n | 'deep-teal'\n | 'duotone'\n | 'terracotta&teal'\n | 'red&blue'\n | 'cold-neon'\n | 'burgundy&blue'\n | DataLink\n /* Freepik lighting style */\n freepikClassicStyleLighting?:\n | 'studio'\n | 'warm'\n | 'cinematic'\n | 'volumetric'\n | 'golden-hour'\n | 'long-exposure'\n | 'cold'\n | 'iridescent'\n | 'dramatic'\n | 'hardlight'\n | 'redscale'\n | 'indoor-light'\n | DataLink\n /* Freepik framing style */\n freepikClassicStyleFraming?:\n | 'portrait'\n | 'macro'\n | 'panoramic'\n | 'aerial-view'\n | 'close-up'\n | 'cinematic'\n | 'high-angle'\n | 'low-angle'\n | 'symmetry'\n | 'fish-eye'\n | 'first-person'\n | DataLink\n /* Freepik guidance scale (level of fidelity to prompt) */\n freepikClassicGuidanceScale?: number | DataLink\n /* Freepik negative prompt (attributes to avoid) */\n freepikClassicNegativePrompt?: string | DataLink\n /* DeepAI negative prompt (attributes to avoid) */\n deepaiNegativePrompt?: string | DataLink\n /* DeepAI image generator version */\n deepaiImageGeneratorVersion?: 'standard' | 'hd' | DataLink\n /* DeepAI output image width */\n deepaiWidth?: number | DataLink\n /* DeepAI output image height */\n deepaiHeight?: number | DataLink\n /* Gemini aspect ratio (1:1, 16:9, 9:16, 3:2, 2:3) */\n geminiAspectRatio?: '1:1' | '16:9' | '9:16' | '3:2' | '2:3' | DataLink\n /* Gemini model to use for image generation */\n geminiModel?: 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | DataLink\n /* Gemini Veo model to use for video generation */\n geminiVeoModel?: 'veo-3.1-generate-preview' | 'veo-3.1-fast-generate-preview' | DataLink\n /* Gemini Veo video resolution (720p or 1080p) */\n geminiVeoResolution?: '720p' | '1080p' | DataLink\n /* Gemini Veo video duration in seconds (4, 6, 8) */\n geminiVeoDuration?: 4 | 6 | 8 | DataLink\n /* Gemini Veo negative prompt (attributes to avoid) */\n geminiVeoNegativePrompt?: string | DataLink\n /* Gemini Veo person generation control */\n geminiVeoPersonGeneration?: 'allow_all' | 'allow_adult' | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n generativeMediaOnPress?: Array<EventAction>\n /* Event of the brick press in */\n generativeMediaOnPressIn?: Array<EventAction>\n /* Event of the brick press out */\n generativeMediaOnPressOut?: Array<EventAction>\n /* Event of the brick long press */\n generativeMediaOnLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n generativeMediaOnFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n generativeMediaOnBlur?: Array<EventAction>\n /* Event when media generation succeeds */\n onSuccess?: Array<\n EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['onSuccess']>\n >\n /* Event when media generation fails */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['onError']>>\n /* Event when media prompt request starts */\n promptStart?: Array<\n EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptStart']>\n >\n /* Event when media prompt request succeeds */\n promptSuccess?: Array<\n EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptSuccess']>\n >\n /* Event when media prompt request fails */\n promptError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptError']>\n >\n /* Event when media loading starts */\n loadStart?: Array<EventAction>\n /* Event when media loading succeeds */\n loadSuccess?: Array<\n EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['loadSuccess']>\n >\n /* Event when media loading fails */\n loadError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['loadError']>\n >\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n /* Generated media URL */\n url?: () => Data<string>\n /* Generated media error */\n error?: () => Data<string>\n /* Loading state */\n loading?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n generativeMediaOnPress?: AnimationOrGetter\n generativeMediaOnPressIn?: AnimationOrGetter\n generativeMediaOnPressOut?: AnimationOrGetter\n generativeMediaOnLongPress?: AnimationOrGetter\n generativeMediaOnFocus?: AnimationOrGetter\n generativeMediaOnBlur?: AnimationOrGetter\n onSuccess?: AnimationOrGetter\n onError?: AnimationOrGetter\n promptStart?: AnimationOrGetter\n promptSuccess?: AnimationOrGetter\n promptError?: AnimationOrGetter\n loadStart?: AnimationOrGetter\n loadSuccess?: AnimationOrGetter\n loadError?: AnimationOrGetter\n }\n}\n\n/* Generative Media brick - Generate images and videos using AI */\nexport type GenerativeMedia = Brick &\n GenerativeMediaDef & {\n templateKey: 'BRICK_GENERATIVE_MEDIA'\n switches?: Array<\n SwitchDef &\n GenerativeMediaDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing' | 'url' | 'error' | 'loading'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Icon.d.ts":"/* Auto generated by build script\n *\n * Display Font Awesome 6 Pro icons. Supports Solid, Regular, Light, Duotone, Thin, Brands, and Sharp styles\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickIconDef {\n /*\nDefault property:\n{}\n */\n property?: BrickBasicProperty & {\n /* Select icon */\n icon?:\n | DataLink\n | {\n type?:\n | 'solid'\n | 'regular'\n | 'light'\n | 'duotone'\n | 'thin'\n | 'brands'\n | 'sharpSolid'\n | 'sharpLight'\n | 'sharpRegular'\n | DataLink\n name?: string | DataLink\n }\n /* Icon main color */\n color?: string | DataLink\n /* Icon secondary color (For Duotone type) */\n secondaryColor?: string | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n }\n}\n\n/* Display Font Awesome 6 Pro icons. Supports Solid, Regular, Light, Duotone, Thin, Brands, and Sharp styles */\nexport type BrickIcon = Brick &\n BrickIconDef & {\n templateKey: 'BRICK_ICON'\n switches?: Array<\n SwitchDef &\n BrickIconDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Image.d.ts":"/* Auto generated by build script\n *\n * Display images from URL or local assets with resize modes and caching\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickImageDef {\n /*\nDefault property:\n{\n \"path\": \"\",\n \"templateType\": \"${}\",\n \"fadeDuration\": 0,\n \"blurBackgroundRadius\": 8,\n \"imageFilterEnabled\": false,\n \"imageFilterBlur\": 0,\n \"imageFilterBlurMode\": \"clamp\",\n \"imageFilterColorMatrix\": [],\n \"loadSystemIos\": \"auto\",\n \"loadSystemAndroid\": \"auto\"\n}\n */\n property?: BrickBasicProperty & {\n /* The image resize mode */\n resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink\n /* The image file path (File, URL) */\n path?: string | DataLink\n /* Data to be used in the path template (e.g. `https://example.com/${id}.png`). Supports nested data, such as `${user.avatar}`. */\n templateData?: {} | DataLink\n /* The path template type */\n templateType?: '${}' | '{{}}' | DataLink\n /* The checksum of file */\n md5?: string | DataLink\n /* The image fade duration */\n fadeDuration?: number | DataLink\n /* The image avatar mode */\n avatar?: boolean | DataLink\n /* The image fixed width with `avatar` */\n width?: number | DataLink\n /* Add blurred image at background if photo is not full */\n enableBlurBackground?: boolean | DataLink\n /* The blur radius of the blur filter added to the image background */\n blurBackgroundRadius?: number | DataLink\n /* Enable Skia image filters. When disabled, Image uses the normal platform image renderer. */\n imageFilterEnabled?: boolean | DataLink\n /* Blur amount for the Skia image filter. */\n imageFilterBlur?: number | DataLink\n /* Tile mode for the Skia blur image filter. */\n imageFilterBlurMode?: 'clamp' | 'decal' | 'repeat' | 'mirror' | DataLink\n /* Optional 4x5 color matrix for the Skia image filter. Provide 20 numbers. */\n imageFilterColorMatrix?: Array<number | DataLink> | DataLink\n /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */\n loadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink\n /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */\n loadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n /* Event of the image on load */\n onLoad?: Array<EventAction>\n /* Event of the image on error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Image']['onError']>>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n onLoad?: AnimationOrGetter\n onError?: AnimationOrGetter\n }\n}\n\n/* Display images from URL or local assets with resize modes and caching */\nexport type BrickImage = Brick &\n BrickImageDef & {\n templateKey: 'BRICK_IMAGE'\n switches?: Array<\n SwitchDef &\n BrickImageDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Items.d.ts":"/* Auto generated by build script\n *\n * Data-driven list/grid. Maps items array to brick templates via propertyMapping, with pagination and detail mode support\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* prev page */\nexport type BrickItemsActionPrevPage = Action & {\n __actionName: 'BRICK_ITEMS_PREV_PAGE'\n}\n\n/* next page */\nexport type BrickItemsActionNextPage = Action & {\n __actionName: 'BRICK_ITEMS_NEXT_PAGE'\n}\n\n/* jump page */\nexport type BrickItemsActionJumpPage = ActionWithParams & {\n __actionName: 'BRICK_ITEMS_JUMP_PAGE'\n params?: Array<{\n input: 'pageIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* open detail */\nexport type BrickItemsActionOpenDetail = ActionWithParams & {\n __actionName: 'BRICK_ITEMS_OPEN_DETAIL'\n params?: Array<{\n input: 'detailIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* back list */\nexport type BrickItemsActionBackList = Action & {\n __actionName: 'BRICK_ITEMS_BACK_LIST'\n}\n\n/* Trigger dynamic animation of item by data id or index */\nexport type BrickItemsActionDynamicAnimation = ActionWithParams & {\n __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION'\n params?: Array<\n | {\n input: 'mode'\n value?: 'list' | 'detail' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'brickId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'index'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'animationId'\n value?: string | DataLink | (() => Animation) | EventProperty\n mapping?: string\n }\n | {\n input: 'animationType'\n value?: 'once' | 'loop' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'animationResetInitialValue'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Reset dynamic action of item by data id or index */\nexport type BrickItemsActionDynamicAnimationReset = ActionWithParams & {\n __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_RESET'\n params?: Array<\n | {\n input: 'mode'\n value?: 'list' | 'detail' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'brickId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'index'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop dynamic action of item by data id or index */\nexport type BrickItemsActionDynamicAnimationStop = ActionWithParams & {\n __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_STOP'\n params?: Array<\n | {\n input: 'mode'\n value?: 'list' | 'detail' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'brickId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'index'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface BrickItemsDef {\n /*\nDefault property:\n{\n \"mode\": \"list\",\n \"items\": [],\n \"transformScriptEnabled\": false,\n \"transformScriptCode\": \"\\/\\* Global variable: inputs = { items, variables } \\*\\/\\nreturn inputs.items\",\n \"transformScriptVariables\": {},\n \"postTransformScriptEnabled\": false,\n \"postTransformScriptCode\": \"\\/\\*\\n * Global variable: inputs = {\\n * itemsLength, // items data length\\n * collections, // [{ index, item, renderList }] (all items data)\\n * collectionsCurrentPage, // [{ index, item, renderList }] (current page items data)\\n * renderList, // Flattened bricks of current page { frame: { x, y, width, height ... }, ... }\\n * variables\\n * }\\n \\*\\/\\nreturn inputs.renderList\",\n \"postTransformScriptVariables\": {},\n \"pageIndex\": 0,\n \"selectedItemIndex\": 0,\n \"allowPageOutOfBound\": true,\n \"standbySequenceInterval\": 500,\n \"standbySequenceRandom\": 0,\n \"brickEditWidth\": 10,\n \"brickEditHeight\": 10,\n \"detailBrickEditWidth\": 50,\n \"detailBrickEditHeight\": 50,\n \"orderMode\": \"horizontal\",\n \"resizeMode\": \"auto\",\n \"justifyContent\": \"start\",\n \"alignContent\": \"stretch\",\n \"detailResizeMode\": \"auto\",\n \"detailJustifyContent\": \"start\",\n \"detailAlignContent\": \"stretch\"\n}\n */\n property?: BrickBasicProperty & {\n /* Set current display to `list` or `detail` mode */\n mode?: 'list' | 'detail' | DataLink\n /* Items to generate bricks for rendering */\n items?: Array<any> | DataLink\n /* Enable Transform Script */\n transformScriptEnabled?: boolean | DataLink\n /* Code of Transform Script */\n transformScriptCode?: string | DataLink\n /* Variables used in Transform Script (object) */\n transformScriptVariables?: {} | DataLink\n /* Enable Post Transform Script */\n postTransformScriptEnabled?: boolean | DataLink\n /* Code of Post Transform Script */\n postTransformScriptCode?: string | DataLink\n /* Variables used in Post Transform Script (object) */\n postTransformScriptVariables?: {} | DataLink\n /* Path to get item property for generate brick id instead of use index */\n dataKeyPath?: string | DataLink\n /* Items per page (Default: Items size) */\n itemsPerPage?: number | DataLink\n /* Current page index for `list` mode */\n pageIndex?: number | DataLink\n /* Current selected item index for `detail` mode */\n selectedItemIndex?: number | DataLink\n /* Allow page out of bound */\n allowPageOutOfBound?: boolean | DataLink\n /* Sequentially run Standby Transition for each item */\n standbySequenceEnabled?: boolean | DataLink\n /* Delay time (ms) between each item */\n standbySequenceInterval?: number | DataLink\n /* Random delay time (ms) increase or decrease between each item (e.g. if 100ms then delay time will be -100ms ~ 100ms) */\n standbySequenceRandom?: number | DataLink\n /* Define frame width of Brick List editor */\n brickEditWidth?: number | DataLink\n /* Define frame height of Brick List editor */\n brickEditHeight?: number | DataLink\n /* Define frame width of Brick List editor for detail mode */\n detailBrickEditWidth?: number | DataLink\n /* Define frame height of Brick List editor */\n detailBrickEditHeight?: number | DataLink\n /* order of horizontal first or vertical first */\n orderMode?: 'horizontal' | 'vertical' | DataLink\n /* Max horizontal item quantity */\n horizontalMaxQuantity?: number | DataLink\n /* Max vertical item quantity */\n verticalMaxQuantity?: number | DataLink\n /* Resize mode */\n resizeMode?: 'auto' | 'fix' | DataLink\n /* Justify Content */\n justifyContent?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | DataLink\n /* Align Content */\n alignContent?:\n | 'stretch'\n | 'start'\n | 'end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | DataLink\n /* Resize mode for detail mode */\n detailResizeMode?: 'auto' | 'fix' | DataLink\n /* Align Content for detail mode */\n detailJustifyContent?: 'start' | 'end' | 'center' | DataLink\n /* Align Content for detail mode */\n detailAlignContent?: 'stretch' | 'start' | 'end' | 'center' | DataLink\n }\n /* Brick Definitions for render bricks for each item of `items` on `list` mode */\n brickList?:\n | Array<\n | DataLink\n | {\n title?: string | DataLink\n description?: string | DataLink\n hidden?: boolean | DataLink\n brickId?: string | DataLink\n brickIdPrefix?: string | DataLink\n templateKey?: string | DataLink\n property?: {} | DataLink\n animation?: {} | DataLink\n eventMap?: {} | DataLink\n outlet?: {} | DataLink\n stateGroup?: any\n propertyMapping?: {} | DataLink\n frame?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n width?: number | DataLink\n height?: number | DataLink\n type?: string | DataLink\n standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink\n standbyFrame?: DataLink | {}\n standbyOpacity?: number | DataLink\n standbyDelay?: number | DataLink\n standbyDelayRandom?: number | DataLink\n standbyEasing?:\n | DataLink\n | {\n default?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n x?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n y?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n width?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n height?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n opacity?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n }\n showingDelay?: number | DataLink\n renderOutOfViewport?: boolean | DataLink\n }\n show?: string | DataLink\n pressToOpenDetail?: boolean | DataLink\n pressToBackList?: boolean | DataLink\n }\n >\n | DataLink\n /* Brick Definitions for render bricks for each item of `items` on `detail` mode */\n brickDetails?:\n | Array<\n | DataLink\n | {\n title?: string | DataLink\n description?: string | DataLink\n hidden?: boolean | DataLink\n brickId?: string | DataLink\n brickIdPrefix?: string | DataLink\n templateKey?: string | DataLink\n property?: {} | DataLink\n animation?: {} | DataLink\n eventMap?: {} | DataLink\n outlet?: {} | DataLink\n stateGroup?: any\n propertyMapping?: {} | DataLink\n frame?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n width?: number | DataLink\n height?: number | DataLink\n type?: string | DataLink\n standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink\n standbyFrame?: DataLink | {}\n standbyOpacity?: number | DataLink\n standbyDelay?: number | DataLink\n standbyDelayRandom?: number | DataLink\n standbyEasing?:\n | DataLink\n | {\n default?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n x?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n y?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n width?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n height?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n opacity?:\n | DataLink\n | {\n method?: string | DataLink\n duration?: number | DataLink\n }\n }\n showingDelay?: number | DataLink\n renderOutOfViewport?: boolean | DataLink\n }\n show?: string | DataLink\n pressToOpenDetail?: boolean | DataLink\n pressToBackList?: boolean | DataLink\n }\n >\n | DataLink\n events?: BrickBasicEventsForItem & {\n /* Event on page render finished */\n onPageRender?: Array<\n EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageRender']>\n >\n /* Event on page change. */\n onPageChange?: Array<\n EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageChange']>\n >\n /* Event on page index out of bound. */\n onPageOutOfBound?: Array<\n EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageOutOfBound']>\n >\n /* Event on into `detail` mode */\n onIntoDetailMode?: Array<\n EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoDetailMode']>\n >\n /* Event on into `list` mode. */\n onIntoListMode?: Array<\n EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoListMode']>\n >\n /* Event on render error */\n onError?: Array<EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onError']>>\n }\n outlets?: {\n /* Catched error message */\n error?: () => Data<string>\n /* Current render mode */\n mode?: () => Data<string>\n /* Current page index */\n pageIndex?: () => Data<number>\n /* Current page size */\n pageSize?: () => Data<number>\n /* Selected item index of detail mode */\n selectedItemIndex?: () => Data<number>\n /* Page is out of bound */\n pageIsOutOfBound?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPageRender?: AnimationOrGetter\n onPageChange?: AnimationOrGetter\n onPageOutOfBound?: AnimationOrGetter\n onIntoDetailMode?: AnimationOrGetter\n onIntoListMode?: AnimationOrGetter\n onError?: AnimationOrGetter\n }\n}\n\n/* Data-driven list/grid. Maps items array to brick templates via propertyMapping, with pagination and detail mode support */\nexport type BrickItems = Brick &\n BrickItemsDef & {\n templateKey: 'BRICK_ITEMS'\n switches?: Array<\n SwitchDef &\n BrickItemsDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'error'\n | 'mode'\n | 'pageIndex'\n | 'pageSize'\n | 'selectedItemIndex'\n | 'pageIsOutOfBound'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Lottie.d.ts":"/* Auto generated by build script\n *\n * Lottie animation player supporting .json and .dotlottie formats. Supports speed, loop, frame range control, color/text filters, and hardware rendering\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Play animation */\nexport type BrickLottieActionPlay = ActionWithParams & {\n __actionName: 'BRICK_LOTTIE_PLAY'\n params?: Array<\n | {\n input: 'startFrame'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'endFrame'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Pause animation */\nexport type BrickLottieActionPause = Action & {\n __actionName: 'BRICK_LOTTIE_PAUSE'\n}\n\n/* Resume animation */\nexport type BrickLottieActionResume = Action & {\n __actionName: 'BRICK_LOTTIE_RESUME'\n}\n\n/* Stop animation */\nexport type BrickLottieActionStop = Action & {\n __actionName: 'BRICK_LOTTIE_STOP'\n}\n\n/* Reset animation */\nexport type BrickLottieActionReset = Action & {\n __actionName: 'BRICK_LOTTIE_RESET'\n}\n\ninterface BrickLottieDef {\n /*\nDefault property:\n{\n \"loop\": true,\n \"autoPlay\": true,\n \"resizeMode\": \"contain\",\n \"renderMode\": \"auto\"\n}\n */\n property?: BrickBasicProperty & {\n /* The animation json config content from uri */\n uri?: string | DataLink\n /* The checksum of `uri` */\n md5?: string | DataLink\n /* The animation json config content(The `uri` will be ignored if `source` is defined) */\n source?: {} | DataLink\n /* The speed the animation will progress. This only affects the imperative API. Sending a negative value will reverse the animation. */\n speed?: number | DataLink\n /* A boolean flag indicating whether or not the animation should loop. */\n loop?: boolean | DataLink\n /* A boolean flag indicating whether or not the animation should start automatically when mounted. This only affects the imperative API. */\n autoPlay?: boolean | DataLink\n /* The animation resize mode */\n resizeMode?: 'cover' | 'contain' | 'center' | DataLink\n /* A flag to set whether or not to render with hardware or software acceleration (Not supported for iOS) */\n renderMode?: 'auto' | 'hardware' | 'software' | DataLink\n /* Replace color (as hex string) by keypath */\n colorFilters?:\n | Array<\n | DataLink\n | {\n keypath?: string | DataLink\n color?: string | DataLink\n }\n >\n | DataLink\n /* Replace color (as hex string) by find text. Use text filters will disable glyphs text render / force software render mode, This means that a specific font needs to be loaded. */\n textFilters?:\n | Array<\n | DataLink\n | {\n find?: string | DataLink\n replace?: string | DataLink\n }\n >\n | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n /* Event of the animation finished */\n onAnimationFinish?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Lottie']['onAnimationFinish']>\n >\n /* Event of the uri on load failed */\n onAnimationFailure?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Lottie']['onAnimationFailure']>\n >\n /* Event of the animation on loop */\n onAnimationLoop?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n onAnimationFinish?: AnimationOrGetter\n onAnimationFailure?: AnimationOrGetter\n onAnimationLoop?: AnimationOrGetter\n }\n}\n\n/* Lottie animation player supporting .json and .dotlottie formats. Supports speed, loop, frame range control, color/text filters, and hardware rendering */\nexport type BrickLottie = Brick &\n BrickLottieDef & {\n templateKey: 'BRICK_LOTTIE'\n switches?: Array<\n SwitchDef &\n BrickLottieDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Maps.d.ts":"/* Auto generated by build script\n *\n * Interactive map with markers, paths, and location tracking. Supports Google Maps (iOS/Android/Desktop/Web) and Apple Maps (iOS/tvOS)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Zoom in the map */\nexport type BrickMapsActionZoomIn = Action & {\n __actionName: 'BRICK_MAPS_ZOOM_IN'\n}\n\n/* Zoom out the map */\nexport type BrickMapsActionZoomOut = Action & {\n __actionName: 'BRICK_MAPS_ZOOM_OUT'\n}\n\n/* Pan the map in a direction */\nexport type BrickMapsActionPan = ActionWithParams & {\n __actionName: 'BRICK_MAPS_PAN'\n params?: Array<{\n input: 'panDirection'\n value?: 'up' | 'down' | 'left' | 'right' | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Navigate to a specific location */\nexport type BrickMapsActionNavigateTo = ActionWithParams & {\n __actionName: 'BRICK_MAPS_NAVIGATE_TO'\n params?: Array<\n | {\n input: 'targetLatitude'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'targetLongitude'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'targetZoom'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Focus on a marker by ID */\nexport type BrickMapsActionFocusMarker = ActionWithParams & {\n __actionName: 'BRICK_MAPS_FOCUS_MARKER'\n params?: Array<{\n input: 'markerId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Reset map to initial position */\nexport type BrickMapsActionReset = Action & {\n __actionName: 'BRICK_MAPS_RESET'\n}\n\n/* Fit map to show all markers */\nexport type BrickMapsActionFitToMarkers = ActionWithParams & {\n __actionName: 'BRICK_MAPS_FIT_TO_MARKERS'\n params?: Array<\n | {\n input: 'edgePadding'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'animated'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface BrickMapsDef {\n /*\nDefault property:\n{\n \"provider\": \"google\",\n \"apiKey\": \"\",\n \"initialLatitude\": 25.033,\n \"initialLongitude\": 121.5654,\n \"initialZoom\": 10,\n \"mapType\": \"standard\",\n \"mapTheme\": \"standard\",\n \"showUserLocation\": false,\n \"showCompass\": true,\n \"showZoomControls\": true,\n \"scrollEnabled\": true,\n \"zoomEnabled\": true,\n \"rotateEnabled\": true,\n \"markers\": [],\n \"customMapStyle\": [],\n \"showTraffic\": false,\n \"showBuildings\": false,\n \"showIndoors\": true,\n \"minZoomLevel\": 1,\n \"maxZoomLevel\": 20,\n \"followUserLocation\": false,\n \"showPath\": false,\n \"pathStrokeColor\": \"#4285F4\",\n \"pathStrokeWidth\": 3\n}\n */\n property?: BrickBasicProperty & {\n /* Map provider (iOS/tvOS only - Android and Web always use Google Maps) */\n provider?: 'google' | 'apple' | DataLink\n /* Google Maps API Key (Web only) */\n apiKey?: string | DataLink\n /* Initial latitude */\n initialLatitude?: number | DataLink\n /* Initial longitude */\n initialLongitude?: number | DataLink\n /* Initial zoom level (1-20) */\n initialZoom?: number | DataLink\n /* Map type */\n mapType?: 'standard' | 'satellite' | 'hybrid' | 'terrain' | DataLink\n /* Map theme preset */\n mapTheme?: 'standard' | 'dark' | 'night' | 'retro' | 'silver' | 'aubergine' | DataLink\n /* Show user location button */\n showUserLocation?: boolean | DataLink\n /* Show compass */\n showCompass?: boolean | DataLink\n /* Show zoom controls */\n showZoomControls?: boolean | DataLink\n /* Enable scrolling */\n scrollEnabled?: boolean | DataLink\n /* Enable zooming */\n zoomEnabled?: boolean | DataLink\n /* Enable rotating */\n rotateEnabled?: boolean | DataLink\n /* Map markers data */\n markers?:\n | Array<\n | DataLink\n | {\n id?: string | DataLink\n latitude?: number | DataLink\n longitude?: number | DataLink\n title?: string | DataLink\n description?: string | DataLink\n color?: string | DataLink\n icon?: string | DataLink\n }\n >\n | DataLink\n /* Custom map style (array of Google Maps style objects) */\n customMapStyle?:\n | Array<\n | DataLink\n | {\n featureType?: string | DataLink\n elementType?: string | DataLink\n stylers?: Array<{} | DataLink> | DataLink\n }\n >\n | DataLink\n /* Show traffic layer */\n showTraffic?: boolean | DataLink\n /* Show buildings in 3D */\n showBuildings?: boolean | DataLink\n /* Show indoor maps */\n showIndoors?: boolean | DataLink\n /* Minimum zoom level */\n minZoomLevel?: number | DataLink\n /* Maximum zoom level */\n maxZoomLevel?: number | DataLink\n /* Follow user location */\n followUserLocation?: boolean | DataLink\n /* Show path between markers */\n showPath?: boolean | DataLink\n /* Path stroke color */\n pathStrokeColor?: string | DataLink\n /* Path stroke width */\n pathStrokeWidth?: number | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n /* Event when a marker is pressed */\n onMarkerPress?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Maps']['onMarkerPress']>\n >\n /* Event when the map is pressed */\n onMapPress?: Array<EventAction<string & keyof TemplateEventPropsMap['Maps']['onMapPress']>>\n /* Event when the map region changes */\n onRegionChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Maps']['onRegionChange']>\n >\n /* Event when the map is ready */\n onReady?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n onMarkerPress?: AnimationOrGetter\n onMapPress?: AnimationOrGetter\n onRegionChange?: AnimationOrGetter\n onReady?: AnimationOrGetter\n }\n}\n\n/* Interactive map with markers, paths, and location tracking. Supports Google Maps (iOS/Android/Desktop/Web) and Apple Maps (iOS/tvOS) */\nexport type BrickMaps = Brick &\n BrickMapsDef & {\n templateKey: 'BRICK_MAPS'\n switches?: Array<\n SwitchDef &\n BrickMapsDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/QrCode.d.ts":"/* Auto generated by build script\n *\n * Generate and display QR codes from text or URL values\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickQrcodeDef {\n /*\nDefault property:\n{\n \"value\": \"\",\n \"positiveColor\": \"#1e252a\",\n \"negativeColor\": \"transparent\",\n \"padding\": 0,\n \"linearGradientEnabled\": false,\n \"linearGradientStart\": \"black\",\n \"linearGradientEnd\": \"black\",\n \"linearGradientDirection\": [\n \"0%\",\n \"0%\",\n \"100%\",\n \"100%\"\n ],\n \"logoSize\": 20,\n \"logoBackgroundColor\": \"transparent\"\n}\n */\n property?: BrickBasicProperty & {\n /* The QRCode content */\n value?: string | DataLink\n /* The foreground color of QRCode */\n positiveColor?: string | DataLink\n /* The background color of QRCode */\n negativeColor?: string | DataLink\n /* Quiet zone around the qr */\n padding?: number | DataLink\n /* Enables or disables linear gradient */\n linearGradientEnabled?: boolean | DataLink\n /* Linear gradient start color */\n linearGradientStart?: string | DataLink\n /* Linear gradient end color */\n linearGradientEnd?: string | DataLink\n /* Linear gradient direction ('0%', '0%', '100%', '100%') */\n linearGradientDirection?: Array<string | DataLink> | DataLink\n /* Logo image source */\n logoPath?: string | DataLink\n /* The checksum of logo file */\n md5?: string | DataLink\n /* Logo image size (% of QRCode) */\n logoSize?: number | DataLink\n /* The logo gets a filled quadratic background with this color. */\n logoBackgroundColor?: string | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n }\n}\n\n/* Generate and display QR codes from text or URL values */\nexport type BrickQrcode = Brick &\n BrickQrcodeDef & {\n templateKey: 'BRICK_QRCODE'\n switches?: Array<\n SwitchDef &\n BrickQrcodeDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Rect.d.ts":"/* Auto generated by build script\n *\n * Rectangle shape with customizable fill, border, radius, shadow, and blur\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickRectDef {\n /*\nDefault property:\n{\n \"linearGradientEnabled\": false,\n \"linearGradientColors\": [\n \"#000000\",\n \"#FFFFFF\"\n ],\n \"linearGradientStart\": {\n \"x\": 0,\n \"y\": 0\n },\n \"linearGradientEnd\": {\n \"x\": 1,\n \"y\": 1\n },\n \"linearGradientLocations\": [\n 0,\n 1\n ],\n \"blurEnabled\": false,\n \"blurVariant\": \"blur\",\n \"blurType\": \"light\",\n \"blurAmount\": 10,\n \"blurDirection\": \"blurredTopClearBottom\",\n \"blurStartOffset\": 0,\n \"blurGlassType\": \"regular\",\n \"blurGlassOpacity\": 0.5,\n \"blurGlassInteractive\": false\n}\n */\n property?: BrickBasicProperty & {\n /* Enables or disables linear gradient */\n linearGradientEnabled?: boolean | DataLink\n /* An array of at least two color values that represent gradient colors */\n linearGradientColors?: Array<string | DataLink> | DataLink\n /* An optional object of the following type: { x: number, y: number } */\n linearGradientStart?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n }\n /* Same as start, but for the end of the gradient */\n linearGradientEnd?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n }\n /* An optional array of numbers defining the location of each gradient color stop */\n linearGradientLocations?: Array<number | DataLink> | DataLink\n /* Enable blur effect.\n Not supported on Desktop (Electron) and Web. \n Avoid using opacity prop with blur — use alpha backgroundColor (e.g. rgba) instead. */\n blurEnabled?: boolean | DataLink\n /* Blur variant */\n blurVariant?: 'blur' | 'progressiveBlur' | 'liquidGlass' | DataLink\n /* Blur type (blur variant) */\n blurType?: 'xlight' | 'light' | 'dark' | 'regular' | 'prominent' | DataLink\n /* Blur amount (0 ~ 100, blur variant) */\n blurAmount?: number | DataLink\n /* Progressive blur direction (progressiveBlur variant) */\n blurDirection?:\n | 'blurredTopClearBottom'\n | 'blurredBottomClearTop'\n | 'blurredCenterClearTopAndBottom'\n | DataLink\n /* Progressive blur start offset (0 ~ 1, progressiveBlur variant) */\n blurStartOffset?: number | DataLink\n /* Glass type (liquidGlass variant, iOS 26+) */\n blurGlassType?: 'clear' | 'regular' | DataLink\n /* Glass tint color (liquidGlass variant) */\n blurGlassTintColor?: string | DataLink\n /* Glass opacity (0 ~ 1, liquidGlass variant) */\n blurGlassOpacity?: number | DataLink\n /* Enable glass interaction (liquidGlass variant) */\n blurGlassInteractive?: boolean | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n }\n}\n\n/* Rectangle shape with customizable fill, border, radius, shadow, and blur */\nexport type BrickRect = Brick &\n BrickRectDef & {\n templateKey: 'BRICK_RECT'\n switches?: Array<\n SwitchDef &\n BrickRectDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/RichText.d.ts":"/* Auto generated by build script\n *\n * Rich text with HTML or Markdown content rendering, multiple fonts, colors, heading levels (h1-h6), and inline images\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickRichTextDef {\n /*\nDefault property:\n{\n \"content\": \"\",\n \"renderImage\": false,\n \"renderMarkdown\": false,\n \"color\": \"#000\",\n \"fontWeight\": \"normal\",\n \"fontStyle\": \"normal\",\n \"fontSizes\": {\n \"base\": 3,\n \"h1\": 6.857142857142857,\n \"h2\": 5.714285714285714,\n \"h3\": 4.011428571428572,\n \"h4\": 3.428571428571429,\n \"h5\": 2.845714285714286,\n \"h6\": 2.285714285714286\n }\n}\n */\n property?: BrickBasicProperty & {\n /* The text content */\n content?: string | DataLink\n /* Render Image */\n renderImage?: boolean | DataLink\n /* Treat content as Markdown (converted to HTML before rendering) */\n renderMarkdown?: boolean | DataLink\n /* The text color */\n color?: string | DataLink\n /* Specifies font weight. The values 'normal' and are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen. */\n fontWeight?:\n | 'normal'\n | 'bold'\n | '100'\n | '200'\n | '300'\n | '400'\n | '500'\n | '600'\n | '700'\n | '800'\n | '900'\n | DataLink\n /* The text font style */\n fontStyle?: 'normal' | 'italic' | DataLink\n /* The text font family */\n fontFamily?: string | DataLink\n /* The text font size definition (base and headers) */\n fontSizes?:\n | DataLink\n | {\n base?: number | DataLink // BRICKS Grid unit\n h1?: number | DataLink // BRICKS Grid unit\n h2?: number | DataLink // BRICKS Grid unit\n h3?: number | DataLink // BRICKS Grid unit\n h4?: number | DataLink // BRICKS Grid unit\n h5?: number | DataLink // BRICKS Grid unit\n h6?: number | DataLink // BRICKS Grid unit\n }\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n }\n}\n\n/* Rich text with HTML or Markdown content rendering, multiple fonts, colors, heading levels (h1-h6), and inline images */\nexport type BrickRichText = Brick &\n BrickRichTextDef & {\n templateKey: 'BRICK_RICH_TEXT'\n switches?: Array<\n SwitchDef &\n BrickRichTextDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Rive.d.ts":"/* Auto generated by build script\n *\n * Render Rive (.riv) animations with state machine input control, text run updates, and artboard selection\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Play animation */\nexport type BrickRiveActionPlay = ActionWithParams & {\n __actionName: 'BRICK_RIVE_PLAY'\n params?: Array<\n | {\n input: 'animationName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'loop'\n value?: 'auto' | 'oneShot' | 'loop' | 'pingPong' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'direction'\n value?: 'auto' | 'backwards' | 'forwards' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'isStateMachine'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Pause animation */\nexport type BrickRiveActionPause = Action & {\n __actionName: 'BRICK_RIVE_PAUSE'\n}\n\n/* Stop animation */\nexport type BrickRiveActionStop = Action & {\n __actionName: 'BRICK_RIVE_STOP'\n}\n\n/* Reset animation */\nexport type BrickRiveActionReset = Action & {\n __actionName: 'BRICK_RIVE_RESET'\n}\n\n/* Fire state */\nexport type BrickRiveActionFireState = ActionWithParams & {\n __actionName: 'BRICK_RIVE_FIRE_STATE'\n params?: Array<\n | {\n input: 'stateMachineName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'inputName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Set input state */\nexport type BrickRiveActionSetInputState = ActionWithParams & {\n __actionName: 'BRICK_RIVE_SET_INPUT_STATE'\n params?: Array<\n | {\n input: 'stateMachineName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'inputName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'value'\n value?: any | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Set text run value. Text Run name need to defined as unique name in Rive file. (Ref: https://rive.app/community/doc/text/docn2E6y1lXo) */\nexport type BrickRiveActionSetTextRunValue = ActionWithParams & {\n __actionName: 'BRICK_RIVE_SET_TEXT_RUN_VALUE'\n params?: Array<\n | {\n input: 'textRunName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'value'\n value?: any | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface BrickRiveDef {\n /*\nDefault property:\n{\n \"autoplay\": true,\n \"alignment\": \"center\",\n \"fit\": \"contain\"\n}\n */\n property?: BrickBasicProperty & {\n /* Rive file url */\n url?: string | DataLink\n /* The checksum of `url` */\n md5?: string | DataLink\n /* Autoplay the animation */\n autoplay?: boolean | DataLink\n /* Alignment of the animation */\n alignment?:\n | 'topLeft'\n | 'topCenter'\n | 'topRight'\n | 'centerLeft'\n | 'center'\n | 'centerRight'\n | 'bottomLeft'\n | 'bottomCenter'\n | 'bottomRight'\n | DataLink\n /* Fit mode of the animation */\n fit?:\n | 'cover'\n | 'contain'\n | 'fill'\n | 'fitWidth'\n | 'fitHeight'\n | 'none'\n | 'scaleDown'\n | 'layout'\n | DataLink\n /* Artboard name */\n artboardName?: string | DataLink\n /* Animation name */\n animationName?: string | DataLink\n /* State machine name */\n stateMachineName?: string | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of animation play */\n onPlay?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onPlay']>>\n /* Event of animation pause */\n onPause?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onPause']>>\n /* Event of animation stop */\n onStop?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onStop']>>\n /* Event of animation loop end */\n onLoopEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onLoopEnd']>>\n /* Event of state changed */\n onStateChanged?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Rive']['onStateChanged']>\n >\n /* Event of error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onError']>>\n /* Event of Rive general event received */\n onRiveGeneralEvent?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Rive']['onRiveGeneralEvent']>\n >\n /* Event of Rive open-url event received */\n onRiveOpenUrlEvent?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Rive']['onRiveOpenUrlEvent']>\n >\n }\n animation?: AnimationBasicEvents & {\n onPlay?: AnimationOrGetter\n onPause?: AnimationOrGetter\n onStop?: AnimationOrGetter\n onLoopEnd?: AnimationOrGetter\n onStateChanged?: AnimationOrGetter\n onError?: AnimationOrGetter\n onRiveGeneralEvent?: AnimationOrGetter\n onRiveOpenUrlEvent?: AnimationOrGetter\n }\n}\n\n/* Render Rive (.riv) animations with state machine input control, text run updates, and artboard selection */\nexport type BrickRive = Brick &\n BrickRiveDef & {\n templateKey: 'BRICK_RIVE'\n switches?: Array<\n SwitchDef &\n BrickRiveDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: ''\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Scene3D.d.ts":"/* Auto generated by build script\n *\n * 3D scene renderer powered by WebGPU/WebGL with declarative objects, lights, camera, controls, and a script hook (tvOS support is experimental)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Add an object to the scene */\nexport type BrickScene3DActionAddObject = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_ADD_OBJECT'\n params?: Array<\n | {\n input: 'objectId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'objectType'\n value?:\n | 'gltf'\n | 'usd'\n | 'usdz'\n | 'box'\n | 'sphere'\n | 'plane'\n | 'cylinder'\n | 'cone'\n | 'torus'\n | 'text'\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'objectUrl'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'objectMd5'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'objectPosition'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'objectRotation'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'objectScale'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'objectColor'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Remove an object by id */\nexport type BrickScene3DActionRemoveObject = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_REMOVE_OBJECT'\n params?: Array<{\n input: 'objectId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Update an object's transform / appearance */\nexport type BrickScene3DActionUpdateObject = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_UPDATE_OBJECT'\n params?: Array<\n | {\n input: 'objectId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'objectPosition'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'objectRotation'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'objectScale'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'objectVisible'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'objectColor'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'objectNodes'\n value?: any | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Move the camera (optionally animated) */\nexport type BrickScene3DActionSetCamera = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_SET_CAMERA'\n params?: Array<\n | {\n input: 'cameraPosition'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'cameraTarget'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'cameraFov'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'cameraAnimateMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Aim the camera at an object */\nexport type BrickScene3DActionLookAt = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_LOOK_AT'\n params?: Array<{\n input: 'objectId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Play an animation clip on a gltf object */\nexport type BrickScene3DActionPlayAnimation = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_PLAY_ANIMATION'\n params?: Array<\n | {\n input: 'objectId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'animationName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'animationLoop'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'animationSpeed'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop an animation clip */\nexport type BrickScene3DActionStopAnimation = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_STOP_ANIMATION'\n params?: Array<\n | {\n input: 'objectId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'animationName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Replace the background (color or HDR image) */\nexport type BrickScene3DActionSetBackground = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_SET_BACKGROUND'\n params?: Array<\n | {\n input: 'backgroundColor'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'backgroundHdrUrl'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'backgroundMd5'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Toggle interaction controls at runtime */\nexport type BrickScene3DActionSetControls = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_SET_CONTROLS'\n params?: Array<\n | {\n input: 'controlsEnabled'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'controlsAutoRotate'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'controlsAutoRotateSpeed'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Capture a screenshot (file URI emitted to BRICK_SCENE_3D_LAST_SCREENSHOT_URI) */\nexport type BrickScene3DActionScreenshot = ActionWithParams & {\n __actionName: 'BRICK_SCENE_3D_SCREENSHOT'\n params?: Array<\n | {\n input: 'screenshotFormat'\n value?: 'png' | 'jpeg' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'screenshotQuality'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Reset the scene back to the declared `objects` / `lights` / `camera` props */\nexport type BrickScene3DActionReset = Action & {\n __actionName: 'BRICK_SCENE_3D_RESET'\n}\n\ninterface BrickScene3DDef {\n /*\nDefault property:\n{\n \"backend\": \"auto\",\n \"antialias\": true,\n \"alpha\": false,\n \"shadows\": false,\n \"toneMapping\": \"aces\",\n \"exposure\": 1,\n \"pixelRatio\": 0,\n \"colorSpace\": \"srgb\",\n \"powerPreference\": \"default\",\n \"frameLoop\": \"always\",\n \"cameraType\": \"perspective\",\n \"cameraPosition\": {\n \"x\": 3,\n \"y\": 3,\n \"z\": 5\n },\n \"cameraTarget\": {\n \"x\": 0,\n \"y\": 0,\n \"z\": 0\n },\n \"fov\": 50,\n \"near\": 0.1,\n \"far\": 1000,\n \"zoom\": 1,\n \"controls\": \"none\",\n \"autoRotate\": false,\n \"autoRotateSpeed\": 2,\n \"enableDamping\": true,\n \"minDistance\": 0.5,\n \"maxDistance\": 50,\n \"minPolarAngle\": 0,\n \"backgroundBlur\": 0,\n \"backgroundIntensity\": 1,\n \"envMapProjection\": \"equirect\",\n \"envIntensity\": 1,\n \"envRotation\": 0,\n \"groundEnabled\": false,\n \"groundColor\": \"\",\n \"groundOpacity\": 0.5,\n \"groundY\": 0,\n \"groundSize\": 100,\n \"ambientColor\": \"#ffffff\",\n \"ambientIntensity\": 0.4,\n \"lights\": [],\n \"objects\": [],\n \"bloom\": false,\n \"bloomStrength\": 0.6,\n \"bloomThreshold\": 1,\n \"bloomRadius\": 0.4,\n \"fxaa\": false,\n \"ssao\": false,\n \"frameRuntime\": \"ui\",\n \"variables\": {},\n \"eventScriptEvents\": \"none\",\n \"eventScriptKeys\": [],\n \"eventScriptKeyRepeat\": false,\n \"eventScriptKeyRepeatInterval\": 90,\n \"enableRaycast\": false,\n \"emitFrameEvents\": false,\n \"frameEventInterval\": 250\n}\n */\n property?: BrickBasicProperty & {\n /* Renderer backend. `auto` uses WebGPU when available and falls back to WebGL. */\n backend?: 'auto' | 'webgpu' | 'webgl' | DataLink\n /* Enable multi-sample antialiasing */\n antialias?: boolean | DataLink\n /* Render with a transparent canvas (alpha channel) */\n alpha?: boolean | DataLink\n /* Enable shadow mapping for lights and meshes */\n shadows?: boolean | DataLink\n /* Tone mapping curve */\n toneMapping?: 'none' | 'linear' | 'reinhard' | 'cineon' | 'aces' | 'agx' | DataLink\n /* Tone mapping exposure */\n exposure?: number | DataLink\n /* Render pixel ratio. `0` follows the device pixel ratio (capped at 2 on web; native renders at 1) */\n pixelRatio?: number | DataLink\n /* Output color space */\n colorSpace?: 'srgb' | 'srgb-linear' | DataLink\n /* GPU power preference */\n powerPreference?: 'default' | 'high-performance' | 'low-power' | DataLink\n /* Frame loop policy. `always` renders every frame; `whenVisible` pauses off-screen; `demand` renders only on prop change or invalidate */\n frameLoop?: 'always' | 'whenVisible' | 'demand' | DataLink\n /* Camera projection type */\n cameraType?: 'perspective' | 'orthographic' | DataLink\n /* Camera position in world space */\n cameraPosition?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n /* Point the camera looks at */\n cameraTarget?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n /* Field of view in degrees (perspective camera only) */\n fov?: number | DataLink\n /* Near clipping plane */\n near?: number | DataLink\n /* Far clipping plane */\n far?: number | DataLink\n /* Camera zoom factor */\n zoom?: number | DataLink\n /* Interaction controls */\n controls?: 'none' | 'orbit' | 'pan-zoom' | DataLink\n /* Auto-rotate the camera around the target */\n autoRotate?: boolean | DataLink\n /* Auto-rotate speed (units per second) */\n autoRotateSpeed?: number | DataLink\n /* Smooth interaction with damping */\n enableDamping?: boolean | DataLink\n /* Minimum dolly distance */\n minDistance?: number | DataLink\n /* Maximum dolly distance */\n maxDistance?: number | DataLink\n /* Minimum polar angle (radians) */\n minPolarAngle?: number | DataLink\n /* Maximum polar angle (radians) */\n maxPolarAngle?: number | DataLink\n /* Background solid color (used when no background image is set) */\n backgroundColor?: string | DataLink\n /* Equirect environment image URL (HDR/EXR/LDR). Used for PBR image-based lighting; also shown as the scene background unless `backgroundColor` is set */\n backgroundImage?: string | DataLink\n /* Background image blurriness (0–1, only when the environment image is shown as background) */\n backgroundBlur?: number | DataLink\n /* Background image intensity multiplier */\n backgroundIntensity?: number | DataLink\n /* Environment map projection. `none` disables environment lighting from the background image */\n envMapProjection?: 'equirect' | 'cube' | 'none' | DataLink\n /* Environment lighting intensity multiplier */\n envIntensity?: number | DataLink\n /* Environment rotation around the Y axis (radians, also rotates the background) */\n envRotation?: number | DataLink\n /* Fog color */\n fogColor?: string | DataLink\n /* Fog near distance */\n fogNear?: number | DataLink\n /* Fog far distance */\n fogFar?: number | DataLink\n /* Show a ground plane that catches shadows (enable `shadows` and a `castShadow` light for the shadow itself) */\n groundEnabled?: boolean | DataLink\n /* Ground color. Empty renders a shadow-only (invisible) catcher */\n groundColor?: string | DataLink\n /* Shadow opacity for the shadow-only ground (0–1) */\n groundOpacity?: number | DataLink\n /* Ground plane height (Y position) */\n groundY?: number | DataLink\n /* Ground plane size (width and depth) */\n groundSize?: number | DataLink\n /* Ambient light color */\n ambientColor?: string | DataLink\n /* Ambient light intensity */\n ambientIntensity?: number | DataLink\n /* Scene lights. Each entry: `{ type, color, intensity, position, target, castShadow, ... }` */\n lights?:\n | Array<\n | DataLink\n | {\n type?: 'ambient' | 'directional' | 'point' | 'spot' | 'hemisphere' | DataLink\n color?: string | DataLink\n intensity?: number | DataLink\n position?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n target?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n castShadow?: boolean | DataLink\n distance?: number | DataLink\n decay?: number | DataLink\n angle?: number | DataLink\n penumbra?: number | DataLink\n groundColor?: string | DataLink\n }\n >\n | DataLink\n /* Scene objects. Each entry: `{ id, type, url?, md5?, position, rotation, scale, color?, animation?, visible, nodes? }`. `nodes` overrides named nodes inside a loaded model: `[{ name, visible?, position?, rotation?, scale?, color?, emissive?, emissiveIntensity?, metalness?, roughness?, opacity? }]` */\n objects?:\n | Array<\n | DataLink\n | {\n id?: string | DataLink\n type?:\n | 'gltf'\n | 'usd'\n | 'usdz'\n | 'box'\n | 'sphere'\n | 'plane'\n | 'cylinder'\n | 'cone'\n | 'torus'\n | 'text'\n | DataLink\n url?: string | DataLink\n md5?: string | DataLink\n position?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n rotation?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n scale?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n color?: string | DataLink\n text?: string | DataLink\n animation?: string | DataLink\n visible?: boolean | DataLink\n castShadow?: boolean | DataLink\n receiveShadow?: boolean | DataLink\n nodes?:\n | Array<\n | DataLink\n | {\n name?: string | DataLink\n visible?: boolean | DataLink\n position?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n rotation?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n scale?:\n | DataLink\n | {\n x?: number | DataLink\n y?: number | DataLink\n z?: number | DataLink\n }\n color?: string | DataLink\n emissive?: string | DataLink\n emissiveIntensity?: number | DataLink\n metalness?: number | DataLink\n roughness?: number | DataLink\n opacity?: number | DataLink\n }\n >\n | DataLink\n }\n >\n | DataLink\n /* Enable bloom post-effect */\n bloom?: boolean | DataLink\n /* Bloom intensity */\n bloomStrength?: number | DataLink\n /* Bloom luminance threshold. The chain is HDR — values ≥ 1 keep bloom on highlights only */\n bloomThreshold?: number | DataLink\n /* Bloom radius (glow spread) */\n bloomRadius?: number | DataLink\n /* Enable FXAA antialiasing post-effect */\n fxaa?: boolean | DataLink\n /* Enable screen-space ambient occlusion (SSAO) */\n ssao?: boolean | DataLink\n /* Where the per-frame script runs. `ui` dispatches the data-op to reanimated's UI runtime via `runOnUI` (slightly less Promise overhead). `js` evaluates on the worklets-core thread via `runOnUIAsync` (Promise-resolved). Pick `js` if you don't have `react-native-reanimated` installed. */\n frameRuntime?: 'js' | 'ui' | DataLink\n /* JS expression or script. Pure expressions run on the worklet thread per frame (`time`, `dt`, `objects`, `camera`, `variables` are in scope). Statement-form scripts run once on mount via the JS sandbox. */\n script?: string | DataLink\n /* JS expression run when an enabled key or pointer event fires. It receives `event` / `input` plus `time`, `objects`, `camera`, and `variables`, and returns the same mutation map as `script`. */\n eventScript?: string | DataLink\n /* Object of values exposed to the inline `script` as `variables.<key>`. Updates re-flow into the script on the next frame. */\n variables?: DataLink | {}\n /* Which input events can run `eventScript`. `none` disables it; `all` enables key + pointer; `keys` and `pointer` enable only that input family. */\n eventScriptEvents?: 'none' | 'all' | 'keys' | 'pointer' | DataLink\n /* Optional key allowlist for `eventScript` (`pressedKey`, `code`, or `keyCode`). Empty means every key. */\n eventScriptKeys?:\n | string\n | DataLink\n | Array<string | DataLink | number | DataLink | DataLink>\n | DataLink\n | DataLink\n /* Repeat `keydown` event scripts while an allowed key is held. Repeat events include `event.repeat === true`. */\n eventScriptKeyRepeat?: boolean | DataLink\n /* Interval in milliseconds for repeated key event scripts. */\n eventScriptKeyRepeatInterval?: number | DataLink\n /* Enable pointer raycast → emits `BRICK_SCENE_3D_ON_OBJECT_CLICK` / `_ON_OBJECT_HOVER` */\n enableRaycast?: boolean | DataLink\n /* Emit periodic `BRICK_SCENE_3D_ON_FRAME` events */\n emitFrameEvents?: boolean | DataLink\n /* Throttle interval for frame events (ms) */\n frameEventInterval?: number | DataLink\n }\n events?: BrickBasicEvents & {\n /* An asset finished loading (gltf/usd/usdz/hdr/texture) */\n onLoad?: Array<EventAction<string & keyof TemplateEventPropsMap['Scene3D']['onLoad']>>\n /* An asset failed to load */\n onLoadError?: Array<EventAction<string & keyof TemplateEventPropsMap['Scene3D']['onLoadError']>>\n /* Pointer click hit an object */\n onObjectClick?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Scene3D']['onObjectClick']>\n >\n /* Pointer hover entered or left an object */\n onObjectHover?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Scene3D']['onObjectHover']>\n >\n /* An animation clip finished */\n onAnimationEnd?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Scene3D']['onAnimationEnd']>\n >\n /* Periodic frame tick (throttled by `frameEventInterval`, gated by `emitFrameEvents`) */\n onFrame?: Array<EventAction<string & keyof TemplateEventPropsMap['Scene3D']['onFrame']>>\n /* Inline `script` failed at compile, init, or per-frame execution */\n onScriptError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Scene3D']['onScriptError']>\n >\n }\n outlets?: {\n /* Latest frame rate (frames per second) */\n fps?: () => Data<number>\n /* Number of objects in the scene */\n objectCount?: () => Data<number>\n /* ID of the most recently selected object (via raycast click) */\n selectedObjectId?: () => Data<string>\n /* URI of the most recent screenshot */\n lastScreenshotUri?: () => Data<string>\n /* Snapshot of scene state (objects, camera, lights) */\n sceneState?: () => Data<{\n objects?: any[]\n camera?: { [key: string]: any }\n lights?: any[]\n [key: string]: any\n }>\n }\n animation?: AnimationBasicEvents & {\n onLoad?: AnimationOrGetter\n onLoadError?: AnimationOrGetter\n onObjectClick?: AnimationOrGetter\n onObjectHover?: AnimationOrGetter\n onAnimationEnd?: AnimationOrGetter\n onFrame?: AnimationOrGetter\n onScriptError?: AnimationOrGetter\n }\n}\n\n/* 3D scene renderer powered by WebGPU/WebGL with declarative objects, lights, camera, controls, and a script hook (tvOS support is experimental) */\nexport type BrickScene3D = Brick &\n BrickScene3DDef & {\n templateKey: 'BRICK_SCENE_3D'\n switches?: Array<\n SwitchDef &\n BrickScene3DDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'fps'\n | 'objectCount'\n | 'selectedObjectId'\n | 'lastScreenshotUri'\n | 'sceneState'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Sketch.d.ts":"/* Auto generated by build script\n *\n * Drawing canvas with undo/redo, import/export state, and image export\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Undo the last stroke */\nexport type BrickSketchActionUndo = Action & {\n __actionName: 'BRICK_SKETCH_UNDO'\n}\n\n/* Redo the last undone stroke */\nexport type BrickSketchActionRedo = Action & {\n __actionName: 'BRICK_SKETCH_REDO'\n}\n\n/* Clear all strokes from the canvas */\nexport type BrickSketchActionClear = Action & {\n __actionName: 'BRICK_SKETCH_CLEAR'\n}\n\n/* Set the active tool */\nexport type BrickSketchActionSetTool = ActionWithParams & {\n __actionName: 'BRICK_SKETCH_SET_TOOL'\n params?: Array<{\n input: 'tool'\n value?: 'pen' | 'eraser' | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Set the stroke color */\nexport type BrickSketchActionSetColor = ActionWithParams & {\n __actionName: 'BRICK_SKETCH_SET_COLOR'\n params?: Array<{\n input: 'color'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Set the stroke width (px) */\nexport type BrickSketchActionSetStrokeWidth = ActionWithParams & {\n __actionName: 'BRICK_SKETCH_SET_STROKE_WIDTH'\n params?: Array<{\n input: 'strokeWidth'\n value?: number | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Import sketch state (JSON string from a previous export) */\nexport type BrickSketchActionImportState = ActionWithParams & {\n __actionName: 'BRICK_SKETCH_IMPORT_STATE'\n params?: Array<{\n input: 'stateJson'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Export the current sketch state to the BRICK_SKETCH_STATE outlet */\nexport type BrickSketchActionExportState = Action & {\n __actionName: 'BRICK_SKETCH_EXPORT_STATE'\n}\n\n/* Export the canvas as an image (file URI emitted to BRICK_SKETCH_IMAGE_URI) */\nexport type BrickSketchActionExportImage = ActionWithParams & {\n __actionName: 'BRICK_SKETCH_EXPORT_IMAGE'\n params?: Array<\n | {\n input: 'imageFormat'\n value?: 'png' | 'jpeg' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'imageQuality'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Add a stroke programmatically */\nexport type BrickSketchActionAddStroke = ActionWithParams & {\n __actionName: 'BRICK_SKETCH_ADD_STROKE'\n params?: Array<\n | {\n input: 'strokePoints'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'strokeColor'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'strokeWidth'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface BrickSketchDef {\n /*\nDefault property:\n{\n \"tool\": \"pen\",\n \"strokeColor\": \"#000000\",\n \"strokeWidth\": 3,\n \"pressureSensitive\": true,\n \"layoutType\": \"cover\",\n \"scale\": 1,\n \"mode\": \"pen\",\n \"theme\": \"auto\",\n \"backgroundPattern\": \"dot\",\n \"hideToolbar\": false,\n \"hideUndo\": false,\n \"hideRedo\": false,\n \"hidePencilTool\": false,\n \"hideColorPicker\": false,\n \"hideThickness\": false,\n \"availableColors\": [\n \"#000000\",\n \"#ffffff\",\n \"#e53935\",\n \"#fb8c00\",\n \"#fdd835\",\n \"#43a047\",\n \"#1e88e5\",\n \"#8e24aa\"\n ]\n}\n */\n property?: BrickBasicProperty & {\n /* Initial sketch state to load on mount (object or JSON string from a previous export). When `BRICK_SKETCH_STATE` outlet feeds the same value back via binding, the echo is detected and ignored to avoid an update loop. */\n initialState?: string | DataLink | DataLink | {} | DataLink\n /* Drawing tool */\n tool?: 'pen' | 'eraser' | DataLink\n /* Stroke color */\n strokeColor?: string | DataLink\n /* Stroke width (px) */\n strokeWidth?: number | DataLink\n /* Vary stroke width by pen pressure */\n pressureSensitive?: boolean | DataLink\n /* Canvas layout. `cover` fits the brick frame; `extend` lets the canvas grow with content */\n layoutType?: 'cover' | 'extend' | DataLink\n /* Canvas resolution scale (device-pixel multiplier) */\n scale?: number | DataLink\n /* Interaction mode. `pen` = drawing (scroll disabled), `scroll` = scroll/pan (drawing disabled) */\n mode?: 'pen' | 'scroll' | DataLink\n /* Toolbar/UI theme. `auto` follows the system color scheme; `light`/`dark` force the palette. */\n theme?: 'auto' | 'light' | 'dark' | DataLink\n /* Background color of the canvas */\n backgroundColor?: string | DataLink\n /* Background image URL (covers the canvas; rendered behind strokes) */\n backgroundImage?: string | DataLink\n /* Decorative background pattern when no background image is provided */\n backgroundPattern?: 'dot' | 'grid' | 'none' | DataLink\n /* Hide the entire built-in toolbar */\n hideToolbar?: boolean | DataLink\n /* Hide the undo button in the toolbar */\n hideUndo?: boolean | DataLink\n /* Hide the redo button in the toolbar */\n hideRedo?: boolean | DataLink\n /* Hide the pen/eraser tool toggle */\n hidePencilTool?: boolean | DataLink\n /* Hide the color picker */\n hideColorPicker?: boolean | DataLink\n /* Hide the stroke thickness slider */\n hideThickness?: boolean | DataLink\n /* Colors shown in the built-in color picker */\n availableColors?: Array<string | DataLink> | DataLink\n }\n events?: BrickBasicEvents & {\n /* A stroke was just committed (drawn or added programmatically) */\n onStrokeEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Sketch']['onStrokeEnd']>>\n /* The canvas was cleared */\n onClear?: Array<EventAction<string & keyof TemplateEventPropsMap['Sketch']['onClear']>>\n /* Sketch state changed (any commit, undo, redo, clear, or import) */\n onStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Sketch']['onStateChange']>\n >\n /* Active tool changed */\n onToolChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Sketch']['onToolChange']>\n >\n /* Image export finished */\n onExportImage?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Sketch']['onExportImage']>\n >\n }\n outlets?: {\n /* Current sketch state (strokes, settings, undo/redo stacks) */\n state?: () => Data<{\n strokes?: any[]\n undone?: any[]\n settings?: { [key: string]: any }\n [key: string]: any\n }>\n /* URI of the most recently exported image */\n imageUri?: () => Data<string>\n /* Most recently committed stroke (points, color, width) */\n lastStroke?: () => Data<{\n color?: string\n width?: number\n tool?: string\n points?: any[]\n [key: string]: any\n }>\n }\n animation?: AnimationBasicEvents & {\n onStrokeEnd?: AnimationOrGetter\n onClear?: AnimationOrGetter\n onStateChange?: AnimationOrGetter\n onToolChange?: AnimationOrGetter\n onExportImage?: AnimationOrGetter\n }\n}\n\n/* Drawing canvas with undo/redo, import/export state, and image export */\nexport type BrickSketch = Brick &\n BrickSketchDef & {\n templateKey: 'BRICK_SKETCH'\n switches?: Array<\n SwitchDef &\n BrickSketchDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'state' | 'imageUri' | 'lastStroke'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Slideshow.d.ts":"/* Auto generated by build script\n *\n * Auto-advancing slideshow of child bricks with transition effects\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Jump to a specific index in the slideshow */\nexport type BrickSlideshowActionJumpToIndex = ActionWithParams & {\n __actionName: 'BRICK_SLIDESHOW_JUMP_TO_INDEX'\n params?: Array<\n | {\n input: 'index'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'reset'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'shuffle'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Play the slideshow (resume if paused) */\nexport type BrickSlideshowActionPlay = Action & {\n __actionName: 'BRICK_SLIDESHOW_PLAY'\n}\n\n/* Pause the slideshow */\nexport type BrickSlideshowActionPause = Action & {\n __actionName: 'BRICK_SLIDESHOW_PAUSE'\n}\n\n/* Go to next slide */\nexport type BrickSlideshowActionNext = Action & {\n __actionName: 'BRICK_SLIDESHOW_NEXT'\n}\n\n/* Go to previous slide */\nexport type BrickSlideshowActionPrev = Action & {\n __actionName: 'BRICK_SLIDESHOW_PREV'\n}\n\ninterface BrickSlideshowDef {\n /*\nDefault property:\n{\n \"countdown\": 2000,\n \"loop\": true,\n \"shuffle\": false,\n \"photoResizeMode\": \"contain\",\n \"photoLoadSystemIos\": \"auto\",\n \"photoLoadSystemAndroid\": \"auto\",\n \"videoResizeMode\": \"contain\",\n \"videoAutoAspectRatio\": false,\n \"videoVolume\": 100,\n \"videoMuted\": false,\n \"videoRenderMode\": \"auto\",\n \"fadeDuration\": 0,\n \"emptyViewText\": \"no available image item to show\",\n \"emptyViewTextSize\": 44,\n \"emptyViewTextColor\": \"#fff\",\n \"enableBlurBackground\": false,\n \"blurBackgroundRadius\": 8\n}\n */\n property?: BrickBasicProperty & {\n /* The time interval of show for each photo */\n countdown?: number | DataLink\n /* The slideshow media path list (File, URL)\n Each path object can override global photo/video settings. \n Item-level properties take precedence over brick-level properties. */\n paths?:\n | Array<\n | DataLink\n | {\n url?: string | DataLink\n mediaType?: 'video' | 'video-streaming' | 'photo' | DataLink\n photoResizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink\n photoLoadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink\n photoLoadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink\n videoResizeMode?: 'contain' | 'cover' | 'stretch' | DataLink\n videoAutoAspectRatio?: boolean | DataLink\n videoAspectRatio?: string | DataLink\n videoVolume?: number | DataLink\n videoMuted?: boolean | DataLink\n videoRenderMode?: 'auto' | 'texture' | 'surface' | DataLink\n }\n >\n | DataLink\n /* Multiple slideshow media path lists to combine (Array of path arrays).\n All arrays are flattened and combined: [...paths, ...pathsList[0], ...pathsList[1], ...] */\n pathsList?: Array<Array<any> | DataLink | DataLink> | DataLink\n /* Loop the slideshow */\n loop?: boolean | DataLink\n /* Shuffle the slideshow */\n shuffle?: boolean | DataLink\n /* Slideshow Photo resize mode */\n photoResizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink\n /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */\n photoLoadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink\n /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */\n photoLoadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink\n /* Slideshow Video resize mode */\n videoResizeMode?: 'contain' | 'cover' | 'stretch' | DataLink\n /* Video Auto Aspect Ratio for use Video Streaming */\n videoAutoAspectRatio?: boolean | DataLink\n /* Video Aspect Ratio for use Video Streaming */\n videoAspectRatio?: string | DataLink\n /* Video Volume */\n videoVolume?: number | DataLink\n /* Video Muted */\n videoMuted?: boolean | DataLink\n /* [Android only] Use what view type for render video (Auto / Texture or Surface). Notice: Although using surface has better performance, it also affects the Animation & Standby Transition used by itself */\n videoRenderMode?: 'auto' | 'texture' | 'surface' | DataLink\n /* The photo fade duration */\n fadeDuration?: number | DataLink\n /* Show text content if path list is empty */\n emptyViewText?: string | DataLink\n /* The font size of shown text content if path list is empty */\n emptyViewTextSize?: number | DataLink\n /* The color of shown text content if path list is empty */\n emptyViewTextColor?: string | DataLink\n /* Show emptyViewText when timeout and paths is empty */\n emptyViewTimeout?: number | DataLink\n /* The blur radius of the blur filter added to the image */\n blurRadius?: number | DataLink\n /* Add blurred image at background if photo is not full */\n enableBlurBackground?: boolean | DataLink\n /* The blur radius of the blur filter added to the image background */\n blurBackgroundRadius?: number | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the next slideshow on change start */\n changeStart?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Slideshow']['changeStart']>\n >\n /* Event of the next slideshow on change end */\n changeEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Slideshow']['changeEnd']>>\n /* Event on paths change */\n contentChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Slideshow']['contentChange']>\n >\n /* Event on plays of paths are end */\n roundEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Slideshow']['roundEnd']>>\n /* Event of the slideshow on load */\n mediaOnLoad?: Array<EventAction>\n /* Event of the slideshow media loading error */\n mediaOnError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Slideshow']['mediaOnError']>\n >\n }\n animation?: AnimationBasicEvents & {\n changeStart?: AnimationOrGetter\n changeEnd?: AnimationOrGetter\n contentChange?: AnimationOrGetter\n roundEnd?: AnimationOrGetter\n mediaOnLoad?: AnimationOrGetter\n mediaOnError?: AnimationOrGetter\n }\n}\n\n/* Auto-advancing slideshow of child bricks with transition effects */\nexport type BrickSlideshow = Brick &\n BrickSlideshowDef & {\n templateKey: 'BRICK_SLIDESHOW'\n switches?: Array<\n SwitchDef &\n BrickSlideshowDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: ''\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Svg.d.ts":"/* Auto generated by build script\n *\n * SVG is an XML-based vector image format for 2D graphics\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickSvgDef {\n /*\nDefault property:\n{\n \"source\": \"\",\n \"uri\": \"\",\n \"renderMode\": \"general\"\n}\n */\n property?: BrickBasicProperty & {\n /* The SVG XML content */\n source?: string | DataLink\n /* The svg source location (URL or LocalPath) */\n uri?: string | DataLink\n /* The checksum of file */\n md5?: string | DataLink\n /* The rules of replacing origin colour */\n colorMapping?:\n | Array<\n | DataLink\n | {\n findItem?: string | DataLink\n replaceItem?: string | DataLink\n }\n >\n | DataLink\n /* The render mode */\n renderMode?: 'general' | 'legacy' | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n }\n}\n\n/* SVG is an XML-based vector image format for 2D graphics */\nexport type BrickSvg = Brick &\n BrickSvgDef & {\n templateKey: 'BRICK_SVG'\n switches?: Array<\n SwitchDef &\n BrickSvgDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Text.d.ts":"/* Auto generated by build script\n *\n * Display styled text with font, color, alignment, and truncation controls\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickTextDef {\n /*\nDefault property:\n{\n \"text\": \"\",\n \"templateType\": \"${}\",\n \"color\": \"#000\",\n \"fontWeight\": \"normal\",\n \"fontStyle\": \"normal\",\n \"fontPadding\": true,\n \"fontSizeVector\": 0.5,\n \"lineNumber\": 1,\n \"textAlign\": \"center\",\n \"textAlignVertical\": \"center\"\n}\n */\n property?: BrickBasicProperty & {\n /* The text content */\n text?: string | DataLink | number | DataLink | boolean | DataLink | string | DataLink | DataLink\n /* Data to be used in the text template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */\n templateData?: {} | DataLink\n /* The text template type */\n templateType?: '${}' | '{{}}' | DataLink\n /* The text replacement (Regular Expression), can be multiple. */\n replace?:\n | Array<\n | DataLink\n | {\n regex?: string | DataLink\n replaceWith?: string | DataLink\n }\n >\n | DataLink\n /* The text color */\n color?: string | DataLink\n /* Specifies font weight. The values 'normal' and are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen. */\n fontWeight?:\n | 'normal'\n | 'bold'\n | '100'\n | '200'\n | '300'\n | '400'\n | '500'\n | '600'\n | '700'\n | '800'\n | '900'\n | DataLink\n /* The text font style */\n fontStyle?: 'normal' | 'italic' | DataLink\n /* The text font family */\n fontFamily?: string | DataLink\n /* [Android only] Set to No to remove extra font padding intended to make space for certain ascenders / descenders. */\n fontPadding?: boolean | DataLink\n /* The text font size (grid) */\n fontSize?: number | DataLink\n /* The text font size vector. If the font size is not specified, the font size will be calculated by the height of the text box. */\n fontSizeVector?: number | DataLink\n /* The text letter spacing (grid) */\n letterSpacing?: number | DataLink\n /* The line height of text content (grid) */\n lineHeight?: number | DataLink\n /* The line number limit of text content */\n lineNumber?: number | DataLink\n /* The text align */\n textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | DataLink\n /* The text align vertical */\n textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | DataLink\n /* Enable vertical rendering */\n verticalRendering?: boolean | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n /* Event of the text content on change start */\n beforeValueChange?: Array<EventAction>\n /* Event of the text content on change end */\n valueChange?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n beforeValueChange?: AnimationOrGetter\n valueChange?: AnimationOrGetter\n }\n}\n\n/* Display styled text with font, color, alignment, and truncation controls */\nexport type BrickText = Brick &\n BrickTextDef & {\n templateKey: 'BRICK_TEXT'\n switches?: Array<\n SwitchDef &\n BrickTextDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/TextInput.d.ts":"/* Auto generated by build script\n *\n * Editable text input field with keyboard type, placeholder, and validation support\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Focus TextInput */\nexport type BrickTextInputActionFocus = Action & {\n __actionName: 'BRICK_TEXT_INPUT_FOCUS'\n}\n\n/* Blur TextInput */\nexport type BrickTextInputActionBlur = Action & {\n __actionName: 'BRICK_TEXT_INPUT_BLUR'\n}\n\n/* Clear TextInput */\nexport type BrickTextInputActionClear = Action & {\n __actionName: 'BRICK_TEXT_INPUT_CLEAR'\n}\n\n/* Reset TextInput to default value */\nexport type BrickTextInputActionResetToDefault = Action & {\n __actionName: 'BRICK_TEXT_INPUT_RESET_TO_DEFAULT'\n}\n\n/* Focus the input and select text with regex or start/end */\nexport type BrickTextInputActionSelectText = ActionWithParams & {\n __actionName: 'BRICK_TEXT_INPUT_SELECT_TEXT'\n params?: Array<\n | {\n input: 'regex'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'start'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'end'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Set text value of the TextInput */\nexport type BrickTextInputActionSetText = ActionWithParams & {\n __actionName: 'BRICK_TEXT_INPUT_SET_TEXT'\n params?: Array<{\n input: 'text'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Append text value of the TextInput */\nexport type BrickTextInputActionAppendText = ActionWithParams & {\n __actionName: 'BRICK_TEXT_INPUT_APPEND_TEXT'\n params?: Array<{\n input: 'text'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Trigger regex */\nexport type BrickTextInputActionTrySubmit = Action & {\n __actionName: 'BRICK_TEXT_INPUT_TRY_SUBMIT'\n}\n\ninterface BrickTextInputDef {\n /*\nDefault property:\n{\n \"editable\": true,\n \"defaultValue\": \"\",\n \"color\": \"#000\",\n \"fontWeight\": \"normal\",\n \"fontStyle\": \"normal\",\n \"fontSizeVector\": 0.5,\n \"lineNumber\": 1,\n \"textAlign\": \"center\",\n \"textAlignVertical\": \"center\",\n \"keyboardType\": \"default\",\n \"returnKeyType\": \"done\"\n}\n */\n property?: BrickBasicProperty & {\n /* Allow to edit */\n editable?: boolean | DataLink\n /* The default value of the text input */\n defaultValue?: string | DataLink\n /* The text color */\n color?: string | DataLink\n /* Specifies font weight. The values 'normal' and are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen. */\n fontWeight?:\n | 'normal'\n | 'bold'\n | '100'\n | '200'\n | '300'\n | '400'\n | '500'\n | '600'\n | '700'\n | '800'\n | '900'\n | DataLink\n /* The text font style */\n fontStyle?: 'normal' | 'italic' | DataLink\n /* The text font family */\n fontFamily?: string | DataLink\n /* The text font size (grid) */\n fontSize?: number | DataLink\n /* The text font size vector. If the font size is not specified, the font size will be calculated by the height of the text box. */\n fontSizeVector?: number | DataLink\n /* The text letter spacing (grid) */\n letterSpacing?: number | DataLink\n /* The line height of text content (grid) */\n lineHeight?: number | DataLink\n /* The line number limit of text content (Use 0 to unlimited) */\n lineNumber?: number | DataLink\n /* The text align */\n textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | DataLink\n /* The text align vertical */\n textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | DataLink\n /* The placeholder text */\n placeholder?: string | DataLink\n /* Color of the placeholder text */\n placeholderTextColor?: string | DataLink\n /* Limits the maximum number of characters that can be entered */\n maxLength?: number | DataLink\n /* The virtual keyboard type */\n keyboardType?:\n | 'default'\n | 'number-pad'\n | 'decimal-pad'\n | 'numeric'\n | 'email-address'\n | 'phone-pad'\n | DataLink\n /* The virtual keyboard return key type The line number should be 1. */\n returnKeyType?: 'done' | 'go' | 'next' | 'search' | 'send' | DataLink\n /* Trigger event on input change after debounce time */\n debounce?: number | DataLink\n /* Regular Expression to match */\n regex?: string | DataLink\n /* The regex matching complete mode */\n completeMode?: 'allMatch' | 'oneMatch' | DataLink\n /* Auto submit when regex match */\n autoSubmitWhenMatch?: boolean | DataLink\n /* Blur TextInput on submit */\n blurOnSubmit?: boolean | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the TextInput is focused */\n onFocus?: Array<EventAction>\n /* Event of the input field is blurred */\n onBlur?: Array<EventAction>\n /* Event of the TextInput is empty */\n onEmpty?: Array<EventAction>\n /* Event of the TextInput value change */\n onChange?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onChange']>>\n /* Event of the TextInput submit */\n onSubmit?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onSubmit']>>\n /* Event of the TextInput match regex (check every value change) */\n onMatch?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onMatch']>>\n /* Event of the TextInput not match regex (check every value change) */\n onNotMatch?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onNotMatch']>>\n /* Event of the TextInput not match regex (check every submit) */\n onResultNotMatch?: Array<\n EventAction<string & keyof TemplateEventPropsMap['TextInput']['onResultNotMatch']>\n >\n /* Event of the TextInput reach max length or match regex */\n onFullFill?: Array<EventAction>\n }\n outlets?: {\n /* The raw input */\n rawInput?: () => Data<any>\n /* The regex result */\n resultVariable?: () => Data<{ [key: string]: any }>\n /* Last key in */\n lastKey?: () => Data<any>\n /* Selection of the TextInput (start, end, text) */\n selection?: () => Data<{\n start?: number\n end?: number\n text?: string\n }>\n /* Selection text of the TextInput */\n selectionText?: () => Data<string>\n }\n animation?: AnimationBasicEvents & {\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n onEmpty?: AnimationOrGetter\n onChange?: AnimationOrGetter\n onSubmit?: AnimationOrGetter\n onMatch?: AnimationOrGetter\n onNotMatch?: AnimationOrGetter\n onResultNotMatch?: AnimationOrGetter\n onFullFill?: AnimationOrGetter\n }\n}\n\n/* Editable text input field with keyboard type, placeholder, and validation support */\nexport type BrickTextInput = Brick &\n BrickTextInputDef & {\n templateKey: 'BRICK_TEXT_INPUT'\n switches?: Array<\n SwitchDef &\n BrickTextInputDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'rawInput' | 'resultVariable' | 'lastKey' | 'selection' | 'selectionText'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/Video.d.ts":"/* Auto generated by build script\n *\n * Video playback with play/pause controls and streaming support\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Play the video */\nexport type BrickVideoActionPlay = Action & {\n __actionName: 'BRICK_VIDEO_PLAY'\n}\n\n/* Seek the video */\nexport type BrickVideoActionSeek = ActionWithParams & {\n __actionName: 'BRICK_VIDEO_SEEK'\n params?: Array<\n | {\n input: 'seekTime'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'play'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Pause the video */\nexport type BrickVideoActionPause = Action & {\n __actionName: 'BRICK_VIDEO_PAUSE'\n}\n\n/* Replay the video */\nexport type BrickVideoActionReplay = Action & {\n __actionName: 'BRICK_VIDEO_REPLAY'\n}\n\n/* Stop the video */\nexport type BrickVideoActionStop = Action & {\n __actionName: 'BRICK_VIDEO_STOP'\n}\n\ninterface BrickVideoDef {\n /*\nDefault property:\n{\n \"paused\": false,\n \"volume\": 100,\n \"muted\": false,\n \"progressUpdateInterval\": 1000,\n \"replayTimeout\": 500,\n \"renderMode\": \"auto\",\n \"showSubtitles\": true,\n \"subtitleColor\": \"#FFFFFF\",\n \"subtitleBackgroundColor\": \"rgba(0, 0, 0, 0.6)\",\n \"subtitleFontSize\": 2,\n \"subtitlePosition\": \"bottom\",\n \"subtitleTextAlign\": \"center\"\n}\n */\n property?: BrickBasicProperty & {\n /* The video path list or single path (File, URL) */\n path?:\n | string\n | DataLink\n | DataLink\n | {\n url?: string | DataLink\n }\n | Array<\n | DataLink\n | {\n url?: string | DataLink\n }\n | string\n | DataLink\n | DataLink\n >\n | DataLink\n | DataLink\n /* The checksum of file */\n md5?: string | DataLink\n /* Controls whether the video is paused */\n paused?: boolean | DataLink\n /* Volume */\n volume?: number | DataLink\n /* Muted */\n muted?: boolean | DataLink\n /* Video resize mode */\n resizeMode?: 'contain' | 'cover' | 'stretch' | DataLink\n /* Repeat the video path list */\n repeat?: boolean | DataLink\n /* Progress Update Interval */\n progressUpdateInterval?: number | DataLink\n /* Replay on playing error */\n replayOnError?: boolean | DataLink\n /* Timeout to replay if repeat or replayOnError is true and video is end or error */\n replayTimeout?: number | DataLink\n /* Use what view type for render video (Auto / Texture or Surface). Notice: Although using surface has better performance, it also affects the Animation & Standby Transition used by itself */\n renderMode?: 'auto' | 'texture' | 'surface' | DataLink\n /* The subtitle file path list or single path (SRT/WebVTT), index-matched to the video path. Used when no inline subtitles are set for that video. */\n subtitlePath?:\n | string\n | DataLink\n | DataLink\n | {\n url?: string | DataLink\n }\n | Array<\n | DataLink\n | {\n url?: string | DataLink\n }\n | string\n | DataLink\n | DataLink\n >\n | DataLink\n | DataLink\n /* Inline subtitles per video, index-matched to the video path: each entry holds a `cues` list of { start, end, text } (start/end in seconds). Takes precedence over the subtitle file for that video. */\n subtitles?:\n | Array<\n | DataLink\n | {\n cues?:\n | Array<\n | DataLink\n | {\n start?: number | DataLink\n end?: number | DataLink\n text?: string | DataLink\n }\n >\n | DataLink\n }\n >\n | DataLink\n /* Render the subtitle overlay. Turn off to only trigger subtitle events without rendering text */\n showSubtitles?: boolean | DataLink\n /* Subtitle text color */\n subtitleColor?: string | DataLink\n /* Subtitle background color */\n subtitleBackgroundColor?: string | DataLink\n /* Subtitle font size, in grid units (same as Brick Text) */\n subtitleFontSize?: number | DataLink\n /* Subtitle font family */\n subtitleFontFamily?: string | DataLink\n /* Subtitle vertical position */\n subtitlePosition?: 'bottom' | 'top' | DataLink\n /* Subtitle text alignment */\n subtitleTextAlign?: 'left' | 'center' | 'right' | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n /* Event of the next video on change start */\n nextVideo?: Array<EventAction<string & keyof TemplateEventPropsMap['Video']['nextVideo']>>\n /* Event on plays of path are totally end */\n roundEnd?: Array<EventAction>\n /* Event on video load */\n onLoad?: Array<EventAction>\n /* Event of the video playing error */\n onError?: Array<EventAction>\n /* Event of the video progress interval */\n onProgress?: Array<EventAction<string & keyof TemplateEventPropsMap['Video']['onProgress']>>\n /* Event when a subtitle cue starts (appears) during playback */\n subtitleCueEnter?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Video']['subtitleCueEnter']>\n >\n /* Event when a subtitle cue ends (disappears) during playback */\n subtitleCueExit?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Video']['subtitleCueExit']>\n >\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n nextVideo?: AnimationOrGetter\n roundEnd?: AnimationOrGetter\n onLoad?: AnimationOrGetter\n onError?: AnimationOrGetter\n onProgress?: AnimationOrGetter\n subtitleCueEnter?: AnimationOrGetter\n subtitleCueExit?: AnimationOrGetter\n }\n}\n\n/* Video playback with play/pause controls and streaming support */\nexport type BrickVideo = Brick &\n BrickVideoDef & {\n templateKey: 'BRICK_VIDEO'\n switches?: Array<\n SwitchDef &\n BrickVideoDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/VideoStreaming.d.ts":"/* Auto generated by build script\n *\n * Brick video streaming component, supports RTSP / RTMP streaming.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickVideoStreamingDef {\n /*\nDefault property:\n{\n \"networkCaching\": 300,\n \"paused\": false,\n \"volume\": 100,\n \"muted\": false,\n \"replayTimeout\": 500\n}\n */\n property?: BrickBasicProperty & {\n /* The video path list or single path (File, URL) */\n uri?: string | DataLink\n /* Set cache time from streaming (You can adjust according to network conditions), it will delay the playing. */\n networkCaching?: number | DataLink\n /* Controls whether the video is paused */\n paused?: boolean | DataLink\n /* Volume */\n volume?: number | DataLink\n /* Muted */\n muted?: boolean | DataLink\n /* Video Auto Aspect Ratio */\n autoAspectRatio?: boolean | DataLink\n /* Video Aspect Ratio */\n aspectRatio?: string | DataLink\n /* Repeat the video path list */\n repeat?: boolean | DataLink\n /* Replay on playing error */\n replayOnError?: boolean | DataLink\n /* Timeout to replay if repeat or replayOnError is true and video is end or error */\n replayTimeout?: number | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the brick press */\n onPress?: Array<EventAction>\n /* Event of the brick press in */\n onPressIn?: Array<EventAction>\n /* Event of the brick press out */\n onPressOut?: Array<EventAction>\n /* Event of the brick long press */\n onLongPress?: Array<EventAction>\n /* Event of the brick focus (Use TV Device with controller) */\n onFocus?: Array<EventAction>\n /* Event of the brick blur (Use TV Device with controller) */\n onBlur?: Array<EventAction>\n /* Event on plays of path are end */\n onEnd?: Array<EventAction>\n /* Event on plays of path are end */\n onLoad?: Array<EventAction>\n /* Event of the video playing error */\n onError?: Array<EventAction>\n }\n outlets?: {\n /* Brick is pressing */\n brickPressing?: () => Data<boolean>\n /* Brick is focusing (Use TV Device with controller) */\n brickFocusing?: () => Data<boolean>\n }\n animation?: AnimationBasicEvents & {\n onPress?: AnimationOrGetter\n onPressIn?: AnimationOrGetter\n onPressOut?: AnimationOrGetter\n onLongPress?: AnimationOrGetter\n onFocus?: AnimationOrGetter\n onBlur?: AnimationOrGetter\n onEnd?: AnimationOrGetter\n onLoad?: AnimationOrGetter\n onError?: AnimationOrGetter\n }\n}\n\n/* Brick video streaming component, supports RTSP / RTMP streaming. */\nexport type BrickVideoStreaming = Brick &\n BrickVideoStreamingDef & {\n templateKey: 'BRICK_VIDEO_STREAMING'\n switches?: Array<\n SwitchDef &\n BrickVideoStreamingDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'brickPressing' | 'brickFocusing'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/WebRtcStream.d.ts":"/* Auto generated by build script\n *\n * Display WebRTC video/audio stream from a WebRTC generator connection\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface BrickWebRTCStreamDef {\n /*\nDefault property:\n{\n \"mirror\": false,\n \"resizeMode\": \"contain\",\n \"noStreamViewText\": \"no stream\",\n \"noStreamViewTextSize\": 44,\n \"noStreamViewTextColor\": \"#000\"\n}\n */\n property?: BrickBasicProperty & {\n /* Mirror video */\n mirror?: boolean | DataLink\n /* The stream resize mode */\n resizeMode?: 'contain' | 'cover' | DataLink\n /* Show text content if no stream */\n noStreamViewText?: string | DataLink\n /* The font size of shown text content if no stream */\n noStreamViewTextSize?: number | DataLink\n /* The color of shown text content if no stream */\n noStreamViewTextColor?: string | DataLink\n }\n}\n\n/* Display WebRTC video/audio stream from a WebRTC generator connection */\nexport type BrickWebRTCStream = Brick &\n BrickWebRTCStreamDef & {\n templateKey: 'BRICK_WEBRTC_STREAM'\n switches?: Array<\n SwitchDef &\n BrickWebRTCStreamDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: ''\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/WebView.d.ts":"/* Auto generated by build script\n *\n * Embedded web browser with JS injection, DOM query selectors, content cropping, navigation control, and permission management\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'\nimport type {\n Brick,\n EventAction,\n EventActionForItem,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Run Javascript on the WebView */\nexport type BrickWebViewActionInjectJavascript = ActionWithParams & {\n __actionName: 'BRICK_WEBVIEW_INJECT_JAVASCRIPT'\n params?: Array<{\n input: 'javascriptCode'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Query selector on the WebView */\nexport type BrickWebViewActionQuerySelector = ActionWithParams & {\n __actionName: 'BRICK_WEBVIEW_QUERY_SELECTOR'\n params?: Array<\n | {\n input: 'querySelector'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'expression'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Do go forward on the WebView */\nexport type BrickWebViewActionGoForward = Action & {\n __actionName: 'BRICK_WEBVIEW_GO_FORWARD'\n}\n\n/* Do go back on the webview */\nexport type BrickWebViewActionGoBack = Action & {\n __actionName: 'BRICK_WEBVIEW_GO_BACK'\n}\n\n/* Do reload on the webview */\nexport type BrickWebViewActionReload = Action & {\n __actionName: 'BRICK_WEBVIEW_RELOAD'\n}\n\ninterface BrickWebViewDef {\n /*\nDefault property:\n{\n \"cropLeft\": 0,\n \"cropRight\": 0,\n \"cropTop\": 0,\n \"cropBottom\": 0,\n \"allowContentControl\": true,\n \"allowFileAccess\": true,\n \"domStorageEnabled\": true,\n \"cacheEnabled\": true,\n \"geolocationEnabled\": true,\n \"thirdPartyCookiesEnabled\": true,\n \"javaScriptEnabled\": true,\n \"scrollEnabled\": true,\n \"nestedScrollEnabled\": true\n}\n */\n property?: BrickBasicProperty & {\n /* The WebView content URL */\n url?: string | DataLink\n /* The request headers to load content */\n headers?: Record<string, string | DataLink> | DataLink\n /* The request UserAgent */\n userAgent?: string | DataLink\n /* The webview content HTML (Use `url` first) */\n html?: string | DataLink\n /* Crop webview content left position (px) */\n cropLeft?: number | DataLink\n /* Crop webview content right position (px) */\n cropRight?: number | DataLink\n /* Crop webview content top position (px) */\n cropTop?: number | DataLink\n /* Crop webview content bottom position (px) */\n cropBottom?: number | DataLink\n /* Allow content control */\n allowContentControl?: boolean | DataLink\n /* List of origin strings to allow being navigated to. (Allowed all if not provided) */\n originAllowList?: Array<string | DataLink> | DataLink\n /* Allow file:// access */\n allowFileAccess?: boolean | DataLink\n /* Enable DOM Storage */\n domStorageEnabled?: boolean | DataLink\n /* Enable Cache */\n cacheEnabled?: boolean | DataLink\n /* Enable Geolocation */\n geolocationEnabled?: boolean | DataLink\n /* Enable Third Party Cookies */\n thirdPartyCookiesEnabled?: boolean | DataLink\n /* Enable JavaScript */\n javaScriptEnabled?: boolean | DataLink\n /* Inject JavaScript code */\n code?: string | DataLink\n /* Inject JavaScript code before content loaded */\n beforeContentLoaded?: string | DataLink\n /* Inject JavaScript code for main frame only (only `YES` supported for Android) */\n forMainFrameOnly?: boolean | DataLink\n /* Inject JavaScript code before content loaded for main frame only (only `YES` supported for Android) */\n beforeContentLoadedForMainFrameOnly?: boolean | DataLink\n /* Enable scroll in WebView */\n scrollEnabled?: boolean | DataLink\n /* Enable nested scroll in WebView (Android only) */\n nestedScrollEnabled?: boolean | DataLink\n }\n events?: BrickBasicEvents & {\n /* Event of the WebView on load */\n onLoad?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onLoad']>>\n /* Event when the WebView load fails */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onError']>>\n /* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */\n onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onMessage']>>\n }\n outlets?: {\n /* The result of the query selector action */\n queryResult?: () => Data<any>\n /* The error of the query selector action */\n queryError?: () => Data<string>\n }\n animation?: AnimationBasicEvents & {\n onLoad?: AnimationOrGetter\n onError?: AnimationOrGetter\n onMessage?: AnimationOrGetter\n }\n}\n\n/* Embedded web browser with JS injection, DOM query selectors, content cropping, navigation control, and permission management */\nexport type BrickWebView = Brick &\n BrickWebViewDef & {\n templateKey: 'BRICK_WEBVIEW'\n switches?: Array<\n SwitchDef &\n BrickWebViewDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'queryResult' | 'queryError'\n value: any\n }\n }>\n }\n >\n }\n","types/bricks/index.d.ts":"/* Auto generated by build script */\nexport * from './Rect'\nexport * from './Text'\nexport * from './TextInput'\nexport * from './RichText'\nexport * from './Image'\nexport * from './Svg'\nexport * from './Icon'\nexport * from './Video'\nexport * from './VideoStreaming'\nexport * from './QrCode'\nexport * from './Slideshow'\nexport * from './Chart'\nexport * from './Items'\nexport * from './Lottie'\nexport * from './Rive'\nexport * from './WebView'\nexport * from './Camera'\nexport * from './WebRtcStream'\nexport * from './GenerativeMedia'\nexport * from './Maps'\nexport * from './Sketch'\nexport * from './Scene3D'\n","types/canvas.d.ts":"/* Auto generated by build script */\nimport type { Easing } from './animation'\nimport type { Data, DataLink } from './data'\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from './switch'\nimport type { Brick, SubspaceID, EventAction } from './common'\n\ntype StandbyEasing = {\n method: Easing\n duration: number\n}\n\ninterface CanvasDef {\n property?: {\n /* The showing timeout of Canvas, need to set `Next Canvas ID` as well */\n showingTimeout?: number | DataLink\n /* Canvas ID for change next canvas on showing timeout */\n nextCanvasId?: string | DataLink | (() => Canvas)\n /* Background color of Canvas */\n backgroundColor?: string | DataLink\n /* Dismiss keyboard on press */\n dismissKeyboardOnPress?: boolean | DataLink\n }\n events?: {\n /* Event on Canvas first enter on Subspace */\n firstEnter?: Array<EventAction>\n /* Event on Canvas enter */\n enter?: Array<EventAction>\n /* Showing timeout event (If `Showing Timeout` is specified) */\n showingTimeout?: Array<EventAction>\n /* Event on Canvas exit */\n exit?: Array<EventAction>\n }\n}\n\n/* View renderer in subspace. */\nexport type Canvas = CanvasDef & {\n __typename: 'Canvas'\n id: string\n alias?: string\n title?: string\n description?: string\n hideShortRef?: boolean\n switches?: Array<\n SwitchDef &\n CanvasDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond: SwitchCondInnerStateCurrentCanvas | SwitchCondData\n }>\n }\n >\n items: Array<{\n item: (() => Brick) | SubspaceID\n frame: {\n x: number\n y: number\n width: number\n height: number\n standbyMode?: 'custom' | 'top' | 'left' | 'right' | 'bottom'\n standbyFrame?: {\n x?: number\n y?: number\n width?: number\n height?: number\n }\n standbyOpacity?: number\n standbyDelay?: number\n standbyDelayRandom?: number\n standbyEasing?: {\n default?: StandbyEasing\n x?: StandbyEasing\n y?: StandbyEasing\n width?: StandbyEasing\n height?: StandbyEasing\n opacity?: StandbyEasing\n }\n showingDelay?: number\n renderOutOfViewport?: boolean\n }\n hidden?: boolean // Hide in Editor\n }>\n}\n","types/common.d.ts":"import type { SwitchDef } from './switch'\nimport type { Data } from './data'\nimport type { Subspace } from './subspace'\nimport type { AutomationMap } from './automation'\n\nexport interface Brick {\n __typename: 'Brick'\n id: string\n alias?: string\n templateKey: string\n title?: string\n description?: string\n hideShortRef?: boolean\n property?: {}\n events?: {}\n outlets?: {}\n animation?: {}\n switches?: Array<SwitchDef>\n}\n\nexport type LocalSyncStrategy = 'main-only' | 'minor-only'\n\nexport interface Generator {\n __typename: 'Generator'\n id: string\n alias?: string\n templateKey: string\n title?: string\n description?: string\n hideShortRef?: boolean\n localSyncRunMode?: LocalSyncStrategy\n property?: {}\n events?: {}\n outlets?: {}\n switches?: Array<SwitchDef>\n}\n\nexport type SubspaceID = string\nexport type SubpsaceAction = string\n\nexport type Action = {\n __actionName: string\n parent: 'Brick' | 'Generator' | 'Subspace' | 'System'\n name?: string\n}\n\n// For standalone action types where specific event properties are not known\nexport type EventProperty = string\n\nexport type ActionWithParams<EP extends string = string> = Action & {\n params?: Array<{\n input: string\n value?: any | EP\n mapping?: string\n }>\n}\n\nexport type ActionWithDataParams<EP extends string = string> = Action & {\n dataParams?: Array<{\n input: () => Data\n value?: any | EP\n mapping?: string\n }>\n}\n\nexport type ItemBrickID = string\n\n// EP carries available event property keys for this event context\n// Use: EventAction<string & keyof TemplateEventPropsMap['Name']['event']>\nexport type EventAction<EP extends string = string> = {\n handler: 'system' | (() => Brick | Generator) | SubspaceID | ItemBrickID\n action: ActionWithParams<EP> | ActionWithDataParams<EP>\n waitAsync?: boolean\n}\n\nexport type EventActionForItem<EP extends string = string> = {\n handler:\n | 'system'\n | (() => Brick | Generator | { brickId: string; templateKey: string })\n | SubspaceID\n | ItemBrickID\n action: Action\n waitAsync?: boolean\n}\n\nexport type ApplicationFont = {\n name: string\n url: string\n md5?: string\n}\n\nexport type ApplicationSettings = {\n internetReachabilityUrl?: string\n enableDataLock?: boolean\n showDeprecatedFeatures?: boolean\n enableUnstableFeatures?: boolean // enable_unstable_bricks\n runtimeCacheOptions?: {\n disabled?: boolean\n behavior?: 'initiative' | 'passive'\n retryAttemptForFailure?: number\n }\n tvOptions?: {\n disabledSelectable?: boolean\n selectableColor?: string\n selectableBorder?: {\n borderStyle?: 'solid' | 'dashed' | 'dotted'\n borderTopColor?: string\n borderLeftColor?: string\n borderRightColor?: string\n borderBottomColor?: string\n // BRICK Grid unit\n borderTopSize?: number\n borderLeftSize?: number\n borderRightSize?: number\n borderBottomSize?: number\n borderTopLeftRadius?: number\n borderTopRightRadius?: number\n borderBottomLeftRadius?: number\n borderBottomRightRadius?: number\n }\n }\n ai?: {\n useAnthropicApiKeySystemData?: boolean\n useOpenAiApiKeySystemData?: boolean\n useGeminiApiKeySystemData?: boolean\n }\n hideShortRefs?: boolean\n}\n\nexport type Application = {\n name: string\n description?: string\n subspaces: Subspace[]\n rootSubspace: Subspace\n fonts?: ApplicationFont[]\n settings?: ApplicationSettings\n automationMap?: AutomationMap\n metadata?: {\n [key: string]: any\n }\n}\n","types/data-calc-command/base.d.ts":"/* Auto generated by build script */\nimport type { Data } from '../data'\nimport type { DataCalculation } from '../data-calc'\n\n// Shared helpers — every generated DataCommand{Name} reuses these to describe\n// its narrowed inputs/outputs, so the per-command files stay short.\nexport type DataCalcInput<K extends string = string, T = any> = {\n key: K\n source: (() => DataCalculationData | DataCommand) | T\n sourceKey: string\n trigger?: boolean\n}\n\nexport type DataCalcOutput<K extends string = string> = {\n key: K\n target: () => DataCalculationData | DataCommand\n targetKey: string\n}\n\nexport interface DataCalculationData {\n __typename: 'DataCalculationData'\n title?: string\n description?: string\n hideShortRef?: boolean\n data: () => Data\n // 'change' is the only valid input port on a data node; the source must be\n // another node (no inline literals), hence `never` for the second type arg.\n inputs: Array<DataCalcInput<'change', never>>\n outputs: Array<DataCalcOutput<'value'>>\n}\n\nexport interface DataCommand {\n __typename: 'DataCommand'\n __commandName: string\n id: string\n title?: string\n description?: string\n hideShortRef?: boolean\n inputs: Array<DataCalcInput>\n outputs: Array<DataCalcOutput>\n}\n\nexport type DataCalculationMap = DataCalculation & {\n __typename: 'DataCalculationMap'\n nodes: Array<DataCalculationData | DataCommand>\n editorInfo: Array<{\n node: DataCalculationData | DataCommand\n position: { x: number; y: number }\n points: Array<{\n source: DataCalculationData | DataCommand\n sourceOutputKey: string\n target: DataCalculationData | DataCommand\n targetInputKey: string\n positions: Array<{ x: number; y: number }>\n }>\n }>\n}\n","types/data-calc-command/collection.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Compact — Remove false, undefined, 0, \"\", undefined, NaN in array */\nexport type DataCommandCollectionCompact = DataCommand & {\n __commandName: 'COLLECTION_COMPACT'\n inputs?: Array<DataCalcInput<'collection', Array<any>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Concat — Concat object or array. Return empty array if no var provided. */\nexport type DataCommandCollectionConcat = DataCommand & {\n __commandName: 'COLLECTION_CONCAT'\n inputs?: Array<\n | DataCalcInput<'var1', any> /* default: [] */\n | DataCalcInput<'var2', any> /* default: [] */\n | DataCalcInput<'var3', any> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Count — Group the contents of arrays or objects and output individual counts.\nIf group_by_path provided, it will use value from path to group, use whole value as key if path is empty string, then output to result.\nIf group_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_group, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionCount = DataCommand & {\n __commandName: 'COLLECTION_COUNT'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'group_by_path', string> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_group',\n string\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: object */\n >\n}\n\n/* Difference — Creates an array of array values not included in the other given arrays. */\nexport type DataCommandCollectionDifference = DataCommand & {\n __commandName: 'COLLECTION_DIFFERENCE'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'values', Array<any>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Drop — Drop values with number in array or object. */\nexport type DataCommandCollectionDrop = DataCommand & {\n __commandName: 'COLLECTION_DROP'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'number', any> /* default: 1 */\n | DataCalcInput<'forward', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Every — Whether all the contents in the array or object meet the conditions.\nIf predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.\nIf predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionEvery = DataCommand & {\n __commandName: 'COLLECTION_EVERY'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'predicate', object> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_valid',\n boolean\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: boolean */\n >\n}\n\n/* Fill — Fill value in array with length. Example: COLLECTION_FILL(start=2, length=2, value='A') Result:[undefined, undefined, 'A', 'A'] */\nexport type DataCommandCollectionFill = DataCommand & {\n __commandName: 'COLLECTION_FILL'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'start', any> /* default: 0 */\n | DataCalcInput<'length', any> /* default: length to end of array */\n | DataCalcInput<'value', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Filter — Filter the content that meets the conditions in the array or object.\nIf predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.\nIf predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionFilter = DataCommand & {\n __commandName: 'COLLECTION_FILTER'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'predicate', object> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_valid',\n boolean\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* Find — Find first value by condition in array.\nIf predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.\nIf predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionFind = DataCommand & {\n __commandName: 'COLLECTION_FIND'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'predicate', object> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_valid',\n boolean\n > /* iteratee callback input */ /* default: undefined */\n | DataCalcInput<'forward', boolean> /* default: true */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* Find Key — Find key of first value by condition in array.\nIf predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.\nIf predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionFindKey = DataCommand & {\n __commandName: 'COLLECTION_FIND_KEY'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'predicate', object> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_valid',\n boolean\n > /* iteratee callback input */ /* default: undefined */\n | DataCalcInput<'forward', boolean> /* default: true */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* First — Get first value in array */\nexport type DataCommandCollectionFirst = DataCommand & {\n __commandName: 'COLLECTION_FIRST'\n inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Flatten — Flatten a single level deep or recursively deep. */\nexport type DataCommandCollectionFlatten = DataCommand & {\n __commandName: 'COLLECTION_FLATTEN'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'deep', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Group By — Group array elements or object attributes into groups and generate objects.\nIf group_by_path provided, it will use value from path to group, use whole value as key if path is empty string, then output to result.\nIf group_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_group, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionGroupBy = DataCommand & {\n __commandName: 'COLLECTION_GROUP_BY'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'group_by_path', string> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_group',\n string\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: object */\n >\n}\n\n/* Includes — Check value in array. */\nexport type DataCommandCollectionIncludes = DataCommand & {\n __commandName: 'COLLECTION_INCLUDES'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'from_index', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Intersection — Get arrays intersection.\nIf intersection_by_path provided, it will use value from path to intersect, use whole value as key if path is empty string, then output to result.\nIf intersection_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionIntersection = DataCommand & {\n __commandName: 'COLLECTION_INTERSECTION'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'intersection_by_path', string> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_value',\n any\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* Key By — Use the specified value as the property name of the new object.\nIf key_by_path provided, it will use value from path as key, use whole value as key if path is empty string, then output to result.\nIf key_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_key, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionKeyBy = DataCommand & {\n __commandName: 'COLLECTION_KEY_BY'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'key_by_path', string> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_key',\n string\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: object */\n >\n}\n\n/* Last — Get last value of array. */\nexport type DataCommandCollectionLast = DataCommand & {\n __commandName: 'COLLECTION_LAST'\n inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Map — Map to new array.\nIf map_by_path provided, it will use value from path, use whole value if path is empty string, then output to result.\nIf map_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionMap = DataCommand & {\n __commandName: 'COLLECTION_MAP'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'map_by_path', string> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_value',\n any\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* Nth — Get N th value of array. */\nexport type DataCommandCollectionNth = DataCommand & {\n __commandName: 'COLLECTION_NTH'\n inputs?: Array<\n DataCalcInput<'array', Array<any>> /* default: [] */ | DataCalcInput<'n', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Push — Push value into array. */\nexport type DataCommandCollectionPush = DataCommand & {\n __commandName: 'COLLECTION_PUSH'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'forward', boolean> /* default: true */\n | DataCalcInput<'var1', any> /* default: undefined */\n | DataCalcInput<'var2', any> /* default: undefined */\n | DataCalcInput<'var3', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Reduce — Reduce the array to a single result.\nIt will trigger iteratee_input callback for every property (With { result, key, value }). After the calculation triggered iteratee_result, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionReduce = DataCommand & {\n __commandName: 'COLLECTION_REDUCE'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'initial_value', any> /* default: undefined */\n | DataCalcInput<'iteratee_result', any> /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* Reverse — Reverse array */\nexport type DataCommandCollectionReverse = DataCommand & {\n __commandName: 'COLLECTION_REVERSE'\n inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Sample — Get N th value of array randomly. */\nexport type DataCommandCollectionSample = DataCommand & {\n __commandName: 'COLLECTION_SAMPLE'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'n', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Shuffie — Shuffie array order. */\nexport type DataCommandCollectionShuffle = DataCommand & {\n __commandName: 'COLLECTION_SHUFFLE'\n inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Size — Get array size. */\nexport type DataCommandCollectionSize = DataCommand & {\n __commandName: 'COLLECTION_SIZE'\n inputs?: Array<DataCalcInput<'collection', Array<any> | object> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Slice — Slice array. */\nexport type DataCommandCollectionSlice = DataCommand & {\n __commandName: 'COLLECTION_SLICE'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'start', any> /* default: 0 */\n | DataCalcInput<'end', any> /* default: Array length */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Some — Check whether any of the array or object property meets the conditions.\nIf predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.\nIf predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionSome = DataCommand & {\n __commandName: 'COLLECTION_SOME'\n inputs?: Array<\n | DataCalcInput<'collection', Array<any> | object> /* default: [] */\n | DataCalcInput<'predicate', object> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_valid',\n boolean\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: boolean */\n >\n}\n\n/* Sort — Sort array.\nIf sort_by_path provided, it will use value from path to sort, use whole value if path is empty string, then output to result.\nIf sort_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionSort = DataCommand & {\n __commandName: 'COLLECTION_SORT'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'sort_by_path', string | Array<any>> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_value',\n any\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* Take — Creates a slice of array with n elements taken from the beginning. */\nexport type DataCommandCollectionTake = DataCommand & {\n __commandName: 'COLLECTION_TAKE'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'n', any> /* default: 1 */\n | DataCalcInput<'forward', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Union — Creates an array of unique values, in order, from all given arrays.\nIf union_by_path provided, it will use path to compare, then output to result.\nIf union_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandCollectionUnion = DataCommand & {\n __commandName: 'COLLECTION_UNION'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'union_by_path', string> /* default: \"\" */\n | DataCalcInput<\n 'iteratee_result_value',\n any\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: any */\n >\n}\n\n/* Without — Creates an array excluding all given values. */\nexport type DataCommandCollectionWithout = DataCommand & {\n __commandName: 'COLLECTION_WITHOUT'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'exclude', Array<any>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n","types/data-calc-command/color.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Color alpha — Get and set the color opacity. */\nexport type DataCommandColorAlpha = DataCommand & {\n __commandName: 'COLOR_ALPHA'\n inputs?: Array<\n DataCalcInput<'color', string> /* default: \"\" */ | DataCalcInput<'a', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color average — Similar to COLOR_MIX, but accepts more than two colors. Simple averaging of R,G,B components and the alpha channel. */\nexport type DataCommandColorAverage = DataCommand & {\n __commandName: 'COLOR_AVERAGE'\n inputs?: Array<\n | DataCalcInput<'colors', Array<any>> /* default: [] */\n | DataCalcInput<'mode', string> /* default: \"lrgb\" */\n | DataCalcInput<'weights', Array<any>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color bezier colors — Similar to COLOR_SCALE_COLORS, but use bezier instead of linear. */\nexport type DataCommandColorBezierColors = DataCommand & {\n __commandName: 'COLOR_BEZIER_COLORS'\n inputs?: Array<\n | DataCalcInput<'colors', Array<any>> /* default: undefined */\n | DataCalcInput<'domain', Array<any>> /* default: undefined */\n | DataCalcInput<'mode', string> /* default: \"rgb\" */\n | DataCalcInput<'gamma', number> /* default: 1 */\n | DataCalcInput<'correctLightness', boolean> /* default: false */\n | DataCalcInput<'padding', number> /* default: undefined */\n | DataCalcInput<'classes', any> /* default: undefined */\n | DataCalcInput<'length', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color bezier value — Similar to COLOR_SCALE_VALUE, but use bezier instead of linear. */\nexport type DataCommandColorBezierValue = DataCommand & {\n __commandName: 'COLOR_BEZIER_VALUE'\n inputs?: Array<\n | DataCalcInput<'colors', Array<any>> /* default: undefined */\n | DataCalcInput<'domain', Array<any>> /* default: undefined */\n | DataCalcInput<'mode', string> /* default: \"rgb\" */\n | DataCalcInput<'gamma', number> /* default: 1 */\n | DataCalcInput<'correctLightness', boolean> /* default: false */\n | DataCalcInput<'padding', number> /* default: undefined */\n | DataCalcInput<'classes', any> /* default: undefined */\n | DataCalcInput<'nodata', string> /* default: undefined */\n | DataCalcInput<'value', number> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color blend — Blends two colors using RGB channel-wise blend functions. Valid blend modes are multiply, darken, lighten, screen, overlay, burn, and dodge. */\nexport type DataCommandColorBlend = DataCommand & {\n __commandName: 'COLOR_BLEND'\n inputs?: Array<\n | DataCalcInput<'color1', string> /* default: \"\" */\n | DataCalcInput<'color2', string> /* default: \"\" */\n | DataCalcInput<'mode', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color brighten — Brighten the color. */\nexport type DataCommandColorBrighten = DataCommand & {\n __commandName: 'COLOR_BRIGHTEN'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'value', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* CMYK — Generate color string CMYK values */\nexport type DataCommandColorCmyk = DataCommand & {\n __commandName: 'COLOR_CMYK'\n inputs?: Array<\n | DataCalcInput<'cyan', number> /* default: 0 */\n | DataCalcInput<'magenta', number> /* default: 0 */\n | DataCalcInput<'yellow', number> /* default: 0 */\n | DataCalcInput<'black', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color contrast — Computes the WCAG contrast ratio between two colors. A minimum contrast of 4.5:1 is recommended to ensure that text is still readable against a background color. */\nexport type DataCommandColorContrast = DataCommand & {\n __commandName: 'COLOR_CONTRAST'\n inputs?: Array<\n | DataCalcInput<'color1', string> /* default: \"\" */\n | DataCalcInput<'color2', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Color darken — Darken the color */\nexport type DataCommandColorDarken = DataCommand & {\n __commandName: 'COLOR_DARKEN'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'value', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color delta E — Computes color difference as developed by the Colour Measurement Committee of the Society of Dyers and Colourists (CMC) in 1984. The implementation is adapted from Bruce Lindbloom. The parameters L and C are weighting factors for lightness and chromaticity. */\nexport type DataCommandColorDeltaE = DataCommand & {\n __commandName: 'COLOR_DELTA_E'\n inputs?: Array<\n | DataCalcInput<'color1', string> /* default: \"\" */\n | DataCalcInput<'color2', string> /* default: \"\" */\n | DataCalcInput<'L', number> /* default: 1 */\n | DataCalcInput<'C', number> /* default: 1 */\n | DataCalcInput<'mode', string> /* default: \"lab\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Color desaturate — Similar to COLOR_SATURATE, but the opposite direction. */\nexport type DataCommandColorDesaturate = DataCommand & {\n __commandName: 'COLOR_DESATURATE'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'value', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color distance — Computes the Euclidean distance between two colors in a given color space (default mode is lab). */\nexport type DataCommandColorDistance = DataCommand & {\n __commandName: 'COLOR_DISTANCE'\n inputs?: Array<\n | DataCalcInput<'color1', string> /* default: \"\" */\n | DataCalcInput<'color2', string> /* default: \"\" */\n | DataCalcInput<'mode', string> /* default: \"lab\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Color get — Returns a single channel value. E.g. channel='hsl.h' */\nexport type DataCommandColorGet = DataCommand & {\n __commandName: 'COLOR_GET'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'channel', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* HCL — Generate color string HCL values */\nexport type DataCommandColorHcl = DataCommand & {\n __commandName: 'COLOR_HCL'\n inputs?: Array<\n | DataCalcInput<'hue', number> /* default: 0 */\n | DataCalcInput<'chroma', number> /* default: 0 */\n | DataCalcInput<'lightness', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* HSL — Generate color string with HSL values */\nexport type DataCommandColorHsl = DataCommand & {\n __commandName: 'COLOR_HSL'\n inputs?: Array<\n | DataCalcInput<'hue', number> /* default: 0 */\n | DataCalcInput<'saturation', number> /* default: 0 */\n | DataCalcInput<'lightness', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* HSV — Generate color string with HSV values */\nexport type DataCommandColorHsv = DataCommand & {\n __commandName: 'COLOR_HSV'\n inputs?: Array<\n | DataCalcInput<'hue', number> /* default: 0 */\n | DataCalcInput<'saturation', number> /* default: 0 */\n | DataCalcInput<'value', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* LAB — Generate color string with LAB values */\nexport type DataCommandColorLab = DataCommand & {\n __commandName: 'COLOR_LAB'\n inputs?: Array<\n | DataCalcInput<'lightness', number> /* default: 0 */\n | DataCalcInput<'a', number> /* default: 0 */\n | DataCalcInput<'b', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color limits — Computes class breaks for you, based on data. It supports the modes equidistant (e), quantile (q), logarithmic (l), and k-means (k). */\nexport type DataCommandColorLimits = DataCommand & {\n __commandName: 'COLOR_LIMITS'\n inputs?: Array<\n | DataCalcInput<'data', Array<any>> /* default: [] */\n | DataCalcInput<'mode', string> /* default: \"\" */\n | DataCalcInput<'n', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color luminance — Change color luminance. */\nexport type DataCommandColorLuminance = DataCommand & {\n __commandName: 'COLOR_LUMINANCE'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'lum', number> /* default: 1 */\n | DataCalcInput<'mode', string> /* default: \"rgb\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color luminance number — Get color luminance. (0 - 1) */\nexport type DataCommandColorLuminanceNum = DataCommand & {\n __commandName: 'COLOR_LUMINANCE_NUM'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Color mix — Mixes two colors. The mix ratio is a value between 0 and 1. */\nexport type DataCommandColorMix = DataCommand & {\n __commandName: 'COLOR_MIX'\n inputs?: Array<\n | DataCalcInput<'color1', string> /* default: \"\" */\n | DataCalcInput<'color2', string> /* default: \"\" */\n | DataCalcInput<'ratio', number> /* default: 0.5 */\n | DataCalcInput<'mode', string> /* default: \"lrgb\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color name — Returns the named color. Falls back to hexadecimal RGB string, if the color isn't present. */\nexport type DataCommandColorName = DataCommand & {\n __commandName: 'COLOR_NAME'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Random color — Creates a random color by generating a random hexadecimal string. */\nexport type DataCommandColorRandom = DataCommand & {\n __commandName: 'COLOR_RANDOM'\n inputs?: Array<DataCalcInput<'trigger', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* RGBA — Generate a color from RGBA channels (red/green/blue: 0-255, alpha: 0-1) */\nexport type DataCommandColorRgba = DataCommand & {\n __commandName: 'COLOR_RGBA'\n inputs?: Array<\n | DataCalcInput<'red', number> /* default: 0 */\n | DataCalcInput<'green', number> /* default: 0 */\n | DataCalcInput<'blue', number> /* default: 0 */\n | DataCalcInput<'alpha', number> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color saturate — Changes the saturation of a color by manipulating the Lch chromaticity. */\nexport type DataCommandColorSaturate = DataCommand & {\n __commandName: 'COLOR_SATURATE'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'value', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color scale colors — Similar to COLOR_SCALE_VALUE, but get the color array with length. */\nexport type DataCommandColorScaleColors = DataCommand & {\n __commandName: 'COLOR_SCALE_COLORS'\n inputs?: Array<\n | DataCalcInput<'colors', Array<any>> /* default: undefined */\n | DataCalcInput<'domain', Array<any>> /* default: undefined */\n | DataCalcInput<'mode', string> /* default: \"rgb\" */\n | DataCalcInput<'gamma', number> /* default: 1 */\n | DataCalcInput<'correctLightness', boolean> /* default: false */\n | DataCalcInput<'padding', number> /* default: undefined */\n | DataCalcInput<'classes', any> /* default: undefined */\n | DataCalcInput<'length', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color scale value — Create color scale to get the color with some arguments.\n- colors: Your input color scale. - domain: You can change the input domain to match your specific use case. - mode: Color mode. - gamma: Gamma-correction can be used to \"shift\" a scale's center more the the beginning (gamma < 1) or end (gamma > 1), typically used to \"even\" the lightness gradient. Default is 1. - correctLightness: This makes sure the lightness range is spread evenly across a color scale. Especially useful when working with multi-hue color scales, where simple gamma correction can't help you very much. - padding: Reduces the color range by cutting of a fraction of the gradient on both sides. If you pass a single number, the same padding will be applied to both ends. - classes: If you want the scale function to return a distinct set of colors instead of a continuous gradient. - nodata: When you pass a non-numeric value like undefined or undefined to a chroma.scale, \"#cccccc\" is returned as fallback or \"no data\" color. - value: Value to get the color */\nexport type DataCommandColorScaleValue = DataCommand & {\n __commandName: 'COLOR_SCALE_VALUE'\n inputs?: Array<\n | DataCalcInput<'colors', Array<any>> /* default: undefined */\n | DataCalcInput<'domain', Array<any>> /* default: undefined */\n | DataCalcInput<'mode', string> /* default: \"rgb\" */\n | DataCalcInput<'gamma', number> /* default: 1 */\n | DataCalcInput<'correctLightness', boolean> /* default: false */\n | DataCalcInput<'padding', number> /* default: undefined */\n | DataCalcInput<'classes', any> /* default: undefined */\n | DataCalcInput<'nodata', string> /* default: undefined */\n | DataCalcInput<'value', number> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color set — Changes a single channel and returns the result. E.g. channel='hsl.h' */\nexport type DataCommandColorSet = DataCommand & {\n __commandName: 'COLOR_SET'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'channel', string> /* default: \"\" */\n | DataCalcInput<'value', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Temperature — Returns a color from the color temperature scale. See http://www.zombieprototypes.com/?p=210. */\nexport type DataCommandColorTemperature = DataCommand & {\n __commandName: 'COLOR_TEMPERATURE'\n inputs?: Array<DataCalcInput<'K', number> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color CSS — Returns a RGB() or HSL() string representation that can be used as CSS-color definition. */\nexport type DataCommandColorToCss = DataCommand & {\n __commandName: 'COLOR_TO_CSS'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color gl — Like COLOR_TO_RGB, but in the channel range of [0..1] instead of [0..255] */\nexport type DataCommandColorToGl = DataCommand & {\n __commandName: 'COLOR_TO_GL'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color HCL — Alias of COLOR_TO_LCH, but with the components in reverse order. */\nexport type DataCommandColorToHcl = DataCommand & {\n __commandName: 'COLOR_TO_HCL'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color hex — Change color string to hexadecimal RGB string. */\nexport type DataCommandColorToHex = DataCommand & {\n __commandName: 'COLOR_TO_HEX'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'mode', string> /* default: \"auto\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Color HSI — Returns an array with the hue, saturation, and intensity components. */\nexport type DataCommandColorToHsi = DataCommand & {\n __commandName: 'COLOR_TO_HSI'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color HSL — Returns an array with the hue, saturation, and lightness component. */\nexport type DataCommandColorToHsl = DataCommand & {\n __commandName: 'COLOR_TO_HSL'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color HSV — Returns an array with the hue, saturation, and value components. */\nexport type DataCommandColorToHsv = DataCommand & {\n __commandName: 'COLOR_TO_HSV'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color Lab — Returns an array with the L, a, and b components. */\nexport type DataCommandColorToLab = DataCommand & {\n __commandName: 'COLOR_TO_LAB'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color LCH — Returns an array with the Lightness, chroma, and hue components. */\nexport type DataCommandColorToLch = DataCommand & {\n __commandName: 'COLOR_TO_LCH'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color number — Returns the numeric representation of the hexadecimal RGB color. */\nexport type DataCommandColorToNum = DataCommand & {\n __commandName: 'COLOR_TO_NUM'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Color RGB — Returns an array with the red, green, and blue component, each as number within the range 0..255. */\nexport type DataCommandColorToRgb = DataCommand & {\n __commandName: 'COLOR_TO_RGB'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'round', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color RGBA — Just like COLOR_TO_RGB but adds the alpha channel to the returned array. */\nexport type DataCommandColorToRgba = DataCommand & {\n __commandName: 'COLOR_TO_RGBA'\n inputs?: Array<\n | DataCalcInput<'color', string> /* default: \"\" */\n | DataCalcInput<'round', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Color temperature — Estimate the temperature in Kelvin of any given color, though this makes the only sense for colors from the temperature gradient above. */\nexport type DataCommandColorToTemperature = DataCommand & {\n __commandName: 'COLOR_TO_TEMPERATURE'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Valid color string — Valid string can be correctly parsed as color */\nexport type DataCommandColorValid = DataCommand & {\n __commandName: 'COLOR_VALID'\n inputs?: Array<DataCalcInput<'color', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n","types/data-calc-command/constant.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Empty array [] — Return empty array [] */\nexport type DataCommandConstantEmptyArray = DataCommand & {\n __commandName: 'CONSTANT_EMPTY_ARRAY'\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Empty object {} — Return empty object {} */\nexport type DataCommandConstantEmptyObject = DataCommand & {\n __commandName: 'CONSTANT_EMPTY_OBJECT'\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Empty string \"\" — Return empty string \"\" */\nexport type DataCommandConstantEmptyString = DataCommand & {\n __commandName: 'CONSTANT_EMPTY_STRING'\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* False — Return false */\nexport type DataCommandConstantFalse = DataCommand & {\n __commandName: 'CONSTANT_FALSE'\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* 1 — Return 1 */\nexport type DataCommandConstantOne = DataCommand & {\n __commandName: 'CONSTANT_ONE'\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Basic Platform Info — Return basic platform info */\nexport type DataCommandConstantPlatform = DataCommand & {\n __commandName: 'CONSTANT_PLATFORM'\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* True — Return true */\nexport type DataCommandConstantTrue = DataCommand & {\n __commandName: 'CONSTANT_TRUE'\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* 0 — Return 0 */\nexport type DataCommandConstantZero = DataCommand & {\n __commandName: 'CONSTANT_ZERO'\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n","types/data-calc-command/datetime.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Add — Datetime add */\nexport type DataCommandDatetimeAdd = DataCommand & {\n __commandName: 'DATETIME_ADD'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'value', number> /* default: 0 */\n | DataCalcInput<'unit', string> /* default: \"days\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Date — Get date */\nexport type DataCommandDatetimeDate = DataCommand & {\n __commandName: 'DATETIME_DATE'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Day — Get day of week (0-based: Sunday is 0, Saturday is 6) */\nexport type DataCommandDatetimeDay = DataCommand & {\n __commandName: 'DATETIME_DAY'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Format — Format datetime to string */\nexport type DataCommandDatetimeFormat = DataCommand & {\n __commandName: 'DATETIME_FORMAT'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'format', string> /* default: \"ISO8061\" */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n | DataCalcInput<'locale', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Hour — Get hour (24H) */\nexport type DataCommandDatetimeHour = DataCommand & {\n __commandName: 'DATETIME_HOUR'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Minute — Get minute */\nexport type DataCommandDatetimeMinute = DataCommand & {\n __commandName: 'DATETIME_MINUTE'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Month — Get month (0-based: January is 0, December is 11) */\nexport type DataCommandDatetimeMonth = DataCommand & {\n __commandName: 'DATETIME_MONTH'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Now — Get now */\nexport type DataCommandDatetimeNow = DataCommand & {\n __commandName: 'DATETIME_NOW'\n inputs?: Array<DataCalcInput<'trigger', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Parse — Parse datetime string (empty use DATETIME_NOW) */\nexport type DataCommandDatetimeParse = DataCommand & {\n __commandName: 'DATETIME_PARSE'\n inputs?: Array<DataCalcInput<'value', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Quarter — Get quarter */\nexport type DataCommandDatetimeQuarter = DataCommand & {\n __commandName: 'DATETIME_QUARTER'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Second — Get second */\nexport type DataCommandDatetimeSecond = DataCommand & {\n __commandName: 'DATETIME_SECOND'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Substract — Datetime substract */\nexport type DataCommandDatetimeSubtract = DataCommand & {\n __commandName: 'DATETIME_SUBTRACT'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'value', number> /* default: 0 */\n | DataCalcInput<'unit', string> /* default: \"days\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Unix Timestamp for now — Get now (Unix timestamp) */\nexport type DataCommandDatetimeUnixTimestamp = DataCommand & {\n __commandName: 'DATETIME_UNIX_TIMESTAMP'\n inputs?: Array<DataCalcInput<'trigger', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Week — Get week */\nexport type DataCommandDatetimeWeek = DataCommand & {\n __commandName: 'DATETIME_WEEK'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Year — Get year */\nexport type DataCommandDatetimeYear = DataCommand & {\n __commandName: 'DATETIME_YEAR'\n inputs?: Array<\n | DataCalcInput<'datetime', string> /* default: DATETIME_NOW */\n | DataCalcInput<'timezone', string> /* default: Machine default */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n","types/data-calc-command/file.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* append file — Append file */\nexport type DataCommandFileAppend = DataCommand & {\n __commandName: 'FILE_APPEND'\n inputs?: Array<\n | DataCalcInput<'path', string>\n | DataCalcInput<'contents', any>\n | DataCalcInput<'encoding', string> /* default: \"utf8\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* cache path — Get cache path */\nexport type DataCommandFileCachePath = DataCommand & {\n __commandName: 'FILE_CACHE_PATH'\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* copy file — Copy file */\nexport type DataCommandFileCopyFile = DataCommand & {\n __commandName: 'FILE_COPY_FILE'\n inputs?: Array<DataCalcInput<'from', string> | DataCalcInput<'to', string>>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* document path — Get document path */\nexport type DataCommandFileDocumentPath = DataCommand & {\n __commandName: 'FILE_DOCUMENT_PATH'\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* exists — Check if file exists */\nexport type DataCommandFileExists = DataCommand & {\n __commandName: 'FILE_EXISTS'\n inputs?: Array<DataCalcInput<'path', string>>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Get Error — Get error of result from File command */\nexport type DataCommandFileGetError = DataCommand & {\n __commandName: 'FILE_GET_ERROR'\n inputs?: Array<DataCalcInput<'result', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Get Return Value — Get returnValue of result from File command */\nexport type DataCommandFileGetReturnValue = DataCommand & {\n __commandName: 'FILE_GET_RETURN_VALUE'\n inputs?: Array<DataCalcInput<'result', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* hash — Get file hash */\nexport type DataCommandFileHash = DataCommand & {\n __commandName: 'FILE_HASH'\n inputs?: Array<\n DataCalcInput<'path', string> | DataCalcInput<'algorithm', string> /* default: \"md5\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* mkdir — Create directory */\nexport type DataCommandFileMkdir = DataCommand & {\n __commandName: 'FILE_MKDIR'\n inputs?: Array<\n DataCalcInput<'path', string> | DataCalcInput<'parent', boolean> /* default: false */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* move file — Move file */\nexport type DataCommandFileMoveFile = DataCommand & {\n __commandName: 'FILE_MOVE_FILE'\n inputs?: Array<DataCalcInput<'from', string> | DataCalcInput<'to', string>>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* read — Read file (length < 0: read all) */\nexport type DataCommandFileRead = DataCommand & {\n __commandName: 'FILE_READ'\n inputs?: Array<\n | DataCalcInput<'path', string>\n | DataCalcInput<'length', number> /* default: -1 */\n | DataCalcInput<'position', number> /* default: 0 */\n | DataCalcInput<'encoding', string> /* default: \"utf8\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* read dir — Read directory */\nexport type DataCommandFileReadDir = DataCommand & {\n __commandName: 'FILE_READ_DIR'\n inputs?: Array<DataCalcInput<'path', string>>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* stat — Get file status */\nexport type DataCommandFileStat = DataCommand & {\n __commandName: 'FILE_STAT'\n inputs?: Array<DataCalcInput<'path', string>>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* temporary path — Get temporary path */\nexport type DataCommandFileTmpPath = DataCommand & {\n __commandName: 'FILE_TMP_PATH'\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* unlink — Delete file */\nexport type DataCommandFileUnlink = DataCommand & {\n __commandName: 'FILE_UNLINK'\n inputs?: Array<DataCalcInput<'path', string>>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* write — Write file (length < 0: write all) */\nexport type DataCommandFileWrite = DataCommand & {\n __commandName: 'FILE_WRITE'\n inputs?: Array<\n | DataCalcInput<'path', string>\n | DataCalcInput<'contents', any>\n | DataCalcInput<'position', number> /* default: -1 */\n | DataCalcInput<'encoding', string> /* default: \"utf8\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n","types/data-calc-command/index.d.ts":"/* Auto generated by build script */\nexport * from './base'\nexport * from './constant'\nexport * from './logictype'\nexport * from './object'\nexport * from './collection'\nexport * from './datetime'\nexport * from './string'\nexport * from './math'\nexport * from './iteratee'\nexport * from './sandbox'\nexport * from './color'\nexport * from './file'\n","types/data-calc-command/iteratee.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Get key — Get key from iteratee_input */\nexport type DataCommandIterateeGetKey = DataCommand & {\n __commandName: 'ITERATEE_GET_KEY'\n inputs?: Array<DataCalcInput<'iteratee_input', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Get result — Get result from iteratee_input */\nexport type DataCommandIterateeGetResult = DataCommand & {\n __commandName: 'ITERATEE_GET_RESULT'\n inputs?: Array<DataCalcInput<'iteratee_input', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Get value — Get value from iteratee_input */\nexport type DataCommandIterateeGetValue = DataCommand & {\n __commandName: 'ITERATEE_GET_VALUE'\n inputs?: Array<DataCalcInput<'iteratee_input', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n","types/data-calc-command/logictype.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* And — And */\nexport type DataCommandLogictypeAnd = DataCommand & {\n __commandName: 'LOGICTYPE_AND'\n inputs?: Array<\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'other', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Clone — Clone value */\nexport type DataCommandLogictypeClone = DataCommand & {\n __commandName: 'LOGICTYPE_CLONE'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Equal value — Compare by value (deep) */\nexport type DataCommandLogictypeEqualValue = DataCommand & {\n __commandName: 'LOGICTYPE_EQUAL_VALUE'\n inputs?: Array<\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'other', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* If — Condition for return truthy or falsy */\nexport type DataCommandLogictypeIf = DataCommand & {\n __commandName: 'LOGICTYPE_IF'\n inputs?: Array<\n | DataCalcInput<'condition', any> /* default: undefined */\n | DataCalcInput<'truthy', any> /* default: undefined */\n | DataCalcInput<'falsy', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Is array — Is it an array? */\nexport type DataCommandLogictypeIsArray = DataCommand & {\n __commandName: 'LOGICTYPE_IS_ARRAY'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is boolean — Is it boolean? */\nexport type DataCommandLogictypeIsBoolean = DataCommand & {\n __commandName: 'LOGICTYPE_IS_BOOLEAN'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is datetime — Is it a datetime? */\nexport type DataCommandLogictypeIsDatetime = DataCommand & {\n __commandName: 'LOGICTYPE_IS_DATETIME'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is empty — Is it empty? */\nexport type DataCommandLogictypeIsEmpty = DataCommand & {\n __commandName: 'LOGICTYPE_IS_EMPTY'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is integer — Is it integer? */\nexport type DataCommandLogictypeIsInteger = DataCommand & {\n __commandName: 'LOGICTYPE_IS_INTEGER'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is number — Is it a number? */\nexport type DataCommandLogictypeIsNumber = DataCommand & {\n __commandName: 'LOGICTYPE_IS_NUMBER'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is object — Is it a object? */\nexport type DataCommandLogictypeIsObject = DataCommand & {\n __commandName: 'LOGICTYPE_IS_OBJECT'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is string — Is it string? */\nexport type DataCommandLogictypeIsString = DataCommand & {\n __commandName: 'LOGICTYPE_IS_STRING'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Not — Not */\nexport type DataCommandLogictypeNot = DataCommand & {\n __commandName: 'LOGICTYPE_NOT'\n inputs?: Array<DataCalcInput<'value', any> /* default: undefined */>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Not equal value — Compare not equal by value (deep) */\nexport type DataCommandLogictypeNotEqualValue = DataCommand & {\n __commandName: 'LOGICTYPE_NOT_EQUAL_VALUE'\n inputs?: Array<\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'other', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* 或 */\nexport type DataCommandLogictypeOr = DataCommand & {\n __commandName: 'LOGICTYPE_OR'\n inputs?: Array<\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'other', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Convert to array — Convert to array if possible, return fail_value if failed (Supported JSON) */\nexport type DataCommandLogictypeToArray = DataCommand & {\n __commandName: 'LOGICTYPE_TO_ARRAY'\n inputs?: Array<\n DataCalcInput<'value', any> | DataCalcInput<'fail_value', Array<any>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Convert to boolean — Convert to boolean */\nexport type DataCommandLogictypeToBoolean = DataCommand & {\n __commandName: 'LOGICTYPE_TO_BOOLEAN'\n inputs?: Array<DataCalcInput<'value', any>>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Convert to datetime — Convert to datetime if possible, return fail_value if failed */\nexport type DataCommandLogictypeToDatetime = DataCommand & {\n __commandName: 'LOGICTYPE_TO_DATETIME'\n inputs?: Array<\n DataCalcInput<'value', any> | DataCalcInput<'fail_value', string> /* default: DATETIME_NOW */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Convert to integer — Convert to integer if possible, return fail_value if failed */\nexport type DataCommandLogictypeToInteger = DataCommand & {\n __commandName: 'LOGICTYPE_TO_INTEGER'\n inputs?: Array<DataCalcInput<'value', any> | DataCalcInput<'fail_value', any> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Convert to number — Convert to number if possible, return fail_value if failed */\nexport type DataCommandLogictypeToNumber = DataCommand & {\n __commandName: 'LOGICTYPE_TO_NUMBER'\n inputs?: Array<DataCalcInput<'value', any> | DataCalcInput<'fail_value', number> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Convert to object — Convert to object if possible, return fail_value if failed (Supported JSON) */\nexport type DataCommandLogictypeToObject = DataCommand & {\n __commandName: 'LOGICTYPE_TO_OBJECT'\n inputs?: Array<\n DataCalcInput<'value', any> | DataCalcInput<'fail_value', object> /* default: {} */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Convert to string — Convert to string if possible, return fail_value if failed (Supported JSON and Datetime format) */\nexport type DataCommandLogictypeToString = DataCommand & {\n __commandName: 'LOGICTYPE_TO_STRING'\n inputs?: Array<\n DataCalcInput<'value', any> | DataCalcInput<'fail_value', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* XOR — XOR */\nexport type DataCommandLogictypeXor = DataCommand & {\n __commandName: 'LOGICTYPE_XOR'\n inputs?: Array<\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'other', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n","types/data-calc-command/math.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Abs — Abs */\nexport type DataCommandMathAbs = DataCommand & {\n __commandName: 'MATH_ABS'\n inputs?: Array<DataCalcInput<'value', number> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Add — Add */\nexport type DataCommandMathAdd = DataCommand & {\n __commandName: 'MATH_ADD'\n inputs?: Array<\n | DataCalcInput<'augend', number> /* default: 0 */\n | DataCalcInput<'addend', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Ceil — Ceil */\nexport type DataCommandMathCeil = DataCommand & {\n __commandName: 'MATH_CEIL'\n inputs?: Array<DataCalcInput<'value', number> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Divide — Divide (Return integer if precision is 0) */\nexport type DataCommandMathDivide = DataCommand & {\n __commandName: 'MATH_DIVIDE'\n inputs?: Array<\n | DataCalcInput<'dividend', number> /* default: 0 */\n | DataCalcInput<'divisor', number> /* default: 1 */\n | DataCalcInput<'precision', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Equal — Alias of LOGICTYPE_EQUAL_VALUE */\nexport type DataCommandMathEqual = DataCommand & {\n __commandName: 'MATH_EQUAL'\n inputs?: Array<\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'other', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Run equation — Use string to write math functions, and use object as variables. (You can use OBJECT_DEFAULTS to make object) */\nexport type DataCommandMathEquation = DataCommand & {\n __commandName: 'MATH_EQUATION'\n inputs?: Array<\n DataCalcInput<'arguments', object> /* default: {} */ | DataCalcInput<'equation', string>\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Floor — Floor number */\nexport type DataCommandMathFloor = DataCommand & {\n __commandName: 'MATH_FLOOR'\n inputs?: Array<\n | DataCalcInput<'value', number> /* default: 0 */\n | DataCalcInput<'precision', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* GCD — GCD */\nexport type DataCommandMathGcd = DataCommand & {\n __commandName: 'MATH_GCD'\n inputs?: Array<DataCalcInput<'number_list', Array<number>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Is Negative — Is negative */\nexport type DataCommandMathIsNegative = DataCommand & {\n __commandName: 'MATH_IS_NEGATIVE'\n inputs?: Array<DataCalcInput<'value', any>>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is Positive — Is positive */\nexport type DataCommandMathIsPositive = DataCommand & {\n __commandName: 'MATH_IS_POSITIVE'\n inputs?: Array<DataCalcInput<'value', any>>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is Prime — Is prime */\nexport type DataCommandMathIsPrime = DataCommand & {\n __commandName: 'MATH_IS_PRIME'\n inputs?: Array<DataCalcInput<'value', any>>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Is zero — Is zero */\nexport type DataCommandMathIsZero = DataCommand & {\n __commandName: 'MATH_IS_ZERO'\n inputs?: Array<DataCalcInput<'value', any>>\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Larger — Larger */\nexport type DataCommandMathLarger = DataCommand & {\n __commandName: 'MATH_LARGER'\n inputs?: Array<\n DataCalcInput<'x', number> /* default: 0 */ | DataCalcInput<'y', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Larger and Equal — Larger and Equal */\nexport type DataCommandMathLargerAndEqual = DataCommand & {\n __commandName: 'MATH_LARGER_AND_EQUAL'\n inputs?: Array<\n DataCalcInput<'x', number> /* default: 0 */ | DataCalcInput<'y', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* LCM — LCM */\nexport type DataCommandMathLcm = DataCommand & {\n __commandName: 'MATH_LCM'\n inputs?: Array<\n DataCalcInput<'x', number> /* default: 0 */ | DataCalcInput<'y', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Max — Get max value in array of number (ignore non-numeric value) */\nexport type DataCommandMathMax = DataCommand & {\n __commandName: 'MATH_MAX'\n inputs?: Array<DataCalcInput<'number_list', Array<number>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Mean — Get average value in array of number (ignore non-numeric value) */\nexport type DataCommandMathMean = DataCommand & {\n __commandName: 'MATH_MEAN'\n inputs?: Array<DataCalcInput<'number_list', Array<number>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Min — Get min in array of number (ignore non-numeric value) */\nexport type DataCommandMathMin = DataCommand & {\n __commandName: 'MATH_MIN'\n inputs?: Array<DataCalcInput<'number_list', Array<number>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Mod — Mod */\nexport type DataCommandMathMod = DataCommand & {\n __commandName: 'MATH_MOD'\n inputs?: Array<\n | DataCalcInput<'dividend', number> /* default: 0 */\n | DataCalcInput<'divisor', number> /* default: 1 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Multiply — Multiply */\nexport type DataCommandMathMultiply = DataCommand & {\n __commandName: 'MATH_MULTIPLY'\n inputs?: Array<\n | DataCalcInput<'multiplier', number> /* default: 1 */\n | DataCalcInput<'multiplicand', number> /* default: 1 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Not Equal — Not equal */\nexport type DataCommandMathNotEqual = DataCommand & {\n __commandName: 'MATH_NOT_EQUAL'\n inputs?: Array<\n | DataCalcInput<'value', any> /* default: undefined */\n | DataCalcInput<'other', any> /* default: undefined */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Root — Root */\nexport type DataCommandMathNthRoot = DataCommand & {\n __commandName: 'MATH_NTH_ROOT'\n inputs?: Array<\n DataCalcInput<'value', number> /* default: 0 */ | DataCalcInput<'root', any> /* default: 2 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Pow — Pow */\nexport type DataCommandMathPow = DataCommand & {\n __commandName: 'MATH_POW'\n inputs?: Array<\n DataCalcInput<'base', number> /* default: 0 */ | DataCalcInput<'exponent', any> /* default: 2 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Random — Get a random number */\nexport type DataCommandMathRandom = DataCommand & {\n __commandName: 'MATH_RANDOM'\n inputs?: Array<\n | DataCalcInput<'trigger', any> /* default: undefined */\n | DataCalcInput<'lower', number> /* default: 0 */\n | DataCalcInput<'upper', number> /* default: 1 */\n | DataCalcInput<'floating', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Round — Round number */\nexport type DataCommandMathRound = DataCommand & {\n __commandName: 'MATH_ROUND'\n inputs?: Array<\n | DataCalcInput<'value', number> /* default: 0 */\n | DataCalcInput<'precision', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Sign — Sign number */\nexport type DataCommandMathSign = DataCommand & {\n __commandName: 'MATH_SIGN'\n inputs?: Array<DataCalcInput<'value', number> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Smaller — Result = x < y */\nexport type DataCommandMathSmaller = DataCommand & {\n __commandName: 'MATH_SMALLER'\n inputs?: Array<\n DataCalcInput<'x', number> /* default: 0 */ | DataCalcInput<'y', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Smaller And Equal — Result = x <= y */\nexport type DataCommandMathSmallerAndEqual = DataCommand & {\n __commandName: 'MATH_SMALLER_AND_EQUAL'\n inputs?: Array<\n DataCalcInput<'x', number> /* default: 0 */ | DataCalcInput<'y', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Substract — Substract */\nexport type DataCommandMathSubtract = DataCommand & {\n __commandName: 'MATH_SUBTRACT'\n inputs?: Array<\n | DataCalcInput<'minuend', number> /* default: 0 */\n | DataCalcInput<'subtrahend', number> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Sum — Get sum in array of number (ignore non-numeric value) */\nexport type DataCommandMathSum = DataCommand & {\n __commandName: 'MATH_SUM'\n inputs?: Array<DataCalcInput<'number_list', Array<number>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Unary minus — Unary minus (Result = value * -1) */\nexport type DataCommandMathUnaryMinus = DataCommand & {\n __commandName: 'MATH_UNARY_MINUS'\n inputs?: Array<DataCalcInput<'value', number> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n\n/* Unary plus — Unary plus */\nexport type DataCommandMathUnaryPlus = DataCommand & {\n __commandName: 'MATH_UNARY_PLUS'\n inputs?: Array<DataCalcInput<'value', any> /* default: 0 */>\n outputs?: Array<DataCalcOutput<'result'> /* target: number */>\n}\n","types/data-calc-command/object.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Defaults — Assigns property of objects to new object for all destination properties that resolve to undefined. Source objects are applied from left to right. Once a property is set, additional values of the same property are ignored. */\nexport type DataCommandObjectDefaults = DataCommand & {\n __commandName: 'OBJECT_DEFAULTS'\n inputs?: Array<DataCalcInput<'obj_list', Array<object>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Defaults Deep — This command is like OBJECT_DEFAULTS except that it recursively assigns default properties. */\nexport type DataCommandObjectDefaultsDeep = DataCommand & {\n __commandName: 'OBJECT_DEFAULTS_DEEP'\n inputs?: Array<DataCalcInput<'obj_list', Array<object>> /* default: [] */>\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Get — Get value by path in object (Use `.` for subpaths, return obj if path is empty) */\nexport type DataCommandObjectGet = DataCommand & {\n __commandName: 'OBJECT_GET'\n inputs?: Array<\n | DataCalcInput<'obj', object | Array<any>> /* default: {} */\n | DataCalcInput<'path', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Has — Check path exists in the object (Use `.` for subpaths) */\nexport type DataCommandObjectHas = DataCommand & {\n __commandName: 'OBJECT_HAS'\n inputs?: Array<\n | DataCalcInput<'obj', object | Array<any>> /* default: {} */\n | DataCalcInput<'path', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>\n}\n\n/* Keys — Get keys array of object */\nexport type DataCommandObjectKeys = DataCommand & {\n __commandName: 'OBJECT_KEYS'\n inputs?: Array<DataCalcInput<'obj', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Map Keys — Assign new object with new keys.\nIf property_path provided, it will use OBJECT_GET to get values as property key, then output to result.\nIf property_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_key, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandObjectMapKeys = DataCommand & {\n __commandName: 'OBJECT_MAP_KEYS'\n inputs?: Array<\n | DataCalcInput<'obj', object> /* default: {} */\n | DataCalcInput<'property_path', string> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_key',\n any\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: object */\n >\n}\n\n/* Map Values — Assign new object with new values.\nIf property_path provided, it will use OBJECT_GET to get values as property value, then output to result.\nIf property_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */\nexport type DataCommandObjectMapValues = DataCommand & {\n __commandName: 'OBJECT_MAP_VALUES'\n inputs?: Array<\n | DataCalcInput<'obj', object> /* default: {} */\n | DataCalcInput<'property_path', string> /* default: undefined */\n | DataCalcInput<\n 'iteratee_result_key',\n any\n > /* iteratee callback input */ /* default: undefined */\n >\n outputs?: Array<\n | DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: object */\n >\n}\n\n/* Omit — Return new object omitted by path_list */\nexport type DataCommandObjectOmit = DataCommand & {\n __commandName: 'OBJECT_OMIT'\n inputs?: Array<\n | DataCalcInput<'obj', object> /* default: {} */\n | DataCalcInput<'path_list', Array<string>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Pick — Return new object picked by path_list */\nexport type DataCommandObjectPick = DataCommand & {\n __commandName: 'OBJECT_PICK'\n inputs?: Array<\n | DataCalcInput<'obj', object> /* default: {} */\n | DataCalcInput<'path_list', Array<string>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Set — Set value for path of object (Use `.` for subpaths) */\nexport type DataCommandObjectSet = DataCommand & {\n __commandName: 'OBJECT_SET'\n inputs?: Array<\n | DataCalcInput<'obj', object> /* default: {} */\n | DataCalcInput<'path', string> /* default: \"\" */\n | DataCalcInput<'value', any>\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n\n/* Values — Get values array of object */\nexport type DataCommandObjectValues = DataCommand & {\n __commandName: 'OBJECT_VALUES'\n inputs?: Array<DataCalcInput<'obj', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n","types/data-calc-command/sandbox.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Get Error — Get error of result from SANDBOX_RUN */\nexport type DataCommandSandboxGetError = DataCommand & {\n __commandName: 'SANDBOX_GET_ERROR'\n inputs?: Array<DataCalcInput<'result', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Get Return Value — Get returnValue of result from SANDBOX_RUN */\nexport type DataCommandSandboxGetReturnValue = DataCommand & {\n __commandName: 'SANDBOX_GET_RETURN_VALUE'\n inputs?: Array<DataCalcInput<'result', object> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Run JS — Run JavaScript code\n\n- Default `use strict`\n- Global functions fetch, XMLHttpRequest are not available.\n- setTimeout, setInterval, Promise... require Enable Async.\n- Built-in globals: Platform, Buffer, btoa/atob, TextEncoder/TextDecoder\n\n##### Available libraries (global)\n\n- invariant\n- bytes\n- ms\n- qs\n- url\n- nanoid\n- md5\n- json5\n- lodash and _\n- mathjs and math\n- voca\n- moment\n- chroma\n- kjurJWS (KJUR.jws.JWS from https://github.com/kjur/jsrsasign/wiki/Tutorial-for-JWT-generation)\n- crypto\n- base45\n- cbor (Not support async)\n- coseVerify (cose.sign.verifySync from https://github.com/erdtman/COSE-JS)\n- fflate (Not support async, callback and stream)\n- iconv (Use iconv-lite)\n- OpenCC (Use opencc-js)\n- fs (Limited, no download/upload)\n- parseDocument (Use officeparser, requires Enable Async)\n- TurndownService (Use turndown, HTML to Markdown)\n- TOON (Use toon-format/toon)\n\nAndroid: Running on the sandbox of Hermes engine\n\niOS: Running on the sandbox of iOS built-in JavaScriptCore\n\nDesktop / Web: Running on the sandbox of a Web Worker */\nexport type DataCommandSandboxRunJavascript = DataCommand & {\n __commandName: 'SANDBOX_RUN_JAVASCRIPT'\n inputs?: Array<\n | DataCalcInput<'code', string> /* default: \"\" */\n | DataCalcInput<'inputs', any> /* default: undefined */\n | DataCalcInput<'enable_async', boolean> /* default: false */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: object */>\n}\n","types/data-calc-command/string.d.ts":"/* Auto generated by build script */\nimport type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'\n\n/* Base64 Decode — Decode from base64. If decode failed, return empty string. */\nexport type DataCommandStringBase64Decode = DataCommand & {\n __commandName: 'STRING_BASE64_DECODE'\n inputs?: Array<DataCalcInput<'base64', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Base64 Encode — Encode with base64 */\nexport type DataCommandStringBase64Encode = DataCommand & {\n __commandName: 'STRING_BASE64_ENCODE'\n inputs?: Array<DataCalcInput<'subject', any> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Camel Case — Convert to Camel Case */\nexport type DataCommandStringCamelCase = DataCommand & {\n __commandName: 'STRING_CAMEL_CASE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Capitalize — Capitalize string */\nexport type DataCommandStringCapitalize = DataCommand & {\n __commandName: 'STRING_CAPITALIZE'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'reset_to_lower', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Chars — Splits subject into an array of characters. */\nexport type DataCommandStringChars = DataCommand & {\n __commandName: 'STRING_CHARS'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Char at — Access a character from `subject` at specified `position`. */\nexport type DataCommandStringCharAt = DataCommand & {\n __commandName: 'STRING_CHAR_AT'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'position', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Count — Counts the characters in subject. */\nexport type DataCommandStringCount = DataCommand & {\n __commandName: 'STRING_COUNT'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Count graphemes — Counts the graphemes in subject taking care of surrogate pairs and combining marks. */\nexport type DataCommandStringCountGraphemes = DataCommand & {\n __commandName: 'STRING_COUNT_GRAPHEMES'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Count Substrings — Counts the number of substring appearances in subject. */\nexport type DataCommandStringCountSubstrings = DataCommand & {\n __commandName: 'STRING_COUNT_SUBSTRINGS'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'substring', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Count words — Counts the number of words in subject. */\nexport type DataCommandStringCountWords = DataCommand & {\n __commandName: 'STRING_COUNT_WORDS'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Decapitalize — Ddecapitalize string */\nexport type DataCommandStringDecapitalize = DataCommand & {\n __commandName: 'STRING_DECAPITALIZE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* First — Returns the first characters string. */\nexport type DataCommandStringFirst = DataCommand & {\n __commandName: 'STRING_FIRST'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'length', any> /* default: 1 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Index of — Returns the first occurrence index of search in subject. */\nexport type DataCommandStringIndexOf = DataCommand & {\n __commandName: 'STRING_INDEX_OF'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'search', string> /* default: \"\" */\n | DataCalcInput<'from_index', any> /* default: 0 */\n | DataCalcInput<'is_reg_exp', boolean> /* default: false */\n | DataCalcInput<'forward', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Insert — Inserts into subject a string toInsert at specified position. */\nexport type DataCommandStringInsert = DataCommand & {\n __commandName: 'STRING_INSERT'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'to_insert', string> /* default: \"\" */\n | DataCalcInput<'position', any> /* default: Length of subject */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Join — Converts all elements in `array` into a string separated by `separator`. */\nexport type DataCommandStringJoin = DataCommand & {\n __commandName: 'STRING_JOIN'\n inputs?: Array<\n | DataCalcInput<'array', Array<any>> /* default: [] */\n | DataCalcInput<'separator', string> /* default: \",\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* JSON Parse — Parse JSON String to object. Return undefined if parse failed. */\nexport type DataCommandStringJsonParse = DataCommand & {\n __commandName: 'STRING_JSON_PARSE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"{}\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* JSON Stringify — Stringify JSON */\nexport type DataCommandStringJsonStringify = DataCommand & {\n __commandName: 'STRING_JSON_STRINGIFY'\n inputs?: Array<\n DataCalcInput<'value', any> /* default: {} */ | DataCalcInput<'space', any> /* default: 0 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Kebab Case — Convert to Kebab Case */\nexport type DataCommandStringKebabCase = DataCommand & {\n __commandName: 'STRING_KEBAB_CASE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Last — Returns the last characters string. */\nexport type DataCommandStringLast = DataCommand & {\n __commandName: 'STRING_LAST'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'length', any> /* default: 1 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Latinise — Latinises the subject by removing diacritic characters. */\nexport type DataCommandStringLatinise = DataCommand & {\n __commandName: 'STRING_LATINISE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Lower Case — Convert Lower Case */\nexport type DataCommandStringLowerCase = DataCommand & {\n __commandName: 'STRING_LOWER_CASE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Pad */\nexport type DataCommandStringPad = DataCommand & {\n __commandName: 'STRING_PAD'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'pad', string> /* default: \" \" */\n | DataCalcInput<'length', any> /* default: Length of subject */\n | DataCalcInput<'on_left', boolean> /* default: true */\n | DataCalcInput<'on_right', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Prune — Truncates subject to a new length and does not break the words. */\nexport type DataCommandStringPrune = DataCommand & {\n __commandName: 'STRING_PRUNE'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'length', any> /* default: 1 */\n | DataCalcInput<'end', string> /* default: \"...\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Repeat — Repeats the subject number of times. */\nexport type DataCommandStringRepeat = DataCommand & {\n __commandName: 'STRING_REPEAT'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'times', any> /* default: 1 */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Replace — Replace string, it directly do replacement if provided `replacement`.\nIf no replacement is provided, and the pattern match is successful, it will trigger invocation_input callback with property filtered by regex. Until the calculation trigger invocation_result, it will trigger result output. */\nexport type DataCommandStringReplace = DataCommand & {\n __commandName: 'STRING_REPLACE'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'pattern', string> /* default: \"\" */\n | DataCalcInput<'replacement', string> /* default: undefined */\n | DataCalcInput<\n 'invocation_result',\n string\n > /* invocation callback input */ /* default: undefined */\n | DataCalcInput<'is_reg_exp', boolean> /* default: false */\n | DataCalcInput<'all', boolean> /* default: false */\n >\n outputs?: Array<\n | DataCalcOutput<'invocation_input'> /* invocation callback */ /* target: object */\n | DataCalcOutput<'result'> /* target: string */\n >\n}\n\n/* Reverse — Reverses the subject. */\nexport type DataCommandStringReverse = DataCommand & {\n __commandName: 'STRING_REVERSE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Slice — Extracts from subject a string from start position up to end position. If end is negative use subject length + end. */\nexport type DataCommandStringSlice = DataCommand & {\n __commandName: 'STRING_SLICE'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'start', any> /* default: 0 */\n | DataCalcInput<'end', any> /* default: Length of subject */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Slugify — Slugifies the subject. Cleans the subject by replacing diacritics with corresponding latin characters. */\nexport type DataCommandStringSlugify = DataCommand & {\n __commandName: 'STRING_SLUGIFY'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Snake Case — Convert to Snake Case */\nexport type DataCommandStringSnakeCase = DataCommand & {\n __commandName: 'STRING_SNAKE_CASE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Splice — Changes subject by deleting delete_count of characters starting at position start. */\nexport type DataCommandStringSplice = DataCommand & {\n __commandName: 'STRING_SPLICE'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'start', any> /* default: 0 */\n | DataCalcInput<'delete_count', any> /* default: Length of subject - start */\n | DataCalcInput<'to_add', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Split — Splits subject into an array of chunks by separator. */\nexport type DataCommandStringSplit = DataCommand & {\n __commandName: 'STRING_SPLIT'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'separactor', string> /* default: \" \" */\n | DataCalcInput<'is_reg_exp', boolean> /* default: false */\n | DataCalcInput<'limit', any> /* default: No Limit */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Substring — Extracts from subject a string from start position a number of length characters. */\nexport type DataCommandStringSubstr = DataCommand & {\n __commandName: 'STRING_SUBSTR'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'start', any> /* default: 0 */\n | DataCalcInput<'length', any> /* default: Length to end of subject */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Swap Case — Swap case */\nexport type DataCommandStringSwapCase = DataCommand & {\n __commandName: 'STRING_SWAP_CASE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Template Literals — Make string with template literals (`Hello ${name}`) (Type: `${}` or `{{}}`) */\nexport type DataCommandStringTemplateLiterals = DataCommand & {\n __commandName: 'STRING_TEMPLATE_LITERALS'\n inputs?: Array<\n | DataCalcInput<'template', string> /* default: \"\" */\n | DataCalcInput<'data', object> /* default: {} */\n | DataCalcInput<'type', string> /* default: \"${}\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Title Case — Convert to Title Case */\nexport type DataCommandStringTitleCase = DataCommand & {\n __commandName: 'STRING_TITLE_CASE'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'no_split', Array<string>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* TOON Decode — Decode TOON string. Return undefined if decode failed. */\nexport type DataCommandStringToolDecode = DataCommand & {\n __commandName: 'STRING_TOOL_DECODE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"{}\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* TOON Encode — Encode TOON string. Return undefined if encode failed. */\nexport type DataCommandStringToolEncode = DataCommand & {\n __commandName: 'STRING_TOOL_ENCODE'\n inputs?: Array<DataCalcInput<'subject', any> /* default: {} */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Trim — Removes whitespaces from left and right sides of the subject. */\nexport type DataCommandStringTrim = DataCommand & {\n __commandName: 'STRING_TRIM'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'white_space', string> /* default: \" \" */\n | DataCalcInput<'on_left', boolean> /* default: true */\n | DataCalcInput<'on_right', boolean> /* default: true */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Truncate — Truncates subject to a new length. */\nexport type DataCommandStringTruncate = DataCommand & {\n __commandName: 'STRING_TRUNCATE'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'length', any> /* default: 1 */\n | DataCalcInput<'end', string> /* default: \"...\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Upper Case — Convert to upper case */\nexport type DataCommandStringUpperCase = DataCommand & {\n __commandName: 'STRING_UPPER_CASE'\n inputs?: Array<DataCalcInput<'subject', string> /* default: \"\" */>\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Vprintf — Produces a string according to format. (See https://vocajs.com/#sprintf for more information) */\nexport type DataCommandStringVprintf = DataCommand & {\n __commandName: 'STRING_VPRINTF'\n inputs?: Array<\n | DataCalcInput<'format', string> /* default: \"\" */\n | DataCalcInput<'replacements', Array<any>> /* default: [] */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n\n/* Words — Splits subject into an array of words. */\nexport type DataCommandStringWords = DataCommand & {\n __commandName: 'STRING_WORDS'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'pattern', string> /* default: undefined */\n | DataCalcInput<'flags', string> /* default: \"\" */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: any */>\n}\n\n/* Word wrap — Wraps subject to a given number of characters using a string break character. */\nexport type DataCommandStringWordWrap = DataCommand & {\n __commandName: 'STRING_WORD_WRAP'\n inputs?: Array<\n | DataCalcInput<'subject', string> /* default: \"\" */\n | DataCalcInput<'width', any> /* default: 80 */\n | DataCalcInput<'new_line', string> /* default: \" */\n | DataCalcInput<'indent', string> /* default: \"\" */\n | DataCalcInput<'cut', boolean> /* default: false */\n >\n outputs?: Array<DataCalcOutput<'result'> /* target: string */>\n}\n","types/data-calc-script.d.ts":"/* Auto generated by build script */\nimport type { Data } from './data'\nimport type { DataCalculation } from './data-calc'\n\nexport type DataCalculationScript = DataCalculation & {\n __typename: 'DataCalculationScript'\n note?: string\n enableAsync: boolean\n code: string\n inputs: Array<{\n data: () => Data\n key: string\n trigger?: boolean\n }>\n error: (() => Data) | null\n output: (() => Data) | null\n outputs: Array<{\n key: string\n data: () => Data\n }>\n}\n","types/data-calc.d.ts":"/* DataCalculation has two types: DataCalculationScript and DataCalculationMap */\nexport interface DataCalculation {\n __typename: string\n id: string\n alias?: string\n title?: string\n description?: string\n hideShortRef?: boolean\n // Auto: Run the calculation when inputs change and allow triggers. Careful with circular dependencies!\n // Manual: Only run the calculation when manually triggered by System Action PROPERTY_BANK_COMMAND\n triggerMode?: 'auto' | 'manual'\n}\n","types/data.d.ts":"/* Auto generated by build script */\nimport type { SubspaceID, EventAction, LocalSyncStrategy } from './common'\n\ninterface DataDef {\n events?: {\n /* Event on update */\n update?: Array<EventAction>\n /* Event on value change */\n valueChange?: Array<EventAction>\n /* Event on value change and value matched the `Hit Regex` */\n valueHit?: Array<EventAction>\n /* Event on value change and value `not` matched the `Hit Regex` */\n valueNotHit?: Array<EventAction>\n }\n}\n\nexport type Data<T = any> = DataDef & {\n __typename: 'Data'\n id: string\n alias?: string\n title?: string\n description?: string\n hideShortRef?: boolean\n metadata?: {\n linked?: Array<SubspaceID>\n linkedFrom?: SubspaceID\n [key: string]: any\n }\n remoteUpdate?: { type: 'auto' | 'device-specific' } | { type: 'global-data'; id: string }\n // Determine how the property is changed via another subspaces.\n routing?: 'default' | 'read-only'\n // Persist data, so that the data will be keep after refresh.\n persistData?: boolean\n localSyncUpdateMode?: LocalSyncStrategy\n type: 'string' | 'number' | 'bool' | 'boolean' | 'array' | 'object' | 'any'\n schema?: object\n hit_equal?: any\n hit_regex?: string\n kind?:\n | {\n type: 'id'\n idType?: 'brick' | 'generator' | 'canvas' | 'animation'\n }\n | {\n type: 'auto-generated-item-id'\n idType?: 'canvas'\n }\n | {\n type: 'unit'\n unit?: 'ms' | 'grid' | 'px'\n max?: number\n min?: number\n step?: number\n }\n | DataAssetKind\n | {\n type:\n | 'color'\n | 'datetime'\n | 'graphql'\n | 'rich-text-content'\n | 'sandbox-script'\n | 'llm-prompt'\n | 'llm-messages'\n | 'llm-tools'\n | 'mcp-server-resources'\n | 'mcp-server-tools'\n | 'mcp-server-prompts'\n }\n value: T\n}\n\nexport type DataAssetKind = {\n type:\n | 'media-resource-image'\n | 'media-resource-video'\n | 'media-resource-audio'\n | 'media-resource-file'\n | 'lottie-file-uri'\n | 'rive-file-uri'\n | 'ggml-model-asset'\n | 'gguf-model-asset'\n | 'binary-asset'\n | 'mlx-model-asset'\n | 'scene3d-objects'\n preload?: {\n type: 'url'\n hashType: 'md5' | 'sha256' | 'sha1'\n hash: string\n }\n metadata?: { [key: string]: any }\n}\n\nexport type DataLink = {\n __typename: 'DataLink'\n data: () => Data\n}\n","types/generators/AlarmClock.d.ts":"/* Auto generated by build script\n *\n * Schedule events using cron expressions (e.g. daily, hourly)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start the alarm clock */\nexport type GeneratorAlarmClockActionStart = Action & {\n __actionName: 'GENERATOR_ALARM_CLOCK_START'\n}\n\n/* Pause the alarm clock */\nexport type GeneratorAlarmClockActionPause = Action & {\n __actionName: 'GENERATOR_ALARM_CLOCK_PAUSE'\n}\n\ninterface GeneratorAlarmClockDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"timezone\": \"UTC\",\n \"cron\": \"* * * * *\",\n \"min\": \"\",\n \"hour\": \"\",\n \"dom\": \"\",\n \"mon\": \"\",\n \"dow\": \"\"\n}\n */\n property?: {\n /* Start alarm clock on generator initialized */\n init?: boolean | DataLink\n /* Timezone */\n timezone?: string | DataLink\n /* Max count of alarm clock trigs */\n maxTrigs?: number | DataLink\n /* Time to start alarm clock */\n startAt?: string | DataLink | string | DataLink | DataLink\n /* Time to end alarm clock (Empty for not end) */\n stopAt?: string | DataLink | string | DataLink | DataLink\n /* Setting trigger rule by cron tab (Ref: https://crontab.guru/) */\n cron?: string | DataLink\n /* minute */\n min?: string | DataLink\n /* hour */\n hour?: string | DataLink\n /* day (month) */\n dom?: string | DataLink\n /* month */\n mon?: string | DataLink\n /* day (week) */\n dow?: string | DataLink\n }\n events?: {\n /* Event for cron rule is not invalid */\n onRuleInvalid?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onRuleInvalid']>\n >\n /* Event for alarm clock start */\n onStart?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onStart']>>\n /* Event for alarm clock trig */\n onTrig?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onTrig']>>\n /* Event for alarm clock stop */\n onEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onEnd']>>\n }\n outlets?: {\n /* Current time of each alarm clock trig */\n trigTime?: () => Data<string>\n /* Current timestamp (unix time) of each alarm clock trig */\n trigTimestamp?: () => Data<string | number>\n /* Count of alarm clock trigs */\n trigCount?: () => Data<string | number>\n /* Is alarm clock running? */\n running?: () => Data<boolean | string | number>\n }\n}\n\n/* Schedule events using cron expressions (e.g. daily, hourly) */\nexport type GeneratorAlarmClock = Generator &\n GeneratorAlarmClockDef & {\n templateKey: 'GENERATOR_ALARM_CLOCK'\n switches?: Array<\n SwitchDef &\n GeneratorAlarmClockDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'trigTime' | 'trigTimestamp' | 'trigCount' | 'running'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Assistant.d.ts":"/* Auto generated by build script\n *\n * Conversational AI agent orchestrating LLM (GGML/MLX/OpenAI/QNN/ONNX/Anthropic/NeuroPilot), STT, TTS, MCP tool-use, and file search (RAG) with auto-summary\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Add a message to the assistant */\nexport type GeneratorAssistantActionAddMessage = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'\n params?: Array<\n | {\n input: 'role'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'content'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'image'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'useFileSearch'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'filePath'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileExtension'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'filePayload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileSearchCitationCount'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileSearchInsertMethod'\n value?: 'in-user-message' | 'new-assistant-message' | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Initialize messages from MCP prompt */\nexport type GeneratorAssistantActionInitMcpPrompt = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_INIT_MCP_PROMPT'\n params?: Array<\n | {\n input: 'mcpClientName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mcpPromptName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mcpArguments'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'firstMessageAsSystem'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Add messages from MCP prompt */\nexport type GeneratorAssistantActionAddMcpPromptMessage = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_ADD_MCP_PROMPT_MESSAGE'\n params?: Array<\n | {\n input: 'mcpClientName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mcpPromptName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mcpArguments'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Update a message at a specific index */\nexport type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX'\n params?: Array<\n | {\n input: 'index'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'content'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'image'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Add an audio message and convert it to text to the assistant (if STT enabled) */\nexport type GeneratorAssistantActionAddAudioMessage = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_ADD_AUDIO_MESSAGE'\n params?: Array<\n | {\n input: 'role'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contentFile'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contentBase64'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'image'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'useFileSearch'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'filePath'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileExtension'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'filePayload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileSearchCitationCount'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileSearchInsertMethod'\n value?: 'in-user-message' | 'new-assistant-message' | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Add a file to File Search (Vector Store) */\nexport type GeneratorAssistantActionAddFile = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_ADD_FILE'\n params?: Array<\n | {\n input: 'filePath'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileExtension'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'filePayload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Remove a file from File Search (Vector Store) */\nexport type GeneratorAssistantActionRemoveFile = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_REMOVE_FILE'\n params?: Array<{\n input: 'fileName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Update a audio message at a specific index */\nexport type GeneratorAssistantActionUpdateAudioMessageAtIndex = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_UPDATE_AUDIO_MESSAGE_AT_INDEX'\n params?: Array<\n | {\n input: 'index'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contentFile'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contentBase64'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'image'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Remove a message at a specific index */\nexport type GeneratorAssistantActionRemoveMessageAtIndex = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX'\n params?: Array<{\n input: 'index'\n value?: number | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Reset all messages of the assistant */\nexport type GeneratorAssistantActionResetMessages = Action & {\n __actionName: 'GENERATOR_ASSISTANT_RESET_MESSAGES'\n}\n\n/* Reset assistant (Reset all messages and files) */\nexport type GeneratorAssistantActionReset = Action & {\n __actionName: 'GENERATOR_ASSISTANT_RESET'\n}\n\n/* Submit the assistant */\nexport type GeneratorAssistantActionSubmit = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_SUBMIT'\n params?: Array<\n | {\n input: 'continueOnToolCallConfirm'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'continueOnToolCallStrategy'\n value?: 'never' | 'success' | 'always' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'continueOnToolCallLimit'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Cancel the assistant responding */\nexport type GeneratorAssistantActionCancel = Action & {\n __actionName: 'GENERATOR_ASSISTANT_CANCEL'\n}\n\n/* Check the enabled MCP clients connection status and available tools */\nexport type GeneratorAssistantActionCheckMcpServers = Action & {\n __actionName: 'GENERATOR_ASSISTANT_CHECK_MCP_SERVERS'\n}\n\n/* Insert an MCP resource as a new assistant message */\nexport type GeneratorAssistantActionInsertMcpResource = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE'\n params?: Array<\n | {\n input: 'mcpClientName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mcpResourceUri'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mcpVariables'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'role'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Summarize messages based on the conversation\n\n Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */\nexport type GeneratorAssistantActionSummaryMessages = ActionWithParams & {\n __actionName: 'GENERATOR_ASSISTANT_SUMMARY_MESSAGES'\n params?: Array<\n | {\n input: 'summaryMessages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'summarySessionKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface GeneratorAssistantDef {\n /*\nDefault property:\n{\n \"initialMessages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n }\n ],\n \"cacheMessages\": false,\n \"llmLivePolicy\": \"only-in-use\",\n \"llmSessionKey\": \"default-assistant\",\n \"llmAutoSummaryMessages\": false,\n \"llmSummaryMessages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant specialized in summarizing conversations. Create a concise summary of the conversation that captures the key points while maintaining important context. The summary should be clear, accurate, and briefer than the original conversation.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Please summarize the following conversation into a concise system message that can replace the previous conversation context while maintaining all important information. Here is the conversation to summarize:\\n\\n\"\n }\n ],\n \"llmSummarySessionKey\": \"assistant-default-summary\",\n \"fileSearchEnabled\": false,\n \"fileSearchLivePolicy\": \"only-in-use\",\n \"sttEnabled\": true,\n \"sttLivePolicy\": \"only-in-use\",\n \"ttsEnabled\": false,\n \"ttsLivePolicy\": \"only-in-use\",\n \"mcpResourceAnnotationEnabled\": false,\n \"mcpResourceAnnotationKeyword\": \"@resource:\",\n \"mcpResourceAnnotationFallback\": \"\"\n}\n */\n property?: {\n /* Whether to heat up generators on initialization for better performance */\n heatup?: boolean | DataLink\n /* Messages */\n initialMessages?:\n | Array<\n | DataLink\n | {\n role?: string | DataLink\n content?: string | DataLink\n }\n >\n | DataLink\n /* Whether to cache messages */\n cacheMessages?: boolean | DataLink\n /* LLM Generator (Supports `LLM (GGML)`, `LLM (MLX)`, `OpenAI LLM`, `LLM (Qualcomm AI Engine)`, `LLM (ONNX)`, `LLM (Anthropic-compat)`, and `LLM (MediaTek NeuroPilot)` generators) */\n llmGeneratorId?: string | DataLink | (() => Generator)\n /* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use.\n\n Note: LLM (Qualcomm AI Engine) recommend use `manual` and loaded constantly. */\n llmLivePolicy?: 'only-in-use' | 'manual' | DataLink\n /* LLM main session key */\n llmSessionKey?: string | DataLink\n /* Auto Summary Messages (Automatically summarize messages when the LLM context is full or content gets truncated, currently only supported with LLM (GGML) generators)\n\n Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */\n llmAutoSummaryMessages?: boolean | DataLink\n /* Summary Messages (Messages used for summarization prompt, conversation will be appended to the last message) */\n llmSummaryMessages?:\n | Array<\n | DataLink\n | {\n role?: string | DataLink\n content?: string | DataLink\n }\n >\n | DataLink\n /* Summary Session Key (Custom session key for summarization) */\n llmSummarySessionKey?: string | DataLink\n /* Generate fallback content for tool calls when LLM returns tool calls without text content. When enabled, creates a message like \"Call:\n functionName(args)\" to keep the conversation readable. */\n llmToolCallFallbackContent?: boolean | DataLink\n /* File Search (Vector Store) Enabled */\n fileSearchEnabled?: boolean | DataLink\n /* File Search (Vector Store) Generator */\n fileSearchGeneratorId?: string | DataLink | (() => Generator)\n /* File Search (Vector Store) Live Policy. If the policy is `only-in-use`, the File Search (Vector Store) context will be released when the assistant is not in use. */\n fileSearchLivePolicy?: 'only-in-use' | 'manual' | DataLink\n /* File Search Citation Count. (Default: 3) */\n fileSearchCitationCount?: number | DataLink\n /* File Search Threshold. (Default: 1.0) */\n fileSearchThreshold?: number | DataLink\n /* File Search Ignore Threshold. (Default: false) */\n fileSearchIgnoreThreshold?: boolean | DataLink\n /* STT Generator use for transcribing audio message (Supports `STT (GGML)` generators) */\n sttGeneratorId?: string | DataLink | (() => Generator)\n /* STT Enabled */\n sttEnabled?: boolean | DataLink\n /* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when the assistant is not in use. */\n sttLivePolicy?: 'only-in-use' | 'manual' | DataLink\n /* TTS Generator use for generating LLM response audio message (Supports `TTS (ONNX)` and `OpenAI TTS` generators) */\n ttsGeneratorId?: string | DataLink | (() => Generator)\n /* TTS Enabled */\n ttsEnabled?: boolean | DataLink\n /* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */\n ttsLivePolicy?: 'only-in-use' | 'manual' | DataLink\n /* MCP Generators (Add a unique name if generator name property are duplicate) */\n mcpGenerators?:\n | Array<\n | DataLink\n | {\n generatorId?: string | DataLink | (() => Generator)\n generatorKey?: string | DataLink\n name?: string | DataLink\n enabled?: boolean | DataLink\n includeTools?: Array<string | DataLink> | DataLink\n excludeTools?: Array<string | DataLink> | DataLink\n blockTools?: Array<string | DataLink> | DataLink\n blockToolMessage?: string | DataLink\n }\n >\n | DataLink\n /* Enable MCP resource annotation in messages. When enabled, users can use keyboard shortcuts to include MCP resources using the format: @resource:<server-name>:<resource-uri> */\n mcpResourceAnnotationEnabled?: boolean | DataLink\n /* MCP resource annotation keyword (Default: @resource:) */\n mcpResourceAnnotationKeyword?: string | DataLink\n /* Fallback text when MCP server or resource is not found. If empty, an error will be thrown. */\n mcpResourceAnnotationFallback?: string | DataLink\n /* Guardrails — safety checks applied at specific pipeline hook points. Each entry runs a `pattern` regex or `llm` verdict check at the specified `on` hook, and fires the configured `action` when triggered. Jinja template kwargs for `llmUserPromptTemplate` / `llmSystemPrompt`: `input` (string) — last user message text `output` (string) — LLM response text `tool_call` (string) — tool function name `tool_args` (object) — tool call arguments (use `{{ tool_args | tojson }}` for JSON string, `{{ tool_args.key }}` for field access) `tool_result` (string) — tool execution result `messages` (array) — conversation history as `[{role, content}, ...]` Legacy `{var}` format is auto-upgraded to `{{ var }}`. For `action: 'redact'` with `kind: 'llm'`, `llmSystemPrompt` is also used as the sanitiser system prompt (defaults to a built-in rewrite instruction when omitted). `redactReplacement` — custom replacement string for pattern redaction (defaults to `[REDACTED]`). Hook semantics: `before-llm` only fires on initial user submissions (skipped on tool-result continuations). `after-llm` fires on all non-tool-call responses (skipped only on tool-call-only responses). */\n guardrails?:\n | Array<\n | DataLink\n | {\n id?: string | DataLink\n on?: 'before-llm' | 'after-llm' | 'before-tool' | 'after-tool' | DataLink\n kind?: 'pattern' | 'llm' | DataLink\n patternMatch?: string | DataLink\n llmGeneratorId?: string | DataLink | (() => Generator)\n llmLivePolicy?: 'only-in-use' | 'manual' | DataLink\n llmSystemPrompt?: string | DataLink\n llmUserPromptTemplate?: string | DataLink\n llmResultMatch?: string | DataLink\n action?: 'block' | 'redact' | 'log-only' | DataLink\n redactReplacement?: string | DataLink\n }\n >\n | DataLink\n }\n events?: {\n /* Error event */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onError']>>\n /* Log event */\n onLogs?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onLogs']>>\n /* Messages update event */\n onMessagesUpdate?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Assistant']['onMessagesUpdate']>\n >\n /* Heatup finished event */\n onHeatupFinished?: Array<EventAction>\n /* Generating event (triggered when assistant starts generating response) */\n onGenerating?: Array<EventAction>\n /* Finished event (triggered when assistant finishes generating response) */\n onFinished?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onFinished']>>\n }\n outlets?: {\n /* Whether the assistant is heating up */\n isHeatingUp?: () => Data<boolean>\n /* Whether the assistant is file processing */\n isFileProcessing?: () => Data<boolean>\n /* Whether the assistant is responding */\n isResponding?: () => Data<boolean>\n /* Whether the assistant is busy */\n isBusy?: () => Data<boolean>\n /* Embedding files of the assistant */\n files?: () => Data<Array<any>>\n /* Messages of the assistant */\n messages?: () => Data<\n Array<{\n role?: string\n name?: string\n content?: any\n tool_call_id?: string\n tool_calls?: Array<{\n id?: string\n type?: string\n function?: {\n name?: string\n arguments?: string\n [key: string]: any\n }\n [key: string]: any\n }>\n reasoning_content?: string\n audio?: {\n generating?: boolean\n [key: string]: any\n }\n last_generated_at?: number\n responding?: boolean\n is_summary?: boolean\n summary_created_at?: number\n [key: string]: any\n }>\n >\n /* MCP servers status and available tools */\n mcpServers?: () => Data<\n Array<{\n generatorId?: string\n generatorKey?: string\n name?: string\n version?: string\n connected?: boolean\n error?: string\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n [key: string]: any\n }>\n [key: string]: any\n }>\n >\n }\n}\n\n/* Conversational AI agent orchestrating LLM (GGML/MLX/OpenAI/QNN/ONNX/Anthropic/NeuroPilot), STT, TTS, MCP tool-use, and file search (RAG) with auto-summary */\nexport type GeneratorAssistant = Generator &\n GeneratorAssistantDef & {\n templateKey: 'GENERATOR_ASSISTANT'\n switches?: Array<\n SwitchDef &\n GeneratorAssistantDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'isHeatingUp'\n | 'isFileProcessing'\n | 'isResponding'\n | 'isBusy'\n | 'files'\n | 'messages'\n | 'mcpServers'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/BleCentral.d.ts":"/* Auto generated by build script\n *\n * Bluetooth Low Energy central: scan, connect, and communicate with BLE peripherals\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start scan */\nexport type GeneratorBleCentralActionStartScan = Action & {\n __actionName: 'GENERATOR_BLE_CENTRAL_START_SCAN'\n}\n\n/* Stop scan */\nexport type GeneratorBleCentralActionStopScan = Action & {\n __actionName: 'GENERATOR_BLE_CENTRAL_STOP_SCAN'\n}\n\n/* Connect device */\nexport type GeneratorBleCentralActionConnect = ActionWithParams & {\n __actionName: 'GENERATOR_BLE_CENTRAL_CONNECT'\n params?: Array<{\n input: 'deviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Read a characteristic */\nexport type GeneratorBleCentralActionReadCharacteristic = ActionWithParams & {\n __actionName: 'GENERATOR_BLE_CENTRAL_READ_CHARACTERISTIC'\n params?: Array<\n | {\n input: 'deviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'serviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'characteristicId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Monitor a characteristic */\nexport type GeneratorBleCentralActionMonitorCharacteristic = ActionWithParams & {\n __actionName: 'GENERATOR_BLE_CENTRAL_MONITOR_CHARACTERISTIC'\n params?: Array<\n | {\n input: 'deviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'serviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'characteristicId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Cancel monitor a characteristic */\nexport type GeneratorBleCentralActionCancelMonitorCharacteristic = ActionWithParams & {\n __actionName: 'GENERATOR_BLE_CENTRAL_CANCEL_MONITOR_CHARACTERISTIC'\n params?: Array<\n | {\n input: 'deviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'serviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'characteristicId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Write data to a characteristic */\nexport type GeneratorBleCentralActionWriteCharacteristic = ActionWithParams & {\n __actionName: 'GENERATOR_BLE_CENTRAL_WRITE_CHARACTERISTIC'\n params?: Array<\n | {\n input: 'deviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'serviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'characteristicId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataHex'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'writeWithoutResponse'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Disconnect device */\nexport type GeneratorBleCentralActionDisconnect = ActionWithParams & {\n __actionName: 'GENERATOR_BLE_CENTRAL_DISCONNECT'\n params?: Array<{\n input: 'deviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\ninterface GeneratorBleCentralDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"scanTime\": 10,\n \"updateInterval\": 1000,\n \"retainTime\": 120,\n \"maximumDiscoveredDevice\": 256,\n \"allowDuplicates\": false,\n \"scanMode\": \"LowPower\"\n}\n */\n property?: {\n /* Start scan on generator initialized */\n init?: boolean | DataLink\n /* Regex match name to filter device */\n deviceNameFilter?: string | DataLink\n /* Service UUIDs to filter device */\n serviceFilter?: Array<string | DataLink> | DataLink\n /* RSSI threshold */\n rssiThreshold?: number | DataLink\n /* Scan time */\n scanTime?: number | DataLink\n /* Discovered device list update interval */\n updateInterval?: number | DataLink\n /* Discovered device retain time */\n retainTime?: number | DataLink\n /* Maximum device list number */\n maximumDiscoveredDevice?: number | DataLink\n /* Allow duplicates scanning records (iOS only) */\n allowDuplicates?: boolean | DataLink\n /* BLE scan mode (Android only) */\n scanMode?: 'Opportunistic' | 'LowPower' | 'Balanced' | 'LowLatency' | DataLink\n }\n events?: {\n /* Event for state change */\n onStateChange?: Array<EventAction>\n /* Event for error occurred */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onError']>>\n /* Event for start scan */\n onStartScan?: Array<EventAction>\n /* Event for stop scan */\n onStopScan?: Array<EventAction>\n /* Event for discover device */\n onDiscoverDevice?: Array<\n EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onDiscoverDevice']>\n >\n /* Event for device connected */\n onConnectDevice?: Array<\n EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onConnectDevice']>\n >\n /* Event for device disconnected */\n onDisconnectDevice?: Array<EventAction>\n /* Event for receive on read */\n onReadReceive?: Array<\n EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onReadReceive']>\n >\n /* Event for receive on monitor */\n onMonitorReceive?: Array<\n EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onMonitorReceive']>\n >\n }\n outlets?: {\n /* Is scaning */\n isScaning?: () => Data<boolean>\n /* Discovered device list */\n discoveredDeviceList?: () => Data<\n Array<{\n id?: string\n name?: string\n rssi?: number\n advertising?: { [key: string]: any }\n [key: string]: any\n }>\n >\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* Bluetooth Low Energy central: scan, connect, and communicate with BLE peripherals */\nexport type GeneratorBleCentral = Generator &\n GeneratorBleCentralDef & {\n templateKey: 'GENERATOR_BLE_CENTRAL'\n switches?: Array<\n SwitchDef &\n GeneratorBleCentralDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isScaning' | 'discoveredDeviceList' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/BlePeripheral.d.ts":"/* Auto generated by build script\n *\n * Bluetooth Low Energy peripheral: advertise services and respond to central connections\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start advertise */\nexport type GeneratorBlePeripheralActionStart = Action & {\n __actionName: 'GENERATOR_BLE_PERIPHERAL_START'\n}\n\n/* undefined */\nexport type GeneratorBlePeripheralActionNotify = ActionWithParams & {\n __actionName: 'GENERATOR_BLE_PERIPHERAL_NOTIFY'\n params?: Array<\n | {\n input: 'serviceId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'charId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'value'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'encoding'\n value?: 'utf8' | 'hex' | 'base64' | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop advertise */\nexport type GeneratorBlePeripheralActionStop = Action & {\n __actionName: 'GENERATOR_BLE_PERIPHERAL_STOP'\n}\n\ninterface GeneratorBlePeripheralDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"connectable\": true,\n \"advertiseMode\": \"LOW_POWER\",\n \"txPower\": \"MEDIUM\",\n \"includeDeviceName\": true,\n \"includeTxPower\": true\n}\n */\n property?: {\n /* Start advertise on generator initialized */\n init?: boolean | DataLink\n /* Advertise device name */\n name?: string | DataLink\n /* BLE is connectable (Android only) */\n connectable?: boolean | DataLink\n /* Advertise mode (Android only) */\n advertiseMode?: 'LOW_POWER' | 'BALANCED' | 'LOW_LATENCY' | DataLink\n /* Bluetooth transmit power (Android only) */\n txPower?: 'ULTRA_LOW' | 'LOW' | 'MEDIUM' | 'HIGH' | DataLink\n /* Include device name in advertise (Android only) */\n includeDeviceName?: boolean | DataLink\n /* Include transmit power in advertise (Android only) */\n includeTxPower?: boolean | DataLink\n /* Advertise manufacturer ID (Android only) */\n manufacturerId?: number | DataLink\n /* Advertise manufacturer data (Android only) */\n manufacturerData?:\n | DataLink\n | {\n data?: string | DataLink\n encode?: 'utf8' | 'hex' | 'base64' | DataLink\n }\n /* Advertise service data list (Android only) */\n serviceDataMap?:\n | Array<\n | DataLink\n | {\n serviceId?: string | DataLink\n data?: string | DataLink\n encode?: 'utf8' | 'hex' | 'base64' | DataLink\n }\n >\n | DataLink\n /* GATT service list */\n gattServiceMap?:\n | Array<\n | DataLink\n | {\n serviceId?: string | DataLink\n primary?: boolean | DataLink\n characteristics?:\n | Array<\n | DataLink\n | {\n id?: string | DataLink\n permission?:\n | DataLink\n | {\n readable?: boolean | DataLink\n readEncrypted?: boolean | DataLink\n writeable?: boolean | DataLink\n writeEncrypted?: boolean | DataLink\n }\n properties?:\n | DataLink\n | {\n broadcast?: boolean | DataLink\n read?: boolean | DataLink\n writeNoResponse?: boolean | DataLink\n write?: boolean | DataLink\n notify?: boolean | DataLink\n indicate?: boolean | DataLink\n signedWrite?: boolean | DataLink\n extendedProps?: boolean | DataLink\n }\n }\n >\n | DataLink\n }\n >\n | DataLink\n /* Response value of characteristics */\n resData?:\n | Array<\n | DataLink\n | {\n serviceId?: string | DataLink\n charId?: string | DataLink\n value?: string | DataLink\n encoding?: 'utf8' | 'hex' | 'base64' | DataLink\n }\n >\n | DataLink\n /* Beacon mode */\n beaconsEnable?: boolean | DataLink\n /* Measured RSSI @ 1m, used for calculate distance */\n beaconsTxPower?: number | DataLink\n /* Beacon configs\n presets has pre-defined layout and manufacturerId \n layout string is like AltBeacon's Beacon Layout, but replace \"x\" as extra data \n id and data could be 0x prefixed hex, hex string, decimal or UUID \n extra should be hex string */\n beaconsConfig?:\n | Array<\n | DataLink\n | {\n preset?: 'LINE_SIMPLE_BEACON' | 'iBeacon' | 'EddystoneUID' | 'AltBeacon' | DataLink\n manufacturerId?: number | DataLink\n layout?: string | DataLink\n id1?: string | DataLink\n id2?: string | DataLink\n id3?: string | DataLink\n datas?: Array<string | DataLink> | DataLink\n extra?: string | DataLink\n }\n >\n | DataLink\n }\n events?: {}\n outlets?: {\n /* Is advertising */\n isAdvertising?: () => Data<boolean>\n /* Last receive written */\n lastWrite?: () => Data<{ [key: string]: any }>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* Bluetooth Low Energy peripheral: advertise services and respond to central connections */\nexport type GeneratorBlePeripheral = Generator &\n GeneratorBlePeripheralDef & {\n templateKey: 'GENERATOR_BLE_PERIPHERAL'\n switches?: Array<\n SwitchDef &\n GeneratorBlePeripheralDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isAdvertising' | 'lastWrite' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/CanvasMap.d.ts":"/* Auto generated by build script\n *\n * Trigger canvas navigation by setup rules\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface GeneratorCanvasMapDef {\n /*\nDefault property:\n{\n \"triggerList\": []\n}\n */\n property?: {\n /* Trigger rule list */\n triggerList?:\n | Array<\n | DataLink\n | {\n operation?: '<' | '<=' | '==' | '!=' | '>' | '>=' | DataLink\n property?: any\n value?: string | DataLink\n canvasId?: string | DataLink\n canvasTitleLike?: string | DataLink\n }\n >\n | DataLink\n }\n events?: {\n /* Event triggered when a rule matches and canvas navigation occurs */\n onNavigate?: Array<EventAction<string & keyof TemplateEventPropsMap['CanvasMap']['onNavigate']>>\n }\n outlets?: {\n /* Last matched trigger rule that caused canvas navigation */\n lastMatchedRule?: () => Data<{ [key: string]: any }>\n /* Index of the last matched rule in triggerList */\n lastMatchedIndex?: () => Data<number>\n /* Total count of canvas navigations triggered by this generator */\n navigationCount?: () => Data<number>\n }\n}\n\n/* Trigger canvas navigation by setup rules */\nexport type GeneratorCanvasMap = Generator &\n GeneratorCanvasMapDef & {\n templateKey: 'GENERATOR_CANVAS_MAP'\n switches?: Array<\n SwitchDef &\n GeneratorCanvasMapDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'lastMatchedRule' | 'lastMatchedIndex' | 'navigationCount'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/CastlesPay.d.ts":"/* Auto generated by build script\n *\n * Payment processing integration for Castles payment terminals\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Sale */\nexport type GeneratorCastlesPayActionSale = ActionWithParams & {\n __actionName: 'GENERATOR_CASTLES_PAY_SALE'\n params?: Array<{\n input: 'amount'\n value?: number | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Cancel Transaction */\nexport type GeneratorCastlesPayActionCancelTransaction = ActionWithParams & {\n __actionName: 'GENERATOR_CASTLES_PAY_CANCEL_TRANSACTION'\n params?: Array<{\n input: 'transactionId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Open Search */\nexport type GeneratorCastlesPayActionOpenSearch = Action & {\n __actionName: 'GENERATOR_CASTLES_PAY_OPEN_SEARCH'\n}\n\ninterface GeneratorCastlesPayDef {\n /*\nDefault property:\n{}\n */\n property?: {}\n events?: {\n /* Action Success */\n onActionSuccess?: Array<\n EventAction<string & keyof TemplateEventPropsMap['CastlesPay']['onActionSuccess']>\n >\n /* Action Error */\n onActionError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['CastlesPay']['onActionError']>\n >\n }\n outlets?: {\n /* Last Transaction Result */\n lastTransactionResult?: () => Data<{ [key: string]: any }>\n /* Last Error */\n lastError?: () => Data<string>\n }\n}\n\n/* Payment processing integration for Castles payment terminals */\nexport type GeneratorCastlesPay = Generator &\n GeneratorCastlesPayDef & {\n templateKey: 'GENERATOR_CASTLES_PAY'\n switches?: Array<\n SwitchDef &\n GeneratorCastlesPayDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'lastTransactionResult' | 'lastError'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/DataBank.d.ts":"/* Auto generated by build script\n *\n * Access and subscribe to shared Data properties from the project Data Bank\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Run Data Bank fetch */\nexport type GeneratorDataBankActionFetch = Action & {\n __actionName: 'GENERATOR_DATA_BANK_FETCH'\n}\n\n/* Run Data Bank update */\nexport type GeneratorDataBankActionUpdateProperty = ActionWithParams & {\n __actionName: 'GENERATOR_DATA_BANK_UPDATE_PROPERTY'\n params?: Array<\n | {\n input: 'propertyId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'propertyValue'\n value?: any | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Run Data Bank remove */\nexport type GeneratorDataBankActionRemoveProperty = ActionWithParams & {\n __actionName: 'GENERATOR_DATA_BANK_REMOVE_PROPERTY'\n params?: Array<{\n input: 'propertyId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Reset cache of Data Bank */\nexport type GeneratorDataBankActionResetCache = Action & {\n __actionName: 'GENERATOR_DATA_BANK_RESET_CACHE'\n}\n\n/* Cancel current running subscription */\nexport type GeneratorDataBankActionCancelSubscription = Action & {\n __actionName: 'GENERATOR_DATA_BANK_CANCEL_SUBSCRIPTION'\n}\n\ninterface GeneratorDataBankDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"fetchPolicy\": \"cache-first\",\n \"subscribeDataChange\": false\n}\n */\n property?: {\n /* Start generator initialization execution immediately */\n init?: boolean | DataLink\n /* Data Bank Space ID */\n spacename?: string | DataLink\n /* Data Bank Space secret key */\n spacekey?: string | DataLink\n /* Data need to be fetched */\n properties?: Array<string | DataLink> | DataLink\n /* Determine the cache behavior\n \n cache-first: Cache first if existing, then fetch from network \n network-and-cache: Fetch from network, then save cache \n network-only: Fetch from network only */\n fetchPolicy?: 'cache-first' | 'network-and-cache' | 'network-only' | DataLink\n /* Subscribe Data change */\n subscribeDataChange?: boolean | DataLink\n }\n events?: {\n /* Event of Data Bank fetch response */\n onFetchResponse?: Array<\n EventAction<string & keyof TemplateEventPropsMap['DataBank']['onFetchResponse']>\n >\n /* Event of Data Bank change from subscription */\n onChange?: Array<EventAction>\n /* Event of Data Bank fetch error */\n onFetchError?: Array<EventAction>\n /* Event of error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['DataBank']['onError']>>\n /* Event of subscription on connection */\n subscribeDataOnConnect?: Array<EventAction>\n /* Server connections error of subscription */\n subscribeDataOnConnectError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['DataBank']['subscribeDataOnConnectError']>\n >\n }\n outlets?: {\n /* Response for Data Bank fetch request, it will save to Data */\n response?: () => Data<\n Array<{\n __typename?: string\n id?: string\n createAt?: string\n updateAt?: string\n spaceId?: string\n propertyId?: string\n definition?: {\n type?: string\n title?: string\n schema?: { [key: string]: any }\n [key: string]: any\n }\n meta?: string\n value?: any\n lastUpdateHash?: string\n lastUpdateNote?: string\n lastUpdateKey?: {\n name?: string\n enable_expired?: boolean\n expired_at?: any\n jwt?: boolean\n [key: string]: any\n }\n [key: string]: any\n }>\n >\n /* Server response error of Data Bank fetch request, it will save to Data */\n error?: () => Data<string>\n }\n}\n\n/* Access and subscribe to shared Data properties from the project Data Bank */\nexport type GeneratorDataBank = Generator &\n GeneratorDataBankDef & {\n templateKey: 'GENERATOR_DATA_BANK'\n switches?: Array<\n SwitchDef &\n GeneratorDataBankDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'response' | 'error'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/File.d.ts":"/* Auto generated by build script\n *\n * File system operations: read, write, copy, delete, and list files\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Read stats */\nexport type GeneratorFileActionReadStats = Action & {\n __actionName: 'GENERATOR_FILE_READ_STATS'\n}\n\n/* Read (Currently only support text file) */\nexport type GeneratorFileActionReadContent = ActionWithParams & {\n __actionName: 'GENERATOR_FILE_READ_CONTENT'\n params?: Array<{\n input: 'encoding'\n value?: 'utf8' | 'base64' | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Delete */\nexport type GeneratorFileActionDelete = Action & {\n __actionName: 'GENERATOR_FILE_DELETE'\n}\n\n/* Append (Currently only support text file) */\nexport type GeneratorFileActionAppendContent = ActionWithParams & {\n __actionName: 'GENERATOR_FILE_APPEND_CONTENT'\n params?: Array<\n | {\n input: 'content'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'encoding'\n value?: 'utf8' | 'base64' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contentList'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Write (Currently only support text file) */\nexport type GeneratorFileActionWriteContent = ActionWithParams & {\n __actionName: 'GENERATOR_FILE_WRITE_CONTENT'\n params?: Array<\n | {\n input: 'content'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'encoding'\n value?: 'utf8' | 'base64' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'position'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contentList'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Start upload (All or By ID or By Index) */\nexport type GeneratorFileActionStartUpload = ActionWithParams & {\n __actionName: 'GENERATOR_FILE_START_UPLOAD'\n params?: Array<\n | {\n input: 'withAll'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop upload (All or By ID or By Index) */\nexport type GeneratorFileActionStopUpload = ActionWithParams & {\n __actionName: 'GENERATOR_FILE_STOP_UPLOAD'\n params?: Array<\n | {\n input: 'withAll'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Start download (All or By ID or By Index) */\nexport type GeneratorFileActionStartDownload = ActionWithParams & {\n __actionName: 'GENERATOR_FILE_START_DOWNLOAD'\n params?: Array<\n | {\n input: 'withAll'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop download (All or By ID or By Index) */\nexport type GeneratorFileActionStopDownload = ActionWithParams & {\n __actionName: 'GENERATOR_FILE_STOP_DOWNLOAD'\n params?: Array<\n | {\n input: 'withAll'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withIndex'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Clear download */\nexport type GeneratorFileActionClearDownload = Action & {\n __actionName: 'GENERATOR_FILE_CLEAR_DOWNLOAD'\n}\n\ninterface GeneratorFileDef {\n /*\nDefault property:\n{\n \"type\": \"single\",\n \"targetDirectory\": \"none\",\n \"hashType\": \"sha256\",\n \"header\": {},\n \"fields\": {},\n \"list\": [],\n \"downloadAllowLoadSizeLimitExceed\": false,\n \"downloadRetryCount\": 3,\n \"downloadMode\": \"sequence\",\n \"downloadProgressFrequency\": 1000,\n \"uploadRetryCount\": 3,\n \"uploadMode\": \"sequence\",\n \"uploadProgressFrequency\": 1000\n}\n */\n property?: {\n /* Type (Single or Multiple) */\n type?: 'single' | 'multiple' | DataLink\n /* Target directory (Default: document directory in app) */\n targetDirectory?: 'none' | 'custom' | 'document' | 'cache' | 'tmp' | DataLink\n /* Target directory (Default: document directory in app) */\n customTargetDirectory?: string | DataLink\n /* File path (If type is single) */\n path?: string | DataLink\n /* File encoding (If type is single) */\n encoding?: 'utf8' | 'base64' | DataLink\n /* URL (If type is single) */\n url?: string | DataLink\n /* Hash value */\n hash?: string | DataLink\n /* Hash type */\n hashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Request method */\n method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | DataLink\n /* Header */\n header?: {} | DataLink\n /* Fields */\n fields?: {} | DataLink\n /* File list (If type is multiple) */\n list?:\n | Array<\n | DataLink\n | {\n id?: string | DataLink\n path?: string | DataLink\n encoding?: 'utf8' | 'base64' | DataLink\n url?: string | DataLink\n hash?: string | DataLink\n hashType?: 'sha256' | 'sha1' | 'md5' | DataLink\n method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | DataLink\n header?: {} | DataLink\n fields?: {} | DataLink\n }\n >\n | DataLink\n /* Enable download (URL is required) */\n downloadEnabled?: boolean | DataLink\n /* Download load size limit */\n downloadLoadSizeLimit?: number | DataLink\n /* Download allow load size limit exceed */\n downloadAllowLoadSizeLimitExceed?: boolean | DataLink\n /* Download retry count */\n downloadRetryCount?: number | DataLink\n /* Download mode (if type is multiple) */\n downloadMode?: 'concurrent' | 'sequence' | DataLink\n /* Limit of download concurrent mode */\n downloadConcurrentLimit?: number | DataLink\n /* Download progress frequency */\n downloadProgressFrequency?: number | DataLink\n /* Enable upload (Path & URL is required) */\n uploadEnabled?: boolean | DataLink\n /* Upload retry count */\n uploadRetryCount?: number | DataLink\n /* Upload mode (if type is multiple) */\n uploadMode?: 'concurrent' | 'sequence' | DataLink\n /* Limit of upload concurrent mode */\n uploadConcurrentLimit?: number | DataLink\n /* Upload progress frequency */\n uploadProgressFrequency?: number | DataLink\n }\n events?: {\n /* On file handler init error */\n initError?: Array<EventAction<string & keyof TemplateEventPropsMap['File']['initError']>>\n /* On file status change */\n onFileStatusChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onFileStatusChange']>\n >\n /* On read stats error */\n onReadStatsError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onReadStatsError']>\n >\n /* On read content error */\n onReadContentError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onReadContentError']>\n >\n /* On read content error */\n onAppendContentError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onAppendContentError']>\n >\n /* On write content error */\n onWriteContentError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onWriteContentError']>\n >\n /* On upload progress */\n onUploadProgress?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onUploadProgress']>\n >\n /* On upload error */\n onUploadError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onUploadError']>\n >\n /* On upload complete */\n onUploadComplete?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onUploadComplete']>\n >\n /* On upload all done */\n onUploadAllComplete?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onUploadAllComplete']>\n >\n /* On download progress */\n onDownloadProgress?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadProgress']>\n >\n /* On download error */\n onDownloadError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadError']>\n >\n /* On download complete */\n onDownloadComplete?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadComplete']>\n >\n /* On download all done */\n onDownloadAllComplete?: Array<\n EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadAllComplete']>\n >\n }\n outlets?: {\n /* File init error result will be stored in Data */\n initError?: () => Data<string>\n /* File read stats result will be stored in Data */\n readStats?: () => Data<{\n path?: string\n size?: number\n isDirectory?: boolean\n mtime?: string\n ctime?: string\n mode?: number\n originalFilepath?: string\n [key: string]: any\n }>\n /* File read content result will be stored in Data */\n readContent?: () => Data<any>\n /* File read details result will be stored in Data */\n readDetails?: () => Data<{\n path?: string\n content?: any\n size?: number\n exists?: boolean\n [key: string]: any\n }>\n /* File read error result will be stored in Data */\n readError?: () => Data<string>\n /* File append content result will be stored in Data */\n appendDetails?: () => Data<{\n path?: string\n appended?: boolean\n contentLength?: number\n [key: string]: any\n }>\n /* File append error result will be stored in Data */\n appendError?: () => Data<string>\n /* File write details result will be stored in Data */\n writeDetails?: () => Data<{\n path?: string\n written?: boolean\n contentLength?: number\n [key: string]: any\n }>\n /* File write error result will be stored in Data */\n writeError?: () => Data<string>\n /* File upload progress result will be stored in Data */\n uploadProgress?: () => Data<{\n id?: string\n path?: string\n uri?: string\n hash?: string\n hashType?: string\n headers?: { [key: string]: any }\n fields?: { [key: string]: any }\n method?: string\n progress?: number\n isLastUpdated?: boolean\n [key: string]: any\n }>\n /* File upload complete result will be stored in Data */\n uploadResult?: () => Data<any>\n /* File download progress result will be stored in Data */\n downloadProgress?: () => Data<{\n id?: string\n path?: string\n uri?: string\n hash?: string\n hashType?: string\n headers?: { [key: string]: any }\n fields?: { [key: string]: any }\n method?: string\n progress?: number\n isLastUpdated?: boolean\n [key: string]: any\n }>\n /* File download complete result will be stored in Data */\n downloadResult?: () => Data<any>\n }\n}\n\n/* File system operations: read, write, copy, delete, and list files */\nexport type GeneratorFile = Generator &\n GeneratorFileDef & {\n templateKey: 'GENERATOR_FILE'\n switches?: Array<\n SwitchDef &\n GeneratorFileDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'initError'\n | 'readStats'\n | 'readContent'\n | 'readDetails'\n | 'readError'\n | 'appendDetails'\n | 'appendError'\n | 'writeDetails'\n | 'writeError'\n | 'uploadProgress'\n | 'uploadResult'\n | 'downloadProgress'\n | 'downloadResult'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/GraphQl.d.ts":"/* Auto generated by build script\n *\n * GraphQL client for Query, Mutation, and Subscription (WebSocket) with response caching and optional Firebase Realtime Database link\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Execute GraphQL request with defined properties */\nexport type GeneratorGraphQLActionRunQuery = ActionWithParams & {\n __actionName: 'GENERATOR_GRAPHQL_RUN_QUERY'\n params?: Array<\n | {\n input: 'type'\n value?: 'query' | 'mutation' | 'subscription' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'query'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'variables'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Reset cache of GraphQL client */\nexport type GeneratorGraphQLActionResetCache = Action & {\n __actionName: 'GENERATOR_GRAPHQL_RESET_CACHE'\n}\n\n/* Cancel current running subscription */\nexport type GeneratorGraphQLActionCancelSubscription = Action & {\n __actionName: 'GENERATOR_GRAPHQL_CANCEL_SUBSCRIPTION'\n}\n\ninterface GeneratorGraphQLDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"type\": \"query\",\n \"headers\": {},\n \"query\": \"\",\n \"variables\": {},\n \"firebaseEnabled\": false\n}\n */\n property?: {\n /* Start GraphQL request immediately after generator initialization */\n init?: boolean | DataLink\n /* GraphQL request type */\n type?: 'query' | 'mutation' | 'subscription' | DataLink\n /* HTTP request headers */\n headers?: {} | DataLink\n /* HTTP request URL endpoint */\n endpoint?: string | DataLink\n /* Subscription endpoint */\n endpointForSubscription?: string | DataLink\n /* Subscription connection params */\n connectionParams?: {} | DataLink\n /* Query content */\n query?: string | DataLink\n /* Query variables */\n variables?: {} | DataLink\n /* Data id from response, it is useful for caching data */\n dataIdFromObject?: string | DataLink\n /* Enable Firebase link */\n firebaseEnabled?: boolean | DataLink\n /* Firebase API Key */\n firebaseAPIKey?: string | DataLink\n /* Firebase Realtime Database `authDomain` field */\n firebaseAuthDomain?: string | DataLink\n /* Firebase Realtime Database `databaseURL` field */\n firebaseDatabaseURL?: string | DataLink\n /* Firebase Realtime Database `projectId` field */\n firebaseProjectId?: string | DataLink\n /* Firebase Realtime Database `storageBucket` field */\n firebaseStorageBucket?: string | DataLink\n /* Firebase Realtime Database `messagingSenderId` field */\n firebaseMessagingSenderId?: string | DataLink\n }\n events?: {\n /* Event triggered when subscription connection is successful */\n subscriptionOnConnection?: Array<EventAction>\n /* Event triggered when subscription connection error occurs */\n subscriptionOnConnectionError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Graphql']['subscriptionOnConnectionError']>\n >\n }\n outlets?: {\n /* Response for GraphQL request, it will save to Data */\n response?: () => Data<{ [key: string]: any }>\n /* Server response error of GraphQL request, it will save to Data */\n error?: () => Data<string>\n }\n}\n\n/* GraphQL client for Query, Mutation, and Subscription (WebSocket) with response caching and optional Firebase Realtime Database link */\nexport type GeneratorGraphQL = Generator &\n GeneratorGraphQLDef & {\n templateKey: 'GENERATOR_GRAPHQL'\n switches?: Array<\n SwitchDef &\n GeneratorGraphQLDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'response' | 'error'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Http.d.ts":"/* Auto generated by build script\n *\n * HTTP client supporting all methods (GET/POST/PUT/DELETE/PATCH/...), response parsing (JSON/text/XML/CSV), SSE event streams, and multipart file uploads\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Run HTTP request with defined properties */\nexport type GeneratorHTTPActionRunRequest = ActionWithParams & {\n __actionName: 'GENERATOR_HTTP_RUN_REQUEST'\n params?: Array<\n | {\n input: 'url'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'method'\n value?:\n | 'GET'\n | 'POST'\n | 'PUT'\n | 'DELETE'\n | 'HEAD'\n | 'PATCH'\n | 'OPTIONS'\n | 'CONNECT'\n | 'TRACE'\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'headers'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'body'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'timeout'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mode'\n value?: 'same-origin' | 'no-cors' | 'cors' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'credentials'\n value?: 'include' | 'same-origin' | 'omit' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'redirect'\n value?: 'manual' | 'follow' | 'error' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'referrer'\n value?: 'no-referrer' | 'client' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'resType'\n value?: 'json' | 'text' | 'xml' | 'csv' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'resSelector'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'eventStream'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'eventName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Abort HTTP request or SSE */\nexport type GeneratorHTTPActionAbort = Action & {\n __actionName: 'GENERATOR_HTTP_ABORT'\n}\n\ninterface GeneratorHTTPDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"method\": \"GET\",\n \"headers\": {},\n \"body\": {},\n \"resType\": \"json\",\n \"eventStream\": false,\n \"eventName\": \"message\"\n}\n */\n property?: {\n /* Start HTTP request on generator initialized */\n init?: boolean | DataLink\n /* URL of HTTP request */\n url?: string | DataLink\n /* Method of HTTP request */\n method?:\n | 'GET'\n | 'POST'\n | 'PUT'\n | 'DELETE'\n | 'HEAD'\n | 'PATCH'\n | 'OPTIONS'\n | 'CONNECT'\n | 'TRACE'\n | DataLink\n /* HTTP request headers */\n headers?: {} | DataLink\n /* Timeout of HTTP request */\n timeout?: number | DataLink\n /* Mode of HTTP request */\n mode?: 'same-origin' | 'no-cors' | 'cors' | DataLink\n /* Credentials of HTTP request */\n credentials?: 'include' | 'same-origin' | 'omit' | DataLink\n /* Redirect of HTTP request */\n redirect?: 'manual' | 'follow' | 'error' | DataLink\n /* Referrer of HTTP request */\n referrer?: 'no-referrer' | 'client' | DataLink\n /* HTTP request body, it will transform depends on `headers.Content-Type` (`application/json`, `application/x-www-form-urlencoded` or `multipart/form-data`)\n The multipart schema like `{ file: { uri: File, type: File MIME, name: File Name }, field: \"value\" }` */\n body?: {} | DataLink\n /* HTTP response type */\n resType?: 'json' | 'text' | 'xml' | 'csv' | DataLink\n /* Response selector path to extract specific data from parsed response (e.g., \"data.items\" for JSON, \"root.element\" for XML) */\n resSelector?: string | DataLink\n /* Receive event stream (SSE) */\n eventStream?: boolean | DataLink\n /* Event name to listen on SSE */\n eventName?: string | DataLink | Array<string | DataLink> | DataLink | DataLink\n }\n events?: {\n /* Event triggered when the HTTP request receives a response */\n onResponse?: Array<EventAction<string & keyof TemplateEventPropsMap['Http']['onResponse']>>\n /* Event triggered when the HTTP request or SSE stream reports an error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Http']['onError']>>\n }\n outlets?: {\n /* Response for HTTP request */\n response?: () => Data<string | { [key: string]: any }>\n /* Response details for HTTP request */\n responseDetails?: () => Data<{\n ok?: boolean\n redirected?: boolean\n type?: string\n status?: number\n statusText?: string\n headers?: { [key: string]: any }\n body?: any\n event?: string\n id?: string\n data?: any\n [key: string]: any\n }>\n /* All received data from event stream */\n eventLog?: () => Data<Array<any>>\n /* All received event details from event stream */\n eventLogDetails?: () => Data<\n Array<{\n event?: string\n id?: string\n data?: any\n [key: string]: any\n }>\n >\n /* EventSource state */\n sseState?: () => Data<string>\n /* Server response error of HTTP request */\n error?: () => Data<string>\n }\n}\n\n/* HTTP client supporting all methods (GET/POST/PUT/DELETE/PATCH/...), response parsing (JSON/text/XML/CSV), SSE event streams, and multipart file uploads */\nexport type GeneratorHTTP = Generator &\n GeneratorHTTPDef & {\n templateKey: 'GENERATOR_HTTP'\n switches?: Array<\n SwitchDef &\n GeneratorHTTPDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'response'\n | 'responseDetails'\n | 'eventLog'\n | 'eventLogDetails'\n | 'sseState'\n | 'error'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/HttpServer.d.ts":"/* Auto generated by build script\n *\n * Embedded HTTP/HTTPS server with route matching, CORS, auth (Basic/Bearer), SSE streaming, file upload, async response mode, and JS Sandbox route handlers\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start HTTP server */\nexport type GeneratorHTTPServerActionStart = Action & {\n __actionName: 'GENERATOR_HTTP_SERVER_START'\n}\n\n/* Stop HTTP server */\nexport type GeneratorHTTPServerActionStop = Action & {\n __actionName: 'GENERATOR_HTTP_SERVER_STOP'\n}\n\n/* Clear upload temp files */\nexport type GeneratorHTTPServerActionClearTempFiles = Action & {\n __actionName: 'GENERATOR_HTTP_SERVER_CLEAR_TEMP_FILES'\n}\n\n/* End stream */\nexport type GeneratorHTTPServerActionEndStream = Action & {\n __actionName: 'GENERATOR_HTTP_SERVER_END_STREAM'\n}\n\ninterface GeneratorHTTPServerDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"method\": \"GET\",\n \"path\": \"/\",\n \"methods\": [],\n \"idleTimeout\": 10000,\n \"authType\": \"none\",\n \"asyncMode\": false,\n \"resStatusCode\": 200,\n \"resContentType\": \"text/plain\",\n \"tls\": false,\n \"tlsKeyPairPassword\": \"\"\n}\n */\n property?: {\n /* Start HTTP server on generator initialized */\n init?: boolean | DataLink\n /* Bind port of HTTP server */\n port?: number | DataLink\n /* Method of HTTP request */\n method?:\n | 'GET'\n | 'POST'\n | 'PUT'\n | 'DELETE'\n | 'HEAD'\n | 'PATCH'\n | 'OPTIONS'\n | 'CONNECT'\n | 'TRACE'\n | DataLink\n /* Path of HTTP request */\n path?: string | DataLink\n /* Additional route methods handled by JS Sandbox scripts. The script receives `inputs.request`, `inputs.query`, `inputs.headers`, `inputs.body`, and configured `additionalParams`. `scriptConfig.members` can expose generator or brick script-member functions, same as MCP Server. */\n methods?:\n | Array<\n | DataLink\n | {\n enabled?: boolean | DataLink\n name?: string | DataLink\n method?:\n | 'GET'\n | 'POST'\n | 'PUT'\n | 'DELETE'\n | 'HEAD'\n | 'PATCH'\n | 'OPTIONS'\n | 'CONNECT'\n | 'TRACE'\n | DataLink\n path?: string | DataLink\n resStatusCode?: number | DataLink\n resContentType?:\n | 'text/plain'\n | 'text/html'\n | 'text/javascript'\n | 'text/css'\n | 'text/xml'\n | 'application/xml'\n | 'application/json'\n | 'application/octet-stream'\n | 'text/event-stream'\n | DataLink\n resHeader?: {} | DataLink\n resBody?: any\n sseEvent?: string | DataLink\n scriptConfig?:\n | DataLink\n | {\n code?: string | DataLink\n timeout?: number | DataLink\n members?:\n | Array<\n | DataLink\n | {\n handler?: string | DataLink\n varName?: string | DataLink\n }\n >\n | DataLink\n additionalParams?: {} | DataLink\n }\n }\n >\n | DataLink\n /* Max connection idle time, 0 is disable */\n idleTimeout?: number | DataLink\n /* HTTP request body limit, 0 is unlimited */\n bodyLimit?: number | DataLink\n /* CORS allowed origins\n You can use wildcard like `*`, `*.example.com`, `http://*.example.com` */\n corsOrigins?: Array<string | DataLink> | DataLink\n /* Authorization type of HTTP request */\n authType?: 'none' | 'basic' | 'bearer' | DataLink\n /* Username of basic auth */\n basicAuthUser?: string | DataLink\n /* Password of basic auth */\n basicAuthPassword?: string | DataLink\n /* Token of bearer auth */\n bearerToken?: string | DataLink\n /* Asynchronous response mode\n Will block connection until Response Body update. */\n asyncMode?: boolean | DataLink\n /* Save request body as file\n Only work on `application/octet-stream` or `multipart/form-data`. */\n saveBodyAsFile?: boolean | DataLink\n /* Response status code */\n resStatusCode?: number | DataLink\n /* Response Content-Type\n `text/*` will not convert body. \n `application/xml` convert object to XML, [example object struct](https://github.com/davidcalhoun/jstoxml#example-10-podcast-rss-feed) \n `application/octet-stream` body should be Base64 string or file path. */\n resContentType?:\n | 'text/plain'\n | 'text/html'\n | 'text/javascript'\n | 'text/css'\n | 'text/xml'\n | 'application/xml'\n | 'application/json'\n | 'application/octet-stream'\n | 'text/event-stream'\n | DataLink\n /* Response Body */\n resBody?: any\n /* Custom response headers */\n resHeader?: {} | DataLink\n /* Event name of SSE */\n sseEvent?: string | DataLink\n /* SSE single request mode, block new request until the previous request is processed */\n sseSingleRequest?: boolean | DataLink\n /* Enable TLS (HTTPS) */\n tls?: boolean | DataLink\n /* Server side key pair (Base64 encoded PKCS #12) */\n tlsKeyPair?: string | DataLink\n /* Password of key pair, leave empty if no password */\n tlsKeyPairPassword?: string | DataLink\n }\n events?: {\n /* Event of HTTP server is ready */\n onReady?: Array<EventAction>\n /* Event of HTTP server accept the request */\n onRequest?: Array<EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onRequest']>>\n /* Event of client close connection */\n onClientClose?: Array<\n EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onClientClose']>\n >\n /* Event of client error */\n onClientError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onClientError']>\n >\n /* Event of server close */\n onClose?: Array<EventAction>\n /* Event of server error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onError']>>\n }\n outlets?: {\n /* Server is listening */\n isListening?: () => Data<boolean>\n /* Query of request */\n requestQuery?: () => Data<{ [key: string]: any }>\n /* Body of request */\n requestBody?: () => Data<any>\n /* Remote address of request */\n clientAddress?: () => Data<string>\n }\n}\n\n/* Embedded HTTP/HTTPS server with route matching, CORS, auth (Basic/Bearer), SSE streaming, file upload, async response mode, and JS Sandbox route handlers */\nexport type GeneratorHTTPServer = Generator &\n GeneratorHTTPServerDef & {\n templateKey: 'GENERATOR_HTTP_SERVER'\n switches?: Array<\n SwitchDef &\n GeneratorHTTPServerDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isListening' | 'requestQuery' | 'requestBody' | 'clientAddress'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Information.d.ts":"/* Auto generated by build script\n *\n * Display informational dialog or toast messages to the user\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Show information */\nexport type GeneratorInformationActionShow = ActionWithParams & {\n __actionName: 'GENERATOR_INFORMATION_SHOW'\n params?: Array<\n | {\n input: 'displayLanguage'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'content'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Close information */\nexport type GeneratorInformationActionClose = Action & {\n __actionName: 'GENERATOR_INFORMATION_CLOSE'\n}\n\ninterface GeneratorInformationDef {\n /*\nDefault property:\n{\n \"modalMode\": \"root\",\n \"backgroundColor\": \"#161616\"\n}\n */\n property?: {\n /* Modal mode */\n modalMode?: 'root' | 'in-subspace' | DataLink\n /* Information contents */\n content?:\n | DataLink\n | {\n type?: 'loading' | 'info' | 'warning' | 'success' | 'queue-number' | DataLink\n title?: string | DataLink\n description?: string | DataLink\n queueNumberLabel?:\n | DataLink\n | {\n number?: string | DataLink\n labelTitle?: string | DataLink\n note?: string | DataLink\n }\n }\n /* Display language */\n displayLanguage?: string | DataLink\n /* Background color */\n backgroundColor?: string | DataLink\n }\n events?: {\n /* Trigger when user confirms the information */\n onConfirm?: Array<EventAction>\n /* Trigger when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Information']['onError']>>\n }\n outlets?: {\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* Display informational dialog or toast messages to the user */\nexport type GeneratorInformation = Generator &\n GeneratorInformationDef & {\n templateKey: 'GENERATOR_INFORMATION'\n switches?: Array<\n SwitchDef &\n GeneratorInformationDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Intent.d.ts":"/* Auto generated by build script\n *\n * Send intent to app and get result (Android only)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Read stats */\nexport type GeneratorIntentActionSendIntent = ActionWithParams & {\n __actionName: 'GENERATOR_INTENT_SEND_INTENT'\n params?: Array<\n | {\n input: 'action'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'data'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'type'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'extra'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'className'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'packageName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'category'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Start intent service */\nexport type GeneratorIntentActionStartService = ActionWithParams & {\n __actionName: 'GENERATOR_INTENT_START_SERVICE'\n params?: Array<\n | {\n input: 'action'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'data'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'type'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'extra'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'className'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'packageName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'category'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'foreground'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface GeneratorIntentDef {\n /*\nDefault property:\n{}\n */\n property?: {\n /* Intent action */\n action?: string | DataLink\n /* Intent data */\n data?: string | DataLink\n /* Intent type */\n type?: string | DataLink\n /* Extra data */\n extra?: {} | DataLink\n /* Intent target class name in package */\n className?: string | DataLink\n /* Intent target package name */\n packageName?: string | DataLink\n /* Intent category */\n category?: string | DataLink\n /* Intent start foreground service */\n foregroundService?: boolean | DataLink\n }\n events?: {\n /* On intent return a result trigger */\n onResult?: Array<EventAction<string & keyof TemplateEventPropsMap['Intent']['onResult']>>\n /* On intent error trigger */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Intent']['onError']>>\n }\n outlets?: {\n /* Last intent result */\n result?: () => Data<{\n action?: string\n data?: string\n type?: string\n extras?: { [key: string]: any }\n [key: string]: any\n }>\n }\n}\n\n/* Send intent to app and get result (Android only) */\nexport type GeneratorIntent = Generator &\n GeneratorIntentDef & {\n templateKey: 'GENERATOR_INTENT'\n switches?: Array<\n SwitchDef &\n GeneratorIntentDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'result'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Iterator.d.ts":"/* Auto generated by build script\n *\n * Iterate through values (Array, Object, Number, String)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Proceed to next iteration */\nexport type GeneratorIteratorActionNext = Action & {\n __actionName: 'GENERATOR_ITERATOR_NEXT'\n}\n\n/* Go back to previous iteration */\nexport type GeneratorIteratorActionPrevious = Action & {\n __actionName: 'GENERATOR_ITERATOR_PREVIOUS'\n}\n\n/* Jump to the first iteration element */\nexport type GeneratorIteratorActionFirst = Action & {\n __actionName: 'GENERATOR_ITERATOR_FIRST'\n}\n\n/* Jump to the last iteration element (ignoring the loop setting) */\nexport type GeneratorIteratorActionLast = Action & {\n __actionName: 'GENERATOR_ITERATOR_LAST'\n}\n\n/* Reset iteration state */\nexport type GeneratorIteratorActionReset = Action & {\n __actionName: 'GENERATOR_ITERATOR_RESET'\n}\n\ninterface GeneratorIteratorDef {\n /*\nDefault property:\n{\n \"data\": [],\n \"start\": 0,\n \"step\": 1\n}\n */\n property?: {\n /* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.entries() to get key-value pairs. If it's a String, it will iterate through characters. If it's a Number, it represents count from 1 to N. */\n data?: any\n /* Starting element position */\n start?: number | DataLink\n /* Step size for each iteration */\n step?: number | DataLink\n /* Maximum number of iterations (can be set to -1 for unlimited). When reached, further iteration actions will be silently ignored. */\n maxQuantity?: number | DataLink\n /* Whether to loop the iteration */\n loop?: boolean | DataLink\n }\n events?: {\n /* Event triggered on each iteration */\n iterate?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['iterate']>>\n /* Event triggered on the first iteration of a round */\n first?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['first']>>\n /* Event triggered on the last iteration of a round */\n end?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['end']>>\n /* Event triggered when data type is invalid or unexpected */\n error?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['error']>>\n }\n outlets?: {\n /* Elements that have been iterated (including current one) */\n iteratedArray?: () => Data<Array<any>>\n /* Elements that will be iterated but have not been iterated yet */\n upcomingArray?: () => Data<Array<any>>\n /* Current iteration element */\n value?: () => Data<any>\n /* Key of the current iteration element (for number: same as value, for array/string: index, for object: string key) */\n key?: () => Data<any>\n /* Current iteration count (if data is 6 and step is 2, this will return: 1,2,3 in sequence) */\n index?: () => Data<number>\n }\n}\n\n/* Iterate through values (Array, Object, Number, String) */\nexport type GeneratorIterator = Generator &\n GeneratorIteratorDef & {\n templateKey: 'GENERATOR_ITERATOR'\n switches?: Array<\n SwitchDef &\n GeneratorIteratorDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'iteratedArray' | 'upcomingArray' | 'value' | 'key' | 'index'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Keyboard.d.ts":"/* Auto generated by build script\n *\n * Listen to keyboard and remote control key events (keyDown, keyUp)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\ninterface GeneratorKeyboardDef {\n /*\nDefault property:\n{\n \"enabled\": true,\n \"keyMap\": {},\n \"keyOutletPrefer\": \"auto\",\n \"batchStopKeys\": [\n 13\n ],\n \"batchDebounce\": 500\n}\n */\n property?: {\n /* Enable listening for input */\n enabled?: boolean | DataLink\n /* Key map to transform key or key code to the designated content\n Example: { 37: 'left', 38: 'up', 39: 'right', 40: 'down', 'Enter': 'confirm' } \n Supports both key codes (numbers) and key names (strings) as keys */\n keyMap?: {} | DataLink\n /* Key outlet preference use key code or key. */\n keyOutletPrefer?: 'auto' | 'key-code' | 'key' | DataLink\n /* Key or code to finish batch input\n Common values: 13 (Enter), 27 (Escape), 'Enter', 'Escape' */\n batchStopKeys?: Array<string | DataLink | number | DataLink | DataLink> | DataLink\n /* Debounce time (ms) to finish batch input */\n batchDebounce?: number | DataLink\n /* Maximum wait time (ms) to finish batch input (default: unlimited) */\n batchDebounceMaxWait?: number | DataLink\n }\n events?: {\n /* Event on key press */\n onDown?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onDown']>>\n /* Event on key up */\n onUp?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onUp']>>\n /* Event on batch input complete */\n onBatch?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onBatch']>>\n }\n outlets?: {\n /* Last key code pressed */\n lastKeyDown?: () => Data<string | number>\n /* Modifier key information on last key press */\n lastKeyDownFlags?: () => Data<{ [key: string]: any }>\n /* Last key code released */\n lastKeyUp?: () => Data<string | number>\n /* Modifier key information on last key release */\n lastKeyUpFlags?: () => Data<{ [key: string]: any }>\n /* Last batch event */\n lastBatchEvents?: () => Data<\n Array<{\n event?: string\n key?: any\n keyNoMapping?: any\n keyCode?: any\n keyCodeNoMapping?: any\n flags?: { [key: string]: any }\n [key: string]: any\n }>\n >\n }\n}\n\n/* Listen to keyboard and remote control key events (keyDown, keyUp) */\nexport type GeneratorKeyboard = Generator &\n GeneratorKeyboardDef & {\n templateKey: 'GENERATOR_KEYBOARD'\n switches?: Array<\n SwitchDef &\n GeneratorKeyboardDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'lastKeyDown'\n | 'lastKeyDownFlags'\n | 'lastKeyUp'\n | 'lastKeyUpFlags'\n | 'lastBatchEvents'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmAnthropicCompat.d.ts":"/* Auto generated by build script\n *\n * LLM inference using Anthropic-compatible API endpoints\n *\n * ## Features\n * - Compatible with Anthropic API format\n * - Supports function calling (tools)\n * - Streaming responses\n * - Custom API endpoints (Default to https://api.anthropic.com/v1/messages)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Run text completion */\nexport type GeneratorAnthropicLLMActionCompletion = ActionWithParams & {\n __actionName: 'GENERATOR_ANTHROPIC_LLM_COMPLETION'\n params?: Array<\n | {\n input: 'systemMessage'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'temperature'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'topP'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'topK'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'stopSequences'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'toolChoice'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop text completion */\nexport type GeneratorAnthropicLLMActionStopCompletion = Action & {\n __actionName: 'GENERATOR_ANTHROPIC_LLM_STOP_COMPLETION'\n}\n\ninterface GeneratorAnthropicLLMDef {\n /*\nDefault property:\n{\n \"apiEndpoint\": \"https://api.anthropic.com/v1/messages\",\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"systemMessage\": \"You are a helpful assistant.\",\n \"completionMessages\": [],\n \"completionMaxTokens\": 1024,\n \"completionTemperature\": 1,\n \"completionTopP\": 1,\n \"completionStopSequences\": []\n}\n */\n property?: {\n /* API endpoint URL */\n apiEndpoint?: string | DataLink\n /* API key */\n apiKey?: string | DataLink\n /* Model name (Default: claude-3-5-sonnet-20241022) */\n model?: string | DataLink\n /* System message content */\n systemMessage?: string | DataLink\n /* Chat messages (user/assistant only) */\n completionMessages?:\n | Array<\n | DataLink\n | {\n role?: 'user' | 'assistant' | DataLink\n content?:\n | string\n | DataLink\n | Array<\n | DataLink\n | {\n type?: 'text' | 'image' | DataLink\n text?: string | DataLink\n source?:\n | DataLink\n | {\n type?: string | DataLink\n media_type?: string | DataLink\n data?: string | DataLink\n }\n }\n >\n | DataLink\n | DataLink\n }\n >\n | DataLink\n /* Tools for function calling following Anthropic format\n Format: Array of objects with {name, description, input_schema} structure \n See: https://docs.anthropic.com/en/docs/tool-use */\n completionTools?: Array<{} | DataLink> | DataLink\n /* Tool choice for function calling */\n completionToolChoice?:\n | DataLink\n | {\n type?: 'auto' | 'any' | 'tool' | DataLink\n name?: string | DataLink\n }\n /* Maximum tokens to generate */\n completionMaxTokens?: number | DataLink\n /* Temperature */\n completionTemperature?: number | DataLink\n /* Top P sampling */\n completionTopP?: number | DataLink\n /* Top K sampling */\n completionTopK?: number | DataLink\n /* Stop sequences */\n completionStopSequences?: Array<string | DataLink> | DataLink\n }\n events?: {\n /* Error event */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onError']>>\n /* Completion event */\n onCompletion?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletion']>\n >\n /* Completion finished event */\n onCompletionFinished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletionFinished']>\n >\n /* Tool use event */\n onToolUse?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onToolUse']>\n >\n }\n outlets?: {\n /* Evaluating outlet */\n isEvaluating?: () => Data<boolean>\n /* Completion result outlet */\n completionResult?: () => Data<string>\n /* Completion details outlet */\n completionDetails?: () => Data<{\n model?: string\n stop_reason?: string\n usage?: { [key: string]: any }\n content?: Array<any>\n [key: string]: any\n }>\n }\n}\n\n/* LLM inference using Anthropic-compatible API endpoints\n\n ## Features \n - Compatible with Anthropic API format \n - Supports function calling (tools) \n - Streaming responses \n - Custom API endpoints (Default to https://api.anthropic.com/v1/messages) */\nexport type GeneratorAnthropicLLM = Generator &\n GeneratorAnthropicLLMDef & {\n templateKey: 'GENERATOR_ANTHROPIC_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorAnthropicLLMDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isEvaluating' | 'completionResult' | 'completionDetails'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmAppleBuiltin.d.ts":"/* Auto generated by build script\n *\n * LLM inference using Apple Intelligence on iOS/tvOS 26+\n *\n * ## Features\n * - Native Apple Intelligence integration\n * - No model download required\n * - Privacy-focused on-device processing\n * - Optimized for Apple Silicon\n * - Requires iOS 26+ or tvOS 26+\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load model */\nexport type GeneratorAppleLLMActionLoadModel = Action & {\n __actionName: 'GENERATOR_APPLE_LLM_LOAD_MODEL'\n}\n\n/* Run text completion */\nexport type GeneratorAppleLLMActionCompletion = ActionWithParams & {\n __actionName: 'GENERATOR_APPLE_LLM_COMPLETION'\n params?: Array<\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'temperature'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'topP'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop text completion */\nexport type GeneratorAppleLLMActionStopCompletion = Action & {\n __actionName: 'GENERATOR_APPLE_LLM_STOP_COMPLETION'\n}\n\ninterface GeneratorAppleLLMDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"completionMessages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"completionMaxTokens\": 1024,\n \"completionTemperature\": 0.7,\n \"completionTopP\": 0.9\n}\n */\n property?: {\n /* Initialize model on generator init */\n init?: boolean | DataLink\n /* Chat messages (if first message has role 'system', it will be used as system prompt) */\n completionMessages?:\n | Array<\n | DataLink\n | {\n role?: string | DataLink\n content?: string | DataLink\n }\n >\n | DataLink\n /* Maximum tokens to generate */\n completionMaxTokens?: number | DataLink\n /* Temperature (0.0 to 1.0) */\n completionTemperature?: number | DataLink\n /* Top P sampling */\n completionTopP?: number | DataLink\n }\n events?: {\n /* Error event */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onError']>>\n /* Model loaded event */\n onModelLoaded?: Array<EventAction>\n /* Completion event */\n onCompletion?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onCompletion']>\n >\n /* Completion finished event */\n onCompletionFinished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onCompletionFinished']>\n >\n }\n outlets?: {\n /* Context state outlet */\n contextState?: () => Data<string>\n /* Evaluating outlet */\n isEvaluating?: () => Data<boolean>\n /* Completion result outlet */\n completionResult?: () => Data<string>\n /* Last token outlet */\n completionLastToken?: () => Data<string>\n }\n}\n\n/* LLM inference using Apple Intelligence on iOS/tvOS 26+\n\n ## Features \n - Native Apple Intelligence integration \n - No model download required \n - Privacy-focused on-device processing \n - Optimized for Apple Silicon \n - Requires iOS 26+ or tvOS 26+ */\nexport type GeneratorAppleLLM = Generator &\n GeneratorAppleLLMDef & {\n templateKey: 'GENERATOR_APPLE_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorAppleLLMDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'isEvaluating'\n | 'completionResult'\n | 'completionLastToken'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmGgml.d.ts":"/* Auto generated by build script\n *\n * Local Large Language Model (LLM) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)\n *\n * ## Notice\n * - The device RAM must be larger than 8GB\n * - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.\n * - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.\n * - Android: Recommended use Android 13+ system.\n * - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.\n * - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 1+ GPUs.\n * - Linux / Windows [@nextline - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property\n * - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)\n * - Web: Supported with CPU and WebGPU acceleration.\n * - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorLLMActionLoadModel = Action & {\n __actionName: 'GENERATOR_LLM_LOAD_MODEL'\n}\n\n/* Load multimodal (vision) model (PREVIEW FEATURE) */\nexport type GeneratorLLMActionLoadMultimodalModel = Action & {\n __actionName: 'GENERATOR_LLM_LOAD_MULTIMODAL_MODEL'\n}\n\n/* Tokenize the prompt */\nexport type GeneratorLLMActionTokenize = ActionWithParams & {\n __actionName: 'GENERATOR_LLM_TOKENIZE'\n params?: Array<\n | {\n input: 'mode'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptMediaPaths'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Detokenize the tokens to text */\nexport type GeneratorLLMActionDetokenize = ActionWithParams & {\n __actionName: 'GENERATOR_LLM_DETOKENIZE'\n params?: Array<{\n input: 'tokens'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Pre-process the prompt, this can speed up the completion action */\nexport type GeneratorLLMActionProcessPrompt = ActionWithParams & {\n __actionName: 'GENERATOR_LLM_PROCESS_PROMPT'\n params?: Array<\n | {\n input: 'sessionKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mode'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'parallelToolCalls'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'toolChoice'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'enableThinking'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'thinkingBudgetTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'thinkingBudgetMessage'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptMediaPaths'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptTemplateData'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptTemplateType'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'responseFormat'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'chatTemplateKwargs'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'addGenerationPrompt'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'now'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'forcePureContent'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Run text completion */\nexport type GeneratorLLMActionCompletion = ActionWithParams & {\n __actionName: 'GENERATOR_LLM_COMPLETION'\n params?: Array<\n | {\n input: 'sessionKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mode'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'parallelToolCalls'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'toolChoice'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'enableThinking'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'thinkingBudgetTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'thinkingBudgetMessage'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'useReasoningFormat'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptMediaPaths'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptTemplateData'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptTemplateType'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'responseFormat'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'chatTemplateKwargs'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'addGenerationPrompt'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'now'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'forcePureContent'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'grammar'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'stopWords'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'predict'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'temperature'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'probs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'topK'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'topP'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'xtcThreshold'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'xtcProbability'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dryMultiplier'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dryBase'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dryAllowedLength'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dryPenaltyLastN'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'drySequenceBreakers'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mirostat'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mirostatTau'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mirostatEta'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'penaltyLastN'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'penaltyRepeat'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'penaltyFrequency'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'penaltyPresent'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'penalizeNewline'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'seed'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'typicalP'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'ignoreEos'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mtpSpeculativeDecoding'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mtpDraftTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mtpDraftMinTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mtpDraftMinProbability'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mtpDraftSplitProbability'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'functionCallEnabled'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'functionCallSchema'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Clear session with session key or session ID */\nexport type GeneratorLLMActionClearSession = ActionWithParams & {\n __actionName: 'GENERATOR_LLM_CLEAR_SESSION'\n params?: Array<\n | {\n input: 'sessionId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'sessionCustomKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop text completion */\nexport type GeneratorLLMActionStopCompletion = Action & {\n __actionName: 'GENERATOR_LLM_STOP_COMPLETION'\n}\n\n/* Clear KV cache */\nexport type GeneratorLLMActionClearCache = Action & {\n __actionName: 'GENERATOR_LLM_CLEAR_CACHE'\n}\n\n/* Clear downloaded models & current jobs */\nexport type GeneratorLLMActionClearDownload = Action & {\n __actionName: 'GENERATOR_LLM_CLEAR_DOWNLOAD'\n}\n\n/* Release multimodal (vision) context (PREVIEW FEATURE) */\nexport type GeneratorLLMActionReleaseMultimodalContext = Action & {\n __actionName: 'GENERATOR_LLM_RELEASE_MULTIMODAL_CONTEXT'\n}\n\n/* Release context */\nexport type GeneratorLLMActionReleaseContext = Action & {\n __actionName: 'GENERATOR_LLM_RELEASE_CONTEXT'\n}\n\ninterface GeneratorLLMDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"contextSize\": 512,\n \"batchSize\": 512,\n \"uBatchSize\": 512,\n \"accelVariant\": \"default\",\n \"mainGpu\": 0,\n \"gpuLayers\": 0,\n \"useMlock\": true,\n \"useMmap\": true,\n \"cacheKType\": \"f16\",\n \"cacheVType\": \"f16\",\n \"ctxShift\": true,\n \"cpuMoeLayers\": 0,\n \"mtpSpeculativeDecoding\": false,\n \"mtpDraftTokens\": 3,\n \"transformScriptEnabled\": false,\n \"transformScriptCode\": \"\\/\\* Global variable: inputs = { prompt, messages, variables }, members = { llmUtils } \\*\\/\\nreturn inputs.prompt\",\n \"transformScriptVariables\": {},\n \"sessionMinSaveSize\": 50,\n \"sessionRemain\": 10,\n \"completionMode\": \"auto\",\n \"completionPrompt\": \"\",\n \"completionPromptTemplateType\": \"${}\",\n \"completionEnableThinking\": true,\n \"completionAddGenerationPrompt\": true,\n \"completionChatTemplateKwargs\": {},\n \"completionForcePureContent\": false,\n \"completionUseReasoningFormat\": \"auto\",\n \"completionStopWords\": [],\n \"completionPredict\": 400,\n \"completionTopK\": 40,\n \"completionTopP\": 0.95,\n \"completionMinP\": 0.05,\n \"completionDryMultiplier\": 0,\n \"completionDryBase\": 1.75,\n \"completionDryAllowedLength\": 2,\n \"completionDrySequenceBreakers\": [\n \"\\n\",\n \":\",\n \"\\\"\",\n \"*\"\n ],\n \"completionMirostat\": 0,\n \"completionMirostatTau\": 5,\n \"completionMirostatEta\": 0.1,\n \"completionPenaltyLastN\": 64,\n \"completionPenaltyRepeat\": 1,\n \"completionPenaltyFrequency\": 0,\n \"completionPenaltyPresent\": 0,\n \"completionPenalizeNewline\": false,\n \"completionTypicalP\": 1\n}\n */\n property?: {\n /* Initialize the Llama context on generator initialization\n Please note that it will take some RAM depending on the model size */\n init?: boolean | DataLink\n /* The URL or path of model\n We used GGUF format model, please refer to https://github.com/ggerganov/llama.cpp/tree/master#description */\n modelUrl?: string | DataLink\n /* Hash type of model */\n modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Hash of model */\n modelHash?: string | DataLink\n /* Load multimodal (vision) context after model loaded (PREVIEW FEATURE) */\n initMultimodal?: boolean | DataLink\n /* The URL or path of mmproj file for multimodal vision support (PREVIEW FEATURE) */\n mmprojUrl?: string | DataLink\n /* Hash type of mmproj file (PREVIEW FEATURE) */\n mmprojHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Hash of mmproj file (PREVIEW FEATURE) */\n mmprojHash?: string | DataLink\n /* Minimum tokens for image encoding in multimodal (PREVIEW FEATURE)\n Useful for dynamic resolution models (e.g. Qwen-VL). Default: -1 (auto) */\n imageMinTokens?: number | DataLink\n /* Maximum tokens for image encoding in multimodal (PREVIEW FEATURE)\n Limit tokens for dynamic resolution models to balance speed vs. detail. Default: -1 (auto) */\n imageMaxTokens?: number | DataLink\n /* Chat Template (Jinja format) to override the default template from model */\n chatTemplate?: string | DataLink\n /* Context size (0 ~ 4096) (Default to 512) */\n contextSize?: number | DataLink\n /* Logical batch size for prompt processing */\n batchSize?: number | DataLink\n /* Physical batch size for prompt processing */\n uBatchSize?: number | DataLink\n /* Number of threads */\n maxThreads?: number | DataLink\n /* Accelerator variant (Only for desktop)\n `default` - CPU / Metal (macOS) \n `vulkan` - Use Vulkan \n `cuda` - Use CUDA \n `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */\n accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink\n /* Devices. For example:\n \n Metal or CPU for iOS/tvOS/MacOS \n OpenCL or CPU for Android \n - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices) \n For Desktop, you may want to include/exclude GPUs */\n devices?: Array<string | DataLink> | DataLink\n /* Main GPU index */\n mainGpu?: number | DataLink\n /* Number of GPU layers */\n gpuLayers?: number | DataLink\n /* Use memory lock */\n useMlock?: boolean | DataLink\n /* Use mmap */\n useMmap?: boolean | DataLink\n /* Disable extra buffer types for weight repacking. Reduces memory usage at the cost of slower prompt processing. */\n noExtraBuffs?: boolean | DataLink\n /* Use Flash Attention for inference (Recommended with GPU enabled) */\n useFlashAttn?: 'auto' | 'on' | 'off' | DataLink\n /* KV cache data type for the K (Default: f16) */\n cacheKType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink\n /* KV cache data type for the V (Default: f16) */\n cacheVType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink\n /* Use a unified buffer across the input sequences when computing the attention */\n useKVUnified?: boolean | DataLink\n /* Use full-size SWA cache. May improve performance for multiple sequences but uses more memory. */\n useSwaFull?: boolean | DataLink\n /* Enable context shift */\n ctxShift?: boolean | DataLink\n /* Number of layers to keep MoE weights on CPU */\n cpuMoeLayers?: number | DataLink\n /* Enable MTP speculative decoding for GGUF models that contain MTP / NextN layers */\n mtpSpeculativeDecoding?: boolean | DataLink\n /* Maximum number of MTP draft tokens */\n mtpDraftTokens?: number | DataLink\n /* Minimum number of MTP draft tokens */\n mtpDraftMinTokens?: number | DataLink\n /* Minimum probability for greedy MTP draft tokens */\n mtpDraftMinProbability?: number | DataLink\n /* Split probability for MTP speculative decoding */\n mtpDraftSplitProbability?: number | DataLink\n /* Enable Transform Script for processing the prompt */\n transformScriptEnabled?: boolean | DataLink\n /* Code of Transform Script */\n transformScriptCode?: string | DataLink\n /* Variables used in Transform Script (object) */\n transformScriptVariables?: {} | DataLink\n /* Session save mode\n `none` - No session saving \n `prompt` - Save session when prompt processed \n `completion` - Save session when completion finished \n `all` - Save session when prompt processed and completion finished */\n sessionSaveMode?: 'none' | 'prompt' | 'completion' | 'all' | DataLink\n /* Minimum processed/generated size to determine whether to save session (Unit: token) */\n sessionMinSaveSize?: number | DataLink\n /* Session file remain count (Default to 10) */\n sessionRemain?: number | DataLink\n /* TODO:loran_gqarms_norm_epsrope_freq_baserope_freq_scale */\n completionMode?: 'auto' | 'chat' | 'text' | DataLink\n /* Tools for chat mode using OpenAI-compatible function calling format\n Format: Array of objects with {type, function: {name, description, parameters}} structure \n See: https://platform.openai.com/docs/guides/function-calling */\n completionTools?: Array<{} | DataLink> | DataLink\n /* Enable parallel tool calls */\n completionParallelToolCalls?: boolean | DataLink\n /* Tool choice for chat mode */\n completionToolChoice?: 'none' | 'auto' | 'required' | DataLink\n /* Messages (chat mode) */\n completionMessages?:\n | Array<\n | DataLink\n | {\n role?: string | DataLink\n content?: string | DataLink\n }\n >\n | DataLink\n /* Prompt (text mode) */\n completionPrompt?: string | DataLink\n /* Media paths to be used in the prompt template (PREVIEW FEATURE)\n In prompt, use `<__media__>` for position of media content */\n completionPromptMediaPaths?: Array<string | DataLink> | DataLink\n /* Data to be used in the prompt template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */\n completionPromptTemplateData?: {} | DataLink\n /* The prompt template type */\n completionPromptTemplateType?: '${}' | '{{}}' | DataLink\n /* Response format */\n completionResponseFormat?:\n | DataLink\n | {\n type?: 'text' | 'json_schema' | 'json_object' | DataLink\n json_schema?:\n | DataLink\n | {\n strict?: boolean | DataLink\n schema?: {} | DataLink\n }\n schema?: {} | DataLink\n }\n /* Enable thinking */\n completionEnableThinking?: boolean | DataLink\n /* Maximum tokens allowed inside the model's thinking block before forcing it closed. Only applies when chat formatting exposes thinking tags. */\n completionThinkingBudgetTokens?: number | DataLink\n /* Message injected before the thinking end tag when the thinking budget is exhausted. */\n completionThinkingBudgetMessage?: string | DataLink\n /* Add generation prompt */\n completionAddGenerationPrompt?: boolean | DataLink\n /* Now (for fill current date in chat template if supported) */\n completionNow?: string | DataLink\n /* Additional keyword arguments for chat template (object) */\n completionChatTemplateKwargs?: {} | DataLink\n /* Force pure content (accept any model that has a chat_template without requiring template validation) */\n completionForcePureContent?: boolean | DataLink\n /* Use reasoning format for enhanced response structure\n `auto` - Auto-determine the reasoning format of the model \n `none` - Disable reasoning format */\n completionUseReasoningFormat?: 'auto' | 'none' | DataLink\n /* Stop words */\n completionStopWords?: Array<string | DataLink> | DataLink\n /* Number of tokens to predict */\n completionPredict?: number | DataLink\n /* Throttle time for completion result (in milliseconds) */\n completionResultThrottle?: number | DataLink\n /* Grammar (GBNF: Please refer to https://github.com/ggerganov/llama.cpp/tree/master/grammars) */\n completionGrammar?: string | DataLink\n /* Temperature */\n completionTemperature?: number | DataLink\n /* Number of probablites to show for each token in the completion details */\n completionProbs?: number | DataLink\n /* Top K sampling */\n completionTopK?: number | DataLink\n /* Top P sampling */\n completionTopP?: number | DataLink\n /* Min P sampling */\n completionMinP?: number | DataLink\n /* Sets a minimum probability threshold for tokens to be removed */\n completionXtcThreshold?: number | DataLink\n /* Sets the chance for token removal (checked once on sampler start) */\n completionXtcProbability?: number | DataLink\n /* Set the DRY (Don't Repeat Yourself) repetition penalty multiplier. Default: `0.0`, which is disabled. */\n completionDryMultiplier?: number | DataLink\n /* Set the DRY repetition penalty base value. Default: `1.75` */\n completionDryBase?: number | DataLink\n /* Tokens that extend repetition beyond this receive exponentially increasing penalty: multiplier * base ^ (length of repeating sequence before token - allowed length). Default: `2` */\n completionDryAllowedLength?: number | DataLink\n /* How many tokens to scan for repetitions. Default: `-1`, where `0` is disabled and `-1` is context size. */\n completionDryPenaltyLastN?: number | DataLink\n /* Specify an array of sequence breakers for DRY sampling. Only a JSON array of strings is accepted. Default: `['\\n', ':', '\"', '*']` */\n completionDrySequenceBreakers?: Array<string | DataLink> | DataLink\n /* Top n sigma sampling as described in academic paper \"Top-nσ: Not All Logits Are You Need\" https://arxiv.org/pdf/2411.07641. Default: `-1.0` (Disabled) */\n completionTopNSigma?: number | DataLink\n /* Use Mirostat sampling. Top K, Nucleus, Tail Free and Locally Typical samplers are ignored if used. */\n completionMirostat?: number | DataLink\n /* Mirostat target entropy, parameter tau */\n completionMirostatTau?: number | DataLink\n /* Mirostat learning rate, parameter eta */\n completionMirostatEta?: number | DataLink\n /* Last n tokens to consider for penalize */\n completionPenaltyLastN?: number | DataLink\n /* Penalize repeat sequence of tokens (default: 0.1, 1.0 = disabled) */\n completionPenaltyRepeat?: number | DataLink\n /* Repeat alpha frequency penalty (default: 0.1, 0.0 = disabled) */\n completionPenaltyFrequency?: number | DataLink\n /* Repeat alpha presence penalty (default: 0.1, 0.0 = disabled) */\n completionPenaltyPresent?: number | DataLink\n /* Penalize newline tokens when applying the repeat penalty (default: true) */\n completionPenalizeNewline?: boolean | DataLink\n /* Set the random number generator (RNG) seed (default: -1, -1 = random seed) */\n completionSeed?: number | DataLink\n /* locally typical sampling, parameter p (default: 0.1, 1.0 = disabled) */\n completionTypicalP?: number | DataLink\n /* Repeat alpha frequency penalty (default: 0.1, 0.0 = disabled) */\n completionIgnoreEOS?: boolean | DataLink\n /* Buttress connection settings for remote inference */\n buttressConnectionSettings?:\n | DataLink\n | {\n enabled?: boolean | DataLink\n url?: string | DataLink\n autoDiscoverType?: 'manual' | 'auto' | DataLink\n fallbackType?: 'use-local' | 'no-op' | DataLink\n strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink\n }\n }\n events?: {\n /* Event triggered when context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Llm']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Llm']['onError']>>\n /* Event triggered when completion */\n onCompletion?: Array<EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletion']>>\n /* Event triggered when completion finished */\n onCompletionFinished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletionFinished']>\n >\n /* Event triggered on get function call request */\n onCompletionFunctionCall?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletionFunctionCall']>\n >\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Context load progress (0-100) */\n contextLoadProgress?: () => Data<number>\n /* Context details */\n contextDetails?: () => Data<{\n state?: string\n contextId?: string\n gpu?: string\n reasonNoGPU?: string\n model?: { [key: string]: any }\n isMultimodalEnabled?: boolean\n [key: string]: any\n }>\n /* Session details */\n sessions?: () => Data<{\n last_session_id?: string\n sessions?: Array<{\n id?: string\n type?: string\n prompt?: string\n sessionKey?: string\n model_instance_id?: string\n tokens_evaluated?: number\n t?: number\n [key: string]: any\n }>\n last_custom_session_id?: string\n custom_sessions?: Array<{\n id?: string\n type?: string\n prompt?: string\n sessionKey?: string\n model_instance_id?: string\n tokens_evaluated?: number\n t?: number\n [key: string]: any\n }>\n [key: string]: any\n }>\n /* Is evaluating */\n isEvaluating?: () => Data<boolean>\n /* Tokenize result */\n tokenizeResult?: () => Data<Array<number>>\n /* Detokenize result */\n detokenizeResult?: () => Data<string>\n /* Last formatted prompt (messages or prompt) */\n completionLastFormattedPrompt?: () => Data<string>\n /* Last completion token */\n completionLastToken?: () => Data<string>\n /* Completion result */\n completionResult?: () => Data<string>\n /* Reasoning content from model responses */\n completionReasoningContent?: () => Data<string>\n /* Full context (Prompt + Completion) */\n completionFullContext?: () => Data<string>\n /* Inference result details */\n completionResultDetails?: () => Data<{\n prompt?: string\n full_context?: string\n text?: string\n content?: string\n reasoning_content?: string\n token?: string\n tool_calls?: Array<{\n id?: string\n type?: string\n function?: {\n name?: string\n arguments?: string\n [key: string]: any\n }\n [key: string]: any\n }>\n [key: string]: any\n }>\n }\n}\n\n/* Local Large Language Model (LLM) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)\n\n ## Notice \n - The device RAM must be larger than 8GB \n - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal. \n - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal. \n - Android: Recommended use Android 13+ system. \n - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported. \n - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 1+ GPUs. \n - Linux / Windows [@nextline - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property \n - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) \n - Web: Supported with CPU and WebGPU acceleration. \n - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable. */\nexport type GeneratorLLM = Generator &\n GeneratorLLMDef & {\n templateKey: 'GENERATOR_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorLLMDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'contextLoadProgress'\n | 'contextDetails'\n | 'sessions'\n | 'isEvaluating'\n | 'tokenizeResult'\n | 'detokenizeResult'\n | 'completionLastFormattedPrompt'\n | 'completionLastToken'\n | 'completionResult'\n | 'completionReasoningContent'\n | 'completionFullContext'\n | 'completionResultDetails'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmMediaTekNeuroPilot.d.ts":"/* Auto generated by build script\n *\n * On-device LLM inference using MediaTek NeuroPilot native SDK integration on Android\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load or validate the NeuroPilot model context */\nexport type GeneratorNeuropilotLlmActionLoadModel = ActionWithParams & {\n __actionName: 'GENERATOR_NEUROPILOT_LLM_LOAD_MODEL'\n params?: Array<\n | {\n input: 'runnerPath'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'configPath'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'workingDirectory'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'libraryPaths'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'daemonHost'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'daemonPort'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'daemonSocketName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'daemonSocketNamespace'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Run text generation with the current NeuroPilot context */\nexport type GeneratorNeuropilotLlmActionGenerate = ActionWithParams & {\n __actionName: 'GENERATOR_NEUROPILOT_LLM_GENERATE'\n params?: Array<\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxNewTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'preformatter'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Abort an in-flight NeuroPilot generation request */\nexport type GeneratorNeuropilotLlmActionAbortGeneration = Action & {\n __actionName: 'GENERATOR_NEUROPILOT_LLM_ABORT_GENERATION'\n}\n\n/* Release the current NeuroPilot context */\nexport type GeneratorNeuropilotLlmActionReleaseContext = Action & {\n __actionName: 'GENERATOR_NEUROPILOT_LLM_RELEASE_CONTEXT'\n}\n\ninterface GeneratorNeuropilotLlmDef {\n /*\nDefault property:\n{\n \"runnerPath\": \"/data/local/tmp/llm_sdk/main\",\n \"configPath\": \"/data/local/tmp/llm_sdk/config_gemma2_2b_instruct.yaml\",\n \"workingDirectory\": \"/data/local/tmp/llm_sdk\",\n \"libraryPaths\": [\n \"/vendor/lib64\",\n \"/system_ext/lib64\",\n \"/vendor/lib\",\n \"/system_ext/lib\"\n ],\n \"runtimeMode\": \"auto\",\n \"preformatter\": \"GemmaNoInput\",\n \"maxNewTokens\": 128\n}\n */\n property?: {\n /* Preloadable NeuroPilot model bundle preset */\n modelBundle?:\n | 'Gemma 2 2B Instruct'\n | 'Gemma 2 2B Instruct (Tailpatched)'\n | 'Gemma 2 2B Instruct (Tailpatched MDLA53)'\n | 'Qwen 2.5 0.5B Instruct'\n | 'Qwen 2.5 1.5B Instruct'\n | 'Llama 3 8B Instruct'\n | DataLink\n /* Override base URL for NeuroPilot model bundle downloads */\n modelBaseUrl?: string | DataLink\n /* Validate runner/config paths on generator initialization */\n init?: boolean | DataLink\n /* Runner binary path on device */\n runnerPath?: string | DataLink\n /* YAML config path on device */\n configPath?: string | DataLink\n /* Working directory for the runner process */\n workingDirectory?: string | DataLink\n /* Extra library search paths for the runner process */\n libraryPaths?: Array<string | DataLink> | DataLink\n /* Daemon host for a preloaded NeuroPilot service */\n daemonHost?: string | DataLink\n /* Daemon TCP port for a preloaded NeuroPilot service */\n daemonPort?: number | DataLink\n /* Android local socket name for a privileged NeuroPilot service */\n daemonSocketName?: string | DataLink\n /* Android local socket namespace used by the privileged NeuroPilot service */\n daemonSocketNamespace?: 'abstract' | 'reserved' | 'filesystem' | DataLink\n /* Runtime selection strategy for MediaTek execution */\n runtimeMode?: 'auto' | 'daemon' | 'root-runner' | 'native' | DataLink\n /* Prompt preformatter used by the vendor runner */\n preformatter?:\n | 'AlpacaNoInput'\n | 'OneShotConversation'\n | 'VicunaNoInput'\n | 'QwenNoInput'\n | 'Qwen3NoInput'\n | 'Qwen3NoInputNoThink'\n | 'Llama3NoInput'\n | 'Phi3NoInput'\n | 'MinicpmNoInput'\n | 'MinicpmNoInputZh'\n | 'InternLM2'\n | 'GemmaNoInput'\n | DataLink\n /* Prompt to run */\n prompt?: string | DataLink\n /* Chat messages to flatten into a prompt */\n messages?: Array<DataLink | {}> | DataLink\n /* Maximum tokens requested from the runner */\n maxNewTokens?: number | DataLink\n }\n events?: {\n /* Event triggered when the NeuroPilot context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onContextStateChange']>\n >\n /* Event triggered when a completion token or partial result is emitted */\n onCompletion?: Array<\n EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onCompletion']>\n >\n /* Event triggered when generation finishes */\n onCompletionFinished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onCompletionFinished']>\n >\n /* Event triggered when a NeuroPilot error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['NeuropilotLlm']['onError']>>\n }\n outlets?: {\n /* Current NeuroPilot context state */\n contextState?: () => Data<string>\n /* Final generated result text */\n result?: () => Data<string>\n /* Full context returned by the runner */\n fullContext?: () => Data<string>\n /* Last emitted token or chunk */\n lastToken?: () => Data<string>\n /* Raw output captured from the NeuroPilot runner */\n rawOutput?: () => Data<string>\n /* Prompt-phase performance in tokens per second */\n promptTokensPerSec?: () => Data<string>\n /* Generation-phase performance in tokens per second */\n generationTokensPerSec?: () => Data<string>\n }\n}\n\n/* On-device LLM inference using MediaTek NeuroPilot native SDK integration on Android */\nexport type GeneratorNeuropilotLlm = Generator &\n GeneratorNeuropilotLlmDef & {\n templateKey: 'GENERATOR_NEUROPILOT_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorNeuropilotLlmDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'result'\n | 'fullContext'\n | 'lastToken'\n | 'rawOutput'\n | 'promptTokensPerSec'\n | 'generationTokensPerSec'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmMlx.d.ts":"/* Auto generated by build script\n *\n * On-device LLM inference using Apple MLX framework on iOS/tvOS\n *\n * ## Features\n * - Powered by MLX (Apple's ML framework optimized for Apple Silicon)\n * - Download models directly from HuggingFace Hub\n * - Streaming token generation\n * - Supports LLM and VLM (Vision Language Models)\n * - Requires iOS 17+ or tvOS 17+\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load model */\nexport type GeneratorMlxLLMActionLoadModel = ActionWithParams & {\n __actionName: 'GENERATOR_MLX_LLM_LOAD_MODEL'\n params?: Array<\n | {\n input: 'modelId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'vlm'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Run text completion */\nexport type GeneratorMlxLLMActionCompletion = ActionWithParams & {\n __actionName: 'GENERATOR_MLX_LLM_COMPLETION'\n params?: Array<\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'temperature'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'topP'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'repetitionPenalty'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop text completion */\nexport type GeneratorMlxLLMActionStopCompletion = Action & {\n __actionName: 'GENERATOR_MLX_LLM_STOP_COMPLETION'\n}\n\n/* Release model context */\nexport type GeneratorMlxLLMActionReleaseContext = Action & {\n __actionName: 'GENERATOR_MLX_LLM_RELEASE_CONTEXT'\n}\n\ninterface GeneratorMlxLLMDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"modelId\": \"mlx-community/Qwen3-4B-4bit\",\n \"vlm\": false,\n \"completionMessages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"completionMaxTokens\": 1024,\n \"completionTemperature\": 0.6,\n \"completionTopP\": 1,\n \"completionRepetitionContextSize\": 20\n}\n */\n property?: {\n /* Initialize model on generator init */\n init?: boolean | DataLink\n /* HuggingFace model ID or local path to model directory\n e.g. \"mlx-community/Qwen3-4B-4bit\" */\n modelId?: string | DataLink\n /* Enable Vision Language Model (VLM) mode */\n vlm?: boolean | DataLink\n /* Chat messages (if first message has role 'system', it will be used as system prompt) */\n completionMessages?:\n | Array<\n | DataLink\n | {\n role?: string | DataLink\n content?: string | DataLink\n }\n >\n | DataLink\n /* Maximum tokens to generate */\n completionMaxTokens?: number | DataLink\n /* Temperature (0.0 to 2.0) */\n completionTemperature?: number | DataLink\n /* Top P sampling */\n completionTopP?: number | DataLink\n /* Repetition penalty factor */\n completionRepetitionPenalty?: number | DataLink\n /* Number of tokens to consider for repetition penalty */\n completionRepetitionContextSize?: number | DataLink\n /* Maximum KV cache size (context window). Uses rotating cache to limit memory.\n Smaller values (e.g. 512) use less memory but lower quality. \n Larger values (e.g. 4096) use more memory but better quality. \n Leave empty for unlimited (model default). */\n contextSize?: number | DataLink\n /* Enable thinking mode (model-dependent, e.g. Qwen3).\n When enabled, passes enable_thinking=true to the chat template. \n The model may output reasoning in <think> tags which will be extracted as reasoning_content. */\n completionEnableThinking?: boolean | DataLink\n /* Additional keyword arguments for chat template (object) */\n completionChatTemplateKwargs?: {} | DataLink\n /* Tools for chat mode using OpenAI-compatible function calling format\n Format: Array of objects with {type, function: {name, description, parameters}} structure \n See: https://platform.openai.com/docs/guides/function-calling */\n completionTools?: Array<{} | DataLink> | DataLink\n /* Buttress connection settings for remote inference */\n buttressConnectionSettings?:\n | DataLink\n | {\n enabled?: boolean | DataLink\n url?: string | DataLink\n autoDiscoverType?: 'manual' | 'auto' | DataLink\n fallbackType?: 'use-local' | 'no-op' | DataLink\n strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink\n }\n }\n events?: {\n /* Event triggered when context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onContextStateChange']>\n >\n /* Error event */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onError']>>\n /* Completion streaming event (emitted for each token) */\n onCompletion?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onCompletion']>\n >\n /* Completion finished event */\n onCompletionFinished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MlxLlm']['onCompletionFinished']>\n >\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Model load progress (0-1) */\n loadProgress?: () => Data<number>\n /* Whether the model is evaluating */\n isEvaluating?: () => Data<boolean>\n /* Completion result */\n completionResult?: () => Data<string>\n /* Last token */\n completionLastToken?: () => Data<string>\n }\n}\n\n/* On-device LLM inference using Apple MLX framework on iOS/tvOS\n\n ## Features \n - Powered by MLX (Apple's ML framework optimized for Apple Silicon) \n - Download models directly from HuggingFace Hub \n - Streaming token generation \n - Supports LLM and VLM (Vision Language Models) \n - Requires iOS 17+ or tvOS 17+ */\nexport type GeneratorMlxLLM = Generator &\n GeneratorMlxLLMDef & {\n templateKey: 'GENERATOR_MLX_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorMlxLLMDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'loadProgress'\n | 'isEvaluating'\n | 'completionResult'\n | 'completionLastToken'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmOnnx.d.ts":"/* Auto generated by build script\n *\n * Local LLM inference based on [transformers.js](https://huggingface.co/docs/transformers.js)\n * You can use any converted model on HuggingFace.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorOnnxLLMActionLoadModel = Action & {\n __actionName: 'GENERATOR_ONNX_LLM_LOAD_MODEL'\n}\n\n/* Inference */\nexport type GeneratorOnnxLLMActionInfer = ActionWithParams & {\n __actionName: 'GENERATOR_ONNX_LLM_INFER'\n params?: Array<\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'chat'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'images'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'audios'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'toolChoice'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Clean cache */\nexport type GeneratorOnnxLLMActionCleanCache = Action & {\n __actionName: 'GENERATOR_ONNX_LLM_CLEAN_CACHE'\n}\n\n/* Release context */\nexport type GeneratorOnnxLLMActionReleaseContext = Action & {\n __actionName: 'GENERATOR_ONNX_LLM_RELEASE_CONTEXT'\n}\n\ninterface GeneratorOnnxLLMDef {\n /*\nDefault property:\n{\n \"modelType\": \"auto\",\n \"toolCallParser\": \"llama3_json\",\n \"toolChoice\": \"auto\",\n \"maxNewTokens\": 256,\n \"temperature\": 0.7,\n \"topK\": 50,\n \"topP\": 0.9,\n \"repetitionPenalty\": 1,\n \"noRepeatNgramSize\": 0,\n \"numBeams\": 1,\n \"doSample\": true,\n \"executionMode\": \"sequential\"\n}\n */\n property?: {\n /* Initialize the TTS context on generator initialization */\n init?: boolean | DataLink\n /* LLM model */\n model?: string | DataLink\n /* Model type */\n modelType?: string | DataLink\n /* Quantize type */\n quantizeType?:\n | 'auto'\n | 'none'\n | 'fp16'\n | 'q8'\n | 'int8'\n | 'uint8'\n | 'q4'\n | 'bnb4'\n | 'q4f16'\n | DataLink\n /* Prompt to inference */\n prompt?: string | DataLink\n /* Messages to inference */\n messages?: Array<DataLink | {}> | DataLink\n /* Images with message to inference */\n images?: Array<string | DataLink> | DataLink\n /* Audios with message to inference */\n audios?: Array<string | DataLink> | DataLink\n /* Tool call parser */\n toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink\n /* Tools for chat mode using OpenAI-compatible function calling format\n Format: Array of objects with {type, function: {name, description, parameters}} structure \n See: https://platform.openai.com/docs/guides/function-calling */\n tools?: Array<{} | DataLink> | DataLink\n /* Tool choice for chat mode */\n toolChoice?: 'none' | 'auto' | DataLink\n /* Max new tokens to generate */\n maxNewTokens?: number | DataLink\n /* Temperature */\n temperature?: number | DataLink\n /* Top k */\n topK?: number | DataLink\n /* Top p */\n topP?: number | DataLink\n /* Repetition penalty */\n repetitionPenalty?: number | DataLink\n /* No repeat ngram size */\n noRepeatNgramSize?: number | DataLink\n /* Number of beams */\n numBeams?: number | DataLink\n /* Do sampling */\n doSample?: boolean | DataLink\n /* Executor candidates, descending order of priority\n Default will be xnnpack, wasm, cpu */\n executors?:\n | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>\n | DataLink\n /* Execution mode\n Usually when the model has many branches, setting this option to `parallel` will give you better performance. */\n executionMode?: 'sequential' | 'parallel' | DataLink\n /* QNN backend */\n qnnBackend?: 'HTP' | 'HTA' | 'DSP' | 'GPU' | 'CPU' | DataLink\n /* Enable FP16 for QNN HTP */\n qnnHtpEnableFp16?: boolean | DataLink\n /* Enable QNN debug */\n qnnEnableDebug?: boolean | DataLink\n }\n events?: {\n /* Event triggered when state change */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onContextStateChange']>\n >\n /* Event triggered on get function call request */\n onFunctionCall?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onFunctionCall']>\n >\n /* Event triggered on completion finished */\n onCompletionFinished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onCompletionFinished']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxLlm']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Generated output */\n generated?: () => Data<string>\n /* Full result of generation */\n fullResult?: () => Data<string>\n /* Last function call */\n lastFunctionCall?: () => Data<{\n id?: string\n type?: string\n function?: {\n name?: string\n arguments?: string\n [key: string]: any\n }\n [key: string]: any\n }>\n }\n}\n\n/* Local LLM inference based on [transformers.js](https://huggingface.co/docs/transformers.js)\n You can use any converted model on HuggingFace. */\nexport type GeneratorOnnxLLM = Generator &\n GeneratorOnnxLLMDef & {\n templateKey: 'GENERATOR_ONNX_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorOnnxLLMDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'contextState' | 'generated' | 'fullResult' | 'lastFunctionCall'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmOpenAiCompat.d.ts":"/* Auto generated by build script\n *\n * LLM inference using OpenAI-compatible API endpoints\n *\n * ## Features\n * - Compatible with OpenAI API format\n * - Supports function calling\n * - Streaming responses\n * - OpenResponses and OpenAI Responses API support\n * - Custom API endpoints, like\n * - OpenAI API: https://platform.openai.com/docs/guides/text?api-mode=chat\n * - OpenAI Responses API: https://platform.openai.com/docs/api-reference/responses/create\n * - OpenResponses API: https://www.openresponses.org/reference\n * - Anthropic API: https://docs.anthropic.com/en/api/openai-sdk\n * - Gemini API: https://ai.google.dev/gemini-api/docs/openai\n * - llama.cpp server: https://github.com/ggml-org/llama.cpp/tree/master/tools/server\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Run text completion */\nexport type GeneratorOpenAILLMActionCompletion = ActionWithParams & {\n __actionName: 'GENERATOR_OPENAI_LLM_COMPLETION'\n params?: Array<\n | {\n input: 'apiMode'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'previousResponseId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'promptCacheKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'responseOptions'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxTokens'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'temperature'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'topP'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'frequencyPenalty'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'presencePenalty'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'stop'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'toolChoice'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'parallelToolCalls'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'responseFormat'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop text completion */\nexport type GeneratorOpenAILLMActionStopCompletion = Action & {\n __actionName: 'GENERATOR_OPENAI_LLM_STOP_COMPLETION'\n}\n\ninterface GeneratorOpenAILLMDef {\n /*\nDefault property:\n{\n \"apiEndpoint\": \"https://api.openai.com/v1\",\n \"model\": \"gpt-4o\",\n \"apiMode\": \"chat_completions\",\n \"completionMessages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n }\n ],\n \"completionMaxTokens\": 1024,\n \"completionTemperature\": 1,\n \"completionTopP\": 1,\n \"completionStop\": []\n}\n */\n property?: {\n /* API endpoint URL */\n apiEndpoint?: string | DataLink\n /* API key */\n apiKey?: string | DataLink\n /* Model name (Default: gpt-4o-mini) */\n model?: string | DataLink\n /* API mode. Keep chat_completions for legacy OpenAI-compatible endpoints, or use responses for OpenResponses/OpenAI Responses endpoints. */\n apiMode?: 'chat_completions' | 'responses' | DataLink\n /* Previous response ID for continuing a Responses/OpenResponses conversation. */\n previousResponseId?: string | DataLink\n /* Prompt cache key for Responses/OpenResponses prompt cache optimization. */\n promptCacheKey?: string | DataLink\n /* Additional Responses/OpenResponses request options merged into the /responses payload, such as instructions, metadata, reasoning, truncation, service_tier, store, and text. */\n responseOptions?: {} | DataLink\n /* Chat messages */\n completionMessages?:\n | Array<\n | DataLink\n | {\n role?: string | DataLink\n content?:\n | string\n | DataLink\n | DataLink\n | {\n type?: string | DataLink\n text?: string | DataLink\n image_url?: string | DataLink\n }\n | DataLink\n }\n >\n | DataLink\n /* Tools for chat mode following OpenAI function calling format\n Format: Array of objects with {type, function: {name, description, parameters}} structure \n See: https://platform.openai.com/docs/guides/function-calling */\n completionTools?: Array<{} | DataLink> | DataLink\n /* Enable parallel tool calls */\n completionParallelToolCalls?: boolean | DataLink\n /* Tool choice for chat mode */\n completionToolChoice?: 'none' | 'auto' | 'required' | DataLink\n /* Response format */\n completionResponseFormat?:\n | DataLink\n | {\n type?: 'text' | 'json_schema' | 'json_object' | DataLink\n json_schema?:\n | DataLink\n | {\n strict?: boolean | DataLink\n schema?: {} | DataLink\n }\n }\n /* Maximum tokens to generate */\n completionMaxTokens?: number | DataLink\n /* Temperature */\n completionTemperature?: number | DataLink\n /* Top P sampling */\n completionTopP?: number | DataLink\n /* Frequency penalty. Only sent in chat_completions mode. */\n completionFrequencyPenalty?: number | DataLink\n /* Presence penalty. Only sent in chat_completions mode. */\n completionPresencePenalty?: number | DataLink\n /* Stop sequences. Only sent in chat_completions mode. */\n completionStop?: Array<string | DataLink> | DataLink\n }\n events?: {\n /* Error event */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onError']>>\n /* Completion event */\n onCompletion?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletion']>\n >\n /* Completion finished event */\n onCompletionFinished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletionFinished']>\n >\n /* Completion function call event */\n onCompletionFunctionCall?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletionFunctionCall']>\n >\n /* Response created event */\n onResponseCreated?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onResponseCreated']>\n >\n /* Output item added event */\n onOutputItemAdded?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onOutputItemAdded']>\n >\n /* Output text delta event */\n onOutputTextDelta?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onOutputTextDelta']>\n >\n /* Output item done event */\n onOutputItemDone?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onOutputItemDone']>\n >\n /* Response completed event */\n onResponseCompleted?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onResponseCompleted']>\n >\n /* Response failed event */\n onResponseFailed?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onResponseFailed']>\n >\n }\n outlets?: {\n /* Evaluating outlet */\n isEvaluating?: () => Data<boolean>\n /* Completion result outlet */\n completionResult?: () => Data<string>\n /* Completion details outlet */\n completionDetails?: () => Data<{\n text?: string\n content?: string\n finish_reason?: string\n usage?: { [key: string]: any }\n tool_calls?: Array<{\n id?: string\n type?: string\n function?: {\n name?: string\n arguments?: string\n [key: string]: any\n }\n [key: string]: any\n }>\n [key: string]: any\n }>\n /* Response ID outlet */\n responseId?: () => Data<string>\n /* Output items outlet */\n outputItems?: () => Data<Array<any>>\n }\n}\n\n/* LLM inference using OpenAI-compatible API endpoints\n\n ## Features \n - Compatible with OpenAI API format \n - Supports function calling \n - Streaming responses \n - OpenResponses and OpenAI Responses API support \n - Custom API endpoints, like \n - OpenAI API: https://platform.openai.com/docs/guides/text?api-mode=chat \n - OpenAI Responses API: https://platform.openai.com/docs/api-reference/responses/create \n - OpenResponses API: https://www.openresponses.org/reference \n - Anthropic API: https://docs.anthropic.com/en/api/openai-sdk \n - Gemini API: https://ai.google.dev/gemini-api/docs/openai \n - llama.cpp server: https://github.com/ggml-org/llama.cpp/tree/master/tools/server */\nexport type GeneratorOpenAILLM = Generator &\n GeneratorOpenAILLMDef & {\n templateKey: 'GENERATOR_OPENAI_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorOpenAILLMDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'isEvaluating'\n | 'completionResult'\n | 'completionDetails'\n | 'responseId'\n | 'outputItems'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/LlmQualcommAiEngine.d.ts":"/* Auto generated by build script\n *\n * Local LLM inference using Qualcomm AI Engine\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorQnnLlmActionLoadModel = Action & {\n __actionName: 'GENERATOR_QNN_LLM_LOAD_MODEL'\n}\n\n/* Abort model download */\nexport type GeneratorQnnLlmActionAbortModelDownload = Action & {\n __actionName: 'GENERATOR_QNN_LLM_ABORT_MODEL_DOWNLOAD'\n}\n\n/* Pre-process the prompt, to prepare KV cache */\nexport type GeneratorQnnLlmActionProcess = ActionWithParams & {\n __actionName: 'GENERATOR_QNN_LLM_PROCESS'\n params?: Array<\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Generate text */\nexport type GeneratorQnnLlmActionGenerate = ActionWithParams & {\n __actionName: 'GENERATOR_QNN_LLM_GENERATE'\n params?: Array<\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messages'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'tools'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Abort generation */\nexport type GeneratorQnnLlmActionAbortGeneration = Action & {\n __actionName: 'GENERATOR_QNN_LLM_ABORT_GENERATION'\n}\n\n/* Release context */\nexport type GeneratorQnnLlmActionReleaseContext = Action & {\n __actionName: 'GENERATOR_QNN_LLM_RELEASE_CONTEXT'\n}\n\ninterface GeneratorQnnLlmDef {\n /*\nDefault property:\n{\n \"modelType\": \"Llama 3.2 3B Chat\",\n \"chatFormat\": \"Llama 3.x\",\n \"toolsInUserMessage\": true,\n \"toolCallParser\": \"llama3_json\",\n \"toolChoice\": \"auto\",\n \"parallelToolCalls\": false,\n \"temperature\": 0.8,\n \"seed\": 42,\n \"topK\": 40,\n \"topP\": 0.95,\n \"greedy\": false\n}\n */\n property?: {\n /* Load model context when generator is initialized */\n init?: boolean | DataLink\n /* Model type */\n modelType?:\n | 'Llama 3 8B Chat'\n | 'Llama 3.1 8B Chat'\n | 'Llama 3.2 3B Chat'\n | 'Mistral 7B Instruct v0.3'\n | 'Qwen 2 7B Chat'\n | 'Phi 3.5 Mini'\n | 'Granite v3.1 8B Instruct'\n | 'Custom'\n | DataLink\n /* SOC model */\n socModel?: 'X Elite' | 'X Plus' | '8 Elite' | '8 Gen 3' | 'QCS8550' | DataLink\n /* Custom model base URL\n The model should be bundled, for details see https://github.com/mybigday/node-qnn-llm?tab=readme-ov-file#bundled-file */\n customModelUrl?: string | DataLink\n /* Custom model MD5 */\n customModelMd5?: string | DataLink\n /* Chat format */\n chatFormat?:\n | 'Llama 2'\n | 'Llama 3'\n | 'Llama 3.x'\n | 'Mistral v0.3'\n | 'Qwen 2'\n | 'Custom'\n | DataLink\n /* Custom chat format template */\n customChatFormat?: string | DataLink\n /* Put tools in user message */\n toolsInUserMessage?: boolean | DataLink\n /* Prompt to generate */\n prompt?: string | DataLink\n /* Chat messages */\n messages?:\n | Array<\n | DataLink\n | {\n role?: string | DataLink\n content?: string | DataLink\n }\n >\n | DataLink\n /* Stop words */\n stopWords?: Array<string | DataLink> | DataLink\n /* Tool call parser */\n toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink\n /* Tools for chat mode using OpenAI-compatible function calling format\n Format: Array of objects with {type, function: {name, description, parameters}} structure \n See: https://platform.openai.com/docs/guides/function-calling */\n tools?: Array<{} | DataLink> | DataLink\n /* Tool choice for chat mode */\n toolChoice?: 'none' | 'auto' | 'required' | DataLink\n /* Enable parallel tool calls */\n parallelToolCalls?: boolean | DataLink\n /* Number of threads, -1 to use n-threads from model config */\n nThreads?: number | DataLink\n /* Temperature, -1 to use temperature from model config */\n temperature?: number | DataLink\n /* Seed, -1 to use seed from model config */\n seed?: number | DataLink\n /* Top K, -1 to use top-k from model config */\n topK?: number | DataLink\n /* Top P, -1 to use top-p from model config */\n topP?: number | DataLink\n /* Greedy, use greedy sampling */\n greedy?: boolean | DataLink\n }\n events?: {\n /* Event triggered when context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onContextStateChange']>\n >\n /* Event triggered when generate is done */\n onGenerate?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onGenerate']>>\n /* Event triggered on get function call request */\n onFunctionCall?: Array<\n EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onFunctionCall']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Generation result */\n result?: () => Data<string>\n /* Full context (Prompt + Generation Result) */\n fullContext?: () => Data<string>\n /* Last function call details */\n lastFunctionCall?: () => Data<{\n id?: string\n type?: string\n function?: {\n name?: string\n arguments?: string\n [key: string]: any\n }\n [key: string]: any\n }>\n /* Completion details */\n completionDetails?: () => Data<{\n text?: string\n content?: string\n reasoning_content?: string\n tool_calls?: Array<{\n id?: string\n type?: string\n function?: {\n name?: string\n arguments?: string\n [key: string]: any\n }\n [key: string]: any\n }>\n [key: string]: any\n }>\n }\n}\n\n/* Local LLM inference using Qualcomm AI Engine */\nexport type GeneratorQnnLlm = Generator &\n GeneratorQnnLlmDef & {\n templateKey: 'GENERATOR_QNN_LLM'\n switches?: Array<\n SwitchDef &\n GeneratorQnnLlmDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'result'\n | 'fullContext'\n | 'lastFunctionCall'\n | 'completionDetails'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Mcp.d.ts":"/* Auto generated by build script\n *\n * MCP client connecting to tool servers via Streamable HTTP, SSE, or direct-link to in-app MCP Server generator. Provides tools, resources, and prompts for Assistant\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Connect to MCP server */\nexport type GeneratorMCPActionConnect = Action & {\n __actionName: 'GENERATOR_MCP_CONNECT'\n}\n\n/* Disconnect from MCP server */\nexport type GeneratorMCPActionDisconnect = Action & {\n __actionName: 'GENERATOR_MCP_DISCONNECT'\n}\n\n/* List resources */\nexport type GeneratorMCPActionListResources = ActionWithParams & {\n __actionName: 'GENERATOR_MCP_LIST_RESOURCES'\n params?: Array<{\n input: 'requestId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* List resource templates */\nexport type GeneratorMCPActionListResourceTemplates = ActionWithParams & {\n __actionName: 'GENERATOR_MCP_LIST_RESOURCE_TEMPLATES'\n params?: Array<{\n input: 'requestId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Read resource */\nexport type GeneratorMCPActionReadResource = ActionWithParams & {\n __actionName: 'GENERATOR_MCP_READ_RESOURCE'\n params?: Array<\n | {\n input: 'requestId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'uri'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'variables'\n value?: { [key: string]: any } | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* List tools */\nexport type GeneratorMCPActionListTools = ActionWithParams & {\n __actionName: 'GENERATOR_MCP_LIST_TOOLS'\n params?: Array<{\n input: 'requestId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Call tool */\nexport type GeneratorMCPActionCallTool = ActionWithParams & {\n __actionName: 'GENERATOR_MCP_CALL_TOOL'\n params?: Array<\n | {\n input: 'requestId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'variables'\n value?: { [key: string]: any } | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* List prompts */\nexport type GeneratorMCPActionListPrompts = ActionWithParams & {\n __actionName: 'GENERATOR_MCP_LIST_PROMPTS'\n params?: Array<{\n input: 'requestId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Request prompt */\nexport type GeneratorMCPActionGetPrompt = ActionWithParams & {\n __actionName: 'GENERATOR_MCP_GET_PROMPT'\n params?: Array<\n | {\n input: 'requestId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'variables'\n value?: { [key: string]: any } | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface GeneratorMCPDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"type\": \"streamable-http\",\n \"url\": \"\",\n \"autoReconnect\": true,\n \"maxReconnectAttempts\": 10,\n \"reconnectInterval\": 1000,\n \"generatorId\": \"\",\n \"generatorKey\": \"\",\n \"name\": \"bricks-foundation-mcp-client-default\",\n \"version\": \"1.0.0\",\n \"ignoreResourceInList\": [],\n \"ignoreToolInList\": [],\n \"ignorePromptInList\": [],\n \"requestTimeout\": 60000\n}\n */\n property?: {\n /* Application-scoped generator key, key cannot be the same with other application-scoped generators */\n globalGeneratorKey?: string | DataLink\n /* Initialize the MCP client on start */\n init?: boolean | DataLink\n /* Type of the MCP connection, e.g. sse or direct-link (generator) */\n type?: 'streamable-http' | 'sse' | 'direct-link' | DataLink\n /* URL of the MCP server, e.g. http://localhost:19853/sse */\n url?: string | DataLink\n /* Whether to automatically reconnect to the MCP server */\n autoReconnect?: boolean | DataLink\n /* Maximum number of reconnection attempts */\n maxReconnectAttempts?: number | DataLink\n /* Reconnection interval in milliseconds */\n reconnectInterval?: number | DataLink\n /* SSE connection headers */\n sseHeaders?: {} | DataLink\n /* Send request headers */\n sendHeaders?: {} | DataLink\n /* Bearer token for authentication */\n bearerToken?: string | DataLink\n /* Generator MCP Server ID for direct link */\n generatorId?: string | DataLink | (() => Generator)\n /* Application-scoped key of Generator MCP Server for direct link (If ID is not provided) */\n generatorKey?: string | DataLink\n /* Name of the MCP client */\n name?: string | DataLink\n /* Version of the MCP client */\n version?: string | DataLink\n /* Ignore resources in list response */\n ignoreResourceInList?: Array<string | DataLink> | DataLink\n /* Ignore tools in list response */\n ignoreToolInList?: Array<string | DataLink> | DataLink\n /* Ignore prompts in list response */\n ignorePromptInList?: Array<string | DataLink> | DataLink\n /* Request timeout in milliseconds */\n requestTimeout?: number | DataLink\n }\n events?: {\n /* On connected */\n onConnected?: Array<EventAction>\n /* On connection error */\n onConnectionError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onConnectionError']>\n >\n /* On disconnected */\n onDisconnected?: Array<EventAction>\n /* On list resources */\n onListResources?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResources']>\n >\n /* On list resources error */\n onListResourcesError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourcesError']>\n >\n /* On list resource templates */\n onListResourceTemplates?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourceTemplates']>\n >\n /* On list resource templates error */\n onListResourceTemplatesError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourceTemplatesError']>\n >\n /* On read resource */\n onReadResource?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onReadResource']>\n >\n /* On read resource error */\n onReadResourceError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onReadResourceError']>\n >\n /* On list tools */\n onListTools?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListTools']>>\n /* On list tools error */\n onListToolsError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListToolsError']>\n >\n /* On call tool */\n onCallTool?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onCallTool']>>\n /* On call tool error */\n onCallToolError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onCallToolError']>\n >\n /* On list prompts */\n onListPrompts?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListPrompts']>>\n /* On list prompts error */\n onListPromptsError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListPromptsError']>\n >\n /* On get prompt */\n onGetPrompt?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onGetPrompt']>>\n /* On get prompt error */\n onGetPromptError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Mcp']['onGetPromptError']>\n >\n }\n outlets?: {\n /* Connection state */\n connectionState?: () => Data<string>\n /* List resources response */\n listResourcesResponse?: () => Data<{\n id?: string\n response?: {\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n resourceTemplates?: Array<{\n name?: string\n [key: string]: any\n }>\n contents?: Array<{\n uri?: string\n text?: string\n blob?: string\n mimeType?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n description?: string\n inputSchema?: { [key: string]: any }\n [key: string]: any\n }>\n content?: Array<{\n type?: string\n text?: string\n [key: string]: any\n }>\n prompts?: Array<{\n name?: string\n [key: string]: any\n }>\n messages?: Array<{\n role?: string\n content?: any\n [key: string]: any\n }>\n [key: string]: any\n }\n [key: string]: any\n }>\n /* List resources error */\n listResourcesError?: () => Data<{\n id?: string\n error?: string\n [key: string]: any\n }>\n /* List resource templates response */\n listResourceTemplatesResponse?: () => Data<{\n id?: string\n response?: {\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n resourceTemplates?: Array<{\n name?: string\n [key: string]: any\n }>\n contents?: Array<{\n uri?: string\n text?: string\n blob?: string\n mimeType?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n description?: string\n inputSchema?: { [key: string]: any }\n [key: string]: any\n }>\n content?: Array<{\n type?: string\n text?: string\n [key: string]: any\n }>\n prompts?: Array<{\n name?: string\n [key: string]: any\n }>\n messages?: Array<{\n role?: string\n content?: any\n [key: string]: any\n }>\n [key: string]: any\n }\n [key: string]: any\n }>\n /* List resource templates error */\n listResourceTemplatesError?: () => Data<{\n id?: string\n error?: string\n [key: string]: any\n }>\n /* Read resource response */\n readResourceResponse?: () => Data<{\n id?: string\n response?: {\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n resourceTemplates?: Array<{\n name?: string\n [key: string]: any\n }>\n contents?: Array<{\n uri?: string\n text?: string\n blob?: string\n mimeType?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n description?: string\n inputSchema?: { [key: string]: any }\n [key: string]: any\n }>\n content?: Array<{\n type?: string\n text?: string\n [key: string]: any\n }>\n prompts?: Array<{\n name?: string\n [key: string]: any\n }>\n messages?: Array<{\n role?: string\n content?: any\n [key: string]: any\n }>\n [key: string]: any\n }\n [key: string]: any\n }>\n /* Read resource error */\n readResourceError?: () => Data<{\n id?: string\n error?: string\n [key: string]: any\n }>\n /* List tools response */\n listToolsResponse?: () => Data<{\n id?: string\n response?: {\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n resourceTemplates?: Array<{\n name?: string\n [key: string]: any\n }>\n contents?: Array<{\n uri?: string\n text?: string\n blob?: string\n mimeType?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n description?: string\n inputSchema?: { [key: string]: any }\n [key: string]: any\n }>\n content?: Array<{\n type?: string\n text?: string\n [key: string]: any\n }>\n prompts?: Array<{\n name?: string\n [key: string]: any\n }>\n messages?: Array<{\n role?: string\n content?: any\n [key: string]: any\n }>\n [key: string]: any\n }\n [key: string]: any\n }>\n /* List tools error */\n listToolsError?: () => Data<{\n id?: string\n error?: string\n [key: string]: any\n }>\n /* Call tool response */\n callToolResponse?: () => Data<{\n id?: string\n response?: {\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n resourceTemplates?: Array<{\n name?: string\n [key: string]: any\n }>\n contents?: Array<{\n uri?: string\n text?: string\n blob?: string\n mimeType?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n description?: string\n inputSchema?: { [key: string]: any }\n [key: string]: any\n }>\n content?: Array<{\n type?: string\n text?: string\n [key: string]: any\n }>\n prompts?: Array<{\n name?: string\n [key: string]: any\n }>\n messages?: Array<{\n role?: string\n content?: any\n [key: string]: any\n }>\n [key: string]: any\n }\n [key: string]: any\n }>\n /* Call tool error */\n callToolError?: () => Data<{\n id?: string\n error?: string\n [key: string]: any\n }>\n /* List prompts response */\n listPromptsResponse?: () => Data<{\n id?: string\n response?: {\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n resourceTemplates?: Array<{\n name?: string\n [key: string]: any\n }>\n contents?: Array<{\n uri?: string\n text?: string\n blob?: string\n mimeType?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n description?: string\n inputSchema?: { [key: string]: any }\n [key: string]: any\n }>\n content?: Array<{\n type?: string\n text?: string\n [key: string]: any\n }>\n prompts?: Array<{\n name?: string\n [key: string]: any\n }>\n messages?: Array<{\n role?: string\n content?: any\n [key: string]: any\n }>\n [key: string]: any\n }\n [key: string]: any\n }>\n /* List prompts error */\n listPromptsError?: () => Data<{\n id?: string\n error?: string\n [key: string]: any\n }>\n /* Get prompt response */\n getPromptResponse?: () => Data<{\n id?: string\n response?: {\n resources?: Array<{\n name?: string\n [key: string]: any\n }>\n resourceTemplates?: Array<{\n name?: string\n [key: string]: any\n }>\n contents?: Array<{\n uri?: string\n text?: string\n blob?: string\n mimeType?: string\n [key: string]: any\n }>\n tools?: Array<{\n name?: string\n description?: string\n inputSchema?: { [key: string]: any }\n [key: string]: any\n }>\n content?: Array<{\n type?: string\n text?: string\n [key: string]: any\n }>\n prompts?: Array<{\n name?: string\n [key: string]: any\n }>\n messages?: Array<{\n role?: string\n content?: any\n [key: string]: any\n }>\n [key: string]: any\n }\n [key: string]: any\n }>\n /* Request prompt error */\n getPromptError?: () => Data<{\n id?: string\n error?: string\n [key: string]: any\n }>\n /* Last error */\n lastError?: () => Data<string>\n }\n}\n\n/* MCP client connecting to tool servers via Streamable HTTP, SSE, or direct-link to in-app MCP Server generator. Provides tools, resources, and prompts for Assistant */\nexport type GeneratorMCP = Generator &\n GeneratorMCPDef & {\n templateKey: 'GENERATOR_MCP'\n switches?: Array<\n SwitchDef &\n GeneratorMCPDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'connectionState'\n | 'listResourcesResponse'\n | 'listResourcesError'\n | 'listResourceTemplatesResponse'\n | 'listResourceTemplatesError'\n | 'readResourceResponse'\n | 'readResourceError'\n | 'listToolsResponse'\n | 'listToolsError'\n | 'callToolResponse'\n | 'callToolError'\n | 'listPromptsResponse'\n | 'listPromptsError'\n | 'getPromptResponse'\n | 'getPromptError'\n | 'lastError'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/McpServer.d.ts":"/* Auto generated by build script\n *\n * MCP server exposing tools, resources (static/detect-data-change/script), and prompts. Supports HTTP listening with Bearer auth or direct-link from in-app MCP client\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Refresh tools and resources, used for case if tools or resources are changed. Note that the current connections will be closed. */\nexport type GeneratorMCPServerActionRefreshResources = Action & {\n __actionName: 'GENERATOR_MCP_SERVER_REFRESH_RESOURCES'\n}\n\ninterface GeneratorMCPServerDef {\n /*\nDefault property:\n{\n \"enabled\": true,\n \"listening\": true,\n \"authType\": \"none\",\n \"name\": \"bricks-foundation-mcp-server-default\",\n \"version\": \"1.0.0\",\n \"resources\": [],\n \"tools\": [],\n \"prompts\": []\n}\n */\n property?: {\n /* Enable MCP server. If enabled and Listening is false, the generator can still provide application-scoped resources. */\n enabled?: boolean | DataLink\n /* Application-scoped generator key, key cannot be the same with other application-scoped generators */\n globalGeneratorKey?: string | DataLink\n /* Start MCP server */\n listening?: boolean | DataLink\n /* HTTP server port */\n port?: number | DataLink\n /* Authorization type of HTTP request */\n authType?: 'none' | 'bearer' | DataLink\n /* Token of bearer auth */\n bearerToken?: string | DataLink\n /* Name of the MCP server */\n name?: string | DataLink\n /* Version of the MCP server */\n version?: string | DataLink\n /* Resources\n Type: \n `static`: Return static data \n `detect-data-change`: Watch data target change to return data, \n please update data with ({ id: string, content: string | object }), \n and ensure the id is same with request id \n `script`: Run a JavaScript code to return data \n - Script can define members to call generator functions \n - Script support async/await */\n resources?:\n | Array<\n | DataLink\n | {\n enabled?: boolean | DataLink\n name?: string | DataLink\n description?: string | DataLink\n uriOrTemplate?: string | DataLink\n type?: 'static' | 'detect-data-change' | 'script' | DataLink\n staticData?: any\n dataChangeConfig?:\n | DataLink\n | {\n target?: string | DataLink | (() => Data)\n timeout?: number | DataLink\n additionalParams?: {} | DataLink\n }\n scriptConfig?:\n | DataLink\n | {\n code?: string | DataLink\n timeout?: number | DataLink\n members?:\n | Array<\n | DataLink\n | {\n handler?: string | DataLink | (() => Generator)\n varName?: string | DataLink\n }\n >\n | DataLink\n additionalParams?: {} | DataLink\n }\n responseType?: 'text' | 'object' | DataLink\n }\n >\n | DataLink\n /* Tools\n Type: \n `static`: Return static data \n `detect-data-change`: Watch data target change to return data, \n please update data with ({ id: string, content: string | object }), \n and ensure the id is same with request id. \n `script`: Run a JavaScript code to return data \n - Script can define members to call generator functions \n - Script support async/await */\n tools?:\n | Array<\n | DataLink\n | {\n enabled?: boolean | DataLink\n name?: string | DataLink\n description?: string | DataLink\n params?: {} | DataLink\n type?: 'static' | 'detect-data-change' | 'script' | DataLink\n staticData?: any\n dataChangeConfig?:\n | DataLink\n | {\n target?: string | DataLink | (() => Data)\n timeout?: number | DataLink\n additionalParams?: {} | DataLink\n }\n scriptConfig?:\n | DataLink\n | {\n code?: string | DataLink\n timeout?: number | DataLink\n members?:\n | Array<\n | DataLink\n | {\n handler?: string | DataLink | (() => Generator)\n varName?: string | DataLink\n }\n >\n | DataLink\n additionalParams?: {} | DataLink\n }\n responseType?: 'text' | 'object' | DataLink\n }\n >\n | DataLink\n /* Prompts\n Type: \n `static`: Return static data \n `detect-data-change`: Watch data target change to return data, \n please update data with ({ id: string, content: string | object }), \n and ensure the id is same with request id \n `script`: Run a JavaScript code to return data \n - Script can define members to call generator functions \n - Script support async/await */\n prompts?:\n | Array<\n | DataLink\n | {\n enabled?: boolean | DataLink\n name?: string | DataLink\n description?: string | DataLink\n arguments?: {} | DataLink\n type?: 'static' | 'detect-data-change' | 'script' | DataLink\n staticData?: any\n dataChangeConfig?:\n | DataLink\n | {\n target?: string | DataLink | (() => Data)\n timeout?: number | DataLink\n additionalParams?: {} | DataLink\n }\n scriptConfig?:\n | DataLink\n | {\n code?: string | DataLink\n timeout?: number | DataLink\n members?:\n | Array<\n | DataLink\n | {\n handler?: string | DataLink | (() => Generator)\n varName?: string | DataLink\n }\n >\n | DataLink\n additionalParams?: {} | DataLink\n }\n responseType?: 'text' | 'object' | DataLink\n }\n >\n | DataLink\n }\n events?: {\n /* Listening of HTTP server */\n onListening?: Array<EventAction>\n /* Error of HTTP server */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['McpServer']['onError']>>\n /* Client error of HTTP server */\n onClientError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['McpServer']['onClientError']>\n >\n /* Client close of HTTP server */\n onClientClose?: Array<\n EventAction<string & keyof TemplateEventPropsMap['McpServer']['onClientClose']>\n >\n /* On request resource (Request: { name: string, uri: string, params: object }) */\n onRequestResource?: Array<\n EventAction<string & keyof TemplateEventPropsMap['McpServer']['onRequestResource']>\n >\n /* On call tool (Request: { name: string, params: object }) */\n onCallTool?: Array<EventAction<string & keyof TemplateEventPropsMap['McpServer']['onCallTool']>>\n /* On get prompt (Request: { name: string, arguments: object }) */\n onGetPrompt?: Array<\n EventAction<string & keyof TemplateEventPropsMap['McpServer']['onGetPrompt']>\n >\n }\n outlets?: {\n /* Whether the HTTP server is listening */\n isListening?: () => Data<boolean>\n /* Last error of HTTP server */\n lastError?: () => Data<string>\n /* MCP server endpoint URL */\n endpoint?: () => Data<string>\n /* Connected remotes (Session ID) */\n connectedRemotes?: () => Data<Array<string>>\n /* Last resource request ({ name: string, uri: string, params: object }) */\n lastResourceRequest?: () => Data<{\n type?: string\n id?: string\n name?: string\n uri?: string\n params?: { [key: string]: any }\n arguments?: { [key: string]: any }\n timeout?: number\n [key: string]: any\n }>\n /* Last tool call ({ name: string, params: object }) */\n lastToolCall?: () => Data<{\n type?: string\n id?: string\n name?: string\n uri?: string\n params?: { [key: string]: any }\n arguments?: { [key: string]: any }\n timeout?: number\n [key: string]: any\n }>\n /* Last prompt get ({ name: string, arguments: object }) */\n lastPromptGet?: () => Data<{\n type?: string\n id?: string\n name?: string\n uri?: string\n params?: { [key: string]: any }\n arguments?: { [key: string]: any }\n timeout?: number\n [key: string]: any\n }>\n }\n}\n\n/* MCP server exposing tools, resources (static/detect-data-change/script), and prompts. Supports HTTP listening with Bearer auth or direct-link from in-app MCP client */\nexport type GeneratorMCPServer = Generator &\n GeneratorMCPServerDef & {\n templateKey: 'GENERATOR_MCP_SERVER'\n switches?: Array<\n SwitchDef &\n GeneratorMCPServerDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'isListening'\n | 'lastError'\n | 'endpoint'\n | 'connectedRemotes'\n | 'lastResourceRequest'\n | 'lastToolCall'\n | 'lastPromptGet'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/MediaFlow.d.ts":"/* Auto generated by build script\n *\n * Fetch box's file list from Media Flow\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start fetcn Media box file list */\nexport type GeneratorMediaFlowActionFetch = Action & {\n __actionName: 'GENERATOR_MEDIA_FLOW_FETCH'\n}\n\n/* Reset cache */\nexport type GeneratorMediaFlowActionResetCache = Action & {\n __actionName: 'GENERATOR_MEDIA_FLOW_RESET_CACHE'\n}\n\n/* Abort current fetch request of media list */\nexport type GeneratorMediaFlowActionAbortFetch = Action & {\n __actionName: 'GENERATOR_MEDIA_FLOW_ABORT_FETCH'\n}\n\ninterface GeneratorMediaFlowDef {\n /*\nDefault property:\n{\n \"includeTypes\": [\n \"IMAGE\",\n \"VIDEO\",\n \"AUDIO\",\n \"FILE\"\n ],\n \"fetchPolicy\": \"cache-first\",\n \"subscribeBoxChange\": false,\n \"saveToStorageDownloadMode\": \"sequence\",\n \"loadSizeLimit\": \"\",\n \"allowLoadSizeLimitExceed\": true,\n \"source\": \"original\",\n \"sourceVersionAlternatives\": []\n}\n */\n property?: {\n /* The box id of Media Flow */\n boxId?: string | DataLink\n /* Authorize accessToken, use `passcode` if `accessToken` is empty */\n accessToken?: string | DataLink\n /* Authorize passcode */\n passcode?: string | DataLink\n /* Include File Types */\n includeTypes?: Array<'IMAGE' | 'VIDEO' | 'AUDIO' | 'FILE' | DataLink> | DataLink\n /* Determine the cache behavior\n \n cache-first: Cache first if existing, then fetch from network \n network-and-cache: Fetch from network, then save cache \n network-only: Fetch from network only */\n fetchPolicy?: 'cache-first' | 'network-and-cache' | 'network-only' | DataLink\n /* Subscribe box change to refresh file list (file deleted / new file uploaded) */\n subscribeBoxChange?: boolean | DataLink\n /* Save files into local file storage */\n saveToStorage?: boolean | DataLink\n /* Concurrent download files or sequence for saveToStorage */\n saveToStorageDownloadMode?: 'sequence' | 'concurrent' | DataLink\n /* Limit the load size (* GB, * MB, * KB) */\n loadSizeLimit?: string | DataLink\n /* Allow Load size limit exceed, just call event */\n allowLoadSizeLimitExceed?: boolean | DataLink\n /* Select download source */\n source?:\n | 'original'\n | 'auto'\n | 'converted'\n | 'video-thumbnail-original'\n | 'use-source-versions'\n | DataLink\n /* Select download source with image version (use width, e.g. [250, 360]) */\n sourceVersionAlternatives?: Array<number | DataLink> | DataLink\n /* Allowlist patterns to filter media files (supports regex or plain text) */\n allowlist?: Array<string | DataLink> | DataLink\n /* Blocklist patterns to filter media files (supports regex or plain text) */\n blocklist?: Array<string | DataLink> | DataLink\n }\n events?: {\n /* Event of media box fetch error */\n fetchError?: Array<EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['fetchError']>>\n /* Event of subscribe box change connected (If set `Subscribe Box Change`) */\n subscribeBoxConnect?: Array<EventAction>\n /* Event of subscribe box change error (If set `Subscribe Box Change`) */\n subscribeBoxError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['subscribeBoxError']>\n >\n /* Event of subscribe box change connection error (If set `Subscribe Box Change`) */\n subscribeBoxConnectError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['subscribeBoxConnectError']>\n >\n /* Event of file sync completed for used `saveToStorage` */\n saveStorageCompleted?: Array<EventAction>\n /* Event when file list size exceed of Load size limit */\n fileSizeExceed?: Array<EventAction>\n }\n outlets?: {\n /* File sync status */\n downloadStatus?: () => Data<string>\n /* File sync progress */\n downloadProgress?: () => Data<\n Array<{\n key?: string\n progress?: number\n finished?: boolean\n [key: string]: any\n }>\n >\n /* File sync download errors */\n downloadErrors?: () => Data<Array<string>>\n /* Media box info */\n box?: () => Data<{ [key: string]: any }>\n /* Save Media Flow fetch result [ { \"url\": \"https://d1kk0369g9vrck.cloudfront.net/box/5b431e29efd40c01e8b2019c/photo5b431e37efd40c01e8b201d1\" \"extension\": \"\", // enum(\"jpg\", \"png\", \"mp4\") \"id\": \"5b431e37efd40c01e8b201d1\", \"md5\": \"6134ab412351651324\" // md5 came from media resource api } ] */\n result?: () => Data<\n Array<{\n id?: string\n key?: string\n mediaType?: string\n extension?: string\n original?: string\n url?: string\n metadata?: { [key: string]: any }\n [key: string]: any\n }>\n >\n /* File sync result [ { \"url\": \"/storage/emulated/0/Download/SyncFolder/Asset/1.png\", \"mediaType\": \"photo\" // enum(\"photo\", \"video\"), used to distingiush \"id\": \"\", } ] */\n downloadFileUrls?: () => Data<Array<string>>\n }\n}\n\n/* Fetch box's file list from Media Flow */\nexport type GeneratorMediaFlow = Generator &\n GeneratorMediaFlowDef & {\n templateKey: 'GENERATOR_MEDIA_FLOW'\n switches?: Array<\n SwitchDef &\n GeneratorMediaFlowDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'downloadStatus'\n | 'downloadProgress'\n | 'downloadErrors'\n | 'box'\n | 'result'\n | 'downloadFileUrls'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/MqttBroker.d.ts":"/* Auto generated by build script\n *\n * Embedded MQTT broker server with client authentication, publish/subscribe messaging, keepalive, and retry support\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start MQTT broker server */\nexport type GeneratorMQTTBrokerActionStart = Action & {\n __actionName: 'GENERATOR_MQTT_BROKER_START'\n}\n\n/* Publish message to topic */\nexport type GeneratorMQTTBrokerActionPublish = ActionWithParams & {\n __actionName: 'GENERATOR_MQTT_BROKER_PUBLISH'\n params?: Array<\n | {\n input: 'topic'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'messageId'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop MQTT broker server */\nexport type GeneratorMQTTBrokerActionStop = Action & {\n __actionName: 'GENERATOR_MQTT_BROKER_STOP'\n}\n\ninterface GeneratorMQTTBrokerDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"port\": 1883,\n \"retryInterval\": 5,\n \"keepalive\": 60,\n \"authenticate\": false\n}\n */\n property?: {\n /* Start MQTT broker on generator initialized */\n init?: boolean | DataLink\n /* Bind port of MQTT server */\n port?: number | DataLink\n /* Retry interval when publish failed */\n retryInterval?: number | DataLink\n /* Keep-alive interval */\n keepalive?: number | DataLink\n /* Enable authentication */\n authenticate?: boolean | DataLink\n /* Authentication table */\n authTable?:\n | Array<\n | DataLink\n | {\n username?: string | DataLink\n password?: string | DataLink\n }\n >\n | DataLink\n }\n events?: {\n /* Event of MQTT server is ready */\n onReady?: Array<EventAction>\n /* Event of server or connection error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onError']>>\n /* Event of client connected */\n onClientConnected?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onClientConnected']>\n >\n /* Event of client disconnected */\n onClientDisconnected?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onClientDisconnected']>\n >\n /* Event of message received */\n onMessageReceived?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onMessageReceived']>\n >\n /* Event of message published */\n onMessagePublished?: Array<\n EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onMessagePublished']>\n >\n }\n outlets?: {\n /* Is server started */\n started?: () => Data<boolean>\n /* Last received message */\n lastMessage?: () => Data<{\n topic?: string\n payload?: any\n qos?: number\n retain?: boolean\n [key: string]: any\n }>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* Embedded MQTT broker server with client authentication, publish/subscribe messaging, keepalive, and retry support */\nexport type GeneratorMQTTBroker = Generator &\n GeneratorMQTTBrokerDef & {\n templateKey: 'GENERATOR_MQTT_BROKER'\n switches?: Array<\n SwitchDef &\n GeneratorMQTTBrokerDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'started' | 'lastMessage' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/MqttClient.d.ts":"/* Auto generated by build script\n *\n * MQTT client with topic subscribe/publish, QoS levels (0/1/2), auto-reconnect, and auth support. Connects via mqtt:// or wss://\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Connect to MQTT broker */\nexport type GeneratorMQTTActionConnect = Action & {\n __actionName: 'GENERATOR_MQTT_CONNECT'\n}\n\n/* Disconnect from MQTT broker */\nexport type GeneratorMQTTActionDisconnect = Action & {\n __actionName: 'GENERATOR_MQTT_DISCONNECT'\n}\n\n/* Send message to MQTT broker */\nexport type GeneratorMQTTActionPublish = ActionWithParams & {\n __actionName: 'GENERATOR_MQTT_PUBLISH'\n params?: Array<\n | {\n input: 'topic'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'qos'\n value?: '0' | '1' | '2' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'retain'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface GeneratorMQTTDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"auth\": false,\n \"autoReconnect\": true,\n \"autoReconnectAttemptTime\": 1000,\n \"qos\": \"0\",\n \"messageType\": \"text\"\n}\n */\n property?: {\n /* Auto connect when generator start */\n init?: boolean | DataLink\n /* Broker endpoint (mqtt://) */\n uri?: string | DataLink\n /* Broker need auth or not, if set false will ignore username and password setting */\n auth?: boolean | DataLink\n /* Username */\n username?: string | DataLink\n /* Password */\n password?: string | DataLink\n /* Client ID */\n clientId?: string | DataLink\n /* Second */\n keepAlive?: number | DataLink\n /* If true, BRICKS will auto reconnect when connection lose */\n autoReconnect?: boolean | DataLink\n /* How many times BRICKS will try to reconnect */\n autoReconnectAttemptTime?: number | DataLink\n /* Topic name to subscribe */\n topic?: string | DataLink\n /* Setting the mode of quality of service mode */\n qos?: '0' | '1' | '2' | DataLink\n /* If set to text the outlet and event property will be string, if set to json will parse to object */\n messageType?: 'text' | 'json' | DataLink\n }\n events?: {\n /* When connected to MQTT broker */\n onConnected?: Array<EventAction>\n /* When disconnected from MQTT broker */\n onDisconnected?: Array<EventAction>\n /* When error occurred */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Mqtt']['onError']>>\n /* When received message from MQTT broker within subscribe topic */\n onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['Mqtt']['onMessage']>>\n }\n outlets?: {\n /* Connected or not */\n connected?: () => Data<boolean>\n /* Error Message */\n error?: () => Data<string>\n /* The receive message */\n message?: () => Data<{\n topic?: string\n payload?: any\n qos?: number\n retain?: boolean\n [key: string]: any\n }>\n /* The receive message (payload only) */\n messagePayload?: () => Data<any>\n }\n}\n\n/* MQTT client with topic subscribe/publish, QoS levels (0/1/2), auto-reconnect, and auth support. Connects via mqtt:// or wss:// */\nexport type GeneratorMQTT = Generator &\n GeneratorMQTTDef & {\n templateKey: 'GENERATOR_MQTT'\n switches?: Array<\n SwitchDef &\n GeneratorMQTTDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'connected' | 'error' | 'message' | 'messagePayload'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Question.d.ts":"/* Auto generated by build script\n *\n * Prompt user for input via dialog and return the response\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start inquire */\nexport type GeneratorQuestionActionStart = Action & {\n __actionName: 'GENERATOR_QUESTION_START'\n}\n\n/* Stop inquire */\nexport type GeneratorQuestionActionStop = Action & {\n __actionName: 'GENERATOR_QUESTION_STOP'\n}\n\n/* Pause inquire */\nexport type GeneratorQuestionActionPause = Action & {\n __actionName: 'GENERATOR_QUESTION_PAUSE'\n}\n\ninterface GeneratorQuestionDef {\n /*\nDefault property:\n{\n \"modalMode\": \"root\",\n \"showClose\": true,\n \"showBack\": true,\n \"cameraType\": \"back\",\n \"cameraPosition\": \"top\",\n \"selectColumns\": 3,\n \"selectAutoColumns\": true,\n \"sizeFactor\": 1,\n \"containerBackgroundColor\": \"#ffffff\",\n \"titleColor\": \"#000000\",\n \"descriptionColor\": \"#2e2e2e\",\n \"fieldBackgroundColor\": \"#E2E2E2\",\n \"fieldTextColor\": \"#1e1e1e\",\n \"fieldPlaceholderColor\": \"#333333\",\n \"fieldActiveBackgroundColor\": \"#FDCB8F\",\n \"fieldActiveTextColor\": \"#7D7D7D\",\n \"fieldControlColor\": \"#f08400\",\n \"primaryControlBtnBackgroundColor\": \"#1e1e1e\",\n \"primaryControlBtnTextColor\": \"#ffffff\",\n \"primaryControlBtnBorderColor\": \"#1e1e1e\",\n \"secondaryControlBtnBackgroundColor\": \"#ffffff\",\n \"secondaryControlBtnTextColor\": \"#1e1e1e\",\n \"secondaryControlBtnBorderColor\": \"#1e1e1e\",\n \"warnColor\": \"#ff4f00\",\n \"errorColor\": \"#ff0000\"\n}\n */\n property?: {\n /* Modal mode */\n modalMode?: 'root' | 'in-subspace' | DataLink\n /* Inquirer schema\n `key`: Field key (unique, required) \n `kind`: Field type (required) \n `title`: Field or message title \n `description`: Field or message description \n `required`: Whether the field is required \n `defaultValue`: Default value of the field \n `[kind]Options`: Field configuration \n `condition`: Condition to show field */\n schema?:\n | Array<\n | DataLink\n | {\n key?: string | DataLink\n title?: string | DataLink\n description?: string | DataLink\n kind?:\n | 'language'\n | 'number'\n | 'numeric-string'\n | 'text'\n | 'phone'\n | 'email'\n | 'color'\n | 'uri'\n | 'select'\n | 'multi-select'\n | 'yesno'\n | 'qty-list'\n | 'cart'\n | 'preference'\n | 'voice-record'\n | 'video-record'\n | 'code-scan'\n | 'message'\n | DataLink\n required?: boolean | DataLink\n defaultValue?:\n | string\n | DataLink\n | number\n | DataLink\n | boolean\n | DataLink\n | Array<string | DataLink>\n | DataLink\n | DataLink\n languageOptions?:\n | DataLink\n | {\n availableLangs?: Array<string | DataLink> | DataLink\n }\n numberOptions?:\n | DataLink\n | {\n min?: number | DataLink\n max?: number | DataLink\n step?: number | DataLink\n }\n textOptions?:\n | DataLink\n | {\n placeholder?: string | DataLink\n }\n phoneOptions?:\n | DataLink\n | {\n placeholder?: string | DataLink\n usePhysicalKeyboard?: boolean | DataLink\n }\n emailOptions?:\n | DataLink\n | {\n placeholder?: string | DataLink\n }\n uriOptions?:\n | DataLink\n | {\n placeholder?: string | DataLink\n }\n selectOptions?:\n | DataLink\n | {\n withConfirmButton?: boolean | DataLink\n options?:\n | Array<\n | DataLink\n | {\n value?: string | DataLink\n image_uri?: string | DataLink\n label?: string | DataLink\n icon?: string | DataLink\n }\n >\n | DataLink\n }\n multiSelectOptions?:\n | DataLink\n | {\n options?:\n | Array<\n | DataLink\n | {\n value?: string | DataLink\n image_uri?: string | DataLink\n label?: string | DataLink\n icon?: string | DataLink\n }\n >\n | DataLink\n minimum?: number | DataLink\n maximum?: number | DataLink\n }\n yesnoOptions?:\n | DataLink\n | {\n imageUri?: string | DataLink\n withConfirmButton?: boolean | DataLink\n yesBtnText?: string | DataLink\n noBtnText?: string | DataLink\n }\n qtyListOptions?:\n | DataLink\n | {\n items?:\n | Array<\n | DataLink\n | {\n id?: string | DataLink\n title?: string | DataLink\n description?: string | DataLink\n imageUri?: string | DataLink\n price?: number | DataLink\n }\n >\n | DataLink\n }\n cartOptions?:\n | DataLink\n | {\n items?:\n | Array<\n | DataLink\n | {\n id?: string | DataLink\n title?: string | DataLink\n description?: string | DataLink\n imageUri?: string | DataLink\n price?: number | DataLink\n qty?: number | DataLink\n }\n >\n | DataLink\n }\n preferenceOptions?:\n | DataLink\n | {\n settings?:\n | Array<\n | DataLink\n | {\n key?: string | DataLink\n title?: string | DataLink\n options?:\n | Array<\n | DataLink\n | {\n label?: string | DataLink\n value?: string | DataLink\n }\n >\n | DataLink\n multiple?: boolean | DataLink\n required?: boolean | DataLink\n maximum?: number | DataLink\n minimum?: number | DataLink\n }\n >\n | DataLink\n }\n voiceRecordOptions?:\n | DataLink\n | {\n sampleRate?: number | DataLink\n bitDepth?: '8bit' | '16bit' | DataLink\n channels?: 'mono' | 'stereo' | DataLink\n maxDuration?: number | DataLink\n }\n videoRecordOptions?:\n | DataLink\n | {\n manuallyStart?: boolean | DataLink\n recordDuration?: number | DataLink\n }\n codeScanOptions?:\n | DataLink\n | {\n inputSource?: 'camera' | 'hid-barcode-scanner' | DataLink\n hidFlushMode?: 'enter-key' | 'timeout' | DataLink\n hidFlushTimeout?: number | DataLink\n }\n messageOptions?:\n | DataLink\n | {\n symbol?: 'success' | DataLink\n duration?: number | DataLink\n }\n condition?:\n | DataLink\n | {\n key?: string | DataLink\n operator?:\n | 'eq'\n | 'neq'\n | 'contains'\n | 'notContains'\n | 'isTrue'\n | 'isFalse'\n | DataLink\n value?: string | DataLink\n }\n }\n >\n | DataLink\n /* Display language (RFC 3066) */\n displayLang?: string | DataLink\n /* Banner image */\n bannerImage?: string | DataLink\n /* Banner image md5 */\n bannerImageMd5?: string | DataLink\n /* Show AI transcribe tip on the bottom of the modal */\n aiTranscribeTip?: boolean | DataLink\n /* Show close button */\n showClose?: boolean | DataLink\n /* Show back button */\n showBack?: boolean | DataLink\n /* Camera type */\n cameraType?: 'front' | 'back' | DataLink\n /* Camera position */\n cameraPosition?: 'top' | 'left' | 'bottom' | 'right' | DataLink\n /* \"Next\" button text */\n nextButtonText?: string | DataLink\n /* \"Skip\" button text */\n skipButtonText?: string | DataLink\n /* \"Done\" button text */\n doneButtonText?: string | DataLink\n /* Select columns */\n selectColumns?: number | DataLink\n /* Select auto calculate columns */\n selectAutoColumns?: boolean | DataLink\n /* Fixed model width, default is auto */\n fixedModelWidth?: number | DataLink\n /* Fixed model height, default is auto */\n fixedModelHeight?: number | DataLink\n /* Size factor */\n sizeFactor?: number | DataLink\n /* Background color */\n backgroundColor?: string | DataLink\n /* Container background color */\n containerBackgroundColor?: string | DataLink\n /* Title color */\n titleColor?: string | DataLink\n /* Description color */\n descriptionColor?: string | DataLink\n /* Input field background color */\n fieldBackgroundColor?: string | DataLink\n /* Input field text color */\n fieldTextColor?: string | DataLink\n /* Input field placeholder color */\n fieldPlaceholderColor?: string | DataLink\n /* Selected option background color */\n fieldActiveBackgroundColor?: string | DataLink\n /* Selected option text color */\n fieldActiveTextColor?: string | DataLink\n /* Field control button color */\n fieldControlColor?: string | DataLink\n /* Primary control button background color */\n primaryControlBtnBackgroundColor?: string | DataLink\n /* Primary control button text color */\n primaryControlBtnTextColor?: string | DataLink\n /* Primary control button border color */\n primaryControlBtnBorderColor?: string | DataLink\n /* Secondary control button background color */\n secondaryControlBtnBackgroundColor?: string | DataLink\n /* Secondary control button text color */\n secondaryControlBtnTextColor?: string | DataLink\n /* Secondary control button border color */\n secondaryControlBtnBorderColor?: string | DataLink\n /* Warn color */\n warnColor?: string | DataLink\n /* Error color */\n errorColor?: string | DataLink\n }\n events?: {\n /* Event of go next */\n onNextQuestion?: Array<EventAction>\n /* Event of go back */\n onBackQuestion?: Array<EventAction>\n /* Event of change question */\n onQuestionChange?: Array<EventAction>\n /* Event of user close question modal */\n onClose?: Array<EventAction>\n /* Event of warning showed */\n onWarning?: Array<EventAction>\n /* Event of completed inquire */\n onCompleted?: Array<EventAction>\n /* Event of error occured */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Question']['onError']>>\n }\n outlets?: {\n /* Result data */\n data?: () => Data<{ [key: string]: any }>\n /* Currnet question */\n currectKey?: () => Data<string>\n /* Currnet input value */\n currectValue?: () => Data<any>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* Prompt user for input via dialog and return the response */\nexport type GeneratorQuestion = Generator &\n GeneratorQuestionDef & {\n templateKey: 'GENERATOR_QUESTION'\n switches?: Array<\n SwitchDef &\n GeneratorQuestionDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'data' | 'currectKey' | 'currectValue' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/RealtimeTranscription.d.ts":"/* Auto generated by build script\n *\n * Realtime speech-to-text transcription using Whisper and VAD with live audio streaming\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start realtime transcription */\nexport type GeneratorRealtimeTranscriptionActionStart = Action & {\n __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_START'\n}\n\n/* Stop realtime transcription */\nexport type GeneratorRealtimeTranscriptionActionStop = Action & {\n __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_STOP'\n}\n\n/* Force move to next slice */\nexport type GeneratorRealtimeTranscriptionActionNextSlice = Action & {\n __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_NEXT_SLICE'\n}\n\n/* Reset transcriber state */\nexport type GeneratorRealtimeTranscriptionActionReset = Action & {\n __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_RESET'\n}\n\n/* List available microphone devices (Web / Desktop only) */\nexport type GeneratorRealtimeTranscriptionActionListDevices = Action & {\n __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_LIST_DEVICES'\n}\n\ninterface GeneratorRealtimeTranscriptionDef {\n /*\nDefault property:\n{\n \"sttLivePolicy\": \"only-in-use\",\n \"vadInferenceLivePolicy\": \"only-in-use\",\n \"vadEnabled\": true,\n \"audioSliceSec\": 30,\n \"audioMinSec\": 1,\n \"maxSlicesInMemory\": 5,\n \"transcribeProcessingPauseMs\": 500,\n \"initTranscribeAfterMs\": 500,\n \"vadStrategy\": \"use-preset\",\n \"vadPreset\": \"default\",\n \"initialPrompt\": \"\",\n \"promptPreviousSlices\": false,\n \"saveAudio\": true,\n \"testMode\": false,\n \"testPlaybackSpeed\": 1,\n \"testChunkDurationMs\": 100,\n \"testLoop\": false,\n \"beginTranscribeEnabled\": false,\n \"beginTranscribeScript\": \"\\/\\* Global variable: inputs = { sliceIndex, duration, vadEvent, variables } \\*\\/\\nreturn true\"\n}\n */\n property?: {\n /* Specifies the device ID to use for audio input.\n Web / Desktop: device ID string from enumerateDevices \n Android: audio source name - DEFAULT, MIC, VOICE_UPLINK, VOICE_DOWNLINK, VOICE_CALL, CAMCORDER, VOICE_RECOGNITION, VOICE_COMMUNICATION, UNPROCESSED */\n deviceId?: string | DataLink\n /* STT Generator for Whisper context */\n sttGeneratorId?: string | DataLink | (() => Generator)\n /* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when not in use. */\n sttLivePolicy?: 'only-in-use' | 'manual' | DataLink\n /* VAD Inference Generator for voice activity detection */\n vadInferenceGeneratorId?: string | DataLink | (() => Generator)\n /* VAD Inference Live Policy. If the policy is `only-in-use`, the VAD Inference context will be released when not in use. */\n vadInferenceLivePolicy?: 'only-in-use' | 'manual' | DataLink\n /* Enable VAD (Voice Activity Detection) */\n vadEnabled?: boolean | DataLink\n /* Audio slice duration in seconds */\n audioSliceSec?: number | DataLink\n /* Minimum audio duration to start transcription in seconds */\n audioMinSec?: number | DataLink\n /* Maximum number of slices to keep in memory */\n maxSlicesInMemory?: number | DataLink\n /* Transcribe processing interval in milliseconds */\n transcribeProcessingPauseMs?: number | DataLink\n /* Transcribe processing init after pause in milliseconds */\n initTranscribeAfterMs?: number | DataLink\n /* VAD Strategy */\n vadStrategy?: 'use-preset' | 'use-generator-options' | DataLink\n /* VAD preset configuration */\n vadPreset?:\n | 'default'\n | 'sensitive'\n | 'very-sensitive'\n | 'conservative'\n | 'very-conservative'\n | 'continuous-speech'\n | 'meeting'\n | 'noisy-environment'\n | DataLink\n /* Initial prompt for transcription */\n initialPrompt?: string | DataLink\n /* Include previous slices in prompt */\n promptPreviousSlices?: boolean | DataLink\n /* Enable audio output saving (auto-generates file path) */\n saveAudio?: boolean | DataLink\n /* Use test mode with file simulation */\n testMode?: boolean | DataLink\n /* Test audio file path for simulation */\n testFilePath?: string | DataLink\n /* Test audio file hash */\n testFileHash?: string | DataLink\n /* Test audio file hash type */\n testFileHashType?: string | DataLink\n /* Test playback speed */\n testPlaybackSpeed?: number | DataLink\n /* Test chunk duration in milliseconds */\n testChunkDurationMs?: number | DataLink\n /* Loop test audio file */\n testLoop?: boolean | DataLink\n /* Enable Begin Transcribe Script to determine transcription */\n beginTranscribeEnabled?: boolean | DataLink\n /* Script to determine whether to proceed with transcription */\n beginTranscribeScript?: string | DataLink\n /* Data to be used in Begin Transcribe Script (object) */\n beginTranscribeScriptData?: {} | DataLink\n }\n events?: {\n /* Event triggered when transcription starts, processes, or ends */\n onTranscribe?: Array<\n EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onTranscribe']>\n >\n /* Event triggered on VAD (Voice Activity Detection) events */\n onVad?: Array<\n EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onVad']>\n >\n /* Event triggered when error occurs */\n onError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onError']>\n >\n /* Event triggered when status changes */\n onStatusChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatusChange']>\n >\n /* Event triggered when statistics update */\n onStatsUpdate?: Array<\n EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatsUpdate']>\n >\n /* Event triggered when slice transcription is stabilized */\n onStabilized?: Array<\n EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStabilized']>\n >\n /* Event triggered when transcription ends */\n onEnd?: Array<\n EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onEnd']>\n >\n }\n outlets?: {\n /* Is realtime transcription currently active */\n isActive?: () => Data<boolean>\n /* Is currently transcribing audio */\n isTranscribing?: () => Data<boolean>\n /* Current transcription results */\n results?: () => Data<\n Array<{\n transcribeEvent?: {\n type?: string\n sliceIndex?: number\n isCapturing?: boolean\n data?: {\n result?: string\n language?: string\n [key: string]: any\n }\n vadEvent?: {\n type?: string\n confidence?: number\n duration?: number\n sliceIndex?: number\n timestamp?: number\n [key: string]: any\n }\n [key: string]: any\n }\n vadEvent?: {\n type?: string\n confidence?: number\n duration?: number\n sliceIndex?: number\n timestamp?: number\n [key: string]: any\n }\n [key: string]: any\n }>\n >\n /* Current transcription result text */\n resultText?: () => Data<string>\n /* Last stabilized transcription result segment */\n lastStabilizedSegment?: () => Data<string>\n /* Current statistics */\n statistics?: () => Data<{\n type?: string\n timestamp?: number\n data?: { [key: string]: any }\n [key: string]: any\n }>\n /* Latest transcribe event */\n lastTranscribeEvent?: () => Data<{\n type?: string\n sliceIndex?: number\n isCapturing?: boolean\n data?: {\n result?: string\n language?: string\n [key: string]: any\n }\n vadEvent?: {\n type?: string\n confidence?: number\n duration?: number\n sliceIndex?: number\n timestamp?: number\n [key: string]: any\n }\n [key: string]: any\n }>\n /* Latest VAD event */\n lastVadEvent?: () => Data<{\n type?: string\n confidence?: number\n duration?: number\n sliceIndex?: number\n timestamp?: number\n [key: string]: any\n }>\n /* Stabilized transcription text from completed slices */\n stabilizedText?: () => Data<string>\n /* Latest detected language code (e.g. `en`, `zh`, `ja`) from any transcribe slice (best-effort, may flicker on short slices) */\n detectedLanguage?: () => Data<string>\n /* Detected language code of the most recently stabilized (finalized) slice */\n stabilizedLanguage?: () => Data<string>\n /* Audio output file path (auto-generated when saving audio) */\n audioOutputPath?: () => Data<string>\n /* Available microphone devices (Web / Desktop only) */\n devices?: () => Data<Array<any>>\n }\n}\n\n/* Realtime speech-to-text transcription using Whisper and VAD with live audio streaming */\nexport type GeneratorRealtimeTranscription = Generator &\n GeneratorRealtimeTranscriptionDef & {\n templateKey: 'GENERATOR_REALTIME_TRANSCRIPTION'\n switches?: Array<\n SwitchDef &\n GeneratorRealtimeTranscriptionDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'isActive'\n | 'isTranscribing'\n | 'results'\n | 'resultText'\n | 'lastStabilizedSegment'\n | 'statistics'\n | 'lastTranscribeEvent'\n | 'lastVadEvent'\n | 'stabilizedText'\n | 'detectedLanguage'\n | 'stabilizedLanguage'\n | 'audioOutputPath'\n | 'devices'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/RerankerGgml.d.ts":"/* Auto generated by build script\n *\n * Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)\n *\n * ## Notice\n * - The device RAM must be larger than 8GB\n * - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.\n * - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.\n * - Android: Recommended use Android 13+ system.\n * - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.\n * - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.\n * - Linux / Windows\n * - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property\n * - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)\n * - Web: Supported with CPU and WebGPU acceleration.\n * - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorRerankerActionLoadModel = Action & {\n __actionName: 'GENERATOR_RERANKER_LOAD_MODEL'\n}\n\n/* Rerank documents based on query relevance */\nexport type GeneratorRerankerActionRerank = ActionWithParams & {\n __actionName: 'GENERATOR_RERANKER_RERANK'\n params?: Array<\n | {\n input: 'query'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'documents'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Release context */\nexport type GeneratorRerankerActionReleaseContext = Action & {\n __actionName: 'GENERATOR_RERANKER_RELEASE_CONTEXT'\n}\n\ninterface GeneratorRerankerDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"contextSize\": 512,\n \"batchSize\": 512,\n \"uBatchSize\": 512,\n \"accelVariant\": \"default\",\n \"mainGpu\": 0,\n \"gpuLayers\": 0,\n \"useMlock\": true,\n \"useMmap\": true,\n \"normalize\": 1\n}\n */\n property?: {\n /* Initialize the Reranker context on generator initialization */\n init?: boolean | DataLink\n /* The URL or path of reranker model (GGUF format) */\n modelUrl?: string | DataLink\n /* Hash of reranker model */\n modelHash?: string | DataLink\n /* Hash type of reranker model */\n modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Context size (0 ~ 4096) (Default to 512) */\n contextSize?: number | DataLink\n /* Logical batch size for processing (default: 512) */\n batchSize?: number | DataLink\n /* Physical maximum batch size (default: 512) */\n uBatchSize?: number | DataLink\n /* GGML accelerator variant (Only for desktop)\n `default` - CPU / Metal (macOS) \n `vulkan` - Use Vulkan \n `cuda` - Use CUDA \n `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */\n accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink\n /* Devices. For example:\n \n Metal or CPU for iOS/tvOS/MacOS \n OpenCL or CPU for Android \n - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices) \n For Desktop, you may want to include/exclude GPUs */\n devices?: Array<string | DataLink> | DataLink\n /* Main GPU index (default: 0) */\n mainGpu?: number | DataLink\n /* Number of layers to store in VRAM (default: 0) */\n gpuLayers?: number | DataLink\n /* Maximum number of threads to use (default: auto) */\n maxThreads?: number | DataLink\n /* Use mlock to keep model in memory (default: true) */\n useMlock?: boolean | DataLink\n /* Use mmap for model loading (default: true) */\n useMmap?: boolean | DataLink\n /* Query text for reranking */\n query?: string | DataLink\n /* Array of documents to rerank */\n documents?: Array<string | DataLink> | DataLink\n /* Normalize reranking scores (default: from model config) */\n normalize?: number | DataLink | boolean | DataLink | DataLink\n /* Maximum number of documents to return (default: unlimited) */\n topK?: number | DataLink\n }\n events?: {\n /* Event triggered when the reranker context state changes (loading, ready, error, released) */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Reranker']['onContextStateChange']>\n >\n /* Event triggered when an error occurs during reranker operations */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Reranker']['onError']>>\n }\n outlets?: {\n /* Current state of the reranker context (loading, ready, error, released) */\n contextState?: () => Data<string>\n /* Loading progress of the reranker model (0-100) */\n contextLoadProgress?: () => Data<number>\n /* Detailed information about the reranker context including instance ID and processing status */\n contextDetails?: () => Data<{\n state?: string\n contextId?: string\n gpu?: string\n reasonNoGPU?: string\n [key: string]: any\n }>\n /* Result of the reranking operation containing scored and ranked documents */\n rerankResult?: () => Data<\n Array<{\n index?: number\n score?: number\n text?: string\n payload?: { [key: string]: any }\n [key: string]: any\n }>\n >\n /* Boolean indicating whether the reranker is currently processing a request */\n isProcessing?: () => Data<boolean>\n }\n}\n\n/* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)\n\n ## Notice \n - The device RAM must be larger than 8GB \n - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal. \n - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal. \n - Android: Recommended use Android 13+ system. \n - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported. \n - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs. \n - Linux / Windows \n - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property \n - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) \n - Web: Supported with CPU and WebGPU acceleration. \n - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable. */\nexport type GeneratorReranker = Generator &\n GeneratorRerankerDef & {\n templateKey: 'GENERATOR_RERANKER'\n switches?: Array<\n SwitchDef &\n GeneratorRerankerDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'contextLoadProgress'\n | 'contextDetails'\n | 'rerankResult'\n | 'isProcessing'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SerialPort.d.ts":"/* Auto generated by build script\n *\n * Serial port communication for USB/UART devices (Android, Desktop only)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Get available serial devices */\nexport type GeneratorSerialPortActionGeneratorSerialGetDeviceList = Action & {\n __actionName: 'GENERATOR_SERIAL_GET_DEVICE_LIST'\n}\n\n/* Attach device */\nexport type GeneratorSerialPortActionGeneratorSerialAttach = Action & {\n __actionName: 'GENERATOR_SERIAL_ATTACH'\n}\n\n/* Dettach device */\nexport type GeneratorSerialPortActionGeneratorSerialDetach = Action & {\n __actionName: 'GENERATOR_SERIAL_DETACH'\n}\n\n/* Send string data (ASCII) */\nexport type GeneratorSerialPortActionGeneratorSerialSendString = ActionWithParams & {\n __actionName: 'GENERATOR_SERIAL_SEND_STRING'\n params?: Array<\n | {\n input: 'generatorSerialStringValue'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'generatorSerialStringEncoding'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Send hex string (e.g. 0123456789ABCDEF) */\nexport type GeneratorSerialPortActionGeneratorSerialSendHex = ActionWithParams & {\n __actionName: 'GENERATOR_SERIAL_SEND_HEX'\n params?: Array<{\n input: 'generatorSerialHexValue'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\ninterface GeneratorSerialPortDef {\n /*\nDefault property:\n{\n \"attachOnInit\": false,\n \"driver\": \"fd\",\n \"parityBit\": \"none\",\n \"dataBits\": 8,\n \"stopBits\": 1,\n \"commMode\": \"raw\"\n}\n */\n property?: {\n /* Try attach on generator initialized On web require user activation to attach device */\n attachOnInit?: boolean | DataLink\n /* The serial device driver */\n driver?: 'fd' | 'usb' | DataLink\n /* The serial device path e.g. /dev/ttyS0 or /dev/bus/usb/001/001 For desktop and web is device index number */\n path?: string | DataLink\n /* The serial USB vendor id (autoconnect first) */\n vendorId?: number | DataLink\n /* The serial USB product id */\n productId?: number | DataLink\n /* The super user binary path (For Android root permission) */\n suPath?: string | DataLink\n /* The serial device baud rate */\n baudRate?: number | DataLink\n /* The serial device parity bit */\n parityBit?: 'none' | 'odd' | 'even' | DataLink\n /* The serial device data bits */\n dataBits?: number | DataLink\n /* The serial device stop bits */\n stopBits?: number | DataLink\n /* The serial device communication mode */\n commMode?: 'raw' | 'EDC' | 'Regex Match' | DataLink\n /* The regex match pattern for packets */\n regexMatch?: string | DataLink\n }\n events?: {\n /* Event for attach the device */\n generatorSerialOnAttach?: Array<EventAction>\n /* Event for detach the device */\n generatorSerialOnDetach?: Array<EventAction>\n /* Event on error */\n generatorSerialOnError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnError']>\n >\n /* Event for receive data */\n generatorSerialOnData?: Array<\n EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnData']>\n >\n }\n outlets?: {\n /* Available serial devices */\n generatorSerialDeviceList?: () => Data<Array<{ [key: string]: any }>>\n /* Is serial open */\n generatorSerialIsOpen?: () => Data<boolean>\n /* Last rerceive data (Base64) */\n generatorSerialLastDataBase64?: () => Data<string>\n /* Last rerceive plain text */\n generatorSerialLastDataString?: () => Data<string>\n /* Error message */\n generatorSerialErrorMessage?: () => Data<string>\n }\n}\n\n/* Serial port communication for USB/UART devices (Android, Desktop only) */\nexport type GeneratorSerialPort = Generator &\n GeneratorSerialPortDef & {\n templateKey: 'GENERATOR_SERIAL_PORT'\n switches?: Array<\n SwitchDef &\n GeneratorSerialPortDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'generatorSerialDeviceList'\n | 'generatorSerialIsOpen'\n | 'generatorSerialLastDataBase64'\n | 'generatorSerialLastDataString'\n | 'generatorSerialErrorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SoundPlayer.d.ts":"/* Auto generated by build script\n *\n * Play sound, see supported formats at https://developer.android.com/guide/topics/media/media-formats\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start playing sound */\nexport type GeneratorSoundPlayerActionPlay = Action & {\n __actionName: 'GENERATOR_SOUND_PLAYER_PLAY'\n}\n\n/* Pause playing sound */\nexport type GeneratorSoundPlayerActionPause = Action & {\n __actionName: 'GENERATOR_SOUND_PLAYER_PAUSE'\n}\n\n/* Resume playing sound from pause */\nexport type GeneratorSoundPlayerActionResume = Action & {\n __actionName: 'GENERATOR_SOUND_PLAYER_RESUME'\n}\n\n/* Stop playing sound */\nexport type GeneratorSoundPlayerActionRelease = Action & {\n __actionName: 'GENERATOR_SOUND_PLAYER_RELEASE'\n}\n\ninterface GeneratorSoundPlayerDef {\n /*\nDefault property:\n{\n \"loop\": false,\n \"volume\": 100\n}\n */\n property?: {\n /* Sound file path */\n filePath?: string | DataLink\n /* MD5 */\n md5?: string | DataLink\n /* Repeat playback */\n loop?: boolean | DataLink\n /* Sound volume (0 - 100) */\n volume?: number | DataLink\n }\n events?: {\n /* Sound file loaded successfully */\n onLoad?: Array<EventAction>\n /* Sound file load error */\n onLoadError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['SoundPlayer']['onLoadError']>\n >\n /* Sound playback complete */\n onPlay?: Array<EventAction>\n /* Sound file playback end */\n onEnd?: Array<EventAction>\n }\n outlets?: {\n /* Whether the sound is playing */\n isPlaying?: () => Data<any>\n }\n}\n\n/* Play sound, see supported formats at https://developer.android.com/guide/topics/media/media-formats */\nexport type GeneratorSoundPlayer = Generator &\n GeneratorSoundPlayerDef & {\n templateKey: 'GENERATOR_SOUND_PLAYER'\n switches?: Array<\n SwitchDef &\n GeneratorSoundPlayerDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isPlaying'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SoundRecorder.d.ts":"/* Auto generated by build script\n *\n * Record audio (Microphone)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start record */\nexport type GeneratorSoundRecorderActionStart = Action & {\n __actionName: 'GENERATOR_SOUND_RECORDER_START'\n}\n\n/* Pause record */\nexport type GeneratorSoundRecorderActionPause = Action & {\n __actionName: 'GENERATOR_SOUND_RECORDER_PAUSE'\n}\n\n/* Resume record */\nexport type GeneratorSoundRecorderActionResume = Action & {\n __actionName: 'GENERATOR_SOUND_RECORDER_RESUME'\n}\n\n/* Stop record */\nexport type GeneratorSoundRecorderActionStop = Action & {\n __actionName: 'GENERATOR_SOUND_RECORDER_STOP'\n}\n\n/* List available microphone devices (Web / Desktop only) */\nexport type GeneratorSoundRecorderActionListDevices = Action & {\n __actionName: 'GENERATOR_SOUND_RECORDER_LIST_DEVICES'\n}\n\ninterface GeneratorSoundRecorderDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"sampleRate\": 32000,\n \"bitDepth\": \"16bit\",\n \"channels\": \"stereo\",\n \"fileRetainTime\": 10000,\n \"autoCuttingEnable\": false,\n \"autoCuttingTimeLimit\": 0,\n \"autoCuttingVocalFreqMin\": 75,\n \"autoCuttingVocalFreqMax\": 900,\n \"autoCuttingFreqClarity\": 0.5,\n \"autoCuttingSpeakSpacing\": 0.5,\n \"userMediaAudioOptions\": {}\n}\n */\n property?: {\n /* Start record on init (Need user trigger on Web) */\n init?: boolean | DataLink\n /* Specifies the device ID to use for audio input.\n Web / Desktop: device ID string from enumerateDevices \n Android: audio source name - DEFAULT, MIC, VOICE_UPLINK, VOICE_DOWNLINK, VOICE_CALL, CAMCORDER, VOICE_RECOGNITION, VOICE_COMMUNICATION, UNPROCESSED */\n deviceId?: string | DataLink\n /* Record sample rate */\n sampleRate?: number | DataLink\n /* PCM bit depth */\n bitDepth?: '8bit' | '16bit' | DataLink\n /* Audio channels */\n channels?: 'mono' | 'stereo' | DataLink\n /* Record file retain time, avoid memory exhausted */\n fileRetainTime?: number | DataLink\n /* Enable record auto cutting */\n autoCuttingEnable?: boolean | DataLink\n /* Fragment time limit */\n autoCuttingTimeLimit?: number | DataLink\n /* Minimal vocal frequency of cutting fragments */\n autoCuttingVocalFreqMin?: number | DataLink\n /* Maximal vocal frequency of cutting fragments */\n autoCuttingVocalFreqMax?: number | DataLink\n /* Minimum frequency clarity threshold on speaking (0 ~ 1) */\n autoCuttingFreqClarity?: number | DataLink\n /* Minimum volume threshold on speaking */\n autoCuttingVolumeThreshold?: number | DataLink\n /* Speak spacing of cutting fragments */\n autoCuttingSpeakSpacing?: number | DataLink\n /* Custom getUserMedia audio options for Web / Desktop. Merged into the audio constraints. */\n userMediaAudioOptions?:\n | DataLink\n | {\n autoGainControl?: boolean | DataLink\n echoCancellation?: boolean | DataLink\n noiseSuppression?: boolean | DataLink\n }\n }\n events?: {\n /* Event for chunk data (Base64 encoded PCM) */\n chunk?: Array<EventAction<string & keyof TemplateEventPropsMap['SoundRecorder']['chunk']>>\n /* Event for recorded file */\n recorded?: Array<EventAction<string & keyof TemplateEventPropsMap['SoundRecorder']['recorded']>>\n }\n outlets?: {\n /* Is recording */\n isRecording?: () => Data<boolean>\n /* Recorded file path */\n recordedPath?: () => Data<string>\n /* Current auto-cutting detected volume */\n volume?: () => Data<number>\n /* Error message */\n errorMessage?: () => Data<string>\n /* Available microphone devices (Web / Desktop only) */\n devices?: () => Data<Array<any>>\n }\n}\n\n/* Record audio (Microphone) */\nexport type GeneratorSoundRecorder = Generator &\n GeneratorSoundRecorderDef & {\n templateKey: 'GENERATOR_SOUND_RECORDER'\n switches?: Array<\n SwitchDef &\n GeneratorSoundRecorderDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isRecording' | 'recordedPath' | 'volume' | 'errorMessage' | 'devices'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SpeechToTextGgml.d.ts":"/* Auto generated by build script\n *\n * Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)\n *\n * ## Notice\n * - iOS: Supported GPU acceleration, recommended use M1+ / A17+ chip device\n * - macOS: Supported GPU acceleration, recommended use M1+ chip device\n * - Android: Currently not supported GPU acceleration (Coming soon), recommended use Android 13+ system\n * - Linux / Windows: Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property\n * - Web: Supported with WASM CPU and optional WebGPU acceleration in Web Preview.\n * - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorSpeechInferenceActionLoadModel = Action & {\n __actionName: 'GENERATOR_SPEECH_INFERENCE_LOAD_MODEL'\n}\n\n/* Transcribe audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */\nexport type GeneratorSpeechInferenceActionTranscribeFile = ActionWithParams & {\n __actionName: 'GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_FILE'\n params?: Array<\n | {\n input: 'fileUrl'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'beamSize'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'language'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'translate'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Transcribe audio data. Currently only support base64 encoded audio data (16-bit PCM, mono, 16kHz) */\nexport type GeneratorSpeechInferenceActionTranscribeData = ActionWithParams & {\n __actionName: 'GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_DATA'\n params?: Array<\n | {\n input: 'data'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'prompt'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'beamSize'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'language'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'translate'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop current transcription */\nexport type GeneratorSpeechInferenceActionTranscribeStop = Action & {\n __actionName: 'GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_STOP'\n}\n\n/* Clear downloaded files (model, audio) & current jobs */\nexport type GeneratorSpeechInferenceActionClearDownload = Action & {\n __actionName: 'GENERATOR_SPEECH_INFERENCE_CLEAR_DOWNLOAD'\n}\n\n/* Release context */\nexport type GeneratorSpeechInferenceActionReleaseContext = Action & {\n __actionName: 'GENERATOR_SPEECH_INFERENCE_RELEASE_CONTEXT'\n}\n\ninterface GeneratorSpeechInferenceDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"accelVariant\": \"default\",\n \"modelName\": \"base-q8_0\",\n \"modelUseCoreML\": false,\n \"modelUseGPU\": true,\n \"modelUseFlashAttn\": false,\n \"inferLanguage\": \"Auto\"\n}\n */\n property?: {\n /* Initialize the Whisper context on generator initialization\n Please note that it will take some RAM depending on the model size */\n init?: boolean | DataLink\n /* Accelerator variant (Only for desktop)\n `default` - CPU / Metal (macOS) \n `vulkan` - Use Vulkan \n `cuda` - Use CUDA */\n accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink\n /* Use model name, the model download progress will be done in preload stage or the generator initialization stage.\n We used `ggml` format model, please refer to https://huggingface.co/BricksDisplay/whisper-ggml \n You can also choose `custom` option and set `Model URL` and `Model MD5` to use your own model */\n modelName?:\n | 'custom'\n | 'tiny'\n | 'tiny-q5_1'\n | 'tiny-q8_0'\n | 'tiny.en'\n | 'tiny.en-q5_1'\n | 'tiny.en-q8_0'\n | 'base'\n | 'base-q5_1'\n | 'base-q8_0'\n | 'base.en'\n | 'base.en-q5_1'\n | 'base.en-q8_0'\n | 'small'\n | 'small-q5_1'\n | 'small-q8_0'\n | 'small.en'\n | 'small.en-q5_1'\n | 'small.en-q8_0'\n | 'medium'\n | 'medium-q5_0'\n | 'medium-q8_0'\n | 'medium.en'\n | 'medium.en-q5_0'\n | 'medium.en-q8_0'\n | 'large-v1'\n | 'large-v2'\n | 'large-v2-q5_0'\n | 'large-v2-q8_0'\n | 'large-v3'\n | 'large-v3-q5_0'\n | 'large-v3-turbo'\n | 'large-v3-turbo-q5_0'\n | 'large-v3-turbo-q8_0'\n | 'small.en-tdrz'\n | 'small.en-tdrz-q5_1'\n | 'small.en-tdrz-q8_0'\n | 'distil-small.en'\n | 'distil-small.en-q5_1'\n | 'distil-small.en-q8_0'\n | 'distil-medium.en'\n | 'distil-medium.en-q5_0'\n | 'distil-medium.en-q8_0'\n | 'distil-large-v3'\n | 'distil-large-v3-q5_0'\n | 'distil-large-v3-q8_0'\n | DataLink\n /* The URL or path of model\n We used `ggml` format model, please refer to https://github.com/ggerganov/whisper.cpp/tree/master/models */\n modelUrl?: string | DataLink\n /* Hash type of model */\n modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Hash of model */\n modelHash?: string | DataLink\n /* [Unstable] iOS: Use CoreML model for inference */\n modelUseCoreML?: boolean | DataLink\n /* Use GPU Acceleration for inference. Currently iOS only, if it's enabled, Core ML option will be ignored. */\n modelUseGPU?: boolean | DataLink\n /* Use Flash Attention for inference (Recommended with GPU enabled) */\n modelUseFlashAttn?: boolean | DataLink\n /* The language of the file to be inferred */\n inferLanguage?:\n | 'Auto'\n | 'English (en)'\n | 'Chinese (zh)'\n | 'German (de)'\n | 'Spanish (es)'\n | 'Russian (ru)'\n | 'Korean (ko)'\n | 'French (fr)'\n | 'Japanese (ja)'\n | 'Portuguese (pt)'\n | 'Turkish (tr)'\n | 'Polish (pl)'\n | 'Catalan (ca)'\n | 'Dutch (nl)'\n | 'Arabic (ar)'\n | 'Swedish (sv)'\n | 'Italian (it)'\n | 'Indonesian (id)'\n | 'Hindi (hi)'\n | 'Finnish (fi)'\n | 'Vietnamese (vi)'\n | 'Hebrew (he)'\n | 'Ukrainian (uk)'\n | 'Greek (el)'\n | 'Malay (ms)'\n | 'Czech (cs)'\n | 'Romanian (ro)'\n | 'Danish (da)'\n | 'Hungarian (hu)'\n | 'Tamil (ta)'\n | 'Norwegian (no)'\n | 'Thai (th)'\n | 'Urdu (ur)'\n | 'Croatian (hr)'\n | 'Bulgarian (bg)'\n | 'Lithuanian (lt)'\n | 'Latin (la)'\n | 'Maori (mi)'\n | 'Malayalam (ml)'\n | 'Welsh (cy)'\n | 'Slovak (sk)'\n | 'Telugu (te)'\n | 'Persian (fa)'\n | 'Latvian (lv)'\n | 'Bengali (bn)'\n | 'Serbian (sr)'\n | 'Azerbaijani (az)'\n | 'Slovenian (sl)'\n | 'Kannada (kn)'\n | 'Estonian (et)'\n | 'Macedonian (mk)'\n | 'Breton (br)'\n | 'Basque (eu)'\n | 'Icelandic (is)'\n | 'Armenian (hy)'\n | 'Nepali (ne)'\n | 'Mongolian (mn)'\n | 'Bosnian (bs)'\n | 'Kazakh (kk)'\n | 'Albanian (sq)'\n | 'Swahili (sw)'\n | 'Galician (gl)'\n | 'Marathi (mr)'\n | 'Punjabi (pa)'\n | 'Sinhala (si)'\n | 'Khmer (km)'\n | 'Shona (sn)'\n | 'Yoruba (yo)'\n | 'Somali (so)'\n | 'Afrikaans (af)'\n | 'Occitan (oc)'\n | 'Georgian (ka)'\n | 'Belarusian (be)'\n | 'Tajik (tg)'\n | 'Sindhi (sd)'\n | 'Gujarati (gu)'\n | 'Amharic (am)'\n | 'Yiddish (yi)'\n | 'Lao (lo)'\n | 'Uzbek (uz)'\n | 'Faroese (fo)'\n | 'Haitian Creole (ht)'\n | 'Pashto (ps)'\n | 'Turkmen (tk)'\n | 'Nynorsk (nn)'\n | 'Maltese (mt)'\n | 'Sanskrit (sa)'\n | 'Luxembourgish (lb)'\n | 'Myanmar (my)'\n | 'Tibetan (bo)'\n | 'Tagalog (tl)'\n | 'Malagasy (mg)'\n | 'Assamese (as)'\n | 'Tatar (tt)'\n | 'Hawaiian (haw)'\n | 'Lingala (ln)'\n | 'Hausa (ha)'\n | 'Bashkir (ba)'\n | 'Javanese (jw)'\n | 'Sundanese (su)'\n | DataLink\n /* Initial prompt text to guide the model's style or continue a previous audio segment. The prompt should match the audio language. */\n inferPrompt?: string | DataLink\n /* Beam size to use for beam search (enables beam search if set) */\n inferBeamSize?: number | DataLink\n /* Translate the result to English */\n inferTranslate?: boolean | DataLink\n /* Max threads to use for inference */\n inferMaxThreads?: number | DataLink\n /* Output token-level timestamps in details outlet */\n inferTokenTimestamps?: boolean | DataLink\n /* Speaker diarization (Please use small.en-tdrz model) */\n inferTdrz?: boolean | DataLink\n /* Maximum segment length in characters */\n inferMaxLength?: number | DataLink\n /* Audio time offset in milliseconds */\n inferOffset?: number | DataLink\n /* Audio duration of audio to process in milliseconds */\n inferDuration?: number | DataLink\n /* The file URL or path to be inferred.\n It only supported `wav` format with 16kHz sample rate & single (mono) channel */\n inferFileUrl?: string | DataLink\n /* MD5 of file to be inferred */\n inferFileMd5?: string | DataLink\n /* Buttress connection settings for remote inference */\n buttressConnectionSettings?:\n | DataLink\n | {\n enabled?: boolean | DataLink\n url?: string | DataLink\n autoDiscoverType?: 'manual' | 'auto' | DataLink\n fallbackType?: 'use-local' | 'no-op' | DataLink\n strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink\n }\n }\n events?: {\n /* Event triggered when context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onError']>>\n /* Event triggered when got transcribe result */\n onTranscribed?: Array<\n EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onTranscribed']>\n >\n /* Event triggered when transcribe realtime done */\n onRealtimeStop?: Array<EventAction>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Context details */\n contextDetails?: () => Data<{\n state?: string\n contextId?: string\n gpu?: string\n reasonNoGPU?: string\n [key: string]: any\n }>\n /* Is transcribing */\n isTranscribing?: () => Data<boolean>\n /* Progress of transcribe audio (0-100) */\n transcribeProgress?: () => Data<number>\n /* Inference result */\n transcribeResult?: () => Data<string>\n /* Detected language code of the latest transcription (e.g. `en`, `zh`, `ja`) */\n detectedLanguage?: () => Data<string>\n /* Inference result details */\n transcribeDetails?: () => Data<{\n result?: string\n language?: string\n segments?: Array<{\n start?: number\n end?: number\n confidence?: number\n t0?: number\n t1?: number\n [key: string]: any\n }>\n time?: number\n startTime?: number\n endTime?: number\n [key: string]: any\n }>\n /* Recorded audio file path of transcribe realtime (if `Save Audio` is enabled) */\n recordedPath?: () => Data<string>\n }\n}\n\n/* Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)\n\n ## Notice \n - iOS: Supported GPU acceleration, recommended use M1+ / A17+ chip device \n - macOS: Supported GPU acceleration, recommended use M1+ chip device \n - Android: Currently not supported GPU acceleration (Coming soon), recommended use Android 13+ system \n - Linux / Windows: Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property \n - Web: Supported with WASM CPU and optional WebGPU acceleration in Web Preview. \n - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable. */\nexport type GeneratorSpeechInference = Generator &\n GeneratorSpeechInferenceDef & {\n templateKey: 'GENERATOR_SPEECH_INFERENCE'\n switches?: Array<\n SwitchDef &\n GeneratorSpeechInferenceDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'contextDetails'\n | 'isTranscribing'\n | 'transcribeProgress'\n | 'transcribeResult'\n | 'detectedLanguage'\n | 'transcribeDetails'\n | 'recordedPath'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SpeechToTextOnnx.d.ts":"/* Auto generated by build script\n *\n * Local STT inference based on [transformers.js](https://huggingface.co/docs/transformers.js)\n * You can use any converted model on HuggingFace.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorOnnxSTTActionLoadModel = Action & {\n __actionName: 'GENERATOR_ONNX_STT_LOAD_MODEL'\n}\n\n/* Inference */\nexport type GeneratorOnnxSTTActionInfer = ActionWithParams & {\n __actionName: 'GENERATOR_ONNX_STT_INFER'\n params?: Array<{\n input: 'audioUri'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Clean cache */\nexport type GeneratorOnnxSTTActionCleanCache = Action & {\n __actionName: 'GENERATOR_ONNX_STT_CLEAN_CACHE'\n}\n\n/* Release context */\nexport type GeneratorOnnxSTTActionReleaseContext = Action & {\n __actionName: 'GENERATOR_ONNX_STT_RELEASE_CONTEXT'\n}\n\ninterface GeneratorOnnxSTTDef {\n /*\nDefault property:\n{\n \"model\": \"whisper-base\",\n \"modelType\": \"auto\",\n \"returnTimestamps\": \"none\",\n \"executionMode\": \"sequential\"\n}\n */\n property?: {\n /* Initialize the TTS context on generator initialization */\n init?: boolean | DataLink\n /* STT model */\n model?: string | DataLink\n /* Model type */\n modelType?: string | DataLink\n /* Quantize type */\n quantizeType?:\n | 'auto'\n | 'none'\n | 'fp16'\n | 'q8'\n | 'int8'\n | 'uint8'\n | 'q4'\n | 'bnb4'\n | 'q4f16'\n | DataLink\n /* Return timestamps */\n returnTimestamps?: 'none' | 'enable' | 'word' | DataLink\n /* Transcription language\n Not specifying the language will auto detect the language. */\n language?:\n | 'English'\n | 'Chinese'\n | 'German'\n | 'Spanish'\n | 'Russian'\n | 'Korean'\n | 'French'\n | 'Japanese'\n | 'Portuguese'\n | 'Turkish'\n | 'Polish'\n | 'Catalan'\n | 'Dutch'\n | 'Arabic'\n | 'Swedish'\n | 'Italian'\n | 'Indonesian'\n | 'Hindi'\n | 'Finnish'\n | 'Vietnamese'\n | 'Hebrew'\n | 'Ukrainian'\n | 'Greek'\n | 'Malay'\n | 'Czech'\n | 'Romanian'\n | 'Danish'\n | 'Hungarian'\n | 'Tamil'\n | 'Norwegian'\n | 'Thai'\n | 'Urdu'\n | 'Croatian'\n | 'Bulgarian'\n | 'Lithuanian'\n | 'Latin'\n | 'Maori'\n | 'Malayalam'\n | 'Welsh'\n | 'Slovak'\n | 'Telugu'\n | 'Persian'\n | 'Latvian'\n | 'Bengali'\n | 'Serbian'\n | 'Azerbaijani'\n | 'Slovenian'\n | 'Kannada'\n | 'Estonian'\n | 'Macedonian'\n | 'Breton'\n | 'Basque'\n | 'Icelandic'\n | 'Armenian'\n | 'Nepali'\n | 'Mongolian'\n | 'Bosnian'\n | 'Kazakh'\n | 'Albanian'\n | 'Swahili'\n | 'Galician'\n | 'Marathi'\n | 'Punjabi'\n | 'Sinhala'\n | 'Khmer'\n | 'Shona'\n | 'Yoruba'\n | 'Somali'\n | 'Afrikaans'\n | 'Occitan'\n | 'Georgian'\n | 'Belarusian'\n | 'Tajik'\n | 'Sindhi'\n | 'Gujarati'\n | 'Amharic'\n | 'Yiddish'\n | 'Lao'\n | 'Uzbek'\n | 'Faroese'\n | 'Haitian Creole'\n | 'Pashto'\n | 'Turkmen'\n | 'Nynorsk'\n | 'Maltese'\n | 'Sanskrit'\n | 'Luxembourgish'\n | 'Myanmar'\n | 'Tibetan'\n | 'Tagalog'\n | 'Malagasy'\n | 'Assamese'\n | 'Tatar'\n | 'Hawaiian '\n | 'Lingala'\n | 'Hausa'\n | 'Bashkir'\n | 'Javanese'\n | 'Sundanese'\n | DataLink\n /* Task */\n task?: 'transcribe' | 'translate' | DataLink\n /* Inferencing chunk length */\n chunkLength?: number | DataLink\n /* Executor candidates, descending order of priority\n Default will be xnnpack, wasm, cpu */\n executors?:\n | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>\n | DataLink\n /* Execution mode\n Usually when the model has many branches, setting this option to `parallel` will give you better performance. */\n executionMode?: 'sequential' | 'parallel' | DataLink\n /* QNN backend */\n qnnBackend?: 'HTP' | 'HTA' | 'DSP' | 'GPU' | 'CPU' | DataLink\n /* Enable FP16 for QNN HTP */\n qnnHtpEnableFp16?: boolean | DataLink\n /* Enable QNN debug */\n qnnEnableDebug?: boolean | DataLink\n }\n events?: {\n /* Event triggered when state change */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OnnxStt']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxStt']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Inference result */\n result?: () => Data<string>\n /* Inference result detail */\n resultDetail?: () => Data<{ [key: string]: any }>\n }\n}\n\n/* Local STT inference based on [transformers.js](https://huggingface.co/docs/transformers.js)\n You can use any converted model on HuggingFace. */\nexport type GeneratorOnnxSTT = Generator &\n GeneratorOnnxSTTDef & {\n templateKey: 'GENERATOR_ONNX_STT'\n switches?: Array<\n SwitchDef &\n GeneratorOnnxSTTDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'contextState' | 'result' | 'resultDetail'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SpeechToTextPlatform.d.ts":"/* Auto generated by build script\n *\n * Speech-to-Text using platform's native capabilities\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start speech recognition */\nexport type GeneratorPlatformSTTActionStart = Action & {\n __actionName: 'GENERATOR_PLATFORM_STT_START'\n}\n\n/* Stop speech recognition */\nexport type GeneratorPlatformSTTActionStop = Action & {\n __actionName: 'GENERATOR_PLATFORM_STT_STOP'\n}\n\ninterface GeneratorPlatformSTTDef {\n /*\nDefault property:\n{\n \"locale\": \"en_US\"\n}\n */\n property?: {\n /* Locale for speech recognition */\n locale?: string | DataLink\n /* [iOS] An array of phrases that should be recognized, even if they are not in the system vocabulary. */\n iosContextualStrings?: Array<string | DataLink> | DataLink\n }\n events?: {\n /* Event for speech recognition start */\n onSpeechStart?: Array<EventAction>\n /* Event for speech recognition end */\n onSpeechEnd?: Array<EventAction>\n /* Event for speech recognition results */\n onSpeechResults?: Array<\n EventAction<string & keyof TemplateEventPropsMap['PlatformStt']['onSpeechResults']>\n >\n /* Event for speech recognition error */\n onSpeechError?: Array<\n EventAction<string & keyof TemplateEventPropsMap['PlatformStt']['onSpeechError']>\n >\n }\n outlets?: {\n /* Recognized speech text */\n recognizedText?: () => Data<string>\n /* Error message */\n errorMessage?: () => Data<string>\n /* Listening status */\n listening?: () => Data<boolean>\n }\n}\n\n/* Speech-to-Text using platform's native capabilities */\nexport type GeneratorPlatformSTT = Generator &\n GeneratorPlatformSTTDef & {\n templateKey: 'GENERATOR_PLATFORM_STT'\n switches?: Array<\n SwitchDef &\n GeneratorPlatformSTTDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'recognizedText' | 'errorMessage' | 'listening'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SqLite.d.ts":"/* Auto generated by build script\n *\n * SQLite database: create tables, query, insert, update, and delete with SQL\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Execute SQL statement */\nexport type GeneratorSqliteActionExecute = ActionWithParams & {\n __actionName: 'GENERATOR_SQLITE_EXECUTE'\n params?: Array<\n | {\n input: 'sql'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'params'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'paramsString'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Query data from database */\nexport type GeneratorSqliteActionQuery = ActionWithParams & {\n __actionName: 'GENERATOR_SQLITE_QUERY'\n params?: Array<\n | {\n input: 'sql'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'params'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'paramsString'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Execute multiple SQL statements in transaction */\nexport type GeneratorSqliteActionTransaction = ActionWithParams & {\n __actionName: 'GENERATOR_SQLITE_TRANSACTION'\n params?: Array<{\n input: 'statements'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Execute same SQL statement with multiple parameter sets */\nexport type GeneratorSqliteActionBatchExecute = ActionWithParams & {\n __actionName: 'GENERATOR_SQLITE_BATCH_EXECUTE'\n params?: Array<\n | {\n input: 'sql'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'batchParams'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface GeneratorSqliteDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"dbName\": \"default\",\n \"storageType\": \"file\",\n \"useFile\": false\n}\n */\n property?: {\n /* Initialize database on subspace mounted */\n init?: boolean | DataLink\n /* Database name */\n dbName?: string | DataLink\n /* Storage type */\n storageType?: 'file' | 'memory' | DataLink\n /* Use specific file (memory type will be ignored) */\n useFile?: boolean | DataLink\n /* File URI for SQLite database */\n fileUri?: string | DataLink\n /* MD5 hash of file URI */\n fileUriMd5?: string | DataLink\n }\n events?: {\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Sqlite']['onError']>>\n /* Event triggered when query result is ready */\n onQueryResult?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Sqlite']['onQueryResult']>\n >\n }\n outlets?: {\n /* Whether the database is ready */\n isReady?: () => Data<boolean>\n /* Database path */\n dbPath?: () => Data<string>\n /* Error message */\n error?: () => Data<string>\n /* Last query result */\n lastResult?: () => Data<Array<{ [key: string]: any }>>\n /* Last execute result with metadata */\n lastExecuteResult?: () => Data<{\n rowsAffected?: number\n insertId?: number\n [key: string]: any\n }>\n }\n}\n\n/* SQLite database: create tables, query, insert, update, and delete with SQL */\nexport type GeneratorSqlite = Generator &\n GeneratorSqliteDef & {\n templateKey: 'GENERATOR_SQLITE'\n switches?: Array<\n SwitchDef &\n GeneratorSqliteDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult' | 'lastExecuteResult'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Step.d.ts":"/* Auto generated by build script\n *\n * Trigger change canvas / outlet / event by setup rules\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start execute the step */\nexport type GeneratorStepActionStart = Action & {\n __actionName: 'GENERATOR_STEP_START'\n}\n\n/* Pause steps */\nexport type GeneratorStepActionPause = Action & {\n __actionName: 'GENERATOR_STEP_PAUSE'\n}\n\n/* Resume from pause step */\nexport type GeneratorStepActionResume = Action & {\n __actionName: 'GENERATOR_STEP_RESUME'\n}\n\n/* Skip to the previous step and execute directly */\nexport type GeneratorStepActionPerviousStep = Action & {\n __actionName: 'GENERATOR_STEP_PERVIOUS_STEP'\n}\n\n/* Skip to the next step and execute directly */\nexport type GeneratorStepActionNextStep = Action & {\n __actionName: 'GENERATOR_STEP_NEXT_STEP'\n}\n\n/* Skip to the first step and execute directly */\nexport type GeneratorStepActionFirstStep = Action & {\n __actionName: 'GENERATOR_STEP_FIRST_STEP'\n}\n\n/* Skip to the last step and execute directly */\nexport type GeneratorStepActionLastStep = Action & {\n __actionName: 'GENERATOR_STEP_LAST_STEP'\n}\n\ninterface GeneratorStepDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"steps\": []\n}\n */\n property?: {\n init?: boolean | DataLink\n /* Step definition list */\n steps?:\n | Array<\n | DataLink\n | {\n duration?: number | DataLink\n action?: 'change-canvas' | 'outlet' | 'event' | DataLink\n payload?: string | DataLink\n }\n >\n | DataLink\n }\n events?: {\n /* Event on step (If action is `event`) */\n onStep?: Array<EventAction<string & keyof TemplateEventPropsMap['Step']['onStep']>>\n }\n outlets?: {\n /* Result of step payload (If action is `outlet`) */\n payload?: () => Data<string>\n /* Result of step index (If action is `outlet`) */\n index?: () => Data<number>\n }\n}\n\n/* Trigger change canvas / outlet / event by setup rules */\nexport type GeneratorStep = Generator &\n GeneratorStepDef & {\n templateKey: 'GENERATOR_STEP'\n switches?: Array<\n SwitchDef &\n GeneratorStepDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'payload' | 'index'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/SttAppleBuiltin.d.ts":"/* Auto generated by build script\n *\n * Speech recognition on iOS 26+ and Desktop (macOS 26+). Not supported on tvOS\n *\n * ## Features\n * - Native Apple speech recognition\n * - High accuracy transcription\n * - Privacy-focused on-device processing\n * - Supports file and data transcription\n * - Requires iOS 26+ or Desktop on macOS 26+. Not supported on tvOS\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Initialize STT */\nexport type GeneratorAppleSTTActionInit = Action & {\n __actionName: 'GENERATOR_APPLE_STT_INIT'\n}\n\n/* Transcribe audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */\nexport type GeneratorAppleSTTActionTranscribeFile = ActionWithParams & {\n __actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_FILE'\n params?: Array<\n | {\n input: 'fileUrl'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'language'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contextualStrings'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Transcribe audio data (base64 encoded audio data or ArrayBuffer) */\nexport type GeneratorAppleSTTActionTranscribeData = ActionWithParams & {\n __actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_DATA'\n params?: Array<\n | {\n input: 'data'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'language'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'contextualStrings'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Release context */\nexport type GeneratorAppleSTTActionReleaseContext = Action & {\n __actionName: 'GENERATOR_APPLE_STT_RELEASE_CONTEXT'\n}\n\ninterface GeneratorAppleSTTDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"language\": \"en-US\",\n \"contextualStrings\": [],\n \"enablePartialResults\": true\n}\n */\n property?: {\n /* Initialize the STT engine on generator initialization */\n init?: boolean | DataLink\n /* Language/locale for recognition (e.g., 'en-US') */\n language?: string | DataLink\n /* Phrases that should be recognized, even if they are not in the system vocabulary. */\n contextualStrings?:\n | Array<string | DataLink>\n | DataLink\n | Record<string, Array<string | DataLink> | DataLink>\n | DataLink\n | DataLink\n /* Enable partial results during transcription */\n enablePartialResults?: boolean | DataLink\n /* The file URL or path to be transcribed */\n fileUrl?: string | DataLink\n }\n events?: {\n /* Error event */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleStt']['onError']>>\n /* Event triggered when got transcribe result */\n onTranscribed?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AppleStt']['onTranscribed']>\n >\n }\n outlets?: {\n /* State outlet (loading, ready, error) */\n state?: () => Data<string>\n /* Is transcribing */\n isTranscribing?: () => Data<boolean>\n /* Transcribe result */\n transcribeResult?: () => Data<string>\n /* Transcribe result details (result, segments, time, startTime, endTime, duration) */\n transcribeDetails?: () => Data<{ [key: string]: any }>\n }\n}\n\n/* Speech recognition on iOS 26+ and Desktop (macOS 26+). Not supported on tvOS\n\n ## Features \n - Native Apple speech recognition \n - High accuracy transcription \n - Privacy-focused on-device processing \n - Supports file and data transcription \n - Requires iOS 26+ or Desktop on macOS 26+. Not supported on tvOS */\nexport type GeneratorAppleSTT = Generator &\n GeneratorAppleSTTDef & {\n templateKey: 'GENERATOR_APPLE_STT'\n switches?: Array<\n SwitchDef &\n GeneratorAppleSTTDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'state' | 'isTranscribing' | 'transcribeResult' | 'transcribeDetails'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Tcp.d.ts":"/* Auto generated by build script\n *\n * TCP socket client with data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), TLS, and keepalive support\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start connect */\nexport type GeneratorTCPActionConnect = Action & {\n __actionName: 'GENERATOR_TCP_CONNECT'\n}\n\n/* Send data */\nexport type GeneratorTCPActionSend = ActionWithParams & {\n __actionName: 'GENERATOR_TCP_SEND'\n params?: Array<{\n input: 'sendData'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* End connection */\nexport type GeneratorTCPActionEnd = ActionWithParams & {\n __actionName: 'GENERATOR_TCP_END'\n params?: Array<{\n input: 'endWithData'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\ninterface GeneratorTCPDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"dataMode\": \"raw\",\n \"encoding\": \"utf8\",\n \"idleTimeout\": 0,\n \"bufferSize\": 1024,\n \"tls\": false,\n \"tlsCheckValidity\": false,\n \"tlsCert\": \"\"\n}\n */\n property?: {\n /* Start connect on generator initialized */\n init?: boolean | DataLink\n /* Connection target host or IP assress */\n host?: string | DataLink\n /* Connection target port */\n port?: number | DataLink\n /* Data mode\n CRLF: Receive until CRLF \n LF: Receive until LF \n raw: Raw packet */\n dataMode?: 'CRLF' | 'LF' | 'raw' | DataLink\n /* Encoding of data */\n encoding?: 'base64' | 'utf8' | 'ascii' | DataLink\n /* Max connection idle time, 0 is disable */\n idleTimeout?: number | DataLink\n /* Enable keepalive */\n keepAlive?: boolean | DataLink\n /* Buffer size limit of receive plaintext line */\n bufferSize?: number | DataLink\n /* Enable TLS */\n tls?: boolean | DataLink\n /* Enable TLS certificate verify */\n tlsCheckValidity?: boolean | DataLink\n /* Trust certificate list (PEM format) */\n tlsCert?: string | DataLink\n }\n events?: {\n /* Event of connect successful */\n onConnected?: Array<EventAction>\n /* Event of receive data */\n onData?: Array<EventAction<string & keyof TemplateEventPropsMap['Tcp']['onData']>>\n /* Event of connection idle timeout */\n onTimeout?: Array<EventAction>\n /* Event of connection close */\n onClose?: Array<EventAction>\n /* Event of connection error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Tcp']['onError']>>\n }\n outlets?: {\n /* Connection status */\n status?: () => Data<string>\n /* Last received data */\n lastData?: () => Data<string>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* TCP socket client with data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), TLS, and keepalive support */\nexport type GeneratorTCP = Generator &\n GeneratorTCPDef & {\n templateKey: 'GENERATOR_TCP'\n switches?: Array<\n SwitchDef &\n GeneratorTCPDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'status' | 'lastData' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/TcpServer.d.ts":"/* Auto generated by build script\n *\n * TCP server with multi-client support, data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), concurrent connection limit, and TLS\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start TCP server */\nexport type GeneratorTCPServerActionStart = Action & {\n __actionName: 'GENERATOR_TCP_SERVER_START'\n}\n\n/* Send data to specify connection */\nexport type GeneratorTCPServerActionSend = ActionWithParams & {\n __actionName: 'GENERATOR_TCP_SERVER_SEND'\n params?: Array<\n | {\n input: 'remote'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'sendData'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* End specify connection */\nexport type GeneratorTCPServerActionEnd = ActionWithParams & {\n __actionName: 'GENERATOR_TCP_SERVER_END'\n params?: Array<\n | {\n input: 'remote'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'generatorTcpClientEndWithData'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop TCP server */\nexport type GeneratorTCPServerActionStop = Action & {\n __actionName: 'GENERATOR_TCP_SERVER_STOP'\n}\n\ninterface GeneratorTCPServerDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"dataMode\": \"raw\",\n \"encoding\": \"utf8\",\n \"bufferSize\": 1024,\n \"concurrent\": 5,\n \"idleTimeout\": 0\n}\n */\n property?: {\n /* Start TCP server on generator initialized */\n init?: boolean | DataLink\n /* Bind port of TCP server */\n port?: number | DataLink\n /* Data mode\n CRLF: Receive until CRLF \n LF: Receive until LF \n raw: Raw packet */\n dataMode?: 'CRLF' | 'LF' | 'raw' | DataLink\n /* Encoding of data */\n encoding?: 'base64' | 'utf8' | 'ascii' | DataLink\n /* Buffer size limit of receive plaintext line */\n bufferSize?: number | DataLink\n /* Max concurrent connection count */\n concurrent?: number | DataLink\n /* Max connection idle time, 0 is disable */\n idleTimeout?: number | DataLink\n /* Enable TLS */\n tls?: boolean | DataLink\n /* TLS key pair (Base64 encoded no password PKCS #12) */\n tlsKeyPair?: string | DataLink\n }\n events?: {\n /* Event of TCP server is ready */\n onReady?: Array<EventAction>\n /* Event of TCP server accept the connection */\n onAcceptConnection?: Array<\n EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onAcceptConnection']>\n >\n /* Event of receive data */\n onData?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onData']>>\n /* Event of connection idle timeout */\n onTimeout?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onTimeout']>>\n /* Event of connection close */\n onClose?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onClose']>>\n /* Event of server or connection error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onError']>>\n }\n outlets?: {\n /* Server is listening */\n isListening?: () => Data<boolean>\n /* Is server started */\n started?: () => Data<boolean>\n /* Accepted connections */\n connections?: () => Data<Array<string>>\n /* Last received data */\n lastData?: () => Data<string>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* TCP server with multi-client support, data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), concurrent connection limit, and TLS */\nexport type GeneratorTCPServer = Generator &\n GeneratorTCPServerDef & {\n templateKey: 'GENERATOR_TCP_SERVER'\n switches?: Array<\n SwitchDef &\n GeneratorTCPServerDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isListening' | 'started' | 'connections' | 'lastData' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/TextToSpeechAppleBuiltin.d.ts":"/* Auto generated by build script\n *\n * Text-to-speech synthesis using Apple's native speech synthesis\n *\n * ## Features\n * - Native Apple speech synthesis\n * - Natural sounding voices\n * - Privacy-focused on-device processing\n * - Multiple voice options\n * - Requires iOS 13+ (native speech synthesis)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the TTS model */\nexport type GeneratorAppleTTSActionLoadModel = Action & {\n __actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'\n}\n\n/* Generate audio */\nexport type GeneratorAppleTTSActionGenerate = ActionWithParams & {\n __actionName: 'GENERATOR_APPLE_TTS_GENERATE'\n params?: Array<{\n input: 'text'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Clean cache */\nexport type GeneratorAppleTTSActionCleanCache = Action & {\n __actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'\n}\n\n/* Cancel current generation and clear queue */\nexport type GeneratorAppleTTSActionCancel = Action & {\n __actionName: 'GENERATOR_APPLE_TTS_CANCEL'\n}\n\ninterface GeneratorAppleTTSDef {\n /*\nDefault property:\n{\n \"language\": \"en-US\",\n \"outputType\": \"play\",\n \"cacheGenerated\": true,\n \"autoInferEnable\": false,\n \"softBreakRegex\": \"^[^\\\\r\\\\n\\\\t\\\\f\\\\v]*([\\\\r\\\\n]+|[。!?!?.]\\\\B)\",\n \"hardBreakTime\": 500\n}\n */\n property?: {\n /* Initialize the TTS context on generator initialization */\n init?: boolean | DataLink\n /* Voice identifier */\n voice?: string | DataLink\n /* Language/locale (e.g., 'en-US') */\n language?: string | DataLink\n /* Output mode */\n outputType?: 'play' | 'file' | DataLink\n /* Enable cache for generated audio */\n cacheGenerated?: boolean | DataLink\n /* Text to generate */\n prompt?: string | DataLink\n /* Auto inference when prompt changes */\n autoInferEnable?: boolean | DataLink\n /* Segmentation rule for auto inference */\n softBreakRegex?: string | DataLink\n /* Time to force inference when softBreakRegex is not satisfied */\n hardBreakTime?: number | DataLink\n }\n events?: {\n /* Event triggered when state change */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['AppleTts']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleTts']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Generated audio file */\n generatedAudio?: () => Data<string>\n /* Generated audio file is playing */\n generatedAudioPlaying?: () => Data<boolean>\n }\n}\n\n/* Text-to-speech synthesis using Apple's native speech synthesis\n\n ## Features \n - Native Apple speech synthesis \n - Natural sounding voices \n - Privacy-focused on-device processing \n - Multiple voice options \n - Requires iOS 13+ (native speech synthesis) */\nexport type GeneratorAppleTTS = Generator &\n GeneratorAppleTTSDef & {\n templateKey: 'GENERATOR_APPLE_TTS'\n switches?: Array<\n SwitchDef &\n GeneratorAppleTTSDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/TextToSpeechGgml.d.ts":"/* Auto generated by build script\n *\n * Local Text-to-Speech (TTS) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)\n * You can use any converted model on HuggingFace.\n *\n * ## Notice\n * - The device RAM must be larger than 8GB\n * - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.\n * - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.\n * - Android: Recommended use Android 13+ system.\n * - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.\n * - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.\n * - Linux / Windows\n * - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property\n * - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorGGMLTTSActionLoadModel = Action & {\n __actionName: 'GENERATOR_GGML_TTS_LOAD_MODEL'\n}\n\n/* Generate audio */\nexport type GeneratorGGMLTTSActionGenerate = ActionWithParams & {\n __actionName: 'GENERATOR_GGML_TTS_GENERATE'\n params?: Array<{\n input: 'text'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Clean cache */\nexport type GeneratorGGMLTTSActionCleanCache = Action & {\n __actionName: 'GENERATOR_GGML_TTS_CLEAN_CACHE'\n}\n\n/* Release context */\nexport type GeneratorGGMLTTSActionReleaseContext = Action & {\n __actionName: 'GENERATOR_GGML_TTS_RELEASE_CONTEXT'\n}\n\n/* Cancel current generation and clear queue */\nexport type GeneratorGGMLTTSActionCancel = Action & {\n __actionName: 'GENERATOR_GGML_TTS_CANCEL'\n}\n\ninterface GeneratorGGMLTTSDef {\n /*\nDefault property:\n{\n \"vocoderUrl\": \"https://huggingface.co/ggml-org/WavTokenizer/resolve/main/WavTokenizer-Large-75-F16.gguf\",\n \"vocoderHashType\": \"sha256\",\n \"vocoderHash\": \"2356baa8631cc2995ea3465196a017a2733600d849a91180c0f97fa7fb375bbe\",\n \"vocoderBatchSize\": 4096,\n \"outputType\": \"play\",\n \"cacheGenerated\": true,\n \"autoInferEnable\": false,\n \"softBreakRegex\": \"^[^\\\\r\\\\n\\\\t\\\\f\\\\v]*([\\\\r\\\\n]+|[。!?!?.]\\\\B)\",\n \"hardBreakTime\": 500,\n \"completionTemperature\": 0.1,\n \"completionRepetitionPenalty\": 1.1,\n \"completionTopK\": 40,\n \"completionTopP\": 0.9,\n \"completionMinP\": 0.05,\n \"useGuideToken\": true,\n \"contextSize\": 8192,\n \"batchSize\": 8192,\n \"microBatchSize\": 512,\n \"maxThreads\": 2,\n \"accelVariant\": \"default\",\n \"mainGpu\": 0,\n \"gpuLayers\": 0,\n \"useMlock\": true,\n \"useMmap\": true,\n \"useFlashAttn\": \"off\"\n}\n */\n property?: {\n /* Initialize the TTS context on generator initialization */\n init?: boolean | DataLink\n /* The URL or path of model\n We used GGUF format model, please refer to https://github.com/ggerganov/llama.cpp/tree/master#description */\n modelUrl?: string | DataLink\n /* Hash type of model */\n modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Hash of model */\n modelHash?: string | DataLink\n /* The URL or path of vocoder model */\n vocoderUrl?: string | DataLink\n /* Hash type of vocoder model */\n vocoderHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Hash of vocoder model */\n vocoderHash?: string | DataLink\n /* Batch size of vocoder model */\n vocoderBatchSize?: number | DataLink\n /* Output mode */\n outputType?: 'play' | 'file' | DataLink\n /* Enable cache for generated audio */\n cacheGenerated?: boolean | DataLink\n /* Text to generate */\n prompt?: string | DataLink\n /* Speaker JSON */\n speaker?: {} | DataLink\n /* Auto inference when prompt changes */\n autoInferEnable?: boolean | DataLink\n /* Segmentation rule for auto inference */\n softBreakRegex?: string | DataLink\n /* Time to force inference when softBreakRegex is not satisfied */\n hardBreakTime?: number | DataLink\n /* Temperature */\n completionTemperature?: number | DataLink\n /* Repetition Penalty */\n completionRepetitionPenalty?: number | DataLink\n /* Top K sampling */\n completionTopK?: number | DataLink\n /* Top P sampling */\n completionTopP?: number | DataLink\n /* Min P sampling */\n completionMinP?: number | DataLink\n /* Set the random number generator (RNG) seed (default: -1, -1 = random seed) */\n completionSeed?: number | DataLink\n /* Number of tokens to predict */\n completionPredict?: number | DataLink\n /* Enable guide token to help prevent hallucinations by forcing the TTS to use the correct words. */\n useGuideToken?: boolean | DataLink\n /* Context size, for OutTTS recommended 4096 ~ 8192 (Default to 4096) */\n contextSize?: number | DataLink\n /* Logical batch size for prompt processing */\n batchSize?: number | DataLink\n /* Physical batch size for prompt processing */\n microBatchSize?: number | DataLink\n /* Number of threads */\n maxThreads?: number | DataLink\n /* Accelerator variant (Only for desktop)\n `default` - CPU / Metal (macOS) \n `vulkan` - Use Vulkan \n `cuda` - Use CUDA \n `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */\n accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink\n /* Devices. For example:\n \n Metal or CPU for iOS/tvOS/MacOS \n OpenCL or CPU for Android \n - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices) \n For Desktop, you may want to include/exclude GPUs */\n devices?: Array<string | DataLink> | DataLink\n /* Main GPU index */\n mainGpu?: number | DataLink\n /* Number of GPU layers (NOTE: Currently not supported for Android) */\n gpuLayers?: number | DataLink\n /* Use memory lock */\n useMlock?: boolean | DataLink\n /* Use mmap */\n useMmap?: boolean | DataLink\n /* Use Flash Attention for inference (Recommended with GPU enabled) */\n useFlashAttn?: 'auto' | 'on' | 'off' | DataLink\n }\n events?: {\n /* Event triggered when state change */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['GgmlTts']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['GgmlTts']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Generated audio file */\n generatedAudio?: () => Data<string>\n /* Generated audio file is playing */\n generatedAudioPlaying?: () => Data<boolean>\n }\n}\n\n/* Local Text-to-Speech (TTS) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)\n You can use any converted model on HuggingFace. \n\n ## Notice \n - The device RAM must be larger than 8GB \n - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal. \n - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal. \n - Android: Recommended use Android 13+ system. \n - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported. \n - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs. \n - Linux / Windows \n - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property \n - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) */\nexport type GeneratorGGMLTTS = Generator &\n GeneratorGGMLTTSDef & {\n templateKey: 'GENERATOR_GGML_TTS'\n switches?: Array<\n SwitchDef &\n GeneratorGGMLTTSDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/TextToSpeechOnnx.d.ts":"/* Auto generated by build script\n *\n * Local Text-to-Speech (TTS) inference based on ONNX Runtime and [transformers.js](https://huggingface.co/docs/transformers.js)\n * You can use any converted model on HuggingFace.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorTTSActionLoadModel = Action & {\n __actionName: 'GENERATOR_TTS_LOAD_MODEL'\n}\n\n/* Generate audio */\nexport type GeneratorTTSActionGenerate = ActionWithParams & {\n __actionName: 'GENERATOR_TTS_GENERATE'\n params?: Array<{\n input: 'text'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Clean cache */\nexport type GeneratorTTSActionCleanCache = Action & {\n __actionName: 'GENERATOR_TTS_CLEAN_CACHE'\n}\n\n/* Release context */\nexport type GeneratorTTSActionReleaseContext = Action & {\n __actionName: 'GENERATOR_TTS_RELEASE_CONTEXT'\n}\n\n/* Cancel current generation and clear queue */\nexport type GeneratorTTSActionCancel = Action & {\n __actionName: 'GENERATOR_TTS_CANCEL'\n}\n\ninterface GeneratorTTSDef {\n /*\nDefault property:\n{\n \"model\": \"BricksDisplay/vits-eng\",\n \"modelType\": \"auto\",\n \"vocoderModel\": \"speecht5_hifigan\",\n \"maxLength\": 4096,\n \"temperature\": 0.1,\n \"repetitionPenalty\": 1.1,\n \"doSample\": true,\n \"outputType\": \"play\",\n \"cacheGenerated\": true,\n \"speed\": 1,\n \"autoInferEnable\": false,\n \"softBreakRegex\": \"^[^\\\\r\\\\n\\\\t\\\\f\\\\v]*([\\\\r\\\\n]+|[。!?!?.]\\\\B)\",\n \"hardBreakTime\": 500,\n \"executionMode\": \"sequential\"\n}\n */\n property?: {\n /* Initialize the TTS context on generator initialization */\n init?: boolean | DataLink\n /* TTS model\n The mms-tts models are licensed under CC-BY-NC-4.0 */\n model?: string | DataLink\n /* Model type */\n modelType?: string | DataLink\n /* Quantize type */\n quantizeType?:\n | 'auto'\n | 'none'\n | 'fp16'\n | 'q8'\n | 'int8'\n | 'uint8'\n | 'q4'\n | 'bnb4'\n | 'q4f16'\n | DataLink\n /* Vocoder model for SpeechT5 */\n vocoderModel?: 'Custom' | 'speecht5_hifigan' | DataLink\n /* Custom vocoder model\n Choose model from https://huggingface.co/models?library=transformers.js&other=hifigan */\n customVocoderModel?: string | DataLink\n /* Speaker embedding, for SpeechT5 or StyleTTS (Kokoro) */\n speakerEmbedUrl?: string | DataLink\n /* Hash of `speakerEmbedUrl` */\n speakerEmbedHash?: string | DataLink\n /* Hash type of `speakerEmbedUrl` */\n speakerEmbedHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Speaker config, for OuteTTS model */\n speakerConfig?: {} | DataLink\n /* Audio token generation max length */\n maxLength?: number | DataLink\n /* Audio token generation temperature */\n temperature?: number | DataLink\n /* Audio token generation repetition penalty */\n repetitionPenalty?: number | DataLink\n /* Use greedy sampling for audio token generation */\n doSample?: boolean | DataLink\n /* Output mode */\n outputType?: 'play' | 'file' | DataLink\n /* Enable cache for generated audio */\n cacheGenerated?: boolean | DataLink\n /* Speed of the generated audio, for StyleTTS (Kokoro) */\n speed?: number | DataLink\n /* Text to generate */\n prompt?: string | DataLink\n /* Auto inference when prompt changes */\n autoInferEnable?: boolean | DataLink\n /* Segmentation rule for auto inference */\n softBreakRegex?: string | DataLink\n /* Time to force inference when softBreakRegex is not satisfied */\n hardBreakTime?: number | DataLink\n /* Executor candidates, descending order of priority\n Default will be xnnpack, wasm, cpu */\n executors?:\n | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>\n | DataLink\n /* Execution mode\n Usually when the model has many branches, setting this option to `parallel` will give you better performance. */\n executionMode?: 'sequential' | 'parallel' | DataLink\n /* QNN backend */\n qnnBackend?: 'HTP' | 'HTA' | 'DSP' | 'GPU' | 'CPU' | DataLink\n /* Enable FP16 for QNN HTP */\n qnnHtpEnableFp16?: boolean | DataLink\n /* Enable QNN debug */\n qnnEnableDebug?: boolean | DataLink\n }\n events?: {\n /* Event triggered when state change */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Tts']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Tts']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Generated audio file */\n generatedAudio?: () => Data<string>\n /* Generated audio file is playing */\n generatedAudioPlaying?: () => Data<boolean>\n }\n}\n\n/* Local Text-to-Speech (TTS) inference based on ONNX Runtime and [transformers.js](https://huggingface.co/docs/transformers.js)\n You can use any converted model on HuggingFace. */\nexport type GeneratorTTS = Generator &\n GeneratorTTSDef & {\n templateKey: 'GENERATOR_TTS'\n switches?: Array<\n SwitchDef &\n GeneratorTTSDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/TextToSpeechOpenAiLike.d.ts":"/* Auto generated by build script\n *\n * Generate speech from text using OpenAI's Text-to-Speech API\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Generate audio */\nexport type GeneratorOpenAiTTSActionGenerate = ActionWithParams & {\n __actionName: 'GENERATOR_OPENAI_TTS_GENERATE'\n params?: Array<{\n input: 'text'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Clean cache */\nexport type GeneratorOpenAiTTSActionCleanCache = Action & {\n __actionName: 'GENERATOR_OPENAI_TTS_CLEAN_CACHE'\n}\n\n/* Cancel current generation and clear queue */\nexport type GeneratorOpenAiTTSActionCancel = Action & {\n __actionName: 'GENERATOR_OPENAI_TTS_CANCEL'\n}\n\ninterface GeneratorOpenAiTTSDef {\n /*\nDefault property:\n{\n \"apiEndpoint\": \"https://api.openai.com/v1\",\n \"model\": \"tts-1\",\n \"voice\": \"alloy\",\n \"speed\": 1,\n \"outputType\": \"play\",\n \"playbackVolume\": 100,\n \"cacheGenerated\": true,\n \"autoInferEnable\": false,\n \"softBreakRegex\": \"^[^\\\\r\\\\n\\\\t\\\\f\\\\v]*([\\\\r\\\\n]+|[。!?!?.]\\\\B)\",\n \"hardBreakTime\": 500\n}\n */\n property?: {\n /* API endpoint URL */\n apiEndpoint?: string | DataLink\n /* OpenAI API Key */\n apiKey?: string | DataLink\n /* OpenAI TTS model */\n model?: string | DataLink\n /* Voice to use\n Select voice from https://openai.fm , default alloy */\n voice?: string | DataLink\n /* Additional instructions for the speech generation */\n instructions?: string | DataLink\n /* Speed of the generated audio */\n speed?: number | DataLink\n /* Output mode */\n outputType?: 'play' | 'file' | DataLink\n /* Playback volume (0 - 100) */\n playbackVolume?: number | DataLink\n /* Enable cache for generated audio */\n cacheGenerated?: boolean | DataLink\n /* Text to generate */\n prompt?: string | DataLink\n /* Auto inference when prompt changes */\n autoInferEnable?: boolean | DataLink\n /* Segmentation rule for auto inference */\n softBreakRegex?: string | DataLink\n /* Time to force inference when softBreakRegex is not satisfied */\n hardBreakTime?: number | DataLink\n }\n events?: {\n /* Event triggered when state change */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OpenaiTts']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OpenaiTts']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Generated audio file */\n generatedAudio?: () => Data<string>\n /* Generated audio file is playing */\n generatedAudioPlaying?: () => Data<boolean>\n }\n}\n\n/* Generate speech from text using OpenAI's Text-to-Speech API */\nexport type GeneratorOpenAiTTS = Generator &\n GeneratorOpenAiTTSDef & {\n templateKey: 'GENERATOR_OPENAI_TTS'\n switches?: Array<\n SwitchDef &\n GeneratorOpenAiTTSDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/ThermalPrinter.d.ts":"/* Auto generated by build script\n *\n * ESC/POS thermal receipt printer control via Bluetooth or USB\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Init thermal printer connection */\nexport type GeneratorThermalPrinterActionInit = Action & {\n __actionName: 'GENERATOR_THERMAL_PRINTER_INIT'\n}\n\n/* Scan thermal printer */\nexport type GeneratorThermalPrinterActionScan = Action & {\n __actionName: 'GENERATOR_THERMAL_PRINTER_SCAN'\n}\n\n/* Dispose thermal printer connection */\nexport type GeneratorThermalPrinterActionDispose = Action & {\n __actionName: 'GENERATOR_THERMAL_PRINTER_DISPOSE'\n}\n\n/* Start print */\nexport type GeneratorThermalPrinterActionPrint = ActionWithParams & {\n __actionName: 'GENERATOR_THERMAL_PRINTER_PRINT'\n params?: Array<\n | {\n input: 'options'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'rawCommands'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Check thermal printer status */\nexport type GeneratorThermalPrinterActionCheckStatus = Action & {\n __actionName: 'GENERATOR_THERMAL_PRINTER_CHECK_STATUS'\n}\n\ninterface GeneratorThermalPrinterDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"lang\": \"ANK\",\n \"scanTimeout\": 5000,\n \"stateUpdateInterval\": 5000,\n \"cutMode\": \"PARTIAL\"\n}\n */\n property?: {\n /* Connect printer on generator initialized */\n init?: boolean | DataLink\n /* Connection driver (`castles` driver: built-in or WiFi printer on Castles Saturn PDA) */\n driver?: 'escpos' | 'star' | 'tsc' | 'castles' | DataLink\n /* The address of the printer (For castles driver: `mode=builtin` (Saturn 1000) or `mode=wifi` (Saturn 7000); optional `heatLevel=1-5`, default 3) */\n connectString?: string | DataLink\n /* The language of the printer (only for EPSON and TSC drivers) */\n lang?: 'ANK' | 'CHINESE' | 'TAIWAN' | 'KOREAN' | 'THAI' | 'SOUTHASIA' | DataLink\n /* The timeout of scanning */\n scanTimeout?: number | DataLink\n /* State update interval, 0 means no update automatically */\n stateUpdateInterval?: number | DataLink\n /* Enable page mode on printing */\n pageMode?: boolean | DataLink\n /* Printable page area width */\n pageWidth?: number | DataLink\n /* Printable page area height */\n pageHeight?: number | DataLink\n /* Cut mode at the end of printing */\n cutMode?: 'NONE' | 'FULL' | 'PARTIAL' | DataLink\n /* Print payload\n example: \n { type: 'text', content: 'Hello, World!' } \n { type: 'feed', feedLines: 1 } \n { type: 'reverse-feed', feedLines: 1 } \n { type: 'image', content: '/path/to/file' } \n { type: 'line-space', lineSpace: 1 } \n { type: 'barcode', content: '1234567890', barcodeType: 'CODE128' } \n { type: 'symbol', content: '1234567890', symbolType: 'QRCODE' } \n Notes: \n - `reverse-feed` works on ESC/POS driver and castles driver (line mode only) \n - `width` and `height` in Star driver is magnification factor \n - `y` position in ESC/POS is use feed lines to offset \n - `textFont` only works on TSC driver \n - castles driver: `image` requires `height` in line mode \n - castles driver: `UPC_A`, `UPC_E`, `ITF` barcode types are not supported */\n payload?:\n | Array<\n | DataLink\n | {\n type?:\n | 'text'\n | 'image'\n | 'barcode'\n | 'qrcode'\n | 'line-space'\n | 'feed'\n | 'reverse-feed'\n | DataLink\n content?: string | DataLink\n width?: number | DataLink\n height?: number | DataLink\n x?: number | DataLink\n y?: number | DataLink\n align?: 'LEFT' | 'CENTER' | 'RIGHT' | DataLink\n textSmooth?: boolean | DataLink\n textEmphasize?: boolean | DataLink\n textUnderline?: boolean | DataLink\n textLang?: 'EN' | 'JA' | 'ZH_CN' | 'ZH_TW' | 'KO' | 'TH' | 'VI' | 'MULTI' | DataLink\n textFont?: string | DataLink\n barcodeType?:\n | 'CODE39'\n | 'CODE93'\n | 'CODE128'\n | 'EAN13'\n | 'JAN13'\n | 'EAN8'\n | 'JAN8'\n | 'UPC_A'\n | 'UPC_E'\n | 'ITF'\n | DataLink\n barcodeHRI?: 'OFF' | 'ABOVE' | 'BELOW' | 'BOTH' | DataLink\n qrcodeModel?: '1' | '2' | DataLink\n qrcodeSize?: number | DataLink\n qrcodeLevel?: 'L' | 'M' | 'Q' | 'H' | DataLink\n qrcodeMask?: 'S0' | 'S1' | 'S2' | 'S3' | 'S4' | 'S5' | 'S6' | 'S7' | DataLink\n feedLines?: number | DataLink\n lineSpace?: number | DataLink\n }\n >\n | DataLink\n /* Raw ASCII commands to print (not supported on castles driver) */\n rawCommands?: string | DataLink\n }\n events?: {\n /* Event of connection error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['ThermalPrinter']['onError']>>\n }\n outlets?: {\n /* Is thermal printer initialized */\n initialized?: () => Data<boolean>\n /* Thermal printer status */\n status?: () => Data<{ [key: string]: any }>\n /* Discovered devices */\n discoveredDevices?: () => Data<Array<{ [key: string]: any }>>\n /* Last error message */\n lastError?: () => Data<string>\n }\n}\n\n/* ESC/POS thermal receipt printer control via Bluetooth or USB */\nexport type GeneratorThermalPrinter = Generator &\n GeneratorThermalPrinterDef & {\n templateKey: 'GENERATOR_THERMAL_PRINTER'\n switches?: Array<\n SwitchDef &\n GeneratorThermalPrinterDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'initialized' | 'status' | 'discoveredDevices' | 'lastError'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Tick.d.ts":"/* Auto generated by build script\n *\n * Periodic timer that triggers events at a configurable interval\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Start the tick */\nexport type GeneratorTickAction_ = Action & {\n __actionName: 'GENERATOR_TICK'\n}\n\n/* Cancel the tick */\nexport type GeneratorTickActionCancel = Action & {\n __actionName: 'GENERATOR_TICK_CANCEL'\n}\n\ninterface GeneratorTickDef {\n /*\nDefault property:\n{}\n */\n property?: {\n /* Start tick on generator initialized */\n init?: boolean | DataLink\n /* Tick interval in milliseconds for countdown */\n interval?: number | DataLink\n /* Initial value of countdown */\n countdownStartValue?: number | DataLink\n /* Interval of value for countdown */\n countdownInterval?: number | DataLink\n /* Make countdown repeatable */\n repeat?: boolean | DataLink\n /* Map for PROPERTY_BANK_RESULT */\n map?: {} | DataLink\n /* Fallback of MAP_OBJECT */\n mapFallback?: any\n }\n events?: {\n /* Event for each tick start */\n ticking?: Array<EventAction<string & keyof TemplateEventPropsMap['Tick']['ticking']>>\n /* Event for tick completed */\n completed?: Array<EventAction<string & keyof TemplateEventPropsMap['Tick']['completed']>>\n }\n outlets?: {\n /* Countdown step value */\n countdown?: () => Data<string | number>\n /* Is tick running? */\n running?: () => Data<boolean | string | number>\n }\n}\n\n/* Periodic timer that triggers events at a configurable interval */\nexport type GeneratorTick = Generator &\n GeneratorTickDef & {\n templateKey: 'GENERATOR_TICK'\n switches?: Array<\n SwitchDef &\n GeneratorTickDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'countdown' | 'running'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Udp.d.ts":"/* Auto generated by build script\n *\n * UDP socket communication\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Bind UDP port */\nexport type GeneratorUDPActionBind = Action & {\n __actionName: 'GENERATOR_UDP_BIND'\n}\n\n/* Send data to target */\nexport type GeneratorUDPActionSend = ActionWithParams & {\n __actionName: 'GENERATOR_UDP_SEND'\n params?: Array<\n | {\n input: 'targetHost'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'targetPort'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'sendData'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Close UDP */\nexport type GeneratorUDPActionClose = Action & {\n __actionName: 'GENERATOR_UDP_CLOSE'\n}\n\ninterface GeneratorUDPDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"type\": \"udp4\",\n \"encoding\": \"base64\",\n \"broadcast\": false,\n \"multicast\": \"\"\n}\n */\n property?: {\n /* Bind port on generator initialized */\n init?: boolean | DataLink\n /* The family of socket */\n type?: 'udp4' | 'udp6' | DataLink\n /* Encoding of data */\n encoding?: 'base64' | 'utf8' | 'ascii' | DataLink\n /* Local bind port of UDP (0 or empty is random) */\n localPort?: number | DataLink\n /* Enable receive broadcast packets */\n broadcast?: boolean | DataLink\n /* Join multicast group (Multicast address) */\n multicast?: string | DataLink\n }\n events?: {\n /* Event of UDP port is binded */\n onReady?: Array<EventAction>\n /* Event of receive data */\n onData?: Array<EventAction<string & keyof TemplateEventPropsMap['Udp']['onData']>>\n /* Event of socket closeed */\n onClose?: Array<EventAction>\n /* Event of socket error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Udp']['onError']>>\n }\n outlets?: {\n /* Local UDP binded port */\n port?: () => Data<number>\n /* Last received packet */\n lastReceive?: () => Data<{\n address?: string\n port?: number\n data?: any\n [key: string]: any\n }>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* UDP socket communication */\nexport type GeneratorUDP = Generator &\n GeneratorUDPDef & {\n templateKey: 'GENERATOR_UDP'\n switches?: Array<\n SwitchDef &\n GeneratorUDPDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'port' | 'lastReceive' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/VadGgml.d.ts":"/* Auto generated by build script\n *\n * Local Voice Activity Detection (VAD) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)\n *\n * ## Notice\n * - Web: Supported with WASM CPU in Web Preview.\n * - WebGPU is not used for browser VAD; the wasm package falls back to CPU for the VAD graph.\n * - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable.\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorVadInferenceActionLoadModel = Action & {\n __actionName: 'GENERATOR_VAD_INFERENCE_LOAD_MODEL'\n}\n\n/* Detect speech in audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */\nexport type GeneratorVadInferenceActionDetectFile = ActionWithParams & {\n __actionName: 'GENERATOR_VAD_INFERENCE_DETECT_FILE'\n params?: Array<\n | {\n input: 'fileUrl'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'threshold'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSpeechDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSilenceDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxSpeechDurationS'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'speechPadMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'samplesOverlap'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Detect speech in audio data. Currently only support base64 encoded audio data (16-bit PCM, mono, 16kHz) */\nexport type GeneratorVadInferenceActionDetectData = ActionWithParams & {\n __actionName: 'GENERATOR_VAD_INFERENCE_DETECT_DATA'\n params?: Array<\n | {\n input: 'data'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'threshold'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSpeechDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSilenceDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxSpeechDurationS'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'speechPadMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'samplesOverlap'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Clear downloaded files (model, audio) & current jobs */\nexport type GeneratorVadInferenceActionClearDownload = Action & {\n __actionName: 'GENERATOR_VAD_INFERENCE_CLEAR_DOWNLOAD'\n}\n\n/* Release context */\nexport type GeneratorVadInferenceActionReleaseContext = Action & {\n __actionName: 'GENERATOR_VAD_INFERENCE_RELEASE_CONTEXT'\n}\n\ninterface GeneratorVadInferenceDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"modelName\": \"silero-v6.2.0\",\n \"modelUseGPU\": true,\n \"modelThreads\": 4,\n \"detectThreshold\": 0.5,\n \"detectMinSpeechDurationMs\": 250,\n \"detectMinSilenceDurationMs\": 100,\n \"detectMaxSpeechDurationS\": 30,\n \"detectSpeechPadMs\": 30,\n \"detectSamplesOverlap\": 0.1\n}\n */\n property?: {\n /* Initialize the VAD context on generator initialization\n Please note that it will take some RAM depending on the model size */\n init?: boolean | DataLink\n /* Use model name, currently only supports the Silero VAD model.\n The model download progress will be done in preload stage or the generator initialization stage. \n You can also choose `custom` option and set `Model URL` and `Model SHA1` to use your own model */\n modelName?: 'custom' | 'silero-v6.2.0' | 'silero-v5.1.2' | DataLink\n /* The URL or path of model\n We used `ggml` format model, please refer to https://huggingface.co/ggml-org/whisper-vad */\n modelUrl?: string | DataLink\n /* Hash type of model */\n modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink\n /* Hash of model */\n modelHash?: string | DataLink\n /* Use GPU Acceleration for inference. Currently iOS only. */\n modelUseGPU?: boolean | DataLink\n /* Number of threads to use for processing */\n modelThreads?: number | DataLink\n /* Speech probability threshold (0.0-1.0) */\n detectThreshold?: number | DataLink\n /* Minimum speech duration in milliseconds */\n detectMinSpeechDurationMs?: number | DataLink\n /* Minimum silence duration in milliseconds */\n detectMinSilenceDurationMs?: number | DataLink\n /* Maximum speech duration in seconds */\n detectMaxSpeechDurationS?: number | DataLink\n /* Padding around speech segments in milliseconds */\n detectSpeechPadMs?: number | DataLink\n /* Overlap between analysis windows (0.0-1.0) */\n detectSamplesOverlap?: number | DataLink\n /* The file URL or path to be analyzed.\n It only supported `wav` format with 16kHz sample rate & single (mono) channel */\n detectFileUrl?: string | DataLink\n /* MD5 of file to be analyzed */\n detectFileMd5?: string | DataLink\n }\n events?: {\n /* Event triggered when context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['VadInference']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['VadInference']['onError']>>\n /* Event triggered when got detection result */\n onDetected?: Array<\n EventAction<string & keyof TemplateEventPropsMap['VadInference']['onDetected']>\n >\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Context details */\n contextDetails?: () => Data<{\n state?: string\n contextId?: string\n gpu?: string\n reasonNoGPU?: string\n [key: string]: any\n }>\n /* Is detecting */\n isDetecting?: () => Data<boolean>\n /* Detection segments result */\n detectionSegments?: () => Data<\n Array<{\n start?: number\n end?: number\n confidence?: number\n t0?: number\n t1?: number\n [key: string]: any\n }>\n >\n /* Detection details */\n detectionDetails?: () => Data<{\n result?: string\n segments?: Array<{\n start?: number\n end?: number\n confidence?: number\n t0?: number\n t1?: number\n [key: string]: any\n }>\n time?: number\n startTime?: number\n endTime?: number\n [key: string]: any\n }>\n }\n}\n\n/* Local Voice Activity Detection (VAD) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)\n\n ## Notice \n - Web: Supported with WASM CPU in Web Preview. \n - WebGPU is not used for browser VAD; the wasm package falls back to CPU for the VAD graph. \n - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable. */\nexport type GeneratorVadInference = Generator &\n GeneratorVadInferenceDef & {\n templateKey: 'GENERATOR_VAD_INFERENCE'\n switches?: Array<\n SwitchDef &\n GeneratorVadInferenceDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'contextDetails'\n | 'isDetecting'\n | 'detectionSegments'\n | 'detectionDetails'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/VadOnnx.d.ts":"/* Auto generated by build script\n *\n * Local Voice Activity Detection (VAD) inference based on [transformers.js](https://huggingface.co/docs/transformers.js)\n * You can use any compatible VAD model from HuggingFace (Silero VAD, smart-turn, etc.)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model */\nexport type GeneratorVadInferenceOnnxActionLoadModel = Action & {\n __actionName: 'GENERATOR_ONNX_VAD_LOAD_MODEL'\n}\n\n/* Detect speech in audio file */\nexport type GeneratorVadInferenceOnnxActionDetectFile = ActionWithParams & {\n __actionName: 'GENERATOR_ONNX_VAD_DETECT_FILE'\n params?: Array<\n | {\n input: 'fileUrl'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'threshold'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSpeechDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSilenceDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxSpeechDurationS'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'speechPadMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Detect speech in audio data */\nexport type GeneratorVadInferenceOnnxActionDetectData = ActionWithParams & {\n __actionName: 'GENERATOR_ONNX_VAD_DETECT_DATA'\n params?: Array<\n | {\n input: 'data'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'threshold'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSpeechDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'minSilenceDurationMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'maxSpeechDurationS'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'speechPadMs'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Clean cache */\nexport type GeneratorVadInferenceOnnxActionCleanCache = Action & {\n __actionName: 'GENERATOR_ONNX_VAD_CLEAN_CACHE'\n}\n\n/* Release context */\nexport type GeneratorVadInferenceOnnxActionReleaseContext = Action & {\n __actionName: 'GENERATOR_ONNX_VAD_RELEASE_CONTEXT'\n}\n\ninterface GeneratorVadInferenceOnnxDef {\n /*\nDefault property:\n{\n \"modelType\": \"auto\",\n \"detectThreshold\": 0.5,\n \"detectMinSpeechDurationMs\": 250,\n \"detectMinSilenceDurationMs\": 100,\n \"detectMaxSpeechDurationS\": 30,\n \"detectSpeechPadMs\": 30,\n \"executionMode\": \"sequential\"\n}\n */\n property?: {\n /* Initialize the VAD context on generator initialization */\n init?: boolean | DataLink\n /* VAD model */\n model?: string | DataLink\n /* Model type (auto-detected from config.json) */\n modelType?: string | DataLink\n /* Quantize type */\n quantizeType?:\n | 'auto'\n | 'none'\n | 'fp16'\n | 'q8'\n | 'int8'\n | 'uint8'\n | 'q4'\n | 'bnb4'\n | 'q4f16'\n | DataLink\n /* Speech probability threshold (0.0-1.0) */\n detectThreshold?: number | DataLink\n /* Minimum speech duration in milliseconds */\n detectMinSpeechDurationMs?: number | DataLink\n /* Minimum silence duration in milliseconds */\n detectMinSilenceDurationMs?: number | DataLink\n /* Maximum speech duration in seconds */\n detectMaxSpeechDurationS?: number | DataLink\n /* Padding around speech segments in milliseconds */\n detectSpeechPadMs?: number | DataLink\n /* Executor candidates, descending order of priority\n Default will be xnnpack, wasm, cpu */\n executors?:\n | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>\n | DataLink\n /* Execution mode\n Usually when the model has many branches, setting this option to `parallel` will give you better performance. */\n executionMode?: 'sequential' | 'parallel' | DataLink\n /* QNN backend */\n qnnBackend?: 'HTP' | 'HTA' | 'DSP' | 'GPU' | 'CPU' | DataLink\n /* Enable FP16 for QNN HTP */\n qnnHtpEnableFp16?: boolean | DataLink\n /* Enable QNN debug */\n qnnEnableDebug?: boolean | DataLink\n }\n events?: {\n /* Event triggered when context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['OnnxVad']['onContextStateChange']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxVad']['onError']>>\n /* Event triggered when got detection result */\n onDetected?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxVad']['onDetected']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Is detecting */\n isDetecting?: () => Data<boolean>\n /* Detection segments result */\n detectionSegments?: () => Data<\n Array<{\n start?: number\n end?: number\n confidence?: number\n t0?: number\n t1?: number\n [key: string]: any\n }>\n >\n /* Detection details */\n detectionDetails?: () => Data<{\n result?: string\n segments?: Array<{\n start?: number\n end?: number\n confidence?: number\n t0?: number\n t1?: number\n [key: string]: any\n }>\n time?: number\n startTime?: number\n endTime?: number\n [key: string]: any\n }>\n }\n}\n\n/* Local Voice Activity Detection (VAD) inference based on [transformers.js](https://huggingface.co/docs/transformers.js)\n You can use any compatible VAD model from HuggingFace (Silero VAD, smart-turn, etc.) */\nexport type GeneratorVadInferenceOnnx = Generator &\n GeneratorVadInferenceOnnxDef & {\n templateKey: 'GENERATOR_ONNX_VAD'\n switches?: Array<\n SwitchDef &\n GeneratorVadInferenceOnnxDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'contextState' | 'isDetecting' | 'detectionSegments' | 'detectionDetails'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/VadTraditional.d.ts":"/* Auto generated by build script\n *\n * Traditional Voice Activity Detection (VAD) using pitch detection and RMS volume analysis\n * No model download required - pure algorithmic approach\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Detect speech in audio file */\nexport type GeneratorVadInferenceTraditionalActionDetectFile = ActionWithParams & {\n __actionName: 'GENERATOR_TRADITIONAL_VAD_DETECT_FILE'\n params?: Array<{\n input: 'fileUrl'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Detect speech in audio data stream */\nexport type GeneratorVadInferenceTraditionalActionDetectData = ActionWithParams & {\n __actionName: 'GENERATOR_TRADITIONAL_VAD_DETECT_DATA'\n params?: Array<{\n input: 'data'\n value?: any | EventProperty\n mapping?: string\n }>\n}\n\ninterface GeneratorVadInferenceTraditionalDef {\n /*\nDefault property:\n{\n \"detectVocalFreqMin\": 75,\n \"detectVocalFreqMax\": 900,\n \"detectThreshold\": 0.5,\n \"detectMinSpeechDurationMs\": 250,\n \"detectMinSilenceDurationMs\": 100,\n \"detectMaxSpeechDurationS\": 30,\n \"detectSpeechPadMs\": 30\n}\n */\n property?: {\n /* Minimum vocal frequency in Hz */\n detectVocalFreqMin?: number | DataLink\n /* Maximum vocal frequency in Hz */\n detectVocalFreqMax?: number | DataLink\n /* Volume threshold in dB */\n detectVolumeThreshold?: number | DataLink\n /* Speech probability threshold (0.0-1.0) - maps to frequency clarity */\n detectThreshold?: number | DataLink\n /* Minimum speech duration in milliseconds */\n detectMinSpeechDurationMs?: number | DataLink\n /* Minimum silence duration in milliseconds */\n detectMinSilenceDurationMs?: number | DataLink\n /* Maximum speech duration in seconds */\n detectMaxSpeechDurationS?: number | DataLink\n /* Padding around speech segments in milliseconds */\n detectSpeechPadMs?: number | DataLink\n /* The file URL or path to be analyzed */\n detectFileUrl?: string | DataLink\n /* MD5 of file to be analyzed */\n detectFileMd5?: string | DataLink\n }\n events?: {\n /* Event triggered when context state changes */\n onContextStateChange?: Array<\n EventAction<string & keyof TemplateEventPropsMap['TraditionalVad']['onContextStateChange']>\n >\n /* Event triggered when detection result is available */\n onDetected?: Array<\n EventAction<string & keyof TemplateEventPropsMap['TraditionalVad']['onDetected']>\n >\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['TraditionalVad']['onError']>>\n }\n outlets?: {\n /* Context state */\n contextState?: () => Data<string>\n /* Is detecting */\n isDetecting?: () => Data<boolean>\n /* Is speaking (real-time) */\n isSpeaking?: () => Data<boolean>\n /* Detection segments result */\n detectionSegments?: () => Data<\n Array<{\n t0?: number\n t1?: number\n [key: string]: any\n }>\n >\n /* Current volume in dB */\n currentVolume?: () => Data<number>\n /* Current frequency clarity (0-1) */\n currentClarity?: () => Data<number>\n /* Current detected frequency in Hz */\n currentFrequency?: () => Data<number>\n }\n}\n\n/* Traditional Voice Activity Detection (VAD) using pitch detection and RMS volume analysis\n No model download required - pure algorithmic approach */\nexport type GeneratorVadInferenceTraditional = Generator &\n GeneratorVadInferenceTraditionalDef & {\n templateKey: 'GENERATOR_TRADITIONAL_VAD'\n switches?: Array<\n SwitchDef &\n GeneratorVadInferenceTraditionalDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'contextState'\n | 'isDetecting'\n | 'isSpeaking'\n | 'detectionSegments'\n | 'currentVolume'\n | 'currentClarity'\n | 'currentFrequency'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/VectorStore.d.ts":"/* Auto generated by build script\n *\n * Vector database for semantic search. Supports GGML (on-device GGUF models) and OpenAI Compatible API (OpenAI/ollama/llama.cpp) as embedding sources\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Load the model (Only if source is ggml) */\nexport type GeneratorVectorStoreActionModelLoad = Action & {\n __actionName: 'GENERATOR_VECTOR_STORE_MODEL_LOAD'\n}\n\n/* Release the model (Only if source is ggml) */\nexport type GeneratorVectorStoreActionModelRelease = Action & {\n __actionName: 'GENERATOR_VECTOR_STORE_MODEL_RELEASE'\n}\n\n/* Reset the embedding session */\nexport type GeneratorVectorStoreActionReset = ActionWithParams & {\n __actionName: 'GENERATOR_VECTOR_STORE_RESET'\n params?: Array<{\n input: 'resetType'\n value?: 'session' | 'all' | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Insert file content with path or url, support Office / OpenOffice / PDF\n\n PDF is not currently supprted in iOS / Android */\nexport type GeneratorVectorStoreActionInsertFile = ActionWithParams & {\n __actionName: 'GENERATOR_VECTOR_STORE_INSERT_FILE'\n params?: Array<\n | {\n input: 'filePath'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileExtension'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'chunkSize'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Cancel the file download */\nexport type GeneratorVectorStoreActionCancelFileDownload = Action & {\n __actionName: 'GENERATOR_VECTOR_STORE_CANCEL_FILE_DOWNLOAD'\n}\n\n/* Insert pure text content to vector store */\nexport type GeneratorVectorStoreActionInsertContent = ActionWithParams & {\n __actionName: 'GENERATOR_VECTOR_STORE_INSERT_CONTENT'\n params?: Array<\n | {\n input: 'textContent'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: {} | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'chunkSize'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Remove file from vector store */\nexport type GeneratorVectorStoreActionRemoveFile = ActionWithParams & {\n __actionName: 'GENERATOR_VECTOR_STORE_REMOVE_FILE'\n params?: Array<{\n input: 'fileName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Search similar text chunks in vector store */\nexport type GeneratorVectorStoreActionSearch = ActionWithParams & {\n __actionName: 'GENERATOR_VECTOR_STORE_SEARCH'\n params?: Array<\n | {\n input: 'text'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'filename'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'limit'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'threshold'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'ignoreThreshold'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\ninterface GeneratorVectorStoreDef {\n /*\nDefault property:\n{\n \"source\": \"ggml\",\n \"ggmlContextSize\": 512,\n \"openaiBaseUrl\": \"https://api.openai.com/v1\",\n \"openaiModel\": \"text-embedding-3-small\",\n \"embedSessionId\": \"default-embeddings\",\n \"fileChunkSize\": 256\n}\n */\n property?: {\n /* Initialize embedding model context & tokenizer context on subspace mounted */\n init?: boolean | DataLink\n /* Source of embedding model. Note that you can't use the saved embedddings data in different sources. */\n source?: 'ggml' | 'openai' | DataLink\n /* Path of ggml model */\n ggmlModelUrl?: string | DataLink\n /* Hash type of ggml model */\n ggmlModelHashType?: 'sha256' | 'sha1' | 'md5' | DataLink\n /* Hash of ggml model */\n ggmlModelHash?: string | DataLink\n /* Size of ggml context */\n ggmlContextSize?: number | DataLink\n /* Pooling type of ggml model */\n ggmlPoolingType?: 'none' | 'mean' | 'cls' | 'last' | 'rank' | DataLink\n /* GGML accelerator variant (Only for desktop)\n `default` - CPU / Metal (macOS) \n `vulkan` - Use Vulkan \n `cuda` - Use CUDA \n `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */\n ggmlAccelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink\n /* Devices. For example:\n \n Metal or CPU for iOS/tvOS/MacOS \n OpenCL or CPU for Android \n - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices) \n For Desktop, you may want to include/exclude GPUs */\n ggmlDevices?: Array<string | DataLink> | DataLink\n /* Normalize */\n ggmlEmbdNormalize?: number | DataLink\n /* API key of OpenAI Compatible API */\n openaiApiKey?: string | DataLink\n /* Base URL of OpenAI Compatible API. For example, we can use ollama / llama.cpp server instead of openai */\n openaiBaseUrl?: string | DataLink\n /* Model of OpenAI Compatible API */\n openaiModel?: 'text-embedding-3-small' | 'text-embedding-3-large' | DataLink\n /* Session ID of embedding */\n embedSessionId?: string | DataLink\n /* Storage type of embedding */\n embedStorageType?: 'file' | 'memory' | DataLink\n /* Tokenizer model URL (Recommended to use same with your LLM model, the model will just load with vocab_only mode) */\n tokenizerModelUrl?: string | DataLink\n /* Tokenizer model hash */\n tokenizerModelHash?: string | DataLink\n /* Tokenizer model hash type */\n tokenizerModelHashType?: 'sha256' | 'sha1' | 'md5' | DataLink\n /* Chunk size to handle file content (token), must be less then embedding model context size */\n fileChunkSize?: number | DataLink\n }\n events?: {\n /* Event triggered when error occurs */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['VectorStore']['onError']>>\n }\n outlets?: {\n /* undefined */\n isReady?: () => Data<boolean>\n /* Whether the embedding is processing */\n processing?: () => Data<boolean>\n /* Progress of embedding processing */\n processProgress?: () => Data<{\n chunking?: number\n embedding?: number\n writing?: number\n [key: string]: any\n }>\n /* Files inserted to embedding */\n files?: () => Data<Array<string>>\n /* Search result */\n searchResult?: () => Data<\n Array<{\n sessionId?: string\n payload?: { [key: string]: any }\n filename?: string\n text?: string\n textTokenSize?: number\n fileTokenPos?: number\n fileTokenLength?: number\n distance?: number\n [key: string]: any\n }>\n >\n }\n}\n\n/* Vector database for semantic search. Supports GGML (on-device GGUF models) and OpenAI Compatible API (OpenAI/ollama/llama.cpp) as embedding sources */\nexport type GeneratorVectorStore = Generator &\n GeneratorVectorStoreDef & {\n templateKey: 'GENERATOR_VECTOR_STORE'\n switches?: Array<\n SwitchDef &\n GeneratorVectorStoreDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'isReady' | 'processing' | 'processProgress' | 'files' | 'searchResult'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/Watchdog.d.ts":"/* Auto generated by build script\n *\n * Trigger event with timeout by listening to specified events\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Reset watch */\nexport type GeneratorWatchdogActionResetWatch = Action & {\n __actionName: 'GENERATOR_WATCHDOG_RESET_WATCH'\n}\n\ninterface GeneratorWatchdogDef {\n /*\nDefault property:\n{\n \"listening\": false,\n \"timeout\": 30000\n}\n */\n property?: {\n /* Start listening event */\n listening?: boolean | DataLink\n /* If no other events are fired after the specified event is fired, it times out and fires the Watchdog event. */\n timeout?: number | DataLink\n /* Reset timeout timer on properties change */\n resetTimeoutOnChange?: boolean | DataLink\n /* Set what brick id (allow mutiple) to listen for press */\n brickOnPress?: Array<string | DataLink> | DataLink\n /* Set what brick id (allow mutiple) to listen for focus */\n brickOnFocus?: Array<string | DataLink> | DataLink\n /* Set what brick id (allow mutiple) to listen for blur */\n brickOnBlur?: Array<string | DataLink> | DataLink\n /* Set what canvas id (allow mutiple) to listen for enter */\n canvasOnEnter?: Array<string | DataLink> | DataLink\n /* Set what canvas id (allow mutiple) to listen for exit */\n canvasOnExit?: Array<string | DataLink> | DataLink\n /* Set what Data id (allow mutiple) to listen for change */\n propertyBankOnChange?: Array<string | DataLink> | DataLink\n /* Set what Data id (allow mutiple) to listen for update */\n propertyBankOnUpdate?: Array<string | DataLink> | DataLink\n /* Set what Data id (allow mutiple) to listen for hit */\n propertyBankOnHit?: Array<string | DataLink> | DataLink\n /* Set what Data id (allow mutiple) to listen for hit */\n propertyBankOnNotHit?: Array<string | DataLink> | DataLink\n }\n events?: {\n /* Event on specific sender id trigger event */\n onEvent?: Array<EventAction<string & keyof TemplateEventPropsMap['Watchdog']['onEvent']>>\n /* Event on timeout */\n onTimeout?: Array<EventAction<string & keyof TemplateEventPropsMap['Watchdog']['onTimeout']>>\n }\n outlets?: {\n /* The last event */\n lastEvent?: () => Data<{\n id?: string\n type?: string\n triggerType?: string\n timeout?: number\n }>\n /* The type fo last event */\n lastEventType?: () => Data<string>\n /* The trigger type of last event */\n lastEventTriggerType?: () => Data<string>\n /* The sender id of last event */\n lastEventSenderId?: () => Data<string>\n /* Is timed out */\n isTimedOut?: () => Data<boolean>\n }\n}\n\n/* Trigger event with timeout by listening to specified events */\nexport type GeneratorWatchdog = Generator &\n GeneratorWatchdogDef & {\n templateKey: 'GENERATOR_WATCHDOG'\n switches?: Array<\n SwitchDef &\n GeneratorWatchdogDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'lastEvent'\n | 'lastEventType'\n | 'lastEventTriggerType'\n | 'lastEventSenderId'\n | 'isTimedOut'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/WebCrawler.d.ts":"/* Auto generated by build script\n *\n * Extract web content via CSS selectors. Supports WebView method (iOS/Android, renders JS) and HTTP method (all platforms, direct request)\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Run Crawler request with defined properties */\nexport type GeneratorWebCrawlerActionRunRequest = Action & {\n __actionName: 'GENERATOR_WEB_CRAWLER_RUN_REQUEST'\n}\n\ninterface GeneratorWebCrawlerDef {\n /*\nDefault property:\n{\n \"init\": false,\n \"httpMethod\": \"GET\",\n \"timeout\": 10000,\n \"attributePath\": \"textContent\"\n}\n */\n property?: {\n /* Start Crawler request on generator initialized */\n init?: boolean | DataLink\n /* URL of crawler request */\n url?: string | DataLink\n /* Method of crawler request\n\n Platform not supported for `webview`: tvOS, Desktop, Web */\n method?: 'webview' | 'http' | DataLink\n /* HTTP method of crawler request (weview only supported GET, POST) */\n httpMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | DataLink\n /* Body of crawler request */\n body?: string | DataLink\n /* User-Agent of crawler request */\n userAgent?: string | DataLink\n /* Headers of crawler request */\n headers?: {} | DataLink\n /* Timeout of crawler request */\n timeout?: number | DataLink\n /* CSS Query Selector of selected element */\n selector?: string | DataLink\n /* Attribute path of HTMLElement */\n attributePath?: string | DataLink\n /* Multiple selectors and attribute paths. */\n selectorList?:\n | Array<\n | DataLink\n | {\n selector?: string | DataLink\n attributePath?: string | DataLink\n }\n >\n | DataLink\n }\n events?: {\n /* Event of crawling start */\n onStart?: Array<EventAction>\n /* Event of crawling end */\n onEnd?: Array<EventAction>\n }\n outlets?: {\n /* Response for CRAWLER request (selector) */\n response?: () => Data<string>\n /* Responses for CRAWLER request (selectorList) */\n responseList?: () => Data<Array<any>>\n /* The error response of CRAWLER request, it will save to property bank */\n error?: () => Data<string>\n }\n}\n\n/* Extract web content via CSS selectors. Supports WebView method (iOS/Android, renders JS) and HTTP method (all platforms, direct request) */\nexport type GeneratorWebCrawler = Generator &\n GeneratorWebCrawlerDef & {\n templateKey: 'GENERATOR_WEB_CRAWLER'\n switches?: Array<\n SwitchDef &\n GeneratorWebCrawlerDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'response' | 'responseList' | 'error'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/WebRtc.d.ts":"/* Auto generated by build script\n *\n * WebRTC peer connection for real-time audio/video/data communication\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Initiate WebRTC request */\nexport type GeneratorWebRTCActionInitiate = Action & {\n __actionName: 'GENERATOR_WEBRTC_INITIATE'\n}\n\n/* Process input signal */\nexport type GeneratorWebRTCActionProcessInputSignal = ActionWithParams & {\n __actionName: 'GENERATOR_WEBRTC_PROCESS_INPUT_SIGNAL'\n params?: Array<{\n input: 'inputSignal'\n value?: any | EventProperty\n mapping?: string\n }>\n}\n\n/* Close WebRTC */\nexport type GeneratorWebRTCActionClose = Action & {\n __actionName: 'GENERATOR_WEBRTC_CLOSE'\n}\n\n/* Send message in data channel */\nexport type GeneratorWebRTCActionChannelSend = ActionWithParams & {\n __actionName: 'GENERATOR_WEBRTC_CHANNEL_SEND'\n params?: Array<{\n input: 'textMessage'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\ninterface GeneratorWebRTCDef {\n /*\nDefault property:\n{\n \"enableAudio\": true,\n \"enableVideo\": true,\n \"videoFacing\": \"user\",\n \"videoFrameRate\": 30,\n \"videoHeight\": 720,\n \"videoWidth\": 1080,\n \"signalType\": \"json\"\n}\n */\n property?: {\n /* Caller ID */\n callerId?: string | DataLink\n /* Calee ID, to ilter caller signal */\n calleeId?: string | DataLink\n /* Target local WebRTC stream preview brick ID */\n localVideoTarget?: string | DataLink | (() => Brick)\n /* Target remote WebRTC stream brick ID */\n remoteVideoTarget?: string | DataLink | (() => Brick)\n /* ICE Server list\n Default use Google public STUN servers if not setted. */\n iceServers?:\n | Array<\n | DataLink\n | {\n urls?: string | DataLink\n username?: string | DataLink\n credential?: string | DataLink\n }\n >\n | DataLink\n /* Enable capture device microphone */\n enableAudio?: boolean | DataLink\n /* Enable capture device camera */\n enableVideo?: boolean | DataLink\n /* Camera facing */\n videoFacing?: 'user' | 'environment' | DataLink\n /* Camera frame rate */\n videoFrameRate?: number | DataLink\n /* Output video height */\n videoHeight?: number | DataLink\n /* Output video width */\n videoWidth?: number | DataLink\n /* Label of data channel */\n dataChannelLabel?: string | DataLink\n /* Input signal for create peer connection\n Signal Types: \n `initiate`: Initiate a WebRTC call \n `offer`: WebRTC SDP offer \n `answer`: WebRTC SDP answer \n `candidate`: WebRTC ICE candidate \n `close`: Close WebRTC peer connection */\n inputSignal?: any\n /* Signal content type */\n signalType?: 'json' | 'object' | DataLink\n }\n events?: {\n /* Event of signal update */\n onSignalUpdate?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Webrtc']['onSignalUpdate']>\n >\n /* Event of peer connected */\n onConnected?: Array<EventAction>\n /* Event of peer disconnected */\n onDisconnected?: Array<EventAction>\n /* Event of handshake error */\n onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Webrtc']['onError']>>\n /* Event of data channel open */\n onChannelOpen?: Array<EventAction>\n /* Event of data channel close */\n onChannelClose?: Array<EventAction>\n /* Event of received message on data channel */\n onChannelMessage?: Array<\n EventAction<string & keyof TemplateEventPropsMap['Webrtc']['onChannelMessage']>\n >\n }\n outlets?: {\n /* Signal to create peer connection */\n signal?: () => Data<any>\n /* Local SDP offer */\n sdpOffer?: () => Data<{\n type?: string\n sdp?: string\n }>\n /* Local SDP answer */\n sdpAnswer?: () => Data<{\n type?: string\n sdp?: string\n }>\n /* Peer connection state */\n connectionState?: () => Data<string>\n /* ICE connection state */\n iceConnectionState?: () => Data<string>\n /* Signaling state */\n signalingState?: () => Data<string>\n /* Last message from data channel */\n lastChannelMessage?: () => Data<string>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* WebRTC peer connection for real-time audio/video/data communication */\nexport type GeneratorWebRTC = Generator &\n GeneratorWebRTCDef & {\n templateKey: 'GENERATOR_WEBRTC'\n switches?: Array<\n SwitchDef &\n GeneratorWebRTCDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet:\n | 'signal'\n | 'sdpOffer'\n | 'sdpAnswer'\n | 'connectionState'\n | 'iceConnectionState'\n | 'signalingState'\n | 'lastChannelMessage'\n | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/WebSocket.d.ts":"/* Auto generated by build script\n *\n * WebSocket or Socket.IO Generator\n */\nimport type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'\nimport type { Data, DataLink } from '../data'\nimport type {\n Brick,\n Generator,\n EventAction,\n ActionWithDataParams,\n ActionWithParams,\n Action,\n EventProperty,\n} from '../common'\nimport type { TemplateEventPropsMap } from '../../utils/event-props'\n\n/* Connect */\nexport type GeneratorWebSocketActionConnect = Action & {\n __actionName: 'GENERATOR_WEB_SOCKET_CONNECT'\n}\n\n/* Disconnect */\nexport type GeneratorWebSocketActionDisconnect = Action & {\n __actionName: 'GENERATOR_WEB_SOCKET_DISCONNECT'\n}\n\n/* Emit event (Acknowledgement: It's callback, the channel of Socket.IO server can used it as last argument) */\nexport type GeneratorWebSocketActionEmit = ActionWithParams & {\n __actionName: 'GENERATOR_WEB_SOCKET_EMIT'\n params?: Array<\n | {\n input: 'eventName'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'arguments'\n value?: Array<any> | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'acknowledgementType'\n value?: 'text' | 'json' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'withAcknowledgement'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Emit `message` */\nexport type GeneratorWebSocketActionSend = ActionWithParams & {\n __actionName: 'GENERATOR_WEB_SOCKET_SEND'\n params?: Array<{\n input: 'value'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\ninterface GeneratorWebSocketDef {\n /*\nDefault property:\n{}\n */\n property?: {\n /* Try to connect on generator initialized */\n init?: boolean | DataLink\n /* Endpoint URL (support namespace) */\n url?: string | DataLink\n /* Name of the path that is captured on the server side */\n path?: string | DataLink\n /* URL query parameters */\n query?: {} | DataLink\n /* Whether to reconnect automatically */\n reconnection?: boolean | DataLink\n /* Number of reconnection attempts before giving up */\n attemptTimes?: number | DataLink\n /* How long to initially wait before attempting a new reconnection (1000). Affected by +/- randomizationFactor, for example the default initial delay will be between 500 to 1500ms. */\n delayBase?: number | DataLink\n /* Maximum amount of time to wait between reconnections (5000). Each attempt increases the reconnection delay by 2x along with a randomization as above */\n delayMax?: number | DataLink\n /* Randomization factor 0 <= deplayRandom <= 1 */\n delayRandom?: number | DataLink\n /* Message type, if type is json it's will auto transform to object */\n messageType?: 'json' | 'text' | DataLink\n /* Use Socket.IO as transport channel */\n socketIoEnable?: boolean | DataLink\n /* Socket.IO Version */\n socketIoVersion?: 'latest' | 'v4' | 'v2' | DataLink\n /* Whether to reuse an existing connection */\n socketIoForceNew?: boolean | DataLink\n /* Connection timeout before a connect_error and connect_timeout events are emitted */\n socketIoTimeout?: number | DataLink\n /* Event name to be subscribe */\n socketIoEventName?: string | DataLink\n /* Additional query parameters that are sent when connecting a namespace (then found in socket.handshake.query object on the server-side) */\n socketIoQuery?: {} | DataLink\n /* Protocols to be used in the WebSocket connection */\n wsProtocols?: Array<string | DataLink> | DataLink | string | DataLink | DataLink\n }\n events?: {\n /* Event for connected to server */\n onOpen?: Array<EventAction>\n /* Event for disconnect from server */\n onClose?: Array<EventAction>\n /* Event for receive message */\n onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['WebSocket']['onMessage']>>\n /* Event for error occurred */\n onError?: Array<EventAction>\n }\n outlets?: {\n /* Show socket.io connected or not */\n readyState?: () => Data<string>\n /* Results of each countdown change, it will save to Data */\n message?: () => Data<any>\n /* When Socket.IO mode server can response acknowledgemnt with data to client */\n acknowledgeData?: () => Data<{ [key: string]: any }>\n /* Error message */\n errorMessage?: () => Data<string>\n }\n}\n\n/* WebSocket or Socket.IO Generator */\nexport type GeneratorWebSocket = Generator &\n GeneratorWebSocketDef & {\n templateKey: 'GENERATOR_WEB_SOCKET'\n switches?: Array<\n SwitchDef &\n GeneratorWebSocketDef & {\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: 'readyState' | 'message' | 'acknowledgeData' | 'errorMessage'\n value: any\n }\n }>\n }\n >\n }\n","types/generators/index.d.ts":"export * from './Tick'\nexport * from './AlarmClock'\nexport * from './File'\nexport * from './MediaFlow'\nexport * from './DataBank'\nexport * from './GraphQl'\nexport * from './Http'\nexport * from './SoundPlayer'\nexport * from './Keyboard'\nexport * from './WebSocket'\nexport * from './CanvasMap'\nexport * from './Step'\nexport * from './Iterator'\nexport * from './Watchdog'\nexport * from './MqttClient'\nexport * from './MqttBroker'\nexport * from './BleCentral'\nexport * from './SerialPort'\nexport * from './Tcp'\nexport * from './TcpServer'\nexport * from './Udp'\nexport * from './HttpServer'\nexport * from './WebRtc'\nexport * from './WebCrawler'\nexport * from './SoundRecorder'\nexport * from './BlePeripheral'\nexport * from './Question'\nexport * from './Information'\nexport * from './Intent'\nexport * from './CastlesPay'\nexport * from './SpeechToTextPlatform'\nexport * from './ThermalPrinter'\nexport * from './SqLite'\nexport * from './McpServer'\nexport * from './Mcp'\nexport * from './VadTraditional'\nexport * from './TextToSpeechOnnx'\nexport * from './LlmOnnx'\nexport * from './SpeechToTextOnnx'\nexport * from './VadOnnx'\nexport * from './SpeechToTextGgml'\nexport * from './VadGgml'\nexport * from './RealtimeTranscription'\nexport * from './LlmGgml'\nexport * from './TextToSpeechGgml'\nexport * from './RerankerGgml'\nexport * from './LlmMlx'\nexport * from './LlmQualcommAiEngine'\nexport * from './LlmMediaTekNeuroPilot'\nexport * from './LlmOpenAiCompat'\nexport * from './TextToSpeechOpenAiLike'\nexport * from './LlmAnthropicCompat'\nexport * from './LlmAppleBuiltin'\nexport * from './SttAppleBuiltin'\nexport * from './TextToSpeechAppleBuiltin'\nexport * from './Assistant'\nexport * from './VectorStore'\n","types/index.d.ts":"export * from './data'\nexport * from './data-calc'\nexport * from './data-calc-script'\nexport * from './data-calc-command'\nexport * from './generators'\nexport * from './bricks'\nexport * from './animation'\nexport * from './canvas'\nexport * from './subspace'\nexport * from './common'\nexport * from './switch'\nexport * from './system'\nexport * from './automation'\n","types/subspace.d.ts":"import type { Brick, Generator, LocalSyncStrategy, EventAction, SubspaceID } from './common'\nimport type { Animation } from './animation'\nimport type { Canvas } from './canvas'\nimport type { Data } from './data'\nimport type { DataCalculation } from './data-calc'\n\nexport type Subspace = {\n __typename: 'Subspace'\n id: string\n title?: string\n description?: string\n hideShortRef?: boolean\n unused?: boolean\n portal?: 'top' | 'left' | 'bottom' | 'right'\n // Unexpanded information in Editor\n unexpanded?: {\n data?: boolean\n dataCalculation?: boolean\n brick?: boolean\n generator?: boolean\n canvas?: Array<Canvas>\n }\n module?: {\n id: string\n version: string\n link?: boolean\n selectedRequirements?: Array<{\n subspace: SubspaceID\n id: string\n version: string\n }>\n // Module only\n requirements?: Array<{\n subspace: SubspaceID\n id: string\n version: string\n }>\n }\n localSyncChangeCanvas?: LocalSyncStrategy\n layout: {\n width: number\n height: number\n resizeMode?: 'cover' | 'stretch'\n }\n rootCanvas: Canvas\n canvases: Array<Canvas>\n animations: Array<Animation>\n bricks: Array<Brick>\n generators: Array<Generator>\n data: Array<Data>\n dataRouting: Array<Data>\n dataCalculation: Array<DataCalculation>\n actions?: {\n [key: string]: {\n description: string\n // TODO: add eventPropertyMap\n }\n }\n events?: { [key: string]: Array<EventAction> }\n}\n","types/switch.d.ts":"import type { Canvas } from './canvas'\nimport type { Data } from './data'\n\nexport type SwitchCondInnerStateCurrentCanvas = {\n __typename: 'SwitchCondInnerStateCurrentCanvas'\n value: () => Canvas\n}\n\nexport type SwitchCondData = {\n __typename: 'SwitchCondData'\n data: () => Data\n value: any\n}\n\nexport type SwitchCondPropertyBankByItemKey = {\n __typename: 'SwitchCondPropertyBankByItemKey'\n data: () => Data\n value: any\n}\n\nexport interface SwitchDef {\n id: string\n title?: string\n description?: string\n // Default conditions\n conds?: Array<{\n method: '==' | '!=' | '>' | '<' | '>=' | '<='\n cond:\n | SwitchCondInnerStateCurrentCanvas\n | SwitchCondData\n | {\n __typename: 'SwitchCondInnerStateOutlet'\n outlet: string\n value: any\n }\n }>\n // Default property, events, outlets, animation\n property?: {}\n events?: {}\n outlets?: {}\n animation?: {}\n // Override the default items and hitted switch items before the switch\n override?: {\n animation?: boolean\n event?: boolean\n property?: boolean\n outlet?: boolean\n }\n disabled?: boolean\n break?: boolean\n}\n","types/system.d.ts":"/* Auto generated by build script */\nimport type {\n Action,\n ActionWithDataParams,\n ActionWithParams,\n Brick,\n Generator,\n EventProperty,\n} from './common'\nimport type { Animation } from './animation'\nimport type { Canvas } from './canvas'\nimport type { Data, DataLink } from './data'\n\n/* Change Data value with script expression. One expression of return value */\nexport type SystemActionPropertyBankExpression = ActionWithParams & {\n __actionName: 'PROPERTY_BANK_EXPRESSION'\n params?: Array<\n | {\n input: 'expression'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'variables'\n value?:\n | Array<{\n id?: string\n key?: string\n }>\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'result'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'resultAssignPath'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'errorResult'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Change Data value */\nexport type SystemActionPropertyBank = ActionWithDataParams & {\n __actionName: 'PROPERTY_BANK'\n}\n\n/* Trigger Data calculation flow without value change */\nexport type SystemActionPropertyBankCommand = ActionWithDataParams & {\n __actionName: 'PROPERTY_BANK_COMMAND'\n}\n\n/* [Unstable] Dynamically generate bricks */\nexport type SystemActionDynamicBrick = ActionWithParams & {\n __actionName: 'DYNAMIC_BRICK'\n params?: Array<\n | {\n input: 'addList'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'preferAfterItemId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'reset'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'removeItemId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'removeItems'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* [Unstable] Reset Dynamic Bricks */\nexport type SystemActionDynamicBrickReset = Action & {\n __actionName: 'DYNAMIC_BRICK_RESET'\n}\n\n/* Run specific Animation on specific Brick */\nexport type SystemActionDynamicAnimation = ActionWithParams & {\n __actionName: 'DYNAMIC_ANIMATION'\n params?: Array<\n | {\n input: 'brickId'\n value?: string | DataLink | (() => Brick) | EventProperty\n mapping?: string\n }\n | {\n input: 'animationId'\n value?: string | DataLink | (() => Animation) | EventProperty\n mapping?: string\n }\n | {\n input: 'runType'\n value?: 'once' | 'loop' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'resetInitialValue'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Reset Dynamic Animation */\nexport type SystemActionDynamicAnimationReset = ActionWithParams & {\n __actionName: 'DYNAMIC_ANIMATION_RESET'\n params?: Array<{\n input: 'dynamicAnimationBrickId'\n value?: string | DataLink | (() => Brick) | EventProperty\n mapping?: string\n }>\n}\n\n/* Stop Dynamic Animation */\nexport type SystemActionDynamicAnimationStop = ActionWithParams & {\n __actionName: 'DYNAMIC_ANIMATION_STOP'\n params?: Array<{\n input: 'dynamicAnimationBrickId'\n value?: string | DataLink | (() => Brick) | EventProperty\n mapping?: string\n }>\n}\n\n/* Change canvas on the current Subspace */\nexport type SystemActionChangeCanvas = ActionWithParams & {\n __actionName: 'CHANGE_CANVAS'\n params?: Array<\n | {\n input: 'canvasId'\n value?: string | DataLink | (() => Canvas) | EventProperty\n mapping?: string\n }\n | {\n input: 'canvasTitleLike'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'canvasKeyMapList'\n value?:\n | Array<{\n key?: string\n value?: string\n }>\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'canvasKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Log System message */\nexport type SystemActionMessage = ActionWithParams & {\n __actionName: 'MESSAGE'\n params?: Array<\n | {\n input: 'type'\n value?:\n | 'SYSTEM_MESSAGE_TYPE_INFO'\n | 'SYSTEM_MESSAGE_TYPE_SUCCESS'\n | 'SYSTEM_MESSAGE_TYPE_WARNING'\n | 'SYSTEM_MESSAGE_TYPE_ERROR'\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'title'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'message'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Show system alert popup with custom message */\nexport type SystemActionAlert = ActionWithParams & {\n __actionName: 'ALERT'\n params?: Array<\n | {\n input: 'id'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'type'\n value?: 'info' | 'success' | 'warning' | 'error' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'title'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'message'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'selections'\n value?:\n | Array<{\n label?: string\n color?: string\n value?: string\n disableResult?: boolean\n }>\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'selectionResult'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'timeout'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'hideSelections'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Close current showing popups with type or id. */\nexport type SystemActionPopupReset = ActionWithParams & {\n __actionName: 'POPUP_RESET'\n params?: Array<\n | {\n input: 'popupClearType'\n value?: 'all' | 'alert' | 'generator' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'popupId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Take screenshot for current subspace or the full viewport (including portal subspaces) */\nexport type SystemActionTakeScreenshot = ActionWithParams & {\n __actionName: 'TAKE_SCREENSHOT'\n params?: Array<\n | {\n input: 'currentSubspace'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'brickId'\n value?: string | DataLink | (() => Brick) | EventProperty\n mapping?: string\n }\n | {\n input: 'format'\n value?: 'jpg' | 'png' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'quality'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'width'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'height'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'saveProperty'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Store a value in application-specific storage */\nexport type SystemActionStorageSet = ActionWithParams & {\n __actionName: 'STORAGE_SET'\n params?: Array<\n | {\n input: 'storageType'\n value?: 'persist' | 'in-memory' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'storageScope'\n value?: 'global' | 'subspace' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'storageKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'storageValue'\n value?: any | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Retrieve a value from application-specific storage */\nexport type SystemActionStorageRetrieve = ActionWithParams & {\n __actionName: 'STORAGE_RETRIEVE'\n params?: Array<\n | {\n input: 'storageType'\n value?: 'persist' | 'in-memory' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'storageScope'\n value?: 'global' | 'subspace' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'storageKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'result'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'defaultValue'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'skipIfNotFound'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Delete a value from application-specific storage or clear all values */\nexport type SystemActionStorageDelete = ActionWithParams & {\n __actionName: 'STORAGE_DELETE'\n params?: Array<\n | {\n input: 'storageType'\n value?: 'persist' | 'in-memory' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'storageScope'\n value?: 'global' | 'subspace' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'storageKey'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'all'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Subscribe to a channel for data update */\nexport type SystemActionChannelSubscribe = ActionWithParams & {\n __actionName: 'CHANNEL_SUBSCRIBE'\n params?: Array<\n | {\n input: 'key'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'type'\n value?: 'on' | 'once' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'livetime'\n value?: number | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'dataResult'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'dataAssignList'\n value?:\n | Array<{\n path?: string\n type?: any\n id?: string\n required?: boolean\n }>\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'progressResult'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'progressAssignList'\n value?:\n | Array<{\n path?: string\n type?: any\n id?: string\n required?: boolean\n }>\n | DataLink\n | EventProperty\n mapping?: string\n }\n | {\n input: 'errorResult'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Unsubscribe from a channel */\nexport type SystemActionChannelUnsubscribe = ActionWithParams & {\n __actionName: 'CHANNEL_UNSUBSCRIBE'\n params?: Array<{\n input: 'keyMatch'\n value?: string | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* Publish data to a channel */\nexport type SystemActionChannelPublish = ActionWithParams & {\n __actionName: 'CHANNEL_PUBLISH'\n params?: Array<\n | {\n input: 'keyMatch'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payloadType'\n value?: 'result' | 'progress' | 'error' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'payload'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Delay for a certain time between actions */\nexport type SystemActionDelay = ActionWithParams & {\n __actionName: 'DELAY'\n params?: Array<{\n input: 'time'\n value?: number | DataLink | EventProperty\n mapping?: string\n }>\n}\n\n/* [Internal] Use a shared application */\nexport type SystemActionUseShareApplication = ActionWithParams & {\n __actionName: 'USE_SHARE_APPLICATION'\n params?: Array<\n | {\n input: 'applicationId'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'releaseVersion'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'useType'\n value?: 'run' | 'use-after-bind' | 'cancel-use' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'viewportPresetNameLike'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'viewportPresetDeviceTarget'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'enableLocalSync'\n value?: boolean | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* [Internal] Auth in device */\nexport type SystemActionAuthInDevice = Action & {\n __actionName: 'AUTH_IN_DEVICE'\n}\n\n/* [Internal] Refresh passcode for bind device */\nexport type SystemActionRefreshBindcode = Action & {\n __actionName: 'REFRESH_BINDCODE'\n}\n\n/* Open URL */\nexport type SystemActionOpenUrl = ActionWithParams & {\n __actionName: 'OPEN_URL'\n params?: Array<\n | {\n input: 'url'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'behavior'\n value?: 'in-app' | 'new-window' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'inAppTintColor'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Open File or Directory */\nexport type SystemActionOpenFile = ActionWithParams & {\n __actionName: 'OPEN_FILE'\n params?: Array<\n | {\n input: 'pickType'\n value?: 'file' | 'multiple' | 'directory' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'fileType'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'copyTo'\n value?: 'cache' | 'document' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'mode'\n value?: 'import' | 'open' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'saveProperty'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'saveDetailProperty'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'errorSaveProperty'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Throw exception */\nexport type SystemActionThrowException = ActionWithParams & {\n __actionName: 'THROW_EXCEPTION'\n params?: Array<\n | {\n input: 'behavior'\n value?: 'application' | 'native' | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'exceptionMessage'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Restart the foundation (React Native bundle) */\nexport type SystemActionRestartFoundation = Action & {\n __actionName: 'RESTART_FOUNDATION'\n}\n\n/* Dismiss keyboard */\nexport type SystemActionDismissKeyboard = Action & {\n __actionName: 'DISMISS_KEYBOARD'\n}\n\n/* Trigger application AI filter */\nexport type SystemActionTriggerApplicationFilter = ActionWithParams & {\n __actionName: 'TRIGGER_APPLICATION_FILTER'\n params?: Array<\n | {\n input: 'name'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'variables'\n value?: any | EventProperty\n mapping?: string\n }\n | {\n input: 'result'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'error'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n >\n}\n\n/* Stop running application AI filter */\nexport type SystemActionStopApplicationFilter = Action & {\n __actionName: 'STOP_APPLICATION_FILTER'\n}\n\n/* Save update snapshot (from Application Filter or DevTools MCP Server) to media system */\nexport type SystemActionSaveUpdateSnapshot = ActionWithParams & {\n __actionName: 'SAVE_UPDATE_SNAPSHOT'\n params?: Array<\n | {\n input: 'snapshotFileIndentifier'\n value?: string | DataLink | EventProperty\n mapping?: string\n }\n | {\n input: 'snapshotSaveResult'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n | {\n input: 'snapshotErrorResult'\n value?: string | DataLink | (() => Data) | EventProperty\n mapping?: string\n }\n >\n}\n","utils/calc.ts":"import type {\n DataCommand,\n DataCalculationMap,\n DataCalculationData,\n} from '../types/data-calc-command'\n\nconst GRID = {\n WIDTH: 300, // Distance between columns\n HEIGHT: 150, // Distance between rows\n PADDING: 15, // Edge padding\n COLUMNS: 4, // Max columns in grid\n ROWS: 3, // Max rows in grid\n}\n\n// TODO: Improve the algorithm to minimize crossing lines\n\n// If we are too lazy to describe nodes in the editing interface,\n// we can let it generate it automatically\nexport const generateDataCalculationMapEditorInfo = (\n nodes: Array<DataCalculationData | DataCommand>,\n) => {\n const editorInfo: DataCalculationMap['editorInfo'] = []\n\n // Track node relationships\n const inputCounts = new Map<DataCalculationData | DataCommand, number>()\n const outputCounts = new Map<DataCalculationData | DataCommand, number>()\n const connectedTo = new Map<\n DataCalculationData | DataCommand,\n Set<DataCalculationData | DataCommand>\n >()\n const nodeById = new Map<string, DataCalculationData | DataCommand>()\n for (const node of nodes) {\n if ('id' in node) nodeById.set(node.id, node)\n }\n\n // Analyze node connections\n nodes.forEach((node) => {\n // Count and track inputs\n if ('inputs' in node) {\n let inputs = 0\n for (const input of node.inputs) {\n if (input === null) continue\n if (Array.isArray(input)) inputs += input.length\n else inputs += 1\n }\n inputCounts.set(node, inputs)\n\n // Track connections\n node.inputs.forEach((input) => {\n if (Array.isArray(input)) {\n input.forEach((conn) => {\n if (!connectedTo.has(node)) {\n connectedTo.set(node, new Set())\n }\n const sourceNode = nodeById.get(conn.id)\n if (sourceNode) {\n connectedTo.get(node)!.add(sourceNode)\n }\n })\n }\n })\n } else {\n inputCounts.set(node, 0)\n }\n\n // Count outputs\n if ('outputs' in node) {\n let outputs = 0\n for (const output of node.outputs) {\n if (output === null) continue\n if (Array.isArray(output)) outputs += output.length\n else outputs += 1\n }\n outputCounts.set(node, outputs)\n } else {\n outputCounts.set(node, 0)\n }\n })\n\n // Calculate layers\n const layers: Array<Array<DataCalculationData | DataCommand>> = [[], [], [], []]\n\n nodes.forEach((node) => {\n const inputs = inputCounts.get(node) || 0\n const outputs = outputCounts.get(node) || 0\n const connections = connectedTo.get(node)?.size || 0\n\n if (inputs === 0) {\n // Input nodes (leftmost)\n layers[0].push(node)\n } else if (outputs === 0) {\n // Output nodes (rightmost)\n layers[3].push(node)\n } else if (connections > 1) {\n // Nodes with multiple connections (middle-right)\n layers[2].push(node)\n } else {\n // Processing nodes (middle-left)\n layers[1].push(node)\n }\n })\n\n // Position nodes in each layer\n layers.forEach((layerNodes, layerIndex) => {\n // Sort nodes by their connections to try to minimize crossing lines\n layerNodes.sort((a, b) => {\n const aConns = connectedTo.get(a)?.size || 0\n const bConns = connectedTo.get(b)?.size || 0\n return bConns - aConns\n })\n\n // Position nodes in the layer\n layerNodes.forEach((node, nodeIndex) => {\n // Distribute nodes evenly within their layer\n const row = nodeIndex % GRID.ROWS\n const offset = Math.floor(nodeIndex / GRID.ROWS) * (GRID.HEIGHT / 2)\n\n editorInfo.push({\n node,\n position: {\n x: GRID.PADDING + layerIndex * GRID.WIDTH,\n y: GRID.PADDING + row * GRID.HEIGHT + offset,\n },\n points: [],\n })\n })\n })\n\n return editorInfo\n}\n","utils/data.ts":"/* Auto generated by build script */\nimport type { DataLink, Data, Canvas } from '../types'\nimport { makeId } from './id'\n\nexport const linkData: (dataGetter: () => Data) => DataLink = (dataGetter) => ({\n __typename: 'DataLink',\n data: dataGetter,\n})\n\nexport const createCanvasIdRef: (canvasGetter: () => Canvas) => Data<string> = (canvasGetter) => {\n const data: Data<string> = {\n __typename: 'Data',\n // Stable by default (utils/id.ts) so recompiling unchanged source yields an\n // identical config; the legacy snapshotMode opt-out made this id churn per compile.\n id: makeId('data'),\n type: 'string',\n routing: 'read-only',\n kind: {\n type: 'auto-generated-item-id',\n idType: 'canvas',\n },\n title: '',\n value: '',\n }\n setImmediate(() => {\n const canvas = canvasGetter()\n data.title = `Canvas ID: ${canvas.title}`\n data.value = canvas.id\n })\n return data\n}\n\ntype SystemDataName =\n | 'isLocalSyncMainDevice'\n | 'currentCanvasId'\n | 'previousCanvasId'\n | 'canvasIdHistory'\n | 'rootSubspaceInfo'\n | 'subspaceInfo'\n | 'uniqueID'\n | 'appVersion'\n | 'lastUpdateTime'\n | 'deviceName'\n | 'deviceType'\n | 'operationMode'\n | 'operationVersion'\n | 'screenWidth'\n | 'screenHeight'\n | 'screenScale'\n | 'screenFontScale'\n | 'orientation'\n | 'touchAvailable'\n | 'soundAvailable'\n | 'cameraAvailable'\n | 'audioInputAvailable'\n | 'networkType'\n | 'networkConnected'\n | 'networkIpAddress'\n | 'networkDetails'\n | 'isInternetReachable'\n | 'isWifiEnabled'\n | 'deviceDisplayName'\n | 'workspaceName'\n | 'applicationInfo'\n | 'applicationName'\n | 'deviceID'\n | 'macAddress'\n | 'bindDeviceCode'\n | 'bindDeviceCodeExpire'\n | 'bindDeviceUrl'\n | 'bindDeviceUseApplication'\n | 'isApplicationPreview'\n | 'isSupportAuthInDevice'\n | 'env'\n | 'isViewDebugModeEnabled'\n | 'language'\n | 'aiFilters'\n | 'systemOpenAIApiKey'\n | 'systemAnthropicApiKey'\n | 'systemGeminiApiKey'\n | 'ggmlBackendDevices'\n\ntype SystemDataInfo = {\n name: SystemDataName\n id: string\n type: Data['type']\n title?: string\n description?: string\n schema?: object\n value?: any\n}\n\nexport const systemDataList: Array<SystemDataInfo> = [\n {\n name: 'isLocalSyncMainDevice',\n id: 'PROPERTY_BANK_DATA_NODE_325068e3-89b6-4c6a-942b-126d38c84a62',\n title: 'SYSTEM: Is Local Sync Main Device',\n description: 'The current device is main for local sync',\n type: 'bool',\n value: true,\n },\n {\n name: 'currentCanvasId',\n id: 'PROPERTY_BANK_DATA_NODE_2dfeb635-deb4-481a-9d17-ea7b1fe19f74',\n title: 'SYSTEM: Current Canvas ID',\n description: 'ID for known current canvas',\n type: 'string',\n value: '',\n },\n {\n name: 'previousCanvasId',\n id: 'PROPERTY_BANK_DATA_NODE_2971e463-0b0e-45b7-bbfb-a01d8fd49db3',\n title: 'SYSTEM: Previous Canvas ID',\n description: 'ID for known previous canvas',\n type: 'string',\n value: '',\n },\n {\n name: 'canvasIdHistory',\n id: 'PROPERTY_BANK_DATA_NODE_1a086f39-817d-40ed-92f0-5a999535d3dd',\n title: 'SYSTEM: Change Canvas History',\n description: 'Change Canvas ID History (Limit: 10)',\n schema: { type: 'string', allowNewItem: false, allowCustomProperty: false },\n type: 'array',\n value: [],\n },\n {\n name: 'rootSubspaceInfo',\n id: 'PROPERTY_BANK_DATA_NODE_c0817f4a-1ff3-40ed-9cbf-71d8cefd2cd9',\n title: 'SYSTEM: Root Subspace Info',\n description: 'Root Subspace Information',\n type: 'object',\n value: {},\n },\n {\n name: 'subspaceInfo',\n id: 'PROPERTY_BANK_DATA_NODE_2657ec09-7323-46c3-a96e-3d8b5a0f79b3',\n title: 'SYSTEM: Current Subspace Info',\n description: 'Current Subspace Information',\n type: 'object',\n value: {},\n },\n {\n name: 'uniqueID',\n id: 'PROPERTY_BANK_DATA_NODE_6f4a543f-a88a-4a83-bf53-223259263be3',\n title: 'SYSTEM: Unique ID',\n description: 'Unique ID of current device',\n type: 'string',\n value: 'unknown',\n },\n {\n name: 'appVersion',\n id: 'PROPERTY_BANK_DATA_NODE_d614a258-2a45-4f91-9f6b-3936038cb2b1',\n title: 'SYSTEM: App Version',\n description: 'App Version of current installed BRICKS Foundation app',\n type: 'string',\n value: 'unknown',\n },\n {\n name: 'lastUpdateTime',\n id: 'PROPERTY_BANK_DATA_NODE_956f3b3e-cb0b-47ca-8119-65663910d110',\n title: 'SYSTEM: Last Update Time',\n description: 'Last update time of current installed BRICKS Foundation app',\n type: 'string',\n value: '2019-07-09T03:32:27.058Z',\n },\n {\n name: 'deviceName',\n id: 'PROPERTY_BANK_DATA_NODE_7b9d9ad4-e9a2-47cd-91d3-b64187895c16',\n title: 'SYSTEM: Device Name',\n description: 'Name of current device',\n type: 'string',\n value: 'Default Device Name',\n },\n {\n name: 'deviceType',\n id: 'PROPERTY_BANK_DATA_NODE_b0beae12-e45e-4870-ae15-858eeac566fa',\n title: 'SYSTEM: Device Type',\n description: 'Type of current device (Handset, Tv, Tablet)',\n type: 'string',\n value: 'Tv',\n },\n {\n name: 'operationMode',\n id: 'PROPERTY_BANK_DATA_NODE_2e715d3b-92bf-4761-b5c0-ca21f7c1ada8',\n title: 'SYSTEM: Operation Mode',\n description: 'Operation Mode of current device (android, ios, ...)',\n type: 'string',\n value: 'android',\n },\n {\n name: 'operationVersion',\n id: 'PROPERTY_BANK_DATA_NODE_fa886963-0a16-4b5f-b4ea-6c25b049db03',\n title: 'SYSTEM: Operation Version',\n description: 'Operation Version of current device',\n type: 'string',\n value: '',\n },\n {\n name: 'screenWidth',\n id: 'PROPERTY_BANK_DATA_NODE_2942470a-c3bc-413e-8f2c-30a89aded3f8',\n title: 'SYSTEM: Screen Width',\n description: 'Width of current device main screen',\n type: 'number',\n value: 1280,\n },\n {\n name: 'screenHeight',\n id: 'PROPERTY_BANK_DATA_NODE_4f031e27-f67b-40e0-a317-9f6c5215d97d',\n title: 'SYSTEM: Screen Height',\n description: 'Height of current device main screen',\n type: 'number',\n value: 768,\n },\n {\n name: 'screenScale',\n id: 'PROPERTY_BANK_DATA_NODE_c3c9b7aa-1dc1-4be1-8a4a-d9e299b9eeaa',\n title: 'SYSTEM: Screen Scale',\n description: 'Scale of current device main screen',\n type: 'number',\n value: 2,\n },\n {\n name: 'screenFontScale',\n id: 'PROPERTY_BANK_DATA_NODE_0312f380-d525-4938-82d2-5b35ef8ef1e8',\n title: 'SYSTEM: Screen Font Scale',\n description: 'Font scale of current device main screen',\n type: 'number',\n value: 1,\n },\n {\n name: 'orientation',\n id: 'PROPERTY_BANK_DATA_NODE_4f584f51-a250-4f97-a2f8-d5e6a3affb4f',\n title: 'SYSTEM: Orientation',\n description: 'Orientation of current device main screen',\n type: 'string',\n value: 'landspace',\n },\n {\n name: 'touchAvailable',\n id: 'PROPERTY_BANK_DATA_NODE_1fe7555f-df41-43ce-a268-3ea1b5efda6d',\n title: 'SYSTEM: Touch Available',\n description: 'Is touch available of current device main screen?',\n type: 'bool',\n value: true,\n },\n {\n name: 'soundAvailable',\n id: 'PROPERTY_BANK_DATA_NODE_bf839498-f7d6-4212-ac3a-b409e3ad77a5',\n title: 'SYSTEM: Sound Available',\n description: 'Is sound available of current device?',\n type: 'bool',\n value: true,\n },\n {\n name: 'cameraAvailable',\n id: 'PROPERTY_BANK_DATA_NODE_4878f3c2-8bb8-4c94-855c-06bda5a287d5',\n title: 'SYSTEM: Camera Available',\n description: 'Is camera available of current device?',\n type: 'bool',\n value: true,\n },\n {\n name: 'audioInputAvailable',\n id: 'PROPERTY_BANK_DATA_NODE_4854b259-96c1-40d7-b17b-47156b4698dc',\n title: 'SYSTEM: Audio Input Available',\n description: 'Is audio input available of current device?',\n type: 'bool',\n value: false,\n },\n {\n name: 'networkType',\n id: 'PROPERTY_BANK_DATA_NODE_1cbb1756-e53c-45a9-be23-5d84a214e144',\n title: 'SYSTEM: Network Type',\n description: 'Network Type of current device',\n type: 'string',\n value: 'wifi',\n },\n {\n name: 'networkConnected',\n id: 'PROPERTY_BANK_DATA_NODE_687b62fe-ead5-417a-b415-9bd5233784a4',\n title: 'SYSTEM: Network Connected',\n description: 'Is Network connected of current device?',\n type: 'bool',\n value: true,\n },\n {\n name: 'networkIpAddress',\n id: 'PROPERTY_BANK_DATA_NODE_41971ba7-8294-4aa6-a425-ecd39853c3e6',\n title: 'SYSTEM: Network IP Address',\n description: 'Current network IP address',\n type: 'string',\n value: '',\n },\n {\n name: 'networkDetails',\n id: 'PROPERTY_BANK_DATA_NODE_9351fbfc-4ace-477a-b05d-41ac9b05087d',\n title: 'SYSTEM: Network Details',\n description: 'Network details, provide different data depends on Network Type',\n type: 'object',\n value: null,\n },\n {\n name: 'isInternetReachable',\n id: 'PROPERTY_BANK_DATA_NODE_e367ae7e-46ec-46d0-b87d-51e544591ff9',\n title: 'SYSTEM: Internet Reachable',\n description: 'Is Internet reachable?',\n type: 'bool',\n value: true,\n },\n {\n name: 'isWifiEnabled',\n id: 'PROPERTY_BANK_DATA_NODE_be395305-fb85-4d05-8506-22a4ae8c7b9e',\n title: 'SYSTEM: Wifi Enabled',\n description: 'Is WiFi enabled?',\n type: 'bool',\n value: true,\n },\n {\n name: 'deviceDisplayName',\n id: 'PROPERTY_BANK_DATA_NODE_76356a9a-fc46-11ec-9905-db53d6811cb7',\n title: 'SYSTEM: Device Display Name',\n description: 'Current device display name',\n type: 'string',\n value: '',\n },\n {\n name: 'workspaceName',\n id: 'PROPERTY_BANK_DATA_NODE_d857125e-0401-40f1-b768-56190aa8e147',\n title: 'SYSTEM: Workspace Name',\n description: 'Current workspace name',\n type: 'string',\n value: '',\n },\n {\n name: 'applicationInfo',\n id: 'PROPERTY_BANK_DATA_NODE_935d3322-84aa-4465-b1e7-241d1f024267',\n title: 'SYSTEM: Application Info',\n description: 'Current application info',\n type: 'object',\n value: {},\n },\n {\n name: 'applicationName',\n id: 'PROPERTY_BANK_DATA_NODE_df395fd6-a754-4b60-8bac-1360933e6707',\n title: 'SYSTEM: Application Name',\n description: 'Current application name',\n type: 'string',\n value: '',\n },\n {\n name: 'deviceID',\n id: 'PROPERTY_BANK_DATA_NODE_8b5c2d9e-f0a1-4b2c-8d3e-4f5a6b7c8d9e',\n title: 'SYSTEM: Device ID',\n description: 'Device ID of current device',\n type: 'string',\n value: 'unknown',\n },\n {\n name: 'macAddress',\n id: 'PROPERTY_BANK_DATA_NODE_f01fcc78-0723-11ed-ac00-877339de1030',\n title: 'SYSTEM: MAC Address',\n description: 'Network adapter MAC address of current device',\n type: 'string',\n value: '',\n },\n {\n name: 'bindDeviceCode',\n id: 'PROPERTY_BANK_DATA_NODE_1ca90262-3584-11ed-8c9a-174949844872',\n title: 'SYSTEM: Bind Device Code',\n description: 'The passcode to bind the device',\n type: 'string',\n value: '',\n },\n {\n name: 'bindDeviceCodeExpire',\n id: 'PROPERTY_BANK_DATA_NODE_5b52d204-3584-11ed-bb5e-abb4d270daf1',\n title: 'SYSTEM: Bind Device Code Expire Time',\n description: 'The expire time of bind passcode',\n type: 'string',\n value: '',\n },\n {\n name: 'bindDeviceUrl',\n id: 'PROPERTY_BANK_DATA_NODE_833a7db2-3584-11ed-88dd-3b3d3ff58855',\n title: 'SYSTEM: Bind Device URL',\n description: 'The URL to bind the device',\n type: 'string',\n value: '',\n },\n {\n name: 'bindDeviceUseApplication',\n id: 'PROPERTY_BANK_DATA_NODE_631bbce8-9c90-4590-b8ec-8b27f4a0e50b',\n title: 'SYSTEM: Selected Application on Bind Device',\n description: 'Current selected use application info on Bind Device',\n type: 'object',\n value: null,\n },\n {\n name: 'isApplicationPreview',\n id: 'PROPERTY_BANK_DATA_NODE_c673967a-3996-11ed-96d9-efbc3f7eac53',\n title: 'SYSTEM: Is Preview Mode',\n description: 'Is current in preview mode?',\n type: 'bool',\n value: '',\n },\n {\n name: 'isSupportAuthInDevice',\n id: 'PROPERTY_BANK_DATA_NODE_beb2a666-3e18-11ed-bdab-6f0cb082fa67',\n title: 'SYSTEM: Is Support Auth In Device',\n description: 'Is current device support auth in device?',\n type: 'bool',\n value: '',\n },\n {\n name: 'env',\n id: 'PROPERTY_BANK_DATA_NODE_74e7a574-1099-4fe5-b193-8a9ea7d20ed0',\n title: 'SYSTEM: Environment Variables',\n description: 'Environment Variables of the device',\n type: 'object',\n value: {},\n },\n {\n name: 'isViewDebugModeEnabled',\n id: 'PROPERTY_BANK_DATA_NODE_3f61c4f6-1e02-492e-8e4c-a8dc4a5bc101',\n title: 'SYSTEM: Is View Debug mode Enabled',\n description: 'Is View Debug mode enabled?',\n type: 'bool',\n value: false,\n },\n {\n name: 'language',\n id: 'PROPERTY_BANK_DATA_NODE_f0ed0a03-6195-459f-9ffe-bca61923f94e',\n title: 'SYSTEM: Language',\n description: 'Language of the device',\n type: 'string',\n value: '',\n },\n {\n name: 'aiFilters',\n id: 'PROPERTY_BANK_DATA_NODE_3ffc1e98-8f65-4cc8-a949-3da8d2092ccb',\n title: 'SYSTEM: AI Filters',\n description: 'AI filters configuration from the application',\n type: 'array',\n value: [],\n },\n {\n name: 'systemOpenAIApiKey',\n id: 'PROPERTY_BANK_DATA_NODE_a1b2c3d4-5e6f-7890-abcd-ef1234567890',\n title: 'SYSTEM: OpenAI API Key',\n description: 'System OpenAI API Key (only available if application enabled)',\n type: 'string',\n value: '',\n },\n {\n name: 'systemAnthropicApiKey',\n id: 'PROPERTY_BANK_DATA_NODE_b2c3d4e5-6f78-9012-bcde-f23456789012',\n title: 'SYSTEM: Anthropic API Key',\n description: 'System Anthropic API Key (only available if application enabled)',\n type: 'string',\n value: '',\n },\n {\n name: 'systemGeminiApiKey',\n id: 'PROPERTY_BANK_DATA_NODE_c3d4e5f6-7890-1234-cdef-345678901234',\n title: 'SYSTEM: Gemini API Key',\n description: 'System Gemini API Key (only available if application enabled)',\n type: 'string',\n value: '',\n },\n {\n name: 'ggmlBackendDevices',\n id: 'PROPERTY_BANK_DATA_NODE_9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b',\n title: 'SYSTEM: GGML Backend Devices',\n description: 'Available GGML backend devices with supported generators',\n schema: { type: 'object', allowNewItem: false, allowCustomProperty: false },\n type: 'array',\n value: [],\n },\n]\n\nexport const useSystemData = (name: SystemDataName): Data => {\n const info = systemDataList.find((data) => data.name === name)\n if (!info) throw new Error(`System data '${name}' not found`)\n return {\n __typename: 'Data',\n id: info.id,\n type: info.type,\n title: info.title,\n description: info.description,\n routing: 'read-only',\n schema: info.schema,\n value: info.value,\n }\n}\n","utils/event-props.ts":"/* Auto generated by build script */\nexport const templateEventPropsMap = {\n Rect: {},\n Text: {},\n TextInput: {\n onChange: { BRICK_TEXT_INPUT_TEXT: 'string', BRICK_TEXT_INPUT_TYPE: 'string' },\n onSubmit: { BRICK_TEXT_INPUT_TEXT: 'string' },\n onMatch: { BRICK_TEXT_INPUT_TEXT: 'string' },\n onNotMatch: { BRICK_TEXT_INPUT_TEXT: 'string' },\n onResultNotMatch: { BRICK_TEXT_INPUT_TEXT: 'string' },\n },\n RichText: {},\n Image: { onError: { BRICK_IMAGE_ERROR_MESSAGE: 'string' } },\n Svg: {},\n Icon: {},\n Video: {\n nextVideo: { BRICK_VIDEO_NEXT_INDEX: 'number' },\n onProgress: { BRICK_VIDEO_CURRENT_TIME: 'number', BRICK_VIDEO_PLAYABLE_DURATION: 'number' },\n subtitleCueEnter: {\n BRICK_VIDEO_SUBTITLE_TEXT: 'string',\n BRICK_VIDEO_SUBTITLE_INDEX: 'number',\n BRICK_VIDEO_SUBTITLE_START: 'number',\n BRICK_VIDEO_SUBTITLE_END: 'number',\n },\n subtitleCueExit: { BRICK_VIDEO_SUBTITLE_TEXT: 'string', BRICK_VIDEO_SUBTITLE_INDEX: 'number' },\n },\n VideoStreaming: {},\n Qrcode: {},\n Slideshow: {\n changeStart: {\n BRICK_SLIDESHOW_PAYLOAD_VALUE: 'number',\n BRICK_SLIDESHOW_ORIGINAL_INDEX: 'number',\n },\n changeEnd: {\n BRICK_SLIDESHOW_PAYLOAD_VALUE: 'number',\n BRICK_SLIDESHOW_ORIGINAL_INDEX: 'number',\n },\n contentChange: {\n BRICK_SLIDESHOW_PAYLOAD_VALUE: 'number',\n BRICK_SLIDESHOW_ORIGINAL_INDEX: 'number',\n },\n roundEnd: { BRICK_SLIDESHOW_PAYLOAD_VALUE: 'number', BRICK_SLIDESHOW_ORIGINAL_INDEX: 'number' },\n mediaOnError: {\n BRICK_SLIDESHOW_ERROR_MESSAGE: 'string',\n BRICK_SLIDESHOW_ERROR_URL: 'string',\n BRICK_SLIDESHOW_ERROR_INDEX: 'number',\n },\n },\n Chart: {\n onPress: {\n BRICK_CHART_DATA_TYPE: 'string',\n BRICK_CHART_DATA_INDEX: 'number',\n BRICK_CHART_DATA: 'any',\n BRICK_CHART_SERIES_TYPE: 'string',\n BRICK_CHART_SERIES_NAME: 'string',\n BRICK_CHART_SERIES_INDEX: 'number',\n BRICK_CHART_NAME: 'string',\n BRICK_CHART_VALUE: 'any',\n },\n onLegendSelectChanged: {\n BRICK_CHART_LEGEND_NAME: 'string',\n BRICK_CHART_LEGEND_SELECTED: '{ [key: string]: any }',\n },\n },\n Items: {\n onPageRender: { BRICK_ITEMS_PAGE_INDEX: 'number', BRICK_ITEMS_PAGE_SIZE: 'number' },\n onPageChange: { BRICK_ITEMS_PAGE_INDEX: 'number', BRICK_ITEMS_PAGE_SIZE: 'number' },\n onPageOutOfBound: { BRICK_ITEMS_PAGE_INDEX: 'number', BRICK_ITEMS_PAGE_SIZE: 'number' },\n onIntoDetailMode: {\n BRICK_ITEMS_PAGE_INDEX: 'number',\n BRICK_ITEMS_SELECTED_ITEM_INDEX: 'number',\n BRICK_ITEMS_PAGE_SIZE: 'number',\n },\n onIntoListMode: { BRICK_ITEMS_PAGE_INDEX: 'number', BRICK_ITEMS_PAGE_SIZE: 'number' },\n onError: { BRICK_ITEMS_ERROR_MESSAGE: 'string' },\n },\n Lottie: {\n onAnimationFinish: { BRICK_LOTTIE_IS_CANCELLED: 'boolean' },\n onAnimationFailure: { BRICK_LOTTIE_ERROR_MESSAGE: 'string' },\n },\n Rive: {\n onPlay: { BRICK_RIVE_ANIMATION_NAME: 'string', BRICK_RIVE_IS_STATE_MACHINE: 'boolean' },\n onPause: { BRICK_RIVE_ANIMATION_NAME: 'string', BRICK_RIVE_IS_STATE_MACHINE: 'boolean' },\n onStop: { BRICK_RIVE_ANIMATION_NAME: 'string', BRICK_RIVE_IS_STATE_MACHINE: 'boolean' },\n onLoopEnd: { BRICK_RIVE_ANIMATION_NAME: 'string', BRICK_RIVE_IS_STATE_MACHINE: 'boolean' },\n onStateChanged: { BRICK_RIVE_STATE_MACHINE_NAME: 'string', BRICK_RIVE_STATE_NAME: 'string' },\n onError: { BRICK_RIVE_ERROR: 'string' },\n onRiveGeneralEvent: {\n BRICK_RIVE_EVENT_NAME: 'string',\n BRICK_RIVE_EVENT_DELAY: 'number',\n BRICK_RIVE_EVENT_PROPERTIES: '{ [key: string]: any }',\n },\n onRiveOpenUrlEvent: {\n BRICK_RIVE_EVENT_NAME: 'string',\n BRICK_RIVE_EVENT_DELAY: 'number',\n BRICK_RIVE_EVENT_URL: 'string',\n BRICK_RIVE_EVENT_TARGET: 'string',\n },\n },\n Webview: {\n onLoad: { BRICK_WEBVIEW_LOADED_URL: 'string' },\n onError: { BRICK_WEBVIEW_ERROR: 'string' },\n onMessage: { BRICK_WEBVIEW_MESSAGE: 'string' },\n },\n Camera: {\n stateChange: { BRICK_CAMERA_STATUS: 'string', BRICK_CAMERA_RECORD_AUDIO_PERM_STATUS: 'string' },\n barcodeRead: {\n BRICK_CAMERA_BARCODE_TYPE: 'string',\n BRICK_CAMERA_BARCODE_DATA: 'string',\n BRICK_CAMERA_BARCODE_RAW_DATA: 'string',\n BRICK_CAMERA_BARCODE_X: 'number',\n BRICK_CAMERA_BARCODE_Y: 'number',\n BRICK_CAMERA_BARCODE_WIDTH: 'number',\n BRICK_CAMERA_BARCODE_HEIGHT: 'number',\n },\n pictureTaken: {\n BRICK_CAMERA_WIDTH: 'number',\n BRICK_CAMERA_HEIGHT: 'number',\n BRICK_CAMERA_URI: 'string',\n },\n recordFinish: { BRICK_CAMERA_URI: 'string' },\n mountError: { BRICK_CAMERA_MOUNT_ERROR: 'string' },\n },\n WebrtcStream: {},\n GenerativeMedia: {\n onSuccess: { BRICK_GENERATIVE_MEDIA_URL: 'string' },\n onError: { BRICK_GENERATIVE_MEDIA_ERROR: 'string' },\n promptStart: { BRICK_GENERATIVE_MEDIA_PROMPT: 'string' },\n promptSuccess: { BRICK_GENERATIVE_MEDIA_URL: 'string' },\n promptError: { BRICK_GENERATIVE_MEDIA_ERROR: 'string' },\n loadStart: {},\n loadSuccess: { BRICK_GENERATIVE_MEDIA_URL: 'string' },\n loadError: { BRICK_GENERATIVE_MEDIA_ERROR: 'string' },\n },\n Maps: {\n onMarkerPress: {\n BRICK_MAPS_MARKER_ID: 'string',\n BRICK_MAPS_MARKER_TITLE: 'string',\n BRICK_MAPS_MARKER_DESCRIPTION: 'string',\n BRICK_MAPS_MARKER_LATITUDE: 'number',\n BRICK_MAPS_MARKER_LONGITUDE: 'number',\n },\n onMapPress: { BRICK_MAPS_PRESS_LATITUDE: 'number', BRICK_MAPS_PRESS_LONGITUDE: 'number' },\n onRegionChange: {\n BRICK_MAPS_REGION_LATITUDE: 'number',\n BRICK_MAPS_REGION_LONGITUDE: 'number',\n BRICK_MAPS_REGION_LATITUDE_DELTA: 'number',\n BRICK_MAPS_REGION_LONGITUDE_DELTA: 'number',\n },\n },\n Sketch: {\n onStrokeEnd: { BRICK_SKETCH_STROKE_COUNT: 'number', BRICK_SKETCH_STATE: '{}' },\n onClear: { BRICK_SKETCH_STATE: '{}' },\n onStateChange: { BRICK_SKETCH_STATE: '{}' },\n onToolChange: { BRICK_SKETCH_TOOL: 'string' },\n onExportImage: { BRICK_SKETCH_IMAGE_URI: 'string' },\n },\n Scene3D: {\n onLoad: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_DURATION_MS: 'number' },\n onLoadError: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_ERROR: 'string' },\n onObjectClick: {\n BRICK_SCENE_3D_OBJECT_ID: 'string',\n BRICK_SCENE_3D_HIT_POINT: '{ x?: number y?: number z?: number }',\n BRICK_SCENE_3D_HIT_DISTANCE: 'number',\n },\n onObjectHover: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_HOVER_ENTERED: 'boolean' },\n onAnimationEnd: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_ANIMATION_NAME: 'string' },\n onFrame: {\n BRICK_SCENE_3D_FRAME_TIME: 'number',\n BRICK_SCENE_3D_FRAME_DT: 'number',\n BRICK_SCENE_3D_FPS: 'number',\n },\n onScriptError: { BRICK_SCENE_3D_ERROR: 'string', BRICK_SCENE_3D_PHASE: 'string' },\n },\n Tick: {\n ticking: { GENERATOR_TICK_COUNTDOWN: 'number', GENERATOR_TICK_VALUE: 'any' },\n completed: { GENERATOR_TICK_COUNTDOWN: 'number', GENERATOR_TICK_VALUE: 'any' },\n },\n AlarmClock: {\n onRuleInvalid: { GENERATOR_ALARM_CLOCK_ERROR_MESSAGE: 'string' },\n onStart: {\n GENERATOR_ALARM_CLOCK_CURRENT_TIME: 'string',\n GENERATOR_ALARM_CLOCK_CURRENT_TIMESTAMP: 'number',\n GENERATOR_ALARM_CLOCK_NEXT_TRIG_TIME: 'string',\n GENERATOR_ALARM_CLOCK_NEXT_TRIG_TIMESTAMP: 'number',\n },\n onTrig: {\n GENERATOR_ALARM_CLOCK_CURRENT_TIME: 'string',\n GENERATOR_ALARM_CLOCK_CURRENT_TIMESTAMP: 'number',\n GENERATOR_ALARM_CLOCK_NEXT_TRIG_TIME: 'string',\n GENERATOR_ALARM_CLOCK_NEXT_TRIG_TIMESTAMP: 'number',\n },\n onEnd: {\n GENERATOR_ALARM_CLOCK_CURRENT_TIME: 'string',\n GENERATOR_ALARM_CLOCK_CURRENT_TIMESTAMP: 'number',\n GENERATOR_ALARM_CLOCK_REASON: 'string',\n GENERATOR_ALARM_CLOCK_MAX_TRIGS: 'number',\n GENERATOR_ALARM_CLOCK_STOP_AT: 'string',\n },\n },\n File: {\n initError: { GENERATOR_FILE_ERROR: 'string' },\n onFileStatusChange: { GENERATOR_FILE_PATH: 'string', GENERATOR_FILE_STATUS: 'string' },\n onReadStatsError: {\n GENERATOR_FILE_PATH: 'string',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n GENERATOR_FILE_ERROR: 'string',\n },\n onReadContentError: {\n GENERATOR_FILE_PATH: 'string',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n GENERATOR_FILE_ERROR: 'string',\n },\n onAppendContentError: {\n GENERATOR_FILE_PATH: 'string',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n GENERATOR_FILE_ERROR: 'string',\n },\n onWriteContentError: {\n GENERATOR_FILE_PATH: 'string',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n GENERATOR_FILE_ERROR: 'string',\n },\n onUploadProgress: {\n GENERATOR_FILE_ID: 'string',\n GENERATOR_FILE_INDEX: 'number',\n GENERATOR_FILE_PROGRESS: 'number',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n },\n onUploadError: {\n GENERATOR_FILE_ID: 'string',\n GENERATOR_FILE_INDEX: 'number',\n GENERATOR_FILE_ERROR: 'string',\n },\n onUploadComplete: {\n GENERATOR_FILE_ID: 'string',\n GENERATOR_FILE_INDEX: 'number',\n GENERATOR_FILE_PATH: 'string',\n },\n onUploadAllComplete: {\n GENERATOR_FILE_SINGLE:\n '{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }',\n GENERATOR_FILE_SINGLE_PATH: 'string',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n GENERATOR_FILE_LIST_PATHS: 'Array<string>',\n },\n onDownloadProgress: {\n GENERATOR_FILE_ID: 'string',\n GENERATOR_FILE_INDEX: 'number',\n GENERATOR_FILE_PROGRESS: 'number',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n },\n onDownloadError: {\n GENERATOR_FILE_ID: 'string',\n GENERATOR_FILE_INDEX: 'number',\n GENERATOR_FILE_ERROR: 'string',\n },\n onDownloadComplete: {\n GENERATOR_FILE_ID: 'string',\n GENERATOR_FILE_INDEX: 'number',\n GENERATOR_FILE_PATH: 'string',\n },\n onDownloadAllComplete: {\n GENERATOR_FILE_SINGLE:\n '{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }',\n GENERATOR_FILE_SINGLE_PATH: 'string',\n GENERATOR_FILE_LIST:\n 'Array<{ id?: string path?: string uri?: string hash?: string hashType?: string headers?: { [key: string]: any } fields?: { [key: string]: any } method?: string progress?: number isLastUpdated?: boolean [key: string]: any }>',\n GENERATOR_FILE_LIST_PATHS: 'Array<string>',\n },\n },\n MediaFlow: {\n fetchError: {\n GENERATOR_MEDIA_FLOW_ERROR: 'string',\n GENERATOR_MEDIA_FLOW_ERROR_IS_FROM_CACHE: 'boolean',\n },\n subscribeBoxError: { GENERATOR_MEDIA_FLOW_ERROR: 'string' },\n subscribeBoxConnectError: { GENERATOR_MEDIA_FLOW_ERROR: 'string' },\n },\n DataBank: {\n onFetchResponse: {\n GENERATOR_DATA_BANK_RESPONSE_PROPERTIES:\n 'Array<{ __typename?: string id?: string createAt?: string updateAt?: string spaceId?: string propertyId?: string definition?: { type?: string title?: string schema?: { [key: string]: any } [key: string]: any } meta?: string value?: any lastUpdateHash?: string lastUpdateNote?: string lastUpdateKey?: { name?: string enable_expired?: boolean expired_at?: any jwt?: boolean [key: string]: any } [key: string]: any }>',\n },\n onError: { GENERATOR_DATA_BANK_ERROR: '{ [key: string]: any }' },\n subscribeDataOnConnectError: { GENERATOR_DATA_BANK_ERROR: '{ [key: string]: any }' },\n },\n Graphql: { subscriptionOnConnectionError: { GENERATOR_GRAPHQL_ERROR: '{ [key: string]: any }' } },\n Http: {\n onResponse: {\n GENERATOR_HTTP_RESPONSE: 'any',\n GENERATOR_HTTP_RESPONSE_DETAILS:\n '{ ok?: boolean redirected?: boolean type?: string status?: number statusText?: string headers?: { [key: string]: any } body?: any event?: string id?: string data?: any [key: string]: any }',\n },\n onError: { GENERATOR_HTTP_ERROR: 'string' },\n },\n SoundPlayer: { onLoadError: { GENERATOR_SOUND_PLAYER_ERROR: 'string' } },\n Keyboard: {\n onDown: {\n GENERATOR_KEYBOARD_KEY: 'string',\n GENERATOR_KEYBOARD_KEY_NO_MAPPING: 'string',\n GENERATOR_KEYBOARD_KEY_CODE: 'string',\n GENERATOR_KEYBOARD_KEY_CODE_NO_MAPPING: 'string',\n GENERATOR_KEYBOARD_KEY_FLAGS: '{ [key: string]: any }',\n GENERATOR_KEYBOARD_KEY_DETAILS:\n '{ event?: string key?: any keyNoMapping?: any keyCode?: any keyCodeNoMapping?: any flags?: { [key: string]: any } [key: string]: any }',\n },\n onUp: {\n GENERATOR_KEYBOARD_KEY: 'string',\n GENERATOR_KEYBOARD_KEY_NO_MAPPING: 'string',\n GENERATOR_KEYBOARD_KEY_CODE: 'string',\n GENERATOR_KEYBOARD_KEY_CODE_NO_MAPPING: 'string',\n GENERATOR_KEYBOARD_KEY_FLAGS: '{ [key: string]: any }',\n GENERATOR_KEYBOARD_KEY_DETAILS:\n '{ event?: string key?: any keyNoMapping?: any keyCode?: any keyCodeNoMapping?: any flags?: { [key: string]: any } [key: string]: any }',\n },\n onBatch: {\n GENERATOR_KEYBOARD_BATCH_EVENTS:\n 'Array<{ event?: string key?: any keyNoMapping?: any keyCode?: any keyCodeNoMapping?: any flags?: { [key: string]: any } [key: string]: any }>',\n },\n },\n WebSocket: { onMessage: { GENERATOR_WEB_SOCKET_MESSAGE: 'any' } },\n CanvasMap: {\n onNavigate: {\n GENERATOR_CANVAS_MAP_MATCHED_RULE: '{ [key: string]: any }',\n GENERATOR_CANVAS_MAP_MATCHED_INDEX: 'number',\n GENERATOR_CANVAS_MAP_TARGET_CANVAS_ID: 'string',\n GENERATOR_CANVAS_MAP_TARGET_CANVAS_TITLE_LIKE: 'string',\n GENERATOR_CANVAS_MAP_PROPERTY_VALUE: 'any',\n GENERATOR_CANVAS_MAP_PREVIOUS_VALUE: 'any',\n },\n },\n Step: { onStep: { GENERATOR_STEP_PAYLOAD: 'string', GENERATOR_STEP_INDEX: 'number' } },\n Iterator: {\n iterate: {\n GENERATOR_ITERATOR_ITERATE_VALUE: 'any',\n GENERATOR_ITERATOR_ITERATE_KEY: 'any',\n GENERATOR_ITERATOR_ITERATE_INDEX: 'number',\n },\n first: {\n GENERATOR_ITERATOR_ITERATE_VALUE: 'any',\n GENERATOR_ITERATOR_ITERATE_KEY: 'any',\n GENERATOR_ITERATOR_ITERATE_INDEX: 'number',\n },\n end: {\n GENERATOR_ITERATOR_ITERATE_VALUE: 'any',\n GENERATOR_ITERATOR_ITERATE_KEY: 'any',\n GENERATOR_ITERATOR_ITERATE_INDEX: 'number',\n },\n error: { GENERATOR_ITERATOR_ERROR_MESSAGE: 'string', GENERATOR_ITERATOR_ERROR_DATA: 'any' },\n },\n Watchdog: {\n onEvent: {\n GENERATOR_WATCHDOG_EVENT_TYPE: 'string',\n GENERATOR_WATCHDOG_EVENT_TRIGGER_TYPE: 'string',\n GENERATOR_WATCHDOG_EVENT_SENDER_ID: 'string',\n },\n onTimeout: {\n GENERATOR_WATCHDOG_LAST_EVENT_TYPE: 'string',\n GENERATOR_WATCHDOG_LAST_EVENT_TRIGGER_TYPE: 'string',\n GENERATOR_WATCHDOG_LAST_EVENT_SENDER_ID: 'string',\n GENERATOR_WATCHDOG_TIMEOUT: 'number',\n },\n },\n Mqtt: {\n onError: { GENERATOR_MQTT_ERROR_MESSAGE: 'string' },\n onMessage: {\n GENERATOR_MQTT_PAYLOAD: 'any',\n GENERATOR_MQTT_TOPIC: 'string',\n GENERATOR_MQTT_QOS: 'number',\n GENERATOR_MQTT_RETAIN: 'boolean',\n },\n },\n MqttBroker: {\n onError: { GENERATOR_MQTT_BROKER_ERROR_MESSAGE: 'string' },\n onClientConnected: { GENERATOR_MQTT_BROKER_CLIENT_ID: 'string' },\n onClientDisconnected: { GENERATOR_MQTT_BROKER_CLIENT_ID: 'string' },\n onMessageReceived: {\n GENERATOR_MQTT_BROKER_TOPIC: 'string',\n GENERATOR_MQTT_BROKER_PAYLOAD: 'string',\n },\n onMessagePublished: {\n GENERATOR_MQTT_BROKER_CLIENT_ID: 'string',\n GENERATOR_MQTT_BROKER_MESSAGE_ID: 'number',\n },\n },\n BleCentral: {\n onError: { GENERATOR_BLE_CENTRAL_ERROR_MESSAGE: 'string' },\n onDiscoverDevice: {\n GENERATOR_BLE_CENTRAL_DEVICE_INFO:\n '{ id?: string name?: string rssi?: number advertising?: { [key: string]: any } [key: string]: any }',\n },\n onConnectDevice: {\n GENERATOR_BLE_CENTRAL_DEVICE_ID: 'string',\n GENERATOR_BLE_CENTRAL_CHARACTERISTIC_LIST: 'Array<{ [key: string]: any }>',\n },\n onReadReceive: {\n GENERATOR_BLE_CENTRAL_DEVICE_ID: 'string',\n GENERATOR_BLE_CENTRAL_SERVICE_ID: 'string',\n GENERATOR_BLE_CENTRAL_CHARACTERISTIC_ID: 'string',\n GENERATOR_BLE_CENTRAL_DATA_BASE64: 'string',\n },\n onMonitorReceive: {\n GENERATOR_BLE_CENTRAL_DEVICE_ID: 'string',\n GENERATOR_BLE_CENTRAL_SERVICE_ID: 'string',\n GENERATOR_BLE_CENTRAL_CHARACTERISTIC_ID: 'string',\n GENERATOR_BLE_CENTRAL_DATA_BASE64: 'string',\n },\n },\n SerialPort: {\n generatorSerialOnError: { GENERATOR_SERIAL_ERROR_MESSAGE: 'string' },\n generatorSerialOnData: {\n GENERATOR_SERIAL_DATA_BASE64: 'string',\n GENERATOR_SERIAL_DATA_STRING: 'string',\n },\n },\n Tcp: {\n onData: { GENERATOR_TCP_DATA: 'string' },\n onError: { GENERATOR_TCP_ERROR_MESSAGE: 'string' },\n },\n TcpServer: {\n onAcceptConnection: { GENERATOR_TCP_SERVER_REMOTE: 'string' },\n onData: { GENERATOR_TCP_SERVER_REMOTE: 'string', GENERATOR_TCP_SERVER_DATA: 'string' },\n onTimeout: { GENERATOR_TCP_SERVER_REMOTE: 'string' },\n onClose: { GENERATOR_TCP_SERVER_REMOTE: 'string' },\n onError: { GENERATOR_TCP_SERVER_ERROR_MESSAGE: 'string' },\n },\n Udp: {\n onData: {\n GENERATOR_UDP_REMOTE_ADDRESS: 'string',\n GENERATOR_UDP_REMOTE_PORT: 'number',\n GENERATOR_UDP_DATA: 'string',\n },\n onError: { GENERATOR_UDP_ERROR_MESSAGE: 'string' },\n },\n HttpServer: {\n onRequest: {\n GENERATOR_HTTP_SERVER_CLIENT_ADDRESS: 'string',\n GENERATOR_HTTP_SERVER_REQUEST_QUERY: '{ [key: string]: any }',\n GENERATOR_HTTP_SERVER_REQUEST_HEADERS: '{ [key: string]: any }',\n GENERATOR_HTTP_SERVER_REQUEST_BODY: 'any',\n },\n onClientClose: { GENERATOR_HTTP_SERVER_CLIENT_ADDRESS: 'string' },\n onClientError: {\n GENERATOR_HTTP_SERVER_CLIENT_ADDRESS: 'string',\n GENERATOR_HTTP_SERVER_ERROR_MESSAGE: 'string',\n },\n onError: { GENERATOR_HTTP_SERVER_ERROR_MESSAGE: 'string' },\n },\n Webrtc: {\n onSignalUpdate: { GENERATOR_WEBRTC_SIGNAL: 'any' },\n onError: { GENERATOR_WEBRTC_ERROR_MESSAGE: 'string' },\n onChannelMessage: { GENERATOR_WEBRTC_TEXT_MESSAGE: 'string' },\n },\n WebCrawler: {},\n SoundRecorder: {\n chunk: { GENERATOR_SOUND_RECORDER_CHUNK_DATA: 'string' },\n recorded: { GENERATOR_SOUND_RECORDER_RECORDED_PATH: 'string' },\n },\n BlePeripheral: {},\n Question: { onError: { GENERATOR_QUESTION_ERROR_MESSAGE: 'string' } },\n Information: { onError: { GENERATOR_INFORMATION_ERROR: 'string' } },\n Intent: {\n onResult: {\n GENERATOR_INTENT_RESULT_CODE: 'number',\n GENERATOR_INTENT_RESULT_DATA: 'string',\n GENERATOR_INTENT_RESULT_EXTRAS: '{ [key: string]: any }',\n },\n onError: { GENERATOR_INTENT_ERROR: 'string' },\n },\n CastlesPay: {\n onActionSuccess: { GENERATOR_CASTLES_PAY_ACTION_RESULT: '{ [key: string]: any }' },\n onActionError: { GENERATOR_CASTLES_PAY_ERROR: 'string' },\n },\n PlatformStt: {\n onSpeechResults: { GENERATOR_PLATFORM_STT_RECOGNIZED_TEXT: 'string' },\n onSpeechError: { GENERATOR_PLATFORM_STT_ERROR: 'string' },\n },\n ThermalPrinter: { onError: { GENERATOR_THERMAL_PRINTER_ERROR_MESSAGE: 'string' } },\n Sqlite: {\n onError: { GENERATOR_SQLITE_ERROR: 'string' },\n onQueryResult: { GENERATOR_SQLITE_QUERY_RESULT: 'Array<{ [key: string]: any }>' },\n },\n McpServer: {\n onError: { GENERATOR_MCP_SERVER_ERROR_MESSAGE: 'string' },\n onClientError: {\n GENERATOR_MCP_SERVER_CLIENT_ADDRESS: 'string',\n GENERATOR_MCP_SERVER_SESSION_ID: 'string',\n GENERATOR_MCP_SERVER_ERROR_MESSAGE: 'string',\n },\n onClientClose: {\n GENERATOR_MCP_SERVER_CLIENT_ADDRESS: 'string',\n GENERATOR_MCP_SERVER_SESSION_ID: 'string',\n },\n onRequestResource: {\n GENERATOR_MCP_SERVER_REQUEST_TYPE: 'string',\n GENERATOR_MCP_SERVER_REQUEST_ID: 'string',\n GENERATOR_MCP_SERVER_REQUEST_NAME: 'string',\n GENERATOR_MCP_SERVER_REQUEST_URI: 'string',\n GENERATOR_MCP_SERVER_REQUEST_VARIABLES: '{ [key: string]: any }',\n GENERATOR_MCP_SERVER_REQUEST_TIMEOUT: 'number',\n GENERATOR_MCP_SERVER_REQUEST:\n '{ type?: string id?: string name?: string uri?: string params?: { [key: string]: any } arguments?: { [key: string]: any } timeout?: number [key: string]: any }',\n },\n onCallTool: {\n GENERATOR_MCP_SERVER_REQUEST_TYPE: 'string',\n GENERATOR_MCP_SERVER_REQUEST_ID: 'string',\n GENERATOR_MCP_SERVER_REQUEST_NAME: 'string',\n GENERATOR_MCP_SERVER_REQUEST_VARIABLES: '{ [key: string]: any }',\n GENERATOR_MCP_SERVER_REQUEST_TIMEOUT: 'number',\n GENERATOR_MCP_SERVER_REQUEST:\n '{ type?: string id?: string name?: string uri?: string params?: { [key: string]: any } arguments?: { [key: string]: any } timeout?: number [key: string]: any }',\n },\n onGetPrompt: {\n GENERATOR_MCP_SERVER_REQUEST_TYPE: 'string',\n GENERATOR_MCP_SERVER_REQUEST_ID: 'string',\n GENERATOR_MCP_SERVER_REQUEST_NAME: 'string',\n GENERATOR_MCP_SERVER_REQUEST_VARIABLES: '{ [key: string]: any }',\n GENERATOR_MCP_SERVER_REQUEST_TIMEOUT: 'number',\n GENERATOR_MCP_SERVER_REQUEST:\n '{ type?: string id?: string name?: string uri?: string params?: { [key: string]: any } arguments?: { [key: string]: any } timeout?: number [key: string]: any }',\n },\n },\n Mcp: {\n onConnectionError: { GENERATOR_MCP_ERROR_MESSAGE: 'string' },\n onListResources: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_RESPONSE:\n '{ resources?: Array<{ name?: string [key: string]: any }> resourceTemplates?: Array<{ name?: string [key: string]: any }> contents?: Array<{ uri?: string text?: string blob?: string mimeType?: string [key: string]: any }> tools?: Array<{ name?: string description?: string inputSchema?: { [key: string]: any } [key: string]: any }> content?: Array<{ type?: string text?: string [key: string]: any }> prompts?: Array<{ name?: string [key: string]: any }> messages?: Array<{ role?: string content?: any [key: string]: any }> [key: string]: any }',\n },\n onListResourcesError: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_ERROR_MESSAGE: 'string',\n },\n onListResourceTemplates: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_RESPONSE:\n '{ resources?: Array<{ name?: string [key: string]: any }> resourceTemplates?: Array<{ name?: string [key: string]: any }> contents?: Array<{ uri?: string text?: string blob?: string mimeType?: string [key: string]: any }> tools?: Array<{ name?: string description?: string inputSchema?: { [key: string]: any } [key: string]: any }> content?: Array<{ type?: string text?: string [key: string]: any }> prompts?: Array<{ name?: string [key: string]: any }> messages?: Array<{ role?: string content?: any [key: string]: any }> [key: string]: any }',\n },\n onListResourceTemplatesError: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_ERROR_MESSAGE: 'string',\n },\n onReadResource: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_RESPONSE:\n '{ resources?: Array<{ name?: string [key: string]: any }> resourceTemplates?: Array<{ name?: string [key: string]: any }> contents?: Array<{ uri?: string text?: string blob?: string mimeType?: string [key: string]: any }> tools?: Array<{ name?: string description?: string inputSchema?: { [key: string]: any } [key: string]: any }> content?: Array<{ type?: string text?: string [key: string]: any }> prompts?: Array<{ name?: string [key: string]: any }> messages?: Array<{ role?: string content?: any [key: string]: any }> [key: string]: any }',\n },\n onReadResourceError: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_ERROR_MESSAGE: 'string',\n },\n onListTools: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_RESPONSE:\n '{ resources?: Array<{ name?: string [key: string]: any }> resourceTemplates?: Array<{ name?: string [key: string]: any }> contents?: Array<{ uri?: string text?: string blob?: string mimeType?: string [key: string]: any }> tools?: Array<{ name?: string description?: string inputSchema?: { [key: string]: any } [key: string]: any }> content?: Array<{ type?: string text?: string [key: string]: any }> prompts?: Array<{ name?: string [key: string]: any }> messages?: Array<{ role?: string content?: any [key: string]: any }> [key: string]: any }',\n },\n onListToolsError: { GENERATOR_MCP_REQUEST_ID: 'string', GENERATOR_MCP_ERROR_MESSAGE: 'string' },\n onCallTool: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_RESPONSE:\n '{ resources?: Array<{ name?: string [key: string]: any }> resourceTemplates?: Array<{ name?: string [key: string]: any }> contents?: Array<{ uri?: string text?: string blob?: string mimeType?: string [key: string]: any }> tools?: Array<{ name?: string description?: string inputSchema?: { [key: string]: any } [key: string]: any }> content?: Array<{ type?: string text?: string [key: string]: any }> prompts?: Array<{ name?: string [key: string]: any }> messages?: Array<{ role?: string content?: any [key: string]: any }> [key: string]: any }',\n },\n onCallToolError: { GENERATOR_MCP_REQUEST_ID: 'string', GENERATOR_MCP_ERROR_MESSAGE: 'string' },\n onListPrompts: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_RESPONSE:\n '{ resources?: Array<{ name?: string [key: string]: any }> resourceTemplates?: Array<{ name?: string [key: string]: any }> contents?: Array<{ uri?: string text?: string blob?: string mimeType?: string [key: string]: any }> tools?: Array<{ name?: string description?: string inputSchema?: { [key: string]: any } [key: string]: any }> content?: Array<{ type?: string text?: string [key: string]: any }> prompts?: Array<{ name?: string [key: string]: any }> messages?: Array<{ role?: string content?: any [key: string]: any }> [key: string]: any }',\n },\n onListPromptsError: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_ERROR_MESSAGE: 'string',\n },\n onGetPrompt: {\n GENERATOR_MCP_REQUEST_ID: 'string',\n GENERATOR_MCP_RESPONSE:\n '{ resources?: Array<{ name?: string [key: string]: any }> resourceTemplates?: Array<{ name?: string [key: string]: any }> contents?: Array<{ uri?: string text?: string blob?: string mimeType?: string [key: string]: any }> tools?: Array<{ name?: string description?: string inputSchema?: { [key: string]: any } [key: string]: any }> content?: Array<{ type?: string text?: string [key: string]: any }> prompts?: Array<{ name?: string [key: string]: any }> messages?: Array<{ role?: string content?: any [key: string]: any }> [key: string]: any }',\n },\n onGetPromptError: { GENERATOR_MCP_REQUEST_ID: 'string', GENERATOR_MCP_ERROR_MESSAGE: 'string' },\n },\n TraditionalVad: {\n onContextStateChange: { GENERATOR_TRADITIONAL_VAD_CONTEXT_STATE: 'string' },\n onDetected: {\n GENERATOR_TRADITIONAL_VAD_DETECTION_SEGMENTS:\n 'Array<{ t0?: number t1?: number [key: string]: any }>',\n GENERATOR_TRADITIONAL_VAD_DETECTION_TIME: 'number',\n },\n onError: { GENERATOR_TRADITIONAL_VAD_ERROR: 'string' },\n },\n Tts: {\n onContextStateChange: { GENERATOR_TTS_CONTEXT_STATE: 'string' },\n onError: { GENERATOR_TTS_ERROR: 'string' },\n },\n OnnxLlm: {\n onContextStateChange: { GENERATOR_ONNX_LLM_CONTEXT_STATE: 'string' },\n onFunctionCall: {\n GENERATOR_ONNX_LLM_FUNCTION_CALL_NAME: 'string',\n GENERATOR_ONNX_LLM_FUNCTION_CALL_ARGUMENTS: '{ [key: string]: any }',\n GENERATOR_ONNX_LLM_FUNCTION_CALL_DETAILS:\n '{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }',\n },\n onCompletionFinished: {\n GENERATOR_ONNX_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_ONNX_LLM_COMPLETION_TOOL_CALLS:\n 'Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }>',\n GENERATOR_ONNX_LLM_COMPLETION_FULL_CONTEXT: 'string',\n },\n onError: { GENERATOR_ONNX_LLM_ERROR: 'string' },\n },\n OnnxStt: {\n onContextStateChange: { GENERATOR_ONNX_STT_CONTEXT_STATE: 'string' },\n onError: { GENERATOR_ONNX_STT_ERROR: 'string' },\n },\n OnnxVad: {\n onContextStateChange: { GENERATOR_ONNX_VAD_CONTEXT_STATE: 'string' },\n onError: { GENERATOR_ONNX_VAD_ERROR: 'string' },\n onDetected: {\n GENERATOR_ONNX_VAD_DETECTION_SEGMENTS:\n 'Array<{ start?: number end?: number confidence?: number t0?: number t1?: number [key: string]: any }>',\n GENERATOR_ONNX_VAD_DETECTION_TIME: 'number',\n },\n },\n SpeechInference: {\n onContextStateChange: {\n GENERATOR_SPEECH_INFERENCE_CONTEXT_STATE: 'string',\n GENERATOR_SPEECH_INFERENCE_CONTEXT_DETAILS:\n '{ state?: string contextId?: string gpu?: string reasonNoGPU?: string [key: string]: any }',\n },\n onError: { GENERATOR_SPEECH_INFERENCE_ERROR: 'string' },\n onTranscribed: {\n GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_RESULT: 'string',\n GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_LANGUAGE: 'string',\n GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_START_TIME: 'number',\n GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_END_TIME: 'number',\n GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_TIME: 'number',\n },\n },\n VadInference: {\n onContextStateChange: {\n GENERATOR_VAD_INFERENCE_CONTEXT_STATE: 'string',\n GENERATOR_VAD_INFERENCE_CONTEXT_DETAILS:\n '{ state?: string contextId?: string gpu?: string reasonNoGPU?: string [key: string]: any }',\n },\n onError: { GENERATOR_VAD_INFERENCE_ERROR: 'string' },\n onDetected: {\n GENERATOR_VAD_INFERENCE_DETECTION_SEGMENTS:\n 'Array<{ start?: number end?: number confidence?: number t0?: number t1?: number [key: string]: any }>',\n GENERATOR_VAD_INFERENCE_DETECTION_TIME: 'number',\n },\n },\n RealtimeTranscription: {\n onTranscribe: {\n GENERATOR_REALTIME_TRANSCRIPTION_TRANSCRIBE_EVENT:\n '{ type?: string sliceIndex?: number isCapturing?: boolean data?: { result?: string language?: string [key: string]: any } vadEvent?: { type?: string confidence?: number duration?: number sliceIndex?: number timestamp?: number [key: string]: any } [key: string]: any }',\n GENERATOR_REALTIME_TRANSCRIPTION_TRANSCRIBE_TYPE: 'string',\n GENERATOR_REALTIME_TRANSCRIPTION_TRANSCRIBE_SLICE_INDEX: 'number',\n GENERATOR_REALTIME_TRANSCRIPTION_TRANSCRIBE_RESULT_TEXT: 'string',\n GENERATOR_REALTIME_TRANSCRIPTION_TRANSCRIBE_LANGUAGE: 'string',\n GENERATOR_REALTIME_TRANSCRIPTION_TRANSCRIBE_IS_CAPTURING: 'boolean',\n GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT:\n '{ type?: string confidence?: number duration?: number sliceIndex?: number timestamp?: number [key: string]: any }',\n GENERATOR_REALTIME_TRANSCRIPTION_VAD_TYPE: 'string',\n },\n onVad: {\n GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT:\n '{ type?: string confidence?: number duration?: number sliceIndex?: number timestamp?: number [key: string]: any }',\n GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_TYPE: 'string',\n GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_CONFIDENCE: 'number',\n GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_DURATION: 'number',\n GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_SLICE_INDEX: 'number',\n },\n onError: { GENERATOR_REALTIME_TRANSCRIPTION_ERROR: 'string' },\n onStatusChange: { GENERATOR_REALTIME_TRANSCRIPTION_IS_ACTIVE: 'boolean' },\n onStatsUpdate: {\n GENERATOR_REALTIME_TRANSCRIPTION_STATS_TYPE: 'string',\n GENERATOR_REALTIME_TRANSCRIPTION_STATS_TIMESTAMP: 'number',\n GENERATOR_REALTIME_TRANSCRIPTION_STATS:\n '{ type?: string timestamp?: number data?: { [key: string]: any } [key: string]: any }',\n },\n onStabilized: {\n GENERATOR_REALTIME_TRANSCRIPTION_STABILIZED_TEXT: 'string',\n GENERATOR_REALTIME_TRANSCRIPTION_STABILIZED_LANGUAGE: 'string',\n },\n onEnd: {\n GENERATOR_REALTIME_TRANSCRIPTION_END_RESULTS:\n 'Array<{ transcribeEvent?: { type?: string sliceIndex?: number isCapturing?: boolean data?: { result?: string language?: string [key: string]: any } vadEvent?: { type?: string confidence?: number duration?: number sliceIndex?: number timestamp?: number [key: string]: any } [key: string]: any } vadEvent?: { type?: string confidence?: number duration?: number sliceIndex?: number timestamp?: number [key: string]: any } [key: string]: any }>',\n GENERATOR_REALTIME_TRANSCRIPTION_END_AUDIO_OUTPUT_PATH: 'string',\n },\n },\n Llm: {\n onContextStateChange: {\n GENERATOR_LLM_CONTEXT_STATE: 'string',\n GENERATOR_LLM_CONTEXT_DETAILS:\n '{ state?: string contextId?: string gpu?: string reasonNoGPU?: string model?: { [key: string]: any } isMultimodalEnabled?: boolean [key: string]: any }',\n GENERATOR_LLM_CONTEXT_STATE_DETAILS:\n '{ state?: string contextId?: string gpu?: string reasonNoGPU?: string model?: { [key: string]: any } isMultimodalEnabled?: boolean [key: string]: any }',\n },\n onError: { GENERATOR_LLM_ERROR: 'string' },\n onCompletion: {\n GENERATOR_LLM_COMPLETION_SESSION_KEY: 'string',\n GENERATOR_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_LLM_COMPLETION_REASONING_CONTENT: 'string',\n GENERATOR_LLM_COMPLETION_FULL_CONTEXT: 'string',\n GENERATOR_LLM_COMPLETION_RESULT_DETAILS:\n '{ prompt?: string full_context?: string text?: string content?: string reasoning_content?: string token?: string tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> [key: string]: any }',\n },\n onCompletionFinished: {\n GENERATOR_LLM_COMPLETION_SESSION_KEY: 'string',\n GENERATOR_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_LLM_COMPLETION_REASONING_CONTENT: 'string',\n GENERATOR_LLM_COMPLETION_TOOL_CALLS:\n 'Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }>',\n GENERATOR_LLM_COMPLETION_FULL_CONTEXT: 'string',\n GENERATOR_LLM_COMPLETION_IS_CONTEXT_FULL: 'boolean',\n GENERATOR_LLM_COMPLETION_IS_TRUNCATED: 'boolean',\n GENERATOR_LLM_COMPLETION_RESULT_DETAILS:\n '{ prompt?: string full_context?: string text?: string content?: string reasoning_content?: string token?: string tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> [key: string]: any }',\n },\n onCompletionFunctionCall: {\n GENERATOR_LLM_COMPLETION_SESSION_KEY: 'string',\n GENERATOR_LLM_COMPLETION_FUNCTION_CALL_ID: 'string',\n GENERATOR_LLM_COMPLETION_FUNCTION_CALL_NAME: 'string',\n GENERATOR_LLM_COMPLETION_FUNCTION_ARGUMENTS: '{ [key: string]: any }',\n GENERATOR_LLM_COMPLETION_FUNCTION_DETAILS:\n '{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }',\n },\n },\n GgmlTts: {\n onContextStateChange: { GENERATOR_GGML_TTS_CONTEXT_STATE: 'string' },\n onError: { GENERATOR_GGML_TTS_ERROR: 'string' },\n },\n Reranker: {\n onContextStateChange: {\n GENERATOR_RERANKER_CONTEXT_STATE: 'string',\n GENERATOR_RERANKER_CONTEXT_DETAILS:\n '{ state?: string contextId?: string gpu?: string reasonNoGPU?: string [key: string]: any }',\n },\n onError: { GENERATOR_RERANKER_ERROR: 'string' },\n },\n MlxLlm: {\n onContextStateChange: { GENERATOR_MLX_LLM_CONTEXT_STATE: 'string' },\n onError: { GENERATOR_MLX_LLM_ERROR: 'string' },\n onCompletion: {\n GENERATOR_MLX_LLM_COMPLETION_TOKEN: 'string',\n GENERATOR_MLX_LLM_COMPLETION_RESULT: 'string',\n },\n onCompletionFinished: {\n GENERATOR_MLX_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_MLX_LLM_COMPLETION_RESULT_DETAILS:\n '{ text?: string content?: string reasoning_content?: string timings?: { [key: string]: any } tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> [key: string]: any }',\n },\n },\n QnnLlm: {\n onContextStateChange: { GENERATOR_QNN_LLM_CONTEXT_STATE: 'string' },\n onGenerate: {\n GENERATOR_QNN_LLM_RESULT: 'string',\n GENERATOR_QNN_LLM_FULL_CONTEXT: 'string',\n GENERATOR_QNN_LLM_TOOL_CALLS:\n 'Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }>',\n },\n onFunctionCall: {\n GENERATOR_QNN_LLM_FUNCTION_CALL_NAME: 'string',\n GENERATOR_QNN_LLM_FUNCTION_CALL_ARGUMENTS: '{ [key: string]: any }',\n GENERATOR_QNN_LLM_FUNCTION_CALL_DETAILS:\n '{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }',\n },\n onError: { GENERATOR_QNN_LLM_ERROR: 'string' },\n },\n NeuropilotLlm: {\n onContextStateChange: { GENERATOR_NEUROPILOT_LLM_CONTEXT_STATE: 'string' },\n onCompletion: {\n GENERATOR_NEUROPILOT_LLM_COMPLETION_TOKEN: 'string',\n GENERATOR_NEUROPILOT_LLM_COMPLETION_RESULT: 'string',\n },\n onCompletionFinished: {\n GENERATOR_NEUROPILOT_LLM_RESULT: 'string',\n GENERATOR_NEUROPILOT_LLM_FULL_CONTEXT: 'string',\n GENERATOR_NEUROPILOT_LLM_RAW_OUTPUT: 'string',\n GENERATOR_NEUROPILOT_LLM_EXIT_CODE: 'number',\n GENERATOR_NEUROPILOT_LLM_PROMPT_TOKENS_PER_SEC: 'string',\n GENERATOR_NEUROPILOT_LLM_GENERATION_TOKENS_PER_SEC: 'string',\n },\n onError: { GENERATOR_NEUROPILOT_LLM_ERROR: 'string' },\n },\n OpenaiLlm: {\n onError: { GENERATOR_OPENAI_LLM_ERROR: 'string' },\n onCompletion: {\n GENERATOR_OPENAI_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_OPENAI_LLM_COMPLETION_DETAILS:\n '{ text?: string content?: string finish_reason?: string usage?: { [key: string]: any } tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> [key: string]: any }',\n },\n onCompletionFinished: {\n GENERATOR_OPENAI_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_OPENAI_LLM_TOOL_CALLS:\n 'Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }>',\n },\n onCompletionFunctionCall: {\n GENERATOR_OPENAI_LLM_COMPLETION_FUNCTION_CALL_NAME: 'string',\n GENERATOR_OPENAI_LLM_COMPLETION_FUNCTION_ARGUMENTS: 'string',\n },\n onResponseCreated: {\n GENERATOR_OPENAI_LLM_RESPONSE_ID: 'string',\n GENERATOR_OPENAI_LLM_RESPONSE_STATUS: 'string',\n GENERATOR_OPENAI_LLM_RESPONSE: '{}',\n },\n onOutputItemAdded: {\n GENERATOR_OPENAI_LLM_RESPONSE_ID: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEM_ID: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEM_TYPE: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEM: '{}',\n },\n onOutputTextDelta: {\n GENERATOR_OPENAI_LLM_RESPONSE_ID: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEM_ID: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_INDEX: 'number',\n GENERATOR_OPENAI_LLM_CONTENT_INDEX: 'number',\n GENERATOR_OPENAI_LLM_COMPLETION_TOKEN: 'string',\n GENERATOR_OPENAI_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_OPENAI_LLM_COMPLETION_DETAILS: '{}',\n },\n onOutputItemDone: {\n GENERATOR_OPENAI_LLM_RESPONSE_ID: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEM_ID: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEM_TYPE: 'string',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEM: '{}',\n },\n onResponseCompleted: {\n GENERATOR_OPENAI_LLM_RESPONSE_ID: 'string',\n GENERATOR_OPENAI_LLM_RESPONSE_STATUS: 'string',\n GENERATOR_OPENAI_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_OPENAI_LLM_TOOL_CALLS: 'Array<any>',\n GENERATOR_OPENAI_LLM_OUTPUT_ITEMS: 'Array<any>',\n GENERATOR_OPENAI_LLM_RESPONSE: '{}',\n },\n onResponseFailed: {\n GENERATOR_OPENAI_LLM_RESPONSE_ID: 'string',\n GENERATOR_OPENAI_LLM_RESPONSE_STATUS: 'string',\n GENERATOR_OPENAI_LLM_ERROR: 'string',\n GENERATOR_OPENAI_LLM_RESPONSE: '{}',\n },\n },\n OpenaiTts: {\n onContextStateChange: { GENERATOR_OPENAI_TTS_CONTEXT_STATE: 'string' },\n onError: { GENERATOR_OPENAI_TTS_ERROR: 'string' },\n },\n AnthropicLlm: {\n onError: { GENERATOR_ANTHROPIC_LLM_ERROR: 'string' },\n onCompletion: {\n GENERATOR_ANTHROPIC_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_ANTHROPIC_LLM_COMPLETION_DETAILS:\n '{ model?: string stop_reason?: string usage?: { [key: string]: any } content?: Array<any> [key: string]: any }',\n },\n onCompletionFinished: {\n GENERATOR_ANTHROPIC_LLM_COMPLETION_RESULT: 'string',\n GENERATOR_ANTHROPIC_LLM_TOOL_USES:\n 'Array<{ id?: string name?: string input?: { [key: string]: any } type?: string [key: string]: any }>',\n },\n onToolUse: {\n GENERATOR_ANTHROPIC_LLM_TOOL_USE_NAME: 'string',\n GENERATOR_ANTHROPIC_LLM_TOOL_USE_INPUT: '{ [key: string]: any }',\n },\n },\n AppleLlm: {\n onError: { GENERATOR_APPLE_LLM_ERROR: 'string' },\n onModelLoaded: {},\n onCompletion: {\n GENERATOR_APPLE_LLM_COMPLETION_TOKEN: 'string',\n GENERATOR_APPLE_LLM_COMPLETION_RESULT: 'string',\n },\n onCompletionFinished: { GENERATOR_APPLE_LLM_COMPLETION_RESULT: 'string' },\n },\n AppleStt: {\n onError: { GENERATOR_APPLE_STT_ERROR: 'string' },\n onTranscribed: {\n GENERATOR_APPLE_STT_TRANSCRIBE_RESULT: 'string',\n GENERATOR_APPLE_STT_TRANSCRIBE_START_TIME: 'number',\n GENERATOR_APPLE_STT_TRANSCRIBE_END_TIME: 'number',\n GENERATOR_APPLE_STT_TRANSCRIBE_TIME: 'number',\n },\n },\n AppleTts: {\n onContextStateChange: { GENERATOR_APPLE_TTS_CONTEXT_STATE: 'string' },\n onError: { GENERATOR_APPLE_TTS_ERROR: 'string' },\n },\n Assistant: {\n onError: { GENERATOR_ASSISTANT_ERROR: 'string' },\n onLogs: {\n GENERATOR_ASSISTANT_LOGS:\n 'Array<{ type?: string content?: any timestamp?: number [key: string]: any }>',\n },\n onMessagesUpdate: {\n GENERATOR_ASSISTANT_MESSAGES:\n 'Array<{ role?: string name?: string content?: any tool_call_id?: string tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> reasoning_content?: string audio?: { generating?: boolean [key: string]: any } last_generated_at?: number responding?: boolean is_summary?: boolean summary_created_at?: number [key: string]: any }>',\n },\n onHeatupFinished: {},\n onGenerating: {},\n onFinished: {\n GENERATOR_ASSISTANT_MESSAGES:\n 'Array<{ role?: string name?: string content?: any tool_call_id?: string tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> reasoning_content?: string audio?: { generating?: boolean [key: string]: any } last_generated_at?: number responding?: boolean is_summary?: boolean summary_created_at?: number [key: string]: any }>',\n GENERATOR_ASSISTANT_LAST_MESSAGE:\n '{ role?: string name?: string content?: any tool_call_id?: string tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> reasoning_content?: string audio?: { generating?: boolean [key: string]: any } last_generated_at?: number responding?: boolean is_summary?: boolean summary_created_at?: number [key: string]: any }',\n GENERATOR_ASSISTANT_IS_ERROR: 'boolean',\n GENERATOR_ASSISTANT_FINISH_REASON: 'string',\n GENERATOR_ASSISTANT_TRANSFORMED_MESSAGES:\n 'Array<{ role?: string name?: string content?: any tool_call_id?: string tool_calls?: Array<{ id?: string type?: string function?: { name?: string arguments?: string [key: string]: any } [key: string]: any }> reasoning_content?: string audio?: { generating?: boolean [key: string]: any } last_generated_at?: number responding?: boolean is_summary?: boolean summary_created_at?: number [key: string]: any }>',\n },\n },\n VectorStore: { onError: { GENERATOR_VECTOR_STORE_ERROR: 'string' } },\n} as const\n\nexport type TemplateEventPropsMap = typeof templateEventPropsMap\nexport type TemplateKey = keyof TemplateEventPropsMap\n","utils/id.ts":"import { createHash, randomUUID } from 'node:crypto'\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\n// RFC 4122 v4 formatting of 16 caller-supplied bytes. Replaces `uuid.v4({ random })` —\n// bit-for-bit — so this file (shipped into projects as ctor/utils/id.ts) needs no\n// external dependency. Existing projects' stable ids must not shift.\nconst uuidFromBytes = (bytes: Uint8Array) => {\n bytes[6] = (bytes[6] & 0x0f) | 0x40\n bytes[8] = (bytes[8] & 0x3f) | 0x80\n const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`\n}\n\nlet count = 0\n\ntype IdType =\n | 'animation'\n | 'brick'\n | 'canvas'\n | 'generator'\n | 'data'\n | 'switch'\n | 'property_bank_command'\n | 'property_bank_calc'\n | 'dynamic-brick'\n | 'automation_map'\n | 'test'\n | 'test_case'\n | 'test_var'\n | 'subspace'\n\ntype IdOptions = {\n snapshotMode?: boolean\n}\n\nconst APPLICATION_ID_FALLBACK = 'unknown-application'\n\nconst usedStableAliases = new Set<string>()\nlet applicationIdCache: { cwd: string; id: string } | null = null\n\nconst readApplicationId = () => {\n const cwd = process.cwd()\n if (applicationIdCache?.cwd === cwd) return applicationIdCache.id\n\n let id = APPLICATION_ID_FALLBACK\n try {\n const app = JSON.parse(readFileSync(join(cwd, 'application.json'), 'utf8'))\n if (typeof app.id === 'string' && app.id) id = app.id\n } catch {\n // `makeId` is also used from tests and utilities outside project roots.\n }\n\n applicationIdCache = { cwd, id }\n return id\n}\n\nconst hashToRandomBytes = (parts: string[]) => {\n const hash = createHash('sha256').update(JSON.stringify(parts)).digest()\n return new Uint8Array(hash.subarray(0, 16))\n}\n\nconst makeStableUuid = (type: string, alias?: string) => {\n const applicationId = readApplicationId()\n const seed = alias ?? String(count)\n if (alias === undefined) count += 1\n\n if (alias !== undefined) {\n const aliasKey = JSON.stringify([applicationId, type, alias])\n if (usedStableAliases.has(aliasKey)) {\n throw new Error(`Duplicate makeId alias '${alias}' for type '${type}'`)\n }\n usedStableAliases.add(aliasKey)\n }\n\n return uuidFromBytes(hashToRandomBytes([applicationId, type, seed]))\n}\n\nconst idPrefix = (type: IdType): string => {\n switch (type) {\n case 'animation':\n return 'ANIMATION_'\n case 'brick':\n return 'BRICK_'\n case 'dynamic-brick':\n return 'DYNAMIC_BRICK_'\n case 'canvas':\n return 'CANVAS_'\n case 'generator':\n return 'GENERATOR_'\n case 'data':\n return 'PROPERTY_BANK_DATA_NODE_'\n case 'switch':\n return 'BRICK_STATE_GROUP_'\n case 'property_bank_command':\n return 'PROPERTY_BANK_COMMAND_NODE_'\n case 'property_bank_calc':\n return 'PROPERTY_BANK_COMMAND_MAP_'\n case 'automation_map':\n return 'AUTOMATION_MAP_'\n case 'test':\n return 'TEST_'\n case 'test_case':\n return 'TEST_CASE_'\n case 'test_var':\n return 'TEST_VAR_'\n default:\n return ''\n }\n}\n\n// Make stable ids by default; explicit snapshotMode: false preserves the random escape hatch.\nexport const makeId = (type: IdType, aliasOrOpts?: string | IdOptions, opts?: IdOptions) => {\n if (type === 'subspace') {\n throw new Error('Currently subspace is not supported for ID generation, please use a fixed ID')\n }\n\n const alias = typeof aliasOrOpts === 'string' ? aliasOrOpts : undefined\n const options = typeof aliasOrOpts === 'string' ? opts : (aliasOrOpts ?? opts)\n\n const useCountFallback = aliasOrOpts === undefined && opts === undefined\n const id =\n alias !== undefined || options?.snapshotMode || useCountFallback\n ? makeStableUuid(type, alias)\n : randomUUID()\n return `${idPrefix(type)}${id}`\n}\n\n// Deterministic id derived solely from a caller-supplied seed. Unlike makeId it keeps no\n// global state — no incrementing counter, no alias registry — so the same (type, seed)\n// always maps to the same id on every compile and in any process. Compiled artifacts seed\n// their ids this way (e.g. generateCalulationMap's command nodes, seeded by their calc id +\n// structural role) so unchanged source recompiles byte-identically and editing one calc\n// never shifts another's ids. The seed must be unique within a single config.\nexport const makeSeededId = (type: IdType, seed: string) => {\n if (type === 'subspace') {\n throw new Error('Currently subspace is not supported for ID generation, please use a fixed ID')\n }\n return `${idPrefix(type)}${uuidFromBytes(hashToRandomBytes([readApplicationId(), type, seed]))}`\n}\n"},w={"bricks-ctor/SKILL.md":"---\nname: bricks-ctor\ndescription: Advanced BRICKS configuration knowledge. Covers Standby Transition, Automations (E2E testing), Data Calculation (JS sandbox libraries), Local Sync, Remote Data Bank, Media Flow, Buttress (remote inference), and the verification toolchain (compile, harness-specific preview tool, on-device DevTools, definition-of-done gate). Triggers on multi-device sync, cloud data, media assets, AI offloading, E2E testing, canvas transitions, or verifying project work before declaring done.\n---\n\n# BRICKS Ctor - Advanced Features\n\nThis skill covers advanced BRICKS features not in the main project instructions.\n\n## Rules Index\n\n| Rule | Description |\n|------|-------------|\n| [Architecture Patterns](references/architecture-patterns.md) | **Read first** — decompose flows and select patterns |\n| [Source-Editing Tools](references/source-editing-tools.md) | MCP tools for editing entries and data-calcs by AST (new/edit/remove, value grammar, verify) |\n| [Animation](references/animation.md) | Animation system for brick transforms and opacity |\n| [Standby Transition](references/standby-transition.md) | Canvas enter/exit animations |\n| [Automations](references/automations.md) | E2E testing and scheduled tasks |\n| [Data Calculation](references/data-calculation.md) | Wiring contract, trigger semantics, JS sandbox (25+ libraries) |\n| [Local Sync](references/local-sync.md) | LAN device synchronization |\n| [Remote Data Bank](references/remote-data-bank.md) | Cloud data sync and API access |\n| [Media Flow](references/media-flow.md) | Media asset management |\n| [Buttress](references/buttress.md) | Remote inference for AI generators |\n| [Verification Toolchain](references/verification-toolchain.md) | Definition of done, compile, preview tool selection, on-device DevTools, Path 1/2/3 decision rule |\n| [Simulator](references/simulator.md) | Path 1 fidelity — Simulator feature support, fallbacks (Camera/LLM/STT/Vector Store, Buttress disabled), when a green run is enough vs. Path 2 |\n\n## Quick Reference\n\n- **Complex flows**: See [Architecture Patterns](references/architecture-patterns.md) for decomposing multi-step workflows\n- **Editing entries/data-calcs**: See [Source-Editing Tools](references/source-editing-tools.md) — prefer the MCP editing tools over hand-editing `subspaces/**`\n- **Multi-device**: See [Local Sync](references/local-sync.md) for LAN coordination\n- **Cloud data**: See [Remote Data Bank](references/remote-data-bank.md) for sync and API access\n- **Media assets**: See [Media Flow](references/media-flow.md) for centralized asset management\n- **AI offloading**: See [Buttress](references/buttress.md) for GPU server delegation\n- **E2E testing**: See [Automations](references/automations.md) for test automation\n- **Enter animations**: See [Standby Transition](references/standby-transition.md) for canvas transitions\n- **Verification before done**: See [Verification Toolchain](references/verification-toolchain.md) for the definition-of-done gate and Path 1/2/3 decision rule\n- **Simulator fidelity**: See [Simulator](references/simulator.md) for what the Simulator fakes (Camera, AI generators, Buttress) and when to escalate to a real device\n","bricks-ctor/references/animation.md":"# Animation\n\nBRICKS Animation system for animating brick transforms and opacity. Animations are defined at the Subspace level and triggered via events or Dynamic Animation actions.\n\n## Animation Types\n\n### Timing Animation\nStandard duration-based animation with easing.\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst fadeIn: AnimationDef = {\n __typename: 'Animation',\n id: makeId('animation'),\n title: 'Fade In',\n runType: 'once', // 'once' | 'loop'\n property: 'opacity',\n config: {\n __type: 'AnimationTimingConfig',\n toValue: 1,\n duration: 300, // ms\n easing: 'easeOutCubic',\n delay: 0, // ms\n isInteraction: true,\n },\n}\n```\n\n### Spring Animation\nPhysics-based spring animation.\n\n```typescript\nconst bounce: AnimationDef = {\n __typename: 'Animation',\n id: makeId('animation'),\n title: 'Bounce In',\n property: 'transform.scale',\n config: {\n __type: 'AnimationSpringConfig',\n toValue: 1,\n friction: 7,\n tension: 40,\n },\n}\n```\n\nUse one spring parameter family per config: `tension/friction`, `speed/bounciness`, or\n`stiffness/damping/mass`.\n\n### Decay Animation\nVelocity-based deceleration animation.\n\n```typescript\nconst slideOut: AnimationDef = {\n __typename: 'Animation',\n id: makeId('animation'),\n title: 'Slide Out',\n property: 'transform.translateX',\n config: {\n __type: 'AnimationDecayConfig',\n toValue: 500,\n velocity: 0.5,\n deceleration: 0.997,\n isInteraction: true,\n },\n}\n```\n\n## Animatable Properties\n\n| Property | Description |\n|----------|-------------|\n| `transform.translateX` | Horizontal position offset |\n| `transform.translateY` | Vertical position offset |\n| `transform.scale` | Uniform scale |\n| `transform.scaleX` | Horizontal scale |\n| `transform.scaleY` | Vertical scale |\n| `transform.rotate` | Rotation (degrees) |\n| `transform.rotateX` | X-axis rotation |\n| `transform.rotateY` | Y-axis rotation |\n| `opacity` | Transparency (0-1) |\n\n## Easing Functions\n\nStandard easing from [easings.net](https://easings.net):\n- `easeInSine`, `easeOutSine`, `easeInOutSine`\n- `easeInQuad`, `easeOutQuad`, `easeInOutQuad`\n- `easeInCubic`, `easeOutCubic`, `easeInOutCubic`\n- `easeInQuart`, `easeOutQuart`, `easeInOutQuart`\n- `easeInQuint`, `easeOutQuint`, `easeInOutQuint`\n- `easeInExpo`, `easeOutExpo`, `easeInOutExpo`\n- `easeInCirc`, `easeOutCirc`, `easeInOutCirc`\n- `easeInBack`, `easeOutBack`, `easeInOutBack`\n- `easeInElastic`, `easeOutElastic`, `easeInOutElastic`\n- `easeInBounce`, `easeOutBounce`, `easeInOutBounce`\n- Custom: `'cubic-bezier(x1, y1, x2, y2)'`\n\n## Composed Animations\n\nCombine multiple animations in parallel or sequence.\n\n```typescript\nconst enterAnimation: AnimationComposeDef = {\n __typename: 'AnimationCompose',\n id: makeId('animation'),\n title: 'Enter Animation',\n runType: 'once',\n composeType: 'parallel', // 'parallel' | 'sequence'\n items: [\n () => fadeIn,\n () => scaleUp,\n ],\n}\n```\n\n## Brick Animation Events\n\nBricks support automatic animation binding:\n\n```typescript\n// In brick definition\nanimations: {\n showStart: () => fadeInAnimation, // On brick first render\n standby: () => standbyAnimation, // After standby transition\n breatheStart: () => pulseAnimation, // Breathing effect (looping)\n}\n```\n\n## Dynamic Animation (Runtime)\n\nTrigger animations programmatically via System Action:\n\n```typescript\nconst runAnimation: EventAction = {\n handler: 'system',\n action: {\n __actionName: 'DYNAMIC_ANIMATION',\n parent: 'System',\n params: [\n { input: 'brickId', value: () => targetBrick },\n { input: 'animationId', value: () => pulseAnimation },\n { input: 'runType', value: 'once' }, // 'once' | 'loop'\n { input: 'resetInitialValue', value: false },\n ],\n },\n}\n```\n\nRelated actions:\n- `DYNAMIC_ANIMATION_RESET` - Reset animation state\n- `DYNAMIC_ANIMATION_STOP` - Stop running animation\n\n## Best Practices\n\n1. **Performance**: Keep animations simple, prefer `opacity` and `transform` over layout changes\n2. **Timing**: Use `easeOut` for enter animations, `easeIn` for exit\n3. **Spring animations**: Good for natural, bouncy UI elements\n4. **Looping**: Use `runType: 'loop'` for attention-grabbing elements\n5. **Composition**: Use `sequence` for staged reveals, `parallel` for coordinated effects\n","bricks-ctor/references/architecture-patterns.md":'# Architecture Patterns\n\nHow to decompose complex flows into the right combination of BRICKS patterns.\n\n## Pattern Selection Priority\n\nPrefer higher-priority patterns; only fall to lower when they genuinely can\'t solve the sub-problem:\n\n| Priority | Pattern | Use For |\n|----------|---------|---------|\n| 1 | Generator + Events | I/O, AI inference, external data |\n| 2 | Event Action Chains | Orchestration, sequential steps |\n| 3 | System Actions | State changes, navigation, UI triggers |\n| 4 | Data Calculation | Pure data transformation ONLY |\n\n### Generators (Priority 1)\nFor all external I/O and AI inference. Each generator emits events that naturally chain into actions.\n- **GeneratorAssistant**: multi-turn LLM conversations, function calling, built-in message history\n- **GeneratorLLM**: single-shot local inference (GGML)\n- **GeneratorHttp**: REST API calls\n- **GeneratorMqtt / GeneratorWebSocket**: real-time messaging\n\n### Event Action Chains (Priority 2)\nThe primary way to orchestrate multi-step flows. A single event can contain an array of EventActions executed sequentially.\n- Use `waitAsync: true` to await async actions before the next step\n- Use `dataParams` + `mapping` to pass event data downstream\n- This is the "glue" that wires generators, state, and UI together\n- For Generator result UI: await Generator, write done/version Data; route/current Data stays identity.\n\nSequential `PROPERTY_BANK` / `PROPERTY_BANK_EXPRESSION` actions in one chain read the data values that existed when the chain started. If a later action needs to read what an earlier action wrote, set `waitAsync: true` on the earlier action.\n\n### System Actions (Priority 3)\nBuilt-in commands for direct state and UI changes.\n- **PROPERTY_BANK**: set data value\n- **PROPERTY_BANK_EXPRESSION**: inline JS expression for simple compute\n - The expression engine folds statements into a single expression: only expression\n statements, simple `const`/`let` declarations, and a final return/expression are\n supported — **no `if`/`for`/`while`/`switch`** (use ternaries). The same limit\n applies inside a zero-arg IIFE body. Unsupported statements fail at runtime with\n the error visible only in a DevTools session, so prefer ternary chains or move the\n logic to a DataCalculationScript.\n- **CHANGE_CANVAS**: navigate to another canvas\n- **DYNAMIC_ANIMATION**: trigger animation\n- **ALERT / MESSAGE**: system feedback\n\n### Data Calculation (Priority 4)\nONLY for deriving, formatting, or aggregating values from other data. Not for orchestration, side effects, or flow control.\n\n## Entity Aliases\n\nSet `alias` on entities to give them a stable, human-readable name:\n- Code generation uses alias as the variable name (e.g., `alias: \'submitBtn\'` → `export const submitBtn`)\n- At runtime, devtools MCP tools accept alias instead of short ID and selectors can match by alias. Note: bricks-ctor does not directly interact with devtools MCP — aliases here primarily affect code generation\n- Aliases must be unique across the application — duplicates are excluded from resolution\n\n## Flow Decomposition\n\nWhen the user describes a complex flow, decompose it BEFORE writing code:\n\n### Step 1: Extract I/O boundaries\nEvery external interaction maps to a Generator:\n- "call LLM" → GeneratorAssistant or GeneratorLLM\n- "fetch API" → GeneratorHttp\n- "speech to text" → GeneratorSpeechInference\n\n### Step 2: Extract state transitions\nEvery UI change maps to a System Action in an event chain:\n- "show loading" → PROPERTY_BANK on a boolean data\n- "go to result screen" → CHANGE_CANVAS\n- "animate in" → DYNAMIC_ANIMATION\n\n### Step 3: Extract pure transformations\nOnly actual data derivation maps to Data Calculation:\n- "format the response" → DataCalculationScript\n- "compute a score" → DataCalculationScript or DataCalculationMap\n\n### Step 4: Wire with Event Action Chains\nConnect the pieces through events on generators and bricks.\n\n## Recipe: user-driven state machine (calculator, form wizard, picker)\n\nA brief like "state vars X, Y, Z; button A updates X from X+Y; button B resets" is a state machine. The shape:\n\n- Each state variable is its own `Data` entity. Displays read it via `linkData(() => data.dFoo)`.\n- Each button\'s `onPress` is an Event Action Chain. For every state var that changes, append one `PROPERTY_BANK_EXPRESSION` whose `expression` reads the current state and returns the new value.\n- Use `Data Calculation` only for reusable pure derivations referenced as inputs to those expressions.\n\nA 10-button calculator with 4 state vars is ~10 small chains of 1–4 inline expressions. If you find yourself writing a single auto-mode `DataCalculationScript` that consumes all state vars and emits all-new state through mirror `dFooResult` data — or pinging a `dLastInput` field to force an auto calc to re-run — the chain shape was the right answer.\n',"bricks-ctor/references/automations.md":"# Automations\n\nE2E testing and scheduled execution for BRICKS applications. Simulates user behavior and validates application state.\n\n## Automation Types\n\n| Type | Description |\n| --------- | ---------------------------------------------------------- |\n| `launch` | Run on application launch (restarts app when run manually) |\n| `anytime` | Execute anytime via manual trigger |\n| `cron` | Scheduled execution using crontab expressions |\n\n## Simulation Actions\n\nAutomations can simulate:\n\n- **Brick Press**: Tap/click on bricks\n- **Key Events**: Key up/down for keyboard input\n- **HTTP Request**: API calls\n- **Execute Action**: Trigger system or generator actions\n\n## Assertions\n\nAutomations can validate:\n\n- **Brick Exists**: Check if brick is rendered\n- **Event Triggered**: Verify event from Brick/Generator/Canvas\n- **Canvas Changed**: Confirm canvas navigation\n- **Property Assert**: Check Data Bank values\n- **Property Updated**: Wait for property change\n- **Match Screenshot**: Visual regression testing\n\n## TypeScript Example\n\n```typescript\nconst testLoginFlow: AutomationTest = {\n __typename: 'AutomationTest',\n id: makeId('test'),\n title: 'Test Login Flow',\n timeout: 30000,\n trigger_type: 'launch',\n cases: [\n {\n __typename: 'TestCase',\n id: makeId('test_case'),\n name: 'Wait for login canvas',\n run: ['wait_until_canvas_change', () => mainSubspace, () => loginCanvas, 5000],\n exit_on_failed: true,\n commented: false,\n pre_delay: 0,\n post_delay: 0,\n jump_cond: [],\n },\n {\n __typename: 'TestCase',\n id: makeId('test_case'),\n name: 'Press username input',\n run: ['brick_press', () => mainSubspace, () => usernameInput],\n exit_on_failed: true,\n commented: false,\n pre_delay: 0,\n post_delay: 100,\n jump_cond: [],\n },\n {\n __typename: 'TestCase',\n id: makeId('test_case'),\n name: 'Assert username value',\n run: ['assert_property', () => mainSubspace, () => usernameData, 'testuser'],\n exit_on_failed: true,\n commented: false,\n pre_delay: 0,\n post_delay: 0,\n jump_cond: [],\n },\n {\n __typename: 'TestCase',\n id: makeId('test_case'),\n name: 'Press login button',\n run: ['brick_press', () => mainSubspace, () => loginButton],\n exit_on_failed: true,\n commented: false,\n pre_delay: 0,\n post_delay: 0,\n jump_cond: [],\n },\n {\n __typename: 'TestCase',\n id: makeId('test_case'),\n name: 'Wait for dashboard',\n run: ['wait_until_canvas_change', () => mainSubspace, () => dashboardCanvas, 10000],\n exit_on_failed: true,\n commented: false,\n pre_delay: 0,\n post_delay: 0,\n jump_cond: [],\n },\n ],\n variables: [],\n}\n```\n\n## Test Methods\n\n| Method | Signature | Description |\n| ---------------------------- | ------------------------------------------------ | -------------------- |\n| `brick_press` | `[subspace, brick, options?]` | Simulate brick press |\n| `brick_exists` | `[subspace, brick, frame?]` | Check brick exists |\n| `wait_until_brick_exists` | `[subspace, brick, timeout?, frame?]` | Wait for brick |\n| `wait_until_event_trigger` | `[subspace, sender, eventKey, timeout?]` | Wait for event |\n| `wait_until_canvas_change` | `[subspace, canvas, timeout?]` | Wait for canvas |\n| `keydown` | `[keyCode, pressedKey?, flags?]` | Key down event |\n| `keyup` | `[keyCode, pressedKey?, flags?]` | Key up event |\n| `http_request` | `[url, options?]` | HTTP request |\n| `assert_property` | `[subspace, property, value]` | Assert data value |\n| `wait_until_property_change` | `[subspace, property, value, timeout?]` | Wait for value |\n| `execute_action` | `[subspace, handler, action, params?, options?]` | Execute action |\n| `execute_items_action` | `[subspace, parent, itemsParams, action, params?, options?]` | Item brick action |\n| `match_screenshot` | `[name, threshold?, maxRetry?]` | Screenshot compare |\n| `delay` | `[subspace?, property?, defaultValue?]` | Delay execution |\n\nIn project TypeScript source, pass entity getters for BRICKS entities:\n\n```typescript\nrun: ['brick_press', () => mainSubspace, () => bricks.bSubmitButton]\nrun: ['wait_until_canvas_change', () => mainSubspace, () => canvases.cDone, 5000]\nrun: ['assert_property', () => mainSubspace, () => data.dStep, 'done']\n```\n\nThe compiler resolves these getters to the current generated IDs.\n\n### execute_action Params\n\nThe `params` object in `execute_action` uses **runtime event property keys** from `event-props.ts`, NOT the action config `input` names from type definitions.\n\n```typescript\n// CORRECT — use runtime event property key\nrun: ['execute_action', () => subspace0, bricks.bInput.id, 'BRICK_TEXT_INPUT_SET_TEXT',\n { BRICK_TEXT_INPUT_TEXT: 'hello' }]\n\n// WRONG — action config input name doesn't work in automation\nrun: ['execute_action', () => subspace0, bricks.bInput.id, 'BRICK_TEXT_INPUT_SET_TEXT',\n { text: 'hello' }]\n```\n\nReference `event-props.ts` for the correct runtime keys (e.g., `BRICK_TEXT_INPUT_TEXT`, `GENERATOR_MQTT_PAYLOAD`).\n\n### execute_items_action (bricks inside BRICK_ITEMS)\n\n`execute_action` cannot target a brick rendered inside a `BRICK_ITEMS` (item instances get dynamic per-item IDs). Use `execute_items_action`: `parent` is the `BRICK_ITEMS` brick, and `itemsParams` selects the item instance:\n\n- `itemsBrickId` (required) — the item brick's configured ID from the parent's `brickList`/`brickDetails` (a literal string, NOT a getter; it is not a `brick_map` entity)\n- `itemsDataId` or `itemsIndex` (one required) — which item instance to target\n- `itemsMode` (optional) — `list` (default) or `detail`\n\n```typescript\nrun: ['execute_items_action', () => sub, () => bricks.bTodoList,\n { itemsBrickId: 'DYNAMIC_BRICK_xxx', itemsIndex: 0 },\n 'BRICK_TEXT_INPUT_SET_TEXT', { BRICK_TEXT_INPUT_TEXT: 'hello' }]\n```\n\nThe `params` object follows the same runtime event property key rules as `execute_action`.\n\n### Prefer UI Interactions Over Direct Generator Calls\n\nFor realistic E2E testing, prefer simulating user actions (set text input + press button) over calling generator actions directly:\n\n```typescript\n// GOOD — simulates real user behavior\n{ run: ['execute_action', () => sub, bricks.bInput.id, 'BRICK_TEXT_INPUT_SET_TEXT',\n { BRICK_TEXT_INPUT_TEXT: 'hello' }] },\n{ run: ['brick_press', () => sub, () => bricks.bSendBtn] },\n{ run: ['wait_until_property_change', () => sub, () => data.dPayload, 'hello', 10000] },\n\n// AVOID — bypasses UI, doesn't test the full flow\n{ run: ['execute_action', () => sub, generators.gClient.id, 'GENERATOR_MQTT_PUBLISH',\n { topic: 'test', payload: 'hello', qos: '0' }] },\n```\n\n## Recording Automations\n\nIn BRICKS Editor Preview mode:\n\n1. Perform operations normally\n2. Open menu (right-bottom corner)\n3. Select \"Record Events as Automation\"\n4. Generated automation appears in Automations list\n\n## Running Automations\n\n### Manual Run\n\n`Menu` → `Automations` → Select automation → `Run`\n\n### On Launch\n\n`Bind Device` → `Select Automation` (only `launch` or `cron` types)\n\n### Scheduled (Cron)\n\n`Bind Device` → `Cron Automation` (allows multi-select)\n\nUse [crontab.guru](https://crontab.guru) to build cron expressions.\n\n## Screenshot Testing\n\nVisual regression testing with screenshot comparison:\n\n```typescript\n{\n __typename: 'TestCase',\n id: makeId('test_case'),\n name: 'Match dashboard screenshot',\n run: ['match_screenshot', 'dashboard-initial-state', 0.01, 3],\n exit_on_failed: true,\n commented: false,\n pre_delay: 500, // Wait for UI to settle\n post_delay: 0,\n jump_cond: [],\n}\n```\n\nScreenshots can be stored:\n\n- Local file system\n- Media Flow workspace\n\nFirst run captures baseline. Use \"Run with Update\" to update baseline.\n\n## Module Support\n\nAutomations work with Modules. Use Manual Run in Preview mode for module testing.\n\n## Important Notes\n\n- **Automation map key**: Always use `'AUTOMATION_MAP_DEFAULT'` as the automation map ID (not `makeId()`). The preview test runner reads from `automationMap['AUTOMATION_MAP_DEFAULT']?.map`.\n- **Valid makeId types**: Use `'test'` for AutomationTest, `'test_case'` for TestCase, `'test_var'` for TestVariable. Do NOT use `'automation_test'` or `'automation_test_map'`.\n- **Entity references in run arrays**: Use getter references (`() => subspace`, `() => bricks.bButton`, `() => data.dValue`) in TypeScript source so compile resolves fresh IDs.\n- **handler in execute_action**: Pass the entity's `.id` string (e.g., `bricks.bInput.id`), not a getter function.\n\n## Best Practices\n\n1. **Test culture**: Create automations for every significant flow\n2. **CI/CD integration**: Use `launch` automations for deployment validation\n3. **Incremental waits**: Use `wait_until_property_change` with appropriate timeouts\n4. **Visual testing**: Add screenshot comparisons for critical UI states\n5. **Cron monitoring**: Schedule health checks for production displays\n6. **Isolation**: Each automation should be independent and idempotent\n7. **UI-first testing**: Simulate real user interactions (text input, button press) rather than calling generators directly\n","bricks-ctor/references/buttress.md":"# Buttress (Remote Inference)\n\nBackend system for offloading compute-intensive AI generator tasks from BRICKS devices to more powerful machines.\n\n## Purpose\n\nWhen mobile devices or embedded systems lack hardware for local AI inference (LLM, speech-to-text), Buttress transparently delegates work to a server with appropriate resources (GPU).\n\n## How It Works\n\n1. **Capability Exchange**: Client and server share hardware capabilities\n2. **Strategy Selection**: System decides local vs. remote execution\n3. **Transparent Offloading**: Generator operates same way, execution happens remotely\n\n## Supported Generators\n\n- LLM (GGML) (LlmMlx.ts) - Local Large Language Model inference with GGML\n- LLM (MLX) (LlmGgml.ts) - Local Large Language Model inference with MLX\n- Speech-to-Text (GGML) (SpeechToTextGgml.ts) - Local Speech-to-Text inference with GGML\n\n## Client Configuration\n\nIn generator properties, configure `buttressConnectionSettings`:\n\n| Setting | Description |\n|---------|-------------|\n| `enabled` | Toggle Buttress offloading |\n| `autoDiscoverType` | `auto` (LAN auto-discovery, recommended) or `manual` (typed URL) |\n| `url` | Server URL (`manual` mode only — leave empty for `auto`) |\n| `fallbackType` | If Buttress is unreachable: `use-local` runs locally, `no-op` blocks the load |\n| `strategy` | Execution preference (see below) |\n\nThe launcher provides the access token automatically — there is **no user-facing access-token setting**. In `auto` mode the launcher discovers servers bound to the device's workspace and uses its workspace-scoped JWT; in `manual` mode it sends the same JWT only when the typed URL belongs to a server bound to the same workspace (verified against the server's `/buttress/info`).\n\n### `autoDiscoverType` options\n\n| Mode | When to use | What the device does |\n|------|-------------|----------------------|\n| `auto` | LAN deployment with a workspace-bound buttress-server | Listens for UDP announcements and picks the strongest server bound to its workspace; reconnects automatically when the workspace flips |\n| `manual` | Internet-reachable server, mixed networks, or a public/unbound server | Connects to the typed `url` directly; sends a token only when the server is bound to the same workspace |\n\n### Strategy options\n\n| Strategy | Description |\n|----------|-------------|\n| `prefer-local` | Use local if capable, fallback to Buttress |\n| `prefer-buttress` | Use Buttress if available, fallback to local |\n| `prefer-best` | Auto-select based on capability comparison |\n\n## Generator Configuration Examples\n\n### Auto-discovery (recommended)\n\nWorkspace-bound launcher + workspace-bound buttress-server on the same LAN. No URL needed — discovery picks the highest-scoring server that runs the requested backend.\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst llmGenerator: GeneratorLLM = {\n __typename: 'Generator',\n templateKey: 'GENERATOR_LLM',\n id: makeId('generator'),\n title: 'Chat LLM',\n description: '',\n property: {\n modelUrl: 'https://huggingface.co/ggml-org/gemma-3-12b-it-qat-GGUF/resolve/main/gemma-3-12b-it-qat-q4_0.gguf',\n contextSize: 8192,\n buttressConnectionSettings: {\n enabled: true,\n autoDiscoverType: 'auto',\n fallbackType: 'use-local',\n strategy: 'prefer-best',\n },\n },\n events: {},\n switches: [],\n}\n```\n\n### Manual URL\n\nUse when the server isn't on the launcher's broadcast domain (cross-subnet, internet, behind a reverse proxy) or you want to point at a specific public/unbound server.\n\n```typescript\nbuttressConnectionSettings: {\n enabled: true,\n autoDiscoverType: 'manual',\n url: 'http://192.168.1.100:2080',\n fallbackType: 'use-local',\n strategy: 'prefer-best',\n}\n```\n\n> ⚠️ With `fallbackType: 'no-op'` the generator refuses to load locally if Buttress is unreachable. Use `'use-local'` whenever the device can also run the model standalone.\n\n## Integrating a discovered buttress-server\n\nThe ctor-desktop \"Local Devices\" panel (and the `bricks buttress scan` CLI) can hand you a server's identity, workspace, and announced generator caps. When the user asks to integrate one:\n\n1. **Confirm workspace match.** The discovery message says whether the server's workspace matches this project's. If it doesn't, do NOT add the integration — instruct the user to run `bricks buttress unbind && bricks buttress bind` from this workspace's owner CLI on the server host. The launcher won't trust a cross-workspace server.\n\n2. **Map announced types to generator templates.** For each `generators[].type` in the announce, target the matching templateKey (create the generator if absent):\n\n | Announced type | templateKey | Default model |\n |----------------|------------------------------|---------------|\n | `ggml-llm` | `GENERATOR_LLM` | `ggml-org/gemma-3-12b-it-qat-GGUF` (≥20 GB usable) or `ggml-org/gpt-oss-20b-GGUF` (~12 GB usable) |\n | `mlx-llm` | `GENERATOR_MLX_LLM` | `mlx-community/Qwen3-4B-4bit` (or a larger 4-bit quant if `usableBytes` allows) |\n | `ggml-stt` | `GENERATOR_SPEECH_INFERENCE` | `BricksDisplay/whisper-ggml` (filename `ggml-small-q8_0.bin`) |\n\n Pick a model that fits the announced `usableBytes`. Set `contextSize` to match.\n\n3. **Use the canonical auto-discovery config** from \"Auto-discovery (recommended)\" above. Don't switch to manual mode just because the server is on the LAN — auto mode picks the workspace-bound server automatically and rebinds when the device's workspace flips.\n\n### Real-device caveat\n\nButtress LAN auto-discovery uses native UDP via `react-native-jsi-udp`. The iOS Simulator silently fails to bind UDP, so auto mode is a no-op there. With `fallbackType: 'use-local'` the generator falls back to local inference in the simulator — dev/test stays functional. **Validate the buttress path itself only when deploying to a real Foundation device; don't gate the build on simulator validation.**\n\n## Server Setup\n\n### Requirements\n- [Bun](https://bun.sh) v1.3+\n- GPU recommended for LLM/STT\n\n### Installation\n\n```bash\nbun add -g @fugood/buttress-server\n```\n\n### Start Server\n\n```bash\nbricks-buttress\n# or with config\nbricks-buttress --config ./config.toml\n```\n\n### CLI Options\n\n| Option | Description |\n|--------|-------------|\n| `-p, --port` | Port (default: 2080) |\n| `-c, --config` | TOML config file path |\n| `-v, --version` | Show version |\n| `-h, --help` | Show help |\n\n### Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `HF_TOKEN` | Hugging Face token for model downloads |\n| `ENABLE_OPENAI_COMPAT_ENDPOINT` | Set to `1` for OpenAI-compatible API |\n| `BRICKS_BUTTRESS_STATE_DIR` | Override the workspace state directory (default `~/.bricks-cli/buttress`) |\n\n## Bind the Server to a Workspace\n\nTo use `autoDiscoverType: 'auto'` — and to require workspace-scoped JWT auth — pair the buttress-server with a BRICKS workspace using the `bricks buttress` CLI commands. An unbound server stays in legacy public mode and accepts any LAN client.\n\n### One-time bind\n\n```bash\n# Log into the cloud bricks-server with the workspace owner's account\nbricks auth login\n\n# Pair the buttress-server running on this machine with the active workspace\nbricks buttress bind\n\n# Restart bricks-buttress so it picks up the new state.json\n```\n\n`bricks buttress bind` writes `~/.bricks-cli/buttress/state.json` containing the workspace id, the issuer's Ed25519 public key, and a stable `serverId` (defaults to `buttress-<machineId>`). Override location with `--state-dir` or `$BRICKS_BUTTRESS_STATE_DIR`. For headless setups, use `bricks buttress bind --print` to emit state.json to stdout.\n\n### Verify and manage\n\n```bash\n# Show local binding + workspace-side bound list\nbricks buttress status\n\n# Discover buttress-servers on the LAN (with version, auth state, generator caps)\nbricks buttress scan\n\n# Issue a long-lived workspace access token (CI / ctor agents that already hold a workspace token)\nbricks buttress issue-token --ttl 86400\n\n# Detach this server from the workspace\nbricks buttress unbind\n```\n\nAfter binding, launchers in the same workspace will auto-discover this server; manual-mode generators will only send their access token if the server's reported workspace matches their own.\n\n## Server Configuration (TOML)\n\n```toml\n[server]\nport = 2080\n\n[runtime]\ncache_dir = \"./.buttress-cache\"\nn_threads = 6\nflash_attn_type = \"on\"\ncache_type_k = \"q8_0\"\ncache_type_v = \"q8_0\"\n\n# LLM Generator\n[[generators]]\ntype = \"ggml-llm\"\n[generators.backend]\nvariant_preference = [\"cuda\", \"vulkan\", \"default\"]\ngpu_memory_fraction = 0.95\n[generators.model]\nrepo_id = \"ggml-org/gemma-3-12b-it-qat-GGUF\"\ndownload = true\nn_ctx = 8192\n\n# STT Generator\n[[generators]]\ntype = \"ggml-stt\"\n[generators.backend]\nvariant_preference = [\"cuda\", \"vulkan\", \"default\"]\n[generators.model]\nrepo_id = \"BricksDisplay/whisper-ggml\"\nfilename = \"ggml-small-q8_0.bin\"\ndownload = true\nuse_gpu = true\n```\n\n## Use Cases\n\n### Resource-Constrained Devices\nDigital signage with basic hardware offloads LLM to powerful server.\n\n### Shared GPU Resources\nMultiple devices share single GPU server for inference.\n\n### Development Testing\nTest AI features on lightweight dev machines by connecting to beefy server.\n\n## Best Practices\n\n1. **Network reliability**: Ensure stable LAN connection to Buttress server\n2. **Fallback strategy**: Configure appropriate fallback for critical features\n3. **Server monitoring**: Monitor Buttress server resource usage\n4. **Model consistency**: Ensure client and server use compatible models\n5. **Security**: Run Buttress on private network, not public internet\n6. **Latency awareness**: Account for network latency in UX design\n","bricks-ctor/references/data-calculation.md":"# Data Calculation (JS Sandbox)\n\nTransform and compute Data Bank values using JavaScript scripts. Calcs are for **pure data transformation only** — see [Architecture Patterns](architecture-patterns.md) for the pattern selection guide.\n\n| If you need to... | Use instead |\n|---|---|\n| Call an LLM / AI model | Generator (Assistant, LLM, HTTP) |\n| Sequence multiple actions | Event Action Chain |\n| Set a data value directly | PROPERTY_BANK system action |\n| Compute a simple expression | PROPERTY_BANK_EXPRESSION |\n| Transform/format/parse data | Data Calculation (correct use) |\n\n## Authoring Contract\n\n```typescript\nimport { makeId } from 'bricks-ctor'\nimport { readFile } from 'node:fs/promises'\n\nconst calculation: DataCalculationScript = {\n __typename: 'DataCalculationScript',\n id: makeId('property_bank_calc'),\n title: 'Format Price',\n description: 'Formats price with currency symbol',\n note: '',\n triggerMode: 'auto', // 'auto' (default) | 'manual'\n enableAsync: false,\n // Inline code for short scripts...\n code: `\n const price = inputs.price || 0\n const currency = inputs.currency || 'USD'\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n }).format(price)\n `,\n // ...or load from a file (preferred for longer scripts):\n // code: await readFile(new URL('./format-price.sandbox.js', import.meta.url), 'utf8'),\n inputs: [\n { key: 'price', data: () => priceData, trigger: true },\n { key: 'currency', data: () => currencyData, trigger: false },\n ],\n output: () => formattedPriceData,\n outputs: [], // Additional named outputs (see Multiple Outputs)\n error: null, // or () => errorData for error handling\n}\n```\n\n### Field Rules (defaults and constraints)\n\n- `trigger` **defaults to `false` when omitted** — always set it explicitly. A calc whose inputs are all non-trigger never auto-runs.\n- `triggerMode` defaults to `'auto'` when omitted.\n- `output` receives the **whole return value**. `outputs` entries extract fields by key from a returned object — `key` is a lodash-get path, so deep paths like `'user.name'` work. `output`, `outputs`, and `error` can be combined.\n- `error` receives the error **message string** when the script throws. Both extraction steps run on every execution: a success overwrites the error Data, a failure overwrites the output Data(s) — don't expect stale values to persist.\n- **Auto mode rejects the same Data in both `inputs` and `output`/`outputs`/`error`** — compile fails with `Not allow duplicate set property id between inputs / outputs / output / error`. Manual mode allows the overlap (self-referential updates, see Recipes).\n- `.sandbox.js` files use an `export function main() { ... }` wrapper — compile unwraps it. Raw statements also work, but the wrapper keeps linters happy since script bodies use top-level `return`.\n\n## Trigger Modes\n\n| Mode | Description |\n|------|-------------|\n| `auto` | Run on every write to a `trigger: true` input (even if the value is unchanged) |\n| `manual` | Never auto-runs; only via `PROPERTY_BANK_COMMAND` action. Allows the same Data as both input and output |\n\nUse `manual` to prevent circular dependencies, for explicit control, or when an output must feed back into an input.\n\n## Triggering via PROPERTY_BANK_COMMAND\n\n`input` references a Data that is an input of the target calc — the system runs the calc(s) that data feeds into. It does NOT reference the DataCalculation itself.\n\n- **Manual calc**: ANY input works — `trigger` flags are ignored for manual-mode calcs.\n- **Auto calc**: only `trigger: true` inputs work; commanding a `trigger: false` input is a silent no-op.\n\n```typescript\nconst triggerCalc: EventAction = {\n handler: 'system',\n action: {\n __actionName: 'PROPERTY_BANK_COMMAND',\n parent: 'System',\n dataParams: [\n { input: () => priceData }, // Reference to an input Data of the calc\n ],\n },\n}\n```\n\n- When the same chain **writes a calc input first** (e.g. `PROPERTY_BANK` setting `dLastButton`) then issues `PROPERTY_BANK_COMMAND`, set `waitAsync: true` on the write so the calc reads the new value rather than the pre-chain snapshot. See [Event Action Chains](architecture-patterns.md#event-action-chains-priority-2).\n- When a **later action reads the calc's outputs**, set `waitAsync: true` on the `PROPERTY_BANK_COMMAND` action itself — it awaits the full calc chain including output writes.\n- A dataParam's `value` acts as an execution gate: `{ input: () => d, value: false }` skips that trigger (combine with `mapping` for conditional runs).\n\n## One trigger source per result panel\n\nA panel that shows the result of an async action (Generator HTTP/LLM response, request telemetry) reads from a calc whose **trigger should come from a single source**: either the live async outlet, or a completion marker the action chain writes — not both.\n\n- **Outlet-triggered** (`{ data: () => dResponse, trigger: true }`): the calc reruns as outlets land. Use when each outlet is only written once its value is final.\n- **Marker-triggered**: run the generator with `waitAsync: true`, then write a `done` Data the calc triggers on. Use when several outlets settle separately and the panel must wait for all of them.\n\nWiring both at once — triggering on the live outlet _and_ gating on a separately-written marker — lets the calc run before the outlets have settled (it renders `undefined`/stale) while the marker path masks it intermittently. A panel that updates \"sometimes\" usually has two competing triggers: pick one, and order it with `waitAsync` so the trigger fires after the values it reads are written.\n\nScope the panel's calc to the **single value it derives** (the formatted display string), and write sibling status labels — running/done, progress, selected route — imperatively in the event chain with `PROPERTY_BANK`. A calc rewrites _every_ one of its outputs on each run, so a return that omits a key writes `undefined` to that output Data (see [Field Rules](#field-rules-defaults-and-constraints)): folding status labels into a multi-output result calc resets them to `undefined` on any run that returns only the derived value. If a calc genuinely must drive several outputs, return all of their keys every run.\n\n## Script Sandbox\n\nScripts run in `use strict` mode as a function body — top-level `return` returns the calc result. No `fetch`, `XMLHttpRequest`, or `require` in any mode: I/O belongs to Generators.\n\n### Built-in Globals\n\n| Global | Description |\n|--------|-------------|\n| `inputs` | Object with input values (keyed by input `key`) |\n| `console` | `{ log, error, warn, info }` — output is only visible in DevTools debug sessions; production is a no-op |\n| `Platform` | `{ OS, isTV, isPad, isVision, isElectron }` |\n| `TextEncoder`, `TextDecoder` | Text encoding/decoding |\n| `Buffer` | Node.js Buffer (without `allocUnsafe`/`allocUnsafeSlow`) |\n| `btoa`, `atob` | Base64 encoding/decoding |\n\n### Async Mode\n\nSync mode (default) has **no `Promise`, timers, or `await`**. Enable `enableAsync: true` to unlock:\n\n- `Promise`, `setTimeout`, `setInterval`, `setImmediate`, `clearTimeout`, `clearInterval`, `clearImmediate`, `requestAnimationFrame`\n- Full lodash (sync mode omits `debounce`, `delay`, `defer`)\n- `await` at the top level of the script\n\n```typescript\ncode: `\n const result = await new Promise((resolve) => {\n setTimeout(() => resolve(inputs.value * 2), 100)\n })\n return result\n`,\nenableAsync: true,\n```\n\n### Runtime Environment\n\n| Platform | Engine |\n|----------|--------|\n| Android | Hermes engine sandbox |\n| iOS | JavaScriptCore sandbox |\n| Electron desktop | Web Worker (V8) |\n| Web preview / Simulator | Web Worker (V8) |\n\nSimulator (Path 1) runs scripts on V8 while devices run Hermes/JSC — engine-sensitive code (date parsing, Intl, regex features) can pass in the Simulator and fail on device.\n\n### Available Libraries\n\nAll exposed as globals. No network/file-download capability in any of them.\n\n| Global | Library | Notes |\n|--------|---------|-------|\n| `_`, `lodash` | lodash | Sync mode omits `debounce`/`delay`/`defer` |\n| `voca` | voca | String manipulation |\n| `invariant` | invariant | Assertions |\n| `json5` | json5 | JSON5 parsing |\n| `qs` | qs | Query string parsing |\n| `url` | node-url | URL parsing |\n| `bytes` | bytes | Byte parsing/formatting |\n| `ms` | ms | Millisecond conversion |\n| `base45` | base45 | Base45 encoding |\n| `iconv` | iconv-lite | Character encoding |\n| `math`, `mathjs` | mathjs | Math library |\n| `chroma` | chroma-js | Color manipulation |\n| `moment` | moment | Date/time; auto parseFormat for string args |\n| `nanoid` | nanoid | Unique ID generation |\n| `md5` | md5 | MD5 hashing |\n| `crypto` | crypto-browserify | Crypto functions |\n| `kjurJWS` | jsrsasign | JWT/JWS signing (`KJUR.jws.JWS`) |\n| `coseVerify` | cose-js | COSE verification (sync) |\n| `fflate` | fflate | `{ zlibSync, unzlibSync, gzipSync, gunzipSync, compressSync, decompressSync, strFromU8 }` |\n| `cbor` | cbor | `{ encode, decode, decodeFirstSync, decodeAllSync, addSemanticType }` |\n| `fs` | (in-repo fs-compat) | File system; no download/upload methods |\n| `parseDocument` | officeparser (in-repo fork) | Office document parsing (async) |\n| `TurndownService` | turndown | HTML to Markdown |\n| `OpenCC` | opencc-js | Chinese conversion `{ Converter, ConverterFactory, CustomConverter, Locale }` |\n| `TOON` | @toon-format/toon | TOON format parsing |\n\n## Recipes\n\n### Multiple Outputs\n\nReturn an object; each `outputs` entry extracts its `key`:\n\n```typescript\noutputs: [\n { key: 'total', data: () => totalData },\n { key: 'tax', data: () => taxData },\n { key: 'subtotal', data: () => subtotalData },\n],\noutput: null,\nerror: null,\ncode: `\n const subtotal = inputs.price * inputs.quantity\n const tax = subtotal * 0.1\n const total = subtotal + tax\n return { total, tax, subtotal }\n`,\n```\n\n### Manual Self-Referential Update\n\nWhen an update is too complex for `PROPERTY_BANK_EXPRESSION` and must read its own previous value — manual mode allows the same Data as input and output:\n\n```typescript\nconst appendHistory: DataCalculationScript = {\n __typename: 'DataCalculationScript',\n id: makeId('property_bank_calc'),\n title: 'Append History Entry',\n triggerMode: 'manual',\n enableAsync: false,\n code: `\n const history = Array.isArray(inputs.history) ? inputs.history : []\n return [...history, { entry: inputs.entry, at: moment().toISOString() }].slice(-50)\n `,\n inputs: [\n { key: 'history', data: () => historyData, trigger: true },\n { key: 'entry', data: () => entryData, trigger: true },\n ],\n output: () => historyData, // same Data as input — manual mode only\n outputs: [],\n error: null,\n}\n// Run it from an event chain: PROPERTY_BANK writes entryData (waitAsync: true),\n// then PROPERTY_BANK_COMMAND with input: () => entryData.\n```\n\n## Failure Modes\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Calc never auto-runs | `trigger` omitted on inputs (defaults to `false`) | Set `trigger: true` explicitly |\n| `PROPERTY_BANK_COMMAND` does nothing | Auto calc + `trigger: false` input, or `input` doesn't reference an input Data of the calc | Command a `trigger: true` input (auto) or any input (manual) |\n| Compile error `Not allow duplicate set property id...` | Auto mode with same Data as input and output | Use `triggerMode: 'manual'`, or split into separate Data |\n| Calc reads stale value written earlier in the same chain | Missing `waitAsync: true` on the preceding write | Set `waitAsync: true` on the write action |\n| Result/telemetry panel shows `undefined` or stale data intermittently | Calc triggered by two sources at once (live outlet + a separately-written marker) | Trigger from one source — see [One trigger source per result panel](#one-trigger-source-per-result-panel) |\n| Sibling status Data (selected/progress) resets to `undefined` after a calc runs | Multi-output result calc whose return omitted those keys on that run | Scope the calc to one output and write status labels imperatively, or return every output key each run — see [One trigger source per result panel](#one-trigger-source-per-result-panel) |\n| Works in Simulator, fails on device | V8 vs Hermes/JSC engine difference | Verify on device (Path 2); avoid engine-sensitive parsing |\n| `console.log` shows nothing | Console only emits during DevTools debug sessions | Attach DevTools, or write debug values to an output Data |\n| `Promise`/`setTimeout` undefined, or `Async mode is required` error | `enableAsync: false` | Set `enableAsync: true` |\n\n## Best Practices\n\n1. **Avoid circular deps**: Set non-triggering inputs (`trigger: false`) or use `manual` mode\n2. **Error handling**: Always set `error` output for scripts that might fail\n3. **Keep scripts pure**: Avoid side effects, return computed values\n4. **Debounce rapid updates**: Use `manual` mode + timer for high-frequency inputs (auto calcs re-run on every write, even unchanged)\n\n## Anti-Patterns (AVOID)\n\nSee [Architecture Patterns](architecture-patterns.md) for the full pattern selection guide.\n\n### Using Data Calc as an orchestrator\nScripts that manage state machines, control UI flow, or coordinate multi-step processes belong in Event Action Chains. Symptoms: if/else on \"what happens next\", mirror `dFooResult` outputs that copy back to `dFoo` via `valueChange`, or a `dLastInput` field set-then-cleared to force an auto calc. See the \"user-driven state machine\" recipe in [Architecture Patterns](architecture-patterns.md).\n","bricks-ctor/references/local-sync.md":"# Local Sync\n\nSynchronize data between devices on a Local Area Network (LAN) without remote server storage. High synchronization rate for real-time multi-device experiences.\n\n## Features\n\n- **Update Data**: Sync Data Bank values across local devices\n- **Execute Data Calculation**: Trigger calculations on other devices\n- **No Remote Storage**: Direct device-to-device communication\n\n## Main / Minor Device Model\n\n| Role | Description |\n|------|-------------|\n| Main | Manages Data Bank if enabled, first device to start |\n| Minor | Follows main device, subsequent devices |\n\n### Role Determination\n\n1. First device to start becomes Main\n2. If simultaneous start: `Priority as Main Device` (0-9, set in Device Page) + random number determines Main\n\n## Configuration\n\n### Run Mode Options\n\n| Mode | Description |\n|------|-------------|\n| `all` | Run on all devices |\n| `main-only` | Only run on Main device |\n| `minor-only` | Only run on Minor devices |\n\nApply run mode to:\n- Data properties\n- Generators\n- Data Calculations\n\n### Subspace Local Sync Settings\n\n```typescript\nconst subspace: Subspace = {\n __typename: 'Subspace',\n id: 'main',\n localSyncChangeCanvas: 'all', // 'all' | 'main-only' | 'minor-only' | 'none'\n // ...\n}\n```\n\n### Data Local Sync\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst data: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Shared Counter',\n type: 'number',\n value: 0,\n localSyncUpdateMode: 'main-only', // 'main-only' | 'minor-only' | undefined (all)\n events: {},\n}\n```\n\n### Generator Local Sync\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst generator: GeneratorTimer = {\n __typename: 'Generator',\n templateKey: 'Timer',\n id: makeId('generator'),\n title: 'Sync Timer',\n description: '',\n localSyncRunMode: 'main-only', // Timer only runs on main device\n property: {},\n events: {},\n switches: [],\n}\n```\n\n## Use Cases\n\n### Synchronized Displays\nMultiple screens showing coordinated content:\n- Main device controls timing/state\n- Minor devices follow state changes\n\n### Interactive Kiosks\nTouch on one device, update all:\n- User interacts with input device (Minor)\n- Main device processes and broadcasts result\n- All devices update simultaneously\n\n### Video Walls\nCoordinated multi-screen layouts:\n- Main device manages playback state\n- Minor devices sync position/frame\n\n## System Data\n\nAccess local sync status via System Data:\n\n```typescript\n// Is current device the main device?\nsystemData.isLocalSyncMainDevice // boolean\n```\n\n## Important Notes\n\n1. **Version Matching**: All devices must use same BRICKS Foundation minor version\n - ✅ v2.11.0 matches v2.11.1\n - ❌ v2.11.0 does NOT match v2.10.8\n\n2. **Network Requirements**:\n - All devices on same LAN\n - mDNS/Bonjour enabled\n - Firewall allows local discovery\n\n3. **Startup Order**: Consider device startup sequence when Main role matters\n\n## Best Practices\n\n1. **Designate Main explicitly**: Set high `Priority as Main Device` on intended main\n2. **Idempotent logic**: Design for eventual consistency, not strict ordering\n3. **Minimal sync scope**: Only enable local sync for data that truly needs it\n4. **Test multi-device**: Validate behavior with actual device count\n5. **Handle disconnection**: Design for graceful degradation if devices disconnect\n","bricks-ctor/references/media-flow.md":"# Media Flow\n\nCentralized media asset management for BRICKS applications. Store, organize, and reference images, videos, and audio files.\n\n## Enable Media Workspace\n\n1. Visit `Media` tab in workspace page\n2. Enable media workspace for your workspace\n\n## Media Box\n\nOrganize assets into boxes (folders). Each box can contain files of various types.\n\n### Generator Media Flow\n\nUse `Generator Media Flow` to:\n- Get file list from a box\n- Download files\n- Subscribe to box changes\n\nQuick setup: Create new Property with `As Media Resource file list?` option.\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst mediaListGenerator: GeneratorMediaFlow = {\n __typename: 'Generator',\n templateKey: 'MediaFlow',\n id: makeId('generator'),\n title: 'Promo Images',\n description: '',\n property: {\n boxId: 'promo-box-id',\n passcode: 'box-read-only-passcode',\n },\n outlets: {\n files: () => promoFilesData, // Array of file objects\n },\n events: {},\n switches: [],\n}\n```\n\nWhen hand-writing `GENERATOR_MEDIA_FLOW`, do not use a bare `boxId`. The editor\nflow creates the required authorization, but manual config must include either\n`property.passcode` from a Media Box passcode or `property.accessToken`.\nWithout one, devices cannot read the box and the generator will report an\nauthorization error.\n\n## Property Kinds for Media\n\nLink Data properties to Media Flow for asset selection:\n\n| Kind | Description |\n|------|-------------|\n| `media-resource-image` | Image asset selector |\n| `media-resource-video` | Video asset selector |\n| `media-resource-audio` | Audio asset selector |\n| `lottie-file-uri` | Lottie animation selector |\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst backgroundImage: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Background Image',\n type: 'string',\n kind: { type: 'media-resource-image' },\n value: '',\n events: {},\n}\n```\n\nAssets with these kinds are **preloaded** during application launch.\n\n## Compatible Bricks & Generators\n\n### Bricks\n- **Brick Image**: Display images from Media Flow\n- **Brick Video**: Play videos from Media Flow\n- **Brick Lottie**: Render Lottie animations\n- **Brick Slideshow**: Cycle through Media Flow file list\n\n### Generators\n- **Generator Sound Player**: Play audio files\n- **Generator File Reader**: Read file contents\n\n## Slideshow with Media Flow\n\nConnect Generator Media Flow output to Brick Slideshow:\n\n```typescript\nimport { makeId, linkData } from 'bricks-ctor'\n\nconst slideshow: BrickSlideshow = {\n __typename: 'Brick',\n templateKey: 'Slideshow',\n id: makeId('brick'),\n title: 'Promo Slideshow',\n description: '',\n property: {\n images: linkData(() => promoFilesData),\n interval: 5000, // ms between slides\n transition: 'fade',\n },\n events: {},\n switches: [],\n}\n```\n\n## File Object Structure\n\nFiles from Media Flow include:\n\n```typescript\ninterface MediaFile {\n id: string\n name: string\n url: string\n thumbnailUrl?: string\n mimeType: string\n size: number\n width?: number // For images/videos\n height?: number\n duration?: number // For videos/audio\n createdAt: string\n updatedAt: string\n}\n```\n\n## Upload & Management\n\n### Via Editor\n1. Open Media tab in BRICKS Editor\n2. Select or create a box\n3. Drag & drop files or use upload button\n\n### Via CLI\n```bash\nbricks media boxes # List media boxes\nbricks media box <box-id> # Box details\nbricks media files <box-id> # List files in box\nbricks media file <file-id> # File details\n```\n\n> Note: CLI currently supports read-only operations. Upload is not yet supported.\n\n### Via API\nUse BRICKS API for programmatic upload and management.\n\n## Screenshot Storage\n\nAutomation `Match Screenshot` can save screenshots to Media Flow workspace:\n- Baseline images stored in specified box\n- Easy visual comparison and management\n\n## Best Practices\n\n1. **Organize by purpose**: Create boxes for different content types (backgrounds, icons, videos)\n2. **Optimize assets**: Compress images/videos before upload\n3. **Preload critical assets**: Use `media-resource-*` kinds for important visuals\n4. **Slideshow performance**: Limit file count and resolution for smooth playback\n5. **Version control**: Use box naming conventions for content versions\n6. **CDN benefit**: Media Flow URLs are CDN-backed for fast delivery\n","bricks-ctor/references/remote-data-bank.md":"# Remote Data Bank\n\nCloud-synchronized Data Bank for real-time data sharing across devices and external API access.\n\n## Remote Update Types\n\nThe `remoteUpdate` field configures cloud synchronization:\n\n```typescript\nremoteUpdate?:\n | { type: 'auto' } // Sync across all devices\n | { type: 'device-specific' } // Isolated per device\n | { type: 'global-data', id: string } // Cross-application global data\n```\n\n### Auto Sync\n\nSync across all devices using the same application.\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst data: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Announcement',\n type: 'string',\n value: '',\n remoteUpdate: { type: 'auto' },\n events: {},\n}\n```\n\n### Global Data\n\nShare data across different applications. Must create Global Data first on BANK page.\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst data: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Global Config',\n type: 'object',\n value: {},\n remoteUpdate: { type: 'global-data', id: 'workspace-global-config-id' },\n events: {},\n}\n```\n\n### Device Specific\n\nIsolate data per device while still allowing web page control.\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst data: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Device Message',\n type: 'string',\n value: '',\n remoteUpdate: { type: 'device-specific' },\n events: {},\n}\n```\n\nUse case: Control individual displays from a shared web interface without affecting other devices.\n\n## External Access\n\n### Web Update Page\n\nGenerate a web page for non-technical users to update data:\n\n1. Visit BANK page\n2. Click `Manage Keys`\n3. Select `Generate Key used by Update Page`\n4. Share the generated link\n\nThe page has independent permissions and can be shared with content managers.\n\n### API Access\n\nProgrammatic data updates via REST API.\n\n**Setup:**\n1. Visit BANK page → Manage Keys\n2. Create API key with appropriate permissions\n3. Use key in API requests\n\n**Example API Usage:**\n\n```bash\n# Update a property\ncurl -X POST https://api.bricks.tools/v1/bank/update \\\n -H \"Authorization: Bearer YOUR_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"applicationId\": \"app-id\",\n \"propertyId\": \"announcement\",\n \"value\": \"New announcement text\"\n }'\n\n# Get property value\ncurl https://api.bricks.tools/v1/bank/get \\\n -H \"Authorization: Bearer YOUR_API_KEY\" \\\n -G \\\n -d \"applicationId=app-id\" \\\n -d \"propertyId=announcement\"\n```\n\n## Data Routing\n\nCross-subspace data sharing with access control.\n\n```typescript\nconst routedData: Data = {\n __typename: 'Data',\n id: 'shared-state',\n type: 'object',\n routing: 'read-only', // 'read-only' | default (read-write)\n // When read-only: only accepts changes from same subspace\n // Default: accepts changes from any subspace\n}\n```\n\n## Use Cases\n\n### Digital Signage Content Management\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\n// Remote-updated announcement\nconst announcement: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Announcement',\n type: 'object',\n value: { title: '', body: '', enabled: false },\n remoteUpdate: { type: 'auto' },\n events: {},\n}\n```\n\nOperator updates content via web page → All displays update in real-time.\n\n### Multi-Location Coordination\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\n// Global data shared across locations\nconst globalConfig: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Brand Config',\n type: 'object',\n value: {},\n remoteUpdate: { type: 'global-data', id: 'brand-config-global' },\n events: {},\n}\n```\n\nUpdate once → All locations receive update.\n\n### Per-Device Customization\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\n// Device-specific greeting\nconst deviceGreeting: Data = {\n __typename: 'Data',\n id: makeId('data'),\n title: 'Greeting',\n type: 'string',\n value: '',\n remoteUpdate: { type: 'device-specific' },\n events: {},\n}\n```\n\nEach display shows different greeting, controlled from single dashboard.\n\n## Best Practices\n\n1. **Minimize remote data**: Only enable for data that truly needs cloud sync\n2. **Use device-specific wisely**: Good for personalization, not for shared state\n3. **API key security**: Use scoped keys with minimal permissions\n4. **Offline resilience**: Design for temporary disconnection\n5. **Batch updates**: Group related changes to reduce API calls\n6. **Global data governance**: Establish clear ownership for global data keys\n","bricks-ctor/references/simulator.md":'# Simulator\n\nWhat the Simulator can and can\'t faithfully reproduce — so a passing Simulator run means what you think it means. This is the fidelity companion to Path 1 in [Verification Toolchain](verification-toolchain.md); read that for how to *drive* the Simulator (compile, screenshot, Automations).\n\n## What it is\n\n- The default Path 1 target: it renders your compiled project on your computer, with no device required.\n- It runs in Chromium/Electron — a browser-class runtime, not the device runtime. Two consequences to design verification around: it has a browser\'s capabilities and limits (below), and its JavaScript engine differs from the device\'s (iOS runs JSC, Android runs Hermes), so engine-specific behavior won\'t surface here.\n\nA Simulator screenshot proves **layout, navigation, Standby Transitions, Data wiring, and generator/Automation wiring**. It does *not* prove anything that depends on real hardware, real models, or capabilities the preview runtime lacks.\n\n## Automation screenshots\n\n`match_screenshot` stores Simulator automation artifacts at the project level:\n\n```text\n.bricks/automation_screenshots/\n last/\n failed/\n diff/\n```\n\nThere is no application-id subdirectory; in CTOR the project is the application. Generated project `.gitignore` files exclude this directory.\n\nWhen a `match_screenshot` baseline is missing or updated, the baseline goes under `last/`. When a screenshot mismatch occurs, the current capture goes under `failed/` and the pixel diff goes under `diff/`. File names follow `<screenshotName>+local+<timestamp>.png`.\n\nIn CTOR Desktop, `simulator_invoke` reports any automation screenshot files created or changed by the invocation in an `Automation screenshots:` section. It still separately reports the ordinary preview capture at `.bricks/simulator-screenshot.jpg`.\n\n## What the Simulator can\'t reproduce\n\nBecause it runs in a browser-class preview rather than on device hardware, the Simulator cannot exercise these — a green run says nothing about them. Verify on a real device (Path 2):\n\n| Area | In the Simulator |\n|------|------------------|\n| BLE (Central / Peripheral), Video Streaming | Not available |\n| Raw network sockets — UDP, TCP, TCP Server, MQTT Broker | Not available (also why Buttress LAN discovery is a no-op — see [Buttress](buttress.md)) |\n| Android Intent | Not available (Android-only) |\n| On-device database **persistence** (SQLite / Vector Store) | Not available — both run in-memory in the Simulator (see caveats below), so data never survives a reload |\n| GGML Text-to-Speech | No vocoder in the preview — use an ONNX TTS model to hear speech |\n\nThese work, but with browser caveats:\n\n| Area | Caveat |\n|------|--------|\n| Live HTTP/API or Worker-backed flows | Can prove UI/request wiring only when the endpoint is reachable from the desktop preview. It does not prove the bound device\'s network route, blocked insecure protocols, device auth/session state, CORS differences, or worker reachability. Escalate to Path 2 before claiming done for check-in/reporting/payment-style flows that depend on real backend responses. |\n| Performance / input feel | Runs on desktop hardware with browser event timing. A smooth Simulator run does not prove target-device main-thread budget, keyboard/focus behavior, or touch responsiveness. |\n| Serial Port | Works via WebSerial — requires browser support and a user gesture |\n| WebView / WebCrawler | Subject to browser CORS — a load/fetch that works on device may be blocked |\n| On-device AI (LLM / STT / VAD / Vector Store / Reranker) | Runs **single-threaded** — far slower than the device, not representative of real latency. Also subject to the model fallbacks below |\n| On-device database (SQLite — `GENERATOR_SQLITE`) | Runs for real on the in-memory WASM `sqlite-vec` build — `execute` / `query` / `transaction` / batch all work. `storageType: file` is transparently treated as in-memory, so nothing persists across reloads (see above) |\n| Scene3D / Sketch / WebRTC | Supported |\n\nFeature availability also varies across the device platforms themselves (iOS / tvOS / Android / the desktop OSes). When a deployment targets a specific platform\'s capability, confirm it on that platform.\n\n## Network security\n\nThe Simulator blocks insecure connections from `applicationPreview` by default: `http://` and `ws://` requests fail, while `https://` and `wss://` are allowed. The Simulator internally allows its own preview host when running the development preview.\n\nGenerated projects include this project-level setting:\n\n```json\n{\n "allowedInsecureHosts": []\n}\n```\n\nAdd explicit entries only when you deliberately need to test an insecure endpoint in the Simulator. A bare `host:port` allows both `http://` and `ws://` for that host:\n\n```json\n{\n "allowedInsecureHosts": ["localhost:8080"]\n}\n```\n\nUse a URL form when only one insecure protocol should be allowed:\n\n```json\n{\n "allowedInsecureHosts": ["http://localhost:8080"]\n}\n```\n\nIn that example, `http://localhost:8080` is allowed and `ws://localhost:8080` remains blocked.\n\nPrefer HTTPS/WSS for anything that is not local development.\n\n## Feature fallbacks — what the Simulator fakes\n\nSo that camera and AI features are usable without device permissions, multi-gigabyte downloads, API keys, or a remote inference backend, the Simulator **transparently substitutes a lightweight stand-in** for a few bricks/generators. The config you author is untouched — only the Simulator\'s runtime behavior differs. **A fallback render proves wiring and layout, not the real feature.**\n\n| Brick / Generator | In the Simulator | Does NOT prove |\n|-------------------|------------------|----------------|\n| Camera (`BRICK_CAMERA`) | A 3D mock canvas, no camera permission prompt. `takePicture` snapshots the canvas; recording produces a placeholder clip | Real camera feed, focus, recording, permission flow |\n| Maps (`BRICK_MAPS`) | A real interactive map on free OpenStreetMap-based tiles — no Google Maps API key needed. Markers, path polyline, the six themes / map types (approximated with free tile sets + CSS tints), and the zoom / pan / navigate / focus / reset / fit actions all work | Google / Apple Maps rendering, exact `customMapStyle` / theme styling (approximated), traffic / buildings / indoors layers, real device geolocation |\n| Thermal Printer (`GENERATOR_THERMAL_PRINTER`) | A simulated printer — `init` / `checkStatus` / `scan` fake per-driver status and discovered devices (ESC/POS, Star, TSC, Castles); `print` renders an approximate on-screen receipt. A bottom-left bubble shows live status with a fault toggle to exercise error wiring. Print results can be exported as PNG via `bricks-cli` (see below) | Real device connection, actual paper output, exact native driver status codes |\n| LLM (`GENERATOR_LLM`) | Swapped to a tiny local stand-in model | Output quality / latency of your real model |\n| Reranker — GGML (`GENERATOR_RERANKER`) | Swapped to a small local multilingual reranker model | Ranking quality / latency of your real model |\n| Speech-to-Text — GGML (`GENERATOR_SPEECH_INFERENCE`) | Swapped to a tiny local model | Accuracy / latency of your real model |\n| Speech-to-Text — ONNX (`GENERATOR_ONNX_STT`) | Swapped to a tiny whisper model | Accuracy / latency of your real model |\n| Text-to-Speech — ONNX (`GENERATOR_TTS`) | Swapped to a tiny VITS model (no vocoder or speaker embedding) | Voice / quality / latency of your real model |\n| Vector Store (`GENERATOR_VECTOR_STORE`) | Runs with a tiny local embedding model — an OpenAI-source config works **without a key** | Real embeddings / dimensions / recall (and no persistence — see above) |\n| Buttress (all generators) | **Disabled** — there is no remote inference backend in the Simulator | The Buttress offload path — see [Buttress](buttress.md) |\n| MLX LLM (`GENERATOR_MLX_LLM`) | Runs as authored, except Buttress is disabled | The MLX / Buttress path |\n\nThese swaps make the AI generators runnable in the Simulator for wiring checks — validate real models, quality, and latency on a device (Path 2).\n\n### Inspecting simulated thermal printer print results\n\nWith the Simulator running (CDP at `localhost:19852`, see [Verification Toolchain](verification-toolchain.md)), `bricks-cli` can read the simulated printers and export a print result as a PNG image — no need to open the bubble popover or screenshot the whole window:\n\n```bash\n# Printers + print history (newest first; shows the --index value per result)\nbricks devtools simulator thermal-printer list -p 19852\nbricks devtools simulator thermal-printer list -p 19852 -j --commands # full print payloads as JSON\n\n# Render one print result to PNG (defaults: the only printer, --index 0 = latest)\nbricks devtools simulator thermal-printer print-result -p 19852 -o receipt.png\nbricks devtools simulator thermal-printer print-result -p 19852 --index 1 --scale 2 -o older.png\n```\n\nThe PNG is the same approximate receipt the on-screen preview shows (rendered from the print payload). It proves the payload wiring — content, ordering, alignment, barcode/QR/image presence — not pixel-exact native raster output. Print history is in-memory (up to 10 per printer) and clears on preview reload.\n\n### Running the real implementation instead\n\nEach substituted brick/generator can be switched back to its real implementation per item: open the **gear (Simulator settings)** in the editor\'s preview toolbar, uncheck the item, and **Apply**. Apply persists the choice and reloads the preview so it takes effect (a plain refresh won\'t). Use this to, e.g., point a Vector Store at a real API key in the preview, or render the real Google/Apple Maps brick (which needs a Maps API key on web). The browser limits above still apply, and **Buttress stays disabled regardless** — there\'s no backend for it here.\n\nThe Thermal Printer is the exception: it has no real web implementation to switch to (the native drivers can\'t run in a browser), so it is **always simulated** and is not in the gear list.\n\n## Enough vs. escalate\n\n- **Simulator is enough for:** layout, navigation, Standby Transitions, Data wiring, Automation / state-machine happy paths, and confirming a generator fires and handles its events when the required endpoints and runtime assumptions are actually represented in preview.\n- **Escalate to a real device for:** anything in the "can\'t reproduce" tables, live backend / Worker reachability from the target device, target-device performance, native keyboard/focus/touch behavior, real camera / peripherals / payment / identity, real model quality & latency, multi-device Local Sync, on-device persistence, the Buttress offload path, and engine-specific behavior.\n- **If Path 2 is required but unavailable:** tell the user exactly what the Simulator did prove and which real-device risks remain. Do not present compile + harness + Simulator evidence as "done" for those cases.\n\nThe full Path 1/2/3 decision rule lives in [Verification Toolchain](verification-toolchain.md).\n',"bricks-ctor/references/source-editing-tools.md":'# MCP Source-Editing Tools\n\nThe project-local `bricks-ctor` MCP server exposes tools that edit `subspaces/**` via\nsurgical AST edits, keeping files in the standard generated style. Prefer them over\nhand-editing entry files; they validate references, manage imports, compile-verify, and\nrecord every operation in `.bricks/edits.jsonl`.\n\n## Entry tools (bricks.ts / generators.ts / canvases.ts / data.ts / animations.ts)\n\n| Tool | Purpose |\n|------|---------|\n| `new_entry` | Create a standard entry skeleton (`file`, `type`, `templateKey`, `alias`, optional initial `set`/`events`) |\n| `edit_entry` | Set/unset dotted paths on an entry: `title`, `property.url`, `outlets.response`, `value`, `switches[0].property.text`, … |\n| `edit_events` | Add/remove/replace/move/clear EventAction items in `events.<eventKey>` |\n| `edit_canvas_items` | Add/replace/remove/move brick items on a Canvas `items` array (frames need numeric x/y/width/height) |\n| `edit_switches` | Add/replace/remove/move switches (id, title, conds, override, disabled, break) |\n| `remove_entry` | Delete an entry; cascades same-subspace references by default, `strict: true` refuses and lists sites |\n\nAddressing: `{ file, entry }` (export const name) is primary; `id` works as a global\nfallback (omit `file`). `edit_entry`/`edit_events` accept a `switch` parameter (switch id\nor index) to edit the facets inside one switch — `edit_switches` owns only the array and\nthe conds/override shell.\n\n### Event actions\n\n```jsonc\n{\n "handler": "system", // or { "ref": "brickOrGeneratorRef" } or { "subspace": "SUBSPACE_id" }\n "name": "CHANGE_CANVAS",\n "params": { "canvasId": { "ref": "mainCanvas" } }, // template params, OR:\n "dataParams": { "someData": 5 }, // PROPERTY_BANK-style params\n "waitAsync": false\n}\n```\n\nSystem actions derive their `as SystemAction...` cast automatically; entity-action casts\nare added only when passed via `cast`. The compiled source form\n`{ handler, action: { name, params: [...], dataParams: [...] }, waitAsync }` is also\naccepted, and `{ "expr": "<raw EventAction>" }` is the escape hatch for shapes the\nstructured form cannot express. Handler refs must resolve to a brick or generator.\n`PROPERTY_BANK_EXPRESSION` expressions are validated against the runtime fold rules at\nedit time: only expression statements, simple `const`/`let` declarations, and a final\nreturn inside a zero-arg IIFE evaluate — no `if`/`for`/`while` (use ternaries, or a\nDataCalculationScript for branching logic).\n\n## Data-calc tools (DataCalculationScript only)\n\n| Tool | Purpose |\n|------|---------|\n| `new_data_calc` | Create `data-calc/data-calculation-{slug}.ts` + `.sandbox.js`, regenerate `data-calc/index.ts`, wire a minimal subspace root |\n| `edit_data_calc` | Set/unset scalar fields, `output`/`error` refs, replace whole `inputs`/`outputs`, or rewrite the sandbox `code` |\n| `edit_data_calc_io` | Add/remove/replace/clear single `inputs`/`outputs` items (input keys unique; output keys may repeat for fan-out) |\n| `remove_data_calc` | Delete the calc `.ts` + its sandbox file and regenerate the index |\n\nAddressing: `{ file }` or `{ subspace, calc }` where `calc` is alias, id, or filename\nslug (subspace defaults to `subspace-0`). Code is canonicalized to the sandbox file form\n(`export function main() { ... }` — wrapped automatically, `async` added when the body\nuses top-level `await`). `DataCalculationMap` (visual node graph) is out of scope and\nreturns `fallback_recommended`.\n\n## Value grammar (everywhere a value appears)\n\n| You pass | Emits |\n|----------|-------|\n| JSON scalar/array/object | literal |\n| `{ "link": "dataRefOrAlias" }` | `linkData(() => data.dX)` (property data-links) |\n| `{ "ref": "idOrAliasOrVarName", "subspace"?: 1 }` | `() => namespace.varName` getter |\n| `{ "expr": "raw TypeScript" }` | spliced verbatim |\n\nReferences resolve by var name, id, or alias within the target subspace and fail loudly\nwhen missing or ambiguous — this doubles as reference validation.\n\n## Verification and audit\n\n- Every call compile-verifies by default and returns `verify.configChange` — the minimal\n compiled-config delta (path-keyed set/unset ops). Skip with per-call `verify: false`\n or `BRICKS_CTOR_MCP_EDIT_VERIFY=0` when batching, then finish with the `compile` tool.\n- All operations append to `.bricks/edits.jsonl` (gitignored) with inputs, outcomes, and\n touched sites.\n- Non-standard files or entries (hand-written shapes the AST editor cannot safely\n rewrite) return `fallback_recommended` — use plain file edits for those cases only.\n',"bricks-ctor/references/standby-transition.md":"# Standby Transition\n\nEasy-to-configure animation for Bricks based on Canvas render/change. Provides smooth enter animations when bricks appear and position transitions when canvas changes.\n\n## How It Works\n\nTwo transition cases:\n1. **First Render**: Run position transition based on `standbyMode` setting\n2. **Canvas Change**: Existing bricks animate to new positions instead of re-rendering\n\n## Configuration\n\nStandby transition is configured in the **canvas item frame**, not the brick itself.\n\n### Standby Mode\n\n| Mode | Description |\n|------|-------------|\n| `top` | Slide in from top |\n| `bottom` | Slide in from bottom |\n| `left` | Slide in from left |\n| `right` | Slide in from right |\n| `custom` | Use custom `standbyFrame` values |\n\n### Frame Options\n\n| Option | Description |\n|--------|-------------|\n| `standbyMode` | Direction or `'custom'` |\n| `standbyFrame` | Custom start frame `{ x?, y?, width?, height? }` |\n| `standbyOpacity` | Start opacity (0.0 - 1.0) |\n| `standbyDelay` | Delay before transition starts (ms) |\n| `standbyDelayRandom` | Random delay variance (ms) |\n| `standbyEasing` | Per-property easing config |\n\n### Easing Configuration\n\n```typescript\nstandbyEasing: {\n default?: { method: Easing, duration: number },\n x?: { method: Easing, duration: number },\n y?: { method: Easing, duration: number },\n width?: { method: Easing, duration: number },\n height?: { method: Easing, duration: number },\n opacity?: { method: Easing, duration: number },\n}\n```\n\n## TypeScript Example\n\n```typescript\nimport { makeId } from 'bricks-ctor'\n\nconst canvas: Canvas = {\n __typename: 'Canvas',\n id: makeId('canvas'),\n title: 'Home',\n description: '',\n property: {\n backgroundColor: '#ffffff',\n },\n events: {},\n switches: [],\n items: [\n {\n item: () => heroCard,\n frame: {\n x: 100,\n y: 50,\n width: 400,\n height: 300,\n // Standby transition config\n standbyMode: 'bottom',\n standbyOpacity: 0,\n standbyDelay: 100,\n standbyEasing: {\n default: { method: 'easeOutCubic', duration: 400 },\n opacity: { method: 'easeOutQuad', duration: 300 },\n },\n },\n },\n ],\n}\n```\n\n## Canvas Change Transition\n\nWhen navigating between canvases, bricks with the same ID smoothly transition:\n- Position interpolates from old to new location\n- Size interpolates if dimensions change\n- Opacity interpolates if visibility changes\n\nThis creates a \"shared element transition\" effect.\n\n## Related Events\n\n- `standby`: Triggered when brick completes standby transition\n\n```typescript\n// In brick definition\nevents: {\n standby: [\n {\n handler: 'system',\n action: {\n __actionName: 'DYNAMIC_ANIMATION',\n parent: 'System',\n params: [\n { input: 'brickId', value: () => heroCard },\n { input: 'animationId', value: () => pulseAnimation },\n ],\n },\n },\n ],\n}\n```\n\n## Best Practices\n\n1. **Stagger delays**: Use incremental delays for list items (e.g., 0, 50, 100ms)\n2. **Keep it short**: 200-400ms transitions feel responsive\n3. **Match content**: Use directional transitions that match scroll direction\n4. **Opacity for polish**: Combine position transition with opacity fade\n5. **Same-ID trick**: Reuse brick IDs across canvases for smooth transitions\n","bricks-ctor/references/verification-toolchain.md":"# Verification Toolchain\n\nThree runtime targets, one decision rule. Verify against the cheapest path that proves what you need to prove.\n\n## Definition of done — the hard gate\n\nBefore the agent is allowed to claim work is complete, **all** of the following must be true:\n\n1. **Compile clean.** Latest source passes `compile` with no errors.\n2. **Every Canvas screenshot captured.** A rendered screenshot of every Canvas in the deliverable, captured via the available preview tool (`responseImage: true` when the selected model supports vision) at the target hardware resolution and orientation. Canvases gated behind events are reached via Automation runs (`testId` / `testTitleLike` with `brick_press` / `wait_until_canvas_change` cases). Single-Canvas Subspaces still require a captured screenshot.\n3. **Every screenshot reviewed by the agent.** The agent must read each captured screenshot back through the host's image-reading capability — saving the file is not the same as seeing it. The model that produced the Canvas must also have seen the rendered result, or the verification gate has not passed.\n4. **Reference comparison report.** If the user supplied any reference material (Figma / website / HTML / screenshot / PDF / brand book / competitor), produce a short delta report per Canvas:\n - What matches the reference.\n - What intentionally diverges, and why (deployment constraint, BRICKS-runtime semantic, system commitment).\n - What unintentionally diverges, and the planned fix.\n5. **Path appropriate to deployment executed.** Path 1 by default. Path 2 (on-device) when the deployment depends on real hardware behaviour, live network reachability that the Simulator cannot represent, target-device performance/input feel, or whenever the brief touches payment, identity, peripherals, or LocalSync.\n6. **Console clean.** No 404s on media, no Data-key-undefined warnings, no Generator init failures, no React-style warnings — every console line is either zero or accept-with-a-comment.\n\nWhat does **not** count as done:\n\n- A single hero-Canvas screenshot.\n- \"Looks roughly like the reference\" with no per-Canvas comparison.\n- \"Compiled successfully\" with no rendered preview.\n- A claim of done with no screenshots in evidence.\n- Captured screenshots saved to disk but never read back by the agent.\n\nIf any item is unmet, the work is mid-iteration. Say so explicitly to the user; offer a precise list of what remains.\n\n## Debug loop discipline\n\nBefore cycling on a runtime or Automation bug, establish what you can observe. A green or red Automation alone is often not enough to explain a race or branch miss.\n\n- Use one repeatable probe at a time: DevTools state/storage/runtime reads, network/console output, Automation screenshots, or a targeted screenshot after a known event.\n- If branch execution or race timing is unclear, add the smallest temporary log/trace point in the relevant data-calculation script, event handler, or generator path, then compile and rerun the same probe.\n- Do not bounce between CLI, DevTools, and Automation without a hypothesis. State what signal will prove or disprove the next fix before changing code again.\n- Remove temporary traces before declaring done, unless the user asked for persistent diagnostics or the trace is intentionally part of the fix.\n\n## Path 1 — Simulator (no device required)\n\nThe default loop. Always available; deterministic; no device wear; safe for side-effecting flows because nothing real fires.\n\nBefore trusting a Simulator screenshot, know what it can and can't reproduce: it runs in the Electron preview (a browser-class runtime, not the device — and not the device's JS engine), can't exercise hardware/peripheral features (BLE, printers, raw sockets, SQLite, …), and substitutes fallbacks for Camera and the AI generators (LLM/STT/Vector Store) with Buttress disabled. See [Simulator](simulator.md) for the fidelity boundaries and the per-item gear to run the real implementation — it's what tells you when a green run is enough vs. when to escalate to Path 2.\n\n`bun update-app` and `bun deploy-app` publish to the BRICKS portal. The local preview reads `.bricks/build/application-config.json` (produced by `compile`) directly.\n\n### Compile tool\n\nTypecheck + compile the project. Gate every iteration on this; everything below assumes a clean compile.\n\nAgent invocation: call the MCP tool `compile` exposed by the `bricks-ctor` MCP server registered for the project. No arguments.\n\n### Simulator tool\n\nUse the preview implementation exposed by the current harness:\n\n- **CTOR Desktop agent session:** use `simulator_invoke`. CTOR Desktop disables the `bricks-ctor` MCP `simulator` tool and routes screenshots/automation through the desktop preview pane instead. If the user already opened the simulator pane, `simulator_invoke` should reuse it rather than start a separate preview.\n- **Pure `bricks-ctor` project / other agent harness:** use the `bricks-ctor` MCP `simulator` tool when `simulator_invoke` is not available.\n\nBoth forms are the same verification primitive: launch or reuse Electron preview, take a screenshot, and optionally run a named Automation test by id or partial title. Do not hard-code one tool name into the workflow; choose the available preview tool for the environment.\n\nCommon arguments:\n- `delay` (ms before screenshot) — default is harness-specific: usually 3000 for a fresh/standalone preview; CTOR Desktop may capture immediately when its preview already has a settled latest config. Increase if Standby Transitions are still in flight.\n- `width`, `height` — screenshot dimensions in px.\n- `responseImage: true` — return the screenshot as image content when the selected model supports vision. If vision is unavailable, save the screenshot and report the path.\n- `testId` or `testTitleLike` — run a project Automation before the screenshot. Use `testTitleLike` for fuzzy matches (case-insensitive partial title).\n\nReturns text log + saved screenshot path + image content when supported.\n\n### `bun invoke-simulator` (project script)\n\nSustained dev session — watches `subspaces/`, recompiles on save, exposes CDP at `localhost:19852` (configurable via `--cdp-port`), writes `.bricks/devtools.json` with port/pid for downstream tooling.\n\nUseful flags:\n- `--screenshot` + `--screenshot-delay/width/height/path` — drive screenshot capture without keeping the window open.\n- `--show-menu` — surface the Electron menu (debugging).\n- `--test-id` / `--test-title-like` — run an Automation in this preview.\n- `--no-keep-open` — exit after one screenshot.\n- `--no-cdp` — disable CDP server (rare; default is to expose it).\n- `--clear-cache` — reset cached state between runs.\n\nFor ad-hoc CDP inspection against this local preview, connect any CDP client to `localhost:19852` — Chrome DevTools front-end works directly. For an agent-friendly CLI over CDP (screenshot, brick tree/query, input emulation, storage reads, runtime eval, network capture), the `bricks-cli` skill documents the `bricks devtools` command surface — read that skill if it is installed in this workspace. If it is not installed, run `bricks --help` and `bricks devtools --help`; the CLI's own help output is authoritative.\n\nTo inspect Data / Property Bank or storage state, prefer the dedicated `bricks devtools storage` subcommands — `storage data-bank get <S_xxxx>` (saved Data values), `storage system persist|memory`, `storage system get <key>` — over hand-written `runtime eval`. Reach for `runtime eval` only for *live* store internals that aren't persisted to a data bank (e.g. a current transient value: `runtime eval \"system.data.property('S_xxxx', '<alias>')\"`); don't reverse-engineer the `system.*` globals.\n\n### Project Automations\n\nE2E tests authored in TypeScript inside the project (`AutomationTest` / `TestCase`). Test cases include:\n\n- `brick_press` — synthesize a press on a Brick.\n- `wait_until_canvas_change` — assert navigation.\n- `assert_property` — assert a Data value equals expected.\n- `wait_property_update` — wait for a Data value to change.\n- `match_screenshot` — visual regression with stored reference image.\n\nTrigger types: `launch` (runs on app start), `anytime` (manual), `cron` (scheduled).\n\nImportant: the automation map id must be `'AUTOMATION_MAP_DEFAULT'` (not a generated id) — the preview test runner reads from `automationMap['AUTOMATION_MAP_DEFAULT']?.map`.\n\nRun a single test from the agent: call the available preview tool (`simulator_invoke` in CTOR Desktop, otherwise `bricks-ctor` MCP `preview`) with `testId` or `testTitleLike`.\n\n## Path 2 — Real device with DevTools enabled\n\nRequired when the deployment depends on behaviour the Simulator cannot reproduce: physical orientation/DPI, real touch hardware (IR overlays, multi-touch), native keyboard/focus behavior, target-device performance or frame timing, live backend / Worker reachability from the bound device, peripherals (camera, BLE, MQTT, NFC, payment, printer, sensors), watchdog cycles on the actual launcher build, fleet-managed reboot semantics, LocalSync across multiple devices, the actual color/luminance of the panel.\n\n**Always Path 2** when the brief touches: payment, identity capture, real-time peripheral data, multi-device LocalSync, certified hardware.\n\n### One-time manual setup (the agent cannot do this)\n\nAsk the user to:\n\n1. On the device, open **Settings** → advanced settings.\n2. Toggle **Chrome DevTools** on. The device starts a DevTools server on the local network on port `19851` (auto-increments if taken).\n3. Confirm **Enable LAN Discovery** is on (default) so the device is discoverable.\n4. Note the device passcode if displayed.\n\nRequires BRICKS Foundation **≥ 2.24** for CDP commands.\n\n### Endpoints exposed once enabled\n\n| Endpoint | URL shape | Use |\n|---|---|---|\n| Web UI | `http://<ip>:19851` | DevTools landing in a browser |\n| CDP | `http://<ip>:19851/devtools-frontend/inspector.html?ws=<ip>:19851/ws/<passcode>` | Chrome DevTools front-end |\n| MCP | `http://<ip>:19851/mcp` | MCP endpoint (Bearer-token auth with passcode) |\n| MCP SSE | `http://<ip>:19851/sse` | Same, SSE transport |\n| Info | `http://<ip>:19851/devtools/info` | Device / server metadata |\n\n### Driving the device\n\nOnce DevTools is on, ask the user how they want to drive the verification — Chrome DevTools front-end, an MCP client they already run, or screenshot export from their own tooling — and follow their lead. Capture every Canvas screenshot through whichever path the user picks; the verification gate is about the evidence, not the tool.\n\nFor agent-driven CDP/MCP work against the device (`bricks devtools …` with `-a <ip> --passcode <pc>`, plus bridging the device MCP endpoint into an MCP client), the same `bricks-cli` skill referenced in Path 1 covers the on-device case — read it if installed. If not installed, run `bricks --help` and `bricks devtools --help` for the authoritative command listing.\n\n### Running real-device Automations from an agent\n\nThere is no `bricks devtools automation` subcommand. Use the DevTools runtime helpers exposed inside the app:\n\n```bash\nbricks devtools runtime eval -a <ip> -p 19851 --passcode <pc> \"Object.getOwnPropertyNames(automation).sort()\" -j\nbricks devtools runtime eval -a <ip> -p 19851 --passcode <pc> \"automation.list()\" -j\nbricks devtools runtime eval -a <ip> -p 19851 --passcode <pc> \"automation.run('<TEST_id>', { updateScreenshot: false })\" --await -j\n```\n\nWhen a project Automation can express the flow, use `automation.run()` as the primary on-device driver. It exercises the same BRICKS automation path as the Simulator and fires app-level handlers; raw `input tap`, platform shell taps, or ad-hoc `simulatePress` calls can miss the app's press/event path and produce false green results. Use low-level input only when the thing under test is raw native input, keyboard focus, or touch hardware itself.\n\n`automation.run()` starts the device-side run and may return `null`; treat that as accepted, not as a pass/fail result. Wait for the run timeout/window, then verify completion through the app's own state and a screenshot. For app state, use live runtime reads such as:\n\n```bash\nbricks devtools runtime eval -a <ip> -p 19851 --passcode <pc> \"JSON.stringify({ result: system.data.property('<S_xxxx>', '<resultAlias>')?.value })\" -j\nbricks devtools screenshot -a <ip> -p 19851 --passcode <pc> -o /tmp/device-automation.png\n```\n\nIn CTOR Desktop sandboxed sessions, keep these as separate simple commands. Avoid multi-line shell scripts, `for` loops, brace expansion, and command substitution around `bricks devtools`; those can stay sandboxed and lose LAN/device access. After `bun update-app` or a device refresh, the DevTools socket may briefly drop, so wait and probe with one screenshot or one `runtime eval` before running the automation.\n\n### Real-device side-effects warning\n\nReal devices fire real peripherals. Payment terminals charge. MQTT broadcasts on shared topics. BLE advertises to bystanders. Use a **staging** device for verification cycles; never iterate on a production-deployed device unless the user explicitly approves.\n\n## Path 3 — Remote debugging via BRICKS Controller (off-LAN)\n\nOut of scope for the standard verification loop. It exists for ops scenarios where the device is not on the same network. If the user asks for it, point them at the BRICKS Controller documentation rather than attempting it as part of verification.\n\n## Decision rule\n\n```\ndefault Path 1.\n\nif deployment depends on:\n physical orientation / DPI / touch HW / native input /\n target-device performance / live backend reachability /\n peripherals / watchdog on real launcher / LocalSync / certified hardware\n→ escalate to Path 2 before declaring done.\n\nif brief touches payment, identity, peripherals, LocalSync\n→ Path 2 is mandatory, not optional.\n\nif user is off-LAN\n→ Path 3 (out of scope here).\n```\n\n## What to actually verify (per shape)\n\n### Static signage (single-canvas glance loop)\n- Path 1 screenshot captures the loop frame.\n- Watch one full rotation in `bun invoke-simulator` to see all queue items.\n- Cut network mid-loop; confirm cached media plays.\n- Path 2 only if the panel is OLED / has burn-in concerns or specific color profile.\n\n### Multi-canvas state machine (kiosk)\n- Path 1: Automation walking the happy path with `brick_press` + `wait_until_canvas_change` + `assert_property` + `match_screenshot` per Canvas.\n- Cancel + inactivity reset paths verified as Automations.\n- Watchdog reset: kill the runtime, restart, confirm boot Canvas resets transient flow Data.\n- Path 2 mandatory if payment / identity is in the flow — fire a real test transaction on staging hardware.\n\n### Subspace-driven composition\n- Path 1: open the Subspace standalone if the preview supports it; verify in isolation.\n- Embedded test: walk the host's flow; assert Outlets fire as expected via `wait_property_update`.\n- Re-mount test: cause the host to re-bind the Subspace; confirm internal state resets.\n\n### Generator-driven reactive\n- Path 1: drive the source by writing to Data from the runtime (whatever CDP path the user prefers); observe Brick re-render.\n- Throttle / firehose tests: write 100 updates rapidly; confirm the canvas doesn't choke (frame budget intact).\n- Disconnect: simulate source disconnect; confirm UI surfaces stale state, not blank.\n- Threshold transitions: cross every Switch boundary; confirm visual reaction.\n- Path 2 mandatory if the source is a real peripheral — Electron cannot fake the timing or the failure modes.\n\n### Multi-device LocalSync\n- Path 2 mandatory. Two devices on the same LAN with DevTools on. Drive one, observe the other.\n\n## Browser / runtime log discipline\n\nThroughout: the DevTools console must be clean. 404s on media, \"Data key not defined\" warnings, Generator init failures, React-style warnings — every one is a defect or accept-with-comment. Don't ship around them.\n","bricks-design/SKILL.md":"---\nname: bricks-design\ndescription: >-\n Visual design discipline for Applications and Subspaces — type, palette, asset\n acquisition, design language, DESIGN.md system, visual rhythm, brand. TRIGGER\n for visual / aesthetic / system / style / brand-asset work even when named in\n product terms — slideshow, pitch deck, explainer, kiosk, signage, menu board,\n lobby, wayfinding, retail, museum, transit; translate or rebuild from Figma /\n HTML / screenshot / website / PDF / brand book; vague creative briefs; branded\n scenes; rework or audit of an existing Subspace's type / palette / motion /\n rhythm. For end-to-end briefs invoke in parallel with bricks-ux (interaction /\n flow layer). SKIP for pure usability / flow / accessibility audits (bricks-\n ux), single-Brick or Generator template work (create-brick-or-generator),\n debugging without design intent, or non-display deliverables. Encodes\n architecture truths, performance guardrails, input-translation rules, visual\n languages, Direction Advisor, Media Flow protocol; verification toolchain\n lives in bricks-ctor.\n---\n\n# BRICKS Design\n\nYou are a BRICKS **visual designer**. Your output is the visual surface of a runnable Subspace — the type, palette, asset, motion vocabulary, rhythm, and system commitment that makes the work read as one designed thing. Interaction shape (flows, journeys, affordance, feedback, accessibility) is the companion `bricks-ux` skill's domain; the two run in parallel on most briefs.\n\nEvery visual decision is downstream of the deployment — hardware, scene, network, language, brand, peripherals, watchdog. Web habits (scroll, hover, modals-as-overlays-by-default, semantic links) do not transfer; surface them as tells when input arrives in those shapes.\n\nThe user-facing primitive is **Data** (legacy alias: Property Bank — kept in some internal action names like `PROPERTY_BANK`). Surface \"Data\" in your prose. Other primitives keep their names: Application, Subspace, Canvas, Brick, Generator, DataCalculation, Switch, Animation, Standby Transition, Media Flow, Automation.\n\n## Priority #0 — Verify deployment context\n\nBefore any design exploration, confirm: **hardware** (size, resolution, orientation, touch, viewing distance), **scene** (where the screen lives, what the user does), **network** (always-on / intermittent / offline), **language(s)**, **brand**, **peripherals** (camera, BLE, MQTT, NFC, payment, printer, sensors), **watchdog / fleet management**. If any of the first five is missing, stop and ask in a single batch — improvising on hardware or scene is the most expensive mistake in BRICKS work.\n\n## Priority #0.5 — Visually inspect every reference, in full\n\nIf the user supplies any reference material — a website URL, a docs site, a Figma link, an HTML project, a screenshot, an image, a PDF, a brand book, a video walkthrough, a competitor's product — you must **visually inspect every page, frame, and state of it**, not skim a text summary or rely on a markdown extraction. Translating from material you have not actually seen is the single fastest path to designs that miss obvious cues (layout rhythm, photography style, motion language, brand temperature) that no text description preserves.\n\nHard rule: a markdown extraction (e.g., `WebFetch`, an `llms.txt`, a `README.md`) is **not** visual inspection. It captures words and loses everything that makes the reference design-relevant. Use it only as a navigation aid — a list of pages to then visit visually.\n\nHow to inspect, by source type:\n\n- **Website / docs site URL** — drive a browser automation tool (browser-MCP, Playwright/Puppeteer-style MCP server, `agent-browser`-equivalent skill, or any host-provided browser tool). Visit the home page, every primary navigation entry, every page the user explicitly named, and every page that looks like it carries the brand's visual signature (hero, product, gallery, customers). Capture a full-page screenshot of each. Then read each screenshot back via the host's image-reading capability so you actually *see* it. If no browser automation is available, ask the user for screenshots before proceeding.\n- **Figma / design-tool link** — use a Figma-MCP / design-tool MCP if available to enumerate every frame and image-export each; otherwise ask the user for PNG exports of every frame. Inspect each image.\n- **HTML project on disk** — serve and screenshot every route via a browser tool, the same way as a public URL. Don't infer visuals from the source HTML/CSS.\n- **PDF / brand book / slide deck** — read every page via the host's PDF-reading capability (page-by-page if the document is long). Do not summarize from a text extraction.\n- **Local images / screenshots** — read each one via the image-reading tool.\n- **Video walkthrough** — ask the user to provide key-frame screenshots, or to describe each state explicitly. Do not claim to \"watch\" a video you cannot actually frame-step.\n\nCoverage check before continuing: list — out loud, in your reply — every reference artifact and the count of pages / frames / images you actually saw. If anything is unseen, name the gap and ask. Translating from incomplete reference inspection is grounds for rework.\n\n## Workflow spine\n\nPass-based delivery, not sprint-to-finished. Full discipline in [`references/workflow.md`](references/workflow.md) (ask-vs-build heuristic, batched question playbook by axis, five passes with checkpoints).\n\n1. **Verify deployment context** (Priority #0) and branch on input shape:\n - Vague brief → [`references/when-the-brief-is-vague.md`](references/when-the-brief-is-vague.md) (Direction Advisor — interaction archetype \xd7 visual language \xd7 Canvas-graph shape for sequenced work).\n - Branded brief → [`references/when-the-brief-is-branded.md`](references/when-the-brief-is-branded.md) (Media Flow protocol).\n - Figma / HTML / screenshot input → [`references/translating-inputs.md`](references/translating-inputs.md).\n - Presentation / slideshow / intro / explainer / storyboard → [`references/presentation-and-slideshow.md`](references/presentation-and-slideshow.md) (Canvas-graph shape decision, hero continuity).\n2. **Pass 0** — Write the project's [`DESIGN.md`](references/design-md.md): named tokens in the frontmatter (type scale, palette, **spacing scale in grid units**, motion vocabulary, grid stance, hero Brick ids) plus Deployment Context and the Visual Theme section. The grid substrate is given by the runtime (Truth #6); the design decisions sit on top. The Subspace file carries only a one-line pointer to DESIGN.md; every Brick cites its tokens by name.\n3. **Pass 1 — Showcase Canvas lockdown.** Build one Canvas fully lit, verify, show the user. This is the cheapest moment to redirect; do not build the full Canvas graph before sign-off.\n4. **Pass 2** — Build out the full Canvas graph with hero ids shared across Canvases (Truth #3 as narrative principle). Mid-review checkpoint partway through.\n5. **Pass 3** — Polish: spacing-scale adherence, density rhythm, Standby Transition vocabulary consistent, multilingual fits.\n6. **Variations**, if exploring options — three patterns ordered by token cost, default Pattern 1. See [`references/variations-and-tweaks.md`](references/variations-and-tweaks.md). Comparison surface is chat + source tree, not the Canvas.\n7. **Pass 4** — Verification gate (below) + self-critique (5 dimensions + first-viewer rubric for sequenced work). Never declare done off a single screenshot.\n\n## The 10 architecture truths\n\nThe load-bearing laws. Each is unpacked in [`references/architecture-truths.md`](references/architecture-truths.md).\n\n1. **Canvas is a state, not a screen.** A Subspace is a state machine; Canvases are states; Brick events / Data changes are transitions. Treat Canvases as web pages and you'll fight the runtime.\n2. **Data is the conduit for *dynamic* values.** Anything that varies at runtime (content, i18n, Generator inputs/outputs, Subspace boundaries, event payloads) flows through Data. Hardcoded values in genuinely-static, single-use Bricks are fine — convention is loose, not enforced. The rule kicks in the moment the value can change.\n3. **Shared Brick ids across Canvases auto-tween.** Use the same Brick on Canvas A and Canvas B with different frames — the runtime animates position/size for free. This is the highest-leverage technique for a polished feel; rewriting per Canvas throws it away.\n4. **Switches compare; Data Hit/Not-Hit only matches.** Canvas / Brick / Generator Switches support `==` `!=` `>` `<` `>=` `<=` against Data values (`SwitchCondData`). Data events `valueHit` / `valueNotHit` only support equal-match (`hit_equal`) or regex-match (`hit_regex`). Threshold-driven UI lives on Switches, not on Data event subscriptions. Don't confuse them.\n5. **Generators are headless, async, event-driven.** Wire them via events; never as synchronous calls. Every chain needs a termination condition. Generators that hit hardware/network must not block the canvas thread.\n6. **Frames are grid units.** Off-grid placement is legal but only ever intentional (overflow effects, anchor-at-origin tricks). It is never a nudge to escape the grid. Bricks fully outside the grid are auto-culled.\n7. **Standby Transition is part of the design language.** Every visible Brick gets an entrance offset (`standbyMode` + `standbyOpacity` + `standbyDelay`); the runtime's auto-tween handles in-flight motion. Snap-cuts are reserved for emphasis (alarm states), never for routine navigation.\n8. **Subspace is a typed module.** Inputs are call-by-value-on-host-change; outlets emit update + value-change events on the host. Extract a Subspace only when the same flow appears 2+ times or when the boundary scopes Data meaningfully — never as a \"tidy up\" tactic.\n9. **DataCalculation is for derivation, not orchestration.** Inputs → outputs via DataCalculationScript or DataCalculationMap. Keep scripts pure by default; `enableAsync: true` (Promise / timers / async libs) and Map `FILE_*` commands are available when derivation genuinely needs them. Network calls, navigation, and DataCalc-triggers-DataCalc fanout belong in Event Action chains or Generators.\n10. **No scroll, no overflow, no responsive reflow.** Frames are fixed; what doesn't fit doesn't show. Design within the Canvas; don't import web habits.\n\n## Commit to a design language\n\nA BRICKS Application that doesn't commit to a design language reads as generic regardless of how well it runs. After Direction Advisor (or directly, when the brief is concrete enough), pick a visual language from [`references/design-languages.md`](references/design-languages.md) — Swiss Editorial / Kenya Hara emptiness / Field.io motion poetics / Brutalist web / Y2K futurist-retro / etc. — and commit it as named tokens in the project's [`DESIGN.md`](references/design-md.md). Every subsequent choice cites a token by name; adding a value not already in the tokens requires adding the token first. That's what makes the system structural rather than aspirational.\n\nThe commitment principle: when unsure, do *more* of what defines the chosen language, not less. A style executed at 30% reads as hesitant; at 80% it reads as deliberate. Soften signature moves and you've abandoned the language for nowhere.\n\nThe picked language is orthogonal to the picked **interaction archetype** (glance / browse / interact / transact / monitor / dwell — see [`references/when-the-brief-is-vague.md`](references/when-the-brief-is-vague.md)). Together they define the work. Pick both deliberately; combine awkward pairings (transact + Sagmeister, monitor + Magazine editorial) only as a deliberate brand statement, not by accident.\n\n## Pressable composition\n\nComposite-button wiring (where `on_press` sits, which Bricks bypass) is an interaction concern — see the companion `bricks-ux` skill's `pressable-composition.md`. The visual-design responsibility here is making pressable affordance *visually distinct*: a tile that's pressable should not look identical to a tile that's decorative. Affordance reads through the visual language; the wiring lands the press.\n\n## Performance & complexity guardrails\n\nTwo reference files cover the second-order rules. Read them when the design is non-trivial.\n\n- [`references/performance.md`](references/performance.md) — throttle at the Generator boundary, bound Data history explicitly, `persistData: true` is for last-known-good and idempotency keys (not transient flow state), boot Canvas must render in < 1 s using only cached/persisted Data, `renderOutOfViewport: false` for legitimate off-grid Bricks, offline-first cache + queue + status-Data on every networked Generator. **Media bound through Media Flow is preloaded to the device and is offline-safe by default — image / video / Lottie / Rive / brand reel are not \"offline risk\" categories. The offline wrap is for Generators fetching dynamic runtime data, not for design-time media.**\n- [`references/avoiding-complexity.md`](references/avoiding-complexity.md) — Subspace abuse (single-instance Subspaces are usually directories), Switch fanout (4+ on one node = state machine in disguise; promote to Canvases), DataCalc chains (orchestration in the wrong primitive), animation overuse (one orchestrated entrance > scattered micro-anims; `loop` only for attention draws), Canvas inflation (each Canvas is a state the user can be stuck in).\n\n## Asset discipline\n\nBrand work succeeds or fails on assets, not on colors. Logo, product photography, UI screenshots, scene photography, and motion assets are first-class — colors and fonts are auxiliary. Acquire them through the protocol in [`references/when-the-brief-is-branded.md`](references/when-the-brief-is-branded.md): five steps, the 5-10-2-8 quality bar with five named scoring dimensions, three fallback paths per asset category, and structural enforcement that Bricks reference Media Flow Data via DataLink rather than embed, redraw, or skip. The acquired assets, scores, and bindings land in the **Assets & Brand** sections of [`DESIGN.md`](references/design-md.md) — one artifact, not a separate brand spec.\n\nWhen an asset category genuinely cannot be acquired and the user has no plan to provide one, the priority is: stop and ask (always for logo) → compose the host environment's image / motion generators (canvas-design / imagen / generative MCP), brand-reference-anchored, scored at the same bar → labeled placeholder with the gap tracked under DESIGN.md's **Gaps & placeholders**. **This skill does not duplicate generative or composition skills — it composes them.** Where the host has none, surface the constraint to the user; don't silently degrade.\n\n## Anti-slop, terse\n\nSnap canvas transitions on routine navigation. Hardcoded *dynamic* strings (content, i18n) bypassing Data. Hover affordances on no-touch hardware. Sketch-drawn imitations of real brand assets. Aggregator-sourced logos shipped as final. Generated brand imagery without a real brand-reference anchor. Subspaces extracted for \"neatness\". Switch fanout standing in for state. DataCalc chains standing in for orchestration. Animation everywhere. Stock-photo grounds behind real product photography. CSS-style scroll containers.\n\n## Variations\n\nWhen exploring options for the user to choose from, default 3, differentiated on a real axis (visual language / interaction archetype / Canvas-graph shape / motion language / content rhythm). Three colour-swap variants is not three variants.\n\n**The comparison surface is chat + source tree, never the Canvas.** No in-Canvas palette pickers, no \"choose your theme\" toggles, no demo-mode switches left in production. Default to Pattern 1 (Data-preset variations — one Canvas tree, flat preset map, single-line preset switch, screenshot grid in chat). Escalate to shared module or separate Subspaces only when the variation can't be expressed by the cheaper pattern. Full protocol with token-saving discipline and knob filter in [`references/variations-and-tweaks.md`](references/variations-and-tweaks.md).\n\nShip a one-paragraph trade-off note alongside so the user can pick or blend with full context.\n\n## Verification gate\n\n**Definition of done — non-negotiable.** Before declaring a design complete, every one of the following must be true:\n\n1. The source compiles cleanly.\n2. Every Canvas in the deliverable has a rendered screenshot at the target hardware resolution and orientation. Cover every reachable state — Canvases gated behind events get reached by running an Automation.\n3. The agent has **viewed** each of those screenshots back through the host's image-reading capability — not just saved them. The model that designed the Canvas must also have seen the rendered result.\n4. If the user supplied any reference material (Figma / website / HTML / screenshot / PDF / brand book), a side-by-side visual comparison has been done between each Canvas screenshot and the corresponding reference, with a short delta report listing:\n - What matches.\n - What intentionally diverges, and why (deployment constraint, system commitment, BRICKS-runtime limitation).\n - What unintentionally diverges, and how you will fix it.\n5. The verification path appropriate to the deployment has executed (Path 1 Electron preview by default; Path 2 on-device DevTools when the deployment depends on real hardware, payment, identity capture, peripherals, or LocalSync).\n6. The browser / runtime console is clean — no 404s, no Data-key-undefined warnings, no Generator init failures.\n\nA single hero-Canvas screenshot is **not** done. A \"looks roughly like the reference\" handwave is **not** done. A claim of done without screenshots in evidence is **not** done. If you have not produced and reviewed a screenshot of every Canvas, you are still mid-iteration and must say so explicitly to the user.\n\n**Self-critique pass before declaring done** — every Canvas scored on 5 dimensions (system commitment / visual hierarchy / craft / functional fit / originality), checked section by section against [`DESIGN.md`](references/design-md.md) (does every colour, gap, and motion in the render trace to a declared token?), anti-slop top-10 swept clean, < 8 scores either fixed or surfaced as accepted trade-offs. See [`references/design-critique.md`](references/design-critique.md). Verification proves it runs; critique proves it's good — both required.\n\nFor the toolchain itself — `compile` / `simulator` MCP usage, `bun invoke-simulator` flags, Project Automation cases, on-device DevTools setup, the Path 1/2/3 decision rule, and per-deployment-shape verification checklists — see the `bricks-ctor` skill's `rules/verification-toolchain.md`.\n\n## Boundaries\n\n- Do not recreate copyrighted UIs. Build an original design that respects the IP.\n- Do not invent brand assets. Use a labeled placeholder Brick + tracked gap list.\n- Do not bypass Data for dynamic values.\n- Do not carry web-frame habits across (scroll, hover, semantic links, modals-by-default, responsive reflow).\n- Treat real-device runs as side-effecting — peripherals fire for real, payment terminals charge for real, MQTT/BLE may broadcast on shared topics. Use a staging device for verification cycles.\n\n## Companion skill: `bricks-ux`\n\nInteraction / flow / journey / affordance / feedback / recovery / accessibility / multilingual concerns live in `bricks-ux`. For end-to-end briefs (\"design a kiosk for X\", \"build a presentation introducing Y\") both skills invoke in parallel — `bricks-design` carries the visual layer, `bricks-ux` carries the interaction layer. Cross-references in this skill point to `bricks-ux/references/...` where the interaction discipline matters.\n\n## Reference index\n\n| When you need to... | Read |\n|---|---|\n| Write or update the project's design-system artifact (tokens, schema, brand merge) | [`references/design-md.md`](references/design-md.md) |\n| Decide when to ask vs build; pace the work across passes | [`references/workflow.md`](references/workflow.md) |\n| Deepen any of the 10 truths | [`references/architecture-truths.md`](references/architecture-truths.md) |\n| Tune for performance / offline | [`references/performance.md`](references/performance.md) |\n| Resist over-engineering | [`references/avoiding-complexity.md`](references/avoiding-complexity.md) |\n| Translate a Figma / HTML / screenshot | [`references/translating-inputs.md`](references/translating-inputs.md) |\n| Pick and commit to a design language | [`references/design-languages.md`](references/design-languages.md) |\n| Design a presentation / pitch deck / intro / explainer / slideshow (visual rhythm + hero continuity) | [`references/presentation-and-slideshow.md`](references/presentation-and-slideshow.md) |\n| Offer variations / pick what becomes a Data knob | [`references/variations-and-tweaks.md`](references/variations-and-tweaks.md) |\n| Self-critique on the visual dimensions | [`references/design-critique.md`](references/design-critique.md) |\n| Verify a design before shipping | `bricks-ctor/rules/verification-toolchain.md` (companion skill) |\n| Propose visual directions for a vague brief | [`references/when-the-brief-is-vague.md`](references/when-the-brief-is-vague.md) |\n| Acquire and bind brand assets | [`references/when-the-brief-is-branded.md`](references/when-the-brief-is-branded.md) |\n| Compose a button so taps land where intended | `bricks-ux/references/pressable-composition.md` (companion skill) |\n| Walk the universal interaction journey | `bricks-ux/references/user-journey.md` (companion skill) |\n| Apply interaction-archetype rule sets | `bricks-ux/references/interaction-archetypes.md` (companion skill) |\n| Design idle / loading / empty / error / boot / maintenance states | `bricks-ux/references/flow-states.md` (companion skill) |\n| Design monitoring / dashboard UX | `bricks-ux/references/monitoring-screens.md` (companion skill) |\n| Accessibility floors at deployment-relative thresholds | `bricks-ux/references/accessibility.md` (companion skill) |\n| Tiered UX critique | `bricks-ux/references/ux-critique.md` (companion skill) |\n","bricks-design/references/architecture-truths.md":"# Architecture Truths\n\nThe 10 load-bearing laws of BRICKS design. Each one lists the truth, the runtime semantic that makes it true, and the failure mode it prevents. Re-read this when something feels arbitrary — usually one of the truths settles it.\n\n## 1. Canvas is a state, not a screen\n\nA Subspace is implicitly a state machine: Canvases are states, Brick events / Data changes are transitions, the visible Canvas is the current state. The runtime auto-tweens shared Bricks across Canvas changes, so transitions *are* the design language.\n\n**Failure mode:** treating each Canvas as an independent web page. Symptoms — every Canvas redraws all chrome from scratch (no shared Bricks), transitions feel like hard cuts, navigation logic gets bolted onto Bricks instead of expressed as Canvas changes.\n\n**Tell:** if you have one Canvas with `if-then-else` Switches toggling Brick visibility based on a `flowStep` Data, you're emulating a state machine inside one Canvas. Promote to N Canvases.\n\n## 2. Data is the conduit for dynamic values\n\nAnything that varies at runtime — content (text, images, URLs), i18n strings, Generator inputs/outputs, Subspace Props/Outlets, event payloads, theme tokens you want to swap — flows through Data.\n\nHardcoded values in genuinely-static, single-use Bricks are *fine*. The convention is loose, not enforced. A decorative Rect's `backgroundColor` set to a literal hex, a Text Brick that says `\"OK\"` as a confirmation label that will never change — both acceptable.\n\n**The rule kicks in the moment the value can change.** A `\"Welcome\"` heading that should later support Chinese must live in Data from day one; retrofitting i18n once the design is complete is far more expensive than naming the Data key now.\n\n**Failure mode:** Bricks coupled directly (Brick A reads Brick B's prop), Generator A invoking Generator B by name, hardcoded URLs that should be config, hardcoded English where i18n is foreseeable.\n\n**Misread to avoid:** \"dynamic values flow through Data\" does not mean \"media is dynamic and therefore an offline risk\". Media bound through Media Flow (image / video / Lottie / Rive / brand reel via Data of `kind: media-resource-*` with `preload` metadata) is preloaded to the device at boot, integrity-verified, and served from local storage. It works offline. The offline-first concern is about Generators fetching runtime data (menus, sensor readings, LLM output, server-fed inventory), not design-time media. Don't strip rich visuals \"to be safe for offline\" — that's a category error.\n\n## 3. Shared Brick ids across Canvases auto-tween\n\nIf a Brick has the same id on Canvas A and Canvas B with different `frame`s, the runtime animates `x`/`y`/`width`/`height` between the two when the Canvas changes. New Bricks enter via Standby Transition; departing Bricks exit symmetrically.\n\n**Use it for** brand chrome (logo, header), progress indicators, persistent CTAs, status footers — anything continuous across the flow.\n\n**Narrative principle, not just a runtime fact.** Pick one or two **hero Bricks** (logo lockup, headline word, product silhouette, brand chrome). Give them the same id across every Canvas they appear on. Each Canvas is then a *transformation* of the hero's state, not a new set of elements appearing and disappearing. Auxiliary Bricks (content that only matters to one Canvas) scope to that Canvas via Standby Transition. Heroes are the thread that makes the sequence feel like one designed thing — especially for presentation / slideshow / narrative work (see [`presentation-and-slideshow.md`](presentation-and-slideshow.md)).\n\n**Failure mode:** every Brick is unique to its Canvas. The Application loses continuity and even with entrance/exit animations configured, every transition feels like a hard cut. This is the single biggest difference between a polished and an amateur BRICKS Application — and the difference between \"narrated PowerPoint\" and a designed presentation.\n\n## 4. Switches compare; Data Hit/Not-Hit only matches\n\nTwo distinct condition systems exist; do not confuse them.\n\n**Switches** (`SwitchDef` on Canvas / Brick / Generator) support comparison operators against `SwitchCondData`:\n\n```\nmethod: '==' | '!=' | '>' | '<' | '>=' | '<='\ncond: SwitchCondData | SwitchCondInnerStateCurrentCanvas | SwitchCondInnerStateOutlet\n```\n\nUse Switches for threshold-driven UI: hide a Brick when `flowProgress < 1`, switch a tile's color when `value >= threshold`, show a chrome variant when the current Canvas has a specific id.\n\n**Data events** `valueHit` / `valueNotHit` only fire on equal-match (`hit_equal: any`) or regex-match (`hit_regex: string`). They do not support `>` `<` `>=` `<=`. Use them for state notifications: \"alarm.active became true\", \"code matched the pin regex\".\n\n**Failure mode:** trying to express `value > threshold` via a Data Hit subscription. It will not fire as you expect. Move the comparison to a Switch.\n\n## 5. Generators are headless, async, event-driven\n\nGenerators have no visible surface. They take inputs from Data, produce outputs to Data, and are triggered by events. They emit events. They run asynchronously against the canvas thread.\n\n**Wire them via events**, never as synchronous calls. The canonical chain: an event triggers a System / Generator Action; the Generator runs; its outlet writes to Data; downstream Data event subscribers (Bricks, other Generators, canvas-transition Actions) react.\n\n**Every chain needs a termination condition.** Idempotency keys, guarded conditions, hard-stop counters, retry caps. Surface termination in a comment or a Switch. A Generator chain that fans out without a stop is a denial-of-service against your own Application.\n\n**Failure mode:** synchronous \"fetch then render\" patterns where the canvas waits on a Generator. The runtime can render *something* immediately and let the Generator's outlet update later — design for that.\n\n## 6. Frames are grid units\n\nFrames (`x`, `y`, `width`, `height`) are integers in the configured grid (`layout.width` \xd7 `layout.height`; default 96 \xd7 54 in many projects, but confirm against the actual Subspace). The runtime maps grid units to physical pixels at runtime based on hardware resolution.\n\nOff-grid placement is *legal*: position `(-2, -3)` size `(4, 6)` puts the Brick's center at the screen origin — a real composition technique. It is *slop* when used to nudge a Brick by a non-grid amount because the grid felt restrictive.\n\n**Bricks fully outside the grid are auto-culled** for performance. Don't rely on that as a hide mechanism — use Switches or `hidden`.\n\n**Failure mode:** copy-pasting pixel values from a Figma render into frame fields. Translate to grid units instead.\n\n## 7. Standby Transition is the design language\n\nEvery visible Brick item on a Canvas can declare a Standby Transition (`standbyMode`, `standbyOpacity`, `standbyDelay`, `standbyDelayRandom`, `standbyEasing`, per-property easing on x/y/width/height/opacity). On Canvas enter, the runtime animates the Brick from its standby pose to its placed pose.\n\nCombined with shared-Brick auto-tweens (Truth #3), this is the entire transition vocabulary of a BRICKS Application. Master it.\n\n**Snap-cuts** (no Standby) are reserved for emphasis — alarm states, error overlays, deliberate hard moments. Routine navigation that snap-cuts feels broken.\n\n**Failure mode:** every Brick gets the same fade-in. Boring is also slop. Stagger delays, vary directions per Brick role, use the runtime's `standbyDelayRandom` for natural-looking item lists.\n\n## 8. Subspace is a typed module\n\nA Subspace is a self-contained mini-Application: own Canvases, own Bricks, own Generators, own Data, own DataCalculation. It binds to a host via:\n\n- **Inputs** (Props): host-provided Data values copied into Subspace Data on host change (call-by-value at the boundary). Triggers the Subspace's `valueChange` event internally.\n- **Outlets**: Subspace-emitted values that fire `outlet update` (always) and `outlet value change` (on diff) events in the host.\n- **Actions / Events**: explicit host-callable actions and Subspace-emitted events.\n\n**Extract a Subspace only when**:\n- The same flow appears 2+ times (login, OTP, payment, language picker, confirm dialog).\n- The boundary scopes Data meaningfully (a sub-flow with its own complete state independent of the host).\n- A Module distribution is intended (Subspace is also the unit of reuse via the BRICKS Module system).\n\n**Do not extract** for \"tidy up\". Single-instance, single-purpose Subspaces are directories, not modules; they make the design harder to reason about.\n\n**Failure mode:** Subspaces with leaky contracts (every host Data exposed as a Prop). Tighten the contract; if you can't, the boundary is wrong.\n\n## 9. DataCalculation is for derivation, not orchestration\n\nTwo flavours:\n\n- **`DataCalculationScript`** — a sandboxed JS function with named inputs / outputs. Default is sync + pure; opt into async with `enableAsync: true`, which unlocks `Promise`, `setTimeout` / `setInterval` / `setImmediate`, `requestAnimationFrame`, and the full lodash surface (`debounce`, `delay`, `defer`). Bundled libraries include lodash, voca, mathjs, chroma, moment, json5, qs, url, bytes, ms, base45, iconv, nanoid, md5, crypto-browserify, jsrsasign (JWS), cose-js, fflate (gzip/zlib), cbor, fs (limited; no download/upload), officeparser, turndown, opencc-js, toon-format. Runs on Hermes (Android) and JavaScriptCore (iOS) — keep that in mind for engine pitfalls.\n- **`DataCalculationMap`** — a node-graph of `DataCommand`s spanning these categories: `COLLECTION`, `COLOR`, `CONSTANT`, `DATETIME`, `FILE` (file-system ops: `READ` / `WRITE` / `APPEND` / `MKDIR` / `COPY_FILE` / `MOVE_FILE` / `UNLINK` / `EXISTS` / `STAT` / etc.), `ITERATEE`, `LOGICTYPE`, `MATH`, `OBJECT`, `SANDBOX` (`SANDBOX_RUN_JAVASCRIPT` runs a script node inside the graph), `STRING`.\n\nDerivation is the intent. Purity is a strong default and the right framing for the common case, but it is a best practice — not a hard runtime restriction. `enableAsync` and `FILE_*` exist because some derivation work (document parsing, decompression, signing, reading a cached file) genuinely needs them.\n\n**Use it for**:\n- Format conversion (date → human-readable, currency → localized string).\n- Combining Data values into a derived display value.\n- Reductions / iterations over a collection.\n- Boolean conditions feeding a Switch.\n- Async derivation pipelines: decode → decompress → parse → verify (cbor, fflate, cose-js, officeparser, turndown).\n- Reading cached files written earlier in the flow (Map `FILE_*` commands or Script `fs`).\n\n**Triggering**: `triggerMode: 'auto'` re-runs on input change (watch for circular dependencies); `'manual'` only runs on `PROPERTY_BANK_COMMAND` action.\n\n**Do not use** for orchestration, navigation, network calls (no `fetch` / XHR in the sandbox — that's a Generator's job), or anything that should be in an Event Action chain or a Generator. A DataCalc that triggers DataCalc that triggers DataCalc is an orchestration system in the wrong primitive — promote to event chains. `enableAsync` and `FILE_*` are tools for derivation, not a licence to smuggle flow control into the calc layer.\n\n**Failure mode:** spinning up a Generator just to do a string concat or unit conversion. That's a DataCalc job; the inverse misuse is just as common.\n\n## 10. No scroll, no overflow, no responsive reflow\n\nSubspace `layout` is fixed. Frames are fixed. There is no document flow, no `overflow: scroll`, no media-query reflow. What doesn't fit, doesn't show.\n\n**Implications**:\n- Long content lists → `Items` Brick (interactive virtualized list) or `Slideshow` Brick (timed rotation) or paginate across Canvases.\n- Long forms → Canvas per question, not a scrollable form.\n- Modal dialogs → Subspace overlay or Switch-driven Brick reveal — not a popup primitive.\n- Different orientations → different Subspaces with different `layout`s, not a single design that \"responds\".\n\n**Failure mode:** importing a long Figma artboard verbatim, expecting BRICKS to scroll the overflow. Redesign the information architecture; the runtime will not save you.\n","bricks-design/references/avoiding-complexity.md":'# Avoiding Complexity\n\nThe "designer ego" guardrails. Each one names a specific over-engineering pattern, the symptom that exposes it, and the simpler primitive it should collapse into. When in doubt, delete.\n\n## Subspace abuse\n\nA Subspace is a typed module — own Canvases, own Data, own Generators, own contract. It earns its complexity only when it\'s reused, when it scopes a non-trivial Data boundary, or when it\'s a distributed Module.\n\n**Symptoms of abuse**:\n- Single-instance Subspace whose Props are "everything in the host\'s Data" — not a module, a leaky directory.\n- Subspace extracted to "tidy up" a single Canvas with 8 Bricks — the cleanup made the design harder to reason about because state now crosses a boundary.\n- Nesting > 2 Subspaces deep — the abstraction is wrong; flatten.\n\n**Collapse rule**: if the Subspace appears once and its Props/Outlets cover most of its Data, inline it back into the host.\n\n## Switch fanout\n\nSwitches are powerful — they let one Brick or Canvas have several conditional poses. They become slop when used to express what should be N Canvases.\n\n**Symptoms**:\n- 4+ Switches on one Canvas, each gating a different subset of Bricks based on a `flowStep` Data.\n- Switches that toggle Brick `hidden` based on the same `flowStep` value — you\'ve hand-rolled a state machine inside one Canvas.\n- Switch conditions referencing Outlets from a Subspace just for navigation logic.\n\n**Collapse rule**: if the Switches partition the Canvas into more than 2 visual states gated by the same Data, promote each state to its own Canvas. Use the runtime\'s auto-tween of shared chrome (Truth #3) to keep continuity.\n\n## DataCalculation chains\n\nDataCalc is for derivation. A single calc that produces a derived value is healthy. A calc whose output triggers another calc whose output triggers another is orchestration smuggled into the wrong primitive.\n\n**Symptoms**:\n- DataCalc A → Data X → DataCalc B → Data Y → DataCalc C → Data Z, all `triggerMode: \'auto\'`.\n- Calcs whose names sound like verbs ("submitForm", "validateInput", "navigateNext") instead of nouns ("formattedDate", "scoreSum", "displayLabel").\n- Circular dependency warnings or fired-multiple-times-per-update behaviour.\n\n**Collapse rule**: derivation lives in calcs; the *flow* connecting derivations to user-visible effects lives in Event Action chains and Generators. If a calc has a side effect or triggers navigation, it shouldn\'t be a calc.\n\n## Animation everywhere\n\nStandby Transitions are part of the design language (Truth #7). `loop` animations are an emphasis tool. Reaching for animation on every Brick on every state change is noise, not polish.\n\n**Symptoms**:\n- Every Brick on every Canvas has a Standby spec with the same easing and duration — uniform motion is no motion.\n- 5+ `runType: \'loop\'` animations idling on a Canvas.\n- Animations that fight each other (a parent Brick scaling while children translate against the scale).\n\n**Collapse rule**: vary motion intentionally — stagger Standby delays per Brick role, reserve loop for genuine attention draws, use shared-Brick auto-tween instead of separate exit + entrance animations for chrome that persists.\n\n## Canvas inflation\n\nEach Canvas is a state. Each state is a place the user can be stuck. More Canvases is rarely better UX.\n\n**Symptoms**:\n- Canvases with one Brick and one event chain that immediately CHANGE_CANVAS to the next — these are state machine steps that don\'t deserve a Canvas.\n- Canvases that exist only to "loadingly transition" — that\'s what Standby and shared-Brick tweens are for.\n- Canvases for every locale / every theme variant — variants belong in Switches or Data-bound props, not parallel Canvases.\n\n**Collapse rule**: a Canvas earns its existence by being a stable state the user observes for at least a moment. Transitional / loading / variant-only Canvases should fold into their neighbours.\n\n## Generator orchestration smell\n\nGenerators are I/O units triggered by events. Generators invoking other Generators directly (via name in an Action chain that runs synchronously) is orchestration smell.\n\n**Symptoms**:\n- Long Action chains with `waitAsync: true` chaining 4+ Generator calls.\n- A Generator whose only job is to call another Generator and wait.\n- Two Generators reading and writing the same Data inside one event chain.\n\n**Collapse rule**: split the chain at Data boundaries. Generator A writes its outlet → Data fires `valueChange` → that event chain triggers Generator B. Each piece is independently inspectable, retryable, and cacheable.\n\n## Module overreach\n\nThe BRICKS Module system lets a Subspace be packaged with version metadata and dependency requirements (`Subspace.module`). It is a real distribution mechanism — and like any package boundary, it has a maintenance cost.\n\n**Symptoms**:\n- Modularizing a Subspace that\'s only used in one Application.\n- Modules whose contract changes every version because the host keeps adding Props.\n- Bumping a Module version for purely cosmetic edits.\n\n**Collapse rule**: keep Subspaces local until at least the second consumer asks for them. Versioned modules are for genuinely shared building blocks (login, payment, OTP, language picker) maintained by someone who treats them as a product.\n\n## "Let\'s make it dynamic" overreach\n\nTruth #2 says dynamic values flow through Data. The inverse failure is making everything dynamic when it doesn\'t need to be — exposing every color, every text, every layout dimension as Data "in case we want to change it later".\n\n**Symptoms**:\n- Subspace with 40 Data entries, half of them never read by a Generator and never written by anything but a default value.\n- Theme tokens exposed as Data even though the design ships with one theme.\n- A Generator whose job is to "set the title" of a Brick that always says the same thing.\n\n**Collapse rule**: Data is the conduit for *currently dynamic* values. If a value is genuinely static and single-use, hardcode it. The cost of converting later is low; the cost of carrying inert Data forever is real.\n',"bricks-design/references/design-critique.md":'# Design Critique — self-review before "done"\n\nThe Verification gate proves the design *runs*. Critique proves it\'s *good*. Both are required before declaring done; neither substitutes for the other.\n\nThis file gives the agent a structured self-review pass: five scoring dimensions with concrete rubrics, a per-deployment-shape focus chart, and an extended anti-slop top-10 with BRICKS-specific failure modes. Run the pass after the screenshots are captured and viewed (per `bricks-ctor/rules/verification-toolchain.md`), and before declaring done to the user.\n\nThe point isn\'t to be self-critical for its own sake. The point is to catch the specific failure modes that consistently ship if not actively rooted out.\n\n## How to run the pass\n\n1. **Verify** — compile clean + screenshot every Canvas + read screenshots back (see `bricks-ctor/rules/verification-toolchain.md`).\n2. **Score** — for each Canvas, rate the five dimensions below 0–10 against the rubrics.\n3. **Anti-slop sweep** — walk the top-10 list; flag every match.\n4. **Fix anything < 8** and any anti-slop matches; re-verify.\n5. **Declare done** — only when every Canvas scores ≥ 8 on every dimension and the anti-slop list is clean.\n\nIf a dimension cannot be scored ≥ 8 within the deployment\'s constraints, surface it as an accepted trade-off in the trade-off note rather than silently shipping a 6.\n\n## The five dimensions\n\n### 1. System commitment\n\n*Does the work cite the declared system (the named tokens in `DESIGN.md`), and does deviation have rationale?*\n\n| Score | Rubric |\n|---|---|\n| 9–10 | Every brick property points back to a DESIGN.md token, a Data token, or an `ApplicationFont` entry. Deviations carry a one-line comment explaining why. |\n| 7–8 | Direction is correct; 1–2 hardcoded values that should be tokens, or 1–2 deviations without rationale. |\n| 5–6 | Visible drift — a third type family slipped in, a fourth color appeared mid-flow, or a brick redrew an asset that exists in Media Flow. |\n| 3–4 | DESIGN.md is decorative; the work doesn\'t follow it. |\n| 1–2 | No DESIGN.md, or its tokens contradict the work. |\n\n**Audit moves:**\n- Open DESIGN.md. Pick five tokens from it (a color, a type size, a Standby duration, a margin, a Brick template). For each, check that the work uses it consistently.\n- Pick five values *from* the work (a `backgroundColor` literal, a `fontSize`, a Standby easing, a hex code in a Rect, a brick template choice). For each, check that the value traces back to a DESIGN.md token or has rationale.\n- If signature moves of the chosen design language (per [`design-languages.md`](design-languages.md)) are absent, score drops regardless of token-discipline. Swiss Editorial without numbered folios and hairline rules is not Swiss Editorial; it\'s "vaguely minimal."\n\n### 2. Visual hierarchy\n\n*Does the user\'s eye flow where the designer intended? Is information findable in under 2 seconds?*\n\n| Score | Rubric |\n|---|---|\n| 9–10 | Squint test passes — even at low resolution / low attention, primary / secondary / tertiary are unmistakable. Display:body scale ratio ≥ 2.5\xd7. Three to four clear levels via size, weight, color, and space combined. |\n| 7–8 | Hierarchy is clear with one or two muddy spots. |\n| 5–6 | Title and body distinguished, but mid-levels collapse together; user has to read everything to find anything. |\n| 3–4 | Information is uniform; no entry point. |\n| 1–2 | The eye doesn\'t know where to land. |\n\n**Audit moves:**\n- The squint test. View the screenshot at 25% zoom or with eyes half-closed. The composition should still read.\n- Measure the display:body scale ratio in grid units. < 2.5\xd7 = deduction.\n- Count the levels distinguishable in the Canvas. < 3 = deduction; > 5 = different deduction (over-stratified).\n- For the deployment\'s viewing distance, simulate the legibility floor (per the scale-floor table in `architecture-truths.md` Truth #6 + `performance.md`\'s scale section). If body text won\'t read at that distance, hierarchy fails regardless of relative ratios.\n\n### 3. Craft execution\n\n*Alignment. Spacing rhythm. Colour discipline. Typography count. Motion vocabulary consistency.*\n\n| Score | Rubric |\n|---|---|\n| 9–10 | Grid stance matches the chosen language (lean / break / breathe) deliberately throughout. Every inter-Brick gap comes from the declared spacing scale. Colours limited to the system tokens (typically ≤ 4). Typography limited (typically ≤ 2 families). Standby Transitions use a consistent easing and timing vocabulary. |\n| 7–8 | Mostly clean; 1–2 alignment slips or one off-scale spacing. |\n| 5–6 | Visible inconsistency — colours creeping past the token set, mixed Standby easings, asymmetric margins without intent, ad-hoc gap values. |\n| 3–4 | Grid stance unclear; multiple type families; arbitrary motion timings; spacing drift. |\n| 1–2 | Looks like a draft. |\n\n**Audit moves:**\n- **Grid stance match.** Off-grid placements should serve the declared language (Brutalist break, Sagmeister theatrical, Risograph hand-placed). Off-grid that drifted in accidentally — flag and snap. A Swiss Editorial Canvas with a Brick at `(3.5, 11.2)` is a tell.\n- **Spacing-scale adherence.** Open DESIGN.md. Read the declared `spacing` tokens (e.g., `gap-s 2 / gap-m 4 / gap-l 8 / margin 8`). Pick ten inter-Brick gaps across the Canvas — every one must come from that set. Gaps of 7 / 9 / 11 / 13 across siblings = arithmetic drift, the agent picked values ad-hoc instead of from the scale. Snap to the nearest scale value or update the scale (and re-check everywhere).\n- List every distinct colour used in the Canvas. > 4 = deduction (excluding intentional photography palette spreads).\n- List every distinct type family. > 2 = deduction.\n- List every distinct Standby easing / duration combination. > 3 = deduction.\n\n### 4. Functional fit to deployment\n\n*Does the design solve the deployment\'s actual constraints?*\n\nThis dimension overlaps with the companion `bricks-ux` skill — interaction / accessibility / flow-state correctness is critiqued in depth there (`bricks-ux/references/ux-critique.md`). What stays here is the visual-design contribution to functional fit: does the visual system *enable* the interaction layer to work, or does it actively disable it.\n\n| Score | Rubric |\n|---|---|\n| 9–10 | Type meets legibility floor for viewing distance. Pressable Bricks are visually distinct from decorative. Contrast survives deployment conditions (sunlight / dim lobby / glare). Brand and asset choices accommodate languages in scope. Orientation respected. |\n| 7–8 | One visual choice marginal — type at the floor instead of comfortably above; one asset that doesn\'t survive a locale; affordance distinction subtle but present. |\n| 5–6 | One visual choice actively disables interaction — pressable tiles indistinguishable from decoration, body type below legibility floor for the distance, palette that fails contrast under deployment light. |\n| 3–4 | Multiple visual-functional conflicts. |\n| 1–2 | Visual design ignores deployment constraints entirely. |\n\n**Audit moves:**\n- Walk the deployment-context block (from Priority #0). For each visible item — what the user must read, find, press, distinguish — point to the visual choice that supports it.\n- Squint test at 25% zoom: primary content readable, pressable elements visually distinct, severity tiers (if monitor) distinguishable.\n- For interaction / accessibility / flow-state critique beyond the visual contribution, cross to `bricks-ux/references/ux-critique.md`. The two passes run in parallel; both block ship.\n\n### 5. Originality within direction\n\n*Is this the chosen design language done at 80% commitment, or 30%?*\n\n| Score | Rubric |\n|---|---|\n| 9–10 | The signature moves of the chosen language are present and confident. The work would be recognized by a designer familiar with the language. There\'s at least one move that\'s specific to *this* brief, not just templated language application. |\n| 7–8 | Direction is recognizable; mostly templated execution; one or two moves feel rote. |\n| 5–6 | Recognizable as "the kind of thing that gets called Swiss Editorial / Kenya Hara / etc." but generically — could be any brand. |\n| 3–4 | Clich\xe9-mode application of the language; works that any agent might produce given the same prompt. |\n| 1–2 | The language is unrecognizable in the work. |\n\n**Audit moves:**\n- For the chosen direction, list its top 3–5 signature moves (from `design-languages.md` or your own knowledge of the language). For each, check whether the work executes it.\n- Where signature moves are absent, the direction has been softened toward generic. Restore them.\n- Look for the inverse — moves that *aren\'t* in the language but the work has imported anyway (a Field.io-style gradient on a Swiss Editorial piece, a Risograph spot color on a Kenya Hara piece). These are the dilutions that drop scores.\n\n## Deployment-shape focus\n\nDifferent deployments weight the dimensions differently:\n\n| Deployment shape | Strongest weight | Weaker weight |\n|---|---|---|\n| Glanceable signage (single canvas) | Visual hierarchy \xb7 Originality | Functional fit (low complexity) |\n| Multi-canvas kiosk (transact / interact) | Functional fit \xb7 Craft execution | Originality (don\'t get cute with money or identity) |\n| Reactive dashboard (monitor) | Visual hierarchy \xb7 Functional fit | Originality (data is the work) |\n| Hospitality / lifestyle (dwell) | Originality \xb7 System commitment | Functional fit (low input complexity) |\n| Wayfinding | Visual hierarchy \xb7 Functional fit (legibility floor) | Originality (recognition over flair) |\n| Presentation / introduction loop | Originality \xb7 Visual hierarchy | Functional fit (no input) |\n\nWhen focus weights diverge sharply, surface the trade-off in the trade-off note. A wayfinding screen that scores 10 on hierarchy and 6 on originality is *correct*; a wayfinding screen that scores 9 on originality and 6 on hierarchy is *wrong*.\n\n## Anti-slop top-10 (BRICKS-specific)\n\nWalk this list every time. Each is a pattern that consistently slips into agent-produced work and consistently degrades it.\n\n### 1. Generic gradient backgrounds on a Rect\n**Tell:** purple → pink → blue full-bleed on the boot Canvas. **Why bad:** it is the literal AI-generated-page tell; reviewers identify the work as machine-made instantly. **Fix:** use a single-color ground from the system tokens, or a reference-anchored gradient that\'s specific to the brand (declared as a Data token, used deliberately).\n\n### 2. Decorative left-border-accent on every Rect\n**Tell:** every card-shaped Rect carries a 4-grid-unit left border in the accent color. **Why bad:** it is the AI-dashboard-card signature; once seen it cannot be un-seen and it dates the work to the AI-tool era. **Fix:** distinguish cards via background contrast, weight, or composition; or commit to a different card vocabulary that matches the chosen language.\n\n### 3. Emoji decoration in RichText\n**Tell:** ✅, ⚡, \uD83D\uDE80, ✨ next to feature bullets or in headlines. **Why bad:** unless the brand actually uses emoji in its voice (rare, deliberate), this is decoration-as-substitute-for-design. **Fix:** real icon library (Lucide / Phosphor / Heroicons via `Icon` brick), or no icon at all.\n\n### 4. Sketch / SVG-drawn imitations of real assets\n**Tell:** a `Sketch` brick that approximates a logo, a CSS-shape product silhouette, a SVG hero illustration. **Why bad:** AI-drawn imagery reads as AI-drawn imagery. A labeled placeholder is more honest. **Fix:** acquire the real asset via the [Media Flow protocol](when-the-brief-is-branded.md), generate one anchored on real brand reference, or accept a labeled placeholder.\n\n### 5. Fabricated stats / fake user counts\n**Tell:** "10,000+ happy customers", "99.9% uptime", "trusted by Fortune 500" appearing without a source. **Why bad:** invented social proof is dishonest and reviewers usually catch it. **Fix:** request real numbers from the user or use a labeled placeholder ("[insert real metric]").\n\n### 6. Default sans system fonts when the brand has its own\n**Tell:** Inter / Roboto / Helvetica / system-ui shipped despite the brand having a documented type stack. **Why bad:** it leaks "I didn\'t bother sourcing the brand font" across the entire surface area of the design. **Fix:** declare the brand fonts as `ApplicationFont` entries with the licensed files in Media Flow.\n\n### 7. Naive dark-mode by inverting Data values\n**Tell:** the dark theme is "white background → black, black text → white" with no other adjustments. **Why bad:** a real dark theme rebalances saturation, contrast, accent intensity, and shadow. Inversion produces a theme that looks broken. **Fix:** if the brief wants dark mode, design it as a deliberate second theme — re-author the token Data, don\'t just toggle.\n\n### 8. Animation `loop` on every visible element\n**Tell:** every brick on every canvas has a `runType: \'loop\'` Animation attached. **Why bad:** continuous motion everywhere is visual noise that burns frame budget and dulls genuine attention-draws. **Fix:** reserve `loop` for true attention-draws (alarm pulse, recording dot, hero motion in Field.io); use Standby Transitions and shared-Brick auto-tween for everything else.\n\n### 9. Hover-state treatments imported to no-touch hardware\n**Tell:** a brick\'s `pressable: \'enabled\'` carries a press scale-down animation, but the deployment is a 75" no-touch signage panel. **Why bad:** the affordance promises something the hardware cannot deliver; the design reads as "ported from web." **Fix:** drop hover on no-touch; convert to a Switch driven by a non-pointer signal (sensor, timer, peripheral Generator) if the visual intent matters.\n\n### 10. AI-generated brand imagery without a real brand-reference anchor\n**Tell:** a generated "brand-appropriate" hero image that nobody at the brand has ever seen, produced from a prompt like "modern tech product on a gradient." **Why bad:** generation without anchoring produces uncanny-valley assets that feel adjacent to the brand without being the brand. **Fix:** anchor every generation on at least one verified brand asset (logo, real photo, official color sample); apply 5-10-2-8; log generation metadata in DESIGN.md\'s Assets & Brand. (See [Media Flow protocol \xa7 Creating assets when missing](when-the-brief-is-branded.md#creating-assets-when-missing).)\n\n## Bonus failure modes (BRICKS-specific, less common)\n\n- **Hardcoded English in a Subspace bound for multilingual deployment.** Every visible string should be a Data value, even when only one language is populated at first.\n- **`persistData: true` on transient flow Data.** Resumes a half-complete flow after a watchdog reset and confuses the next user.\n- **DataCalculation chains masquerading as orchestration.** See [`avoiding-complexity.md`](avoiding-complexity.md) — calc → calc → calc is the wrong primitive.\n- **Subspace-as-tidiness.** A Subspace with a single instance and a leaky Props contract is a directory, not a module. See `architecture-truths.md` Truth #8.\n- **Snap canvas transitions on routine navigation.** Reserved for emphasis only.\n- **Inline brand binaries** (logo as base64 in a Brick prop, hero image embedded). Pollutes the Subspace and defeats Media Flow\'s offline + refresh model.\n- **Pseudo-chrome contamination — page counters, progress bars, chapter numbers drawn into Canvas content.** A "Slide 3/12" Text Brick inside the design competes with the runtime\'s own transition affordances and reads as duplicated chrome. If the audience genuinely needs to know where they are, render it via a shared chrome Brick (so it auto-tweens with the rest of the chrome) — or drop it entirely. See [`presentation-and-slideshow.md`](presentation-and-slideshow.md).\n- **Density-rhythm collapse — three or more consecutive Canvases at the same layout archetype.** Three "headline + bullet list" Canvases in a row reads as a single Canvas that didn\'t change. Alternate density across the sequence (full-bleed / two-column / pull-quote / data-figure / breather — see the rotation table in `presentation-and-slideshow.md`).\n- **In-Canvas variation pickers — palette swatches, theme toggles, "choose your style" buttons left in production.** Same category as pseudo-chrome. The variation comparison surface is chat + source tree, not the Canvas. See [`variations-and-tweaks.md`](variations-and-tweaks.md).\n- **Full-set unmount + remount per Canvas change.** Every Brick is Canvas-local; no shared ids; every transition is a hard cut even with Standby Transitions configured. This is what makes a sequence read as "narrated PowerPoint" instead of a designed flow. Pick 1–2 hero Bricks and share their ids across Canvases — see Truth #3.\n\n## First-viewer reaction rubric (for sequenced / narrative work)\n\nFor presentations, slideshows, intro decks, explainers — anything sequenced. Predict (or directly ask) the first reaction. The rubric is a separate axis from the 5 dimensions and only applies when the work is a sequence ≥ 3 Canvases.\n\n- *"This is narrated PowerPoint."* — Redesign. Hero architecture missing or broken. Likely full-set unmount per Canvas change. Back to Pass 1.\n- *"Things were just moving."* — Motion is present but hierarchy isn\'t. Heroes exist but compete with auxiliaries. Quiet down everything except the hero.\n- *"I wanted to keep watching."* — Baseline good. Pacing works, hero continuity reads. Polish from here.\n- *"I wanted to screenshot that frame."* — Memorable keyframe achieved. At least one Canvas is doing more than its job.\n\nAim for the third reaction overall and the fourth on at least one Canvas in any sequence of ≥ 5 Canvases. Anything ≤ first is a structural failure, not a polish issue.\n\n## Definition of "done" with critique applied\n\nA design is done when:\n\n1. The Verification gate (compile + every-Canvas screenshot + screenshots reviewed) passes.\n2. Every Canvas scores ≥ 8 on every one of the five dimensions, or trade-offs are explicitly accepted with rationale.\n3. The anti-slop top-10 + bonus-failure-modes walk produces zero unaddressed matches.\n4. For sequenced / narrative work, the first-viewer rubric predicts ≥ "I wanted to keep watching."\n5. Reference comparisons (where applicable) have a written delta report.\n6. The trade-off note that ships alongside variations captures every accepted < 8.\n\nIf any item is unmet, the work is mid-iteration. Say so explicitly to the user; offer a precise list of what remains.\n',"bricks-design/references/design-languages.md":'# Design Languages\n\nA curated library of visual languages, each with concrete BRICKS-native execution notes. The library exists because *committing to a system* is what separates polished work from generic output — and an agent without anchors averages toward generic. These anchors give you something specific to commit to.\n\nThe library does not constrain you. Pick one, blend two, or invent a new one rooted in the same discipline. What it prevents is the no-commitment middle.\n\n## Two orthogonal axes\n\nA picked direction is the combination of two independent choices:\n\n- **Interaction archetype** — *what the user does* in front of the screen (glance / browse / interact / transact / monitor / dwell). Drives the Subspace structure: Canvas count, state-machine shape, dominant Bricks. See [`when-the-brief-is-vague.md`](when-the-brief-is-vague.md).\n- **Visual language** — *what the design says*. Drives expression: type, color logic, motion vocabulary, signature moves, asset emphasis. This file.\n\nA "browse + Kenya Hara emptiness" Subspace is profoundly different from a "browse + Brutalist web" Subspace, even though the user does the same thing. Advisor mode picks 3 candidates spanning both axes.\n\n## The commitment principle — fight your averaging instinct\n\nWhen unsure, do *more* of what defines the chosen language, not less. A style executed at 30% reads as hesitant; at 80% it reads as deliberate.\n\n- Swiss Editorial without numbered folios, hairline rules, and oversized headlines is just "generic minimal."\n- Kenya Hara without 70%+ negative space is just "a bit sparse."\n- Brutalist web with rounded corners and gradient accents is just "an unfinished page."\n\nIf you find yourself softening signature moves to "make it more accessible" — stop. The signature moves are the language. Soften them and you\'ve abandoned the language for no destination.\n\n## How to use the library in Advisor mode\n\n1. **Pick 3 directions from different schools.** Not three minimalist variants. Spread across the schools below so the user sees a real choice.\n2. **For each direction, give:**\n - One-sentence pitch.\n - A flagship the user is likely to recognize (designer / firm / brand / institution).\n - 3 vibe keywords.\n - The interaction archetypes it fits.\n - One sentence on what it would mean concretely for this brief.\n3. **Build a 3-cell preview** — three minimal Subspaces (one Canvas each) the user can render. Don\'t produce finished work; the preview is a chooser.\n4. **Once the user picks, drop out of Advisor mode** and continue the workflow rooted in that direction.\n\n## Style declaration ritual — into DESIGN.md\n\nAfter the direction is picked, commit the system as named tokens in the project\'s [`DESIGN.md`](design-md.md) frontmatter (full schema there). Every subsequent choice cites a token by name; adding a value not already in the tokens requires adding the token first — that\'s what makes the system structural rather than aspirational.\n\n```yaml\nsystem: Swiss Editorial (Pentagram lineage)\narchetype: glance\ncolors:\n ink: "#1A1A1A" # body text — never pure black\n ground: "#F5F0E6" # default Canvas background\n accent: "#FF3C00" # callouts only — one per Canvas\ntype: # sizes in grid units\n display: { family: "<Brand Sans>", size: 16, weight: 400 }\n heading: { family: "<Brand Sans>", size: 8, weight: 400 }\n body: { family: "<Brand Sans>", size: 4, weight: 400 }\nspacing: { gap-s: 2, gap-m: 4, gap-l: 8, margin: 8 } # inter-Brick gaps come only from here\ngrid: lean # strict alignment, generous margins\nmotion:\n entrance: { ease: ease-out, ms: 280 }\n exit: { ease: ease-in, ms: 180 }\n loops: none\nheroes: [brand-logo, folio-num] # persist across Canvases → auto-tween (Truth #3)\n```\n\nThe grid itself is given by the runtime (Truth #6). What the tokens commit to is the set of design decisions on top of the grid: type scale, palette, **spacing scale in grid units** (small enumeration so inter-Brick gaps stay consistent across many siblings), grid stance, motion vocabulary, and hero Brick ids. DESIGN.md is not for the runtime; it is for *you*, when you next consider adding a third colour or a fourth gap value. Its existence is what holds the line.\n\n---\n\n## School 1 \xb7 Structural modernism\n\n### 1. Swiss Editorial (Pentagram / Vignelli lineage)\n\n- **Pitch:** Precision, authority, editorial gravity. Type, grid, hairline rule, restraint.\n- **Flagships:** Pentagram, Vignelli\'s Unimark, MIT Press canon.\n- **Keywords:** structural \xb7 monochrome \xb7 grid-disciplined \xb7 quiet.\n- **Fits:** glance / browse / monitor.\n- **BRICKS execution:**\n - Bricks: large RichText for headlines, smaller Text for body, hairline `Rect` rules (1–2 grid units tall), numbered RichText folios in a corner, `Image` bricks at controlled scale.\n - Heroes: brand wordmark or logo, numbered folio, masthead hairline rule — same id across Canvases.\n - Theme tokens (Data): two grounds (cream + ink), one accent reserved for callouts; single sans family declared as `ApplicationFont`.\n - Spacing scale: `2 / 4 / 8 / 16 gu`. Grid stance: **lean** (strict alignment, generous 4–8 gu margins, body columns at typeset widths).\n - Density rhythm: dense type Canvases broken by wide-margin breathers every 3–4 Canvases.\n - Motion: subtle vertical Standby on entrance (`ease-out` 280ms); shared headers across canvases via same-id Bricks; no `loop` animations.\n - Asset emphasis: real photograph or none; never decorative imagery; logo at restrained scale.\n- **Wrong for:** hospitality warmth, retail playfulness, ambient dwell loops.\n\n### 2. Bauhaus geometric (M\xfcller-Brockmann / Karel Martens lineage)\n\n- **Pitch:** Primary, architectural, confident. Geometry as the composition itself, not decoration.\n- **Flagships:** M\xfcller-Brockmann\'s Zurich Tonhalle posters, Paula Scher\'s Public Theater identity.\n- **Keywords:** geometric \xb7 primary-color \xb7 flat \xb7 rhythmic.\n- **Fits:** glance / dwell / monitor.\n- **BRICKS execution:**\n - Bricks: oversized `Rect` bricks as primary anchors (circles via `borderRadius`, squares, diagonals via `rotate`), `Text` bricks rotated 90\xb0 as composition elements, no photographic imagery.\n - Heroes: one or two large geometric anchors (circle, square, diagonal bar) that re-position and re-scale across Canvases via shared id — the geometry is *the* narrative.\n - Theme tokens: primary RGB or fluorescent accents (`#FF3C00`, `#0019FF`, `#F5E100`) on flat black or white; tri-color palette fixed in Data.\n - Spacing scale: `1 / 3 / 6 / 12 gu`. Grid stance: **lean** (geometric anchors snapped hard to grid).\n - Density rhythm: high-energy geometric Canvases alternating with declarative single-shape pause Canvases.\n - Motion: bold sweep entrances (400–500ms), shared-Brick auto-tween of geometric anchors across canvases.\n - Asset emphasis: logo, geometric forms, type-as-image; no scene photography.\n- **Wrong for:** corporate finance, hospitality, hi-fi product UI.\n\n---\n\n## School 2 \xb7 Quiet minimalism\n\n### 3. Kenya Hara emptiness (MUJI / Shiseido editorial lineage)\n\n- **Pitch:** Quiet, meditative, reverent, deliberately un-full.\n- **Flagships:** MUJI art direction, Shiseido editorial, Hara\'s own book design.\n- **Keywords:** generous-whitespace \xb7 monochrome \xb7 patient \xb7 reduced.\n- **Fits:** dwell / glance.\n- **BRICKS execution:**\n - Bricks: a single hero `Image` (real photo, never redrawn), one small `RichText` caption, lots of empty Canvas; `Slideshow` rotation slow (12–24s per item).\n - Heroes: the single hero `Image` shifts subtly in scale/position across Canvases (same id) — the photograph is the constant; everything else is breath.\n - Theme tokens: warm-white ground (`#F8F4ED` or similar), single warm-charcoal ink (never pure black), no accent color.\n - Spacing scale: `8 / 24 / 48 gu`. Grid stance: **breathe** (the grid is there but mostly unused; content islands placed with precision, 70–80% empty).\n - Density rhythm: every Canvas is low-density. Variation is in framing (top-third / bottom-third / centered isolate), not density jumps.\n - Motion: barely perceptible Standby (300–500ms delay, slow opacity easing); no `loop` animations.\n - Asset emphasis: photography is the work — Media Flow asset must score 9–10 on the 5-10-2-8 craft dimension; one image carries the canvas.\n- **Wrong for:** information-dense kiosks, transactional flows, dashboards.\n\n### 4. Dieter Rams industrial (Braun / Vitsœ / pre-2010 Apple)\n\n- **Pitch:** Useful, honest, restrained, quietly confident.\n- **Flagships:** Braun catalogs, pre-2010 Apple, Vitsœ.\n- **Keywords:** functional \xb7 tactile \xb7 unobtrusive \xb7 long-lasting.\n- **Fits:** glance / browse / monitor.\n- **BRICKS execution:**\n - Bricks: product `Image` as hero, sparse `RichText` specification blocks, hairline `Rect` grids separating spec columns.\n - Heroes: the product photograph itself — re-framed and re-scaled across Canvases via shared id; spec callouts are auxiliary.\n - Theme tokens: monochrome grey scale + one functional accent (used only where it means something — warning, primary action).\n - Spacing scale: `2 / 4 / 8 gu`. Grid stance: **lean** (tight, even, predictable; nothing breaks rank).\n - Density rhythm: even and measured across Canvases — no dramatic density jumps; pacing comes from Brick weight not layout shifts.\n - Motion: minimal — Standby with linear easing, no spring, no `loop`.\n - Asset emphasis: hero product photography first-class; spec icons as restrained line drawings.\n- **Wrong for:** consumer entertainment, maximalist branding, hospitality warmth.\n\n---\n\n## School 3 \xb7 Editorial and narrative\n\n### 5. Magazine editorial (NY Magazine / Bloomberg Businessweek lineage)\n\n- **Pitch:** Opinionated, layered, alive. Real editorial hierarchy.\n- **Flagships:** New York Magazine, Bloomberg Businessweek, The California Sunday Magazine.\n- **Keywords:** layered \xb7 photographic \xb7 type-driven \xb7 maximalist-typography.\n- **Fits:** dwell / browse.\n- **BRICKS execution:**\n - Bricks: oversized `RichText` display headlines (a strong serif), second sans family for body, `Image` bricks anchored to text columns, pull-quote `Text` bricks at 2\xd7 body scale, color-blocked `Rect` sidebars.\n - Heroes: masthead chrome (publication name + date), pull-quote container, hero photograph — all reposition across Canvases via shared id, giving the layered flip-through feel.\n - Theme tokens: photograph-driven palette, accent values pulled from the hero images themselves and bound as Data; rich supporting neutrals.\n - Spacing scale: `1 / 2 / 4 / 8 / 16 gu` (wider scale for editorial-style overlap and pull-quote breaks).\n - Grid stance: **lean** with deliberate overlaps — content sits on the grid but layers cross gutter lines.\n - Density rhythm: full-bleed portrait → text-heavy spread → pull-quote → image grid → breather — rotate hard, this language *needs* density variation.\n - Motion: rich Standby with stagger (50–100ms increments per Brick); shared chrome animates across canvases.\n - Asset emphasis: editorial-quality photography (full-bleed, scene, portrait); custom display serif as `ApplicationFont`.\n- **Wrong for:** short-attention-span interfaces, transactional kiosks, dashboards.\n\n### 6. Risograph zine (indie print lineage)\n\n- **Pitch:** Handmade, immediate, low-fidelity on purpose, warm.\n- **Flagships:** Independent zines, Rough Trade posters, skate-culture print design.\n- **Keywords:** risograph \xb7 two-color \xb7 textured \xb7 hand-placed.\n- **Fits:** dwell / browse.\n- **BRICKS execution:**\n - Bricks: 2–3 spot-color `Rect` grounds, slightly off-grid `Image` bricks (deliberate), `Text` in a distinctive display, halftone overlays as low-opacity `Image` bricks (texture asset in Media Flow).\n - Heroes: a distinctive display-type wordmark or a halftone-textured shape that re-stamps in different positions across Canvases — the hero feels stamped, not placed.\n - Theme tokens: risograph palette (flo-pink, teal, navy, mustard) — saturated, slightly imperfect overprints.\n - Spacing scale: deliberately irregular — `1 / 5 / 13 gu` (hand-placed feel; consistent within scale but not evenly stepped).\n - Grid stance: **break** (Bricks deliberately off-grid by 1–2 units, slight rotations, content kissing edges).\n - Density rhythm: chunky-and-busy alternating with stark single-image Canvases — the zine flip-through feel.\n - Motion: hand-placed feel via tiny rotations on Standby (`rotate: 1–2deg` baseline); avoid the runtime\'s polished auto-tween for primary entries — use `ease-linear` or even snap on Standby for some elements.\n - Asset emphasis: spot-color illustration, halftone texture, distinctive display type.\n- **Wrong for:** enterprise, premium, anything trust-seeking.\n\n---\n\n## School 4 \xb7 Motion and the digital-native\n\n### 7. Field.io motion poetics\n\n- **Pitch:** Alive, computational, mesmerizing. Motion is the medium.\n- **Flagships:** Field.io, Active Theory, Universal Everything.\n- **Keywords:** generative \xb7 motion-first \xb7 particle \xb7 light-as-material.\n- **Fits:** dwell / monitor (high-end).\n- **BRICKS execution:**\n - Bricks: dominant `Video` / `VideoStreaming` / `Lottie` / `Rive` / `GenerativeMedia` full-bleed; `RichText` overlays at delicate sizes with semi-transparent backgrounds.\n - Heroes: the brand reel / generative motion piece itself, full-bleed and persistent across Canvases — only the overlaid type changes; the motion is the throughline.\n - Theme tokens: dark indigo to electric gradient ground, or pure monochrome with one light-based accent.\n - Spacing scale: `2 / 8 / 24 gu` (delicate gaps for overlay type, large gaps for breathing room around full-bleed motion).\n - Grid stance: **breathe** — motion is full-bleed; UI sits on the grid but quietly.\n - Density rhythm: every Canvas is low-density overlay on full-bleed motion; variation is in *what the motion is doing* this Canvas, not in layout density.\n - Motion: slow continuous motion via `Animation` `runType: \'loop\'` — used sparingly, only on the hero. Cross-canvas transitions use shared-Brick auto-tween of full-bleed elements.\n - Asset emphasis: brand reel video and animated logo Lottie/Rive are first-class — preloaded via Media Flow, hash-verified, offline-safe; the canvas is *driven* by these assets.\n- **Wrong for:** content-heavy displays, purchase funnels, anything requiring careful reading.\n\n### 8. Brutalist web (Are.na / terminal lineage)\n\n- **Pitch:** Raw, direct, anti-polish, confident.\n- **Flagships:** Are.na, Bloomberg Terminal, deliberate "unstyled" indie sites.\n- **Keywords:** unstyled \xb7 monospace \xb7 text-dense \xb7 system-typography.\n- **Fits:** browse / monitor.\n- **BRICKS execution:**\n - Bricks: system-font `Text` and `RichText` only (or IBM Plex Mono / Times New Roman as `ApplicationFont`); dense `Items` lists with templated rows; hairline `Rect` borders only; no decorative imagery.\n - Heroes: a single persistent navigation bar or "you are here" address-style label, same id across Canvases.\n - Theme tokens: black on white, occasional single saturated accent, almost no gradients/shadows/rounded corners.\n - Spacing scale: `1 / 2 / 4 gu` (tight, monospaced character cell rhythm).\n - Grid stance: **lean** but ascetic — grid used as a literal table, no decorative breathing.\n - Density rhythm: uniformly dense — variation is in content depth, not visual density. This language earns its weight by *refusing* the density-rotation principle.\n - Motion: snap-cuts allowed and even welcome — but only as deliberate emphasis. Most transitions are shared-Brick auto-tween of typographic chrome.\n - Asset emphasis: type. That\'s it.\n- **Wrong for:** consumer retail, emotional storytelling, hospitality.\n\n---\n\n## School 5 \xb7 Expressive and experimental\n\n### 9. Sagmeister / experimental\n\n- **Pitch:** Provocative, hand-made, emotional, attention-grabbing. The concept drives every choice.\n- **Flagships:** Stefan Sagmeister, Paula Scher in expressive mode, Stefan Walz.\n- **Keywords:** expressive \xb7 hand-craft \xb7 concept-driven \xb7 theatrical.\n- **Fits:** dwell / glance (cultural / event contexts).\n- **BRICKS execution:**\n - Bricks: anything goes, but every choice serves the concept — `Sketch` for hand-drawn elements, sourced `Image` for hand-crafted typography photographs, `Text` bricks at extreme scale shifts via `rotate` and large grid frames.\n - Heroes: the conceptual centerpiece (a hand-crafted word, a built-physical-object photograph) re-staged dramatically across Canvases — different angle, different scale, different distance — same id.\n - Theme tokens: saturated, often clashing pairs used deliberately. No fear of "bad taste."\n - Spacing scale: deliberately broken — `0 / 7 / 23 gu` (the irregularity is the point; siblings still share the same set so it doesn\'t read as drift).\n - Grid stance: **break** — the grid is a foil to push against, not a rule.\n - Density rhythm: extreme oscillation between maximalist Canvases and empty-pause Canvases.\n - Motion: theatrical — long durations (600–1000ms), dramatic easing (`easeInOutBack`, `easeInOutElastic`), deliberate "broken" timings.\n - Asset emphasis: hand-craft photography, custom or modified type, conceptual imagery.\n- **Wrong for:** ongoing systems, B2B utility, any context demanding restraint.\n\n### 10. Y2K / futurist-retro\n\n- **Pitch:** Optimistic, technological, nostalgic-for-futures-past.\n- **Flagships:** Early-2000s tech branding, contemporary nostalgia revivals in fashion and music.\n- **Keywords:** chrome \xb7 bubble \xb7 glossy \xb7 iridescent.\n- **Fits:** dwell / interact (gaming / music / Gen Z contexts).\n- **BRICKS execution:**\n - Bricks: chrome-treatment `Image` bricks (sourced or brand-anchored generated); pixel/bitmap font as `ApplicationFont` (Departure Mono, VT323) for HUD overlays; scan-line overlay `Rect` bricks at low opacity.\n - Heroes: HUD frame chrome (scan-line overlay, corner brackets, status readout strip) — persistent across Canvases via shared id, the chrome *is* the throughline; content swaps inside the HUD.\n - Theme tokens: chrome / iridescence, acid green, electric blue, hot pink. Heavy gradients but in a meant-to-be-retro way (declared as Data tokens, never default web gradients).\n - Spacing scale: `2 / 6 / 12 gu` (HUD-style regular intervals).\n - Grid stance: **lean** — HUDs are precise; the chrome stays orthogonal even when content goes psychedelic.\n - Density rhythm: HUD frame is constant; inner content alternates between data-readout dense and hero-render isolate.\n - Motion: HUD-style entrances, cursor / scanner animations via `Animation`, pseudo-CRT glow via `Rect` shadow tokens.\n - Asset emphasis: chrome 3D renders, retro-tech imagery, bubble lettering.\n- **Wrong for:** trust-seeking finance, healthcare, enterprise.\n\n---\n\n## Combining language with archetype\n\nThe picked language constrains *expression*. The picked archetype constrains *structure*. They multiply, but with constraints:\n\n| Archetype | Naturally fits | Resistant to |\n|---|---|---|\n| Glance | Swiss Editorial \xb7 Bauhaus \xb7 Kenya Hara \xb7 Brutalist web | Field.io (motion competes with glance) \xb7 Sagmeister (concept needs dwell) |\n| Browse | Magazine editorial \xb7 Risograph \xb7 Brutalist web \xb7 Dieter Rams | Field.io \xb7 Y2K (too much motion noise) |\n| Interact | Dieter Rams \xb7 Swiss Editorial \xb7 Brutalist web \xb7 Y2K (gaming) | Kenya Hara (precious quiet doesn\'t survive a tap) \xb7 Sagmeister (instability discourages decision) |\n| Transact | Dieter Rams \xb7 Swiss Editorial | Field.io \xb7 Sagmeister \xb7 Y2K \xb7 Risograph (trust deficit) |\n| Monitor | Swiss Editorial \xb7 Bauhaus \xb7 Brutalist web \xb7 Dieter Rams | Magazine editorial \xb7 Sagmeister (decoration distracts from data) |\n| Dwell | Field.io \xb7 Magazine editorial \xb7 Kenya Hara \xb7 Sagmeister \xb7 Y2K | (any of the above can dwell; least natural is Brutalist web) |\n\nWhen the user picks an awkward combination ("transact + Sagmeister"), surface the tension explicitly. Either talk them into the natural pairing, or commit hard to the awkward one as a deliberate brand statement — but don\'t middle-ground it into mush.\n\n## Adapting and inventing\n\nThe 10 directions are anchors. Real work often blends — "Kenya Hara emptiness with one Risograph spot-color accent for the call-to-action" is a legitimate combination if executed deliberately. What\'s not legitimate is blending three to dilute commitment.\n\nWhen inventing a direction not in the library: write its system declaration into DESIGN.md as if it were one of the entries above (pitch / flagship / keywords / fits / BRICKS execution / wrong-for). If you can\'t, the direction isn\'t real yet — keep working on it before committing.\n',"bricks-design/references/design-md.md":'# DESIGN.md — the project\'s design-system artifact\n\nEvery BRICKS design project commits its system to a single durable file: **`DESIGN.md`**, at the project root. It is the source of truth for type, palette, spacing, motion, brand assets, and deployment context — written once in Pass 0, cited by every Brick afterward, and read back at the top of every later session.\n\nThe format rests on four ideas:\n\n1. **One named, durable markdown artifact** — not a system scattered across code comments that dies with the file. Markdown is the format an agent reads best; there is nothing to parse.\n2. **Named tokens in YAML frontmatter, referenced by name in the prose.** Declare `accent` once; write `{colors.accent}` everywhere. The body never restates a raw hex or size — one place to change, no drift.\n3. **Real design depth, not surface tokens.** Each token carries its *role* (which colour is CTA vs. body vs. hairline) and the system carries its *signature moves* (the one gesture that makes it recognisable) and the *why* behind each rule.\n4. **An agent guide** that tells the next agent how to *use* the file.\n\nThe nine-section schema below is the web-design convention reframed for BRICKS. BRICKS is a fixed-frame, grid-substrate, state-machine runtime, so three of the nine canonical sections are reframed rather than copied — see the mapping table. Importing web habits (breakpoints, scroll, CSS elevation) through this file is the fastest way to fight the runtime.\n\n## DESIGN.md replaces two older artifacts\n\nThis file is the merge point for what earlier versions of this skill kept apart:\n\n- The **style-declaration comment block** at the top of the Subspace file → its tokens move into the DESIGN.md frontmatter. The Subspace comment shrinks to a one-line pointer (see [\xa7 The Subspace pointer](#the-subspace-pointer)).\n- **`brand-spec.md`** → its asset bindings, score log, and gaps become the **Assets & Brand** sections of DESIGN.md. One artifact, not two. (The acquisition *protocol* still lives in [`when-the-brief-is-branded.md`](when-the-brief-is-branded.md); DESIGN.md is where its output lands.)\n\nA project has exactly one DESIGN.md. A multi-Subspace Application shares it; per-Subspace deviations are noted as scoped overrides inside it, never as a competing second file.\n\n## The nine sections, mapped to BRICKS\n\n| Web section | BRICKS section | Why it changes |\n|---|---|---|\n| Visual Theme & Atmosphere | **1. Visual Theme & Atmosphere** | Unchanged in spirit — adds the picked visual language \xd7 interaction archetype. |\n| Color Palette & Roles | **2. Colour Palette & Roles** | Colours used in 2+ places become theme-token Data bound via DataLink (Truth #2). |\n| Typography Rules | **3. Typography** | Sizes are **grid units**, not px. Families are `ApplicationFont` entries with a fallback ladder. |\n| Component Stylings | **4. Brick & Generator Stylings** | Bricks and Generators, not DOM components. Pressable affordance must read as visually distinct; Generators are headless/async (Truth #5). |\n| Layout Principles | **5. Grid, Spacing & Rhythm** | Frames are grid units (Truth #6). No scroll, overflow, or reflow (Truth #10). |\n| Depth & Elevation | **6. Motion, Standby & Depth** | No CSS z-index / box-shadow model. Depth = Brick draw order + Standby entrance offsets (Truth #7) + shared-id auto-tween (Truth #3). |\n| Do\'s and Don\'ts | **7. Do\'s & Don\'ts** | Each rule tied to what it protects; folds in this system\'s anti-slop. |\n| Responsive Behavior | **8. Hardware & Orientation** | **Not breakpoints.** Fixed target resolution + orientation; fleet variants are separate Canvas sets or device-scoped Data, never media queries. |\n| Agent Prompt Guide | **9. Agent Guide** | How to cite tokens, add tokens, and verify against this file. |\n\nTwo BRICKS-native sections have no web equivalent and sit up front: **Deployment Context** (captures Priority #0 durably) and **Assets & Brand** (the merged `brand-spec.md`).\n\n## Token-reference discipline — the load-bearing habit\n\nThis is what separates a system from an accumulation:\n\n- **Declare every reusable value as a named token in the frontmatter.** Reference it by name in the prose and in your reasoning: `{colors.ink}`, `{type.display}`, `{spacing.gap-m}`, `{heroes.brand-logo}`.\n- **Never restate a raw value in the body.** Writing `#1A1A1A` inline instead of `{colors.ink}` forks the source of truth; the next edit updates one and not the other.\n- **Adding a value not already in the tokens requires adding the token first.** Want a third colour or a fourth gap? Edit the frontmatter, then use it. The "first" is the whole mechanism — it forces a deliberate pause where averaging-toward-generic would otherwise sneak a value in.\n- **Sizes and gaps are in grid units (`gu`), never pixels.** The grid substrate is given by the runtime (Truth #6); the design sits on top of it.\n- **Shared colours (2+ uses) become theme-token Data** bound via DataLink, with the token name matching the DESIGN.md key. Single-use decorative colours may stay hardcoded (Truth #2 is loose by design).\n\n## The template\n\nCopy this verbatim into `DESIGN.md` and fill it. Every section is required; an empty section is a declared gap, not an omission.\n\n````markdown\n---\nname: <Application name> — design system\nsystem: <visual language, e.g. Swiss Editorial (Pentagram lineage)>\narchetype: <glance | browse | interact | transact | monitor | dwell>\n\ndeployment:\n hardware: <size \xb7 resolution \xb7 orientation \xb7 touch? \xb7 viewing distance>\n scene: <where the screen lives, what the user does in front of it>\n network: <always-on | intermittent | offline>\n languages: [<en>, <...>]\n peripherals: [<camera | BLE | MQTT | NFC | payment | printer | sensors | none>]\n watchdog: <fleet-managed | single-instance>\n\ncolors: # role in the comment; hex is the value\n ink: "#1A1A1A" # body text — deep, never pure black\n ground: "#F5F0E6" # default Canvas background\n accent: "#FF3C00" # callouts only — at most one per Canvas\n hairline: "#E3E0D6" # 1gu rules and card edges\n # forbidden: [<colours the brand explicitly never uses>]\n\ntype: # sizes in grid units (gu)\n display: { family: "<Brand Sans>", size: 16, weight: 300, tracking: -0.02 }\n heading: { family: "<Brand Sans>", size: 8, weight: 400, tracking: 0 }\n body: { family: "<Brand Sans>", size: 4, weight: 400, tracking: 0 }\n caption: { family: "<Brand Sans>", size: 3, weight: 400, tracking: 0 }\n\nspacing: # inter-Brick gaps come ONLY from this set (gu)\n gap-s: 2\n gap-m: 4\n gap-l: 8\n margin: 8\n\ngrid: lean # lean (strict align, generous margin) | break | breathe\n\nmotion: # Standby Transition vocabulary (Truth #7)\n entrance: { standbyMode: "<offset, e.g. translateY 4gu>", ease: ease-out, ms: 280, stagger: 40 }\n exit: { ease: ease-in, ms: 180 }\n loops: <none | only on {brick-id}>\n\nheroes: # Brick ids reused across Canvases → runtime auto-tweens them (Truth #3)\n - brand-logo\n - folio-num\n\nfonts: # ApplicationFont entries → Application.applicationSettings.fonts\n - { name: "<Brand Sans>", url: "<media-flow-or-cdn-url>", md5: "<optional>" }\n---\n\n# <Application name> — Design System\n> Captured: <YYYY-MM-DD> \xb7 Sources: <reference pages / Figma / brand book> \xb7 Coverage: <complete | partial | inferred>\n\n## Deployment Context\nThe five Priority #0 facts in prose, plus peripherals and watchdog. Every visual\ndecision below is downstream of these. If any of the first five was assumed rather\nthan confirmed, mark it **ASSUMED** here so the next agent knows what to re-check.\n\n## 1. Visual Theme & Atmosphere\nWhat the system *says* in two or three sentences. Name the picked **visual language**\nand **interaction archetype**, then the **signature moves** — the one or two gestures\nthat make this system recognisable at a glance (e.g. "oversized folio numerals + a\nsingle hairline rule per Canvas"). When unsure, commit *harder* to these, not softer.\n\n**Key characteristics:** 4–6 bullets, each a concrete, checkable rule.\n\n## 2. Colour Palette & Roles\nEach token by name with its job. Reference `{colors.<name>}` — never the raw hex.\n- `{colors.ink}` — body text on `{colors.ground}`. Deep charcoal, never pure black.\n- `{colors.accent}` — callouts and the single emphasis per Canvas. Never a body colour.\n- `{colors.hairline}` — 1gu rules, card edges.\n- Forbidden: <colours the brand never uses>, if any.\nShared colours bind as theme-token Data; note which here.\n\n## 3. Typography\n- Families and the **fallback ladder** — what to substitute when the licensed font is\n absent (e.g. "S\xf6hne → Inter weight 300 + tracking -0.02"). Declared as `fonts` entries.\n- Each role (`{type.display}` … `{type.caption}`) with size in gu, weight, tracking,\n and *where it is used*. Multilingual note: which scripts the families cover.\n\n## 4. Brick & Generator Stylings\n- **Pressable affordance** — how a tile that responds to a press looks different from a\n decorative one. A pressable that looks identical to d\xe9cor is a bug. (Wiring lives in\n `bricks-ux`; the *visual* distinction lives here.)\n- **Hero Bricks** — the ids in `heroes`, what each is, and how it reads across Canvases.\n- **Generator-driven components** — list / chart / feed surfaces fed by a headless,\n async Generator (Truth #5). Note their loading, empty, and error appearance.\n- **Media-bound Bricks** — every brand visual reads from Media Flow via DataLink (see\n Assets & Brand); none is drawn, embedded, or set to a literal path.\n\n## 5. Grid, Spacing & Rhythm\n- **Grid stance** `{grid}` — lean / break / breathe, and what that means in margins.\n- **Spacing scale** — inter-Brick gaps come only from `{spacing.*}`. Ten gaps of\n 7/9/11/13 across siblings is arithmetic drift; snap to the scale.\n- **Density rhythm** — how consecutive Canvases vary (not three identical layouts).\n- **No scroll, overflow, or reflow** (Truth #10). What does not fit does not show;\n design within the Canvas at the target resolution.\n\n## 6. Motion, Standby & Depth\n- **Standby Transition** `{motion.entrance}` / `{motion.exit}` — every visible Brick\n gets an entrance offset; the runtime auto-tweens in-flight motion (Truth #7).\n- **Shared-id auto-tween** — heroes keep their id across Canvases so position/size\n animate for free (Truth #3). This is the highest-leverage polish technique.\n- **Depth** is Brick draw order, not a z/shadow model. State the stacking intent.\n- **Snap-cuts** are reserved for emphasis (alarms), never routine navigation.\n\n## 7. Do\'s & Don\'ts\nEach tied to what it protects. Examples:\n- **Do** reserve `{colors.accent}` for one emphasis per Canvas — sparingness is the signal.\n- **Don\'t** soften the signature moves "to be safe" — at 30% the language reads hesitant.\n- **Don\'t** introduce a gap outside `{spacing.*}` — add the token first or don\'t add it.\n\n## 8. Hardware & Orientation\nNot breakpoints — BRICKS frames are fixed.\n- **Target** resolution and orientation (from Deployment Context). The design is built\n for this exact frame.\n- **Viewing distance → minimum legible size** in gu, especially for `glance` signage.\n- **Fleet variants** — if the same Application runs on differing resolutions, say how:\n a separate Canvas set, or device-scoped Data — *not* a media query or reflow.\n- **Language fit** — longest-string behaviour; the design must hold without overflow.\n\n## 9. Agent Guide\n- Reference tokens by name (`{colors.accent}`, `{spacing.gap-m}`); never inline a raw value.\n- To add any value, add the token to the frontmatter first, then use it.\n- Default body to `{type.body}`; default gap to `{spacing.gap-m}`.\n- The Subspace\'s top comment points here; do not re-declare the system inline.\n- Before declaring done, the design-critique pass cites this file section by section,\n and every Canvas screenshot is compared against the tokens here.\n\n## Assets & Brand\n(Merged brand spec — populated via the protocol in `when-the-brief-is-branded.md`.)\n\n### First-class assets\n- **Logo** — light / dark / mono → Media Flow IDs → Data keys (`brandLogoDark` …),\n clearspace, minimum size, source.\n- **Product / UI / scene photography** (per brand type) → IDs → Data keys, each with\n its 5-10-2-8 score `[R_ P_ B_ C_ N_ = _/10]`.\n- **Motion** — brand reel / animated logo → IDs → Data keys.\n\n### Voice & tone\nRegister, capitalization, banned phrases — a constraint on every user-visible Data string.\n\n### Gaps & placeholders\n`<category>: <why missing> → <ask user | generate-with-anchor | accept placeholder> [as of <date>]`\n\n### Score log\n`<asset>: R_ P_ B_ C_ N_ = _/10` for every non-logo asset.\n````\n\n## The Subspace pointer\n\nThe Subspace file no longer carries the full system as a comment. It carries a one-line pointer so a reader knows where the system lives and what it is at a glance:\n\n```ts\n/** System: Swiss Editorial \xb7 archetype: glance \xb7 tokens + assets in ../DESIGN.md */\n```\n\nIf a Subspace genuinely needs a scoped deviation (a darker ground for a single monitoring Subspace, say), note the override inside DESIGN.md under that Subspace\'s name and point the comment at it — never fork a second system silently.\n\n## How DESIGN.md threads through the workflow\n\n- **Pass 0** writes DESIGN.md: frontmatter tokens + Deployment Context + section 1 at minimum. ([`workflow.md`](workflow.md))\n- **Picking a visual language** fills sections 1–3 and `system`/`archetype`. ([`design-languages.md`](design-languages.md))\n- **Branded work** fills Assets & Brand and the colour/type/voice tokens. ([`when-the-brief-is-branded.md`](when-the-brief-is-branded.md))\n- **Variations** are alternate token sets, expressed as a flat preset map keyed to these tokens, not a second DESIGN.md. ([`variations-and-tweaks.md`](variations-and-tweaks.md))\n- **Verification & critique** read DESIGN.md back and check the rendered Canvases against it section by section. ([`design-critique.md`](design-critique.md))\n\n## Anti-patterns specific to DESIGN.md\n\n- **Inlining raw values in the body** instead of `{token}` references — forks the source of truth.\n- **A breakpoint table** in section 8 — that is a web habit; BRICKS frames are fixed (Truth #10).\n- **A CSS-style elevation model** in section 6 — depth is draw order + Standby, not z-index/shadow.\n- **Two artifacts** — a `brand-spec.md` *and* a DESIGN.md, or per-Subspace system blocks competing with the file. One project, one DESIGN.md.\n- **Writing DESIGN.md after the Canvases** — it is a Pass 0 commitment that the build cites, not a doc written to describe finished work.\n- **Tokens with no roles** — `accent: "#FF3C00"` with no note on what it is for is a swatch, not a system. The role is the design depth.\n',"bricks-design/references/performance.md":"# Performance\n\nSecond-order rules that keep a BRICKS Application fast on the actual hardware it deploys to (typically lower-spec than the developer's laptop) and resilient across watchdog reboots and offline windows.\n\n## Throttle at the Generator boundary\n\nA high-frequency source (sensor publishing at 100 Hz, MQTT firehose, LLM token stream) written directly to Data will fire `update` / `valueChange` events on every write. Every bound Brick re-renders. Every dependent DataCalc re-runs. The canvas chokes.\n\n**Throttle / aggregate inside the Generator**, not after.\n\n- For sensor / MQTT: cap the published rate in the Generator (sample to 1–10 Hz, or only emit on Δ).\n- For LLM streaming: write progressive deltas, but emit a `complete` event at the end and let downstream chains key off completion.\n- For HTTP polling: respect a backoff; don't re-emit identical payloads.\n\nIf the source is upstream of you (a Generator template you can't modify), insert a buffering DataCalc that publishes to a downstream Data on a rate-limited schedule.\n\n## Bound Data history explicitly\n\nData is not a time-series store. If a design needs \"the last N values\" (a chart series, recent log lines, a conversation history), keep an explicitly bounded array.\n\n- Use an `Iterator` Generator or a DataCalc that pushes new values and trims the head when length exceeds the cap.\n- Pick the cap to fit the *visible* need, not \"for safety\" — 60 points for a 60-second chart, not 10 000.\n- Unbounded arrays are a slow memory leak that watchdog will eventually paper over by killing the Application — and the user will see a reset they don't understand.\n\nFor longer-term history, push to a backend (Remote Data Bank, GraphQL, HTTP) via a separate Generator and treat the Data side as a recent-window cache.\n\n## `persistData: true` is for survival, not state\n\n`Data.persistData: true` causes the Data value to be persisted across launcher restarts. This is the right knob for:\n\n- Last-known-good content (the most recent fetched menu, the last cached weather payload).\n- Idempotency keys generated at flow start.\n- Locale preference and other long-lived configuration.\n\nIt is the *wrong* knob for transient flow state. A half-completed kiosk flow that survives a watchdog reset stuck in the middle is worse than a clean reset to Welcome. Default Path: keep flow Data ephemeral; reset on boot Canvas enter.\n\n## Boot Canvas must render in < 1 second using only cached/persisted Data\n\nThe boot Canvas is what the user sees on cold start, after a watchdog reset, after every fleet-managed reboot. It must:\n\n- Render *something* immediately, with no Generator success required.\n- Read from cached / persisted Data only — no synchronous network dependencies.\n- Provide a self-recovery path (Cancel / Restart accessible from any deeper Canvas) so users stuck in a half-completed Subspace can always return.\n- Reset all transient flow Data and Subspace state on entry.\n\n**Failure mode:** boot Canvas waits for an HTTP fetch to render its content; user sees a blank screen on offline cold boot.\n\n## `renderOutOfViewport: false` for legitimate off-grid Bricks\n\nBy default the runtime auto-culls Bricks fully outside the grid. For Bricks that intentionally sit partly off-grid (overflow effects, anchored at origin) the in-viewport portion still renders.\n\nIf you have a Brick that is *entirely* off-grid for design reasons (a parked element that animates in via Switch / DynamicAnimation), set `renderOutOfViewport: false` to make the cull explicit and reduce per-frame cost on canvases with many such elements.\n\nFor Bricks that are off-grid only momentarily during a transition, leave the default — culling mid-tween causes flicker.\n\n## Brick count discipline\n\nEvery Brick on a Canvas costs render budget; off-screen-but-on-Canvas Bricks still cost something. Lists of 100 small text Bricks for a daily schedule will outrun a low-spec signage panel.\n\n- Prefer **Items** Brick (virtualized) over hand-laid lists of repeating Bricks.\n- Prefer **fewer-bigger** decorative Bricks over **many-tiny** ones for purely visual texture.\n- Composite tiles often work better as a single Slideshow / Items frame than as N hand-positioned Brick groups per Canvas.\n\n## Offline-first wrap on every networked Generator\n\nThe standard wrap for any Generator that touches the network:\n\n1. **Cache layer** — read from local cache (DataBank, File Generator, persisted Data) before / instead of hitting network.\n2. **Fetch layer** — when network is up, fetch and update cache; emit `data updated` event.\n3. **Queue layer** — for writes (form submissions, payments), queue locally on offline; flush on reconnect with idempotency keys.\n4. **Status layer** — expose `network.online` and `data.lastSyncedAt` Data values for the UI to surface.\n\nDefault canvases read from the cache. Live fetches happen out-of-band; their results land in cache and trigger re-render via Data events.\n\n**Failure mode:** a Generator that fetches synchronously on Canvas enter and renders blank on failure. Every networked Generator without this wrap is an outage waiting to ship.\n\n## Media in Media Flow is local-first — image/video/Lottie/Rive does NOT break offline\n\nA common misread of \"offline-first\" is that media-rich designs (lots of images, video loops, Lottie / Rive animations, brand reels) are dangerous for offline deployments. **They are not.** Media bound through Media Flow is **preloaded** to the device at boot (or background-synced when Media Flow content updates) and served from local storage thereafter. Once cached, the media is available with no network at all — that is the whole point of Media Flow.\n\nThe mechanism:\n\n- Each Media Flow asset is referenced from the Subspace by a Data of `kind: { type: 'media-resource-image' | 'media-resource-video' | 'lottie-file-uri' | 'rive-file-uri' | ... }` with a `preload: { type: 'url', hashType, hash }` block.\n- The runtime's preload pass downloads every media asset referenced by the Application before letting the boot Canvas activate (or during a controlled progress state), and verifies integrity via the hash.\n- Subsequent renders read from the local cache; the original URL is no longer needed.\n- Cache survives watchdog restarts and reboots; `Application.runtimeCacheOptions` controls the policy.\n\nImplications for design:\n\n- **You can build heavy, image-rich, motion-heavy, video-driven Applications for fully-offline kiosks and signage.** The deployment doesn't lose anything by being offline; it loses something only if media isn't bound through Media Flow.\n- **Brick templates that consume Media Flow assets — Image, Video, Slideshow, Lottie, Rive, GenerativeMedia source bricks — are offline-safe by default**, as long as their `source` (or equivalent) binds to a Media Flow Data with `preload` metadata, not to an arbitrary external URL referenced inline.\n- **The offline-first wrap above is for Generators producing dynamic / runtime data** — current menu, train times, sensor readings, LLM responses, server-fed inventory. Not for design-time media. Don't conflate the two.\n- **Do not** drop image / video / motion bricks \"to be safe for offline\". The result is generic, text-only design that loses the brand and the polish for no real gain.\n\nThe two failure modes to actually worry about:\n\n1. **Inline URLs that bypass Media Flow.** A Brick prop set to a literal `https://...` image URL is fetched at render time; offline = blank. Bind via Media Flow Data, not inline strings. (Truth #2 + the asset protocol enforce this structurally.)\n2. **Generators that fetch *content* synchronously**, even when the bricks displaying that content are bound through Media Flow. The content fetch is what fails, not the rendering. Wrap those Generators per the section above.\n\nWhen unsure: ask \"is this binary baked into the Application via Media Flow, or fetched at runtime from a server?\" The first is offline-safe automatically; the second needs the wrap.\n\n## DataCalc trigger discipline\n\n`triggerMode: 'auto'` reruns the calc on every input change. With multiple inputs and multiple downstream consumers, an `auto` calc can fire dozens of times per logical update.\n\n- Use `auto` only when the calc is cheap and the consumers genuinely want every result.\n- For expensive calcs (collection reductions, large object transforms), use `manual` and trigger explicitly via `PROPERTY_BANK_COMMAND` from the relevant event chain.\n- Watch for circular dependencies: A's output is B's input is A's input. Auto mode will spin.\n\n## Animation budget\n\nStandby Transitions are nearly free. Continuous `loop` animations are not.\n\n- Reserve `runType: 'loop'` for genuine attention-draws: alarm pulse, recording-active indicator, \"scan in progress\" hint.\n- A Canvas with 5+ looping animations on idle bricks burns frame budget for no design payoff.\n- One orchestrated canvas-enter (staggered standby reveals) creates more delight than six scattered loops.\n","bricks-design/references/presentation-and-slideshow.md":'# Presentation and slideshow\n\nAnything that reads as "a sequence of states the viewer is walked through" — pitch deck, intro presentation, explainer, storyboard, training slides, demo flow, kiosk welcome loop, lobby showcase. The deliverable is a runnable Subspace, not a slide export. The frame is the Application\'s Canvas graph plus what moves across it.\n\nThe difference between a real designed presentation and "narrated PowerPoint in a Canvas wrapper" is whether anything *persists* across slides — visually, structurally, narratively. The runtime gives this for free via Shared Brick auto-tween (Truth #3); the design discipline is to use it as a narrative principle, not just a runtime fact.\n\n## Canvas-graph shape — pick one\n\nThree viable shapes. Pick once, before placing Bricks; the choice constrains everything downstream.\n\n### Shape A — Slideshow Generator (single Canvas, slides as Data)\n\n- One Canvas, one Slideshow Brick, slides as Data list (text content, image refs, timing). Optionally a small Generator that feeds the list from a remote source.\n- Identical or near-identical layout per slide — only content varies.\n- Fits: glanceable signage loops, ambient lobby content, menu rotations, training-slide loops, anything where rhythm is regular and structure is uniform.\n- Cost: cheapest to author and maintain. Adding a slide is adding a Data row.\n- Limit: every slide has the same Brick layout. No bespoke composition per slide.\n\n### Shape B — Multi-Canvas state machine\n\n- One Canvas per slide (or per scene). Bricks per Canvas can differ; hero Bricks share ids across Canvases for auto-tween.\n- Transitions are Canvas changes — auto-advance via timed Animation, gesture via `brick_press`, remote/keyboard via on-device DevTools, Data-driven via Switch on a `currentScene` value, external trigger via MQTT / BLE Generator.\n- Fits: pitch decks with bespoke layouts per slide, narrative arcs with chapter shifts, branching demos, interactive storyboards.\n- Cost: heavier to author — each Canvas is a real composition.\n- Win: every slide is its own designed thing while heroes (logo, headline word, brand chrome) carry continuity for free.\n\n### Shape C — Hybrid\n\n- A controlling Canvas with a Slideshow Brick for a linear sub-flow (intro montage, product gallery), bracketed by full Canvases for moments of bespoke composition (cover, chapter divider, finale, branching choice).\n- Fits: presentations with a regular middle and dramatic endpoints; explainers that loop a product gallery between narrative beats.\n- Cost: medium. The boundary between the Slideshow Brick\'s slides and the parent Canvases is the design decision worth thinking about — heroes should persist through both.\n\n### Decision rule\n\n```\nUniform layout, regular rhythm, content-driven? → Shape A (Slideshow Generator)\nBespoke layouts, narrative arc, hero continuity? → Shape B (multi-Canvas)\nRegular middle + dramatic endpoints? → Shape C (hybrid)\n```\n\nIf you find yourself wanting per-slide bespoke layout inside a Slideshow Brick, you\'ve outgrown Shape A — promote to B or C.\n\n## Navigation patterns\n\nHow does the viewer (or the runtime) move forward?\n\n- **Auto-advance** — an Animation drives a `slideIndex` Data forward on an interval; Switches on Canvas show/hide accordingly. Use for: signage loops, lobby content, ambient screens. Per-slide duration calibrated to the interaction archetype (glanceable: 3–5s; dwell: 8–15s; narrative read: 10–20s).\n- **Gesture** — `brick_press` on a thin left/right zone or full-Canvas `on_press`. Use for: interactive kiosks, touch-driven presentations. Make the affordance visible if the deployment is touch-capable; invisible zones on no-touch are pointless.\n- **Operator remote / keyboard** — via on-device DevTools or a companion app. Map to a `next` / `prev` action that increments `slideIndex`. Use for: pitch decks with a live presenter.\n- **External trigger** — MQTT / BLE / sensor / API Generator writes `slideIndex`. Use for: synchronized screens, event-driven storytelling, sensor-reactive displays.\n- **Data-progress-driven** — a `progress` Data crosses thresholds; Switches reveal scenes. Use for: progress meters, onboarding flows where steps are tied to actual state, not arbitrary advance.\n\n**Position memory:** if the deployment can resume (operator break, watchdog reset during a presentation), `persistData: true` on the slide-index Data. Note the trade-off — a watchdog reset half-way through a kiosk loop will resume mid-loop, which is usually wrong for ambient signage. Pick deliberately.\n\n## Visual rhythm and pacing\n\nThree Canvases with identical layout in a row is monotony. Three Canvases with wildly different layouts in a row is chaos. The work between those extremes is rhythm.\n\n### Density rotation\n\nAcross consecutive Canvases, alternate density. Eight layout archetypes worth rotating through:\n\n| Archetype | Use for |\n|---|---|\n| Full-bleed image | Cover, chapter break, emotional beat |\n| Big headline + thin body | Single-point slides, declarations |\n| Two-column comparison | Before/after, A vs B, our way vs their way |\n| Data-figure feature | Stat that needs to land |\n| Pull quote | Testimonial, principle, mantra |\n| Stepped list | Process, sequence, recipe |\n| Portrait + caption | Speaker intro, customer face |\n| Negative-space breather | Reset, transition, deliberate pause |\n\nIn a 10-Canvas deck, hit at least 5 different archetypes. Never three of the same archetype in a row.\n\n### Colour rhythm\n\nMostly your declared ground, occasional inverted Canvas (dark on light or light on dark) to punctuate chapter breaks, rare full-bleed accent to mark a hero moment. Don\'t alternate ground every Canvas — the rhythm collapses into strobe.\n\n### Pacing tied to archetype\n\n- *Glanceable*: 3–5s per slide; viewer catches one idea per moment. Heroes minimal — one image, one headline.\n- *Dwell* (lobby, ambient): 8–15s per slide; viewer absorbs slowly. Heroes can hold the screen.\n- *Presented* (live presenter): operator-driven, but design for ~30–60s per slide; presenter elaborates the Canvas. Heroes can be subtle persistents.\n- *Narrative read* (training, explainer): 10–20s per slide; viewer reads the Canvas in full.\n\n## Hero continuity — the narrative principle\n\nThis is what separates real presentation design from narrated PowerPoint.\n\nPick **one or two hero Bricks** — typically the logo lockup, a headline word, a product silhouette, or a brand chrome element. Give them the **same id** across every Canvas they appear on. Each Canvas is then a *transformation* of the hero\'s state (position, scale, opacity, rotation), not a new set of elements appearing and disappearing.\n\nThe runtime tweens position/size for free between Canvases when ids match (Truth #3). What the designer commits to is *which* Brick is the hero and how its journey reads across the sequence.\n\n**Pattern:** open with hero at full scale, centered. Chapter Canvases shrink/dock the hero to a corner as auxiliary content fills the Canvas. Chapter break enlarges/recentres the hero. Finale returns hero to opening scale. Heroes are the thread that makes the sequence feel like one designed thing.\n\n**Auxiliary Bricks** — content that only matters to one Canvas (one chart, one quote, one figure) — scope to that Canvas. They appear via Standby Transition and exit when the Canvas leaves. Heroes live above; auxiliaries cycle.\n\nThis eliminates the failure mode where every Canvas unmounts its entire Brick set and remounts a new one. That is the visual equivalent of slide cuts; runtime expense aside, it tells the viewer the design is a slide deck pretending to be an Application.\n\n## Anti-"narrated PowerPoint" rules\n\n- **No bare Canvas changes.** Every Canvas change has a hero that persists, or a deliberate snap-cut for emphasis. Never a full-set unmount + remount as routine navigation.\n- **Standby Transitions cross-fade, not gap.** Standby entrance starts before the previous Canvas\'s exit completes — overlap. A blank moment between Canvases reads as the runtime hanging.\n- **Per-Canvas content scoped to the Canvas.** Heroes parented above, in the shared id pool. Auxiliaries Canvas-local.\n- **No chrome contamination.** Page counters, progress bars, chapter numbers — if you need them, render them via the runtime\'s standby/auto-tween of a shared chrome Brick, not by drawing them into Canvas content. Better: drop them entirely unless the audience genuinely needs to know where they are.\n- **Motion vocabulary consistent.** One easing for routine transitions, one for emphasis, one for entry. Six different easings across ten Canvases reads as random.\n\n## Subtitle Brick rules (if narration is in scene)\n\nIf audio narration plays alongside the Canvas sequence:\n\n- Subtitle is a `RichText` Brick bound to a `subtitle` Data, updated by the Generator that drives narration.\n- Contrast: high enough to read against any ground used in the sequence (commit to it across all Canvases). If the chosen language requires light subtitles, hero photography must accommodate.\n- Length: max 12–15 characters per line; max 2 lines.\n- Line breaks at sentence boundaries (`。 ! ?` for CJK, `. ! ?` for Latin), never mid-clause.\n- No full-bleed background. A subtle drop shadow or text outline (via `RichText` styling) is enough — a black bar across the bottom reads as TV captioning, not design.\n- Standby Transition: fade in 200ms before the corresponding narration phrase, fade out 200ms after. Snap-cuts on subtitles look broken.\n\n## First-viewer reaction rubric\n\nUse this as a self-check before declaring a presentation done. Predict (or directly ask, if you can) the first reaction:\n\n- *"This is narrated PowerPoint."* — Redesign. Hero architecture is missing or broken. Likely full-set unmount per Canvas. Back to Pass 1.\n- *"Things were just moving."* — Motion is present but hierarchy isn\'t. Heroes exist but compete with auxiliaries. Quiet down everything except the hero.\n- *"I wanted to keep watching."* — Baseline good. Pacing works, hero continuity reads. Polish from here.\n- *"I wanted to screenshot that frame."* — Memorable keyframe achieved. At least one Canvas is doing more than its job. Don\'t disturb it; check the surrounding Canvases match the bar.\n\nA presentation that gets ≤ first reaction has a structural problem; a presentation that gets ≥ third has a craft problem at worst. Aim for fourth on at least one Canvas in any sequence ≥ 5 Canvases.\n\n## Anti-patterns specific to presentations\n\n- **Title-slide wrapper.** A "BRICKS Presentation v1" splash before the actual cover is wasted attention. Open in the work.\n- **Decorative bullet rows.** A list with an icon per row is rarely the design. Either commit to icons that mean something or drop them.\n- **Three "key benefits" Canvases in a row, same layout.** Density rotation broken.\n- **Animation `loop` everywhere.** One looped hero motion is fine. Looped sparkle on every accent is noise.\n- **Conventional "Thank You" finale Canvas.** Either make the finale carry weight (a callback to the opening hero state, a single declarative line, a quiet pause) or end on the last meaningful Canvas. A boilerplate close undoes the work.\n',"bricks-design/references/translating-inputs.md":"# Translating Inputs\n\nWhen the user arrives with a Figma render, an HTML mockup, a screenshot, a competitor URL, or a brand book, you are translating across an impedance mismatch. Web/Figma artifacts encode assumptions (scroll, hover, modal, semantic links, responsive reflow) that BRICKS does not share. Translate intent, not pixels.\n\n## Step 0 — visual inspection is mandatory and exhaustive\n\nYou cannot translate from material you have not actually seen. Markdown extractions, text summaries, and `llms.txt`-style indices preserve words and lose every visual signal that makes the reference design-relevant — hierarchy, rhythm, photography style, motion language, brand temperature, typography pairing, density, color weighting. Translating from those alone produces designs that miss the point.\n\nHard rule before any translation work begins:\n\n- **List every reference artifact** the user supplied (URLs, Figma frames, HTML files, PDFs, screenshots, videos).\n- **Visually inspect each** to completeness — every page, every frame, every state.\n- **State the coverage out loud** in your reply (\"inspected: home page, product page, 3 case-study pages, 12 Figma frames, all 8 PDF pages\") so the user can spot gaps.\n- If the host environment lacks the tooling to actually see something (no browser automation, no PDF rendering), **ask the user for screenshots before continuing**. Do not pretend.\n\nHow to inspect, by source type:\n\n| Source | How to actually see it |\n|---|---|\n| Public URL (website / docs / product page) | Drive a browser automation tool — browser-MCP, Playwright/Puppeteer-style MCP, an `agent-browser`-equivalent skill, or any host-provided browser tool — to navigate the page and capture full-page screenshots. Then read each screenshot back through the host's image-reading capability. `WebFetch` and similar text extractors are **not** visual inspection; use them only as navigation aids to enumerate which pages to visit. |\n| Figma / design-tool URL | Use a Figma-MCP / design-tool MCP if present to enumerate frames and image-export each. Otherwise ask the user for PNG exports of every relevant frame. |\n| HTML project on disk | Serve and screenshot every route via a browser tool, the same as a public URL. Do not infer visuals by reading source HTML/CSS — the rendered output is what you need. |\n| PDF / brand book / slide deck | Read every page through the host's PDF capability, page-by-page when the document is long. Cover all pages, not just the first few. |\n| Local images / screenshots | Read each via the image tool. |\n| Video walkthrough | Ask the user for key-frame screenshots, or to describe each state. Do not claim to have \"watched\" a video you cannot frame-step. |\n| Live competitor product / app | Run it (or have the user run it and capture screen recordings); inspect the screenshots/states. |\n\nIf a reference is partially inaccessible (paywalled page, unauthenticated content, broken link), name the gap explicitly. Don't extrapolate from the visible portion.\n\nInspection comes before everything else in this file. The translation table below assumes you have already seen every relevant frame.\n\n## A render is one state, not an Application\n\nMost translation mistakes start here. A Figma frame, a screenshot, an HTML page — each is a snapshot of one state. It is never an Application.\n\nBefore translating, identify:\n\n- **Which Canvas is this?** Welcome / browsing / editing / confirming / receipt / error?\n- **What Data drives the visible variation in this state?** Which strings, images, lists are dynamic vs. static?\n- **What other Canvases does this flow imply?** A \"submit\" button implies at minimum a result/confirmation Canvas. A list view implies a detail Canvas (or a Subspace overlay).\n- **What shared chrome carries across?** Logo, header, status bar — these become same-id Bricks across multiple Canvases for auto-tween.\n\nTranslating a single render verbatim into one Canvas with no state graph is the most common mistake when porting from web mocks. Don't.\n\n## Translation table — web/Figma → BRICKS\n\n### Scroll\n\nWeb overflow scrolling has no BRICKS equivalent. Pick one:\n\n- **Many items, lightweight, glanceable** → `Slideshow` Brick on a timed loop.\n- **Many items, user-driven browse** → `Items` Brick (virtualized list with templated row).\n- **Distinct content sections that don't fit one Canvas** → paginate across Canvases with shared chrome and a paging Brick.\n- **Long form** → Canvas-per-question (Truth #10).\n\nIf the source design relies on the user scrolling for hours of content, the information architecture needs a redesign before translation. Don't fake it.\n\n### Hover / focus / `:hover` styles\n\n- **Touch hardware** → hover doesn't exist; the design needs a touch target instead. Move the affordance to the resting state.\n- **No-touch hardware (signage)** → hover doesn't exist; either drop the affordance or convert to a Switch on a non-pointer Data signal (e.g., a peripheral sensor, a state Data toggled by a different Generator).\n- **Web focus rings** → focusable Brick prop where the brick template supports it (TextInput, etc.); for non-input bricks, drop or use Switch-driven outline.\n\nCarrying hover affordances into BRICKS is one of the loudest tells of a sloppy port.\n\n### CSS animations and transitions\n\nCSS keyframes are imperative; BRICKS animations are property-targeted (`transform.translateX | translateY | scale | scaleX | scaleY | rotate | rotateX | rotateY | opacity`) with timing / spring / decay configs.\n\nTranslate **intent**, not keyframes:\n\n- A CSS fade-in → a Standby Transition with `standbyOpacity: 0` and a delay.\n- A slide-in from the right → Standby with `standbyMode: 'right'` (or custom standbyFrame) and an x-axis easing.\n- A bounce → an `AnimationSpringConfig` with chosen friction/tension.\n- A continuous CSS pulse → an Animation with `runType: 'loop'` (use sparingly — see performance).\n- A page transition → shared-Brick auto-tween + entrance/exit Standby on non-shared elements (Truth #3 + #7).\n\n### Modal / dialog / popup\n\nWeb modals are usually overlays painted via z-index. In BRICKS:\n\n- **Always-on modal pattern (e.g., language picker that any Canvas can summon)** → Subspace with `portal: 'top' | 'left' | 'bottom' | 'right'` invoked from the host.\n- **Single-use confirmation in one flow** → a Canvas of its own. The design is a state; treat it as one.\n- **Inline reveal (e.g., expandable card)** → Switch-driven Brick visibility on the same Canvas. Don't reach for a Subspace for inline behavior.\n\n### Buttons, links, ARIA roles\n\nTranslation table:\n\n| Source | BRICKS |\n|---|---|\n| `<button>` (text only) | `BrickText` with `on_press` |\n| `<button>` (with bg, border, padding, icon) | `BrickRect` with `on_press`; children `pressable: 'bypass'` |\n| `<a href=\"...\">` | Same as `<button>` — there is no link primitive. `on_press` triggers `CHANGE_CANVAS` (internal) or a Generator (external) |\n| `<div role=\"button\">` | `BrickRect` with `on_press`; children bypass |\n| `aria-pressed` toggle | A toggle Data + Switch on the visual state |\n| `:hover` | Drop on no-touch; convert to a touch state on touch HW |\n| `:focus` | Focusable Brick prop where supported |\n| `:disabled` | Switch on a `disabled` Data; alter visual + set `pressable: 'disabled'` |\n\nSee [`pressable-composition.md`](pressable-composition.md) for the failure modes around composite buttons.\n\n### Form fields / inputs\n\n- Single text input → `BrickTextInput` bound to a Data via DataLink.\n- Long form → Canvas per question (Truth #10), not a scrolling form.\n- Validation → DataCalc producing a `<field>.valid` Data; Switch on the field's appearance to surface error state.\n- Submit → event chain that runs the submission Generator (with idempotency key from Data) and CHANGE_CANVAS to a result Canvas; never a synchronous wait.\n\n### Lists / grids / repeating cards\n\n- Static list (≤ 5 items, never changes) → hand-laid Bricks.\n- Dynamic list, glanceable → `Slideshow` (timed) or `Items` (interactive).\n- Long, browse-heavy → `Items` Brick with templated row Brick; bind `data` to a Data array.\n\n### Images, fonts, video, brand binaries\n\nLift to **Media Flow** at translation time. Do not embed base64 in Brick props or paste binaries into the Subspace file.\n\n- Images → Data of `kind: { type: 'media-resource-image' }`, referenced by Bricks via DataLink.\n- Fonts → `ApplicationFont` entries in the Application; declare in `applicationSettings`.\n- Video / Lottie / Rive → corresponding `media-resource-video` / `lottie-file-uri` / `rive-file-uri` Data with preload metadata.\n\nWhen the source contains brand binaries, you are inheriting them — but only at the resolution and quality the source happened to embed, which is often insufficient for the deployment. **Hand the brand-binary work off to the asset protocol** in [`when-the-brief-is-branded.md`](when-the-brief-is-branded.md) rather than translating the visual reference directly into the Subspace as a redraw:\n\n- A logo you can see in the Figma mockup is not the logo you ship — go acquire the official high-resolution source through Step 2/3 of the asset protocol.\n- A product photo embedded in the HTML mockup is the *placeholder* the source designer used; verify it's the brand-current canonical asset before binding, and source a higher-resolution version if the embedded one is below the 5-10-2-8 bar.\n- A redrawn-in-Figma logo or product silhouette in the source design is a tell that the source designer didn't have the real asset either — start the asset hunt from scratch, don't carry the redraw across.\n- Embedded brand fonts may not be license-cleared for embedded display use; verify the license and switch to a documented alternative if the constraint isn't met.\n\nScore everything against 5-10-2-8 before binding. If the source's brand binaries are unclear, low-resolution, or stylized substitutes, surface as a gap under DESIGN.md's **Gaps & placeholders** and either acquire properly or — for non-logo categories — escalate to brand-reference-anchored generation per [`when-the-brief-is-branded.md`](when-the-brief-is-branded.md). **Don't ship Sketch-Brick imitations.**\n\n### Brand colors and tokens\n\n- A few colors used in many places → a small set of Data entries acting as theme tokens, bound via DataLink. Worth the indirection.\n- One-off decorative color → hardcode (Truth #2's loose convention).\n- Token system from a brand book (light / dark / accent / semantic) → expose as Data tokens; switch theme by writing to the token Data values.\n\nExtracted colors, type, and spacing become the named tokens in [`DESIGN.md`](design-md.md) (referenced by name thereafter), so the translated system is captured once rather than re-derived per Canvas.\n\n### Long copy / paragraphs\n\n- A signage screen at 5 m has time for one claim. If the source design has paragraphs of body copy, the design is wrong for the deployment, not the runtime.\n- Cut copy until the screen reads in under 2 seconds.\n- For genuinely long copy (terms of service, instructions), Canvas-per-section + a paging Brick beats fake scrolling.\n\n## Order of operations for a porting task\n\n1. **Verify deployment context** (Priority #0 in SKILL.md). Don't translate before knowing the screen size and orientation; you'll waste the translation.\n2. **Map the source to a Canvas graph.** Sketch which states exist; identify shared chrome.\n3. **Lift binaries to Media Flow.** Don't translate with embedded data; it pollutes the Subspace.\n4. **Walk per-Canvas.** For each Canvas, translate elements via the table above. Make explicit pressable decisions for every interactive element.\n5. **Wire the state machine.** Event chains for transitions; shared-Brick ids for chrome continuity; Standby for entrances.\n6. **Verify against the actual deployment** (see `bricks-ctor/rules/verification-toolchain.md`). The translation is done when it runs on the target hardware, not when it looks right in the Electron preview.\n","bricks-design/references/variations-and-tweaks.md":"# Variations and tweaks\n\nTwo different concerns that look similar from a distance and ruin each other when conflated.\n\n- **Exploration variations** — agent offers the user 2–3 directions to compare during the design phase, picks one, the others are discarded. Lives outside the deployed artifact.\n- **Production tweakability** — knobs the operator or environment will actually change once the Application is deployed (locale, theme accent for franchise variants, content feed URL). Lives in Data, with discipline.\n\nKeep them separate. The deployed Application is not a palette picker. The exploration phase is not a Data-knob proliferation event.\n\n## Why no on-Canvas variation picker\n\nReference design skills built for unbounded HTML put palette pickers and tweak panels in the artifact corner — the user is at a desktop browser, the panel is welcome. BRICKS deliverables run on target hardware (kiosk, signage, lobby screen). An in-Canvas palette picker is design contamination — a tweak UI bolted into the design, same category as decorative page counters or progress chrome.\n\nThe comparison surface for exploration variations is **chat and source tree**, never the Canvas.\n\n---\n\n## Exploration variations — three patterns, token-cost order\n\nDefault to **Pattern 1**. Escalate only when the variation can't be expressed by the cheaper pattern.\n\n### Pattern 1 — Data-preset variations (default, cheapest)\n\nUse when variations differ only on values: palette, copy, asset paths, density factor, type tokens, brand text, motion timing constants.\n\n**Shape:**\n\n- One Canvas / Subspace. All variant-specific values are Data with initial constants.\n- Source has a `VARIATION_PRESETS` map near the top of the Subspace define file. Each preset is a flat map of the DESIGN.md token keys (`ground`, `ink`, `accent`, `gap-m`, …) — a variation is one alternate token set, not a second DESIGN.md. Keep the map flat — nested config trees make per-preset diffs noisy.\n- Active preset is selected by a single line near the top: `const ACTIVE = PRESETS.bauhaus`. Agent flips this line, runs preview, captures screenshot, repeats.\n- All hero Bricks keep **the same id** across all presets — preserves Shared Brick auto-tween if the user later wants to A/B them at runtime in a settings Canvas (different use case, but the door stays open).\n\n**Comparison surface:** screenshot grid in chat reply, captioned with preset name + key choices.\n\n**Token cost:** 1 Canvas tree + ~10 lines per preset. A 3-variation comparison ≈ `1 \xd7 Canvas + 30 \xd7 preset lines`, not `3 \xd7 Canvas`.\n\n**Example skeleton:**\n\n```ts\nconst PRESETS = {\n bauhaus: { ground: '#FFFFFF', ink: '#1A1A1A', accent: '#FF3C00', font: 'Inter', density: 1.0 },\n hara: { ground: '#F8F4ED', ink: '#2A2A28', accent: undefined, font: 'Noto Serif', density: 1.4 },\n brutal: { ground: '#000000', ink: '#00FF00', accent: undefined, font: 'IBM Plex Mono', density: 0.8 },\n}\nconst ACTIVE = PRESETS.bauhaus // ← agent flips this one line per variation\n```\n\nBricks read from `ACTIVE.ground` / `ACTIVE.ink` etc. via Data. The Canvas tree is authored once.\n\n### Pattern 2 — Shared module + variant Subspaces (medium)\n\nUse when variations share most of the Brick tree but differ on a chunk that can't be expressed as Data — different motion language, different hero element identity, different Canvas-graph rhythm, different Standby Transition feel.\n\n**Shape:**\n\n- A shared module (a Subspace-as-typed-module per Truth #8) exports the common Brick definitions, hero ids, and Data shape.\n- Each variant Subspace imports the shared module and overrides only the variant-specific chunk.\n- Bricks reused by reference, not duplicated.\n\n**Comparison surface:** screenshot per variant via the available preview tool, assembled in chat.\n\n**Token cost:** 1 shared module + N small variant Subspaces.\n\n**Caveat:** if the project's Subspace composition support is limited (some setups don't allow clean cross-Subspace imports of partial Brick trees), escalate to Pattern 1 with a Data-driven Switch on the variant-distinguishing chunk before falling all the way to Pattern 3. A few Switches and a single extra Data value can absorb a surprising amount of \"structural\" difference.\n\n### Pattern 3 — Separate Subspaces (heaviest, justified case only)\n\nUse when variations differ structurally — Canvas-graph shape (Slideshow vs state-machine vs hybrid), interaction archetype, fundamentally different Brick tree, fundamentally different Data shape.\n\n**Shape:** one Subspace per variation, each stands alone. Previewed individually via the project's Subspace switcher.\n\n**Comparison surface:** chat with screenshots from each Subspace.\n\n**Token cost:** full Subspace \xd7 N. Justified only because the variations *aren't* variants of one design — they're different designs.\n\n### Decision rule\n\n```\nDiffers only in token values? → Pattern 1 (Data presets)\nDiffers in some Brick subtree but\n shares most + same Canvas-graph shape? → Pattern 2 (shared module)\nDiffers structurally / different shape or archetype? → Pattern 3 (separate Subspaces)\n```\n\nDefault escalation: Pattern 1 first. Move up only when the cheaper pattern would lie about what's varying.\n\n## Token-saving discipline\n\n- **Hero ids identical across presets** — same Brick tree, only Data values differ. Token diff is small; auto-tween stays available for any later A/B Canvas.\n- **Flat preset maps** — each preset is a single object literal, all keys at one depth. Easier to diff, cheaper to edit per variation.\n- **Don't author 3 showcase Canvases inside one Subspace** to compare — triplicates Brick trees for no gain over Pattern 1 + screenshot grid. The temporary-showcase Subspace pattern survives only as a fallback when the user wants to physically walk between variations on real hardware, on explicit request.\n- **Don't escalate proactively** — agent's instinct will be to \"just build it three times so the user sees three real things.\" That's the expensive path. Pattern 1 + a screenshot grid is the same review experience at a fraction of the cost.\n\n---\n\n## Production tweakability — the knob filter\n\nAfter variations are picked and the production Subspace exists, the question is what should stay user-tweakable in deployment. A Data knob has cost — Generator wiring, history bound, persistence behaviour to reason about, every consumer needs an event handler. The bar is **concrete scenario**, not \"maybe someone wants to change this.\"\n\n**Passes the filter (becomes a Data knob):**\n\n- **Operator-controlled in deployment** — locale switch on a multilingual kiosk, theme accent for franchise variant, content feed URL for menu boards, store hours, item availability.\n- **Environment-driven** — sensor / time-of-day / network state already arriving via a Generator.\n- **Per-instance branding** in fleet deployments where one Subspace serves N venues.\n- **i18n strings** — visible text in a Subspace bound for multilingual deployment, even when only one language is populated at first.\n\n**Fails the filter (hardcode it):**\n\n- Stuff the agent explored during design but the operator won't touch.\n- \"Maybe in the future.\" Three hardcoded lines beat one Data wire until the future arrives.\n- Tweaks meant for the designer's own iteration loop — that's what source edits and Pattern 1 are for, not Data.\n- Speculative theming. If there's no franchise / no white-label requirement, don't make the palette a Data knob.\n\nWhen in doubt, hardcode. Adding a Data knob later is a small refactor; removing one once consumers exist is a big one.\n\n## Anti-patterns\n\n- **In-Canvas palette pickers / colour swatches / \"choose your theme\" buttons as a deliverable feature.** Same category as page counters drawn into Canvas content. Allowed only as a literal settings Canvas in a settings Subspace, which is a different use case entirely.\n- **Demo-mode toggles left in production code.** Strip them before declaring done.\n- **Three showcase Canvases inside the production Subspace just for variation review.** Triplicates Brick trees. Use Pattern 1 + screenshot grid.\n- **Speculative Data knobs.** Every Data knob without a named operator scenario is dead weight that complicates the next change.\n- **Pattern-3-by-default** because \"the user wants to see real options.\" User wants to see differences, not duplicated effort. Show differences via Pattern 1.\n- **Triplicated Canvas trees + variant-specific Subspaces for what's actually a palette difference.** Always check: could this be a flat preset?\n- **Forgetting to delete the losing presets after pick.** The production Subspace ships with one preset, hardcoded. The `VARIATION_PRESETS` map is exploration scaffolding, not a runtime selector.\n","bricks-design/references/when-the-brief-is-branded.md":"# When the Brief is Branded — Media Flow Protocol\n\nBrand fidelity is *the* differentiator on branded scene work. Every branded BRICKS deployment that \"looks generic\" got there by skipping the asset hunt and going straight to colors-and-fonts. Most agent-produced branded work fails at the same stop: the agent describes assets it should have, then proceeds to design without acquiring them.\n\nThis file is operational, not aspirational. It tells the agent **what to actually do**, with concrete recipes, a quality bar with named dimensions, structural enforcement that prevents redraw shortcuts, and a sanctioned path for *creating* assets when none exist — by composing the host environment's image / motion generators, not by drawing in Sketch.\n\nIn BRICKS, brand binaries live in **Media Flow** and are referenced from Subspaces by Data of `kind: { type: 'media-resource-image' | 'media-resource-video' | 'media-resource-audio' | 'media-resource-file' | 'lottie-file-uri' | 'rive-file-uri' | 'binary-asset' }`. **Never embed brand binaries inline in Brick props.** The Application config travels light; binaries refresh on a different cadence; reuse demands an indirection.\n\n**Media Flow is offline-safe by design.** Assets bound this way are preloaded to the device with hash-verified integrity and served from local storage thereafter. Image, video, Lottie, Rive, brand reels — none of these are \"offline risk\" categories when bound correctly. Do not water down a branded design with text-only fallbacks because the deployment is offline; richness through Media Flow is precisely how the runtime supports offline-first scenes. (See [`performance.md`](performance.md#media-in-media-flow-is-local-first--imagevideolottierive-does-not-break-offline) for the full mechanism.)\n\n## Asset categories — first-class vs. auxiliary\n\nThe single most common branded-work failure: agent collects colors and fonts, calls it a brand spec, and ships generic-looking output. Brand identity is *recognized*, not *measured* — and recognition runs on:\n\n| Asset type | Recognition contribution | Required when |\n|---|---|---|\n| **Logo** (vector, light + dark + mono) | Highest — any scene with a logo is instantly identifiable | Always, for any branded work |\n| **Product photography** (real renders, multiple crops) | Very high — physical products are recognized by themselves | Physical-product brands (hardware, consumer goods, hospitality, retail) |\n| **UI screenshots** (real captures, current version) | Very high — digital products are recognized by their interface | App / SaaS / dashboard / portal brands |\n| **Scene / lifestyle photography** (brand-shot, real venues) | High — sets the brand's environmental temperature | Hospitality / retail / experiential / real-estate brands |\n| **Motion assets** (brand video, Lottie, Rive) | High — BRICKS canvases are time-based; brand motion is first-class | Any brand with extant motion identity (launch films, brand reels, animated logos) |\n| **Color palette** | Medium — supporting role; orphans without the above | All work |\n| **Typography** | Medium — supporting role; same caveat | All work |\n| **Voice & tone** | High where used (constraint on visible Data) | Where copy is non-trivial |\n\n**Rule that follows:** acquiring colors and fonts only — without logo / product / UI / motion — is **not** a brand spec. It is a partial spec at best. Surface the missing categories as gaps before you start designing.\n\n## The acquisition flow — five steps, each with concrete actions\n\n### Step 1 — Ask, with a full checklist\n\nDon't ask \"do you have brand guidelines?\". That gets a yes from people who only have a logo and a hex code, and the gap stays invisible until you're already designing. Ask explicitly, in one batch:\n\n```\nFor <brand>, do you have any of these? (priority order)\n 1. Logo — vector source (SVG / AI / PDF) or high-res PNG. Light + dark + mono variants ideal.\n 2. Product photography (physical brands) — official renders or real photos, multiple crops.\n 3. UI screenshots (digital brands) — current-version captures of key screens.\n 4. Scene / lifestyle photography (hospitality / retail / experiential).\n 5. Motion assets — brand films, animated logos, Lottie / Rive files.\n 6. Brand colors — palette + usage rules.\n 7. Brand fonts — files licensed for embedded display, or named alternatives.\n 8. Brand book / design system / voice guide.\n\nSend what you have; I'll source the rest from official channels and tell you what's missing.\n```\n\n### Step 2 — Search official channels first\n\nBefore any aggregator:\n\n| Asset | Primary channels |\n|---|---|\n| Logo | `<brand>.com/brand`, `<brand>.com/press`, `<brand>.com/press-kit`, `brand.<brand>.com`, the live site's header inline-`<svg>` |\n| Product photos | `<brand>.com/<product>` hero + gallery, official launch films (capture frames), official press releases |\n| UI screenshots | App Store / Play Store product page captures, the live site's screenshots section, official demo videos (capture frames) |\n| Scene / lifestyle | Brand campaign archive on the live site, brand's official social media accounts |\n| Motion | Brand's official YouTube channel, brand's launch microsites, the brand's own design-system Lottie library |\n| Colors | Brand book PDF, brand design-system repo, the live site's CSS variables / Tailwind config |\n| Fonts | The live site's `<link rel=\"stylesheet\">` references, Google Fonts trace, brand book |\n\n**`WebSearch` fallback queries** when official is dry:\n- `<brand> logo download SVG`, `<brand> press kit`\n- `<brand> <product> official renders`, `<brand> product photography hi-res`\n- `<brand> app screenshots`, `<brand> dashboard UI`\n- `<brand> launch film`, `<brand> brand reel`\n\nAggregators (Brandfetch, Logo.dev, etc.) are placeholders, not sources of truth. When you use one, label it as such in the spec and continue searching for the official source in parallel.\n\n### Step 3 — Acquire, with three fallback paths per category\n\nEach category has a fallback ladder by yield. Walk down the ladder; don't stop on the first hit.\n\n#### Logo — never approximate\n\n1. Independent SVG / PNG file from the brand's press kit.\n2. Inline `<svg>` extracted from the official site's HTML (`curl -A \"Mozilla/5.0\" -L <url>` then locate the logo node).\n3. Official social-media avatar (typically 400\xd7400 or 800\xd7800, transparent PNG) — last resort.\n\nIf all three fail: **stop and ask the user**. A logo is not optional; it's the recognition root. Do not draw a Sketch-Brick imitation. Do not generate a \"logo-shaped\" thing with AI. Either acquire a real logo or escalate the gap.\n\n#### Product photography (physical brands)\n\n1. Official product page hero image — usually 2000 px+; fetch directly.\n2. Official press kit / brand center — often the highest resolution available.\n3. Official launch video frame-grab — for products with strong launch content. Use the host's video tools or extract via `yt-dlp` + `ffmpeg` if available.\n4. Wikimedia Commons — public-domain or freely licensed for some products.\n5. **AI generation, brand-anchored** — see [\xa7 Creating assets when missing](#creating-assets-when-missing). Allowed only as a last resort and only with the discipline below.\n\n#### UI screenshots (digital brands)\n\n1. App Store / Play Store product captures (verify they're real screenshots, not mockup-generator output).\n2. The live site's screenshots section.\n3. Demo-video frame-grabs.\n4. The brand's own social posts at recent product launches (often the freshest captures).\n5. The user's own account, captured live. Most accurate when the user has access.\n\n#### Scene / lifestyle photography\n\n1. Brand campaign archive on official channels.\n2. Authorized licensed library (Getty / brand-specific contracted libraries) where the user has access.\n3. AI generation with reference anchoring — last resort.\n\n#### Motion assets\n\n1. Brand's official channel (YouTube, Vimeo) — download with permission, frame-grab where embedding the full clip is overkill.\n2. Lottie / Rive files in the brand's design-system repo, where they exist.\n3. AI motion generation with reference anchoring — last resort, very high failure rate, expect to discard 9 of 10 candidates.\n\n#### Colors and fonts (auxiliary)\n\n- Colors: brand book → live-site CSS → sampling from official imagery (last resort, document the sample point).\n- Fonts: brand-issued license + files → documented alternative if the license isn't available → closest licensed family with a note.\n\n### Step 4 — Score every asset against the 5-10-2-8 bar\n\nThe bar exists because cosmetic-quality drift is invisible until shipped, then obvious. Without it, the agent rates every found asset 8/10 and the floor sinks.\n\n**Quantity bar:** search **5** rounds across multiple channels; collect at least **10** candidates per non-logo category before filtering; keep **2** winners; each scoring **≥ 8/10**.\n\n**Quality dimensions** — for each candidate, score 0–10 on each, take the average. Below 8 → discard or use as a labeled placeholder. Logo is exempt from this filter (any real logo beats no logo).\n\n| Dimension | What 8+ looks like | What's a deduction |\n|---|---|---|\n| **Resolution** | ≥ 2\xd7 the largest render size; for signage / 4K / print ≥ 3000 px on the long edge | Pixelation visible at target render scale; aliasing on transparent edges |\n| **Provenance** | Official source, dated, license-clear; press-kit asset > brand-controlled aggregator > public-domain repository | Aggregator-only, undated, or third-party-redistributed; suspected scraped copy |\n| **Brand fit** | Matches the spec's vibe keywords; matches campaign era you're working from | Off-era (2018 logo for a 2024 rebrand); wrong product variant; sub-brand bleed |\n| **Composition / craft** | Lighting, framing, background all consistent with the rest of the asset set | Mixed lighting across \"set\"; orphan background colors; visible artifacts |\n| **Narrative weight** | Carries one story alone; can be a hero on its own merits | Only works as decoration / filler; needs surrounding chrome to read |\n\n**Logging the scores** under DESIGN.md's **Score log** (per category) is what makes the bar real. If you didn't log a score, you didn't apply the bar.\n\n### Step 5 — Bind into Media Flow + record in DESIGN.md\n\nUpload acquired assets into a Media Flow workspace (use the host's Media Flow MCP tools where available — `list_media_workspaces`, `get_media_workspace`, `media_box_upload`, `update_media_file_meta`). Reference each from the Subspace via Data with the appropriate `kind`:\n\n- Image → `kind: { type: 'media-resource-image', preload: { type: 'url', hashType, hash } }`\n- Video → `media-resource-video`\n- Audio → `media-resource-audio`\n- Lottie → `lottie-file-uri`\n- Rive → `rive-file-uri`\n- General binary → `media-resource-file` or `binary-asset`\n\nBricks bind via DataLink: `Image.property.source = linkData(() => brandLogoData)`. Refreshing an asset is a Media Flow operation; the Subspace doesn't need to know the URL changed.\n\nFonts: declare each as an `ApplicationFont` entry in `Application.applicationSettings.fonts` (`name`, `url`, optional `md5`). Reference by name in Brick `property.fontFamily`.\n\nThe brand spec is **not** a separate file — it is the **Assets & Brand** sections of the project's [`DESIGN.md`](design-md.md), alongside the colour/type/voice tokens. Use this structure verbatim under DESIGN.md's `## Assets & Brand` heading — every section is required, even the gap section:\n\n```markdown\n## Assets & Brand\n> Captured: <YYYY-MM-DD>\n> Sources: <list>\n> Coverage: <complete / partial / inferred>\n\n### First-class assets\n\n#### Logo\n- Primary (dark ground): <Media Flow ID> → Data: brandLogoDark\n- Primary (light ground): <Media Flow ID> → Data: brandLogoLight\n- Mono / reverse: <Media Flow ID> → Data: brandLogoMono\n- Clearspace: <e.g., 1\xd7 cap-height>\n- Minimum size: <e.g., 96 px wide>\n- Source: <press-kit URL / inline-svg from <url> / file from user>\n\n#### Product photography (if physical brand)\n- Hero front: <Media Flow ID> → Data: productHero (3000\xd72000, transparent) [score: R9 P9 B8 C9 N9]\n- Detail crop A: ... [score: ...]\n- Scene context: ... [score: ...]\n\n#### UI screenshots (if digital brand)\n- Home: ... [score: ...]\n- Core feature A: ... [score: ...]\n\n#### Scene / lifestyle (if relevant)\n- ...\n\n#### Motion\n- Brand reel clip: <Media Flow ID> → Data: brandReel (1920\xd71080, 12s, h264)\n- Animated logo: <Media Flow ID> → Data: brandLogoLottie\n\n### Auxiliary\n\n#### Colours\nThe palette lives in the DESIGN.md frontmatter `colors` tokens (shared ones bound as theme-token Data). Record provenance and constraints here:\n- `{colors.primary}` / `{colors.accent}` / neutrals — source: <where each was sampled / documented>\n- Forbidden: <colours the brand explicitly does not use>\n\n#### Fonts (ApplicationFont entries)\n- Display: <family / weights / file location / license> → frontmatter `type.display` + `fonts`\n- Body: <family / weights / file location / license> → frontmatter `type.body` + `fonts`\n\n#### Voice & tone\n- Register: <e.g., confident, terse, never effusive>\n- Capitalization: <e.g., sentence case>\n- Banned phrases: <e.g., \"innovative\", \"revolutionary\", \"AI-powered\">\n\n#### Signature details\n- <One or two design moves the brand is known for — a specific corner radius, a hairline rule, a particular typographic treatment.>\n\n### Gaps & placeholders\n- <category>: <why missing> → <action: ask user / AI generate / accept placeholder> [as of <date>]\n\n### Score log (for non-logo assets)\n- <asset>: R<n> P<n> B<n> C<n> N<n> = <avg>/10\n```\n\n## Structural enforcement — assets are referenced, not redrawn\n\nOnce DESIGN.md's Assets & Brand sections are populated, the discipline that keeps the design honest is structural, not behavioural. Encode it in the build:\n\n- **Every brand visual** is a Brick reading from a Media Flow Data via DataLink. No `Image.property.source` set to a literal URL or path. No `Sketch` Brick drawing a \"logo-shaped\" graphic. No `Svg` Brick reproducing the logo as a path. The pattern enforces \"you cannot ship a redrawn logo because the project structure doesn't allow it.\"\n- **Brand colors used in 2+ places** become theme-token Data, bound via DataLink. Single-use decorative colors can stay hardcoded (Truth #2's loose convention).\n- **Theme tokens are the single source of truth.** Want to add a new color? Add a Data entry first, then bind. The \"first\" is what makes it a system instead of an accumulation.\n- **Every Brick that uses a brand asset** has its source traceable to a DESIGN.md Assets & Brand line. Reviewing DESIGN.md is reviewing the design.\n\n## Creating assets when missing\n\nWhen a category has no acquirable real asset and the user has no plan to provide one, **do not** quietly substitute a placeholder and proceed. Three options, in priority order:\n\n1. **Stop and ask.** For logo, this is the only allowed option.\n2. **Compose the host environment's generative tools.** If a canvas-design / imagen / image-generation MCP / motion-generation MCP / Banana-style tool is available in the host, use it — *anchored on a verified brand reference*. This skill does not duplicate them; it composes them.\n3. **Accept a labeled placeholder Brick** with the gap tracked under DESIGN.md's **Gaps & placeholders**. Use this when generation is unavailable or known to fail for the asset type (e.g., generating a \"real product photo\" for a niche industrial product almost always fails).\n\n### Generative discipline (when option 2)\n\n- **Anchor on real brand material.** Feed at least one verified brand asset — the logo, a verified product photo, a brand color sample — as conditioning to the generator. Generation from \"the brand's general vibe\" produces uncanny-valley assets that feel adjacent to the brand without being the brand. Almost always recognized as fake by reviewers.\n- **Generate at the 5-10-2-8 quantity bar.** 8–10 candidates per slot, scored on the same 5 dimensions, keep 2.\n- **Persist generation metadata** under DESIGN.md's Assets & Brand: prompt, seed (where supported), reference assets used, model version. Reproducibility matters when the user later asks for a refresh in the same style.\n- **Never generate logos, wordmarks, or named characters.** These are identity, not imagery — generation produces look-alikes that legal will reject.\n- **Avoid AI-design tells.** Gradient orbs as \"AI\". Glassy translucent panels with no source. Generic happy-diverse-people-in-a-bright-office. Tech-y blue-purple gradients as backgrounds. Float / hover dot patterns. Watch for these in generated output and re-generate or discard.\n- **Motion generation is high-failure.** For Lottie / Rive / video, expect to discard 9 of 10 outputs. Budget the iteration; don't ship the first plausible result.\n\n### What \"compose, don't rebuild\" looks like in practice\n\n- This skill does **not** teach typography pairing, color theory, image composition, or generative prompting from scratch. Those domains are deep and other skills cover them well.\n- This skill **does** insist that when the host has a canvas-design / imagen / image-generation skill available, the agent invoke it for the relevant sub-task — generation, motion, composition — rather than substitute its own freehand work or skip with a placeholder.\n- Where the host has none, surface that constraint to the user. \"There's no image generator available in this environment; we have three options: (a) you supply, (b) we accept labeled placeholders, (c) you bring a generator skill / MCP into the environment.\" Don't silently degrade.\n\n## Anti-patterns — recurring failures\n\n- **Colors-and-fonts-only branding.** Visual identity lives in photography and logo treatment, not hex codes. If logo + product/scene aren't acquirable, surface it as a blocker before continuing.\n- **Aggregator-as-source-of-truth.** Brandfetch is a placeholder; not a final source.\n- **Eyeballing a hero color from a competitor's site or a stylistic neighbour.** Leaks the wrong brand into the work; reviewers catch it immediately.\n- **CSS-drawn imitations of real assets.** A gradient orb is not a logo. A Sketch path is not a product photo. Source or generate-with-anchor or labeled-placeholder. There is no fourth option.\n- **Embedding base64 in Brick props.** Pollutes the Subspace, defeats Media Flow refresh, balloons the file. Lift to Media Flow.\n- **Generating without a brand-reference anchor.** Produces uncanny-valley assets adjacent to the brand. Always anchor.\n- **Demo-content color contamination.** A Stripe-style hero from an aggregator site that has a third-party brand's accent color baked in. Either request a clean asset or note the contamination in the spec.\n- **Skipping the score log.** Without it, the bar is aspirational. Log scores per non-logo asset; commit the log alongside the spec.\n\n## When the brand has nothing\n\nSome BRICKS deployments are for venues with no prior brand work — small clinics, community lobbies, one-off pop-ups. In that case:\n\n- Skip the protocol; admit the gap up front.\n- Switch into Direction Advisor mode ([`when-the-brief-is-vague.md`](when-the-brief-is-vague.md)) and propose 3 differentiated visual directions.\n- The picked direction *becomes* the brand spec for this Application. Persist the picked direction's tokens, motion language, photography style guidelines, and (if any) generated assets in DESIGN.md (tokens + Assets & Brand) — even when invented from scratch. Treat it as a real spec, not a working note. The next person to touch the deployment will need it.\n\n## Voice & tone as a constraint on user-visible Data\n\nVoice and tone don't live in Bricks; they live in the strings inside Data values. The brand spec's voice section becomes a **content-author constraint**:\n\n- All user-visible Data values follow the register (sentence case, no exclamation marks, banned phrases avoided, length budget respected).\n- Translations follow the register in their target language — work with a localizer who understands the voice.\n- Generator-produced strings (LLM responses, formatted dates, error messages) need explicit prompts or templates that respect the voice. Do not trust default LLM phrasing; constrain it.\n\nSurface this to whoever maintains content post-deploy so it doesn't quietly drift.\n\n## Coverage checklist before declaring asset work complete\n\nYou cannot move from this protocol back into design until all of the following are true:\n\n1. Logo — present in Media Flow with light + dark + mono where applicable; bound via Data.\n2. Product / UI / scene category appropriate to the brand type — present, scored ≥ 8/10 on each kept asset, bound via Data.\n3. Motion category — present where the brand has motion identity; absent and noted otherwise.\n4. Colors — palette declared as DESIGN.md `colors` tokens (shared ones bound as theme-token Data).\n5. Fonts — declared as `ApplicationFont` entries; license confirmed.\n6. Voice & tone — captured as constraint or marked TBD with stakeholder + date.\n7. Gaps — every missing or placeholder asset listed under \"Gaps & placeholders\" with action and date.\n8. Score log — every non-logo asset scored on the 5 dimensions and logged.\n9. Spec committed — DESIGN.md's Assets & Brand sections are filled in the project root; not in a chat scrollback or a working file that will be lost.\n\nIf any item is incomplete, name it in your reply and either resolve it or pause for user input. Don't proceed silently.\n","bricks-design/references/when-the-brief-is-vague.md":'# When the Brief is Vague — Direction Advisor\n\nIf the brief is too open to execute ("design me a signage app", "make something for the lobby", "I don\'t know what kind of kiosk I want"), do not improvise on generic intuition. That\'s how every signage screen ends up looking like every other signage screen.\n\nSwitch into **Direction Advisor** mode. The output of this mode is *a chooser*, not a design — a small set of differentiated directions the user can pick or blend. Once they pick, drop out of Advisor mode and continue the normal workflow.\n\n## What "differentiated" means\n\nPick directions that disagree on a real axis. Three minimalist variants is not three directions; it is one direction at three opacities.\n\nThe strongest axis is **interaction archetype** — what the user *does* in front of the screen. Six archetypes:\n\n| Archetype | The user... | Dominant Brick(s) | Generator load | Canvas count |\n|---|---|---|---|---|\n| Glance | reads in 1–2 seconds while passing | Slideshow, RichText, Video | Light — content fetch only | 1 |\n| Browse | scans options without commitment | Items, Slideshow, Maps | Light to medium | 1–3 |\n| Interact | drives a flow, taps to choose | Items, BrickRect tiles, TextInput | Light | 2–5 |\n| Transact | completes a task with stakes (payment, identity) | TextInput, BrickRect, Camera, payment | Heavy — peripheral generators | 4–8 |\n| Monitor | watches changing state | Chart, Items bound to live Data | Heavy — MQTT/HTTP/MCP | 1–2 |\n| Dwell | inhabits the space; the screen is ambient | Video, Slideshow, Lottie | Light — looped media | 1 |\n\nFull rule sets per archetype (what carries forward, failure modes, which UX disciplines weight strongest) live in the companion skill — see `bricks-ux/references/interaction-archetypes.md`. Use the table above to pick at Advisor time; consult the companion file when the picked archetype needs to drive structural decisions.\n\nFor most vague briefs you can spread three options across this set — e.g., "lobby screen" reasonably maps to {Glance, Dwell, Interact}, "retail aisle screen" to {Glance, Browse, Transact}, "transit platform" to {Glance, Monitor, Browse}.\n\nYou can also differentiate on:\n- **Visual system** — Editorial / Cinematic / Brutalist / Soft minimalist / Maximalist. Useful when the deployment is fixed and the conversation is about expression.\n- **Brick set** — what the design is *built from* (image-led / type-led / map-led / video-led / chart-led).\n- **Motion language** — calm vs. cinematic vs. snappy.\n\nBut interaction archetype is the most useful starting axis because it changes the entire shape of the Subspace, not just its skin.\n\n## What to deliver in Advisor mode\n\nA direction is the combination of three choices — two axes the user perceives, and one structural decision that flows from them:\n\n- **Interaction archetype** (above) — *what the user does*. Drives Subspace structure.\n- **Visual language** — *what the design says*. Drives expression: type, color, motion, signature moves, asset emphasis. Pick from the curated library in [`design-languages.md`](design-languages.md) (Swiss Editorial / Kenya Hara emptiness / Field.io motion poetics / Brutalist web / Y2K futurist-retro / etc.) or invent one rooted in the same discipline.\n- **Canvas-graph shape** — when the brief reads as a presentation / pitch deck / introduction / explainer / slideshow / storyboard / demo / training-loop / kiosk-welcome, the choice between **Shape A** (Slideshow Generator — uniform layout, content-driven), **Shape B** (multi-Canvas state machine — bespoke layouts, hero continuity), and **Shape C** (hybrid) is a real direction differentiator. See [`presentation-and-slideshow.md`](presentation-and-slideshow.md). When the brief is not sequenced (single Canvas signage, dashboard, dwell loop), this collapses to "single Canvas" and isn\'t a real axis.\n\nFor each of 3 directions, write:\n\n- **One-sentence pitch** combining the axes ("Glanceable signage in the Kenya Hara emptiness register — a single hero photograph holding the canvas, captions smaller than instinct demands.").\n- **A real-world flagship** for the visual language (the user is unlikely to recognize an interaction archetype on its own, but they will recognize "MUJI lobby loops" or "Bloomberg Terminal").\n- **3 vibe keywords**.\n- **Interaction archetype + visual language pairing**, named explicitly so the user can refer back.\n- **Canvas-graph shape** (only for sequenced work — Shape A / B / C).\n- **Dominant Brick / Generator** the work will be built from.\n- **Canvas-count shape** — single canvas / 2–3 / state machine.\n- **Trade-off** — what this direction gives up.\n\nKeep each direction to ~5 lines. The chooser is the artefact, not finished work.\n\n**Spread across the axes.** Three directions all in the same archetype but different languages is a thin spread. Three different archetypes paired with the same language is also thin. For sequenced work, also spread across Canvas-graph shapes when it changes the user\'s experience meaningfully (Slideshow Generator vs multi-Canvas state machine is a different *kind* of presentation, not just a different look). Aim for at least two different archetypes and at least two different language schools across the three options.\n\n## The 3-cell preview\n\nBuild a lightweight preview that lets the user compare side by side:\n\n- **Best**: 3 minimal Subspaces (one Canvas each, placeholder content, real Brick layout) loadable in `bricks-ctor` `preview`. The user can render each.\n- **Good**: 3 sketches in a single Canvas — three frames within one Subspace, each labelled. Use this when speed matters more than fidelity.\n- **Acceptable**: 3 hand-drawn or screenshot-style images placed as Image Bricks with captions.\n\nDon\'t build full Subspaces. Direction Advisor is a 5–10 minute cycle. If you\'re 30 minutes in, ship what you have and let the user redirect.\n\n## When the user picks\n\nOnce they pick (or pick a blend):\n\n1. **Drop out of Advisor mode.** Stop offering alternatives. Commit.\n2. **Re-confirm deployment context.** The pick changes some assumptions (e.g., picking Transact when the deployment is no-touch is wrong; surface that and renegotiate).\n3. **Continue the normal workflow.** Declare a system, build a runnable skeleton, iterate, ship variations within the chosen direction (variants on visual / motion / content rhythm — not on archetype anymore).\n\n## Anti-patterns\n\n- **Three options that all want the same archetype.** Three "elegant minimalist" variants is not a chooser. The user can\'t decide because the options haven\'t disagreed yet.\n- **Naming the visual style without naming the interaction.** "Editorial / Brutalist / Soft" tells the user nothing about what they\'ll do in front of the screen. Lead with archetype.\n- **Building all three to high fidelity.** You\'re spending design budget you should spend after the user picks.\n- **Skipping Advisor when the brief is "kind of vague" but you have a strong opinion.** State your opinion in plain language ("I\'d default to a glanceable signage loop because of the lobby context — want me to start there, or see two other options?") and let them redirect. Skipping the chooser without checking is how design budgets get burned on the wrong direction.\n\n## When to skip Advisor mode\n\n- The user supplied concrete references (a Figma render, an HTML mockup, a competitor URL). The translation rules in [`translating-inputs.md`](translating-inputs.md) take over; Advisor is unnecessary.\n- The brief is concrete enough to act on — specific screen, specific interaction, specific brand. Don\'t manufacture ambiguity.\n- The user is impatient and named a clear preference. State your default and proceed; offer to revisit if they want options later.\n',"bricks-design/references/workflow.md":"# Workflow — questions and staged delivery\n\nTwo disciplines bundled because they're both about how the work moves through time: deciding when to ask vs. when to build, and pacing the build itself so misalignment is caught early instead of after twelve Canvases.\n\n## Ask vs. build\n\nAsk when the design space has too many free variables. Build when constraints are already pinned.\n\n**Ask** if any of these are unclear:\n\n- Hardware / scene / network / language / brand (Priority #0 — never improvise on these).\n- Fidelity expectation — rough Canvas with tokens only, fully lit single scene, or full system across all Canvases.\n- Variation scope — one direction or multiple to choose from.\n- Variation axes — visual language, palette, density, motion, Canvas-graph shape.\n- Content provenance — does the user have copy/assets, or should you write placeholder in a declared voice?\n\n**Build** if:\n\n- Deployment context is concrete, brief names a recognisable shape, brand is supplied or absent-by-design.\n- Reference material was supplied (Figma / HTML / screenshot / website) — translation rules in [`translating-inputs.md`](translating-inputs.md) take over; ask only the residual.\n- The user named a strong preference. State your default, build, offer to revisit.\n\n**Batch the asks.** Single round of questions, not staged. Volleys cost user momentum. Aim for 5–10 well-targeted questions per round; fewer than 3 means you're missing problem-specific depth; more than 12 means you're stalling.\n\n## Question playbook by axis\n\nWhen you do ask, cover these axes — in one batch, omitting any already pinned:\n\n**Deployment context** (Priority #0 — covered in SKILL.md, repeat checklist if any is missing).\n\n**Output shape**\n\n- Single Canvas / multi-Canvas state machine / Slideshow Generator / hybrid?\n- How many Canvases roughly? (Calibrates effort, not a contract.)\n\n**Fidelity**\n\n- Rough skeleton with tokens declared / one fully-lit hero Canvas / full system across every Canvas?\n- Is the deliverable for review, for handoff to another designer, or for direct deployment?\n\n**Variations**\n\n- One direction, or three to pick from?\n- Axes that should vary — visual language, palette, density, motion, Canvas-graph shape, interaction archetype?\n- Conservative spread or one bold option included?\n\n**Tone and content**\n\n- Audience for the deployed Application (passersby / customers / employees / operators / VIPs)?\n- Tone register (formal / warm / playful / technical / quiet / loud)?\n- Copy supplied or placeholder-in-voice?\n\n**Problem-specific** (3–5 questions tailored to output shape — examples below):\n\n- *Slideshow / pitch deck*: how many slides, target duration per slide, narration or silent, branching or linear, who advances (auto-timer / operator remote / interaction).\n- *Kiosk / interactive*: peripherals attached, identity capture, payment terminal, queue/wait behaviour, idle reset interval.\n- *Dashboard / monitor*: data sources, refresh cadence, alert thresholds, what action a viewer might take from each state.\n- *Signage / glanceable*: dwell-time at the screen, day/night cycle, ambient sound, fleet vs. single-instance, content feed.\n\n## Staged delivery — five passes\n\nDon't sprint to a finished Subspace. Stage the work so wrong direction is caught at the cheapest point.\n\n### Pass 0 — Deployment context + DESIGN.md\n\nConfirm Priority #0 verbatim, then write the project's **`DESIGN.md`** before placing any Brick. Full schema and template in [`design-md.md`](design-md.md); at Pass 0 you need at minimum:\n\n- **Frontmatter tokens** — `system`, `archetype`, the `colors` / `type` (sizes in grid units) / `spacing` (grid units) / `motion` / `grid` / `heroes` maps. Each token carries its role in a comment.\n- **Deployment Context** — the five Priority #0 facts in prose, with any assumed value flagged `ASSUMED`.\n- **Visual Theme & Atmosphere** (section 1) — what the system says and its one or two signature moves.\n\nThe grid substrate is given (Truth #6). What you commit to is type scale, palette, **spacing scale in grid units**, motion vocabulary, grid stance, and hero Bricks. The spacing scale is a small enumeration (3–5 values); inter-Brick gaps come from this set by name (`{spacing.gap-m}`), not arbitrary integers. DESIGN.md keeps the agent's arithmetic consistent across many Bricks and is what the design-critique pass cites.\n\nThe Subspace file itself carries only a one-line pointer:\n\n```ts\n/** System: <picked design language> \xb7 archetype: <archetype> \xb7 tokens + assets in ../DESIGN.md */\n```\n\n### Pass 1 — Showcase Canvas (the lockdown moment)\n\nBuild **one** Canvas, fully lit, that represents the work at its highest fidelity. Choose the hardest Canvas — the boot screen, the most content-dense state, or the moment that carries the brand most. Run through Verification (compile + screenshot + view back). Show the user.\n\nThis is the cheapest point to discover the direction is wrong. If the user wants the type bigger, the photography swapped, the rhythm slower, the language different — fix the Canvas and the DESIGN.md tokens, not twelve Canvases.\n\n**Do not** build the full Canvas graph before this checkpoint. The temptation is real because state-machine work feels productive; resist it. Sign-off on one Canvas first.\n\n### Pass 2 — Full Canvas graph\n\nAfter Pass 1 sign-off, build the remaining Canvases and the Switch / Data wiring that connects them. Hero Bricks use the same id across Canvases (Truth #3). Every visible Brick has a Standby Transition (Truth #7).\n\nMid-review checkpoint partway through: show the user 3–4 representative Canvases (not all of them) and the navigation flow. Caught here is still cheap. Wait until everything is finished and you've spent the budget.\n\n### Pass 3 — Polish, edge cases, content rhythm\n\nPass over every Canvas for:\n\n- Spacing-scale adherence (every gap from the declared set).\n- Density rhythm across consecutive Canvases (not three identical layouts in a row).\n- Standby Transitions consistent vocabulary, not 6 different easings.\n- Asset fidelity at the 5-10-2-8 bar (per `when-the-brief-is-branded.md`).\n- Multilingual content fits without breaking layout, if relevant.\n\n### Pass 4 — Verification + self-critique\n\nThe non-negotiable Definition of done from SKILL.md plus the 5-dimension self-critique in [`design-critique.md`](design-critique.md). Compile, screenshot every Canvas, view back, critique pass, fix anything < 8 or surface as an accepted trade-off.\n\nOnly after Pass 4 do you declare done.\n\n## When to compress passes\n\nSmaller deliverables don't need all five.\n\n- **Single-Canvas glanceable signage**: Pass 0 + a one-pass build + Pass 4. Pass 1 *is* the deliverable.\n- **Iterative changes on existing Subspace**: skip to the affected passes; don't re-declare the system.\n- **Direction Advisor mode**: 3 lightweight Pass 1 candidates, no Pass 2/3 until the user picks.\n\nDon't compress passes on:\n\n- Multi-Canvas state machines (3+ Canvases).\n- Anything with branding (Pass 1 lockdown catches asset-bar problems before they propagate).\n- Anything with peripherals, payment, or identity (Path 2 verification mandatory in Pass 4).\n\n## Anti-patterns\n\n- **Sprinting to a finished Subspace and showing it.** The user can't easily redirect a finished thing. Pass 1 is for redirection.\n- **Asking one question at a time.** Burns volleys, drains user energy.\n- **Asking nothing and inferring.** The five Priority #0 items are not inferrable; trying to is the most expensive mistake.\n- **Declaring done after Pass 2.** Pass 4 critique is what separates \"runs\" from \"good.\"\n- **Rewriting DESIGN.md tokens on every iteration.** If you find yourself updating five tokens at once mid-Pass-3, you're rebuilding the system — back up to Pass 1.\n","bricks-ux/SKILL.md":'---\nname: bricks-ux\ndescription: >-\n Interaction design and end-user experience for any Application or Subspace\n built on Canvases, Bricks, Generators, Data, DataCalculation. TRIGGER on\n usability / flow / interaction / journey / state / affordance / feedback /\n recovery / accessibility audits and design work — "audit this flow", "improve\n usability", "design the wait state", "make the kiosk usable", "design the\n payment flow", "design idle and attractor states", "design for multilingual /\n low vision". Also triggers in parallel with visual-design work for end-to-end\n deliverables (kiosk, signage, dashboard, interactive screen, pitch deck) where\n interaction shape matters as much as look. SKIP for purely visual / aesthetic\n / style / brand-asset / typography / palette work — that is bricks-design.\n Encodes a universal user-journey spine, interaction archetypes, pressable\n composition, monitoring-screen discipline, designed flow states,\n accessibility, tiered UX critique; hardware floors are deployment-relative and\n web habits do not transfer.\n---\n\n# BRICKS UX\n\nYou are a BRICKS interaction designer. Your output is a **designed user journey** expressed through Canvas graphs, Brick affordances, Standby Transitions, Switch thresholds, and Data states. The deliverable is a Subspace whose interaction shape, not just its visual surface, is intentional.\n\nWeb interaction habits do not transfer. There is no hover, no scroll, no `<form>` submit, no modal-as-default, no semantic link, no document flow. Hardware varies wildly — a phone-shaped PWA, a 32" landscape kiosk, a 75" portrait signage panel, a curved retail display. **Floors and discipline are deployment-relative**; pinning pixel measurements is the wrong altitude. Express discipline in grid units, viewing distances, fractions of viewport, deployment-shape categories.\n\n## Priority #0 — Verify the end user\n\nBefore designing any flow, confirm:\n\n- **Who** uses the screen — passersby, customers, employees, operators, VIPs, mixed.\n- **What they\'re doing** in front of it — passing through, queuing, ordering, paying, monitoring, dwelling, troubleshooting.\n- **What state they arrive in** — fresh / mid-task / returning / interrupted / under time pressure / under emotional pressure (payment, identity).\n- **What stress they\'re under** — daylight glare, queue behind them, low literacy, accessibility need, multilingual mix, watchdog reset just happened.\n- **How they leave** — completion, abandonment, idle timeout, peripheral disconnect, someone else taking over.\n\nIf any of the first four is missing, stop and ask in a single batch. UX without a named end user is decoration.\n\n## Priority #0.5 — Walk the journey end-to-end before designing\n\nBefore placing Bricks for a flow, narrate the journey step-by-step out loud in your reply. Every step gets:\n\n- **Who\'s acting** — the user, the runtime, a peripheral, an operator.\n- **What they see** — Canvas + dominant Bricks at that moment.\n- **What they feel** — confident / hesitant / waiting / stuck / relieved.\n- **What can go wrong** — including the silent failures (peripheral delay, network blip, watchdog reset, language fallback).\n\nA flow you cannot narrate is a flow you cannot design. This step catches the missing-state cases (no in-flight visibility, no error recovery, no closure) before they ship.\n\n## The universal user-journey spine\n\nEvery interaction — touch, peripheral, remote, external trigger — follows the same seven steps. Skipping any of them is the most common failure mode. Full file: [`references/user-journey.md`](references/user-journey.md).\n\n1. **Affordance** — "Can I do something here?"\n2. **Instruction** — "What do I do?"\n3. **Immediate feedback** — "Did I do it?"\n4. **In-flight visibility** — "Is it being handled?"\n5. **Continuation** — "What\'s next?"\n6. **Recovery** — "What if it went wrong?"\n7. **Closure** — "When can I leave?"\n\nThis scaffold replaces device-specific recipes. QR scan, face detection, BLE proximity, NFC tap, payment, voice mic, touch — all the same seven steps, expressed through different Brick families and Generator events.\n\n## Interaction archetypes\n\nThe user does one of six things in front of a BRICKS screen. The archetype determines Subspace structure (Canvas count, Brick dominance, motion vocabulary, what carries forward across Canvases).\n\nGlance \xb7 Browse \xb7 Interact \xb7 Transact \xb7 Monitor \xb7 Dwell.\n\nEach has its own rule set, what reads as fail, and which UX disciplines weight strongest. See [`references/interaction-archetypes.md`](references/interaction-archetypes.md).\n\n## Flow states are first-class\n\nIdle, loading, empty, error, attractor, boot, maintenance — these are not afterthoughts. They are states the deployment will spend real time in. A flow whose error state is a stack of red text in a corner is a flow that fails in the field. See [`references/flow-states.md`](references/flow-states.md).\n\n## Pressable composition\n\nEvery composite (multi-element) button needs a deliberate decision about where `on_press` sits and how overlapping press chains resolve. Pressable-capable Bricks with no press events auto-bypass at the runtime, so the trivial wrapper case works without ceremony; explicit `pressable: \'bypass\'` matters when inner Bricks carry their own chains. Affordance is a UX signal — the user must be able to *see* what\'s pressable before discovering it by accident. See [`references/pressable-composition.md`](references/pressable-composition.md).\n\n## Monitoring screens have their own discipline\n\nCalm state must be readable and forgettable. Change must be detectable without being demanding. Demand must compel response without crying wolf. Stale data is worse than no data. See [`references/monitoring-screens.md`](references/monitoring-screens.md).\n\n## Accessibility is non-optional, deployment-relative\n\nUniversal access is not a checkbox; it\'s a deployment-floor commitment. Contrast, scale, motor, reduced-motion, color-not-only, predictable navigation, audio cues — each applies at a deployment-specific floor (viewing distance, ambient light, user posture, hardware capability). See [`references/accessibility.md`](references/accessibility.md).\n\n## Verification — UX critique\n\nVerification proves the flow *runs*. UX critique proves the flow is *usable*. Tiered by deployment risk (CRITICAL on transact / identity / safety-critical; HIGH on interact / monitor with alarms; MEDIUM on browse / dwell; LOW on glance / loop) with Must Have / Anti-Pattern pairs per section. See [`references/ux-critique.md`](references/ux-critique.md).\n\nUX critique runs alongside visual-design critique (in `bricks-design`), not after. The two are concurrent; a Canvas can fail one and pass the other, and both block ship.\n\n## Boundaries\n\n- Do not design flows for users not yet identified — Priority #0 must be answered first.\n- Do not invent peripheral behaviour — if a peripheral\'s behaviour at threshold is unknown, the journey has an unsafe step; surface it before designing past it.\n- Do not declare a flow done after testing only the golden path. Edge states (timeout, error, abandon, watchdog reset, peripheral disconnect) are part of the design.\n- Do not import web interaction patterns — hover affordances, scroll-to-reveal, modal overlays, page-submit forms — to no-touch or peripheral-bound hardware without translation.\n\n## Companion skill\n\nFor visual design — type, palette, asset acquisition, design language, system commitment, visual rhythm — use `bricks-design` (companion skill). Most end-to-end briefs ("design a kiosk for X", "build a presentation about Y") invoke both in parallel.\n\n## Reference index\n\n| When you need to... | Read |\n|---|---|\n| Walk the universal interaction journey | [`references/user-journey.md`](references/user-journey.md) |\n| Pick the right interaction archetype + apply its rule set | [`references/interaction-archetypes.md`](references/interaction-archetypes.md) |\n| Compose a button so taps land where intended | [`references/pressable-composition.md`](references/pressable-composition.md) |\n| Design monitoring / dashboard / status-board UX | [`references/monitoring-screens.md`](references/monitoring-screens.md) |\n| Design idle / loading / empty / error / attractor / boot / maintenance states | [`references/flow-states.md`](references/flow-states.md) |\n| Ensure universal access at deployment-relative floors | [`references/accessibility.md`](references/accessibility.md) |\n| UX critique before declaring done | [`references/ux-critique.md`](references/ux-critique.md) |\n',"bricks-ux/references/accessibility.md":"# Accessibility\n\nUniversal access is not a checkbox; it is a deployment-floor commitment. The floors themselves are **deployment-relative** — a 75\" signage panel viewed at 5m has a different contrast floor than a 13\" PWA at arm's length. Pinning pixel measurements is the wrong altitude; pin the principle to viewing distance, ambient light, user posture, hardware capability, and the audience that will actually be in front of the screen.\n\nThis is design discipline, not compliance citation. Standards like WCAG are useful references for ratios and thresholds; the deployment is the audit.\n\n## The seven disciplines\n\nEach below is non-optional unless the brief explicitly removes the constraint (rare). Each is expressed in deployment-relative terms.\n\n### 1. Contrast at viewing distance\n\nThe screen must remain readable under the deployment's actual luminance conditions — direct sunlight on outdoor signage, dim lobby, fluorescent retail, surgical-theatre lighting, day-night cycles in 24-hour venues.\n\n**Discipline:**\n\n- Body text contrast: at viewing distance, the text must be readable to a viewer with imperfect vision. Use the deployment's worst-case ambient (peak sun for outdoor; lowest lobby level for indoor) as the calibration point.\n- Critical-action elements (alarm indicators, transact-flow CTAs, way-finding directional cues): higher contrast than body, reads through glare and reflection.\n- The 4.5:1 ratio (a common reference) is a *floor*, not a goal — comfortable reading on a kiosk at 1m is more like 7:1 for body, 10:1 for critical.\n- Adjacent fills (a coloured Rect over a coloured ground) must also meet contrast — don't measure ink-on-ground only.\n- Audit by squint test: at 25% zoom on the design preview, primary content should still be readable. If it isn't, the contrast is wrong.\n\n**Failure modes:**\n\n- Mid-tone-grey body text on a slightly-lighter-grey ground — reads on the designer's monitor, vanishes under the deployment's actual conditions.\n- Brand-palette pastels on white grounds — pretty in a mockup, illegible on a sunlit signage panel.\n- Dark-mode invert without re-balancing contrast — see `bricks-design/design-critique.md` anti-slop list.\n\n### 2. Scale at viewing distance\n\nText and pressable elements must be large enough for the deployment's actual viewing distance and user capability.\n\n**Discipline:**\n\n- Body text scale: pick a grid-unit height that, at deployment resolution and viewing distance, reads comfortably for the audience. A wayfinding screen for an aged audience at 3m needs body text larger than a control-room dashboard at 0.6m.\n- Touch targets: on touch-enabled hardware, every pressable Brick must be large enough that an adult finger lands reliably. Children-using-it deployments scale up; gloves-on factory deployments scale up further. The 44pt-equivalent web reference is a desk-laptop floor, not a kiosk floor.\n- Inter-element spacing: pressable Bricks need breathing room — accidental adjacent presses are common with single-finger interaction on dense layouts.\n\n**Failure modes:**\n\n- Web-default 14–16px body text on a 65\" signage panel at 3m — readable only if the viewer walks up.\n- Touch targets sized for mouse cursors — 32px tiles on a kiosk; thumb miss rate is high; users press the wrong tile and abandon.\n- Inter-element spacing < 1 grid unit on a no-haptic-feedback touch panel — adjacent presses happen routinely.\n\n### 3. Color is necessary but never sufficient\n\nCritical information (status, error, severity, success) must be encoded by *more than colour*. Colour blindness is common; viewing conditions degrade colour rendering; monochrome failover paths exist.\n\n**Discipline:**\n\n- Status indicators encode by **colour + shape + label**. A red diamond labelled \"CRITICAL\" survives where a red dot doesn't.\n- Severity tiers use distinct shape vocabularies, not just hue ramps. Critical = filled, Warning = outlined, Normal = absent. Or critical = diamond, warning = triangle.\n- Form validation: errors marked by colour AND icon AND positional cue (the field with the error gets a distinct outline, an icon, and an inline message — not just a red border).\n- Print / screenshot / monochrome screenshot of the design should still convey the same information hierarchy.\n\n**Failure modes:**\n\n- Charts encoded by hue alone — multi-series charts unreadable when desaturated or for colour-blind viewers.\n- Red \"alarm\" badge in a corner with no shape or label distinction — invisible to red-green colour-blind operators.\n- Form-validation error styled only by red text — unreadable without a colour distinction the user can perceive.\n\n### 4. Motor allowances\n\nSome users have reduced fine motor control. Some are using gloves. Some are children. Some have pressed the wrong tile three times and are frustrated. Design for the realistic worst case the deployment will see.\n\n**Discipline:**\n\n- Touch targets sized for the audience and conditions (see \xa72).\n- No precise gestures (multi-touch, swipe-to-confirm, drag-to-amount) when the audience may include reduced-motor users. If gesture is needed, a tap alternative exists.\n- Accidental-press protection on consequential actions: confirm-step for transact, undo window for destructive actions, \"press twice to confirm\" for irreversible operator commands.\n- No time-pressure that fails the slow user. A 3-second confirmation timer that auto-cancels frustrates older users and accommodates none.\n\n**Failure modes:**\n\n- Swipe-to-pay as the only commit gesture — unusable for some, harder than a tap for most.\n- \"Press twice within 1 second\" — fails users who hesitate.\n- Tiny \"X\" close buttons on dialogs — children, gloved users, and users with tremor cannot hit them reliably.\n\n### 5. Reduced motion\n\nSome users find continuous motion distressing or disorienting. Some hardware deployments (in clinical settings, in environments with motion-sickness-prone audiences) need to minimise screen motion.\n\n**Discipline:**\n\n- Animation that's part of the design language can be reduced via a Data flag (`reduceMotion: true`). `Animation.runType` is a literal `'once' | 'loop'` and does not accept a `DataLink`, so the flag has to drive a `Switch` (`SwitchCondData`) whose `animation` override swaps the looping slot for a non-looping Animation or omits it entirely; Standby easing is shortened the same way. The flag is a deployment-time setting, not a per-user runtime toggle (since BRICKS deployments typically don't have OS-level reduce-motion).\n- Critical state changes (alarm transitions, success acknowledgement) remain animated even with reduced motion — these are functional, not decorative.\n- Where motion is the design language (Field.io poetics), reduced-motion mode reframes the deployment — possibly delivers a different Subspace. Don't half-fly the motion design.\n\n**Failure modes:**\n\n- Continuous looped animation on every Brick — fatiguing in the best case, distressing in the worst.\n- No reduced-motion path for a deployment in a clinical / safety-critical setting.\n- Reduced-motion that also breaks critical state visibility (the alarm pulse silenced along with the decorative motion).\n\n### 6. Predictable navigation\n\nOperators and users build mental models of where things live on the screen. Layout shifts that move primary elements between Canvases (or between states on one Canvas) destroy that mental model.\n\n**Discipline:**\n\n- Hero Bricks (logo, primary CTA, page indicator, time) keep position across Canvases via Truth #3 shared ids. The eye-anchor doesn't move.\n- Navigation affordances (back, next, home) sit in consistent positions across Canvases.\n- Error states do not relocate the user — the error appears in or near the affected element, not on a completely different Canvas that erases context.\n- Idle-reset returns to the *same* idle Canvas every time, not to a variant; reliability over novelty.\n\n**Failure modes:**\n\n- Brand chrome that moves between Canvases — the eye lands in different places every time.\n- \"Back\" button that moves around or disappears mid-flow.\n- Idle rotation that breaks the eye-anchor — the same brand element appears at top-left, then top-right, then centre across rotation cycles.\n\n### 7. Audio cues (when hardware allows)\n\nVisual is the dominant channel, but sound complements where it can. Sound becomes especially important when the user is *looking at the peripheral, not the screen* (a payment terminal, a card reader, a printer) and needs confirmation from the screen.\n\n**Discipline:**\n\n- Tap / press feedback: a brief audio cue (50–100ms) at the moment of registration helps users with reduced peripheral vision and confirms action when the visual feedback might be missed.\n- Alarm / demand state: an audio signal with the visual change. Distinguishable from ambient music or environment.\n- Success closure on transact: a short success cue when the transaction completes, especially when the user's attention is on the peripheral / receipt.\n- Volume and timing aware — late-night deployments quiet, daytime louder. Schedule via Data, not hardcoded.\n- Audio is never the *only* cue — pair with visual. A user wearing earphones, in a noisy environment, or hard-of-hearing must still see the change.\n\n**Failure modes:**\n\n- Audio cue at constant volume regardless of time of day — disruptive at 11pm, inaudible during a busy lunch rush.\n- Audio-only confirmation — the user without good hearing is left guessing.\n- Default OS / browser system sounds — unbranded, often jarring, dated.\n\n## Multilingual is an accessibility concern (for some deployments)\n\nWhere the audience speaks multiple languages, accessibility includes language access. See [`multilingual-and-rtl.md`](multilingual-and-rtl.md) when that file exists; until then:\n\n- Strings used in the UI go through Data so a locale can be swapped (Truth #2 + critique bonus on hardcoded English).\n- Type scales must accommodate the longest expected translation — German strings are often 30%+ longer than English; CJK is often shorter but with different optical density.\n- RTL layouts (Arabic, Hebrew) flip at the Subspace / Canvas level — not a per-Brick CSS prop. Plan the Canvas to support flipping if RTL is in-scope.\n\n## Cognitive load discipline\n\nUniversal-access also covers cognitive accessibility — users who are tired, distracted, unfamiliar with the system, under stress.\n\n**Discipline:**\n\n- One primary action per Canvas. The user knows what they're being asked to do.\n- Plain language over jargon. \"Pay now\" beats \"Authorize transaction.\"\n- Reading comprehension at the audience's likely level — a venue-of-the-public deployment writes at a lower grade level than a control-room console.\n- Predictable patterns — same kind of action gets the same kind of affordance across the deployment.\n\n**Failure modes:**\n\n- Three competing CTAs on one Canvas — the user freezes choosing.\n- Jargon error messages (HTTP codes, internal error names) — the user doesn't know what to do.\n- Inconsistent affordance vocabulary — tiles look pressable on Canvas 1, identical tiles are decorative on Canvas 2.\n\n## How to use this file\n\n1. **Confirm the audience and conditions** as part of Priority #0. Reduced-motor users? Multilingual? Outdoor sun? Night-shift fatigue? Each shifts which disciplines weight strongest.\n2. **Apply the seven disciplines as a baseline.** Each has a deployment-relative floor; calibrate to the conditions, not to a default.\n3. **Verify at the deployment.** Path 2 (on-device DevTools, see `bricks-ctor/rules/verification-toolchain.md`) is the only way to confirm contrast under real lighting, touch-target size under real fingers, audio cue volume in real ambient.\n4. **Surface gaps in trade-off notes.** A deployment that opts out of one of the seven (e.g., audio cues skipped because the hardware is muted; reduced motion skipped because the design language IS motion) must say so explicitly in the handoff.\n\nA design that passes visual critique but fails accessibility floors is not done. Accessibility critique runs in parallel.\n","bricks-ux/references/flow-states.md":'# Flow States\n\nIdle, loading, empty, error, attractor, boot, maintenance — these are not afterthoughts. They are states the deployment will spend real time in. A flow whose error state is a stack of red text in a corner is a flow that fails in the field. A kiosk whose idle state is "whatever the last user was looking at" is a kiosk that confuses every next user.\n\nThis file treats each as a **first-class designed state**. Universal principles, BRICKS-native expression notes, and the failure mode that consistently slips into agent-produced work.\n\nThe common thread across all of them: every state has a *who arrives*, a *what they see*, a *what they need to know*, and a *how they leave*. If you cannot answer all four, the state is unfinished.\n\n## Idle\n\n**The state when the screen is on, the user is not present, and no peripheral / sensor event is active.**\n\nMost kiosks and interactive deployments spend the majority of their hours idle. Yet idle is the most-skipped designed state in agent work — it gets treated as "whatever Canvas is loaded when nobody\'s using it," which is wrong.\n\n**Design discipline:**\n\n- **Idle is a designed Canvas (or set of Canvases), not a side-effect.** The flow returns to it after every session via an idle-timeout reset.\n- **Idle invites.** A passerby should look at the idle screen and understand what\'s offered here. This is the affordance layer for the eventual interact flow — see [`user-journey.md`](user-journey.md) step 1.\n- **Idle resets cleanly.** No state from the previous user persists into idle — no half-built order, no name still on screen, no "please confirm". The reset wipes flow Data; `persistData: true` is reserved for *deployment* state (last-known-good, config), not session state.\n- **Idle rotates if needed.** For deployments where idle runs hours, a slow Slideshow / Canvas rotation prevents burn-in and gives the screen rhythm. Don\'t loop a single static Canvas indefinitely.\n- **Idle is calm.** No spinners, no progress indicators, no "loading" residue. The screen is at rest.\n\n**Failure modes:**\n\n- Idle = "last interact Canvas frozen." Next user arrives mid-flow, doesn\'t know whose order is on screen, may complete or cancel someone else\'s.\n- Idle with a spinner or "please wait" — implies the system is busy when it isn\'t.\n- Idle without an attractor element — passersby see "this is on" but not "this is for them".\n- Idle timeout reset that doesn\'t actually reset all Data — partial state leaks into next session.\n- Idle too noisy — looping animation that demands attention from people not interacting; reads as broken.\n\n## Attractor\n\n**The active state of "no current user, but invite the next one."**\n\nSome deployments differentiate idle (passive) from attractor (actively inviting). A kiosk in a quiet store may use the same Canvas for both; a kiosk in a busy mall might cycle a deliberate attractor sequence to pull users in.\n\n**Design discipline:**\n\n- **A clear value proposition.** "Order here", "Check in", "See today\'s events", "Find your room". One line, large, immediately readable from approach distance.\n- **A demonstration of action.** A subtle animation showing the kind of interaction the user will do — a finger graphic tapping a tile, a card moving toward a reader, a face-detection frame breathing.\n- **Brand presence, not brand wallpaper.** The brand is in the attractor; the attractor isn\'t *only* brand. A wordmark-only attractor doesn\'t tell the passerby what\'s possible.\n- **Calibrated motion.** Enough to catch the eye from peripheral vision (10–15\xb0 off-axis), not enough to read as broken or anxious.\n- **Time-of-day / context aware** if the deployment runs long hours — morning rush attractor differs from afternoon quiet differs from late-night.\n\n**Failure modes:**\n\n- Attractor that\'s only logo + tagline — looks like signage, not like an invitation to act.\n- Attractor that demos a different action than what\'s available — promises one experience, delivers another.\n- Attractor with hover-style affordances on no-touch hardware — implies pointing-device interaction that doesn\'t exist.\n- Attractor competing with the deployment\'s surroundings — the screen drowns in a busy retail wall, or shouts over a quiet hotel lobby.\n\n## Boot\n\n**The state when the device just started — pre-content, pre-user.**\n\nPer `bricks-design/performance.md`, the boot Canvas must render in < 1s using only cached/persisted Data. That\'s the runtime floor. The design floor is *what the user sees during that second and what arrives after*.\n\n**Design discipline:**\n\n- **Boot is brand, not work.** The first second is brand presence — wordmark, logo lockup, a confident moment. Not a spinner. Not "loading…".\n- **Boot transitions into idle gracefully.** Standby Transitions carry the boot chrome into the idle Canvas; Truth #3 shared Brick ids preserve continuity. The user doesn\'t see a blank moment between boot and idle.\n- **Boot is fault-tolerant.** If a Generator fails, if a Data source is unreachable, if a peripheral hasn\'t initialised — boot completes anyway, with the failure surfaced in the affected component (a sensor that hasn\'t reported reads as "—", not as a frozen screen).\n- **Boot is what a watchdog reset returns to.** A reset is a fresh boot; design boot so the operator and any in-progress user can recover gracefully. Persistent state restores last-known-good, not last-current-screen.\n\n**Failure modes:**\n\n- Boot as a loading spinner over a blank background — every reset reads as "this is broken."\n- Boot Canvas different from idle Canvas — the user sees the brand appear, then a layout shift to idle; instability tell.\n- Boot that requires network / Generator success — offline boot fails; deployment goes dark.\n- Boot that doesn\'t acknowledge watchdog reset — operator or user in-flight is suddenly back at boot with no explanation.\n\n## Loading\n\n**The state when the user has acted (or the system has triggered) and a response is pending.**\n\nThis is step 4 of the user journey (in-flight visibility, see [`user-journey.md`](user-journey.md)). Loading is a *state visibility* discipline, not a decorative flourish.\n\n**Design discipline:**\n\n- **Loading is not blankness.** A pending response gets a visible state — spinner, progress indicator, animated tile, "processing" badge — that confirms the system is working.\n- **Loading is bounded by time-out.** Every loading state has a failure path. If the response doesn\'t arrive in N seconds (deployment-relative, typically 10–30 seconds for network operations, 2–5 for peripheral), the state transitions to error recovery (step 6 of the journey).\n- **Loading disables the trigger.** While loading, the affordance that triggered it is `pressable: \'disabled\'` or Switch-hidden — user can\'t re-trigger.\n- **Loading scales with expected wait.** A < 1s wait is a snap-cut visual change; a 1–5s wait is a spinner; a 5s+ wait surfaces progress estimate or "still working".\n- **Skeleton screens** (showing the *shape* of incoming content with a placeholder) work for content that arrives gradually. Less appropriate for transact-flow loading (a fake-result skeleton would mislead).\n\n**Failure modes:**\n\n- Loading visually identical to idle — user doesn\'t know if they pressed something or not.\n- Loading without a time-out — system hangs; loading state persists forever; user walks away.\n- Loading that allows re-trigger — user impatient, presses again, queues duplicate work.\n- Loading dressed as success — skeleton that looks complete; user assumes the action finished and acts on the placeholder.\n- Loading on a transact flow that reads ambiguous between "still processing" and "approved" — user walks away from a partial transaction.\n\n## Empty\n\n**The state when there\'s nothing to show — no items in the list, no events today, no notifications, no search results.**\n\nEmpty is the most-forgotten state in agent work. Loading gets designed because it follows from acting; empty gets skipped because it follows from *not* acting and the agent thinks "there\'s nothing to design".\n\n**Design discipline:**\n\n- **Empty explains the absence.** Not "nothing here". Specifically: "No bookings today. New bookings appear here." or "No events scheduled. Check back tomorrow." or "No matches. Try a different spelling."\n- **Empty offers a path forward.** Even on monitoring deployments, empty should suggest what will populate it ("Sensor will report every 30 seconds") or how the user can change the state ("Add an item to begin").\n- **Empty is not error.** A bookings list with no bookings today is a perfectly normal state — design it as content, not as failure.\n- **Empty preserves the layout.** The list area / grid area is still occupied — by an empty-state composition, not by collapsed-away whitespace that resizes the rest of the screen.\n- **Empty is rare on dense deployments and frequent on others.** A retail menu board never has an empty menu (it would close instead). A queue display is empty when there\'s no queue — which is most of the time.\n\n**Failure modes:**\n\n- Empty rendered as collapsed space — the screen\'s layout shifts because there\'s nothing there; users perceive the screen as broken.\n- Empty rendered as "—" everywhere — placeholders never replaced by content; design forgot to handle the populated case (or vice versa).\n- Empty as error — "No results" styled as red and alarming; the user thinks they made a mistake.\n- Empty without explanation — the user can\'t tell if there\'s truly nothing or if data hasn\'t loaded.\n\n## Error\n\n**The state when something went wrong — peripheral disconnected, validation failed, network unavailable, Generator timed out, content feed broken.**\n\nError is step 6 of the user journey. It is a first-class designed state, not a corner-text afterthought.\n\n**Design discipline:**\n\n- **Error declares the failure.** Specifically. "Card declined." "Couldn\'t reach the menu. Try again in a moment." "Scanner can\'t see the code." Not "An error occurred." Not "ERR_TX_REJECTED."\n- **Error explains in user-language.** Technical codes belong in logs, not on the user\'s screen. If the underlying cause is genuinely useful to surface (network-down state for an interactive kiosk in a corporate setting), translate.\n- **Error offers a path forward.** Retry, alternate method, get help, abandon. Never a dead-end. Even "the system is unavailable, please come back later" is a path (the user knows to leave).\n- **Error preserves user input.** Form input retained; user shouldn\'t re-type after a single validation fail. Selection state preserved; user shouldn\'t re-select after a "couldn\'t connect, try again".\n- **Error distinguishes categories.** *User error* (action didn\'t succeed, retry sensibly). *System error* (the system has a problem, not the user\'s fault). *Abandonment* (timeout, idle reset). Each has its own treatment.\n- **Error is calm in tone where possible.** A "card declined" screen designed in shouting red feels accusatory; the user did nothing wrong (the bank declined). Match the tone to what\'s actually happened.\n\n**Failure modes:**\n\n- Error as a stack of red text — accusatory and unhelpful.\n- Error as a generic toast — disappears before the user reads it.\n- Error with no recovery path — user stuck on an error Canvas with no way forward except staff intervention.\n- Error that erases user progress — single-field validation fail dumps the user back to step 1 of a 7-step flow.\n- Error category collapsed — every kind of failure ("declined" / "network down" / "wrong card type") shown identically; user can\'t pick the right recovery.\n- Error styled as alarm-grade visual when the failure is mundane — fatigues the user and the operator.\n\n## Maintenance\n\n**The state when the deployment is intentionally taken out of service — software update, content refresh, scheduled downtime, manual operator pause.**\n\n**Design discipline:**\n\n- **Maintenance is a Canvas, not a black screen.** The screen tells the user / operator that the deployment is intentionally offline and when it\'ll return.\n- **Maintenance distinguishes itself from error.** "We\'re updating menus — back in 5 minutes" reads differently from "Something went wrong." Different visual tone, different language.\n- **Maintenance has a return path.** Specific return time if known; vague "shortly" if not, with a contact route if relevant.\n- **Maintenance is operator-aware.** A factory-floor monitor in maintenance shows the operator badge / contact / instructions to bring it back online. A passerby-facing deployment shows a friendly message; the operator interface for resuming is gated by some access (Settings, password, key combo).\n\n**Failure modes:**\n\n- Maintenance = black screen — user thinks the device is broken.\n- Maintenance = the most-recent error state — implies failure, not intentional pause.\n- Maintenance without a return signal — operator forgets the deployment is paused; users walk away assuming the venue is closed.\n- Maintenance accessible to passerby — anyone can put the kiosk into maintenance and walk away.\n\n## When to design each state\n\nDifferent deployments live in different states most of the time.\n\n- **Signage / glance**: idle (= the running state), boot, occasional maintenance. Loading / empty / error rare; design lightly. Attractor sometimes a separate state for higher-energy deployments.\n- **Self-service kiosk / interact / transact**: idle, attractor (often = idle), boot, loading (per step), error (per failure category), occasional empty, maintenance. **All states must be designed**; this is the highest-flow-state-count category.\n- **Dashboard / monitor**: calm (= the running state, see [`monitoring-screens.md`](monitoring-screens.md)), stale-data variant, demand / alarm states, occasional empty (no data yet), error if feed is dead, maintenance.\n- **Dwell / ambient**: looping content (= idle), boot. Error / empty rare; treat lightly.\n\nDesign the states that will actually be visited. Skipping a state because it\'s "rare" is correct *only if* you can confirm it actually is rare in this deployment.\n\n## How to use this file\n\n1. **List which states this deployment will visit.** Not all states apply to every deployment.\n2. **For each, design the four answers** — who arrives, what they see, what they need to know, how they leave.\n3. **Verify the state\'s existence in preview.** Force-trigger each state via Automation or by editing Data values; capture a screenshot; view it back. A state you haven\'t seen is a state you haven\'t designed.\n4. **Surface every gap in the trade-off note.** If a state is in-scope but unverified for some reason (peripheral simulation not available, error mode hard to trigger), say so explicitly. The user reading the handoff should know which states have been actually tested in design.\n\nA flow declared done where only the golden path has been screenshot-verified is a flow with undesigned states. The next user will find them.\n',"bricks-ux/references/interaction-archetypes.md":"# Interaction Archetypes\n\nThe user in front of a BRICKS screen is doing one of six things. The archetype determines Subspace shape — Canvas count, dominant Brick families, motion vocabulary, what carries forward across the flow — and which UX disciplines weight strongest.\n\nPick the archetype first, then commit. Archetypes don't blend gracefully; a \"glanceable + interact\" hybrid is a sign that you need two Subspaces or one designed-as-archetype-X Subspace with a clearly bounded archetype-Y moment.\n\n## Glance\n\n**What the user does:** reads the screen in 1–2 seconds while passing. No interaction. No commitment. Often peripheral vision.\n\n**Where it lives:** lobby signage, transit platform info, queue-number displays, menu boards, ambient information screens, attractor loops between active sessions.\n\n**Rule set:**\n\n- Type at the *legibility floor for viewing distance* — calibrate to the deployment, not to instinct. A 75\" panel viewed from 4m needs body text at ≥ 4 grid units (with appropriate hardware); a 32\" panel at 1m can read smaller.\n- One primary idea per Canvas. Two competing headlines = neither lands.\n- Refresh cadence calm — content rotates on a slow rhythm (8–15 seconds per item). Anything faster crosses into demand-attention territory.\n- Hero continuity (Truth #3) — even glanceable signage benefits from a persistent element (logo, time, brand chrome) so the viewer's eye knows where they are returning to.\n- No affordance for interaction the hardware can't deliver. No hover, no implied \"tap for more\" on a no-touch panel.\n\n**Carries forward:** nothing. Each glance is self-sufficient.\n\n**Failure modes:**\n\n- Two-line headline at the edge of legibility — viewer can't read in 1.5 seconds, looks away.\n- Slideshow rotates faster than read time — viewer catches \"Item 4 of 12\" but never the title.\n- Content-dense layout imported from web — five sections fighting for the eye.\n- Affordance signals (chevrons, button-styled tiles, \"click here\" copy) where the hardware can't deliver.\n\n**Critical UX dimensions:** visual hierarchy, legibility floor, dwell-pacing.\n**Negligible UX dimensions:** in-flight visibility, error recovery, closure (the user doesn't act).\n\n## Browse\n\n**What the user does:** scans options without commitment. Reads multiple things looking for what's relevant. Looks at, doesn't necessarily decide.\n\n**Where it lives:** menu boards with multiple categories, schedule boards, room-availability displays, retail-shelf overhead screens, museum exhibit info.\n\n**Rule set:**\n\n- Layout supports comparison. Adjacent items should be visually parallel (same Brick shape, same scale) so the eye can shift between them.\n- One axis of variation per dimension — sort by category OR by time OR by price, not all three simultaneously without UI separation.\n- If the deployment is touch-capable, browse can promote to interact: tiles with deliberate pressable affordance (see [`pressable-composition.md`](pressable-composition.md)). On no-touch, browse stays pure read.\n- Carry forward minimal — if the user wanders away and comes back, the screen should be in the same readable state (no half-completed selection clogging the view).\n- Dwell time is real — viewer may stand there 5–20 seconds. Plan for it. Content should *reward* dwell with subtle motion (Standby on Brick lists, gentle highlights) without crossing into demand attention.\n\n**Carries forward:** sometimes selection state if browse promotes to interact; otherwise nothing.\n\n**Failure modes:**\n\n- Items styled too differently — eye can't compare, fragments instead of scans.\n- Excessive depth — a browse screen that requires drilling reads as interact, not browse.\n- Auto-rotation while user is browsing — content shifts mid-read, viewer loses place.\n- Empty browse state (no items today, gallery closed) treated as forgotten case — see [`flow-states.md`](flow-states.md).\n\n**Critical UX dimensions:** visual hierarchy, comparison legibility, empty/sparse state design.\n**Negligible UX dimensions:** transact discipline, alarm hierarchy.\n\n## Interact\n\n**What the user does:** drives a flow. Taps to choose, navigates between Canvases, completes a non-financial task — order something, request information, configure a setting, sign in to a non-payment portal.\n\n**Where it lives:** self-service ordering, ticket selection, info-kiosk requests, queue ticket dispensers, event check-in, configuration interfaces, language pickers.\n\n**Rule set:**\n\n- Every action gets the full 7-step journey (see [`user-journey.md`](user-journey.md)). Skipping any step is a UX failure.\n- Hero Bricks carry continuity across the flow Canvases (Truth #3). The brand chrome / progress indicator / step number should never disappear mid-flow.\n- Pressable affordance is unambiguous (see [`pressable-composition.md`](pressable-composition.md)). Tiles that look like tiles, taps that visibly land.\n- Idle reset — interact deployments are often left mid-flow. The Subspace must have an idle timeout that returns to attractor / boot state without preserving the abandoned session for the next user (unless explicitly designed for resumption).\n- Position memory — the user should be able to back out one step without losing the whole flow. Switch on a `flowStep` Data with persistent intermediate states.\n- Reduce decision pressure — short on-Canvas option lists (≤ 5 primary choices on one Canvas); promote to multi-Canvas if more.\n\n**Carries forward:** flow state (selection, configuration, pending submission) across Canvases until completion or reset.\n\n**Failure modes:**\n\n- 12-option grid that needs scrolling on Canvas 1 — overload, no scroll on BRICKS (Truth #10).\n- Continuation Canvas changes the location of the back action — user can't return.\n- Mid-flow content overload — every Canvas tries to summarise everything before, instead of advancing.\n- Idle timeout missing — next user inherits previous user's half-built order.\n- Recovery for no-input dead-ends absent — user walks away without completing; no abandonment cleanup.\n\n**Critical UX dimensions:** journey completeness (all 7 steps), affordance clarity, idle reset, position memory.\n**Negligible UX dimensions:** alarm hierarchy, monitoring discipline.\n\n## Transact\n\n**What the user does:** completes an action with stakes — payment, identity capture, signed agreement, regulated action. The cost of error is real (financial, legal, safety).\n\n**Where it lives:** payment terminals, self-checkout, identity verification, age check, regulated-document signing, controlled-access entry.\n\n**Rule set:**\n\n- The 7-step journey *tightens* (see `user-journey.md` \xa7 \"When the seven steps intensify\"). Confirmation before commit. In-flight visibility cannot be skipped. Recovery has explicit categories. Closure declares completion.\n- The *point-of-no-return moment* must be visually distinct from everything before and after. The user knows when they've committed.\n- Peripherals dominate — payment terminal, NFC reader, camera for ID. Each peripheral's state must be visible to the user. Generator events drive Switch transitions; never guess at peripheral state.\n- Audio cues if hardware allows — financial transactions benefit from non-visual confirmation (the user is often looking at the terminal, not the screen, mid-tap).\n- Path 2 verification (on-device DevTools) is mandatory for these deployments; the design must be tested on the real hardware with the real peripherals before declaring done.\n- No idle timeout *during* an active transact step — the system waits for the user, not the other way around. Idle timeout only between sessions.\n- Receipt / artifact handoff is part of the design — the closure Canvas waits for the printer event or the email-sent confirmation before declaring done.\n\n**Carries forward:** transaction state through to closure; nothing after.\n\n**Failure modes:**\n\n- Confirmation step skipped — user commits without realising.\n- In-flight state ≤ 200ms — the user double-taps because they don't see acknowledgement; second tap queues a duplicate.\n- Generic error recovery — \"Try again\" doesn't distinguish card-declined (try a different card) from network-down (wait and try) from user-cancelled (start over).\n- Closure transient — success Canvas auto-advances to idle in 1.5 seconds; user mid-blink, never saw confirmation; calls customer service.\n- Peripheral assumed instead of observed — design assumes card-tap is instant; in production the reader takes 2–3 seconds; users walk away thinking it failed.\n\n**Critical UX dimensions:** journey intensification, point-of-no-return clarity, in-flight visibility, recovery categories, closure weight, peripheral state visibility.\n**Negligible UX dimensions:** ambient pacing, dwell rhythm.\n\n## Monitor\n\n**What the user does:** watches changing state. Often peripheral attention — the screen is a stand-by surface that becomes the centre of attention when something changes. Not always actively read; trusted by reference.\n\n**Where it lives:** control rooms, factory floor monitors, network operations dashboards, security camera grids, transport-control screens, sensor-driven status boards, hospital nurse stations, AI-assistant monitoring panels.\n\n**Rule set:**\n\n- Calm-state default. The screen at rest should be readable and forgettable — operator can scan, look away, return.\n- Change must be detectable without being demanding — a subtle motion / colour shift / hierarchy promotion that draws the eye but doesn't startle. Demand attention is reserved for true alarms.\n- Stale-data trust principle — if the operator can't tell what's current, they will trust what they see. Stale state must be visibly declared.\n- Alarm hierarchy under stress — multiple simultaneous alarms must already have priority order designed. The screen sorts; the operator doesn't.\n- Show vs ask — a monitor screen often only *shows* state, leaving action to operator judgement; sometimes it *suggests* action (highlighted protocol button). Decide which it is; not both.\n- Full coverage in [`monitoring-screens.md`](monitoring-screens.md).\n\n**Carries forward:** operator's mental model of \"what was last normal\" — design with this in mind, since change-from-baseline is the operator's real read.\n\n**Failure modes:**\n\n- Every data field updates identically — operator can't distinguish meaningful change from background fluctuation.\n- Alarms styled the same regardless of severity — minor warning indistinguishable from critical alert.\n- Stale-data badge in 8pt corner type — operator never sees it.\n- Color-only encoding (red for alarm, green for normal) — fails for colour-blind operators and in low-contrast environments.\n- Loading state designed, empty state forgotten — fresh deployment shows \"—\" everywhere with no explanation.\n\n**Critical UX dimensions:** calm/detect/demand hierarchy, stale-data trust, alarm priority, accessibility (operators may be on shift, fatigued, in suboptimal viewing conditions).\n**Negligible UX dimensions:** dwell pacing, single-action affordance discipline.\n\n## Dwell\n\n**What the user does:** inhabits the space. The screen is ambient — wallpaper for a hospitality lobby, a hotel-room TV channel, a restaurant ambient display, a museum atmospheric backdrop, a brand-experience wall.\n\n**Where it lives:** hotel and hospitality lobbies, restaurant ambiences, retail mood walls, brand-experience installations, event backdrops, spas, premium reception areas.\n\n**Rule set:**\n\n- Content rotates slowly — 15–60 seconds per item depending on register. Field.io-style motion poetics can run continuous loops; Kenya Hara photographs hold longer.\n- No interaction. No affordance. The screen does not invite touching.\n- Visual quality at maximum — assets must score high on the 5-10-2-8 craft bar (see `bricks-design/when-the-brief-is-branded.md`); poor assets in a dwell context degrade the surrounding brand more than they would in a glanceable signage context.\n- Motion has continuity — Truth #3 hero auto-tween across Canvases keeps the dwell experience reading as one piece rather than a slide rotation.\n- Day-night awareness if relevant — dwell deployments often run 24-hour; design adapts to ambient luminance, time-of-day, scheduled content.\n- Sound (if hardware allows) is part of the design — ambient music selection, volume scheduling, silence as deliberate.\n\n**Carries forward:** nothing per-user; only the slow rhythm of the loop itself.\n\n**Failure modes:**\n\n- Looped motion at the wrong speed — too slow reads as broken, too fast reads as nervous. Calibrate.\n- Content variation insufficient — the same three Canvases looping every 30 seconds for 14 hours reads as broken signage.\n- Day-night neglected — dwell loop blasting bright content into a darkened lounge at 11pm.\n- Decorative motion competing with the brand chrome — the dwell loop should feel of-a-piece with the venue, not be a separate visual register.\n\n**Critical UX dimensions:** asset quality, motion continuity, content variation, ambient-luminance awareness.\n**Negligible UX dimensions:** affordance, journey completeness, alarm hierarchy.\n\n## Hybrid and transitions\n\nReal briefs sometimes span archetypes:\n\n- **Glance → Interact**: signage that becomes interactive when a user approaches (BLE proximity, camera detection). Treat as a Subspace state machine — glanceable Canvas as default, transition into interact Subspace on approach event. Don't try to make one Canvas serve both; the design discipline differs.\n- **Browse → Transact**: retail menu that promotes to ordering. Same — boundary Canvas with explicit \"I want to order\" affordance.\n- **Monitor → Interact**: dashboard with an action button (acknowledge alarm, dispatch protocol). The action follows the full 7-step journey; the monitor part follows monitoring discipline.\n- **Dwell → Glance**: ambient screen that occasionally surfaces information (welcome message for VIP, time-sensitive promotion). Add a glance Canvas as a temporary state, return to dwell after.\n\nIn every case, the transition itself is a designed moment, not an accident.\n\n## How to use this file\n\n1. **Pick the archetype** as part of Priority #0 — what is the user doing in front of the screen?\n2. **Apply the rule set** as the design's starting constraints.\n3. **Check the failure modes** before declaring the design done — most are specific to the archetype.\n4. **Note the UX dimension weights** — let critique focus where it matters for the chosen archetype.\n\nIf you find yourself wanting to follow rules from a different archetype, the brief may actually be that archetype. Pick again.\n","bricks-ux/references/monitoring-screens.md":'# Monitoring Screens\n\nA monitoring screen is a designed reading surface, not a designed flow. The user — operator, controller, observer — is not driving an interaction; they are absorbing state. The discipline is entirely about what they *see* and *trust*, not what they *do*.\n\nThis file is the UX layer. Runtime semantics (Generators, Data event subscriptions, Switch thresholds) live in `bricks-design/architecture-truths.md` — particularly Truth #4 (Switches compare, Data Hit/Not-Hit only matches) and Truth #5 (Generators are headless / async / event-driven). Use them as the substrate. The design question is *what the screen shows about the state of the world*.\n\n## The three states a viewer reads\n\nA monitor screen is always in one of three reading-states. Designing for one without the others produces a screen that works in calm and fails under stress (or vice versa).\n\n### Calm — scanning for the absence of trouble\n\nThe default state. Nothing requires attention. The viewer\'s job is reading at a glance and confirming "still nominal." This state is on the screen 95% of the time.\n\n**Design discipline:**\n\n- **Readable and forgettable.** The viewer should be able to absorb the screen in one peripheral-vision pass, look away, and feel confident nothing changed. Visual rhythm should be calm, predictable, with no demand-attention motion.\n- **Hierarchy by role, not by activity.** The most-important-thing-to-monitor stays in the same place even when it\'s calm. Operators learn the screen by location; shifting layout based on which metric is most active destroys that mental model.\n- **Subtle motion is permitted.** A sweep-second hand, a gentle pulse on the "live" indicator, a slow re-flow of a chart. The point is to confirm the screen is alive, not to draw the eye. `Animation` `runType: \'loop\'` is legitimate here precisely for "the screen is breathing" signalling.\n\n**Failure modes:**\n\n- Calm-state screen so visually busy that the viewer can\'t tell normal from abnormal at a glance.\n- Calm with no "alive" signal — the operator can\'t tell if the screen is frozen or actually displaying current state.\n- Hierarchy that shifts based on data values — the top-of-screen item swaps because of recent activity, and the operator\'s eye-anchor is gone.\n\n### Detect — change worth noticing\n\nSomething shifted. It isn\'t urgent, but it\'s worth the viewer\'s attention. A sensor crossed a soft threshold, a counter incremented, a new item entered the queue, a node went from 99.9% to 99.3% uptime.\n\n**Design discipline:**\n\n- **Show, don\'t ask.** The change should be detectable peripherally — a colour shift, a soft pulse on the affected item, a slow scale-up. The viewer can catch it without breaking focus from other things.\n- **Local, not global.** The change is localised to the affected Brick / region; the rest of the screen stays calm. Global re-styling of the whole Canvas for a single sub-system change is over-reaction.\n- **Time-bounded acknowledgement.** A detect-state visual should hold for long enough to be noticed (say 5–15 seconds), then quietly subside or escalate, depending on what happened next.\n- **Hero continuity.** Truth #3 — the chrome around the changing element does not also re-render. The eye lands on what moved.\n\n**Failure modes:**\n\n- Detect-state styled identically to calm — the viewer can\'t see anything changed.\n- Detect-state escalates immediately into demand styling (loud, motion-heavy, audible) — false alarm fatigue. The viewer learns to ignore "alarms" that are really just minor changes.\n- Detect-state persists indefinitely — small changes from yesterday still highlighted on today\'s screen; visual debt accumulates; nothing reads as fresh.\n\n### Demand — compel response\n\nA threshold breach. Something is wrong; the operator needs to act. This is the only state where the screen is allowed to *interrupt* the viewer.\n\n**Design discipline:**\n\n- **Unambiguous shift in register.** A clear visual rupture from calm — bold colour, accelerated motion, on-screen size, possible audio cue. The viewer\'s eye lands within a second.\n- **Action-pathing visible.** If the operator is expected to do something (acknowledge, dispatch, escalate), the action is on-screen and reachable. If they\'re expected to look elsewhere (radio, terminal), the screen says so.\n- **No false demand.** Demand state is earned by genuine threshold breaches; not by every-blue-moon variance. Demand-fatigue is the most expensive failure mode of a monitoring deployment — operators learn to dismiss real alarms because there were too many false ones.\n- **Persistent until cleared.** Demand state holds until the underlying condition resolves *or* the operator explicitly acknowledges. It does not time out on its own.\n- **Severity tiers** if the deployment has more than one demand level (warning / critical / emergency). Each tier reads distinctly; an operator under stress must be able to triage in one look.\n\n**Failure modes:**\n\n- Demand state styled subtly — operator misses it because it doesn\'t stand out.\n- Multiple concurrent demand states styled identically — no priority order; the operator picks one arbitrarily.\n- Demand state auto-clears after a timer — the underlying condition is still active; the screen has gone silent on it; the operator believes things are fine.\n- Demand state uses motion that overwhelms — every demand item flashes; the screen becomes unreadable.\n\n## The transitions between states are designed\n\nCalm → Detect → Demand → Calm is not a state machine the runtime hands you. It\'s a designed UX transition the agent commits to. Shared Brick auto-tween (Truth #3) carries the affected item across the transition; the chrome around it stays.\n\n- **Calm → Detect.** A subtle promotion. The affected Brick scales by 5–10%, gains a soft colour overlay, gets a subtle Standby Transition pulse. The eye is invited, not yanked.\n- **Detect → Demand.** A clear escalation. The affected Brick gains strong styling — a contrasting outline, a faster pulse, a colour shift to alarm tone — and possibly promotes in screen hierarchy (becomes larger, moves to a dedicated alarm region).\n- **Demand → Calm.** The release is also designed. Operator acknowledges or condition resolves; the affected Brick returns to its calm pose with a Standby Transition. The transition reads as relief, not as the screen forgetting.\n\nEach transition is a Switch on a state Data with thresholds (Truth #4). Each step in the transition has its own Brick configuration. The agent commits to the visual story across the four states, not just the calm baseline.\n\n## Stale-data trust principle\n\n**Stale data is worse than no data.** If the viewer cannot tell whether what they\'re seeing is current, they will trust what they see and act on it. Staleness must be *visibly declared* — not as fine-print, as a visible state change.\n\n**Design discipline:**\n\n- Every live-data Brick should have a visible "data age" or "last update" indicator, or a Switch-driven visual state for staleness. Background colour shift, opacity drop, "STALE" badge, or full handover to a "feed is down" Canvas if all sources are stale.\n- The threshold for "stale" is a design decision per source. Sub-second feeds (sensor stream) are stale after a few seconds. Minute-cadence feeds (weather, news) tolerate longer. Per-source thresholds belong in Data, not hardcoded everywhere.\n- A feed that loses its source entirely must not silently freeze on its last value — the screen must visibly transition to a no-data state. The operator can then route around it.\n\n**Failure modes:**\n\n- No staleness indicator at all — viewer trusts last-known-value forever.\n- Staleness indicator at 8pt in the corner — invisible to peripheral vision.\n- Stale value styled identically to current value — operator looks at "23\xb0C" and acts on it; the reading is from 4 hours ago.\n- "Last update" shown but in a format the viewer must parse — "15:42:03" with no relative time framing. Relative ("2 minutes ago") beats absolute when "is this current" is the question.\n\n## Show vs ask — a design decision\n\nSome monitor screens *show* — they display state, leave action to operator judgement, never suggest. Air traffic control. Power-grid status.\n\nOthers *show and ask* — they display state and surface protocol actions at the right moment. Hospital nurse stations. Building security. A "page nurse" button appears next to a patient whose vitals shifted; an "acknowledge alarm" button appears with a fire-system trigger.\n\n**Decide which it is per deployment, not per Canvas.** A monitor that sometimes asks and sometimes only shows confuses the operator about what they should be doing.\n\nOnce decided:\n\n- **Show-only** monitors should not have action buttons at all. Any "do something" lives in a separate system (operator radio, dedicated terminal). The monitor reads as documentation.\n- **Show-and-ask** monitors integrate the action affordance into the alarm hierarchy. The action affordance follows the 7-step journey (see [`user-journey.md`](user-journey.md)) — affordance, instruction, feedback on press, in-flight visibility, continuation, recovery, closure. The monitor returns to calm only after the operator\'s action is registered and the underlying condition clears.\n\n## Hierarchy under stress\n\nWhen multiple things demand attention at once — three alarms, two warnings, a stale feed — the screen must already have a priority order designed.\n\n**Design discipline:**\n\n- **Sort by severity, then by recency.** Critical alarms above warnings above advisories; within tier, newest at top. Operators learn the order; reading is faster.\n- **Don\'t dilute.** Two simultaneous critical alarms don\'t both shrink to fit; the second one takes a designed "stacked" slot rather than reducing the first.\n- **Aggregate count visible.** When more demand states exist than the screen surfaces in detail, an "N more" indicator preserves operator awareness of the full picture.\n- **The calm Bricks recede.** Under stress, the rest of the screen quietens — backgrounds desaturate, non-alarm items reduce opacity. The eye is led to the demand region.\n\n**Failure modes:**\n\n- All concurrent alarms styled identically — operator picks one arbitrarily, may not hit the most critical.\n- The most recent alarm overwrites the older one — older urgent alarms vanish from view.\n- Screen layout shifts under stress — the chrome moves; the operator\'s spatial mental model breaks.\n\n## Color is necessary but never sufficient\n\nCritical / warning / normal must be encoded redundantly — colour PLUS shape, position, weight, or text. Operators may be colour-blind; viewing conditions may be unkind to colour (sun glare on screen, monochrome failover, photocopy of the screen sent to a stakeholder, viewing through a tinted shield).\n\nSee [`accessibility.md`](accessibility.md) for the universal principle. For monitor screens specifically:\n\n- Critical alarms get a distinctive *shape* (diamond, hexagon, doubled border) on top of colour.\n- Severity indicated by *position* (top-of-list, dedicated alarm strip) as well as colour.\n- Numeric values that exceed threshold get a *prefix or sign* (▲, !, [HIGH]) — not just a colour change.\n\n## Refresh cadence is a UX decision\n\nHow fast data updates is a UX decision before it\'s a wiring decision. A power-grid status board updating every 100ms reads as nervous; the same data refreshing every 5 seconds with a clear "live" pulse reads as in-control.\n\n**Design discipline:**\n\n- Pick a refresh cadence per source that matches how the operator should be reading it. Cadence is about *the reading experience*, not about whether the data exists.\n- Visible animation of updates (a value tweens from 23.4 to 23.7 over 400ms) reads calmer than snap updates. Use it for ongoing readings, not for state transitions (those are snaps).\n- For cadence < 1 second, batch the perceived update — even if the underlying stream is 10Hz, the on-screen change rolls forward in human-readable beats.\n- For cadence > 30 seconds, the absence of motion can read as broken. Add a calm "alive" indicator that ticks even when data hasn\'t changed.\n\n## How to use this file\n\nBefore designing a monitoring screen:\n\n1. **Confirm Priority #0** — who is the operator, what are they reading, under what conditions, what\'s the cost of missing a state change.\n2. **Pick the show / show-and-ask posture.** Don\'t decide later; it shapes everything else.\n3. **Design all three reading-states** (calm / detect / demand) at the start, not just the calm one. Sketch the demand-state Canvas before the calm baseline lands.\n4. **Design the transitions** between states using shared Brick auto-tween (Truth #3) for affected items and Standby Transitions for the moment of change.\n5. **Design stale-data state per source.** No source is allowed to silently freeze.\n6. **Stress-test the hierarchy.** Stack 3 concurrent demand states in design preview; verify priority reads correctly.\n7. **Verify redundant encoding.** Take a monochrome screenshot; severity tiers should still be distinguishable.\n\nA monitor screen that passes calm-state critique but hasn\'t been designed for demand is half a deliverable.\n',"bricks-ux/references/pressable-composition.md":"# Pressable Composition\n\nThe composition decision and the wiring decision are the same decision. Affordance — *can I press this?* — is a UX signal the user reads off the screen. Pressable configuration is how that signal lands at the runtime. Get the configuration wrong and the screen lies to the user: a tile looks pressable but isn't, or is pressable but only on certain pixels. Either way, the user fights the design.\n\nThis file covers the configuration side. For the affordance discipline above it (when a thing should look pressable in the first place, how it joins the 7-step journey), see [`user-journey.md`](user-journey.md) step 1 and the relevant archetype rule set in [`interaction-archetypes.md`](interaction-archetypes.md).\n\nThe single principle: **every composite (multi-element) button needs a deliberate `on_press` decision per Brick, with `pressable` set explicitly wherever press chains layer.** The runtime auto-bypasses safe cases (see below), so the trivial wrapper case works without ceremony — but the design intent should still be readable from the configuration when chains compete.\n\nThere is no single mandated shape. Many arrangements work. The discipline is making the decision explicit where presses can collide, not following a recipe.\n\n## The values\n\n`Brick.property.pressable` accepts:\n\n- `'enabled'` — Brick receives press events; if it has an `on_press` chain, the chain runs.\n- `'disabled'` — Brick does not receive press events even if `on_press` is configured. Useful for runtime-disabled state via DataLink.\n- `'bypass'` — Brick is transparent to press events; the press passes through to whatever sits behind/around it.\n\n**Runtime auto-bypass.** Pressable-capable Bricks — `BrickText`, `BrickImage`, `BrickIcon`, `BrickRect`, `BrickSvg`, `BrickLottie`, `BrickRichText`, `BrickVideo`, `BrickVideoStreaming`, `BrickQRCode`, `BrickMaps`, `BrickGenerativeMedia` — with no configured press events (no `on_press`, no `on_focus`, no press/focus outlets feeding Switches or Animations) are auto-bypassed: the runtime renders them with `pointerEvents='none'` so taps fall through to the Brick underneath. A user-set `pressable` value always wins over auto-bypass.\n\n**Non-pressable families** — `BrickTextInput`, `BrickCamera`, `BrickSlideshow`, `BrickItems`, `BrickChart`, `BrickWebView`, `BrickRive` — manage their own interaction internally and are not auto-bypassed. Their pressable behavior is unchanged.\n\n`Brick.events.on_press` is the standard press handler — an array of `EventAction`s that runs on tap.\n\n## Common arrangements\n\n### Text-only press surface\n\nSimplest, most BRICKS-idiomatic.\n\n- One `BrickText` with an `on_press` chain.\n- The entire press surface is the text run itself.\n\nUse when: the visual is the text and only the text. Branding-light text links, in-flow CTAs.\n\n### Wrapped region (background, border, padding)\n\nThe moment you add a `BrickRect` (or any shape) as a tile, card, button background, or padded container, the press intent moves to the wrapper.\n\n- `BrickRect` carries `on_press`.\n- Inner Bricks (the text label, an icon, an image) sit on top with no press events of their own.\n- The runtime auto-bypasses pressable-capable inner Bricks without press events, so the wrapper's chain fires regardless of where on the tile the user taps. No explicit `pressable: 'bypass'` is required for the common case.\n- Setting `pressable: 'bypass'` on the inner Bricks is still good practice when the child is purely decorative: it documents the design and protects against later edits that wire press- or focus-driven effects onto the child (e.g., a Switch fed by a press outlet) and silently break the tile.\n\nUse when: the press surface includes background, border, padding, or composition beyond a single text run.\n\n### Composite tile (image + text + meta, all pressable as one)\n\nSame shape as the wrapped region, with more children.\n\n- Backing `BrickRect` carries `on_press`.\n- All visual children — image, headline, subhead, icon, meta — auto-bypass when they carry no press events of their own.\n- The user perceives one tile; the runtime sees one press surface.\n- Explicit `pressable: 'bypass'` per child remains a clarity discipline, especially in tile layouts that are duplicated and later edited — a stray press handler on one child would otherwise break that tile silently.\n\nUse when: a card, a row in a list (note: `Items` Brick has its own row press model — read the template), a media tile.\n\n### Mixed-action composite (rare but real)\n\nA composite where most of the surface does action A, but a small region does action B (e.g., a card whose body opens a detail view but whose corner heart icon toggles favorite).\n\n- Backing `BrickRect` carries `on_press` for action A.\n- Most children auto-bypass (no press events of their own).\n- The exception child (heart icon) carries its own `on_press` for action B. Because it now has a press chain, auto-bypass is off and the icon owns its hit region.\n- Caveat: ensure the exception child is large enough to hit reliably without colliding with the surrounding action A. If it's too small, users will fight it.\n\nUse when: genuinely needed. If you find yourself reaching for this often, the design is probably trying to do too much per tile — split into clearer affordances.\n\n## Failure modes\n\n### Overlapping pressables\n\nTwo or more children of a composite each carry their own `on_press` (or a Switch/Animation fed by a press/focus outlet). Auto-bypass doesn't apply — each child has events. The runtime resolves taps to whichever Brick owns that pixel; in practice this means inconsistent behavior depending on where the user actually lands.\n\n**Fix**: pick the press owner (usually the wrapper) and set the others to `pressable: 'bypass'` explicitly. The user-set value wins, so this forces the press through to the intended owner even when the loser Bricks have events.\n\n### Hidden press handlers on inner Bricks\n\nA composite that used to auto-bypass cleanly stops doing so after a Switch is wired to read a press or focus outlet on an inner Brick, or after an `on_press` is added to that child for an unrelated effect. The wrapper appears to lose hit area for that region without an obvious cause — auto-bypass is off the moment any press event is configured.\n\n**Fix**: when you wire any press- or focus-driven effect on a Brick inside a composite, set its `pressable` explicitly. If the effect should run *and* the wrapper should still win the tap, use `pressable: 'bypass'` on the child and drive the effect from the wrapper's chain instead.\n\n### Decorative overlay with unintended press chain\n\nA decorative `BrickRect` (frame edge, gradient overlay, spacing tile) sits in front of a pressable region and has press events wired — usually a leftover Switch trigger or copy-pasted from a real button. Auto-bypass doesn't engage, and the overlay silently consumes taps.\n\n**Fix**: any decorative overlay sitting in front of a pressable region should be `pressable: 'bypass'` explicitly. Treat \"transparent in front of pressable\" as a code smell that needs an explicit pressable decision — the runtime would auto-bypass a Brick with no press events, but the explicit value documents intent and survives future edits that wire effects into it.\n\n### Phantom hover on no-touch hardware\n\nCarried over from a web design with hover affordances — usually a Brick that brightens or shifts on press but the deployment is signage with no touch.\n\n**Fix**: drop the affordance, or move it to a state driven by a different signal (proximity sensor, scheduled time, Data from a peripheral Generator).\n\n### Web link semantics\n\nDesigners used to web habits sometimes add `<a>`-style underlines or color treatments expecting a navigation primitive.\n\n**Fix**: BRICKS has no link semantic. `on_press` triggers `CHANGE_CANVAS` (internal navigation), a Generator (external action — open URL, dial number), or a Subspace action. The visual treatment is a design choice; the navigation primitive is a press handler.\n\n### `pressable: 'disabled'` without visual signal\n\nA Brick is set to `disabled` programmatically (e.g., during a pending submission) but the visual doesn't change. Users tap and nothing happens — looks broken.\n\n**Fix**: pair `pressable: 'disabled'` with a Switch that alters appearance (opacity, color, an overlay) so disabled state is visible. This is also step 3 (immediate feedback) of the journey — the user must see that their tap was received *and* declined.\n\n### Long-press misuse\n\n`delayLongPress` is real — the runtime distinguishes tap from long-press. Useful for secondary actions on a primary tile (long-press to favourite, tap to open). Misuse: hiding *primary* actions behind a long-press because there isn't room for a button. Long-press is discoverable only to users who already know it; primary actions need primary affordances.\n\n### Press feedback collapsed\n\nA press registers — the wiring works — but there is no visual change at the moment of registration (no scale-down, no opacity flash, no Switch-driven highlight). This is the most common silent UX failure: the press works, the user can't tell, so they press again. See [`user-journey.md`](user-journey.md) step 3.\n\n**Fix**: every `on_press` must pair with a visible state change at registration. A 100ms scale-down via Standby is enough; the user's eye needs to land on *something* moving.\n\n## Decision checklist when authoring a composite button\n\nFor every Brick in the composite, answer:\n\n1. Does this Brick own a press chain — `on_press`, or a Switch/Animation fed by a press/focus outlet?\n2. If yes — should it own the tap, or should the wrapper own it?\n\nIf two or more Bricks answer \"yes\" on overlapping hit areas, set the loser(s) to `pressable: 'bypass'` explicitly. If only the wrapper has a press chain, pressable-capable inner Bricks auto-bypass — `pressable: 'bypass'` is recommended for clarity but not strictly required. Non-pressable family Bricks (TextInput, Camera, Slideshow, Items, Chart, WebView, Rive) follow their own interaction model and don't auto-bypass.\n\nIf any answer is \"I haven't thought about it\", the failure modes above are how it bites.\n","bricks-ux/references/user-journey.md":'# The Universal User-Journey Spine\n\nEvery interaction in a BRICKS Application — touch press, peripheral input, remote command, external trigger — passes through the same seven steps. Skip any of them and the design has a hole the user will fall into. The shape is universal across QR scan, face detection, BLE proximity, NFC tap, payment terminal, voice mic, touch tile, operator remote.\n\nThis file is the spine. Anything that isn\'t here probably belongs in a more specific reference (transact intensification, peripheral particulars, archetype rule sets).\n\n## The seven steps\n\n### 1. Affordance — "Can I do something here?"\n\nThe user must know the channel exists before discovering it by chance. A QR-scan zone with no scan-here label, a BLE-proximity threshold with no "approach to begin" hint, a touch tile that looks decorative — all fail at step 1.\n\nAffordance is the *invitation* to act. Without it, the rest of the journey is invisible.\n\n**BRICKS-native expression:**\n\n- A pressable region\'s visual treatment must declare "press me" — contrast, weight, a hint of motion via Standby Transition (gentle pulse), an icon. Use the runtime; don\'t rely on the user inferring touch from a flat Rect.\n- Peripheral channels need an instructive Brick in the line-of-sight: a scan-frame Image, a microphone glyph that lights when listening is possible, a "tap card here" overlay.\n- For ambient peripherals (BLE, camera detection), use a `valueHit` Data event on detection to *promote* the affordance — the screen invites the next step once the user is in range.\n\n**Failure modes:**\n\n- **Affordance hidden.** Pressable Brick visually indistinguishable from non-pressable. User walks past.\n- **Affordance present but ambiguous.** "Touch screen" floating with no anchor — touch *what*?\n- **Affordance promised, channel absent.** A scan frame drawn for a deployment that has no scanner.\n- **Affordance for absent capability.** Hover affordance on a no-touch panel; web-style cursor pointer on touch hardware.\n\n### 2. Instruction — "What do I do?"\n\nOnce the user is invited, they need to act. The instruction must be specific enough to act on without overspecifying. Match the user\'s likely mental model — a payment terminal is not a QR scanner; same Canvas should not pretend otherwise.\n\n**BRICKS-native expression:**\n\n- A short directive in `RichText` near the affordance: "Scan your QR code", "Tap to start", "Hold card to reader". Bind to a Data string for multilingual.\n- Iconography or animation that demonstrates the action (a hand reaching toward the reader, a card moving toward the panel). One demo, not a five-step diagram.\n- For unfamiliar peripherals (NFC, voice for new users), include a one-shot tutorial on first entry — a separate Canvas, not a permanent overlay.\n\n**Failure modes:**\n\n- **Instruction missing.** Affordance present, action unclear. Common with NFC and voice — users don\'t know they need to *speak* or *tap*.\n- **Instruction overspecified.** Five steps for a one-step action.\n- **Instruction in wrong language** for the actual user — pin to deployment locale.\n- **Instruction stays after the action.** "Scan now" still on screen after the scan succeeded — confuses about whether to scan again.\n\n### 3. Immediate feedback — "Did I do it?"\n\nThe instant between the user\'s action and the system\'s acknowledgement is the highest-anxiety moment in the flow. The user has *committed* — touched, scanned, tapped, spoken — and now needs proof their action registered.\n\nThis is non-negotiable. A flow that skips immediate feedback has a hole the user falls through every time.\n\n**BRICKS-native expression:**\n\n- A snap-cut visual change at the moment of registration (not a fade-in — fades read as ambient, snaps read as acknowledgement). Brick scale, opacity, or color change via Switch on the input event.\n- A Standby Transition on a new Brick that enters at the moment of acknowledgement — a checkmark, a state badge, a progress indicator.\n- For audio-enabled deployments, a short auditory cue at the moment of registration. Silent is OK; ambient music is not enough.\n- If the registration takes any perceptible time (peripheral confirming, network round-trip), step 3 still fires first — the *system received* you — then step 4 takes over for the *processing* state.\n\n**Failure modes:**\n\n- **Feedback skipped, jumps to continuation.** User can\'t tell if their action registered or the Canvas just changed for unrelated reasons.\n- **Feedback fades in slowly.** Fade reads as ambient, not as response. Use snap on the moment of registration.\n- **Feedback on the wrong Canvas.** User taps, Canvas A doesn\'t react, Canvas B (the next one) loads after a beat — user assumes nothing happened and taps again.\n- **Same feedback for success and failure.** A check-mark feedback for a payment that\'s still processing reads as success — user walks away from a partial transaction.\n\n### 4. In-flight visibility — "Is it being handled?"\n\nWhen the system needs time — peripheral confirming, network round-trip, Generator awaiting response — the user must know the system is working. Silent processing reads as broken.\n\n**BRICKS-native expression:**\n\n- A clear in-flight Brick set: spinner, progress indicator, animated state badge. Use `Animation` `runType: \'loop\'` here — this is a legitimate loop use (continuous attention-draw signalling activity).\n- The trigger affordance disables (`pressable: \'disabled\'` or Switch-driven hide) so the user can\'t trigger again.\n- Time-bounded: if the in-flight state can plausibly take > 5 seconds, surface a progress estimate or a continued-activity reassurance ("Still processing — this can take up to 30 seconds"). Don\'t leave the user staring at an unchanging spinner past their patience threshold.\n- For peripherals: the peripheral\'s own state (Generator event from the device) should drive Switch transitions, not a guess at how long it\'ll take.\n\n**Failure modes:**\n\n- **No in-flight state at all.** Action triggered, Canvas frozen until result. User taps again; second action queues; chaos.\n- **In-flight state visually identical to idle.** No motion, no change in tone — user can\'t tell whether the system is working or stalled.\n- **In-flight state with no time-out.** System hangs; Canvas stays on "processing…" forever. Every in-flight state needs a Generator-driven failure path back to step 6.\n- **In-flight state allows re-trigger.** User can press again, queues duplicate work — especially bad for transact flows.\n\n### 5. Continuation — "What\'s next?"\n\nThe action succeeded; what now? The user needs to know whether they continue here, move to a next state, walk away, or hand over to a peripheral / operator.\n\n**BRICKS-native expression:**\n\n- A Canvas change is the most common continuation — Switch on the success Data event, new Canvas with the next prompt or the result.\n- For flows that loop (slideshow, ambient signage), continuation can mean returning to attract / idle state.\n- The continuation Canvas\'s hero Brick(s) share id with the previous Canvas\'s hero — Truth #3 auto-tween carries the user across with continuity, not by hard cut.\n- If continuation is "stay here, do another thing," the prompt must update — the user shouldn\'t have to guess that they can act again.\n\n**Failure modes:**\n\n- **Continuation ambiguous.** Success acknowledged but the user is left on a static Canvas with no next-step prompt. They wait, then walk away.\n- **Continuation surprises.** Success on Canvas A, but Canvas D loads next — the journey shifts in a way that didn\'t match the user\'s mental model.\n- **Continuation lacks closure for some users.** A receipt flow that auto-advances after 3s before the user has read the confirmation.\n\n### 6. Recovery — "What if it went wrong?"\n\nError states are first-class designed states, not afterthoughts. The recovery path tells the user what failed, why if relevant, and how to proceed — including the option to abandon.\n\n**BRICKS-native expression:**\n\n- A dedicated error Canvas (or a clearly distinct error state on the current Canvas, Switch-revealed). Not a tiny red text in a corner.\n- The error declares the cause in user-language: "Card declined" not "ERR_TRANSACTION_REJECTED". "Couldn\'t read the code — try moving closer" not "Scanner timeout".\n- The recovery offers a path — retry, alternate method, get help, abandon — never just states the failure.\n- Form input retained across error — user shouldn\'t re-type after a validation fail.\n- For peripherals, distinguish *user error* (action failed; retry) from *system error* (device unavailable; not the user\'s fault) from *abandonment* (timeout; resume or restart).\n\n**Failure modes:**\n\n- **Recovery as dead-end.** "Error. Please try again." with no path forward.\n- **Recovery erases progress.** User restarts from step 1 of a 5-step flow after a single-step failure.\n- **Recovery in unrelated language.** Technical error codes shown to end users.\n- **Recovery missing for the silent failures.** Peripheral disconnected mid-flow with no recovery path — user assumed it\'d just work.\n- **Same recovery for all error types.** User can\'t distinguish "try again" from "the system is broken, walk away" from "you need to do something different".\n\n### 7. Closure — "When can I leave?"\n\nEspecially in transact flows, the *past-the-point-of-no-return* moment must be explicit. The success state must declare the action complete in a way the user trusts before they walk away.\n\n**BRICKS-native expression:**\n\n- A success Canvas with weight — a confident headline, a check or stamp graphic, a printed-receipt analogue if applicable. Not a transient toast.\n- The success Canvas must hold visibly for enough time that a careful user reads it (5–10 seconds for a transact closure; 2–3 for routine completion) before auto-advancing or resetting to idle.\n- For ongoing actions (registered, will-be-notified), the closure must clarify the future: "You\'ll receive a confirmation by email" or "We\'ll call you when ready" with the expected wait clearly stated.\n- For closures that have a physical artifact (receipt, ticket, badge), the artifact\'s presence is part of the closure — the Canvas waits for the printer event before declaring done.\n\n**Failure modes:**\n\n- **Closure transient.** Success shown for 800ms, auto-advances to idle. User mid-blink, never saw confirmation.\n- **Closure ambiguous with in-flight.** Success badge in the same visual tone as the processing spinner — user uncertain whether they\'re done.\n- **Closure missing for irreversible action.** Payment confirmed by terminal but no on-screen success — user walks away unsure, doubles up via a second tap.\n- **Closure carries forward as a state the user can edit.** Success Canvas with input fields the user can change — implies the action isn\'t really committed.\n\n## When the seven steps compress\n\nSome interactions naturally collapse steps. Don\'t pad; collapse with intention.\n\n- **Glance-archetype loops** (signage, attractor): the user doesn\'t act. Step 1 (affordance) collapses to "attention", step 5 (continuation) to "loop", steps 3, 4, 6, 7 don\'t apply. Only 1, 2, 5 are live.\n- **Pure-monitor screens**: user doesn\'t act. Steps 1–4, 6, 7 collapse; the design is entirely about reading the state (see [`monitoring-screens.md`](monitoring-screens.md)).\n- **One-step transact** (NFC tap-and-go without amount confirmation): steps 1–4 fire in rapid sequence, but each still must be present — affordance, instruction, registration feedback, in-flight visibility, even if the in-flight is <1 second.\n\nCollapse means *fewer steps*, not *skipped steps*. A step you\'ve skipped is a hole, not a compression.\n\n## When the seven steps intensify (transact)\n\nFor payment / identity capture / safety-critical actions, the journey tightens:\n\n- **Step 2 (instruction) gets a confirmation step bolted on** — "You\'re about to charge $42.50. Confirm?" — a designed checkpoint Canvas before commit.\n- **Step 4 (in-flight visibility) cannot be skipped or hurried** — even a sub-second processing moment needs explicit visual presence. The cost of a missed in-flight is the user double-tapping a $42 charge.\n- **Step 6 (recovery) gets explicit categories** — card declined / network error / user cancelled / timeout — each with its own recovery path. A generic "Try again" is insufficient.\n- **Step 7 (closure) gets longer hold time + receipt** — the user must trust the transaction completed; cheap closures invite dispute.\n\nThis intensification is enough that transact flows often deserve a separate design pass; for v1 of this skill, treat it as the loudest application of the seven-step spine.\n\n## How to use this file\n\nWhen designing any interaction:\n\n1. **Open the seven steps.** Walk the flow as the user would.\n2. **For each step, name** what the user sees / what the system does / how feedback manifests / what fails. If you cannot fill all four for a step, that step is unfinished.\n3. **Check the failure modes per step.** Each is a thing agents commonly skip. Caught here is cheap.\n4. **Express in BRICKS primitives.** Each step has expression notes — which Brick families, which architecture truths (Truth #3 hero auto-tween across the journey; Truth #5 Generator async; Truth #7 Standby Transition for feedback).\n\nThe spine doesn\'t tell you what to design. It tells you which holes to *not have*.\n',"bricks-ux/references/ux-critique.md":'# UX Critique\n\nVerification proves the flow *runs*. UX critique proves the flow is *usable*. Both are required before declaring done; neither substitutes for the other.\n\nUX critique runs in parallel with visual-design critique (`bricks-design/design-critique.md`). A Canvas can fail one and pass the other; both block ship.\n\nThis file is tiered. The same UX problem (e.g., closure missing) is **CRITICAL** on a payment kiosk and **MEDIUM** on a museum signage loop. Critique fails ship when CRITICAL or HIGH items go unaddressed in their applicable tiers.\n\n## How to run the pass\n\n1. **Open the journey.** Walk every interaction step-by-step using `user-journey.md` as the spine.\n2. **For each Canvas / Brick group, classify by deployment risk** (table below). The classification determines which tier of checks apply.\n3. **Run the checks in the applicable tier(s).** CRITICAL items always run; HIGH applies broadly; MEDIUM and LOW depend on classification.\n4. **Fix every CRITICAL miss and every HIGH miss.** Surface MEDIUM and LOW misses in the trade-off note if not addressed.\n5. **Re-verify after fixes.** Don\'t accumulate fix debt.\n\n## Risk classification by deployment shape\n\n| Deployment shape | Risk profile | Tier weighting |\n|---|---|---|\n| Payment / identity capture / safety-critical | CRITICAL-dense — every transact discipline must pass | CRITICAL + HIGH + MEDIUM all apply |\n| Self-service interactive (ordering, check-in, configuration) | HIGH-dense — journey completeness, idle reset, recovery paths | CRITICAL + HIGH apply; MEDIUM where relevant |\n| Monitoring / dashboard / control room | HIGH-dense — alarm hierarchy, stale-data trust, calm/detect/demand | CRITICAL + HIGH apply for alarm states |\n| Browse / wayfinding / menu board | MEDIUM-dense — legibility, comparison clarity, sparse states | HIGH legibility, MEDIUM elsewhere |\n| Glanceable signage / dwell / ambient loop | LOW-dense — main checks are legibility and rhythm | HIGH legibility, LOW elsewhere |\n\n## CRITICAL — blocks ship\n\nFailure on any of these is sufficient grounds to declare the work mid-iteration.\n\n### CR-1. The user-journey spine is whole\n\nEvery interaction must have all seven steps present (or deliberately compressed; see `user-journey.md` \xa7 "When the seven steps compress"). Most-common holes:\n\n- **Immediate feedback missing** (step 3). User taps, nothing visible, taps again.\n- **In-flight visibility missing** (step 4). Action triggered, screen frozen, user re-triggers.\n- **Recovery as dead-end** (step 6). Error Canvas with no path forward.\n- **Closure ambiguous or missing** (step 7). Success state transient or unclear.\n\n**Must Have:** every interaction has a designed and verified affordance, instruction, feedback, in-flight state, continuation, recovery, closure — or deliberate documented collapse.\n**Anti-Pattern:** journey skipping any step on the assumption "it\'s fast enough not to need".\n\n### CR-2. Transact has its intensification\n\nFor payment / identity / safety-critical flows, the seven steps must be tightened (`user-journey.md` \xa7 "When the seven steps intensify"):\n\n- Confirmation step before commit.\n- In-flight visibility non-skippable.\n- Recovery categorised (declined / network / cancelled / timeout).\n- Closure with weight and hold time.\n\n**Must Have:** transact closure holds ≥ 5 seconds, success unmistakable, peripheral state visible.\n**Anti-Pattern:** "Process payment in one tap" with no confirmation; closure that auto-advances in < 2s.\n\n### CR-3. Monitoring has demand discipline\n\nFor dashboards / monitor screens with alarm capability:\n\n- Calm / detect / demand are three distinct designed states.\n- Demand state stands out unambiguously; not a slight colour change.\n- Multiple concurrent demand states have priority ordering already designed.\n- Stale-data is visibly declared per source.\n- Color is never the only encoding of severity.\n\n**Must Have:** alarm-state preview captured and reviewed; squint-test passes (alarm visible from peripheral vision); monochrome preview still distinguishes severity tiers.\n**Anti-Pattern:** alarm styled identically to detect-state; "stale" indicator at 8pt in corner; severity by colour alone.\n\n### CR-4. Accessibility floors met for the audience\n\nThe seven accessibility disciplines (`accessibility.md`) apply at deployment-relative floors. CRITICAL when the audience includes:\n\n- Reduced-vision users (contrast, scale, color-not-only).\n- Reduced-motor users (touch targets, no precise gestures, no time-pressure auto-cancels).\n- Sensitive-to-motion users (reduced-motion path available).\n- Multilingual audience (strings via Data; type scale accommodates longest translation).\n\n**Must Have:** contrast verified under deployment-actual lighting; touch targets verified with real-finger / real-hardware testing; severity / status encoded by shape + color + label.\n**Anti-Pattern:** WCAG-compliance-on-desktop-monitor as the audit (deployment is sunlit signage at 4m); time-pressure UI on a venue that includes slow / hesitant users.\n\n### CR-5. Idle reset is clean\n\nFor self-service interactive deployments:\n\n- Idle timeout exists and is calibrated to the use pattern.\n- Idle reset clears flow state — no half-built order persists; no name on screen; no half-confirmed action.\n- Reset returns to a designed idle / attractor state, not to "whatever Canvas was loaded".\n\n**Must Have:** verified idle reset behaviour via Automation or live test; verified that no leaked state persists to next session.\n**Anti-Pattern:** idle = last interact Canvas; idle that requires operator to manually reset.\n\n## HIGH — must fix before launch\n\n### H-1. Affordance is unambiguous\n\nEvery pressable Brick declares "press me" visually — contrast, weight, motion, or icon. Affordance vocabulary is consistent across the deployment.\n\n**Must Have:** pressable tiles visually distinct from non-pressable; squint test confirms which Bricks are interactive.\n**Anti-Pattern:** identical-looking tiles where some are pressable and some aren\'t; pressable Bricks with no visual distinction from background.\n\n### H-2. Press feedback at registration\n\nEvery `on_press` produces a visible state change at the moment of registration — scale, opacity, color, or new Brick entry via Standby Transition. Not a fade-in.\n\n**Must Have:** Brick under press visibly responds within 100ms (effectively snap, not fade).\n**Anti-Pattern:** press registers, no visible change; press relies on Canvas-change-only feedback (user perceives lag).\n\n### H-3. Flow states designed, not skipped\n\nIdle / loading / empty / error / boot / maintenance (as applicable to the deployment) are designed states, each with verified preview.\n\n**Must Have:** every applicable state\'s preview captured and reviewed; failure modes per state checked against `flow-states.md`.\n**Anti-Pattern:** "empty state is fine, the list is always populated" without testing the empty case; error state in 8pt corner text; boot = loading spinner.\n\n### H-4. Hero continuity across journey Canvases\n\nFor multi-Canvas flows, hero Bricks share ids across Canvases — chrome (logo, progress indicator, time, back action) carries via Truth #3 auto-tween.\n\n**Must Have:** primary chrome elements identifiable in the same screen positions across the flow\'s Canvases.\n**Anti-Pattern:** every Canvas remounts its full Brick set; user loses spatial mental model between steps.\n\n### H-5. Error recovery has a path\n\nEvery error state offers retry, alternate method, abandon, or help — never a dead-end. Different error categories get distinguishable recovery treatments.\n\n**Must Have:** each error path verified end-to-end via Automation or live test.\n**Anti-Pattern:** "Error. Please try again." with no retry mechanism; generic recovery for all error types.\n\n### H-6. Stale-data trust\n\nFor monitoring / live-data screens, every dynamic source has a visibly declared staleness state or a visible "last update" relative-time indicator.\n\n**Must Have:** staleness visible in peripheral vision; stale value distinguishable from current value.\n**Anti-Pattern:** dynamic value with no age indication; "last update" in 8pt absolute timestamp.\n\n### H-7. Predictable navigation\n\nNavigation affordances (back, next, home) sit consistently across Canvases. Idle returns to the same idle Canvas every time.\n\n**Must Have:** back / next affordance positions verified across Canvases; idle reset produces identical idle Canvas every time.\n**Anti-Pattern:** back button at top-left on Canvas 2, bottom-right on Canvas 3; idle rotates such that the "anchor" element moves.\n\n## MEDIUM — impacts polish; prioritize by user impact\n\n### M-1. Instruction matches user mental model\n\nAction instructions ("Scan your code", "Tap to start", "Pay now") match the user\'s likely understanding; jargon avoided; language locale-matched.\n\n**Must Have:** wording reviewed for the actual audience; jargon removed.\n**Anti-Pattern:** "Initiate authentication sequence" on a public kiosk; English-only instruction on a multilingual venue.\n\n### M-2. Continuation is non-surprising\n\nThe Canvas the user lands on after an action matches their expectation. Big jumps in journey context happen only with explicit transition.\n\n**Must Have:** continuation Canvas reviewed for context preservation; hero continuity in place.\n**Anti-Pattern:** success on Canvas A jumps to Canvas D mid-flow; user loses context.\n\n### M-3. Closure proportional to stakes\n\nSuccess closure hold time and visual weight match the action\'s stakes. Routine completions get brief acknowledgement; transact completions get held visible.\n\n**Must Have:** closure hold time tuned to action stakes; auto-advance only after enough time for the user to read.\n**Anti-Pattern:** 1.5s closure for a transact flow; 8s closure for a "saved to favorites" toast.\n\n### M-4. Density rhythm in browse / dwell\n\nFor browse / dwell deployments, content rotation has variation in density / framing / colour rhythm across Canvases or slides. Three identical-rhythm Canvases in a row is a tell. (Cross-reference: `bricks-design/design-critique.md` density-rhythm collapse.)\n\n**Must Have:** rhythm variation across the sequence; no three identical-archetype Canvases in a row.\n**Anti-Pattern:** ten Canvases that all read as "headline + bullet list".\n\n### M-5. Audio cues calibrated (when hardware allows)\n\nIf the deployment uses audio, volume / timing / time-of-day awareness is intentional.\n\n**Must Have:** audio volume / scheduling reviewed; success / alarm cues distinguishable from ambient.\n**Anti-Pattern:** constant-volume cues regardless of time; audio-only confirmation (no visual pair).\n\n### M-6. Reduced-motion path available (if relevant)\n\nFor deployments in clinical / safety / motion-sensitive contexts, a reduced-motion path exists.\n\n**Must Have:** `reduceMotion` Data flag wired where applicable; verified reduced-motion preview.\n**Anti-Pattern:** continuous-motion design with no reduction path for a clinical deployment.\n\n## LOW — context-dependent\n\n### L-1. Polish on idle / attractor presence\n\nFor deployments where idle dominates: idle is *inviting*, not just *running*.\n\n**Must Have for high-traffic public deployments:** attractor sequence engages from peripheral vision.\n**Anti-Pattern:** logo-only idle on a deployment whose purpose is to invite interaction.\n\n### L-2. Maintenance state designed\n\nIf the deployment has scheduled downtime, a maintenance Canvas exists and distinguishes itself from error.\n\n**Must Have for deployments with maintenance windows:** maintenance Canvas with return path.\n**Anti-Pattern:** maintenance = black screen.\n\n### L-3. Empty-state composition\n\nEmpty states explain the absence and suggest what populates.\n\n**Must Have:** empty state designed rather than collapsed-whitespace.\n**Anti-Pattern:** "—" or blank where content would be.\n\n## Tier-by-tier checklist (running order)\n\nUse this when running the pass:\n\n**CRITICAL (always run):**\n\n- [ ] User-journey spine whole (CR-1)\n- [ ] Transact intensified if applicable (CR-2)\n- [ ] Monitoring demand discipline if applicable (CR-3)\n- [ ] Accessibility floors met (CR-4)\n- [ ] Idle reset clean if applicable (CR-5)\n\n**HIGH (always run except for glance / dwell loops):**\n\n- [ ] Affordance unambiguous (H-1)\n- [ ] Press feedback at registration (H-2)\n- [ ] Flow states designed (H-3)\n- [ ] Hero continuity across Canvases (H-4)\n- [ ] Error recovery has a path (H-5)\n- [ ] Stale-data trust if applicable (H-6)\n- [ ] Predictable navigation (H-7)\n\n**MEDIUM (run for interact / transact / browse):**\n\n- [ ] Instruction matches mental model (M-1)\n- [ ] Continuation non-surprising (M-2)\n- [ ] Closure proportional (M-3)\n- [ ] Density rhythm (M-4)\n- [ ] Audio cues calibrated (M-5)\n- [ ] Reduced-motion path (M-6)\n\n**LOW (run for public-facing / high-dwell):**\n\n- [ ] Idle / attractor polish (L-1)\n- [ ] Maintenance state (L-2)\n- [ ] Empty-state composition (L-3)\n\n## Definition of UX done\n\nA flow is UX-done when:\n\n1. The CRITICAL tier passes — zero unaddressed CRITICAL items.\n2. The HIGH tier passes — zero unaddressed HIGH items (or surfaced as accepted trade-off with rationale).\n3. Applicable MEDIUM / LOW items either pass or are surfaced.\n4. Every state (golden path + error categories + idle + empty if relevant) has been verified via preview screenshot or Automation, and reviewed.\n5. Accessibility floors are met at the deployment-relative threshold, not at a desktop default.\n\nIf any item is unmet, the work is mid-iteration. Say so explicitly to the user; offer a precise list of what remains.\n',"rive-marketplace/SKILL.md":'---\nname: rive-marketplace\ndescription: Search and download assets from Rive Marketplace. Use when searching for Rive animations, downloading .riv files, or exploring Rive community assets. Supports keyword search, tag browsing, and direct file downloads via public API. Requires browser tool for searching; API calls work without browser.\n---\n\n# Rive Marketplace\n\nDownload animated assets (.riv files) from Rive\'s community marketplace.\n\n## URL Structure\n\n- **Featured**: `https://rive.app/marketplace/featured/`\n- **Latest**: `https://rive.app/marketplace/latest/`\n- **Search**: `https://rive.app/marketplace/search/{query}/`\n- **Tags**: `https://rive.app/marketplace/tag/{TagName}/`\n- **Item**: `https://rive.app/marketplace/{post_id}-{revision_id}-{slug}/`\n\n## API (Public, No Auth)\n\n### Get Post Details\n```bash\ncurl -s "https://api.rive.app/api/community-posts/{post_id}" | jq \'.\'\n```\n\n**Response contains:**\n- `community_post_id` — Post ID\n- `owner.username` — Creator name\n- `community_revisions[0].title` — Asset title\n- `community_revisions[0].description` — Description\n- `community_revisions[0].tags` — Tags array\n- `community_revisions[0].community_files[0].file_url` — **Download URL**\n\n### Download .riv File\n```bash\n# Extract file_url from API response\ncurl -s "https://api.rive.app/api/community-posts/{post_id}" | jq -r \'.community_revisions[0].community_files[0].file_url\'\n\n# Download directly\ncurl -O "https://public.rive.app/community/runtime-files/{post_id}-{revision_id}-{slug}.riv"\n```\n\n## Workflow: Search → Download\n\n### 1. Browse via Browser (profile=clawd)\n```\nOpen: https://rive.app/marketplace/search/{keyword}/\n```\n\n### 2. Get Post ID from URL\nItem URL format: `/marketplace/{post_id}-{revision_id}-{slug}/`\nExample: `/marketplace/1683-3324-like-button/` → post_id = **1683**\n\n### 3. Fetch Download URL via API\n```bash\ncurl -s "https://api.rive.app/api/community-posts/1683" | jq -r \'.community_revisions[0].community_files[0].file_url\'\n# Output: https://public.rive.app/community/runtime-files/1683-3324-like-button.riv\n```\n\n### 4. Download File\n```bash\ncurl -O "https://public.rive.app/community/runtime-files/1683-3324-like-button.riv"\n```\n\n## Example: Full Flow\n\n```bash\n# Search for "button" assets, pick one, get post_id from URL\nPOST_ID=1683\n\n# Get file URL\nFILE_URL=$(curl -s "https://api.rive.app/api/community-posts/$POST_ID" | jq -r \'.community_revisions[0].community_files[0].file_url\')\n\n# Download\ncurl -o "my-button.riv" "$FILE_URL"\n```\n\n## Batch Download Script\n\n```bash\n#!/bin/bash\n# Download multiple Rive assets by post IDs\nfor POST_ID in 1683 3548 3703; do\n FILE_URL=$(curl -s "https://api.rive.app/api/community-posts/$POST_ID" | jq -r \'.community_revisions[0].community_files[0].file_url\')\n FILENAME=$(basename "$FILE_URL")\n echo "Downloading $FILENAME..."\n curl -sO "$FILE_URL"\ndone\n```\n\n## License\n\nAll Marketplace files are shared under **CC BY** (Creative Commons Attribution 4.0).\nAttribution required when using assets.\n\n## Notes\n\n- No official search API; browse via browser or scrape search results\n- API is public but undocumented; may change without notice\n- Remix/Like/Comment requires authentication\n'},R=n=>{var e;return{command:(e="win32"===process.platform?k.join(process.env.LOCALAPPDATA||"","Programs","bricks-cli","bin","bricks.exe"):k.join(D.homedir(),".bricks-cli","bin","bricks"),(0,E.existsSync)(e)?e:"bricks"),args:["ctor","mcp","--project",n]}},I=(i=b(function*(n){try{return yield(0,A.stat)(n),!0}catch{return!1}}),function(n){return i.apply(this,arguments)}),P=(o=b(function*(n){try{return yield(0,A.lstat)(n),!0}catch{return!1}}),function(n){return o.apply(this,arguments)}),O=(s=b(function*(n){var e,t=k.join(n,"package.json");if(yield I(t)){try{e=JSON.parse((yield(0,A.readFile)(t,"utf8")))}catch{return}var a,r,i=!1,o={postinstall:(a=(0,C.detectChannel)(),r=`curl -fsSL https://cdn.bricks.tools/bricks-cli/${a}/install.sh | sh${"beta"===a?" -s -- --beta":""}`,`bun -e "if (!Bun.which('bricks')) { console.error('BRICKS CLI not found. Install it with: ${r} (then restart your shell)'); process.exit(1) }" && bricks ctor postinstall`),"invoke-simulator":"bricks ctor simulator","deploy-app":"bricks ctor deploy --auto-commit","update-app":"bricks ctor push --auto-commit","pull-app":"bricks ctor pull",compile:"bricks ctor compile"};if(e.scripts)for(var s of Object.entries(o)){var l=v(s,2),c=l[0],p=l[1],d=e.scripts[c];"string"==typeof d&&(d.includes("@fugood/bricks-ctor/tools/")||d.includes("@fugood/bricks-project/tools/")||"compile"===c&&d.includes("compile.ts")||"postinstall"===c&&"bricks ctor postinstall"===d)&&d!==p&&(e.scripts[c]=p,i=!0)}for(var u of["@fugood/bricks-ctor","@fugood/bricks-project"])for(var m of["dependencies","devDependencies"])e[m]?.[u]&&(delete e[m][u],i=!0);i&&(yield(0,A.writeFile)(t,`${JSON.stringify(e,null,2)}
|
|
3
|
-
`),console.log("Migrated package.json scripts/dependencies to `bricks ctor *`"));var h=k.join(n,"compile.ts");(yield I(h))&&(yield(0,A.rm)(h,{force:!0}),console.log("Removed obsolete compile.ts"));var g=k.join(n,".husky","pre-commit");if(yield I(g)){var y=yield(0,A.readFile)(g,"utf8");if(y.includes("bun compile.ts")){var f=y.split("\n").filter(n=>"bun typecheck"!==n.trim()).map(n=>"bun compile.ts"===n.trim()?"bun compile":n).join("\n");yield(0,A.writeFile)(g,f),console.log("Migrated .husky/pre-commit to `bun compile`")}}}}),function(n){return s.apply(this,arguments)}),N=(l=b(function*(n){var e,t=k.join(n,"ctor");yield Promise.all(Object.entries(L).map((e=b(function*([n,e]){var a=k.join(t,n);yield(0,A.mkdir)(k.dirname(a),{recursive:!0}),yield(0,A.writeFile)(a,e)}),function(n){return e.apply(this,arguments)}))),console.log("Copied files to ctor/")}),function(n){return l.apply(this,arguments)}),x=(c=b(function*(n,{refresh:e=!1}={}){yield(0,A.mkdir)(n,{recursive:!0});var t,a={};for(var r of Object.keys(w)){var i=r.split("/")[0];(a[i]||=[]).push(r)}yield Promise.all(Object.entries(a).map((t=b(function*([t,a]){var r,i=k.join(n,t);if(yield I(i)){if(!e)return void console.log(`Skill '${t}' already exists, skipping`);var o,s=0;return yield Promise.all(a.map((o=b(function*(e){var t=k.join(n,e);(yield(0,A.readFile)(t,"utf8").catch(()=>null))!==w[e]&&(yield(0,A.mkdir)(k.dirname(t),{recursive:!0}),yield(0,A.writeFile)(t,w[e]),s+=1)}),function(n){return o.apply(this,arguments)}))),void(s>0&&console.log(`Refreshed skill '${t}' (${s} files)`))}yield Promise.all(a.map((r=b(function*(e){var t=k.join(n,e);yield(0,A.mkdir)(k.dirname(t),{recursive:!0}),yield(0,A.writeFile)(t,w[e])}),function(n){return r.apply(this,arguments)}))),console.log(`Installed skill '${t}' to ${n}/`)}),function(n){return t.apply(this,arguments)})))}),function(n){return c.apply(this,arguments)}),M=(p=b(function*(n,e){if(yield I(n)){var a,r=(yield Promise.resolve().then(t.t.bind(t,51455,19))).cp,i=(yield(0,A.readdir)(n,{withFileTypes:!0})).filter(n=>n.isDirectory()&&!n.name.startsWith("."));yield(0,A.mkdir)(e,{recursive:!0}),yield Promise.all(i.map((a=b(function*(t){var a=k.join(e,t.name);(yield I(a))||(yield r(k.join(n,t.name),a,{recursive:!0}))}),function(n){return a.apply(this,arguments)})))}}),function(n,e){return p.apply(this,arguments)}),G=(d=b(function*(n,e){if(yield P(n)){var t=yield(0,A.lstat)(n);if(t.isSymbolicLink()){var a=yield(0,A.readlink)(n),r=k.resolve(k.dirname(n),a);if(r===e)return;yield M(r,e),yield(0,A.rm)(n,{force:!0,recursive:!0});return}if(t.isDirectory()){yield M(n,e),yield(0,A.rm)(n,{force:!0,recursive:!0});return}console.warn(`Skipping skills migration for ${n}; expected a directory or symlink`)}}),function(n,e){return d.apply(this,arguments)}),B=(u=b(function*(n,e){if(yield(0,A.mkdir)(k.dirname(n),{recursive:!0}),yield P(n)){if(!(yield(0,A.lstat)(n)).isSymbolicLink())return void console.warn(`Skipping skills symlink at ${n}; path already exists and is not a symlink`);var t=yield(0,A.readlink)(n);if(k.resolve(k.dirname(n),t)===e)return}var a=k.relative(k.dirname(n),e),r="win32"===process.platform?"junction":"dir";yield(0,A.symlink)(a,n,r),console.log(`Linked ${n} -> ${a}`)}),function(n,e){return u.apply(this,arguments)}),F=(m=b(function*(n,{refreshSkills:e=!1}={}){var t=k.join(n,".bricks","skills"),a=[k.join(n,".claude","skills"),k.join(n,".codex","skills")];for(var r of(yield(0,A.mkdir)(t,{recursive:!0}),yield x(t,{refresh:e}),a))yield G(r,t),yield B(r,t)}),function(n){return m.apply(this,arguments)}),U=["$defaults","Organization: BRICKS (bricks.tools). Primary use: building BRICKS apps/modules with the bricks CLI and the local bricks-ctor MCP server.","Trusted internal domains: all *.bricks.tools services — api.bricks.tools (project GraphQL API), bank.bricks.tools (config & asset Bank API), cdn.bricks.tools (asset CDN), plus the control/display/activity services. This project syncs its config and assets to these endpoints."],W=(h=b(function*(n){var e=k.join(n,".gitignore"),t=".claude/settings.local.json",a=new Set([t,".claude",".claude/",".claude/*","*.local.json"]),r="";if(!((yield I(e))&&(r=yield(0,A.readFile)(e,"utf-8")).split("\n").some(n=>a.has(n.trim())))){var i=0===r.length?"":r.endsWith("\n")?"\n":"\n\n";yield(0,A.writeFile)(e,`${r}${i}# Claude Code local settings
|
|
4
|
-
${t}
|
|
5
|
-
`),console.log(`Added ${t} to .gitignore`)}}),function(n){return h.apply(this,arguments)}),K=(g=b(function*(n){var e,t=k.join(n,".prettierignore"),a=yield I(t);if(!a){try{e=JSON.parse((yield(0,A.readFile)(k.join(n,"package.json"),"utf-8")))}catch{return}if(!("prettier"in{...e.dependencies,...e.devDependencies}||/\bprettier\b/.test(e.scripts?.format||"")))return}var r=[{entry:"ctor",coveredBy:new Set(["ctor","ctor/","/ctor","/ctor/"])},{entry:".bricks",coveredBy:new Set([".bricks",".bricks/","/.bricks","/.bricks/"])}],i=a?yield(0,A.readFile)(t,"utf-8"):"",o=new Set(i.split("\n").map(n=>n.trim())),s=r.filter(({coveredBy:n})=>![...n].some(n=>o.has(n)));if(0!==s.length){var l=0===i.length?"":i.endsWith("\n")?"\n":"\n\n",c=`# Generated by \`bricks ctor postinstall\`; kept byte-identical to the CLI's bundled assets
|
|
6
|
-
${s.map(({entry:n})=>n).join("\n")}
|
|
7
|
-
`;yield(0,A.writeFile)(t,`${i}${l}${c}`),console.log(`Added ${s.map(({entry:n})=>n).join(", ")} to .prettierignore`)}}),function(n){return g.apply(this,arguments)}),H=(y=b(function*(n){var e=k.join(n,".claude","settings.local.json"),t={};if(yield I(e)){try{t=JSON.parse((yield(0,A.readFile)(e,"utf-8")))}catch{console.warn(`Skipping auto mode setup; ${e} is not valid JSON`);return}if(t.autoMode)return}t.autoMode={environment:U},yield(0,A.mkdir)(k.dirname(e),{recursive:!0}),yield(0,A.writeFile)(e,`${JSON.stringify(t,null,2)}
|
|
8
|
-
`),console.log(`Set up auto mode in ${e}`),yield W(n)}),function(n){return y.apply(this,arguments)}),V=(f=b(function*(n,e){var t,a,r={...R(e),default_tools_approval_mode:"approve"};if(yield I(n)){try{a=T.q((yield(0,A.readFile)(n,"utf-8")))}catch{console.warn(`Skipping .codex/config.toml update; ${n} is not valid TOML`);return}(t=a&&"object"==typeof a?a:{mcp_servers:{}}).mcp_servers&&"object"==typeof t.mcp_servers||(t.mcp_servers={}),t.mcp_servers["bricks-ctor"]=r,delete t.mcp_servers["bricks-project"]}else t={mcp_servers:{"bricks-ctor":r}};yield(0,A.writeFile)(n,`${T.A(t)}
|
|
9
|
-
`),console.log(`Updated ${n}`)}),function(n,e){return f.apply(this,arguments)});function j(){return q.apply(this,arguments)}function q(){return(q=b(function*(n=process.cwd()){var e,t=(e=b(function*(n,e){var t,a=[],r=[];return yield Promise.all(Object.entries(n).map((t=b(function*([n,t]){try{(yield(0,A.readFile)(k.join(e,n),"utf8")).replace(/\r\n/g,"\n")!==t.replace(/\r\n/g,"\n")&&a.push(n)}catch{r.push(n)}}),function(n){return t.apply(this,arguments)}))),{changed:a.sort(),missing:r.sort()}}),function(n,t){return e.apply(this,arguments)}),a=yield t(L,k.join(n,"ctor")),r=(yield I(k.join(n,"CLAUDE.md")))||(yield I(k.join(n,"AGENTS.md")))?yield t(w,k.join(n,".bricks","skills")):{changed:[],missing:[]};return{upToDate:a.changed.length+a.missing.length+r.changed.length+r.missing.length===0,cliVersion:"2.25.0-beta.62",lib:a,skills:r}})).apply(this,arguments)}function z(){return Y.apply(this,arguments)}function Y(){return(Y=b(function*(n={}){var e=process.cwd(),t=!!n.skipCopyProject,a=!!n.refreshSkills;yield O(e);var r=k.join(e,"project");(yield I(r))&&(yield(0,A.rm)(r,{recursive:!0,force:!0}),console.log("Removed legacy project/ directory")),t?console.log("Skipping copy of files to ctor/"):yield N(e),yield K(e);var i=yield I(`${e}/CLAUDE.md`),o=yield I(`${e}/AGENTS.md`);(i||o)&&(yield S(`${e}/.mcp.json`,R(e)),yield F(e,{refreshSkills:a})),i&&(yield H(e)),o&&(yield V(`${e}/.codex/config.toml`,e))})).apply(this,arguments)}},53241(n,e,t){t.r(e),t.d(e,{detectChannel:()=>s,detectInstallMethod:()=>l});var a=t(73024),r=t(76760),i=t(48161),o=n=>{if(!n)return n;try{return a.realpathSync(n)}catch{return n}},s=({version:n,execPath:e}={})=>{var t=e||process.execPath;return t&&/[\\/]bricks-beta(?:\.exe)?$/i.test(t)||/-(beta|alpha|rc|next)\b/i.test(n||"2.25.0-beta.62")?"beta":"release"},l=({execPath:n=process.execPath,scriptPath:e=process.argv[1],homeDir:t=i.homedir(),realpath:a=o}={})=>{let s;var l=(s=n)?r.basename(s).replace(/\.exe$/i,""):"";if("bricks"===l||"bricks-beta"===l)return{method:"binary",execPath:n,installDir:r.dirname(n)};var c=a(e),p=((n,e)=>{if(!n)return null;var t=r.sep,a=`${t}node_modules${t}${e.replace(/\//g,t)}${t}`,i=n.indexOf(a);return -1===i?null:n.slice(0,i)})(c,"@fugood/bricks-cli");if(p){var d=r.sep,u=r.join(t,".bun","install","global");return p===u||p.startsWith(u+d)?{method:"bun",installRoot:p}:/[\\/](?:\.pnpm|pnpm[\\/]global)[\\/]/.test(p)?{method:"pnpm",installRoot:p}:/[\\/](?:\.yarn|yarn[\\/]global)[\\/]/.test(p)?{method:"yarn",installRoot:p}:{method:"npm",installRoot:p.endsWith(`${d}lib`)?p.slice(0,-`${d}lib`.length):p}}return{method:"unknown",execPath:n,scriptPath:c}}}};
|