@dxos/react-ui-canvas-compute 0.7.5-labs.5f04cf6
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/LICENSE +8 -0
- package/README.md +1 -0
- package/dist/lib/browser/index.mjs +2499 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/node/index.cjs +2591 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node-esm/index.mjs +2499 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/types/src/compute-layout.d.ts +9 -0
- package/dist/types/src/compute-layout.d.ts.map +1 -0
- package/dist/types/src/compute.stories.d.ts +28 -0
- package/dist/types/src/compute.stories.d.ts.map +1 -0
- package/dist/types/src/graph/controller.d.ts +139 -0
- package/dist/types/src/graph/controller.d.ts.map +1 -0
- package/dist/types/src/graph/index.d.ts +3 -0
- package/dist/types/src/graph/index.d.ts.map +1 -0
- package/dist/types/src/graph/node-defs.d.ts +6 -0
- package/dist/types/src/graph/node-defs.d.ts.map +1 -0
- package/dist/types/src/hooks/compute-context.d.ts +7 -0
- package/dist/types/src/hooks/compute-context.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeNodeState.d.ts +19 -0
- package/dist/types/src/hooks/useComputeNodeState.d.ts.map +1 -0
- package/dist/types/src/hooks/useGraphMonitor.d.ts +14 -0
- package/dist/types/src/hooks/useGraphMonitor.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +6 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/json.test.d.ts +21 -0
- package/dist/types/src/json.test.d.ts.map +1 -0
- package/dist/types/src/registry.d.ts +9 -0
- package/dist/types/src/registry.d.ts.map +1 -0
- package/dist/types/src/schema.test.d.ts +2 -0
- package/dist/types/src/schema.test.d.ts.map +1 -0
- package/dist/types/src/shapes/Append.d.ts +54 -0
- package/dist/types/src/shapes/Append.d.ts.map +1 -0
- package/dist/types/src/shapes/Array.d.ts +38 -0
- package/dist/types/src/shapes/Array.d.ts.map +1 -0
- package/dist/types/src/shapes/Audio.d.ts +54 -0
- package/dist/types/src/shapes/Audio.d.ts.map +1 -0
- package/dist/types/src/shapes/Beacon.d.ts +54 -0
- package/dist/types/src/shapes/Beacon.d.ts.map +1 -0
- package/dist/types/src/shapes/Boolean.d.ts +233 -0
- package/dist/types/src/shapes/Boolean.d.ts.map +1 -0
- package/dist/types/src/shapes/Chat.d.ts +57 -0
- package/dist/types/src/shapes/Chat.d.ts.map +1 -0
- package/dist/types/src/shapes/Constant.d.ts +60 -0
- package/dist/types/src/shapes/Constant.d.ts.map +1 -0
- package/dist/types/src/shapes/Database.d.ts +54 -0
- package/dist/types/src/shapes/Database.d.ts.map +1 -0
- package/dist/types/src/shapes/Function.d.ts +54 -0
- package/dist/types/src/shapes/Function.d.ts.map +1 -0
- package/dist/types/src/shapes/Gpt.d.ts +54 -0
- package/dist/types/src/shapes/Gpt.d.ts.map +1 -0
- package/dist/types/src/shapes/GptRealtime.d.ts +54 -0
- package/dist/types/src/shapes/GptRealtime.d.ts.map +1 -0
- package/dist/types/src/shapes/Json.d.ts +107 -0
- package/dist/types/src/shapes/Json.d.ts.map +1 -0
- package/dist/types/src/shapes/Logic.d.ts +109 -0
- package/dist/types/src/shapes/Logic.d.ts.map +1 -0
- package/dist/types/src/shapes/Queue.d.ts +58 -0
- package/dist/types/src/shapes/Queue.d.ts.map +1 -0
- package/dist/types/src/shapes/RNG.d.ts +58 -0
- package/dist/types/src/shapes/RNG.d.ts.map +1 -0
- package/dist/types/src/shapes/Scope.d.ts +54 -0
- package/dist/types/src/shapes/Scope.d.ts.map +1 -0
- package/dist/types/src/shapes/Surface.d.ts +54 -0
- package/dist/types/src/shapes/Surface.d.ts.map +1 -0
- package/dist/types/src/shapes/Switch.d.ts +54 -0
- package/dist/types/src/shapes/Switch.d.ts.map +1 -0
- package/dist/types/src/shapes/Table.d.ts +54 -0
- package/dist/types/src/shapes/Table.d.ts.map +1 -0
- package/dist/types/src/shapes/Template.d.ts +56 -0
- package/dist/types/src/shapes/Template.d.ts.map +1 -0
- package/dist/types/src/shapes/Text.d.ts +54 -0
- package/dist/types/src/shapes/Text.d.ts.map +1 -0
- package/dist/types/src/shapes/TextToImage.d.ts +54 -0
- package/dist/types/src/shapes/TextToImage.d.ts.map +1 -0
- package/dist/types/src/shapes/Thread.d.ts +58 -0
- package/dist/types/src/shapes/Thread.d.ts.map +1 -0
- package/dist/types/src/shapes/Trigger.d.ts +64 -0
- package/dist/types/src/shapes/Trigger.d.ts.map +1 -0
- package/dist/types/src/shapes/common/Box.d.ts +25 -0
- package/dist/types/src/shapes/common/Box.d.ts.map +1 -0
- package/dist/types/src/shapes/common/FunctionBody.d.ts +15 -0
- package/dist/types/src/shapes/common/FunctionBody.d.ts.map +1 -0
- package/dist/types/src/shapes/common/TypeSelect.d.ts +4 -0
- package/dist/types/src/shapes/common/TypeSelect.d.ts.map +1 -0
- package/dist/types/src/shapes/common/index.d.ts +4 -0
- package/dist/types/src/shapes/common/index.d.ts.map +1 -0
- package/dist/types/src/shapes/defs.d.ts +39 -0
- package/dist/types/src/shapes/defs.d.ts.map +1 -0
- package/dist/types/src/shapes/index.d.ts +27 -0
- package/dist/types/src/shapes/index.d.ts.map +1 -0
- package/dist/types/src/testing/circuits.d.ts +193 -0
- package/dist/types/src/testing/circuits.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +85 -0
- package/src/README.md +47 -0
- package/src/compute-layout.ts +37 -0
- package/src/compute.stories.tsx +362 -0
- package/src/graph/controller.ts +405 -0
- package/src/graph/index.ts +6 -0
- package/src/graph/node-defs.ts +82 -0
- package/src/hooks/compute-context.ts +19 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useComputeNodeState.ts +83 -0
- package/src/hooks/useGraphMonitor.ts +133 -0
- package/src/index.ts +9 -0
- package/src/json.test.ts +35 -0
- package/src/registry.ts +100 -0
- package/src/schema.test.ts +62 -0
- package/src/shapes/Append.tsx +43 -0
- package/src/shapes/Array.tsx +61 -0
- package/src/shapes/Audio.tsx +55 -0
- package/src/shapes/Beacon.tsx +56 -0
- package/src/shapes/Boolean.tsx +215 -0
- package/src/shapes/Chat.tsx +77 -0
- package/src/shapes/Constant.tsx +125 -0
- package/src/shapes/Database.tsx +39 -0
- package/src/shapes/Function.tsx +40 -0
- package/src/shapes/Gpt.tsx +91 -0
- package/src/shapes/GptRealtime.tsx +168 -0
- package/src/shapes/Json.tsx +103 -0
- package/src/shapes/Logic.tsx +82 -0
- package/src/shapes/Queue.tsx +78 -0
- package/src/shapes/RNG.tsx +84 -0
- package/src/shapes/Scope.tsx +54 -0
- package/src/shapes/Surface.tsx +57 -0
- package/src/shapes/Switch.tsx +53 -0
- package/src/shapes/Table.tsx +45 -0
- package/src/shapes/Template.tsx +98 -0
- package/src/shapes/Text.tsx +56 -0
- package/src/shapes/TextToImage.tsx +39 -0
- package/src/shapes/Thread.tsx +87 -0
- package/src/shapes/Trigger.tsx +152 -0
- package/src/shapes/common/Box.tsx +74 -0
- package/src/shapes/common/FunctionBody.tsx +122 -0
- package/src/shapes/common/TypeSelect.tsx +27 -0
- package/src/shapes/common/index.ts +7 -0
- package/src/shapes/defs.ts +50 -0
- package/src/shapes/index.ts +31 -0
- package/src/testing/circuits.ts +320 -0
- package/src/testing/index.ts +5 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/graph/controller.ts", "../../../src/graph/node-defs.ts", "../../../src/hooks/compute-context.ts", "../../../src/hooks/useComputeNodeState.ts", "../../../src/hooks/useGraphMonitor.ts", "../../../src/registry.ts", "../../../src/shapes/common/Box.tsx", "../../../src/shapes/common/FunctionBody.tsx", "../../../src/shapes/defs.ts", "../../../src/shapes/common/TypeSelect.tsx", "../../../src/shapes/Array.tsx", "../../../src/shapes/Append.tsx", "../../../src/shapes/Audio.tsx", "../../../src/shapes/Beacon.tsx", "../../../src/shapes/Boolean.tsx", "../../../src/shapes/Chat.tsx", "../../../src/shapes/Constant.tsx", "../../../src/shapes/Database.tsx", "../../../src/shapes/Function.tsx", "../../../src/shapes/Gpt.tsx", "../../../src/shapes/Json.tsx", "../../../src/shapes/Logic.tsx", "../../../src/shapes/Queue.tsx", "../../../src/shapes/RNG.tsx", "../../../src/shapes/Scope.tsx", "../../../src/shapes/Surface.tsx", "../../../src/shapes/Switch.tsx", "../../../src/shapes/Table.tsx", "../../../src/shapes/Template.tsx", "../../../src/shapes/Text.tsx", "../../../src/shapes/Thread.tsx", "../../../src/shapes/TextToImage.tsx", "../../../src/shapes/Trigger.tsx", "../../../src/shapes/GptRealtime.tsx", "../../../src/compute-layout.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Context, Effect, Either, Exit, Layer, Scope } from 'effect';\n\nimport { type ImageContentBlock } from '@dxos/artifact';\nimport { Event, synchronized } from '@dxos/async';\nimport {\n isNotExecuted,\n makeValueBag,\n type ComputeEdge,\n type ComputeEvent,\n type ComputeGraphModel,\n type ComputeMeta,\n type ComputeNode,\n type ComputeRequirements,\n EventLogger,\n type GptInput,\n type GptOutput,\n GptService,\n GraphExecutor,\n MockGpt,\n QueueService,\n SpaceService,\n type ValueBag,\n} from '@dxos/conductor';\nimport { Resource } from '@dxos/context';\nimport type { EdgeClient, EdgeHttpClient } from '@dxos/edge-client';\nimport { log } from '@dxos/log';\nimport { type CanvasGraphModel } from '@dxos/react-ui-canvas-editor';\n\nimport { resolveComputeNode } from './node-defs';\nimport { createComputeGraph } from '../hooks';\nimport { type ComputeShape } from '../shapes';\n\n// TODO(burdon): API package for conductor.\nexport const InvalidStateError = Error;\n\nexport type FunctionCallback<INPUT, OUTPUT> = (input: INPUT) => Promise<OUTPUT>;\n\n/**\n * Callback to notify the controller of a scheduled update.\n */\nexport type AsyncUpdate<T> = (value: T) => void;\n\nexport interface GptExecutor {\n invoke: FunctionCallback<GptInput, GptOutput>;\n\n // TODO(dmaretskyi): A hack to get image artifacts working. Rework into querying images from the ai-service store.\n imageCache: Map<string, ImageContentBlock>;\n}\n\nexport type RuntimeValue =\n | {\n type: 'not-executed'; // TODO(burdon): Different from pending?\n }\n | {\n type: 'executed';\n value: any;\n }\n | {\n type: 'pending';\n }\n | {\n type: 'error';\n error: string;\n };\n\nexport type Services = {\n gpt: Context.Tag.Service<GptService>;\n edgeClient?: EdgeClient;\n edgeHttpClient?: EdgeHttpClient;\n spaceService?: Context.Tag.Service<SpaceService>;\n};\n\ntype ComputeOutputEvent = {\n nodeId: string;\n property: string;\n value: RuntimeValue;\n};\n\n/**\n * Nodes that will automatically trigger the execution of the graph on startup.\n */\nconst AUTO_TRIGGER_NODES = ['chat', 'switch', 'constant'];\n\nexport const createComputeGraphController = (graph: CanvasGraphModel<ComputeShape>, services?: Partial<Services>) => {\n const computeGraph = createComputeGraph(graph);\n const controller = new ComputeGraphController(computeGraph);\n controller.setServices(services ?? {});\n return { controller, graph };\n};\n\n/**\n * Controller that manages compute graph state, execution, and service coordination.\n */\nexport class ComputeGraphController extends Resource {\n private readonly _executor = new GraphExecutor({\n computeNodeResolver: (node) => resolveComputeNode(node),\n });\n\n private _services: Partial<Services> = {};\n\n /**\n * Canvas force-sets outputs of those nodes.\n */\n private _forcedOutputs: Record<string, Record<string, unknown>> = {};\n\n /**\n * Runtime state of the execution graph.\n */\n private _runtimeStateInputs: Record<string, Record<string, RuntimeValue>> = {};\n\n private _runtimeStateOutputs: Record<string, Record<string, RuntimeValue>> = {};\n\n // TODO(burdon): Remove? Make state reactive?\n public readonly update = new Event();\n\n /** Computed result. */\n public readonly output = new Event<ComputeOutputEvent>();\n\n public readonly events = new Event<ComputeEvent>();\n\n constructor(\n /** Persistent compute graph. */\n private readonly _graph: ComputeGraphModel,\n ) {\n super();\n }\n\n toJSON() {\n return {\n graph: this._graph,\n state: {\n inputs: this._runtimeStateInputs,\n outputs: this._runtimeStateOutputs,\n },\n forcedOutputs: this._forcedOutputs,\n };\n }\n\n setServices(services: Partial<Services>) {\n Object.assign(this._services, services);\n }\n\n get graph() {\n return this._graph;\n }\n\n get userState() {\n return this._forcedOutputs;\n }\n\n get inputStates() {\n return this._runtimeStateInputs;\n }\n\n get outputStates() {\n return this._runtimeStateOutputs;\n }\n\n /**\n * Inputs and outputs for all nodes.\n */\n get state() {\n const ids = [...new Set([...Object.keys(this._runtimeStateInputs), ...Object.keys(this._runtimeStateOutputs)])];\n return Object.fromEntries(\n ids.map((id) => [\n id,\n {\n node: this._graph.getNode(id),\n input: this._runtimeStateInputs[id],\n output: this._runtimeStateOutputs[id],\n },\n ]),\n );\n }\n\n addNode(node: ComputeNode) {\n this._graph.addNode(node);\n }\n\n addEdge(edge: ComputeEdge) {\n this._graph.addEdge(edge);\n }\n\n getComputeNode(nodeId: string): ComputeNode {\n return this._graph.getNode(nodeId);\n }\n\n getInputs(nodeId: string) {\n return this._runtimeStateInputs[nodeId] ?? {};\n }\n\n getOutputs(nodeId: string) {\n return this._runtimeStateOutputs[nodeId] ?? {};\n }\n\n setOutput(nodeId: string, property: string, value: any) {\n this._forcedOutputs[nodeId] ??= {};\n this._forcedOutputs[nodeId][property] = value;\n\n queueMicrotask(async () => {\n try {\n await this.exec(nodeId);\n } catch (err) {\n log.catch(err);\n }\n });\n }\n\n async getMeta(node: ComputeNode): Promise<ComputeMeta> {\n const { meta } = await resolveComputeNode(node);\n return meta;\n }\n\n async evalNode(nodeId: string) {\n const executor = this._executor.clone();\n await executor.load(this._graph);\n\n for (const [nodeId, outputs] of Object.entries(this._forcedOutputs)) {\n executor.setOutputs(nodeId, Effect.succeed(makeValueBag(outputs)));\n }\n\n const services = this._createServiceLayer();\n await Effect.runPromise(\n Effect.gen(this, function* () {\n const scope = yield* Scope.make();\n\n // TODO(dmaretskyi): Code duplication.\n const executable = yield* Effect.promise(() => resolveComputeNode(this._graph.getNode(nodeId)));\n const computingOutputs = executable.exec != null;\n // TODO(dmaretskyi): Check if the node has a compute function and run computeOutputs if it does.\n const effect = (computingOutputs ? executor.computeOutputs(nodeId) : executor.computeInputs(nodeId)).pipe(\n Effect.withSpan('runGraph'),\n Effect.provide(services),\n Scope.extend(scope),\n\n Effect.flatMap(computeValueBag),\n Effect.withSpan('test'),\n Effect.tap((values) => {\n for (const [key, value] of Object.entries(values)) {\n if (computingOutputs) {\n this._onOutputComputed(nodeId, key, value);\n } else {\n this._onInputComputed(nodeId, key, value);\n }\n }\n }),\n );\n\n yield* effect;\n\n yield* Scope.close(scope, Exit.void);\n }),\n );\n\n this.update.emit();\n }\n\n /**\n * Executes the graph.\n * @param startFromNode - Node to start from, otherwise all {@link AUTO_TRIGGER_NODES} are executed.\n */\n @synchronized\n async exec(startFromNode?: string) {\n this._runtimeStateInputs = {};\n this._runtimeStateOutputs = {};\n const executor = this._executor.clone();\n await executor.load(this._graph);\n\n for (const [nodeId, outputs] of Object.entries(this._forcedOutputs)) {\n executor.setOutputs(nodeId, Effect.succeed(makeValueBag(outputs)));\n }\n\n // TODO(dmaretskyi): Stop hardcoding.\n const triggerNodes =\n startFromNode != null\n ? [this._graph.getNode(startFromNode)]\n : this._graph.nodes.filter((node) => node.type != null && AUTO_TRIGGER_NODES.includes(node.type));\n const allAffectedNodes = [...new Set(triggerNodes.flatMap((node) => executor.getAllDependantNodes(node.id)))];\n\n const services = this._createServiceLayer();\n await Effect.runPromise(\n Effect.gen(this, function* () {\n const scope = yield* Scope.make();\n\n // TODO(burdon): Return map?\n const tasks: Effect.Effect<unknown, any, never>[] = [];\n for (const node of allAffectedNodes) {\n // TODO(dmaretskyi): Code duplication.\n const executable = yield* Effect.promise(() => resolveComputeNode(this._graph.getNode(node)));\n const computingOutputs = executable.exec != null;\n\n // TODO(dmaretskyi): Check if the node has a compute function and run computeOutputs if it does.\n const effect = (computingOutputs ? executor.computeOutputs(node) : executor.computeInputs(node)).pipe(\n Effect.withSpan('runGraph'),\n Effect.provide(services),\n Scope.extend(scope),\n Effect.flatMap(computeValueBag),\n Effect.withSpan('test'),\n Effect.tap((values) => {\n for (const [key, value] of Object.entries(values)) {\n if (computingOutputs) {\n this._onOutputComputed(node, key, value);\n } else {\n this._onInputComputed(node, key, value);\n }\n }\n }),\n );\n\n tasks.push(effect);\n }\n\n //\n yield* Effect.all(tasks);\n\n //\n yield* Scope.close(scope, Exit.void);\n }),\n );\n\n this.update.emit();\n }\n\n private _createServiceLayer(): Layer.Layer<Exclude<ComputeRequirements, Scope.Scope>> {\n const services = { ...DEFAULT_SERVICES, ...this._services };\n const logLayer = Layer.succeed(EventLogger, this._createLogger());\n const gptLayer = Layer.succeed(GptService, services.gpt!);\n const queueLayer =\n services.edgeHttpClient != null ? QueueService.fromClient(services.edgeHttpClient) : QueueService.notAvailable;\n\n const spaceLayer =\n services.spaceService != null ? Layer.succeed(SpaceService, services.spaceService) : SpaceService.empty;\n\n return Layer.mergeAll(logLayer, gptLayer, queueLayer, spaceLayer);\n }\n\n private _createLogger(): Context.Tag.Service<EventLogger> {\n return {\n log: (event) => {\n this._handleEvent(event);\n },\n nodeId: undefined, // Not in a context of a specific node.\n };\n }\n\n private _handleEvent(event: ComputeEvent) {\n log('handleEvent', { event });\n switch (event.type) {\n case 'compute-input': {\n this._onInputComputed(event.nodeId, event.property, { type: 'executed', value: event.value });\n break;\n }\n\n case 'compute-output': {\n this._onOutputComputed(event.nodeId, event.property, { type: 'executed', value: event.value });\n break;\n }\n }\n this.events.emit(event);\n }\n\n private _onInputComputed(nodeId: string, property: string, value: RuntimeValue) {\n this._runtimeStateInputs[nodeId] ??= {};\n this._runtimeStateInputs[nodeId][property] = value;\n }\n\n private _onOutputComputed(nodeId: string, property: string, value: RuntimeValue) {\n this._runtimeStateOutputs[nodeId] ??= {};\n this._runtimeStateOutputs[nodeId][property] = value;\n\n // TODO(burdon): Only fire if changed?\n this.output.emit({ nodeId, property, value });\n }\n}\n\nconst DEFAULT_SERVICES: Services = {\n gpt: new MockGpt(),\n};\n\n/**\n * Waits for all effects in the bag to complete and returns the `RuntimeValue` for each property.\n */\nconst computeValueBag = (bag: ValueBag<any>): Effect.Effect<Record<string, RuntimeValue>, never, never> => {\n return Effect.all(\n Object.entries(bag.values).map(([key, eff]) =>\n Effect.either(eff).pipe(\n Effect.map((value) => {\n if (Either.isLeft(value)) {\n if (isNotExecuted(value.left)) {\n return [key, { type: 'not-executed' }] as const;\n } else {\n return [key, { type: 'error', error: value.left }] as const;\n }\n } else {\n return [key, { type: 'executed', value: value.right }] as const;\n }\n }),\n ),\n ),\n ).pipe(Effect.map((entries) => Object.fromEntries(entries) as Record<string, RuntimeValue>));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n NODE_INPUT,\n NODE_OUTPUT,\n type ComputeNode,\n type Executable,\n type NodeType,\n registry,\n getTemplateInputSchema,\n} from '@dxos/conductor';\nimport { raise } from '@dxos/debug';\nimport { ObjectId, toJsonSchema } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\n\nimport { type ComputeShape, type ConstantShape, type TemplateShape } from '../shapes';\n\nexport const resolveComputeNode = async (node: ComputeNode): Promise<Executable> => {\n const impl = registry[node.type as NodeType];\n invariant(impl, `Unknown node type: ${node.type}`);\n return impl;\n};\n\nexport const isValidComputeNode = (type: string): boolean => {\n return nodeFactory[type as NodeType] !== undefined;\n};\n\nexport const createComputeNode = (shape: ComputeShape): ComputeNode => {\n const type = shape.type ?? raise(new Error('Type not specified'));\n const factory = nodeFactory[type as NodeType] ?? raise(new Error(`Unknown shape type: ${type}`));\n return factory(shape);\n};\n\nconst nodeFactory: Record<NodeType | 'trigger', (shape: ComputeShape) => ComputeNode> = {\n // System.\n [NODE_INPUT]: () => createNode(NODE_INPUT),\n [NODE_OUTPUT]: () => createNode(NODE_OUTPUT),\n\n // Extensions.\n ['text-to-image' as const]: () => createNode('text-to-image'), // TODO(burdon): Rename ai-impage-tool\n ['and' as const]: () => createNode('and'),\n ['append' as const]: () => createNode('append'),\n ['audio' as const]: () => createNode('audio'),\n ['beacon' as const]: () => createNode('beacon'),\n ['chat' as const]: () => createNode('chat'),\n ['constant' as const]: (shape) =>\n createNode('constant', {\n value: (shape as ConstantShape).value,\n }),\n ['database' as const]: () => createNode('database'),\n ['gpt' as const]: () => createNode('gpt'),\n ['gpt-realtime' as const]: () => createNode('gpt-realtime'),\n ['if' as const]: () => createNode('if'),\n ['if-else' as const]: () => createNode('if-else'),\n ['function' as const]: () => createNode('function'),\n ['json' as const]: () => createNode('json'),\n ['json-transform' as const]: () => createNode('json-transform'),\n ['not' as const]: () => createNode('not'),\n ['or' as const]: () => createNode('or'),\n ['queue' as const]: () => createNode('queue'),\n ['rng' as const]: () => createNode('rng'),\n ['reducer' as const]: () => createNode('reducer'),\n ['scope' as const]: () => createNode('scope'),\n ['surface' as const]: () => createNode('surface'),\n ['switch' as const]: () => createNode('switch'),\n ['template' as const]: (shape) => {\n const node = createNode('template', { valueType: (shape as TemplateShape).valueType, value: shape.text });\n node.inputSchema = toJsonSchema(getTemplateInputSchema(node));\n return node;\n },\n ['text' as const]: () => createNode('text'),\n ['thread' as const]: () => createNode('thread'),\n ['trigger' as const]: () => createNode(NODE_INPUT),\n};\n\nconst createNode = (type: string, props?: Partial<ComputeNode>): ComputeNode => ({\n id: ObjectId.random(),\n type,\n ...props,\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport type { ComputeGraphController } from '../graph';\n\nexport type ComputeContextType = {\n controller: ComputeGraphController;\n};\n\nexport const ComputeContext = createContext<ComputeContextType | null>(null);\n\nexport const useComputeContext = () => {\n return useContext(ComputeContext) ?? raise(new Error('Missing ComputeContext'));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport type { ComputeNode, ComputeMeta, ComputeEvent } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\n\nimport { useComputeContext } from './compute-context';\nimport { type RuntimeValue } from '../graph';\nimport { type ComputeShape } from '../shapes';\n\nexport type ComputeNodeState = {\n node: ComputeNode;\n meta: ComputeMeta;\n runtime: {\n inputs: Record<string, RuntimeValue>;\n outputs: Record<string, RuntimeValue>;\n setOutput: (property: string, value: any) => void;\n evalNode: () => void;\n subscribeToEventLog: (cb: (event: ComputeEvent) => void) => void;\n };\n};\n\n/**\n * Runtime state of a compute node.\n */\nexport const useComputeNodeState = (shape: ComputeShape): ComputeNodeState => {\n const { controller } = useComputeContext();\n invariant(controller);\n\n const [meta, setMeta] = useState<ComputeMeta>();\n useEffect(() => {\n let disposed = false;\n queueMicrotask(async () => {\n invariant(shape.node, 'Node not specified');\n const node = controller.getComputeNode(shape.node);\n const meta = await controller.getMeta(node);\n if (disposed) {\n return;\n }\n setMeta(meta);\n });\n\n return () => {\n disposed = true;\n };\n }, [shape.node]);\n\n const evalNode = useCallback(() => {\n return controller.evalNode(shape.node!);\n }, [shape.node]);\n\n const subscribeToEventLog = useCallback(\n (cb: (event: ComputeEvent) => void) => {\n return controller.events.on((ev) => {\n if (ev.nodeId === shape.node) {\n cb(ev);\n }\n });\n },\n [shape.node],\n );\n\n return {\n node: controller.getComputeNode(shape.node!),\n meta: meta ?? {\n input: S.Struct({}),\n output: S.Struct({}),\n },\n runtime: {\n inputs: controller.getInputs(shape.node!),\n outputs: controller.getOutputs(shape.node!),\n setOutput: (property: string, value: any) => {\n controller.setOutput(shape.node!, property, value);\n },\n evalNode,\n subscribeToEventLog,\n },\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type ComputeEdge, ComputeGraphModel, type ComputeNode, DEFAULT_INPUT, DEFAULT_OUTPUT } from '@dxos/conductor';\nimport { ObjectId } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { type GraphMonitor, type CanvasGraphModel, type Connection } from '@dxos/react-ui-canvas-editor';\nimport { nonNullable } from '@dxos/util';\n\nimport { createComputeNode, isValidComputeNode } from '../graph';\nimport { type ComputeShape, type TriggerShape } from '../shapes';\n\n/**\n * Map canvas edge to compute edge.\n */\nexport const mapEdge = (\n graph: CanvasGraphModel,\n { source, target, output = DEFAULT_OUTPUT, input = DEFAULT_INPUT }: Connection,\n): ComputeEdge => {\n const sourceNode = graph.findNode(source) as ComputeShape;\n const targetNode = graph.findNode(target) as ComputeShape;\n invariant(sourceNode?.node);\n invariant(targetNode?.node);\n\n return {\n id: ObjectId.random(),\n source: sourceNode.node,\n target: targetNode.node,\n output,\n input,\n };\n};\n\n/**\n * Listens for changes to the graph and updates the compute graph.\n * @param model Compute graph to update on change.\n */\n// TODO(burdon): Generalize into sync function.\nexport const useGraphMonitor = (model?: ComputeGraphModel): GraphMonitor<ComputeShape> => {\n return useMemo<GraphMonitor<ComputeShape>>(() => {\n return {\n onCreate: ({ node }) => {\n if (!model) {\n return;\n }\n\n // Ignore shapes that don't have a corresponding node factory.\n invariant(node.type);\n if (!isValidComputeNode(node.type)) {\n return;\n }\n\n const computeNode = createComputeNode(node);\n if (node.type === 'trigger') {\n linkTriggerToCompute(model, computeNode, node as TriggerShape);\n }\n model.addNode(computeNode);\n node.node = computeNode.id;\n },\n\n onLink: ({ graph, edge }) => {\n if (model) {\n model.addEdge(mapEdge(graph, edge));\n }\n },\n\n onDelete: ({ subgraph }) => {\n if (model) {\n const nodeIds = subgraph.nodes.map((shape) => (shape as ComputeShape).node) as string[];\n\n // NOTE(ZaymonFC): Based on the information we have, this is O(edges to remove * compute edges).\n const edgeIds = subgraph.edges\n .map(({ source, target, output = DEFAULT_OUTPUT, input = DEFAULT_INPUT }) => {\n return model.edges.find((computeEdge) => computeEdge.input === input && computeEdge.output === output)\n ?.id;\n })\n .filter(nonNullable);\n\n model.removeNodes(nodeIds);\n model.removeEdges(edgeIds);\n\n deleteTriggerObjects(model, subgraph);\n }\n },\n };\n }, [model]);\n};\n\nexport const createComputeGraph = (graph?: CanvasGraphModel<ComputeShape>) => {\n const computeGraph = ComputeGraphModel.create();\n\n if (graph) {\n for (const shape of graph.nodes) {\n if (isValidComputeNode(shape.type)) {\n const node = createComputeNode(shape);\n computeGraph.addNode(node);\n shape.node = node.id;\n }\n }\n\n for (const edge of graph.edges) {\n computeGraph.addEdge(mapEdge(graph, edge));\n }\n }\n\n return computeGraph;\n};\n\nconst linkTriggerToCompute = (graph: ComputeGraphModel, computeNode: ComputeNode, triggerData: TriggerShape) => {\n const functionTrigger = triggerData.functionTrigger?.target;\n invariant(functionTrigger);\n functionTrigger.function = DXN.fromLocalObjectId(graph.root.id).toString();\n functionTrigger.meta ??= {};\n functionTrigger.meta.computeNodeId = computeNode.id;\n};\n\nconst deleteTriggerObjects = (computeGraph: ComputeGraphModel, deleted: CanvasGraphModel) => {\n const space = getSpace(computeGraph.root);\n if (!space) {\n return;\n }\n for (const node of deleted.nodes) {\n if (node.type === 'trigger') {\n const trigger = node as TriggerShape;\n space.db.remove(trigger.functionTrigger!.target!);\n }\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type { ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { noteShape } from '@dxos/react-ui-canvas-editor';\n\nimport {\n andShape,\n appendShape,\n audioShape,\n beaconShape,\n chatShape,\n constantShape,\n databaseShape,\n functionShape,\n gptRealtimeShape,\n gptShape,\n ifElseShape,\n ifShape,\n jsonShape,\n jsonTransformShape,\n notShape,\n orShape,\n queueShape,\n randomShape,\n reducerShape,\n scopeShape,\n surfaceShape,\n switchShape,\n templateShape,\n threadShape,\n textToImageShape,\n triggerShape,\n textShape,\n} from './shapes';\n\n/**\n * Order used by toolbar.\n */\nexport const computeShapes: { title: string; shapes: ShapeDef[] }[] = [\n {\n title: 'Inputs',\n shapes: [\n //\n constantShape,\n templateShape,\n chatShape,\n switchShape,\n audioShape,\n triggerShape,\n randomShape,\n ],\n },\n {\n title: 'Transform',\n shapes: [\n //\n gptShape,\n gptRealtimeShape,\n functionShape,\n databaseShape,\n textToImageShape,\n appendShape,\n ],\n },\n {\n title: 'Operations',\n shapes: [\n //\n ifShape,\n ifElseShape,\n andShape,\n orShape,\n notShape,\n reducerShape,\n jsonTransformShape,\n ],\n },\n {\n title: 'Outputs',\n shapes: [\n //\n jsonShape,\n queueShape,\n threadShape,\n textShape,\n surfaceShape,\n beaconShape,\n scopeShape,\n ],\n },\n {\n title: 'Misc',\n shapes: [\n //\n noteShape,\n ],\n },\n];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { forwardRef, type PropsWithChildren, type ReactNode } from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { Icon, IconButton, type ThemedClassName } from '@dxos/react-ui';\nimport { useEditorContext, useShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { type Shape } from '@dxos/react-ui-canvas-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nexport const headerHeight = 32;\nexport const footerHeight = 32;\n\nexport type BoxActionHandler = (action: 'run' | 'open' | 'close') => void;\n\nexport type BoxProps = PropsWithChildren<\n ThemedClassName<{\n shape: Shape;\n title?: string;\n status?: string | ReactNode;\n open?: boolean;\n onAction?: BoxActionHandler;\n }>\n>;\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n ({ children, classNames, shape, title, status, open, onAction }, forwardedRef) => {\n invariant(shape.type);\n const { icon, name, openable } = useShapeDef(shape.type) ?? { icon: 'ph--placeholder--regular' };\n const { debug } = useEditorContext();\n\n return (\n <div ref={forwardedRef} className='flex flex-col h-full w-full justify-between'>\n <div className='flex shrink-0 w-full justify-between items-center h-[32px] bg-hoverSurface'>\n <Icon icon={icon} classNames='mx-2' />\n <div className='grow text-sm truncate'>{debug ? shape.type : name ?? shape.text ?? title}</div>\n <IconButton\n classNames='p-1 text-green-500'\n variant='ghost'\n icon='ph--play--regular'\n size={4}\n label='run'\n iconOnly\n onDoubleClick={(ev) => ev.stopPropagation()}\n onClick={(ev) => {\n ev.stopPropagation();\n onAction?.('run');\n }}\n />\n </div>\n <div className={mx('flex flex-col h-full grow overflow-hidden', classNames)}>{children}</div>\n <div className='flex shrink-0 w-full justify-between items-center h-[32px] bg-hoverSurface'>\n <div className='grow px-2 text-sm truncate'>{debug ? shape.id : status}</div>\n {openable && (\n <IconButton\n classNames='p-1'\n variant='ghost'\n icon={open ? 'ph--caret-up--regular' : 'ph--caret-down--regular'}\n size={4}\n label={open ? 'close' : 'open'}\n iconOnly\n onClick={(ev) => {\n ev.stopPropagation();\n onAction?.(open ? 'close' : 'open');\n }}\n />\n )}\n </div>\n </div>\n );\n },\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type JSX, useRef, useState } from 'react';\n\nimport { VoidInput, VoidOutput } from '@dxos/conductor';\nimport { AST, type S } from '@dxos/echo-schema';\nimport { useCanvasContext } from '@dxos/react-ui-canvas';\nimport { type Polygon, type Shape } from '@dxos/react-ui-canvas-editor';\nimport { getParentShapeElement, createAnchors, rowHeight } from '@dxos/react-ui-canvas-editor';\n\nimport { Box, type BoxProps, footerHeight, headerHeight } from '../common';\nimport { createAnchorId, getProperties } from '../defs';\n\nconst bodyPadding = 8;\nconst expandedHeight = 200;\n\nexport type FunctionBodyProps = {\n shape: Shape;\n name?: string;\n content?: JSX.Element;\n inputSchema?: S.Schema.Any;\n outputSchema?: S.Schema.Any;\n} & Pick<BoxProps, 'status'>;\n\nexport const FunctionBody = ({\n shape,\n name,\n content,\n inputSchema = VoidInput,\n outputSchema = VoidOutput,\n ...props\n}: FunctionBodyProps) => {\n const { scale } = useCanvasContext();\n const rootRef = useRef<HTMLDivElement>(null);\n const [open, setOpen] = useState(false);\n\n const handleAction: BoxProps['onAction'] = (action) => {\n if (!rootRef.current) {\n return;\n }\n\n switch (action) {\n case 'open': {\n const el = getParentShapeElement(rootRef.current, shape.id)!;\n const { height } = el.getBoundingClientRect();\n el.style.height = `${height / scale + expandedHeight}px`;\n setOpen(true);\n break;\n }\n case 'close': {\n const el = getParentShapeElement(rootRef.current, shape.id)!;\n el.style.height = '';\n setOpen(false);\n break;\n }\n }\n };\n\n // TODO(burdon): Move labels to anchor?\n const inputs = getProperties(inputSchema.ast);\n const outputs = getProperties(outputSchema.ast);\n const columnCount = inputs.length && outputs.length ? 2 : 1;\n\n return (\n <Box\n ref={rootRef}\n shape={shape}\n title={name}\n classNames='divide-y divide-separator'\n open={open}\n onAction={handleAction}\n {...props}\n >\n <div\n className={`grid grid-cols-${columnCount} items-center`}\n style={{ paddingTop: bodyPadding, paddingBottom: bodyPadding }}\n >\n {(inputs?.length ?? 0) > 0 && (\n <div className='flex flex-col'>\n {inputs?.map(({ name }) => (\n <div key={name} className='px-2 truncate text-sm font-mono items-center' style={{ height: rowHeight }}>\n {name}\n </div>\n ))}\n </div>\n )}\n {(outputs?.length ?? 0) > 0 && (\n <div className='flex flex-col'>\n {outputs?.map(({ name }) => (\n <div\n key={name}\n className='px-2 truncate text-sm font-mono items-center text-right'\n style={{ height: rowHeight }}\n >\n {name}\n </div>\n ))}\n </div>\n )}\n </div>\n {open && <div className='flex flex-col grow overflow-hidden'>{content}</div>}\n </Box>\n );\n};\n\nexport const getHeight = (input: S.Schema<any>) => {\n const properties = AST.getPropertySignatures(input.ast);\n return headerHeight + footerHeight + bodyPadding * 2 + properties.length * rowHeight + 2; // Incl. borders.\n};\n\nexport const createFunctionAnchors = (\n shape: Polygon,\n input: S.Schema<any> = VoidInput,\n output: S.Schema<any> = VoidOutput,\n) => {\n // TODO(burdon): Set type.\n const inputs = AST.getPropertySignatures(input.ast).map(({ name }) => createAnchorId('input', name.toString()));\n const outputs = AST.getPropertySignatures(output.ast).map(({ name }) => createAnchorId('output', name.toString()));\n return createAnchors({ shape, inputs, outputs, center: { x: 0, y: (headerHeight - footerHeight) / 2 + 1 } });\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { AST } from '@effect/schema';\n\nimport { DEFAULT_INPUT, DEFAULT_OUTPUT } from '@dxos/conductor';\nimport { ObjectId, S } from '@dxos/echo-schema';\nimport { Polygon } from '@dxos/react-ui-canvas-editor';\nimport { type MakeOptional } from '@dxos/util';\n\n//\n// Properties\n//\n\nexport type PropertyKind = 'input' | 'output';\n\nexport const getProperties = (ast: AST.AST) =>\n AST.getPropertySignatures(ast).map(({ name }) => ({ name: name.toString() }));\n\nexport const createAnchorId = (kind: PropertyKind, property = kind === 'input' ? DEFAULT_INPUT : DEFAULT_OUTPUT) =>\n [kind, property].join('.');\n\nexport const parseAnchorId = (id: string): [PropertyKind | undefined, string] => {\n const parts = id.match(/(input|output)\\.(.+)/);\n return parts ? (parts.slice(1) as any) : [undefined, id];\n};\n\n//\n// Shapes\n//\n\nexport type CreateShapeProps<S extends Polygon> = Omit<MakeOptional<S, 'id' | 'size'>, 'type' | 'node'>;\n\nexport const ComputeShape = S.extend(\n Polygon,\n S.Struct({\n // TODO(burdon): Rename computeNode?\n node: S.optional(ObjectId.annotations({ [AST.DescriptionAnnotationId]: 'Compute node id' })),\n }).pipe(S.mutable),\n);\n\nexport type ComputeShape = S.Schema.Type<typeof ComputeShape>;\n\nexport const createShape = <S extends ComputeShape>({ id, ...rest }: CreateShapeProps<S> & { type: string }): S => {\n return {\n id: id ?? ObjectId.random(),\n ...rest,\n } as S;\n};\n", "import React from 'react';\n\nimport { Select, type SelectRootProps } from '@dxos/react-ui';\nimport { ComputeValueType } from '@dxos/conductor';\n\n// TODO(burdon): Factor out.\nexport const TypeSelect = ({ value, onValueChange }: Pick<SelectRootProps, 'value' | 'onValueChange'>) => {\n return (\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton variant='ghost' classNames='w-full !px-0' />\n <Select.Portal>\n <Select.Content>\n <Select.ScrollUpButton />\n <Select.Viewport>\n {ComputeValueType.literals.map((type) => (\n <Select.Option key={type} value={type}>\n {type}\n </Select.Option>\n ))}\n </Select.Viewport>\n <Select.ScrollDownButton />\n <Select.Arrow />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { ReducerInput, ReducerOutput } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors, FunctionBody, getHeight } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\n//\n// Data\n//\n\nexport const ReducerShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('reducer'),\n }),\n);\n\nexport type ReducerShape = S.Schema.Type<typeof ReducerShape>;\n\n//\n// Components\n//\n\nexport type ReducerComponentProps = ShapeComponentProps<ReducerShape>;\n\nexport const ReducerComponent = ({ shape }: ReducerComponentProps) => {\n return <FunctionBody shape={shape} inputSchema={ReducerInput} outputSchema={ReducerOutput} />;\n};\n\n//\n// Defs\n//\n\nexport type CreateReduceProps = CreateShapeProps<ReducerShape> & { reduce?: string };\n\nexport const createReducer = ({\n id,\n size = { width: 192, height: getHeight(ReducerInput) },\n ...rest\n}: CreateReduceProps): ReducerShape =>\n createShape<ReducerShape>({\n type: 'reducer',\n size,\n ...rest,\n });\n\nexport const reducerShape: ShapeDef<ReducerShape> = {\n type: 'reducer',\n name: 'Reducer',\n icon: 'ph--repeat--regular',\n component: (props) => <ReducerComponent {...props} />,\n createShape: createReducer,\n getAnchors: (shape) => createFunctionAnchors(shape, ReducerInput, ReducerOutput),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { AppendInput } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors, FunctionBody, getHeight } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\nexport const AppendShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('append'),\n }),\n);\n\nexport type AppendShape = S.Schema.Type<typeof AppendShape>;\n\nexport type CreateAppendProps = CreateShapeProps<AppendShape>;\n\nexport const createAppend = (props: CreateAppendProps) =>\n createShape<AppendShape>({\n type: 'append',\n size: { width: 128, height: getHeight(AppendInput) },\n ...props,\n });\n\nexport const AppendComponent = ({ shape }: ShapeComponentProps<AppendShape>) => {\n return <FunctionBody shape={shape} inputSchema={AppendInput} />;\n};\n\nexport const appendShape: ShapeDef<AppendShape> = {\n type: 'append',\n name: 'Append',\n icon: 'ph--list-plus--regular',\n component: AppendComponent,\n createShape: createAppend,\n getAnchors: (shape) => createFunctionAnchors(shape, AppendInput),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport { Icon } from '@dxos/react-ui';\nimport { createAnchorMap, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const AudioShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('audio'),\n }),\n);\n\nexport type AudioShape = S.Schema.Type<typeof AudioShape>;\n\nexport type CreateAudioProps = CreateShapeProps<AudioShape>;\n\nexport const createAudio = (props: CreateAudioProps) =>\n createShape<AudioShape>({ type: 'audio', size: { width: 64, height: 64 }, ...props });\n\nexport const AudioComponent = ({ shape }: ShapeComponentProps<AudioShape>) => {\n const { node } = useComputeNodeState(shape);\n const [active, setActive] = useState(false);\n useEffect(() => {\n node.value = active;\n }, [active]);\n\n // https://docs.pmnd.rs/react-three-fiber/api/canvas#render-props\n return (\n <div className='flex w-full justify-center items-center'>\n <Icon\n icon={active ? 'ph--microphone--regular' : 'ph--microphone-slash--regular'}\n classNames={['transition opacity-20 duration-1000', active && 'opacity-100 text-red-500']}\n size={8}\n onClick={() => setActive(!active)}\n />\n </div>\n );\n};\n\nexport const audioShape: ShapeDef<AudioShape> = {\n type: 'audio',\n name: 'Audio',\n icon: 'ph--microphone--regular',\n component: AudioComponent,\n createShape: createAudio,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('output')]: { x: 1, y: 0 } }),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DEFAULT_INPUT, isTruthy } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { Icon } from '@dxos/react-ui';\nimport { createAnchorMap, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const BeaconShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('beacon'),\n }),\n);\n\nexport type BeaconShape = S.Schema.Type<typeof BeaconShape>;\n\nexport type CreateBeaconProps = CreateShapeProps<BeaconShape>;\n\nexport const createBeacon = (props: CreateBeaconProps) =>\n createShape<BeaconShape>({ type: 'beacon', size: { width: 64, height: 64 }, ...props });\n\nexport const BeaconComponent = ({ shape }: ShapeComponentProps<BeaconShape>) => {\n const { runtime } = useComputeNodeState(shape);\n const input = runtime.inputs[DEFAULT_INPUT];\n const value = input?.type === 'executed' ? input.value : false;\n\n return (\n <div className='flex w-full justify-center items-center'>\n <Icon\n icon='ph--sun--regular'\n classNames={mx('transition opacity-20 duration-1000', isTruthy(value) && 'opacity-100 text-yellow-500')}\n size={8}\n />\n </div>\n );\n};\n\nexport const beaconShape: ShapeDef<BeaconShape> = {\n type: 'beacon',\n name: 'Beacon',\n icon: 'ph--sun--regular',\n component: BeaconComponent,\n createShape: createBeacon,\n getAnchors: (shape) =>\n createAnchorMap(shape, {\n [createAnchorId('input')]: { x: -1, y: 0 },\n }),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { createAnchors, getAnchorPoints } from '@dxos/react-ui-canvas-editor';\n\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\n\n//\n// Gate utils.\n// https://en.wikipedia.org/wiki/Logic_gate\n//\n\ntype GateType = 'and' | 'or' | 'not';\n\nconst GateShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.String,\n }),\n);\n\ntype GateShape = S.Schema.Type<typeof GateShape>;\n\ntype CreateGateProps = CreateShapeProps<GateShape> & { type: GateType };\n\nconst createGate = (props: CreateGateProps): GateShape =>\n createShape<GateShape>({\n size: { width: 64, height: 64 },\n ...props,\n });\n\nconst GateComponent = (Symbol: FC<GateSymbolProps>) => () => {\n return (\n <div className='flex w-full justify-center items-center'>\n <Symbol />\n </div>\n );\n};\n\n// TODO(burdon): Create custom icons.\nconst defineShape = <S extends GateShape>({\n type,\n name,\n icon,\n Symbol,\n createShape,\n inputs,\n outputs = [createAnchorId('output')],\n}: {\n type: GateType;\n Symbol: FC<GateSymbolProps>;\n createShape: ShapeDef<S>['createShape'];\n inputs: string[];\n outputs?: string[];\n} & Pick<ShapeDef<GateShape>, 'name' | 'icon'>): ShapeDef<GateShape> => ({\n type,\n name,\n icon,\n component: GateComponent(Symbol),\n createShape,\n getAnchors: (shape) => createAnchors({ shape, inputs, outputs }),\n});\n\n//\n// Symbols\n//\n\ntype PathConstructor = (props: { startX: number; endX: number; height: number }) => string[];\n\ntype GateSymbolProps = {\n width?: number;\n height?: number;\n className?: string;\n strokeWidth?: number;\n};\n\n// TODO(burdon): Note inputs should line up with anchors.\nconst Symbol =\n (pathConstructor: PathConstructor, inputs: number): FC<GateSymbolProps> =>\n ({\n width = 64,\n height = 32,\n // TODO(burdon): Same as line color.\n className = 'fill-neutral-200 dark:fill-neutral-800 stroke-neutral-500',\n strokeWidth = 1,\n }) => {\n const startX = width * 0.25;\n const endX = width * 0.75;\n const centerY = height / 2;\n const paths = pathConstructor({ startX, endX, height });\n\n return (\n <svg viewBox={`0 0 ${width} ${height}`} className='w-full h-full'>\n {/* Input line. */}\n {getAnchorPoints({ x: 0, y: centerY }, inputs).map(({ x, y }, i) => (\n <line key={i} x1={x} y1={y} x2={startX * 1.3} y2={y} strokeWidth={strokeWidth} className={className} />\n ))}\n\n {/* Output line. */}\n <line x1={endX} y1={centerY} x2={width} y2={centerY} strokeWidth={strokeWidth} className={className} />\n\n {/* And body. */}\n {paths.map((path, i) => (\n <path key={i} d={path} strokeWidth={strokeWidth} className={className} />\n ))}\n </svg>\n );\n };\n\n//\n// AND\n//\n\nconst AndSymbol = Symbol(({ startX, endX, height }) => {\n const arcRadius = (endX - startX) / 2;\n return [\n `\n M ${startX},${height * 0.1}\n L ${endX - arcRadius},${height * 0.1}\n A ${arcRadius},${height * 0.4} 0 0 1 ${endX - arcRadius},${height * 0.9}\n L ${startX},${height * 0.9}\n Z\n `,\n ];\n}, 2);\n\nexport const AndShape = GateShape;\nexport type AndShape = GateShape;\n\nexport const createAnd = (props: Omit<CreateGateProps, 'type' | 'node'>) => {\n return createGate({ ...props, type: 'and' });\n};\nexport const andShape = defineShape({\n type: 'and',\n name: 'AND',\n icon: 'ph--intersection--regular',\n Symbol: AndSymbol,\n createShape: createAnd,\n inputs: ['input.a', 'input.b'],\n});\n\n//\n// OR\n//\n\n// TODO(burdon): Should have sharper point.\nconst OrSymbol = Symbol(({ startX, endX, height }) => {\n const arcRadius = (endX - startX) / 2;\n return [\n `\n M ${startX},${height * 0.1}\n L ${endX - arcRadius},${height * 0.1}\n A ${arcRadius},${height * 0.4} 0 0 1 ${endX - arcRadius},${height * 0.9}\n L ${startX},${height * 0.9}\n C ${startX * 1.4},${height * 0.5} ${startX * 1.4},${height * 0.5} ${startX},${height * 0.1}\n Z\n `,\n ];\n}, 2);\n\nexport const OrShape = GateShape;\nexport type OrShape = GateShape;\n\nexport const createOr = (props: Omit<CreateGateProps, 'type' | 'node'>) => {\n return createGate({ ...props, type: 'or' });\n};\nexport const orShape = defineShape({\n type: 'or',\n name: 'OR',\n icon: 'ph--union--regular',\n Symbol: OrSymbol,\n createShape: createOr,\n inputs: ['input.a', 'input.b'],\n});\n\n//\n// NOT\n//\n\nconst NotSymbol = Symbol(({ startX, endX, height }) => {\n return [\n `\n M ${startX},${height * 0.1}\n L ${endX * 0.9},${height * 0.5}\n L ${startX},${height * 0.9}\n Z\n `,\n `\n M ${endX - height * 0.2},${height * 0.5}\n A ${height * 0.1} ${height * 0.1} 0 0 1 ${endX},${height * 0.5}\n A ${height * 0.1} ${height * 0.1} 0 0 1 ${endX - height * 0.2},${height * 0.5}\n Z\n `,\n ];\n}, 1);\n\nexport const NotShape = GateShape;\nexport type NotShape = GateShape;\n\nexport const createNot = (props: Omit<CreateGateProps, 'type' | 'node'>) => {\n return createGate({ ...props, type: 'not' });\n};\nexport const notShape = defineShape({\n type: 'not',\n name: 'NOT',\n icon: 'ph--x--regular',\n Symbol: NotSymbol,\n createShape: createNot,\n inputs: [createAnchorId('input')],\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useRef } from 'react';\n\nimport { DEFAULT_OUTPUT } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport {\n type ShapeComponentProps,\n type ShapeDef,\n TextBox,\n type TextBoxControl,\n type TextBoxProps,\n} from '@dxos/react-ui-canvas-editor';\nimport { createAnchorMap } from '@dxos/react-ui-canvas-editor';\n\nimport { Box } from './common';\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\n//\n// Data\n//\n\nexport const ChatShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('chat'),\n }),\n);\n\nexport type ChatShape = S.Schema.Type<typeof ChatShape>;\n\n//\n// Component\n//\n\nexport type TextInputComponentProps = ShapeComponentProps<ChatShape> & TextBoxProps & { title?: string };\n\nexport const TextInputComponent = ({ shape, title, ...props }: TextInputComponentProps) => {\n const { runtime } = useComputeNodeState(shape);\n const inputRef = useRef<TextBoxControl>(null);\n\n const handleEnter: TextBoxProps['onEnter'] = (text) => {\n const value = text.trim();\n if (value.length) {\n runtime.setOutput(DEFAULT_OUTPUT, value);\n inputRef.current?.setText('');\n }\n };\n\n return (\n <Box shape={shape} title={title}>\n <TextBox ref={inputRef} onEnter={handleEnter} {...props} />\n </Box>\n );\n};\n\n//\n// Defs\n//\n\nexport type CreateChatProps = CreateShapeProps<ChatShape>;\n\nexport const createChat = (props: CreateChatProps) =>\n createShape<ChatShape>({ type: 'chat', size: { width: 256, height: 128 }, ...props });\n\nexport const chatShape: ShapeDef<ChatShape> = {\n type: 'chat',\n name: 'Chat',\n icon: 'ph--textbox--regular',\n component: (props) => <TextInputComponent {...props} title={'Prompt'} placeholder={'Message'} />,\n createShape: createChat,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('output')]: { x: 1, y: 0 } }),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { ComputeValueType } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { Input } from '@dxos/react-ui';\nimport {\n type ShapeComponentProps,\n type ShapeDef,\n TextBox,\n type TextBoxControl,\n type TextBoxProps,\n} from '@dxos/react-ui-canvas-editor';\nimport { createAnchorMap } from '@dxos/react-ui-canvas-editor';\nimport { safeParseJson } from '@dxos/util';\n\nimport { Box, TypeSelect } from './common';\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\n//\n// Data\n//\n\nexport const ConstantShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('constant'),\n value: S.optional(S.Any),\n }),\n);\n\nexport type ConstantShape = S.Schema.Type<typeof ConstantShape>;\n\n//\n// Component\n//\n\nexport type ConstantComponentProps = ShapeComponentProps<ConstantShape> &\n TextBoxProps & { title?: string; chat?: boolean };\n\nconst inferType = (value: any): string | undefined => {\n if (typeof value === 'string') {\n return 'string';\n } else if (typeof value === 'number') {\n return 'number';\n } else if (typeof value === 'boolean') {\n return 'boolean';\n } else if (typeof value === 'object') {\n return 'object';\n }\n};\n\nexport const ConstantComponent = ({ shape, title, chat, ...props }: ConstantComponentProps) => {\n const { node } = useComputeNodeState(shape);\n const [type, setType] = useState(inferType(node.value) ?? ComputeValueType.literals[0]);\n const inputRef = useRef<TextBoxControl>(null);\n\n const handleEnter = useCallback<NonNullable<TextBoxProps['onEnter']>>(\n (text) => {\n const value = text.trim();\n if (value.length) {\n // TODO(burdon): Set text filter.\n if (type === 'number') {\n const floatValue = parseFloat(value);\n if (!isNaN(floatValue)) {\n node.value = floatValue;\n }\n } else if (type === 'object') {\n node.value = safeParseJson(value, {});\n } else {\n node.value = value;\n }\n\n inputRef.current?.focus();\n }\n },\n [type],\n );\n\n return (\n <Box shape={shape} title={title} status={<TypeSelect value={type} onValueChange={setType} />}>\n {(type === 'string' || type === 'number') && (\n <TextBox {...props} ref={inputRef} value={node.value} onEnter={handleEnter} />\n )}\n {type === 'object' && (\n <TextBox {...props} ref={inputRef} value={JSON.stringify(node.value, null, 2)} language={'json'} />\n )}\n {type === 'boolean' && (\n <div className='flex grow justify-center items-center'>\n <Input.Root>\n <Input.Switch\n checked={node.value}\n onCheckedChange={(value) => {\n node.value = value;\n }}\n />\n </Input.Root>\n </div>\n )}\n </Box>\n );\n};\n\n//\n// Defs\n//\n\nexport type CreateConstantProps = CreateShapeProps<ConstantShape>;\n\nexport const createConstant = (props: CreateConstantProps) =>\n createShape<ConstantShape>({ type: 'constant', size: { width: 192, height: 128 }, ...props });\n\nexport const constantShape: ShapeDef<ConstantShape> = {\n type: 'constant',\n name: 'Value',\n icon: 'ph--dots-three-circle--regular',\n component: (props) => <ConstantComponent {...props} placeholder={'Constant'} />,\n createShape: createConstant,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('output')]: { x: 1, y: 0 } }),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { createAnchorMap } from '@dxos/react-ui-canvas-editor';\n\nimport { Box } from './common';\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\n\nexport const DatabaseShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('database'),\n }),\n);\n\nexport type DatabaseShape = S.Schema.Type<typeof DatabaseShape>;\n\nexport type CreateDatabaseProps = CreateShapeProps<DatabaseShape>;\n\nexport const createDatabase = (props: CreateDatabaseProps) =>\n createShape<DatabaseShape>({ type: 'database', size: { width: 128, height: 64 }, ...props });\n\nexport const DatabaseComponent = ({ shape }: ShapeComponentProps<DatabaseShape>) => {\n return <Box shape={shape} />;\n};\n\nexport const databaseShape: ShapeDef<DatabaseShape> = {\n type: 'database',\n name: 'ECHO',\n icon: 'ph--database--regular',\n component: DatabaseComponent,\n createShape: createDatabase,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('output')]: { x: 1, y: 0 } }),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { AnyOutput, FunctionInput } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors, FunctionBody, getHeight } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\nexport const FunctionShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('function'),\n }),\n);\n\nexport type FunctionShape = S.Schema.Type<typeof FunctionShape>;\n\nexport type CreateFunctionProps = CreateShapeProps<FunctionShape>;\n\nexport const createFunction = (props: CreateFunctionProps) =>\n createShape<FunctionShape>({ type: 'function', size: { width: 192, height: getHeight(FunctionInput) }, ...props });\n\nexport const FunctionComponent = ({ shape }: ShapeComponentProps<FunctionShape>) => {\n return <FunctionBody shape={shape} inputSchema={FunctionInput} outputSchema={AnyOutput} />;\n};\n\nexport const functionShape: ShapeDef<FunctionShape> = {\n type: 'function',\n name: 'Function',\n icon: 'ph--function--regular',\n component: FunctionComponent,\n createShape: createFunction,\n // TODO(burdon): Get dynamic schema.\n getAnchors: (shape) => createFunctionAnchors(shape, FunctionInput, AnyOutput),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport type { ResultStreamEvent } from '@dxos/assistant';\nimport { GptInput, GptOutput } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors, FunctionBody, getHeight } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const GptShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('gpt'),\n }),\n);\n\nexport type GptShape = S.Schema.Type<typeof GptShape>;\n\nexport type CreateGptProps = CreateShapeProps<GptShape>;\n\nexport const createGpt = (props: CreateGptProps) =>\n createShape<GptShape>({\n type: 'gpt',\n size: { width: 256, height: Math.max(getHeight(GptInput), getHeight(GptOutput)) },\n ...props,\n });\n\nexport const GptComponent = ({ shape }: ShapeComponentProps<GptShape>) => {\n const { meta, runtime } = useComputeNodeState(shape);\n const [text, setText] = useState('');\n const [tokens, setTokens] = useState(0);\n\n useEffect(() => {\n return runtime.subscribeToEventLog((ev) => {\n switch (ev.type) {\n case 'begin-compute': {\n setText('');\n break;\n }\n case 'custom': {\n const token: ResultStreamEvent = ev.event;\n switch (token.type) {\n case 'content_block_delta':\n switch (token.delta.type) {\n case 'text_delta': {\n const delta = token.delta.text;\n setText((prev) => {\n const text = prev + delta;\n // TODO(burdon): Get token count.\n setTokens(text.split(' ').length);\n return text;\n });\n break;\n }\n }\n break;\n\n // TODO(dmaretskyi): Handle other types of events.\n }\n break;\n }\n }\n });\n }, [runtime?.subscribeToEventLog]);\n\n return (\n <FunctionBody\n shape={shape}\n content={<div className='px-2 py-1 overflow-y-scroll'>{text}</div>}\n status={`${tokens} tokens`}\n inputSchema={meta.input}\n outputSchema={meta.output}\n />\n );\n};\n\nexport const gptShape: ShapeDef<GptShape> = {\n type: 'gpt',\n name: 'GPT',\n icon: 'ph--brain--regular',\n component: GptComponent,\n createShape: createGpt,\n getAnchors: (shape) => createFunctionAnchors(shape, GptInput, GptOutput),\n openable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DEFAULT_INPUT, DefaultOutput, JsonTransformInput } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { createAnchorMap } from '@dxos/react-ui-canvas-editor';\nimport { JsonFilter } from '@dxos/react-ui-syntax-highlighter';\n\nimport { createFunctionAnchors, getHeight, Box } from './common';\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\n//\n// Data\n//\n\nexport const JsonShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('json'),\n }),\n);\n\nexport type JsonShape = S.Schema.Type<typeof JsonShape>;\n\nexport const JsonTransformShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('json-transform'),\n }),\n);\n\nexport type JsonTransformShape = S.Schema.Type<typeof JsonTransformShape>;\n\n//\n// Component\n//\n\nexport type JsonComponentProps = ShapeComponentProps<JsonShape>;\n\nexport const JsonComponent = ({ shape, ...props }: JsonComponentProps) => {\n const { runtime } = useComputeNodeState(shape);\n const input = runtime.inputs[DEFAULT_INPUT];\n const value = input?.type === 'executed' ? input.value : undefined;\n\n return (\n <Box shape={shape}>\n <JsonFilter data={value} classNames='text-xs' />\n </Box>\n );\n};\n\nexport type JsonTransformComponentProps = ShapeComponentProps<JsonTransformShape>;\n\nexport const JsonTransformComponent = ({ shape, ...props }: JsonTransformComponentProps) => {\n return <Box shape={shape} />;\n};\n\n//\n// Defs\n//\n\nexport type CreateJsonProps = CreateShapeProps<JsonShape>;\n\nexport const createJson = (props: CreateJsonProps) =>\n createShape<JsonShape>({ type: 'json', size: { width: 256, height: 256 }, ...props });\n\nexport const jsonShape: ShapeDef<JsonShape> = {\n type: 'json',\n name: 'JSON',\n icon: 'ph--code--regular',\n component: (props) => <JsonComponent {...props} />,\n createShape: createJson,\n getAnchors: (shape) =>\n createAnchorMap(shape, {\n [createAnchorId('input')]: { x: -1, y: 0 },\n [createAnchorId('output')]: { x: 1, y: 0 },\n }),\n resizable: true,\n};\n\nexport type CreateJsonTransformProps = CreateShapeProps<JsonTransformShape> & { expression?: string };\n\nexport const createJsonTransform = (props: CreateJsonTransformProps) =>\n createShape<JsonTransformShape>({\n type: 'json-transform',\n size: { width: 128, height: getHeight(JsonTransformInput) },\n ...props,\n });\n\nexport const jsonTransformShape: ShapeDef<JsonTransformShape> = {\n type: 'json-transform',\n name: 'Transform',\n icon: 'ph--shuffle-simple--regular',\n component: (props) => <JsonTransformComponent {...props} />,\n createShape: createJsonTransform,\n getAnchors: (shape) => createFunctionAnchors(shape, JsonTransformInput, DefaultOutput),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { IfElseInput, IfElseOutput, IfInput, IfOutput } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors, FunctionBody, getHeight } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\n//\n// Data\n//\n\nexport const IfShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('if'),\n }),\n);\n\nexport type IfShape = S.Schema.Type<typeof IfShape>;\n\nexport const IfElseShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('if-else'),\n }),\n);\n\nexport type IfElseShape = S.Schema.Type<typeof IfElseShape>;\n\n//\n// Components\n//\n\nexport type IfComponentProps = ShapeComponentProps<IfShape>;\n\nexport const IfComponent = ({ shape, ...props }: IfComponentProps) => {\n return <FunctionBody shape={shape} inputSchema={IfInput} outputSchema={IfOutput} />;\n};\n\nexport type IfElseComponentProps = ShapeComponentProps<IfElseShape>;\n\nexport const IfElseComponent = ({ shape, ...props }: IfElseComponentProps) => {\n return <FunctionBody shape={shape} inputSchema={IfElseInput} outputSchema={IfElseOutput} />;\n};\n\n//\n// Defs\n//\n\nexport type CreateIfProps = CreateShapeProps<IfShape> & { if?: string };\n\nexport const createIf = (props: CreateIfProps) =>\n createShape<IfShape>({ type: 'if', size: { width: 192, height: getHeight(IfInput) }, ...props });\n\nexport const ifShape: ShapeDef<IfShape> = {\n type: 'if',\n name: 'IF',\n icon: 'ph--arrows-split--regular',\n component: (props) => <IfComponent {...props} />,\n createShape: createIf,\n getAnchors: (shape) => createFunctionAnchors(shape, IfInput, IfOutput),\n};\n\nexport type CreateIfElseProps = CreateShapeProps<IfShape> & { if?: string };\n\nexport const createIfElse = (props: CreateIfElseProps) =>\n createShape<IfElseShape>({ type: 'if-else', size: { width: 192, height: getHeight(IfElseInput) }, ...props });\n\nexport const ifElseShape: ShapeDef<IfElseShape> = {\n type: 'if-else',\n name: 'IF/ELSE',\n icon: 'ph--arrows-merge--regular',\n component: (props) => <IfElseComponent {...props} />,\n createShape: createIfElse,\n getAnchors: (shape) => createFunctionAnchors(shape, IfElseInput, IfElseOutput),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { Fragment } from 'react';\n\nimport { DEFAULT_OUTPUT, QueueInput, QueueOutput } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createFunctionAnchors } from './common';\nimport { Box, type BoxActionHandler } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const QueueShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('queue'),\n }),\n);\n\nexport type QueueShape = S.Schema.Type<typeof QueueShape>;\n\nexport type CreateQueueProps = CreateShapeProps<QueueShape>;\n\nexport const createQueue = (props: CreateQueueProps) =>\n createShape<QueueShape>({ type: 'queue', size: { width: 256, height: 512 }, ...props });\n\nexport const QueueComponent = ({ shape }: ShapeComponentProps<QueueShape>) => {\n const { runtime } = useComputeNodeState(shape);\n const items = runtime.outputs[DEFAULT_OUTPUT]?.type === 'executed' ? runtime.outputs[DEFAULT_OUTPUT].value : [];\n\n const handleAction: BoxActionHandler = (action) => {\n if (action === 'run') {\n runtime.evalNode();\n }\n };\n\n return (\n <Box shape={shape} status={`${items.length} items`} onAction={handleAction}>\n <div className='flex flex-col w-full overflow-y-scroll divide-y divide-separator'>\n {[...items].map((item, i) => (\n <QueueItem key={i} classNames='p-1 px-2' item={item} />\n ))}\n </div>\n </Box>\n );\n};\n\nexport const QueueItem = ({ classNames, item }: ThemedClassName<{ item: any }>) => {\n if (typeof item !== 'object') {\n return <div className={mx(classNames, 'whitespace-pre-wrap')}>{item}</div>;\n }\n\n return (\n <div className={mx('grid grid-cols-[80px,1fr]', classNames)}>\n {Object.entries(item).map(([key, value]) => (\n <Fragment key={key}>\n <div className='p-1 text-xs text-subdued'>{key}</div>\n <div>{typeof value === 'string' ? value : JSON.stringify(value)}</div>\n </Fragment>\n ))}\n </div>\n );\n};\n\nexport const queueShape: ShapeDef<QueueShape> = {\n type: 'queue',\n name: 'Queue',\n icon: 'ph--queue--regular',\n component: QueueComponent,\n createShape: createQueue,\n getAnchors: (shape) => createFunctionAnchors(shape, QueueInput, QueueOutput),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport { DEFAULT_OUTPUT } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { Icon, type IconProps } from '@dxos/react-ui';\nimport { createAnchorMap, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const RandomShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('rng'),\n min: S.optional(S.Number),\n max: S.optional(S.Number),\n }),\n);\n\nexport type RandomShape = S.Schema.Type<typeof RandomShape>;\n\nexport type CreateRandomProps = CreateShapeProps<RandomShape>;\n\nexport const createRandom = (props: CreateRandomProps) =>\n createShape<RandomShape>({ type: 'rng', size: { width: 64, height: 64 }, ...props });\n\nconst icons = [\n 'ph--dice-one--regular',\n 'ph--dice-two--regular',\n 'ph--dice-three--regular',\n 'ph--dice-four--regular',\n 'ph--dice-five--regular',\n 'ph--dice-six--regular',\n];\n\nconst pickIcon = () => icons[Math.floor(Math.random() * icons.length)];\n\n// TODO(burdon): Optional range.\nexport const RandomComponent = ({ shape }: ShapeComponentProps<RandomShape>) => {\n const { runtime } = useComputeNodeState(shape);\n\n const [spin, setSpin] = useState(false);\n const [icon, setIcon] = useState(pickIcon());\n useEffect(() => {\n if (!spin) {\n return;\n }\n\n const i = setInterval(() => setIcon(pickIcon()), 250);\n const t1 = setTimeout(() => clearInterval(i), 900);\n const t2 = setTimeout(() => setSpin(false), 1_100);\n return () => {\n clearInterval(i);\n clearTimeout(t1);\n clearTimeout(t2);\n };\n }, [spin]);\n\n const handleClick: IconProps['onClick'] = (ev) => {\n ev.stopPropagation();\n runtime.setOutput(DEFAULT_OUTPUT, Math.random());\n setSpin(true);\n };\n\n return (\n <div className='flex grow items-center justify-center'>\n <Icon icon={icon} classNames={mx(spin && 'animate-[spin_1s]')} size={10} onClick={handleClick} />\n </div>\n );\n};\n\nexport const randomShape: ShapeDef<RandomShape> = {\n type: 'rng',\n name: 'Random',\n icon: 'ph--dice-six--regular',\n component: RandomComponent,\n createShape: createRandom,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('output')]: { x: 1, y: 0 } }),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DEFAULT_INPUT } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { createAnchorMap, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { useAudioStream, Chaos, shaderPresets } from '@dxos/react-ui-sfx';\n\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const ScopeShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('scope'),\n }),\n);\n\nexport type ScopeShape = S.Schema.Type<typeof ScopeShape>;\n\nexport type CreateScopeProps = CreateShapeProps<ScopeShape>;\n\nexport const createScope = (props: CreateScopeProps) =>\n createShape<ScopeShape>({\n type: 'scope',\n size: { width: 128, height: 128 },\n classNames: 'rounded-full border-primary-800',\n ...props,\n });\n\nexport const ScopeComponent = ({ shape }: ShapeComponentProps<ScopeShape>) => {\n const { runtime } = useComputeNodeState(shape);\n const input = runtime.inputs[DEFAULT_INPUT];\n const active = input?.type === 'executed' ? input.value : false;\n const { getAverage } = useAudioStream(active);\n\n return (\n <div className='flex w-full justify-center items-center bg-black'>\n <Chaos active={active} getValue={getAverage} options={{ ...shaderPresets.heptapod, zoom: 1.2 }} />\n </div>\n );\n};\n\nexport const scopeShape: ShapeDef<ScopeShape> = {\n type: 'scope',\n name: 'Scope',\n icon: 'ph--waveform--regular',\n component: ScopeComponent,\n createShape: createScope,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('input')]: { x: -1, y: 0 } }),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { DEFAULT_INPUT } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { createAnchorMap } from '@dxos/react-ui-canvas-editor';\n\nimport { Box, type BoxActionHandler } from './common';\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const SurfaceShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('surface'),\n }),\n);\n\nexport type SurfaceShape = S.Schema.Type<typeof SurfaceShape>;\n\nexport type CreateSurfaceProps = CreateShapeProps<SurfaceShape>;\n\nexport const createSurface = (props: CreateSurfaceProps) =>\n createShape<SurfaceShape>({ type: 'surface', size: { width: 384, height: 384 }, ...props });\n\nexport const SurfaceComponent = ({ shape }: ShapeComponentProps<SurfaceShape>) => {\n const { runtime } = useComputeNodeState(shape);\n const input = runtime.inputs[DEFAULT_INPUT];\n const value = input?.type === 'executed' ? input.value : null;\n\n const handleAction: BoxActionHandler = (action) => {\n if (action === 'run') {\n runtime.evalNode();\n }\n };\n\n return (\n <Box shape={shape} onAction={handleAction}>\n {value !== null && <Surface role='canvas-node' data={{ value }} limit={1} />}\n </Box>\n );\n};\n\nexport const surfaceShape: ShapeDef<SurfaceShape> = {\n type: 'surface',\n name: 'Surface',\n icon: 'ph--frame-corners--regular',\n component: SurfaceComponent,\n createShape: createSurface,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('input')]: { x: -1, y: 0 } }),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport { DEFAULT_OUTPUT } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { Input } from '@dxos/react-ui';\nimport { createAnchorMap, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const SwitchShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('switch'),\n }),\n);\n\nexport type SwitchShape = S.Schema.Type<typeof SwitchShape>;\n\nexport type CreateSwitchProps = CreateShapeProps<SwitchShape>;\n\nexport const createSwitch = (props: CreateSwitchProps) =>\n createShape<SwitchShape>({ type: 'switch', size: { width: 64, height: 64 }, ...props });\n\n// TODO(burdon): Should model as a constant.\nexport const SwitchComponent = ({ shape }: ShapeComponentProps<SwitchShape>) => {\n const { runtime } = useComputeNodeState(shape);\n const [value, setValue] = useState(false);\n useEffect(() => {\n runtime.setOutput(DEFAULT_OUTPUT, value);\n }, [value]);\n\n return (\n <div className='flex w-full justify-center items-center' onClick={(ev) => ev.stopPropagation()}>\n <Input.Root>\n <Input.Switch checked={value} onCheckedChange={(value) => setValue(value)} />\n </Input.Root>\n </div>\n );\n};\n\nexport const switchShape: ShapeDef<SwitchShape> = {\n type: 'switch',\n name: 'Switch',\n icon: 'ph--toggle-left--regular',\n component: SwitchComponent,\n createShape: createSwitch,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('output')]: { x: 1, y: 0 } }),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createInputSchema, createOutputSchema, GptMessage } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors, Box } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\nconst InputSchema = createInputSchema(GptMessage);\nconst OutputSchema = createOutputSchema(S.mutable(S.Array(GptMessage)));\n\nexport const TableShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('table'),\n }),\n);\n\nexport type TableShape = S.Schema.Type<typeof TableShape>;\n\nexport type CreateTableProps = CreateShapeProps<TableShape>;\n\nexport const createTable = (props: CreateTableProps) =>\n createShape<TableShape>({ type: 'table', size: { width: 320, height: 512 }, ...props });\n\nexport const TableComponent = ({ shape }: ShapeComponentProps<TableShape>) => {\n // const items = shape.node.items.value;\n\n return <Box shape={shape}></Box>;\n};\n\nexport const tableShape: ShapeDef<TableShape> = {\n type: 'table',\n name: 'Table',\n icon: 'ph--table--regular',\n component: TableComponent,\n createShape: createTable,\n getAnchors: (shape) => createFunctionAnchors(shape, InputSchema, OutputSchema),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useRef } from 'react';\n\nimport { ComputeValueType, getTemplateInputSchema, TemplateOutput, VoidInput } from '@dxos/conductor';\nimport { S, toJsonSchema } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport {\n type ShapeComponentProps,\n type ShapeDef,\n TextBox,\n type TextBoxControl,\n type TextBoxProps,\n} from '@dxos/react-ui-canvas-editor';\n\nimport { Box, createFunctionAnchors, TypeSelect } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\n//\n// Data\n//\n\nexport const TemplateShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('template'),\n valueType: S.optional(ComputeValueType),\n }),\n);\n\nexport type TemplateShape = S.Schema.Type<typeof TemplateShape>;\n\n//\n// Component\n//\n\ntype TextInputComponentProps = ShapeComponentProps<TemplateShape> & TextBoxProps & { title?: string };\n\nconst TextInputComponent = ({ shape, title, ...props }: TextInputComponentProps) => {\n const { node } = useComputeNodeState(shape);\n const inputRef = useRef<TextBoxControl>(null);\n\n const handleEnter: TextBoxProps['onEnter'] = (text) => {\n const value = text.trim();\n if (value.length) {\n const schema = getTemplateInputSchema(node);\n\n node.value = value;\n node.inputSchema = toJsonSchema(schema);\n }\n };\n\n const handleTypeChange = (newType: string) => {\n invariant(S.is(ComputeValueType)(newType), 'Invalid type');\n\n node.valueType = newType;\n node.inputSchema = toJsonSchema(getTemplateInputSchema(node));\n };\n\n return (\n <Box\n shape={shape}\n title={'Template'}\n status={<TypeSelect value={node.valueType ?? 'string'} onValueChange={handleTypeChange} />}\n >\n <TextBox\n {...props}\n ref={inputRef}\n value={node.value}\n language={node.valueType === 'object' ? 'json' : undefined}\n onBlur={handleEnter}\n onEnter={handleEnter}\n />\n </Box>\n );\n};\n\n//\n// Defs\n//\n\nexport type CreateTemplateProps = CreateShapeProps<TemplateShape> & { text?: string };\n\nexport const createTemplate = (props: CreateTemplateProps) =>\n createShape<TemplateShape>({ type: 'template', size: { width: 256, height: 384 }, ...props });\n\nexport const templateShape: ShapeDef<TemplateShape> = {\n type: 'template',\n name: 'Template',\n icon: 'ph--article--regular',\n component: (props) => <TextInputComponent {...props} placeholder={'Prompt'} />,\n createShape: createTemplate,\n getAnchors: (shape) => createFunctionAnchors(shape, VoidInput, TemplateOutput),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DEFAULT_INPUT } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { TextBox, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { createAnchorMap } from '@dxos/react-ui-canvas-editor';\n\nimport { Box, type BoxActionHandler } from './common';\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\nimport { useComputeNodeState } from '../hooks';\n\nexport const TextShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('text'),\n }),\n);\n\nexport type TextShape = S.Schema.Type<typeof TextShape>;\n\nexport type CreateTextProps = CreateShapeProps<TextShape>;\n\nexport const createText = (props: CreateTextProps) =>\n createShape<TextShape>({ type: 'text', size: { width: 384, height: 384 }, ...props });\n\nexport const TextComponent = ({ shape }: ShapeComponentProps<TextShape>) => {\n const { runtime } = useComputeNodeState(shape);\n const input = runtime.inputs[DEFAULT_INPUT];\n const value = input?.type === 'executed' ? input.value : 0;\n\n const handleAction: BoxActionHandler = (action) => {\n if (action === 'run') {\n runtime.evalNode();\n }\n };\n\n return (\n <Box shape={shape} onAction={handleAction}>\n <TextBox value={value} />\n </Box>\n );\n};\n\nexport const textShape: ShapeDef<TextShape> = {\n type: 'text',\n name: 'Text',\n icon: 'ph--article--regular',\n component: TextComponent,\n createShape: createText,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('input')]: { x: -1, y: 0 } }),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useRef } from 'react';\n\nimport { createInputSchema, createOutputSchema, GptMessage } from '@dxos/conductor';\nimport { S } from '@dxos/echo-schema';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createFunctionAnchors, Box } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\nconst InputSchema = createInputSchema(GptMessage);\nconst OutputSchema = createOutputSchema(S.mutable(S.Array(GptMessage)));\n\nexport const ThreadShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('thread'),\n }),\n);\n\nexport type ThreadShape = S.Schema.Type<typeof ThreadShape>;\n\nexport type CreateThreadProps = CreateShapeProps<ThreadShape>;\n\nexport const createThread = (props: CreateThreadProps) =>\n createShape<ThreadShape>({ type: 'thread', size: { width: 384, height: 384 }, ...props });\n\nexport const ThreadComponent = ({ shape }: ShapeComponentProps<ThreadShape>) => {\n const items: any[] = [];\n const scrollRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollTop = scrollRef.current.scrollHeight;\n }\n }, [items]);\n\n return (\n <Box shape={shape}>\n <div ref={scrollRef} className='flex flex-col w-full overflow-y-scroll gap-2 p-2'>\n {[...items].map((item, i) => (\n <ThreadItem key={i} item={item} />\n ))}\n </div>\n </Box>\n );\n};\n\nexport const ThreadItem = ({ classNames, item }: ThemedClassName<{ item: any }>) => {\n if (typeof item !== 'object') {\n return <div className={mx(classNames)}>{item}</div>;\n }\n\n // TODO(burdon): Hack; introspect type.\n // TODO(burdon): Markdown parser.\n const { role, message } = item;\n return (\n <div className={mx('flex', classNames, role === 'user' && 'justify-end')}>\n <div\n className={mx(\n 'block rounded-md p-1 px-2 text-sm',\n role === 'user'\n ? 'bg-blue-100 dark:bg-blue-800'\n : role === 'system'\n ? 'bg-red-100, dark:bg-red-800'\n : 'whitespace-pre-wrap bg-neutral-50 dark:bg-neutral-800',\n )}\n >\n {message}\n </div>\n </div>\n );\n};\n\nexport const threadShape: ShapeDef<ThreadShape> = {\n type: 'thread',\n name: 'Thread',\n icon: 'ph--chats-circle--regular',\n component: ThreadComponent,\n createShape: createThread,\n getAnchors: (shape) => createFunctionAnchors(shape, InputSchema, OutputSchema),\n resizable: true,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\nimport { createAnchorMap } from '@dxos/react-ui-canvas-editor';\n\nimport { Box } from './common';\nimport { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';\n\nexport const TextToImageShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('text-to-image'),\n }),\n);\n\nexport type TextToImageShape = S.Schema.Type<typeof TextToImageShape>;\n\nexport type CreateTextToImageProps = CreateShapeProps<TextToImageShape>;\n\nexport const createTextToImage = (props: CreateTextToImageProps) =>\n createShape<TextToImageShape>({ type: 'text-to-image', size: { width: 128, height: 64 }, ...props });\n\nexport const TextToImageComponent = ({ shape }: ShapeComponentProps<TextToImageShape>) => {\n return <Box shape={shape} />;\n};\n\nexport const textToImageShape: ShapeDef<TextToImageShape> = {\n type: 'text-to-image',\n name: 'Image',\n icon: 'ph--image--regular',\n component: TextToImageComponent,\n createShape: createTextToImage,\n getAnchors: (shape) => createAnchorMap(shape, { [createAnchorId('output')]: { x: 1, y: 0 } }),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect } from 'react';\n\nimport {\n EmailTriggerOutput,\n SubscriptionTriggerOutput,\n TimerTriggerOutput,\n VoidInput,\n WebhookTriggerOutput,\n} from '@dxos/conductor';\nimport { Ref, S } from '@dxos/echo-schema';\nimport {\n type EmailTrigger,\n FunctionTrigger,\n type SubscriptionTrigger,\n type TimerTrigger,\n TriggerKind,\n type TriggerType,\n type WebhookTrigger,\n} from '@dxos/functions';\nimport { create, makeRef } from '@dxos/react-client/echo';\nimport { Select, type SelectRootProps } from '@dxos/react-ui';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors, FunctionBody, getHeight } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\nexport const TriggerShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('trigger'),\n functionTrigger: S.optional(Ref(FunctionTrigger)),\n }),\n);\nexport type TriggerShape = S.Schema.Type<typeof TriggerShape>;\n\nexport type CreateTriggerProps = CreateShapeProps<Omit<TriggerShape, 'functionTrigger'>> & {\n triggerKind?: TriggerKind;\n};\n\nexport const createTrigger = (props: CreateTriggerProps): TriggerShape => {\n const functionTrigger = create(FunctionTrigger, {\n enabled: true,\n spec: createTriggerSpec(props.triggerKind ?? TriggerKind.Email),\n });\n return createShape<TriggerShape>({\n type: 'trigger',\n functionTrigger: makeRef(functionTrigger),\n size: { width: 192, height: getHeight(EmailTriggerOutput) },\n ...props,\n });\n};\n\nexport type TriggerComponentProps = ShapeComponentProps<TriggerShape>;\n\nexport const TriggerComponent = ({ shape }: TriggerComponentProps) => {\n const functionTrigger = shape.functionTrigger?.target;\n\n useEffect(() => {\n if (functionTrigger && !functionTrigger.spec) {\n functionTrigger.spec = createTriggerSpec(TriggerKind.Email);\n }\n }, [functionTrigger, functionTrigger?.spec]);\n\n useEffect(() => {\n shape.size.height = getHeight(getOutputSchema(functionTrigger?.spec?.type ?? TriggerKind.Email));\n }, [functionTrigger?.spec?.type]);\n\n const setKind = (kind: TriggerKind) => {\n if (functionTrigger?.spec?.type !== kind) {\n functionTrigger!.spec = createTriggerSpec(kind);\n }\n };\n\n if (!functionTrigger?.spec) {\n return;\n }\n\n return (\n <FunctionBody\n shape={shape}\n status={\n <TriggerKindSelect value={functionTrigger.spec?.type} onValueChange={(kind) => setKind(kind as TriggerKind)} />\n }\n inputSchema={VoidInput}\n outputSchema={getOutputSchema(functionTrigger.spec!.type!)}\n />\n );\n};\n\n// TODO(burdon): Factor out.\nconst TriggerKindSelect = ({ value, onValueChange }: Pick<SelectRootProps, 'value' | 'onValueChange'>) => {\n return (\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton variant='ghost' classNames='w-full !px-0' />\n <Select.Portal>\n <Select.Content>\n <Select.ScrollUpButton />\n <Select.Viewport>\n {Object.values(TriggerKind).map((type) => (\n <Select.Option key={type} value={type}>\n {type}\n </Select.Option>\n ))}\n </Select.Viewport>\n <Select.ScrollDownButton />\n <Select.Arrow />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n\nconst createTriggerSpec = (kind: TriggerKind): TriggerType => {\n switch (kind) {\n case TriggerKind.Timer:\n return { type: TriggerKind.Timer, cron: '0 0 * * *' } satisfies TimerTrigger;\n case TriggerKind.Webhook:\n return { type: TriggerKind.Webhook, method: 'POST' } satisfies WebhookTrigger;\n case TriggerKind.Subscription:\n return { type: TriggerKind.Subscription, filter: {} } satisfies SubscriptionTrigger;\n case TriggerKind.Email:\n return { type: TriggerKind.Email } satisfies EmailTrigger;\n }\n};\n\nconst getOutputSchema = (kind: TriggerKind) => {\n const kindToSchema: Record<TriggerKind, S.Schema<any>> = {\n [TriggerKind.Email]: EmailTriggerOutput,\n [TriggerKind.Subscription]: SubscriptionTriggerOutput,\n [TriggerKind.Timer]: TimerTriggerOutput,\n [TriggerKind.Webhook]: WebhookTriggerOutput,\n };\n return kindToSchema[kind];\n};\n\nexport const triggerShape: ShapeDef<TriggerShape> = {\n type: 'trigger',\n name: 'Trigger',\n icon: 'ph--lightning--regular',\n component: TriggerComponent,\n createShape: createTrigger,\n getAnchors: (shape) =>\n createFunctionAnchors(\n shape,\n VoidInput,\n getOutputSchema(shape.functionTrigger?.target?.spec?.type ?? TriggerKind.Email),\n ),\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport { Icon } from '@dxos/react-ui';\nimport { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';\n\nimport { createFunctionAnchors } from './common';\nimport { ComputeShape, createShape, type CreateShapeProps } from './defs';\n\nexport const GptRealtimeShape = S.extend(\n ComputeShape,\n S.Struct({\n type: S.Literal('gpt-realtime'),\n }),\n);\n\nexport type GptRealtimeShape = S.Schema.Type<typeof GptRealtimeShape>;\n\nexport type CreateGptRealtimeProps = CreateShapeProps<GptRealtimeShape>;\n\nexport const createGptRealtime = (props: CreateGptRealtimeProps) =>\n createShape<GptRealtimeShape>({ type: 'gpt-realtime', size: { width: 256, height: 256 }, ...props });\n\nexport const GptRealtimeComponent = ({ shape }: ShapeComponentProps<GptRealtimeShape>) => {\n const [isLive, setIsLive] = useState(false);\n const [isReady, setIsReady] = useState(false);\n\n const start = async () => {\n setIsLive(true);\n\n try {\n // Create WebRTC connection\n const peerConnection = new RTCPeerConnection();\n\n // Handle incoming audio\n peerConnection.ontrack = (event) => {\n const audioElement = document.createElement('audio');\n audioElement.srcObject = event.streams[0];\n audioElement.autoplay = true;\n audioElement.controls = false;\n audioElement.style.display = 'none';\n document.body.appendChild(audioElement);\n setIsReady(true);\n };\n\n // Get microphone stream\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n\n // Add microphone track to connection\n stream.getTracks().forEach((track) => peerConnection.addTransceiver(track, { direction: 'sendrecv' }));\n\n // Create offer\n const offer = await peerConnection.createOffer();\n await peerConnection.setLocalDescription(offer);\n\n // Send offer to backend and get answer\n const response = await fetch(`${AI_SERVICE_URL}/rtc-connect`, {\n method: 'POST',\n body: offer.sdp,\n headers: {\n 'Content-Type': 'application/sdp',\n },\n });\n\n const answer = await response.text();\n\n // Set remote description with answer\n await peerConnection.setRemoteDescription({\n sdp: answer,\n type: 'answer',\n });\n\n const dataChannel = peerConnection.createDataChannel('response');\n\n const configureData = () => {\n console.log('Configuring data channel');\n const event = {\n type: 'session.update',\n session: {\n modalities: ['text', 'audio'],\n // Provide the tools. Note they match the keys in the `fns` object above\n tools: [],\n },\n };\n dataChannel.send(JSON.stringify(event));\n };\n\n dataChannel.addEventListener('open', (ev) => {\n console.log('Opening data channel', ev);\n configureData();\n });\n\n // {\n // \"type\": \"response.function_call_arguments.done\",\n // \"event_id\": \"event_Ad2gt864G595umbCs2aF9\",\n // \"response_id\": \"resp_Ad2griUWUjsyeLyAVtTtt\",\n // \"item_id\": \"item_Ad2gsxA84w9GgEvFwW1Ex\",\n // \"output_index\": 1,\n // \"call_id\": \"call_PG12S5ER7l7HrvZz\",\n // \"name\": \"get_weather\",\n // \"arguments\": \"{\\\"location\\\":\\\"Portland, Oregon\\\"}\"\n // }\n\n dataChannel.addEventListener('message', async (ev) => {\n const msg = JSON.parse(ev.data);\n // console.log('realtime gpt event', msg);\n // Handle function calls\n if (msg.type === 'response.function_call_arguments.done') {\n // const fn = fns[msg.name];\n // if (fn !== undefined) {\n // console.log(`Calling local function ${msg.name} with ${msg.arguments}`);\n // const args = JSON.parse(msg.arguments);\n // const result = await fn(args);\n // console.log('result', result);\n // // Let OpenAI know that the function has been called and share it's output\n // const event = {\n // type: 'conversation.item.create',\n // item: {\n // type: 'function_call_output',\n // call_id: msg.call_id, // call_id from the function_call message\n // output: JSON.stringify(result), // result of the function\n // },\n // };\n // dataChannel.send(JSON.stringify(event));\n // }\n }\n });\n } catch (error) {\n console.error('Error in realtime session:', error);\n throw error;\n }\n };\n\n return (\n <div className='flex w-full justify-center items-center'>\n <Icon\n icon={isReady ? 'ph--waveform--regular' : isLive ? 'ph--pulse--regular' : 'ph--play--regular'}\n size={16}\n classNames={!isLive && 'cursor-pointer'}\n onClick={start}\n />\n </div>\n );\n};\n\nexport const gptRealtimeShape: ShapeDef<GptRealtimeShape> = {\n type: 'gpt-realtime',\n name: 'GPT Realtime',\n icon: 'ph--pulse--regular',\n component: GptRealtimeComponent,\n createShape: createGptRealtime,\n // TODO(dmaretskyi): Can we fetch the schema dynamically?\n getAnchors: (shape) =>\n createFunctionAnchors(\n shape,\n S.Struct({\n audio: S.Any,\n }),\n S.Struct({}),\n ),\n resizable: true,\n};\n\nconst AI_SERVICE_URL = 'http://localhost:8788';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { DefaultInput, DefaultOutput } from '@dxos/conductor';\nimport { toEffectSchema } from '@dxos/echo-schema';\nimport { type Anchor, ShapeLayout, ShapeRegistry } from '@dxos/react-ui-canvas-editor';\n\nimport { type ComputeGraphController } from './graph';\nimport { type ComputeShape, createFunctionAnchors } from './shapes';\n\n// TODO(burdon): Customize layout. Specialize ComputeShapeDef and registry.\nexport class ComputeShapeLayout extends ShapeLayout {\n constructor(\n private _controller: ComputeGraphController,\n registry: ShapeRegistry,\n ) {\n super(registry);\n }\n\n // TODO(burdon): Doesn't update.\n override getAnchors(shape: ComputeShape): Record<string, Anchor> {\n const shapeDef = this._registry.getShapeDef(shape.type);\n let anchors = shapeDef?.getAnchors?.(shape) ?? {};\n if (shape.node) {\n const node = this._controller.graph.getNode(shape.node);\n if (node.inputSchema || node.outputSchema) {\n // TODO(burdon): Requires that component defined input and output types.\n const inputSchema = node.inputSchema ? toEffectSchema(node.inputSchema) : DefaultInput;\n const outputSchema = node.outputSchema ? toEffectSchema(node.outputSchema) : DefaultOutput;\n anchors = createFunctionAnchors(shape, inputSchema, outputSchema);\n }\n }\n\n return anchors;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MACAN;MACAqI;MACAzN;;EAEJ;EACA;IACExG,OAAO;IACPkZ,QAAQ;;MAEN5K;MACAE;MACAxF;MACAI;MACAI;MACAvD;MACA0H;;EAEJ;EACA;IACE3N,OAAO;IACPkZ,QAAQ;;MAEN1L;MACAwB;MACA6E;MACAT;MACA5B;MACApK;MACA6J;;EAEJ;EACA;IACEjR,OAAO;IACPkZ,QAAQ;;MAENC;;EAEJ;;A6BtFK,IAAMC,qBAAN,cAAiCC,4CAAAA;EACtCjgB,YACUkgB,aACRrnB,WACA;AACA,UAAMA,SAAAA;SAHEqnB,cAAAA;EAIV;;EAGSnT,WAAW3T,OAA6C;AAC/D,UAAM+mB,WAAW,KAAKC,UAAUC,YAAYjnB,MAAMN,IAAI;AACtD,QAAIwnB,UAAUH,UAAUpT,aAAa3T,KAAAA,KAAU,CAAC;AAChD,QAAIA,MAAMT,MAAM;AACd,YAAMA,OAAO,KAAKunB,YAAY3jB,MAAMgF,QAAQnI,MAAMT,IAAI;AACtD,UAAIA,KAAKmB,eAAenB,KAAKkR,cAAc;AAEzC,cAAM/P,cAAcnB,KAAKmB,kBAAcymB,qCAAe5nB,KAAKmB,WAAW,IAAI0mB;AAC1E,cAAM3W,eAAelR,KAAKkR,mBAAe0W,qCAAe5nB,KAAKkR,YAAY,IAAI2K,mBAAAA;AAC7E8L,kBAAUnV,sBAAsB/R,OAAOU,aAAa+P,YAAAA;MACtD;IACF;AAEA,WAAOyW;EACT;AACF;",
|
|
6
|
+
"names": ["import_conductor", "import_debug", "import_react", "import_echo_schema", "import_invariant", "import_react_ui_canvas_editor", "import_react_ui", "import_react_ui_theme", "import_util", "import_echo", "resolveComputeNode", "node", "impl", "registry", "type", "invariant", "isValidComputeNode", "nodeFactory", "undefined", "createComputeNode", "shape", "raise", "Error", "factory", "NODE_INPUT", "createNode", "NODE_OUTPUT", "value", "valueType", "text", "inputSchema", "toJsonSchema", "getTemplateInputSchema", "props", "id", "ObjectId", "random", "ComputeContext", "createContext", "useComputeContext", "useContext", "useComputeNodeState", "controller", "meta", "setMeta", "useState", "useEffect", "disposed", "queueMicrotask", "getComputeNode", "getMeta", "evalNode", "useCallback", "subscribeToEventLog", "cb", "events", "on", "ev", "nodeId", "input", "S", "Struct", "output", "runtime", "inputs", "getInputs", "outputs", "getOutputs", "setOutput", "property", "mapEdge", "graph", "source", "target", "DEFAULT_OUTPUT", "DEFAULT_INPUT", "sourceNode", "findNode", "targetNode", "useGraphMonitor", "model", "useMemo", "onCreate", "computeNode", "linkTriggerToCompute", "addNode", "onLink", "edge", "addEdge", "onDelete", "subgraph", "nodeIds", "nodes", "map", "edgeIds", "edges", "find", "computeEdge", "filter", "nonNullable", "removeNodes", "removeEdges", "deleteTriggerObjects", "createComputeGraph", "computeGraph", "ComputeGraphModel", "create", "triggerData", "functionTrigger", "function", "DXN", "fromLocalObjectId", "root", "toString", "computeNodeId", "deleted", "space", "getSpace", "trigger", "db", "remove", "InvalidStateError", "AUTO_TRIGGER_NODES", "createComputeGraphController", "services", "ComputeGraphController", "setServices", "Resource", "constructor", "_graph", "_executor", "GraphExecutor", "computeNodeResolver", "_services", "_forcedOutputs", "_runtimeStateInputs", "_runtimeStateOutputs", "update", "Event", "toJSON", "state", "forcedOutputs", "Object", "assign", "userState", "inputStates", "outputStates", "ids", "Set", "keys", "fromEntries", "getNode", "exec", "err", "log", "catch", "executor", "clone", "load", "entries", "setOutputs", "Effect", "succeed", "makeValueBag", "_createServiceLayer", "runPromise", "gen", "scope", "Scope", "make", "executable", "promise", "computingOutputs", "effect", "computeOutputs", "computeInputs", "pipe", "withSpan", "provide", "extend", "flatMap", "computeValueBag", "tap", "values", "key", "_onOutputComputed", "_onInputComputed", "close", "Exit", "void", "emit", "startFromNode", "triggerNodes", "includes", "allAffectedNodes", "getAllDependantNodes", "tasks", "push", "all", "DEFAULT_SERVICES", "logLayer", "Layer", "EventLogger", "_createLogger", "gptLayer", "GptService", "gpt", "queueLayer", "edgeHttpClient", "QueueService", "fromClient", "notAvailable", "spaceLayer", "spaceService", "SpaceService", "empty", "mergeAll", "event", "_handleEvent", "synchronized", "MockGpt", "bag", "eff", "either", "Either", "isLeft", "isNotExecuted", "left", "error", "right", "headerHeight", "footerHeight", "Box", "forwardRef", "children", "classNames", "title", "status", "open", "onAction", "forwardedRef", "icon", "name", "openable", "useShapeDef", "debug", "useEditorContext", "React", "div", "ref", "className", "Icon", "IconButton", "variant", "size", "label", "iconOnly", "onDoubleClick", "stopPropagation", "onClick", "mx", "getProperties", "ast", "AST", "getPropertySignatures", "createAnchorId", "kind", "join", "parseAnchorId", "parts", "match", "slice", "ComputeShape", "Polygon", "optional", "annotations", "DescriptionAnnotationId", "mutable", "createShape", "rest", "bodyPadding", "expandedHeight", "FunctionBody", "content", "VoidInput", "outputSchema", "VoidOutput", "scale", "useCanvasContext", "rootRef", "useRef", "setOpen", "handleAction", "action", "current", "el", "getParentShapeElement", "height", "getBoundingClientRect", "style", "columnCount", "length", "paddingTop", "paddingBottom", "rowHeight", "getHeight", "properties", "createFunctionAnchors", "createAnchors", "center", "x", "y", "TypeSelect", "onValueChange", "Select", "Root", "TriggerButton", "Portal", "Content", "ScrollUpButton", "Viewport", "ComputeValueType", "literals", "Option", "ScrollDownButton", "Arrow", "ReducerShape", "Literal", "ReducerComponent", "ReducerInput", "ReducerOutput", "createReducer", "width", "reducerShape", "component", "getAnchors", "AppendShape", "createAppend", "AppendInput", "AppendComponent", "appendShape", "AudioShape", "createAudio", "AudioComponent", "active", "setActive", "audioShape", "createAnchorMap", "BeaconShape", "createBeacon", "BeaconComponent", "isTruthy", "beaconShape", "GateShape", "String", "createGate", "GateComponent", "Symbol", "defineShape", "pathConstructor", "strokeWidth", "startX", "endX", "centerY", "paths", "svg", "viewBox", "getAnchorPoints", "i", "line", "x1", "y1", "x2", "y2", "path", "d", "AndSymbol", "arcRadius", "AndShape", "createAnd", "andShape", "OrSymbol", "OrShape", "createOr", "orShape", "NotSymbol", "NotShape", "createNot", "notShape", "ChatShape", "TextInputComponent", "inputRef", "handleEnter", "trim", "setText", "TextBox", "onEnter", "createChat", "chatShape", "placeholder", "resizable", "ConstantShape", "Any", "inferType", "ConstantComponent", "chat", "setType", "floatValue", "parseFloat", "isNaN", "safeParseJson", "focus", "JSON", "stringify", "language", "Input", "Switch", "checked", "onCheckedChange", "createConstant", "constantShape", "DatabaseShape", "createDatabase", "DatabaseComponent", "databaseShape", "FunctionShape", "createFunction", "FunctionInput", "FunctionComponent", "AnyOutput", "functionShape", "GptShape", "createGpt", "Math", "max", "GptInput", "GptOutput", "GptComponent", "tokens", "setTokens", "token", "delta", "prev", "split", "gptShape", "JsonShape", "JsonTransformShape", "JsonComponent", "JsonFilter", "data", "JsonTransformComponent", "createJson", "jsonShape", "createJsonTransform", "JsonTransformInput", "jsonTransformShape", "DefaultOutput", "IfShape", "IfElseShape", "IfComponent", "IfInput", "IfOutput", "IfElseComponent", "IfElseInput", "IfElseOutput", "createIf", "ifShape", "createIfElse", "ifElseShape", "QueueShape", "createQueue", "QueueComponent", "items", "item", "QueueItem", "Fragment", "queueShape", "QueueInput", "QueueOutput", "RandomShape", "min", "Number", "createRandom", "icons", "pickIcon", "floor", "RandomComponent", "spin", "setSpin", "setIcon", "setInterval", "t1", "setTimeout", "clearInterval", "t2", "clearTimeout", "handleClick", "randomShape", "ScopeShape", "createScope", "ScopeComponent", "getAverage", "useAudioStream", "Chaos", "getValue", "options", "shaderPresets", "heptapod", "zoom", "scopeShape", "SurfaceShape", "createSurface", "SurfaceComponent", "Surface", "role", "limit", "surfaceShape", "SwitchShape", "createSwitch", "SwitchComponent", "setValue", "switchShape", "InputSchema", "createInputSchema", "GptMessage", "OutputSchema", "createOutputSchema", "Array", "TableShape", "createTable", "TableComponent", "tableShape", "TemplateShape", "schema", "handleTypeChange", "newType", "is", "onBlur", "createTemplate", "templateShape", "TemplateOutput", "TextShape", "createText", "TextComponent", "textShape", "ThreadShape", "createThread", "ThreadComponent", "scrollRef", "scrollTop", "scrollHeight", "ThreadItem", "message", "threadShape", "TextToImageShape", "createTextToImage", "TextToImageComponent", "textToImageShape", "TriggerShape", "Ref", "FunctionTrigger", "createTrigger", "enabled", "spec", "createTriggerSpec", "triggerKind", "TriggerKind", "Email", "makeRef", "EmailTriggerOutput", "TriggerComponent", "getOutputSchema", "setKind", "TriggerKindSelect", "Timer", "cron", "Webhook", "method", "Subscription", "kindToSchema", "SubscriptionTriggerOutput", "TimerTriggerOutput", "WebhookTriggerOutput", "triggerShape", "GptRealtimeShape", "createGptRealtime", "GptRealtimeComponent", "isLive", "setIsLive", "isReady", "setIsReady", "start", "peerConnection", "RTCPeerConnection", "ontrack", "audioElement", "document", "createElement", "srcObject", "streams", "autoplay", "controls", "display", "body", "appendChild", "stream", "navigator", "mediaDevices", "getUserMedia", "audio", "getTracks", "forEach", "track", "addTransceiver", "direction", "offer", "createOffer", "setLocalDescription", "response", "fetch", "AI_SERVICE_URL", "sdp", "headers", "answer", "setRemoteDescription", "dataChannel", "createDataChannel", "configureData", "console", "session", "modalities", "tools", "send", "addEventListener", "msg", "parse", "gptRealtimeShape", "computeShapes", "shapes", "noteShape", "ComputeShapeLayout", "ShapeLayout", "_controller", "shapeDef", "_registry", "getShapeDef", "anchors", "toEffectSchema", "DefaultInput"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-canvas-compute/src/graph/node-defs.ts":{"bytes":10120,"imports":[{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/hooks/compute-context.ts":{"bytes":1661,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/hooks/useComputeNodeState.ts":{"bytes":7603,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/compute-context.ts","kind":"import-statement","original":"./compute-context"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/hooks/useGraphMonitor.ts":{"bytes":15158,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/graph/index.ts","kind":"import-statement","original":"../graph"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/hooks/index.ts":{"bytes":758,"imports":[{"path":"packages/ui/react-ui-canvas-compute/src/hooks/compute-context.ts","kind":"import-statement","original":"./compute-context"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/useComputeNodeState.ts","kind":"import-statement","original":"./useComputeNodeState"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/useGraphMonitor.ts","kind":"import-statement","original":"./useGraphMonitor"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/graph/controller.ts":{"bytes":41050,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/graph/node-defs.ts","kind":"import-statement","original":"./node-defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/graph/index.ts":{"bytes":608,"imports":[{"path":"packages/ui/react-ui-canvas-compute/src/graph/controller.ts","kind":"import-statement","original":"./controller"},{"path":"packages/ui/react-ui-canvas-compute/src/graph/node-defs.ts","kind":"import-statement","original":"./node-defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/common/Box.tsx":{"bytes":8601,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts":{"bytes":5043,"imports":[{"path":"@effect/schema","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/common/FunctionBody.tsx":{"bytes":13553,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"../common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"../defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/common/TypeSelect.tsx":{"bytes":3519,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts":{"bytes":706,"imports":[{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/Box.tsx","kind":"import-statement","original":"./Box"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/FunctionBody.tsx","kind":"import-statement","original":"./FunctionBody"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/TypeSelect.tsx","kind":"import-statement","original":"./TypeSelect"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Array.tsx":{"bytes":5019,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Append.tsx":{"bytes":4265,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Audio.tsx":{"bytes":6265,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Beacon.tsx":{"bytes":6099,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Boolean.tsx":{"bytes":18365,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Chat.tsx":{"bytes":7116,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Constant.tsx":{"bytes":12847,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Database.tsx":{"bytes":4286,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Function.tsx":{"bytes":4654,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Gpt.tsx":{"bytes":9586,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Json.tsx":{"bytes":9884,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Logic.tsx":{"bytes":7704,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Queue.tsx":{"bytes":9041,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/RNG.tsx":{"bytes":9124,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Scope.tsx":{"bytes":6352,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Surface.tsx":{"bytes":6506,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Switch.tsx":{"bytes":6370,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Table.tsx":{"bytes":4818,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Template.tsx":{"bytes":9569,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Text.tsx":{"bytes":6065,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Thread.tsx":{"bytes":9082,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/TextToImage.tsx":{"bytes":4416,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/Trigger.tsx":{"bytes":15984,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx":{"bytes":18854,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/shapes/index.ts":{"bytes":2635,"imports":[{"path":"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts","kind":"import-statement","original":"./defs"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Array.tsx","kind":"import-statement","original":"./Array"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Append.tsx","kind":"import-statement","original":"./Append"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Audio.tsx","kind":"import-statement","original":"./Audio"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Beacon.tsx","kind":"import-statement","original":"./Beacon"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Boolean.tsx","kind":"import-statement","original":"./Boolean"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Chat.tsx","kind":"import-statement","original":"./Chat"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Constant.tsx","kind":"import-statement","original":"./Constant"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Database.tsx","kind":"import-statement","original":"./Database"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Function.tsx","kind":"import-statement","original":"./Function"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Gpt.tsx","kind":"import-statement","original":"./Gpt"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Json.tsx","kind":"import-statement","original":"./Json"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Logic.tsx","kind":"import-statement","original":"./Logic"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Queue.tsx","kind":"import-statement","original":"./Queue"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/RNG.tsx","kind":"import-statement","original":"./RNG"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Scope.tsx","kind":"import-statement","original":"./Scope"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Surface.tsx","kind":"import-statement","original":"./Surface"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Switch.tsx","kind":"import-statement","original":"./Switch"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Table.tsx","kind":"import-statement","original":"./Table"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Template.tsx","kind":"import-statement","original":"./Template"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Text.tsx","kind":"import-statement","original":"./Text"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Thread.tsx","kind":"import-statement","original":"./Thread"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/TextToImage.tsx","kind":"import-statement","original":"./TextToImage"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/Trigger.tsx","kind":"import-statement","original":"./Trigger"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx","kind":"import-statement","original":"./GptRealtime"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/registry.ts":{"bytes":5905,"imports":[{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/index.ts","kind":"import-statement","original":"./shapes"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/compute-layout.ts":{"bytes":4896,"imports":[{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/index.ts","kind":"import-statement","original":"./shapes"}],"format":"esm"},"packages/ui/react-ui-canvas-compute/src/index.ts":{"bytes":861,"imports":[{"path":"packages/ui/react-ui-canvas-compute/src/graph/index.ts","kind":"import-statement","original":"./graph"},{"path":"packages/ui/react-ui-canvas-compute/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/ui/react-ui-canvas-compute/src/registry.ts","kind":"import-statement","original":"./registry"},{"path":"packages/ui/react-ui-canvas-compute/src/shapes/index.ts","kind":"import-statement","original":"./shapes"},{"path":"packages/ui/react-ui-canvas-compute/src/compute-layout.ts","kind":"import-statement","original":"./compute-layout"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-canvas-compute/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":162507},"packages/ui/react-ui-canvas-compute/dist/lib/node/index.cjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@effect/schema","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-canvas-editor","kind":"import-statement","external":true}],"exports":["AndShape","AppendComponent","AppendShape","AudioComponent","AudioShape","BeaconComponent","BeaconShape","Box","ChatShape","ComputeContext","ComputeGraphController","ComputeShape","ComputeShapeLayout","ConstantComponent","ConstantShape","DatabaseComponent","DatabaseShape","FunctionBody","FunctionComponent","FunctionShape","GptComponent","GptRealtimeComponent","GptRealtimeShape","GptShape","IfComponent","IfElseComponent","IfElseShape","IfShape","InvalidStateError","JsonComponent","JsonShape","JsonTransformComponent","JsonTransformShape","NotShape","OrShape","QueueComponent","QueueItem","QueueShape","RandomComponent","RandomShape","ReducerComponent","ReducerShape","ScopeComponent","ScopeShape","SurfaceComponent","SurfaceShape","SwitchComponent","SwitchShape","TableComponent","TableShape","TemplateShape","TextComponent","TextInputComponent","TextShape","TextToImageComponent","TextToImageShape","ThreadComponent","ThreadItem","ThreadShape","TriggerComponent","TriggerShape","TypeSelect","andShape","appendShape","audioShape","beaconShape","chatShape","computeShapes","constantShape","createAnchorId","createAnd","createAppend","createAudio","createBeacon","createChat","createComputeGraph","createComputeGraphController","createComputeNode","createConstant","createDatabase","createFunction","createFunctionAnchors","createGpt","createGptRealtime","createIf","createIfElse","createJson","createJsonTransform","createNot","createOr","createQueue","createRandom","createReducer","createScope","createShape","createSurface","createSwitch","createTable","createTemplate","createText","createTextToImage","createThread","createTrigger","databaseShape","footerHeight","functionShape","getHeight","getProperties","gptRealtimeShape","gptShape","headerHeight","ifElseShape","ifShape","isValidComputeNode","jsonShape","jsonTransformShape","mapEdge","notShape","orShape","parseAnchorId","queueShape","randomShape","reducerShape","resolveComputeNode","scopeShape","surfaceShape","switchShape","tableShape","templateShape","textShape","textToImageShape","threadShape","triggerShape","useComputeContext","useComputeNodeState","useGraphMonitor"],"entryPoint":"packages/ui/react-ui-canvas-compute/src/index.ts","inputs":{"packages/ui/react-ui-canvas-compute/src/graph/controller.ts":{"bytesInOutput":9121},"packages/ui/react-ui-canvas-compute/src/graph/node-defs.ts":{"bytesInOutput":2510},"packages/ui/react-ui-canvas-compute/src/hooks/compute-context.ts":{"bytesInOutput":259},"packages/ui/react-ui-canvas-compute/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-canvas-compute/src/hooks/useComputeNodeState.ts":{"bytesInOutput":1798},"packages/ui/react-ui-canvas-compute/src/hooks/useGraphMonitor.ts":{"bytesInOutput":3615},"packages/ui/react-ui-canvas-compute/src/graph/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-canvas-compute/src/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-canvas-compute/src/registry.ts":{"bytesInOutput":910},"packages/ui/react-ui-canvas-compute/src/shapes/common/Box.tsx":{"bytesInOutput":2429},"packages/ui/react-ui-canvas-compute/src/shapes/common/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-canvas-compute/src/shapes/common/FunctionBody.tsx":{"bytesInOutput":3142},"packages/ui/react-ui-canvas-compute/src/shapes/defs.ts":{"bytesInOutput":966},"packages/ui/react-ui-canvas-compute/src/shapes/common/TypeSelect.tsx":{"bytesInOutput":901},"packages/ui/react-ui-canvas-compute/src/shapes/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-canvas-compute/src/shapes/Array.tsx":{"bytesInOutput":860},"packages/ui/react-ui-canvas-compute/src/shapes/Append.tsx":{"bytesInOutput":720},"packages/ui/react-ui-canvas-compute/src/shapes/Audio.tsx":{"bytesInOutput":1329},"packages/ui/react-ui-canvas-compute/src/shapes/Beacon.tsx":{"bytesInOutput":1335},"packages/ui/react-ui-canvas-compute/src/shapes/Boolean.tsx":{"bytesInOutput":3936},"packages/ui/react-ui-canvas-compute/src/shapes/Chat.tsx":{"bytesInOutput":1434},"packages/ui/react-ui-canvas-compute/src/shapes/Constant.tsx":{"bytesInOutput":2990},"packages/ui/react-ui-canvas-compute/src/shapes/Database.tsx":{"bytesInOutput":771},"packages/ui/react-ui-canvas-compute/src/shapes/Function.tsx":{"bytesInOutput":843},"packages/ui/react-ui-canvas-compute/src/shapes/Gpt.tsx":{"bytesInOutput":1947},"packages/ui/react-ui-canvas-compute/src/shapes/Json.tsx":{"bytesInOutput":2068},"packages/ui/react-ui-canvas-compute/src/shapes/Logic.tsx":{"bytesInOutput":1539},"packages/ui/react-ui-canvas-compute/src/shapes/Queue.tsx":{"bytesInOutput":2062},"packages/ui/react-ui-canvas-compute/src/shapes/RNG.tsx":{"bytesInOutput":2109},"packages/ui/react-ui-canvas-compute/src/shapes/Scope.tsx":{"bytesInOutput":1370},"packages/ui/react-ui-canvas-compute/src/shapes/Surface.tsx":{"bytesInOutput":1339},"packages/ui/react-ui-canvas-compute/src/shapes/Switch.tsx":{"bytesInOutput":1398},"packages/ui/react-ui-canvas-compute/src/shapes/Table.tsx":{"bytesInOutput":849},"packages/ui/react-ui-canvas-compute/src/shapes/Template.tsx":{"bytesInOutput":2362},"packages/ui/react-ui-canvas-compute/src/shapes/Text.tsx":{"bytesInOutput":1247},"packages/ui/react-ui-canvas-compute/src/shapes/Thread.tsx":{"bytesInOutput":2127},"packages/ui/react-ui-canvas-compute/src/shapes/TextToImage.tsx":{"bytesInOutput":804},"packages/ui/react-ui-canvas-compute/src/shapes/Trigger.tsx":{"bytesInOutput":3841},"packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx":{"bytesInOutput":3394},"packages/ui/react-ui-canvas-compute/src/compute-layout.ts":{"bytesInOutput":970}},"bytes":74030}}}
|