@jsm-mit/chat-motoko-package 0.1.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 +50 -0
  2. package/declarations/chat-motoko-backend/chat-motoko-backend.did +275 -0
  3. package/declarations/chat-motoko-backend/chat-motoko-backend.did.d.ts +197 -0
  4. package/declarations/chat-motoko-backend/chat-motoko-backend.did.js +198 -0
  5. package/declarations/chat-motoko-backend/index.d.ts +50 -0
  6. package/declarations/chat-motoko-backend/index.js +42 -0
  7. package/dist/actor-base.d.ts +47 -0
  8. package/dist/actor-base.d.ts.map +1 -0
  9. package/dist/actor-base.js +130 -0
  10. package/dist/actors/admin-actor.d.ts +61 -0
  11. package/dist/actors/admin-actor.d.ts.map +1 -0
  12. package/dist/actors/admin-actor.js +82 -0
  13. package/dist/actors/chats-actor.d.ts +77 -0
  14. package/dist/actors/chats-actor.d.ts.map +1 -0
  15. package/dist/actors/chats-actor.js +120 -0
  16. package/dist/actors/messages-actor.d.ts +43 -0
  17. package/dist/actors/messages-actor.d.ts.map +1 -0
  18. package/dist/actors/messages-actor.js +80 -0
  19. package/dist/actors/projects-actor.d.ts +38 -0
  20. package/dist/actors/projects-actor.d.ts.map +1 -0
  21. package/dist/actors/projects-actor.js +64 -0
  22. package/dist/chat-poller.d.ts +36 -0
  23. package/dist/chat-poller.d.ts.map +1 -0
  24. package/dist/chat-poller.js +82 -0
  25. package/dist/globals.d.ts +2 -0
  26. package/dist/globals.d.ts.map +1 -0
  27. package/dist/globals.js +1 -0
  28. package/dist/index.d.ts +10 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +7 -0
  31. package/dist/interfaces.d.ts +149 -0
  32. package/dist/interfaces.d.ts.map +1 -0
  33. package/dist/interfaces.js +6 -0
  34. package/dist/mappers.d.ts +17 -0
  35. package/dist/mappers.d.ts.map +1 -0
  36. package/dist/mappers.js +109 -0
  37. package/package.json +61 -0
@@ -0,0 +1,77 @@
1
+ import { type Identity } from "@icp-sdk/core/agent";
2
+ import { ActorBase } from "../actor-base.js";
3
+ import type { ChatView, CreateChatInput, GetMyChatsInput, InviteMemberInput, PolicyView, RemoveMemberInput } from "../interfaces.js";
4
+ /** 1:1 wrapper for the canister's ChatsController — rooms, members, roles and policy. */
5
+ export declare class ChatsActor extends ActorBase {
6
+ constructor(canisterId: string, identity?: Identity);
7
+ /**
8
+ * Creates a chat: the caller becomes `owner`, the project's agents join as `agent`, the
9
+ * canister writes the `chatCreated` event and — when given — the first text message,
10
+ * all in one call.
11
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound` for the project, `InvalidData` for members/lengths/quotas). Examine "cause" for {errorKey, errorMessage, logs}.
12
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
13
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
14
+ */
15
+ createChatAsyncUnsafe(input: CreateChatInput): Promise<ChatView>;
16
+ /**
17
+ * Adds a member. Owner/admin members, project admins, canister admins — and agent
18
+ * members when the project allows it (agents may only add `member`s).
19
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `AlreadyExists`, `InvalidData` for a closed chat / anonymous / limit). Examine "cause" for {errorKey, errorMessage, logs}.
20
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
21
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
22
+ */
23
+ inviteMemberAsyncUnsafe(input: InviteMemberInput): Promise<ChatView>;
24
+ /**
25
+ * Removes somebody else; an owner can be removed only by a project admin.
26
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for self-removal / closed chat). Examine "cause" for {errorKey, errorMessage, logs}.
27
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
28
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
29
+ */
30
+ removeMemberAsyncUnsafe(input: RemoveMemberInput): Promise<ChatView>;
31
+ /**
32
+ * Leaves the chat. The last owner/admin of an open chat cannot leave — close it instead.
33
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for the last manager). Examine "cause" for {errorKey, errorMessage, logs}.
34
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
35
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
36
+ */
37
+ leaveChatAsyncUnsafe(chatId: string): Promise<boolean>;
38
+ /**
39
+ * Changes the policy agents read (e.g. `agentsReply: false` to hand the chat to a human).
40
+ * Same callers as inviteMember.
41
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for a closed chat). Examine "cause" for {errorKey, errorMessage, logs}.
42
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
43
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
44
+ */
45
+ setPolicyAsyncUnsafe(chatId: string, policy: PolicyView): Promise<ChatView>;
46
+ /**
47
+ * Closes the chat for good (no more posts or membership changes). Owner/admin members,
48
+ * project admins, canister admins — not agents.
49
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` when already closed). Examine "cause" for {errorKey, errorMessage, logs}.
50
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
51
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
52
+ */
53
+ closeChatAsyncUnsafe(chatId: string): Promise<ChatView>;
54
+ /**
55
+ * Deletes the chat and every message of it. Canister admin only; irreversible — the
56
+ * erasure path for personal data.
57
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
58
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
59
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
60
+ */
61
+ purgeChatAsyncUnsafe(chatId: string): Promise<boolean>;
62
+ /**
63
+ * One chat with its members. Members, project admins, canister admins.
64
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
65
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
66
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
67
+ */
68
+ getChatAsyncUnsafe(chatId: string): Promise<ChatView>;
69
+ /**
70
+ * The caller's chats in a project, newest first, optionally filtered by subject.
71
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
72
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
73
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
74
+ */
75
+ getMyChatsAsyncUnsafe(input: GetMyChatsInput): Promise<ChatView[]>;
76
+ }
77
+ //# sourceMappingURL=chats-actor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chats-actor.d.ts","sourceRoot":"","sources":["../../src/actors/chats-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrI,yFAAyF;AACzF,qBAAa,UAAW,SAAQ,SAAS;gBAEzB,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;;OAOG;IACU,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAc7E;;;;;;OAMG;IACU,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAWjF;;;;;OAKG;IACU,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOjF;;;;;OAKG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAInE;;;;;;OAMG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOxF;;;;;;OAMG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKpE;;;;;;OAMG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAInE;;;;;OAKG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKlE;;;;;OAKG;IACU,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAWlF"}
@@ -0,0 +1,120 @@
1
+ import {} from "@icp-sdk/core/agent";
2
+ import { Principal } from "@icp-sdk/core/principal";
3
+ import { ActorBase } from "../actor-base.js";
4
+ import { mapChatView, toCandidMemberInput, toCandidRole, toOpt, toOptBigInt } from "../mappers.js";
5
+ /** 1:1 wrapper for the canister's ChatsController — rooms, members, roles and policy. */
6
+ export class ChatsActor extends ActorBase {
7
+ constructor(canisterId, identity) {
8
+ super(canisterId, identity);
9
+ }
10
+ /**
11
+ * Creates a chat: the caller becomes `owner`, the project's agents join as `agent`, the
12
+ * canister writes the `chatCreated` event and — when given — the first text message,
13
+ * all in one call.
14
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound` for the project, `InvalidData` for members/lengths/quotas). Examine "cause" for {errorKey, errorMessage, logs}.
15
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
16
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
17
+ */
18
+ async createChatAsyncUnsafe(input) {
19
+ const chat = await this.executeFunctionAsyncUnsafe(() => this.actor.createChat({
20
+ projectId: input.projectId,
21
+ members: (input.members ?? []).map(toCandidMemberInput),
22
+ policy: toOpt(input.policy === undefined ? undefined : { agentsReply: input.policy.agentsReply }),
23
+ title: toOpt(input.title),
24
+ subject: toOpt(input.subject),
25
+ firstMessage: toOpt(input.firstMessage),
26
+ }));
27
+ return mapChatView(chat);
28
+ }
29
+ /**
30
+ * Adds a member. Owner/admin members, project admins, canister admins — and agent
31
+ * members when the project allows it (agents may only add `member`s).
32
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `AlreadyExists`, `InvalidData` for a closed chat / anonymous / limit). Examine "cause" for {errorKey, errorMessage, logs}.
33
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
34
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
35
+ */
36
+ async inviteMemberAsyncUnsafe(input) {
37
+ const chat = await this.executeFunctionAsyncUnsafe(() => this.actor.inviteMember({
38
+ chatId: input.chatId,
39
+ principal: Principal.fromText(input.principal),
40
+ role: toCandidRole(input.role),
41
+ }));
42
+ return mapChatView(chat);
43
+ }
44
+ /**
45
+ * Removes somebody else; an owner can be removed only by a project admin.
46
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for self-removal / closed chat). Examine "cause" for {errorKey, errorMessage, logs}.
47
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
48
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
49
+ */
50
+ async removeMemberAsyncUnsafe(input) {
51
+ const chat = await this.executeFunctionAsyncUnsafe(() => this.actor.removeMember({ chatId: input.chatId, principal: Principal.fromText(input.principal) }));
52
+ return mapChatView(chat);
53
+ }
54
+ /**
55
+ * Leaves the chat. The last owner/admin of an open chat cannot leave — close it instead.
56
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for the last manager). Examine "cause" for {errorKey, errorMessage, logs}.
57
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
58
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
59
+ */
60
+ async leaveChatAsyncUnsafe(chatId) {
61
+ return this.executeFunctionAsyncUnsafe(() => this.actor.leaveChat({ chatId }));
62
+ }
63
+ /**
64
+ * Changes the policy agents read (e.g. `agentsReply: false` to hand the chat to a human).
65
+ * Same callers as inviteMember.
66
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for a closed chat). Examine "cause" for {errorKey, errorMessage, logs}.
67
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
68
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
69
+ */
70
+ async setPolicyAsyncUnsafe(chatId, policy) {
71
+ const chat = await this.executeFunctionAsyncUnsafe(() => this.actor.setPolicy({ chatId, policy: { agentsReply: policy.agentsReply } }));
72
+ return mapChatView(chat);
73
+ }
74
+ /**
75
+ * Closes the chat for good (no more posts or membership changes). Owner/admin members,
76
+ * project admins, canister admins — not agents.
77
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` when already closed). Examine "cause" for {errorKey, errorMessage, logs}.
78
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
79
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
80
+ */
81
+ async closeChatAsyncUnsafe(chatId) {
82
+ const chat = await this.executeFunctionAsyncUnsafe(() => this.actor.closeChat({ chatId }));
83
+ return mapChatView(chat);
84
+ }
85
+ /**
86
+ * Deletes the chat and every message of it. Canister admin only; irreversible — the
87
+ * erasure path for personal data.
88
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
89
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
90
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
91
+ */
92
+ async purgeChatAsyncUnsafe(chatId) {
93
+ return this.executeFunctionAsyncUnsafe(() => this.actor.purgeChat({ chatId }));
94
+ }
95
+ /**
96
+ * One chat with its members. Members, project admins, canister admins.
97
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
98
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
99
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
100
+ */
101
+ async getChatAsyncUnsafe(chatId) {
102
+ const chat = await this.executeFunctionAsyncUnsafe(() => this.actor.getChat({ chatId }));
103
+ return mapChatView(chat);
104
+ }
105
+ /**
106
+ * The caller's chats in a project, newest first, optionally filtered by subject.
107
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
108
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
109
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
110
+ */
111
+ async getMyChatsAsyncUnsafe(input) {
112
+ const chats = await this.executeFunctionAsyncUnsafe(() => this.actor.getMyChats({
113
+ projectId: input.projectId,
114
+ subject: toOpt(input.subject),
115
+ includeClosed: input.includeClosed ?? false,
116
+ limit: toOptBigInt(input.limit),
117
+ }));
118
+ return chats.map(mapChatView);
119
+ }
120
+ }
@@ -0,0 +1,43 @@
1
+ import { type Identity } from "@icp-sdk/core/agent";
2
+ import { ActorBase } from "../actor-base.js";
3
+ import type { GetMessagesInput, MessageView, MessagesPageView, PollNewMessagesInput, PollResultView, PostInput } from "../interfaces.js";
4
+ /** 1:1 wrapper for the canister's MessagesController. */
5
+ export declare class MessagesActor extends ActorBase {
6
+ constructor(canisterId: string, identity?: Identity);
7
+ /**
8
+ * Posts a message as the caller. `text` for any member; `toolTrace` only for `agent`
9
+ * and `admin` members.
10
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for empty/long text, closed or full chat, daily limit). Examine "cause" for {errorKey, errorMessage, logs}.
11
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
12
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
13
+ */
14
+ postAsyncUnsafe(input: PostInput): Promise<MessageView>;
15
+ /** Like postAsyncUnsafe but never throws — returns null on any failure. */
16
+ postAsyncSafe(input: PostInput): Promise<MessageView | null>;
17
+ /**
18
+ * Records that the caller has read up to `seq` (never moves backwards).
19
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` when seq is beyond the newest message). Examine "cause" for {errorKey, errorMessage, logs}.
20
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
21
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
22
+ */
23
+ markReadAsyncUnsafe(chatId: string, seq: number): Promise<boolean>;
24
+ /**
25
+ * A chat's messages with seq > sinceSeq, oldest first (max 200 per call). Members,
26
+ * project admins, canister admins.
27
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
28
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
29
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
30
+ */
31
+ getMessagesAsyncUnsafe(input: GetMessagesInput): Promise<MessagesPageView>;
32
+ /**
33
+ * New messages in every chat the caller belongs to, after a global sequence number.
34
+ * Always returns `nextSinceGlobalSeq` — pass it back next time, whatever matched.
35
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized). Examine "cause" for {errorKey, errorMessage, logs}.
36
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
37
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
38
+ */
39
+ pollNewMessagesAsyncUnsafe(input: PollNewMessagesInput): Promise<PollResultView>;
40
+ /** Like pollNewMessagesAsyncUnsafe but never throws — returns null on any failure. */
41
+ pollNewMessagesAsyncSafe(input: PollNewMessagesInput): Promise<PollResultView | null>;
42
+ }
43
+ //# sourceMappingURL=messages-actor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages-actor.d.ts","sourceRoot":"","sources":["../../src/actors/messages-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGzI,yDAAyD;AACzD,qBAAa,aAAc,SAAQ,SAAS;gBAE5B,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;OAMG;IACU,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAWpE,2EAA2E;IAC9D,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAQzE;;;;;OAKG;IACU,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/E;;;;;;OAMG;IACU,sBAAsB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWvF;;;;;;OAMG;IACU,0BAA0B,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAU7F,sFAAsF;IACzE,wBAAwB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;CAOrG"}
@@ -0,0 +1,80 @@
1
+ import {} from "@icp-sdk/core/agent";
2
+ import { ActorBase } from "../actor-base.js";
3
+ import { mapMessageView, mapMessagesPageView, mapPollResultView, toOptBigInt } from "../mappers.js";
4
+ /** 1:1 wrapper for the canister's MessagesController. */
5
+ export class MessagesActor extends ActorBase {
6
+ constructor(canisterId, identity) {
7
+ super(canisterId, identity);
8
+ }
9
+ /**
10
+ * Posts a message as the caller. `text` for any member; `toolTrace` only for `agent`
11
+ * and `admin` members.
12
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` for empty/long text, closed or full chat, daily limit). Examine "cause" for {errorKey, errorMessage, logs}.
13
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
14
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
15
+ */
16
+ async postAsyncUnsafe(input) {
17
+ const message = await this.executeFunctionAsyncUnsafe(() => this.actor.post({
18
+ chatId: input.chatId,
19
+ text: input.text,
20
+ kind: input.kind === "toolTrace" ? { toolTrace: null } : { text: null },
21
+ }));
22
+ return mapMessageView(message);
23
+ }
24
+ /** Like postAsyncUnsafe but never throws — returns null on any failure. */
25
+ async postAsyncSafe(input) {
26
+ try {
27
+ return await this.postAsyncUnsafe(input);
28
+ }
29
+ catch {
30
+ return null;
31
+ }
32
+ }
33
+ /**
34
+ * Records that the caller has read up to `seq` (never moves backwards).
35
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData` when seq is beyond the newest message). Examine "cause" for {errorKey, errorMessage, logs}.
36
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
37
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
38
+ */
39
+ async markReadAsyncUnsafe(chatId, seq) {
40
+ return this.executeFunctionAsyncUnsafe(() => this.actor.markRead({ chatId, seq: BigInt(seq) }));
41
+ }
42
+ /**
43
+ * A chat's messages with seq > sinceSeq, oldest first (max 200 per call). Members,
44
+ * project admins, canister admins.
45
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
46
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
47
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
48
+ */
49
+ async getMessagesAsyncUnsafe(input) {
50
+ const page = await this.executeFunctionAsyncUnsafe(() => this.actor.getMessages({
51
+ chatId: input.chatId,
52
+ sinceSeq: BigInt(input.sinceSeq ?? 0),
53
+ limit: toOptBigInt(input.limit),
54
+ }));
55
+ return mapMessagesPageView(page);
56
+ }
57
+ /**
58
+ * New messages in every chat the caller belongs to, after a global sequence number.
59
+ * Always returns `nextSinceGlobalSeq` — pass it back next time, whatever matched.
60
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized). Examine "cause" for {errorKey, errorMessage, logs}.
61
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
62
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
63
+ */
64
+ async pollNewMessagesAsyncUnsafe(input) {
65
+ const result = await this.executeFunctionAsyncUnsafe(() => this.actor.pollNewMessages({
66
+ sinceGlobalSeq: BigInt(input.sinceGlobalSeq),
67
+ limit: toOptBigInt(input.limit),
68
+ }));
69
+ return mapPollResultView(result);
70
+ }
71
+ /** Like pollNewMessagesAsyncUnsafe but never throws — returns null on any failure. */
72
+ async pollNewMessagesAsyncSafe(input) {
73
+ try {
74
+ return await this.pollNewMessagesAsyncUnsafe(input);
75
+ }
76
+ catch {
77
+ return null;
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,38 @@
1
+ import { type Identity } from "@icp-sdk/core/agent";
2
+ import { ActorBase } from "../actor-base.js";
3
+ import type { CreateProjectInput, ProjectView, UpdateProjectInput } from "../interfaces.js";
4
+ /** 1:1 wrapper for the canister's ProjectsController — a project is a consumer's namespace
5
+ * with its own admins and the agents that auto-join every chat. */
6
+ export declare class ProjectsActor extends ActorBase {
7
+ constructor(canisterId: string, identity?: Identity);
8
+ /**
9
+ * Creates a project. Canister admin only.
10
+ * @param input - id (max 50 chars), admins and agents (max 10 each, no anonymous), whether agents may invite, the default policy.
11
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `AlreadyExists`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
12
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
13
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
14
+ */
15
+ createProjectAsyncUnsafe(input: CreateProjectInput): Promise<ProjectView>;
16
+ /**
17
+ * Changes only the given fields. Canister admins and the project's admins.
18
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
19
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
20
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
21
+ */
22
+ updateProjectAsyncUnsafe(input: UpdateProjectInput): Promise<ProjectView>;
23
+ /**
24
+ * One project. Canister admins, the project's admins and its agents.
25
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
26
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
27
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
28
+ */
29
+ getProjectAsyncUnsafe(projectId: string): Promise<ProjectView>;
30
+ /**
31
+ * Every project. Canister admin only.
32
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized). Examine "cause" for {errorKey, errorMessage, logs}.
33
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
34
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
35
+ */
36
+ listProjectsAsyncUnsafe(limit?: number): Promise<ProjectView[]>;
37
+ }
38
+ //# sourceMappingURL=projects-actor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects-actor.d.ts","sourceRoot":"","sources":["../../src/actors/projects-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG5F;mEACmE;AACnE,qBAAa,aAAc,SAAQ,SAAS;gBAE5B,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;OAMG;IACU,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAatF;;;;;OAKG;IACU,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAatF;;;;;OAKG;IACU,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAK3E;;;;;OAKG;IACU,uBAAuB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAI/E"}
@@ -0,0 +1,64 @@
1
+ import {} from "@icp-sdk/core/agent";
2
+ import { Principal } from "@icp-sdk/core/principal";
3
+ import { ActorBase } from "../actor-base.js";
4
+ import { mapProjectView, toOpt, toOptBigInt } from "../mappers.js";
5
+ /** 1:1 wrapper for the canister's ProjectsController — a project is a consumer's namespace
6
+ * with its own admins and the agents that auto-join every chat. */
7
+ export class ProjectsActor extends ActorBase {
8
+ constructor(canisterId, identity) {
9
+ super(canisterId, identity);
10
+ }
11
+ /**
12
+ * Creates a project. Canister admin only.
13
+ * @param input - id (max 50 chars), admins and agents (max 10 each, no anonymous), whether agents may invite, the default policy.
14
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `AlreadyExists`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
15
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
16
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
17
+ */
18
+ async createProjectAsyncUnsafe(input) {
19
+ const project = await this.executeFunctionAsyncUnsafe(() => this.actor.createProject({
20
+ id: input.id,
21
+ admins: input.admins.map((p) => Principal.fromText(p)),
22
+ agents: input.agents.map((p) => Principal.fromText(p)),
23
+ agentsMayInvite: input.agentsMayInvite,
24
+ defaultPolicy: { agentsReply: input.defaultPolicy.agentsReply },
25
+ }));
26
+ return mapProjectView(project);
27
+ }
28
+ /**
29
+ * Changes only the given fields. Canister admins and the project's admins.
30
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
31
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
32
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
33
+ */
34
+ async updateProjectAsyncUnsafe(input) {
35
+ const project = await this.executeFunctionAsyncUnsafe(() => this.actor.updateProject({
36
+ projectId: input.projectId,
37
+ admins: toOpt(input.admins?.map((p) => Principal.fromText(p))),
38
+ agents: toOpt(input.agents?.map((p) => Principal.fromText(p))),
39
+ agentsMayInvite: toOpt(input.agentsMayInvite),
40
+ defaultPolicy: toOpt(input.defaultPolicy === undefined ? undefined : { agentsReply: input.defaultPolicy.agentsReply }),
41
+ }));
42
+ return mapProjectView(project);
43
+ }
44
+ /**
45
+ * One project. Canister admins, the project's admins and its agents.
46
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
47
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
48
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
49
+ */
50
+ async getProjectAsyncUnsafe(projectId) {
51
+ const project = await this.executeFunctionAsyncUnsafe(() => this.actor.getProject({ projectId }));
52
+ return mapProjectView(project);
53
+ }
54
+ /**
55
+ * Every project. Canister admin only.
56
+ * @throws Error with message `CanisterError` when the canister returns a business error (not authorized). Examine "cause" for {errorKey, errorMessage, logs}.
57
+ * @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
58
+ * @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
59
+ */
60
+ async listProjectsAsyncUnsafe(limit) {
61
+ const projects = await this.executeFunctionAsyncUnsafe(() => this.actor.listProjects({ limit: toOptBigInt(limit) }));
62
+ return projects.map(mapProjectView);
63
+ }
64
+ }
@@ -0,0 +1,36 @@
1
+ import { Observable } from "rxjs";
2
+ import type { MessagesActor } from "./actors/messages-actor.js";
3
+ import type { MessageView } from "./interfaces.js";
4
+ export interface ChatPollerOptions {
5
+ /** Global sequence to start after. Omitted = the canister's current head (no replay). */
6
+ startAt?: number;
7
+ /** Called with every poll failure; a five-minute streak also rebuilds the agent. */
8
+ onError?: (error: unknown) => void;
9
+ batchLimit?: number;
10
+ }
11
+ /**
12
+ * Polls `pollNewMessages` on an interval for the wrapped identity and pushes every new
13
+ * message it is a member of onto `messages$`, in global order. Filtering out one's own
14
+ * messages is the consumer's job — the poller reports what the canister reports.
15
+ *
16
+ * Browser-safe on purpose: no pigeon, no `node:` imports, so the same package serves the
17
+ * agent host and the panel.
18
+ */
19
+ export declare class ChatPoller {
20
+ private readonly actor;
21
+ private readonly intervalMilliseconds;
22
+ private readonly options;
23
+ private intervalId;
24
+ private isProcessing;
25
+ private readonly messageSubject;
26
+ private lastSuccessfulProcessTs;
27
+ private sinceGlobalSeq;
28
+ get messages$(): Observable<MessageView>;
29
+ /** The cursor the next tick will poll from; undefined until the first successful tick. */
30
+ get cursor(): number | undefined;
31
+ constructor(actor: MessagesActor, intervalMilliseconds: number, options?: ChatPollerOptions);
32
+ private processQueue;
33
+ run(): void;
34
+ stop(): void;
35
+ }
36
+ //# sourceMappingURL=chat-poller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-poller.d.ts","sourceRoot":"","sources":["../src/chat-poller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,MAAM,WAAW,iBAAiB;IAC9B,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,qBAAa,UAAU;IAiBf,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAlB5B,OAAO,CAAC,UAAU,CAA+C;IACjE,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;IAC7D,OAAO,CAAC,uBAAuB,CAAc;IAC7C,OAAO,CAAC,cAAc,CAAqB;IAE3C,IAAW,SAAS,IAAI,UAAU,CAAC,WAAW,CAAC,CAE9C;IAED,0FAA0F;IAC1F,IAAW,MAAM,IAAI,MAAM,GAAG,SAAS,CAEtC;gBAGoB,KAAK,EAAE,aAAa,EACpB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,GAAE,iBAAsB;YAKtC,YAAY;IAsCnB,GAAG,IAAI,IAAI;IAOX,IAAI,IAAI,IAAI;CAOtB"}
@@ -0,0 +1,82 @@
1
+ import { Observable, Subject } from "rxjs";
2
+ const STALE_AGENT_THRESHOLD_MS = 5 * 60 * 1000;
3
+ const DEFAULT_BATCH_LIMIT = 200;
4
+ /**
5
+ * Polls `pollNewMessages` on an interval for the wrapped identity and pushes every new
6
+ * message it is a member of onto `messages$`, in global order. Filtering out one's own
7
+ * messages is the consumer's job — the poller reports what the canister reports.
8
+ *
9
+ * Browser-safe on purpose: no pigeon, no `node:` imports, so the same package serves the
10
+ * agent host and the panel.
11
+ */
12
+ export class ChatPoller {
13
+ actor;
14
+ intervalMilliseconds;
15
+ options;
16
+ intervalId = null;
17
+ isProcessing = false;
18
+ messageSubject = new Subject();
19
+ lastSuccessfulProcessTs = Date.now();
20
+ sinceGlobalSeq;
21
+ get messages$() {
22
+ return this.messageSubject.asObservable();
23
+ }
24
+ /** The cursor the next tick will poll from; undefined until the first successful tick. */
25
+ get cursor() {
26
+ return this.sinceGlobalSeq;
27
+ }
28
+ constructor(actor, intervalMilliseconds, options = {}) {
29
+ this.actor = actor;
30
+ this.intervalMilliseconds = intervalMilliseconds;
31
+ this.options = options;
32
+ this.sinceGlobalSeq = options.startAt;
33
+ }
34
+ async processQueue() {
35
+ if (this.isProcessing)
36
+ return;
37
+ if (Date.now() - this.lastSuccessfulProcessTs > STALE_AGENT_THRESHOLD_MS) {
38
+ this.lastSuccessfulProcessTs = Date.now();
39
+ this.options.onError?.(new Error("ChatPoller: no successful poll in the last 5 minutes — rebuilding the agent"));
40
+ this.actor.reinitializeAgent();
41
+ }
42
+ try {
43
+ this.isProcessing = true;
44
+ if (this.sinceGlobalSeq === undefined) {
45
+ // Seed at the head: limit 0 returns only the cursors.
46
+ const seed = await this.actor.pollNewMessagesAsyncUnsafe({ sinceGlobalSeq: 0, limit: 0 });
47
+ this.sinceGlobalSeq = seed.headGlobalSeq;
48
+ }
49
+ else {
50
+ const result = await this.actor.pollNewMessagesAsyncUnsafe({
51
+ sinceGlobalSeq: this.sinceGlobalSeq,
52
+ limit: this.options.batchLimit ?? DEFAULT_BATCH_LIMIT,
53
+ });
54
+ for (const message of result.messages) {
55
+ this.messageSubject.next(message);
56
+ }
57
+ // A reinstalled canister has a smaller head than our cursor — clamp to it.
58
+ this.sinceGlobalSeq = Math.min(result.nextSinceGlobalSeq, result.headGlobalSeq);
59
+ }
60
+ this.lastSuccessfulProcessTs = Date.now();
61
+ }
62
+ catch (error) {
63
+ this.options.onError?.(error);
64
+ }
65
+ finally {
66
+ this.isProcessing = false;
67
+ }
68
+ }
69
+ run() {
70
+ if (this.intervalId)
71
+ return;
72
+ this.intervalId = setInterval(() => void this.processQueue(), this.intervalMilliseconds);
73
+ void this.processQueue();
74
+ }
75
+ stop() {
76
+ if (this.intervalId) {
77
+ clearInterval(this.intervalId);
78
+ this.intervalId = null;
79
+ this.messageSubject.complete();
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,2 @@
1
+ export declare const componentName = "chat-motoko-package";
2
+ //# sourceMappingURL=globals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ export const componentName = "chat-motoko-package";
@@ -0,0 +1,10 @@
1
+ export { ActorBase, type LogEntry } from "./actor-base.js";
2
+ export { AdminActor } from "./actors/admin-actor.js";
3
+ export { ProjectsActor } from "./actors/projects-actor.js";
4
+ export { ChatsActor } from "./actors/chats-actor.js";
5
+ export { MessagesActor } from "./actors/messages-actor.js";
6
+ export { ChatPoller, type ChatPollerOptions } from "./chat-poller.js";
7
+ export type { RoleView, ChatStatusView, PolicyView, ProjectView, MemberView, ChatView, SystemEventView, MessageKindView, MessageView, MessagesPageView, PollResultView, CreateProjectInput, UpdateProjectInput, MemberInputView, CreateChatInput, InviteMemberInput, RemoveMemberInput, GetMyChatsInput, PostInput, GetMessagesInput, PollNewMessagesInput, } from "./interfaces.js";
8
+ export { mapProjectView, mapChatView, mapMemberView, mapMessageView, mapMessagesPageView, mapPollResultView, mapSystemEventView, mapRoleView, toCandidRole, } from "./mappers.js";
9
+ export type { Chat, ChatId, ChatStatus, Member, Message, MessageKind, MessagesPage, Policy, PollResult, Project, ProjectId, Role, SystemEvent, Error as CanisterErrorShape, ErrorDetails, } from "../declarations/chat-motoko-backend/chat-motoko-backend.did.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EACR,QAAQ,EACR,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,oBAAoB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACH,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,YAAY,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EACR,IAAI,EACJ,MAAM,EACN,UAAU,EACV,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,IAAI,EACJ,WAAW,EACX,KAAK,IAAI,kBAAkB,EAC3B,YAAY,GACf,MAAM,gEAAgE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { ActorBase } from "./actor-base.js";
2
+ export { AdminActor } from "./actors/admin-actor.js";
3
+ export { ProjectsActor } from "./actors/projects-actor.js";
4
+ export { ChatsActor } from "./actors/chats-actor.js";
5
+ export { MessagesActor } from "./actors/messages-actor.js";
6
+ export { ChatPoller } from "./chat-poller.js";
7
+ export { mapProjectView, mapChatView, mapMemberView, mapMessageView, mapMessagesPageView, mapPollResultView, mapSystemEventView, mapRoleView, toCandidRole, } from "./mappers.js";