@holon-run/uxc-daemon-client 0.18.0 → 0.20.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/dist/index.cjs +39 -0
- package/dist/index.d.cts +52 -2
- package/dist/index.d.ts +52 -2
- package/dist/index.js +39 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -109,6 +109,16 @@ var UxcDaemonClient = class {
|
|
|
109
109
|
});
|
|
110
110
|
return generateTypeScriptClient(schema, args.emitter);
|
|
111
111
|
}
|
|
112
|
+
async emailSend(args) {
|
|
113
|
+
return this.request("email.send", emailSendParams(args));
|
|
114
|
+
}
|
|
115
|
+
async emailReply(args) {
|
|
116
|
+
const { replyHandle, ...send } = args;
|
|
117
|
+
return this.request("email.reply", {
|
|
118
|
+
...emailSendParams(send),
|
|
119
|
+
...replyHandle ? { reply_handle: emailReplyHandleParams(replyHandle) } : {}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
112
122
|
async sourceEnsure(args) {
|
|
113
123
|
return this.request("source.ensure", {
|
|
114
124
|
namespace: args.namespace,
|
|
@@ -628,6 +638,35 @@ function defaultSocketPath(env) {
|
|
|
628
638
|
const label = bestEffortUserLabel(env);
|
|
629
639
|
return (0, import_node_path.join)((0, import_node_os.tmpdir)(), `uxc-${label}`, "daemon", "uxc.sock");
|
|
630
640
|
}
|
|
641
|
+
function emailSendParams(args) {
|
|
642
|
+
const params = {
|
|
643
|
+
smtp_url: args.smtpUrl,
|
|
644
|
+
from: args.from,
|
|
645
|
+
to: args.to,
|
|
646
|
+
subject: args.subject
|
|
647
|
+
};
|
|
648
|
+
if (args.cc?.length) params.cc = args.cc;
|
|
649
|
+
if (args.bcc?.length) params.bcc = args.bcc;
|
|
650
|
+
if (args.text != null) params.text = args.text;
|
|
651
|
+
if (args.html != null) params.html = args.html;
|
|
652
|
+
if (args.inReplyTo != null) params.in_reply_to = args.inReplyTo;
|
|
653
|
+
if (args.references?.length) params.references = args.references;
|
|
654
|
+
if (args.auth != null) params.auth = args.auth;
|
|
655
|
+
if (args.messageId != null) params.message_id = args.messageId;
|
|
656
|
+
if (args.allowInsecureAuth != null) params.allow_insecure_auth = args.allowInsecureAuth;
|
|
657
|
+
if (args.dryRun != null) params.dry_run = args.dryRun;
|
|
658
|
+
return params;
|
|
659
|
+
}
|
|
660
|
+
function emailReplyHandleParams(replyHandle) {
|
|
661
|
+
if (replyHandle.messageId == null) {
|
|
662
|
+
throw new Error("emailReply replyHandle requires messageId");
|
|
663
|
+
}
|
|
664
|
+
const params = { message_id: replyHandle.messageId };
|
|
665
|
+
if (replyHandle.account != null) params.account = replyHandle.account;
|
|
666
|
+
if (replyHandle.mailbox != null) params.mailbox = replyHandle.mailbox;
|
|
667
|
+
if (replyHandle.uid != null) params.uid = replyHandle.uid;
|
|
668
|
+
return params;
|
|
669
|
+
}
|
|
631
670
|
function bestEffortUserLabel(env) {
|
|
632
671
|
const raw = env?.USER ?? env?.USERNAME ?? "unknown";
|
|
633
672
|
const filtered = raw.replace(/[^A-Za-z0-9_-]/g, "_");
|
package/dist/index.d.cts
CHANGED
|
@@ -81,7 +81,7 @@ interface ManagedSourceSpec {
|
|
|
81
81
|
args?: Record<string, unknown> | null;
|
|
82
82
|
resource_uri?: string | null;
|
|
83
83
|
read_resource?: boolean;
|
|
84
|
-
transport_hint?: "websocket" | "discord_gateway" | "slack_socket_mode" | "feishu_long_connection" | null;
|
|
84
|
+
transport_hint?: "websocket" | "discord_gateway" | "slack_socket_mode" | "feishu_long_connection" | "email_imap_idle" | "email_provider_poll" | null;
|
|
85
85
|
subprotocols?: string[];
|
|
86
86
|
initial_text_frames?: string[];
|
|
87
87
|
mode: "stream" | "poll";
|
|
@@ -97,6 +97,45 @@ interface ManagedSourceEnsureResponse {
|
|
|
97
97
|
reused: boolean;
|
|
98
98
|
replaced_previous: boolean;
|
|
99
99
|
}
|
|
100
|
+
interface EmailSendResult {
|
|
101
|
+
smtp_url: string;
|
|
102
|
+
from: string;
|
|
103
|
+
to: string[];
|
|
104
|
+
cc?: string[];
|
|
105
|
+
bcc?: string[];
|
|
106
|
+
subject: string;
|
|
107
|
+
message_id: string;
|
|
108
|
+
in_reply_to?: string | null;
|
|
109
|
+
references?: string[];
|
|
110
|
+
dry_run: boolean;
|
|
111
|
+
accepted_recipients: number;
|
|
112
|
+
}
|
|
113
|
+
interface EmailReplyHandle {
|
|
114
|
+
messageId?: string;
|
|
115
|
+
account?: string;
|
|
116
|
+
mailbox?: string;
|
|
117
|
+
uid?: number;
|
|
118
|
+
}
|
|
119
|
+
interface EmailSendArgs {
|
|
120
|
+
smtpUrl: string;
|
|
121
|
+
from: string;
|
|
122
|
+
to: string[];
|
|
123
|
+
cc?: string[];
|
|
124
|
+
bcc?: string[];
|
|
125
|
+
subject: string;
|
|
126
|
+
text?: string;
|
|
127
|
+
html?: string;
|
|
128
|
+
inReplyTo?: string;
|
|
129
|
+
references?: string[];
|
|
130
|
+
auth?: string;
|
|
131
|
+
/** Caller-supplied Message-ID used for outbound idempotency. */
|
|
132
|
+
messageId?: string;
|
|
133
|
+
allowInsecureAuth?: boolean;
|
|
134
|
+
dryRun?: boolean;
|
|
135
|
+
}
|
|
136
|
+
interface EmailReplyArgs extends EmailSendArgs {
|
|
137
|
+
replyHandle?: EmailReplyHandle | null;
|
|
138
|
+
}
|
|
100
139
|
interface ManagedSourceView {
|
|
101
140
|
namespace: string;
|
|
102
141
|
source_key: string;
|
|
@@ -197,6 +236,15 @@ interface PollSubscriptionConfig {
|
|
|
197
236
|
response_cursor_pointer?: string;
|
|
198
237
|
cursor_from_item_pointer?: string;
|
|
199
238
|
cursor_transform?: "increment";
|
|
239
|
+
/**
|
|
240
|
+
* First-look backfill depth. When set, only the initial poll cycle after a
|
|
241
|
+
* fresh checkpoint emits items: the whole first page is recorded in the
|
|
242
|
+
* checkpoint, but at most this many unseen items are emitted. `0`
|
|
243
|
+
* establishes the baseline without emitting anything ("new items only").
|
|
244
|
+
* Later cycles are unaffected. Requires the item_key, watermark, or
|
|
245
|
+
* content_hash checkpoint strategy.
|
|
246
|
+
*/
|
|
247
|
+
initial_items_limit?: number;
|
|
200
248
|
checkpoint_strategy: {
|
|
201
249
|
type: "cursor_only";
|
|
202
250
|
} | {
|
|
@@ -245,6 +293,8 @@ declare class UxcDaemonClient {
|
|
|
245
293
|
options?: RuntimeInvokeOptions;
|
|
246
294
|
emitter?: GenerateTypeScriptClientOptions;
|
|
247
295
|
}): Promise<string>;
|
|
296
|
+
emailSend(args: EmailSendArgs): Promise<EmailSendResult>;
|
|
297
|
+
emailReply(args: EmailReplyArgs): Promise<EmailSendResult>;
|
|
248
298
|
sourceEnsure(args: {
|
|
249
299
|
namespace: string;
|
|
250
300
|
sourceKey: string;
|
|
@@ -268,4 +318,4 @@ declare class UxcDaemonClient {
|
|
|
268
318
|
}
|
|
269
319
|
declare function generateTypeScriptClient(schema: CodegenHostSchemaV1, options?: GenerateTypeScriptClientOptions): string;
|
|
270
320
|
|
|
271
|
-
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonSessionKillResponse, type DaemonStatus, type GenerateTypeScriptClientOptions, type ManagedSourceDeleteResponse, type ManagedSourceEnsureResponse, type ManagedSourceListEntry, type ManagedSourceSpec, type ManagedSourceStopResponse, type ManagedSourceView, type ManagedStreamEvent, type ManagedStreamInfo, type ManagedStreamReadResponse, type ManagedStreamTrimResponse, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
|
321
|
+
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonSessionKillResponse, type DaemonStatus, type EmailReplyArgs, type EmailReplyHandle, type EmailSendArgs, type EmailSendResult, type GenerateTypeScriptClientOptions, type ManagedSourceDeleteResponse, type ManagedSourceEnsureResponse, type ManagedSourceListEntry, type ManagedSourceSpec, type ManagedSourceStopResponse, type ManagedSourceView, type ManagedStreamEvent, type ManagedStreamInfo, type ManagedStreamReadResponse, type ManagedStreamTrimResponse, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ interface ManagedSourceSpec {
|
|
|
81
81
|
args?: Record<string, unknown> | null;
|
|
82
82
|
resource_uri?: string | null;
|
|
83
83
|
read_resource?: boolean;
|
|
84
|
-
transport_hint?: "websocket" | "discord_gateway" | "slack_socket_mode" | "feishu_long_connection" | null;
|
|
84
|
+
transport_hint?: "websocket" | "discord_gateway" | "slack_socket_mode" | "feishu_long_connection" | "email_imap_idle" | "email_provider_poll" | null;
|
|
85
85
|
subprotocols?: string[];
|
|
86
86
|
initial_text_frames?: string[];
|
|
87
87
|
mode: "stream" | "poll";
|
|
@@ -97,6 +97,45 @@ interface ManagedSourceEnsureResponse {
|
|
|
97
97
|
reused: boolean;
|
|
98
98
|
replaced_previous: boolean;
|
|
99
99
|
}
|
|
100
|
+
interface EmailSendResult {
|
|
101
|
+
smtp_url: string;
|
|
102
|
+
from: string;
|
|
103
|
+
to: string[];
|
|
104
|
+
cc?: string[];
|
|
105
|
+
bcc?: string[];
|
|
106
|
+
subject: string;
|
|
107
|
+
message_id: string;
|
|
108
|
+
in_reply_to?: string | null;
|
|
109
|
+
references?: string[];
|
|
110
|
+
dry_run: boolean;
|
|
111
|
+
accepted_recipients: number;
|
|
112
|
+
}
|
|
113
|
+
interface EmailReplyHandle {
|
|
114
|
+
messageId?: string;
|
|
115
|
+
account?: string;
|
|
116
|
+
mailbox?: string;
|
|
117
|
+
uid?: number;
|
|
118
|
+
}
|
|
119
|
+
interface EmailSendArgs {
|
|
120
|
+
smtpUrl: string;
|
|
121
|
+
from: string;
|
|
122
|
+
to: string[];
|
|
123
|
+
cc?: string[];
|
|
124
|
+
bcc?: string[];
|
|
125
|
+
subject: string;
|
|
126
|
+
text?: string;
|
|
127
|
+
html?: string;
|
|
128
|
+
inReplyTo?: string;
|
|
129
|
+
references?: string[];
|
|
130
|
+
auth?: string;
|
|
131
|
+
/** Caller-supplied Message-ID used for outbound idempotency. */
|
|
132
|
+
messageId?: string;
|
|
133
|
+
allowInsecureAuth?: boolean;
|
|
134
|
+
dryRun?: boolean;
|
|
135
|
+
}
|
|
136
|
+
interface EmailReplyArgs extends EmailSendArgs {
|
|
137
|
+
replyHandle?: EmailReplyHandle | null;
|
|
138
|
+
}
|
|
100
139
|
interface ManagedSourceView {
|
|
101
140
|
namespace: string;
|
|
102
141
|
source_key: string;
|
|
@@ -197,6 +236,15 @@ interface PollSubscriptionConfig {
|
|
|
197
236
|
response_cursor_pointer?: string;
|
|
198
237
|
cursor_from_item_pointer?: string;
|
|
199
238
|
cursor_transform?: "increment";
|
|
239
|
+
/**
|
|
240
|
+
* First-look backfill depth. When set, only the initial poll cycle after a
|
|
241
|
+
* fresh checkpoint emits items: the whole first page is recorded in the
|
|
242
|
+
* checkpoint, but at most this many unseen items are emitted. `0`
|
|
243
|
+
* establishes the baseline without emitting anything ("new items only").
|
|
244
|
+
* Later cycles are unaffected. Requires the item_key, watermark, or
|
|
245
|
+
* content_hash checkpoint strategy.
|
|
246
|
+
*/
|
|
247
|
+
initial_items_limit?: number;
|
|
200
248
|
checkpoint_strategy: {
|
|
201
249
|
type: "cursor_only";
|
|
202
250
|
} | {
|
|
@@ -245,6 +293,8 @@ declare class UxcDaemonClient {
|
|
|
245
293
|
options?: RuntimeInvokeOptions;
|
|
246
294
|
emitter?: GenerateTypeScriptClientOptions;
|
|
247
295
|
}): Promise<string>;
|
|
296
|
+
emailSend(args: EmailSendArgs): Promise<EmailSendResult>;
|
|
297
|
+
emailReply(args: EmailReplyArgs): Promise<EmailSendResult>;
|
|
248
298
|
sourceEnsure(args: {
|
|
249
299
|
namespace: string;
|
|
250
300
|
sourceKey: string;
|
|
@@ -268,4 +318,4 @@ declare class UxcDaemonClient {
|
|
|
268
318
|
}
|
|
269
319
|
declare function generateTypeScriptClient(schema: CodegenHostSchemaV1, options?: GenerateTypeScriptClientOptions): string;
|
|
270
320
|
|
|
271
|
-
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonSessionKillResponse, type DaemonStatus, type GenerateTypeScriptClientOptions, type ManagedSourceDeleteResponse, type ManagedSourceEnsureResponse, type ManagedSourceListEntry, type ManagedSourceSpec, type ManagedSourceStopResponse, type ManagedSourceView, type ManagedStreamEvent, type ManagedStreamInfo, type ManagedStreamReadResponse, type ManagedStreamTrimResponse, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
|
321
|
+
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonSessionKillResponse, type DaemonStatus, type EmailReplyArgs, type EmailReplyHandle, type EmailSendArgs, type EmailSendResult, type GenerateTypeScriptClientOptions, type ManagedSourceDeleteResponse, type ManagedSourceEnsureResponse, type ManagedSourceListEntry, type ManagedSourceSpec, type ManagedSourceStopResponse, type ManagedSourceView, type ManagedStreamEvent, type ManagedStreamInfo, type ManagedStreamReadResponse, type ManagedStreamTrimResponse, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
package/dist/index.js
CHANGED
|
@@ -73,6 +73,16 @@ var UxcDaemonClient = class {
|
|
|
73
73
|
});
|
|
74
74
|
return generateTypeScriptClient(schema, args.emitter);
|
|
75
75
|
}
|
|
76
|
+
async emailSend(args) {
|
|
77
|
+
return this.request("email.send", emailSendParams(args));
|
|
78
|
+
}
|
|
79
|
+
async emailReply(args) {
|
|
80
|
+
const { replyHandle, ...send } = args;
|
|
81
|
+
return this.request("email.reply", {
|
|
82
|
+
...emailSendParams(send),
|
|
83
|
+
...replyHandle ? { reply_handle: emailReplyHandleParams(replyHandle) } : {}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
76
86
|
async sourceEnsure(args) {
|
|
77
87
|
return this.request("source.ensure", {
|
|
78
88
|
namespace: args.namespace,
|
|
@@ -592,6 +602,35 @@ function defaultSocketPath(env) {
|
|
|
592
602
|
const label = bestEffortUserLabel(env);
|
|
593
603
|
return join(tmpdir(), `uxc-${label}`, "daemon", "uxc.sock");
|
|
594
604
|
}
|
|
605
|
+
function emailSendParams(args) {
|
|
606
|
+
const params = {
|
|
607
|
+
smtp_url: args.smtpUrl,
|
|
608
|
+
from: args.from,
|
|
609
|
+
to: args.to,
|
|
610
|
+
subject: args.subject
|
|
611
|
+
};
|
|
612
|
+
if (args.cc?.length) params.cc = args.cc;
|
|
613
|
+
if (args.bcc?.length) params.bcc = args.bcc;
|
|
614
|
+
if (args.text != null) params.text = args.text;
|
|
615
|
+
if (args.html != null) params.html = args.html;
|
|
616
|
+
if (args.inReplyTo != null) params.in_reply_to = args.inReplyTo;
|
|
617
|
+
if (args.references?.length) params.references = args.references;
|
|
618
|
+
if (args.auth != null) params.auth = args.auth;
|
|
619
|
+
if (args.messageId != null) params.message_id = args.messageId;
|
|
620
|
+
if (args.allowInsecureAuth != null) params.allow_insecure_auth = args.allowInsecureAuth;
|
|
621
|
+
if (args.dryRun != null) params.dry_run = args.dryRun;
|
|
622
|
+
return params;
|
|
623
|
+
}
|
|
624
|
+
function emailReplyHandleParams(replyHandle) {
|
|
625
|
+
if (replyHandle.messageId == null) {
|
|
626
|
+
throw new Error("emailReply replyHandle requires messageId");
|
|
627
|
+
}
|
|
628
|
+
const params = { message_id: replyHandle.messageId };
|
|
629
|
+
if (replyHandle.account != null) params.account = replyHandle.account;
|
|
630
|
+
if (replyHandle.mailbox != null) params.mailbox = replyHandle.mailbox;
|
|
631
|
+
if (replyHandle.uid != null) params.uid = replyHandle.uid;
|
|
632
|
+
return params;
|
|
633
|
+
}
|
|
595
634
|
function bestEffortUserLabel(env) {
|
|
596
635
|
const raw = env?.USER ?? env?.USERNAME ?? "unknown";
|
|
597
636
|
const filtered = raw.replace(/[^A-Za-z0-9_-]/g, "_");
|