@dxos/assistant 0.8.2-main.12df754 → 0.8.2-main.2f9c567
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-DEIGOD4U.mjs → chunk-OLO6SVOL.mjs} +21 -21
- package/dist/lib/browser/chunk-OLO6SVOL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +272 -152
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +82 -86
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-7VH7NMIM.cjs → chunk-CI5Q7FBG.cjs} +6 -6
- package/dist/lib/node/chunk-CI5Q7FBG.cjs.map +7 -0
- package/dist/lib/node/index.cjs +300 -183
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +72 -77
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node-esm/{chunk-7JI4MDGL.mjs → chunk-Y3SYOFFJ.mjs} +21 -21
- package/dist/lib/node-esm/chunk-Y3SYOFFJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +272 -152
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +82 -86
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/ai-service/types.d.ts +133 -133
- package/dist/types/src/ai-service/types.d.ts.map +1 -1
- package/dist/types/src/conversation/types.d.ts +9 -9
- package/dist/types/src/conversation/types.d.ts.map +1 -1
- package/dist/types/src/cypher/echo-data-source.d.ts.map +1 -1
- package/dist/types/src/session/index.d.ts +1 -0
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/session.d.ts +32 -7
- package/dist/types/src/session/session.d.ts.map +1 -1
- package/dist/types/src/session/version-pin.d.ts +17 -0
- package/dist/types/src/session/version-pin.d.ts.map +1 -0
- package/dist/types/src/session/version-pin.test.d.ts +2 -0
- package/dist/types/src/session/version-pin.test.d.ts.map +1 -0
- package/dist/types/src/testing/query-promts.d.ts +3 -3
- package/dist/types/src/testing/query-promts.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +4 -4
- package/dist/types/src/testing/test-data.d.ts.map +1 -1
- package/dist/types/src/testing/test-schema.d.ts +25 -23
- package/dist/types/src/testing/test-schema.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/ai-service/client.test.ts +5 -5
- package/src/ai-service/ollama-client.ts +7 -7
- package/src/ai-service/types.ts +14 -14
- package/src/bin/chat.ts +2 -2
- package/src/conversation/conversation.test.ts +3 -3
- package/src/conversation/types.ts +10 -10
- package/src/cypher/combinators.test.ts +4 -4
- package/src/cypher/echo-data-source.ts +7 -5
- package/src/cypher/execution-plan.test.ts +1 -1
- package/src/cypher/query-executor.test.ts +1 -1
- package/src/cypher/schema.test.ts +3 -3
- package/src/session/index.ts +1 -0
- package/src/session/session.test.ts +24 -17
- package/src/session/session.ts +285 -149
- package/src/session/version-pin.test.ts +26 -0
- package/src/session/version-pin.ts +43 -0
- package/src/testing/artifacts.test.ts +22 -22
- package/src/testing/query-promts.ts +5 -5
- package/src/testing/query.test.ts +3 -3
- package/src/testing/test-data.ts +62 -55
- package/src/testing/test-schema.ts +28 -29
- package/dist/lib/browser/chunk-DEIGOD4U.mjs.map +0 -7
- package/dist/lib/node/chunk-7VH7NMIM.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-7JI4MDGL.mjs.map +0 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
7
|
import { defineTool, ToolResult } from '@dxos/artifact';
|
|
8
8
|
import { toJsonSchema } from '@dxos/echo-schema';
|
|
@@ -11,14 +11,14 @@ import { log } from '@dxos/log';
|
|
|
11
11
|
import { executeQuery, formatJsonSchemaForLLM, type DataSource } from '../cypher';
|
|
12
12
|
import { trim } from '../util';
|
|
13
13
|
|
|
14
|
-
export const createCypherTool = (dataSource: DataSource, schemaTypes:
|
|
14
|
+
export const createCypherTool = (dataSource: DataSource, schemaTypes: Schema.Schema.Any[] = []) =>
|
|
15
15
|
defineTool('dxos.org/echo', {
|
|
16
16
|
name: 'query',
|
|
17
17
|
description:
|
|
18
18
|
'Query the ECHO graph database in cypher query language. Returns data from the database.' +
|
|
19
19
|
(schemaTypes.length > 0 ? `\n\n${createSystemPrompt(schemaTypes)}` : ''),
|
|
20
|
-
schema:
|
|
21
|
-
query:
|
|
20
|
+
schema: Schema.Struct({
|
|
21
|
+
query: Schema.String.annotations({
|
|
22
22
|
description: `
|
|
23
23
|
A valid cypher query string to execute.
|
|
24
24
|
Query must have one MATCH clause.
|
|
@@ -55,7 +55,7 @@ export const createCypherTool = (dataSource: DataSource, schemaTypes: S.Schema.A
|
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
export const createSystemPrompt = (schemaTypes:
|
|
58
|
+
export const createSystemPrompt = (schemaTypes: Schema.Schema.Any[]) => trim`
|
|
59
59
|
You have access to ECHO graph database. You can query the database to get data to satisfy user prompts.
|
|
60
60
|
|
|
61
61
|
Database schema is defined in pseud-cypher syntax. The schema is:
|
|
@@ -14,7 +14,7 @@ import { AI_SERVICE_ENDPOINT } from './defs';
|
|
|
14
14
|
import { createLogger } from './logger';
|
|
15
15
|
import { createCypherTool, createSystemPrompt } from './query-promts';
|
|
16
16
|
import { createTestData, seedTestData } from './test-data';
|
|
17
|
-
import { Contact,
|
|
17
|
+
import { Contact, Organization, Project, Task } from './test-schema';
|
|
18
18
|
import { AIServiceEdgeClient, DEFAULT_EDGE_MODEL } from '../ai-service';
|
|
19
19
|
import { runLLM } from '../conversation';
|
|
20
20
|
import { EchoDataSource } from '../cypher';
|
|
@@ -25,7 +25,7 @@ const client = new AIServiceEdgeClient({
|
|
|
25
25
|
|
|
26
26
|
test.skip('cypher query', async () => {
|
|
27
27
|
const dataSource = createTestData();
|
|
28
|
-
const schemaTypes = [
|
|
28
|
+
const schemaTypes = [Organization, Project, Task, Contact];
|
|
29
29
|
|
|
30
30
|
const cypherTool = createCypherTool(dataSource);
|
|
31
31
|
|
|
@@ -56,7 +56,7 @@ test.skip('query ECHO', async () => {
|
|
|
56
56
|
await using builder = await new EchoTestBuilder().open();
|
|
57
57
|
const { db, graph } = await builder.createDatabase();
|
|
58
58
|
|
|
59
|
-
const schemaTypes = [
|
|
59
|
+
const schemaTypes = [Organization, Project, Task, Contact];
|
|
60
60
|
graph.schemaRegistry.addSchema(schemaTypes);
|
|
61
61
|
|
|
62
62
|
seedTestData(db);
|
package/src/testing/test-data.ts
CHANGED
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Schema
|
|
5
|
+
import { type Schema } from 'effect';
|
|
6
6
|
|
|
7
7
|
import { raise } from '@dxos/debug';
|
|
8
8
|
import type { EchoDatabase } from '@dxos/echo-db';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
JSON_SCHEMA_ECHO_REF_ID,
|
|
11
|
+
ObjectId,
|
|
12
|
+
toJsonSchema,
|
|
13
|
+
type JsonSchemaType,
|
|
14
|
+
type Ref,
|
|
15
|
+
Ref as RefImpl,
|
|
16
|
+
} from '@dxos/echo-schema';
|
|
10
17
|
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { live
|
|
18
|
+
import { live } from '@dxos/live-object';
|
|
12
19
|
|
|
13
20
|
import {
|
|
14
21
|
type DataSource,
|
|
@@ -17,7 +24,7 @@ import {
|
|
|
17
24
|
formatInferredRelationshipLabel,
|
|
18
25
|
formatNodeLabel,
|
|
19
26
|
} from '../cypher';
|
|
20
|
-
import { Contact,
|
|
27
|
+
import { Contact, Organization, Project, Task } from '../testing';
|
|
21
28
|
|
|
22
29
|
export const seedTestData = (db: EchoDatabase) => {
|
|
23
30
|
const contactRich = db.add(
|
|
@@ -60,79 +67,79 @@ export const seedTestData = (db: EchoDatabase) => {
|
|
|
60
67
|
const _taskComposer1 = db.add(
|
|
61
68
|
live(Task, {
|
|
62
69
|
name: 'Optimize startup performance',
|
|
63
|
-
project:
|
|
64
|
-
assignee:
|
|
70
|
+
project: RefImpl.make(projectComposer),
|
|
71
|
+
assignee: RefImpl.make(contactJosiah),
|
|
65
72
|
}),
|
|
66
73
|
);
|
|
67
74
|
const _taskComposer2 = db.add(
|
|
68
75
|
live(Task, {
|
|
69
76
|
name: 'Create form builder',
|
|
70
|
-
project:
|
|
71
|
-
assignee:
|
|
77
|
+
project: RefImpl.make(projectComposer),
|
|
78
|
+
assignee: RefImpl.make(contactRich),
|
|
72
79
|
}),
|
|
73
80
|
);
|
|
74
81
|
const _taskComposer3 = db.add(
|
|
75
82
|
live(Task, {
|
|
76
83
|
name: 'Add support for custom themes',
|
|
77
|
-
project:
|
|
78
|
-
assignee:
|
|
84
|
+
project: RefImpl.make(projectComposer),
|
|
85
|
+
assignee: RefImpl.make(contactJosiah),
|
|
79
86
|
}),
|
|
80
87
|
);
|
|
81
88
|
const _taskComposer5 = db.add(
|
|
82
89
|
live(Task, {
|
|
83
90
|
name: 'Implement community plugin',
|
|
84
|
-
project:
|
|
85
|
-
assignee:
|
|
91
|
+
project: RefImpl.make(projectComposer),
|
|
92
|
+
assignee: RefImpl.make(contactFred),
|
|
86
93
|
}),
|
|
87
94
|
);
|
|
88
95
|
const _taskComposer4 = db.add(
|
|
89
96
|
live(Task, {
|
|
90
97
|
name: 'Implement dark mode',
|
|
91
|
-
project:
|
|
92
|
-
assignee:
|
|
98
|
+
project: RefImpl.make(projectComposer),
|
|
99
|
+
assignee: RefImpl.make(contactRich),
|
|
93
100
|
}),
|
|
94
101
|
);
|
|
95
102
|
const _taskEcho1 = db.add(
|
|
96
103
|
live(Task, {
|
|
97
104
|
name: 'Implement cypher query engine',
|
|
98
|
-
project:
|
|
99
|
-
assignee:
|
|
105
|
+
project: RefImpl.make(projectEcho),
|
|
106
|
+
assignee: RefImpl.make(contactDima),
|
|
100
107
|
}),
|
|
101
108
|
);
|
|
102
109
|
const _taskEcho2 = db.add(
|
|
103
110
|
live(Task, {
|
|
104
111
|
name: 'Add schema editor',
|
|
105
|
-
project:
|
|
106
|
-
assignee:
|
|
112
|
+
project: RefImpl.make(projectEcho),
|
|
113
|
+
assignee: RefImpl.make(contactRich),
|
|
107
114
|
}),
|
|
108
115
|
);
|
|
109
116
|
const _taskDoodles1 = db.add(
|
|
110
117
|
live(Task, {
|
|
111
118
|
name: 'Add support for custom themes',
|
|
112
|
-
project:
|
|
113
|
-
assignee:
|
|
119
|
+
project: RefImpl.make(projectDoodles),
|
|
120
|
+
assignee: RefImpl.make(contactFred),
|
|
114
121
|
}),
|
|
115
122
|
);
|
|
116
123
|
const _taskDoodles2 = db.add(
|
|
117
124
|
live(Task, {
|
|
118
125
|
name: 'Implement dark mode',
|
|
119
|
-
project:
|
|
120
|
-
assignee:
|
|
126
|
+
project: RefImpl.make(projectDoodles),
|
|
127
|
+
assignee: RefImpl.make(contactJosiah),
|
|
121
128
|
}),
|
|
122
129
|
);
|
|
123
130
|
|
|
124
131
|
const _orgDxos = db.add(
|
|
125
|
-
live(
|
|
132
|
+
live(Organization, {
|
|
126
133
|
name: 'DXOS',
|
|
127
|
-
employees: [
|
|
128
|
-
projects: [
|
|
134
|
+
employees: [RefImpl.make(contactRich), RefImpl.make(contactJosiah), RefImpl.make(contactDima)],
|
|
135
|
+
projects: [RefImpl.make(projectEcho)],
|
|
129
136
|
}),
|
|
130
137
|
);
|
|
131
138
|
const _orgBraneframe = db.add(
|
|
132
|
-
live(
|
|
139
|
+
live(Organization, {
|
|
133
140
|
name: 'Braneframe',
|
|
134
|
-
employees: [
|
|
135
|
-
projects: [
|
|
141
|
+
employees: [RefImpl.make(contactJosiah), RefImpl.make(contactRich)],
|
|
142
|
+
projects: [RefImpl.make(projectComposer)],
|
|
136
143
|
}),
|
|
137
144
|
);
|
|
138
145
|
};
|
|
@@ -174,69 +181,69 @@ export const createTestData = (): MockDataSource => {
|
|
|
174
181
|
const _taskComposer1 = dataSource.add(Task, {
|
|
175
182
|
id: ObjectId.random(),
|
|
176
183
|
name: 'Optimize startup performance',
|
|
177
|
-
project:
|
|
178
|
-
assignee:
|
|
184
|
+
project: RefImpl.make(projectComposer),
|
|
185
|
+
assignee: RefImpl.make(contactJosiah),
|
|
179
186
|
});
|
|
180
187
|
const _taskComposer2 = dataSource.add(Task, {
|
|
181
188
|
id: ObjectId.random(),
|
|
182
189
|
name: 'Create form builder',
|
|
183
|
-
project:
|
|
184
|
-
assignee:
|
|
190
|
+
project: RefImpl.make(projectComposer),
|
|
191
|
+
assignee: RefImpl.make(contactRich),
|
|
185
192
|
});
|
|
186
193
|
const _taskComposer3 = dataSource.add(Task, {
|
|
187
194
|
id: ObjectId.random(),
|
|
188
195
|
name: 'Add support for custom themes',
|
|
189
|
-
project:
|
|
190
|
-
assignee:
|
|
196
|
+
project: RefImpl.make(projectComposer),
|
|
197
|
+
assignee: RefImpl.make(contactJosiah),
|
|
191
198
|
});
|
|
192
199
|
const _taskComposer5 = dataSource.add(Task, {
|
|
193
200
|
id: ObjectId.random(),
|
|
194
201
|
name: 'Implement community plugin',
|
|
195
|
-
project:
|
|
196
|
-
assignee:
|
|
202
|
+
project: RefImpl.make(projectComposer),
|
|
203
|
+
assignee: RefImpl.make(contactFred),
|
|
197
204
|
});
|
|
198
205
|
const _taskComposer4 = dataSource.add(Task, {
|
|
199
206
|
id: ObjectId.random(),
|
|
200
207
|
name: 'Implement dark mode',
|
|
201
|
-
project:
|
|
202
|
-
assignee:
|
|
208
|
+
project: RefImpl.make(projectComposer),
|
|
209
|
+
assignee: RefImpl.make(contactRich),
|
|
203
210
|
});
|
|
204
211
|
const _taskEcho1 = dataSource.add(Task, {
|
|
205
212
|
id: ObjectId.random(),
|
|
206
213
|
name: 'Implement cypher query engine',
|
|
207
|
-
project:
|
|
208
|
-
assignee:
|
|
214
|
+
project: RefImpl.make(projectEcho),
|
|
215
|
+
assignee: RefImpl.make(contactDima),
|
|
209
216
|
});
|
|
210
217
|
const _taskEcho2 = dataSource.add(Task, {
|
|
211
218
|
id: ObjectId.random(),
|
|
212
219
|
name: 'Add schema editor',
|
|
213
|
-
project:
|
|
214
|
-
assignee:
|
|
220
|
+
project: RefImpl.make(projectEcho),
|
|
221
|
+
assignee: RefImpl.make(contactRich),
|
|
215
222
|
});
|
|
216
223
|
const _taskDoodles1 = dataSource.add(Task, {
|
|
217
224
|
id: ObjectId.random(),
|
|
218
225
|
name: 'Add support for custom themes',
|
|
219
|
-
project:
|
|
220
|
-
assignee:
|
|
226
|
+
project: RefImpl.make(projectDoodles),
|
|
227
|
+
assignee: RefImpl.make(contactFred),
|
|
221
228
|
});
|
|
222
229
|
const _taskDoodles2 = dataSource.add(Task, {
|
|
223
230
|
id: ObjectId.random(),
|
|
224
231
|
name: 'Implement dark mode',
|
|
225
|
-
project:
|
|
226
|
-
assignee:
|
|
232
|
+
project: RefImpl.make(projectDoodles),
|
|
233
|
+
assignee: RefImpl.make(contactJosiah),
|
|
227
234
|
});
|
|
228
235
|
|
|
229
|
-
const _orgDxos = dataSource.add(
|
|
236
|
+
const _orgDxos = dataSource.add(Organization, {
|
|
230
237
|
id: ObjectId.random(),
|
|
231
238
|
name: 'DXOS',
|
|
232
|
-
employees: [
|
|
233
|
-
projects: [
|
|
239
|
+
employees: [RefImpl.make(contactRich), RefImpl.make(contactJosiah), RefImpl.make(contactDima)],
|
|
240
|
+
projects: [RefImpl.make(projectEcho)],
|
|
234
241
|
});
|
|
235
|
-
const _orgBraneframe = dataSource.add(
|
|
242
|
+
const _orgBraneframe = dataSource.add(Organization, {
|
|
236
243
|
id: ObjectId.random(),
|
|
237
244
|
name: 'Braneframe',
|
|
238
|
-
employees: [
|
|
239
|
-
projects: [
|
|
245
|
+
employees: [RefImpl.make(contactJosiah), RefImpl.make(contactRich)],
|
|
246
|
+
projects: [RefImpl.make(projectComposer)],
|
|
240
247
|
});
|
|
241
248
|
dataSource.computeGraph();
|
|
242
249
|
|
|
@@ -247,7 +254,7 @@ export class MockDataSource implements DataSource {
|
|
|
247
254
|
objects: Record<
|
|
248
255
|
string,
|
|
249
256
|
{
|
|
250
|
-
schema:
|
|
257
|
+
schema: Schema.Schema.All;
|
|
251
258
|
typeDxn: string;
|
|
252
259
|
id: string;
|
|
253
260
|
data: unknown;
|
|
@@ -258,7 +265,7 @@ export class MockDataSource implements DataSource {
|
|
|
258
265
|
string,
|
|
259
266
|
{
|
|
260
267
|
json: JsonSchemaType;
|
|
261
|
-
instance:
|
|
268
|
+
instance: Schema.Schema.All;
|
|
262
269
|
}
|
|
263
270
|
> = {};
|
|
264
271
|
|
|
@@ -273,7 +280,7 @@ export class MockDataSource implements DataSource {
|
|
|
273
280
|
return this.relationships.filter((relationship) => !label || relationship.label === label);
|
|
274
281
|
}
|
|
275
282
|
|
|
276
|
-
add<S extends
|
|
283
|
+
add<S extends Schema.Schema.All>(schema: S, data: Schema.Schema.Type<S>) {
|
|
277
284
|
invariant(typeof data.id === 'string', 'Data must have an id');
|
|
278
285
|
const jsonSchema = toJsonSchema(schema);
|
|
279
286
|
if (!this.schema[jsonSchema.$id!]) {
|
|
@@ -2,22 +2,19 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { EntityKind, TypeAnnotationId, Ref } from '@dxos/echo-schema';
|
|
7
|
+
import { EntityKind, TypeAnnotationId, Ref, ObjectId } from '@dxos/echo-schema';
|
|
8
8
|
|
|
9
|
-
// TODO(burdon):
|
|
10
|
-
// TODO(burdon): Convert interface to type.
|
|
9
|
+
// TODO(burdon): Remove (use @dxos/schema DataType).
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
export const
|
|
14
|
-
|
|
15
|
-
export const Contact = S.Struct({
|
|
11
|
+
/** @deprecated */
|
|
12
|
+
export const Contact = Schema.Struct({
|
|
16
13
|
id: ObjectId,
|
|
17
|
-
name:
|
|
18
|
-
email:
|
|
14
|
+
name: Schema.String.annotations({ description: 'The name of the person.' }),
|
|
15
|
+
email: Schema.optional(Schema.String).annotations({ description: 'Email address.' }),
|
|
19
16
|
})
|
|
20
|
-
.pipe(
|
|
17
|
+
.pipe(Schema.mutable)
|
|
21
18
|
.annotations({
|
|
22
19
|
[TypeAnnotationId]: {
|
|
23
20
|
kind: EntityKind.Object,
|
|
@@ -26,14 +23,15 @@ export const Contact = S.Struct({
|
|
|
26
23
|
},
|
|
27
24
|
description: 'Contact information.',
|
|
28
25
|
});
|
|
29
|
-
export interface Contact extends
|
|
26
|
+
export interface Contact extends Schema.Schema.Type<typeof Contact> {}
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
/** @deprecated */
|
|
29
|
+
export const Project = Schema.Struct({
|
|
32
30
|
id: ObjectId,
|
|
33
|
-
name:
|
|
34
|
-
description:
|
|
31
|
+
name: Schema.String.annotations({ description: 'The name of the project.' }),
|
|
32
|
+
description: Schema.optional(Schema.String).annotations({ description: 'The description of the project.' }),
|
|
35
33
|
})
|
|
36
|
-
.pipe(
|
|
34
|
+
.pipe(Schema.mutable)
|
|
37
35
|
.annotations({
|
|
38
36
|
[TypeAnnotationId]: {
|
|
39
37
|
kind: EntityKind.Object,
|
|
@@ -42,16 +40,16 @@ export const Project = S.Struct({
|
|
|
42
40
|
},
|
|
43
41
|
description: 'Contact information.',
|
|
44
42
|
});
|
|
45
|
-
export interface Project extends
|
|
43
|
+
export interface Project extends Schema.Schema.Type<typeof Project> {}
|
|
46
44
|
|
|
47
|
-
export const Task =
|
|
45
|
+
export const Task = Schema.Struct({
|
|
48
46
|
id: ObjectId,
|
|
49
|
-
name:
|
|
50
|
-
description:
|
|
47
|
+
name: Schema.String.annotations({ description: 'The name of the task.' }),
|
|
48
|
+
description: Schema.optional(Schema.String).annotations({ description: 'The description of the task.' }),
|
|
51
49
|
project: Ref(Project),
|
|
52
50
|
assignee: Ref(Contact),
|
|
53
51
|
})
|
|
54
|
-
.pipe(
|
|
52
|
+
.pipe(Schema.mutable)
|
|
55
53
|
.annotations({
|
|
56
54
|
[TypeAnnotationId]: {
|
|
57
55
|
kind: EntityKind.Object,
|
|
@@ -60,21 +58,22 @@ export const Task = S.Struct({
|
|
|
60
58
|
},
|
|
61
59
|
description: 'Contact information.',
|
|
62
60
|
});
|
|
63
|
-
export interface Task extends
|
|
61
|
+
export interface Task extends Schema.Schema.Type<typeof Task> {}
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
/** @deprecated */
|
|
64
|
+
export const Organization = Schema.Struct({
|
|
66
65
|
id: ObjectId,
|
|
67
|
-
name:
|
|
68
|
-
projects:
|
|
69
|
-
employees:
|
|
66
|
+
name: Schema.String.annotations({ description: 'The name of the organization.' }),
|
|
67
|
+
projects: Schema.Array(Ref(Project)),
|
|
68
|
+
employees: Schema.Array(Ref(Contact)),
|
|
70
69
|
})
|
|
71
|
-
.pipe(
|
|
70
|
+
.pipe(Schema.mutable)
|
|
72
71
|
.annotations({
|
|
73
72
|
[TypeAnnotationId]: {
|
|
74
73
|
kind: EntityKind.Object,
|
|
75
|
-
typename: 'example.com/type/
|
|
74
|
+
typename: 'example.com/type/Organization',
|
|
76
75
|
version: '0.1.0',
|
|
77
76
|
},
|
|
78
77
|
description: 'Contact information.',
|
|
79
78
|
});
|
|
80
|
-
export interface
|
|
79
|
+
export interface Organization extends Schema.Schema.Type<typeof Organization> {}
|