@dxos/plugin-kanban 0.8.3 → 0.8.4-main.1068cf700f

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 (158) hide show
  1. package/dist/lib/browser/blueprint-definition-GGL6Y5GN.mjs +18 -0
  2. package/dist/lib/browser/blueprint-definition-GGL6Y5GN.mjs.map +7 -0
  3. package/dist/lib/browser/blueprints/index.mjs +8 -0
  4. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  5. package/dist/lib/browser/chunk-L6N4ZDZ7.mjs +35 -0
  6. package/dist/lib/browser/chunk-L6N4ZDZ7.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-XYQO4VL7.mjs +150 -0
  8. package/dist/lib/browser/chunk-XYQO4VL7.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +66 -72
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/operation-resolver-RFQU4VAB.mjs +162 -0
  13. package/dist/lib/browser/operation-resolver-RFQU4VAB.mjs.map +7 -0
  14. package/dist/lib/browser/react-surface-FZQDOE3J.mjs +237 -0
  15. package/dist/lib/browser/react-surface-FZQDOE3J.mjs.map +7 -0
  16. package/dist/lib/browser/types/index.mjs +14 -0
  17. package/dist/lib/browser/types/index.mjs.map +7 -0
  18. package/dist/lib/node-esm/blueprint-definition-AMIOYZSF.mjs +19 -0
  19. package/dist/lib/node-esm/blueprint-definition-AMIOYZSF.mjs.map +7 -0
  20. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  21. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  22. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  23. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  24. package/dist/lib/node-esm/chunk-NN6JMKIT.mjs +152 -0
  25. package/dist/lib/node-esm/chunk-NN6JMKIT.mjs.map +7 -0
  26. package/dist/lib/node-esm/chunk-ZHRMUKTF.mjs +36 -0
  27. package/dist/lib/node-esm/chunk-ZHRMUKTF.mjs.map +7 -0
  28. package/dist/lib/node-esm/index.mjs +66 -72
  29. package/dist/lib/node-esm/index.mjs.map +4 -4
  30. package/dist/lib/node-esm/meta.json +1 -1
  31. package/dist/lib/node-esm/operation-resolver-J4JUSY74.mjs +163 -0
  32. package/dist/lib/node-esm/operation-resolver-J4JUSY74.mjs.map +7 -0
  33. package/dist/lib/node-esm/react-surface-KOQ56TL6.mjs +238 -0
  34. package/dist/lib/node-esm/react-surface-KOQ56TL6.mjs.map +7 -0
  35. package/dist/lib/node-esm/{types.mjs → types/index.mjs} +7 -6
  36. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  37. package/dist/types/src/KanbanPlugin.d.ts +2 -1
  38. package/dist/types/src/KanbanPlugin.d.ts.map +1 -1
  39. package/dist/types/src/blueprints/index.d.ts +2 -0
  40. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  41. package/dist/types/src/blueprints/kanban-blueprint.d.ts +22 -0
  42. package/dist/types/src/blueprints/kanban-blueprint.d.ts.map +1 -0
  43. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
  44. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
  45. package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
  46. package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +10 -0
  48. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  50. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  51. package/dist/types/src/capabilities/index.d.ts +3 -3
  52. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  54. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  56. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  57. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  58. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  59. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  60. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  61. package/dist/types/src/components/KanbanContainer.d.ts +4 -5
  62. package/dist/types/src/components/KanbanContainer.d.ts.map +1 -1
  63. package/dist/types/src/components/KanbanContainer.stories.d.ts +71 -6
  64. package/dist/types/src/components/KanbanContainer.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/KanbanViewEditor.d.ts +3 -3
  66. package/dist/types/src/components/KanbanViewEditor.d.ts.map +1 -1
  67. package/dist/types/src/index.d.ts +1 -1
  68. package/dist/types/src/index.d.ts.map +1 -1
  69. package/dist/types/src/meta.d.ts +2 -3
  70. package/dist/types/src/meta.d.ts.map +1 -1
  71. package/dist/types/src/translations.d.ts +36 -53
  72. package/dist/types/src/translations.d.ts.map +1 -1
  73. package/dist/types/src/types/index.d.ts +3 -0
  74. package/dist/types/src/types/index.d.ts.map +1 -0
  75. package/dist/types/src/types/schema.d.ts +122 -0
  76. package/dist/types/src/types/schema.d.ts.map +1 -0
  77. package/dist/types/src/types/types.d.ts +4 -0
  78. package/dist/types/src/types/types.d.ts.map +1 -0
  79. package/dist/types/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +65 -44
  81. package/src/KanbanPlugin.tsx +39 -55
  82. package/src/blueprints/index.ts +5 -0
  83. package/src/blueprints/kanban-blueprint.ts +24 -0
  84. package/src/capabilities/artifact-definition/artifact-definition.ts +150 -0
  85. package/src/capabilities/artifact-definition/index.ts +7 -0
  86. package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
  87. package/src/capabilities/blueprint-definition/index.ts +7 -0
  88. package/src/capabilities/index.ts +3 -5
  89. package/src/capabilities/operation-resolver/index.ts +7 -0
  90. package/src/capabilities/operation-resolver/operation-resolver.ts +133 -0
  91. package/src/capabilities/react-surface/index.ts +7 -0
  92. package/src/capabilities/react-surface/react-surface.tsx +87 -0
  93. package/src/components/KanbanContainer.stories.tsx +212 -118
  94. package/src/components/KanbanContainer.tsx +38 -46
  95. package/src/components/KanbanViewEditor.tsx +34 -79
  96. package/src/index.ts +2 -1
  97. package/src/meta.ts +9 -7
  98. package/src/translations.ts +10 -10
  99. package/src/types/index.ts +6 -0
  100. package/src/types/schema.ts +120 -0
  101. package/src/types/types.ts +7 -0
  102. package/dist/lib/browser/artifact-definition-6HNQFL2M.mjs +0 -178
  103. package/dist/lib/browser/artifact-definition-6HNQFL2M.mjs.map +0 -7
  104. package/dist/lib/browser/chunk-6JEDX6HA.mjs +0 -85
  105. package/dist/lib/browser/chunk-6JEDX6HA.mjs.map +0 -7
  106. package/dist/lib/browser/intent-resolver-QQOH5EV2.mjs +0 -297
  107. package/dist/lib/browser/intent-resolver-QQOH5EV2.mjs.map +0 -7
  108. package/dist/lib/browser/react-surface-HJL2JRJP.mjs +0 -305
  109. package/dist/lib/browser/react-surface-HJL2JRJP.mjs.map +0 -7
  110. package/dist/lib/browser/types.mjs +0 -13
  111. package/dist/lib/node/artifact-definition-GRCAYCVG.cjs +0 -193
  112. package/dist/lib/node/artifact-definition-GRCAYCVG.cjs.map +0 -7
  113. package/dist/lib/node/chunk-ATDUVDIE.cjs +0 -108
  114. package/dist/lib/node/chunk-ATDUVDIE.cjs.map +0 -7
  115. package/dist/lib/node/index.cjs +0 -128
  116. package/dist/lib/node/index.cjs.map +0 -7
  117. package/dist/lib/node/intent-resolver-6ZNOIHKY.cjs +0 -308
  118. package/dist/lib/node/intent-resolver-6ZNOIHKY.cjs.map +0 -7
  119. package/dist/lib/node/meta.json +0 -1
  120. package/dist/lib/node/react-surface-G2J6F7U5.cjs +0 -322
  121. package/dist/lib/node/react-surface-G2J6F7U5.cjs.map +0 -7
  122. package/dist/lib/node/types.cjs +0 -35
  123. package/dist/lib/node/types.cjs.map +0 -7
  124. package/dist/lib/node-esm/artifact-definition-FA2IAAUQ.mjs +0 -179
  125. package/dist/lib/node-esm/artifact-definition-FA2IAAUQ.mjs.map +0 -7
  126. package/dist/lib/node-esm/chunk-7DHZSNGQ.mjs +0 -87
  127. package/dist/lib/node-esm/chunk-7DHZSNGQ.mjs.map +0 -7
  128. package/dist/lib/node-esm/intent-resolver-4TYFDM4E.mjs +0 -298
  129. package/dist/lib/node-esm/intent-resolver-4TYFDM4E.mjs.map +0 -7
  130. package/dist/lib/node-esm/react-surface-257WTPQZ.mjs +0 -306
  131. package/dist/lib/node-esm/react-surface-257WTPQZ.mjs.map +0 -7
  132. package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
  133. package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
  134. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  135. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  136. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  137. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  138. package/dist/types/src/testing/index.d.ts +0 -3
  139. package/dist/types/src/testing/index.d.ts.map +0 -1
  140. package/dist/types/src/testing/initialize-kanban.d.ts +0 -17
  141. package/dist/types/src/testing/initialize-kanban.d.ts.map +0 -1
  142. package/dist/types/src/testing/kanban-manager.d.ts +0 -7
  143. package/dist/types/src/testing/kanban-manager.d.ts.map +0 -1
  144. package/dist/types/src/testing/playwright/smoke.spec.d.ts +0 -2
  145. package/dist/types/src/testing/playwright/smoke.spec.d.ts.map +0 -1
  146. package/dist/types/src/types.d.ts +0 -76
  147. package/dist/types/src/types.d.ts.map +0 -1
  148. package/src/capabilities/artifact-definition.ts +0 -136
  149. package/src/capabilities/intent-resolver.ts +0 -71
  150. package/src/capabilities/react-surface.tsx +0 -81
  151. package/src/testing/index.ts +0 -6
  152. package/src/testing/initialize-kanban.ts +0 -128
  153. package/src/testing/kanban-manager.ts +0 -13
  154. package/src/testing/playwright/playwright.config.cts +0 -18
  155. package/src/testing/playwright/smoke.spec.ts +0 -7
  156. package/src/types.ts +0 -95
  157. /package/dist/lib/browser/{types.mjs.map → blueprints/index.mjs.map} +0 -0
  158. /package/dist/lib/{node-esm/types.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,28 +1,43 @@
1
1
  {
2
2
  "name": "@dxos/plugin-kanban",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.1068cf700f",
4
4
  "description": "Kanban DXOS Surface plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
10
14
  "type": "module",
11
15
  "exports": {
12
16
  ".": {
13
- "types": "./dist/types/src/index.d.ts",
14
17
  "browser": "./dist/lib/browser/index.mjs",
15
- "node": "./dist/lib/node-esm/index.mjs"
18
+ "node": "./dist/lib/node-esm/index.mjs",
19
+ "source": "./src/index.ts",
20
+ "types": "./dist/types/src/index.d.ts"
21
+ },
22
+ "./blueprints": {
23
+ "browser": "./dist/lib/browser/blueprints/index.mjs",
24
+ "node": "./dist/lib/node-esm/blueprints/index.mjs",
25
+ "source": "./src/blueprints/index.ts",
26
+ "types": "./dist/types/src/blueprints/index.d.ts"
16
27
  },
17
28
  "./types": {
18
- "types": "./dist/types/src/types/index.d.ts",
19
29
  "browser": "./dist/lib/browser/types/index.mjs",
20
- "node": "./dist/lib/node-esm/types/index.mjs"
30
+ "node": "./dist/lib/node-esm/types/index.mjs",
31
+ "source": "./src/types/index.ts",
32
+ "types": "./dist/types/src/types/index.d.ts"
21
33
  }
22
34
  },
23
35
  "types": "dist/types/src/index.d.ts",
24
36
  "typesVersions": {
25
37
  "*": {
38
+ "blueprints": [
39
+ "dist/types/src/blueprints/index.d.ts"
40
+ ],
26
41
  "types": [
27
42
  "dist/types/src/types/index.d.ts"
28
43
  ]
@@ -33,49 +48,55 @@
33
48
  "src"
34
49
  ],
35
50
  "dependencies": {
36
- "@preact-signals/safe-react": "^0.9.0",
37
- "@preact/signals-core": "^1.9.0",
38
- "effect": "3.14.21",
39
- "@dxos/ai": "0.8.3",
40
- "@dxos/app-framework": "0.8.3",
41
- "@dxos/assistant": "0.8.3",
42
- "@dxos/artifact": "0.8.3",
43
- "@dxos/async": "0.8.3",
44
- "@dxos/echo-schema": "0.8.3",
45
- "@dxos/echo": "0.8.3",
46
- "@dxos/effect": "0.8.3",
47
- "@dxos/invariant": "0.8.3",
48
- "@dxos/plugin-client": "0.8.3",
49
- "@dxos/plugin-graph": "0.8.3",
50
- "@dxos/plugin-search": "0.8.3",
51
- "@dxos/plugin-space": "0.8.3",
52
- "@dxos/random": "0.8.3",
53
- "@dxos/react-client": "0.8.3",
54
- "@dxos/react-ui-form": "0.8.3",
55
- "@dxos/react-ui-kanban": "0.8.3",
56
- "@dxos/react-ui-stack": "0.8.3",
57
- "@dxos/schema": "0.8.3",
58
- "@dxos/util": "0.8.3"
51
+ "@effect-atom/atom-react": "^0.5.0",
52
+ "effect": "3.19.16",
53
+ "@dxos/ai": "0.8.4-main.1068cf700f",
54
+ "@dxos/app-framework": "0.8.4-main.1068cf700f",
55
+ "@dxos/async": "0.8.4-main.1068cf700f",
56
+ "@dxos/echo": "0.8.4-main.1068cf700f",
57
+ "@dxos/app-toolkit": "0.8.4-main.1068cf700f",
58
+ "@dxos/assistant": "0.8.4-main.1068cf700f",
59
+ "@dxos/effect": "0.8.4-main.1068cf700f",
60
+ "@dxos/functions": "0.8.4-main.1068cf700f",
61
+ "@dxos/blueprints": "0.8.4-main.1068cf700f",
62
+ "@dxos/invariant": "0.8.4-main.1068cf700f",
63
+ "@dxos/log": "0.8.4-main.1068cf700f",
64
+ "@dxos/plugin-graph": "0.8.4-main.1068cf700f",
65
+ "@dxos/operation": "0.8.4-main.1068cf700f",
66
+ "@dxos/plugin-space": "0.8.4-main.1068cf700f",
67
+ "@dxos/plugin-client": "0.8.4-main.1068cf700f",
68
+ "@dxos/plugin-search": "0.8.4-main.1068cf700f",
69
+ "@dxos/random": "0.8.4-main.1068cf700f",
70
+ "@dxos/react-ui": "0.8.4-main.1068cf700f",
71
+ "@dxos/react-client": "0.8.4-main.1068cf700f",
72
+ "@dxos/react-ui-form": "0.8.4-main.1068cf700f",
73
+ "@dxos/react-ui-kanban": "0.8.4-main.1068cf700f",
74
+ "@dxos/react-ui-mosaic": "0.8.4-main.1068cf700f",
75
+ "@dxos/react-ui-stack": "0.8.4-main.1068cf700f",
76
+ "@dxos/types": "0.8.4-main.1068cf700f",
77
+ "@dxos/util": "0.8.4-main.1068cf700f",
78
+ "@dxos/schema": "0.8.4-main.1068cf700f"
59
79
  },
60
80
  "devDependencies": {
61
- "@types/react": "~18.2.0",
62
- "@types/react-dom": "~18.2.0",
63
- "react": "~18.2.0",
64
- "react-dom": "~18.2.0",
65
- "vite": "5.4.7",
66
- "@dxos/plugin-preview": "0.8.3",
67
- "@dxos/plugin-theme": "0.8.3",
68
- "@dxos/react-ui": "0.8.3",
69
- "@dxos/storybook-utils": "0.8.3",
70
- "@dxos/react-ui-theme": "0.8.3",
71
- "@dxos/react-ui-syntax-highlighter": "0.8.3"
81
+ "@types/react": "~19.2.7",
82
+ "@types/react-dom": "~19.2.3",
83
+ "react": "~19.2.3",
84
+ "react-dom": "~19.2.3",
85
+ "vite": "7.1.9",
86
+ "@dxos/plugin-preview": "0.8.4-main.1068cf700f",
87
+ "@dxos/plugin-theme": "0.8.4-main.1068cf700f",
88
+ "@dxos/plugin-testing": "0.8.4-main.1068cf700f",
89
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.1068cf700f",
90
+ "@dxos/test-utils": "0.8.4-main.1068cf700f",
91
+ "@dxos/ui-theme": "0.8.4-main.1068cf700f",
92
+ "@dxos/storybook-utils": "0.8.4-main.1068cf700f"
72
93
  },
73
94
  "peerDependencies": {
74
- "effect": "^3.13.3",
75
- "react": "~18.2.0",
76
- "react-dom": "~18.2.0",
77
- "@dxos/react-ui": "0.8.3",
78
- "@dxos/react-ui-theme": "0.8.3"
95
+ "effect": "3.19.16",
96
+ "react": "~19.2.3",
97
+ "react-dom": "~19.2.3",
98
+ "@dxos/ui-theme": "0.8.4-main.1068cf700f",
99
+ "@dxos/react-ui": "0.8.4-main.1068cf700f"
79
100
  },
80
101
  "publishConfig": {
81
102
  "access": "public"
@@ -2,61 +2,45 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { createIntent, defineModule, contributes, Capabilities, Events, definePlugin } from '@dxos/app-framework';
6
- import { ClientEvents } from '@dxos/plugin-client';
7
- import { SpaceCapabilities } from '@dxos/plugin-space';
8
- import { defineObjectForm } from '@dxos/plugin-space/types';
9
- import { KanbanType, translations as kanbanTranslations } from '@dxos/react-ui-kanban';
5
+ import * as Effect from 'effect/Effect';
10
6
 
11
- import { ArtifactDefinition, IntentResolver, ReactSurface } from './capabilities';
7
+ import { Plugin } from '@dxos/app-framework';
8
+ import { AppPlugin } from '@dxos/app-toolkit';
9
+ import { Type } from '@dxos/echo';
10
+ import { type CreateObject } from '@dxos/plugin-space/types';
11
+ import { translations as kanbanTranslations } from '@dxos/react-ui-kanban';
12
+ import { Kanban } from '@dxos/react-ui-kanban/types';
13
+ import { View } from '@dxos/schema';
14
+
15
+ import { BlueprintDefinition, OperationResolver, ReactSurface } from './capabilities';
12
16
  import { meta } from './meta';
13
- import translations from './translations';
14
- import { CreateKanbanSchema, KanbanAction } from './types';
17
+ import { translations } from './translations';
18
+ import { CreateKanbanSchema } from './types';
15
19
 
16
- export const KanbanPlugin = () =>
17
- definePlugin(meta, [
18
- defineModule({
19
- id: `${meta.id}/module/translations`,
20
- activatesOn: Events.SetupTranslations,
21
- activate: () => contributes(Capabilities.Translations, [...translations, ...kanbanTranslations]),
22
- }),
23
- defineModule({
24
- id: `${meta.id}/module/metadata`,
25
- activatesOn: Events.SetupMetadata,
26
- activate: () =>
27
- contributes(Capabilities.Metadata, {
28
- id: KanbanType.typename,
29
- metadata: {
30
- icon: 'ph--kanban--regular',
31
- },
32
- }),
33
- }),
34
- defineModule({
35
- id: `${meta.id}/module/object-form`,
36
- activatesOn: ClientEvents.SetupSchema,
37
- activate: () =>
38
- contributes(
39
- SpaceCapabilities.ObjectForm,
40
- defineObjectForm({
41
- objectSchema: KanbanType,
42
- formSchema: CreateKanbanSchema,
43
- getIntent: (props, options) => createIntent(KanbanAction.Create, { ...props, space: options.space }),
44
- }),
45
- ),
46
- }),
47
- defineModule({
48
- id: `${meta.id}/module/react-surface`,
49
- activatesOn: Events.SetupReactSurface,
50
- activate: ReactSurface,
51
- }),
52
- defineModule({
53
- id: `${meta.id}/module/intent-resolver`,
54
- activatesOn: Events.SetupIntentResolver,
55
- activate: IntentResolver,
56
- }),
57
- defineModule({
58
- id: `${meta.id}/module/artifact-definition`,
59
- activatesOn: Events.SetupArtifactDefinition,
60
- activate: ArtifactDefinition,
61
- }),
62
- ]);
20
+ export const KanbanPlugin = Plugin.define(meta).pipe(
21
+ AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
22
+ AppPlugin.addMetadataModule({
23
+ metadata: {
24
+ id: Type.getTypename(Kanban.Kanban),
25
+ metadata: {
26
+ icon: 'ph--kanban--regular',
27
+ iconHue: 'green',
28
+ inputSchema: CreateKanbanSchema,
29
+ createObject: ((props, { db }) =>
30
+ Effect.promise(async () => {
31
+ const { view } = await View.makeFromDatabase({
32
+ db,
33
+ typename: props.typename,
34
+ pivotFieldName: props.initialPivotColumn,
35
+ });
36
+ return Kanban.make({ name: props.name, view });
37
+ })) satisfies CreateObject,
38
+ },
39
+ },
40
+ }),
41
+ AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
42
+ AppPlugin.addSchemaModule({ schema: [Kanban.Kanban] }),
43
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
44
+ AppPlugin.addTranslationsModule({ translations: [...translations, ...kanbanTranslations] }),
45
+ Plugin.make,
46
+ );
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * as KanbanBlueprint from './kanban-blueprint';
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Blueprint, Template } from '@dxos/blueprints';
6
+ import { type FunctionDefinition } from '@dxos/functions';
7
+ import { trim } from '@dxos/util';
8
+
9
+ export const functions: FunctionDefinition[] = [];
10
+ export const tools: string[] = [];
11
+
12
+ export const Key = 'dxos.org/blueprint/kanban';
13
+
14
+ export const make = () =>
15
+ Blueprint.make({
16
+ key: Key,
17
+ name: 'Kanban',
18
+ tools: Blueprint.toolDefinitions({ functions, tools }),
19
+ instructions: Template.make({
20
+ source: trim`
21
+ You can create and update kanban boards to show data in sorted columns defined by schema.
22
+ `,
23
+ }),
24
+ });
@@ -0,0 +1,150 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // ISSUE(burdon): defineArtifact
6
+ // @ts-nocheck
7
+
8
+ import * as Effect from 'effect/Effect';
9
+ import * as Schema from 'effect/Schema';
10
+
11
+ import { ToolResult, createTool } from '@dxos/ai';
12
+ import { Capabilities, Capability, type PromiseIntentDispatcher } from '@dxos/app-framework';
13
+ import { createArtifactElement } from '@dxos/assistant';
14
+ import { defineArtifact } from '@dxos/blueprints';
15
+ import { Obj, Query } from '@dxos/echo';
16
+ import { invariant } from '@dxos/invariant';
17
+ import { SpaceOperation } from '@dxos/plugin-space/types';
18
+ import { Filter, type Space } from '@dxos/react-client/echo';
19
+ import { Kanban, KanbanView } from '@dxos/react-ui-kanban';
20
+ import { View } from '@dxos/schema';
21
+ import { isNonNullable } from '@dxos/util';
22
+
23
+ import { meta } from '../../meta';
24
+
25
+ const QualifiedId = Schema.String.annotations({
26
+ description: 'The fully qualified ID of the kanban `spaceID:objectID`',
27
+ });
28
+
29
+ declare global {
30
+ interface ToolContextExtensions {
31
+ space?: Space;
32
+ dispatch?: PromiseIntentDispatcher;
33
+ }
34
+ }
35
+
36
+ export default Capability.makeModule(() =>
37
+ Effect.sync(() => {
38
+ const definition = defineArtifact({
39
+ id: `artifact:${meta.id}`,
40
+ name: meta.name,
41
+ instructions: `
42
+ - Before adding items to a kanban board, inspect the board to see its schema
43
+ - When adding items, you must not include the 'id' field -- it is automatically generated
44
+ - BEFORE adding items, always make sure the board has been shown to the user!
45
+ `,
46
+ schema: KanbanView,
47
+ tools: [
48
+ createTool(meta.id, {
49
+ name: 'create',
50
+ description: `
51
+ Create a new kanban board using an existing schema.
52
+ Use schema_create first to create a schema, or schema_list to choose an existing one.`,
53
+ caption: 'Creating kanban board...',
54
+ schema: Schema.Struct({
55
+ typename: Schema.String.annotations({
56
+ description: 'The fully qualified name of the record type to use for the kanban cards.',
57
+ }),
58
+ pivotColumn: Schema.optional(Schema.String).annotations({
59
+ description: 'Optional field name to use as the column pivot.',
60
+ }),
61
+ }),
62
+ execute: async ({ typename, pivotColumn }, { extensions }) => {
63
+ invariant(extensions?.space, 'No space');
64
+ invariant(extensions?.invoke, 'No operation invoker');
65
+
66
+ // Validate schema exists first
67
+ const schema = await extensions.space.db.schemaRegistry.query({ typename }).firstOrUndefined();
68
+ if (!schema) {
69
+ return ToolResult.Error(`Schema not found: ${typename}`);
70
+ }
71
+
72
+ const { view } = await View.makeFromDatabase({
73
+ db: extensions.space.db,
74
+ typename,
75
+ pivotFieldName: pivotColumn,
76
+ });
77
+ const kanban = Kanban.make({ view });
78
+
79
+ const { error } = await extensions.invoke(SpaceOperation.AddObject, {
80
+ target: extensions.space,
81
+ object: kanban,
82
+ });
83
+ if (error) {
84
+ return ToolResult.Error(error?.message ?? 'Failed to add kanban board to space');
85
+ }
86
+
87
+ return ToolResult.Success(createArtifactElement(kanban.id));
88
+ },
89
+ }),
90
+ createTool(meta.id, {
91
+ name: 'list',
92
+ description: 'List all kanban boards in the current space.',
93
+ caption: 'Listing kanban boards...',
94
+ schema: Schema.Struct({}),
95
+ execute: async (_input, { extensions }) => {
96
+ invariant(extensions?.space, 'No space');
97
+ const space = extensions.space;
98
+ const { objects } = await space.db.query(Filter.type(View.View)).run();
99
+
100
+ const boardInfo = await Promise.all(
101
+ objects.map(async (view) => {
102
+ const kanban = await view.presentation.load();
103
+ if (!Obj.instanceOf(KanbanView, kanban)) {
104
+ return null;
105
+ }
106
+
107
+ return {
108
+ id: Obj.getDXN(view).toString(),
109
+ name: view.name ?? 'Unnamed Kanban',
110
+ typename: view.query.typename,
111
+ };
112
+ }),
113
+ );
114
+
115
+ return ToolResult.Success(boardInfo.filter(isNonNullable));
116
+ },
117
+ }),
118
+ createTool(meta.id, {
119
+ name: 'inspect',
120
+ description: 'Get details about a specific kanban board.',
121
+ caption: 'Inspecting kanban board...',
122
+ schema: Schema.Struct({ id: QualifiedId }),
123
+ execute: async ({ id }, { extensions }) => {
124
+ invariant(extensions?.space, 'No space');
125
+ const space = extensions.space;
126
+ const view = (await space.db
127
+ // TODO(wittjosiah): Filter.and should aggregate type
128
+ .query(Query.select(Filter.and(Filter.type(View.View), Filter.id(id))))
129
+ .first()) as View.View;
130
+
131
+ const kanban = await view.presentation.load();
132
+ invariant(Obj.instanceOf(KanbanView, kanban));
133
+
134
+ const typename = view.query.typename;
135
+ const schema = await space.db.schemaRegistry.query({ typename }).firstOrUndefined();
136
+ invariant(schema);
137
+
138
+ return ToolResult.Success({
139
+ schema,
140
+ columnField: kanban.columnFieldId,
141
+ viewFields: view.projection.fields,
142
+ });
143
+ },
144
+ }),
145
+ ],
146
+ });
147
+
148
+ return Capability.contributes(Capabilities.ArtifactDefinition, definition);
149
+ }),
150
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ArtifactDefinition = Capability.lazy('ArtifactDefinition', () => import('./artifact-definition'));
@@ -0,0 +1,24 @@
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 } from '@dxos/app-toolkit';
9
+
10
+ import { KanbanBlueprint } from '../../blueprints';
11
+
12
+ export type BlueprintCapabilities = [
13
+ Capability.Capability<typeof AppCapabilities.Functions>,
14
+ Capability.Capability<typeof AppCapabilities.BlueprintDefinition>,
15
+ ];
16
+
17
+ const blueprintDefinition = Capability.makeModule<[], BlueprintCapabilities>(() =>
18
+ Effect.succeed([
19
+ Capability.contributes(AppCapabilities.Functions, KanbanBlueprint.functions),
20
+ Capability.contributes(AppCapabilities.BlueprintDefinition, KanbanBlueprint.make()),
21
+ ]),
22
+ );
23
+
24
+ export default blueprintDefinition;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
@@ -2,8 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
6
-
7
- export const ArtifactDefinition = lazy(() => import('./artifact-definition'));
8
- export const IntentResolver = lazy(() => import('./intent-resolver'));
9
- export const ReactSurface = lazy(() => import('./react-surface'));
5
+ export * from './blueprint-definition';
6
+ export * from './operation-resolver';
7
+ export * from './react-surface';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const OperationResolver = Capability.lazy('OperationResolver', () => import('./operation-resolver'));
@@ -0,0 +1,133 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability, UndoMapping } from '@dxos/app-framework';
8
+ import { JsonSchema, Obj } from '@dxos/echo';
9
+ import { type EchoSchema } from '@dxos/echo/internal';
10
+ import { invariant } from '@dxos/invariant';
11
+ import { OperationResolver } from '@dxos/operation';
12
+ import { ProjectionModel, createEchoChangeCallback, getTypenameFromQuery } from '@dxos/schema';
13
+
14
+ import { meta } from '../../meta';
15
+ import { KanbanOperation } from '../../types';
16
+
17
+ export default Capability.makeModule(() =>
18
+ Effect.succeed([
19
+ Capability.contributes(Capabilities.UndoMapping, [
20
+ UndoMapping.make({
21
+ operation: KanbanOperation.DeleteCardField,
22
+ inverse: KanbanOperation.RestoreCardField,
23
+ deriveContext: (input, output) => ({
24
+ view: input.view,
25
+ field: output.field,
26
+ props: output.props,
27
+ index: output.index,
28
+ }),
29
+ message: ['card field deleted label', { ns: meta.id }],
30
+ }),
31
+ UndoMapping.make({
32
+ operation: KanbanOperation.DeleteCard,
33
+ inverse: KanbanOperation.RestoreCard,
34
+ deriveContext: (_input, output) => ({
35
+ card: output.card,
36
+ }),
37
+ message: ['card deleted label', { ns: meta.id }],
38
+ }),
39
+ ]),
40
+ Capability.contributes(Capabilities.OperationResolver, [
41
+ OperationResolver.make({
42
+ operation: KanbanOperation.DeleteCardField,
43
+ handler: Effect.fnUntraced(function* ({ view, fieldId }) {
44
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
45
+ const db = Obj.getDatabase(view);
46
+ invariant(db, 'Database not found');
47
+ const schema = yield* Effect.promise(() =>
48
+ db.schemaRegistry
49
+ .query({
50
+ typename: getTypenameFromQuery(view.query.ast)!,
51
+ location: ['database', 'runtime'],
52
+ })
53
+ .first(),
54
+ );
55
+
56
+ // Create projection with change callbacks that wrap in Obj.change().
57
+ // Schema from registry is an EchoSchema at runtime.
58
+ const projection = new ProjectionModel({
59
+ registry,
60
+ view,
61
+ baseSchema: JsonSchema.toJsonSchema(schema),
62
+ change: createEchoChangeCallback(view, schema as EchoSchema),
63
+ });
64
+
65
+ const result = projection.deleteFieldProjection(fieldId);
66
+
67
+ // Return data needed for undo.
68
+ return {
69
+ field: result.deleted.field,
70
+ props: result.deleted.props,
71
+ index: result.index,
72
+ };
73
+ }),
74
+ }),
75
+ OperationResolver.make({
76
+ operation: KanbanOperation.DeleteCard,
77
+ handler: ({ card }) =>
78
+ Effect.sync(() => {
79
+ const db = Obj.getDatabase(card);
80
+ invariant(db);
81
+ db.remove(card);
82
+
83
+ // Return data needed for undo.
84
+ return { card };
85
+ }),
86
+ }),
87
+
88
+ //
89
+ // RestoreCardField (inverse of DeleteCardField)
90
+ //
91
+ OperationResolver.make({
92
+ operation: KanbanOperation.RestoreCardField,
93
+ handler: Effect.fnUntraced(function* ({ view, field, props, index }) {
94
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
95
+ const db = Obj.getDatabase(view);
96
+ invariant(db, 'Database not found');
97
+ const schema = yield* Effect.promise(() =>
98
+ db.schemaRegistry
99
+ .query({
100
+ typename: getTypenameFromQuery(view.query.ast)!,
101
+ location: ['database', 'runtime'],
102
+ })
103
+ .first(),
104
+ );
105
+
106
+ // Create projection with change callbacks that wrap in Obj.change().
107
+ // Schema from registry is an EchoSchema at runtime.
108
+ const projection = new ProjectionModel({
109
+ registry,
110
+ view,
111
+ baseSchema: JsonSchema.toJsonSchema(schema),
112
+ change: createEchoChangeCallback(view, schema as EchoSchema),
113
+ });
114
+
115
+ projection.setFieldProjection({ field, props }, index);
116
+ }),
117
+ }),
118
+
119
+ //
120
+ // RestoreCard (inverse of DeleteCard)
121
+ //
122
+ OperationResolver.make({
123
+ operation: KanbanOperation.RestoreCard,
124
+ handler: ({ card }) =>
125
+ Effect.sync(() => {
126
+ const db = Obj.getDatabase(card);
127
+ invariant(db);
128
+ db.add(card);
129
+ }),
130
+ }),
131
+ ]),
132
+ ]),
133
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));