Skip to content

Commit 63d36b0

Browse files
committed
[Components] rumi_ai - new components
1 parent a7211d1 commit 63d36b0

File tree

15 files changed

+695
-7
lines changed

15 files changed

+695
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ components/**/package-lock.json
2020
/packages/sdk/examples/.next/
2121

2222
**/.claude/settings.local.json
23+
24+
.cursor
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-add-session-access",
5+
name: "Add Session Access",
6+
description: "Add access to a session for specific email addresses or domains. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
sessionId: {
12+
propDefinition: [
13+
app,
14+
"sessionId",
15+
],
16+
},
17+
sessionRecurrenceId: {
18+
propDefinition: [
19+
app,
20+
"sessionRecurrenceId",
21+
],
22+
},
23+
emails: {
24+
propDefinition: [
25+
app,
26+
"emails",
27+
],
28+
},
29+
domains: {
30+
propDefinition: [
31+
app,
32+
"domains",
33+
],
34+
},
35+
message: {
36+
propDefinition: [
37+
app,
38+
"message",
39+
],
40+
},
41+
},
42+
async run({ $ }) {
43+
const {
44+
app,
45+
sessionId,
46+
sessionRecurrenceId,
47+
emails,
48+
domains,
49+
message,
50+
} = this;
51+
52+
const response = await app.addSessionAccess({
53+
$,
54+
data: {
55+
sessionID: sessionId,
56+
sessionRecurrenceID: sessionRecurrenceId,
57+
emails,
58+
domains,
59+
message,
60+
},
61+
});
62+
63+
$.export("$summary", `Successfully added access to session \`${response?.data?.sessionID}\``);
64+
return response;
65+
},
66+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-ai-stream-query",
5+
name: "AI Stream Query",
6+
description: "Stream an AI query against session memories. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
query: {
12+
propDefinition: [
13+
app,
14+
"query",
15+
],
16+
},
17+
requestId: {
18+
propDefinition: [
19+
app,
20+
"requestId",
21+
],
22+
},
23+
tz: {
24+
propDefinition: [
25+
app,
26+
"tz",
27+
],
28+
},
29+
},
30+
async run({ $ }) {
31+
const {
32+
app,
33+
query,
34+
requestId,
35+
tz,
36+
} = this;
37+
38+
const response = await app.streamAiQuery({
39+
$,
40+
data: {
41+
query,
42+
requestId,
43+
tz,
44+
},
45+
});
46+
47+
$.export("$summary", "Successfully executed AI stream query");
48+
return response;
49+
},
50+
};
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-create-session",
5+
name: "Create Session",
6+
description: "Create a new session/meeting. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
sessionTitle: {
12+
propDefinition: [
13+
app,
14+
"sessionTitle",
15+
],
16+
},
17+
about: {
18+
description: "A brief description of the session.",
19+
propDefinition: [
20+
app,
21+
"about",
22+
],
23+
},
24+
startDate: {
25+
propDefinition: [
26+
app,
27+
"startDate",
28+
],
29+
},
30+
startTime: {
31+
propDefinition: [
32+
app,
33+
"startTime",
34+
],
35+
},
36+
endDate: {
37+
propDefinition: [
38+
app,
39+
"endDate",
40+
],
41+
},
42+
endTime: {
43+
propDefinition: [
44+
app,
45+
"endTime",
46+
],
47+
},
48+
enableRecording: {
49+
propDefinition: [
50+
app,
51+
"enableRecording",
52+
],
53+
},
54+
summaAI: {
55+
propDefinition: [
56+
app,
57+
"summaAI",
58+
],
59+
},
60+
},
61+
async run({ $ }) {
62+
const {
63+
app,
64+
sessionTitle,
65+
about,
66+
startDate,
67+
startTime,
68+
endDate,
69+
endTime,
70+
enableRecording,
71+
summaAI,
72+
} = this;
73+
74+
// Convert date/time inputs to Unix timestamps with validation
75+
const startDateTime = new Date(`${startDate}T${startTime}:00`);
76+
const endDateTime = new Date(`${endDate || startDate}T${endTime}:00`);
77+
78+
// Validate dates
79+
if (isNaN(startDateTime.getTime())) {
80+
throw new Error("Invalid start date/time provided");
81+
}
82+
if (isNaN(endDateTime.getTime())) {
83+
throw new Error("Invalid end date/time provided");
84+
}
85+
if (endDateTime <= startDateTime) {
86+
throw new Error("End time must be after start time");
87+
}
88+
89+
// Convert to Unix timestamps (seconds since epoch)
90+
const startTimestamp = Math.floor(startDateTime.getTime() / 1000);
91+
const endTimestamp = Math.floor(endDateTime.getTime() / 1000);
92+
93+
const response = await app.createSession({
94+
$,
95+
data: {
96+
sessionTitle,
97+
about,
98+
dataVisibility: "team-visible",
99+
accessStatus: "unlocked",
100+
startTimestamp,
101+
endTimestamp,
102+
sessionSettings: {
103+
enableRecording,
104+
summaAI,
105+
preferredLanguages: [
106+
"en-US",
107+
],
108+
recurring: 0,
109+
postSessionSummaries: {
110+
recipients: {
111+
email: "everyone",
112+
},
113+
},
114+
},
115+
},
116+
});
117+
118+
$.export("$summary", `Successfully created session: ${sessionTitle}`);
119+
return response;
120+
},
121+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-get-current-user",
5+
name: "Get Current User",
6+
description: "Get information about the current authenticated user. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
},
12+
async run({ $ }) {
13+
const { app } = this;
14+
15+
const response = await app.getCurrentUser({
16+
$,
17+
});
18+
19+
$.export("$summary", "Successfully retrieved current user information");
20+
return response;
21+
},
22+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-get-future-sessions",
5+
name: "Get Future Sessions",
6+
description: "Retrieve upcoming/future sessions. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
},
12+
async run({ $ }) {
13+
const { app } = this;
14+
15+
const response = await app.getFutureSessions({
16+
$,
17+
});
18+
19+
$.export("$summary", `Successfully retrieved \`${response?.data?.sessions?.length}\` future session(s)`);
20+
return response;
21+
},
22+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-get-meeting-types",
5+
name: "Get Meeting Types",
6+
description: "Retrieve available meeting types. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
},
12+
async run({ $ }) {
13+
const { app } = this;
14+
15+
const response = await app.getMeetingTypes({
16+
$,
17+
});
18+
19+
$.export("$summary", `Successfully retrieved \`${response?.data?.meetingTypes?.length}\` meeting type(s)`);
20+
return response;
21+
},
22+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-get-memory-threads",
5+
name: "Get Memory Threads",
6+
description: "Retrieve memory threads. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
limit: {
12+
propDefinition: [
13+
app,
14+
"limit",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const {
20+
app,
21+
limit,
22+
} = this;
23+
24+
const response = await app.getMemoryThreads({
25+
$,
26+
params: {
27+
limit,
28+
},
29+
});
30+
31+
$.export("$summary", `Successfully retrieved \`${response?.data?.threads?.length}\` memory thread(s)`);
32+
return response;
33+
},
34+
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import app from "../../rumi_ai.app.mjs";
2+
3+
export default {
4+
key: "rumi_ai-get-past-sessions",
5+
name: "Get Past Sessions",
6+
description: "Retrieve past sessions/meetings. [See the documentation](https://rumiai.notion.site/Rumi-Public-API-Authentication-02055b7286874bd7b355862f1abe48d9)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
limit: {
12+
propDefinition: [
13+
app,
14+
"limit",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const {
20+
app, limit,
21+
} = this;
22+
23+
const response = await app.getPastSessions({
24+
$,
25+
params: {
26+
limit,
27+
},
28+
});
29+
30+
$.export("$summary", `Successfully retrieved \`${response?.data?.sessions?.length}\` past session(s)`);
31+
return response;
32+
},
33+
};

0 commit comments

Comments
 (0)