@messenger-box/platform-server 10.0.3-alpha.72 → 10.0.3-alpha.74
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/config/env-config.d.ts +7 -0
- package/lib/config/env-config.js +20 -0
- package/lib/config/env-config.js.map +1 -1
- package/lib/containers/containers.js +6 -1
- package/lib/containers/containers.js.map +1 -1
- package/lib/containers/context-services-from-container.js +4 -2
- package/lib/containers/context-services-from-container.js.map +1 -1
- package/lib/graphql/resolvers/ai-fragment.d.ts +3 -0
- package/lib/graphql/resolvers/ai-fragment.js +276 -0
- package/lib/graphql/resolvers/ai-fragment.js.map +1 -0
- package/lib/graphql/resolvers/channel.js +29 -0
- package/lib/graphql/resolvers/channel.js.map +1 -1
- package/lib/graphql/resolvers/index.js +1 -1
- package/lib/graphql/resolvers/index.js.map +1 -1
- package/lib/graphql/resolvers/post.js +187 -14
- package/lib/graphql/resolvers/post.js.map +1 -1
- package/lib/graphql/schema/ai-fragment.graphql +311 -0
- package/lib/graphql/schema/ai-fragment.graphql.js +1 -0
- package/lib/graphql/schema/ai-fragment.graphql.js.map +1 -0
- package/lib/graphql/schema/channel.graphql +19 -0
- package/lib/graphql/schema/channel.graphql.js +1 -1
- package/lib/graphql/schema/index.js +2 -2
- package/lib/graphql/schema/index.js.map +1 -1
- package/lib/graphql/schema/post.graphql +76 -0
- package/lib/graphql/schema/post.graphql.js +1 -1
- package/lib/graphql/schema/services.graphql +19 -0
- package/lib/index.js.map +1 -1
- package/lib/inngest/factory.d.ts +20 -0
- package/lib/inngest/factory.js +4 -0
- package/lib/inngest/factory.js.map +1 -0
- package/lib/inngest/functions.d.ts +235 -0
- package/lib/inngest/functions.js +1385 -0
- package/lib/inngest/functions.js.map +1 -0
- package/lib/inngest/index.d.ts +3 -0
- package/lib/inngest/prompt.d.ts +6 -0
- package/lib/inngest/prompt.js +871 -0
- package/lib/inngest/prompt.js.map +1 -0
- package/lib/inngest/utils.d.ts +5 -0
- package/lib/inngest/utils.js +32 -0
- package/lib/inngest/utils.js.map +1 -0
- package/lib/module.js +10 -3
- package/lib/module.js.map +1 -1
- package/lib/plugins/ai-fragment-moleculer-service.d.ts +29 -0
- package/lib/plugins/ai-fragment-moleculer-service.js +516 -0
- package/lib/plugins/ai-fragment-moleculer-service.js.map +1 -0
- package/lib/plugins/channel-moleculer-service.js +9 -0
- package/lib/plugins/channel-moleculer-service.js.map +1 -1
- package/lib/plugins/index.d.ts +1 -0
- package/lib/plugins/post-moleculer-service.js +116 -0
- package/lib/plugins/post-moleculer-service.js.map +1 -1
- package/lib/services/ai-fragment-service.d.ts +195 -0
- package/lib/services/ai-fragment-service.js +631 -0
- package/lib/services/ai-fragment-service.js.map +1 -0
- package/lib/services/channel-service.d.ts +4 -2
- package/lib/services/channel-service.js +24 -2
- package/lib/services/channel-service.js.map +1 -1
- package/lib/services/index.d.ts +2 -0
- package/lib/services/post-service.d.ts +9 -2
- package/lib/services/post-service.js +225 -5
- package/lib/services/post-service.js.map +1 -1
- package/lib/services/proxy-services/ai-fragment-microservice.d.ts +23 -0
- package/lib/services/proxy-services/ai-fragment-microservice.js +78 -0
- package/lib/services/proxy-services/ai-fragment-microservice.js.map +1 -0
- package/lib/services/proxy-services/channel-microservice.d.ts +2 -1
- package/lib/services/proxy-services/channel-microservice.js +6 -0
- package/lib/services/proxy-services/channel-microservice.js.map +1 -1
- package/lib/services/proxy-services/index.d.ts +1 -0
- package/lib/services/proxy-services/post-microservice.d.ts +22 -1
- package/lib/services/proxy-services/post-microservice.js +80 -0
- package/lib/services/proxy-services/post-microservice.js.map +1 -1
- package/lib/services/sandbox-error-service.d.ts +23 -0
- package/lib/services/sandbox-error-service.js +422 -0
- package/lib/services/sandbox-error-service.js.map +1 -0
- package/lib/store/models/ai-fragment.d.ts +4 -0
- package/lib/store/models/ai-fragment.js +125 -0
- package/lib/store/models/ai-fragment.js.map +1 -0
- package/lib/store/models/channel.js +5 -0
- package/lib/store/models/channel.js.map +1 -1
- package/lib/store/models/index.d.ts +1 -0
- package/lib/store/repositories/ai-fragment-repository.d.ts +15 -0
- package/lib/store/repositories/ai-fragment-repository.js +69 -0
- package/lib/store/repositories/ai-fragment-repository.js.map +1 -0
- package/lib/store/repositories/channel-repository.js +1 -1
- package/lib/store/repositories/channel-repository.js.map +1 -1
- package/lib/store/repositories/index.d.ts +1 -0
- package/lib/store/repositories/post-repository.js +1 -1
- package/lib/store/repositories/post-repository.js.map +1 -1
- package/lib/store/repositories/post-thread-repository.js +1 -1
- package/lib/store/repositories/post-thread-repository.js.map +1 -1
- package/lib/store/repositories/reaction-repository.js +1 -1
- package/lib/store/repositories/reaction-repository.js.map +1 -1
- package/lib/templates/constants/SERVER_TYPES.ts.template +4 -1
- package/lib/templates/repositories/AiFragmentRepository.ts.template +4 -0
- package/lib/templates/services/AiFragmentService.ts.template +123 -0
- package/lib/templates/services/ChannelService.ts.template +11 -1
- package/lib/templates/services/PostService.ts.template +82 -1
- package/lib/templates/services/SandboxErrorService.ts.template +125 -0
- package/package.json +12 -6
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox Error Service Interface
|
|
3
|
+
* --------------------------------
|
|
4
|
+
*
|
|
5
|
+
* This interface defines the monitoring and reporting layer for sandbox runtime,
|
|
6
|
+
* build, and compilation errors during ephemeral development sessions.
|
|
7
|
+
*
|
|
8
|
+
* Key capabilities:
|
|
9
|
+
* - Start/stop intensive error monitoring for a sandbox
|
|
10
|
+
* - Detect compilation, build, server start, and runtime errors
|
|
11
|
+
* - Deduplicate and publish structured error events
|
|
12
|
+
* - Manual error reporting and test error generation
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Structured error payload captured from a sandbox
|
|
17
|
+
*/
|
|
18
|
+
// export interface ISandboxError {
|
|
19
|
+
// /** Unique error id */
|
|
20
|
+
// id: string;
|
|
21
|
+
// /** Project identifier that owns the sandbox */
|
|
22
|
+
// projectId: string;
|
|
23
|
+
// /** Sandbox identifier */
|
|
24
|
+
// sandboxId: string;
|
|
25
|
+
// /** Error classification, e.g. COMPILATION_ERROR, BUILD_ERROR */
|
|
26
|
+
// errorType: string;
|
|
27
|
+
// /** Human-readable error message */
|
|
28
|
+
// message: string;
|
|
29
|
+
// /** Optional stack trace if available */
|
|
30
|
+
// stack?: string;
|
|
31
|
+
// /** ISO timestamp when the error was observed */
|
|
32
|
+
// timestamp: string;
|
|
33
|
+
// /** Optional URL referencing the sandbox */
|
|
34
|
+
// url?: string;
|
|
35
|
+
// /** Whether the error appears programmatically fixable */
|
|
36
|
+
// fixable: boolean;
|
|
37
|
+
// }
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Alias to align with implementation naming where needed
|
|
41
|
+
*/
|
|
42
|
+
// export type SandboxError = ISandboxError;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Common sandbox error categories
|
|
46
|
+
*/
|
|
47
|
+
export enum SandboxErrorType {
|
|
48
|
+
COMPILATION_ERROR = 'COMPILATION_ERROR',
|
|
49
|
+
BUILD_ERROR = 'BUILD_ERROR',
|
|
50
|
+
SERVER_START_ERROR = 'SERVER_START_ERROR',
|
|
51
|
+
SANDBOX_DISCONNECTED = 'SANDBOX_DISCONNECTED',
|
|
52
|
+
UNCAUGHT_EXCEPTION = 'UNCAUGHT_EXCEPTION',
|
|
53
|
+
UNHANDLED_REJECTION = 'UNHANDLED_REJECTION',
|
|
54
|
+
RUNTIME_ERROR = 'RUNTIME_ERROR',
|
|
55
|
+
DEPENDENCY_ERROR = 'DEPENDENCY_ERROR',
|
|
56
|
+
TEST_ERROR = 'TEST_ERROR',
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* PubSub topic for sandbox error events
|
|
61
|
+
*/
|
|
62
|
+
export const SANDBOX_ERROR_TOPIC = 'SANDBOX_ERROR';
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* PubSub payload for sandbox error events
|
|
66
|
+
*/
|
|
67
|
+
// export interface ISandboxErrorEventPayload {
|
|
68
|
+
// sandboxError: {
|
|
69
|
+
// projectId: string;
|
|
70
|
+
// sandboxId: string;
|
|
71
|
+
// error: ISandboxError;
|
|
72
|
+
// };
|
|
73
|
+
// }
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Sandbox Error Service contract
|
|
77
|
+
*/
|
|
78
|
+
export interface ISandboxErrorService {
|
|
79
|
+
/**
|
|
80
|
+
* Starts intensive error monitoring for the given sandbox.
|
|
81
|
+
*
|
|
82
|
+
* @param {string} projectId - Project identifier
|
|
83
|
+
* @param {string} sandboxId - Sandbox identifier
|
|
84
|
+
* @param {string} url - Optional friendly URL for the sandbox
|
|
85
|
+
* @returns {Promise<void>}
|
|
86
|
+
*/
|
|
87
|
+
startErrorMonitoring(projectId: string, sandboxId: string, url: string,id?:string): Promise<void>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Stops error monitoring for the given sandbox and clears any state.
|
|
91
|
+
*
|
|
92
|
+
* @param {string} sandboxId - Sandbox identifier
|
|
93
|
+
* @returns {Promise<void>}
|
|
94
|
+
*/
|
|
95
|
+
stopErrorMonitoring(sandboxId: string): Promise<void>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Manually reports an error for a sandbox.
|
|
99
|
+
*
|
|
100
|
+
* @param {string} projectId - Project identifier
|
|
101
|
+
* @param {string} sandboxId - Sandbox identifier
|
|
102
|
+
* @param {string} errorType - Error classification
|
|
103
|
+
* @param {string} message - Error message
|
|
104
|
+
* @param {string} [stack] - Optional stack trace
|
|
105
|
+
* @param {string} [url] - Optional sandbox URL
|
|
106
|
+
* @returns {Promise<void>}
|
|
107
|
+
*/
|
|
108
|
+
reportError(
|
|
109
|
+
projectId: string,
|
|
110
|
+
sandboxId: string,
|
|
111
|
+
errorType: string,
|
|
112
|
+
message: string,
|
|
113
|
+
stack?: string,
|
|
114
|
+
url?: string,
|
|
115
|
+
id?:string
|
|
116
|
+
): Promise<void>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Triggers a test error publication for diagnostics.
|
|
120
|
+
*
|
|
121
|
+
* @param {string} projectId - Project identifier
|
|
122
|
+
* @returns {Promise<void>}
|
|
123
|
+
*/
|
|
124
|
+
triggerTestError(projectId: string,id?:string): Promise<void>;
|
|
125
|
+
}
|
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.74",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -20,9 +20,12 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@container-stack/mailing-api": "5.4.1-alpha.9",
|
|
23
|
-
"@
|
|
23
|
+
"@e2b/code-interpreter": "^1.5.1",
|
|
24
|
+
"@inngest/agent-kit": "^0.8.3",
|
|
25
|
+
"@messenger-box/core": "10.0.3-alpha.74",
|
|
24
26
|
"@skoropletov/moleculer-cron-tasks": "~0.0.8",
|
|
25
|
-
"date-fns": "^4.1.0"
|
|
27
|
+
"date-fns": "^4.1.0",
|
|
28
|
+
"inngest": "^3.39.2"
|
|
26
29
|
},
|
|
27
30
|
"peerDependencies": {
|
|
28
31
|
"@adminide-stack/account-api-server": "*",
|
|
@@ -57,18 +60,21 @@
|
|
|
57
60
|
"./${libDir}/templates/services/PostService.ts.template",
|
|
58
61
|
"./${libDir}/templates/services/PostThreadService.ts.template",
|
|
59
62
|
"./${libDir}/templates/services/ReactionService.ts.template",
|
|
60
|
-
"./${libDir}/templates/services/RedisCacheManager.ts.template"
|
|
63
|
+
"./${libDir}/templates/services/RedisCacheManager.ts.template",
|
|
64
|
+
"./${libDir}/templates/services/SandboxErrorService.ts.template",
|
|
65
|
+
"./${libDir}/templates/services/AiFragmentService.ts.template"
|
|
61
66
|
],
|
|
62
67
|
"repositories": [
|
|
63
68
|
"./${libDir}/templates/repositories/ChannelRepository.ts.template",
|
|
64
69
|
"./${libDir}/templates/repositories/PostRepository.ts.template",
|
|
65
70
|
"./${libDir}/templates/repositories/PostThreadRepository.ts.template",
|
|
66
|
-
"./${libDir}/templates/repositories/ReactionRepository.ts.template"
|
|
71
|
+
"./${libDir}/templates/repositories/ReactionRepository.ts.template",
|
|
72
|
+
"./${libDir}/templates/repositories/AiFragmentRepository.ts.template"
|
|
67
73
|
]
|
|
68
74
|
}
|
|
69
75
|
},
|
|
70
76
|
"typescript": {
|
|
71
77
|
"definition": "lib/index.d.ts"
|
|
72
78
|
},
|
|
73
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "2bfc901f9f0a9da1919294e1ebd8246edec0a3b0"
|
|
74
80
|
}
|