@fugood/bricks-ctor 2.25.0-beta.6 → 2.25.0-beta.60
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/compile/__tests__/config-diff.test.js +100 -0
- package/compile/__tests__/index.test.js +461 -0
- package/compile/__tests__/util.test.js +450 -0
- package/compile/action-name-map.ts +64 -0
- package/compile/config-diff.ts +155 -0
- package/compile/index.ts +668 -352
- package/compile/util.ts +134 -10
- package/package.json +7 -3
- package/skills/bricks-ctor/SKILL.md +23 -17
- package/skills/bricks-ctor/{rules → references}/animation.md +3 -2
- package/skills/bricks-ctor/{rules → references}/architecture-patterns.md +19 -0
- package/skills/bricks-ctor/{rules → references}/automations.md +11 -0
- package/skills/bricks-ctor/references/buttress.md +245 -0
- package/skills/bricks-ctor/references/data-calculation.md +252 -0
- package/skills/bricks-ctor/{rules → references}/media-flow.md +7 -0
- package/skills/bricks-ctor/references/simulator.md +132 -0
- package/skills/bricks-ctor/references/source-editing-tools.md +81 -0
- package/skills/bricks-ctor/references/verification-toolchain.md +200 -0
- package/skills/bricks-design/SKILL.md +150 -45
- package/skills/bricks-design/references/architecture-truths.md +132 -0
- package/skills/bricks-design/references/avoiding-complexity.md +91 -0
- package/skills/bricks-design/references/design-critique.md +195 -0
- package/skills/bricks-design/references/design-languages.md +265 -0
- package/skills/bricks-design/references/performance.md +116 -0
- package/skills/bricks-design/references/presentation-and-slideshow.md +137 -0
- package/skills/bricks-design/references/translating-inputs.md +152 -0
- package/skills/bricks-design/references/variations-and-tweaks.md +124 -0
- package/skills/bricks-design/references/when-the-brief-is-branded.md +284 -0
- package/skills/bricks-design/references/when-the-brief-is-vague.md +85 -0
- package/skills/bricks-design/references/workflow.md +134 -0
- package/skills/bricks-ux/SKILL.md +114 -0
- package/skills/bricks-ux/references/accessibility.md +162 -0
- package/skills/bricks-ux/references/flow-states.md +175 -0
- package/skills/bricks-ux/references/interaction-archetypes.md +189 -0
- package/skills/bricks-ux/references/monitoring-screens.md +153 -0
- package/skills/bricks-ux/references/pressable-composition.md +126 -0
- package/skills/bricks-ux/references/user-journey.md +168 -0
- package/skills/bricks-ux/references/ux-critique.md +256 -0
- package/tools/__tests__/_cli-error.test.ts +35 -0
- package/tools/__tests__/_mcp-config.test.ts +67 -0
- package/tools/__tests__/pull.test.ts +108 -0
- package/tools/_cli-error.ts +17 -0
- package/tools/_edits-log.ts +41 -0
- package/tools/_git-author.ts +10 -2
- package/tools/_last-pushed-commit.ts +28 -0
- package/tools/_mcp-config.ts +42 -0
- package/tools/_shell.ts +8 -1
- package/tools/deploy.ts +17 -6
- package/tools/mcp-env.ts +13 -0
- package/tools/mcp-server.ts +8 -0
- package/tools/mcp-tools/__tests__/data-calc-editing.test.js +516 -0
- package/tools/mcp-tools/__tests__/entry-editing.test.js +866 -0
- package/tools/mcp-tools/__tests__/huggingface.test.ts +49 -0
- package/tools/mcp-tools/__tests__/icons.test.ts +21 -0
- package/tools/mcp-tools/__tests__/mcp-env.test.js +19 -0
- package/tools/mcp-tools/_editing-helpers.ts +98 -0
- package/tools/mcp-tools/_verify.ts +50 -0
- package/tools/mcp-tools/compile.ts +21 -9
- package/tools/mcp-tools/data-calc-editing.ts +1311 -0
- package/tools/mcp-tools/entry-editing.ts +2297 -0
- package/tools/mcp-tools/huggingface.ts +23 -13
- package/tools/mcp-tools/icons.ts +23 -7
- package/tools/mcp-tools/media.ts +4 -1
- package/tools/postinstall.ts +95 -38
- package/tools/pull.ts +100 -23
- package/tools/push-config.ts +114 -0
- package/tools/{preview-main.mjs → simulator-main.mjs} +207 -12
- package/tools/simulator-preload.cjs +16 -0
- package/tools/{preview.ts → simulator.ts} +4 -4
- package/types/{animation.ts → animation.d.ts} +24 -8
- package/types/{automation.ts → automation.d.ts} +16 -20
- package/types/{brick-base.ts → brick-base.d.ts} +1 -1
- package/types/bricks/{Camera.ts → Camera.d.ts} +8 -8
- package/types/bricks/{Chart.ts → Chart.d.ts} +4 -4
- package/types/bricks/{GenerativeMedia.ts → GenerativeMedia.d.ts} +15 -15
- package/types/bricks/{Icon.ts → Icon.d.ts} +7 -7
- package/types/bricks/{Image.ts → Image.d.ts} +21 -9
- package/types/bricks/{Items.ts → Items.d.ts} +11 -7
- package/types/bricks/{Lottie.ts → Lottie.d.ts} +10 -10
- package/types/bricks/{Maps.ts → Maps.d.ts} +11 -11
- package/types/bricks/{QrCode.ts → QrCode.d.ts} +7 -7
- package/types/bricks/{Rect.ts → Rect.d.ts} +7 -7
- package/types/bricks/{RichText.ts → RichText.d.ts} +12 -9
- package/types/bricks/{Rive.ts → Rive.d.ts} +9 -9
- package/types/bricks/Scene3D.d.ts +676 -0
- package/types/bricks/{Sketch.ts → Sketch.d.ts} +10 -8
- package/types/bricks/{Slideshow.ts → Slideshow.d.ts} +7 -7
- package/types/bricks/{Svg.ts → Svg.d.ts} +7 -7
- package/types/bricks/{Text.ts → Text.d.ts} +9 -9
- package/types/bricks/{TextInput.ts → TextInput.d.ts} +10 -10
- package/types/bricks/{Video.ts → Video.d.ts} +80 -13
- package/types/bricks/{VideoStreaming.ts → VideoStreaming.d.ts} +10 -10
- package/types/bricks/{WebRtcStream.ts → WebRtcStream.d.ts} +1 -1
- package/types/bricks/{WebView.ts → WebView.d.ts} +4 -4
- package/types/bricks/{index.ts → index.d.ts} +1 -0
- package/types/{common.ts → common.d.ts} +3 -6
- package/types/data-calc-command/base.d.ts +57 -0
- package/types/data-calc-command/collection.d.ts +418 -0
- package/types/data-calc-command/color.d.ts +432 -0
- package/types/data-calc-command/constant.d.ts +50 -0
- package/types/data-calc-command/datetime.d.ts +147 -0
- package/types/data-calc-command/file.d.ts +129 -0
- package/types/data-calc-command/index.d.ts +13 -0
- package/types/data-calc-command/iteratee.d.ts +23 -0
- package/types/data-calc-command/logictype.d.ts +190 -0
- package/types/data-calc-command/math.d.ts +275 -0
- package/types/data-calc-command/object.d.ts +119 -0
- package/types/data-calc-command/sandbox.d.ts +66 -0
- package/types/data-calc-command/string.d.ts +407 -0
- package/types/{data-calc.ts → data-calc.d.ts} +1 -0
- package/types/{data.ts → data.d.ts} +4 -2
- package/types/generators/{Assistant.ts → Assistant.d.ts} +19 -0
- package/types/generators/{HttpServer.ts → HttpServer.d.ts} +56 -2
- package/types/generators/{LlmGgml.ts → LlmGgml.d.ts} +43 -1
- package/types/generators/{LlmMlx.ts → LlmMlx.d.ts} +1 -0
- package/types/generators/{RerankerGgml.ts → RerankerGgml.d.ts} +5 -1
- package/types/generators/{SoundRecorder.ts → SoundRecorder.d.ts} +10 -1
- package/types/generators/{SpeechToTextGgml.ts → SpeechToTextGgml.d.ts} +6 -1
- package/types/generators/{SttAppleBuiltin.ts → SttAppleBuiltin.d.ts} +27 -4
- package/types/generators/{ThermalPrinter.ts → ThermalPrinter.d.ts} +9 -7
- package/types/generators/{Tick.ts → Tick.d.ts} +1 -1
- package/types/generators/{VadGgml.ts → VadGgml.d.ts} +12 -2
- package/types/{subspace.ts → subspace.d.ts} +1 -1
- package/utils/__tests__/calc.test.js +25 -0
- package/utils/__tests__/id.test.js +154 -0
- package/utils/calc.ts +5 -1
- package/utils/data.ts +5 -7
- package/utils/event-props.ts +27 -1
- package/utils/id.ts +109 -56
- package/skills/bricks-ctor/rules/buttress.md +0 -156
- package/skills/bricks-ctor/rules/data-calculation.md +0 -209
- package/skills/bricks-design/LICENSE.txt +0 -180
- package/types/data-calc-command.ts +0 -7005
- /package/skills/bricks-ctor/{rules → references}/local-sync.md +0 -0
- /package/skills/bricks-ctor/{rules → references}/remote-data-bank.md +0 -0
- /package/skills/bricks-ctor/{rules → references}/standby-transition.md +0 -0
- /package/types/{canvas.ts → canvas.d.ts} +0 -0
- /package/types/{data-calc-script.ts → data-calc-script.d.ts} +0 -0
- /package/types/generators/{AlarmClock.ts → AlarmClock.d.ts} +0 -0
- /package/types/generators/{BleCentral.ts → BleCentral.d.ts} +0 -0
- /package/types/generators/{BlePeripheral.ts → BlePeripheral.d.ts} +0 -0
- /package/types/generators/{CanvasMap.ts → CanvasMap.d.ts} +0 -0
- /package/types/generators/{CastlesPay.ts → CastlesPay.d.ts} +0 -0
- /package/types/generators/{DataBank.ts → DataBank.d.ts} +0 -0
- /package/types/generators/{File.ts → File.d.ts} +0 -0
- /package/types/generators/{GraphQl.ts → GraphQl.d.ts} +0 -0
- /package/types/generators/{Http.ts → Http.d.ts} +0 -0
- /package/types/generators/{Information.ts → Information.d.ts} +0 -0
- /package/types/generators/{Intent.ts → Intent.d.ts} +0 -0
- /package/types/generators/{Iterator.ts → Iterator.d.ts} +0 -0
- /package/types/generators/{Keyboard.ts → Keyboard.d.ts} +0 -0
- /package/types/generators/{LlmAnthropicCompat.ts → LlmAnthropicCompat.d.ts} +0 -0
- /package/types/generators/{LlmAppleBuiltin.ts → LlmAppleBuiltin.d.ts} +0 -0
- /package/types/generators/{LlmMediaTekNeuroPilot.ts → LlmMediaTekNeuroPilot.d.ts} +0 -0
- /package/types/generators/{LlmOnnx.ts → LlmOnnx.d.ts} +0 -0
- /package/types/generators/{LlmOpenAiCompat.ts → LlmOpenAiCompat.d.ts} +0 -0
- /package/types/generators/{LlmQualcommAiEngine.ts → LlmQualcommAiEngine.d.ts} +0 -0
- /package/types/generators/{Mcp.ts → Mcp.d.ts} +0 -0
- /package/types/generators/{McpServer.ts → McpServer.d.ts} +0 -0
- /package/types/generators/{MediaFlow.ts → MediaFlow.d.ts} +0 -0
- /package/types/generators/{MqttBroker.ts → MqttBroker.d.ts} +0 -0
- /package/types/generators/{MqttClient.ts → MqttClient.d.ts} +0 -0
- /package/types/generators/{Question.ts → Question.d.ts} +0 -0
- /package/types/generators/{RealtimeTranscription.ts → RealtimeTranscription.d.ts} +0 -0
- /package/types/generators/{SerialPort.ts → SerialPort.d.ts} +0 -0
- /package/types/generators/{SoundPlayer.ts → SoundPlayer.d.ts} +0 -0
- /package/types/generators/{SpeechToTextOnnx.ts → SpeechToTextOnnx.d.ts} +0 -0
- /package/types/generators/{SpeechToTextPlatform.ts → SpeechToTextPlatform.d.ts} +0 -0
- /package/types/generators/{SqLite.ts → SqLite.d.ts} +0 -0
- /package/types/generators/{Step.ts → Step.d.ts} +0 -0
- /package/types/generators/{Tcp.ts → Tcp.d.ts} +0 -0
- /package/types/generators/{TcpServer.ts → TcpServer.d.ts} +0 -0
- /package/types/generators/{TextToSpeechAppleBuiltin.ts → TextToSpeechAppleBuiltin.d.ts} +0 -0
- /package/types/generators/{TextToSpeechGgml.ts → TextToSpeechGgml.d.ts} +0 -0
- /package/types/generators/{TextToSpeechOnnx.ts → TextToSpeechOnnx.d.ts} +0 -0
- /package/types/generators/{TextToSpeechOpenAiLike.ts → TextToSpeechOpenAiLike.d.ts} +0 -0
- /package/types/generators/{Udp.ts → Udp.d.ts} +0 -0
- /package/types/generators/{VadOnnx.ts → VadOnnx.d.ts} +0 -0
- /package/types/generators/{VadTraditional.ts → VadTraditional.d.ts} +0 -0
- /package/types/generators/{VectorStore.ts → VectorStore.d.ts} +0 -0
- /package/types/generators/{Watchdog.ts → Watchdog.d.ts} +0 -0
- /package/types/generators/{WebCrawler.ts → WebCrawler.d.ts} +0 -0
- /package/types/generators/{WebRtc.ts → WebRtc.d.ts} +0 -0
- /package/types/generators/{WebSocket.ts → WebSocket.d.ts} +0 -0
- /package/types/generators/{index.ts → index.d.ts} +0 -0
- /package/types/{index.ts → index.d.ts} +0 -0
- /package/types/{switch.ts → switch.d.ts} +0 -0
- /package/types/{system.ts → system.d.ts} +0 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { generateCalulationMap, validateConfig } from '../util'
|
|
2
|
+
|
|
3
|
+
const baseConfig = (overrides = {}) => ({
|
|
4
|
+
inputs: {},
|
|
5
|
+
enable_async: false,
|
|
6
|
+
disabled_triggers: {},
|
|
7
|
+
output: null,
|
|
8
|
+
outputs: {},
|
|
9
|
+
error: null,
|
|
10
|
+
code: 'return inputs',
|
|
11
|
+
...overrides,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const SANDBOX_PREFIX = 'PROPERTY_BANK_COMMAND_NODE_'
|
|
15
|
+
|
|
16
|
+
const sandboxNodeIds = (map) =>
|
|
17
|
+
Object.entries(map)
|
|
18
|
+
.filter(([id, node]) => id.startsWith(SANDBOX_PREFIX) && node.type === 'command-node-sandbox')
|
|
19
|
+
.map(([id, node]) => ({ id, command: node.properties.command }))
|
|
20
|
+
|
|
21
|
+
const findSandboxIds = (map) => {
|
|
22
|
+
const sandbox = sandboxNodeIds(map)
|
|
23
|
+
return {
|
|
24
|
+
run: sandbox.find((s) => s.command === 'SANDBOX_RUN_JAVASCRIPT')?.id,
|
|
25
|
+
error: sandbox.find((s) => s.command === 'SANDBOX_GET_ERROR')?.id,
|
|
26
|
+
result: sandbox.find((s) => s.command === 'SANDBOX_GET_RETURN_VALUE')?.id,
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
describe('validateConfig', () => {
|
|
31
|
+
test('returns without throwing for a clean config', () => {
|
|
32
|
+
expect(() => validateConfig(baseConfig({ inputs: { a: 'foo' } }))).not.toThrow()
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
test('skips overlap checks in manual trigger mode', () => {
|
|
36
|
+
const config = baseConfig({
|
|
37
|
+
trigger_mode: 'manual',
|
|
38
|
+
inputs: { a: 'foo' },
|
|
39
|
+
output: 'a',
|
|
40
|
+
error: 'a',
|
|
41
|
+
outputs: { x: ['a'] },
|
|
42
|
+
})
|
|
43
|
+
expect(() => validateConfig(config)).not.toThrow()
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test('throws when error key collides with an input id', () => {
|
|
47
|
+
const config = baseConfig({ inputs: { a: 'foo' }, error: 'a' })
|
|
48
|
+
expect(() => validateConfig(config)).toThrow(/key: error/)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
test('throws when output key collides with an input id', () => {
|
|
52
|
+
const config = baseConfig({ inputs: { a: 'foo' }, output: 'a' })
|
|
53
|
+
expect(() => validateConfig(config)).toThrow(/key: output/)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
test('throws when any outputs entry references an input id', () => {
|
|
57
|
+
const config = baseConfig({
|
|
58
|
+
inputs: { a: 'foo', b: 'bar' },
|
|
59
|
+
outputs: { x: ['c', 'b'] },
|
|
60
|
+
})
|
|
61
|
+
expect(() => validateConfig(config)).toThrow(/key: outputs/)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
test('does not throw when error/output are falsy and inputs are empty', () => {
|
|
65
|
+
expect(() => validateConfig(baseConfig())).not.toThrow()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
// Regression: the overlap checks tested `config.inputs[id]` (the OBJECT_SET path) for
|
|
69
|
+
// truthiness instead of asking whether `id` is an input key. An empty path ('' is
|
|
70
|
+
// OBJECT_SET's default "set whole object") is a legitimate input value, so an input with
|
|
71
|
+
// an empty path that also targets output/error/outputs slipped the guard and compiled into
|
|
72
|
+
// a node double-wired as both input and output.
|
|
73
|
+
test('throws when output collides with an input whose path is empty', () => {
|
|
74
|
+
const config = baseConfig({ inputs: { a: '' }, output: 'a' })
|
|
75
|
+
expect(() => validateConfig(config)).toThrow(/key: output/)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('throws when error collides with an input whose path is empty', () => {
|
|
79
|
+
const config = baseConfig({ inputs: { a: '' }, error: 'a' })
|
|
80
|
+
expect(() => validateConfig(config)).toThrow(/key: error/)
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
test('throws when an outputs entry references an input whose path is empty', () => {
|
|
84
|
+
const config = baseConfig({ inputs: { a: '' }, outputs: { x: ['a'] } })
|
|
85
|
+
expect(() => validateConfig(config)).toThrow(/key: outputs/)
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
test('throws when error and output target the same id', () => {
|
|
89
|
+
const config = baseConfig({ output: 'shared', error: 'shared' })
|
|
90
|
+
expect(() => validateConfig(config)).toThrow(/key: error\/output/)
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
test('throws when output collides with an outputs target id', () => {
|
|
94
|
+
const config = baseConfig({ output: 'shared', outputs: { x: ['shared'] } })
|
|
95
|
+
expect(() => validateConfig(config)).toThrow(/key: output\/outputs/)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
test('throws when error collides with an outputs target id', () => {
|
|
99
|
+
const config = baseConfig({ error: 'shared', outputs: { x: ['shared'] } })
|
|
100
|
+
expect(() => validateConfig(config)).toThrow(/key: error\/outputs/)
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// The same id reused across *different* outputs entries is a supported last-wins case
|
|
104
|
+
// (see generateCalulationMap test below) and must stay allowed.
|
|
105
|
+
test('allows the same id across multiple outputs entries', () => {
|
|
106
|
+
const config = baseConfig({ outputs: { first: ['pb1'], second: ['pb1'] } })
|
|
107
|
+
expect(() => validateConfig(config)).not.toThrow()
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
// generateCalulationMap now seeds command ids from the owning calc id; tests that don't
|
|
112
|
+
// assert id values share one fixed id (ids stay deterministic with no global state).
|
|
113
|
+
const CALC_ID = 'PROPERTY_BANK_COMMAND_MAP_00000000-0000-4000-8000-000000000000'
|
|
114
|
+
const genMap = (config, calcId = CALC_ID) => generateCalulationMap(config, calcId)
|
|
115
|
+
|
|
116
|
+
describe('generateCalulationMap', () => {
|
|
117
|
+
test('produces only the three sandbox nodes for an empty config', () => {
|
|
118
|
+
const result = genMap(baseConfig())
|
|
119
|
+
|
|
120
|
+
expect(Object.keys(result.map)).toHaveLength(3)
|
|
121
|
+
const { run, error, result: returnValue } = findSandboxIds(result.map)
|
|
122
|
+
|
|
123
|
+
expect(result.map[run].in.inputs).toEqual([])
|
|
124
|
+
expect(result.map[error].out.result).toEqual([])
|
|
125
|
+
expect(result.map[returnValue].out.result).toEqual([])
|
|
126
|
+
expect(Object.keys(result.editor_info)).toHaveLength(3)
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
test('chains multiple inputs through OBJECT_SET commands', () => {
|
|
130
|
+
const result = genMap(baseConfig({ inputs: { a: 'foo.bar', b: 'baz' } }))
|
|
131
|
+
|
|
132
|
+
const { run } = findSandboxIds(result.map)
|
|
133
|
+
|
|
134
|
+
// Each input gets a data-node + an OBJECT_SET command-node.
|
|
135
|
+
expect(result.map.a.type).toBe('data-node')
|
|
136
|
+
expect(result.map.b.type).toBe('data-node')
|
|
137
|
+
|
|
138
|
+
const aCommandId = result.map.a.out.value[0].id
|
|
139
|
+
const bCommandId = result.map.b.out.value[0].id
|
|
140
|
+
expect(aCommandId).not.toBe(bCommandId)
|
|
141
|
+
|
|
142
|
+
const aCmd = result.map[aCommandId]
|
|
143
|
+
const bCmd = result.map[bCommandId]
|
|
144
|
+
expect(aCmd.properties.command).toBe('OBJECT_SET')
|
|
145
|
+
expect(aCmd.properties.args.path).toBe('foo.bar')
|
|
146
|
+
expect(bCmd.properties.command).toBe('OBJECT_SET')
|
|
147
|
+
expect(bCmd.properties.args.path).toBe('baz')
|
|
148
|
+
|
|
149
|
+
// First command has no upstream obj; second command's obj input is the first command.
|
|
150
|
+
expect(aCmd.in.obj).toBeNull()
|
|
151
|
+
expect(bCmd.in.obj).toEqual([{ id: aCommandId, port: 'result' }])
|
|
152
|
+
// First command forwards its result to the second command's `obj` input.
|
|
153
|
+
expect(aCmd.out.result).toEqual([{ id: bCommandId, port: 'obj' }])
|
|
154
|
+
// The last command feeds the SANDBOX_RUN_JAVASCRIPT `inputs` port.
|
|
155
|
+
expect(bCmd.out.result).toEqual([{ id: run, port: 'inputs' }])
|
|
156
|
+
expect(result.map[run].in.inputs).toEqual([{ id: bCommandId, port: 'result' }])
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
test('builds OBJECT_GET commands and target data-nodes for outputs', () => {
|
|
160
|
+
const result = genMap(baseConfig({ outputs: { resultPath: ['pb1', 'pb2'] } }))
|
|
161
|
+
|
|
162
|
+
const { result: returnValue } = findSandboxIds(result.map)
|
|
163
|
+
|
|
164
|
+
// Both target property-bank nodes are created as data-nodes.
|
|
165
|
+
expect(result.map.pb1.type).toBe('data-node')
|
|
166
|
+
expect(result.map.pb2.type).toBe('data-node')
|
|
167
|
+
|
|
168
|
+
// The SANDBOX_GET_RETURN_VALUE forwards to the OBJECT_GET command for the output entry.
|
|
169
|
+
const objectGetRefs = result.map[returnValue].out.result
|
|
170
|
+
expect(objectGetRefs).toHaveLength(1)
|
|
171
|
+
const getCommandId = objectGetRefs[0].id
|
|
172
|
+
expect(objectGetRefs[0].port).toBe('obj')
|
|
173
|
+
|
|
174
|
+
const getCmd = result.map[getCommandId]
|
|
175
|
+
expect(getCmd.type).toBe('command-node-object')
|
|
176
|
+
expect(getCmd.properties.command).toBe('OBJECT_GET')
|
|
177
|
+
expect(getCmd.properties.args.path).toBe('resultPath')
|
|
178
|
+
expect(getCmd.in.obj).toEqual([{ id: returnValue, port: 'result' }])
|
|
179
|
+
|
|
180
|
+
// OBJECT_GET feeds both target data-nodes' `change` ports.
|
|
181
|
+
expect(getCmd.out.result).toEqual([
|
|
182
|
+
{ id: 'pb1', port: 'change' },
|
|
183
|
+
{ id: 'pb2', port: 'change' },
|
|
184
|
+
])
|
|
185
|
+
// Target data-nodes consume the OBJECT_GET result via their `change` port.
|
|
186
|
+
expect(result.map.pb1.in.change).toEqual([{ id: getCommandId, port: 'result' }])
|
|
187
|
+
expect(result.map.pb2.in.change).toEqual([{ id: getCommandId, port: 'result' }])
|
|
188
|
+
|
|
189
|
+
// Without input usage their `out.value` defaults to null.
|
|
190
|
+
expect(result.map.pb1.out.value).toBeNull()
|
|
191
|
+
expect(result.map.pb2.out.value).toBeNull()
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
// Manual mode is the only mode that lets an output target reuse an input id
|
|
195
|
+
// (see validateConfig tests). When that happens, generateCalulationMap must
|
|
196
|
+
// keep the input-side `out.value` so the data-node remains a usable input.
|
|
197
|
+
test.each([
|
|
198
|
+
['outputs', { outputs: { result: ['shared'] } }],
|
|
199
|
+
['output', { output: 'shared' }],
|
|
200
|
+
['error', { error: 'shared' }],
|
|
201
|
+
])('preserves input out.value when %s target reuses an input id', (_, overrides) => {
|
|
202
|
+
const result = genMap(
|
|
203
|
+
baseConfig({ trigger_mode: 'manual', inputs: { shared: 'foo' }, ...overrides }),
|
|
204
|
+
)
|
|
205
|
+
expect(Array.isArray(result.map.shared.out.value)).toBe(true)
|
|
206
|
+
expect(result.map[result.map.shared.out.value[0].id].properties.command).toBe('OBJECT_SET')
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
test('also rewires in.change to OBJECT_GET when an outputs target reuses an input id', () => {
|
|
210
|
+
const result = genMap(
|
|
211
|
+
baseConfig({
|
|
212
|
+
trigger_mode: 'manual',
|
|
213
|
+
inputs: { shared: 'foo' },
|
|
214
|
+
outputs: { result: ['shared'] },
|
|
215
|
+
}),
|
|
216
|
+
)
|
|
217
|
+
expect(result.map.shared.in.change).toHaveLength(1)
|
|
218
|
+
expect(result.map[result.map.shared.in.change[0].id].properties.command).toBe('OBJECT_GET')
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
test('preserves out.value when the same pb appears in multiple outputs entries', () => {
|
|
222
|
+
// Two outputs entries both target `pb1`. The reduce visits each entry in turn
|
|
223
|
+
// and must preserve the accumulated `out.value` from the first iteration via
|
|
224
|
+
// `acc.map[pb]` rather than wiping it on the second.
|
|
225
|
+
const result = genMap(baseConfig({ outputs: { first: ['pb1'], second: ['pb1'] } }))
|
|
226
|
+
expect(result.map.pb1.type).toBe('data-node')
|
|
227
|
+
// Without an input, out.value remains null after both passes.
|
|
228
|
+
expect(result.map.pb1.out.value).toBeNull()
|
|
229
|
+
// The latest OBJECT_GET wins as the change source — each iteration overwrites
|
|
230
|
+
// `in.change`, so we end up pointing at the second outputs entry's command.
|
|
231
|
+
expect(result.map.pb1.in.change).toHaveLength(1)
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
test('wires the error data-node when error is configured', () => {
|
|
235
|
+
const result = genMap(baseConfig({ error: 'errNode' }))
|
|
236
|
+
|
|
237
|
+
const { error } = findSandboxIds(result.map)
|
|
238
|
+
// SANDBOX_GET_ERROR now broadcasts to the error data-node's `change` port.
|
|
239
|
+
expect(result.map[error].out.result).toEqual([{ id: 'errNode', port: 'change' }])
|
|
240
|
+
expect(result.map.errNode.type).toBe('data-node')
|
|
241
|
+
expect(result.map.errNode.in.change).toEqual([{ id: error, port: 'result' }])
|
|
242
|
+
// No upstream input → out.value falls back to null.
|
|
243
|
+
expect(result.map.errNode.out.value).toBeNull()
|
|
244
|
+
// editor_info contains the new node.
|
|
245
|
+
expect(result.editor_info.errNode).toBeDefined()
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
test('wires the output data-node when output is configured', () => {
|
|
249
|
+
const result = genMap(baseConfig({ output: 'outNode' }))
|
|
250
|
+
|
|
251
|
+
const { result: returnValue } = findSandboxIds(result.map)
|
|
252
|
+
expect(result.map[returnValue].out.result).toEqual([{ id: 'outNode', port: 'change' }])
|
|
253
|
+
expect(result.map.outNode.type).toBe('data-node')
|
|
254
|
+
expect(result.map.outNode.in.change).toEqual([{ id: returnValue, port: 'result' }])
|
|
255
|
+
expect(result.editor_info.outNode).toBeDefined()
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
test('manual trigger mode sets disable_trigger_command on input value ports', () => {
|
|
259
|
+
const result = genMap(
|
|
260
|
+
baseConfig({
|
|
261
|
+
trigger_mode: 'manual',
|
|
262
|
+
inputs: { a: 'foo', b: 'bar' },
|
|
263
|
+
}),
|
|
264
|
+
)
|
|
265
|
+
const aCmdId = result.map.a.out.value[0].id
|
|
266
|
+
const bCmdId = result.map.b.out.value[0].id
|
|
267
|
+
expect(result.map[aCmdId].in.value[0].disable_trigger_command).toBe(true)
|
|
268
|
+
expect(result.map[bCmdId].in.value[0].disable_trigger_command).toBe(true)
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
test('auto trigger mode honours per-key disabled_triggers', () => {
|
|
272
|
+
const result = genMap(
|
|
273
|
+
baseConfig({
|
|
274
|
+
inputs: { a: 'foo', b: 'bar' },
|
|
275
|
+
disabled_triggers: { a: true, b: false },
|
|
276
|
+
}),
|
|
277
|
+
)
|
|
278
|
+
const aCmdId = result.map.a.out.value[0].id
|
|
279
|
+
const bCmdId = result.map.b.out.value[0].id
|
|
280
|
+
expect(result.map[aCmdId].in.value[0].disable_trigger_command).toBe(true)
|
|
281
|
+
// Falsy disabled_triggers entry → property is not set (or set to undefined).
|
|
282
|
+
expect(result.map[bCmdId].in.value[0].disable_trigger_command).toBeUndefined()
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
test('auto trigger mode without disabled_triggers leaves disable_trigger_command undefined', () => {
|
|
286
|
+
const result = genMap(baseConfig({ inputs: { a: 'foo' } }))
|
|
287
|
+
const aCmdId = result.map.a.out.value[0].id
|
|
288
|
+
expect(result.map[aCmdId].in.value[0].disable_trigger_command).toBeUndefined()
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
test('derives command ids deterministically from the calc id (stable across compiles)', () => {
|
|
292
|
+
const config = baseConfig({ inputs: { a: 'foo' }, outputs: { out: ['pb1'] } })
|
|
293
|
+
const first = generateCalulationMap(config, CALC_ID)
|
|
294
|
+
const second = generateCalulationMap(config, CALC_ID)
|
|
295
|
+
// Same calc id + same config must yield byte-identical ids, so recompiling unchanged
|
|
296
|
+
// source produces no spurious property_bank_calc_map diff.
|
|
297
|
+
expect(Object.keys(second.map)).toEqual(Object.keys(first.map))
|
|
298
|
+
|
|
299
|
+
const uuid = '[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}'
|
|
300
|
+
sandboxNodeIds(first.map).forEach(({ id }) => {
|
|
301
|
+
expect(id).toMatch(new RegExp(`^PROPERTY_BANK_COMMAND_NODE_${uuid}$`))
|
|
302
|
+
})
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
test('seeds command ids per calc so different calcs never collide (edit isolation)', () => {
|
|
306
|
+
const config = baseConfig({ inputs: { a: 'foo' } })
|
|
307
|
+
const a = generateCalulationMap(
|
|
308
|
+
config,
|
|
309
|
+
'PROPERTY_BANK_COMMAND_MAP_aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa',
|
|
310
|
+
)
|
|
311
|
+
const b = generateCalulationMap(
|
|
312
|
+
config,
|
|
313
|
+
'PROPERTY_BANK_COMMAND_MAP_bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb',
|
|
314
|
+
)
|
|
315
|
+
expect(findSandboxIds(a.map).run).not.toBe(findSandboxIds(b.map).run)
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
test('validateConfig errors propagate out of generateCalulationMap', () => {
|
|
319
|
+
expect(() => genMap(baseConfig({ inputs: { a: 'foo' }, error: 'a' }))).toThrow(/key: error/)
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
test('SANDBOX_GET_RETURN_VALUE broadcasts to both output target and outputs commands', () => {
|
|
323
|
+
const result = genMap(
|
|
324
|
+
baseConfig({
|
|
325
|
+
output: 'outNode',
|
|
326
|
+
outputs: { foo: ['pb1'] },
|
|
327
|
+
}),
|
|
328
|
+
)
|
|
329
|
+
const { result: returnValue } = findSandboxIds(result.map)
|
|
330
|
+
const refs = result.map[returnValue].out.result
|
|
331
|
+
// First entry is the output data-node's `change` port; remainder are OBJECT_GET ids.
|
|
332
|
+
expect(refs[0]).toEqual({ id: 'outNode', port: 'change' })
|
|
333
|
+
expect(refs).toHaveLength(2)
|
|
334
|
+
expect(refs[1].port).toBe('obj')
|
|
335
|
+
expect(result.map[refs[1].id].properties.command).toBe('OBJECT_GET')
|
|
336
|
+
})
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
// Direction A: generateCalulationMap also emits a single-node `script_map` the new runtime
|
|
340
|
+
// prefers. These assert that derived graph, independent of the legacy `map` above.
|
|
341
|
+
const scriptNode = (scriptMap) =>
|
|
342
|
+
Object.entries(scriptMap).find(([, node]) => node.type === 'command-node-script')
|
|
343
|
+
|
|
344
|
+
describe('generateScriptMap (script_map)', () => {
|
|
345
|
+
test('empty config produces a single command-node-script node', () => {
|
|
346
|
+
const { script_map } = genMap(baseConfig())
|
|
347
|
+
expect(Object.values(script_map)).toHaveLength(1)
|
|
348
|
+
const [, node] = scriptNode(script_map)
|
|
349
|
+
expect(node.properties.command).toBe('SCRIPT_RUN')
|
|
350
|
+
expect(node.properties.args.code).toBe('return inputs')
|
|
351
|
+
expect(node.properties.args.inputs).toEqual({})
|
|
352
|
+
expect(node.properties.args.outputs).toEqual({})
|
|
353
|
+
expect(node.in).toEqual({})
|
|
354
|
+
expect(node.out).toEqual({})
|
|
355
|
+
})
|
|
356
|
+
|
|
357
|
+
test('wires keyed input ports and input data nodes, preserving order', () => {
|
|
358
|
+
const { script_map } = genMap(baseConfig({ inputs: { a: 'foo.bar', b: 'baz' } }))
|
|
359
|
+
const [scriptId, node] = scriptNode(script_map)
|
|
360
|
+
expect(script_map.a.out.value).toEqual([{ id: scriptId, port: 'a' }])
|
|
361
|
+
expect(script_map.b.out.value).toEqual([{ id: scriptId, port: 'b' }])
|
|
362
|
+
expect(script_map.a.in.change).toBeNull()
|
|
363
|
+
expect(node.in.a).toEqual([{ id: 'a', port: 'value' }])
|
|
364
|
+
expect(node.in.b).toEqual([{ id: 'b', port: 'value' }])
|
|
365
|
+
// args.inputs maps each input port (data-node id) to its inputs-object path, in order.
|
|
366
|
+
expect(node.properties.args.inputs).toEqual({ a: 'foo.bar', b: 'baz' })
|
|
367
|
+
expect(Object.keys(node.properties.args.inputs)).toEqual(['a', 'b'])
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
test('fans out output / error / outputs to distinct ports and target data nodes', () => {
|
|
371
|
+
const { script_map } = genMap(
|
|
372
|
+
baseConfig({ output: 'outNode', error: 'errNode', outputs: { sum: ['pb1', 'pb2'] } }),
|
|
373
|
+
)
|
|
374
|
+
const [scriptId, node] = scriptNode(script_map)
|
|
375
|
+
expect(node.out.output).toEqual([{ id: 'outNode', port: 'change' }])
|
|
376
|
+
expect(node.out.error).toEqual([{ id: 'errNode', port: 'change' }])
|
|
377
|
+
expect(node.out['out:sum']).toEqual([
|
|
378
|
+
{ id: 'pb1', port: 'change' },
|
|
379
|
+
{ id: 'pb2', port: 'change' },
|
|
380
|
+
])
|
|
381
|
+
expect(node.properties.args.outputs).toEqual({ 'out:sum': 'sum' })
|
|
382
|
+
expect(script_map.outNode.in.change).toEqual([{ id: scriptId, port: 'output' }])
|
|
383
|
+
expect(script_map.errNode.in.change).toEqual([{ id: scriptId, port: 'error' }])
|
|
384
|
+
expect(script_map.pb1.in.change).toEqual([{ id: scriptId, port: 'out:sum' }])
|
|
385
|
+
expect(script_map.pb2.in.change).toEqual([{ id: scriptId, port: 'out:sum' }])
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
test('manual mode disables every input edge', () => {
|
|
389
|
+
const { script_map } = genMap(
|
|
390
|
+
baseConfig({ trigger_mode: 'manual', inputs: { a: 'foo', b: 'bar' } }),
|
|
391
|
+
)
|
|
392
|
+
const [, node] = scriptNode(script_map)
|
|
393
|
+
expect(node.in.a[0].disable_trigger_command).toBe(true)
|
|
394
|
+
expect(node.in.b[0].disable_trigger_command).toBe(true)
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
test('auto mode honours per-key disabled_triggers', () => {
|
|
398
|
+
const { script_map } = genMap(
|
|
399
|
+
baseConfig({ inputs: { a: 'foo', b: 'bar' }, disabled_triggers: { a: true, b: false } }),
|
|
400
|
+
)
|
|
401
|
+
const [, node] = scriptNode(script_map)
|
|
402
|
+
expect(node.in.a[0].disable_trigger_command).toBe(true)
|
|
403
|
+
expect(node.in.b[0].disable_trigger_command).toBeUndefined()
|
|
404
|
+
})
|
|
405
|
+
|
|
406
|
+
test('a node reused as input and output keeps both edges (manual mode)', () => {
|
|
407
|
+
const { script_map } = genMap(
|
|
408
|
+
baseConfig({
|
|
409
|
+
trigger_mode: 'manual',
|
|
410
|
+
inputs: { shared: 'foo' },
|
|
411
|
+
outputs: { sum: ['shared'] },
|
|
412
|
+
}),
|
|
413
|
+
)
|
|
414
|
+
const [scriptId] = scriptNode(script_map)
|
|
415
|
+
// Input side (out.value) is preserved alongside the output side (in.change).
|
|
416
|
+
expect(script_map.shared.out.value).toEqual([{ id: scriptId, port: 'shared' }])
|
|
417
|
+
expect(script_map.shared.in.change).toEqual([{ id: scriptId, port: 'out:sum' }])
|
|
418
|
+
})
|
|
419
|
+
|
|
420
|
+
test('outputs port names never collide with the reserved output port', () => {
|
|
421
|
+
const { script_map } = genMap(baseConfig({ output: 'outNode', outputs: { output: ['pb1'] } }))
|
|
422
|
+
const [, node] = scriptNode(script_map)
|
|
423
|
+
// The whole-return-value port stays `output`; an outputs path literally named "output"
|
|
424
|
+
// is namespaced to `out:output`.
|
|
425
|
+
expect(node.out.output).toEqual([{ id: 'outNode', port: 'change' }])
|
|
426
|
+
expect(node.out['out:output']).toEqual([{ id: 'pb1', port: 'change' }])
|
|
427
|
+
expect(node.properties.args.outputs).toEqual({ 'out:output': 'output' })
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
test('script node id is byte-stable across recompiles and unique per calc', () => {
|
|
431
|
+
const config = baseConfig({ inputs: { a: 'foo' }, outputs: { out: ['pb1'] } })
|
|
432
|
+
const first = generateCalulationMap(config, CALC_ID)
|
|
433
|
+
const second = generateCalulationMap(config, CALC_ID)
|
|
434
|
+
expect(Object.keys(second.script_map)).toEqual(Object.keys(first.script_map))
|
|
435
|
+
const [idA] = scriptNode(first.script_map)
|
|
436
|
+
const [idB] = scriptNode(
|
|
437
|
+
generateCalulationMap(
|
|
438
|
+
config,
|
|
439
|
+
'PROPERTY_BANK_COMMAND_MAP_bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb',
|
|
440
|
+
).script_map,
|
|
441
|
+
)
|
|
442
|
+
expect(idA).not.toBe(idB)
|
|
443
|
+
const uuid = '[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}'
|
|
444
|
+
expect(idA).toMatch(new RegExp(`^PROPERTY_BANK_COMMAND_NODE_${uuid}$`))
|
|
445
|
+
})
|
|
446
|
+
|
|
447
|
+
test('validateConfig still guards the script_map path (auto mode overlap)', () => {
|
|
448
|
+
expect(() => genMap(baseConfig({ inputs: { a: 'foo' }, error: 'a' }))).toThrow(/key: error/)
|
|
449
|
+
})
|
|
450
|
+
})
|
|
@@ -350,6 +350,63 @@ export const templateActionNameMap = {
|
|
|
350
350
|
strokeWidth: 'BRICK_SKETCH_STROKE_WIDTH',
|
|
351
351
|
},
|
|
352
352
|
},
|
|
353
|
+
BRICK_SCENE_3D: {
|
|
354
|
+
BRICK_SCENE_3D_ADD_OBJECT: {
|
|
355
|
+
objectId: 'BRICK_SCENE_3D_OBJECT_ID',
|
|
356
|
+
objectType: 'BRICK_SCENE_3D_OBJECT_TYPE',
|
|
357
|
+
objectUrl: 'BRICK_SCENE_3D_OBJECT_URL',
|
|
358
|
+
objectMd5: 'BRICK_SCENE_3D_OBJECT_MD5',
|
|
359
|
+
objectPosition: 'BRICK_SCENE_3D_OBJECT_POSITION',
|
|
360
|
+
objectRotation: 'BRICK_SCENE_3D_OBJECT_ROTATION',
|
|
361
|
+
objectScale: 'BRICK_SCENE_3D_OBJECT_SCALE',
|
|
362
|
+
objectColor: 'BRICK_SCENE_3D_OBJECT_COLOR',
|
|
363
|
+
},
|
|
364
|
+
BRICK_SCENE_3D_REMOVE_OBJECT: {
|
|
365
|
+
objectId: 'BRICK_SCENE_3D_OBJECT_ID',
|
|
366
|
+
},
|
|
367
|
+
BRICK_SCENE_3D_UPDATE_OBJECT: {
|
|
368
|
+
objectId: 'BRICK_SCENE_3D_OBJECT_ID',
|
|
369
|
+
objectPosition: 'BRICK_SCENE_3D_OBJECT_POSITION',
|
|
370
|
+
objectRotation: 'BRICK_SCENE_3D_OBJECT_ROTATION',
|
|
371
|
+
objectScale: 'BRICK_SCENE_3D_OBJECT_SCALE',
|
|
372
|
+
objectVisible: 'BRICK_SCENE_3D_OBJECT_VISIBLE',
|
|
373
|
+
objectColor: 'BRICK_SCENE_3D_OBJECT_COLOR',
|
|
374
|
+
objectNodes: 'BRICK_SCENE_3D_OBJECT_NODES',
|
|
375
|
+
},
|
|
376
|
+
BRICK_SCENE_3D_SET_CAMERA: {
|
|
377
|
+
cameraPosition: 'BRICK_SCENE_3D_CAMERA_POSITION',
|
|
378
|
+
cameraTarget: 'BRICK_SCENE_3D_CAMERA_TARGET',
|
|
379
|
+
cameraFov: 'BRICK_SCENE_3D_CAMERA_FOV',
|
|
380
|
+
cameraAnimateMs: 'BRICK_SCENE_3D_CAMERA_ANIMATE_MS',
|
|
381
|
+
},
|
|
382
|
+
BRICK_SCENE_3D_LOOK_AT: {
|
|
383
|
+
objectId: 'BRICK_SCENE_3D_OBJECT_ID',
|
|
384
|
+
},
|
|
385
|
+
BRICK_SCENE_3D_PLAY_ANIMATION: {
|
|
386
|
+
objectId: 'BRICK_SCENE_3D_OBJECT_ID',
|
|
387
|
+
animationName: 'BRICK_SCENE_3D_ANIMATION_NAME',
|
|
388
|
+
animationLoop: 'BRICK_SCENE_3D_ANIMATION_LOOP',
|
|
389
|
+
animationSpeed: 'BRICK_SCENE_3D_ANIMATION_SPEED',
|
|
390
|
+
},
|
|
391
|
+
BRICK_SCENE_3D_STOP_ANIMATION: {
|
|
392
|
+
objectId: 'BRICK_SCENE_3D_OBJECT_ID',
|
|
393
|
+
animationName: 'BRICK_SCENE_3D_ANIMATION_NAME',
|
|
394
|
+
},
|
|
395
|
+
BRICK_SCENE_3D_SET_BACKGROUND: {
|
|
396
|
+
backgroundColor: 'BRICK_SCENE_3D_BACKGROUND_COLOR',
|
|
397
|
+
backgroundHdrUrl: 'BRICK_SCENE_3D_BACKGROUND_HDR_URL',
|
|
398
|
+
backgroundMd5: 'BRICK_SCENE_3D_BACKGROUND_MD5',
|
|
399
|
+
},
|
|
400
|
+
BRICK_SCENE_3D_SET_CONTROLS: {
|
|
401
|
+
controlsEnabled: 'BRICK_SCENE_3D_CONTROLS_ENABLED',
|
|
402
|
+
controlsAutoRotate: 'BRICK_SCENE_3D_CONTROLS_AUTO_ROTATE',
|
|
403
|
+
controlsAutoRotateSpeed: 'BRICK_SCENE_3D_CONTROLS_AUTO_ROTATE_SPEED',
|
|
404
|
+
},
|
|
405
|
+
BRICK_SCENE_3D_SCREENSHOT: {
|
|
406
|
+
screenshotFormat: 'BRICK_SCENE_3D_SCREENSHOT_FORMAT',
|
|
407
|
+
screenshotQuality: 'BRICK_SCENE_3D_SCREENSHOT_QUALITY',
|
|
408
|
+
},
|
|
409
|
+
},
|
|
353
410
|
|
|
354
411
|
GENERATOR_FILE: {
|
|
355
412
|
GENERATOR_FILE_READ_CONTENT: {
|
|
@@ -782,6 +839,11 @@ export const templateActionNameMap = {
|
|
|
782
839
|
seed: 'GENERATOR_LLM_SEED',
|
|
783
840
|
typicalP: 'GENERATOR_LLM_TYPICAL_P',
|
|
784
841
|
ignoreEos: 'GENERATOR_LLM_IGNORE_EOS',
|
|
842
|
+
mtpSpeculativeDecoding: 'GENERATOR_LLM_MTP_SPECULATIVE_DECODING',
|
|
843
|
+
mtpDraftTokens: 'GENERATOR_LLM_MTP_DRAFT_TOKENS',
|
|
844
|
+
mtpDraftMinTokens: 'GENERATOR_LLM_MTP_DRAFT_MIN_TOKENS',
|
|
845
|
+
mtpDraftMinProbability: 'GENERATOR_LLM_MTP_DRAFT_MIN_PROBABILITY',
|
|
846
|
+
mtpDraftSplitProbability: 'GENERATOR_LLM_MTP_DRAFT_SPLIT_PROBABILITY',
|
|
785
847
|
functionCallEnabled: 'GENERATOR_LLM_FUNCTION_CALL_ENABLED',
|
|
786
848
|
functionCallSchema: 'GENERATOR_LLM_FUNCTION_CALL_SCHEMA',
|
|
787
849
|
},
|
|
@@ -894,10 +956,12 @@ export const templateActionNameMap = {
|
|
|
894
956
|
GENERATOR_APPLE_STT_TRANSCRIBE_FILE: {
|
|
895
957
|
fileUrl: 'GENERATOR_APPLE_STT_FILE_URL',
|
|
896
958
|
language: 'GENERATOR_APPLE_STT_LANGUAGE',
|
|
959
|
+
contextualStrings: 'GENERATOR_APPLE_STT_CONTEXTUAL_STRINGS',
|
|
897
960
|
},
|
|
898
961
|
GENERATOR_APPLE_STT_TRANSCRIBE_DATA: {
|
|
899
962
|
data: 'GENERATOR_APPLE_STT_DATA',
|
|
900
963
|
language: 'GENERATOR_APPLE_STT_LANGUAGE',
|
|
964
|
+
contextualStrings: 'GENERATOR_APPLE_STT_CONTEXTUAL_STRINGS',
|
|
901
965
|
},
|
|
902
966
|
},
|
|
903
967
|
GENERATOR_APPLE_TTS: {
|