@undefineds.co/models 0.2.34 → 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 -14
- package/dist/index.js +20 -18
- 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 -92
- 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 -12
- package/dist/resource-id-defaults.js +65 -72
- 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 -194
- package/dist/schema.js +18 -10
- 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
- package/dist/matrix.repository.d.ts +0 -183
- package/dist/matrix.repository.js +0 -20
- package/dist/matrix.schema.d.ts +0 -136
- package/dist/matrix.schema.js +0 -100
package/dist/contact.schema.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare const contactResource: import("@undefineds.co/drizzle-solid/dist/
|
|
|
32
32
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
33
33
|
name: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
34
34
|
avatarUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
35
|
-
|
|
35
|
+
entity: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
36
36
|
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, true>;
|
|
37
37
|
contactType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
38
38
|
isPublic: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
@@ -54,7 +54,7 @@ export declare const contactTable: import("@undefineds.co/drizzle-solid/dist/cor
|
|
|
54
54
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
55
55
|
name: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
56
56
|
avatarUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
57
|
-
|
|
57
|
+
entity: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
58
58
|
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, true>;
|
|
59
59
|
contactType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
60
60
|
isPublic: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
package/dist/contact.schema.js
CHANGED
|
@@ -33,12 +33,12 @@ export function normalizeContactGender(value, fallback) {
|
|
|
33
33
|
* Contact resource - unified contact index for all contact types.
|
|
34
34
|
*/
|
|
35
35
|
export const contactResource = podTable('contact', {
|
|
36
|
-
id: id('id'),
|
|
36
|
+
id: id('id').default('{key}.ttl'),
|
|
37
37
|
// Display information (cached for search/display)
|
|
38
38
|
name: string('name').predicate(VCARD.fn).notNull(),
|
|
39
39
|
avatarUrl: uri('avatarUrl').predicate(VCARD.hasPhoto),
|
|
40
40
|
// The actual entity this contact represents
|
|
41
|
-
|
|
41
|
+
entity: uri('entity').predicate(FOAF.primaryTopic).notNull(),
|
|
42
42
|
// Semantic classifier for the represented entity.
|
|
43
43
|
rdfType: uri('rdfType').predicate(RDF.type).notNull().default(ContactClass.PERSON),
|
|
44
44
|
// Runtime/source hint for fetch/handler selection.
|
|
@@ -68,7 +68,6 @@ export const contactResource = podTable('contact', {
|
|
|
68
68
|
sparqlEndpoint: '/.data/contacts/-/sparql',
|
|
69
69
|
type: VCARD.Individual,
|
|
70
70
|
namespace: UDFS,
|
|
71
|
-
subjectTemplate: '{id}.ttl',
|
|
72
71
|
});
|
|
73
72
|
// Compatibility alias. New model code should prefer `contactResource`.
|
|
74
73
|
export const contactTable = contactResource;
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { boolean, id, integer, podTable, string, timestamp, uri } from "@undefineds.co/drizzle-solid";
|
|
2
|
-
import {
|
|
2
|
+
import { UDFS } from "./namespaces.js";
|
|
3
3
|
export const credentialResource = podTable("credential", {
|
|
4
|
-
id: id("id"),
|
|
5
|
-
provider: uri("provider").predicate(
|
|
6
|
-
service: string("service").predicate(
|
|
7
|
-
status: string("status").predicate(
|
|
8
|
-
apiKey: string("apiKey").predicate(
|
|
9
|
-
baseUrl: string("baseUrl").predicate(
|
|
10
|
-
proxyUrl: string("proxyUrl").predicate(
|
|
11
|
-
label: string("label").predicate(
|
|
12
|
-
isDefault: boolean("isDefault").predicate(
|
|
13
|
-
lastUsedAt: timestamp("lastUsedAt").predicate(
|
|
14
|
-
failCount: integer("failCount").predicate(
|
|
15
|
-
rateLimitResetAt: timestamp("rateLimitResetAt").predicate(
|
|
16
|
-
oauthRefreshToken: string("oauthRefreshToken").predicate(
|
|
17
|
-
oauthAccessToken: string("oauthAccessToken").predicate(
|
|
18
|
-
oauthExpiresAt: timestamp("oauthExpiresAt").predicate(
|
|
19
|
-
projectId: string("projectId").predicate(
|
|
20
|
-
organizationId: string("organizationId").predicate(
|
|
4
|
+
id: id("id").default("credentials.ttl#{key}"),
|
|
5
|
+
provider: uri("provider").predicate(UDFS.provider).link("aiProvider"),
|
|
6
|
+
service: string("service").predicate(UDFS.service).notNull().default("ai"),
|
|
7
|
+
status: string("status").predicate(UDFS.status).notNull().default("active"),
|
|
8
|
+
apiKey: string("apiKey").predicate(UDFS.apiKey),
|
|
9
|
+
baseUrl: string("baseUrl").predicate(UDFS.baseUrl),
|
|
10
|
+
proxyUrl: string("proxyUrl").predicate(UDFS.proxyUrl),
|
|
11
|
+
label: string("label").predicate(UDFS.label),
|
|
12
|
+
isDefault: boolean("isDefault").predicate(UDFS.isDefault).default(false),
|
|
13
|
+
lastUsedAt: timestamp("lastUsedAt").predicate(UDFS.lastUsedAt),
|
|
14
|
+
failCount: integer("failCount").predicate(UDFS.failCount).default(0),
|
|
15
|
+
rateLimitResetAt: timestamp("rateLimitResetAt").predicate(UDFS.rateLimitResetAt),
|
|
16
|
+
oauthRefreshToken: string("oauthRefreshToken").predicate(UDFS.oauthRefreshToken),
|
|
17
|
+
oauthAccessToken: string("oauthAccessToken").predicate(UDFS.oauthAccessToken),
|
|
18
|
+
oauthExpiresAt: timestamp("oauthExpiresAt").predicate(UDFS.oauthExpiresAt),
|
|
19
|
+
projectId: string("projectId").predicate(UDFS.projectId),
|
|
20
|
+
organizationId: string("organizationId").predicate(UDFS.organizationId),
|
|
21
21
|
}, {
|
|
22
|
-
base: "/settings/
|
|
23
|
-
type:
|
|
24
|
-
namespace:
|
|
25
|
-
subjectTemplate: "#{id}",
|
|
22
|
+
base: "/settings/",
|
|
23
|
+
type: UDFS.Credential,
|
|
24
|
+
namespace: UDFS,
|
|
26
25
|
});
|
|
27
26
|
// Compatibility aliases. New model code should prefer `credentialResource`.
|
|
28
27
|
export const credentialTable = credentialResource;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type DeliveryStatusType = 'pending' | 'dispatched' | 'consumed' | 'completed' | 'failed' | 'cancelled';
|
|
2
|
+
export type DeliveryKindType = 'task_dispatch' | 'runtime_intent' | 'runtime_followup' | 'steer' | 'approval_request' | 'input_request' | 'delegated_response' | 'report' | 'mention_dispatch';
|
|
3
|
+
export declare const DeliveryStatus: {
|
|
4
|
+
readonly PENDING: "pending";
|
|
5
|
+
readonly DISPATCHED: "dispatched";
|
|
6
|
+
readonly CONSUMED: "consumed";
|
|
7
|
+
readonly COMPLETED: "completed";
|
|
8
|
+
readonly FAILED: "failed";
|
|
9
|
+
readonly CANCELLED: "cancelled";
|
|
10
|
+
};
|
|
11
|
+
export declare const DeliveryKind: {
|
|
12
|
+
readonly TASK_DISPATCH: "task_dispatch";
|
|
13
|
+
readonly RUNTIME_INTENT: "runtime_intent";
|
|
14
|
+
readonly RUNTIME_FOLLOWUP: "runtime_followup";
|
|
15
|
+
readonly STEER: "steer";
|
|
16
|
+
readonly APPROVAL_REQUEST: "approval_request";
|
|
17
|
+
readonly INPUT_REQUEST: "input_request";
|
|
18
|
+
readonly DELEGATED_RESPONSE: "delegated_response";
|
|
19
|
+
readonly REPORT: "report";
|
|
20
|
+
readonly MENTION_DISPATCH: "mention_dispatch";
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Delivery resource.
|
|
24
|
+
*
|
|
25
|
+
* Delivery is an internal handoff envelope between Threads, Sessions, Agents,
|
|
26
|
+
* and runtimes. It is not an Inbox item; user-visible attention can be
|
|
27
|
+
* projected from a Delivery into Inbox/Approval only when needed.
|
|
28
|
+
*/
|
|
29
|
+
export declare const deliveryResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
30
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
31
|
+
kind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
32
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
33
|
+
task: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
34
|
+
source: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
35
|
+
target: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
36
|
+
chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
37
|
+
thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
38
|
+
targetThread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
39
|
+
targetSession: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
40
|
+
actor: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
41
|
+
object: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
42
|
+
objective: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
43
|
+
payload: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
44
|
+
projection: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
45
|
+
projectedRole: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
46
|
+
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
47
|
+
error: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
48
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
49
|
+
dispatchedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
50
|
+
consumedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
51
|
+
completedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
52
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
53
|
+
}>>;
|
|
54
|
+
export declare const deliveryTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
55
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
56
|
+
kind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
57
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
58
|
+
task: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
59
|
+
source: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
60
|
+
target: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
61
|
+
chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
62
|
+
thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
63
|
+
targetThread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
64
|
+
targetSession: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
65
|
+
actor: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
66
|
+
object: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
67
|
+
objective: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
68
|
+
payload: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
69
|
+
projection: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
70
|
+
projectedRole: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
71
|
+
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
72
|
+
error: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
73
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
74
|
+
dispatchedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
75
|
+
consumedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
76
|
+
completedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
77
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
78
|
+
}>>;
|
|
79
|
+
export type DeliveryRow = typeof deliveryResource.$inferSelect;
|
|
80
|
+
export type DeliveryInsert = typeof deliveryResource.$inferInsert;
|
|
81
|
+
export type DeliveryUpdate = typeof deliveryResource.$inferUpdate;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { id, object, podTable, string, text, timestamp, uri } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
import { AS, DCTerms, UDFS } from './namespaces.js';
|
|
3
|
+
import { chatResource } from './chat.schema.js';
|
|
4
|
+
import { threadResource } from './thread.schema.js';
|
|
5
|
+
import { taskResource } from './task.schema.js';
|
|
6
|
+
export const DeliveryStatus = {
|
|
7
|
+
PENDING: 'pending',
|
|
8
|
+
DISPATCHED: 'dispatched',
|
|
9
|
+
CONSUMED: 'consumed',
|
|
10
|
+
COMPLETED: 'completed',
|
|
11
|
+
FAILED: 'failed',
|
|
12
|
+
CANCELLED: 'cancelled',
|
|
13
|
+
};
|
|
14
|
+
export const DeliveryKind = {
|
|
15
|
+
TASK_DISPATCH: 'task_dispatch',
|
|
16
|
+
RUNTIME_INTENT: 'runtime_intent',
|
|
17
|
+
RUNTIME_FOLLOWUP: 'runtime_followup',
|
|
18
|
+
STEER: 'steer',
|
|
19
|
+
APPROVAL_REQUEST: 'approval_request',
|
|
20
|
+
INPUT_REQUEST: 'input_request',
|
|
21
|
+
DELEGATED_RESPONSE: 'delegated_response',
|
|
22
|
+
REPORT: 'report',
|
|
23
|
+
MENTION_DISPATCH: 'mention_dispatch',
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Delivery resource.
|
|
27
|
+
*
|
|
28
|
+
* Delivery is an internal handoff envelope between Threads, Sessions, Agents,
|
|
29
|
+
* and runtimes. It is not an Inbox item; user-visible attention can be
|
|
30
|
+
* projected from a Delivery into Inbox/Approval only when needed.
|
|
31
|
+
*/
|
|
32
|
+
export const deliveryResource = podTable('delivery', {
|
|
33
|
+
id: id('id').default('{thread.dir}/{yyyy}/{MM}/{dd}/deliveries.ttl#{key}'),
|
|
34
|
+
kind: string('kind').predicate(UDFS.deliveryKind).notNull().default(DeliveryKind.TASK_DISPATCH),
|
|
35
|
+
status: string('status').predicate(UDFS.status).notNull().default(DeliveryStatus.PENDING),
|
|
36
|
+
task: uri('task').predicate(UDFS.task).link(taskResource),
|
|
37
|
+
source: uri('source').predicate(DCTerms.source),
|
|
38
|
+
target: uri('target').predicate(AS.target),
|
|
39
|
+
chat: uri('chat').predicate(UDFS.conversation).link(chatResource),
|
|
40
|
+
thread: uri('thread').predicate(UDFS.inThread).notNull().link(threadResource),
|
|
41
|
+
targetThread: uri('targetThread').predicate(UDFS.targetThread).link(threadResource),
|
|
42
|
+
targetSession: uri('targetSession').predicate(UDFS.targetSession),
|
|
43
|
+
actor: uri('actor').predicate(AS.actor),
|
|
44
|
+
object: uri('object').predicate(AS.object),
|
|
45
|
+
objective: text('objective').predicate(UDFS.objective),
|
|
46
|
+
payload: object('payload').predicate(UDFS.payload),
|
|
47
|
+
projection: object('projection').predicate(UDFS.projection),
|
|
48
|
+
projectedRole: string('projectedRole').predicate(UDFS.projectedRole),
|
|
49
|
+
// Opaque protocol/local/UI metadata only. Shared relations must be explicit URI fields.
|
|
50
|
+
metadata: object('metadata').predicate(UDFS.metadata),
|
|
51
|
+
error: text('error').predicate(UDFS.error),
|
|
52
|
+
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
53
|
+
dispatchedAt: timestamp('dispatchedAt').predicate(UDFS.startedAt),
|
|
54
|
+
consumedAt: timestamp('consumedAt').predicate(UDFS.consumedAt),
|
|
55
|
+
completedAt: timestamp('completedAt').predicate(UDFS.completedAt),
|
|
56
|
+
updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
|
|
57
|
+
}, {
|
|
58
|
+
base: '/.data/',
|
|
59
|
+
sparqlEndpoint: '/.data/-/sparql',
|
|
60
|
+
type: UDFS.Delivery,
|
|
61
|
+
namespace: UDFS,
|
|
62
|
+
});
|
|
63
|
+
// Compatibility alias. New model code should prefer `deliveryResource`.
|
|
64
|
+
export const deliveryTable = deliveryResource;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type EvidenceKindType = 'test' | 'runtime_log' | 'diff' | 'artifact' | 'pod_projection' | 'user_validation' | 'review_finding' | 'migration_note' | 'manual_observation';
|
|
2
|
+
export declare const EvidenceKind: {
|
|
3
|
+
readonly TEST: "test";
|
|
4
|
+
readonly RUNTIME_LOG: "runtime_log";
|
|
5
|
+
readonly DIFF: "diff";
|
|
6
|
+
readonly ARTIFACT: "artifact";
|
|
7
|
+
readonly POD_PROJECTION: "pod_projection";
|
|
8
|
+
readonly USER_VALIDATION: "user_validation";
|
|
9
|
+
readonly REVIEW_FINDING: "review_finding";
|
|
10
|
+
readonly MIGRATION_NOTE: "migration_note";
|
|
11
|
+
readonly MANUAL_OBSERVATION: "manual_observation";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Evidence resource.
|
|
15
|
+
*
|
|
16
|
+
* Evidence is append-only proof or finding. The resource subject is the
|
|
17
|
+
* evidence file/record itself; `about` points to the work/control object it
|
|
18
|
+
* supports. It is not a status owner by itself.
|
|
19
|
+
*/
|
|
20
|
+
export declare const evidenceResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
21
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
22
|
+
evidenceKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
23
|
+
about: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
24
|
+
issue: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
25
|
+
task: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
26
|
+
delivery: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
27
|
+
run: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
28
|
+
thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
29
|
+
summary: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
30
|
+
source: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
31
|
+
actor: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
32
|
+
outcome: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
33
|
+
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
34
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
35
|
+
}>>;
|
|
36
|
+
export type EvidenceRow = typeof evidenceResource.$inferSelect;
|
|
37
|
+
export type EvidenceInsert = typeof evidenceResource.$inferInsert;
|
|
38
|
+
export type EvidenceUpdate = typeof evidenceResource.$inferUpdate;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { id, object, podTable, string, text, timestamp, uri } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
import { DCTerms, SCHEMA, UDFS } from './namespaces.js';
|
|
3
|
+
import { deliveryResource } from './delivery.schema.js';
|
|
4
|
+
import { issueResource } from './issue.schema.js';
|
|
5
|
+
import { runResource } from './run.schema.js';
|
|
6
|
+
import { taskResource } from './task.schema.js';
|
|
7
|
+
import { threadResource } from './thread.schema.js';
|
|
8
|
+
export const EvidenceKind = {
|
|
9
|
+
TEST: 'test',
|
|
10
|
+
RUNTIME_LOG: 'runtime_log',
|
|
11
|
+
DIFF: 'diff',
|
|
12
|
+
ARTIFACT: 'artifact',
|
|
13
|
+
POD_PROJECTION: 'pod_projection',
|
|
14
|
+
USER_VALIDATION: 'user_validation',
|
|
15
|
+
REVIEW_FINDING: 'review_finding',
|
|
16
|
+
MIGRATION_NOTE: 'migration_note',
|
|
17
|
+
MANUAL_OBSERVATION: 'manual_observation',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Evidence resource.
|
|
21
|
+
*
|
|
22
|
+
* Evidence is append-only proof or finding. The resource subject is the
|
|
23
|
+
* evidence file/record itself; `about` points to the work/control object it
|
|
24
|
+
* supports. It is not a status owner by itself.
|
|
25
|
+
*/
|
|
26
|
+
export const evidenceResource = podTable('evidence', {
|
|
27
|
+
id: id('id').default('evidence/{yyyy}/{MM}/{dd}.ttl#{key}'),
|
|
28
|
+
evidenceKind: string('evidenceKind').predicate(UDFS.evidenceKind).notNull(),
|
|
29
|
+
about: uri('about').predicate(SCHEMA.about).notNull(),
|
|
30
|
+
issue: uri('issue').predicate(UDFS.issue).link(issueResource),
|
|
31
|
+
task: uri('task').predicate(UDFS.task).link(taskResource),
|
|
32
|
+
delivery: uri('delivery').predicate(UDFS.delivery).link(deliveryResource),
|
|
33
|
+
run: uri('run').predicate(UDFS.run).link(runResource),
|
|
34
|
+
thread: uri('thread').predicate(UDFS.inThread).link(threadResource),
|
|
35
|
+
summary: text('summary').predicate(DCTerms.abstract),
|
|
36
|
+
source: uri('source').predicate(DCTerms.source),
|
|
37
|
+
actor: uri('actor').predicate(DCTerms.creator),
|
|
38
|
+
outcome: string('outcome').predicate(UDFS.outcome),
|
|
39
|
+
metadata: object('metadata').predicate(UDFS.metadata),
|
|
40
|
+
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
41
|
+
}, {
|
|
42
|
+
base: '/.data/',
|
|
43
|
+
sparqlEndpoint: '/.data/-/sparql',
|
|
44
|
+
type: UDFS.Evidence,
|
|
45
|
+
namespace: UDFS,
|
|
46
|
+
});
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
* 收藏项 - 基于 Solid Pod 存储
|
|
4
4
|
*
|
|
5
5
|
* 支持收藏:Chat, Thread, Contact, Message 等
|
|
6
|
-
*
|
|
6
|
+
* targetType 使用 RDF type URI 标识实体类型
|
|
7
7
|
*/
|
|
8
8
|
export declare const favoriteResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
9
9
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
10
10
|
targetType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
11
|
-
|
|
11
|
+
target: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
12
12
|
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
13
13
|
snapshotContent: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
14
14
|
snapshotAuthor: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
15
15
|
sourceModule: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
16
|
-
sourceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
17
16
|
searchText: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
18
17
|
snapshotMeta: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
19
18
|
favoredAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
@@ -22,12 +21,11 @@ export declare const favoriteResource: import("@undefineds.co/drizzle-solid/dist
|
|
|
22
21
|
export declare const favoriteTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
23
22
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
24
23
|
targetType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
25
|
-
|
|
24
|
+
target: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
26
25
|
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
27
26
|
snapshotContent: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
28
27
|
snapshotAuthor: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
29
28
|
sourceModule: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
30
|
-
sourceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
31
29
|
searchText: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
32
30
|
snapshotMeta: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
33
31
|
favoredAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
@@ -5,20 +5,19 @@ import { UDFS, DCTerms, SCHEMA, RDF } from "../namespaces.js";
|
|
|
5
5
|
* 收藏项 - 基于 Solid Pod 存储
|
|
6
6
|
*
|
|
7
7
|
* 支持收藏:Chat, Thread, Contact, Message 等
|
|
8
|
-
*
|
|
8
|
+
* targetType 使用 RDF type URI 标识实体类型
|
|
9
9
|
*/
|
|
10
10
|
export const favoriteResource = podTable("favorite", {
|
|
11
11
|
id: id("id"),
|
|
12
12
|
// 收藏目标
|
|
13
13
|
targetType: uri("targetType").predicate(RDF.type).notNull(), // RDF type URI (e.g., MEETING.LongChat)
|
|
14
|
-
|
|
14
|
+
target: uri("target").predicate(UDFS.favoriteTarget).notNull(), // 收藏对象的 URI
|
|
15
15
|
// 快照信息(用于快速显示,避免每次查询原始资源)
|
|
16
16
|
title: string("title").predicate(DCTerms.title).notNull(),
|
|
17
17
|
snapshotContent: text("snapshotContent").predicate(SCHEMA.text),
|
|
18
18
|
snapshotAuthor: string("snapshotAuthor").predicate(SCHEMA.author),
|
|
19
19
|
// V2: 来源追踪
|
|
20
20
|
sourceModule: string("sourceModule").predicate(UDFS.sourceModule), // 'chat' | 'contacts' | 'files' | 'messages' | 'thread'
|
|
21
|
-
sourceId: string("sourceId").predicate(UDFS.sourceId), // 来源对象业务 ID
|
|
22
21
|
// V2: 检索
|
|
23
22
|
searchText: text("searchText").predicate(UDFS.searchText), // 归一化检索文本
|
|
24
23
|
// V2: 快照元数据
|
|
@@ -9,9 +9,8 @@ import { VCARD } from '@inrupt/vocab-common-rdf';
|
|
|
9
9
|
*/
|
|
10
10
|
async function createFavorite(_ctx, config, record) {
|
|
11
11
|
const { rdfType, sourceModule, extractor } = config;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
if (!targetUri) {
|
|
12
|
+
const target = record['@id'] || record.id;
|
|
13
|
+
if (!target) {
|
|
15
14
|
console.warn('[StarredSync] Cannot create favorite: missing target URI');
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
@@ -19,13 +18,12 @@ async function createFavorite(_ctx, config, record) {
|
|
|
19
18
|
const favoriteData = {
|
|
20
19
|
id: crypto.randomUUID(),
|
|
21
20
|
targetType: rdfType,
|
|
22
|
-
|
|
21
|
+
target,
|
|
23
22
|
title,
|
|
24
23
|
snapshotContent: extractor.getContent?.(record),
|
|
25
24
|
snapshotAuthor: extractor.getAuthor?.(record),
|
|
26
25
|
// V2 fields
|
|
27
26
|
sourceModule,
|
|
28
|
-
sourceId,
|
|
29
27
|
searchText: extractor.getSearchText?.(record) ?? title,
|
|
30
28
|
snapshotMeta: extractor.getSnapshotMeta?.(record),
|
|
31
29
|
favoredAt: new Date(),
|
|
@@ -35,7 +33,7 @@ async function createFavorite(_ctx, config, record) {
|
|
|
35
33
|
const db = getDbInstance();
|
|
36
34
|
if (db) {
|
|
37
35
|
await db.insert(favoriteResource).values(favoriteData).execute();
|
|
38
|
-
console.log(`[StarredSync] Created favorite: ${rdfType} → ${
|
|
36
|
+
console.log(`[StarredSync] Created favorite: ${rdfType} → ${target}`);
|
|
39
37
|
}
|
|
40
38
|
else {
|
|
41
39
|
console.warn('[StarredSync] No db instance registered');
|
|
@@ -46,18 +44,18 @@ async function createFavorite(_ctx, config, record) {
|
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
/**
|
|
49
|
-
* 删除 Favorite 记录(通过
|
|
47
|
+
* 删除 Favorite 记录(通过 target 查找)
|
|
50
48
|
*/
|
|
51
|
-
async function deleteFavorite(_ctx,
|
|
52
|
-
if (!
|
|
49
|
+
async function deleteFavorite(_ctx, target) {
|
|
50
|
+
if (!target)
|
|
53
51
|
return;
|
|
54
52
|
try {
|
|
55
53
|
const db = getDbInstance();
|
|
56
54
|
if (db) {
|
|
57
55
|
await db.delete(favoriteResource)
|
|
58
|
-
.where({
|
|
56
|
+
.where({ target })
|
|
59
57
|
.execute();
|
|
60
|
-
console.log(`[StarredSync] Deleted favorite: ${
|
|
58
|
+
console.log(`[StarredSync] Deleted favorite: ${target}`);
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
catch (error) {
|
|
@@ -88,14 +86,14 @@ export function createStarredSyncHook(config) {
|
|
|
88
86
|
if (!('starred' in changes))
|
|
89
87
|
return;
|
|
90
88
|
const starred = record.starred;
|
|
91
|
-
const
|
|
89
|
+
const target = record['@id'] || record.id;
|
|
92
90
|
if (starred) {
|
|
93
91
|
// 标星 → 创建 Favorite
|
|
94
92
|
await createFavorite(ctx, config, record);
|
|
95
93
|
}
|
|
96
94
|
else {
|
|
97
95
|
// 取消标星 → 删除 Favorite
|
|
98
|
-
await deleteFavorite(ctx,
|
|
96
|
+
await deleteFavorite(ctx, target);
|
|
99
97
|
}
|
|
100
98
|
},
|
|
101
99
|
};
|
|
@@ -4,7 +4,7 @@ export const fixtureContactSolid = {
|
|
|
4
4
|
name: 'Alice',
|
|
5
5
|
rdfType: ContactClass.PERSON,
|
|
6
6
|
contactType: 'solid',
|
|
7
|
-
|
|
7
|
+
entity: 'https://pod.example/profile/card#me',
|
|
8
8
|
isPublic: false,
|
|
9
9
|
};
|
|
10
10
|
export const fixtureContactAgentWorkspace = {
|
|
@@ -12,7 +12,7 @@ export const fixtureContactAgentWorkspace = {
|
|
|
12
12
|
name: 'Secretary@linx',
|
|
13
13
|
rdfType: ContactClass.AGENT,
|
|
14
14
|
contactType: 'agent',
|
|
15
|
-
|
|
15
|
+
entity: 'https://pod.example/agents/__secretary__/',
|
|
16
16
|
isPublic: false,
|
|
17
17
|
};
|
|
18
18
|
export const fixtureChatDirectAI = {
|
|
@@ -53,7 +53,7 @@ export const fixtureToolApprovalBlock = {
|
|
|
53
53
|
};
|
|
54
54
|
export const fixtureTaskProgressBlock = {
|
|
55
55
|
type: 'task_progress',
|
|
56
|
-
|
|
56
|
+
task: 'https://pod.example/.data/task/index.ttl#task-1',
|
|
57
57
|
title: 'CP0 contract baseline',
|
|
58
58
|
steps: [
|
|
59
59
|
{ id: 's1', label: 'Freeze contracts', status: 'done', duration: 10 },
|
package/dist/grant.schema.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare function buildGrantSubjectPath(grantId: string): string;
|
|
2
1
|
export declare const grantResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
3
2
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
4
3
|
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "uri", true, true>;
|
|
@@ -6,7 +5,7 @@ export declare const grantResource: import("@undefineds.co/drizzle-solid/dist/co
|
|
|
6
5
|
action: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
7
6
|
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
8
7
|
summary: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
9
|
-
|
|
8
|
+
description: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
10
9
|
schema: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
11
10
|
pageKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
12
11
|
wikiStatus: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
@@ -33,7 +32,7 @@ export declare const grantTable: import("@undefineds.co/drizzle-solid/dist/core/
|
|
|
33
32
|
action: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
34
33
|
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
35
34
|
summary: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
36
|
-
|
|
35
|
+
description: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
37
36
|
schema: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
38
37
|
pageKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
39
38
|
wikiStatus: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
package/dist/grant.schema.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { podTable, uri, string, text, timestamp, id } from '@undefineds.co/drizzle-solid';
|
|
2
2
|
import { RDF, ODRL, UDFS, DCTerms } from './namespaces.js';
|
|
3
|
-
export function buildGrantSubjectPath(grantId) {
|
|
4
|
-
return `/settings/autonomy/grants/${encodeURIComponent(grantId)}.ttl`;
|
|
5
|
-
}
|
|
6
3
|
// Persistent delegation grant resource generated by "do not ask again" decisions.
|
|
7
4
|
// This is the durable "delegation" layer (distinct from one-off approvals and append-only audit entries).
|
|
8
5
|
export const grantResource = podTable('grant', {
|
|
9
|
-
id: id('id'),
|
|
6
|
+
id: id('id').default('{key}.ttl'),
|
|
10
7
|
// Resource-level type writes odrl:Policy. Keep the project-specific class as
|
|
11
8
|
// an additional rdf:type, so readback treats RDF class membership as multi-valued.
|
|
12
9
|
rdfType: uri('rdfType').array().predicate(RDF.type).notNull().default([UDFS.AutonomyGrant]),
|
|
@@ -16,17 +13,18 @@ export const grantResource = podTable('grant', {
|
|
|
16
13
|
// Pod version of the LLM Wiki page contract. The grant remains an ODRL
|
|
17
14
|
// policy, but its maintainable surface is a wiki page with provenance.
|
|
18
15
|
title: string('title').predicate(DCTerms.title),
|
|
19
|
-
summary: text('summary').predicate(
|
|
20
|
-
|
|
16
|
+
summary: text('summary').predicate(DCTerms.abstract),
|
|
17
|
+
description: text('description').predicate(DCTerms.description),
|
|
21
18
|
schema: uri('schema').predicate(DCTerms.conformsTo),
|
|
22
19
|
pageKind: string('pageKind').predicate(UDFS.pageKind),
|
|
23
20
|
wikiStatus: string('wikiStatus').predicate(UDFS.status),
|
|
24
21
|
tags: text('tags').predicate(UDFS.tags),
|
|
25
|
-
|
|
22
|
+
// Source is a literal category such as "approval", not a resource URI.
|
|
23
|
+
source: string('source').predicate(UDFS.sourceKind),
|
|
26
24
|
sourceHash: string('sourceHash').predicate(UDFS.sourceHash),
|
|
27
25
|
compiledAt: timestamp('compiledAt').predicate(UDFS.compiledAt),
|
|
28
26
|
compiledFrom: uri('compiledFrom').array().predicate(UDFS.compiledFrom),
|
|
29
|
-
related: uri('related').array().predicate(
|
|
27
|
+
related: uri('related').array().predicate(DCTerms.relation),
|
|
30
28
|
// Extensions
|
|
31
29
|
effect: string('effect').predicate(UDFS.effect).notNull(),
|
|
32
30
|
riskCeiling: string('riskCeiling').predicate(UDFS.riskCeiling),
|
|
@@ -44,7 +42,6 @@ export const grantResource = podTable('grant', {
|
|
|
44
42
|
sparqlEndpoint: '/settings/autonomy/grants/-/sparql',
|
|
45
43
|
type: ODRL.Policy,
|
|
46
44
|
namespace: ODRL,
|
|
47
|
-
subjectTemplate: '{id}.ttl',
|
|
48
45
|
});
|
|
49
46
|
// Compatibility alias. New model code should prefer `grantResource`.
|
|
50
47
|
export const grantTable = grantResource;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type IdeaStatus = 'captured' | 'exploring' | 'candidate' | 'promoted' | 'deferred' | 'rejected' | 'superseded';
|
|
2
|
+
export type IdeaCommitment = 'thought' | 'direction' | 'tentative_decision' | 'committed';
|
|
3
|
+
/**
|
|
4
|
+
* Lightweight candidate extracted from conversation.
|
|
5
|
+
*
|
|
6
|
+
* Idea is the buffer before committed work. It can reference source Messages
|
|
7
|
+
* and related records, but it is not an Issue or Task until promoted.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ideaResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
10
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
11
|
+
summary: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
12
|
+
input: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
13
|
+
status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
14
|
+
commitment: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
15
|
+
affectedArea: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
16
|
+
currentUnderstanding: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
17
|
+
openQuestions: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "string", false, false>;
|
|
18
|
+
related: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "uri", false, false>;
|
|
19
|
+
conflicts: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "string", false, false>;
|
|
20
|
+
nextStep: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
21
|
+
promotedTo: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
22
|
+
chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
23
|
+
thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
24
|
+
sourceMessages: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "uri", false, false>;
|
|
25
|
+
createdBy: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
26
|
+
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
27
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
28
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
29
|
+
}>>;
|
|
30
|
+
export type IdeaRow = typeof ideaResource.$inferSelect;
|
|
31
|
+
export type IdeaInsert = typeof ideaResource.$inferInsert;
|
|
32
|
+
export type IdeaUpdate = typeof ideaResource.$inferUpdate;
|