@ghostpaw/email 0.3.0 → 0.4.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 +72 -0
- package/SKILL.md +89 -241
- package/dist/cli.js +9265 -7332
- package/dist/database-Rfe-wn1C.d.cts +20 -0
- package/dist/database-Rfe-wn1C.d.ts +20 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +2 -20
- package/dist/index.d.ts +2 -20
- package/dist/index.js +5 -5
- package/dist/mcp-server.js +6396 -0
- package/dist/mcp.cjs +6325 -0
- package/dist/mcp.d.cts +89 -0
- package/dist/mcp.d.ts +89 -0
- package/dist/mcp.js +6295 -0
- package/package.json +42 -10
- package/skills/email/SKILL.md +131 -0
- package/skills/email/references/attachment-workflow.md +25 -0
- package/skills/email/references/cli.md +283 -0
- package/skills/email/references/compose-and-send.md +30 -0
- package/skills/email/references/connect-and-sync.md +29 -0
- package/skills/email/references/organize-bulk.md +33 -0
- package/skills/email/references/read-and-reply.md +29 -0
- package/skills/email/references/recover-from-disruption.md +29 -0
- package/skills/email/references/search-and-act.md +33 -0
- package/skills/email/references/triage-inbox.md +30 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface EmailRunResult {
|
|
2
|
+
lastInsertRowid: number | bigint;
|
|
3
|
+
changes?: number | bigint | undefined;
|
|
4
|
+
}
|
|
5
|
+
interface EmailStatement {
|
|
6
|
+
run(...params: unknown[]): EmailRunResult;
|
|
7
|
+
get<TRecord>(...params: unknown[]): TRecord | undefined;
|
|
8
|
+
all<TRecord>(...params: unknown[]): TRecord[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* SQLite dependency injected into every email operation.
|
|
12
|
+
* Node.js `DatabaseSync` satisfies this interface directly.
|
|
13
|
+
*/
|
|
14
|
+
type EmailDb = {
|
|
15
|
+
exec(sql: string): void;
|
|
16
|
+
prepare(sql: string): EmailStatement;
|
|
17
|
+
close(): void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type { EmailDb as E };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface EmailRunResult {
|
|
2
|
+
lastInsertRowid: number | bigint;
|
|
3
|
+
changes?: number | bigint | undefined;
|
|
4
|
+
}
|
|
5
|
+
interface EmailStatement {
|
|
6
|
+
run(...params: unknown[]): EmailRunResult;
|
|
7
|
+
get<TRecord>(...params: unknown[]): TRecord | undefined;
|
|
8
|
+
all<TRecord>(...params: unknown[]): TRecord[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* SQLite dependency injected into every email operation.
|
|
12
|
+
* Node.js `DatabaseSync` satisfies this interface directly.
|
|
13
|
+
*/
|
|
14
|
+
type EmailDb = {
|
|
15
|
+
exec(sql: string): void;
|
|
16
|
+
prepare(sql: string): EmailStatement;
|
|
17
|
+
close(): void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type { EmailDb as E };
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var net = require('net');
|
|
5
|
-
var tls = require('tls');
|
|
6
|
-
var zlib = require('zlib');
|
|
7
|
-
var
|
|
3
|
+
var node_events = require('node:events');
|
|
4
|
+
var net = require('node:net');
|
|
5
|
+
var tls = require('node:tls');
|
|
6
|
+
var zlib = require('node:zlib');
|
|
7
|
+
var node_crypto = require('node:crypto');
|
|
8
8
|
|
|
9
9
|
function _interopNamespace(e) {
|
|
10
10
|
if (e && e.__esModule) return e;
|
|
@@ -398,7 +398,7 @@ var DEFAULT_MAX_MESSAGE_SIZE = 26214400;
|
|
|
398
398
|
var DEFAULT_CHARSET = "utf-8";
|
|
399
399
|
|
|
400
400
|
// src/imap/connection.ts
|
|
401
|
-
var ImapConnection = class extends
|
|
401
|
+
var ImapConnection = class extends node_events.EventEmitter {
|
|
402
402
|
#config;
|
|
403
403
|
#socket = null;
|
|
404
404
|
#connected = false;
|
|
@@ -3880,11 +3880,11 @@ __export(write_exports, {
|
|
|
3880
3880
|
createWriteSurface: () => createWriteSurface
|
|
3881
3881
|
});
|
|
3882
3882
|
function generateMessageId(domain) {
|
|
3883
|
-
const id =
|
|
3883
|
+
const id = node_crypto.randomUUID().replace(/-/g, "");
|
|
3884
3884
|
return `<${Date.now()}.${id}@${domain}>`;
|
|
3885
3885
|
}
|
|
3886
3886
|
function generateBoundary() {
|
|
3887
|
-
return `----=_Part_${
|
|
3887
|
+
return `----=_Part_${node_crypto.randomUUID()}`;
|
|
3888
3888
|
}
|
|
3889
3889
|
|
|
3890
3890
|
// src/lib/normalize_subject.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
+
import { E as EmailDb } from './database-Rfe-wn1C.cjs';
|
|
1
2
|
import { Writable, Duplex } from 'node:stream';
|
|
2
3
|
import { EventEmitter } from 'node:events';
|
|
3
4
|
import { DatabaseSync } from 'node:sqlite';
|
|
4
5
|
|
|
5
|
-
interface EmailRunResult {
|
|
6
|
-
lastInsertRowid: number | bigint;
|
|
7
|
-
changes?: number | bigint | undefined;
|
|
8
|
-
}
|
|
9
|
-
interface EmailStatement {
|
|
10
|
-
run(...params: unknown[]): EmailRunResult;
|
|
11
|
-
get<TRecord>(...params: unknown[]): TRecord | undefined;
|
|
12
|
-
all<TRecord>(...params: unknown[]): TRecord[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* SQLite dependency injected into every email operation.
|
|
16
|
-
* Node.js `DatabaseSync` satisfies this interface directly.
|
|
17
|
-
*/
|
|
18
|
-
type EmailDb = {
|
|
19
|
-
exec(sql: string): void;
|
|
20
|
-
prepare(sql: string): EmailStatement;
|
|
21
|
-
close(): void;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
6
|
type EmailErrorCode = 'invariant' | 'not_found' | 'state' | 'validation' | 'auth' | 'connection' | 'protocol' | 'timeout' | 'unsupported' | 'envelope_rejected' | 'quota';
|
|
25
7
|
declare class EmailError extends Error {
|
|
26
8
|
readonly code: EmailErrorCode;
|
|
@@ -1994,4 +1976,4 @@ declare namespace write {
|
|
|
1994
1976
|
export { type write_CreateWriteSurfaceOptions as CreateWriteSurfaceOptions, write_createWriteSurface as createWriteSurface };
|
|
1995
1977
|
}
|
|
1996
1978
|
|
|
1997
|
-
export { type Account, type AccountStats, type Address, type Attachment, type AttachmentMeta, type AuthConfig, type BodyPart, type ComposeAttachment, type ComposeInput, type ContinuationResponse, DEFAULT_AUTO_EXPUNGE, DEFAULT_BATCH_SIZE, DEFAULT_CHARSET, DEFAULT_COMPRESS, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_KEEPALIVE_INTERVAL, DEFAULT_MAX_ATTACHMENT_CACHE, DEFAULT_MAX_BODY_CACHE, DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_MESSAGE_SIZE, DEFAULT_MAX_NESTING_DEPTH, DEFAULT_MAX_RECONNECT_ATTEMPTS, DEFAULT_MAX_RECONNECT_DELAY, DEFAULT_PIPELINING, DEFAULT_SOCKET_TIMEOUT, DEFAULT_SYNC_DELETED_FOLDERS, DEFAULT_TAG_PREFIX, DEFAULT_WATCH_FOLDERS, EmailAuthError, type EmailConfig, EmailConnectionError,
|
|
1979
|
+
export { type Account, type AccountStats, type Address, type Attachment, type AttachmentMeta, type AuthConfig, type BodyPart, type ComposeAttachment, type ComposeInput, type ContinuationResponse, DEFAULT_AUTO_EXPUNGE, DEFAULT_BATCH_SIZE, DEFAULT_CHARSET, DEFAULT_COMPRESS, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_KEEPALIVE_INTERVAL, DEFAULT_MAX_ATTACHMENT_CACHE, DEFAULT_MAX_BODY_CACHE, DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_MESSAGE_SIZE, DEFAULT_MAX_NESTING_DEPTH, DEFAULT_MAX_RECONNECT_ATTEMPTS, DEFAULT_MAX_RECONNECT_DELAY, DEFAULT_PIPELINING, DEFAULT_SOCKET_TIMEOUT, DEFAULT_SYNC_DELETED_FOLDERS, DEFAULT_TAG_PREFIX, DEFAULT_WATCH_FOLDERS, EmailAuthError, type EmailConfig, EmailConnectionError, EmailDb, EmailEnvelopeRejectedError, EmailError, type EmailErrorCode, EmailInvariantError, type EmailNetworkSurface, EmailNotFoundError, EmailProtocolError, EmailQuotaError, type EmailReadSurface, type EmailRuntimeSurface, type EmailSkill, type EmailSkillRegistry, type EmailSoul, type EmailSoulTrait, EmailStateError, EmailTimeoutError, type EmailToolContext, type EmailToolDefinition, type EmailToolResult, EmailUnsupportedError, EmailValidationError, type EmailWriteSurface, type FetchResult, type Folder, type FolderRole, type FolderStatus, type ForwardInput, type ImapResponse, type ImapToken, type InsertMessageInput, type JsonSchema, type JsonSchemaType, type LocalSearchOptions, Mailbox, type Message, type MessageBody, type MessageDetail, type MessageListOptions, type NegotiatedExtensions, type ParsedEnvelope, type ReplyInput, type ResponseCode, type SearchQuery, type SelectedFolder, type SmtpErrorCategory, type SmtpResponse, type SyncFolderResult, type SyncOptions, type SyncResult, type TaggedResponse, type Thread, type ThreadListOptions, type ThreadMessage, type TokenType, type ToolEntityKind, type ToolEntityRef, type ToolOutcomeKind, type ToolSideEffects, type UntaggedResponse, type WatchEvent, type WatchOptions, aligned, attachmentWorkflowSkill, composeAndSendSkill, connectAndSyncSkill, defineEmailSkill, emailSkills, emailSoul, emailSoulEssence, emailSoulTraits, emailTools, errors, getEmailSkillByName, getEmailToolByName, index$8 as imap, initSchema, isEmailError, isRetriable, index$7 as mime, network, organizeBulkSkill, read, readAndReplySkill, recoverFromDisruptionSkill, renderEmailSoulPromptFoundation, runtime, index$6 as schema, searchAndActSkill, index$5 as skills, index$4 as smtp, soul, index$3 as store, index$2 as sync, index$1 as tools, triageInboxSkill, index as types, write };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
+
import { E as EmailDb } from './database-Rfe-wn1C.js';
|
|
1
2
|
import { Writable, Duplex } from 'node:stream';
|
|
2
3
|
import { EventEmitter } from 'node:events';
|
|
3
4
|
import { DatabaseSync } from 'node:sqlite';
|
|
4
5
|
|
|
5
|
-
interface EmailRunResult {
|
|
6
|
-
lastInsertRowid: number | bigint;
|
|
7
|
-
changes?: number | bigint | undefined;
|
|
8
|
-
}
|
|
9
|
-
interface EmailStatement {
|
|
10
|
-
run(...params: unknown[]): EmailRunResult;
|
|
11
|
-
get<TRecord>(...params: unknown[]): TRecord | undefined;
|
|
12
|
-
all<TRecord>(...params: unknown[]): TRecord[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* SQLite dependency injected into every email operation.
|
|
16
|
-
* Node.js `DatabaseSync` satisfies this interface directly.
|
|
17
|
-
*/
|
|
18
|
-
type EmailDb = {
|
|
19
|
-
exec(sql: string): void;
|
|
20
|
-
prepare(sql: string): EmailStatement;
|
|
21
|
-
close(): void;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
6
|
type EmailErrorCode = 'invariant' | 'not_found' | 'state' | 'validation' | 'auth' | 'connection' | 'protocol' | 'timeout' | 'unsupported' | 'envelope_rejected' | 'quota';
|
|
25
7
|
declare class EmailError extends Error {
|
|
26
8
|
readonly code: EmailErrorCode;
|
|
@@ -1994,4 +1976,4 @@ declare namespace write {
|
|
|
1994
1976
|
export { type write_CreateWriteSurfaceOptions as CreateWriteSurfaceOptions, write_createWriteSurface as createWriteSurface };
|
|
1995
1977
|
}
|
|
1996
1978
|
|
|
1997
|
-
export { type Account, type AccountStats, type Address, type Attachment, type AttachmentMeta, type AuthConfig, type BodyPart, type ComposeAttachment, type ComposeInput, type ContinuationResponse, DEFAULT_AUTO_EXPUNGE, DEFAULT_BATCH_SIZE, DEFAULT_CHARSET, DEFAULT_COMPRESS, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_KEEPALIVE_INTERVAL, DEFAULT_MAX_ATTACHMENT_CACHE, DEFAULT_MAX_BODY_CACHE, DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_MESSAGE_SIZE, DEFAULT_MAX_NESTING_DEPTH, DEFAULT_MAX_RECONNECT_ATTEMPTS, DEFAULT_MAX_RECONNECT_DELAY, DEFAULT_PIPELINING, DEFAULT_SOCKET_TIMEOUT, DEFAULT_SYNC_DELETED_FOLDERS, DEFAULT_TAG_PREFIX, DEFAULT_WATCH_FOLDERS, EmailAuthError, type EmailConfig, EmailConnectionError,
|
|
1979
|
+
export { type Account, type AccountStats, type Address, type Attachment, type AttachmentMeta, type AuthConfig, type BodyPart, type ComposeAttachment, type ComposeInput, type ContinuationResponse, DEFAULT_AUTO_EXPUNGE, DEFAULT_BATCH_SIZE, DEFAULT_CHARSET, DEFAULT_COMPRESS, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_KEEPALIVE_INTERVAL, DEFAULT_MAX_ATTACHMENT_CACHE, DEFAULT_MAX_BODY_CACHE, DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_MESSAGE_SIZE, DEFAULT_MAX_NESTING_DEPTH, DEFAULT_MAX_RECONNECT_ATTEMPTS, DEFAULT_MAX_RECONNECT_DELAY, DEFAULT_PIPELINING, DEFAULT_SOCKET_TIMEOUT, DEFAULT_SYNC_DELETED_FOLDERS, DEFAULT_TAG_PREFIX, DEFAULT_WATCH_FOLDERS, EmailAuthError, type EmailConfig, EmailConnectionError, EmailDb, EmailEnvelopeRejectedError, EmailError, type EmailErrorCode, EmailInvariantError, type EmailNetworkSurface, EmailNotFoundError, EmailProtocolError, EmailQuotaError, type EmailReadSurface, type EmailRuntimeSurface, type EmailSkill, type EmailSkillRegistry, type EmailSoul, type EmailSoulTrait, EmailStateError, EmailTimeoutError, type EmailToolContext, type EmailToolDefinition, type EmailToolResult, EmailUnsupportedError, EmailValidationError, type EmailWriteSurface, type FetchResult, type Folder, type FolderRole, type FolderStatus, type ForwardInput, type ImapResponse, type ImapToken, type InsertMessageInput, type JsonSchema, type JsonSchemaType, type LocalSearchOptions, Mailbox, type Message, type MessageBody, type MessageDetail, type MessageListOptions, type NegotiatedExtensions, type ParsedEnvelope, type ReplyInput, type ResponseCode, type SearchQuery, type SelectedFolder, type SmtpErrorCategory, type SmtpResponse, type SyncFolderResult, type SyncOptions, type SyncResult, type TaggedResponse, type Thread, type ThreadListOptions, type ThreadMessage, type TokenType, type ToolEntityKind, type ToolEntityRef, type ToolOutcomeKind, type ToolSideEffects, type UntaggedResponse, type WatchEvent, type WatchOptions, aligned, attachmentWorkflowSkill, composeAndSendSkill, connectAndSyncSkill, defineEmailSkill, emailSkills, emailSoul, emailSoulEssence, emailSoulTraits, emailTools, errors, getEmailSkillByName, getEmailToolByName, index$8 as imap, initSchema, isEmailError, isRetriable, index$7 as mime, network, organizeBulkSkill, read, readAndReplySkill, recoverFromDisruptionSkill, renderEmailSoulPromptFoundation, runtime, index$6 as schema, searchAndActSkill, index$5 as skills, index$4 as smtp, soul, index$3 as store, index$2 as sync, index$1 as tools, triageInboxSkill, index as types, write };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
import * as net from 'net';
|
|
3
|
-
import * as tls from 'tls';
|
|
4
|
-
import * as zlib from 'zlib';
|
|
5
|
-
import { randomUUID } from 'crypto';
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import * as net from 'node:net';
|
|
3
|
+
import * as tls from 'node:tls';
|
|
4
|
+
import * as zlib from 'node:zlib';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|