@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.
- package/dist/lib/browser/blueprint-definition-GGL6Y5GN.mjs +18 -0
- package/dist/lib/browser/blueprint-definition-GGL6Y5GN.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-L6N4ZDZ7.mjs +35 -0
- package/dist/lib/browser/chunk-L6N4ZDZ7.mjs.map +7 -0
- package/dist/lib/browser/chunk-XYQO4VL7.mjs +150 -0
- package/dist/lib/browser/chunk-XYQO4VL7.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +66 -72
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-RFQU4VAB.mjs +162 -0
- package/dist/lib/browser/operation-resolver-RFQU4VAB.mjs.map +7 -0
- package/dist/lib/browser/react-surface-FZQDOE3J.mjs +237 -0
- package/dist/lib/browser/react-surface-FZQDOE3J.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +14 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-AMIOYZSF.mjs +19 -0
- package/dist/lib/node-esm/blueprint-definition-AMIOYZSF.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NN6JMKIT.mjs +152 -0
- package/dist/lib/node-esm/chunk-NN6JMKIT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZHRMUKTF.mjs +36 -0
- package/dist/lib/node-esm/chunk-ZHRMUKTF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +66 -72
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-J4JUSY74.mjs +163 -0
- package/dist/lib/node-esm/operation-resolver-J4JUSY74.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-KOQ56TL6.mjs +238 -0
- package/dist/lib/node-esm/react-surface-KOQ56TL6.mjs.map +7 -0
- package/dist/lib/node-esm/{types.mjs → types/index.mjs} +7 -6
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/KanbanPlugin.d.ts +2 -1
- package/dist/types/src/KanbanPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/kanban-blueprint.d.ts +22 -0
- package/dist/types/src/blueprints/kanban-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +10 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/KanbanContainer.d.ts +4 -5
- package/dist/types/src/components/KanbanContainer.d.ts.map +1 -1
- package/dist/types/src/components/KanbanContainer.stories.d.ts +71 -6
- package/dist/types/src/components/KanbanContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/KanbanViewEditor.d.ts +3 -3
- package/dist/types/src/components/KanbanViewEditor.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +36 -53
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +122 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +4 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -44
- package/src/KanbanPlugin.tsx +39 -55
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/kanban-blueprint.ts +24 -0
- package/src/capabilities/artifact-definition/artifact-definition.ts +150 -0
- package/src/capabilities/artifact-definition/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +3 -5
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +133 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +87 -0
- package/src/components/KanbanContainer.stories.tsx +212 -118
- package/src/components/KanbanContainer.tsx +38 -46
- package/src/components/KanbanViewEditor.tsx +34 -79
- package/src/index.ts +2 -1
- package/src/meta.ts +9 -7
- package/src/translations.ts +10 -10
- package/src/types/index.ts +6 -0
- package/src/types/schema.ts +120 -0
- package/src/types/types.ts +7 -0
- package/dist/lib/browser/artifact-definition-6HNQFL2M.mjs +0 -178
- package/dist/lib/browser/artifact-definition-6HNQFL2M.mjs.map +0 -7
- package/dist/lib/browser/chunk-6JEDX6HA.mjs +0 -85
- package/dist/lib/browser/chunk-6JEDX6HA.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-QQOH5EV2.mjs +0 -297
- package/dist/lib/browser/intent-resolver-QQOH5EV2.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HJL2JRJP.mjs +0 -305
- package/dist/lib/browser/react-surface-HJL2JRJP.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -13
- package/dist/lib/node/artifact-definition-GRCAYCVG.cjs +0 -193
- package/dist/lib/node/artifact-definition-GRCAYCVG.cjs.map +0 -7
- package/dist/lib/node/chunk-ATDUVDIE.cjs +0 -108
- package/dist/lib/node/chunk-ATDUVDIE.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -128
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-6ZNOIHKY.cjs +0 -308
- package/dist/lib/node/intent-resolver-6ZNOIHKY.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-G2J6F7U5.cjs +0 -322
- package/dist/lib/node/react-surface-G2J6F7U5.cjs.map +0 -7
- package/dist/lib/node/types.cjs +0 -35
- package/dist/lib/node/types.cjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-FA2IAAUQ.mjs +0 -179
- package/dist/lib/node-esm/artifact-definition-FA2IAAUQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7DHZSNGQ.mjs +0 -87
- package/dist/lib/node-esm/chunk-7DHZSNGQ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4TYFDM4E.mjs +0 -298
- package/dist/lib/node-esm/intent-resolver-4TYFDM4E.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-257WTPQZ.mjs +0 -306
- package/dist/lib/node-esm/react-surface-257WTPQZ.mjs.map +0 -7
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -3
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/initialize-kanban.d.ts +0 -17
- package/dist/types/src/testing/initialize-kanban.d.ts.map +0 -1
- package/dist/types/src/testing/kanban-manager.d.ts +0 -7
- package/dist/types/src/testing/kanban-manager.d.ts.map +0 -1
- package/dist/types/src/testing/playwright/smoke.spec.d.ts +0 -2
- package/dist/types/src/testing/playwright/smoke.spec.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -76
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/artifact-definition.ts +0 -136
- package/src/capabilities/intent-resolver.ts +0 -71
- package/src/capabilities/react-surface.tsx +0 -81
- package/src/testing/index.ts +0 -6
- package/src/testing/initialize-kanban.ts +0 -128
- package/src/testing/kanban-manager.ts +0 -13
- package/src/testing/playwright/playwright.config.cts +0 -18
- package/src/testing/playwright/smoke.spec.ts +0 -7
- package/src/types.ts +0 -95
- /package/dist/lib/browser/{types.mjs.map → blueprints/index.mjs.map} +0 -0
- /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
|
+
"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
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/invariant": "0.8.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/plugin-graph": "0.8.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/plugin-space": "0.8.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/react-ui
|
|
56
|
-
"@dxos/react-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
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": "~
|
|
62
|
-
"@types/react-dom": "~
|
|
63
|
-
"react": "~
|
|
64
|
-
"react-dom": "~
|
|
65
|
-
"vite": "
|
|
66
|
-
"@dxos/plugin-preview": "0.8.
|
|
67
|
-
"@dxos/plugin-theme": "0.8.
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
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": "
|
|
75
|
-
"react": "~
|
|
76
|
-
"react-dom": "~
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/react-ui
|
|
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"
|
package/src/KanbanPlugin.tsx
CHANGED
|
@@ -2,61 +2,45 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
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 {
|
|
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
|
|
17
|
+
import { translations } from './translations';
|
|
18
|
+
import { CreateKanbanSchema } from './types';
|
|
15
19
|
|
|
16
|
-
export const KanbanPlugin = ()
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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,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,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;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
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,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
|
+
);
|