@usenaive-sdk/cli 0.2.0 → 0.2.2
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 +25 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.js +25 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/billing.d.ts +2 -0
- package/dist/commands/billing.js +204 -0
- package/dist/commands/billing.js.map +1 -0
- package/dist/commands/companies.d.ts +2 -0
- package/dist/commands/companies.js +88 -0
- package/dist/commands/companies.js.map +1 -0
- package/dist/commands/domains.d.ts +2 -0
- package/dist/commands/domains.js +252 -0
- package/dist/commands/domains.js.map +1 -0
- package/dist/commands/email.d.ts +2 -0
- package/dist/commands/email.js +289 -0
- package/dist/commands/email.js.map +1 -0
- package/dist/commands/identity.d.ts +2 -0
- package/dist/commands/identity.js +109 -0
- package/dist/commands/identity.js.map +1 -0
- package/dist/commands/images.d.ts +2 -0
- package/dist/commands/images.js +291 -0
- package/dist/commands/images.js.map +1 -0
- package/dist/commands/jobs.d.ts +2 -0
- package/dist/commands/jobs.js +143 -0
- package/dist/commands/jobs.js.map +1 -0
- package/dist/commands/keys.d.ts +2 -0
- package/dist/commands/keys.js +133 -0
- package/dist/commands/keys.js.map +1 -0
- package/dist/commands/link.d.ts +3 -0
- package/dist/commands/link.js +91 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.js +63 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/register.d.ts +2 -0
- package/dist/commands/register.js +68 -0
- package/dist/commands/register.js.map +1 -0
- package/dist/commands/search.d.ts +2 -0
- package/dist/commands/search.js +209 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/social.d.ts +2 -0
- package/dist/commands/social.js +402 -0
- package/dist/commands/social.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +47 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/usage.d.ts +2 -0
- package/dist/commands/usage.js +62 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/video.d.ts +2 -0
- package/dist/commands/video.js +243 -0
- package/dist/commands/video.js.map +1 -0
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.js +37 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +40 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +37 -0
- package/dist/output.js +84 -0
- package/dist/output.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../src/commands/domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;KAC7C,WAAW,CAAC,gEAAgE,CAAC;KAC7E,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCvB,CAAC,CAAC;AAEH,UAAU;KACP,OAAO,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KACpC,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACpD,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAErC,MAAM,IAAI,GAAG,IAAI,CAAC,IAA6G,CAAC;IAChI,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAA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EAAE;SAC/E;QACD,KAAK,EAAE;YACL,sCAAsC,IAAI,CAAC,YAAY,EAAE;YACzD,WAAW,IAAI,CAAC,MAAM,aAAa,IAAI,CAAC,KAAK,EAAE;YAC/C,gFAAgF;SACjF;QACD,gBAAgB,EAAE,CAAC,eAAe,EAAE,sBAAsB,CAAC;KAC5D,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { apiRequest, handleApiError } from "../client.js";
|
|
3
|
+
import { agentOutput } from "../output.js";
|
|
4
|
+
export const emailCmd = new Command("email")
|
|
5
|
+
.description("Send and manage emails using provisioned inboxes")
|
|
6
|
+
.addHelpText("after", `
|
|
7
|
+
Subcommands:
|
|
8
|
+
naive email inboxes List available email inboxes (get UUIDs for sending)
|
|
9
|
+
naive email create Create a new email inbox
|
|
10
|
+
naive email delete Delete (deactivate) an email inbox
|
|
11
|
+
naive email send Send an email from a specific inbox
|
|
12
|
+
naive email inbox List received emails
|
|
13
|
+
naive email read Read full email content by ID
|
|
14
|
+
|
|
15
|
+
Workflow:
|
|
16
|
+
1. naive email create --local-part support → create a new inbox
|
|
17
|
+
2. naive email inboxes → discover available from addresses
|
|
18
|
+
3. naive email send --from-inbox <uuid> --to ... → send an email
|
|
19
|
+
4. naive email inbox → check for replies
|
|
20
|
+
5. naive email read <id> → read full email content
|
|
21
|
+
|
|
22
|
+
Identity-aware: All operations are scoped to inboxes provisioned
|
|
23
|
+
for your company. Use 'naive identity emails' to see all inboxes.
|
|
24
|
+
|
|
25
|
+
Examples:
|
|
26
|
+
$ naive email create --local-part support
|
|
27
|
+
$ naive email inboxes
|
|
28
|
+
$ naive email send --from-inbox abc-123 --to client@example.com --subject "Hello" --body "Hi there"
|
|
29
|
+
$ naive email inbox --limit 10
|
|
30
|
+
$ naive email read msg-uuid-456
|
|
31
|
+
$ naive email delete <inbox-uuid>
|
|
32
|
+
`);
|
|
33
|
+
emailCmd
|
|
34
|
+
.command("inboxes")
|
|
35
|
+
.description("List all email inboxes available for sending (returns inbox UUIDs)")
|
|
36
|
+
.addHelpText("after", `
|
|
37
|
+
Examples:
|
|
38
|
+
$ naive email inboxes
|
|
39
|
+
|
|
40
|
+
Output includes:
|
|
41
|
+
- id: inbox UUID (use as --from-inbox when sending)
|
|
42
|
+
- address: the email address (e.g., support@yourcompany.com)
|
|
43
|
+
- name: display name
|
|
44
|
+
- status: active or disabled
|
|
45
|
+
|
|
46
|
+
Note: This is equivalent to 'naive identity emails'. Use either command.
|
|
47
|
+
`)
|
|
48
|
+
.action(async () => {
|
|
49
|
+
const resp = await apiRequest("GET", "/v1/email/inboxes");
|
|
50
|
+
handleApiError("email.inboxes", resp);
|
|
51
|
+
const data = resp.data;
|
|
52
|
+
const count = data.inboxes?.length ?? 0;
|
|
53
|
+
agentOutput({
|
|
54
|
+
action: "email.inboxes",
|
|
55
|
+
result: resp.data,
|
|
56
|
+
next_steps: [
|
|
57
|
+
...(count > 0
|
|
58
|
+
? [{ command: `naive email send --from-inbox ${data.inboxes[0].id} --to <recipient> --subject <subject> --body <body>`, description: "Send an email using the first inbox" }]
|
|
59
|
+
: []),
|
|
60
|
+
{ command: "naive email inbox", description: "Check received emails" },
|
|
61
|
+
],
|
|
62
|
+
hints: [
|
|
63
|
+
`${count} inbox${count !== 1 ? "es" : ""} available for sending`,
|
|
64
|
+
"Use the inbox 'id' field as the --from-inbox parameter when sending",
|
|
65
|
+
"Create new inboxes with 'naive email create --local-part <name>'",
|
|
66
|
+
],
|
|
67
|
+
related_commands: ["naive email create", "naive email send", "naive email inbox", "naive identity emails"],
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
emailCmd
|
|
71
|
+
.command("create")
|
|
72
|
+
.description("Create a new email inbox on your company's domain")
|
|
73
|
+
.requiredOption("--local-part <name>", "The part before the @ sign (e.g., 'support', 'hello', 'sales-team')")
|
|
74
|
+
.option("--domain-id <uuid>", "Specific domain UUID (uses company's default domain if not set)")
|
|
75
|
+
.addHelpText("after", `
|
|
76
|
+
Examples:
|
|
77
|
+
$ naive email create --local-part support
|
|
78
|
+
$ naive email create --local-part sales-team
|
|
79
|
+
$ naive email create --local-part hello --domain-id <domain-uuid>
|
|
80
|
+
|
|
81
|
+
What this does:
|
|
82
|
+
1. Validates the local_part (letters, numbers, dots, hyphens, min 2 chars)
|
|
83
|
+
2. Finds your company's active domain (or uses --domain-id)
|
|
84
|
+
3. Creates the inbox as local_part@yourdomain.com
|
|
85
|
+
4. Returns the inbox UUID for use in 'naive email send'
|
|
86
|
+
|
|
87
|
+
Requirements:
|
|
88
|
+
- Your company must have at least one active domain
|
|
89
|
+
- The email address must not already exist
|
|
90
|
+
|
|
91
|
+
The resulting address will be: <local_part>@<your-company-domain>
|
|
92
|
+
`)
|
|
93
|
+
.action(async (opts) => {
|
|
94
|
+
const resp = await apiRequest("POST", "/v1/email/inboxes", {
|
|
95
|
+
local_part: opts.localPart,
|
|
96
|
+
...(opts.domainId && { domain_id: opts.domainId }),
|
|
97
|
+
});
|
|
98
|
+
handleApiError("email.create", resp);
|
|
99
|
+
const data = resp.data;
|
|
100
|
+
agentOutput({
|
|
101
|
+
action: "email.create",
|
|
102
|
+
result: resp.data,
|
|
103
|
+
next_steps: [
|
|
104
|
+
{ command: `naive email send --from-inbox ${data.id} --to <recipient> --subject <subject> --body <body>`, description: "Send an email from this new inbox" },
|
|
105
|
+
{ command: "naive email inboxes", description: "List all inboxes including the new one" },
|
|
106
|
+
{ command: "naive email inbox", description: "Monitor this inbox for incoming emails" },
|
|
107
|
+
],
|
|
108
|
+
hints: [
|
|
109
|
+
`Inbox created: ${data.address}`,
|
|
110
|
+
`Inbox UUID: ${data.id}`,
|
|
111
|
+
"Use this UUID as --from-inbox when sending emails",
|
|
112
|
+
],
|
|
113
|
+
related_commands: ["naive email send", "naive email inboxes", "naive email delete"],
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
emailCmd
|
|
117
|
+
.command("delete <inbox_id>")
|
|
118
|
+
.description("Delete (deactivate) an email inbox — emails to this address will no longer be received")
|
|
119
|
+
.addHelpText("after", `
|
|
120
|
+
Examples:
|
|
121
|
+
$ naive email delete 550e8400-e29b-41d4-a716-446655440000
|
|
122
|
+
|
|
123
|
+
What this does:
|
|
124
|
+
Soft-deletes the inbox (marks as inactive). Emails sent to this
|
|
125
|
+
address will no longer be routed to your company.
|
|
126
|
+
|
|
127
|
+
Notes:
|
|
128
|
+
- This is a soft delete — the address can be reclaimed later
|
|
129
|
+
- Any emails already received remain accessible via 'naive email inbox'
|
|
130
|
+
- Use 'naive email inboxes' to find the inbox UUID
|
|
131
|
+
`)
|
|
132
|
+
.action(async (inboxId) => {
|
|
133
|
+
const resp = await apiRequest("DELETE", `/v1/email/inboxes/${inboxId}`);
|
|
134
|
+
handleApiError("email.delete", resp);
|
|
135
|
+
const data = resp.data;
|
|
136
|
+
agentOutput({
|
|
137
|
+
action: "email.delete",
|
|
138
|
+
result: resp.data,
|
|
139
|
+
next_steps: [
|
|
140
|
+
{ command: "naive email inboxes", description: "Verify inbox is removed from active list" },
|
|
141
|
+
{ command: "naive email create --local-part <name>", description: "Create a replacement inbox" },
|
|
142
|
+
],
|
|
143
|
+
hints: [
|
|
144
|
+
`Inbox deactivated: ${data.address}`,
|
|
145
|
+
"Emails to this address will no longer be received",
|
|
146
|
+
"Existing emails remain accessible",
|
|
147
|
+
],
|
|
148
|
+
related_commands: ["naive email inboxes", "naive email create"],
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
emailCmd
|
|
152
|
+
.command("send")
|
|
153
|
+
.description("Send an email from a specific provisioned inbox")
|
|
154
|
+
.requiredOption("--from-inbox <uuid>", "Inbox UUID to send from (get via 'naive email inboxes')")
|
|
155
|
+
.requiredOption("--to <email>", "Recipient email address")
|
|
156
|
+
.requiredOption("--subject <subject>", "Email subject line")
|
|
157
|
+
.requiredOption("--body <body>", "Email body (plain text or HTML)")
|
|
158
|
+
.option("--reply-to <email>", "Reply-to address (if different from inbox)")
|
|
159
|
+
.addHelpText("after", `
|
|
160
|
+
Examples:
|
|
161
|
+
$ naive email send --from-inbox abc-123-uuid --to client@example.com --subject "Invoice Ready" --body "Your invoice is attached."
|
|
162
|
+
$ naive email send --from-inbox abc-123-uuid --to support@vendor.com --subject "Question" --body "<h1>Hi</h1><p>Body here</p>"
|
|
163
|
+
|
|
164
|
+
What this does:
|
|
165
|
+
1. Validates the inbox UUID belongs to your company
|
|
166
|
+
2. Sends the email via the provisioned email service (Resend)
|
|
167
|
+
3. Deducts 1 credit immediately
|
|
168
|
+
4. Returns the message ID for tracking
|
|
169
|
+
|
|
170
|
+
Parameters:
|
|
171
|
+
--from-inbox The UUID of the inbox (NOT the email address). Get this from 'naive email inboxes'
|
|
172
|
+
--to Recipient email address
|
|
173
|
+
--subject Subject line
|
|
174
|
+
--body Body content (plain text or HTML — HTML tags are auto-detected)
|
|
175
|
+
--reply-to Optional reply-to override
|
|
176
|
+
|
|
177
|
+
Cost: 1 credit per email sent
|
|
178
|
+
`)
|
|
179
|
+
.action(async (opts) => {
|
|
180
|
+
const resp = await apiRequest("POST", "/v1/email/send", {
|
|
181
|
+
from_inbox: opts.fromInbox,
|
|
182
|
+
to: opts.to,
|
|
183
|
+
subject: opts.subject,
|
|
184
|
+
body: opts.body,
|
|
185
|
+
...(opts.replyTo && { reply_to: opts.replyTo }),
|
|
186
|
+
});
|
|
187
|
+
handleApiError("email.send", resp);
|
|
188
|
+
const data = resp.data;
|
|
189
|
+
agentOutput({
|
|
190
|
+
action: "email.send",
|
|
191
|
+
result: resp.data,
|
|
192
|
+
next_steps: [
|
|
193
|
+
{ command: "naive email inbox", description: "Monitor inbox for replies" },
|
|
194
|
+
{ command: `naive email read ${data.id}`, description: "View the sent message details", when: "You want to confirm delivery" },
|
|
195
|
+
{ command: "naive usage", description: "Check credit deduction" },
|
|
196
|
+
],
|
|
197
|
+
hints: [
|
|
198
|
+
`Email sent successfully (id: ${data.id})`,
|
|
199
|
+
"Cost: 1 credit (deducted immediately)",
|
|
200
|
+
"Monitor for replies with 'naive email inbox'",
|
|
201
|
+
],
|
|
202
|
+
related_commands: ["naive email inbox", "naive email read", "naive email inboxes"],
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
emailCmd
|
|
206
|
+
.command("inbox")
|
|
207
|
+
.description("List received emails for your inboxes")
|
|
208
|
+
.option("--inbox <uuid>", "Filter by specific inbox UUID")
|
|
209
|
+
.option("--limit <n>", "Maximum number of emails to return (default: 20)", "20")
|
|
210
|
+
.addHelpText("after", `
|
|
211
|
+
Examples:
|
|
212
|
+
$ naive email inbox
|
|
213
|
+
$ naive email inbox --limit 5
|
|
214
|
+
$ naive email inbox --inbox abc-123-uuid --limit 10
|
|
215
|
+
|
|
216
|
+
What this does:
|
|
217
|
+
Returns received emails for your company's inboxes, ordered by
|
|
218
|
+
most recent. Each email includes:
|
|
219
|
+
- id: message UUID (use with 'naive email read')
|
|
220
|
+
- from: sender address
|
|
221
|
+
- to: recipient (your inbox)
|
|
222
|
+
- subject: email subject
|
|
223
|
+
- received_at: timestamp
|
|
224
|
+
- snippet: preview of body text
|
|
225
|
+
|
|
226
|
+
Use --inbox to filter to a specific inbox, or omit to see all.
|
|
227
|
+
`)
|
|
228
|
+
.action(async (opts) => {
|
|
229
|
+
const params = new URLSearchParams({ limit: opts.limit });
|
|
230
|
+
if (opts.inbox)
|
|
231
|
+
params.set("from_inbox", opts.inbox);
|
|
232
|
+
const resp = await apiRequest("GET", `/v1/email/inbox?${params}`);
|
|
233
|
+
handleApiError("email.inbox", resp);
|
|
234
|
+
const data = resp.data;
|
|
235
|
+
const count = data.emails?.length ?? 0;
|
|
236
|
+
agentOutput({
|
|
237
|
+
action: "email.inbox",
|
|
238
|
+
result: resp.data,
|
|
239
|
+
next_steps: [
|
|
240
|
+
...(count > 0
|
|
241
|
+
? [{ command: `naive email read ${data.emails[0].id}`, description: "Read the most recent email" }]
|
|
242
|
+
: []),
|
|
243
|
+
{ command: "naive email inbox --limit 50", description: "Load more emails" },
|
|
244
|
+
{ command: "naive email send --from-inbox <uuid> --to <email> --subject <subject> --body <body>", description: "Reply to an email" },
|
|
245
|
+
],
|
|
246
|
+
hints: [
|
|
247
|
+
`${count} email${count !== 1 ? "s" : ""} found`,
|
|
248
|
+
"Use 'naive email read <id>' to see full email content",
|
|
249
|
+
],
|
|
250
|
+
related_commands: ["naive email read", "naive email send", "naive email inboxes"],
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
emailCmd
|
|
254
|
+
.command("read <message_id>")
|
|
255
|
+
.description("Read the full content of a specific email by its ID")
|
|
256
|
+
.addHelpText("after", `
|
|
257
|
+
Examples:
|
|
258
|
+
$ naive email read 550e8400-e29b-41d4-a716-446655440000
|
|
259
|
+
|
|
260
|
+
What this does:
|
|
261
|
+
Returns the full email content including:
|
|
262
|
+
- From, To, Subject, Date
|
|
263
|
+
- Full body (HTML and/or plain text)
|
|
264
|
+
- Attachments list (if any)
|
|
265
|
+
- Headers
|
|
266
|
+
|
|
267
|
+
Use this to:
|
|
268
|
+
- Read a full email after seeing it in 'naive email inbox'
|
|
269
|
+
- Extract information from an email for further processing
|
|
270
|
+
- Check delivery/read receipts
|
|
271
|
+
`)
|
|
272
|
+
.action(async (id) => {
|
|
273
|
+
const resp = await apiRequest("GET", `/v1/email/${id}`);
|
|
274
|
+
handleApiError("email.read", resp);
|
|
275
|
+
const data = resp.data;
|
|
276
|
+
agentOutput({
|
|
277
|
+
action: "email.read",
|
|
278
|
+
result: resp.data,
|
|
279
|
+
next_steps: [
|
|
280
|
+
{ command: "naive email inbox", description: "Go back to inbox list" },
|
|
281
|
+
{ command: `naive email send --from-inbox <uuid> --to ${data.from} --subject "Re: ${data.subject}" --body <reply>`, description: "Reply to this email" },
|
|
282
|
+
],
|
|
283
|
+
hints: [
|
|
284
|
+
"Use the sender address with 'naive email send' to reply",
|
|
285
|
+
],
|
|
286
|
+
related_commands: ["naive email inbox", "naive email send"],
|
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EAAE,QAAQ;YAC/C,uDAAuD;SACxD;QACD,gBAAgB,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,CAAC;KAClF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,QAAQ;KACL,OAAO,CAAC,mBAAmB,CAAC;KAC5B,WAAW,CAAC,qDAAqD,CAAC;KAClE,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;;;;;;CAevB,CAAC;KACC,MAAM,CAAC,KAAK,EAAE,EAAU,EAAE,EAAE;IAC3B,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;IACxD,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAEnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAqD,CAAC;IAExE,WAAW,CAAC;QACV,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,IAAI,CAAC,IAAI;QACjB,UAAU,EAAE;YACV,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,uBAAuB,EAAE;YACtE,EAAE,OAAO,EAAE,6CAA6C,IAAI,CAAC,IAAI,mBAAmB,IAAI,CAAC,OAAO,kBAAkB,EAAE,WAAW,EAAE,qBAAqB,EAAE;SACzJ;QACD,KAAK,EAAE;YACL,yDAAyD;SAC1D;QACD,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;KAC5D,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { apiRequest, handleApiError } from "../client.js";
|
|
3
|
+
import { agentOutput } from "../output.js";
|
|
4
|
+
export const identityCmd = new Command("identity")
|
|
5
|
+
.description("View agent identity and all provisioned resources for the current company")
|
|
6
|
+
.addHelpText("after", `
|
|
7
|
+
Examples:
|
|
8
|
+
$ naive identity
|
|
9
|
+
$ naive identity emails
|
|
10
|
+
$ naive identity resources
|
|
11
|
+
|
|
12
|
+
What this does:
|
|
13
|
+
Returns complete identity info for the current agent/company:
|
|
14
|
+
- Agent details (name, role, status)
|
|
15
|
+
- Company info
|
|
16
|
+
- Email inboxes available for sending
|
|
17
|
+
- Phone numbers (if provisioned)
|
|
18
|
+
- Connected integrations
|
|
19
|
+
|
|
20
|
+
Use this to:
|
|
21
|
+
- Discover what email addresses you can send from
|
|
22
|
+
- Check what resources are provisioned before using them
|
|
23
|
+
- Verify your agent has the necessary access for a task
|
|
24
|
+
`)
|
|
25
|
+
.action(async () => {
|
|
26
|
+
const resp = await apiRequest("GET", "/v1/identity");
|
|
27
|
+
handleApiError("identity", resp);
|
|
28
|
+
agentOutput({
|
|
29
|
+
action: "identity",
|
|
30
|
+
result: resp.data,
|
|
31
|
+
next_steps: [
|
|
32
|
+
{ command: "naive identity emails", description: "List only email inboxes (with UUIDs for sending)" },
|
|
33
|
+
{ command: "naive email send --from-inbox <uuid> --to user@example.com --subject Hi --body Hello", description: "Send an email using a discovered inbox", when: "You need to send an email" },
|
|
34
|
+
{ command: "naive status", description: "Check credits and API status" },
|
|
35
|
+
],
|
|
36
|
+
hints: [
|
|
37
|
+
"Email inboxes listed here provide the UUID needed for the --from-inbox parameter",
|
|
38
|
+
"Resources shown are specific to your current company context",
|
|
39
|
+
],
|
|
40
|
+
related_commands: ["naive identity emails", "naive identity resources", "naive email inboxes"],
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
identityCmd
|
|
44
|
+
.command("emails")
|
|
45
|
+
.description("List email inboxes available for sending (returns inbox UUIDs)")
|
|
46
|
+
.addHelpText("after", `
|
|
47
|
+
Examples:
|
|
48
|
+
$ naive identity emails
|
|
49
|
+
|
|
50
|
+
What this does:
|
|
51
|
+
Lists all email addresses provisioned for your company that you can
|
|
52
|
+
send from. Each inbox has a UUID that you use as --from-inbox when
|
|
53
|
+
sending emails.
|
|
54
|
+
|
|
55
|
+
Output includes:
|
|
56
|
+
- inbox_id: UUID to use in email commands
|
|
57
|
+
- address: the email address
|
|
58
|
+
- name: display name
|
|
59
|
+
- status: active/disabled
|
|
60
|
+
`)
|
|
61
|
+
.action(async () => {
|
|
62
|
+
const resp = await apiRequest("GET", "/v1/identity/emails");
|
|
63
|
+
handleApiError("identity.emails", resp);
|
|
64
|
+
const data = resp.data;
|
|
65
|
+
agentOutput({
|
|
66
|
+
action: "identity.emails",
|
|
67
|
+
result: resp.data,
|
|
68
|
+
next_steps: [
|
|
69
|
+
...(data.inboxes?.length > 0
|
|
70
|
+
? [{ command: `naive email send --from-inbox ${data.inboxes[0].id} --to <recipient> --subject <subject> --body <body>`, description: "Send an email from the first available inbox" }]
|
|
71
|
+
: []),
|
|
72
|
+
{ command: "naive email inbox", description: "View received emails" },
|
|
73
|
+
],
|
|
74
|
+
hints: [
|
|
75
|
+
`Found ${data.inboxes?.length ?? 0} email inboxes`,
|
|
76
|
+
"Use the inbox UUID as --from-inbox when calling 'naive email send'",
|
|
77
|
+
],
|
|
78
|
+
related_commands: ["naive email send", "naive email inbox", "naive email read"],
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
identityCmd
|
|
82
|
+
.command("resources")
|
|
83
|
+
.description("List all provisioned resources (email, phone, integrations)")
|
|
84
|
+
.addHelpText("after", `
|
|
85
|
+
Examples:
|
|
86
|
+
$ naive identity resources
|
|
87
|
+
|
|
88
|
+
What this does:
|
|
89
|
+
Returns a comprehensive list of all resources provisioned for your
|
|
90
|
+
company, grouped by type: email inboxes, phone numbers, domains,
|
|
91
|
+
and connected third-party integrations.
|
|
92
|
+
`)
|
|
93
|
+
.action(async () => {
|
|
94
|
+
const resp = await apiRequest("GET", "/v1/identity/resources");
|
|
95
|
+
handleApiError("identity.resources", resp);
|
|
96
|
+
agentOutput({
|
|
97
|
+
action: "identity.resources",
|
|
98
|
+
result: resp.data,
|
|
99
|
+
next_steps: [
|
|
100
|
+
{ command: "naive identity emails", description: "See detailed email inbox info" },
|
|
101
|
+
{ command: "naive status", description: "Check overall account status" },
|
|
102
|
+
],
|
|
103
|
+
hints: [
|
|
104
|
+
"Resources are scoped to your current company. Switch companies with 'naive companies select' to see different resources.",
|
|
105
|
+
],
|
|
106
|
+
related_commands: ["naive identity", "naive identity emails", "naive companies"],
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/commands/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;KAC/C,WAAW,CAAC,2EAA2E,CAAC;KACxF,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;;;;;;;;;CAkBvB,CAAC;KACC,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IACrD,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEjC,WAAW,CAAC;QACV,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,IAAI,CAAC,IAAI;QACjB,UAAU,EAAE;YACV,EAAE,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,kDAAkD,EAAE;YACrG,EAAE,OAAO,EAAE,sFAAsF,EAAE,WAAW,EAAE,wCAAwC,EAAE,IAAI,EAAE,2BAA2B,EAAE;YAC7L,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,8BAA8B,EAAE;SACzE;QACD,KAAK,EAAE;YACL,kFAAkF;YAClF,8DAA8D;SAC/D;QACD,gBAAgB,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,EAAE,qBAAqB,C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