@keska/sandbox 0.46.2 → 0.47.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 (3) hide show
  1. package/dist/index.d.ts +390 -138
  2. package/dist/index.js +242 -461
  3. package/package.json +1 -2
package/dist/index.d.ts CHANGED
@@ -1605,15 +1605,11 @@ type Agent$2 = Message<"numen.sandbox.v1.Agent"> & {
1605
1605
  */
1606
1606
  activeSandboxId: string;
1607
1607
  /**
1608
- * Unset means true (provision a Matrix identity and a direct message).
1608
+ * Unset means true (provision a Matrix identity). Conversations are separate rooms.
1609
1609
  *
1610
1610
  * @generated from field: optional bool messaging = 9;
1611
1611
  */
1612
1612
  messaging?: boolean | undefined;
1613
- /**
1614
- * @generated from field: string matrix_room_id = 10;
1615
- */
1616
- matrixRoomId: string;
1617
1613
  /**
1618
1614
  * @generated from field: string template_id = 11;
1619
1615
  */
@@ -1626,6 +1622,19 @@ type Agent$2 = Message<"numen.sandbox.v1.Agent"> & {
1626
1622
  * @generated from field: string profile_id = 13;
1627
1623
  */
1628
1624
  profileId: string;
1625
+ /**
1626
+ * Shown to end users. Empty means name.
1627
+ *
1628
+ * @generated from field: string display_name = 14;
1629
+ */
1630
+ displayName: string;
1631
+ /**
1632
+ * End user this agent is for. Several agents may share one user_id.
1633
+ * Empty means the caller (a solo developer).
1634
+ *
1635
+ * @generated from field: string user_id = 15;
1636
+ */
1637
+ userId: string;
1629
1638
  };
1630
1639
  /**
1631
1640
  * Describes the message numen.sandbox.v1.Agent.
@@ -1650,12 +1659,190 @@ type CreateAgentRequest = Message<"numen.sandbox.v1.CreateAgentRequest"> & {
1650
1659
  * @generated from field: optional bool messaging = 4;
1651
1660
  */
1652
1661
  messaging?: boolean | undefined;
1662
+ /**
1663
+ * @generated from field: string user_id = 5;
1664
+ */
1665
+ userId: string;
1666
+ /**
1667
+ * @generated from field: string display_name = 6;
1668
+ */
1669
+ displayName: string;
1653
1670
  };
1654
1671
  /**
1655
1672
  * Describes the message numen.sandbox.v1.CreateAgentRequest.
1656
1673
  * Use `create(CreateAgentRequestSchema)` to create a new message.
1657
1674
  */
1658
1675
  declare const CreateAgentRequestSchema: GenMessage<CreateAgentRequest>;
1676
+ /**
1677
+ * @generated from message numen.sandbox.v1.Conversation
1678
+ */
1679
+ type Conversation$1 = Message<"numen.sandbox.v1.Conversation"> & {
1680
+ /**
1681
+ * @generated from field: string id = 1;
1682
+ */
1683
+ id: string;
1684
+ /**
1685
+ * @generated from field: string agent_id = 2;
1686
+ */
1687
+ agentId: string;
1688
+ /**
1689
+ * @generated from field: string user_id = 3;
1690
+ */
1691
+ userId: string;
1692
+ /**
1693
+ * @generated from field: string title = 4;
1694
+ */
1695
+ title: string;
1696
+ /**
1697
+ * @generated from field: google.protobuf.Timestamp created_at = 5;
1698
+ */
1699
+ createdAt?: Timestamp | undefined;
1700
+ };
1701
+ /**
1702
+ * Describes the message numen.sandbox.v1.Conversation.
1703
+ * Use `create(ConversationSchema)` to create a new message.
1704
+ */
1705
+ declare const ConversationSchema: GenMessage<Conversation$1>;
1706
+ /**
1707
+ * @generated from message numen.sandbox.v1.CreateConversationRequest
1708
+ */
1709
+ type CreateConversationRequest = Message<"numen.sandbox.v1.CreateConversationRequest"> & {
1710
+ /**
1711
+ * @generated from field: string agent_id = 1;
1712
+ */
1713
+ agentId: string;
1714
+ /**
1715
+ * @generated from field: string user_id = 2;
1716
+ */
1717
+ userId: string;
1718
+ /**
1719
+ * @generated from field: string title = 3;
1720
+ */
1721
+ title: string;
1722
+ };
1723
+ /**
1724
+ * Describes the message numen.sandbox.v1.CreateConversationRequest.
1725
+ * Use `create(CreateConversationRequestSchema)` to create a new message.
1726
+ */
1727
+ declare const CreateConversationRequestSchema: GenMessage<CreateConversationRequest>;
1728
+ /**
1729
+ * @generated from message numen.sandbox.v1.ListConversationsRequest
1730
+ */
1731
+ type ListConversationsRequest = Message<"numen.sandbox.v1.ListConversationsRequest"> & {
1732
+ /**
1733
+ * @generated from field: string agent_id = 1;
1734
+ */
1735
+ agentId: string;
1736
+ /**
1737
+ * @generated from field: string user_id = 2;
1738
+ */
1739
+ userId: string;
1740
+ /**
1741
+ * @generated from field: int32 page_size = 3;
1742
+ */
1743
+ pageSize: number;
1744
+ /**
1745
+ * @generated from field: string page_token = 4;
1746
+ */
1747
+ pageToken: string;
1748
+ };
1749
+ /**
1750
+ * Describes the message numen.sandbox.v1.ListConversationsRequest.
1751
+ * Use `create(ListConversationsRequestSchema)` to create a new message.
1752
+ */
1753
+ declare const ListConversationsRequestSchema: GenMessage<ListConversationsRequest>;
1754
+ /**
1755
+ * @generated from message numen.sandbox.v1.ListConversationsResponse
1756
+ */
1757
+ type ListConversationsResponse = Message<"numen.sandbox.v1.ListConversationsResponse"> & {
1758
+ /**
1759
+ * @generated from field: repeated numen.sandbox.v1.Conversation conversations = 1;
1760
+ */
1761
+ conversations: Conversation$1[];
1762
+ /**
1763
+ * @generated from field: string next_page_token = 2;
1764
+ */
1765
+ nextPageToken: string;
1766
+ };
1767
+ /**
1768
+ * Describes the message numen.sandbox.v1.ListConversationsResponse.
1769
+ * Use `create(ListConversationsResponseSchema)` to create a new message.
1770
+ */
1771
+ declare const ListConversationsResponseSchema: GenMessage<ListConversationsResponse>;
1772
+ /**
1773
+ * @generated from message numen.sandbox.v1.DeleteConversationRequest
1774
+ */
1775
+ type DeleteConversationRequest = Message<"numen.sandbox.v1.DeleteConversationRequest"> & {
1776
+ /**
1777
+ * @generated from field: string id = 1;
1778
+ */
1779
+ id: string;
1780
+ };
1781
+ /**
1782
+ * Describes the message numen.sandbox.v1.DeleteConversationRequest.
1783
+ * Use `create(DeleteConversationRequestSchema)` to create a new message.
1784
+ */
1785
+ declare const DeleteConversationRequestSchema: GenMessage<DeleteConversationRequest>;
1786
+ /**
1787
+ * @generated from message numen.sandbox.v1.LoginToken
1788
+ */
1789
+ type LoginToken$1 = Message<"numen.sandbox.v1.LoginToken"> & {
1790
+ /**
1791
+ * @generated from field: string token = 1;
1792
+ */
1793
+ token: string;
1794
+ /**
1795
+ * @generated from field: google.protobuf.Timestamp expires_at = 2;
1796
+ */
1797
+ expiresAt?: Timestamp | undefined;
1798
+ };
1799
+ /**
1800
+ * Describes the message numen.sandbox.v1.LoginToken.
1801
+ * Use `create(LoginTokenSchema)` to create a new message.
1802
+ */
1803
+ declare const LoginTokenSchema: GenMessage<LoginToken$1>;
1804
+ /**
1805
+ * @generated from message numen.sandbox.v1.CreateLoginTokenRequest
1806
+ */
1807
+ type CreateLoginTokenRequest = Message<"numen.sandbox.v1.CreateLoginTokenRequest"> & {
1808
+ /**
1809
+ * @generated from field: string user_id = 1;
1810
+ */
1811
+ userId: string;
1812
+ };
1813
+ /**
1814
+ * Describes the message numen.sandbox.v1.CreateLoginTokenRequest.
1815
+ * Use `create(CreateLoginTokenRequestSchema)` to create a new message.
1816
+ */
1817
+ declare const CreateLoginTokenRequestSchema: GenMessage<CreateLoginTokenRequest>;
1818
+ /**
1819
+ * @generated from message numen.sandbox.v1.RevokeEndUserRequest
1820
+ */
1821
+ type RevokeEndUserRequest = Message<"numen.sandbox.v1.RevokeEndUserRequest"> & {
1822
+ /**
1823
+ * @generated from field: string user_id = 1;
1824
+ */
1825
+ userId: string;
1826
+ };
1827
+ /**
1828
+ * Describes the message numen.sandbox.v1.RevokeEndUserRequest.
1829
+ * Use `create(RevokeEndUserRequestSchema)` to create a new message.
1830
+ */
1831
+ declare const RevokeEndUserRequestSchema: GenMessage<RevokeEndUserRequest>;
1832
+ /**
1833
+ * @generated from message numen.sandbox.v1.DeleteEndUserRequest
1834
+ */
1835
+ type DeleteEndUserRequest = Message<"numen.sandbox.v1.DeleteEndUserRequest"> & {
1836
+ /**
1837
+ * @generated from field: string user_id = 1;
1838
+ */
1839
+ userId: string;
1840
+ };
1841
+ /**
1842
+ * Describes the message numen.sandbox.v1.DeleteEndUserRequest.
1843
+ * Use `create(DeleteEndUserRequestSchema)` to create a new message.
1844
+ */
1845
+ declare const DeleteEndUserRequestSchema: GenMessage<DeleteEndUserRequest>;
1659
1846
  /**
1660
1847
  * @generated from message numen.sandbox.v1.BindAgentSecretRequest
1661
1848
  */
@@ -3866,6 +4053,54 @@ declare const SandboxService: GenService<{
3866
4053
  input: typeof DeleteMatrixSessionRequestSchema;
3867
4054
  output: typeof EmptySchema;
3868
4055
  };
4056
+ /**
4057
+ * @generated from rpc numen.sandbox.v1.SandboxService.CreateConversation
4058
+ */
4059
+ createConversation: {
4060
+ methodKind: "unary";
4061
+ input: typeof CreateConversationRequestSchema;
4062
+ output: typeof ConversationSchema;
4063
+ };
4064
+ /**
4065
+ * @generated from rpc numen.sandbox.v1.SandboxService.ListConversations
4066
+ */
4067
+ listConversations: {
4068
+ methodKind: "unary";
4069
+ input: typeof ListConversationsRequestSchema;
4070
+ output: typeof ListConversationsResponseSchema;
4071
+ };
4072
+ /**
4073
+ * @generated from rpc numen.sandbox.v1.SandboxService.DeleteConversation
4074
+ */
4075
+ deleteConversation: {
4076
+ methodKind: "unary";
4077
+ input: typeof DeleteConversationRequestSchema;
4078
+ output: typeof EmptySchema;
4079
+ };
4080
+ /**
4081
+ * @generated from rpc numen.sandbox.v1.SandboxService.CreateLoginToken
4082
+ */
4083
+ createLoginToken: {
4084
+ methodKind: "unary";
4085
+ input: typeof CreateLoginTokenRequestSchema;
4086
+ output: typeof LoginTokenSchema;
4087
+ };
4088
+ /**
4089
+ * @generated from rpc numen.sandbox.v1.SandboxService.RevokeEndUser
4090
+ */
4091
+ revokeEndUser: {
4092
+ methodKind: "unary";
4093
+ input: typeof RevokeEndUserRequestSchema;
4094
+ output: typeof EmptySchema;
4095
+ };
4096
+ /**
4097
+ * @generated from rpc numen.sandbox.v1.SandboxService.DeleteEndUser
4098
+ */
4099
+ deleteEndUser: {
4100
+ methodKind: "unary";
4101
+ input: typeof DeleteEndUserRequestSchema;
4102
+ output: typeof EmptySchema;
4103
+ };
3869
4104
  /**
3870
4105
  * @generated from rpc numen.sandbox.v1.SandboxService.CreateHTTPGrant
3871
4106
  */
@@ -4250,7 +4485,8 @@ type Agent$1 = {
4250
4485
  /** Sandbox this agent is attached to now. Empty when it has none. */
4251
4486
  activeSandboxId: string;
4252
4487
  messaging: boolean;
4253
- matrixRoomId: string;
4488
+ userId: string;
4489
+ displayName: string;
4254
4490
  templateId: string;
4255
4491
  image: string;
4256
4492
  profileId: string;
@@ -4259,6 +4495,23 @@ type AgentList = {
4259
4495
  agents: Agent$1[];
4260
4496
  nextPageToken: string;
4261
4497
  };
4498
+ /** One conversation room. */
4499
+ type Conversation = {
4500
+ id: string;
4501
+ agentId: string;
4502
+ userId: string;
4503
+ title: string;
4504
+ createdAt: string;
4505
+ };
4506
+ type ConversationList = {
4507
+ conversations: Conversation[];
4508
+ nextPageToken: string;
4509
+ };
4510
+ /** Short-lived login JWT. The app exchanges it at the homeserver. */
4511
+ type LoginToken = {
4512
+ token: string;
4513
+ expiresAt: string;
4514
+ };
4262
4515
  /** Short-lived Matrix device for an SDK process (CreateMatrixSession). */
4263
4516
  type MatrixSession = {
4264
4517
  homeserver: string;
@@ -4822,6 +5075,8 @@ declare class Session {
4822
5075
  createAgent(name: string, opts?: CallOpts & {
4823
5076
  templateId?: string;
4824
5077
  messaging?: boolean;
5078
+ userId?: string;
5079
+ displayName?: string;
4825
5080
  }): Promise<Agent$1>;
4826
5081
  getAgent(id?: string, opts?: CallOpts & {
4827
5082
  name?: string;
@@ -4832,6 +5087,20 @@ declare class Session {
4832
5087
  messaging?: boolean;
4833
5088
  }): Promise<AgentList>;
4834
5089
  deleteAgent(id: string, opts?: CallOpts): Promise<void>;
5090
+ createConversation(agentId: string, opts?: CallOpts & {
5091
+ userId?: string;
5092
+ title?: string;
5093
+ }): Promise<Conversation>;
5094
+ listConversations(opts?: CallOpts & {
5095
+ agentId?: string;
5096
+ userId?: string;
5097
+ pageSize?: number;
5098
+ pageToken?: string;
5099
+ }): Promise<ConversationList>;
5100
+ deleteConversation(id: string, opts?: CallOpts): Promise<void>;
5101
+ createLoginToken(userId: string, opts?: CallOpts): Promise<LoginToken>;
5102
+ revokeEndUser(userId: string, opts?: CallOpts): Promise<void>;
5103
+ deleteEndUser(userId: string, opts?: CallOpts): Promise<void>;
4835
5104
  bindAgentSecret(agentId: string, envName: string, secretName: string, opts?: CallOpts): Promise<Agent$1>;
4836
5105
  unbindAgentSecret(agentId: string, envName: string, opts?: CallOpts): Promise<Agent$1>;
4837
5106
  createMatrixSession(opts?: CallOpts): Promise<MatrixSession>;
@@ -4967,108 +5236,6 @@ declare class GuestHttp$1 {
4967
5236
  websocket(path?: string): Promise<WebSocket>;
4968
5237
  }
4969
5238
 
4970
- type RawEvent = {
4971
- type?: string;
4972
- event_id?: string;
4973
- sender?: string;
4974
- origin_server_ts?: number;
4975
- content?: Record<string, unknown>;
4976
- };
4977
- type SyncBody = {
4978
- next_batch?: string;
4979
- rooms?: {
4980
- join?: Record<string, {
4981
- timeline?: {
4982
- events?: RawEvent[];
4983
- prev_batch?: string;
4984
- };
4985
- }>;
4986
- };
4987
- };
4988
- interface RoomIO {
4989
- send(roomId: string, content: Record<string, unknown>): Promise<string>;
4990
- messages(roomId: string, fromToken: string, limit: number): Promise<{
4991
- chunk: RawEvent[];
4992
- end: string;
4993
- }>;
4994
- sync(since: string | null, timeoutMs: number): Promise<SyncBody>;
4995
- /**
4996
- * Optional first window for history: this room's recent message timeline
4997
- * only. A plain `sync(null, 0)` on a fresh device is an initial sync over
4998
- * every joined room, which takes seconds; implementations that can scope
4999
- * the request to one room should.
5000
- */
5001
- historyWindow?(roomId: string, limit: number): Promise<SyncBody>;
5002
- close(): void;
5003
- }
5004
-
5005
- /** Agent DM timeline and live-stream event shapes. */
5006
-
5007
- type SenderKind = "agent" | "user" | "unknown";
5008
- /** One text message in the agent DM. */
5009
- type MessageEvent = {
5010
- /** Discriminator; always `"message"`. */
5011
- type: "message";
5012
- /** Message body. */
5013
- content: string;
5014
- /** Matrix user id of the sender. */
5015
- sender: string;
5016
- /** Matrix event id. */
5017
- eventId: string;
5018
- /** Server timestamp in milliseconds. */
5019
- ts: number;
5020
- /** Whether the sender is the agent, the portal user, or unknown. */
5021
- senderKind?: SenderKind;
5022
- /** Human-readable sender label when known. */
5023
- senderLabel?: string;
5024
- /** Set when an agent posted a protocol final. */
5025
- isFinal?: boolean;
5026
- /** Agent final tied to a human trigger, when present on the Matrix event. */
5027
- triggerEventId?: string;
5028
- };
5029
-
5030
- /** Display labels for Matrix senders on agent message events. */
5031
-
5032
- type SenderLabelContext = {
5033
- agentMatrixUserId?: string;
5034
- agentName?: string;
5035
- projectUserId?: string;
5036
- };
5037
-
5038
- /** One sync pump per Client; room subscriptions receive live messaging events. */
5039
-
5040
- declare class RoomSyncPump {
5041
- private readonly io;
5042
- private since;
5043
- private primed;
5044
- private running;
5045
- private stopped;
5046
- private readonly rooms;
5047
- private readonly seenByRoom;
5048
- constructor(io: RoomIO);
5049
- subscribe(roomId: string, labels: SenderLabelContext): MessageSubscription;
5050
- unsubscribe(sub: MessageSubscription, roomId: string): void;
5051
- stop(): void;
5052
- private hasSubscribers;
5053
- private ensurePrimed;
5054
- private seen;
5055
- private deliver;
5056
- private loop;
5057
- take(sub: MessageSubscription, roomId: string): MessageEvent | undefined;
5058
- waitFor(sub: MessageSubscription, roomId: string): Promise<void>;
5059
- isOpen(sub: MessageSubscription, roomId: string): boolean;
5060
- }
5061
- /** Live messaging events for one room. Start before `post()` so fast replies are not missed. */
5062
- declare class MessageSubscription {
5063
- private readonly pump;
5064
- private readonly roomId;
5065
- constructor(pump: RoomSyncPump, roomId: string);
5066
- /** Stop receiving events. */
5067
- close(): void;
5068
- /** Iterate live agent messages until {@link MessageSubscription.close}. */
5069
- [Symbol.asyncIterator](): AsyncIterator<MessageEvent>;
5070
- }
5071
-
5072
5239
  type TimeoutOpts = {
5073
5240
  timeout?: number;
5074
5241
  signal?: AbortSignal;
@@ -5126,6 +5293,8 @@ declare class Agents$1 {
5126
5293
  create(name: string, opts?: {
5127
5294
  template?: string;
5128
5295
  messaging?: boolean;
5296
+ userId?: string;
5297
+ displayName?: string;
5129
5298
  } & TimeoutOpts): Promise<Agent$1>;
5130
5299
  /** Get by name. */
5131
5300
  getByName(name: string, opts?: TimeoutOpts): Promise<Agent$1>;
@@ -5143,6 +5312,44 @@ declare class Agents$1 {
5143
5312
  /** Remove one binding. Fails with reason `AGENT_BUSY` while a sandbox is live. */
5144
5313
  unbindSecret(id: string, envName: string, opts?: TimeoutOpts): Promise<Agent$1>;
5145
5314
  }
5315
+ /** Conversation rooms for the project's agents. */
5316
+ declare class Conversations$1 {
5317
+ private readonly wire;
5318
+ /** Create the handle. */
5319
+ constructor(wire: Session);
5320
+ /** Open a room. `userId` is required when the agent is not bound to one. */
5321
+ create(agentId: string, opts?: {
5322
+ userId?: string;
5323
+ title?: string;
5324
+ } & TimeoutOpts): Promise<Conversation>;
5325
+ /** List, newest activity first. Pass an agent id or an end-user id. */
5326
+ list(opts?: {
5327
+ agentId?: string;
5328
+ userId?: string;
5329
+ pageSize?: number;
5330
+ pageToken?: string;
5331
+ } & TimeoutOpts): Promise<ConversationList>;
5332
+ /** Delete one room. */
5333
+ delete(id: string, opts?: TimeoutOpts): Promise<void>;
5334
+ }
5335
+ /** Login JWTs for end-user apps. */
5336
+ declare class Tokens$1 {
5337
+ private readonly wire;
5338
+ /** Create the handle. */
5339
+ constructor(wire: Session);
5340
+ /** Mint a login JWT. An empty user id uses the authenticated subject. */
5341
+ create(userId?: string, opts?: TimeoutOpts): Promise<LoginToken>;
5342
+ }
5343
+ /** End users shared by every agent in the project. */
5344
+ declare class EndUsers$1 {
5345
+ private readonly wire;
5346
+ /** Create the handle. */
5347
+ constructor(wire: Session);
5348
+ /** Revoke every Matrix device of this end user. */
5349
+ revoke(userId: string, opts?: TimeoutOpts): Promise<void>;
5350
+ /** Deactivate the Matrix user and erase their devices. */
5351
+ delete(userId: string, opts?: TimeoutOpts): Promise<void>;
5352
+ }
5146
5353
  /** Platform names and project images. */
5147
5354
  declare class Images$1 {
5148
5355
  private readonly wire;
@@ -5332,6 +5539,12 @@ declare class Client$1 {
5332
5539
  readonly secrets: Secrets$1;
5333
5540
  /** Agents. */
5334
5541
  readonly agents: Agents$1;
5542
+ /** Conversation rooms. */
5543
+ readonly conversations: Conversations$1;
5544
+ /** End-user login JWTs. */
5545
+ readonly tokens: Tokens$1;
5546
+ /** End users across every agent. */
5547
+ readonly endUsers: EndUsers$1;
5335
5548
  /** Images. */
5336
5549
  readonly images: Images$1;
5337
5550
  /** Snapshots. */
@@ -5372,20 +5585,6 @@ declare class Client$1 {
5372
5585
  listImagesIter(opts?: Omit<NonNullable<Parameters<Images$1["list"]>[0]>, "pageToken">): AsyncGenerator<Image>;
5373
5586
  }
5374
5587
 
5375
- /** Bounded message history snapshots from Matrix. */
5376
-
5377
- declare const UNLIMITED$1: number;
5378
- type HistoryOptions = {
5379
- /** Maximum eligible text messages. Default 50. */
5380
- limit?: number;
5381
- /** Present newest messages first. Default oldest first. */
5382
- newestFirst?: boolean;
5383
- /** Overall fetch deadline in seconds. Default 180. */
5384
- timeout?: number | typeof UNLIMITED$1;
5385
- /** @internal Resolved by `Agent.history`. */
5386
- labels?: SenderLabelContext;
5387
- };
5388
-
5389
5588
  /** Arguments for `Sandbox.create`. Fields say what omit means. */
5390
5589
  type SandboxCreateParams$1 = {
5391
5590
  /** Guest rootfs. Required. Platform aliases such as `numen/base` resolve on the control plane. */
@@ -5901,7 +6100,6 @@ declare function remove(path: string, recursive?: boolean): Remove;
5901
6100
  type FileOp = Write | Mkdir | Remove;
5902
6101
  /** One agent. One sandbox. Sleep stops the process you started. */
5903
6102
  declare class Agent {
5904
- #private;
5905
6103
  private readonly client;
5906
6104
  /** Agent id. */
5907
6105
  readonly id: string;
@@ -5915,6 +6113,10 @@ declare class Agent {
5915
6113
  activeSandboxId: string;
5916
6114
  /** False when this agent has no Matrix identity. */
5917
6115
  messaging: boolean;
6116
+ /** End user this agent is bound to. Empty means each conversation names its own. */
6117
+ userId: string;
6118
+ /** What end users see. Empty shows `name`. */
6119
+ displayName: string;
5918
6120
  /** Template this agent was copied from. */
5919
6121
  templateId: string;
5920
6122
  /** Image copied from the template. */
@@ -5935,13 +6137,14 @@ declare class Agent {
5935
6137
  newSandbox(opts?: Omit<SandboxCreateParams, "agentId" | "image"> & {
5936
6138
  image?: string;
5937
6139
  }): Promise<Sandbox>;
5938
- private requireMessaging;
5939
- /** Post plain text to this agent's DM. */
5940
- sendMessage(body: string): Promise<string>;
5941
- /** Live DM events. Call before `sendMessage` when you need to catch a fast reply. */
5942
- subscribe(): Promise<MessageSubscription>;
5943
- /** Bounded snapshot of DM text messages. */
5944
- history(opts?: HistoryOptions): AsyncGenerator<MessageEvent>;
6140
+ /** Chat goes through agent-kit. This client creates conversations and login tokens. */
6141
+ sendMessage(_body: string): Promise<string>;
6142
+ /** Chat goes through agent-kit. */
6143
+ subscribe(): Promise<never>;
6144
+ /** Chat goes through agent-kit. */
6145
+ history(): AsyncGenerator<never>;
6146
+ /** Messaging off is reported first. A messaging agent still chats through agent-kit. */
6147
+ private chatElsewhere;
5945
6148
  }
5946
6149
  /** Copied onto an agent at create. Later edits do not change existing agents. */
5947
6150
  declare class Template {
@@ -6009,6 +6212,8 @@ declare class Agents {
6009
6212
  create(name: string, opts?: {
6010
6213
  template?: string;
6011
6214
  messaging?: boolean;
6215
+ userId?: string;
6216
+ displayName?: string;
6012
6217
  timeout?: Timeout;
6013
6218
  }): Promise<Agent>;
6014
6219
  getByName(name: string, opts?: {
@@ -6026,6 +6231,52 @@ declare class Agents {
6026
6231
  timeout?: Timeout;
6027
6232
  }): Promise<void>;
6028
6233
  }
6234
+ /** Rooms between an agent and one end user. */
6235
+ declare class Conversations {
6236
+ private readonly client;
6237
+ constructor(client: Client);
6238
+ /** Open a room. Pass an agent id or an Agent. */
6239
+ create(agent: Agent | string, opts?: {
6240
+ userId?: string;
6241
+ title?: string;
6242
+ timeout?: Timeout;
6243
+ }): Promise<Conversation>;
6244
+ /** Newest activity first. Pass an agent or an end-user id. */
6245
+ list(opts?: {
6246
+ agent?: Agent | string;
6247
+ userId?: string;
6248
+ pageSize?: number;
6249
+ pageToken?: string;
6250
+ timeout?: Timeout;
6251
+ }): Promise<ConversationList>;
6252
+ /** Delete one room. */
6253
+ delete(id: string, opts?: {
6254
+ missingOk?: boolean;
6255
+ timeout?: Timeout;
6256
+ }): Promise<void>;
6257
+ }
6258
+ /** Login JWTs. The caller exchanges the token at the homeserver. */
6259
+ declare class Tokens {
6260
+ private readonly client;
6261
+ constructor(client: Client);
6262
+ /** Mint a login JWT. An empty user id uses the authenticated subject. */
6263
+ create(userId?: string, opts?: {
6264
+ timeout?: Timeout;
6265
+ }): Promise<LoginToken>;
6266
+ }
6267
+ /** One end user across every agent in the project. */
6268
+ declare class EndUsers {
6269
+ private readonly client;
6270
+ constructor(client: Client);
6271
+ /** Revoke every Matrix device of this end user. */
6272
+ revoke(userId: string, opts?: {
6273
+ timeout?: Timeout;
6274
+ }): Promise<void>;
6275
+ /** Deactivate the Matrix user. */
6276
+ delete(userId: string, opts?: {
6277
+ timeout?: Timeout;
6278
+ }): Promise<void>;
6279
+ }
6029
6280
  /** Where to connect. */
6030
6281
  type ClientOptions = {
6031
6282
  /** Control plane URL. Omit to use credentials, then the default cloud URL. */
@@ -6055,6 +6306,12 @@ declare class Client {
6055
6306
  readonly secrets: Secrets;
6056
6307
  /** Matrix agents. */
6057
6308
  readonly agents: Agents;
6309
+ /** Conversation rooms. */
6310
+ readonly conversations: Conversations;
6311
+ /** End-user login JWTs. */
6312
+ readonly tokens: Tokens;
6313
+ /** End users across every agent. */
6314
+ readonly endUsers: EndUsers;
6058
6315
  /** Platform and project images. */
6059
6316
  readonly images: Images;
6060
6317
  /** Filesystem snapshots. */
@@ -6066,12 +6323,7 @@ declare class Client {
6066
6323
  /** Create, list, and open sandboxes. */
6067
6324
  readonly sandboxes: Sandboxes;
6068
6325
  constructor(opts?: ClientOptions);
6069
- private matrix;
6070
- /** The Matrix client for send and receive. One device for this process. */
6071
- room(): Promise<RoomIO>;
6072
- /** @internal Matrix user id for the live SDK session. */
6073
- matrixUserId(): Promise<string>;
6074
- /** Close the connection and log out this process's Matrix device. */
6326
+ /** Close the connection. */
6075
6327
  close(): void;
6076
6328
  /** `using` calls this. */
6077
6329
  [Symbol.dispose](): void;
@@ -6683,6 +6935,6 @@ type GuestHttp = GuestHttp$1;
6683
6935
  /** Body returned by `GuestHttp.get` and `GuestHttp.post`. */
6684
6936
  type GuestResponse = GuestResponse$1;
6685
6937
 
6686
- declare const publicExports: readonly ["Agent", "Template", "MessageSubscription", "AuthenticationError", "CapacityError", "Client", "CommandFailedError", "CommandTimeoutError", "CommandTooLargeError", "ConflictError", "DirectoryNotEmptyError", "ExecutableNotFoundError", "FileExistsError", "FileTooLargeError", "GuestRuntimeDeadError", "ImageTimeoutError", "InvalidArgumentError", "InvalidPathError", "Mkdir", "UNLIMITED", "NameTakenError", "NotFoundError", "Page", "PathNotFoundError", "PageExhaustedError", "PermissionDeniedError", "PortNotOpenError", "ProcessHandle", "Profile", "ResourceInUseError", "ResourcePolicy", "SecurityPolicy", "ProcessNotFoundError", "ProcessWaitTimeoutError", "Remove", "Sandbox", "SandboxConflictError", "SandboxError", "SandboxNotFoundError", "SandboxNotReadyError", "SandboxSleepingError", "SandboxStateError", "LogStream", "SandboxStatus", "SandboxWaitTimeoutError", "SandboxTimeoutError", "TimeoutError", "UnavailableError", "Write", "mkdir", "publicExports", "remove", "write"];
6938
+ declare const publicExports: readonly ["Agent", "Template", "AuthenticationError", "CapacityError", "Client", "CommandFailedError", "CommandTimeoutError", "CommandTooLargeError", "ConflictError", "DirectoryNotEmptyError", "ExecutableNotFoundError", "FileExistsError", "FileTooLargeError", "GuestRuntimeDeadError", "ImageTimeoutError", "InvalidArgumentError", "InvalidPathError", "Mkdir", "UNLIMITED", "NameTakenError", "NotFoundError", "Page", "PathNotFoundError", "PageExhaustedError", "PermissionDeniedError", "PortNotOpenError", "ProcessHandle", "Profile", "ResourceInUseError", "ResourcePolicy", "SecurityPolicy", "ProcessNotFoundError", "ProcessWaitTimeoutError", "Remove", "Sandbox", "SandboxConflictError", "SandboxError", "SandboxNotFoundError", "SandboxNotReadyError", "SandboxSleepingError", "SandboxStateError", "LogStream", "SandboxStatus", "SandboxWaitTimeoutError", "SandboxTimeoutError", "TimeoutError", "UnavailableError", "Write", "mkdir", "publicExports", "remove", "write"];
6687
6939
 
6688
- export { Agent, AuthenticationError, CapacityError, Client, type ClientOptions, CommandFailedError, CommandTimeoutError, CommandTooLargeError, ConflictError, DirectoryNotEmptyError, type ExecBytesResult, type ExecResult, ExecutableNotFoundError, FileExistsError, type FileInfo, type FileList, FileTooLargeError, type GuestHttp, type GuestResponse, GuestRuntimeDeadError, type HTTPGrant, type Image, type ImageKind, ImageTimeoutError, InvalidArgumentError, InvalidPathError, type LogEntry, LogStream, type MessageEvent, MessageSubscription, Mkdir, NameTakenError, NotFoundError, Page, PageExhaustedError, PathNotFoundError, PermissionDeniedError, PortNotOpenError, type Process, ProcessHandle, ProcessNotFoundError, ProcessWaitTimeoutError, Profile, Remove, ResourceInUseError, ResourcePolicy, type Resources, Sandbox, SandboxConflictError, type SandboxCreateParams, SandboxError, type SandboxInfo, SandboxNotFoundError, SandboxNotReadyError, type SandboxRow, SandboxSleepingError, SandboxStateError, SandboxStatus, SandboxTimeoutError, SandboxWaitTimeoutError, type Secret, SecurityPolicy, type Snapshot, type StreamChunk, Template, TimeoutError, UNLIMITED, UnavailableError, type Volume, Write, mkdir, publicExports, remove, write };
6940
+ export { Agent, AuthenticationError, CapacityError, Client, type ClientOptions, CommandFailedError, CommandTimeoutError, CommandTooLargeError, ConflictError, DirectoryNotEmptyError, type ExecBytesResult, type ExecResult, ExecutableNotFoundError, FileExistsError, type FileInfo, type FileList, FileTooLargeError, type GuestHttp, type GuestResponse, GuestRuntimeDeadError, type HTTPGrant, type Image, type ImageKind, ImageTimeoutError, InvalidArgumentError, InvalidPathError, type LogEntry, LogStream, Mkdir, NameTakenError, NotFoundError, Page, PageExhaustedError, PathNotFoundError, PermissionDeniedError, PortNotOpenError, type Process, ProcessHandle, ProcessNotFoundError, ProcessWaitTimeoutError, Profile, Remove, ResourceInUseError, ResourcePolicy, type Resources, Sandbox, SandboxConflictError, type SandboxCreateParams, SandboxError, type SandboxInfo, SandboxNotFoundError, SandboxNotReadyError, type SandboxRow, SandboxSleepingError, SandboxStateError, SandboxStatus, SandboxTimeoutError, SandboxWaitTimeoutError, type Secret, SecurityPolicy, type Snapshot, type StreamChunk, Template, TimeoutError, UNLIMITED, UnavailableError, type Volume, Write, mkdir, publicExports, remove, write };