@zhin.js/adapter-email 1.0.1 → 1.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/CHANGELOG.md +374 -0
- package/README.md +50 -102
- package/adapters/email.js +25 -0
- package/adapters/email.ts +35 -0
- package/lib/client.d.ts +23 -0
- package/lib/client.js +29 -0
- package/lib/endpoint.d.ts +27 -32
- package/lib/endpoint.js +284 -317
- package/lib/index.d.ts +4 -10
- package/lib/index.js +4 -23
- package/lib/protocol.d.ts +138 -0
- package/lib/protocol.js +245 -0
- package/lib/transport.d.ts +32 -0
- package/lib/transport.js +27 -0
- package/package.json +45 -12
- package/plugin.js +8 -0
- package/schema.json +169 -0
- package/src/client.ts +40 -0
- package/src/endpoint.ts +334 -390
- package/src/index.ts +35 -28
- package/src/protocol.ts +384 -0
- package/src/transport.ts +65 -0
- package/lib/adapter.d.ts +0 -12
- package/lib/adapter.d.ts.map +0 -1
- package/lib/adapter.js +0 -15
- package/lib/adapter.js.map +0 -1
- package/lib/endpoint.d.ts.map +0 -1
- package/lib/endpoint.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/types.d.ts +0 -49
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -2
- package/lib/types.js.map +0 -1
- package/src/adapter.ts +0 -18
- package/src/types.ts +0 -52
- /package/{skills/email/SKILL.md → agent/skills/email.md} +0 -0
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import { Endpoint
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* HTML → 纯文本转换,处理常见标签和实体
|
|
30
|
-
*/
|
|
31
|
-
static htmlToText(html: string): string;
|
|
1
|
+
import { Endpoint } from 'zhin.js/adapter';
|
|
2
|
+
import { type EndpointSendRequest } from 'zhin.js/adapter';
|
|
3
|
+
import type { CapabilityId } from 'zhin.js';
|
|
4
|
+
import { type EmailMessage, type ResolvedEmailConfig } from './protocol.js';
|
|
5
|
+
import { type EmailImapTransport, type EmailSmtpTransport } from './transport.js';
|
|
6
|
+
import { EmailClient } from './client.js';
|
|
7
|
+
export interface EmailEndpointOptions {
|
|
8
|
+
readonly id: CapabilityId;
|
|
9
|
+
readonly config: ResolvedEmailConfig;
|
|
10
|
+
readonly createSmtp?: (config: ResolvedEmailConfig['smtp']) => EmailSmtpTransport | Promise<EmailSmtpTransport>;
|
|
11
|
+
readonly createImap?: (config: ResolvedEmailConfig['imap']) => EmailImapTransport;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Email(SMTP/IMAP)无好友/群/频道等社交图谱概念,
|
|
15
|
+
* 不适用 EndpointManagement 语义端口;本 endpoint 不暴露该端口。
|
|
16
|
+
*/
|
|
17
|
+
export declare class EmailEndpoint extends Endpoint<EmailClient> {
|
|
18
|
+
#private;
|
|
19
|
+
readonly client: EmailClient;
|
|
20
|
+
constructor(options: EmailEndpointOptions);
|
|
21
|
+
start(): Promise<void>;
|
|
22
|
+
open(): void;
|
|
23
|
+
close(): void;
|
|
24
|
+
stop(): Promise<void>;
|
|
25
|
+
send({ conversation, payload }: EndpointSendRequest): Promise<string>;
|
|
26
|
+
/** Test / internal: admit a parsed mail when the endpoint is open. */
|
|
27
|
+
admit(email: EmailMessage): void;
|
|
32
28
|
}
|
|
33
|
-
//# sourceMappingURL=endpoint.d.ts.map
|