@amaster.ai/pi-attachments 0.1.0-beta.0 → 0.1.0
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 +50 -27
- package/dist/classify.d.ts +18 -7
- package/dist/classify.d.ts.map +1 -1
- package/dist/classify.js +236 -98
- package/dist/classify.js.map +1 -1
- package/dist/extension.d.ts +22 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +359 -0
- package/dist/extension.js.map +1 -0
- package/dist/index.d.ts +2 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/package.json +32 -5
- package/preview.png +0 -0
- package/dist/diagnostics.d.ts +0 -8
- package/dist/diagnostics.d.ts.map +0 -1
- package/dist/diagnostics.js +0 -30
- package/dist/diagnostics.js.map +0 -1
- package/dist/http.d.ts +0 -10
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -44
- package/dist/http.js.map +0 -1
- package/dist/local-store.d.ts +0 -20
- package/dist/local-store.d.ts.map +0 -1
- package/dist/local-store.js +0 -118
- package/dist/local-store.js.map +0 -1
- package/dist/multipart.d.ts +0 -9
- package/dist/multipart.d.ts.map +0 -1
- package/dist/multipart.js +0 -48
- package/dist/multipart.js.map +0 -1
- package/dist/normalize.d.ts +0 -7
- package/dist/normalize.d.ts.map +0 -1
- package/dist/normalize.js +0 -83
- package/dist/normalize.js.map +0 -1
- package/dist/parser.d.ts +0 -12
- package/dist/parser.d.ts.map +0 -1
- package/dist/parser.js +0 -166
- package/dist/parser.js.map +0 -1
- package/dist/prompt.d.ts +0 -10
- package/dist/prompt.d.ts.map +0 -1
- package/dist/prompt.js +0 -35
- package/dist/prompt.js.map +0 -1
- package/dist/remote-fetch.d.ts +0 -10
- package/dist/remote-fetch.d.ts.map +0 -1
- package/dist/remote-fetch.js +0 -34
- package/dist/remote-fetch.js.map +0 -1
- package/dist/routes.d.ts +0 -14
- package/dist/routes.d.ts.map +0 -1
- package/dist/routes.js +0 -89
- package/dist/routes.js.map +0 -1
- package/dist/service.d.ts +0 -10
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -134
- package/dist/service.js.map +0 -1
- package/dist/types.d.ts +0 -85
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/upload-proxy.d.ts +0 -19
- package/dist/upload-proxy.d.ts.map +0 -1
- package/dist/upload-proxy.js +0 -105
- package/dist/upload-proxy.js.map +0 -1
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pi Attachments Extension
|
|
3
|
+
*
|
|
4
|
+
* Intercepts user input containing @-references, reads referenced resources,
|
|
5
|
+
* and injects their content into the prompt as context.
|
|
6
|
+
*
|
|
7
|
+
* Recognized references:
|
|
8
|
+
* - @skill:<name> — load SKILL.md for a registered skill (project > user > global agent dir)
|
|
9
|
+
* - @path/to/file.ts — unquoted file reference
|
|
10
|
+
* - @"/path with spaces/file.pdf" — quoted file reference
|
|
11
|
+
* - @file.ts#L10-20 — line range (parsed but range applied by LLM tools)
|
|
12
|
+
*
|
|
13
|
+
* Image attachments are exposed on two parallel channels:
|
|
14
|
+
* 1. event.images[] — base64 image content the model sees via vision.
|
|
15
|
+
* 2. event.text — `` markdown line per image, in the same order.
|
|
16
|
+
*
|
|
17
|
+
* The two channels are kept in lock-step so that "the first image you see" in
|
|
18
|
+
* the vision channel is the same one the first markdown ref points to. This is
|
|
19
|
+
* what lets a model call `image_generate({ image: [path] })` after looking at
|
|
20
|
+
* an uploaded image.
|
|
21
|
+
*
|
|
22
|
+
* Drag-uploaded images (those that arrive on event.images[] without an
|
|
23
|
+
* @-mention) have no source path. We materialize them to <cwd>/.pi/uploads/
|
|
24
|
+
* with a sha256-derived filename and surface that path. They're rendered
|
|
25
|
+
* before the @-mention block, matching "user uploads first, then types".
|
|
26
|
+
*/
|
|
27
|
+
import { createHash } from 'node:crypto';
|
|
28
|
+
import { mkdir, readFile, stat, writeFile } from 'node:fs/promises';
|
|
29
|
+
import path from 'node:path';
|
|
30
|
+
import { resolveAgentDir } from '@amaster.ai/pi-shared/settings';
|
|
31
|
+
import { classifyAttachment, renderAttachmentBlock } from './classify.js';
|
|
32
|
+
const SKILL_NAMESPACE = 'skill';
|
|
33
|
+
const NAMESPACE_AT_RE = /(^|\s)@([a-z][a-z0-9_-]*):([^\s@"]+)/gi;
|
|
34
|
+
const QUOTED_AT_RE = /(^|\s)@"([^"]+)"/g;
|
|
35
|
+
const REGULAR_AT_RE = /(^|\s)@([^\s@"]+)/g;
|
|
36
|
+
const MIME_TO_EXT = {
|
|
37
|
+
'image/png': 'png',
|
|
38
|
+
'image/jpeg': 'jpg',
|
|
39
|
+
'image/jpg': 'jpg',
|
|
40
|
+
'image/webp': 'webp',
|
|
41
|
+
'image/gif': 'gif',
|
|
42
|
+
'image/bmp': 'bmp',
|
|
43
|
+
'image/svg+xml': 'svg',
|
|
44
|
+
'image/avif': 'avif',
|
|
45
|
+
'image/heic': 'heic',
|
|
46
|
+
};
|
|
47
|
+
const MIME_BY_EXT = {
|
|
48
|
+
png: 'image/png',
|
|
49
|
+
jpg: 'image/jpeg',
|
|
50
|
+
jpeg: 'image/jpeg',
|
|
51
|
+
gif: 'image/gif',
|
|
52
|
+
webp: 'image/webp',
|
|
53
|
+
svg: 'image/svg+xml',
|
|
54
|
+
bmp: 'image/bmp',
|
|
55
|
+
avif: 'image/avif',
|
|
56
|
+
heic: 'image/heic',
|
|
57
|
+
pdf: 'application/pdf',
|
|
58
|
+
json: 'application/json',
|
|
59
|
+
xml: 'application/xml',
|
|
60
|
+
};
|
|
61
|
+
export default function piAttachmentsExtension(pi) {
|
|
62
|
+
const maxTextChars = Number(process.env.PI_ATTACHMENT_MAX_TEXT_CHARS) || 128_000;
|
|
63
|
+
pi.on('input', async (event, ctx) => {
|
|
64
|
+
const { mentions } = extractMentions(event.text);
|
|
65
|
+
const incomingImages = event.images ?? [];
|
|
66
|
+
if (mentions.length === 0 && incomingImages.length === 0) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const cwd = ctx.cwd;
|
|
70
|
+
const items = [];
|
|
71
|
+
const resolvedPaths = new Set();
|
|
72
|
+
const resolvedSkills = new Set();
|
|
73
|
+
// Drag-uploaded images go first, in arrival order. Persist each to disk so
|
|
74
|
+
// we can give the model a concrete path it can pass to file-aware tools.
|
|
75
|
+
for (const image of incomingImages) {
|
|
76
|
+
try {
|
|
77
|
+
const persisted = await persistDragUploadedImage(image, cwd);
|
|
78
|
+
if (resolvedPaths.has(persisted.absolutePath))
|
|
79
|
+
continue;
|
|
80
|
+
resolvedPaths.add(persisted.absolutePath);
|
|
81
|
+
items.push({
|
|
82
|
+
kind: 'image',
|
|
83
|
+
name: persisted.name,
|
|
84
|
+
absolutePath: persisted.absolutePath,
|
|
85
|
+
image,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// If we can't persist (read-only fs, permissions), keep the vision
|
|
90
|
+
// channel anyway by recording the image with no path. The markdown
|
|
91
|
+
// line will use a placeholder so the model knows the image is there.
|
|
92
|
+
items.push({
|
|
93
|
+
kind: 'image',
|
|
94
|
+
name: 'uploaded-image',
|
|
95
|
+
absolutePath: '',
|
|
96
|
+
image,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// @-mentions in the order they appeared in the user's text.
|
|
101
|
+
for (const mention of mentions) {
|
|
102
|
+
if (mention.kind === 'skill') {
|
|
103
|
+
if (resolvedSkills.has(mention.name))
|
|
104
|
+
continue;
|
|
105
|
+
resolvedSkills.add(mention.name);
|
|
106
|
+
const block = await loadSkillBlock(mention.name, cwd);
|
|
107
|
+
if (block)
|
|
108
|
+
items.push({ kind: 'skill', block });
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const { filename } = parseFileReference(mention.ref);
|
|
112
|
+
const absolutePath = path.isAbsolute(filename) ? filename : path.resolve(cwd, filename);
|
|
113
|
+
if (resolvedPaths.has(absolutePath))
|
|
114
|
+
continue;
|
|
115
|
+
resolvedPaths.add(absolutePath);
|
|
116
|
+
try {
|
|
117
|
+
const stats = await stat(absolutePath);
|
|
118
|
+
if (stats.isDirectory()) {
|
|
119
|
+
items.push({
|
|
120
|
+
kind: 'file',
|
|
121
|
+
meta: {
|
|
122
|
+
id: absolutePath,
|
|
123
|
+
name: path.basename(absolutePath),
|
|
124
|
+
path: absolutePath,
|
|
125
|
+
mimeType: 'inode/directory',
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const name = path.basename(absolutePath);
|
|
131
|
+
const mimeType = guessMimeType(name);
|
|
132
|
+
const kind = classifyAttachment(name, mimeType);
|
|
133
|
+
if (kind === 'image') {
|
|
134
|
+
try {
|
|
135
|
+
const bytes = await readFile(absolutePath);
|
|
136
|
+
items.push({
|
|
137
|
+
kind: 'image',
|
|
138
|
+
name,
|
|
139
|
+
absolutePath,
|
|
140
|
+
image: {
|
|
141
|
+
type: 'image',
|
|
142
|
+
mimeType: mimeType ?? 'image/png',
|
|
143
|
+
data: bytes.toString('base64'),
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// skip unreadable images
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
items.push({
|
|
153
|
+
kind: 'file',
|
|
154
|
+
meta: {
|
|
155
|
+
id: absolutePath,
|
|
156
|
+
name,
|
|
157
|
+
path: absolutePath,
|
|
158
|
+
...(mimeType ? { mimeType } : {}),
|
|
159
|
+
size: stats.size,
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// skip files that don't exist or can't be accessed
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (items.length === 0) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
// Emit images in the same order they appear in items[]. Lock-step ordering
|
|
172
|
+
// is what guarantees `images[N]` corresponds to the Nth `` line.
|
|
173
|
+
const outputImages = items
|
|
174
|
+
.filter((item) => item.kind === 'image')
|
|
175
|
+
.map((item) => item.image);
|
|
176
|
+
const cleanText = stripMentions(event.text);
|
|
177
|
+
const renderedItems = [];
|
|
178
|
+
for (const item of items) {
|
|
179
|
+
if (item.kind === 'image') {
|
|
180
|
+
renderedItems.push(renderImageMarkdown(item.name, item.absolutePath));
|
|
181
|
+
}
|
|
182
|
+
else if (item.kind === 'skill') {
|
|
183
|
+
renderedItems.push(item.block);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
renderedItems.push(await renderAttachmentBlock(item.meta, maxTextChars));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const parts = [];
|
|
190
|
+
if (cleanText)
|
|
191
|
+
parts.push(cleanText);
|
|
192
|
+
if (renderedItems.length > 0)
|
|
193
|
+
parts.push(renderedItems.join('\n\n'));
|
|
194
|
+
const text = parts.join('\n\n');
|
|
195
|
+
return {
|
|
196
|
+
action: 'transform',
|
|
197
|
+
text,
|
|
198
|
+
...(outputImages.length > 0 ? { images: outputImages } : {}),
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Render an inline image reference. `` is the standard markdown
|
|
204
|
+
* shape; if path is empty (drag-upload that we couldn't persist) we fall back
|
|
205
|
+
* to a name-only marker so the model still sees the slot.
|
|
206
|
+
*/
|
|
207
|
+
function renderImageMarkdown(name, absolutePath) {
|
|
208
|
+
if (!absolutePath) {
|
|
209
|
+
return ``;
|
|
210
|
+
}
|
|
211
|
+
return ``;
|
|
212
|
+
}
|
|
213
|
+
function escapeMarkdown(value) {
|
|
214
|
+
return value.replace(/[[\]()]/g, (ch) => `\\${ch}`);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Persist a drag-uploaded image (which has no source path) into
|
|
218
|
+
* `<cwd>/.pi/uploads/`, naming it by sha256 of its bytes. Same image uploaded
|
|
219
|
+
* twice → same path, no duplicate write.
|
|
220
|
+
*/
|
|
221
|
+
async function persistDragUploadedImage(image, cwd) {
|
|
222
|
+
const bytes = Buffer.from(image.data, 'base64');
|
|
223
|
+
const hash = createHash('sha256').update(bytes).digest('hex').slice(0, 16);
|
|
224
|
+
const ext = MIME_TO_EXT[image.mimeType] ?? 'png';
|
|
225
|
+
const name = `${hash}.${ext}`;
|
|
226
|
+
const dir = path.resolve(cwd, '.pi', 'uploads');
|
|
227
|
+
const absolutePath = path.join(dir, name);
|
|
228
|
+
await mkdir(dir, { recursive: true });
|
|
229
|
+
try {
|
|
230
|
+
await stat(absolutePath);
|
|
231
|
+
// already on disk — same content (sha256 collision-resistant)
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
await writeFile(absolutePath, bytes);
|
|
235
|
+
}
|
|
236
|
+
return { absolutePath, name };
|
|
237
|
+
}
|
|
238
|
+
export function extractMentions(content) {
|
|
239
|
+
const mentions = [];
|
|
240
|
+
const raw = [];
|
|
241
|
+
const seenSkills = new Set();
|
|
242
|
+
const seenFiles = new Set();
|
|
243
|
+
const namespaceSpans = [];
|
|
244
|
+
for (const match of content.matchAll(NAMESPACE_AT_RE)) {
|
|
245
|
+
const ns = match[2].toLowerCase();
|
|
246
|
+
const value = match[3];
|
|
247
|
+
const start = match.index + (match[1]?.length ?? 0);
|
|
248
|
+
namespaceSpans.push([start, start + 1 + ns.length + 1 + value.length]);
|
|
249
|
+
if (ns === SKILL_NAMESPACE) {
|
|
250
|
+
if (!seenSkills.has(value)) {
|
|
251
|
+
seenSkills.add(value);
|
|
252
|
+
mentions.push({ kind: 'skill', name: value });
|
|
253
|
+
raw.push(`@${ns}:${value}`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const isInsideNamespace = (start, end) => namespaceSpans.some(([s, e]) => start >= s && end <= e);
|
|
258
|
+
for (const match of content.matchAll(QUOTED_AT_RE)) {
|
|
259
|
+
const value = match[2];
|
|
260
|
+
const start = match.index + (match[1]?.length ?? 0);
|
|
261
|
+
const end = start + 2 + value.length + 1;
|
|
262
|
+
if (isInsideNamespace(start, end))
|
|
263
|
+
continue;
|
|
264
|
+
if (!seenFiles.has(value)) {
|
|
265
|
+
seenFiles.add(value);
|
|
266
|
+
mentions.push({ kind: 'file', ref: value });
|
|
267
|
+
raw.push(`@"${value}"`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
for (const match of content.matchAll(REGULAR_AT_RE)) {
|
|
271
|
+
const value = match[2];
|
|
272
|
+
const start = match.index + (match[1]?.length ?? 0);
|
|
273
|
+
const end = start + 1 + value.length;
|
|
274
|
+
if (isInsideNamespace(start, end))
|
|
275
|
+
continue;
|
|
276
|
+
if (value.startsWith('http'))
|
|
277
|
+
continue;
|
|
278
|
+
if (seenFiles.has(value))
|
|
279
|
+
continue;
|
|
280
|
+
seenFiles.add(value);
|
|
281
|
+
mentions.push({ kind: 'file', ref: value });
|
|
282
|
+
raw.push(`@${value}`);
|
|
283
|
+
}
|
|
284
|
+
return { mentions, raw };
|
|
285
|
+
}
|
|
286
|
+
export function stripMentions(content) {
|
|
287
|
+
return content
|
|
288
|
+
.replace(NAMESPACE_AT_RE, '$1')
|
|
289
|
+
.replace(QUOTED_AT_RE, '$1')
|
|
290
|
+
.replace(REGULAR_AT_RE, '$1')
|
|
291
|
+
.trim();
|
|
292
|
+
}
|
|
293
|
+
function parseFileReference(mention) {
|
|
294
|
+
const hashIdx = mention.indexOf('#L');
|
|
295
|
+
if (hashIdx === -1) {
|
|
296
|
+
return { filename: mention };
|
|
297
|
+
}
|
|
298
|
+
const filename = mention.slice(0, hashIdx);
|
|
299
|
+
const range = mention.slice(hashIdx + 2);
|
|
300
|
+
const parts = range.split('-');
|
|
301
|
+
const lineStart = Number(parts[0]) || undefined;
|
|
302
|
+
const lineEnd = parts[1] ? Number(parts[1]) || undefined : undefined;
|
|
303
|
+
return {
|
|
304
|
+
filename,
|
|
305
|
+
...(lineStart ? { lineStart } : {}),
|
|
306
|
+
...(lineEnd ? { lineEnd } : {}),
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Search order for `@skill:<name>`: project-level (`<cwd>/.pi/skills`) before
|
|
311
|
+
* user-level (`<agentDir>/skills`). Matches `loadSkillsFromAllLocations` in
|
|
312
|
+
* the pi-coding-agent SDK so a project skill overrides a user-installed one.
|
|
313
|
+
*/
|
|
314
|
+
export function skillSearchPaths(name, cwd) {
|
|
315
|
+
const projectDir = path.resolve(cwd, '.pi', 'skills', name);
|
|
316
|
+
const userDir = path.resolve(resolveAgentDir(), 'skills', name);
|
|
317
|
+
return [projectDir, userDir].map((dir) => path.join(dir, 'SKILL.md'));
|
|
318
|
+
}
|
|
319
|
+
async function loadSkillBlock(name, cwd) {
|
|
320
|
+
for (const filePath of skillSearchPaths(name, cwd)) {
|
|
321
|
+
try {
|
|
322
|
+
const content = await readFile(filePath, 'utf8');
|
|
323
|
+
const baseDir = path.dirname(filePath);
|
|
324
|
+
const body = stripFrontmatter(content).trim();
|
|
325
|
+
return [
|
|
326
|
+
`<skill name="${escapeXmlAttribute(name)}" location="${escapeXmlAttribute(filePath)}">`,
|
|
327
|
+
`References are relative to ${baseDir}.`,
|
|
328
|
+
'',
|
|
329
|
+
body,
|
|
330
|
+
'</skill>',
|
|
331
|
+
].join('\n');
|
|
332
|
+
}
|
|
333
|
+
catch {
|
|
334
|
+
// try next candidate
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
function stripFrontmatter(content) {
|
|
340
|
+
if (!content.startsWith('---'))
|
|
341
|
+
return content;
|
|
342
|
+
const close = content.indexOf('\n---', 3);
|
|
343
|
+
if (close === -1)
|
|
344
|
+
return content;
|
|
345
|
+
const after = close + '\n---'.length;
|
|
346
|
+
return content.slice(content[after] === '\n' ? after + 1 : after);
|
|
347
|
+
}
|
|
348
|
+
function escapeXmlAttribute(value) {
|
|
349
|
+
return value
|
|
350
|
+
.replace(/&/g, '&')
|
|
351
|
+
.replace(/"/g, '"')
|
|
352
|
+
.replace(/</g, '<')
|
|
353
|
+
.replace(/>/g, '>');
|
|
354
|
+
}
|
|
355
|
+
function guessMimeType(name) {
|
|
356
|
+
const ext = name.toLowerCase().split('.').pop();
|
|
357
|
+
return ext ? MIME_BY_EXT[ext] : undefined;
|
|
358
|
+
}
|
|
359
|
+
//# sourceMappingURL=extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAuB,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAI/F,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,eAAe,GAAG,wCAAwC,CAAC;AACjE,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAS3C,MAAM,WAAW,GAA2B;IAC1C,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,KAAK;IAClB,eAAe,EAAE,KAAK;IACtB,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;CACrB,CAAC;AAEF,MAAM,WAAW,GAA2B;IAC1C,GAAG,EAA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ACjC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAChD,OAAO,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { renderAttachmentPrompt, } from "./prompt.js";
|
|
4
|
-
export { handleAttachmentRoutes, } from "./routes.js";
|
|
5
|
-
export type { AttachmentUploadAuth, } from "./upload-proxy.js";
|
|
6
|
-
export { checkAttachmentHostDependencies, type AttachmentDependencyCheck, } from "./diagnostics.js";
|
|
7
|
-
export type { AttachmentContext, AttachmentFailure, AttachmentServiceConfig, AttachmentSource, ChatAttachmentInput, NormalizedAttachment, PreparedAttachmentBundle, StoredAttachmentRecord, } from "./types.js";
|
|
1
|
+
export { type AttachmentKind, type AttachmentMeta, classifyAttachment, docReadInstruction, fenceForName, renderAttachmentBlock, renderAttachmentContext, truncateText, } from './classify.js';
|
|
2
|
+
export { default } from './extension.js';
|
|
8
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { renderAttachmentPrompt, } from "./prompt.js";
|
|
4
|
-
export { handleAttachmentRoutes, } from "./routes.js";
|
|
5
|
-
export { checkAttachmentHostDependencies, } from "./diagnostics.js";
|
|
1
|
+
export { classifyAttachment, docReadInstruction, fenceForName, renderAttachmentBlock, renderAttachmentContext, truncateText, } from './classify.js';
|
|
2
|
+
export { default } from './extension.js';
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaster.ai/pi-attachments",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Pi extension for attachment processing — classifies, parses, and renders file attachments into LLM-visible prompt context",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package",
|
|
7
|
+
"pi",
|
|
8
|
+
"extension",
|
|
9
|
+
"attachments",
|
|
10
|
+
"files",
|
|
11
|
+
"documents"
|
|
12
|
+
],
|
|
4
13
|
"license": "Apache-2.0",
|
|
5
14
|
"type": "module",
|
|
6
15
|
"sideEffects": false,
|
|
@@ -17,23 +26,41 @@
|
|
|
17
26
|
},
|
|
18
27
|
"files": [
|
|
19
28
|
"dist",
|
|
29
|
+
"preview.png",
|
|
20
30
|
"README.md"
|
|
21
31
|
],
|
|
32
|
+
"pi": {
|
|
33
|
+
"image": "https://raw.githubusercontent.com/TGYD-helige/pi/master/packages/pi-attachments/preview.png",
|
|
34
|
+
"extensions": [
|
|
35
|
+
"./dist/index.js"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
22
38
|
"publishConfig": {
|
|
23
39
|
"access": "public"
|
|
24
40
|
},
|
|
25
41
|
"repository": {
|
|
26
42
|
"type": "git",
|
|
27
43
|
"url": "https://github.com/TGYD-helige/pi.git",
|
|
28
|
-
"directory": "packages/attachments"
|
|
44
|
+
"directory": "packages/pi-attachments"
|
|
29
45
|
},
|
|
30
46
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
|
|
47
|
+
"@amaster.ai/pi-shared": "0.1.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@earendil-works/pi-coding-agent": ">=0.74.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@earendil-works/pi-coding-agent": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@earendil-works/pi-coding-agent": "0.74.0",
|
|
59
|
+
"vitest": "^4.0.0"
|
|
33
60
|
},
|
|
34
61
|
"scripts": {
|
|
35
62
|
"build": "tsc -b",
|
|
36
63
|
"typecheck": "tsc -b --pretty false",
|
|
37
|
-
"test": "vitest run"
|
|
64
|
+
"test": "vitest run src"
|
|
38
65
|
}
|
|
39
66
|
}
|
package/preview.png
ADDED
|
Binary file
|
package/dist/diagnostics.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type AttachmentDependencyCheck = {
|
|
2
|
-
name: "libreoffice" | "imagemagick" | "ghostscript" | "tesseract" | "poppler";
|
|
3
|
-
command: string;
|
|
4
|
-
installed: boolean;
|
|
5
|
-
version?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function checkAttachmentHostDependencies(): Promise<AttachmentDependencyCheck[]>;
|
|
8
|
-
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAsB,+BAA+B,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAiB5F"}
|
package/dist/diagnostics.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
export async function checkAttachmentHostDependencies() {
|
|
3
|
-
const checks = [
|
|
4
|
-
{ name: "libreoffice", command: "soffice", args: ["--version"] },
|
|
5
|
-
{ name: "imagemagick", command: "magick", args: ["-version"] },
|
|
6
|
-
{ name: "ghostscript", command: "gs", args: ["--version"] },
|
|
7
|
-
{ name: "tesseract", command: "tesseract", args: ["--version"] },
|
|
8
|
-
{ name: "poppler", command: "pdftotext", args: ["-v"] },
|
|
9
|
-
];
|
|
10
|
-
return Promise.all(checks.map(async (check) => {
|
|
11
|
-
const result = await run(check.command, check.args);
|
|
12
|
-
return {
|
|
13
|
-
name: check.name,
|
|
14
|
-
command: check.command,
|
|
15
|
-
installed: result.code === 0,
|
|
16
|
-
...(result.output ? { version: result.output.split(/\r?\n/)[0] } : {}),
|
|
17
|
-
};
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
function run(command, args) {
|
|
21
|
-
return new Promise((resolve) => {
|
|
22
|
-
const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
23
|
-
const chunks = [];
|
|
24
|
-
child.stdout.on("data", (chunk) => chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)));
|
|
25
|
-
child.stderr.on("data", (chunk) => chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)));
|
|
26
|
-
child.on("error", () => resolve({ code: -1, output: "" }));
|
|
27
|
-
child.on("close", (code) => resolve({ code, output: Buffer.concat(chunks).toString("utf8").trim() }));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=diagnostics.js.map
|
package/dist/diagnostics.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAS3C,MAAM,CAAC,KAAK,UAAU,+BAA+B;IACnD,MAAM,MAAM,GAAG;QACb,EAAE,IAAI,EAAE,aAAsB,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE;QACzE,EAAE,IAAI,EAAE,aAAsB,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE;QACvE,EAAE,IAAI,EAAE,aAAsB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE;QACpE,EAAE,IAAI,EAAE,WAAoB,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE;QACzE,EAAE,IAAI,EAAE,SAAkB,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE;KACjE,CAAC;IACF,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,OAAO;YACL,IAAI,EAAE,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C,CAAC;QAC3D,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACxG,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/http.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
export declare class AttachmentHttpError extends Error {
|
|
3
|
-
readonly statusCode: number;
|
|
4
|
-
readonly code: string;
|
|
5
|
-
constructor(statusCode: number, code: string, message: string);
|
|
6
|
-
}
|
|
7
|
-
export declare function readRequestBody(request: IncomingMessage, maxBytes: number): Promise<Buffer>;
|
|
8
|
-
export declare function writeJson(response: ServerResponse, statusCode: number, body: unknown): void;
|
|
9
|
-
export declare function getHeader(request: IncomingMessage, name: string): string | undefined;
|
|
10
|
-
//# sourceMappingURL=http.d.ts.map
|
package/dist/http.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,qBAAa,mBAAoB,SAAQ,KAAK;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAzC,UAAU,EAAE,MAAM,EAAW,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIhF;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBjG;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAS3F;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKpF"}
|
package/dist/http.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export class AttachmentHttpError extends Error {
|
|
2
|
-
statusCode;
|
|
3
|
-
code;
|
|
4
|
-
constructor(statusCode, code, message) {
|
|
5
|
-
super(message);
|
|
6
|
-
this.statusCode = statusCode;
|
|
7
|
-
this.code = code;
|
|
8
|
-
this.name = "AttachmentHttpError";
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export async function readRequestBody(request, maxBytes) {
|
|
12
|
-
const contentLength = Number(request.headers["content-length"]);
|
|
13
|
-
if (Number.isFinite(contentLength) && contentLength > maxBytes) {
|
|
14
|
-
throw new AttachmentHttpError(413, "request_body_too_large", `request body exceeds ${maxBytes} bytes`);
|
|
15
|
-
}
|
|
16
|
-
const chunks = [];
|
|
17
|
-
let totalBytes = 0;
|
|
18
|
-
for await (const chunk of request) {
|
|
19
|
-
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
20
|
-
totalBytes += buffer.length;
|
|
21
|
-
if (totalBytes > maxBytes) {
|
|
22
|
-
throw new AttachmentHttpError(413, "request_body_too_large", `request body exceeds ${maxBytes} bytes`);
|
|
23
|
-
}
|
|
24
|
-
chunks.push(buffer);
|
|
25
|
-
}
|
|
26
|
-
return Buffer.concat(chunks);
|
|
27
|
-
}
|
|
28
|
-
export function writeJson(response, statusCode, body) {
|
|
29
|
-
if (response.headersSent) {
|
|
30
|
-
if (!response.writableEnded) {
|
|
31
|
-
response.end();
|
|
32
|
-
}
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
response.writeHead(statusCode, { "content-type": "application/json; charset=utf-8" });
|
|
36
|
-
response.end(`${JSON.stringify(body)}\n`);
|
|
37
|
-
}
|
|
38
|
-
export function getHeader(request, name) {
|
|
39
|
-
const value = request.headers[name.toLowerCase()];
|
|
40
|
-
const candidate = Array.isArray(value) ? value[0] : value;
|
|
41
|
-
const trimmed = candidate?.trim();
|
|
42
|
-
return trimmed ? trimmed : undefined;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=http.js.map
|
package/dist/http.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACvB;IAA6B;IAAlD,YAAqB,UAAkB,EAAW,IAAY,EAAE,OAAe;QAC7E,KAAK,CAAC,OAAO,CAAC,CAAC;QADI,eAAU,GAAV,UAAU,CAAQ;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAE5D,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAwB,EAAE,QAAgB;IAC9E,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAChE,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,QAAQ,EAAE,CAAC;QAC/D,MAAM,IAAI,mBAAmB,CAAC,GAAG,EAAE,wBAAwB,EAAE,wBAAwB,QAAQ,QAAQ,CAAC,CAAC;IACzG,CAAC;IACD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnE,UAAU,IAAI,MAAM,CA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entStore {
|
|
3
|
-
private readonly rootDir;
|
|
4
|
-
constructor(rootDir: string);
|
|
5
|
-
putFile(input: {
|
|
6
|
-
sourcePath: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
mimeType?: string;
|
|
9
|
-
sessionId?: string;
|
|
10
|
-
}): Promise<StoredAttachmentRecord>;
|
|
11
|
-
putBuffer(input: {
|
|
12
|
-
data: Buffer;
|
|
13
|
-
name: string;
|
|
14
|
-
mimeType?: string;
|
|
15
|
-
sessionId?: string;
|
|
16
|
-
}): Promise<StoredAttachmentRecord>;
|
|
17
|
-
readRecord(attachmentId: string): Promise<StoredAttachmentRecord>;
|
|
18
|
-
private attachmentDir;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=local-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../src/local-store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAGzD,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM;IAEtC,OAAO,CAAC,KAAK,EAAE;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAuB7B,SAAS,CAAC,KAAK,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAkB7B,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgBvE,OAAO,CAAC,aAAa;CAKtB"}
|