@undefineds.co/models 0.2.0 → 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/README.md +515 -125
- 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 +8 -8
- package/dist/fixtures/contracts-chat-contact.js +5 -9
- 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 -43
- package/dist/index.js +27 -26
- 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/{governance/runtime-projections.d.ts → sidecar/persistence-mapping.d.ts} +7 -7
- package/dist/{governance/runtime-projections.js → sidecar/persistence-mapping.js} +7 -1
- package/dist/{protocols/runtime-events.d.ts → sidecar/sidecar-events.d.ts} +35 -35
- package/dist/{protocols/runtime-events.js → sidecar/sidecar-events.js} +21 -4
- 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/{core/types/collaboration-rich-content.d.ts → types/collaboration-blocks.d.ts} +7 -7
- package/dist/types/collaboration-blocks.js +7 -0
- package/dist/types/message-block.d.ts +270 -0
- package/dist/types/message-block.js +125 -0
- 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 -39
- 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-rich-content.js +0 -7
- package/dist/core/types/message-rich-content.d.ts +0 -121
- package/dist/core/types/message-rich-content.js +0 -85
- 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/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/governance/index.d.ts +0 -1
- package/dist/governance/index.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/protocols/index.d.ts +0 -1
- package/dist/protocols/index.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/types/collaboration-rich-content.d.ts +0 -52
- package/dist/types/collaboration-rich-content.js +0 -7
- package/dist/types/message-rich-content.d.ts +0 -121
- package/dist/types/message-rich-content.js +0 -85
- package/dist/vocab/governance.vocab.d.ts +0 -46
- package/dist/vocab/governance.vocab.js +0 -47
- 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
- /package/dist/{core/vocab/governance.vocab.d.ts → vocab/sidecar.vocab.d.ts} +0 -0
- /package/dist/{core/vocab/governance.vocab.js → vocab/sidecar.vocab.js} +0 -0
|
@@ -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 { InboxApprovalEvent, SessionStateEvent
|
|
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';
|
|
@@ -14,7 +14,7 @@ export type ApprovalProjectionUpdate = Partial<Pick<ApprovalUpdate, 'status' | '
|
|
|
14
14
|
export type AuditProjectionInsert = Pick<AuditInsert, 'action' | 'actor' | 'actorRole' | 'onBehalfOf' | 'session' | 'toolCallId' | 'approval' | 'context' | 'policy' | 'policyVersion'>;
|
|
15
15
|
export type GrantProjectionInsert = Pick<GrantInsert, 'target' | 'action' | 'effect' | 'riskCeiling' | 'decisionBy' | 'decisionRole' | 'onBehalfOf'>;
|
|
16
16
|
export type InboxNotificationProjectionInsert = Pick<InboxNotificationInsert, 'actor' | 'object'>;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const SidecarEventToPodMapping: {
|
|
18
18
|
readonly tool_call_waiting_approval: {
|
|
19
19
|
readonly approval: "insert";
|
|
20
20
|
readonly inboxNotification: "insert";
|
|
@@ -37,7 +37,6 @@ export declare const RuntimeEventProjectionRules: {
|
|
|
37
37
|
readonly chat: "update";
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
export type RuntimeEventProjectionRuleKey = keyof typeof RuntimeEventProjectionRules;
|
|
41
40
|
export declare function hasPodScope(scope: {
|
|
42
41
|
target?: string;
|
|
43
42
|
action?: string;
|
|
@@ -45,6 +44,7 @@ export declare function hasPodScope(scope: {
|
|
|
45
44
|
target: string;
|
|
46
45
|
action: string;
|
|
47
46
|
};
|
|
47
|
+
export type SidecarPersistenceRuleKey = keyof typeof SidecarEventToPodMapping;
|
|
48
48
|
export declare function isToolWaitingApproval(event: ToolCallEvent): boolean;
|
|
49
49
|
export declare function isToolDecisionEvent(event: ToolCallEvent): boolean;
|
|
50
50
|
export declare function isInboxResolved(event: InboxApprovalEvent): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const SidecarEventToPodMapping = {
|
|
2
|
+
// tool.call
|
|
2
3
|
tool_call_waiting_approval: {
|
|
3
4
|
approval: 'insert',
|
|
4
5
|
inboxNotification: 'insert',
|
|
@@ -11,19 +12,24 @@ export const RuntimeEventProjectionRules = {
|
|
|
11
12
|
audit: 'insert',
|
|
12
13
|
grant: null,
|
|
13
14
|
},
|
|
15
|
+
// inbox.approval
|
|
14
16
|
inbox_approval_resolved: {
|
|
15
17
|
approval: 'update',
|
|
16
18
|
inboxNotification: 'insert',
|
|
17
19
|
audit: null,
|
|
18
20
|
grant: null,
|
|
19
21
|
},
|
|
22
|
+
// session.state
|
|
20
23
|
session_state_terminal: {
|
|
21
24
|
chat: 'update',
|
|
22
25
|
},
|
|
23
26
|
};
|
|
27
|
+
// Projection helpers (pure, no DB calls)
|
|
28
|
+
// NOTE: CP0 scope is Pod-only. Only project events that provide a concrete ODRL target/action.
|
|
24
29
|
export function hasPodScope(scope) {
|
|
25
30
|
return typeof scope.target === 'string' && scope.target.length > 0 && typeof scope.action === 'string' && scope.action.length > 0;
|
|
26
31
|
}
|
|
32
|
+
// Optional helpers for downstream implementers (pure, no DB calls)
|
|
27
33
|
export function isToolWaitingApproval(event) {
|
|
28
34
|
return event.type === 'tool.call' && event.status === 'waiting_approval';
|
|
29
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
2
|
+
export type SidecarEventType = 'tool.call' | 'session.state' | 'tool.control' | 'inbox.approval';
|
|
3
|
+
export type SidecarEventVersion = 1;
|
|
4
4
|
export declare const RiskLevelSchema: z.ZodEnum<["low", "medium", "high"]>;
|
|
5
5
|
export type RiskLevel = z.infer<typeof RiskLevelSchema>;
|
|
6
6
|
export declare const DecisionRoleSchema: z.ZodEnum<["human", "secretary", "system"]>;
|
|
@@ -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" | "completed" | "paused";
|
|
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" | "completed" | "paused";
|
|
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" | "completed" | "paused";
|
|
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" | "completed" | "paused";
|
|
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;
|
|
@@ -427,7 +427,7 @@ export declare const InboxApprovalEventSchema: z.ZodObject<{
|
|
|
427
427
|
version?: 1 | undefined;
|
|
428
428
|
}>;
|
|
429
429
|
export type InboxApprovalEvent = z.infer<typeof InboxApprovalEventSchema>;
|
|
430
|
-
export declare const
|
|
430
|
+
export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
431
431
|
type: z.ZodLiteral<"tool.call">;
|
|
432
432
|
version: z.ZodOptional<z.ZodLiteral<1>>;
|
|
433
433
|
sessionId: z.ZodString;
|
|
@@ -448,10 +448,10 @@ export declare const RuntimeEventSchema: 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 RuntimeEventSchema: 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 RuntimeEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
500
500
|
tokenUsage: z.ZodNumber;
|
|
501
501
|
timestamp: z.ZodString;
|
|
502
502
|
}, "strict", z.ZodTypeAny, {
|
|
503
|
-
|
|
504
|
-
status: "active" | "error" | "completed" | "paused";
|
|
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 RuntimeEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
512
512
|
policyVersion?: string | undefined;
|
|
513
513
|
version?: 1 | undefined;
|
|
514
514
|
}, {
|
|
515
|
-
|
|
516
|
-
status: "active" | "error" | "completed" | "paused";
|
|
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 RuntimeEventSchema: 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 RuntimeEventSchema: 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;
|
|
@@ -628,5 +628,5 @@ export declare const RuntimeEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
628
628
|
policyVersion?: string | undefined;
|
|
629
629
|
version?: 1 | undefined;
|
|
630
630
|
}>]>;
|
|
631
|
-
export type
|
|
632
|
-
export declare function
|
|
631
|
+
export type SidecarEvent = z.infer<typeof SidecarEventSchema>;
|
|
632
|
+
export declare function getSidecarEventVersion(_event: SidecarEvent): SidecarEventVersion;
|
|
@@ -11,6 +11,9 @@ export const ToolCallStatusSchema = z.enum([
|
|
|
11
11
|
'error',
|
|
12
12
|
]);
|
|
13
13
|
const IsoDatetimeSchema = z.string().datetime();
|
|
14
|
+
// --------------------------------------------
|
|
15
|
+
// tool.call
|
|
16
|
+
// --------------------------------------------
|
|
14
17
|
export const ToolCallEventV1Schema = z
|
|
15
18
|
.object({
|
|
16
19
|
type: z.literal('tool.call'),
|
|
@@ -20,6 +23,7 @@ export const ToolCallEventV1Schema = z
|
|
|
20
23
|
toolName: z.string(),
|
|
21
24
|
risk: RiskLevelSchema.optional(),
|
|
22
25
|
status: ToolCallStatusSchema,
|
|
26
|
+
// CP0 Pod-only scope projection
|
|
23
27
|
target: z.string().optional(),
|
|
24
28
|
action: z.string().optional(),
|
|
25
29
|
arguments: z.record(z.unknown()).optional(),
|
|
@@ -27,14 +31,17 @@ export const ToolCallEventV1Schema = z
|
|
|
27
31
|
error: z.string().optional(),
|
|
28
32
|
duration: z.number().int().nonnegative().optional(),
|
|
29
33
|
inboxItemId: z.string().optional(),
|
|
30
|
-
decisionBy: z.string().optional(),
|
|
34
|
+
decisionBy: z.string().optional(), // WebID
|
|
31
35
|
decisionRole: DecisionRoleSchema.optional(),
|
|
32
|
-
onBehalfOf: z.string().optional(),
|
|
36
|
+
onBehalfOf: z.string().optional(), // WebID
|
|
33
37
|
policyVersion: z.string().optional(),
|
|
34
38
|
timestamp: IsoDatetimeSchema,
|
|
35
39
|
})
|
|
36
40
|
.strict();
|
|
37
41
|
export const ToolCallEventSchema = ToolCallEventV1Schema;
|
|
42
|
+
// --------------------------------------------
|
|
43
|
+
// session.state
|
|
44
|
+
// --------------------------------------------
|
|
38
45
|
export const SessionToolSchema = z.enum(['claude-code', 'cursor', 'windsurf']);
|
|
39
46
|
export const SessionStatusSchema = z.enum(['active', 'paused', 'completed', 'error']);
|
|
40
47
|
export const SessionStateEventV1Schema = z
|
|
@@ -53,6 +60,9 @@ export const SessionStateEventV1Schema = z
|
|
|
53
60
|
})
|
|
54
61
|
.strict();
|
|
55
62
|
export const SessionStateEventSchema = SessionStateEventV1Schema;
|
|
63
|
+
// --------------------------------------------
|
|
64
|
+
// tool.control
|
|
65
|
+
// --------------------------------------------
|
|
56
66
|
export const ToolControlCommandNameSchema = z.enum([
|
|
57
67
|
'approve',
|
|
58
68
|
'reject',
|
|
@@ -85,6 +95,9 @@ export const ToolControlCommandV1Schema = z
|
|
|
85
95
|
})
|
|
86
96
|
.strict();
|
|
87
97
|
export const ToolControlCommandSchema = ToolControlCommandV1Schema;
|
|
98
|
+
// --------------------------------------------
|
|
99
|
+
// inbox.approval
|
|
100
|
+
// --------------------------------------------
|
|
88
101
|
export const InboxApprovalStatusSchema = z.enum(['pending', 'approved', 'rejected', 'expired']);
|
|
89
102
|
export const InboxApprovalEventV1Schema = z
|
|
90
103
|
.object({
|
|
@@ -93,6 +106,7 @@ export const InboxApprovalEventV1Schema = z
|
|
|
93
106
|
inboxItemId: z.string(),
|
|
94
107
|
sessionId: z.string(),
|
|
95
108
|
toolCallId: z.string(),
|
|
109
|
+
// Optional Pod scope projection
|
|
96
110
|
target: z.string().optional(),
|
|
97
111
|
action: z.string().optional(),
|
|
98
112
|
policy: z.string().optional(),
|
|
@@ -105,12 +119,15 @@ export const InboxApprovalEventV1Schema = z
|
|
|
105
119
|
})
|
|
106
120
|
.strict();
|
|
107
121
|
export const InboxApprovalEventSchema = InboxApprovalEventV1Schema;
|
|
108
|
-
|
|
122
|
+
// --------------------------------------------
|
|
123
|
+
// SidecarEvent
|
|
124
|
+
// --------------------------------------------
|
|
125
|
+
export const SidecarEventSchema = z.union([
|
|
109
126
|
ToolCallEventSchema,
|
|
110
127
|
SessionStateEventSchema,
|
|
111
128
|
ToolControlCommandSchema,
|
|
112
129
|
InboxApprovalEventSchema,
|
|
113
130
|
]);
|
|
114
|
-
export function
|
|
131
|
+
export function getSidecarEventVersion(_event) {
|
|
115
132
|
return 1;
|
|
116
133
|
}
|
|
@@ -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;
|