buildhive-agent 1.0.0-beta.1

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 (170) hide show
  1. package/README.md +166 -0
  2. package/dist/__tests__/fakes/FakeDockerManager.d.ts +115 -0
  3. package/dist/__tests__/fakes/FakeDockerManager.d.ts.map +1 -0
  4. package/dist/__tests__/fakes/FakeDockerManager.js +203 -0
  5. package/dist/__tests__/fakes/FakeDockerManager.js.map +1 -0
  6. package/dist/acceptanceChecker.d.ts +26 -0
  7. package/dist/acceptanceChecker.d.ts.map +1 -0
  8. package/dist/acceptanceChecker.js +64 -0
  9. package/dist/acceptanceChecker.js.map +1 -0
  10. package/dist/advancedAgent.d.ts +161 -0
  11. package/dist/advancedAgent.d.ts.map +1 -0
  12. package/dist/advancedAgent.js +604 -0
  13. package/dist/advancedAgent.js.map +1 -0
  14. package/dist/agent.d.ts +101 -0
  15. package/dist/agent.d.ts.map +1 -0
  16. package/dist/agent.js +490 -0
  17. package/dist/agent.js.map +1 -0
  18. package/dist/api/jobStatusApi.d.ts +88 -0
  19. package/dist/api/jobStatusApi.d.ts.map +1 -0
  20. package/dist/api/jobStatusApi.js +240 -0
  21. package/dist/api/jobStatusApi.js.map +1 -0
  22. package/dist/autoUpdater.d.ts +135 -0
  23. package/dist/autoUpdater.d.ts.map +1 -0
  24. package/dist/autoUpdater.js +494 -0
  25. package/dist/autoUpdater.js.map +1 -0
  26. package/dist/cacheManager.d.ts +108 -0
  27. package/dist/cacheManager.d.ts.map +1 -0
  28. package/dist/cacheManager.js +300 -0
  29. package/dist/cacheManager.js.map +1 -0
  30. package/dist/cli.d.ts +11 -0
  31. package/dist/cli.d.ts.map +1 -0
  32. package/dist/cli.js +749 -0
  33. package/dist/cli.js.map +1 -0
  34. package/dist/config/index.d.ts +30 -0
  35. package/dist/config/index.d.ts.map +1 -0
  36. package/dist/config/index.js +35 -0
  37. package/dist/config/index.js.map +1 -0
  38. package/dist/config/loader.d.ts +45 -0
  39. package/dist/config/loader.d.ts.map +1 -0
  40. package/dist/config/loader.js +269 -0
  41. package/dist/config/loader.js.map +1 -0
  42. package/dist/config/types.d.ts +193 -0
  43. package/dist/config/types.d.ts.map +1 -0
  44. package/dist/config/types.js +90 -0
  45. package/dist/config/types.js.map +1 -0
  46. package/dist/config/validation.d.ts +28 -0
  47. package/dist/config/validation.d.ts.map +1 -0
  48. package/dist/config/validation.js +397 -0
  49. package/dist/config/validation.js.map +1 -0
  50. package/dist/docker.d.ts +96 -0
  51. package/dist/docker.d.ts.map +1 -0
  52. package/dist/docker.js +411 -0
  53. package/dist/docker.js.map +1 -0
  54. package/dist/enhancedJobExecutor.d.ts +81 -0
  55. package/dist/enhancedJobExecutor.d.ts.map +1 -0
  56. package/dist/enhancedJobExecutor.js +223 -0
  57. package/dist/enhancedJobExecutor.js.map +1 -0
  58. package/dist/executors/executorFactory.d.ts +46 -0
  59. package/dist/executors/executorFactory.d.ts.map +1 -0
  60. package/dist/executors/executorFactory.js +80 -0
  61. package/dist/executors/executorFactory.js.map +1 -0
  62. package/dist/executors/index.d.ts +7 -0
  63. package/dist/executors/index.d.ts.map +1 -0
  64. package/dist/executors/index.js +6 -0
  65. package/dist/executors/index.js.map +1 -0
  66. package/dist/executors/nativeExecutor.d.ts +60 -0
  67. package/dist/executors/nativeExecutor.d.ts.map +1 -0
  68. package/dist/executors/nativeExecutor.js +311 -0
  69. package/dist/executors/nativeExecutor.js.map +1 -0
  70. package/dist/executors/types.d.ts +38 -0
  71. package/dist/executors/types.d.ts.map +1 -0
  72. package/dist/executors/types.js +9 -0
  73. package/dist/executors/types.js.map +1 -0
  74. package/dist/healthMonitor.d.ts +213 -0
  75. package/dist/healthMonitor.d.ts.map +1 -0
  76. package/dist/healthMonitor.js +547 -0
  77. package/dist/healthMonitor.js.map +1 -0
  78. package/dist/index.d.ts +16 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +16 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/jobExecutor.d.ts +117 -0
  83. package/dist/jobExecutor.d.ts.map +1 -0
  84. package/dist/jobExecutor.js +458 -0
  85. package/dist/jobExecutor.js.map +1 -0
  86. package/dist/lifecycleExecutor.d.ts +54 -0
  87. package/dist/lifecycleExecutor.d.ts.map +1 -0
  88. package/dist/lifecycleExecutor.js +230 -0
  89. package/dist/lifecycleExecutor.js.map +1 -0
  90. package/dist/main.d.ts +15 -0
  91. package/dist/main.d.ts.map +1 -0
  92. package/dist/main.js +77 -0
  93. package/dist/main.js.map +1 -0
  94. package/dist/metrics.d.ts +103 -0
  95. package/dist/metrics.d.ts.map +1 -0
  96. package/dist/metrics.js +360 -0
  97. package/dist/metrics.js.map +1 -0
  98. package/dist/recipes/builtinRecipes.d.ts +11 -0
  99. package/dist/recipes/builtinRecipes.d.ts.map +1 -0
  100. package/dist/recipes/builtinRecipes.js +688 -0
  101. package/dist/recipes/builtinRecipes.js.map +1 -0
  102. package/dist/recipes/index.d.ts +18 -0
  103. package/dist/recipes/index.d.ts.map +1 -0
  104. package/dist/recipes/index.js +17 -0
  105. package/dist/recipes/index.js.map +1 -0
  106. package/dist/recipes/recipeRegistry.d.ts +49 -0
  107. package/dist/recipes/recipeRegistry.d.ts.map +1 -0
  108. package/dist/recipes/recipeRegistry.js +264 -0
  109. package/dist/recipes/recipeRegistry.js.map +1 -0
  110. package/dist/recipes/types.d.ts +116 -0
  111. package/dist/recipes/types.d.ts.map +1 -0
  112. package/dist/recipes/types.js +10 -0
  113. package/dist/recipes/types.js.map +1 -0
  114. package/dist/recovery.d.ts +133 -0
  115. package/dist/recovery.d.ts.map +1 -0
  116. package/dist/recovery.js +299 -0
  117. package/dist/recovery.js.map +1 -0
  118. package/dist/registration/apiClient.d.ts +44 -0
  119. package/dist/registration/apiClient.d.ts.map +1 -0
  120. package/dist/registration/apiClient.js +149 -0
  121. package/dist/registration/apiClient.js.map +1 -0
  122. package/dist/registration/index.d.ts +41 -0
  123. package/dist/registration/index.d.ts.map +1 -0
  124. package/dist/registration/index.js +141 -0
  125. package/dist/registration/index.js.map +1 -0
  126. package/dist/registration/machineId.d.ts +30 -0
  127. package/dist/registration/machineId.d.ts.map +1 -0
  128. package/dist/registration/machineId.js +89 -0
  129. package/dist/registration/machineId.js.map +1 -0
  130. package/dist/registration/types.d.ts +32 -0
  131. package/dist/registration/types.d.ts.map +1 -0
  132. package/dist/registration/types.js +9 -0
  133. package/dist/registration/types.js.map +1 -0
  134. package/dist/resourceGovernor.d.ts +57 -0
  135. package/dist/resourceGovernor.d.ts.map +1 -0
  136. package/dist/resourceGovernor.js +125 -0
  137. package/dist/resourceGovernor.js.map +1 -0
  138. package/dist/security/secretManager.d.ts +107 -0
  139. package/dist/security/secretManager.d.ts.map +1 -0
  140. package/dist/security/secretManager.js +361 -0
  141. package/dist/security/secretManager.js.map +1 -0
  142. package/dist/security.d.ts +134 -0
  143. package/dist/security.d.ts.map +1 -0
  144. package/dist/security.js +470 -0
  145. package/dist/security.js.map +1 -0
  146. package/dist/storage/artifactUploader.d.ts +155 -0
  147. package/dist/storage/artifactUploader.d.ts.map +1 -0
  148. package/dist/storage/artifactUploader.js +554 -0
  149. package/dist/storage/artifactUploader.js.map +1 -0
  150. package/dist/types.d.ts +49 -0
  151. package/dist/types.d.ts.map +1 -0
  152. package/dist/types.js +7 -0
  153. package/dist/types.js.map +1 -0
  154. package/dist/utils/capabilities.d.ts +23 -0
  155. package/dist/utils/capabilities.d.ts.map +1 -0
  156. package/dist/utils/capabilities.js +200 -0
  157. package/dist/utils/capabilities.js.map +1 -0
  158. package/dist/utils/logger.d.ts +20 -0
  159. package/dist/utils/logger.d.ts.map +1 -0
  160. package/dist/utils/logger.js +188 -0
  161. package/dist/utils/logger.js.map +1 -0
  162. package/dist/utils/sdkScanner.d.ts +105 -0
  163. package/dist/utils/sdkScanner.d.ts.map +1 -0
  164. package/dist/utils/sdkScanner.js +459 -0
  165. package/dist/utils/sdkScanner.js.map +1 -0
  166. package/dist/websocketClient.d.ts +154 -0
  167. package/dist/websocketClient.d.ts.map +1 -0
  168. package/dist/websocketClient.js +422 -0
  169. package/dist/websocketClient.js.map +1 -0
  170. package/package.json +64 -0
@@ -0,0 +1,223 @@
1
+ /**
2
+ * Enhanced Job Executor
3
+ *
4
+ * Orchestrates the full enhanced pipeline with recipe awareness:
5
+ * 1. Acceptance check (should we accept this job?)
6
+ * 2. Resource governance check (do we have resources?)
7
+ * 3. Recipe detection (what kind of project is this?)
8
+ * 4. Recipe application (merge recipe config into job)
9
+ * 5. Executor selection (Docker vs Native)
10
+ * 6. Cache setup (mount cache volumes)
11
+ * 7. Lifecycle execution (setup -> build -> teardown)
12
+ * 8. Cache save (update metadata)
13
+ * 9. Result reporting
14
+ *
15
+ * This module does NOT modify the existing JobExecutor. It wraps
16
+ * the new subsystems (RecipeRegistry, CacheManager, AcceptanceChecker,
17
+ * ResourceGovernor, ExecutorFactory, LifecycleExecutor) into a single
18
+ * cohesive pipeline.
19
+ */
20
+ import { ExecutorFactory } from './executors/executorFactory.js';
21
+ import { LifecycleExecutor } from './lifecycleExecutor.js';
22
+ const defaultSnapshotProvider = () => ({
23
+ cpuPercent: 10,
24
+ memoryPercent: 30,
25
+ diskFreeGB: 50,
26
+ activeJobs: 0,
27
+ });
28
+ // ---------------------------------------------------------------------------
29
+ // EnhancedJobExecutor
30
+ // ---------------------------------------------------------------------------
31
+ export class EnhancedJobExecutor {
32
+ recipeRegistry;
33
+ cacheManager;
34
+ acceptanceChecker;
35
+ resourceGovernor;
36
+ config;
37
+ lifecycleExecutor;
38
+ snapshotProvider;
39
+ constructor(recipeRegistry, cacheManager, acceptanceChecker, resourceGovernor, config, snapshotProvider) {
40
+ this.recipeRegistry = recipeRegistry;
41
+ this.cacheManager = cacheManager;
42
+ this.acceptanceChecker = acceptanceChecker;
43
+ this.resourceGovernor = resourceGovernor;
44
+ this.config = config;
45
+ this.lifecycleExecutor = new LifecycleExecutor();
46
+ this.snapshotProvider = snapshotProvider ?? defaultSnapshotProvider;
47
+ }
48
+ // -----------------------------------------------------------------------
49
+ // Public API
50
+ // -----------------------------------------------------------------------
51
+ async executeJob(job, callbacks) {
52
+ const startTime = Date.now();
53
+ const allLogs = [];
54
+ const log = (msg) => {
55
+ allLogs.push(msg);
56
+ callbacks?.onLog?.(msg);
57
+ };
58
+ // ---- Step 1: Acceptance check ----
59
+ callbacks?.onProgress?.(5, 'acceptance-check');
60
+ log('[enhanced] Checking acceptance rules...');
61
+ const recipeName = job.recipe ?? undefined;
62
+ const candidate = {
63
+ recipe: recipeName,
64
+ repository: job.repository,
65
+ requiresDocker: (job.executionMode ?? this.config.executionMode) === 'docker',
66
+ };
67
+ const acceptance = this.acceptanceChecker.shouldAccept(candidate);
68
+ if (!acceptance.accepted) {
69
+ log(`[enhanced] Job rejected by acceptance checker: ${acceptance.reason}`);
70
+ return this.rejectionResult(acceptance.reason, startTime, allLogs);
71
+ }
72
+ // ---- Step 2: Resource governance check ----
73
+ callbacks?.onProgress?.(10, 'resource-check');
74
+ log('[enhanced] Checking resource availability...');
75
+ const snapshot = this.snapshotProvider();
76
+ const resourceDecision = this.resourceGovernor.canAcceptJob(snapshot);
77
+ if (!resourceDecision.allowed) {
78
+ log(`[enhanced] Job rejected by resource governor: ${resourceDecision.reason}`);
79
+ return this.rejectionResult(resourceDecision.reason, startTime, allLogs);
80
+ }
81
+ // ---- Step 3: Recipe detection ----
82
+ callbacks?.onProgress?.(15, 'recipe-detection');
83
+ log('[enhanced] Detecting recipe...');
84
+ let recipe;
85
+ if (job.recipe) {
86
+ // Explicit recipe override
87
+ recipe = this.recipeRegistry.get(job.recipe);
88
+ if (recipe) {
89
+ log(`[enhanced] Using explicit recipe: ${recipe.name}`);
90
+ }
91
+ else {
92
+ log(`[enhanced] Explicit recipe "${job.recipe}" not found, proceeding without recipe`);
93
+ }
94
+ }
95
+ else {
96
+ // Auto-detect
97
+ const matches = await this.recipeRegistry.detectRecipe(job.workDir);
98
+ if (matches.length > 0) {
99
+ recipe = matches[0].recipe;
100
+ log(`[enhanced] Auto-detected recipe: ${recipe.name} (confidence: ${matches[0].confidence})`);
101
+ }
102
+ else {
103
+ log('[enhanced] No recipe detected, using job defaults');
104
+ }
105
+ }
106
+ // ---- Step 4: Apply recipe overrides ----
107
+ callbacks?.onProgress?.(20, 'recipe-apply');
108
+ const effectiveDockerImage = recipe?.dockerImage ?? job.dockerImage;
109
+ const effectiveEnv = {
110
+ ...(recipe?.environment ?? {}),
111
+ ...(job.environment ?? {}),
112
+ };
113
+ const effectiveBuildCommand = job.buildCommand || recipe?.defaultBuildCommand || 'echo "No build command"';
114
+ const setupSteps = recipe?.setup ?? [];
115
+ const teardownSteps = recipe?.teardown ?? [];
116
+ const effectiveArtifacts = job.artifacts ?? recipe?.artifacts?.paths ?? [];
117
+ const effectiveMode = job.executionMode ?? recipe?.executionMode ?? this.config.executionMode;
118
+ if (recipe) {
119
+ log(`[enhanced] Recipe applied: dockerImage=${effectiveDockerImage}, env keys=[${Object.keys(effectiveEnv).join(',')}]`);
120
+ }
121
+ // ---- Step 5: Executor selection ----
122
+ callbacks?.onProgress?.(25, 'executor-selection');
123
+ const executor = ExecutorFactory.create({
124
+ mode: effectiveMode,
125
+ dockerAvailable: this.config.dockerAvailable,
126
+ jobRequirements: {
127
+ requiredOS: recipe?.requiredOS,
128
+ executionMode: effectiveMode,
129
+ },
130
+ });
131
+ const executionMode = executor.type;
132
+ log(`[enhanced] Selected executor: ${executionMode}`);
133
+ // ---- Step 6: Cache setup ----
134
+ callbacks?.onProgress?.(30, 'cache-setup');
135
+ let cacheMounts = [];
136
+ let cacheHit = false;
137
+ if (recipe?.cache) {
138
+ log('[enhanced] Setting up cache volumes...');
139
+ cacheMounts = this.cacheManager.generateVolumeMounts(recipe.cache);
140
+ // A cache "hit" means we already have entries for these paths
141
+ cacheHit = cacheMounts.length > 0;
142
+ log(`[enhanced] Generated ${cacheMounts.length} cache volume mounts`);
143
+ }
144
+ // ---- Step 7: Lifecycle execution ----
145
+ callbacks?.onProgress?.(35, 'lifecycle-execution');
146
+ log('[enhanced] Starting lifecycle execution...');
147
+ let lifecycleResult;
148
+ try {
149
+ lifecycleResult = await this.lifecycleExecutor.execute(setupSteps, effectiveBuildCommand, teardownSteps, {
150
+ workDir: job.workDir,
151
+ environment: effectiveEnv,
152
+ onProgress: (phase, step, progress) => {
153
+ // Map lifecycle progress (0-100) into the 35-95 range
154
+ const mappedProgress = 35 + Math.round(progress * 0.6);
155
+ callbacks?.onProgress?.(mappedProgress, `${phase}:${step}`);
156
+ },
157
+ onLog: (_phase, _step, logLine) => {
158
+ log(logLine);
159
+ },
160
+ });
161
+ }
162
+ catch (error) {
163
+ const errorMsg = error instanceof Error ? error.message : String(error);
164
+ log(`[enhanced] Lifecycle execution error: ${errorMsg}`);
165
+ return {
166
+ success: false,
167
+ exitCode: 1,
168
+ logs: allLogs.join('\n'),
169
+ artifacts: [],
170
+ durationMs: Date.now() - startTime,
171
+ recipe: recipe?.name,
172
+ cacheHit,
173
+ executionMode,
174
+ rejection: undefined,
175
+ };
176
+ }
177
+ // ---- Step 8: Cache save ----
178
+ callbacks?.onProgress?.(96, 'cache-save');
179
+ if (recipe?.cache) {
180
+ log('[enhanced] Saving cache metadata...');
181
+ try {
182
+ await this.cacheManager.saveMetadata();
183
+ }
184
+ catch (error) {
185
+ log(`[enhanced] Cache save warning: ${error instanceof Error ? error.message : String(error)}`);
186
+ }
187
+ }
188
+ // ---- Step 9: Result reporting ----
189
+ callbacks?.onProgress?.(100, 'complete');
190
+ const success = lifecycleResult.overallSuccess;
191
+ log(`[enhanced] Job ${job.id} ${success ? 'completed successfully' : 'failed'} (duration: ${lifecycleResult.totalDurationMs}ms)`);
192
+ return {
193
+ success,
194
+ exitCode: lifecycleResult.executeResult.exitCode,
195
+ logs: allLogs.join('\n'),
196
+ artifacts: effectiveArtifacts,
197
+ durationMs: Date.now() - startTime,
198
+ recipe: recipe?.name,
199
+ cacheHit,
200
+ executionMode,
201
+ lifecycleResults: {
202
+ setupResults: lifecycleResult.setupResults,
203
+ teardownResults: lifecycleResult.teardownResults,
204
+ },
205
+ };
206
+ }
207
+ // -----------------------------------------------------------------------
208
+ // Private helpers
209
+ // -----------------------------------------------------------------------
210
+ rejectionResult(reason, startTime, logs) {
211
+ return {
212
+ success: false,
213
+ exitCode: -1,
214
+ logs: logs.join('\n'),
215
+ artifacts: [],
216
+ durationMs: Date.now() - startTime,
217
+ cacheHit: false,
218
+ executionMode: 'docker',
219
+ rejection: { reason },
220
+ };
221
+ }
222
+ }
223
+ //# sourceMappingURL=enhancedJobExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enhancedJobExecutor.js","sourceRoot":"","sources":["../src/enhancedJobExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAmB,MAAM,wBAAwB,CAAC;AA0D5E,MAAM,uBAAuB,GAA6B,GAAG,EAAE,CAAC,CAAC;IAC/D,UAAU,EAAE,EAAE;IACd,aAAa,EAAE,EAAE;IACjB,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,CAAC;CACd,CAAC,CAAC;AAEH,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E,MAAM,OAAO,mBAAmB;IAKpB;IACA;IACA;IACA;IACA;IARF,iBAAiB,CAAoB;IACrC,gBAAgB,CAA2B;IAEnD,YACU,cAA8B,EAC9B,YAA0B,EAC1B,iBAAoC,EACpC,gBAAkC,EAClC,MAAiC,EACzC,gBAA2C;QALnC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,WAAM,GAAN,MAAM,CAA2B;QAGzC,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC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AkB,GAAG,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,eAAe,eAAe,CAAC,eAAe,KAAK,CAAC,CAAC;QAElI,OAAO;YACL,OAAO;YACP,QAAQ,EAAE,eAAe,CAAC,aAAa,CAAC,QAAQ;YAChD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACxB,SAAS,EAAE,kBAAkB;YAC7B,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;YAClC,MAAM,EAAE,MAAM,EAAE,IAAI;YACpB,QAAQ;YACR,aAAa;YACb,gBAAgB,EAAE;gBAChB,YAAY,EAAE,eAAe,CAAC,YAAY;gBAC1C,eAAe,EAAE,eAAe,CAAC,eAAe;aACjD;SACF,CAAC;IACJ,CAAC;IAED,0EAA0E;IAC1E,kBAAkB;IAClB,0EAA0E;IAElE,eAAe,CACrB,MAAc,EACd,SAAiB,EACjB,IAAc;QAEd,OAAO;YACL,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,CAAC,CAAC;YACZ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACrB,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;YAClC,QAAQ,EAAE,KAAK;YACf,aAAa,EAAE,QAAQ;YACvB,SAAS,EAAE,EAAE,MAAM,EAAE;SACtB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Executor Factory
3
+ *
4
+ * Selects the appropriate executor (Docker or Native) based on
5
+ * configuration, job requirements, and system capabilities.
6
+ */
7
+ import { Executor } from './types.js';
8
+ import { NativeExecutionConfig } from '../config/types.js';
9
+ export interface ExecutorFactoryConfig {
10
+ mode: 'docker' | 'native' | 'auto';
11
+ nativeConfig?: NativeExecutionConfig;
12
+ dockerAvailable?: boolean;
13
+ jobRequirements?: {
14
+ requiredOS?: string;
15
+ executionMode?: string;
16
+ };
17
+ }
18
+ /**
19
+ * Marker class representing the Docker executor type.
20
+ * The actual Docker executor implementation lives in docker.ts / jobExecutor.ts.
21
+ * This stub is used for factory selection only, avoiding a hard dependency on dockerode.
22
+ */
23
+ export declare class DockerExecutorStub implements Executor {
24
+ readonly type: "docker";
25
+ validate(): Promise<{
26
+ valid: boolean;
27
+ errors: string[];
28
+ }>;
29
+ execute(): Promise<never>;
30
+ cleanup(): Promise<void>;
31
+ }
32
+ export declare class ExecutorFactory {
33
+ /**
34
+ * Create the appropriate executor for a job.
35
+ *
36
+ * Selection logic:
37
+ * 1. If job explicitly requests 'native' -> NativeExecutor
38
+ * 2. If job explicitly requests 'docker' -> DockerExecutorStub
39
+ * 3. If mode is 'auto':
40
+ * a. If job requires macOS-only tools (xcode, ios) -> NativeExecutor
41
+ * b. If Docker is available -> DockerExecutorStub
42
+ * c. Else -> NativeExecutor (fallback)
43
+ */
44
+ static create(config: ExecutorFactoryConfig): Executor;
45
+ }
46
+ //# sourceMappingURL=executorFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executorFactory.d.ts","sourceRoot":"","sources":["../../src/executors/executorFactory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IACnC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,QAAQ;IACjD,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;IAE5B,QAAQ,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAIzD,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC;IAOzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B;AAED,qBAAa,eAAe;IAC1B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,QAAQ;CAkDvD"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Executor Factory
3
+ *
4
+ * Selects the appropriate executor (Docker or Native) based on
5
+ * configuration, job requirements, and system capabilities.
6
+ */
7
+ import { NativeExecutor } from './nativeExecutor.js';
8
+ /**
9
+ * Marker class representing the Docker executor type.
10
+ * The actual Docker executor implementation lives in docker.ts / jobExecutor.ts.
11
+ * This stub is used for factory selection only, avoiding a hard dependency on dockerode.
12
+ */
13
+ export class DockerExecutorStub {
14
+ type = 'docker';
15
+ async validate() {
16
+ return { valid: true, errors: [] };
17
+ }
18
+ async execute() {
19
+ throw new Error('DockerExecutorStub.execute() should not be called directly. ' +
20
+ 'Use the full DockerManager-based JobExecutor for Docker execution.');
21
+ }
22
+ async cleanup() {
23
+ // no-op
24
+ }
25
+ }
26
+ export class ExecutorFactory {
27
+ /**
28
+ * Create the appropriate executor for a job.
29
+ *
30
+ * Selection logic:
31
+ * 1. If job explicitly requests 'native' -> NativeExecutor
32
+ * 2. If job explicitly requests 'docker' -> DockerExecutorStub
33
+ * 3. If mode is 'auto':
34
+ * a. If job requires macOS-only tools (xcode, ios) -> NativeExecutor
35
+ * b. If Docker is available -> DockerExecutorStub
36
+ * c. Else -> NativeExecutor (fallback)
37
+ */
38
+ static create(config) {
39
+ const { mode, nativeConfig, dockerAvailable, jobRequirements } = config;
40
+ // Check if job explicitly requests an execution mode
41
+ const jobMode = jobRequirements?.executionMode;
42
+ if (jobMode === 'native' || mode === 'native') {
43
+ return new NativeExecutor({
44
+ allowedPaths: nativeConfig?.allowedPaths,
45
+ userIsolation: nativeConfig?.userIsolation,
46
+ sandboxProfile: nativeConfig?.sandboxProfile,
47
+ });
48
+ }
49
+ if (jobMode === 'docker' || mode === 'docker') {
50
+ return new DockerExecutorStub();
51
+ }
52
+ // Auto mode: inspect job requirements
53
+ if (mode === 'auto') {
54
+ // macOS-only tools require native execution
55
+ const requiredOS = jobRequirements?.requiredOS?.toLowerCase() ?? '';
56
+ if (requiredOS === 'macos' ||
57
+ requiredOS === 'darwin' ||
58
+ requiredOS === 'ios') {
59
+ return new NativeExecutor({
60
+ allowedPaths: nativeConfig?.allowedPaths,
61
+ userIsolation: nativeConfig?.userIsolation,
62
+ sandboxProfile: nativeConfig?.sandboxProfile,
63
+ });
64
+ }
65
+ // Prefer Docker when available
66
+ if (dockerAvailable !== false) {
67
+ return new DockerExecutorStub();
68
+ }
69
+ // Fallback to native
70
+ return new NativeExecutor({
71
+ allowedPaths: nativeConfig?.allowedPaths,
72
+ userIsolation: nativeConfig?.userIsolation,
73
+ sandboxProfile: nativeConfig?.sandboxProfile,
74
+ });
75
+ }
76
+ // Default: Docker
77
+ return new DockerExecutorStub();
78
+ }
79
+ }
80
+ //# sourceMappingURL=executorFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executorFactory.js","sourceRoot":"","sources":["../../src/executors/executorFactory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAarD;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACpB,IAAI,GAAG,QAAiB,CAAC;IAElC,KAAK,CAAC,QAAQ;QACZ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,KAAK,CACb,8DAA8D;YAC9D,oEAAoE,CACrE,CAAC;IACJ,CAAC;IAED,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,EAAE,YAAY;gBACxC,aAAa,EAAE,YAAY,EAAE,aAAa;gBAC1C,cAAc,EAAE,YAAY,EAAE,cAAc;aAC7C,CAAC,CAAC;QACL,CAAC;QAED,kBAAkB;QAClB,OAAO,IAAI,kBAAkB,EAAE,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Executors barrel export
3
+ */
4
+ export { Executor, ExecutionResult, ExecutionOptions } from './types.js';
5
+ export { NativeExecutor, NativeExecutorConfig } from './nativeExecutor.js';
6
+ export { ExecutorFactory, ExecutorFactoryConfig, DockerExecutorStub, } from './executorFactory.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/executors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Executors barrel export
3
+ */
4
+ export { NativeExecutor } from './nativeExecutor.js';
5
+ export { ExecutorFactory, DockerExecutorStub, } from './executorFactory.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EAEf,kBAAkB,GACnB,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Native Executor - Non-Docker job execution
3
+ *
4
+ * Runs build commands directly on the host OS in an isolated temp workspace.
5
+ * Designed for iOS/macOS builds that require native toolchains (Xcode, etc.)
6
+ * which are not available inside Docker containers.
7
+ *
8
+ * Security model:
9
+ * - Jobs run in an isolated temp directory (not the developer's workspace)
10
+ * - Environment variables are explicitly injected (PATH preserved)
11
+ * - Timeout enforcement with graceful shutdown (SIGTERM → 10s → SIGKILL)
12
+ */
13
+ import { Executor, ExecutionOptions, ExecutionResult } from './types.js';
14
+ export interface NativeExecutorConfig {
15
+ allowedPaths?: string[];
16
+ userIsolation?: boolean;
17
+ sandboxProfile?: string;
18
+ defaultTimeout?: number;
19
+ }
20
+ export declare class NativeExecutor implements Executor {
21
+ private config;
22
+ readonly type: "native";
23
+ private tempWorkspaces;
24
+ constructor(config?: NativeExecutorConfig);
25
+ validate(): Promise<{
26
+ valid: boolean;
27
+ errors: string[];
28
+ }>;
29
+ execute(options: ExecutionOptions): Promise<ExecutionResult>;
30
+ cleanup(): Promise<void>;
31
+ /**
32
+ * Build the environment for the child process.
33
+ * Preserves PATH and common SDK paths from the system, then merges user-provided vars.
34
+ */
35
+ private buildEnvironment;
36
+ /**
37
+ * Resolve the best available shell.
38
+ */
39
+ private resolveShell;
40
+ /**
41
+ * Check if a supported shell is available.
42
+ */
43
+ private checkShellAvailable;
44
+ /**
45
+ * Collect artifacts matching glob-like patterns from the workDir.
46
+ * Walks the directory tree and matches files against the patterns.
47
+ * Patterns can include ** for recursive matching and * for single-segment matching.
48
+ */
49
+ private collectArtifacts;
50
+ /**
51
+ * Recursively walk a directory and return all file paths.
52
+ */
53
+ private walkDirectory;
54
+ /**
55
+ * Simple glob-like pattern matching.
56
+ * Supports * (any segment chars) and ** (any path depth).
57
+ */
58
+ private matchPattern;
59
+ }
60
+ //# sourceMappingURL=nativeExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeExecutor.d.ts","sourceRoot":"","sources":["../../src/executors/nativeExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOzE,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,cAAe,YAAW,QAAQ;IAIjC,OAAO,CAAC,MAAM;IAH1B,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;IAClC,OAAO,CAAC,cAAc,CAA0B;gBAE5B,MAAM,GAAE,oBAAyB;IAE/C,QAAQ,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAgCzD,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IA6I5D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAY9B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAkCxB;;OAEG;YACW,YAAY;IAa1B;;OAEG;YACW,mBAAmB;IAYjC;;;;OAIG;YACW,gBAAgB;IA0B9B;;OAEG;YACW,aAAa;IAqB3B;;;OAGG;IACH,OAAO,CAAC,YAAY;CAWrB"}