@hydra_db/openclaw 0.1.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/types/hydra.ts ADDED
@@ -0,0 +1,166 @@
1
+ export type ConversationTurn = {
2
+ user: string
3
+ assistant: string
4
+ }
5
+
6
+ export type MemoryPayload = {
7
+ text?: string
8
+ user_assistant_pairs?: ConversationTurn[]
9
+ is_markdown?: boolean
10
+ infer?: boolean
11
+ custom_instructions?: string
12
+ user_name?: string
13
+ source_id?: string
14
+ title?: string
15
+ expiry_time?: number
16
+ document_metadata?: string
17
+ tenant_metadata?: string
18
+ }
19
+
20
+ export type AddMemoryRequest = {
21
+ memories: MemoryPayload[]
22
+ tenant_id: string
23
+ sub_tenant_id?: string
24
+ upsert?: boolean
25
+ }
26
+
27
+ export type MemoryResultItem = {
28
+ source_id: string
29
+ title?: string | null
30
+ status: string
31
+ infer: boolean
32
+ error?: string | null
33
+ }
34
+
35
+ export type AddMemoryResponse = {
36
+ success: boolean
37
+ message: string
38
+ results: MemoryResultItem[]
39
+ success_count: number
40
+ failed_count: number
41
+ }
42
+
43
+ export type RecallRequest = {
44
+ tenant_id: string
45
+ sub_tenant_id?: string
46
+ query: string
47
+ max_results?: number
48
+ mode?: "fast" | "thinking"
49
+ alpha?: number | string
50
+ recency_bias?: number
51
+ graph_context?: boolean
52
+ additional_context?: string
53
+ }
54
+
55
+ export type VectorChunk = {
56
+ chunk_uuid: string
57
+ source_id: string
58
+ chunk_content: string
59
+ source_type?: string
60
+ source_upload_time?: string
61
+ source_title?: string
62
+ source_last_updated_time?: string
63
+ relevancy_score?: number | null
64
+ document_metadata?: Record<string, unknown> | null
65
+ tenant_metadata?: Record<string, unknown> | null
66
+ extra_context_ids?: string[] | null
67
+ layout?: string | null
68
+ }
69
+
70
+ export type PathTriplet = {
71
+ source: { name: string; type: string; entity_id: string }
72
+ relation: {
73
+ canonical_predicate: string
74
+ raw_predicate: string
75
+ context: string
76
+ confidence?: number
77
+ chunk_id?: string | null
78
+ relationship_id: string
79
+ }
80
+ target: { name: string; type: string; entity_id: string }
81
+ }
82
+
83
+ export type ScoredPath = {
84
+ triplets: PathTriplet[]
85
+ relevancy_score: number
86
+ combined_context?: string | null
87
+ group_id?: string | null
88
+ }
89
+
90
+ export type GraphContext = {
91
+ query_paths: ScoredPath[]
92
+ chunk_relations: ScoredPath[]
93
+ chunk_id_to_group_ids: Record<string, string[]>
94
+ }
95
+
96
+ export type RecallResponse = {
97
+ chunks: VectorChunk[]
98
+ graph_context?: GraphContext
99
+ additional_context?: Record<string, VectorChunk>
100
+ }
101
+
102
+ // --- List API ---
103
+
104
+ export type ListDataRequest = {
105
+ tenant_id: string
106
+ sub_tenant_id?: string
107
+ kind?: "knowledge" | "memories"
108
+ source_ids?: string[]
109
+ }
110
+
111
+ export type UserMemory = {
112
+ memory_id: string
113
+ memory_content: string
114
+ }
115
+
116
+ export type ListMemoriesResponse = {
117
+ success: boolean
118
+ user_memories: UserMemory[]
119
+ }
120
+
121
+ export type SourceItem = {
122
+ id: string
123
+ tenant_id: string
124
+ sub_tenant_id: string
125
+ title?: string
126
+ type?: string
127
+ description?: string
128
+ timestamp?: string
129
+ url?: string
130
+ }
131
+
132
+ export type ListSourcesResponse = {
133
+ success: boolean
134
+ message?: string
135
+ sources: SourceItem[]
136
+ total: number
137
+ }
138
+
139
+ // --- Delete API ---
140
+
141
+ export type DeleteMemoryResponse = {
142
+ success: boolean
143
+ user_memory_deleted: boolean
144
+ }
145
+
146
+ // --- Fetch Content API ---
147
+
148
+ export type FetchContentRequest = {
149
+ tenant_id: string
150
+ sub_tenant_id?: string
151
+ source_id: string
152
+ mode?: "content" | "url" | "both"
153
+ expiry_seconds?: number
154
+ }
155
+
156
+ export type FetchContentResponse = {
157
+ success: boolean
158
+ source_id: string
159
+ content?: string | null
160
+ content_base64?: string | null
161
+ presigned_url?: string | null
162
+ content_type?: string | null
163
+ size_bytes?: number | null
164
+ message?: string
165
+ error?: string | null
166
+ }
@@ -0,0 +1,19 @@
1
+ declare module "openclaw/plugin-sdk" {
2
+ export interface OpenClawPluginApi {
3
+ pluginConfig: unknown
4
+ logger: {
5
+ info: (msg: string) => void
6
+ warn: (msg: string) => void
7
+ error: (msg: string, ...args: unknown[]) => void
8
+ debug: (msg: string) => void
9
+ }
10
+ config: unknown
11
+ registerTool(tool: any, options: any): void
12
+ registerCommand(command: any): void
13
+ registerCli(handler: any, options?: any): void
14
+ registerService(service: any): void
15
+ on(event: string, handler: (...args: any[]) => any): void
16
+ }
17
+
18
+ export function stringEnum(values: readonly string[]): any
19
+ }