@undefineds.co/models 0.2.33 → 0.2.36
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/README.md +13 -16
- package/dist/agent.repository.d.ts +48 -0
- package/dist/agent.repository.js +1 -1
- package/dist/agent.schema.d.ts +24 -0
- package/dist/agent.schema.js +16 -5
- package/dist/ai-config/index.d.ts +28 -2
- package/dist/ai-config/index.js +154 -13
- package/dist/ai-model.schema.js +11 -12
- package/dist/ai-provider.schema.d.ts +4 -0
- package/dist/ai-provider.schema.js +11 -10
- package/dist/ai-runtime.schema.d.ts +4 -4
- package/dist/ai-runtime.schema.js +43 -45
- package/dist/approval.schema.d.ts +0 -1
- package/dist/approval.schema.js +2 -11
- package/dist/audit.schema.d.ts +0 -1
- package/dist/audit.schema.js +2 -11
- package/dist/automation-rule.schema.d.ts +63 -0
- package/dist/automation-rule.schema.js +51 -0
- package/dist/bin/udfs.js +3 -3
- package/dist/chat.repository.d.ts +4 -4
- package/dist/chat.repository.js +1 -1
- package/dist/chat.schema.d.ts +2 -2
- package/dist/chat.schema.js +3 -4
- package/dist/chat.utils.d.ts +7 -0
- package/dist/chat.utils.js +35 -6
- package/dist/contact.repository.d.ts +4 -4
- package/dist/contact.repository.js +1 -1
- package/dist/contact.schema.d.ts +2 -2
- package/dist/contact.schema.js +2 -3
- package/dist/credential.schema.js +21 -22
- package/dist/delivery.schema.d.ts +81 -0
- package/dist/delivery.schema.js +64 -0
- package/dist/evidence.schema.d.ts +38 -0
- package/dist/evidence.schema.js +46 -0
- package/dist/favorite/favorite.schema.d.ts +3 -5
- package/dist/favorite/favorite.schema.js +2 -3
- package/dist/favorite/starred-sync.d.ts +1 -1
- package/dist/favorite/starred-sync.js +11 -13
- package/dist/fixtures/contracts-chat-contact.js +3 -3
- package/dist/grant.schema.d.ts +2 -3
- package/dist/grant.schema.js +6 -9
- package/dist/idea.schema.d.ts +32 -0
- package/dist/idea.schema.js +36 -0
- package/dist/inbox-notification.schema.js +1 -2
- package/dist/index.d.ts +19 -12
- package/dist/index.js +20 -16
- package/dist/issue.repository.js +1 -1
- package/dist/issue.schema.js +1 -2
- package/dist/knowledge/knowledge-folder.schema.d.ts +1 -1
- package/dist/knowledge/knowledge-folder.schema.js +1 -1
- package/dist/message.repository.d.ts +7 -15
- package/dist/message.repository.js +1 -1
- package/dist/message.schema.d.ts +7 -11
- package/dist/message.schema.js +10 -12
- package/dist/namespaces.d.ts +0 -2
- package/dist/namespaces.js +122 -73
- package/dist/pod-storage-descriptor.d.ts +0 -6
- package/dist/pod-storage-descriptor.js +11 -12
- package/dist/profile.repository.d.ts +2 -2
- package/dist/profile.repository.js +2 -2
- package/dist/report.schema.d.ts +58 -0
- package/dist/report.schema.js +73 -0
- package/dist/repository.d.ts +15 -4
- package/dist/repository.js +16 -5
- package/dist/resource-id-defaults.d.ts +1 -9
- package/dist/resource-id-defaults.js +65 -48
- package/dist/resource-refs.d.ts +25 -0
- package/dist/resource-refs.js +45 -0
- package/dist/run.schema.d.ts +13 -17
- package/dist/run.schema.js +12 -13
- package/dist/schedule.schema.d.ts +56 -0
- package/dist/schedule.schema.js +46 -0
- package/dist/schema.d.ts +273 -98
- package/dist/schema.js +18 -3
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/session.schema.d.ts +4 -6
- package/dist/session/session.schema.js +5 -16
- package/dist/session.repository.d.ts +8 -8
- package/dist/session.repository.js +1 -1
- package/dist/settings/settings.schema.d.ts +2 -0
- package/dist/settings/settings.schema.js +8 -3
- package/dist/sidecar/persistence-mapping.d.ts +1 -1
- package/dist/sidecar/sidecar-events.d.ts +36 -36
- package/dist/skill.schema.d.ts +39 -0
- package/dist/skill.schema.js +31 -0
- package/dist/task.schema.d.ts +22 -32
- package/dist/task.schema.js +17 -25
- package/dist/thread.repository.d.ts +4 -8
- package/dist/thread.repository.js +1 -1
- package/dist/thread.schema.d.ts +9 -10
- package/dist/thread.schema.js +24 -13
- package/dist/types/collaboration-blocks.d.ts +3 -1
- package/dist/types/message-block.d.ts +3 -1
- package/dist/vocab/chat.vocab.d.ts +1 -1
- package/dist/vocab/chat.vocab.js +1 -1
- package/dist/vocab/contact.vocab.d.ts +1 -1
- package/dist/vocab/contact.vocab.js +1 -1
- package/dist/vocab/index.d.ts +2 -0
- package/dist/vocab/index.js +2 -0
- package/dist/vocab/message.vocab.d.ts +1 -1
- package/dist/vocab/message.vocab.js +1 -1
- package/dist/vocab/session.vocab.d.ts +16 -0
- package/dist/vocab/session.vocab.js +17 -0
- package/dist/vocab/sidecar.vocab.d.ts +19 -1
- package/dist/vocab/sidecar.vocab.js +22 -4
- package/dist/vocab/thread.vocab.d.ts +1 -0
- package/dist/vocab/thread.vocab.js +1 -0
- package/dist/vocab/workflow.vocab.d.ts +135 -0
- package/dist/vocab/workflow.vocab.js +136 -0
- package/package.json +3 -3
- package/skills/solid-modeling/SKILL.md +57 -17
- package/dist/file/file.schema.d.ts +0 -60
- package/dist/file/file.schema.js +0 -53
- package/dist/file/index.d.ts +0 -1
- package/dist/file/index.js +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizePodDataResourceId } from '@undefineds.co/drizzle-solid';
|
|
1
2
|
export function dateParts(value) {
|
|
2
3
|
const date = value instanceof Date
|
|
3
4
|
? value
|
|
@@ -16,6 +17,15 @@ export function resourceKey(key, prefix) {
|
|
|
16
17
|
? key
|
|
17
18
|
: `${prefix}_${Math.random().toString(36).slice(2, 12)}`;
|
|
18
19
|
}
|
|
20
|
+
export function workflowOwnerDir(row) {
|
|
21
|
+
return taskDir(row)
|
|
22
|
+
?? runDir(row)
|
|
23
|
+
?? deliveryDir(row)
|
|
24
|
+
?? issueDir(row)
|
|
25
|
+
?? threadDir(row)
|
|
26
|
+
?? chatDir(row)
|
|
27
|
+
?? aboutDir(row);
|
|
28
|
+
}
|
|
19
29
|
export function parentDir(id) {
|
|
20
30
|
if (!id)
|
|
21
31
|
return null;
|
|
@@ -25,60 +35,67 @@ export function parentDir(id) {
|
|
|
25
35
|
return null;
|
|
26
36
|
return parts.slice(0, -1).join('/');
|
|
27
37
|
}
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
function chatDir(row) {
|
|
39
|
+
const chat = typeof row?.chat === 'string' ? row.chat : undefined;
|
|
40
|
+
if (!chat)
|
|
30
41
|
return null;
|
|
31
|
-
const
|
|
32
|
-
|
|
42
|
+
const resourceId = normalizePodDataResourceId(chat);
|
|
43
|
+
const match = resourceId.match(/^chat\/(.+)\/index\.ttl#this$/);
|
|
44
|
+
return match?.[1] ? `chat/${match[1]}` : null;
|
|
33
45
|
}
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
function threadDir(row) {
|
|
47
|
+
const thread = typeof row?.thread === 'string' ? row.thread : undefined;
|
|
48
|
+
if (!thread)
|
|
36
49
|
return null;
|
|
37
|
-
const
|
|
38
|
-
|
|
50
|
+
const resourceId = normalizePodDataResourceId(thread);
|
|
51
|
+
const match = resourceId.match(/^((?:chat|task)\/.+)\/index\.ttl#[^#/]+$/);
|
|
52
|
+
return match?.[1] ?? null;
|
|
39
53
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
function taskDir(row) {
|
|
55
|
+
const task = typeof row?.task === 'string' ? row.task : undefined;
|
|
56
|
+
if (!task)
|
|
57
|
+
return null;
|
|
58
|
+
const resourceId = normalizePodDataResourceId(task);
|
|
59
|
+
if (resourceId === 'task/index.ttl#this')
|
|
60
|
+
return 'task';
|
|
61
|
+
const legacyIndexMatch = resourceId.match(/^task\/index\.ttl#([^#/]+)$/);
|
|
62
|
+
if (legacyIndexMatch?.[1])
|
|
63
|
+
return `task/${legacyIndexMatch[1]}`;
|
|
64
|
+
const match = resourceId.match(/^task\/(.+)\.ttl(?:#[^#/]+)?$/);
|
|
65
|
+
return match?.[1] ? `task/${match[1]}` : null;
|
|
45
66
|
}
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return
|
|
67
|
+
function issueDir(row) {
|
|
68
|
+
const issue = typeof row?.issue === 'string' ? row.issue : undefined;
|
|
69
|
+
if (!issue)
|
|
70
|
+
return null;
|
|
71
|
+
const resourceId = normalizePodDataResourceId(issue);
|
|
72
|
+
const match = resourceId.match(/^issues\/(.+)\.ttl(?:#[^#/]+)?$/);
|
|
73
|
+
return match?.[1] ? `issues/${match[1]}` : null;
|
|
53
74
|
}
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return `${commandKind}/${surfaceId}/${yyyy}/${MM}/${dd}/messages.ttl#${localKey}`;
|
|
75
|
+
function deliveryDir(row) {
|
|
76
|
+
const delivery = typeof row?.delivery === 'string' ? row.delivery : undefined;
|
|
77
|
+
if (!delivery)
|
|
78
|
+
return null;
|
|
79
|
+
const resourceId = normalizePodDataResourceId(delivery);
|
|
80
|
+
const match = resourceId.match(/^(.+)\/\d{4}\/\d{2}\/\d{2}\/deliveries\.ttl#[^#/]+$/);
|
|
81
|
+
return match?.[1] ?? null;
|
|
62
82
|
}
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return `${commandKind}/${surfaceId}/${yyyy}/${MM}/${dd}/runs.ttl#${localKey}`;
|
|
83
|
+
function runDir(row) {
|
|
84
|
+
const run = typeof row?.run === 'string' ? row.run : undefined;
|
|
85
|
+
if (!run)
|
|
86
|
+
return null;
|
|
87
|
+
const resourceId = normalizePodDataResourceId(run);
|
|
88
|
+
const match = resourceId.match(/^(.+)\/\d{4}\/\d{2}\/\d{2}\/runs\.ttl#[^#/]+$/);
|
|
89
|
+
return match?.[1] ?? null;
|
|
71
90
|
}
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
:
|
|
82
|
-
const { yyyy, MM, dd } = dateParts(row?.createdAt);
|
|
83
|
-
return `${commandKind}/${surfaceId}/${yyyy}/${MM}/${dd}/runs.ttl#${localKey}`;
|
|
91
|
+
function aboutDir(row) {
|
|
92
|
+
const about = typeof row?.about === 'string' ? row.about : undefined;
|
|
93
|
+
if (!about)
|
|
94
|
+
return null;
|
|
95
|
+
return runDir({ run: about })
|
|
96
|
+
?? deliveryDir({ delivery: about })
|
|
97
|
+
?? taskDir({ task: about })
|
|
98
|
+
?? issueDir({ issue: about })
|
|
99
|
+
?? threadDir({ thread: about })
|
|
100
|
+
?? chatDir({ chat: about });
|
|
84
101
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PodResource, PodResourceTarget } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
type ModelResource = PodResource<any>;
|
|
3
|
+
export type ModelResourceTarget = PodResourceTarget;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated New code should call `resource.buildId(target)` directly.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildModelResourceId(resource: ModelResource, target: ModelResourceTarget): string;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated New code should call `resource.buildIri(webIdOrPodUrl, target)` directly.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildModelResourceIri(webIdOrPodUrl: string, resource: ModelResource, target: ModelResourceTarget): string;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated New code should call `resource.buildIriForDatabase(database, target)` directly.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildModelResourceIriForDatabase(database: unknown, resource: ModelResource, target: ModelResourceTarget): string;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated New code should call `resource.buildIri(...)` and catch only when
|
|
18
|
+
* a nullable result is part of the business contract.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveModelResourceIri(webIdOrPodUrl: string, resource: ModelResource, target: ModelResourceTarget | null | undefined): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated New code should call `resource.resolveIriForDatabase(database, target)`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveModelResourceIriForDatabase(database: unknown, resource: ModelResource, target: ModelResourceTarget | null | undefined): string | null;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated New code should call `resource.buildId(target)` directly.
|
|
3
|
+
*/
|
|
4
|
+
export function buildModelResourceId(resource, target) {
|
|
5
|
+
return resource.buildId(target);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated New code should call `resource.buildIri(webIdOrPodUrl, target)` directly.
|
|
9
|
+
*/
|
|
10
|
+
export function buildModelResourceIri(webIdOrPodUrl, resource, target) {
|
|
11
|
+
return resource.buildIri(webIdOrPodUrl, target);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated New code should call `resource.buildIriForDatabase(database, target)` directly.
|
|
15
|
+
*/
|
|
16
|
+
export function buildModelResourceIriForDatabase(database, resource, target) {
|
|
17
|
+
return resource.buildIriForDatabase(database, target);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated New code should call `resource.buildIri(...)` and catch only when
|
|
21
|
+
* a nullable result is part of the business contract.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveModelResourceIri(webIdOrPodUrl, resource, target) {
|
|
24
|
+
if (!target)
|
|
25
|
+
return null;
|
|
26
|
+
try {
|
|
27
|
+
return buildModelResourceIri(webIdOrPodUrl, resource, target);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated New code should call `resource.resolveIriForDatabase(database, target)`.
|
|
35
|
+
*/
|
|
36
|
+
export function resolveModelResourceIriForDatabase(database, resource, target) {
|
|
37
|
+
if (!target)
|
|
38
|
+
return null;
|
|
39
|
+
try {
|
|
40
|
+
return buildModelResourceIriForDatabase(database, resource, target);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/run.schema.d.ts
CHANGED
|
@@ -33,9 +33,10 @@ export type RunStepTypeValue = (typeof RunStepType)[keyof typeof RunStepType];
|
|
|
33
33
|
*/
|
|
34
34
|
export declare const runResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
35
35
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
36
|
-
commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
37
|
-
surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
38
36
|
task: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
37
|
+
delivery: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
38
|
+
trigger: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
39
|
+
input: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
39
40
|
thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
40
41
|
workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
41
42
|
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
@@ -56,26 +57,24 @@ export declare const runResource: import("@undefineds.co/drizzle-solid/dist/core
|
|
|
56
57
|
/**
|
|
57
58
|
* RunStep resource.
|
|
58
59
|
*
|
|
59
|
-
* Append-only execution facts emitted while a Run executes. `
|
|
60
|
-
*
|
|
61
|
-
* relation
|
|
60
|
+
* Append-only execution facts emitted while a Run executes. `run` is the
|
|
61
|
+
* semantic RDF relation to the Run; storage colocation is derived from that
|
|
62
|
+
* relation by the id default helper.
|
|
62
63
|
*/
|
|
63
64
|
export declare const runStepResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
64
65
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
65
|
-
commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
66
|
-
surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
67
|
-
runId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
68
66
|
run: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
69
|
-
|
|
67
|
+
stepType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
70
68
|
message: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
71
|
-
|
|
69
|
+
payload: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
72
70
|
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
73
71
|
}>>;
|
|
74
72
|
export declare const runTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
75
73
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
76
|
-
commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
77
|
-
surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
78
74
|
task: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
75
|
+
delivery: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
76
|
+
trigger: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
77
|
+
input: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
79
78
|
thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
80
79
|
workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
81
80
|
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
@@ -95,13 +94,10 @@ export declare const runTable: import("@undefineds.co/drizzle-solid/dist/core/sc
|
|
|
95
94
|
}>>;
|
|
96
95
|
export declare const runStepTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
97
96
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
98
|
-
commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
99
|
-
surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
100
|
-
runId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
101
97
|
run: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
102
|
-
|
|
98
|
+
stepType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
103
99
|
message: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
104
|
-
|
|
100
|
+
payload: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
105
101
|
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
106
102
|
}>>;
|
|
107
103
|
export type RunRow = typeof runResource.$inferSelect;
|
package/dist/run.schema.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { id, object, podTable, string, timestamp, uri } from '@undefineds.co/drizzle-solid';
|
|
2
2
|
import { DCTerms, UDFS } from './namespaces.js';
|
|
3
|
+
import { deliveryResource } from './delivery.schema.js';
|
|
3
4
|
import { taskResource } from './task.schema.js';
|
|
4
5
|
import { threadResource } from './thread.schema.js';
|
|
5
|
-
import { runResourceId, runStepResourceId } from './resource-id-defaults.js';
|
|
6
6
|
export const RunStatus = {
|
|
7
7
|
QUEUED: 'queued',
|
|
8
8
|
RUNNING: 'running',
|
|
@@ -35,10 +35,11 @@ export const RunStepType = {
|
|
|
35
35
|
* Task describe command shape; Run describes the concrete runtime execution.
|
|
36
36
|
*/
|
|
37
37
|
export const runResource = podTable('run', {
|
|
38
|
-
id: id('id').default(
|
|
39
|
-
commandKind: string('commandKind').predicate(UDFS.commandKind).notNull().default('chat'),
|
|
40
|
-
surfaceId: string('surfaceId').predicate(UDFS.surfaceId).notNull().default('default'),
|
|
38
|
+
id: id('id').default('{thread.dir}/{yyyy}/{MM}/{dd}/runs.ttl#{key}'),
|
|
41
39
|
task: uri('task').predicate(UDFS.task).link(taskResource),
|
|
40
|
+
delivery: uri('delivery').predicate(UDFS.delivery).link(deliveryResource),
|
|
41
|
+
trigger: uri('trigger').predicate(UDFS.trigger),
|
|
42
|
+
input: uri('input').predicate(UDFS.input),
|
|
42
43
|
thread: uri('thread').predicate(UDFS.inThread).notNull().link(threadResource),
|
|
43
44
|
workspace: uri('workspace').predicate(UDFS.workspace).notNull(),
|
|
44
45
|
status: string('status').predicate(UDFS.status).notNull().default(RunStatus.QUEUED),
|
|
@@ -50,6 +51,7 @@ export const runResource = podTable('run', {
|
|
|
50
51
|
heartbeatAt: timestamp('heartbeatAt').predicate(UDFS.heartbeatAt),
|
|
51
52
|
cancelRequestedAt: timestamp('cancelRequestedAt').predicate(UDFS.cancelRequestedAt),
|
|
52
53
|
error: string('error').predicate(UDFS.error),
|
|
54
|
+
// Opaque protocol/local/UI metadata only. Shared relations must be explicit URI fields.
|
|
53
55
|
metadata: object('metadata').predicate(UDFS.metadata),
|
|
54
56
|
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
55
57
|
startedAt: timestamp('startedAt').predicate(UDFS.startedAt),
|
|
@@ -64,19 +66,16 @@ export const runResource = podTable('run', {
|
|
|
64
66
|
/**
|
|
65
67
|
* RunStep resource.
|
|
66
68
|
*
|
|
67
|
-
* Append-only execution facts emitted while a Run executes. `
|
|
68
|
-
*
|
|
69
|
-
* relation
|
|
69
|
+
* Append-only execution facts emitted while a Run executes. `run` is the
|
|
70
|
+
* semantic RDF relation to the Run; storage colocation is derived from that
|
|
71
|
+
* relation by the id default helper.
|
|
70
72
|
*/
|
|
71
73
|
export const runStepResource = podTable('run_step', {
|
|
72
|
-
id: id('id').default(
|
|
73
|
-
commandKind: string('commandKind').predicate(UDFS.commandKind).notNull().default('chat'),
|
|
74
|
-
surfaceId: string('surfaceId').predicate(UDFS.surfaceId).notNull().default('default'),
|
|
75
|
-
runId: string('runId').predicate(UDFS.runId).notNull(),
|
|
74
|
+
id: id('id').default('{run.doc}#{key}'),
|
|
76
75
|
run: uri('run').predicate(UDFS.run).notNull().link(runResource),
|
|
77
|
-
|
|
76
|
+
stepType: string('stepType').predicate(UDFS.stepType).notNull(),
|
|
78
77
|
message: string('message').predicate(DCTerms.description),
|
|
79
|
-
|
|
78
|
+
payload: object('payload').predicate(UDFS.payload),
|
|
80
79
|
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
81
80
|
}, {
|
|
82
81
|
base: '/.data/',
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type ScheduleStatusType = 'active' | 'paused' | 'completed' | 'failed' | 'cancelled';
|
|
2
|
+
export type ScheduleKindType = 'once' | 'interval' | 'cron';
|
|
3
|
+
export declare const ScheduleStatus: {
|
|
4
|
+
readonly ACTIVE: "active";
|
|
5
|
+
readonly PAUSED: "paused";
|
|
6
|
+
readonly COMPLETED: "completed";
|
|
7
|
+
readonly FAILED: "failed";
|
|
8
|
+
readonly CANCELLED: "cancelled";
|
|
9
|
+
};
|
|
10
|
+
export declare const ScheduleKind: {
|
|
11
|
+
readonly ONCE: "once";
|
|
12
|
+
readonly INTERVAL: "interval";
|
|
13
|
+
readonly CRON: "cron";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Schedule resource.
|
|
17
|
+
*
|
|
18
|
+
* Schedule owns time-based triggering for a Task. It intentionally does not
|
|
19
|
+
* select a runner or record a concrete execution attempt; those belong to Run.
|
|
20
|
+
*
|
|
21
|
+
* The id template is intentionally left unset. Callers must provide an exact
|
|
22
|
+
* base-relative id until the durable storage path is designed.
|
|
23
|
+
*/
|
|
24
|
+
export declare const scheduleResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
25
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
26
|
+
task: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
27
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
28
|
+
scheduleKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
29
|
+
cron: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
30
|
+
intervalSeconds: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, false>;
|
|
31
|
+
timezone: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
32
|
+
startsAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
33
|
+
nextRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
34
|
+
lastRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
35
|
+
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
36
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
37
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
38
|
+
}>>;
|
|
39
|
+
export declare const scheduleTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
40
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
41
|
+
task: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
42
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
43
|
+
scheduleKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
44
|
+
cron: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
45
|
+
intervalSeconds: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, false>;
|
|
46
|
+
timezone: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
47
|
+
startsAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
48
|
+
nextRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
49
|
+
lastRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
50
|
+
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
51
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
52
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
53
|
+
}>>;
|
|
54
|
+
export type ScheduleRow = typeof scheduleResource.$inferSelect;
|
|
55
|
+
export type ScheduleInsert = typeof scheduleResource.$inferInsert;
|
|
56
|
+
export type ScheduleUpdate = typeof scheduleResource.$inferUpdate;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { id, integer, object, podTable, string, timestamp, uri } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
import { DCTerms, UDFS } from './namespaces.js';
|
|
3
|
+
import { taskResource } from './task.schema.js';
|
|
4
|
+
export const ScheduleStatus = {
|
|
5
|
+
ACTIVE: 'active',
|
|
6
|
+
PAUSED: 'paused',
|
|
7
|
+
COMPLETED: 'completed',
|
|
8
|
+
FAILED: 'failed',
|
|
9
|
+
CANCELLED: 'cancelled',
|
|
10
|
+
};
|
|
11
|
+
export const ScheduleKind = {
|
|
12
|
+
ONCE: 'once',
|
|
13
|
+
INTERVAL: 'interval',
|
|
14
|
+
CRON: 'cron',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Schedule resource.
|
|
18
|
+
*
|
|
19
|
+
* Schedule owns time-based triggering for a Task. It intentionally does not
|
|
20
|
+
* select a runner or record a concrete execution attempt; those belong to Run.
|
|
21
|
+
*
|
|
22
|
+
* The id template is intentionally left unset. Callers must provide an exact
|
|
23
|
+
* base-relative id until the durable storage path is designed.
|
|
24
|
+
*/
|
|
25
|
+
export const scheduleResource = podTable('schedule', {
|
|
26
|
+
id: id('id'),
|
|
27
|
+
task: uri('task').predicate(UDFS.task).notNull().link(taskResource),
|
|
28
|
+
status: string('status').predicate(UDFS.status).notNull().default(ScheduleStatus.ACTIVE),
|
|
29
|
+
scheduleKind: string('scheduleKind').predicate(UDFS.scheduleKind).notNull().default(ScheduleKind.ONCE),
|
|
30
|
+
cron: string('cron').predicate(UDFS.cron),
|
|
31
|
+
intervalSeconds: integer('intervalSeconds').predicate(UDFS.intervalSeconds),
|
|
32
|
+
timezone: string('timezone').predicate(UDFS.timezone),
|
|
33
|
+
startsAt: timestamp('startsAt').predicate(UDFS.startsAt),
|
|
34
|
+
nextRunAt: timestamp('nextRunAt').predicate(UDFS.nextRunAt),
|
|
35
|
+
lastRunAt: timestamp('lastRunAt').predicate(UDFS.lastRunAt),
|
|
36
|
+
metadata: object('metadata').predicate(UDFS.metadata),
|
|
37
|
+
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
38
|
+
updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
|
|
39
|
+
}, {
|
|
40
|
+
base: '/.data/',
|
|
41
|
+
sparqlEndpoint: '/.data/-/sparql',
|
|
42
|
+
type: UDFS.Schedule,
|
|
43
|
+
namespace: UDFS,
|
|
44
|
+
});
|
|
45
|
+
// Compatibility alias. New model code should prefer `scheduleResource`.
|
|
46
|
+
export const scheduleTable = scheduleResource;
|