@172ai/containers-mcp-server 1.7.0 → 1.7.2
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/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +190 -2
- package/dist/server.js.map +1 -1
- package/dist/services/buildService.d.ts +39 -53
- package/dist/services/buildService.d.ts.map +1 -1
- package/dist/services/buildService.js +238 -400
- package/dist/services/buildService.js.map +1 -1
- package/dist/services/executionService.d.ts +40 -52
- package/dist/services/executionService.d.ts.map +1 -1
- package/dist/services/executionService.js +291 -325
- package/dist/services/executionService.js.map +1 -1
- package/dist/services/streamingService.d.ts +95 -0
- package/dist/services/streamingService.d.ts.map +1 -0
- package/dist/services/streamingService.js +298 -0
- package/dist/services/streamingService.js.map +1 -0
- package/package.json +8 -7
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { BuildStatus, BuildListResponse, BuildLogEntry, BuildContainerParams, GetBuildStatusParams, ListBuildsParams } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Build management service
|
|
3
|
+
* Build management service with real-time streaming support
|
|
4
|
+
* Replaces polling-based progress tracking with PubNub event streams
|
|
4
5
|
*/
|
|
5
|
-
interface ActiveBuildMonitor {
|
|
6
|
-
containerId: string;
|
|
7
|
-
buildId: string;
|
|
8
|
-
progressToken: string;
|
|
9
|
-
startTime: number;
|
|
10
|
-
lastProgress: number;
|
|
11
|
-
lastLogCount: number;
|
|
12
|
-
status: 'active' | 'completed' | 'failed' | 'cancelled' | 'error';
|
|
13
|
-
retryCount: number;
|
|
14
|
-
timeoutHandle?: NodeJS.Timeout;
|
|
15
|
-
}
|
|
16
6
|
interface StreamAnalytics {
|
|
17
7
|
totalBuilds: number;
|
|
18
8
|
activeBuilds: number;
|
|
@@ -23,48 +13,69 @@ interface StreamAnalytics {
|
|
|
23
13
|
errorsEncountered: number;
|
|
24
14
|
lastActivity: string;
|
|
25
15
|
}
|
|
16
|
+
interface ActiveBuildStream {
|
|
17
|
+
containerId: string;
|
|
18
|
+
buildId: string;
|
|
19
|
+
progressToken: string;
|
|
20
|
+
streamId: string;
|
|
21
|
+
startTime: number;
|
|
22
|
+
lastProgress: number;
|
|
23
|
+
status: 'active' | 'completed' | 'failed' | 'cancelled' | 'error';
|
|
24
|
+
}
|
|
26
25
|
export declare class BuildService {
|
|
27
26
|
private httpClient;
|
|
28
27
|
private mcpServer;
|
|
29
|
-
private
|
|
28
|
+
private activeStreams;
|
|
29
|
+
private progressUpdates;
|
|
30
30
|
private streamAnalytics;
|
|
31
|
-
private maxConcurrentBuilds;
|
|
32
|
-
private globalMonitoringTimeout;
|
|
33
31
|
constructor();
|
|
34
32
|
/**
|
|
35
33
|
* Set MCP server reference for progress notifications
|
|
36
34
|
*/
|
|
37
35
|
setMCPServer(server: any): void;
|
|
38
36
|
/**
|
|
39
|
-
*
|
|
37
|
+
* Get stream analytics and monitoring information
|
|
40
38
|
*/
|
|
41
39
|
getStreamAnalytics(): StreamAnalytics & {
|
|
42
|
-
|
|
40
|
+
activeStreams: ActiveBuildStream[];
|
|
43
41
|
};
|
|
44
42
|
/**
|
|
45
|
-
*
|
|
43
|
+
* Get progress update for a specific token
|
|
44
|
+
*/
|
|
45
|
+
getProgressUpdate(progressToken: string): any | null;
|
|
46
|
+
/**
|
|
47
|
+
* Get all progress updates for debugging
|
|
46
48
|
*/
|
|
47
|
-
|
|
49
|
+
getAllProgressUpdates(): Record<string, any>;
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
51
|
+
* Cancel build monitoring for a specific token
|
|
50
52
|
*/
|
|
51
53
|
cancelBuildMonitoring(progressToken: string, reason?: string): Promise<boolean>;
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
55
|
+
* Start a container build with real-time streaming progress
|
|
54
56
|
*/
|
|
55
|
-
|
|
57
|
+
buildContainer(params: BuildContainerParams, progressToken?: string): Promise<BuildStatus>;
|
|
56
58
|
/**
|
|
57
|
-
*
|
|
59
|
+
* Set up real-time streaming monitoring for build progress
|
|
60
|
+
* Replaces the old polling-based monitoring system
|
|
58
61
|
*/
|
|
59
|
-
private
|
|
62
|
+
private setupStreamingMonitoring;
|
|
60
63
|
/**
|
|
61
|
-
*
|
|
64
|
+
* Handle real-time build stream events
|
|
62
65
|
*/
|
|
63
|
-
private
|
|
66
|
+
private handleBuildStreamEvent;
|
|
64
67
|
/**
|
|
65
|
-
*
|
|
68
|
+
* Convert stream event to progress update format
|
|
66
69
|
*/
|
|
67
|
-
|
|
70
|
+
private convertStreamEventToProgress;
|
|
71
|
+
/**
|
|
72
|
+
* Store progress update with expiration
|
|
73
|
+
*/
|
|
74
|
+
private storeProgressUpdate;
|
|
75
|
+
/**
|
|
76
|
+
* Complete stream monitoring and update analytics
|
|
77
|
+
*/
|
|
78
|
+
private completeStream;
|
|
68
79
|
/**
|
|
69
80
|
* Get build status
|
|
70
81
|
*/
|
|
@@ -77,31 +88,6 @@ export declare class BuildService {
|
|
|
77
88
|
* Get build logs
|
|
78
89
|
*/
|
|
79
90
|
getBuildLogs(containerId: string, buildId?: string): Promise<BuildLogEntry[]>;
|
|
80
|
-
/**
|
|
81
|
-
* Cancel a running build
|
|
82
|
-
*/
|
|
83
|
-
cancelBuild(containerId: string, buildId: string): Promise<{
|
|
84
|
-
success: boolean;
|
|
85
|
-
message: string;
|
|
86
|
-
}>;
|
|
87
|
-
/**
|
|
88
|
-
* Retry a failed build
|
|
89
|
-
*/
|
|
90
|
-
retryBuild(containerId: string, buildId: string): Promise<BuildStatus>;
|
|
91
|
-
/**
|
|
92
|
-
* Get build statistics
|
|
93
|
-
*/
|
|
94
|
-
getBuildStats(containerId?: string): Promise<{
|
|
95
|
-
total: number;
|
|
96
|
-
completed: number;
|
|
97
|
-
failed: number;
|
|
98
|
-
running: number;
|
|
99
|
-
pending: number;
|
|
100
|
-
}>;
|
|
101
|
-
/**
|
|
102
|
-
* Stream build logs (for real-time updates)
|
|
103
|
-
*/
|
|
104
|
-
streamBuildLogs(containerId: string, buildId: string, onLog: (log: BuildLogEntry) => void, onError?: (error: Error) => void, onComplete?: () => void): Promise<void>;
|
|
105
91
|
}
|
|
106
92
|
export declare const buildService: BuildService;
|
|
107
93
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildService.d.ts","sourceRoot":"","sources":["../../src/services/buildService.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"buildService.d.ts","sourceRoot":"","sources":["../../src/services/buildService.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAalB;;;GAGG;AAGH,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB;AAGD,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;CACnE;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,SAAS,CAAoB;IAGrC,OAAO,CAAC,aAA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