@dxos/plugin-kanban 0.8.4-main.c1de068 → 0.8.4-main.fd6878d
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/{chunk-X44RHBZK.mjs → chunk-5BR6HNHI.mjs} +4 -4
- package/dist/lib/browser/{chunk-X44RHBZK.mjs.map → chunk-5BR6HNHI.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +4 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-E6O3LBAB.mjs → intent-resolver-65UVYRI2.mjs} +3 -3
- package/dist/lib/{node-esm/intent-resolver-LPASDELU.mjs.map → browser/intent-resolver-65UVYRI2.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-MWNNZYMN.mjs → react-surface-KX5U6PJ2.mjs} +4 -4
- package/dist/lib/{node-esm/react-surface-T52BBG45.mjs.map → browser/react-surface-KX5U6PJ2.mjs.map} +3 -3
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-6WK5CGYY.mjs → chunk-WLFZKRIJ.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-6WK5CGYY.mjs.map → chunk-WLFZKRIJ.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +4 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-LPASDELU.mjs → intent-resolver-R3MYQATZ.mjs} +3 -3
- package/dist/lib/{browser/intent-resolver-E6O3LBAB.mjs.map → node-esm/intent-resolver-R3MYQATZ.mjs.map} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-T52BBG45.mjs → react-surface-BAMERRU5.mjs} +4 -4
- package/dist/lib/{browser/react-surface-MWNNZYMN.mjs.map → node-esm/react-surface-BAMERRU5.mjs.map} +3 -3
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/KanbanPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/components/KanbanContainer.d.ts.map +1 -1
- package/dist/types/src/components/KanbanContainer.stories.d.ts +1 -1
- package/dist/types/src/components/KanbanContainer.stories.d.ts.map +1 -1
- package/dist/types/src/types/kanban.d.ts +1 -1
- package/dist/types/src/types/kanban.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -32
- package/src/KanbanPlugin.tsx +2 -7
- package/src/capabilities/artifact-definition.ts +7 -4
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/components/KanbanContainer.stories.tsx +3 -3
- package/src/components/KanbanContainer.tsx +3 -3
- package/src/components/KanbanViewEditor.tsx +1 -1
- package/src/types/kanban.ts +1 -1
- package/src/types/schema.ts +2 -2
- package/dist/lib/browser/artifact-definition-WMSZK3RW.mjs +0 -174
- package/dist/lib/browser/artifact-definition-WMSZK3RW.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-QVZXPDXK.mjs +0 -175
- package/dist/lib/node-esm/artifact-definition-QVZXPDXK.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-kanban",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fd6878d",
|
|
4
4
|
"description": "Kanban DXOS Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
18
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -35,29 +37,29 @@
|
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@preact-signals/safe-react": "^0.9.0",
|
|
37
39
|
"@preact/signals-core": "^1.9.0",
|
|
38
|
-
"effect": "3.17.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/echo": "0.8.4-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/log": "0.8.4-main.
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/plugin-
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-client": "0.8.4-main.
|
|
55
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
56
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
40
|
+
"effect": "3.17.7",
|
|
41
|
+
"@dxos/app-framework": "0.8.4-main.fd6878d",
|
|
42
|
+
"@dxos/async": "0.8.4-main.fd6878d",
|
|
43
|
+
"@dxos/blueprints": "0.8.4-main.fd6878d",
|
|
44
|
+
"@dxos/assistant": "0.8.4-main.fd6878d",
|
|
45
|
+
"@dxos/echo": "0.8.4-main.fd6878d",
|
|
46
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
47
|
+
"@dxos/effect": "0.8.4-main.fd6878d",
|
|
48
|
+
"@dxos/invariant": "0.8.4-main.fd6878d",
|
|
49
|
+
"@dxos/plugin-graph": "0.8.4-main.fd6878d",
|
|
50
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
51
|
+
"@dxos/plugin-search": "0.8.4-main.fd6878d",
|
|
52
|
+
"@dxos/plugin-client": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/plugin-space": "0.8.4-main.fd6878d",
|
|
54
|
+
"@dxos/random": "0.8.4-main.fd6878d",
|
|
55
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
56
|
+
"@dxos/react-client": "0.8.4-main.fd6878d",
|
|
57
|
+
"@dxos/react-ui-kanban": "0.8.4-main.fd6878d",
|
|
58
|
+
"@dxos/react-ui-form": "0.8.4-main.fd6878d",
|
|
59
|
+
"@dxos/react-ui-stack": "0.8.4-main.fd6878d",
|
|
60
|
+
"@dxos/schema": "0.8.4-main.fd6878d",
|
|
61
|
+
"@dxos/util": "0.8.4-main.fd6878d",
|
|
62
|
+
"@dxos/ai": "0.8.4-main.fd6878d"
|
|
61
63
|
},
|
|
62
64
|
"devDependencies": {
|
|
63
65
|
"@types/react": "~18.2.0",
|
|
@@ -65,19 +67,19 @@
|
|
|
65
67
|
"react": "~18.2.0",
|
|
66
68
|
"react-dom": "~18.2.0",
|
|
67
69
|
"vite": "5.4.7",
|
|
68
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
70
|
+
"@dxos/plugin-preview": "0.8.4-main.fd6878d",
|
|
71
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
72
|
+
"@dxos/plugin-theme": "0.8.4-main.fd6878d",
|
|
73
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.fd6878d",
|
|
74
|
+
"@dxos/test-utils": "0.8.4-main.fd6878d",
|
|
75
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d"
|
|
74
76
|
},
|
|
75
77
|
"peerDependencies": {
|
|
76
78
|
"effect": "^3.13.3",
|
|
77
79
|
"react": "~18.2.0",
|
|
78
80
|
"react-dom": "~18.2.0",
|
|
79
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
80
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
81
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
82
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
81
83
|
},
|
|
82
84
|
"publishConfig": {
|
|
83
85
|
"access": "public"
|
package/src/KanbanPlugin.tsx
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
7
7
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
8
8
|
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
9
9
|
import { KanbanView, translations as kanbanTranslations } from '@dxos/react-ui-kanban';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { IntentResolver, ReactSurface } from './capabilities';
|
|
12
12
|
import { meta } from './meta';
|
|
13
13
|
import { translations } from './translations';
|
|
14
14
|
import { CreateKanbanSchema, KanbanAction } from './types';
|
|
@@ -55,9 +55,4 @@ export const KanbanPlugin = () =>
|
|
|
55
55
|
activatesOn: Events.SetupIntentResolver,
|
|
56
56
|
activate: IntentResolver,
|
|
57
57
|
}),
|
|
58
|
-
defineModule({
|
|
59
|
-
id: `${meta.id}/module/artifact-definition`,
|
|
60
|
-
activatesOn: Events.SetupArtifactDefinition,
|
|
61
|
-
activate: ArtifactDefinition,
|
|
62
|
-
}),
|
|
63
58
|
]);
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// ISSUE(burdon): defineArtifact
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
5
8
|
import { Schema, pipe } from 'effect';
|
|
6
9
|
|
|
7
|
-
import {
|
|
8
|
-
import { Capabilities, chain, contributes, createIntent
|
|
10
|
+
import { ToolResult, createTool } from '@dxos/ai';
|
|
11
|
+
import { Capabilities, type PromiseIntentDispatcher, chain, contributes, createIntent } from '@dxos/app-framework';
|
|
9
12
|
import { createArtifactElement } from '@dxos/assistant';
|
|
10
13
|
import { defineArtifact } from '@dxos/blueprints';
|
|
11
14
|
import { Obj, Query } from '@dxos/echo';
|
|
12
15
|
import { invariant } from '@dxos/invariant';
|
|
13
16
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
14
|
-
import { Filter,
|
|
17
|
+
import { Filter, type Space, fullyQualifiedId } from '@dxos/react-client/echo';
|
|
15
18
|
import { KanbanView } from '@dxos/react-ui-kanban';
|
|
16
19
|
import { DataType } from '@dxos/schema';
|
|
17
20
|
import { isNonNullable } from '@dxos/util';
|
|
@@ -49,7 +52,7 @@ export default () => {
|
|
|
49
52
|
caption: 'Creating kanban board...',
|
|
50
53
|
schema: Schema.Struct({
|
|
51
54
|
typename: Schema.String.annotations({
|
|
52
|
-
description: 'The fully qualified
|
|
55
|
+
description: 'The fully qualified name of the record type to use for the kanban cards.',
|
|
53
56
|
}),
|
|
54
57
|
pivotColumn: Schema.optional(Schema.String).annotations({
|
|
55
58
|
description: 'Optional field name to use as the column pivot.',
|
|
@@ -4,6 +4,5 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const ArtifactDefinition = lazy(() => import('./artifact-definition'));
|
|
8
7
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
9
8
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capabilities, type PluginContext, contributes, createResolver } from '@dxos/app-framework';
|
|
6
6
|
import { invariant } from '@dxos/invariant';
|
|
7
7
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
8
8
|
import { getSpace } from '@dxos/react-client/echo';
|
|
9
9
|
import { ProjectionModel } from '@dxos/schema';
|
|
10
10
|
|
|
11
11
|
import { KANBAN_PLUGIN } from '../meta';
|
|
12
|
-
import {
|
|
12
|
+
import { KanbanAction, createKanban } from '../types';
|
|
13
13
|
|
|
14
14
|
export default (context: PluginContext) =>
|
|
15
15
|
contributes(Capabilities.IntentResolver, [
|
|
@@ -9,7 +9,7 @@ import { Capabilities, contributes, createSurface, useCapabilities } from '@dxos
|
|
|
9
9
|
import { Obj, Type } from '@dxos/echo';
|
|
10
10
|
import { findAnnotation } from '@dxos/effect';
|
|
11
11
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
12
|
-
import { getSpace, isSpace
|
|
12
|
+
import { type Space, getSpace, isSpace } from '@dxos/react-client/echo';
|
|
13
13
|
import { type InputProps, SelectInput, useFormValues } from '@dxos/react-ui-form';
|
|
14
14
|
import { KanbanView } from '@dxos/react-ui-kanban';
|
|
15
15
|
import { DataType } from '@dxos/schema';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
@@ -19,7 +19,7 @@ import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
|
19
19
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
20
20
|
import { faker } from '@dxos/random';
|
|
21
21
|
import { useClient } from '@dxos/react-client';
|
|
22
|
-
import { Filter,
|
|
22
|
+
import { Filter, useQuery, useSchema, useSpaces } from '@dxos/react-client/echo';
|
|
23
23
|
import { ViewEditor } from '@dxos/react-ui-form';
|
|
24
24
|
import { Kanban, KanbanView, useKanbanModel } from '@dxos/react-ui-kanban';
|
|
25
25
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
@@ -154,7 +154,7 @@ const meta: Meta<StoryProps> = {
|
|
|
154
154
|
ThemePlugin({ tx: defaultTx }),
|
|
155
155
|
ClientPlugin({
|
|
156
156
|
types: [DataType.Organization, DataType.Person, DataType.View, KanbanView],
|
|
157
|
-
onClientInitialized: async (
|
|
157
|
+
onClientInitialized: async ({ client }) => {
|
|
158
158
|
await client.halo.createIdentity();
|
|
159
159
|
const space = await client.spaces.create();
|
|
160
160
|
await space.waitUntilReady();
|
|
@@ -9,10 +9,10 @@ import { Filter, Obj, Type } from '@dxos/echo';
|
|
|
9
9
|
import { EchoSchema, type TypedObject } from '@dxos/echo-schema';
|
|
10
10
|
import { useGlobalFilteredObjects } from '@dxos/plugin-search';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { getSpace, useQuery } from '@dxos/react-client/echo';
|
|
13
|
+
import { Kanban, useKanbanModel } from '@dxos/react-ui-kanban';
|
|
14
14
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
15
|
-
import {
|
|
15
|
+
import { type DataType, ProjectionModel } from '@dxos/schema';
|
|
16
16
|
|
|
17
17
|
import { KanbanAction } from '../types';
|
|
18
18
|
|
|
@@ -8,7 +8,7 @@ import { Type } from '@dxos/echo';
|
|
|
8
8
|
import { EchoSchema, FormatEnum } from '@dxos/echo-schema';
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
10
|
import { getSpace, useSchema } from '@dxos/react-client/echo';
|
|
11
|
-
import { Form, SelectInput
|
|
11
|
+
import { type CustomInputMap, Form, SelectInput } from '@dxos/react-ui-form';
|
|
12
12
|
import { KanbanSettingsSchema, type KanbanView } from '@dxos/react-ui-kanban';
|
|
13
13
|
import { type DataType, ProjectionModel } from '@dxos/schema';
|
|
14
14
|
|
package/src/types/kanban.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Obj } from '@dxos/echo';
|
|
6
6
|
import { type JsonSchemaType } from '@dxos/echo-schema';
|
|
7
7
|
import { KanbanView } from '@dxos/react-ui-kanban';
|
|
8
|
-
import { type
|
|
8
|
+
import { type CreateViewFromSpaceProps, type DataType, ProjectionModel, createViewFromSpace } from '@dxos/schema';
|
|
9
9
|
|
|
10
10
|
type InitializeKanbanProps = Omit<CreateViewFromSpaceProps, 'presentation'> & {
|
|
11
11
|
initialPivotColumn?: string;
|
package/src/types/schema.ts
CHANGED
|
@@ -25,8 +25,8 @@ export const CreateKanbanSchema = Schema.Struct({
|
|
|
25
25
|
name: Schema.optional(Schema.String),
|
|
26
26
|
typename: Schema.optional(
|
|
27
27
|
Schema.String.annotations({
|
|
28
|
-
[TypenameAnnotationId]: ['
|
|
29
|
-
title: 'Select card
|
|
28
|
+
[TypenameAnnotationId]: ['used-static', 'dynamic'],
|
|
29
|
+
title: 'Select card record type (leave empty to start fresh)',
|
|
30
30
|
}),
|
|
31
31
|
),
|
|
32
32
|
initialPivotColumn: Schema.optional(
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
KanbanAction,
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-X44RHBZK.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/artifact-definition.ts
|
|
7
|
-
import { Schema, pipe } from "effect";
|
|
8
|
-
import { createTool, ToolResult } from "@dxos/ai";
|
|
9
|
-
import { Capabilities, chain, contributes, createIntent } from "@dxos/app-framework";
|
|
10
|
-
import { createArtifactElement } from "@dxos/assistant";
|
|
11
|
-
import { defineArtifact } from "@dxos/blueprints";
|
|
12
|
-
import { Obj, Query } from "@dxos/echo";
|
|
13
|
-
import { invariant } from "@dxos/invariant";
|
|
14
|
-
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
15
|
-
import { Filter, fullyQualifiedId } from "@dxos/react-client/echo";
|
|
16
|
-
import { KanbanView } from "@dxos/react-ui-kanban";
|
|
17
|
-
import { DataType } from "@dxos/schema";
|
|
18
|
-
import { isNonNullable } from "@dxos/util";
|
|
19
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-kanban/src/capabilities/artifact-definition.ts";
|
|
20
|
-
var QualifiedId = Schema.String.annotations({
|
|
21
|
-
description: "The fully qualified ID of the kanban `spaceID:objectID`"
|
|
22
|
-
});
|
|
23
|
-
var artifact_definition_default = () => {
|
|
24
|
-
const definition = defineArtifact({
|
|
25
|
-
id: `artifact:${meta.id}`,
|
|
26
|
-
name: meta.name,
|
|
27
|
-
instructions: `
|
|
28
|
-
- Before adding items to a kanban board, inspect the board to see its schema
|
|
29
|
-
- When adding items, you must not include the 'id' field -- it is automatically generated
|
|
30
|
-
- BEFORE adding items, always make sure the board has been shown to the user!
|
|
31
|
-
`,
|
|
32
|
-
schema: KanbanView,
|
|
33
|
-
tools: [
|
|
34
|
-
createTool(meta.id, {
|
|
35
|
-
name: "create",
|
|
36
|
-
description: `
|
|
37
|
-
Create a new kanban board using an existing schema.
|
|
38
|
-
Use schema_create first to create a schema, or schema_list to choose an existing one.`,
|
|
39
|
-
caption: "Creating kanban board...",
|
|
40
|
-
schema: Schema.Struct({
|
|
41
|
-
typename: Schema.String.annotations({
|
|
42
|
-
description: "The fully qualified typename of the schema to use for the kanban cards."
|
|
43
|
-
}),
|
|
44
|
-
pivotColumn: Schema.optional(Schema.String).annotations({
|
|
45
|
-
description: "Optional field name to use as the column pivot."
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
execute: async ({ typename, pivotColumn }, { extensions }) => {
|
|
49
|
-
invariant(extensions?.space, "No space", {
|
|
50
|
-
F: __dxlog_file,
|
|
51
|
-
L: 59,
|
|
52
|
-
S: void 0,
|
|
53
|
-
A: [
|
|
54
|
-
"extensions?.space",
|
|
55
|
-
"'No space'"
|
|
56
|
-
]
|
|
57
|
-
});
|
|
58
|
-
invariant(extensions?.dispatch, "No intent dispatcher", {
|
|
59
|
-
F: __dxlog_file,
|
|
60
|
-
L: 60,
|
|
61
|
-
S: void 0,
|
|
62
|
-
A: [
|
|
63
|
-
"extensions?.dispatch",
|
|
64
|
-
"'No intent dispatcher'"
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
const schema = await extensions.space.db.schemaRegistry.query({
|
|
68
|
-
typename
|
|
69
|
-
}).firstOrUndefined();
|
|
70
|
-
if (!schema) {
|
|
71
|
-
return ToolResult.Error(`Schema not found: ${typename}`);
|
|
72
|
-
}
|
|
73
|
-
const intent = pipe(createIntent(KanbanAction.Create, {
|
|
74
|
-
space: extensions.space,
|
|
75
|
-
typename,
|
|
76
|
-
initialPivotColumn: pivotColumn
|
|
77
|
-
}), chain(SpaceAction.AddObject, {
|
|
78
|
-
target: extensions.space
|
|
79
|
-
}));
|
|
80
|
-
const { data, error } = await extensions.dispatch(intent);
|
|
81
|
-
if (!data || error) {
|
|
82
|
-
return ToolResult.Error(error?.message ?? "Failed to create kanban board");
|
|
83
|
-
}
|
|
84
|
-
return ToolResult.Success(createArtifactElement(data.id));
|
|
85
|
-
}
|
|
86
|
-
}),
|
|
87
|
-
createTool(meta.id, {
|
|
88
|
-
name: "list",
|
|
89
|
-
description: "List all kanban boards in the current space.",
|
|
90
|
-
caption: "Listing kanban boards...",
|
|
91
|
-
schema: Schema.Struct({}),
|
|
92
|
-
execute: async (_input, { extensions }) => {
|
|
93
|
-
invariant(extensions?.space, "No space", {
|
|
94
|
-
F: __dxlog_file,
|
|
95
|
-
L: 91,
|
|
96
|
-
S: void 0,
|
|
97
|
-
A: [
|
|
98
|
-
"extensions?.space",
|
|
99
|
-
"'No space'"
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
const space = extensions.space;
|
|
103
|
-
const { objects } = await space.db.query(Filter.type(DataType.View)).run();
|
|
104
|
-
const boardInfo = await Promise.all(objects.map(async (view) => {
|
|
105
|
-
const kanban = await view.presentation.load();
|
|
106
|
-
if (!Obj.instanceOf(KanbanView, kanban)) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
id: fullyQualifiedId(view),
|
|
111
|
-
name: view.name ?? "Unnamed Kanban",
|
|
112
|
-
typename: view.query.typename
|
|
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({
|
|
123
|
-
id: QualifiedId
|
|
124
|
-
}),
|
|
125
|
-
execute: async ({ id }, { extensions }) => {
|
|
126
|
-
invariant(extensions?.space, "No space", {
|
|
127
|
-
F: __dxlog_file,
|
|
128
|
-
L: 119,
|
|
129
|
-
S: void 0,
|
|
130
|
-
A: [
|
|
131
|
-
"extensions?.space",
|
|
132
|
-
"'No space'"
|
|
133
|
-
]
|
|
134
|
-
});
|
|
135
|
-
const space = extensions.space;
|
|
136
|
-
const view = await space.db.query(Query.select(Filter.and(Filter.type(DataType.View), Filter.ids(id)))).first();
|
|
137
|
-
const kanban = await view.presentation.load();
|
|
138
|
-
invariant(Obj.instanceOf(KanbanView, kanban), void 0, {
|
|
139
|
-
F: __dxlog_file,
|
|
140
|
-
L: 127,
|
|
141
|
-
S: void 0,
|
|
142
|
-
A: [
|
|
143
|
-
"Obj.instanceOf(KanbanView, kanban)",
|
|
144
|
-
""
|
|
145
|
-
]
|
|
146
|
-
});
|
|
147
|
-
const typename = view.query.typename;
|
|
148
|
-
const schema = await space.db.schemaRegistry.query({
|
|
149
|
-
typename
|
|
150
|
-
}).firstOrUndefined();
|
|
151
|
-
invariant(schema, void 0, {
|
|
152
|
-
F: __dxlog_file,
|
|
153
|
-
L: 131,
|
|
154
|
-
S: void 0,
|
|
155
|
-
A: [
|
|
156
|
-
"schema",
|
|
157
|
-
""
|
|
158
|
-
]
|
|
159
|
-
});
|
|
160
|
-
return ToolResult.Success({
|
|
161
|
-
schema,
|
|
162
|
-
columnField: kanban.columnFieldId,
|
|
163
|
-
viewFields: view.projection.fields
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
]
|
|
168
|
-
});
|
|
169
|
-
return contributes(Capabilities.ArtifactDefinition, definition);
|
|
170
|
-
};
|
|
171
|
-
export {
|
|
172
|
-
artifact_definition_default as default
|
|
173
|
-
};
|
|
174
|
-
//# sourceMappingURL=artifact-definition-WMSZK3RW.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/artifact-definition.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema, pipe } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { defineArtifact } from '@dxos/blueprints';\nimport { Obj, Query } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, fullyQualifiedId, type Space } from '@dxos/react-client/echo';\nimport { KanbanView } from '@dxos/react-ui-kanban';\nimport { DataType } from '@dxos/schema';\nimport { isNonNullable } from '@dxos/util';\n\nimport { meta } from '../meta';\nimport { KanbanAction } from '../types';\n\nconst QualifiedId = Schema.String.annotations({\n description: 'The fully qualified ID of the kanban `spaceID:objectID`',\n});\n\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: `artifact:${meta.id}`,\n name: meta.name,\n instructions: `\n - Before adding items to a kanban board, inspect the board to see its schema\n - When adding items, you must not include the 'id' field -- it is automatically generated\n - BEFORE adding items, always make sure the board has been shown to the user!\n `,\n schema: KanbanView,\n tools: [\n createTool(meta.id, {\n name: 'create',\n description: `\n Create a new kanban board using an existing schema.\n Use schema_create first to create a schema, or schema_list to choose an existing one.`,\n caption: 'Creating kanban board...',\n schema: Schema.Struct({\n typename: Schema.String.annotations({\n description: 'The fully qualified typename of the schema to use for the kanban cards.',\n }),\n pivotColumn: Schema.optional(Schema.String).annotations({\n description: 'Optional field name to use as the column pivot.',\n }),\n }),\n execute: async ({ typename, pivotColumn }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n\n // Validate schema exists first\n const schema = await extensions.space.db.schemaRegistry.query({ typename }).firstOrUndefined();\n if (!schema) {\n return ToolResult.Error(`Schema not found: ${typename}`);\n }\n\n const intent = pipe(\n createIntent(KanbanAction.Create, {\n space: extensions.space,\n typename,\n initialPivotColumn: pivotColumn,\n }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create kanban board');\n }\n\n return ToolResult.Success(createArtifactElement(data.id));\n },\n }),\n createTool(meta.id, {\n name: 'list',\n description: 'List all kanban boards in the current space.',\n caption: 'Listing kanban boards...',\n schema: Schema.Struct({}),\n execute: async (_input, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const space = extensions.space;\n const { objects } = await space.db.query(Filter.type(DataType.View)).run();\n\n const boardInfo = await Promise.all(\n objects.map(async (view) => {\n const kanban = await view.presentation.load();\n if (!Obj.instanceOf(KanbanView, kanban)) {\n return null;\n }\n\n return {\n id: fullyQualifiedId(view),\n name: view.name ?? 'Unnamed Kanban',\n typename: view.query.typename,\n };\n }),\n );\n\n return ToolResult.Success(boardInfo.filter(isNonNullable));\n },\n }),\n createTool(meta.id, {\n name: 'inspect',\n description: 'Get details about a specific kanban board.',\n caption: 'Inspecting kanban board...',\n schema: Schema.Struct({ id: QualifiedId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const space = extensions.space;\n const view = (await space.db\n // TODO(wittjosiah): Filter.and should aggregate type\n .query(Query.select(Filter.and(Filter.type(DataType.View), Filter.ids(id))))\n .first()) as DataType.View;\n\n const kanban = await view.presentation.load();\n invariant(Obj.instanceOf(KanbanView, kanban));\n\n const typename = view.query.typename;\n const schema = await space.db.schemaRegistry.query({ typename }).firstOrUndefined();\n invariant(schema);\n\n return ToolResult.Success({\n schema,\n columnField: kanban.columnFieldId,\n viewFields: view.projection.fields,\n });\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Schema", "pipe", "createTool", "ToolResult", "Capabilities", "chain", "contributes", "createIntent", "createArtifactElement", "defineArtifact", "Obj", "Query", "invariant", "SpaceAction", "Filter", "fullyQualifiedId", "KanbanView", "DataType", "isNonNullable", "QualifiedId", "Schema", "String", "annotations", "description", "definition", "defineArtifact", "id", "meta", "name", "instructions", "schema", "KanbanView", "tools", "createTool", "caption", "Struct", "typename", "pivotColumn", "optional", "execute", "extensions", "invariant", "space", "dispatch", "db", "schemaRegistry", "query", "firstOrUndefined", "ToolResult", "Error", "intent", "pipe", "createIntent", "KanbanAction", "Create", "initialPivotColumn", "chain", "SpaceAction", "AddObject", "target", "data", "error", "message", "Success", "createArtifactElement", "_input", "objects", "Filter", "type", "DataType", "View", "run", "boardInfo", "Promise", "all", "map", "view", "kanban", "presentation", "load", "Obj", "instanceOf", "fullyQualifiedId", "filter", "isNonNullable", "Query", "select", "and", "ids", "first", "columnField", "columnFieldId", "viewFields", "projection", "fields", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
-
}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
KanbanAction,
|
|
4
|
-
meta
|
|
5
|
-
} from "./chunk-6WK5CGYY.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/artifact-definition.ts
|
|
8
|
-
import { Schema, pipe } from "effect";
|
|
9
|
-
import { createTool, ToolResult } from "@dxos/ai";
|
|
10
|
-
import { Capabilities, chain, contributes, createIntent } from "@dxos/app-framework";
|
|
11
|
-
import { createArtifactElement } from "@dxos/assistant";
|
|
12
|
-
import { defineArtifact } from "@dxos/blueprints";
|
|
13
|
-
import { Obj, Query } from "@dxos/echo";
|
|
14
|
-
import { invariant } from "@dxos/invariant";
|
|
15
|
-
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
16
|
-
import { Filter, fullyQualifiedId } from "@dxos/react-client/echo";
|
|
17
|
-
import { KanbanView } from "@dxos/react-ui-kanban";
|
|
18
|
-
import { DataType } from "@dxos/schema";
|
|
19
|
-
import { isNonNullable } from "@dxos/util";
|
|
20
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-kanban/src/capabilities/artifact-definition.ts";
|
|
21
|
-
var QualifiedId = Schema.String.annotations({
|
|
22
|
-
description: "The fully qualified ID of the kanban `spaceID:objectID`"
|
|
23
|
-
});
|
|
24
|
-
var artifact_definition_default = () => {
|
|
25
|
-
const definition = defineArtifact({
|
|
26
|
-
id: `artifact:${meta.id}`,
|
|
27
|
-
name: meta.name,
|
|
28
|
-
instructions: `
|
|
29
|
-
- Before adding items to a kanban board, inspect the board to see its schema
|
|
30
|
-
- When adding items, you must not include the 'id' field -- it is automatically generated
|
|
31
|
-
- BEFORE adding items, always make sure the board has been shown to the user!
|
|
32
|
-
`,
|
|
33
|
-
schema: KanbanView,
|
|
34
|
-
tools: [
|
|
35
|
-
createTool(meta.id, {
|
|
36
|
-
name: "create",
|
|
37
|
-
description: `
|
|
38
|
-
Create a new kanban board using an existing schema.
|
|
39
|
-
Use schema_create first to create a schema, or schema_list to choose an existing one.`,
|
|
40
|
-
caption: "Creating kanban board...",
|
|
41
|
-
schema: Schema.Struct({
|
|
42
|
-
typename: Schema.String.annotations({
|
|
43
|
-
description: "The fully qualified typename of the schema to use for the kanban cards."
|
|
44
|
-
}),
|
|
45
|
-
pivotColumn: Schema.optional(Schema.String).annotations({
|
|
46
|
-
description: "Optional field name to use as the column pivot."
|
|
47
|
-
})
|
|
48
|
-
}),
|
|
49
|
-
execute: async ({ typename, pivotColumn }, { extensions }) => {
|
|
50
|
-
invariant(extensions?.space, "No space", {
|
|
51
|
-
F: __dxlog_file,
|
|
52
|
-
L: 59,
|
|
53
|
-
S: void 0,
|
|
54
|
-
A: [
|
|
55
|
-
"extensions?.space",
|
|
56
|
-
"'No space'"
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
|
-
invariant(extensions?.dispatch, "No intent dispatcher", {
|
|
60
|
-
F: __dxlog_file,
|
|
61
|
-
L: 60,
|
|
62
|
-
S: void 0,
|
|
63
|
-
A: [
|
|
64
|
-
"extensions?.dispatch",
|
|
65
|
-
"'No intent dispatcher'"
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
const schema = await extensions.space.db.schemaRegistry.query({
|
|
69
|
-
typename
|
|
70
|
-
}).firstOrUndefined();
|
|
71
|
-
if (!schema) {
|
|
72
|
-
return ToolResult.Error(`Schema not found: ${typename}`);
|
|
73
|
-
}
|
|
74
|
-
const intent = pipe(createIntent(KanbanAction.Create, {
|
|
75
|
-
space: extensions.space,
|
|
76
|
-
typename,
|
|
77
|
-
initialPivotColumn: pivotColumn
|
|
78
|
-
}), chain(SpaceAction.AddObject, {
|
|
79
|
-
target: extensions.space
|
|
80
|
-
}));
|
|
81
|
-
const { data, error } = await extensions.dispatch(intent);
|
|
82
|
-
if (!data || error) {
|
|
83
|
-
return ToolResult.Error(error?.message ?? "Failed to create kanban board");
|
|
84
|
-
}
|
|
85
|
-
return ToolResult.Success(createArtifactElement(data.id));
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
createTool(meta.id, {
|
|
89
|
-
name: "list",
|
|
90
|
-
description: "List all kanban boards in the current space.",
|
|
91
|
-
caption: "Listing kanban boards...",
|
|
92
|
-
schema: Schema.Struct({}),
|
|
93
|
-
execute: async (_input, { extensions }) => {
|
|
94
|
-
invariant(extensions?.space, "No space", {
|
|
95
|
-
F: __dxlog_file,
|
|
96
|
-
L: 91,
|
|
97
|
-
S: void 0,
|
|
98
|
-
A: [
|
|
99
|
-
"extensions?.space",
|
|
100
|
-
"'No space'"
|
|
101
|
-
]
|
|
102
|
-
});
|
|
103
|
-
const space = extensions.space;
|
|
104
|
-
const { objects } = await space.db.query(Filter.type(DataType.View)).run();
|
|
105
|
-
const boardInfo = await Promise.all(objects.map(async (view) => {
|
|
106
|
-
const kanban = await view.presentation.load();
|
|
107
|
-
if (!Obj.instanceOf(KanbanView, kanban)) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
id: fullyQualifiedId(view),
|
|
112
|
-
name: view.name ?? "Unnamed Kanban",
|
|
113
|
-
typename: view.query.typename
|
|
114
|
-
};
|
|
115
|
-
}));
|
|
116
|
-
return ToolResult.Success(boardInfo.filter(isNonNullable));
|
|
117
|
-
}
|
|
118
|
-
}),
|
|
119
|
-
createTool(meta.id, {
|
|
120
|
-
name: "inspect",
|
|
121
|
-
description: "Get details about a specific kanban board.",
|
|
122
|
-
caption: "Inspecting kanban board...",
|
|
123
|
-
schema: Schema.Struct({
|
|
124
|
-
id: QualifiedId
|
|
125
|
-
}),
|
|
126
|
-
execute: async ({ id }, { extensions }) => {
|
|
127
|
-
invariant(extensions?.space, "No space", {
|
|
128
|
-
F: __dxlog_file,
|
|
129
|
-
L: 119,
|
|
130
|
-
S: void 0,
|
|
131
|
-
A: [
|
|
132
|
-
"extensions?.space",
|
|
133
|
-
"'No space'"
|
|
134
|
-
]
|
|
135
|
-
});
|
|
136
|
-
const space = extensions.space;
|
|
137
|
-
const view = await space.db.query(Query.select(Filter.and(Filter.type(DataType.View), Filter.ids(id)))).first();
|
|
138
|
-
const kanban = await view.presentation.load();
|
|
139
|
-
invariant(Obj.instanceOf(KanbanView, kanban), void 0, {
|
|
140
|
-
F: __dxlog_file,
|
|
141
|
-
L: 127,
|
|
142
|
-
S: void 0,
|
|
143
|
-
A: [
|
|
144
|
-
"Obj.instanceOf(KanbanView, kanban)",
|
|
145
|
-
""
|
|
146
|
-
]
|
|
147
|
-
});
|
|
148
|
-
const typename = view.query.typename;
|
|
149
|
-
const schema = await space.db.schemaRegistry.query({
|
|
150
|
-
typename
|
|
151
|
-
}).firstOrUndefined();
|
|
152
|
-
invariant(schema, void 0, {
|
|
153
|
-
F: __dxlog_file,
|
|
154
|
-
L: 131,
|
|
155
|
-
S: void 0,
|
|
156
|
-
A: [
|
|
157
|
-
"schema",
|
|
158
|
-
""
|
|
159
|
-
]
|
|
160
|
-
});
|
|
161
|
-
return ToolResult.Success({
|
|
162
|
-
schema,
|
|
163
|
-
columnField: kanban.columnFieldId,
|
|
164
|
-
viewFields: view.projection.fields
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
return contributes(Capabilities.ArtifactDefinition, definition);
|
|
171
|
-
};
|
|
172
|
-
export {
|
|
173
|
-
artifact_definition_default as default
|
|
174
|
-
};
|
|
175
|
-
//# sourceMappingURL=artifact-definition-QVZXPDXK.mjs.map
|