@messenger-box/platform-server 10.0.3-alpha.113 → 10.0.3-alpha.117
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/lib/inngest/utils.js +1 -29
- package/lib/inngest/utils.js.map +1 -1
- package/lib/module.js +4 -9
- package/lib/module.js.map +1 -1
- package/package.json +3 -3
- package/lib/inngest/factory.d.ts +0 -22
- package/lib/inngest/factory.js +0 -4
- package/lib/inngest/factory.js.map +0 -1
- package/lib/inngest/functions.d.ts +0 -121
- package/lib/inngest/functions.js +0 -863
- package/lib/inngest/functions.js.map +0 -1
- package/lib/inngest/index.d.ts +0 -3
- package/lib/inngest/prompt.js +0 -871
- package/lib/inngest/prompt.js.map +0 -1
package/lib/inngest/utils.js
CHANGED
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
import {Sandbox}from'@e2b/code-interpreter';async function getSandbox(sandboxId) {
|
|
2
2
|
const sandbox = await Sandbox.connect(sandboxId);
|
|
3
3
|
return sandbox;
|
|
4
|
-
}
|
|
5
|
-
function lastAssistantTextMessageContent(result) {
|
|
6
|
-
// Find the last assistant message by iterating backwards
|
|
7
|
-
let lastAssistantTextMessageIndex = -1;
|
|
8
|
-
for (let i = result.output.length - 1; i >= 0; i--) {
|
|
9
|
-
if (result.output[i].role === 'assistant') {
|
|
10
|
-
lastAssistantTextMessageIndex = i;
|
|
11
|
-
break;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const message = lastAssistantTextMessageIndex >= 0 ? result.output[lastAssistantTextMessageIndex] : undefined;
|
|
15
|
-
return message?.content ? typeof message.content === 'string' ? message.content : message.content.map(c => c.text).join('') : undefined;
|
|
16
|
-
}
|
|
17
|
-
const parseAgentOutput = value => {
|
|
18
|
-
const output = value[0];
|
|
19
|
-
if (output.type !== 'text') {
|
|
20
|
-
return 'Fragment';
|
|
21
|
-
}
|
|
22
|
-
let content = '';
|
|
23
|
-
if (Array.isArray(output.content)) {
|
|
24
|
-
content = output.content.map(txt => txt).join('');
|
|
25
|
-
} else {
|
|
26
|
-
content = output.content;
|
|
27
|
-
}
|
|
28
|
-
// Clean the content by removing any remaining task_summary and canvas_layers tags
|
|
29
|
-
content = content.replace(/<task_summary>([\s\S]*?)<\/task_summary>/, '$1');
|
|
30
|
-
content = content.replace(/<canvas_layers>[\s\S]*?<\/canvas_layers>/g, '');
|
|
31
|
-
return content.trim() || 'Fragment';
|
|
32
|
-
};export{getSandbox,lastAssistantTextMessageContent,parseAgentOutput};//# sourceMappingURL=utils.js.map
|
|
4
|
+
}export{getSandbox};//# sourceMappingURL=utils.js.map
|
package/lib/inngest/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/inngest/utils.ts"],"sourcesContent":[null],"names":[],"mappings":"4CAGO,eAAe,UAAU,CAAC,SAAiB,EAAA;QAC9C,OAAM,SAAU,OAAM,CAAA,OAAQ,CAAA,SAAQ,CAAA;AACtC,EAAA,OAAA;AACJ
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/inngest/utils.ts"],"sourcesContent":[null],"names":[],"mappings":"4CAGO,eAAe,UAAU,CAAC,SAAiB,EAAA;QAC9C,OAAM,SAAU,OAAM,CAAA,OAAQ,CAAA,SAAQ,CAAA;AACtC,EAAA,OAAA;AACJ"}
|
package/lib/module.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {Feature}from'@common-stack/server-core';import {schema}from'./graphql/schema/index.js';import {messengerResolvers}from'./graphql/resolvers/index.js';import {serviceContainerModule,proxyServiceContainerModule}from'./containers/containers.js';import {contextServicesFromContainer}from'./containers/context-services-from-container.js';import {ChannelMoleculerService}from'./plugins/channel-moleculer-service.js';import {PostMoleculerService}from'./plugins/post-moleculer-service.js';import {PostThreadMoleculerService}from'./plugins/post-thread-moleculer-service.js';import {ReactionMoleculerService}from'./plugins/reaction-moleculer-service.js';import {ExtendedTokenAccountMoleculerService}from'./plugins/extended-token-account-moleculer-service.js';import {MessengerNotificationMoleculerService}from'./plugins/messenger-notification-moleculer-service.js';import'./preferences/settings/post-settings.js';import {InboxRolesContribution}from'./preferences/permissions/inbox-permission-contribution.js';import {InboxRolesPermissionOverwrite}from'./preferences/permissions/inbox-roles-permission-overwrite.js'
|
|
1
|
+
import {Feature}from'@common-stack/server-core';import {schema}from'./graphql/schema/index.js';import {messengerResolvers}from'./graphql/resolvers/index.js';import {serviceContainerModule,proxyServiceContainerModule}from'./containers/containers.js';import {contextServicesFromContainer}from'./containers/context-services-from-container.js';import {ChannelMoleculerService}from'./plugins/channel-moleculer-service.js';import {PostMoleculerService}from'./plugins/post-moleculer-service.js';import {PostThreadMoleculerService}from'./plugins/post-thread-moleculer-service.js';import {ReactionMoleculerService}from'./plugins/reaction-moleculer-service.js';import {ExtendedTokenAccountMoleculerService}from'./plugins/extended-token-account-moleculer-service.js';import {MessengerNotificationMoleculerService}from'./plugins/messenger-notification-moleculer-service.js';import'./preferences/settings/post-settings.js';import {InboxRolesContribution}from'./preferences/permissions/inbox-permission-contribution.js';import {InboxRolesPermissionOverwrite}from'./preferences/permissions/inbox-roles-permission-overwrite.js';// import { inngestFunctionsFactory } from './inngest/factory';
|
|
2
|
+
var MessengerModule = new Feature({
|
|
2
3
|
schema,
|
|
3
4
|
createContainerFunc: [proxyServiceContainerModule],
|
|
4
5
|
createHemeraContainerFunc: [serviceContainerModule],
|
|
@@ -11,12 +12,6 @@ import {Feature}from'@common-stack/server-core';import {schema}from'./graphql/sc
|
|
|
11
12
|
overwriteRolesPermissions: InboxRolesPermissionOverwrite
|
|
12
13
|
},
|
|
13
14
|
addBrokerClientServiceClass: [ChannelMoleculerService, PostMoleculerService, PostThreadMoleculerService, ReactionMoleculerService, MessengerNotificationMoleculerService, ExtendedTokenAccountMoleculerService],
|
|
14
|
-
addBrokerMainServiceClass: []
|
|
15
|
-
inngestFunctions: [({
|
|
16
|
-
container,
|
|
17
|
-
inngest
|
|
18
|
-
}) => inngestFunctionsFactory({
|
|
19
|
-
container,
|
|
20
|
-
inngest
|
|
21
|
-
})]
|
|
15
|
+
addBrokerMainServiceClass: []
|
|
16
|
+
//inngestFunctions: [({ container, inngest }) => inngestFunctionsFactory({ container, inngest })],
|
|
22
17
|
});export{MessengerModule as default};//# sourceMappingURL=module.js.map
|
package/lib/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[null],"names":[],"mappings":"wlCAYA;AAEA,sBAAe,IAAI,OAAO,CAAC;QACvB;qBACA,EAAmB,CAAA,2BAAG,CAAA;2BACtB,EAAyB,CAAA,sBAAG,CAAA;AAC5B,EAAA,mBAAA,EAAmB,kBAAE;AACrB,EAAA,iBAAA,EAAiB,4BAAE;AACnB,EAAA,cAAA,EAAc;qBACV,EAAA,CAAA,sBAAoB;AACvB,GAAA;AACD,EAAA,WAAA,EAAW;AACP,IAAA,yBAAA,EAAA;AACH,GAAA;AACD,EAAA,2BAAA,EAA2B,CAAA,uBAAE,EAAA,oBAAA,EAAA,0BAAA,EAAA,wBAAA,EAAA,qCAAA,EAAA,oCAAA,CAAA;2BACzB,EAAA;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/platform-server",
|
|
3
|
-
"version": "10.0.3-alpha.
|
|
3
|
+
"version": "10.0.3-alpha.117",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@container-stack/mailing-api": "5.4.1-alpha.32",
|
|
23
23
|
"@e2b/code-interpreter": "^1.5.1",
|
|
24
24
|
"@inngest/agent-kit": "^0.8.3",
|
|
25
|
-
"@messenger-box/core": "10.0.3-alpha.
|
|
25
|
+
"@messenger-box/core": "10.0.3-alpha.117",
|
|
26
26
|
"@skoropletov/moleculer-cron-tasks": "~0.0.8",
|
|
27
27
|
"date-fns": "^4.1.0",
|
|
28
28
|
"inngest": "^3.39.2"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"typescript": {
|
|
76
76
|
"definition": "lib/index.d.ts"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "faa59345ca683b453b6144f10a71d587cf8d9f45"
|
|
79
79
|
}
|
package/lib/inngest/factory.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Container } from 'inversify';
|
|
2
|
-
import type { Inngest } from 'inngest';
|
|
3
|
-
export declare const inngestFunctionsFactory: ({ inngest, container }: {
|
|
4
|
-
container: Container;
|
|
5
|
-
inngest: Inngest;
|
|
6
|
-
}) => import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
7
|
-
event: string;
|
|
8
|
-
}], import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
9
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
10
|
-
logger: import("inngest").Logger;
|
|
11
|
-
error: Error;
|
|
12
|
-
}>>, "triggers">, ({ event, step }: import("inngest").Context<Inngest<import("inngest").ClientOptions>, string, {
|
|
13
|
-
logger: import("inngest").Logger;
|
|
14
|
-
}>) => Promise<{
|
|
15
|
-
channelData: any;
|
|
16
|
-
}>, import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
17
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
18
|
-
logger: import("inngest").Logger;
|
|
19
|
-
error: Error;
|
|
20
|
-
}>, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
21
|
-
event: string;
|
|
22
|
-
}]>[];
|
package/lib/inngest/factory.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {createChannelWorkflowJob,sendMessageHandler,generateAiCodeFunction,recreateSandboxUrlFunction}from'./functions.js';const inngestFunctionsFactory = ({
|
|
2
|
-
inngest,
|
|
3
|
-
container
|
|
4
|
-
}) => [createChannelWorkflowJob(inngest, container), sendMessageHandler(inngest, container), generateAiCodeFunction(inngest, container), recreateSandboxUrlFunction(inngest, container)];export{inngestFunctionsFactory};//# sourceMappingURL=factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sources":["../../src/inngest/factory.ts"],"sourcesContent":[null],"names":[],"mappings":"2HAUO,MAAM,uBAAuB,GAAG,CAAC;AACpC,EAAA,OAAA;AACA,EAAA;AACA,CAAA,KAAA,CAAA,wBAAuB,CAAA,OAAS,EAAA,SAAU,CAAA,EAAA,kBAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,sBAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,0BAAA,CAAA,OAAA,EAAA,SAAA,CAAA"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { IWorkflowJobEventPayload } from 'common/server';
|
|
2
|
-
import type { Inngest } from 'inngest';
|
|
3
|
-
import { Container } from 'inversify';
|
|
4
|
-
export declare const createChannelWorkflowJob: (inngest: Inngest, container: Container) => import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
5
|
-
event: string;
|
|
6
|
-
}], import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
7
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
8
|
-
logger: import("inngest").Logger;
|
|
9
|
-
error: Error;
|
|
10
|
-
}>>, "triggers">, ({ event, step }: import("inngest").Context<Inngest<import("inngest").ClientOptions>, string, {
|
|
11
|
-
logger: import("inngest").Logger;
|
|
12
|
-
}>) => Promise<{
|
|
13
|
-
channelData: any;
|
|
14
|
-
}>, import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
15
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
16
|
-
logger: import("inngest").Logger;
|
|
17
|
-
error: Error;
|
|
18
|
-
}>, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
19
|
-
event: string;
|
|
20
|
-
}]>;
|
|
21
|
-
export declare const sendMessageHandler: (inngest: Inngest, container: Container) => import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
22
|
-
event: string;
|
|
23
|
-
}], import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
24
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
25
|
-
logger: import("inngest").Logger;
|
|
26
|
-
error: Error;
|
|
27
|
-
}>>, "triggers">, ({ event, step }: import("inngest").Context<Inngest<import("inngest").ClientOptions>, string, {
|
|
28
|
-
logger: import("inngest").Logger;
|
|
29
|
-
}>) => Promise<{
|
|
30
|
-
id?: string;
|
|
31
|
-
type?: import("common").Maybe<string>;
|
|
32
|
-
creator?: string;
|
|
33
|
-
createdAt?: string;
|
|
34
|
-
deletedAt?: string;
|
|
35
|
-
updatedAt?: string;
|
|
36
|
-
_id?: string;
|
|
37
|
-
parentId?: import("common").Maybe<string>;
|
|
38
|
-
props?: import("common").Maybe<any>;
|
|
39
|
-
filenames?: string[];
|
|
40
|
-
message?: import("common").Maybe<string>;
|
|
41
|
-
channel?: string;
|
|
42
|
-
author?: string;
|
|
43
|
-
deletedBy?: string;
|
|
44
|
-
editedAt?: string;
|
|
45
|
-
editedBy?: string;
|
|
46
|
-
fields?: string[];
|
|
47
|
-
fromServer?: import("common").Maybe<boolean>;
|
|
48
|
-
hasReactions?: import("common").Maybe<boolean>;
|
|
49
|
-
hashTags?: import("common").Maybe<string>;
|
|
50
|
-
isDelivered?: import("common").Maybe<boolean>;
|
|
51
|
-
isPinned?: import("common").Maybe<boolean>;
|
|
52
|
-
isRead?: import("common").Maybe<boolean>;
|
|
53
|
-
originalId?: import("common").Maybe<string>;
|
|
54
|
-
propsConfiguration?: string;
|
|
55
|
-
reactions?: string[];
|
|
56
|
-
rootId?: import("common").Maybe<string>;
|
|
57
|
-
}>, import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
58
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
59
|
-
logger: import("inngest").Logger;
|
|
60
|
-
error: Error;
|
|
61
|
-
}>, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
62
|
-
event: string;
|
|
63
|
-
}]>;
|
|
64
|
-
export declare const generateAiCodeFunction: (inngest: Inngest, container: Container) => import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
65
|
-
event: string;
|
|
66
|
-
}], import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
67
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
68
|
-
logger: import("inngest").Logger;
|
|
69
|
-
error: Error;
|
|
70
|
-
}>>, "triggers">, ({ event, step, }: {
|
|
71
|
-
event: {
|
|
72
|
-
data: {
|
|
73
|
-
payload: IWorkflowJobEventPayload;
|
|
74
|
-
activeFragmentFiles: any;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
step: any;
|
|
78
|
-
}) => Promise<any>, import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
79
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
80
|
-
logger: import("inngest").Logger;
|
|
81
|
-
error: Error;
|
|
82
|
-
}>, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
83
|
-
event: string;
|
|
84
|
-
}]>;
|
|
85
|
-
export declare const recreateSandboxUrlFunction: (inngest: Inngest, container: Container) => import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
86
|
-
event: string;
|
|
87
|
-
}], import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
88
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
89
|
-
logger: import("inngest").Logger;
|
|
90
|
-
error: Error;
|
|
91
|
-
}>>, "triggers">, ({ event, step }: import("inngest").Context<Inngest<import("inngest").ClientOptions>, string, {
|
|
92
|
-
logger: import("inngest").Logger;
|
|
93
|
-
}>) => Promise<{
|
|
94
|
-
success: boolean;
|
|
95
|
-
messageId: any;
|
|
96
|
-
newSandboxUrl: string;
|
|
97
|
-
newSandboxId: string;
|
|
98
|
-
}>, import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
99
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
100
|
-
logger: import("inngest").Logger;
|
|
101
|
-
error: Error;
|
|
102
|
-
}>, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
103
|
-
event: string;
|
|
104
|
-
}]>;
|
|
105
|
-
export declare const inngestFunctions: ((inngest: Inngest, container: Container) => import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
106
|
-
event: string;
|
|
107
|
-
}], import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
108
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
109
|
-
logger: import("inngest").Logger;
|
|
110
|
-
error: Error;
|
|
111
|
-
}>>, "triggers">, ({ event, step }: import("inngest").Context<Inngest<import("inngest").ClientOptions>, string, {
|
|
112
|
-
logger: import("inngest").Logger;
|
|
113
|
-
}>) => Promise<{
|
|
114
|
-
channelData: any;
|
|
115
|
-
}>, import("inngest").Handler<Inngest<import("inngest").ClientOptions>, string, {
|
|
116
|
-
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
117
|
-
logger: import("inngest").Logger;
|
|
118
|
-
error: Error;
|
|
119
|
-
}>, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, [{
|
|
120
|
-
event: string;
|
|
121
|
-
}]>)[];
|