adp-openclaw 0.0.44 → 0.0.46
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/index.ts +11 -2
- package/package.json +1 -1
- package/src/monitor.ts +5 -0
- package/src/tool-result-message-blocks.ts +1 -0
package/index.ts
CHANGED
|
@@ -179,16 +179,23 @@ const plugin = {
|
|
|
179
179
|
|
|
180
180
|
api.logger.debug?.(`[${ADP_UPLOAD_TOOL_NAME}] upload success toolCallId=${toolCallId} count=${successResult.files?.length ?? 0} paths=${JSON.stringify(parsed.value.paths)}`);
|
|
181
181
|
|
|
182
|
+
// Debug: print full downloadUrl for each file
|
|
183
|
+
for (const file of (successResult.files || [])) {
|
|
184
|
+
api.logger.info?.(`[${ADP_UPLOAD_TOOL_NAME}] file.downloadUrl: ${file.downloadUrl}`);
|
|
185
|
+
api.logger.info?.(`[${ADP_UPLOAD_TOOL_NAME}] file.uri: ${file.uri}`);
|
|
186
|
+
}
|
|
187
|
+
|
|
182
188
|
// Build content with resource links and download URLs
|
|
183
|
-
const content: Array<{ type: string; uri?: string; name?: string; mimeType?: string; text?: string }> = [];
|
|
189
|
+
const content: Array<{ type: string; uri?: string; name?: string; mimeType?: string; text?: string; downloadUrl?: string }> = [];
|
|
184
190
|
|
|
185
191
|
// Add resource links for each file
|
|
186
192
|
for (const file of (successResult.files || [])) {
|
|
187
193
|
content.push({
|
|
188
194
|
type: "resource_link",
|
|
189
|
-
uri: file.uri,
|
|
195
|
+
uri: file.downloadUrl || file.uri, // 使用带签名的下载链接
|
|
190
196
|
name: file.name,
|
|
191
197
|
mimeType: file.mimeType,
|
|
198
|
+
downloadUrl: file.downloadUrl, // 也包含 downloadUrl 字段
|
|
192
199
|
});
|
|
193
200
|
}
|
|
194
201
|
|
|
@@ -197,6 +204,8 @@ const plugin = {
|
|
|
197
204
|
.map((f: UploadedFileInfo) => `- [${f.name}](${f.downloadUrl || f.uri})`)
|
|
198
205
|
.join("\n");
|
|
199
206
|
|
|
207
|
+
api.logger.info?.(`[${ADP_UPLOAD_TOOL_NAME}] urlSummary: ${urlSummary}`);
|
|
208
|
+
|
|
200
209
|
content.push({
|
|
201
210
|
type: "text",
|
|
202
211
|
text: `Files uploaded successfully:\n${urlSummary}\n\n⚠️ Note: Please include these download links in your response to the user and remind them that the links are valid for 24 hours.`,
|
package/package.json
CHANGED
package/src/monitor.ts
CHANGED
|
@@ -452,6 +452,11 @@ async function connectAndHandle(params: ConnectParams): Promise<void> {
|
|
|
452
452
|
if (toolName === ADP_UPLOAD_TOOL_NAME && toolResult && typeof toolResult === "object") {
|
|
453
453
|
const result = toolResult as AdpUploadToolResult;
|
|
454
454
|
if (result.ok && result.files && result.files.length > 0) {
|
|
455
|
+
// Debug: print full downloadUrl before formatting
|
|
456
|
+
for (const file of result.files) {
|
|
457
|
+
log?.info(`[adp-openclaw] File downloadUrl (full): ${file.downloadUrl}`);
|
|
458
|
+
}
|
|
459
|
+
|
|
455
460
|
// Format upload result as user-readable message
|
|
456
461
|
const uploadMessage = formatUploadResultAsMarkdown(result);
|
|
457
462
|
|
|
@@ -247,6 +247,7 @@ export const formatUploadResultAsMarkdown = (result: AdpUploadToolResult): strin
|
|
|
247
247
|
|
|
248
248
|
const lines: string[] = ["**文件上传成功**:"];
|
|
249
249
|
for (const file of result.files) {
|
|
250
|
+
console.log(`[ADP-UPLOAD] formatUploadResultAsMarkdown - file.downloadUrl: ${file.downloadUrl}`);
|
|
250
251
|
if (file.downloadUrl) {
|
|
251
252
|
lines.push(`- [${file.name}](${file.downloadUrl})`);
|
|
252
253
|
} else {
|