@undefineds.co/models 0.1.1 → 0.2.1

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.
Files changed (228) hide show
  1. package/dist/agent.repository.d.ts +20 -40
  2. package/dist/agent.schema.d.ts +20 -1
  3. package/dist/agent.schema.js +25 -1
  4. package/dist/ai-config/index.d.ts +8 -6
  5. package/dist/ai-config/index.js +41 -23
  6. package/dist/ai-model.schema.d.ts +13 -1
  7. package/dist/ai-model.schema.js +17 -1
  8. package/dist/ai-provider.schema.d.ts +9 -1
  9. package/dist/ai-provider.schema.js +13 -1
  10. package/dist/approval.schema.d.ts +21 -1
  11. package/dist/approval.schema.js +33 -1
  12. package/dist/audit.schema.d.ts +17 -1
  13. package/dist/audit.schema.js +29 -1
  14. package/dist/chat.repository.d.ts +19 -15
  15. package/dist/chat.schema.d.ts +37 -1
  16. package/dist/chat.schema.js +47 -1
  17. package/dist/client/index.d.ts +121 -0
  18. package/dist/client/index.js +299 -0
  19. package/dist/contact.repository.d.ts +21 -21
  20. package/dist/contact.schema.d.ts +48 -1
  21. package/dist/contact.schema.js +60 -1
  22. package/dist/credential.schema.d.ts +15 -1
  23. package/dist/credential.schema.js +19 -1
  24. package/dist/discovery/index.d.ts +2 -2
  25. package/dist/discovery/index.js +2 -2
  26. package/dist/extension/extension.schema.d.ts +4 -1
  27. package/dist/extension/extension.schema.js +11 -1
  28. package/dist/extension/index.d.ts +1 -1
  29. package/dist/favorite/favorite.schema.d.ts +24 -1
  30. package/dist/favorite/favorite.schema.js +34 -1
  31. package/dist/favorite/index.d.ts +2 -2
  32. package/dist/file/file.schema.d.ts +39 -1
  33. package/dist/file/file.schema.js +51 -1
  34. package/dist/file/index.d.ts +1 -1
  35. package/dist/fixtures/contracts-chat-contact.d.ts +5 -5
  36. package/dist/fixtures/contracts-chat-contact.js +1 -1
  37. package/dist/grant.schema.d.ts +16 -1
  38. package/dist/grant.schema.js +29 -1
  39. package/dist/import/index.d.ts +1 -1
  40. package/dist/inbox-notification.schema.d.ts +9 -1
  41. package/dist/inbox-notification.schema.js +16 -1
  42. package/dist/index.d.ts +42 -40
  43. package/dist/index.js +20 -16
  44. package/dist/knowledge/index.d.ts +1 -1
  45. package/dist/knowledge/knowledge-folder.schema.d.ts +7 -1
  46. package/dist/knowledge/knowledge-folder.schema.js +6 -1
  47. package/dist/message.repository.d.ts +20 -20
  48. package/dist/message.schema.d.ts +32 -1
  49. package/dist/message.schema.js +47 -1
  50. package/dist/namespaces.d.ts +178 -1
  51. package/dist/namespaces.js +253 -1
  52. package/dist/profile.d.ts +22 -1
  53. package/dist/profile.js +88 -1
  54. package/dist/profile.repository.d.ts +105 -0
  55. package/dist/profile.repository.js +47 -0
  56. package/dist/profile.schema.d.ts +16 -0
  57. package/dist/{core/profile.js → profile.schema.js} +4 -4
  58. package/dist/repository.d.ts +49 -9
  59. package/dist/repository.js +49 -46
  60. package/dist/schema.d.ts +244 -1
  61. package/dist/schema.js +37 -1
  62. package/dist/session/index.d.ts +1 -1
  63. package/dist/session/index.js +1 -1
  64. package/dist/session/session.schema.d.ts +43 -1
  65. package/dist/session/session.schema.js +46 -1
  66. package/dist/session.repository.d.ts +61 -0
  67. package/dist/session.repository.js +8 -0
  68. package/dist/settings/index.d.ts +1 -1
  69. package/dist/settings/settings.schema.d.ts +49 -1
  70. package/dist/settings/settings.schema.js +63 -1
  71. package/dist/sidecar/persistence-mapping.d.ts +5 -5
  72. package/dist/sidecar/sidecar-events.d.ts +30 -30
  73. package/dist/thread.repository.d.ts +15 -19
  74. package/dist/thread.schema.d.ts +30 -1
  75. package/dist/thread.schema.js +39 -1
  76. package/dist/types/message-block.d.ts +1 -1
  77. package/dist/vocab/_namespaces.d.ts +1 -1
  78. package/dist/vocab/index.d.ts +5 -6
  79. package/dist/vocab/index.js +0 -1
  80. package/dist/vocab/message.vocab.js +1 -1
  81. package/dist/vocab/thread.vocab.d.ts +1 -2
  82. package/dist/vocab/thread.vocab.js +2 -3
  83. package/dist/watch/index.d.ts +226 -0
  84. package/dist/watch/index.js +1156 -0
  85. package/package.json +41 -31
  86. package/dist/_drizzle-solid/columns.d.ts +0 -37
  87. package/dist/_drizzle-solid/columns.js +0 -1
  88. package/dist/_drizzle-solid/pod-table.d.ts +0 -3
  89. package/dist/_drizzle-solid/pod-table.js +0 -1
  90. package/dist/_drizzle-solid/types.d.ts +0 -40
  91. package/dist/_drizzle-solid/types.js +0 -1
  92. package/dist/ai-config.d.ts +0 -1
  93. package/dist/ai-config.js +0 -1
  94. package/dist/chat.utils.d.ts +0 -3
  95. package/dist/chat.utils.js +0 -30
  96. package/dist/core/agent-provider.schema.d.ts +0 -1
  97. package/dist/core/agent-provider.schema.js +0 -1
  98. package/dist/core/agent-status.schema.d.ts +0 -12
  99. package/dist/core/agent-status.schema.js +0 -18
  100. package/dist/core/agent.schema.d.ts +0 -72
  101. package/dist/core/agent.schema.js +0 -38
  102. package/dist/core/ai-config.schema.d.ts +0 -11
  103. package/dist/core/ai-config.schema.js +0 -18
  104. package/dist/core/ai-model.schema.d.ts +0 -15
  105. package/dist/core/ai-model.schema.js +0 -21
  106. package/dist/core/ai-provider.schema.d.ts +0 -16
  107. package/dist/core/ai-provider.schema.js +0 -28
  108. package/dist/core/approval.schema.d.ts +0 -21
  109. package/dist/core/approval.schema.js +0 -33
  110. package/dist/core/audit.schema.d.ts +0 -17
  111. package/dist/core/audit.schema.js +0 -29
  112. package/dist/core/chat.schema.d.ts +0 -36
  113. package/dist/core/chat.schema.js +0 -45
  114. package/dist/core/contact.schema.d.ts +0 -47
  115. package/dist/core/contact.schema.js +0 -59
  116. package/dist/core/credential.schema.d.ts +0 -56
  117. package/dist/core/credential.schema.js +0 -40
  118. package/dist/core/extension/extension.schema.d.ts +0 -4
  119. package/dist/core/extension/extension.schema.js +0 -11
  120. package/dist/core/extension/index.d.ts +0 -1
  121. package/dist/core/extension/index.js +0 -1
  122. package/dist/core/extension.d.ts +0 -1
  123. package/dist/core/extension.js +0 -1
  124. package/dist/core/favorite/favorite.schema.d.ts +0 -24
  125. package/dist/core/favorite/favorite.schema.js +0 -34
  126. package/dist/core/favorite/index.d.ts +0 -1
  127. package/dist/core/favorite/index.js +0 -1
  128. package/dist/core/file/file.schema.d.ts +0 -39
  129. package/dist/core/file/file.schema.js +0 -51
  130. package/dist/core/file/index.d.ts +0 -1
  131. package/dist/core/file/index.js +0 -1
  132. package/dist/core/file.d.ts +0 -1
  133. package/dist/core/file.js +0 -1
  134. package/dist/core/grant.schema.d.ts +0 -16
  135. package/dist/core/grant.schema.js +0 -29
  136. package/dist/core/import/import-job.schema.d.ts +0 -5
  137. package/dist/core/import/import-job.schema.js +0 -5
  138. package/dist/core/import/index.d.ts +0 -1
  139. package/dist/core/import/index.js +0 -1
  140. package/dist/core/import.d.ts +0 -1
  141. package/dist/core/import.js +0 -1
  142. package/dist/core/inbox-notification.schema.d.ts +0 -9
  143. package/dist/core/inbox-notification.schema.js +0 -16
  144. package/dist/core/index.d.ts +0 -31
  145. package/dist/core/index.js +0 -32
  146. package/dist/core/knowledge/index.d.ts +0 -1
  147. package/dist/core/knowledge/index.js +0 -1
  148. package/dist/core/knowledge/knowledge-folder.schema.d.ts +0 -7
  149. package/dist/core/knowledge/knowledge-folder.schema.js +0 -6
  150. package/dist/core/knowledge.d.ts +0 -1
  151. package/dist/core/knowledge.js +0 -1
  152. package/dist/core/message.schema.d.ts +0 -33
  153. package/dist/core/message.schema.js +0 -49
  154. package/dist/core/namespaces.d.ts +0 -176
  155. package/dist/core/namespaces.js +0 -289
  156. package/dist/core/profile.d.ts +0 -16
  157. package/dist/core/schema.d.ts +0 -304
  158. package/dist/core/schema.js +0 -46
  159. package/dist/core/session/index.d.ts +0 -1
  160. package/dist/core/session/index.js +0 -1
  161. package/dist/core/session/session.schema.d.ts +0 -6
  162. package/dist/core/session/session.schema.js +0 -6
  163. package/dist/core/session.d.ts +0 -1
  164. package/dist/core/session.js +0 -1
  165. package/dist/core/settings/index.d.ts +0 -1
  166. package/dist/core/settings/index.js +0 -1
  167. package/dist/core/settings/settings.schema.d.ts +0 -49
  168. package/dist/core/settings/settings.schema.js +0 -63
  169. package/dist/core/settings.d.ts +0 -1
  170. package/dist/core/settings.js +0 -1
  171. package/dist/core/thread.schema.d.ts +0 -28
  172. package/dist/core/thread.schema.js +0 -36
  173. package/dist/core/types/collaboration-blocks.d.ts +0 -52
  174. package/dist/core/types/collaboration-blocks.js +0 -7
  175. package/dist/core/types/message-block.d.ts +0 -270
  176. package/dist/core/types/message-block.js +0 -125
  177. package/dist/core/vector-store.schema.d.ts +0 -25
  178. package/dist/core/vector-store.schema.js +0 -35
  179. package/dist/core/vocab/_namespaces.d.ts +0 -1
  180. package/dist/core/vocab/_namespaces.js +0 -3
  181. package/dist/core/vocab/chat.vocab.d.ts +0 -16
  182. package/dist/core/vocab/chat.vocab.js +0 -22
  183. package/dist/core/vocab/contact.vocab.d.ts +0 -21
  184. package/dist/core/vocab/contact.vocab.js +0 -22
  185. package/dist/core/vocab/index.d.ts +0 -6
  186. package/dist/core/vocab/index.js +0 -6
  187. package/dist/core/vocab/message.vocab.d.ts +0 -20
  188. package/dist/core/vocab/message.vocab.js +0 -24
  189. package/dist/core/vocab/sidecar.vocab.d.ts +0 -46
  190. package/dist/core/vocab/sidecar.vocab.js +0 -47
  191. package/dist/core/vocab/thread.vocab.d.ts +0 -11
  192. package/dist/core/vocab/thread.vocab.js +0 -14
  193. package/dist/core/vocab/workspace.vocab.d.ts +0 -12
  194. package/dist/core/vocab/workspace.vocab.js +0 -13
  195. package/dist/core/vocab.d.ts +0 -1
  196. package/dist/core/vocab.js +0 -1
  197. package/dist/core/workspace.schema.d.ts +0 -35
  198. package/dist/core/workspace.schema.js +0 -106
  199. package/dist/core.d.ts +0 -1
  200. package/dist/core.js +0 -1
  201. package/dist/discovery/vercel.d.ts +0 -25
  202. package/dist/discovery/vercel.js +0 -95
  203. package/dist/discovery.d.ts +0 -1
  204. package/dist/discovery.js +0 -1
  205. package/dist/extension.d.ts +0 -1
  206. package/dist/extension.js +0 -1
  207. package/dist/favorite.d.ts +0 -1
  208. package/dist/favorite.js +0 -1
  209. package/dist/file.d.ts +0 -1
  210. package/dist/file.js +0 -1
  211. package/dist/import.d.ts +0 -1
  212. package/dist/import.js +0 -1
  213. package/dist/knowledge.d.ts +0 -1
  214. package/dist/knowledge.js +0 -1
  215. package/dist/session.d.ts +0 -1
  216. package/dist/session.js +0 -1
  217. package/dist/settings.d.ts +0 -1
  218. package/dist/settings.js +0 -1
  219. package/dist/sidecar/index.d.ts +0 -2
  220. package/dist/sidecar/index.js +0 -2
  221. package/dist/vocab/workspace.vocab.d.ts +0 -12
  222. package/dist/vocab/workspace.vocab.js +0 -13
  223. package/dist/vocab.d.ts +0 -1
  224. package/dist/vocab.js +0 -1
  225. package/dist/workspace.repository.d.ts +0 -45
  226. package/dist/workspace.repository.js +0 -8
  227. package/dist/workspace.schema.d.ts +0 -1
  228. package/dist/workspace.schema.js +0 -1
@@ -1 +1,49 @@
1
- export { settingsTable, SETTING_KEYS, type SettingKey, type SettingsRow, type SettingsInsert, type SettingsUpdate, } from '../core.js';
1
+ /**
2
+ * Settings Schema
3
+ * 用户设置模型 - 基于 Solid Pod 存储
4
+ *
5
+ * 参考标准:
6
+ * - Schema.org PropertyValue
7
+ * - FOAF preferences
8
+ *
9
+ * 存储用户的应用配置、偏好设置等
10
+ */
11
+ export declare const settingsTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
12
+ key: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
13
+ value: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
14
+ valueType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
15
+ category: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
16
+ label: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
17
+ description: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
18
+ owner: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
19
+ isSensitive: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
20
+ createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
21
+ modifiedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
22
+ }>>;
23
+ /**
24
+ * 常用设置键定义
25
+ */
26
+ export declare const SETTING_KEYS: {
27
+ readonly UI_THEME: "ui.theme";
28
+ readonly UI_LANGUAGE: "ui.language";
29
+ readonly UI_SIDEBAR_WIDTH: "ui.sidebar.width";
30
+ readonly UI_LIST_PANEL_WIDTH: "ui.listPanel.width";
31
+ readonly AI_DEFAULT_ASSISTANT: "ai.defaultAssistant";
32
+ readonly AI_AUTO_REPLY: "ai.autoReply";
33
+ readonly AI_STREAMING: "ai.streaming";
34
+ readonly SYNC_AUTO: "sync.auto";
35
+ readonly SYNC_INTERVAL: "sync.interval";
36
+ readonly SYNC_WIFI_ONLY: "sync.wifiOnly";
37
+ readonly PRIVACY_READ_RECEIPTS: "privacy.readReceipts";
38
+ readonly PRIVACY_ONLINE_STATUS: "privacy.onlineStatus";
39
+ readonly PRIVACY_TYPING_INDICATOR: "privacy.typingIndicator";
40
+ readonly NOTIFICATIONS_ENABLED: "notifications.enabled";
41
+ readonly NOTIFICATIONS_SOUND: "notifications.sound";
42
+ readonly NOTIFICATIONS_DESKTOP: "notifications.desktop";
43
+ readonly POD_AUTO_CONNECT: "pod.autoConnect";
44
+ readonly POD_CACHE_SIZE: "pod.cacheSize";
45
+ };
46
+ export type SettingKey = typeof SETTING_KEYS[keyof typeof SETTING_KEYS];
47
+ export type SettingsRow = typeof settingsTable.$inferSelect;
48
+ export type SettingsInsert = typeof settingsTable.$inferInsert;
49
+ export type SettingsUpdate = typeof settingsTable.$inferUpdate;
@@ -1 +1,63 @@
1
- export { settingsTable, SETTING_KEYS, } from '../core.js';
1
+ import { podTable, string, timestamp, text, boolean } from "@undefineds.co/drizzle-solid";
2
+ import { UDFS, DCTerms, SCHEMA } from "../namespaces.js";
3
+ /**
4
+ * Settings Schema
5
+ * 用户设置模型 - 基于 Solid Pod 存储
6
+ *
7
+ * 参考标准:
8
+ * - Schema.org PropertyValue
9
+ * - FOAF preferences
10
+ *
11
+ * 存储用户的应用配置、偏好设置等
12
+ */
13
+ export const settingsTable = podTable("settings", {
14
+ // 设置键值对
15
+ key: string("key").primaryKey().predicate(UDFS.settingKey).notNull(), // 设置键(唯一)
16
+ value: text("value").predicate(UDFS.settingValue).notNull(), // 设置值(JSON 字符串)
17
+ valueType: string("valueType").predicate(UDFS.settingType).notNull().default("string"), // string, number, boolean, json
18
+ // 元数据
19
+ category: string("category").predicate(DCTerms.type).notNull(), // 设置分类:ui, ai, sync, privacy, notifications
20
+ label: string("label").predicate(DCTerms.title), // 设置标签(用于 UI 显示)
21
+ description: text("description").predicate(DCTerms.description), // 设置描述
22
+ // 所有者
23
+ owner: string("owner").predicate(DCTerms.creator).notNull(), // 设置所有者 WebID
24
+ // 是否敏感(敏感设置可能需要加密)
25
+ isSensitive: boolean("isSensitive").predicate(UDFS.status).default(false),
26
+ // 时间戳
27
+ createdAt: timestamp("createdAt").predicate(DCTerms.created).notNull().defaultNow(),
28
+ modifiedAt: timestamp("modifiedAt").predicate(DCTerms.modified).notNull().defaultNow(),
29
+ }, {
30
+ base: "idp:///settings/", // LDP Container
31
+ sparqlEndpoint: "idp:///settings/-/sparql",
32
+ type: SCHEMA.PropertyValue,
33
+ namespace: UDFS,
34
+ });
35
+ /**
36
+ * 常用设置键定义
37
+ */
38
+ export const SETTING_KEYS = {
39
+ // UI 设置
40
+ UI_THEME: "ui.theme", // dark, light, auto
41
+ UI_LANGUAGE: "ui.language", // zh-CN, en-US
42
+ UI_SIDEBAR_WIDTH: "ui.sidebar.width",
43
+ UI_LIST_PANEL_WIDTH: "ui.listPanel.width",
44
+ // AI 设置
45
+ AI_DEFAULT_ASSISTANT: "ai.defaultAssistant", // 默认 AI 助手 URI
46
+ AI_AUTO_REPLY: "ai.autoReply", // 是否自动回复
47
+ AI_STREAMING: "ai.streaming", // 是否启用流式输出
48
+ // 同步设置
49
+ SYNC_AUTO: "sync.auto", // 是否自动同步
50
+ SYNC_INTERVAL: "sync.interval", // 同步间隔(秒)
51
+ SYNC_WIFI_ONLY: "sync.wifiOnly", // 仅在 WiFi 下同步
52
+ // 隐私设置
53
+ PRIVACY_READ_RECEIPTS: "privacy.readReceipts", // 是否发送已读回执
54
+ PRIVACY_ONLINE_STATUS: "privacy.onlineStatus", // 是否显示在线状态
55
+ PRIVACY_TYPING_INDICATOR: "privacy.typingIndicator", // 是否显示正在输入
56
+ // 通知设置
57
+ NOTIFICATIONS_ENABLED: "notifications.enabled",
58
+ NOTIFICATIONS_SOUND: "notifications.sound",
59
+ NOTIFICATIONS_DESKTOP: "notifications.desktop",
60
+ // Pod 设置
61
+ POD_AUTO_CONNECT: "pod.autoConnect", // 启动时自动连接
62
+ POD_CACHE_SIZE: "pod.cacheSize", // 缓存大小(MB)
63
+ };
@@ -1,8 +1,8 @@
1
- import type { ApprovalInsert, ApprovalUpdate } from '../approval.schema.js';
2
- import type { AuditInsert } from '../audit.schema.js';
3
- import type { GrantInsert } from '../grant.schema.js';
4
- import type { InboxNotificationInsert } from '../inbox-notification.schema.js';
5
- import type { ToolCallEvent, InboxApprovalEvent, SessionStateEvent } from './sidecar-events.js';
1
+ import type { ApprovalInsert, ApprovalUpdate } from '../approval.schema';
2
+ import type { AuditInsert } from '../audit.schema';
3
+ import type { GrantInsert } from '../grant.schema';
4
+ import type { InboxNotificationInsert } from '../inbox-notification.schema';
5
+ import type { ToolCallEvent, InboxApprovalEvent, SessionStateEvent } from './sidecar-events';
6
6
  export type ChatSessionProjection = {
7
7
  chatId: string;
8
8
  sessionStatus: 'active' | 'paused' | 'completed' | 'error';
@@ -28,10 +28,10 @@ export declare const ToolCallEventV1Schema: z.ZodObject<{
28
28
  policyVersion: z.ZodOptional<z.ZodString>;
29
29
  timestamp: z.ZodString;
30
30
  }, "strict", z.ZodTypeAny, {
31
- type: "tool.call";
32
31
  status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
33
32
  toolCallId: string;
34
33
  toolName: string;
34
+ type: "tool.call";
35
35
  sessionId: string;
36
36
  timestamp: string;
37
37
  target?: string | undefined;
@@ -48,10 +48,10 @@ export declare const ToolCallEventV1Schema: z.ZodObject<{
48
48
  duration?: number | undefined;
49
49
  version?: 1 | undefined;
50
50
  }, {
51
- type: "tool.call";
52
51
  status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
53
52
  toolCallId: string;
54
53
  toolName: string;
54
+ type: "tool.call";
55
55
  sessionId: string;
56
56
  timestamp: string;
57
57
  target?: string | undefined;
@@ -89,10 +89,10 @@ export declare const ToolCallEventSchema: z.ZodObject<{
89
89
  policyVersion: z.ZodOptional<z.ZodString>;
90
90
  timestamp: z.ZodString;
91
91
  }, "strict", z.ZodTypeAny, {
92
- type: "tool.call";
93
92
  status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
94
93
  toolCallId: string;
95
94
  toolName: string;
95
+ type: "tool.call";
96
96
  sessionId: string;
97
97
  timestamp: string;
98
98
  target?: string | undefined;
@@ -109,10 +109,10 @@ export declare const ToolCallEventSchema: z.ZodObject<{
109
109
  duration?: number | undefined;
110
110
  version?: 1 | undefined;
111
111
  }, {
112
- type: "tool.call";
113
112
  status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
114
113
  toolCallId: string;
115
114
  toolName: string;
115
+ type: "tool.call";
116
116
  sessionId: string;
117
117
  timestamp: string;
118
118
  target?: string | undefined;
@@ -147,11 +147,11 @@ export declare const SessionStateEventV1Schema: z.ZodObject<{
147
147
  tokenUsage: z.ZodNumber;
148
148
  timestamp: z.ZodString;
149
149
  }, "strict", z.ZodTypeAny, {
150
- type: "session.state";
151
- status: "active" | "error" | "paused" | "completed";
150
+ status: "error" | "paused" | "active" | "completed";
152
151
  tokenUsage: number;
153
- chatId: string;
152
+ type: "session.state";
154
153
  tool: "claude-code" | "cursor" | "windsurf";
154
+ chatId: string;
155
155
  sessionId: string;
156
156
  timestamp: string;
157
157
  previousStatus: string;
@@ -159,11 +159,11 @@ export declare const SessionStateEventV1Schema: z.ZodObject<{
159
159
  policyVersion?: string | undefined;
160
160
  version?: 1 | undefined;
161
161
  }, {
162
- type: "session.state";
163
- status: "active" | "error" | "paused" | "completed";
162
+ status: "error" | "paused" | "active" | "completed";
164
163
  tokenUsage: number;
165
- chatId: string;
164
+ type: "session.state";
166
165
  tool: "claude-code" | "cursor" | "windsurf";
166
+ chatId: string;
167
167
  sessionId: string;
168
168
  timestamp: string;
169
169
  previousStatus: string;
@@ -184,11 +184,11 @@ export declare const SessionStateEventSchema: z.ZodObject<{
184
184
  tokenUsage: z.ZodNumber;
185
185
  timestamp: z.ZodString;
186
186
  }, "strict", z.ZodTypeAny, {
187
- type: "session.state";
188
- status: "active" | "error" | "paused" | "completed";
187
+ status: "error" | "paused" | "active" | "completed";
189
188
  tokenUsage: number;
190
- chatId: string;
189
+ type: "session.state";
191
190
  tool: "claude-code" | "cursor" | "windsurf";
191
+ chatId: string;
192
192
  sessionId: string;
193
193
  timestamp: string;
194
194
  previousStatus: string;
@@ -196,11 +196,11 @@ export declare const SessionStateEventSchema: z.ZodObject<{
196
196
  policyVersion?: string | undefined;
197
197
  version?: 1 | undefined;
198
198
  }, {
199
- type: "session.state";
200
- status: "active" | "error" | "paused" | "completed";
199
+ status: "error" | "paused" | "active" | "completed";
201
200
  tokenUsage: number;
202
- chatId: string;
201
+ type: "session.state";
203
202
  tool: "claude-code" | "cursor" | "windsurf";
203
+ chatId: string;
204
204
  sessionId: string;
205
205
  timestamp: string;
206
206
  previousStatus: string;
@@ -350,12 +350,12 @@ export declare const InboxApprovalEventV1Schema: z.ZodObject<{
350
350
  createdAt: z.ZodString;
351
351
  resolvedAt: z.ZodOptional<z.ZodString>;
352
352
  }, "strict", z.ZodTypeAny, {
353
- type: "inbox.approval";
354
353
  createdAt: string;
355
354
  status: "pending" | "approved" | "rejected" | "expired";
356
355
  risk: "low" | "medium" | "high";
357
356
  toolCallId: string;
358
357
  inboxItemId: string;
358
+ type: "inbox.approval";
359
359
  sessionId: string;
360
360
  target?: string | undefined;
361
361
  action?: string | undefined;
@@ -365,12 +365,12 @@ export declare const InboxApprovalEventV1Schema: z.ZodObject<{
365
365
  policyVersion?: string | undefined;
366
366
  version?: 1 | undefined;
367
367
  }, {
368
- type: "inbox.approval";
369
368
  createdAt: string;
370
369
  status: "pending" | "approved" | "rejected" | "expired";
371
370
  risk: "low" | "medium" | "high";
372
371
  toolCallId: string;
373
372
  inboxItemId: string;
373
+ type: "inbox.approval";
374
374
  sessionId: string;
375
375
  target?: string | undefined;
376
376
  action?: string | undefined;
@@ -396,12 +396,12 @@ export declare const InboxApprovalEventSchema: z.ZodObject<{
396
396
  createdAt: z.ZodString;
397
397
  resolvedAt: z.ZodOptional<z.ZodString>;
398
398
  }, "strict", z.ZodTypeAny, {
399
- type: "inbox.approval";
400
399
  createdAt: string;
401
400
  status: "pending" | "approved" | "rejected" | "expired";
402
401
  risk: "low" | "medium" | "high";
403
402
  toolCallId: string;
404
403
  inboxItemId: string;
404
+ type: "inbox.approval";
405
405
  sessionId: string;
406
406
  target?: string | undefined;
407
407
  action?: string | undefined;
@@ -411,12 +411,12 @@ export declare const InboxApprovalEventSchema: z.ZodObject<{
411
411
  policyVersion?: string | undefined;
412
412
  version?: 1 | undefined;
413
413
  }, {
414
- type: "inbox.approval";
415
414
  createdAt: string;
416
415
  status: "pending" | "approved" | "rejected" | "expired";
417
416
  risk: "low" | "medium" | "high";
418
417
  toolCallId: string;
419
418
  inboxItemId: string;
419
+ type: "inbox.approval";
420
420
  sessionId: string;
421
421
  target?: string | undefined;
422
422
  action?: string | undefined;
@@ -448,10 +448,10 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
448
448
  policyVersion: z.ZodOptional<z.ZodString>;
449
449
  timestamp: z.ZodString;
450
450
  }, "strict", z.ZodTypeAny, {
451
- type: "tool.call";
452
451
  status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
453
452
  toolCallId: string;
454
453
  toolName: string;
454
+ type: "tool.call";
455
455
  sessionId: string;
456
456
  timestamp: string;
457
457
  target?: string | undefined;
@@ -468,10 +468,10 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
468
468
  duration?: number | undefined;
469
469
  version?: 1 | undefined;
470
470
  }, {
471
- type: "tool.call";
472
471
  status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
473
472
  toolCallId: string;
474
473
  toolName: string;
474
+ type: "tool.call";
475
475
  sessionId: string;
476
476
  timestamp: string;
477
477
  target?: string | undefined;
@@ -500,11 +500,11 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
500
500
  tokenUsage: z.ZodNumber;
501
501
  timestamp: z.ZodString;
502
502
  }, "strict", z.ZodTypeAny, {
503
- type: "session.state";
504
- status: "active" | "error" | "paused" | "completed";
503
+ status: "error" | "paused" | "active" | "completed";
505
504
  tokenUsage: number;
506
- chatId: string;
505
+ type: "session.state";
507
506
  tool: "claude-code" | "cursor" | "windsurf";
507
+ chatId: string;
508
508
  sessionId: string;
509
509
  timestamp: string;
510
510
  previousStatus: string;
@@ -512,11 +512,11 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
512
512
  policyVersion?: string | undefined;
513
513
  version?: 1 | undefined;
514
514
  }, {
515
- type: "session.state";
516
- status: "active" | "error" | "paused" | "completed";
515
+ status: "error" | "paused" | "active" | "completed";
517
516
  tokenUsage: number;
518
- chatId: string;
517
+ type: "session.state";
519
518
  tool: "claude-code" | "cursor" | "windsurf";
519
+ chatId: string;
520
520
  sessionId: string;
521
521
  timestamp: string;
522
522
  previousStatus: string;
@@ -598,12 +598,12 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
598
598
  createdAt: z.ZodString;
599
599
  resolvedAt: z.ZodOptional<z.ZodString>;
600
600
  }, "strict", z.ZodTypeAny, {
601
- type: "inbox.approval";
602
601
  createdAt: string;
603
602
  status: "pending" | "approved" | "rejected" | "expired";
604
603
  risk: "low" | "medium" | "high";
605
604
  toolCallId: string;
606
605
  inboxItemId: string;
606
+ type: "inbox.approval";
607
607
  sessionId: string;
608
608
  target?: string | undefined;
609
609
  action?: string | undefined;
@@ -613,12 +613,12 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
613
613
  policyVersion?: string | undefined;
614
614
  version?: 1 | undefined;
615
615
  }, {
616
- type: "inbox.approval";
617
616
  createdAt: string;
618
617
  status: "pending" | "approved" | "rejected" | "expired";
619
618
  risk: "low" | "medium" | "high";
620
619
  toolCallId: string;
621
620
  inboxItemId: string;
621
+ type: "inbox.approval";
622
622
  sessionId: string;
623
623
  target?: string | undefined;
624
624
  action?: string | undefined;
@@ -1,41 +1,37 @@
1
- export declare const threadRepository: import("./repository.js").PodRepositoryDescriptor<import("@undefineds.co/models/_drizzle-solid/pod-table").PodTableWithColumns<import("@undefineds.co/models/_drizzle-solid/types").ResolvedColumns<{
2
- id: import("@undefineds.co/models/_drizzle-solid/columns").PodStringColumn<false, false>;
3
- chatId: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, true, false>;
4
- title: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
5
- starred: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"boolean", null, false, true>;
6
- status: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, true>;
7
- metadata: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"object", null, false, false>;
8
- workspace: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
9
- createdAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
10
- updatedAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
1
+ export declare const threadRepository: import("./repository").PodRepositoryDescriptor<import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
2
+ id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
3
+ chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
4
+ title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
5
+ starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
6
+ workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
7
+ metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
8
+ createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
9
+ updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
11
10
  }>>, {
12
11
  id: string;
13
- chatId: string;
12
+ chat: string;
14
13
  title: string;
15
14
  starred: boolean;
16
- status: string;
17
- metadata: Record<string, unknown>;
18
15
  workspace: string;
16
+ metadata: Record<string, unknown>;
19
17
  createdAt: Date;
20
18
  updatedAt: Date;
21
19
  }, {
22
- chatId: string;
20
+ chat: string;
23
21
  id?: string | undefined;
24
22
  title?: string | undefined;
25
23
  starred?: boolean | undefined;
26
- status?: string | undefined;
27
- metadata?: Record<string, unknown> | undefined;
28
24
  workspace?: string | undefined;
25
+ metadata?: Record<string, unknown> | undefined;
29
26
  createdAt?: Date | undefined;
30
27
  updatedAt?: Date | undefined;
31
28
  }, {
32
29
  id?: string | null | undefined;
33
- chatId?: string | undefined;
30
+ chat?: string | undefined;
34
31
  title?: string | null | undefined;
35
32
  starred?: boolean | null | undefined;
36
- status?: string | null | undefined;
37
- metadata?: Record<string, unknown> | null | undefined;
38
33
  workspace?: string | null | undefined;
34
+ metadata?: Record<string, unknown> | null | undefined;
39
35
  createdAt?: Date | undefined;
40
36
  updatedAt?: Date | undefined;
41
37
  }, Record<string, unknown>>;
@@ -1 +1,30 @@
1
- export { threadTable, type ThreadRow, type ThreadInsert, type ThreadUpdate, } from './core.js';
1
+ /**
2
+ * Thread schema.
3
+ *
4
+ * CP0 baseline:
5
+ * - Chat is a pure channel/place.
6
+ * - Thread carries execution context needed for collaboration/audit.
7
+ *
8
+ * Storage structure (aligned with xpod):
9
+ * - Thread stored as fragment in Chat's index.ttl
10
+ * - Location: /.data/chat/{chat}/index.ttl#{id}
11
+ *
12
+ * NOTE:
13
+ * - `thread.workspace` is a storage-layer reference (URI) to a container/resource in CSS/Pod.
14
+ * - It is NOT the same thing as the runtime create API payload `workspace: { path, copy }`.
15
+ * - Runtime path/copy is an execution-time interface shape; persistence should keep the
16
+ * container URI here and store portable metadata with that container/resource.
17
+ */
18
+ export declare const threadTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
19
+ id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
20
+ chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
21
+ title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
22
+ starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
23
+ workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
24
+ metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
25
+ createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
26
+ updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
27
+ }>>;
28
+ export type ThreadRow = typeof threadTable.$inferSelect;
29
+ export type ThreadInsert = typeof threadTable.$inferInsert;
30
+ export type ThreadUpdate = typeof threadTable.$inferUpdate;
@@ -1 +1,39 @@
1
- export { threadTable, } from './core.js';
1
+ import { uri, boolean, object, podTable, string, timestamp, id } from '@undefineds.co/drizzle-solid';
2
+ import { UDFS, DCTerms, SIOC, LINX_CHAT } from './namespaces.js';
3
+ /**
4
+ * Thread schema.
5
+ *
6
+ * CP0 baseline:
7
+ * - Chat is a pure channel/place.
8
+ * - Thread carries execution context needed for collaboration/audit.
9
+ *
10
+ * Storage structure (aligned with xpod):
11
+ * - Thread stored as fragment in Chat's index.ttl
12
+ * - Location: /.data/chat/{chat}/index.ttl#{id}
13
+ *
14
+ * NOTE:
15
+ * - `thread.workspace` is a storage-layer reference (URI) to a container/resource in CSS/Pod.
16
+ * - It is NOT the same thing as the runtime create API payload `workspace: { path, copy }`.
17
+ * - Runtime path/copy is an execution-time interface shape; persistence should keep the
18
+ * container URI here and store portable metadata with that container/resource.
19
+ */
20
+ export const threadTable = podTable('thread', {
21
+ id: id('id'),
22
+ // Belongs to chat. Stored as an RDF URI; short ids are resolved via chatTable's URI template by the ORM.
23
+ chat: uri('chat').predicate(SIOC.has_parent).notNull().link('chats'),
24
+ // Display / state
25
+ title: string('title').predicate(DCTerms.title),
26
+ starred: boolean('starred').predicate(UDFS.favorite).default(false),
27
+ // Storage-layer execution context reference: container/resource URI
28
+ workspace: uri('workspace').predicate(LINX_CHAT.workspace),
29
+ // Generic execution metadata shared by CLI/App runtimes.
30
+ metadata: object('metadata').predicate(UDFS.metadata),
31
+ createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
32
+ updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
33
+ }, {
34
+ base: '/.data/chat/',
35
+ sparqlEndpoint: '/.data/chat/-/sparql',
36
+ type: SIOC.Thread,
37
+ namespace: UDFS,
38
+ subjectTemplate: '{chat}/index.ttl#{id}',
39
+ });
@@ -1,4 +1,4 @@
1
- import type { ToolApprovalStatus, ToolCallStatus, TaskProgressStepStatus } from './collaboration-blocks.js';
1
+ import type { ToolApprovalStatus, ToolCallStatus, TaskProgressStepStatus } from './collaboration-blocks';
2
2
  /**
3
3
  * Message Block Types - 基于 Cherry Studio 的 block-based 消息系统
4
4
  *
@@ -1 +1 @@
1
- export * from '../namespaces.js';
1
+ export * from '../namespaces';
@@ -1,6 +1,5 @@
1
- export * from './_namespaces.js';
2
- export * from './chat.vocab.js';
3
- export * from './message.vocab.js';
4
- export * from './contact.vocab.js';
5
- export * from './thread.vocab.js';
6
- export * from './workspace.vocab.js';
1
+ export * from './_namespaces';
2
+ export * from './chat.vocab';
3
+ export * from './message.vocab';
4
+ export * from './contact.vocab';
5
+ export * from './thread.vocab';
@@ -3,4 +3,3 @@ export * from './chat.vocab.js';
3
3
  export * from './message.vocab.js';
4
4
  export * from './contact.vocab.js';
5
5
  export * from './thread.vocab.js';
6
- export * from './workspace.vocab.js';
@@ -1,7 +1,7 @@
1
1
  import { DCTerms, FOAF, LINX_MSG, SCHEMA, SIOC, UDFS, WF } from '../namespaces.js';
2
2
  export const MessageVocab = {
3
3
  // Existing
4
- thread: SIOC.hasContainer,
4
+ thread: SIOC.has_member,
5
5
  chat: WF.message,
6
6
  maker: FOAF.maker,
7
7
  role: UDFS.messageType,
@@ -1,8 +1,7 @@
1
1
  export declare const ThreadVocab: {
2
- readonly chatId: string;
2
+ readonly chat: string;
3
3
  readonly title: string;
4
4
  readonly starred: string;
5
- readonly status: string;
6
5
  readonly metadata: string;
7
6
  readonly createdAt: string;
8
7
  readonly updatedAt: string;
@@ -1,13 +1,12 @@
1
1
  import { DCTerms, LINX_CHAT, SIOC, UDFS } from '../namespaces.js';
2
2
  export const ThreadVocab = {
3
- chatId: SIOC.has_parent,
3
+ chat: SIOC.has_parent,
4
4
  title: DCTerms.title,
5
5
  starred: UDFS.favorite,
6
- status: UDFS.status,
7
6
  metadata: UDFS.metadata,
8
7
  createdAt: DCTerms.created,
9
8
  updatedAt: DCTerms.modified,
10
- // Execution context: workspace container (Agent@workspace)
9
+ // Execution context: workspace URI for the runnable root
11
10
  workspace: LINX_CHAT.workspace,
12
11
  // Type marker (for SPARQL convenience)
13
12
  type: SIOC.Thread,