@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.
- package/dist/agent.repository.d.ts +20 -40
- package/dist/agent.schema.d.ts +20 -1
- package/dist/agent.schema.js +25 -1
- package/dist/ai-config/index.d.ts +8 -6
- package/dist/ai-config/index.js +41 -23
- package/dist/ai-model.schema.d.ts +13 -1
- package/dist/ai-model.schema.js +17 -1
- package/dist/ai-provider.schema.d.ts +9 -1
- package/dist/ai-provider.schema.js +13 -1
- package/dist/approval.schema.d.ts +21 -1
- package/dist/approval.schema.js +33 -1
- package/dist/audit.schema.d.ts +17 -1
- package/dist/audit.schema.js +29 -1
- package/dist/chat.repository.d.ts +19 -15
- package/dist/chat.schema.d.ts +37 -1
- package/dist/chat.schema.js +47 -1
- package/dist/client/index.d.ts +121 -0
- package/dist/client/index.js +299 -0
- package/dist/contact.repository.d.ts +21 -21
- package/dist/contact.schema.d.ts +48 -1
- package/dist/contact.schema.js +60 -1
- package/dist/credential.schema.d.ts +15 -1
- package/dist/credential.schema.js +19 -1
- package/dist/discovery/index.d.ts +2 -2
- package/dist/discovery/index.js +2 -2
- package/dist/extension/extension.schema.d.ts +4 -1
- package/dist/extension/extension.schema.js +11 -1
- package/dist/extension/index.d.ts +1 -1
- package/dist/favorite/favorite.schema.d.ts +24 -1
- package/dist/favorite/favorite.schema.js +34 -1
- package/dist/favorite/index.d.ts +2 -2
- package/dist/file/file.schema.d.ts +39 -1
- package/dist/file/file.schema.js +51 -1
- package/dist/file/index.d.ts +1 -1
- package/dist/fixtures/contracts-chat-contact.d.ts +5 -5
- package/dist/fixtures/contracts-chat-contact.js +1 -1
- package/dist/grant.schema.d.ts +16 -1
- package/dist/grant.schema.js +29 -1
- package/dist/import/index.d.ts +1 -1
- package/dist/inbox-notification.schema.d.ts +9 -1
- package/dist/inbox-notification.schema.js +16 -1
- package/dist/index.d.ts +42 -40
- package/dist/index.js +20 -16
- package/dist/knowledge/index.d.ts +1 -1
- package/dist/knowledge/knowledge-folder.schema.d.ts +7 -1
- package/dist/knowledge/knowledge-folder.schema.js +6 -1
- package/dist/message.repository.d.ts +20 -20
- package/dist/message.schema.d.ts +32 -1
- package/dist/message.schema.js +47 -1
- package/dist/namespaces.d.ts +178 -1
- package/dist/namespaces.js +253 -1
- package/dist/profile.d.ts +22 -1
- package/dist/profile.js +88 -1
- package/dist/profile.repository.d.ts +105 -0
- package/dist/profile.repository.js +47 -0
- package/dist/profile.schema.d.ts +16 -0
- package/dist/{core/profile.js → profile.schema.js} +4 -4
- package/dist/repository.d.ts +49 -9
- package/dist/repository.js +49 -46
- package/dist/schema.d.ts +244 -1
- package/dist/schema.js +37 -1
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/session.schema.d.ts +43 -1
- package/dist/session/session.schema.js +46 -1
- package/dist/session.repository.d.ts +61 -0
- package/dist/session.repository.js +8 -0
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/settings.schema.d.ts +49 -1
- package/dist/settings/settings.schema.js +63 -1
- package/dist/sidecar/persistence-mapping.d.ts +5 -5
- package/dist/sidecar/sidecar-events.d.ts +30 -30
- package/dist/thread.repository.d.ts +15 -19
- package/dist/thread.schema.d.ts +30 -1
- package/dist/thread.schema.js +39 -1
- package/dist/types/message-block.d.ts +1 -1
- package/dist/vocab/_namespaces.d.ts +1 -1
- package/dist/vocab/index.d.ts +5 -6
- package/dist/vocab/index.js +0 -1
- package/dist/vocab/message.vocab.js +1 -1
- package/dist/vocab/thread.vocab.d.ts +1 -2
- package/dist/vocab/thread.vocab.js +2 -3
- package/dist/watch/index.d.ts +226 -0
- package/dist/watch/index.js +1156 -0
- package/package.json +41 -31
- package/dist/_drizzle-solid/columns.d.ts +0 -37
- package/dist/_drizzle-solid/columns.js +0 -1
- package/dist/_drizzle-solid/pod-table.d.ts +0 -3
- package/dist/_drizzle-solid/pod-table.js +0 -1
- package/dist/_drizzle-solid/types.d.ts +0 -40
- package/dist/_drizzle-solid/types.js +0 -1
- package/dist/ai-config.d.ts +0 -1
- package/dist/ai-config.js +0 -1
- package/dist/chat.utils.d.ts +0 -3
- package/dist/chat.utils.js +0 -30
- package/dist/core/agent-provider.schema.d.ts +0 -1
- package/dist/core/agent-provider.schema.js +0 -1
- package/dist/core/agent-status.schema.d.ts +0 -12
- package/dist/core/agent-status.schema.js +0 -18
- package/dist/core/agent.schema.d.ts +0 -72
- package/dist/core/agent.schema.js +0 -38
- package/dist/core/ai-config.schema.d.ts +0 -11
- package/dist/core/ai-config.schema.js +0 -18
- package/dist/core/ai-model.schema.d.ts +0 -15
- package/dist/core/ai-model.schema.js +0 -21
- package/dist/core/ai-provider.schema.d.ts +0 -16
- package/dist/core/ai-provider.schema.js +0 -28
- package/dist/core/approval.schema.d.ts +0 -21
- package/dist/core/approval.schema.js +0 -33
- package/dist/core/audit.schema.d.ts +0 -17
- package/dist/core/audit.schema.js +0 -29
- package/dist/core/chat.schema.d.ts +0 -36
- package/dist/core/chat.schema.js +0 -45
- package/dist/core/contact.schema.d.ts +0 -47
- package/dist/core/contact.schema.js +0 -59
- package/dist/core/credential.schema.d.ts +0 -56
- package/dist/core/credential.schema.js +0 -40
- package/dist/core/extension/extension.schema.d.ts +0 -4
- package/dist/core/extension/extension.schema.js +0 -11
- package/dist/core/extension/index.d.ts +0 -1
- package/dist/core/extension/index.js +0 -1
- package/dist/core/extension.d.ts +0 -1
- package/dist/core/extension.js +0 -1
- package/dist/core/favorite/favorite.schema.d.ts +0 -24
- package/dist/core/favorite/favorite.schema.js +0 -34
- package/dist/core/favorite/index.d.ts +0 -1
- package/dist/core/favorite/index.js +0 -1
- package/dist/core/file/file.schema.d.ts +0 -39
- package/dist/core/file/file.schema.js +0 -51
- package/dist/core/file/index.d.ts +0 -1
- package/dist/core/file/index.js +0 -1
- package/dist/core/file.d.ts +0 -1
- package/dist/core/file.js +0 -1
- package/dist/core/grant.schema.d.ts +0 -16
- package/dist/core/grant.schema.js +0 -29
- package/dist/core/import/import-job.schema.d.ts +0 -5
- package/dist/core/import/import-job.schema.js +0 -5
- package/dist/core/import/index.d.ts +0 -1
- package/dist/core/import/index.js +0 -1
- package/dist/core/import.d.ts +0 -1
- package/dist/core/import.js +0 -1
- package/dist/core/inbox-notification.schema.d.ts +0 -9
- package/dist/core/inbox-notification.schema.js +0 -16
- package/dist/core/index.d.ts +0 -31
- package/dist/core/index.js +0 -32
- package/dist/core/knowledge/index.d.ts +0 -1
- package/dist/core/knowledge/index.js +0 -1
- package/dist/core/knowledge/knowledge-folder.schema.d.ts +0 -7
- package/dist/core/knowledge/knowledge-folder.schema.js +0 -6
- package/dist/core/knowledge.d.ts +0 -1
- package/dist/core/knowledge.js +0 -1
- package/dist/core/message.schema.d.ts +0 -33
- package/dist/core/message.schema.js +0 -49
- package/dist/core/namespaces.d.ts +0 -176
- package/dist/core/namespaces.js +0 -289
- package/dist/core/profile.d.ts +0 -16
- package/dist/core/schema.d.ts +0 -304
- package/dist/core/schema.js +0 -46
- package/dist/core/session/index.d.ts +0 -1
- package/dist/core/session/index.js +0 -1
- package/dist/core/session/session.schema.d.ts +0 -6
- package/dist/core/session/session.schema.js +0 -6
- package/dist/core/session.d.ts +0 -1
- package/dist/core/session.js +0 -1
- package/dist/core/settings/index.d.ts +0 -1
- package/dist/core/settings/index.js +0 -1
- package/dist/core/settings/settings.schema.d.ts +0 -49
- package/dist/core/settings/settings.schema.js +0 -63
- package/dist/core/settings.d.ts +0 -1
- package/dist/core/settings.js +0 -1
- package/dist/core/thread.schema.d.ts +0 -28
- package/dist/core/thread.schema.js +0 -36
- package/dist/core/types/collaboration-blocks.d.ts +0 -52
- package/dist/core/types/collaboration-blocks.js +0 -7
- package/dist/core/types/message-block.d.ts +0 -270
- package/dist/core/types/message-block.js +0 -125
- package/dist/core/vector-store.schema.d.ts +0 -25
- package/dist/core/vector-store.schema.js +0 -35
- package/dist/core/vocab/_namespaces.d.ts +0 -1
- package/dist/core/vocab/_namespaces.js +0 -3
- package/dist/core/vocab/chat.vocab.d.ts +0 -16
- package/dist/core/vocab/chat.vocab.js +0 -22
- package/dist/core/vocab/contact.vocab.d.ts +0 -21
- package/dist/core/vocab/contact.vocab.js +0 -22
- package/dist/core/vocab/index.d.ts +0 -6
- package/dist/core/vocab/index.js +0 -6
- package/dist/core/vocab/message.vocab.d.ts +0 -20
- package/dist/core/vocab/message.vocab.js +0 -24
- package/dist/core/vocab/sidecar.vocab.d.ts +0 -46
- package/dist/core/vocab/sidecar.vocab.js +0 -47
- package/dist/core/vocab/thread.vocab.d.ts +0 -11
- package/dist/core/vocab/thread.vocab.js +0 -14
- package/dist/core/vocab/workspace.vocab.d.ts +0 -12
- package/dist/core/vocab/workspace.vocab.js +0 -13
- package/dist/core/vocab.d.ts +0 -1
- package/dist/core/vocab.js +0 -1
- package/dist/core/workspace.schema.d.ts +0 -35
- package/dist/core/workspace.schema.js +0 -106
- package/dist/core.d.ts +0 -1
- package/dist/core.js +0 -1
- package/dist/discovery/vercel.d.ts +0 -25
- package/dist/discovery/vercel.js +0 -95
- package/dist/discovery.d.ts +0 -1
- package/dist/discovery.js +0 -1
- package/dist/extension.d.ts +0 -1
- package/dist/extension.js +0 -1
- package/dist/favorite.d.ts +0 -1
- package/dist/favorite.js +0 -1
- package/dist/file.d.ts +0 -1
- package/dist/file.js +0 -1
- package/dist/import.d.ts +0 -1
- package/dist/import.js +0 -1
- package/dist/knowledge.d.ts +0 -1
- package/dist/knowledge.js +0 -1
- package/dist/session.d.ts +0 -1
- package/dist/session.js +0 -1
- package/dist/settings.d.ts +0 -1
- package/dist/settings.js +0 -1
- package/dist/sidecar/index.d.ts +0 -2
- package/dist/sidecar/index.js +0 -2
- package/dist/vocab/workspace.vocab.d.ts +0 -12
- package/dist/vocab/workspace.vocab.js +0 -13
- package/dist/vocab.d.ts +0 -1
- package/dist/vocab.js +0 -1
- package/dist/workspace.repository.d.ts +0 -45
- package/dist/workspace.repository.js +0 -8
- package/dist/workspace.schema.d.ts +0 -1
- package/dist/workspace.schema.js +0 -1
|
@@ -1 +1,49 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
151
|
-
status: "active" | "error" | "paused" | "completed";
|
|
150
|
+
status: "error" | "paused" | "active" | "completed";
|
|
152
151
|
tokenUsage: number;
|
|
153
|
-
|
|
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
|
-
|
|
163
|
-
status: "active" | "error" | "paused" | "completed";
|
|
162
|
+
status: "error" | "paused" | "active" | "completed";
|
|
164
163
|
tokenUsage: number;
|
|
165
|
-
|
|
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
|
-
|
|
188
|
-
status: "active" | "error" | "paused" | "completed";
|
|
187
|
+
status: "error" | "paused" | "active" | "completed";
|
|
189
188
|
tokenUsage: number;
|
|
190
|
-
|
|
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
|
-
|
|
200
|
-
status: "active" | "error" | "paused" | "completed";
|
|
199
|
+
status: "error" | "paused" | "active" | "completed";
|
|
201
200
|
tokenUsage: number;
|
|
202
|
-
|
|
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
|
-
|
|
504
|
-
status: "active" | "error" | "paused" | "completed";
|
|
503
|
+
status: "error" | "paused" | "active" | "completed";
|
|
505
504
|
tokenUsage: number;
|
|
506
|
-
|
|
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
|
-
|
|
516
|
-
status: "active" | "error" | "paused" | "completed";
|
|
515
|
+
status: "error" | "paused" | "active" | "completed";
|
|
517
516
|
tokenUsage: number;
|
|
518
|
-
|
|
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
|
|
2
|
-
id: import("@undefineds.co/
|
|
3
|
-
|
|
4
|
-
title: import("@undefineds.co/
|
|
5
|
-
starred: import("@undefineds.co/
|
|
6
|
-
|
|
7
|
-
metadata: import("@undefineds.co/
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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>>;
|
package/dist/thread.schema.d.ts
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
|
|
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;
|
package/dist/thread.schema.js
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
-
|
|
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
|
|
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
|
|
1
|
+
export * from '../namespaces';
|
package/dist/vocab/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export * from './_namespaces
|
|
2
|
-
export * from './chat.vocab
|
|
3
|
-
export * from './message.vocab
|
|
4
|
-
export * from './contact.vocab
|
|
5
|
-
export * from './thread.vocab
|
|
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';
|
package/dist/vocab/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { DCTerms, LINX_CHAT, SIOC, UDFS } from '../namespaces.js';
|
|
2
2
|
export const ThreadVocab = {
|
|
3
|
-
|
|
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
|
|
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,
|