octo-dev 0.8.1 → 0.9.0
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/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { ask, askSecret } from '../shared/prompt.js';
|
|
|
5
5
|
|
|
6
6
|
const PROVIDERS: Record<string, { baseUrl: string; defaultModel: string }> = {
|
|
7
7
|
openai: { baseUrl: 'https://openai.com/v1', defaultModel: 'gpt-4o-mini' },
|
|
8
|
-
gemini: { baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai', defaultModel: 'gemini-2.
|
|
8
|
+
gemini: { baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai', defaultModel: 'gemini-2.5-flash' },
|
|
9
9
|
groq: { baseUrl: 'https://api.groq.com/openai/v1', defaultModel: 'llama-3.3-70b-versatile' },
|
|
10
10
|
anthropic: { baseUrl: 'https://api.anthropic.com/v1', defaultModel: 'claude-sonnet-4-20250514' },
|
|
11
11
|
custom: { baseUrl: '', defaultModel: '' },
|
package/src/cli/index.ts
CHANGED
|
@@ -16,8 +16,8 @@ export interface ComposeSmartMerger {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Builds the LLM prompt for optimized compose merging.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* The prompt is agnostic — it describes optimization principles without
|
|
20
|
+
* referencing specific technologies or project names.
|
|
21
21
|
*
|
|
22
22
|
* @param composes - Array of discovered compose files to merge.
|
|
23
23
|
* @returns The formatted prompt string.
|
|
@@ -27,26 +27,26 @@ function buildPrompt(composes: DiscoveredCompose[]): string {
|
|
|
27
27
|
.map((c) => `--- ${c.serviceName} (${c.path}) ---\n${JSON.stringify(c.content, null, 2)}`)
|
|
28
28
|
.join('\n\n');
|
|
29
29
|
|
|
30
|
-
return `You are
|
|
30
|
+
return `You are given multiple docker-compose files from a workspace of microservices. Produce a single optimized unified docker-compose file.
|
|
31
31
|
|
|
32
|
-
Optimization
|
|
33
|
-
1. UNIFY shared infrastructure — multiple PostgreSQL, Redis, MongoDB, Elasticsearch, RabbitMQ, NATS, or similar containers MUST be consolidated into a single shared instance. Create separate databases/schemas via environment variables or init scripts, not separate containers.
|
|
34
|
-
2. UNIFY shared volumes — if multiple services mount the same type of volume (e.g. pg-data), consolidate into one.
|
|
35
|
-
3. UNIFY networks — use a single shared network unless isolation is explicitly required for security.
|
|
36
|
-
4. PRESERVE application services — each microservice container remains separate (they are distinct apps).
|
|
37
|
-
5. MERGE environment variables — when unifying databases, collect all required databases/users into the shared instance config.
|
|
38
|
-
6. AVOID port conflicts — if two services expose the same host port, remap one to an available port.
|
|
39
|
-
7. USE latest image versions when duplicates exist with different tags.
|
|
40
|
-
8. ADD healthchecks to infrastructure services (postgres, redis, etc.) if not already present.
|
|
41
|
-
9. ADD depends_on with condition: service_healthy for app services that need infrastructure.
|
|
32
|
+
Optimization principles:
|
|
42
33
|
|
|
43
|
-
|
|
34
|
+
- Infrastructure consolidation: when multiple services declare separate containers of the same database engine (e.g. multiple PostgreSQL instances), consolidate them into a single shared instance that hosts multiple databases. The same applies to message brokers, caches, search engines, and any other shared infrastructure.
|
|
35
|
+
|
|
36
|
+
- Application preservation: each application service (containers with a "build" directive) must remain as a separate container. Never merge application services together.
|
|
37
|
+
|
|
38
|
+
- Dependency correctness: update all environment variables in application services to point to the consolidated infrastructure container names. Ensure depends_on references the correct unified containers with condition: service_healthy.
|
|
39
|
+
|
|
40
|
+
- Minimal resource footprint: use one shared network, one volume per infrastructure type, and eliminate any redundant declarations.
|
|
41
|
+
|
|
42
|
+
- Healthchecks: every infrastructure container must have a healthcheck defined.
|
|
43
|
+
|
|
44
|
+
- Port conflicts: if consolidation would create port conflicts on the host, remap to available ports.
|
|
44
45
|
|
|
45
46
|
Input compose files:
|
|
46
47
|
${composesText}
|
|
47
48
|
|
|
48
|
-
Return ONLY valid JSON with this
|
|
49
|
-
{"services": {...}, "networks": {...}, "volumes": {...}}`
|
|
49
|
+
Return ONLY valid JSON with this structure: {"services": {...}, "networks": {...}, "volumes": {...}}`
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export function createComposeSmartMerger(): ComposeSmartMerger {
|