@fugood/bricks-project 2.22.0-beta.12 → 2.22.0-beta.14

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.
@@ -257,6 +257,10 @@ export const templateActionNameMap = {
257
257
  BRICK_WEBVIEW_INJECT_JAVASCRIPT: {
258
258
  javascriptCode: 'BRICK_WEBVIEW_JAVASCRIPT_CODE',
259
259
  },
260
+ BRICK_WEBVIEW_QUERY_SELECTOR: {
261
+ querySelector: 'BRICK_WEBVIEW_QUERY_SELECTOR',
262
+ expression: 'BRICK_WEBVIEW_EXPRESSION',
263
+ },
260
264
  },
261
265
  BRICK_CAMERA: {
262
266
  BRICK_CAMERA_TAKE_PICTURE: {
@@ -594,8 +598,9 @@ export const templateActionNameMap = {
594
598
  GENERATOR_LLM: {
595
599
  GENERATOR_LLM_TOKENIZE: {
596
600
  mode: 'GENERATOR_LLM_MODE',
597
- messages: 'GENERATOR_LLM_MESSAGES',
598
601
  prompt: 'GENERATOR_LLM_PROMPT',
602
+ promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
603
+ messages: 'GENERATOR_LLM_MESSAGES',
599
604
  },
600
605
  GENERATOR_LLM_DETOKENIZE: {
601
606
  tokens: 'GENERATOR_LLM_TOKENS',
@@ -608,7 +613,7 @@ export const templateActionNameMap = {
608
613
  parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
609
614
  toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
610
615
  prompt: 'GENERATOR_LLM_PROMPT',
611
- promptImagePaths: 'GENERATOR_LLM_PROMPT_IMAGE_PATHS',
616
+ promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
612
617
  promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
613
618
  promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
614
619
  responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
@@ -621,7 +626,7 @@ export const templateActionNameMap = {
621
626
  parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
622
627
  toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
623
628
  prompt: 'GENERATOR_LLM_PROMPT',
624
- promptImagePaths: 'GENERATOR_LLM_PROMPT_IMAGE_PATHS',
629
+ promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
625
630
  promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
626
631
  promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
627
632
  responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.22.0-beta.12",
3
+ "version": "2.22.0-beta.14",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
@@ -14,5 +14,5 @@
14
14
  "lodash": "^4.17.4",
15
15
  "uuid": "^8.3.1"
16
16
  },
17
- "gitHead": "bf844dee8ddb0e8437c8795e0a44cafc48ef16d1"
17
+ "gitHead": "4b62185a9ec82561db90d85b8281de9e67f978ae"
18
18
  }
package/types/bricks.ts CHANGED
@@ -2420,6 +2420,23 @@ export type BrickWebViewActionInjectJavascript = ActionWithParams & {
2420
2420
  }>
2421
2421
  }
2422
2422
 
2423
+ /* Query selector on the WebView */
2424
+ export type BrickWebViewActionQuerySelector = ActionWithParams & {
2425
+ __actionName: 'BRICK_WEBVIEW_QUERY_SELECTOR'
2426
+ params?: Array<
2427
+ | {
2428
+ input: 'querySelector'
2429
+ value?: string | DataLink | EventProperty
2430
+ mapping?: string
2431
+ }
2432
+ | {
2433
+ input: 'expression'
2434
+ value?: string | DataLink | EventProperty
2435
+ mapping?: string
2436
+ }
2437
+ >
2438
+ }
2439
+
2423
2440
  /* Do go forward on the WebView */
2424
2441
  export type BrickWebViewActionGoForward = Action & {
2425
2442
  __actionName: 'BRICK_WEBVIEW_GO_FORWARD'
@@ -2502,6 +2519,12 @@ Default property:
2502
2519
  /* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
2503
2520
  onMessage?: Array<EventAction>
2504
2521
  }
2522
+ outlets?: {
2523
+ /* The result of the query selector action */
2524
+ queryResult?: () => Data
2525
+ /* The error of the query selector action */
2526
+ queryError?: () => Data
2527
+ }
2505
2528
  animation?: AnimationBasicEvents & {
2506
2529
  onLoad?: Animation
2507
2530
  onError?: Animation
@@ -2523,7 +2546,7 @@ export type BrickWebView = Brick &
2523
2546
  | SwitchCondData
2524
2547
  | {
2525
2548
  __typename: 'SwitchCondInnerStateOutlet'
2526
- outlet: ''
2549
+ outlet: 'queryResult' | 'queryError'
2527
2550
  value: any
2528
2551
  }
2529
2552
  }>
package/types/data.ts CHANGED
@@ -56,6 +56,11 @@ export type Data<T = any> = DataDef & {
56
56
  | 'rich-text-content'
57
57
  | 'sandbox-script'
58
58
  | 'llm-prompt'
59
+ | 'llm-messages'
60
+ | 'llm-tools'
61
+ | 'mcp-server-resources'
62
+ | 'mcp-server-tools'
63
+ | 'mcp-server-prompts'
59
64
  }
60
65
  value: T
61
66
  }
@@ -67,6 +72,7 @@ export type DataAssetKind = {
67
72
  | 'media-resource-audio'
68
73
  | 'media-resource-file'
69
74
  | 'lottie-file-uri'
75
+ | 'rive-file-uri'
70
76
  | 'ggml-model-asset'
71
77
  | 'gguf-model-asset'
72
78
  | 'binary-asset'
@@ -5094,24 +5094,19 @@ Default property:
5094
5094
  /* Model type */
5095
5095
  modelType?:
5096
5096
  | 'auto'
5097
- | 'gpt2'
5098
- | 'gptj'
5099
- | 'gpt_bigcode'
5100
- | 'gpt_neo'
5101
- | 'gpt_neox'
5102
- | 'bloom'
5103
- | 'mpt'
5104
- | 'opt'
5105
- | 'llama'
5106
- | 'falcon'
5107
- | 'mistral'
5097
+ | 'text-generation'
5098
+ | 'qwen2-vl'
5099
+ | 'paligemma'
5100
+ | 'llava'
5101
+ | 'llava_onevision'
5102
+ | 'moondream1'
5103
+ | 'florence2'
5104
+ | 'idefics3'
5105
+ | 'smolvlm'
5106
+ | 'phi3_v'
5108
5107
  | 't5'
5109
5108
  | 'mt5'
5110
5109
  | 'longt5'
5111
- | 'phi'
5112
- | 'qwen2'
5113
- | 'stablelm'
5114
- | 'gemma'
5115
5110
  | DataLink
5116
5111
  /* Load quantized model (deprecated, use `quantizeType` instead) */
5117
5112
  quantized?: boolean | DataLink
@@ -5919,13 +5914,18 @@ export type GeneratorLLMActionTokenize = ActionWithParams & {
5919
5914
  mapping?: string
5920
5915
  }
5921
5916
  | {
5922
- input: 'messages'
5917
+ input: 'prompt'
5918
+ value?: string | DataLink | EventProperty
5919
+ mapping?: string
5920
+ }
5921
+ | {
5922
+ input: 'promptMediaPaths'
5923
5923
  value?: Array<any> | DataLink | EventProperty
5924
5924
  mapping?: string
5925
5925
  }
5926
5926
  | {
5927
- input: 'prompt'
5928
- value?: string | DataLink | EventProperty
5927
+ input: 'messages'
5928
+ value?: Array<any> | DataLink | EventProperty
5929
5929
  mapping?: string
5930
5930
  }
5931
5931
  >
@@ -5981,7 +5981,7 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
5981
5981
  mapping?: string
5982
5982
  }
5983
5983
  | {
5984
- input: 'promptImagePaths'
5984
+ input: 'promptMediaPaths'
5985
5985
  value?: Array<any> | DataLink | EventProperty
5986
5986
  mapping?: string
5987
5987
  }
@@ -6043,7 +6043,7 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
6043
6043
  mapping?: string
6044
6044
  }
6045
6045
  | {
6046
- input: 'promptImagePaths'
6046
+ input: 'promptMediaPaths'
6047
6047
  value?: Array<any> | DataLink | EventProperty
6048
6048
  mapping?: string
6049
6049
  }
@@ -6386,9 +6386,9 @@ Default property:
6386
6386
  | DataLink
6387
6387
  /* Prompt (text mode) */
6388
6388
  completionPrompt?: string | DataLink
6389
- /* Image paths to be used in the prompt template (PREVIEW FEATURE)
6390
- In prompt, use `<__image__>` for position of image content */
6391
- completionPromptImagePaths?: Array<string | DataLink> | DataLink
6389
+ /* Media paths to be used in the prompt template (PREVIEW FEATURE)
6390
+ In prompt, use `<__media__>` for position of media content */
6391
+ completionPromptMediaPaths?: Array<string | DataLink> | DataLink
6392
6392
  /* Data to be used in the prompt template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */
6393
6393
  completionPromptTemplateData?: {} | DataLink
6394
6394
  /* The prompt template type */
@@ -6793,7 +6793,7 @@ interface GeneratorOpenAILLMDef {
6793
6793
  Default property:
6794
6794
  {
6795
6795
  "apiEndpoint": "https://api.openai.com/v1",
6796
- "model": "gpt-4o-mini",
6796
+ "model": "gpt-4o",
6797
6797
  "completionMessages": [
6798
6798
  {
6799
6799
  "role": "system",
@@ -6803,8 +6803,6 @@ Default property:
6803
6803
  "completionMaxTokens": 1024,
6804
6804
  "completionTemperature": 1,
6805
6805
  "completionTopP": 1,
6806
- "completionFrequencyPenalty": 0,
6807
- "completionPresencePenalty": 0,
6808
6806
  "completionStop": []
6809
6807
  }
6810
6808
  */
@@ -6893,7 +6891,11 @@ Default property:
6893
6891
  - Compatible with OpenAI API format
6894
6892
  - Supports function calling
6895
6893
  - Streaming responses
6896
- - Custom API endpoints */
6894
+ - Custom API endpoints, like
6895
+ - OpenAI API: https://platform.openai.com/docs/guides/text?api-mode=chat
6896
+ - Anthropic API: https://docs.anthropic.com/en/api/openai-sdk
6897
+ - Gemini API: https://ai.google.dev/gemini-api/docs/openai
6898
+ - llama.cpp server: https://github.com/ggml-org/llama.cpp/tree/master/tools/server */
6897
6899
  export type GeneratorOpenAILLM = Generator &
6898
6900
  GeneratorOpenAILLMDef & {
6899
6901
  templateKey: 'GENERATOR_OPENAI_LLM'