@amaster.ai/pi-attachments 0.1.2-beta.1 → 0.1.2-beta.11
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/classify.d.ts +18 -7
- package/dist/classify.d.ts.map +1 -1
- package/dist/classify.js +172 -93
- package/dist/classify.js.map +1 -1
- package/dist/extension.d.ts +3 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +150 -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 +29 -6
- package/README.md +0 -37
- 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 -121
- 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 -168
- 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 -38
- 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 -35
- 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 -91
- package/dist/routes.js.map +0 -1
- package/dist/service.d.ts +0 -9
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -140
- 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
package/dist/types.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
export type AttachmentJsonObject = {
|
|
2
|
-
[key: string]: AttachmentJsonValue | undefined;
|
|
3
|
-
};
|
|
4
|
-
export type AttachmentJsonValue = string | number | boolean | null | AttachmentJsonObject | AttachmentJsonValue[];
|
|
5
|
-
export type AttachmentImageContent = {
|
|
6
|
-
type: 'image';
|
|
7
|
-
mimeType: string;
|
|
8
|
-
data: string;
|
|
9
|
-
};
|
|
10
|
-
export type AttachmentSource = {
|
|
11
|
-
kind: 'inlineText';
|
|
12
|
-
text: string;
|
|
13
|
-
truncated?: boolean;
|
|
14
|
-
} | {
|
|
15
|
-
kind: 'remoteObject';
|
|
16
|
-
url: string;
|
|
17
|
-
key?: string;
|
|
18
|
-
} | {
|
|
19
|
-
kind: 'storedFile';
|
|
20
|
-
attachmentId: string;
|
|
21
|
-
};
|
|
22
|
-
export type ChatAttachmentInput = {
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
mimeType?: string;
|
|
26
|
-
size?: number;
|
|
27
|
-
source: AttachmentSource;
|
|
28
|
-
};
|
|
29
|
-
export type NormalizedAttachment = ChatAttachmentInput;
|
|
30
|
-
export type PreparedAttachmentBundle = {
|
|
31
|
-
attachments: NormalizedAttachment[];
|
|
32
|
-
images: AttachmentImageContent[];
|
|
33
|
-
promptBlocks: string[];
|
|
34
|
-
failures: AttachmentFailure[];
|
|
35
|
-
telemetry: AttachmentJsonObject[];
|
|
36
|
-
};
|
|
37
|
-
export type AttachmentFailure = {
|
|
38
|
-
attachmentId: string;
|
|
39
|
-
name: string;
|
|
40
|
-
reason: string;
|
|
41
|
-
};
|
|
42
|
-
export type AttachmentContext = {
|
|
43
|
-
tenantId?: string;
|
|
44
|
-
userId?: string;
|
|
45
|
-
workspaceId?: string;
|
|
46
|
-
sessionId: string;
|
|
47
|
-
traceId?: string;
|
|
48
|
-
};
|
|
49
|
-
export type AttachmentServiceConfig = {
|
|
50
|
-
storageMode: 'platform' | 'local';
|
|
51
|
-
uploadEndpoint: string;
|
|
52
|
-
allowInsecureLocalUploadTls: boolean;
|
|
53
|
-
localStoreDir: string;
|
|
54
|
-
maxAttachmentCount: number;
|
|
55
|
-
maxBytes: number;
|
|
56
|
-
maxTextChars: number;
|
|
57
|
-
fetchTimeoutMs: number;
|
|
58
|
-
parseEnabled: boolean;
|
|
59
|
-
parser: 'liteparse' | 'basic';
|
|
60
|
-
ocr: 'off' | 'auto';
|
|
61
|
-
maxPages: number;
|
|
62
|
-
desktopEnabled: boolean;
|
|
63
|
-
};
|
|
64
|
-
export type StoredAttachmentRecord = {
|
|
65
|
-
attachmentId: string;
|
|
66
|
-
name: string;
|
|
67
|
-
mimeType?: string;
|
|
68
|
-
size: number;
|
|
69
|
-
path: string;
|
|
70
|
-
createdAt: string;
|
|
71
|
-
};
|
|
72
|
-
export type ParseAttachmentInput = {
|
|
73
|
-
path: string;
|
|
74
|
-
name: string;
|
|
75
|
-
mimeType?: string;
|
|
76
|
-
format?: 'text' | 'json';
|
|
77
|
-
ocr: 'off' | 'auto';
|
|
78
|
-
maxPages: number;
|
|
79
|
-
};
|
|
80
|
-
export type ParsedAttachment = {
|
|
81
|
-
text: string;
|
|
82
|
-
pageCount?: number;
|
|
83
|
-
warnings?: string[];
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{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,CAAC;IACzB,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
package/dist/types.js
DELETED
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/upload-proxy.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
export type AttachmentUploadAuth = {
|
|
3
|
-
enabled: boolean;
|
|
4
|
-
baseUrl?: string;
|
|
5
|
-
internalBaseUrl?: string;
|
|
6
|
-
accessToken?: string;
|
|
7
|
-
user?: unknown;
|
|
8
|
-
userHeaders?: (user: unknown) => Record<string, string>;
|
|
9
|
-
};
|
|
10
|
-
export declare function proxyAttachmentUpload(input: {
|
|
11
|
-
request: IncomingMessage;
|
|
12
|
-
response: ServerResponse;
|
|
13
|
-
uploadEndpoint: string;
|
|
14
|
-
allowInsecureLocalTls: boolean;
|
|
15
|
-
auth: AttachmentUploadAuth;
|
|
16
|
-
maxBodyBytes: number;
|
|
17
|
-
}): Promise<void>;
|
|
18
|
-
export declare function isLocalUploadHost(hostname: string): boolean;
|
|
19
|
-
//# sourceMappingURL=upload-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-proxy.d.ts","sourceRoot":"","sources":["../src/upload-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKjE,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzD,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoChB;AAyDD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAS3D"}
|
package/dist/upload-proxy.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { request as httpRequest } from 'node:http';
|
|
2
|
-
import { Agent as HttpsAgent, request as httpsRequest } from 'node:https';
|
|
3
|
-
import { getHeader, readRequestBody, writeJson } from './http.js';
|
|
4
|
-
export async function proxyAttachmentUpload(input) {
|
|
5
|
-
if (input.auth.enabled && !input.auth.accessToken) {
|
|
6
|
-
writeJson(input.response, 401, { error: 'authentication is required for attachment upload' });
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const targetUrl = resolveUploadUrl(input.uploadEndpoint, input.auth);
|
|
10
|
-
const body = await readRequestBody(input.request, input.maxBodyBytes);
|
|
11
|
-
const headers = {
|
|
12
|
-
'content-length': String(body.length),
|
|
13
|
-
};
|
|
14
|
-
const contentType = getHeader(input.request, 'content-type');
|
|
15
|
-
if (contentType) {
|
|
16
|
-
headers['content-type'] = contentType;
|
|
17
|
-
}
|
|
18
|
-
if (input.auth.accessToken) {
|
|
19
|
-
headers.authorization = `Bearer ${input.auth.accessToken}`;
|
|
20
|
-
}
|
|
21
|
-
if (input.auth.user && input.auth.userHeaders) {
|
|
22
|
-
Object.assign(headers, input.auth.userHeaders(input.auth.user));
|
|
23
|
-
}
|
|
24
|
-
let upstream;
|
|
25
|
-
try {
|
|
26
|
-
upstream = await proxyHttpRequest(targetUrl, headers, body, {
|
|
27
|
-
allowInsecureLocalTls: input.allowInsecureLocalTls,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
writeJson(input.response, 502, {
|
|
32
|
-
error: `attachment upload proxy failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
33
|
-
upstream: redactUrlForClient(targetUrl),
|
|
34
|
-
});
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
input.response.writeHead(upstream.status, {
|
|
38
|
-
'content-type': upstream.contentType ?? 'application/json; charset=utf-8',
|
|
39
|
-
});
|
|
40
|
-
input.response.end(upstream.body);
|
|
41
|
-
}
|
|
42
|
-
function resolveUploadUrl(uploadEndpoint, auth) {
|
|
43
|
-
if (/^https?:\/\//i.test(uploadEndpoint)) {
|
|
44
|
-
return uploadEndpoint;
|
|
45
|
-
}
|
|
46
|
-
const baseUrl = auth.internalBaseUrl ?? auth.baseUrl;
|
|
47
|
-
if (!baseUrl) {
|
|
48
|
-
throw new Error('upload endpoint must be absolute when upload base url is not configured');
|
|
49
|
-
}
|
|
50
|
-
return new URL(uploadEndpoint, baseUrl).toString();
|
|
51
|
-
}
|
|
52
|
-
function proxyHttpRequest(targetUrl, headers, body, options) {
|
|
53
|
-
const url = new URL(targetUrl);
|
|
54
|
-
const requestImpl = url.protocol === 'https:' ? httpsRequest : httpRequest;
|
|
55
|
-
const allowInsecureLocalTls = url.protocol === 'https:' && options.allowInsecureLocalTls && isLocalUploadHost(url.hostname);
|
|
56
|
-
return new Promise((resolve, reject) => {
|
|
57
|
-
const upstream = requestImpl({
|
|
58
|
-
protocol: url.protocol,
|
|
59
|
-
hostname: url.hostname,
|
|
60
|
-
port: url.port,
|
|
61
|
-
path: `${url.pathname}${url.search}`,
|
|
62
|
-
method: 'POST',
|
|
63
|
-
headers,
|
|
64
|
-
...(allowInsecureLocalTls ? { agent: new HttpsAgent({ rejectUnauthorized: false }) } : {}),
|
|
65
|
-
}, (upstreamResponse) => {
|
|
66
|
-
const chunks = [];
|
|
67
|
-
upstreamResponse.on('data', (chunk) => {
|
|
68
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
69
|
-
});
|
|
70
|
-
upstreamResponse.on('error', reject);
|
|
71
|
-
upstreamResponse.on('end', () => {
|
|
72
|
-
const contentTypeHeader = upstreamResponse.headers['content-type'];
|
|
73
|
-
resolve({
|
|
74
|
-
status: upstreamResponse.statusCode ?? 502,
|
|
75
|
-
contentType: Array.isArray(contentTypeHeader)
|
|
76
|
-
? contentTypeHeader[0]
|
|
77
|
-
: contentTypeHeader,
|
|
78
|
-
body: Buffer.concat(chunks),
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
upstream.on('error', reject);
|
|
83
|
-
upstream.end(body);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
export function isLocalUploadHost(hostname) {
|
|
87
|
-
const host = hostname.toLowerCase();
|
|
88
|
-
return (host === 'localhost' ||
|
|
89
|
-
host === '127.0.0.1' ||
|
|
90
|
-
host === '::1' ||
|
|
91
|
-
host === '[::1]' ||
|
|
92
|
-
host.endsWith('.local'));
|
|
93
|
-
}
|
|
94
|
-
function redactUrlForClient(value) {
|
|
95
|
-
try {
|
|
96
|
-
const url = new URL(value);
|
|
97
|
-
url.username = '';
|
|
98
|
-
url.password = '';
|
|
99
|
-
return url.toString();
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return value;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=upload-proxy.js.map
|
package/dist/upload-proxy.js.map
DELETED
|
@@ -1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