@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.
Files changed (98) hide show
  1. package/lib/config/env-config.d.ts +7 -0
  2. package/lib/config/env-config.js +20 -0
  3. package/lib/config/env-config.js.map +1 -1
  4. package/lib/containers/containers.js +6 -1
  5. package/lib/containers/containers.js.map +1 -1
  6. package/lib/containers/context-services-from-container.js +4 -2
  7. package/lib/containers/context-services-from-container.js.map +1 -1
  8. package/lib/graphql/resolvers/ai-fragment.d.ts +3 -0
  9. package/lib/graphql/resolvers/ai-fragment.js +276 -0
  10. package/lib/graphql/resolvers/ai-fragment.js.map +1 -0
  11. package/lib/graphql/resolvers/channel.js +29 -0
  12. package/lib/graphql/resolvers/channel.js.map +1 -1
  13. package/lib/graphql/resolvers/index.js +1 -1
  14. package/lib/graphql/resolvers/index.js.map +1 -1
  15. package/lib/graphql/resolvers/post.js +187 -14
  16. package/lib/graphql/resolvers/post.js.map +1 -1
  17. package/lib/graphql/schema/ai-fragment.graphql +311 -0
  18. package/lib/graphql/schema/ai-fragment.graphql.js +1 -0
  19. package/lib/graphql/schema/ai-fragment.graphql.js.map +1 -0
  20. package/lib/graphql/schema/channel.graphql +19 -0
  21. package/lib/graphql/schema/channel.graphql.js +1 -1
  22. package/lib/graphql/schema/index.js +2 -2
  23. package/lib/graphql/schema/index.js.map +1 -1
  24. package/lib/graphql/schema/post.graphql +76 -0
  25. package/lib/graphql/schema/post.graphql.js +1 -1
  26. package/lib/graphql/schema/services.graphql +19 -0
  27. package/lib/index.js.map +1 -1
  28. package/lib/inngest/factory.d.ts +20 -0
  29. package/lib/inngest/factory.js +4 -0
  30. package/lib/inngest/factory.js.map +1 -0
  31. package/lib/inngest/functions.d.ts +235 -0
  32. package/lib/inngest/functions.js +1385 -0
  33. package/lib/inngest/functions.js.map +1 -0
  34. package/lib/inngest/index.d.ts +3 -0
  35. package/lib/inngest/prompt.d.ts +6 -0
  36. package/lib/inngest/prompt.js +871 -0
  37. package/lib/inngest/prompt.js.map +1 -0
  38. package/lib/inngest/utils.d.ts +5 -0
  39. package/lib/inngest/utils.js +32 -0
  40. package/lib/inngest/utils.js.map +1 -0
  41. package/lib/module.js +10 -3
  42. package/lib/module.js.map +1 -1
  43. package/lib/plugins/ai-fragment-moleculer-service.d.ts +29 -0
  44. package/lib/plugins/ai-fragment-moleculer-service.js +516 -0
  45. package/lib/plugins/ai-fragment-moleculer-service.js.map +1 -0
  46. package/lib/plugins/channel-moleculer-service.js +9 -0
  47. package/lib/plugins/channel-moleculer-service.js.map +1 -1
  48. package/lib/plugins/index.d.ts +1 -0
  49. package/lib/plugins/post-moleculer-service.js +116 -0
  50. package/lib/plugins/post-moleculer-service.js.map +1 -1
  51. package/lib/services/ai-fragment-service.d.ts +195 -0
  52. package/lib/services/ai-fragment-service.js +631 -0
  53. package/lib/services/ai-fragment-service.js.map +1 -0
  54. package/lib/services/channel-service.d.ts +4 -2
  55. package/lib/services/channel-service.js +24 -2
  56. package/lib/services/channel-service.js.map +1 -1
  57. package/lib/services/index.d.ts +2 -0
  58. package/lib/services/post-service.d.ts +9 -2
  59. package/lib/services/post-service.js +225 -5
  60. package/lib/services/post-service.js.map +1 -1
  61. package/lib/services/proxy-services/ai-fragment-microservice.d.ts +23 -0
  62. package/lib/services/proxy-services/ai-fragment-microservice.js +78 -0
  63. package/lib/services/proxy-services/ai-fragment-microservice.js.map +1 -0
  64. package/lib/services/proxy-services/channel-microservice.d.ts +2 -1
  65. package/lib/services/proxy-services/channel-microservice.js +6 -0
  66. package/lib/services/proxy-services/channel-microservice.js.map +1 -1
  67. package/lib/services/proxy-services/index.d.ts +1 -0
  68. package/lib/services/proxy-services/post-microservice.d.ts +22 -1
  69. package/lib/services/proxy-services/post-microservice.js +80 -0
  70. package/lib/services/proxy-services/post-microservice.js.map +1 -1
  71. package/lib/services/sandbox-error-service.d.ts +23 -0
  72. package/lib/services/sandbox-error-service.js +422 -0
  73. package/lib/services/sandbox-error-service.js.map +1 -0
  74. package/lib/store/models/ai-fragment.d.ts +4 -0
  75. package/lib/store/models/ai-fragment.js +125 -0
  76. package/lib/store/models/ai-fragment.js.map +1 -0
  77. package/lib/store/models/channel.js +5 -0
  78. package/lib/store/models/channel.js.map +1 -1
  79. package/lib/store/models/index.d.ts +1 -0
  80. package/lib/store/repositories/ai-fragment-repository.d.ts +15 -0
  81. package/lib/store/repositories/ai-fragment-repository.js +69 -0
  82. package/lib/store/repositories/ai-fragment-repository.js.map +1 -0
  83. package/lib/store/repositories/channel-repository.js +1 -1
  84. package/lib/store/repositories/channel-repository.js.map +1 -1
  85. package/lib/store/repositories/index.d.ts +1 -0
  86. package/lib/store/repositories/post-repository.js +1 -1
  87. package/lib/store/repositories/post-repository.js.map +1 -1
  88. package/lib/store/repositories/post-thread-repository.js +1 -1
  89. package/lib/store/repositories/post-thread-repository.js.map +1 -1
  90. package/lib/store/repositories/reaction-repository.js +1 -1
  91. package/lib/store/repositories/reaction-repository.js.map +1 -1
  92. package/lib/templates/constants/SERVER_TYPES.ts.template +4 -1
  93. package/lib/templates/repositories/AiFragmentRepository.ts.template +4 -0
  94. package/lib/templates/services/AiFragmentService.ts.template +123 -0
  95. package/lib/templates/services/ChannelService.ts.template +11 -1
  96. package/lib/templates/services/PostService.ts.template +82 -1
  97. package/lib/templates/services/SandboxErrorService.ts.template +125 -0
  98. 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.72",
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
- "@messenger-box/core": "10.0.3-alpha.72",
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": "b4e54a34578a1a63afbe7ab48644b86e5cc8858f"
79
+ "gitHead": "2bfc901f9f0a9da1919294e1ebd8246edec0a3b0"
74
80
  }