@dxos/plugin-pipeline 0.8.4-main.52d7546f51 → 0.8.4-main.74a063c4e0

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.
Files changed (112) hide show
  1. package/dist/lib/browser/index.mjs +63 -74
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/types/index.mjs +0 -9
  5. package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
  6. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  7. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  8. package/dist/types/src/capabilities/index.d.ts +3 -3
  9. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  10. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  11. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  12. package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts +9 -0
  13. package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts.map +1 -0
  14. package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts +65 -0
  15. package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -0
  16. package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts +43 -0
  17. package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts.map +1 -0
  18. package/dist/types/src/components/PipelineComponent/index.d.ts +3 -0
  19. package/dist/types/src/components/PipelineComponent/index.d.ts.map +1 -0
  20. package/dist/types/src/components/index.d.ts +1 -4
  21. package/dist/types/src/components/index.d.ts.map +1 -1
  22. package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts +6 -0
  23. package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts.map +1 -0
  24. package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts +57 -0
  25. package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +1 -0
  26. package/dist/types/src/containers/PipelineContainer/index.d.ts +2 -0
  27. package/dist/types/src/containers/PipelineContainer/index.d.ts.map +1 -0
  28. package/dist/types/src/{components/PipelineSettings.d.ts → containers/PipelineObjectSettings/PipelineObjectSettings.d.ts} +1 -2
  29. package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts.map +1 -0
  30. package/dist/types/src/containers/PipelineObjectSettings/index.d.ts +2 -0
  31. package/dist/types/src/containers/PipelineObjectSettings/index.d.ts.map +1 -0
  32. package/dist/types/src/containers/index.d.ts +4 -0
  33. package/dist/types/src/containers/index.d.ts.map +1 -0
  34. package/dist/types/src/hooks/index.d.ts +2 -0
  35. package/dist/types/src/hooks/index.d.ts.map +1 -0
  36. package/dist/types/src/hooks/usePipelineBoardModel.d.ts +6 -0
  37. package/dist/types/src/hooks/usePipelineBoardModel.d.ts.map +1 -0
  38. package/dist/types/src/templates/research.d.ts.map +1 -1
  39. package/dist/types/src/translations.d.ts +22 -21
  40. package/dist/types/src/translations.d.ts.map +1 -1
  41. package/dist/types/src/types/index.d.ts +0 -2
  42. package/dist/types/src/types/index.d.ts.map +1 -1
  43. package/dist/types/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +53 -41
  45. package/src/PipelinePlugin.tsx +20 -19
  46. package/src/capabilities/app-graph-builder.ts +40 -0
  47. package/src/capabilities/index.ts +4 -3
  48. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +20 -14
  49. package/src/components/PipelineComponent/PipelineColumn.tsx +164 -0
  50. package/src/components/{PipelineComponent.stories.tsx → PipelineComponent/PipelineComponent.stories.tsx} +45 -30
  51. package/src/components/PipelineComponent/PipelineComponent.tsx +140 -0
  52. package/src/components/PipelineComponent/index.ts +6 -0
  53. package/src/components/index.ts +1 -7
  54. package/src/containers/PipelineContainer/PipelineContainer.stories.tsx +229 -0
  55. package/src/containers/PipelineContainer/PipelineContainer.tsx +86 -0
  56. package/src/containers/PipelineContainer/index.ts +5 -0
  57. package/src/{components/PipelineSettings.tsx → containers/PipelineObjectSettings/PipelineObjectSettings.tsx} +75 -63
  58. package/src/containers/PipelineObjectSettings/index.ts +5 -0
  59. package/src/containers/index.ts +8 -0
  60. package/src/hooks/index.ts +5 -0
  61. package/src/hooks/usePipelineBoardModel.ts +79 -0
  62. package/src/meta.ts +1 -1
  63. package/src/templates/research.ts +14 -15
  64. package/src/translations.ts +22 -21
  65. package/src/types/index.ts +0 -3
  66. package/dist/lib/browser/PipelineContainer-I3TPA7ZN.mjs +0 -217
  67. package/dist/lib/browser/PipelineContainer-I3TPA7ZN.mjs.map +0 -7
  68. package/dist/lib/browser/PipelineSettings-YSGSJHBT.mjs +0 -212
  69. package/dist/lib/browser/PipelineSettings-YSGSJHBT.mjs.map +0 -7
  70. package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs +0 -65
  71. package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs.map +0 -7
  72. package/dist/lib/browser/chunk-7GVESVYR.mjs +0 -42
  73. package/dist/lib/browser/chunk-7GVESVYR.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-QWNKLHBY.mjs +0 -28
  75. package/dist/lib/browser/chunk-QWNKLHBY.mjs.map +0 -7
  76. package/dist/lib/browser/react-surface-JMMCTIL3.mjs +0 -57
  77. package/dist/lib/browser/react-surface-JMMCTIL3.mjs.map +0 -7
  78. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  79. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  80. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  81. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  82. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
  83. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  84. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  85. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  86. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  87. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  88. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  89. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  90. package/dist/types/src/components/PipelineColumn.d.ts +0 -10
  91. package/dist/types/src/components/PipelineColumn.d.ts.map +0 -1
  92. package/dist/types/src/components/PipelineComponent.d.ts +0 -38
  93. package/dist/types/src/components/PipelineComponent.d.ts.map +0 -1
  94. package/dist/types/src/components/PipelineComponent.stories.d.ts +0 -42
  95. package/dist/types/src/components/PipelineComponent.stories.d.ts.map +0 -1
  96. package/dist/types/src/components/PipelineContainer.d.ts +0 -7
  97. package/dist/types/src/components/PipelineContainer.d.ts.map +0 -1
  98. package/dist/types/src/components/PipelineContainer.stories.d.ts +0 -56
  99. package/dist/types/src/components/PipelineContainer.stories.d.ts.map +0 -1
  100. package/dist/types/src/components/PipelineSettings.d.ts.map +0 -1
  101. package/dist/types/src/types/PipelineAction.d.ts +0 -25
  102. package/dist/types/src/types/PipelineAction.d.ts.map +0 -1
  103. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -51
  104. package/src/capabilities/app-graph-builder/index.ts +0 -7
  105. package/src/capabilities/operation-resolver/index.ts +0 -5
  106. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -29
  107. package/src/capabilities/react-surface/index.ts +0 -7
  108. package/src/components/PipelineColumn.tsx +0 -145
  109. package/src/components/PipelineComponent.tsx +0 -103
  110. package/src/components/PipelineContainer.stories.tsx +0 -226
  111. package/src/components/PipelineContainer.tsx +0 -57
  112. package/src/types/PipelineAction.ts +0 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-pipeline",
3
- "version": "0.8.4-main.52d7546f51",
3
+ "version": "0.8.4-main.74a063c4e0",
4
4
  "description": "Pipeline plugin for Composer",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,6 +12,14 @@
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": true,
14
14
  "type": "module",
15
+ "imports": {
16
+ "#capabilities": "./src/capabilities/index.ts",
17
+ "#components": "./src/components/index.ts",
18
+ "#containers": "./src/containers/index.ts",
19
+ "#hooks": "./src/hooks/index.ts",
20
+ "#meta": "./src/meta.ts",
21
+ "#types": "./src/types/index.ts"
22
+ },
15
23
  "exports": {
16
24
  ".": {
17
25
  "source": "./src/index.ts",
@@ -39,33 +47,36 @@
39
47
  "dependencies": {
40
48
  "@radix-ui/react-compose-refs": "1.1.1",
41
49
  "@radix-ui/react-context": "1.1.1",
42
- "effect": "3.19.16",
43
- "@dxos/app-framework": "0.8.4-main.52d7546f51",
44
- "@dxos/async": "0.8.4-main.52d7546f51",
45
- "@dxos/assistant-toolkit": "0.8.4-main.52d7546f51",
46
- "@dxos/app-toolkit": "0.8.4-main.52d7546f51",
47
- "@dxos/devtools": "0.8.4-main.52d7546f51",
48
- "@dxos/echo-query": "0.8.4-main.52d7546f51",
49
- "@dxos/echo": "0.8.4-main.52d7546f51",
50
- "@dxos/functions": "0.8.4-main.52d7546f51",
51
- "@dxos/operation": "0.8.4-main.52d7546f51",
52
- "@dxos/plugin-client": "0.8.4-main.52d7546f51",
53
- "@dxos/plugin-deck": "0.8.4-main.52d7546f51",
54
- "@dxos/plugin-graph": "0.8.4-main.52d7546f51",
55
- "@dxos/plugin-markdown": "0.8.4-main.52d7546f51",
56
- "@dxos/log": "0.8.4-main.52d7546f51",
57
- "@dxos/plugin-inbox": "0.8.4-main.52d7546f51",
58
- "@dxos/plugin-space": "0.8.4-main.52d7546f51",
59
- "@dxos/react-ui-attention": "0.8.4-main.52d7546f51",
60
- "@dxos/react-ui-form": "0.8.4-main.52d7546f51",
61
- "@dxos/react-ui-list": "0.8.4-main.52d7546f51",
62
- "@dxos/react-client": "0.8.4-main.52d7546f51",
63
- "@dxos/react-ui-components": "0.8.4-main.52d7546f51",
64
- "@dxos/react-ui-stack": "0.8.4-main.52d7546f51",
65
- "@dxos/react-ui-mosaic": "0.8.4-main.52d7546f51",
66
- "@dxos/schema": "0.8.4-main.52d7546f51",
67
- "@dxos/types": "0.8.4-main.52d7546f51",
68
- "@dxos/util": "0.8.4-main.52d7546f51"
50
+ "@radix-ui/react-slot": "1.1.2",
51
+ "effect": "3.20.0",
52
+ "@dxos/async": "0.8.4-main.74a063c4e0",
53
+ "@dxos/assistant-toolkit": "0.8.4-main.74a063c4e0",
54
+ "@dxos/app-framework": "0.8.4-main.74a063c4e0",
55
+ "@dxos/echo": "0.8.4-main.74a063c4e0",
56
+ "@dxos/devtools": "0.8.4-main.74a063c4e0",
57
+ "@dxos/echo-atom": "0.8.4-main.74a063c4e0",
58
+ "@dxos/echo-query": "0.8.4-main.74a063c4e0",
59
+ "@dxos/log": "0.8.4-main.74a063c4e0",
60
+ "@dxos/plugin-deck": "0.8.4-main.74a063c4e0",
61
+ "@dxos/operation": "0.8.4-main.74a063c4e0",
62
+ "@dxos/plugin-inbox": "0.8.4-main.74a063c4e0",
63
+ "@dxos/plugin-client": "0.8.4-main.74a063c4e0",
64
+ "@dxos/functions": "0.8.4-main.74a063c4e0",
65
+ "@dxos/plugin-markdown": "0.8.4-main.74a063c4e0",
66
+ "@dxos/plugin-space": "0.8.4-main.74a063c4e0",
67
+ "@dxos/react-client": "0.8.4-main.74a063c4e0",
68
+ "@dxos/plugin-graph": "0.8.4-main.74a063c4e0",
69
+ "@dxos/react-ui-attention": "0.8.4-main.74a063c4e0",
70
+ "@dxos/react-ui-form": "0.8.4-main.74a063c4e0",
71
+ "@dxos/react-ui-list": "0.8.4-main.74a063c4e0",
72
+ "@dxos/react-ui-components": "0.8.4-main.74a063c4e0",
73
+ "@dxos/react-ui-menu": "0.8.4-main.74a063c4e0",
74
+ "@dxos/react-ui-mosaic": "0.8.4-main.74a063c4e0",
75
+ "@dxos/app-toolkit": "0.8.4-main.74a063c4e0",
76
+ "@dxos/react-ui-stack": "0.8.4-main.74a063c4e0",
77
+ "@dxos/types": "0.8.4-main.74a063c4e0",
78
+ "@dxos/schema": "0.8.4-main.74a063c4e0",
79
+ "@dxos/util": "0.8.4-main.74a063c4e0"
69
80
  },
70
81
  "devDependencies": {
71
82
  "@effect-atom/atom-react": "^0.5.0",
@@ -73,24 +84,25 @@
73
84
  "@types/react-dom": "~19.2.3",
74
85
  "react": "~19.2.3",
75
86
  "react-dom": "~19.2.3",
76
- "vite": "7.1.9",
77
- "@dxos/plugin-attention": "0.8.4-main.52d7546f51",
78
- "@dxos/plugin-inbox": "0.8.4-main.52d7546f51",
79
- "@dxos/plugin-preview": "0.8.4-main.52d7546f51",
80
- "@dxos/plugin-testing": "0.8.4-main.52d7546f51",
81
- "@dxos/plugin-theme": "0.8.4-main.52d7546f51",
82
- "@dxos/random": "0.8.4-main.52d7546f51",
83
- "@dxos/ui-theme": "0.8.4-main.52d7546f51",
84
- "@dxos/react-ui": "0.8.4-main.52d7546f51",
85
- "@dxos/storybook-utils": "0.8.4-main.52d7546f51"
87
+ "vite": "^7.1.11",
88
+ "@dxos/echo-db": "0.8.4-main.74a063c4e0",
89
+ "@dxos/plugin-attention": "0.8.4-main.74a063c4e0",
90
+ "@dxos/plugin-inbox": "0.8.4-main.74a063c4e0",
91
+ "@dxos/plugin-preview": "0.8.4-main.74a063c4e0",
92
+ "@dxos/plugin-theme": "0.8.4-main.74a063c4e0",
93
+ "@dxos/plugin-testing": "0.8.4-main.74a063c4e0",
94
+ "@dxos/random": "0.8.4-main.74a063c4e0",
95
+ "@dxos/react-ui": "0.8.4-main.74a063c4e0",
96
+ "@dxos/ui-theme": "0.8.4-main.74a063c4e0",
97
+ "@dxos/storybook-utils": "0.8.4-main.74a063c4e0"
86
98
  },
87
99
  "peerDependencies": {
88
100
  "@effect-atom/atom-react": "^0.5.0",
89
- "effect": "3.19.16",
101
+ "effect": "3.20.0",
90
102
  "react": "~19.2.3",
91
103
  "react-dom": "~19.2.3",
92
- "@dxos/react-ui": "0.8.4-main.52d7546f51",
93
- "@dxos/ui-theme": "0.8.4-main.52d7546f51"
104
+ "@dxos/react-ui": "0.8.4-main.74a063c4e0",
105
+ "@dxos/ui-theme": "0.8.4-main.74a063c4e0"
94
106
  },
95
107
  "publishConfig": {
96
108
  "access": "public"
@@ -3,18 +3,20 @@
3
3
  //
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
+ import * as Option from 'effect/Option';
6
7
 
7
- import { Capability, Plugin } from '@dxos/app-framework';
8
+ import { Plugin } from '@dxos/app-framework';
8
9
  import { AppPlugin } from '@dxos/app-toolkit';
10
+ import { Annotation } from '@dxos/echo';
9
11
  import { Operation } from '@dxos/operation';
10
- import { SpaceCapabilities, SpaceEvents } from '@dxos/plugin-space';
12
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
11
13
  import { type CreateObject } from '@dxos/plugin-space/types';
12
14
  import { Pipeline } from '@dxos/types';
13
15
 
14
- import { AppGraphBuilder, OperationResolver, ReactSurface } from './capabilities';
15
- import { meta } from './meta';
16
+ import { AppGraphBuilder, ReactSurface } from '#capabilities';
17
+ import { meta } from '#meta';
18
+
16
19
  import { translations } from './translations';
17
- import { PipelineOperation } from './types';
18
20
 
19
21
  export const PipelinePlugin = Plugin.define(meta).pipe(
20
22
  AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
@@ -22,25 +24,24 @@ export const PipelinePlugin = Plugin.define(meta).pipe(
22
24
  metadata: {
23
25
  id: Pipeline.Pipeline.typename,
24
26
  metadata: {
25
- icon: 'ph--path--regular',
26
- iconHue: 'purple',
27
- createObject: ((props) => Effect.sync(() => Pipeline.make(props))) satisfies CreateObject,
27
+ icon: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).icon,
28
+ iconHue: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).hue ?? 'white',
29
+ createObject: ((props, options) =>
30
+ Effect.gen(function* () {
31
+ const object = Pipeline.make(props);
32
+ return yield* Operation.invoke(SpaceOperation.AddObject, {
33
+ object,
34
+ target: options.target,
35
+ hidden: true,
36
+ targetNodeId: options.targetNodeId,
37
+ });
38
+ })) satisfies CreateObject,
28
39
  },
29
40
  },
30
41
  }),
31
- AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
42
+
32
43
  AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
33
44
  AppPlugin.addSurfaceModule({ activate: ReactSurface }),
34
45
  AppPlugin.addTranslationsModule({ translations }),
35
- Plugin.addModule({
36
- id: 'on-space-created',
37
- activatesOn: SpaceEvents.SpaceCreated,
38
- activate: () =>
39
- Effect.succeed(
40
- Capability.contributes(SpaceCapabilities.OnCreateSpace, (params) =>
41
- Operation.invoke(PipelineOperation.OnCreateSpace, params),
42
- ),
43
- ),
44
- }),
45
46
  Plugin.make,
46
47
  );
@@ -0,0 +1,40 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
9
+ import { GraphBuilder } from '@dxos/plugin-graph';
10
+ import { Pipeline } from '@dxos/types';
11
+
12
+ import { meta } from '#meta';
13
+
14
+ export default Capability.makeModule(
15
+ Effect.fnUntraced(function* () {
16
+ const extensions = yield* Effect.all([
17
+ GraphBuilder.createTypeExtension({
18
+ id: 'triggers',
19
+ type: Pipeline.Pipeline,
20
+ connector: () =>
21
+ Effect.succeed([
22
+ AppNode.makeCompanion({
23
+ id: 'invocations',
24
+ label: ['pipeline-invocations.label', { ns: meta.id }],
25
+ icon: 'ph--clock-countdown--regular',
26
+ data: 'invocations',
27
+ }),
28
+ AppNode.makeCompanion({
29
+ id: 'automation',
30
+ label: ['pipeline-automation.label', { ns: meta.id }],
31
+ icon: 'ph--lightning--regular',
32
+ data: 'automation',
33
+ }),
34
+ ]),
35
+ }),
36
+ ]);
37
+
38
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
39
+ }),
40
+ );
@@ -2,6 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './app-graph-builder';
6
- export * from './operation-resolver';
7
- export * from './react-surface';
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
8
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -7,42 +7,48 @@ import React from 'react';
7
7
 
8
8
  import { Capabilities, Capability } from '@dxos/app-framework';
9
9
  import { Surface } from '@dxos/app-framework/ui';
10
+ import { AppSurface } from '@dxos/app-toolkit/ui';
10
11
  import { InvocationTraceContainer } from '@dxos/devtools';
11
12
  import { Obj } from '@dxos/echo';
12
- import { Layout } from '@dxos/react-ui';
13
+ import { Panel } from '@dxos/react-ui';
13
14
  import { Pipeline } from '@dxos/types';
14
15
 
15
- import { PipelineContainer, PipelineObjectSettings } from '../../components';
16
- import { meta } from '../../meta';
16
+ import { PipelineContainer, PipelineObjectSettings } from '#containers';
17
17
 
18
18
  export default Capability.makeModule(() =>
19
19
  Effect.succeed(
20
20
  Capability.contributes(Capabilities.ReactSurface, [
21
21
  Surface.create({
22
- id: meta.id,
22
+ id: 'root',
23
23
  role: 'article',
24
- filter: (data): data is { subject: Pipeline.Pipeline } => Obj.instanceOf(Pipeline.Pipeline, data.subject),
25
- component: ({ data, role }) => <PipelineContainer role={role} subject={data.subject} />,
24
+ filter: AppSurface.objectArticle(Pipeline.Pipeline),
25
+ component: ({ data, role }) => (
26
+ <PipelineContainer role={role} subject={data.subject} attendableId={data.attendableId} />
27
+ ),
26
28
  }),
27
29
  Surface.create({
28
- id: `${meta.id}/companion/invocations`,
30
+ id: 'companion.invocations',
29
31
  role: 'article',
30
- filter: (data): data is { companionTo: Pipeline.Pipeline } =>
31
- Obj.instanceOf(Pipeline.Pipeline, data.companionTo) && data.subject === 'invocations',
32
+ filter: AppSurface.and(
33
+ AppSurface.literalArticle('invocations'),
34
+ AppSurface.companionArticle(Pipeline.Pipeline),
35
+ ),
32
36
  component: ({ data, role }) => {
33
37
  const db = Obj.getDatabase(data.companionTo);
34
38
  // TODO(wittjosiah): Filter the invocations to those relevant to the project.
35
39
  return (
36
- <Layout.Main role={role}>
37
- <InvocationTraceContainer db={db} detailAxis='block' />
38
- </Layout.Main>
40
+ <Panel.Root role={role} className='dx-document'>
41
+ <Panel.Content asChild>
42
+ <InvocationTraceContainer db={db} detailAxis='block' />
43
+ </Panel.Content>
44
+ </Panel.Root>
39
45
  );
40
46
  },
41
47
  }),
42
48
  Surface.create({
43
- id: `${meta.id}/object-settings`,
49
+ id: 'object-settings',
44
50
  role: 'object-settings',
45
- filter: (data): data is { subject: Pipeline.Pipeline } => Obj.instanceOf(Pipeline.Pipeline, data.subject),
51
+ filter: AppSurface.objectSettings(Pipeline.Pipeline),
46
52
  component: ({ data }) => <PipelineObjectSettings pipeline={data.subject} />,
47
53
  }),
48
54
  ]),
@@ -0,0 +1,164 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useComposedRefs } from '@radix-ui/react-compose-refs';
6
+ import * as Function from 'effect/Function';
7
+ import * as Option from 'effect/Option';
8
+ import type * as Schema from 'effect/Schema';
9
+ import React, { forwardRef, useMemo, useRef, useState } from 'react';
10
+
11
+ import { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';
12
+ import { Annotation, JsonSchema, Obj, Query, Type } from '@dxos/echo';
13
+ import { Filter, getSpace, useObject } from '@dxos/react-client/echo';
14
+ import { Panel, Toolbar, useAsyncEffect, useTranslation } from '@dxos/react-ui';
15
+ import { Card } from '@dxos/react-ui';
16
+ import { Menu } from '@dxos/react-ui-menu';
17
+ import { Board, Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
18
+ import { ProjectionModel, createEchoChangeCallback } from '@dxos/schema';
19
+ import { type Pipeline } from '@dxos/types';
20
+
21
+ import { meta } from '#meta';
22
+
23
+ import { type ItemProps, usePipeline } from './PipelineComponent';
24
+
25
+ //
26
+ // PipelineColumn
27
+ //
28
+
29
+ const PIPELINE_COLUMN_NAME = 'PipelineColumn';
30
+
31
+ export type PipelineColumnProps = Pick<MosaicTileProps<Pipeline.Column>, 'classNames' | 'location' | 'data' | 'debug'>;
32
+
33
+ // TODO(wittjosiah): Support item DnD reordering (ordering needs to be stored on the view presentation collection).
34
+ export const PipelineColumn = ({ data: column, location, classNames, debug }: PipelineColumnProps) => {
35
+ const { t } = useTranslation(meta.id);
36
+ const dragHandleRef = useRef<HTMLButtonElement>(null);
37
+ // Subscribe to the view target for reactivity.
38
+ const [viewSnapshot] = useObject(column.view);
39
+ const view = column.view.target;
40
+ const space = getSpace(view);
41
+ const { Item } = usePipeline(PIPELINE_COLUMN_NAME);
42
+ const [schema, setSchema] = useState<Schema.Schema.AnyNoContext>();
43
+ const query = useMemo(() => {
44
+ if (!view) {
45
+ return Query.select(Filter.nothing());
46
+ } else {
47
+ // NOTE: Snapshot is required to prevent signal read in prohibited scope.
48
+ // TODO(wittjosiah): Without stringify, filter.filters remains a proxied array.
49
+ return Query.fromAst(JSON.parse(JSON.stringify(viewSnapshot?.query.ast)));
50
+ }
51
+ }, [JSON.stringify(viewSnapshot?.query.ast)]);
52
+
53
+ useAsyncEffect(async () => {
54
+ if (!query || !space?.db) {
55
+ return;
56
+ }
57
+
58
+ const schema = await resolveSchemaWithRegistry(space.db.schemaRegistry, query.ast);
59
+ setSchema(() => schema);
60
+ }, [space, query]);
61
+
62
+ const projectionModel = useMemo(() => {
63
+ if (!schema || !view) {
64
+ return undefined;
65
+ }
66
+
67
+ // For mutable schemas (EchoSchema), use the live jsonSchema reference for reactivity.
68
+ const jsonSchema = Type.isMutable(schema) ? schema.jsonSchema : JsonSchema.toJsonSchema(schema);
69
+ const change = createEchoChangeCallback(view, Type.isMutable(schema) ? schema : undefined);
70
+ return new ProjectionModel({ view, baseSchema: jsonSchema, change });
71
+ }, [schema, view]);
72
+
73
+ const PipelineTile = useMemo(() => {
74
+ return forwardRef<HTMLDivElement, Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'>>(
75
+ (props, ref) => <ItemTile {...props} itemProps={{ item: props.data, projectionModel }} ref={ref} />,
76
+ );
77
+ }, [projectionModel]);
78
+
79
+ if (!view) {
80
+ return null;
81
+ }
82
+
83
+ return (
84
+ <Panel.Root asChild>
85
+ <Board.Column.Root
86
+ debug={debug}
87
+ data={column}
88
+ location={location}
89
+ classNames={classNames}
90
+ dragHandleRef={dragHandleRef}
91
+ >
92
+ <Panel.Toolbar asChild>
93
+ <Board.Column.Header
94
+ classNames='_opacity-10'
95
+ label={column.name || t('untitled-view.title')}
96
+ dragHandleRef={dragHandleRef}
97
+ />
98
+ </Panel.Toolbar>
99
+ <Panel.Content asChild>
100
+ <Board.Column.Body data={column} Tile={PipelineTile} />
101
+ </Panel.Content>
102
+ </Board.Column.Root>
103
+ </Panel.Root>
104
+ );
105
+ };
106
+
107
+ PipelineColumn.displayName = PIPELINE_COLUMN_NAME;
108
+
109
+ //
110
+ // ItemTile
111
+ //
112
+
113
+ const ITEM_TILE_NAME = 'ItemTile';
114
+
115
+ type ItemTileProps = Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'> & {
116
+ itemProps: ItemProps;
117
+ };
118
+
119
+ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
120
+ ({ classNames, data, location, debug, itemProps }, forwardedRef) => {
121
+ const rootRef = useRef<HTMLDivElement>(null);
122
+ const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);
123
+ const { Item } = usePipeline(ITEM_TILE_NAME);
124
+ const icon = Function.pipe(
125
+ Obj.getSchema(data),
126
+ Option.fromNullable,
127
+ Option.flatMap(Annotation.IconAnnotation.get),
128
+ Option.map(({ icon }) => icon),
129
+ Option.getOrElse(() => 'ph--placeholder--regular'),
130
+ );
131
+
132
+ return (
133
+ <Menu.Root>
134
+ <Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
135
+ <Focus.Item asChild>
136
+ <Card.Root classNames={classNames} ref={composedRef}>
137
+ <Card.Toolbar>
138
+ <Card.Icon icon={icon} />
139
+ <Card.Title>{Obj.getLabel(data)}</Card.Title>
140
+ {/* TODO(wittjosiah): Reconcile with Card.Menu. */}
141
+ <Card.IconBlock padding>
142
+ <Menu.Trigger asChild>
143
+ <Toolbar.IconButton
144
+ iconOnly
145
+ variant='ghost'
146
+ icon='ph--dots-three-vertical--regular'
147
+ label='Actions'
148
+ />
149
+ </Menu.Trigger>
150
+ <Menu.Content />
151
+ </Card.IconBlock>
152
+ </Card.Toolbar>
153
+ <Card.Content>
154
+ <Item {...itemProps} />
155
+ </Card.Content>
156
+ </Card.Root>
157
+ </Focus.Item>
158
+ </Mosaic.Tile>
159
+ </Menu.Root>
160
+ );
161
+ },
162
+ );
163
+
164
+ ItemTile.displayName = ITEM_TILE_NAME;
@@ -2,31 +2,37 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { RegistryContext } from '@effect-atom/atom-react';
5
6
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useCallback, useEffect } from 'react';
7
+ import React, { useCallback, useContext, useEffect, useMemo } from 'react';
7
8
 
8
9
  import { Filter, Ref } from '@dxos/client/echo';
9
- import { Obj, Query, Type } from '@dxos/echo';
10
- import { faker } from '@dxos/random';
10
+ import { JsonSchema, Obj, Query } from '@dxos/echo';
11
+ import { Collection, View } from '@dxos/echo';
12
+ import { random } from '@dxos/random';
11
13
  import { useQuery } from '@dxos/react-client/echo';
12
14
  import { useClientStory, withClientProvider } from '@dxos/react-client/testing';
13
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
14
15
  import { Form, omitId } from '@dxos/react-ui-form';
15
16
  import { withMosaic } from '@dxos/react-ui-mosaic/testing';
16
- import { Collection, View } from '@dxos/schema';
17
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
18
+ import { ViewModel } from '@dxos/schema';
17
19
  import { createObjectFactory } from '@dxos/schema/testing';
20
+ import { withRegistry } from '@dxos/storybook-utils';
18
21
  import { Person, Pipeline } from '@dxos/types';
19
22
 
20
- import { translations } from '../translations';
23
+ import { usePipelineBoardModel } from '#hooks';
21
24
 
22
- import { type ItemProps, PipelineComponent as PipelineComponent } from './PipelineComponent';
25
+ import { translations } from '../../translations';
26
+ import { type ItemProps, PipelineComponent } from './PipelineComponent';
23
27
 
24
28
  const StorybookProjectItem = ({ item, projectionModel }: ItemProps) => {
29
+ const personSchema = useMemo(() => omitId(Person.Person), []);
30
+
25
31
  if (Obj.instanceOf(Person.Person, item)) {
26
- const contact = item as Obj.Obj<Person.Person>;
32
+ const contact = item as Obj.OfShape<Person.Person>;
27
33
 
28
34
  return (
29
- <Form.Root schema={omitId(Person.Person)} projection={projectionModel} values={contact} autoSave>
35
+ <Form.Root schema={personSchema} projection={projectionModel} values={contact} autoSave>
30
36
  <Form.Viewport>
31
37
  <Form.Content>
32
38
  <Form.FieldSet />
@@ -40,9 +46,11 @@ const StorybookProjectItem = ({ item, projectionModel }: ItemProps) => {
40
46
  };
41
47
 
42
48
  const DefaultStory = () => {
49
+ const registry = useContext(RegistryContext);
43
50
  const { space } = useClientStory();
44
51
  const pipelines = useQuery(space?.db, Filter.type(Pipeline.Pipeline));
45
52
  const pipeline = pipelines[0];
53
+ const model = usePipelineBoardModel(pipeline, registry);
46
54
 
47
55
  const handleAddColumn = useCallback(() => {
48
56
  if (!space || !pipeline) {
@@ -50,16 +58,16 @@ const DefaultStory = () => {
50
58
  }
51
59
 
52
60
  // Create a new view for contacts similar to the initialization.
53
- const view = View.make({
61
+ const view = ViewModel.make({
54
62
  query: Query.select(Filter.type(Person.Person)),
55
- jsonSchema: Type.toJsonSchema(Person.Person),
63
+ jsonSchema: JsonSchema.toJsonSchema(Person.Person),
56
64
  fields: ['fullName'],
57
65
  });
58
66
 
59
- Obj.change(pipeline, (p) => {
60
- p.columns.push({
67
+ Obj.change(pipeline, (obj) => {
68
+ obj.columns.push({
61
69
  name: 'New Contacts',
62
- view: Ref.make(view) as (typeof p.columns)[number]['view'],
70
+ view: Ref.make(view) as (typeof obj.columns)[number]['view'],
63
71
  order: [],
64
72
  });
65
73
  });
@@ -73,16 +81,20 @@ const DefaultStory = () => {
73
81
 
74
82
  return (
75
83
  <PipelineComponent.Root Item={StorybookProjectItem} onAddColumn={handleAddColumn}>
76
- <PipelineComponent.Content pipeline={pipeline} />
84
+ <PipelineComponent.Content model={model}>
85
+ <PipelineComponent.Columns pipeline={pipeline} />
86
+ </PipelineComponent.Content>
77
87
  </PipelineComponent.Root>
78
88
  );
79
89
  };
80
90
 
81
91
  const MutationsStory = () => {
92
+ const registry = useContext(RegistryContext);
82
93
  const { space } = useClientStory();
83
94
  const pipelines = useQuery(space?.db, Filter.type(Pipeline.Pipeline));
84
95
  const contacts = useQuery(space?.db, Filter.type(Person.Person));
85
96
  const pipeline = pipelines[0];
97
+ const model = usePipelineBoardModel(pipeline, registry);
86
98
 
87
99
  const handleAddColumn = useCallback(() => {
88
100
  if (!space || !pipeline) {
@@ -90,16 +102,16 @@ const MutationsStory = () => {
90
102
  }
91
103
 
92
104
  // Create a new view for contacts similar to the initialization.
93
- const view = View.make({
105
+ const view = ViewModel.make({
94
106
  query: Query.select(Filter.type(Person.Person)),
95
- jsonSchema: Type.toJsonSchema(Person.Person),
107
+ jsonSchema: JsonSchema.toJsonSchema(Person.Person),
96
108
  fields: ['fullName'],
97
109
  });
98
110
 
99
- Obj.change(pipeline, (p) => {
100
- p.columns.push({
111
+ Obj.change(pipeline, (obj) => {
112
+ obj.columns.push({
101
113
  name: 'New Contacts',
102
- view: Ref.make(view) as (typeof p.columns)[number]['view'],
114
+ view: Ref.make(view) as (typeof obj.columns)[number]['view'],
103
115
  order: [],
104
116
  });
105
117
  });
@@ -113,19 +125,19 @@ const MutationsStory = () => {
113
125
  }
114
126
 
115
127
  const interval = setInterval(() => {
116
- const factory = createObjectFactory(space.db, faker as any);
128
+ const factory = createObjectFactory(space.db, random as any);
117
129
  const p = Math.random();
118
130
 
119
131
  if (p < 0.4) {
120
132
  // Append to the name
121
- const contactToAdjust = faker.helpers.arrayElement(contacts);
122
- Obj.change(contactToAdjust, (c) => {
123
- c.fullName = (c.fullName ?? '') + ' X';
133
+ const contactToAdjust = random.helpers.arrayElement(contacts);
134
+ Obj.change(contactToAdjust, (obj) => {
135
+ obj.fullName = (obj.fullName ?? '') + ' X';
124
136
  });
125
137
  return;
126
138
  } else if (p < 0.7 && contacts.length > 1) {
127
139
  // Remove a contact (30% chance, but only if we have more than 1)
128
- const contactToRemove = faker.helpers.arrayElement(contacts);
140
+ const contactToRemove = random.helpers.arrayElement(contacts);
129
141
  space.db.remove(contactToRemove);
130
142
  } else {
131
143
  // Add a new contact (30% chance)
@@ -142,16 +154,19 @@ const MutationsStory = () => {
142
154
 
143
155
  return (
144
156
  <PipelineComponent.Root Item={StorybookProjectItem} onAddColumn={handleAddColumn}>
145
- <PipelineComponent.Content pipeline={pipeline} />
157
+ <PipelineComponent.Content model={model}>
158
+ <PipelineComponent.Columns pipeline={pipeline} />
159
+ </PipelineComponent.Content>
146
160
  </PipelineComponent.Root>
147
161
  );
148
162
  };
149
163
 
150
164
  const meta = {
151
- title: 'plugins/plugin-pipeline/PipelineComponent',
165
+ title: 'plugins/plugin-pipeline/components/PipelineComponent',
152
166
  decorators: [
153
167
  withTheme(),
154
168
  withLayout({ layout: 'column' }),
169
+ withRegistry,
155
170
  withMosaic(),
156
171
  withClientProvider({
157
172
  types: [Pipeline.Pipeline, View.View, Collection.Collection, Person.Person],
@@ -159,10 +174,10 @@ const meta = {
159
174
  createSpace: true,
160
175
  onCreateSpace: async ({ space }) => {
161
176
  // Create a view for contacts.
162
- const view = View.make({
177
+ const view = ViewModel.make({
163
178
  name: 'Contacts',
164
179
  query: Query.select(Filter.type(Person.Person)),
165
- jsonSchema: Type.toJsonSchema(Person.Person),
180
+ jsonSchema: JsonSchema.toJsonSchema(Person.Person),
166
181
  fields: ['fullName'],
167
182
  });
168
183
 
@@ -180,7 +195,7 @@ const meta = {
180
195
  );
181
196
 
182
197
  // Generate random contacts.
183
- const factory = createObjectFactory(space.db, faker as any);
198
+ const factory = createObjectFactory(space.db, random as any);
184
199
  await factory([{ type: Person.Person, count: 12 }]);
185
200
  },
186
201
  }),