@undefineds.co/models 0.2.26 → 0.2.27
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/approval.schema.js +2 -1
- package/dist/audit.schema.js +2 -1
- package/dist/bin/udfs.d.ts +2 -0
- package/dist/bin/udfs.js +430 -0
- package/dist/chat.repository.d.ts +8 -0
- package/dist/chat.schema.d.ts +10 -0
- package/dist/chat.schema.js +9 -2
- package/dist/chat.utils.js +24 -9
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -3
- package/dist/message.repository.d.ts +29 -9
- package/dist/message.schema.d.ts +29 -6
- package/dist/message.schema.js +26 -10
- package/dist/namespaces.js +23 -0
- package/dist/pod-storage-descriptor.d.ts +189 -0
- package/dist/pod-storage-descriptor.js +283 -0
- package/dist/repository.d.ts +2 -0
- package/dist/repository.js +3 -0
- package/dist/resource-id-defaults.d.ts +18 -0
- package/dist/resource-id-defaults.js +84 -0
- package/dist/run.schema.d.ts +112 -0
- package/dist/run.schema.js +89 -0
- package/dist/schema.d.ts +132 -8
- package/dist/schema.js +8 -0
- package/dist/session/session.schema.js +2 -1
- package/dist/sidecar/sidecar-events.d.ts +36 -36
- package/dist/task.schema.d.ts +62 -0
- package/dist/task.schema.js +49 -0
- package/dist/thread.repository.d.ts +15 -3
- package/dist/thread.schema.d.ts +14 -2
- package/dist/thread.schema.js +13 -5
- package/package.json +11 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { id, integer, object, podTable, string, timestamp, uri } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
import { DCTerms, UDFS } from './namespaces.js';
|
|
3
|
+
import { threadResource } from './thread.schema.js';
|
|
4
|
+
import { taskResourceId } from './resource-id-defaults.js';
|
|
5
|
+
export const TaskStatus = {
|
|
6
|
+
ACTIVE: 'active',
|
|
7
|
+
PAUSED: 'paused',
|
|
8
|
+
COMPLETED: 'completed',
|
|
9
|
+
FAILED: 'failed',
|
|
10
|
+
};
|
|
11
|
+
export const TaskTriggerKind = {
|
|
12
|
+
ONCE: 'once',
|
|
13
|
+
INTERVAL: 'interval',
|
|
14
|
+
CRON: 'cron',
|
|
15
|
+
EVENT: 'event',
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Task resource.
|
|
19
|
+
*
|
|
20
|
+
* Task is a durable task-style command, parallel to Chat as a command surface.
|
|
21
|
+
* It is intentionally generic: protocol-specific request, response, and event
|
|
22
|
+
* shapes stay in adapter code.
|
|
23
|
+
*/
|
|
24
|
+
export const taskResource = podTable('task', {
|
|
25
|
+
id: id('id').default(taskResourceId),
|
|
26
|
+
surfaceId: string('surfaceId').predicate(UDFS.surfaceId).notNull().default('default'),
|
|
27
|
+
title: string('title').predicate(DCTerms.title),
|
|
28
|
+
prompt: string('prompt').predicate(UDFS.prompt).notNull(),
|
|
29
|
+
thread: uri('thread').predicate(UDFS.inThread).link(threadResource),
|
|
30
|
+
workspace: uri('workspace').predicate(UDFS.workspace).notNull(),
|
|
31
|
+
runner: string('runner').predicate(UDFS.runner).notNull(),
|
|
32
|
+
status: string('status').predicate(UDFS.status).notNull().default(TaskStatus.ACTIVE),
|
|
33
|
+
triggerKind: string('triggerKind').predicate(UDFS.triggerKind).notNull().default(TaskTriggerKind.ONCE),
|
|
34
|
+
cron: string('cron').predicate(UDFS.cron),
|
|
35
|
+
intervalSeconds: integer('intervalSeconds').predicate(UDFS.intervalSeconds),
|
|
36
|
+
eventName: string('eventName').predicate(UDFS.eventName),
|
|
37
|
+
nextRunAt: timestamp('nextRunAt').predicate(UDFS.nextRunAt),
|
|
38
|
+
lastRunAt: timestamp('lastRunAt').predicate(UDFS.lastRunAt),
|
|
39
|
+
metadata: object('metadata').predicate(UDFS.metadata),
|
|
40
|
+
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
41
|
+
updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
|
|
42
|
+
}, {
|
|
43
|
+
base: '/.data/task/',
|
|
44
|
+
sparqlEndpoint: '/.data/task/-/sparql',
|
|
45
|
+
type: UDFS.Task,
|
|
46
|
+
namespace: UDFS,
|
|
47
|
+
});
|
|
48
|
+
// Compatibility alias. New model code should prefer `taskResource`.
|
|
49
|
+
export const taskTable = taskResource;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export declare const threadRepository: import("@undefineds.co/drizzle-solid/dist/core/repository").PodRepositoryDescriptor<import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
2
2
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
3
|
-
|
|
3
|
+
commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
4
|
+
surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
5
|
+
chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
4
6
|
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
7
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
5
8
|
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
6
9
|
workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
7
10
|
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
@@ -9,17 +12,23 @@ export declare const threadRepository: import("@undefineds.co/drizzle-solid/dist
|
|
|
9
12
|
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
10
13
|
}>>, {
|
|
11
14
|
id: string;
|
|
15
|
+
commandKind: string;
|
|
16
|
+
surfaceId: string;
|
|
12
17
|
chat: string;
|
|
13
18
|
title: string;
|
|
19
|
+
status: string;
|
|
14
20
|
starred: boolean;
|
|
15
21
|
workspace: string;
|
|
16
22
|
metadata: Record<string, unknown>;
|
|
17
23
|
createdAt: Date;
|
|
18
24
|
updatedAt: Date;
|
|
19
25
|
}, {
|
|
20
|
-
chat: string;
|
|
21
26
|
id?: string | undefined;
|
|
27
|
+
commandKind?: string | undefined;
|
|
28
|
+
surfaceId?: string | undefined;
|
|
29
|
+
chat?: string | undefined;
|
|
22
30
|
title?: string | undefined;
|
|
31
|
+
status?: string | undefined;
|
|
23
32
|
starred?: boolean | undefined;
|
|
24
33
|
workspace?: string | undefined;
|
|
25
34
|
metadata?: Record<string, unknown> | undefined;
|
|
@@ -27,8 +36,11 @@ export declare const threadRepository: import("@undefineds.co/drizzle-solid/dist
|
|
|
27
36
|
updatedAt?: Date | undefined;
|
|
28
37
|
}, {
|
|
29
38
|
id?: string | null | undefined;
|
|
30
|
-
|
|
39
|
+
commandKind?: string | undefined;
|
|
40
|
+
surfaceId?: string | undefined;
|
|
41
|
+
chat?: string | null | undefined;
|
|
31
42
|
title?: string | null | undefined;
|
|
43
|
+
status?: string | undefined;
|
|
32
44
|
starred?: boolean | null | undefined;
|
|
33
45
|
workspace?: string | null | undefined;
|
|
34
46
|
metadata?: Record<string, unknown> | null | undefined;
|
package/dist/thread.schema.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export type ThreadStatusType = 'active' | 'locked' | 'closed';
|
|
2
|
+
export declare const ThreadStatus: {
|
|
3
|
+
readonly ACTIVE: "active";
|
|
4
|
+
readonly LOCKED: "locked";
|
|
5
|
+
readonly CLOSED: "closed";
|
|
6
|
+
};
|
|
1
7
|
/**
|
|
2
8
|
* Thread resource.
|
|
3
9
|
*
|
|
@@ -22,8 +28,11 @@
|
|
|
22
28
|
*/
|
|
23
29
|
export declare const threadResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
24
30
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
25
|
-
|
|
31
|
+
commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
32
|
+
surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
33
|
+
chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
26
34
|
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
35
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
27
36
|
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
28
37
|
workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
29
38
|
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
@@ -32,8 +41,11 @@ export declare const threadResource: import("@undefineds.co/drizzle-solid/dist/c
|
|
|
32
41
|
}>>;
|
|
33
42
|
export declare const threadTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
34
43
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
35
|
-
|
|
44
|
+
commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
45
|
+
surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
46
|
+
chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
36
47
|
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
48
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
37
49
|
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
38
50
|
workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
39
51
|
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
package/dist/thread.schema.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { uri, boolean, object, podTable, string, timestamp, id } from '@undefineds.co/drizzle-solid';
|
|
2
2
|
import { UDFS, DCTerms, SIOC } from './namespaces.js';
|
|
3
3
|
import { chatResource } from './chat.schema.js';
|
|
4
|
+
import { threadResourceId } from './resource-id-defaults.js';
|
|
5
|
+
export const ThreadStatus = {
|
|
6
|
+
ACTIVE: 'active',
|
|
7
|
+
LOCKED: 'locked',
|
|
8
|
+
CLOSED: 'closed',
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* Thread resource.
|
|
6
12
|
*
|
|
@@ -24,11 +30,14 @@ import { chatResource } from './chat.schema.js';
|
|
|
24
30
|
* container URI here and store portable metadata with that container/resource.
|
|
25
31
|
*/
|
|
26
32
|
export const threadResource = podTable('thread', {
|
|
27
|
-
id: id('id'),
|
|
33
|
+
id: id('id').default(threadResourceId),
|
|
34
|
+
commandKind: string('commandKind').predicate(UDFS.commandKind).notNull().default('chat'),
|
|
35
|
+
surfaceId: string('surfaceId').predicate(UDFS.surfaceId).notNull().default('default'),
|
|
28
36
|
// Belongs to chat/counterpart. Stored as an RDF URI; short ids are resolved via chatResource's URI template by the ORM.
|
|
29
|
-
chat: uri('chat').predicate(SIOC.has_parent).
|
|
37
|
+
chat: uri('chat').predicate(SIOC.has_parent).link(chatResource),
|
|
30
38
|
// Display / state
|
|
31
39
|
title: string('title').predicate(DCTerms.title),
|
|
40
|
+
status: string('status').predicate(UDFS.status).notNull().default(ThreadStatus.ACTIVE),
|
|
32
41
|
starred: boolean('starred').predicate(UDFS.favorite).default(false),
|
|
33
42
|
// Storage-layer execution context reference: container/resource URI
|
|
34
43
|
workspace: uri('workspace').predicate(UDFS.workspace),
|
|
@@ -37,11 +46,10 @@ export const threadResource = podTable('thread', {
|
|
|
37
46
|
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
38
47
|
updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
|
|
39
48
|
}, {
|
|
40
|
-
base: '/.data/
|
|
41
|
-
sparqlEndpoint: '/.data
|
|
49
|
+
base: '/.data/',
|
|
50
|
+
sparqlEndpoint: '/.data/-/sparql',
|
|
42
51
|
type: SIOC.Thread,
|
|
43
52
|
namespace: UDFS,
|
|
44
|
-
subjectTemplate: '{chat|id}/index.ttl#{id}',
|
|
45
53
|
});
|
|
46
54
|
// Compatibility alias. New model code should prefer `threadResource`.
|
|
47
55
|
export const threadTable = threadResource;
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@undefineds.co/models",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"udfs": "./dist/bin/udfs.js"
|
|
10
|
+
},
|
|
8
11
|
"repository": {
|
|
9
12
|
"type": "git",
|
|
10
13
|
"url": "git+https://github.com/undefinedsco/models.git"
|
|
@@ -60,15 +63,17 @@
|
|
|
60
63
|
"build": "tsc -p tsconfig.json && node scripts/fix-dist-esm.mjs",
|
|
61
64
|
"lint": "echo \"lint not configured\"",
|
|
62
65
|
"pack:release": "node scripts/pack-release.mjs",
|
|
66
|
+
"skills:check": "node scripts/check-skills.mjs",
|
|
67
|
+
"skills:pack": "yarn skills:check && node scripts/pack-skills.mjs",
|
|
63
68
|
"sync:discovery:vercel": "node --experimental-strip-types scripts/sync-discovery-vercel.ts",
|
|
64
69
|
"test": "vitest run",
|
|
65
|
-
"test:ci": "vitest run tests/ai-config.test.ts tests/ai-runtime-schema.test.ts tests/client.test.ts tests/contracts-chat-contact.contract.test.ts tests/discovery-vercel.test.ts tests/discovery.test.ts tests/issue-schema.test.ts tests/profile.test.ts tests/repository.test.ts tests/resource-utils.test.ts tests/session-schema.test.ts tests/sidecar-events.contract.test.ts tests/resource-schema.test.ts",
|
|
70
|
+
"test:ci": "vitest run tests/ai-config.test.ts tests/ai-runtime-schema.test.ts tests/client.test.ts tests/contracts-chat-contact.contract.test.ts tests/discovery-vercel.test.ts tests/discovery.test.ts tests/issue-schema.test.ts tests/profile.test.ts tests/repository.test.ts tests/resource-utils.test.ts tests/session-schema.test.ts tests/sidecar-events.contract.test.ts tests/resource-schema.test.ts tests/resource-id-defaults.test.ts tests/pod-storage-descriptor.test.ts tests/udfs-cli.test.ts",
|
|
66
71
|
"test:pod": "dotenv -e ../linx-models/.env -- vitest run tests/pod.integration.test.ts"
|
|
67
72
|
},
|
|
68
73
|
"dependencies": {
|
|
69
74
|
"@comunica/query-sparql-solid": "^4.0.2",
|
|
70
75
|
"@inrupt/vocab-common-rdf": "^1.0.5",
|
|
71
|
-
"@undefineds.co/drizzle-solid": "^0.3.
|
|
76
|
+
"@undefineds.co/drizzle-solid": "^0.3.13",
|
|
72
77
|
"n3": "^1.26.0",
|
|
73
78
|
"zod": "^3.22.4"
|
|
74
79
|
},
|
|
@@ -77,6 +82,9 @@
|
|
|
77
82
|
"typescript": "^5.4.0",
|
|
78
83
|
"vitest": "^1.6.0"
|
|
79
84
|
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"@undefineds.co/drizzle-solid": "^0.3.13"
|
|
87
|
+
},
|
|
80
88
|
"packageManager": "yarn@1.22.22",
|
|
81
89
|
"files": [
|
|
82
90
|
"dist",
|