@digo-org/digo-api 1.0.34 → 1.0.35

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@digo-org/digo-api",
3
3
  "private": false,
4
- "version": "1.0.34",
4
+ "version": "1.0.35",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
7
7
  "types": "src/index.ts",
@@ -1,6 +1,5 @@
1
1
  {
2
- "type": "DATA_ASSET_DEFINITION",
3
- "value": {
2
+ "DATA_ASSET_DEFINITION": {
4
3
  "timeArray": [],
5
4
  "columns": [
6
5
  {
@@ -1,6 +1,5 @@
1
1
  {
2
- "type": "LINKS",
3
- "value": {
2
+ "LINKS": {
4
3
  "bar-color": "color-1",
5
4
  "bar-value": "number-1"
6
5
  }
@@ -0,0 +1,90 @@
1
+ {
2
+ "DATA_ASSET_DEFINITION": {
3
+ "timeArray": [],
4
+ "columns": [
5
+ {
6
+ "id": "gdp_2024",
7
+ "name": "GDP 2024 (Trillions USD)",
8
+ "type": "NUMBER",
9
+ "definition": {
10
+ "defaultValue": 0,
11
+ "min": 0,
12
+ "units": "Trillions USD",
13
+ "decimals": 2
14
+ }
15
+ }
16
+ ],
17
+ "rows": [
18
+ {
19
+ "id": "usa",
20
+ "name": "United States",
21
+ "hidden": false,
22
+ "gdp_2024": 30.34
23
+ },
24
+ {
25
+ "id": "china",
26
+ "name": "China",
27
+ "hidden": false,
28
+ "gdp_2024": 19.53
29
+ },
30
+ {
31
+ "id": "germany",
32
+ "name": "Germany",
33
+ "hidden": false,
34
+ "gdp_2024": 4.92
35
+ },
36
+ {
37
+ "id": "japan",
38
+ "name": "Japan",
39
+ "hidden": false,
40
+ "gdp_2024": 4.39
41
+ },
42
+ {
43
+ "id": "india",
44
+ "name": "India",
45
+ "hidden": false,
46
+ "gdp_2024": 4.27
47
+ },
48
+ {
49
+ "id": "united_kingdom",
50
+ "name": "United Kingdom",
51
+ "hidden": false,
52
+ "gdp_2024": 3.73
53
+ },
54
+ {
55
+ "id": "france",
56
+ "name": "France",
57
+ "hidden": false,
58
+ "gdp_2024": 3.28
59
+ },
60
+ {
61
+ "id": "italy",
62
+ "name": "Italy",
63
+ "hidden": false,
64
+ "gdp_2024": 2.46
65
+ },
66
+ {
67
+ "id": "brazil",
68
+ "name": "Brazil",
69
+ "hidden": false,
70
+ "gdp_2024": 2.31
71
+ },
72
+ {
73
+ "id": "canada",
74
+ "name": "Canada",
75
+ "hidden": false,
76
+ "gdp_2024": 2.33
77
+ }
78
+ ]
79
+ },
80
+ "LINKS": {
81
+ "bar-color": "color-1",
82
+ "bar-value": "number-1"
83
+ },
84
+ "VIZ_ASSET_FILES": {
85
+ "/asset.tsx": "import { DigoAsset } from '@digo-org/digo-api';\n\nimport { ResponsiveContainer, Cell, BarChart, CartesianGrid, XAxis, YAxis, Legend, Bar, Rectangle, Tooltip } from 'recharts';\n\nexport class Asset extends DigoAsset {\n constructor() {\n super();\n }\n\n override render() {\n return (\n <ResponsiveContainer width=\"100%\" height=\"100%\" key=\"responsive-container\">\n <BarChart\n data={this.instances}\n layout=\"horizontal\"\n margin={{\n top: 120,\n right: 60,\n left: 40,\n bottom: 120,\n }}\n style={{ backgroundColor: this.globalParameters['bg-color'] as string }}\n\n >\n <CartesianGrid strokeDasharray=\"3 3\" />\n\n <XAxis dataKey=\"id\" />\n\n <YAxis />\n\n <Legend />\n\n <Tooltip />\n\n <Bar\n dataKey=\"bar-value\"\n fill=\"#ff\"\n animationEasing=\"ease-in-out\"\n animationDuration={200}\n activeBar={<Rectangle fill=\"pink\" stroke=\"blue\" />}\n >\n {this.instances?.map((instance, index) => {\n const color = instance['bar-color'];\n return <Cell key={`cell-${index}`} fill={color as string} />;\n })}\n </Bar>\n\n </BarChart>\n </ResponsiveContainer>\n );\n }\n}\n",
86
+ "/styles.css": "body {\n font-family: sans-serif;\n -webkit-font-smoothing: auto;\n -moz-font-smoothing: auto;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-smooth: always;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\n.root {\n height: 100vh;\n background-color: 'red';\n display: grid;\n}",
87
+ "/package.json": "{\n \"dependencies\": {\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\",\n \"react-scripts\": \"^5.0.0\",\n \"@digo-org/digo-api\": \"1.0.28\",\n \"@react-three/drei\": \"^10.0.6\",\n \"@react-three/fiber\": \"^9.1.2\",\n \"recharts\": \"^2.15.1\"\n },\n \"main\": \"/index.tsx\",\n \"devDependencies\": {}\n}",
88
+ "/definition.json": "[\n {\n \"id\": \"bg-color\",\n \"group\": \"\",\n \"isGlobal\": true,\n \"properties\": {\n \"name\": \"Background Color\",\n \"type\": 2,\n \"definition\": {\n \"defaultValue\": \"#000\"\n }\n }\n },\n {\n \"id\": \"bar-value\",\n \"group\": \"\",\n \"isGlobal\": false,\n \"properties\": {\n \"name\": \"Value\",\n \"type\": 0,\n \"definition\": {\n \"defaultValue\": 50,\n \"min\": 0,\n \"max\": 100,\n \"icon\": \"icon-[material-symbols--percent-rounded]\",\n \"decimals\": 0,\n \"step\": 1,\n \"units\": \"\"\n }\n }\n },\n {\n \"id\": \"bar-color\",\n \"group\": \"\",\n \"isGlobal\": false,\n \"properties\": {\n \"name\": \"Bar Color\",\n \"type\": 2,\n \"definition\": {\n \"defaultValue\": \"#ffffff\"\n }\n }\n }\n]"
89
+ }
90
+ }
@@ -1,6 +1,5 @@
1
1
  {
2
- "type": "VIZ_FILES",
3
- "value": {
2
+ "VIZ_FILES": {
4
3
  "/asset.tsx": "import { DigoAsset } from '@digo-org/digo-api';\n\nimport { ResponsiveContainer, Cell, BarChart, CartesianGrid, XAxis, YAxis, Legend, Bar, Rectangle, Tooltip } from 'recharts';\n\nexport class Asset extends DigoAsset {\n constructor() {\n super();\n }\n\n override render() {\n return (\n <ResponsiveContainer width=\"100%\" height=\"100%\" key=\"responsive-container\">\n <BarChart\n data={this.instances}\n layout=\"horizontal\"\n margin={{\n top: 120,\n right: 60,\n left: 40,\n bottom: 120,\n }}\n style={{ backgroundColor: this.globalParameters['bg-color'] as string }}\n\n >\n <CartesianGrid strokeDasharray=\"3 3\" />\n\n <XAxis dataKey=\"id\" />\n\n <YAxis />\n\n <Legend />\n\n <Tooltip />\n\n <Bar\n dataKey=\"bar-value\"\n fill=\"#ff\"\n animationEasing=\"ease-in-out\"\n animationDuration={200}\n activeBar={<Rectangle fill=\"pink\" stroke=\"blue\" />}\n >\n {this.instances?.map((instance, index) => {\n const color = instance['bar-color'];\n return <Cell key={`cell-${index}`} fill={color as string} />;\n })}\n </Bar>\n\n </BarChart>\n </ResponsiveContainer>\n );\n }\n}\n",
5
4
  "/styles.css": "body {\n font-family: sans-serif;\n -webkit-font-smoothing: auto;\n -moz-font-smoothing: auto;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-smooth: always;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\n.root {\n height: 100vh;\n background-color: 'red';\n display: grid;\n}",
6
5
  "/package.json": "{\n \"dependencies\": {\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\",\n \"react-scripts\": \"^5.0.0\",\n \"@digo-org/digo-api\": \"1.0.28\",\n \"@react-three/drei\": \"^10.0.6\",\n \"@react-three/fiber\": \"^9.1.2\",\n \"recharts\": \"^2.15.1\"\n },\n \"main\": \"/index.tsx\",\n \"devDependencies\": {}\n}",
package/src/types-llm.ts CHANGED
@@ -1,12 +1,11 @@
1
- import { CommonMetadata, DataAssetDefinition, Links, ProjectDefinition, VizAssetDefinition, VizAssetFiles } from '@digo-org/digo-api';
1
+ import { CommonMetadata, DataAssetDefinition, Links, VizAssetDefinition, VizAssetFiles } from '@digo-org/digo-api';
2
2
 
3
3
  export interface Artifact extends CommonMetadata {
4
4
  type: ArtifactType;
5
- value: ProjectDefinition | DataAssetDefinition | VizAssetFiles | VizAssetDefinition | Links;
5
+ value: DataAssetDefinition | VizAssetFiles | VizAssetDefinition | Links;
6
6
  }
7
7
 
8
8
  export enum ArtifactType {
9
- PROJECT_DEFINITION = 'PROJECT_DEFINITION',
10
9
  DATA_ASSET_DEFINITION = 'DATA_ASSET_DEFINITION',
11
10
  VIZ_ASSET_FILES = 'VIZ_ASSET_FILES',
12
11
  VIZ_ASSET_DEFINITION = 'VIZ_ASSET_DEFINITION',
@@ -21,4 +20,5 @@ export interface MessagePart {
21
20
  export enum MessageType {
22
21
  TEXT = 'TEXT',
23
22
  ARCTIFACT = 'ARCTIFACT',
23
+ RESOURCE = 'RESOURCE',
24
24
  }
package/src/types-misc.ts CHANGED
@@ -34,11 +34,9 @@ export enum MessageRole {
34
34
  ASSISTANT = 'ASSISTANT',
35
35
  }
36
36
 
37
- export interface Message {
38
- id: string;
39
- role: MessageRole;
40
- content: MessagePart[];
41
- createdAt: number;
37
+ export interface MessageDefinition {
38
+ role: MessageRole;
39
+ content: MessagePart[];
42
40
  }
43
41
 
44
42
  export interface ArtifactStep {
@@ -1,93 +0,0 @@
1
- {
2
- "type": "PROJECT",
3
- "value": {
4
- "dataAssetDefinition": {
5
- "timeArray": [],
6
- "columns": [
7
- {
8
- "id": "gdp_2024",
9
- "name": "GDP 2024 (Trillions USD)",
10
- "type": "NUMBER",
11
- "definition": {
12
- "defaultValue": 0,
13
- "min": 0,
14
- "units": "Trillions USD",
15
- "decimals": 2
16
- }
17
- }
18
- ],
19
- "rows": [
20
- {
21
- "id": "usa",
22
- "name": "United States",
23
- "hidden": false,
24
- "gdp_2024": 30.34
25
- },
26
- {
27
- "id": "china",
28
- "name": "China",
29
- "hidden": false,
30
- "gdp_2024": 19.53
31
- },
32
- {
33
- "id": "germany",
34
- "name": "Germany",
35
- "hidden": false,
36
- "gdp_2024": 4.92
37
- },
38
- {
39
- "id": "japan",
40
- "name": "Japan",
41
- "hidden": false,
42
- "gdp_2024": 4.39
43
- },
44
- {
45
- "id": "india",
46
- "name": "India",
47
- "hidden": false,
48
- "gdp_2024": 4.27
49
- },
50
- {
51
- "id": "united_kingdom",
52
- "name": "United Kingdom",
53
- "hidden": false,
54
- "gdp_2024": 3.73
55
- },
56
- {
57
- "id": "france",
58
- "name": "France",
59
- "hidden": false,
60
- "gdp_2024": 3.28
61
- },
62
- {
63
- "id": "italy",
64
- "name": "Italy",
65
- "hidden": false,
66
- "gdp_2024": 2.46
67
- },
68
- {
69
- "id": "brazil",
70
- "name": "Brazil",
71
- "hidden": false,
72
- "gdp_2024": 2.31
73
- },
74
- {
75
- "id": "canada",
76
- "name": "Canada",
77
- "hidden": false,
78
- "gdp_2024": 2.33
79
- }
80
- ]
81
- },
82
- "links": {
83
- "bar-color": "color-1",
84
- "bar-value": "number-1"
85
- },
86
- "vizAssetFiles": {
87
- "/asset.tsx": "import { DigoAsset } from '@digo-org/digo-api';\n\nimport { ResponsiveContainer, Cell, BarChart, CartesianGrid, XAxis, YAxis, Legend, Bar, Rectangle, Tooltip } from 'recharts';\n\nexport class Asset extends DigoAsset {\n constructor() {\n super();\n }\n\n override render() {\n return (\n <ResponsiveContainer width=\"100%\" height=\"100%\" key=\"responsive-container\">\n <BarChart\n data={this.instances}\n layout=\"horizontal\"\n margin={{\n top: 120,\n right: 60,\n left: 40,\n bottom: 120,\n }}\n style={{ backgroundColor: this.globalParameters['bg-color'] as string }}\n\n >\n <CartesianGrid strokeDasharray=\"3 3\" />\n\n <XAxis dataKey=\"id\" />\n\n <YAxis />\n\n <Legend />\n\n <Tooltip />\n\n <Bar\n dataKey=\"bar-value\"\n fill=\"#ff\"\n animationEasing=\"ease-in-out\"\n animationDuration={200}\n activeBar={<Rectangle fill=\"pink\" stroke=\"blue\" />}\n >\n {this.instances?.map((instance, index) => {\n const color = instance['bar-color'];\n return <Cell key={`cell-${index}`} fill={color as string} />;\n })}\n </Bar>\n\n </BarChart>\n </ResponsiveContainer>\n );\n }\n}\n",
88
- "/styles.css": "body {\n font-family: sans-serif;\n -webkit-font-smoothing: auto;\n -moz-font-smoothing: auto;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-smooth: always;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\n.root {\n height: 100vh;\n background-color: 'red';\n display: grid;\n}",
89
- "/package.json": "{\n \"dependencies\": {\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\",\n \"react-scripts\": \"^5.0.0\",\n \"@digo-org/digo-api\": \"1.0.28\",\n \"@react-three/drei\": \"^10.0.6\",\n \"@react-three/fiber\": \"^9.1.2\",\n \"recharts\": \"^2.15.1\"\n },\n \"main\": \"/index.tsx\",\n \"devDependencies\": {}\n}",
90
- "/definition.json": "[\n {\n \"id\": \"bg-color\",\n \"group\": \"\",\n \"isGlobal\": true,\n \"properties\": {\n \"name\": \"Background Color\",\n \"type\": 2,\n \"definition\": {\n \"defaultValue\": \"#000\"\n }\n }\n },\n {\n \"id\": \"bar-value\",\n \"group\": \"\",\n \"isGlobal\": false,\n \"properties\": {\n \"name\": \"Value\",\n \"type\": 0,\n \"definition\": {\n \"defaultValue\": 50,\n \"min\": 0,\n \"max\": 100,\n \"icon\": \"icon-[material-symbols--percent-rounded]\",\n \"decimals\": 0,\n \"step\": 1,\n \"units\": \"\"\n }\n }\n },\n {\n \"id\": \"bar-color\",\n \"group\": \"\",\n \"isGlobal\": false,\n \"properties\": {\n \"name\": \"Bar Color\",\n \"type\": 2,\n \"definition\": {\n \"defaultValue\": \"#ffffff\"\n }\n }\n }\n]"
91
- }
92
- }
93
- }