From dd7118001583ef39301d207d66dabc5bf2840ce8 Mon Sep 17 00:00:00 2001 From: Ray Liao <17989965+rayruizhiliao@users.noreply.github.com> Date: Sat, 14 Mar 2026 23:42:23 -0400 Subject: [PATCH 1/2] fix: agent handle for mailbox creation --- typescript/src/agent_identity.ts | 19 +++++++++++++------ typescript/src/mail/resources/mailboxes.ts | 7 ++++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/typescript/src/agent_identity.ts b/typescript/src/agent_identity.ts index 4635712..bbe0786 100644 --- a/typescript/src/agent_identity.ts +++ b/typescript/src/agent_identity.ts @@ -58,13 +58,20 @@ export class AgentIdentity { * @returns The newly created and linked {@link IdentityMailbox}. */ async createMailbox(options: { displayName?: string } = {}): Promise { - const mailbox = await this._inkbox._mailboxes.create(options); - const data = await this._inkbox._idsResource.assignMailbox(this.agentHandle, { - mailboxId: mailbox.id, + const mailbox = await this._inkbox._mailboxes.create({ + agentHandle: this.agentHandle, + ...options, }); - this._mailbox = data.mailbox; - this._data = data; - return this._mailbox!; + const linked: IdentityMailbox = { + id: mailbox.id, + emailAddress: mailbox.emailAddress, + displayName: mailbox.displayName, + status: mailbox.status, + createdAt: mailbox.createdAt, + updatedAt: mailbox.updatedAt, + }; + this._mailbox = linked; + return linked; } /** diff --git a/typescript/src/mail/resources/mailboxes.ts b/typescript/src/mail/resources/mailboxes.ts index f7ea312..b271425 100644 --- a/typescript/src/mail/resources/mailboxes.ts +++ b/typescript/src/mail/resources/mailboxes.ts @@ -21,14 +21,15 @@ export class MailboxesResource { constructor(private readonly http: HttpTransport) {} /** - * Create a new mailbox. + * Create a new mailbox and link it to an agent identity. * * The email address is automatically generated by the server. * + * @param options.agentHandle - Handle of the agent identity to assign this mailbox to. * @param options.displayName - Optional human-readable name shown as the sender. */ - async create(options: { displayName?: string } = {}): Promise { - const body: Record = {}; + async create(options: { agentHandle: string; displayName?: string }): Promise { + const body: Record = { agent_handle: options.agentHandle }; if (options.displayName !== undefined) { body["display_name"] = options.displayName; } From 4d162dda7a03bfec06dea7aefedfdc70e64e767e Mon Sep 17 00:00:00 2001 From: Ray Liao <17989965+rayruizhiliao@users.noreply.github.com> Date: Sat, 14 Mar 2026 23:47:53 -0400 Subject: [PATCH 2/2] bumping version --- python/pyproject.toml | 2 +- typescript/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 131847f..8fa62a2 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "inkbox" -version = "0.1.0" +version = "0.1.1" description = "Python SDK for the Inkbox API" readme = "README.md" requires-python = ">=3.11" diff --git a/typescript/package.json b/typescript/package.json index eba371a..d798666 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@inkbox/sdk", - "version": "0.1.0", + "version": "0.1.1", "description": "TypeScript SDK for the Inkbox API", "license": "MIT", "type": "module",