MCPcopy Create free account
hub / github.com/experdot/pointer / readAttachment

Method readAttachment

src/main/attachmentHandler.ts:56–69  ·  view source on GitHub ↗

* 读取附件内容 * @param localPath 相对路径 * @returns base64编码的内容

(
    localPath: string
  )

Source from the content-addressed store, hash-verified

54 * @returns base64编码的内容
55 */
56 async readAttachment(
57 localPath: string
58 ): Promise<{ success: boolean; content?: string; error?: string }> {
59 try {
60 const content = await readAttachmentFile(localPath)
61 return { success: true, content }
62 } catch (error) {
63 console.error('读取附件失败:', error)
64 return {
65 success: false,
66 error: error instanceof Error ? error.message : '读取附件失败'
67 }
68 }
69 }
70
71 /**
72 * 删除附件

Callers 1

setupAttachmentHandlersFunction · 0.80

Calls 1

readAttachmentFileFunction · 0.90

Tested by

no test coverage detected