@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,149 @@
1
+ /**
2
+ * Friendly views of the canister's candid types: `Principal` → text, `opt` → optional,
3
+ * variants → string unions, sequence numbers → `number` (they stay far below 2^53),
4
+ * timestamps kept as `bigint` nanoseconds like every other JSM package.
5
+ */
6
+ export type RoleView = "owner" | "member" | "agent" | "admin";
7
+ export type ChatStatusView = "open" | "closed";
8
+ export interface PolicyView {
9
+ /** Read by agents, never enforced by the canister. */
10
+ agentsReply: boolean;
11
+ }
12
+ export interface ProjectView {
13
+ id: string;
14
+ createdBy: string;
15
+ createdAt: bigint;
16
+ admins: string[];
17
+ /** Auto-joined as `agent` on every new chat of the project. */
18
+ agents: string[];
19
+ agentsMayInvite: boolean;
20
+ defaultPolicy: PolicyView;
21
+ }
22
+ export interface MemberView {
23
+ principal: string;
24
+ role: RoleView;
25
+ joinedAt: bigint;
26
+ lastReadSeq: number;
27
+ }
28
+ export interface ChatView {
29
+ id: string;
30
+ projectId: string;
31
+ createdBy: string;
32
+ createdAt: bigint;
33
+ title?: string;
34
+ subject?: string;
35
+ policy: PolicyView;
36
+ status: ChatStatusView;
37
+ members: MemberView[];
38
+ lastSeq: number;
39
+ lastMessageAt: bigint;
40
+ }
41
+ export type SystemEventView = {
42
+ type: "chatCreated";
43
+ } | {
44
+ type: "memberJoined";
45
+ principal: string;
46
+ role: RoleView;
47
+ } | {
48
+ type: "memberInvited";
49
+ principal: string;
50
+ role: RoleView;
51
+ by: string;
52
+ } | {
53
+ type: "memberRemoved";
54
+ principal: string;
55
+ by: string;
56
+ } | {
57
+ type: "memberLeft";
58
+ principal: string;
59
+ } | {
60
+ type: "policyChanged";
61
+ policy: PolicyView;
62
+ } | {
63
+ type: "chatClosed";
64
+ };
65
+ export type MessageKindView = "text" | "toolTrace" | "event";
66
+ export interface MessageView {
67
+ chatId: string;
68
+ projectId: string;
69
+ /** Dense per-chat sequence starting at 1. */
70
+ seq: number;
71
+ /** Canister-wide sequence — the poll cursor. */
72
+ globalSeq: number;
73
+ author: string;
74
+ kind: MessageKindView;
75
+ /** Set when `kind === "event"`. */
76
+ event?: SystemEventView;
77
+ text: string;
78
+ createdAt: bigint;
79
+ }
80
+ export interface MessagesPageView {
81
+ messages: MessageView[];
82
+ lastSeq: number;
83
+ }
84
+ export interface PollResultView {
85
+ messages: MessageView[];
86
+ /** Pass back as `sinceGlobalSeq` on the next poll. */
87
+ nextSinceGlobalSeq: number;
88
+ headGlobalSeq: number;
89
+ }
90
+ export interface CreateProjectInput {
91
+ id: string;
92
+ admins: string[];
93
+ agents: string[];
94
+ agentsMayInvite: boolean;
95
+ defaultPolicy: PolicyView;
96
+ }
97
+ export interface UpdateProjectInput {
98
+ projectId: string;
99
+ admins?: string[];
100
+ agents?: string[];
101
+ agentsMayInvite?: boolean;
102
+ defaultPolicy?: PolicyView;
103
+ }
104
+ export interface MemberInputView {
105
+ principal: string;
106
+ role: RoleView;
107
+ }
108
+ export interface CreateChatInput {
109
+ projectId: string;
110
+ /** Besides the caller (always `owner`) and the project's agents (always `agent`). */
111
+ members?: MemberInputView[];
112
+ policy?: PolicyView;
113
+ title?: string;
114
+ subject?: string;
115
+ firstMessage?: string;
116
+ }
117
+ export interface InviteMemberInput {
118
+ chatId: string;
119
+ principal: string;
120
+ role: RoleView;
121
+ }
122
+ export interface RemoveMemberInput {
123
+ chatId: string;
124
+ principal: string;
125
+ }
126
+ export interface GetMyChatsInput {
127
+ projectId: string;
128
+ subject?: string;
129
+ includeClosed?: boolean;
130
+ limit?: number;
131
+ }
132
+ export interface PostInput {
133
+ chatId: string;
134
+ text: string;
135
+ /** Defaults to `text`; `toolTrace` needs the `agent` or `admin` role. */
136
+ kind?: "text" | "toolTrace";
137
+ }
138
+ export interface GetMessagesInput {
139
+ chatId: string;
140
+ /** Messages with seq > sinceSeq; defaults to 0. */
141
+ sinceSeq?: number;
142
+ limit?: number;
143
+ }
144
+ export interface PollNewMessagesInput {
145
+ sinceGlobalSeq: number;
146
+ /** 0 = only the cursors. */
147
+ limit?: number;
148
+ }
149
+ //#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/B;AAED,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Friendly views of the canister's candid types: `Principal` → text, `opt` → optional,
3
+ * variants → string unions, sequence numbers → `number` (they stay far below 2^53),
4
+ * timestamps kept as `bigint` nanoseconds like every other JSM package.
5
+ */
6
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { Chat, ChatStatus, Member, MemberInput, Message, MessagesPage, PollResult, Project, Role, SystemEvent } from "../declarations/chat-motoko-backend/chat-motoko-backend.did.js";
2
+ import type { ChatStatusView, ChatView, MemberInputView, MemberView, MessageView, MessagesPageView, PollResultView, ProjectView, RoleView, SystemEventView } from "./interfaces.js";
3
+ export declare function fromOpt<T>(opt: [] | [T]): T | undefined;
4
+ export declare function toOpt<T>(value: T | undefined): [] | [T];
5
+ export declare function toOptBigInt(value: number | undefined): [] | [bigint];
6
+ export declare function mapRoleView(role: Role): RoleView;
7
+ export declare function toCandidRole(role: RoleView): Role;
8
+ export declare function toCandidMemberInput(input: MemberInputView): MemberInput;
9
+ export declare function mapChatStatusView(status: ChatStatus): ChatStatusView;
10
+ export declare function mapProjectView(project: Project): ProjectView;
11
+ export declare function mapMemberView(member: Member): MemberView;
12
+ export declare function mapChatView(chat: Chat): ChatView;
13
+ export declare function mapSystemEventView(event: SystemEvent): SystemEventView;
14
+ export declare function mapMessageView(message: Message): MessageView;
15
+ export declare function mapMessagesPageView(page: MessagesPage): MessagesPageView;
16
+ export declare function mapPollResultView(result: PollResult): PollResultView;
17
+ //# sourceMappingURL=mappers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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AAE,OAAO,GAAG,WAAW,CAe5D;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAExE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,cAAc,CAMpE"}
@@ -0,0 +1,109 @@
1
+ import { Principal } from "@icp-sdk/core/principal";
2
+ export function fromOpt(opt) {
3
+ return opt[0];
4
+ }
5
+ export function toOpt(value) {
6
+ return value === undefined ? [] : [value];
7
+ }
8
+ export function toOptBigInt(value) {
9
+ return value === undefined ? [] : [BigInt(value)];
10
+ }
11
+ export function mapRoleView(role) {
12
+ return Object.keys(role)[0];
13
+ }
14
+ export function toCandidRole(role) {
15
+ switch (role) {
16
+ case "owner": return { owner: null };
17
+ case "member": return { member: null };
18
+ case "agent": return { agent: null };
19
+ case "admin": return { admin: null };
20
+ }
21
+ }
22
+ export function toCandidMemberInput(input) {
23
+ return { principal: Principal.fromText(input.principal), role: toCandidRole(input.role) };
24
+ }
25
+ export function mapChatStatusView(status) {
26
+ return Object.keys(status)[0];
27
+ }
28
+ export function mapProjectView(project) {
29
+ return {
30
+ id: project.id,
31
+ createdBy: project.createdBy.toText(),
32
+ createdAt: project.createdAt,
33
+ admins: project.admins.map((p) => p.toText()),
34
+ agents: project.agents.map((p) => p.toText()),
35
+ agentsMayInvite: project.agentsMayInvite,
36
+ defaultPolicy: { agentsReply: project.defaultPolicy.agentsReply },
37
+ };
38
+ }
39
+ export function mapMemberView(member) {
40
+ return {
41
+ principal: member.principal.toText(),
42
+ role: mapRoleView(member.role),
43
+ joinedAt: member.joinedAt,
44
+ lastReadSeq: Number(member.lastReadSeq),
45
+ };
46
+ }
47
+ export function mapChatView(chat) {
48
+ return {
49
+ id: chat.id,
50
+ projectId: chat.projectId,
51
+ createdBy: chat.createdBy.toText(),
52
+ createdAt: chat.createdAt,
53
+ title: fromOpt(chat.title),
54
+ subject: fromOpt(chat.subject),
55
+ policy: { agentsReply: chat.policy.agentsReply },
56
+ status: mapChatStatusView(chat.status),
57
+ members: chat.members.map(mapMemberView),
58
+ lastSeq: Number(chat.lastSeq),
59
+ lastMessageAt: chat.lastMessageAt,
60
+ };
61
+ }
62
+ export function mapSystemEventView(event) {
63
+ if ("chatCreated" in event)
64
+ return { type: "chatCreated" };
65
+ if ("chatClosed" in event)
66
+ return { type: "chatClosed" };
67
+ if ("policyChanged" in event)
68
+ return { type: "policyChanged", policy: { agentsReply: event.policyChanged.agentsReply } };
69
+ if ("memberJoined" in event) {
70
+ return { type: "memberJoined", principal: event.memberJoined.principal.toText(), role: mapRoleView(event.memberJoined.role) };
71
+ }
72
+ if ("memberInvited" in event) {
73
+ return {
74
+ type: "memberInvited",
75
+ principal: event.memberInvited.principal.toText(),
76
+ role: mapRoleView(event.memberInvited.role),
77
+ by: event.memberInvited.by.toText(),
78
+ };
79
+ }
80
+ if ("memberRemoved" in event) {
81
+ return { type: "memberRemoved", principal: event.memberRemoved.principal.toText(), by: event.memberRemoved.by.toText() };
82
+ }
83
+ return { type: "memberLeft", principal: event.memberLeft.principal.toText() };
84
+ }
85
+ export function mapMessageView(message) {
86
+ const base = {
87
+ chatId: message.chatId,
88
+ projectId: message.projectId,
89
+ seq: Number(message.seq),
90
+ globalSeq: Number(message.globalSeq),
91
+ author: message.author.toText(),
92
+ text: message.text,
93
+ createdAt: message.createdAt,
94
+ };
95
+ if ("event" in message.kind) {
96
+ return { ...base, kind: "event", event: mapSystemEventView(message.kind.event) };
97
+ }
98
+ return { ...base, kind: "toolTrace" in message.kind ? "toolTrace" : "text" };
99
+ }
100
+ export function mapMessagesPageView(page) {
101
+ return { messages: page.messages.map(mapMessageView), lastSeq: Number(page.lastSeq) };
102
+ }
103
+ export function mapPollResultView(result) {
104
+ return {
105
+ messages: result.messages.map(mapMessageView),
106
+ nextSinceGlobalSeq: Number(result.nextSinceGlobalSeq),
107
+ headGlobalSeq: Number(result.headGlobalSeq),
108
+ };
109
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@jsm-mit/chat-motoko-package",
3
+ "version": "0.1.0",
4
+ "description": "Wrapper TypeScript package for the chat-motoko canister: projects, multi-party chats, messages and a poller for agent hosts.",
5
+ "license": "ISC",
6
+ "author": "",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ },
15
+ "./declarations/*": "./declarations/*"
16
+ },
17
+ "files": [
18
+ "dist/",
19
+ "declarations/"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "clean": "rm -rf dist",
24
+ "prepare": "npm run build",
25
+ "publish-public": "bash scripts/publish-public.sh",
26
+ "typecheck": "tsc --noEmit -p tsconfig.tests.json",
27
+ "sync-declarations": "bash scripts/sync-declarations.sh",
28
+ "test-suite": "bash scripts/run-tests.sh tests/test-suite.ts",
29
+ "test-access-restrictions": "bash scripts/run-tests.sh tests/test-access-restrictions.ts",
30
+ "sandbox": "npx tsx sandbox/main.ts",
31
+ "stamp-canister": "bash scripts/stamp-canister-commit.sh"
32
+ },
33
+ "dependencies": {
34
+ "@jsm-mit/utils-package": "^0.5.0",
35
+ "rxjs": "^7.8.1"
36
+ },
37
+ "peerDependencies": {
38
+ "@icp-sdk/core": "^6.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@icp-sdk/core": "^6.1.0",
42
+ "@jsm-mit/cli-game-helpers": "^0.1.3",
43
+ "@types/node": "^25.5.2",
44
+ "dotenv": "^16.3.1",
45
+ "tsx": "^4.18.0",
46
+ "typescript": "^5.9.3"
47
+ },
48
+ "homepage": "https://github.com/JSM-Common/chat-motoko-package#readme",
49
+ "bugs": {
50
+ "url": "https://github.com/JSM-Common/chat-motoko-package/issues"
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/JSM-Common/chat-motoko-package.git"
55
+ },
56
+ "chatMotoko": {
57
+ "repo": "chat-motoko",
58
+ "repoUrl": "https://github.com/JSM-Common/chat-motoko",
59
+ "commit": "1affa62db4bab4f424f4b633621472dc5f74ca95"
60
+ }
61
+ }