@sendmux/cli 1.4.0 → 1.5.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.
Files changed (37) hide show
  1. package/README.md +53 -7
  2. package/dist/agent-auth.d.ts +37 -0
  3. package/dist/agent-auth.d.ts.map +1 -0
  4. package/dist/agent-auth.js +348 -0
  5. package/dist/base-command.d.ts.map +1 -1
  6. package/dist/base-command.js +32 -4
  7. package/dist/commands/agent/invite-owner.d.ts +12 -0
  8. package/dist/commands/agent/invite-owner.d.ts.map +1 -0
  9. package/dist/commands/agent/invite-owner.js +36 -0
  10. package/dist/commands/agent/register.d.ts +16 -0
  11. package/dist/commands/agent/register.d.ts.map +1 -0
  12. package/dist/commands/agent/register.js +42 -0
  13. package/dist/commands/mailbox/get-connection.d.ts +26 -0
  14. package/dist/commands/mailbox/get-connection.d.ts.map +1 -0
  15. package/dist/commands/mailbox/get-connection.js +7 -0
  16. package/dist/commands/management/get-connection.d.ts +26 -0
  17. package/dist/commands/management/get-connection.d.ts.map +1 -0
  18. package/dist/commands/management/get-connection.js +7 -0
  19. package/dist/commands/profiles/list.d.ts.map +1 -1
  20. package/dist/commands/profiles/list.js +26 -8
  21. package/dist/commands/profiles/set.d.ts.map +1 -1
  22. package/dist/commands/profiles/set.js +12 -11
  23. package/dist/commands/profiles/show.d.ts.map +1 -1
  24. package/dist/commands/profiles/show.js +19 -7
  25. package/dist/commands/sending/get-connection.d.ts +26 -0
  26. package/dist/commands/sending/get-connection.d.ts.map +1 -0
  27. package/dist/commands/sending/get-connection.js +7 -0
  28. package/dist/generated/operations.d.ts +63 -0
  29. package/dist/generated/operations.d.ts.map +1 -1
  30. package/dist/generated/operations.js +69 -0
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/profiles.d.ts +38 -2
  34. package/dist/profiles.d.ts.map +1 -1
  35. package/dist/profiles.js +147 -4
  36. package/oclif.manifest.json +743 -150
  37. package/package.json +5 -2
@@ -0,0 +1,42 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { registerAgent } from "../../agent-auth.js";
3
+ import { SendmuxCommand } from "../../base-command.js";
4
+ export default class AgentRegister extends SendmuxCommand {
5
+ static args = {
6
+ profile: Args.string({
7
+ description: "Local profile name for the agent inbox.",
8
+ required: true,
9
+ }),
10
+ };
11
+ static description = "Register a durable agent inbox profile.";
12
+ static flags = {
13
+ "base-url": Flags.string({
14
+ description: "Sendmux app origin. Defaults to https://app.sendmux.ai.",
15
+ }),
16
+ "client-name": Flags.string({
17
+ description: "Optional agent client name.",
18
+ }),
19
+ default: Flags.boolean({
20
+ description: "Make this the default profile.",
21
+ }),
22
+ "mailbox-local-part": Flags.string({
23
+ description: "Optional requested mailbox local part.",
24
+ }),
25
+ "owner-email": Flags.string({
26
+ description: "Invite this owner after the inbox becomes ready.",
27
+ }),
28
+ };
29
+ async run() {
30
+ const { args, flags } = await this.parse(AgentRegister);
31
+ const result = await registerAgent({
32
+ ...(flags["base-url"] ? { appOrigin: flags["base-url"] } : {}),
33
+ ...(flags["client-name"] ? { clientName: flags["client-name"] } : {}),
34
+ configDir: this.config.configDir,
35
+ makeDefault: flags.default,
36
+ ...(flags["mailbox-local-part"] ? { mailboxLocalPart: flags["mailbox-local-part"] } : {}),
37
+ ...(flags["owner-email"] ? { ownerEmail: flags["owner-email"] } : {}),
38
+ profileName: args.profile,
39
+ });
40
+ return this.renderResult({ ok: true, data: result, meta: {} });
41
+ }
42
+ }
@@ -0,0 +1,26 @@
1
+ import { OperationCommand } from "../../operation-command.js";
2
+ export default class MailboxGetConnectionCommand extends OperationCommand {
3
+ static description: "Get Mailbox connection";
4
+ static operation: {
5
+ readonly bodyKind: "none";
6
+ readonly command: "mailbox:get-connection";
7
+ readonly description: "Get Mailbox connection";
8
+ readonly headerParams: readonly [{
9
+ readonly name: "If-None-Match";
10
+ readonly required: false;
11
+ readonly schema: {
12
+ readonly type: "string";
13
+ };
14
+ }];
15
+ readonly method: "get";
16
+ readonly operationId: "mailboxGetConnection";
17
+ readonly path: "/mailbox/connection";
18
+ readonly pathParams: readonly [];
19
+ readonly queryParams: readonly [];
20
+ readonly responseKind: "json";
21
+ readonly requestBodyRequired: false;
22
+ readonly requiredKeyKind: "mailbox";
23
+ readonly surface: "mailbox";
24
+ };
25
+ }
26
+ //# sourceMappingURL=get-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-connection.d.ts","sourceRoot":"","sources":["../../../src/commands/mailbox/get-connection.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,gBAAgB;IACvE,MAAM,CAAC,WAAW,2BAA+C;IACjE,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;MAAmC;CACpD"}
@@ -0,0 +1,7 @@
1
+ // This file is generated by scripts/generate-cli.mjs
2
+ import { operations } from "../../generated/operations.js";
3
+ import { OperationCommand } from "../../operation-command.js";
4
+ export default class MailboxGetConnectionCommand extends OperationCommand {
5
+ static description = operations.mailboxGetConnection.description;
6
+ static operation = operations.mailboxGetConnection;
7
+ }
@@ -0,0 +1,26 @@
1
+ import { OperationCommand } from "../../operation-command.js";
2
+ export default class ManagementGetConnectionCommand extends OperationCommand {
3
+ static description: "Get Management connection";
4
+ static operation: {
5
+ readonly bodyKind: "none";
6
+ readonly command: "management:get-connection";
7
+ readonly description: "Get Management connection";
8
+ readonly headerParams: readonly [{
9
+ readonly name: "If-None-Match";
10
+ readonly required: false;
11
+ readonly schema: {
12
+ readonly type: "string";
13
+ };
14
+ }];
15
+ readonly method: "get";
16
+ readonly operationId: "managementGetConnection";
17
+ readonly path: "/me";
18
+ readonly pathParams: readonly [];
19
+ readonly queryParams: readonly [];
20
+ readonly responseKind: "json";
21
+ readonly requestBodyRequired: false;
22
+ readonly requiredKeyKind: "root";
23
+ readonly surface: "management";
24
+ };
25
+ }
26
+ //# sourceMappingURL=get-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-connection.d.ts","sourceRoot":"","sources":["../../../src/commands/management/get-connection.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,8BAA+B,SAAQ,gBAAgB;IAC1E,MAAM,CAAC,WAAW,8BAAkD;IACpE,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;MAAsC;CACvD"}
@@ -0,0 +1,7 @@
1
+ // This file is generated by scripts/generate-cli.mjs
2
+ import { operations } from "../../generated/operations.js";
3
+ import { OperationCommand } from "../../operation-command.js";
4
+ export default class ManagementGetConnectionCommand extends OperationCommand {
5
+ static description = operations.managementGetConnection.description;
6
+ static operation = operations.managementGetConnection;
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/profiles/list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAOvD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAC,WAAW,SAAsC;IACxD,MAAM,CAAC,KAAK;;MAIV;IAEI,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAiB9B"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/profiles/list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWvD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAC,WAAW,SAAsC;IACxD,MAAM,CAAC,KAAK;;MAIV;IAEI,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAoC9B"}
@@ -1,7 +1,7 @@
1
1
  import { Flags } from "@oclif/core";
2
2
  import { SendmuxCommand } from "../../base-command.js";
3
3
  import { inferApiKeyKind, maskApiKey, } from "../../key-kind.js";
4
- import { readCliConfig } from "../../profiles.js";
4
+ import { isActiveAgentProfile, isApiKeyProfile, readCliConfig, } from "../../profiles.js";
5
5
  export default class ProfilesList extends SendmuxCommand {
6
6
  static description = "List local Sendmux CLI profiles.";
7
7
  static flags = {
@@ -12,13 +12,31 @@ export default class ProfilesList extends SendmuxCommand {
12
12
  async run() {
13
13
  const { flags } = await this.parse(ProfilesList);
14
14
  const config = await readCliConfig(this.config.configDir);
15
- const profiles = Object.entries(config.profiles).map(([name, profile]) => ({
16
- default: name === config.defaultProfile,
17
- key_kind: inferApiKeyKind(profile.apiKey),
18
- name,
19
- ...(profile.baseUrl ? { base_url: profile.baseUrl } : {}),
20
- ...(flags.verbose ? { api_key: maskApiKey(profile.apiKey) } : {}),
21
- }));
15
+ const profiles = Object.entries(config.profiles).map(([name, profile]) => {
16
+ if (isApiKeyProfile(profile)) {
17
+ return {
18
+ default: name === config.defaultProfile,
19
+ key_kind: inferApiKeyKind(profile.apiKey),
20
+ name,
21
+ ...(profile.baseUrl ? { base_url: profile.baseUrl } : {}),
22
+ ...(flags.verbose ? { api_key: maskApiKey(profile.apiKey) } : {}),
23
+ type: "api_key",
24
+ };
25
+ }
26
+ return {
27
+ default: name === config.defaultProfile,
28
+ ...(isActiveAgentProfile(profile)
29
+ ? {
30
+ mailbox_email: profile.mailboxEmail,
31
+ owner_invite_status: profile.ownerInvite?.status,
32
+ registration_id: profile.registrationId,
33
+ }
34
+ : {}),
35
+ name,
36
+ status: profile.state,
37
+ type: "agent",
38
+ };
39
+ });
22
40
  return this.renderResult({
23
41
  ok: true,
24
42
  data: { profiles },
@@ -1 +1 @@
1
- {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/commands/profiles/set.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAOvD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAC,IAAI;;MAKT;IACF,MAAM,CAAC,WAAW,SAAmD;IACrE,MAAM,CAAC,KAAK;;;;MAWV;IAEI,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAsC9B"}
1
+ {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/commands/profiles/set.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAC,IAAI;;MAKT;IACF,MAAM,CAAC,WAAW,SAAmD;IACrE,MAAM,CAAC,KAAK;;;;MAWV;IAEI,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAoC9B"}
@@ -1,7 +1,7 @@
1
1
  import { Args, Flags } from "@oclif/core";
2
2
  import { SendmuxCommand } from "../../base-command.js";
3
3
  import { inferApiKeyKind } from "../../key-kind.js";
4
- import { readCliConfig, writeCliConfig, } from "../../profiles.js";
4
+ import { updateCliConfig } from "../../profiles.js";
5
5
  export default class ProfilesSet extends SendmuxCommand {
6
6
  static args = {
7
7
  name: Args.string({
@@ -29,19 +29,20 @@ export default class ProfilesSet extends SendmuxCommand {
29
29
  this.error("Pass --api-key or set SENDMUX_API_KEY.", { exit: 2 });
30
30
  }
31
31
  const keyKind = inferApiKeyKind(apiKey);
32
- const config = await readCliConfig(this.config.configDir);
33
- config.profiles[args.name] = {
34
- apiKey,
35
- ...(flags["base-url"] ? { baseUrl: flags["base-url"] } : {}),
36
- };
37
- if (flags.default || !config.defaultProfile) {
38
- config.defaultProfile = args.name;
39
- }
40
- await writeCliConfig(this.config.configDir, config);
32
+ const isDefault = await updateCliConfig(this.config.configDir, (config) => {
33
+ config.profiles[args.name] = {
34
+ apiKey,
35
+ ...(flags["base-url"] ? { baseUrl: flags["base-url"] } : {}),
36
+ type: "api_key",
37
+ };
38
+ if (flags.default || !config.defaultProfile)
39
+ config.defaultProfile = args.name;
40
+ return config.defaultProfile === args.name;
41
+ });
41
42
  const result = {
42
43
  ok: true,
43
44
  data: {
44
- default: config.defaultProfile === args.name,
45
+ default: isDefault,
45
46
  key_kind: keyKind,
46
47
  name: args.name,
47
48
  ...(flags["base-url"] ? { base_url: flags["base-url"] } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/commands/profiles/show.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAOvD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAC,IAAI;;MAKT;IACF,MAAM,CAAC,WAAW,SAAiE;IAE7E,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAyB9B"}
1
+ {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/commands/profiles/show.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWvD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAC,IAAI;;MAKT;IACF,MAAM,CAAC,WAAW,SAAiE;IAE7E,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAsC9B"}
@@ -1,7 +1,7 @@
1
1
  import { Args } from "@oclif/core";
2
2
  import { SendmuxCommand } from "../../base-command.js";
3
3
  import { inferApiKeyKind, maskApiKey, } from "../../key-kind.js";
4
- import { readCliConfig } from "../../profiles.js";
4
+ import { isActiveAgentProfile, isApiKeyProfile, readCliConfig, } from "../../profiles.js";
5
5
  export default class ProfilesShow extends SendmuxCommand {
6
6
  static args = {
7
7
  name: Args.string({
@@ -21,16 +21,28 @@ export default class ProfilesShow extends SendmuxCommand {
21
21
  if (!profile) {
22
22
  this.error(`Sendmux profile "${profileName}" was not found.`, { exit: 2 });
23
23
  }
24
- return this.renderResult({
25
- ok: true,
26
- data: {
24
+ const data = isApiKeyProfile(profile)
25
+ ? {
27
26
  api_key: maskApiKey(profile.apiKey),
28
27
  default: profileName === config.defaultProfile,
29
28
  key_kind: inferApiKeyKind(profile.apiKey),
30
29
  name: profileName,
31
30
  ...(profile.baseUrl ? { base_url: profile.baseUrl } : {}),
32
- },
33
- meta: {},
34
- });
31
+ type: "api_key",
32
+ }
33
+ : {
34
+ default: profileName === config.defaultProfile,
35
+ ...(isActiveAgentProfile(profile)
36
+ ? {
37
+ mailbox_email: profile.mailboxEmail,
38
+ owner_invite_status: profile.ownerInvite?.status,
39
+ registration_id: profile.registrationId,
40
+ }
41
+ : {}),
42
+ name: profileName,
43
+ status: profile.state,
44
+ type: "agent",
45
+ };
46
+ return this.renderResult({ ok: true, data, meta: {} });
35
47
  }
36
48
  }
@@ -0,0 +1,26 @@
1
+ import { OperationCommand } from "../../operation-command.js";
2
+ export default class SendingGetConnectionCommand extends OperationCommand {
3
+ static description: "Get Sending connection";
4
+ static operation: {
5
+ readonly bodyKind: "none";
6
+ readonly command: "sending:get-connection";
7
+ readonly description: "Get Sending connection";
8
+ readonly headerParams: readonly [{
9
+ readonly name: "If-None-Match";
10
+ readonly required: false;
11
+ readonly schema: {
12
+ readonly type: "string";
13
+ };
14
+ }];
15
+ readonly method: "get";
16
+ readonly operationId: "sendingGetConnection";
17
+ readonly path: "/me";
18
+ readonly pathParams: readonly [];
19
+ readonly queryParams: readonly [];
20
+ readonly responseKind: "json";
21
+ readonly requestBodyRequired: false;
22
+ readonly requiredKeyKind: "sending";
23
+ readonly surface: "sending";
24
+ };
25
+ }
26
+ //# sourceMappingURL=get-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-connection.d.ts","sourceRoot":"","sources":["../../../src/commands/sending/get-connection.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,gBAAgB;IACvE,MAAM,CAAC,WAAW,2BAA+C;IACjE,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;MAAmC;CACpD"}
@@ -0,0 +1,7 @@
1
+ // This file is generated by scripts/generate-cli.mjs
2
+ import { operations } from "../../generated/operations.js";
3
+ import { OperationCommand } from "../../operation-command.js";
4
+ export default class SendingGetConnectionCommand extends OperationCommand {
5
+ static description = operations.sendingGetConnection.description;
6
+ static operation = operations.sendingGetConnection;
7
+ }
@@ -390,6 +390,27 @@ export declare const operations: {
390
390
  readonly requiredKeyKind: "mailbox";
391
391
  readonly surface: "mailbox";
392
392
  };
393
+ readonly mailboxGetConnection: {
394
+ readonly bodyKind: "none";
395
+ readonly command: "mailbox:get-connection";
396
+ readonly description: "Get Mailbox connection";
397
+ readonly headerParams: readonly [{
398
+ readonly name: "If-None-Match";
399
+ readonly required: false;
400
+ readonly schema: {
401
+ readonly type: "string";
402
+ };
403
+ }];
404
+ readonly method: "get";
405
+ readonly operationId: "mailboxGetConnection";
406
+ readonly path: "/mailbox/connection";
407
+ readonly pathParams: readonly [];
408
+ readonly queryParams: readonly [];
409
+ readonly responseKind: "json";
410
+ readonly requestBodyRequired: false;
411
+ readonly requiredKeyKind: "mailbox";
412
+ readonly surface: "mailbox";
413
+ };
393
414
  readonly mailboxGetFolder: {
394
415
  readonly bodyKind: "none";
395
416
  readonly command: "mailbox:get-folder";
@@ -2473,6 +2494,27 @@ export declare const operations: {
2473
2494
  readonly requiredKeyKind: "root";
2474
2495
  readonly surface: "management";
2475
2496
  };
2497
+ readonly managementGetConnection: {
2498
+ readonly bodyKind: "none";
2499
+ readonly command: "management:get-connection";
2500
+ readonly description: "Get Management connection";
2501
+ readonly headerParams: readonly [{
2502
+ readonly name: "If-None-Match";
2503
+ readonly required: false;
2504
+ readonly schema: {
2505
+ readonly type: "string";
2506
+ };
2507
+ }];
2508
+ readonly method: "get";
2509
+ readonly operationId: "managementGetConnection";
2510
+ readonly path: "/me";
2511
+ readonly pathParams: readonly [];
2512
+ readonly queryParams: readonly [];
2513
+ readonly responseKind: "json";
2514
+ readonly requestBodyRequired: false;
2515
+ readonly requiredKeyKind: "root";
2516
+ readonly surface: "management";
2517
+ };
2476
2518
  readonly managementGetDeliveryPayload: {
2477
2519
  readonly bodyKind: "none";
2478
2520
  readonly command: "management:get-delivery-payload";
@@ -3641,6 +3683,27 @@ export declare const operations: {
3641
3683
  readonly requiredKeyKind: "sending";
3642
3684
  readonly surface: "sending";
3643
3685
  };
3686
+ readonly sendingGetConnection: {
3687
+ readonly bodyKind: "none";
3688
+ readonly command: "sending:get-connection";
3689
+ readonly description: "Get Sending connection";
3690
+ readonly headerParams: readonly [{
3691
+ readonly name: "If-None-Match";
3692
+ readonly required: false;
3693
+ readonly schema: {
3694
+ readonly type: "string";
3695
+ };
3696
+ }];
3697
+ readonly method: "get";
3698
+ readonly operationId: "sendingGetConnection";
3699
+ readonly path: "/me";
3700
+ readonly pathParams: readonly [];
3701
+ readonly queryParams: readonly [];
3702
+ readonly responseKind: "json";
3703
+ readonly requestBodyRequired: false;
3704
+ readonly requiredKeyKind: "sending";
3705
+ readonly surface: "sending";
3706
+ };
3644
3707
  readonly sendingGetOpenApiSpec: {
3645
3708
  readonly bodyKind: "none";
3646
3709
  readonly command: "sending:get-open-api-spec";
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/generated/operations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWpB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
@@ -446,6 +446,29 @@ export const operations = {
446
446
  "requiredKeyKind": "mailbox",
447
447
  "surface": "mailbox"
448
448
  },
449
+ mailboxGetConnection: {
450
+ "bodyKind": "none",
451
+ "command": "mailbox:get-connection",
452
+ "description": "Get Mailbox connection",
453
+ "headerParams": [
454
+ {
455
+ "name": "If-None-Match",
456
+ "required": false,
457
+ "schema": {
458
+ "type": "string"
459
+ }
460
+ }
461
+ ],
462
+ "method": "get",
463
+ "operationId": "mailboxGetConnection",
464
+ "path": "/mailbox/connection",
465
+ "pathParams": [],
466
+ "queryParams": [],
467
+ "responseKind": "json",
468
+ "requestBodyRequired": false,
469
+ "requiredKeyKind": "mailbox",
470
+ "surface": "mailbox"
471
+ },
449
472
  mailboxGetFolder: {
450
473
  "bodyKind": "none",
451
474
  "command": "mailbox:get-folder",
@@ -2901,6 +2924,29 @@ export const operations = {
2901
2924
  "requiredKeyKind": "root",
2902
2925
  "surface": "management"
2903
2926
  },
2927
+ managementGetConnection: {
2928
+ "bodyKind": "none",
2929
+ "command": "management:get-connection",
2930
+ "description": "Get Management connection",
2931
+ "headerParams": [
2932
+ {
2933
+ "name": "If-None-Match",
2934
+ "required": false,
2935
+ "schema": {
2936
+ "type": "string"
2937
+ }
2938
+ }
2939
+ ],
2940
+ "method": "get",
2941
+ "operationId": "managementGetConnection",
2942
+ "path": "/me",
2943
+ "pathParams": [],
2944
+ "queryParams": [],
2945
+ "responseKind": "json",
2946
+ "requestBodyRequired": false,
2947
+ "requiredKeyKind": "root",
2948
+ "surface": "management"
2949
+ },
2904
2950
  managementGetDeliveryPayload: {
2905
2951
  "bodyKind": "none",
2906
2952
  "command": "management:get-delivery-payload",
@@ -4262,6 +4308,29 @@ export const operations = {
4262
4308
  "requiredKeyKind": "sending",
4263
4309
  "surface": "sending"
4264
4310
  },
4311
+ sendingGetConnection: {
4312
+ "bodyKind": "none",
4313
+ "command": "sending:get-connection",
4314
+ "description": "Get Sending connection",
4315
+ "headerParams": [
4316
+ {
4317
+ "name": "If-None-Match",
4318
+ "required": false,
4319
+ "schema": {
4320
+ "type": "string"
4321
+ }
4322
+ }
4323
+ ],
4324
+ "method": "get",
4325
+ "operationId": "sendingGetConnection",
4326
+ "path": "/me",
4327
+ "pathParams": [],
4328
+ "queryParams": [],
4329
+ "responseKind": "json",
4330
+ "requestBodyRequired": false,
4331
+ "requiredKeyKind": "sending",
4332
+ "surface": "sending"
4333
+ },
4265
4334
  sendingGetOpenApiSpec: {
4266
4335
  "bodyKind": "none",
4267
4336
  "command": "sending:get-open-api-spec",
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export type { CliConfig, CliProfile, } from "./profiles.js";
1
+ export type { ActiveAgentCliProfile, AgentCliProfile, ApiKeyCliProfile, CliConfig, CliProfile, RegisteringAgentCliProfile, } from "./profiles.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,0BAA0B,GAC3B,MAAM,eAAe,CAAC"}
@@ -1,12 +1,48 @@
1
- export interface CliProfile {
1
+ export interface ApiKeyCliProfile {
2
2
  apiKey: string;
3
3
  baseUrl?: string;
4
+ type?: "api_key";
4
5
  }
6
+ interface AgentProfileBase {
7
+ appApiBaseUrl: string;
8
+ authBaseUrl: string;
9
+ clientName?: string;
10
+ idempotencyKey: string;
11
+ mailboxLocalPart?: string;
12
+ sendingApiBaseUrl: string;
13
+ type: "agent";
14
+ }
15
+ export interface RegisteringAgentCliProfile extends AgentProfileBase {
16
+ state: "registering";
17
+ }
18
+ export interface ActiveAgentCliProfile extends AgentProfileBase {
19
+ accessToken: string;
20
+ mailboxEmail: string;
21
+ ownerInvite?: {
22
+ email: string;
23
+ idempotencyKey: string;
24
+ status: "dispatching" | "pending";
25
+ };
26
+ registrationId: string;
27
+ sendingToken?: {
28
+ accessToken: string;
29
+ expiresAt: string;
30
+ };
31
+ state: "active";
32
+ }
33
+ export type AgentCliProfile = ActiveAgentCliProfile | RegisteringAgentCliProfile;
34
+ export type CliProfile = AgentCliProfile | ApiKeyCliProfile;
5
35
  export interface CliConfig {
6
36
  defaultProfile?: string;
7
37
  profiles: Record<string, CliProfile>;
8
38
  }
9
39
  export declare function readCliConfig(configDir: string): Promise<CliConfig>;
10
- export declare function writeCliConfig(configDir: string, config: CliConfig): Promise<void>;
40
+ export declare function updateCliConfig<T>(configDir: string, update: (config: CliConfig) => T): Promise<T>;
41
+ export declare function reserveAgentRegistrationIntent(configDir: string, profileName: string, candidate: RegisteringAgentCliProfile): Promise<RegisteringAgentCliProfile>;
42
+ export declare function clearAgentRegistrationIntent(configDir: string, profileName: string): Promise<void>;
11
43
  export declare function configPath(configDir: string): string;
44
+ export declare function isAgentProfile(profile: CliProfile): profile is AgentCliProfile;
45
+ export declare function isApiKeyProfile(profile: CliProfile): profile is ApiKeyCliProfile;
46
+ export declare function isActiveAgentProfile(profile: CliProfile): profile is ActiveAgentCliProfile;
47
+ export {};
12
48
  //# sourceMappingURL=profiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM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