@troykelly/openclaw-projects 0.0.8 → 0.0.10
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/api-client.d.ts.map +1 -1
- package/dist/api-client.js +5 -1
- package/dist/api-client.js.map +1 -1
- package/dist/register-openclaw.d.ts.map +1 -1
- package/dist/register-openclaw.js +126 -67
- package/dist/register-openclaw.js.map +1 -1
- package/dist/tools/contacts.d.ts +6 -8
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +13 -26
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/memory-forget.d.ts +1 -6
- package/dist/tools/memory-forget.d.ts.map +1 -1
- package/dist/tools/memory-forget.js +36 -53
- package/dist/tools/memory-forget.js.map +1 -1
- package/dist/tools/memory-recall.d.ts +4 -4
- package/dist/tools/memory-recall.d.ts.map +1 -1
- package/dist/tools/memory-recall.js +13 -3
- package/dist/tools/memory-recall.js.map +1 -1
- package/dist/tools/memory-store.d.ts +25 -8
- package/dist/tools/memory-store.d.ts.map +1 -1
- package/dist/tools/memory-store.js +16 -6
- package/dist/tools/memory-store.js.map +1 -1
- package/dist/tools/message-search.d.ts +4 -13
- package/dist/tools/message-search.d.ts.map +1 -1
- package/dist/tools/message-search.js +6 -12
- package/dist/tools/message-search.js.map +1 -1
- package/dist/tools/projects.js +3 -3
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/relationships.js +5 -5
- package/dist/tools/relationships.js.map +1 -1
- package/dist/tools/threads.d.ts +22 -14
- package/dist/tools/threads.d.ts.map +1 -1
- package/dist/tools/threads.js +25 -15
- package/dist/tools/threads.js.map +1 -1
- package/dist/tools/todos.d.ts.map +1 -1
- package/dist/tools/todos.js +10 -8
- package/dist/tools/todos.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sour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E,gBAAgB,GAAG,SAAS,CAEpE"}
|
package/dist/api-client.js
CHANGED
|
@@ -129,9 +129,13 @@ export class ApiClient {
|
|
|
129
129
|
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
130
130
|
try {
|
|
131
131
|
const headers = {
|
|
132
|
-
'Content-Type': 'application/json',
|
|
133
132
|
'X-Request-Id': requestId,
|
|
134
133
|
};
|
|
134
|
+
// Only set Content-Type for requests that have a body.
|
|
135
|
+
// Fastify rejects Content-Type: application/json with an empty body.
|
|
136
|
+
if (body !== undefined) {
|
|
137
|
+
headers['Content-Type'] = 'application/json';
|
|
138
|
+
}
|
|
135
139
|
if (this.apiKey) {
|
|
136
140
|
headers.Authorization = `Bearer ${this.apiKey}`;
|
|
137
141
|
}
|
package/dist/api-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAe,MAAM,aAAa,CAAC;AAqCxD;;GAEG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB;IACxB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,OAAe,EAAE,SAAS,GAAG,IAAI,EAAE,QAAQ,GAAG,KAAK;IAC9E,yCAAyC;IACzC,MAAM,gBAAgB,GAAG,SAAS,GAAG,CAAC,IAAI,OAAO,CAAC;IAClD,+CAA+C;IAC/C,MAAM,MAAM,GAAG,gBAAgB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IAC/D,OAAO,IAAI,CAAC,GAAG,CAA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O,KAAK,EAEV,iBAAiB,EAEjB,UAAU,EAOX,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"register-openclaw.d.ts","sourceRoot":"","sources":["../src/register-openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAEV,iBAAiB,EAEjB,UAAU,EAOX,MAAM,yBAAyB,CAAC;AAuoEjC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAkgB9B,CAAC;AAEF,yDAAyD;AACzD,eAAe,gBAAgB,CAAC;AAEhC,2CAA2C;AAC3C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BnB,CAAC"}
|
|
@@ -57,7 +57,7 @@ const memoryRecallSchema = {
|
|
|
57
57
|
category: {
|
|
58
58
|
type: 'string',
|
|
59
59
|
description: 'Filter by memory category',
|
|
60
|
-
enum: ['preference', 'fact', 'decision', 'context', 'other'],
|
|
60
|
+
enum: ['preference', 'fact', 'decision', 'context', 'entity', 'other'],
|
|
61
61
|
},
|
|
62
62
|
tags: {
|
|
63
63
|
type: 'array',
|
|
@@ -82,24 +82,30 @@ const memoryRecallSchema = {
|
|
|
82
82
|
const memoryStoreSchema = {
|
|
83
83
|
type: 'object',
|
|
84
84
|
properties: {
|
|
85
|
-
|
|
85
|
+
text: {
|
|
86
86
|
type: 'string',
|
|
87
|
-
description: '
|
|
87
|
+
description: 'Information to remember',
|
|
88
88
|
minLength: 1,
|
|
89
89
|
maxLength: 10000,
|
|
90
90
|
},
|
|
91
|
-
|
|
91
|
+
content: {
|
|
92
92
|
type: 'string',
|
|
93
|
-
description: '
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
description: 'Alias for text (backwards compatibility)',
|
|
94
|
+
minLength: 1,
|
|
95
|
+
maxLength: 10000,
|
|
96
96
|
},
|
|
97
97
|
importance: {
|
|
98
98
|
type: 'number',
|
|
99
|
-
description: 'Importance
|
|
99
|
+
description: 'Importance 0-1 (default: 0.7)',
|
|
100
100
|
minimum: 0,
|
|
101
101
|
maximum: 1,
|
|
102
|
-
default: 0.
|
|
102
|
+
default: 0.7,
|
|
103
|
+
},
|
|
104
|
+
category: {
|
|
105
|
+
type: 'string',
|
|
106
|
+
description: 'Memory category',
|
|
107
|
+
enum: ['preference', 'fact', 'decision', 'context', 'entity', 'other'],
|
|
108
|
+
default: 'other',
|
|
103
109
|
},
|
|
104
110
|
tags: {
|
|
105
111
|
type: 'array',
|
|
@@ -116,7 +122,7 @@ const memoryStoreSchema = {
|
|
|
116
122
|
format: 'uuid',
|
|
117
123
|
},
|
|
118
124
|
},
|
|
119
|
-
required: ['
|
|
125
|
+
required: ['text'],
|
|
120
126
|
};
|
|
121
127
|
/**
|
|
122
128
|
* Memory forget tool JSON Schema
|
|
@@ -882,7 +888,7 @@ function createToolHandlers(state) {
|
|
|
882
888
|
try {
|
|
883
889
|
const queryParams = new URLSearchParams({ q: query, limit: String(limit) });
|
|
884
890
|
if (category)
|
|
885
|
-
queryParams.set('
|
|
891
|
+
queryParams.set('memory_type', category);
|
|
886
892
|
if (tags && tags.length > 0)
|
|
887
893
|
queryParams.set('tags', tags.join(','));
|
|
888
894
|
if (relationship_id)
|
|
@@ -891,8 +897,8 @@ function createToolHandlers(state) {
|
|
|
891
897
|
if (!response.success) {
|
|
892
898
|
return { success: false, error: response.error.message };
|
|
893
899
|
}
|
|
894
|
-
const memories = response.data.
|
|
895
|
-
const content = memories.length > 0 ? memories.map((m) => `- [${m.
|
|
900
|
+
const memories = response.data.results ?? [];
|
|
901
|
+
const content = memories.length > 0 ? memories.map((m) => `- [${m.type}] ${m.content}`).join('\n') : 'No relevant memories found.';
|
|
896
902
|
return {
|
|
897
903
|
success: true,
|
|
898
904
|
data: {
|
|
@@ -907,22 +913,33 @@ function createToolHandlers(state) {
|
|
|
907
913
|
}
|
|
908
914
|
},
|
|
909
915
|
async memory_store(params) {
|
|
910
|
-
|
|
916
|
+
// Accept 'text' (OpenClaw native) or 'content' (backwards compat)
|
|
917
|
+
const { text, content: contentAlias, category = 'other', importance = 0.7, tags, relationship_id, } = params;
|
|
918
|
+
const memoryText = text || contentAlias;
|
|
919
|
+
if (!memoryText) {
|
|
920
|
+
return { success: false, error: 'text is required' };
|
|
921
|
+
}
|
|
911
922
|
try {
|
|
912
|
-
|
|
923
|
+
// Map to backend's /api/memories/unified which expects 'content'
|
|
924
|
+
// Map 'category' → 'memory_type' (backend term)
|
|
925
|
+
const payload = {
|
|
926
|
+
content: memoryText,
|
|
927
|
+
memory_type: category === 'entity' ? 'reference' : category === 'other' ? 'note' : category,
|
|
928
|
+
importance,
|
|
929
|
+
};
|
|
913
930
|
if (tags && tags.length > 0)
|
|
914
931
|
payload.tags = tags;
|
|
915
932
|
if (relationship_id)
|
|
916
933
|
payload.relationship_id = relationship_id;
|
|
917
|
-
const response = await apiClient.post('/api/memories', payload, { userId });
|
|
934
|
+
const response = await apiClient.post('/api/memories/unified', payload, { userId });
|
|
918
935
|
if (!response.success) {
|
|
919
936
|
return { success: false, error: response.error.message };
|
|
920
937
|
}
|
|
921
938
|
return {
|
|
922
939
|
success: true,
|
|
923
940
|
data: {
|
|
924
|
-
content: `
|
|
925
|
-
details: { id: response.data.id
|
|
941
|
+
content: `Stored: "${memoryText.slice(0, 100)}${memoryText.length > 100 ? '...' : ''}"`,
|
|
942
|
+
details: { action: 'created', id: response.data.id },
|
|
926
943
|
},
|
|
927
944
|
};
|
|
928
945
|
}
|
|
@@ -945,15 +962,40 @@ function createToolHandlers(state) {
|
|
|
945
962
|
};
|
|
946
963
|
}
|
|
947
964
|
if (query) {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
965
|
+
// Match OpenClaw gateway memory_forget behavior:
|
|
966
|
+
// Search → single high-confidence match auto-deletes, multiple returns candidates.
|
|
967
|
+
const searchResponse = await apiClient.get(`/api/memories/search?q=${encodeURIComponent(query)}&limit=5`, { userId });
|
|
968
|
+
if (!searchResponse.success) {
|
|
969
|
+
return { success: false, error: searchResponse.error.message };
|
|
970
|
+
}
|
|
971
|
+
const matches = searchResponse.data.results ?? [];
|
|
972
|
+
if (matches.length === 0) {
|
|
973
|
+
return {
|
|
974
|
+
success: true,
|
|
975
|
+
data: { content: 'No matching memories found.', details: { found: 0 } },
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
// Single high-confidence match → auto-delete
|
|
979
|
+
if (matches.length === 1 && (matches[0].similarity ?? 0) > 0.9) {
|
|
980
|
+
const delResponse = await apiClient.delete(`/api/memories/${matches[0].id}`, { userId });
|
|
981
|
+
if (!delResponse.success) {
|
|
982
|
+
return { success: false, error: delResponse.error.message };
|
|
983
|
+
}
|
|
984
|
+
return {
|
|
985
|
+
success: true,
|
|
986
|
+
data: {
|
|
987
|
+
content: `Forgotten: "${matches[0].content}"`,
|
|
988
|
+
details: { action: 'deleted', id: matches[0].id },
|
|
989
|
+
},
|
|
990
|
+
};
|
|
951
991
|
}
|
|
992
|
+
// Multiple matches or low confidence → return candidates, don't delete
|
|
993
|
+
const list = matches.map((m) => `- [${m.id.slice(0, 8)}] ${m.content.slice(0, 60)}${m.content.length > 60 ? '...' : ''}`).join('\n');
|
|
952
994
|
return {
|
|
953
995
|
success: true,
|
|
954
996
|
data: {
|
|
955
|
-
content: `
|
|
956
|
-
details: {
|
|
997
|
+
content: `Found ${matches.length} candidates. Specify memoryId:\n${list}`,
|
|
998
|
+
details: { action: 'candidates', candidates: matches.map((m) => ({ id: m.id, content: m.content, similarity: m.similarity })) },
|
|
957
999
|
},
|
|
958
1000
|
};
|
|
959
1001
|
}
|
|
@@ -967,15 +1009,15 @@ function createToolHandlers(state) {
|
|
|
967
1009
|
async project_list(params) {
|
|
968
1010
|
const { status = 'active', limit = 10 } = params;
|
|
969
1011
|
try {
|
|
970
|
-
const queryParams = new URLSearchParams({ limit: String(limit) });
|
|
1012
|
+
const queryParams = new URLSearchParams({ item_type: 'project', limit: String(limit) });
|
|
971
1013
|
if (status !== 'all')
|
|
972
1014
|
queryParams.set('status', status);
|
|
973
|
-
const response = await apiClient.get(`/api/
|
|
1015
|
+
const response = await apiClient.get(`/api/work-items?${queryParams}`, { userId });
|
|
974
1016
|
if (!response.success) {
|
|
975
1017
|
return { success: false, error: response.error.message };
|
|
976
1018
|
}
|
|
977
|
-
const projects = response.data.
|
|
978
|
-
const content = projects.length > 0 ? projects.map((p) => `- ${p.
|
|
1019
|
+
const projects = response.data.items ?? [];
|
|
1020
|
+
const content = projects.length > 0 ? projects.map((p) => `- ${p.title} (${p.status})`).join('\n') : 'No projects found.';
|
|
979
1021
|
return {
|
|
980
1022
|
success: true,
|
|
981
1023
|
data: { content, details: { count: projects.length, projects } },
|
|
@@ -989,7 +1031,7 @@ function createToolHandlers(state) {
|
|
|
989
1031
|
async project_get(params) {
|
|
990
1032
|
const { projectId } = params;
|
|
991
1033
|
try {
|
|
992
|
-
const response = await apiClient.get(`/api/
|
|
1034
|
+
const response = await apiClient.get(`/api/work-items/${projectId}`, { userId });
|
|
993
1035
|
if (!response.success) {
|
|
994
1036
|
return { success: false, error: response.error.message };
|
|
995
1037
|
}
|
|
@@ -997,7 +1039,7 @@ function createToolHandlers(state) {
|
|
|
997
1039
|
return {
|
|
998
1040
|
success: true,
|
|
999
1041
|
data: {
|
|
1000
|
-
content: `Project: ${project.
|
|
1042
|
+
content: `Project: ${project.title}\nStatus: ${project.status}\n${project.description || ''}`,
|
|
1001
1043
|
details: { project },
|
|
1002
1044
|
},
|
|
1003
1045
|
};
|
|
@@ -1010,7 +1052,7 @@ function createToolHandlers(state) {
|
|
|
1010
1052
|
async project_create(params) {
|
|
1011
1053
|
const { name, description, status = 'active', } = params;
|
|
1012
1054
|
try {
|
|
1013
|
-
const response = await apiClient.post('/api/
|
|
1055
|
+
const response = await apiClient.post('/api/work-items', { title: name, description, item_type: 'project', status }, { userId });
|
|
1014
1056
|
if (!response.success) {
|
|
1015
1057
|
return { success: false, error: response.error.message };
|
|
1016
1058
|
}
|
|
@@ -1030,16 +1072,16 @@ function createToolHandlers(state) {
|
|
|
1030
1072
|
async todo_list(params) {
|
|
1031
1073
|
const { projectId, status = 'pending', limit = 20, } = params;
|
|
1032
1074
|
try {
|
|
1033
|
-
const queryParams = new URLSearchParams({ limit: String(limit) });
|
|
1075
|
+
const queryParams = new URLSearchParams({ item_type: 'task', limit: String(limit) });
|
|
1034
1076
|
if (status !== 'all')
|
|
1035
1077
|
queryParams.set('status', status);
|
|
1036
1078
|
if (projectId)
|
|
1037
|
-
queryParams.set('
|
|
1038
|
-
const response = await apiClient.get(`/api/
|
|
1079
|
+
queryParams.set('parent_work_item_id', projectId);
|
|
1080
|
+
const response = await apiClient.get(`/api/work-items?${queryParams}`, { userId });
|
|
1039
1081
|
if (!response.success) {
|
|
1040
1082
|
return { success: false, error: response.error.message };
|
|
1041
1083
|
}
|
|
1042
|
-
const todos = response.data.
|
|
1084
|
+
const todos = response.data.items ?? [];
|
|
1043
1085
|
const content = todos.length > 0 ? todos.map((t) => `- [${t.status}] ${t.title}`).join('\n') : 'No todos found.';
|
|
1044
1086
|
return {
|
|
1045
1087
|
success: true,
|
|
@@ -1054,7 +1096,12 @@ function createToolHandlers(state) {
|
|
|
1054
1096
|
async todo_create(params) {
|
|
1055
1097
|
const { title, description, projectId, priority = 'medium', dueDate, } = params;
|
|
1056
1098
|
try {
|
|
1057
|
-
const
|
|
1099
|
+
const body = { title, description, item_type: 'task', priority };
|
|
1100
|
+
if (projectId)
|
|
1101
|
+
body.parent_work_item_id = projectId;
|
|
1102
|
+
if (dueDate)
|
|
1103
|
+
body.not_after = dueDate;
|
|
1104
|
+
const response = await apiClient.post('/api/work-items', body, { userId });
|
|
1058
1105
|
if (!response.success) {
|
|
1059
1106
|
return { success: false, error: response.error.message };
|
|
1060
1107
|
}
|
|
@@ -1074,7 +1121,7 @@ function createToolHandlers(state) {
|
|
|
1074
1121
|
async todo_complete(params) {
|
|
1075
1122
|
const { todoId } = params;
|
|
1076
1123
|
try {
|
|
1077
|
-
const response = await apiClient.patch(`/api/
|
|
1124
|
+
const response = await apiClient.patch(`/api/work-items/${todoId}/status`, { status: 'completed' }, { userId });
|
|
1078
1125
|
if (!response.success) {
|
|
1079
1126
|
return { success: false, error: response.error.message };
|
|
1080
1127
|
}
|
|
@@ -1091,15 +1138,15 @@ function createToolHandlers(state) {
|
|
|
1091
1138
|
async contact_search(params) {
|
|
1092
1139
|
const { query, limit = 10 } = params;
|
|
1093
1140
|
try {
|
|
1094
|
-
const queryParams = new URLSearchParams({
|
|
1095
|
-
const response = await apiClient.get(`/api/contacts
|
|
1141
|
+
const queryParams = new URLSearchParams({ search: query, limit: String(limit) });
|
|
1142
|
+
const response = await apiClient.get(`/api/contacts?${queryParams}`, {
|
|
1096
1143
|
userId,
|
|
1097
1144
|
});
|
|
1098
1145
|
if (!response.success) {
|
|
1099
1146
|
return { success: false, error: response.error.message };
|
|
1100
1147
|
}
|
|
1101
1148
|
const contacts = response.data.contacts ?? [];
|
|
1102
|
-
const content = contacts.length > 0 ? contacts.map((c) => `- ${c.
|
|
1149
|
+
const content = contacts.length > 0 ? contacts.map((c) => `- ${c.displayName}${c.email ? ` (${c.email})` : ''}`).join('\n') : 'No contacts found.';
|
|
1103
1150
|
return {
|
|
1104
1151
|
success: true,
|
|
1105
1152
|
data: { content, details: { count: contacts.length, contacts } },
|
|
@@ -1138,9 +1185,10 @@ function createToolHandlers(state) {
|
|
|
1138
1185
|
}
|
|
1139
1186
|
},
|
|
1140
1187
|
async contact_create(params) {
|
|
1141
|
-
const { name,
|
|
1188
|
+
const { name, notes } = params;
|
|
1142
1189
|
try {
|
|
1143
|
-
|
|
1190
|
+
// API requires displayName, not name. Email/phone are stored as separate contact_endpoint records.
|
|
1191
|
+
const response = await apiClient.post('/api/contacts', { displayName: name, notes }, { userId });
|
|
1144
1192
|
if (!response.success) {
|
|
1145
1193
|
return { success: false, error: response.error.message };
|
|
1146
1194
|
}
|
|
@@ -1281,7 +1329,7 @@ function createToolHandlers(state) {
|
|
|
1281
1329
|
hasIdempotencyKey: !!idempotencyKey,
|
|
1282
1330
|
});
|
|
1283
1331
|
try {
|
|
1284
|
-
const response = await apiClient.post('/api/
|
|
1332
|
+
const response = await apiClient.post('/api/email/messages/send', { to, subject, body, htmlBody, threadId, idempotencyKey }, { userId });
|
|
1285
1333
|
if (!response.success) {
|
|
1286
1334
|
logger.error('email_send API error', {
|
|
1287
1335
|
userId,
|
|
@@ -1355,6 +1403,7 @@ function createToolHandlers(state) {
|
|
|
1355
1403
|
if (includeThread) {
|
|
1356
1404
|
queryParams.set('includeThread', 'true');
|
|
1357
1405
|
}
|
|
1406
|
+
// Unified search API: returns { results: [{ type, id, title, snippet, score, metadata }], total }
|
|
1358
1407
|
const response = await apiClient.get(`/api/search?${queryParams}`, { userId });
|
|
1359
1408
|
if (!response.success) {
|
|
1360
1409
|
logger.error('message_search API error', {
|
|
@@ -1368,14 +1417,14 @@ function createToolHandlers(state) {
|
|
|
1368
1417
|
};
|
|
1369
1418
|
}
|
|
1370
1419
|
const { results, total } = response.data;
|
|
1371
|
-
// Transform results
|
|
1420
|
+
// Transform unified search results to message format
|
|
1372
1421
|
const messages = results.map((r) => ({
|
|
1373
1422
|
id: r.id,
|
|
1374
|
-
body: r.
|
|
1375
|
-
direction: r.direction,
|
|
1376
|
-
channel: r.channel,
|
|
1377
|
-
contactName: r.contactName,
|
|
1378
|
-
timestamp: r.
|
|
1423
|
+
body: r.snippet,
|
|
1424
|
+
direction: r.metadata?.direction || 'inbound',
|
|
1425
|
+
channel: r.metadata?.channel || 'unknown',
|
|
1426
|
+
contactName: r.metadata?.contactName,
|
|
1427
|
+
timestamp: r.metadata?.received_at || '',
|
|
1379
1428
|
similarity: r.score,
|
|
1380
1429
|
}));
|
|
1381
1430
|
logger.debug('message_search completed', {
|
|
@@ -1390,7 +1439,8 @@ function createToolHandlers(state) {
|
|
|
1390
1439
|
const prefix = m.direction === 'inbound' ? '←' : '→';
|
|
1391
1440
|
const contact = m.contactName || 'Unknown';
|
|
1392
1441
|
const similarity = `(${Math.round(m.similarity * 100)}%)`;
|
|
1393
|
-
|
|
1442
|
+
const bodyText = m.body || '';
|
|
1443
|
+
return `${prefix} [${m.channel}] ${contact} ${similarity}: ${bodyText.substring(0, 100)}${bodyText.length > 100 ? '...' : ''}`;
|
|
1394
1444
|
})
|
|
1395
1445
|
.join('\n')
|
|
1396
1446
|
: 'No messages found matching your query.';
|
|
@@ -1422,7 +1472,9 @@ function createToolHandlers(state) {
|
|
|
1422
1472
|
limit,
|
|
1423
1473
|
});
|
|
1424
1474
|
try {
|
|
1475
|
+
// No /api/threads listing exists. Use unified search with types=message.
|
|
1425
1476
|
const queryParams = new URLSearchParams();
|
|
1477
|
+
queryParams.set('types', 'message');
|
|
1426
1478
|
queryParams.set('limit', String(limit));
|
|
1427
1479
|
if (channel) {
|
|
1428
1480
|
queryParams.set('channel', channel);
|
|
@@ -1430,7 +1482,7 @@ function createToolHandlers(state) {
|
|
|
1430
1482
|
if (contactId) {
|
|
1431
1483
|
queryParams.set('contactId', contactId);
|
|
1432
1484
|
}
|
|
1433
|
-
const response = await apiClient.get(`/api/
|
|
1485
|
+
const response = await apiClient.get(`/api/search?${queryParams}`, { userId });
|
|
1434
1486
|
if (!response.success) {
|
|
1435
1487
|
logger.error('thread_list API error', {
|
|
1436
1488
|
userId,
|
|
@@ -1442,18 +1494,25 @@ function createToolHandlers(state) {
|
|
|
1442
1494
|
error: response.error.message || 'Failed to list threads',
|
|
1443
1495
|
};
|
|
1444
1496
|
}
|
|
1445
|
-
|
|
1497
|
+
// Search API returns { results: [...], total }, not { threads: [...] }
|
|
1498
|
+
const results = response.data.results ?? response.data.threads ?? [];
|
|
1499
|
+
const total = response.data.total ?? results.length;
|
|
1446
1500
|
logger.debug('thread_list completed', {
|
|
1447
1501
|
userId,
|
|
1448
|
-
threadCount:
|
|
1502
|
+
threadCount: results.length,
|
|
1449
1503
|
total,
|
|
1450
1504
|
});
|
|
1451
|
-
const content =
|
|
1452
|
-
?
|
|
1453
|
-
.map((
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1505
|
+
const content = results.length > 0
|
|
1506
|
+
? results
|
|
1507
|
+
.map((r) => {
|
|
1508
|
+
// Handle both thread and search result formats
|
|
1509
|
+
if ('channel' in r) {
|
|
1510
|
+
const t = r;
|
|
1511
|
+
const contact = t.contactName || t.endpointValue || 'Unknown';
|
|
1512
|
+
const msgCount = t.messageCount ? `${t.messageCount} message${t.messageCount !== 1 ? 's' : ''}` : '';
|
|
1513
|
+
return `[${t.channel}] ${contact}${msgCount ? ` - ${msgCount}` : ''}`;
|
|
1514
|
+
}
|
|
1515
|
+
return `- ${r.title || r.snippet || r.id}`;
|
|
1457
1516
|
})
|
|
1458
1517
|
.join('\n')
|
|
1459
1518
|
: 'No threads found.';
|
|
@@ -1461,7 +1520,7 @@ function createToolHandlers(state) {
|
|
|
1461
1520
|
success: true,
|
|
1462
1521
|
data: {
|
|
1463
1522
|
content,
|
|
1464
|
-
details: { threads, total, userId },
|
|
1523
|
+
details: { threads: results, total, userId },
|
|
1465
1524
|
},
|
|
1466
1525
|
};
|
|
1467
1526
|
}
|
|
@@ -1492,8 +1551,8 @@ function createToolHandlers(state) {
|
|
|
1492
1551
|
});
|
|
1493
1552
|
try {
|
|
1494
1553
|
const queryParams = new URLSearchParams();
|
|
1495
|
-
queryParams.set('
|
|
1496
|
-
const response = await apiClient.get(`/api/threads/${threadId}?${queryParams}`, { userId });
|
|
1554
|
+
queryParams.set('limit', String(messageLimit));
|
|
1555
|
+
const response = await apiClient.get(`/api/threads/${threadId}/history?${queryParams}`, { userId });
|
|
1497
1556
|
if (!response.success) {
|
|
1498
1557
|
logger.error('thread_get API error', {
|
|
1499
1558
|
userId,
|
|
@@ -1561,9 +1620,9 @@ function createToolHandlers(state) {
|
|
|
1561
1620
|
});
|
|
1562
1621
|
try {
|
|
1563
1622
|
const body = {
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1623
|
+
contact_a,
|
|
1624
|
+
contact_b,
|
|
1625
|
+
relationship_type: relationship,
|
|
1567
1626
|
};
|
|
1568
1627
|
if (notes) {
|
|
1569
1628
|
body.notes = notes;
|
|
@@ -1610,11 +1669,11 @@ function createToolHandlers(state) {
|
|
|
1610
1669
|
hasTypeFilter: !!type_filter,
|
|
1611
1670
|
});
|
|
1612
1671
|
try {
|
|
1613
|
-
const queryParams = new URLSearchParams({ contact });
|
|
1672
|
+
const queryParams = new URLSearchParams({ contact_id: contact });
|
|
1614
1673
|
if (type_filter) {
|
|
1615
|
-
queryParams.set('
|
|
1674
|
+
queryParams.set('relationship_type_id', type_filter);
|
|
1616
1675
|
}
|
|
1617
|
-
const response = await apiClient.get(`/api/relationships
|
|
1676
|
+
const response = await apiClient.get(`/api/relationships?${queryParams}`, { userId });
|
|
1618
1677
|
if (!response.success) {
|
|
1619
1678
|
return { success: false, error: response.error.message };
|
|
1620
1679
|
}
|