@credal/actions 0.1.87 → 0.1.89
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.
- package/dist/actions/actionMapper.js +18 -0
- package/dist/actions/autogen/definitions.d.ts +5 -0
- package/dist/actions/autogen/definitions.js +132 -0
- package/dist/actions/autogen/templates.d.ts +4 -0
- package/dist/actions/autogen/templates.js +267 -3
- package/dist/actions/autogen/types.d.ts +260 -10
- package/dist/actions/autogen/types.js +71 -5
- package/dist/actions/definitions.js +35 -0
- package/dist/actions/groups.js +2 -0
- package/dist/actions/invokeMapper.d.ts +9 -0
- package/dist/actions/invokeMapper.js +33 -0
- package/dist/actions/providers/asana/getTasksDetails.d.ts +3 -0
- package/dist/actions/providers/asana/getTasksDetails.js +99 -0
- package/dist/actions/providers/asana/searchAsanaTasks.d.ts +3 -0
- package/dist/actions/providers/asana/searchAsanaTasks.js +67 -0
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +43 -0
- package/dist/actions/providers/gong/getGongTranscripts.js +31 -43
- package/dist/actions/providers/google-oauth/searchDriveByKeywords.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchDriveByKeywords.js +46 -0
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +3 -0
- package/dist/actions/providers/googlemaps/nearbysearch.js +96 -0
- package/dist/actions/providers/jira/createTicket.d.ts +3 -0
- package/dist/actions/providers/jira/createTicket.js +34 -0
- package/dist/actions/providers/slack/listConversations.d.ts +1 -1
- package/dist/actions/providers/slack/list_conversations.d.ts +3 -0
- package/dist/actions/providers/slack/list_conversations.js +60 -0
- package/dist/actions/providers/slack/summarizeChannel.d.ts +3 -0
- package/dist/actions/providers/slack/summarizeChannel.js +51 -0
- package/dist/actions/schema.js +6 -0
- package/dist/actions/types.js +2 -0
- package/dist/main.js +11 -0
- package/package.json +1 -1
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const web_api_1 = require("@slack/web-api");
|
16
|
+
const helpers_1 = require("./helpers");
|
17
|
+
const openai_1 = __importDefault(require("openai"));
|
18
|
+
const summarizeChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
19
|
+
var _b;
|
20
|
+
const client = new web_api_1.WebClient(authParams.authToken);
|
21
|
+
const { channelName } = params;
|
22
|
+
const allChannels = yield (0, helpers_1.getSlackChannels)(client);
|
23
|
+
const channel = allChannels.find(channel => channel.name === channelName && channel.is_private === false);
|
24
|
+
if (!channel || !channel.id) {
|
25
|
+
throw Error(`Channel with name ${channelName} not found`);
|
26
|
+
}
|
27
|
+
// summarize last 50 messages
|
28
|
+
const messages = yield client.conversations.history({
|
29
|
+
channel: channel.id,
|
30
|
+
limit: 50,
|
31
|
+
});
|
32
|
+
if (!messages.ok) {
|
33
|
+
throw Error(`Failed to fetch messages from channel ${channel.name}`);
|
34
|
+
}
|
35
|
+
const history = ((_b = messages.messages) === null || _b === void 0 ? void 0 : _b.reverse().map(message => message.user + ":" + message.text).join("\n")) || "";
|
36
|
+
const oai = new openai_1.default();
|
37
|
+
const completion = yield oai.chat.completions.create({
|
38
|
+
model: "gpt-4o-mini",
|
39
|
+
messages: [
|
40
|
+
{
|
41
|
+
role: "user",
|
42
|
+
content: "Summarize the following messages in the Slack channel:\n" + history,
|
43
|
+
},
|
44
|
+
],
|
45
|
+
});
|
46
|
+
const summary = completion.choices[0].message.content || "";
|
47
|
+
return {
|
48
|
+
summary: summary,
|
49
|
+
};
|
50
|
+
});
|
51
|
+
exports.default = summarizeChannel;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createParametersObject = createParametersObject;
|
4
|
+
function createParametersObject(parameters) {
|
5
|
+
return Object.fromEntries(Object.entries(parameters).map(([key, param]) => [key, param.type]));
|
6
|
+
}
|
package/dist/main.js
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const list_conversations_1 = __importDefault(require("./actions/providers/slack/list_conversations"));
|
7
|
+
const result = (0, list_conversations_1.default)({
|
8
|
+
accessToken: "xoxp-4172665288294-8092684180551-8154529379075-89f1f70cc06e5648e8f912ba96f56626"
|
9
|
+
}).then((result) => {
|
10
|
+
console.log(result);
|
11
|
+
});
|