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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octo-dev",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Build orchestration, semantic versioning, and local infrastructure management for repository workspaces",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -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.0-flash' },
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
@@ -11,7 +11,7 @@ const program = new Command();
11
11
  program
12
12
  .name('octo')
13
13
  .description('Build orchestration, semantic versioning, and local infrastructure management for repository workspaces')
14
- .version('0.8.1');
14
+ .version('0.9.0');
15
15
 
16
16
  program
17
17
  .command('init')
@@ -16,8 +16,8 @@ export interface ComposeSmartMerger {
16
16
 
17
17
  /**
18
18
  * Builds the LLM prompt for optimized compose merging.
19
- * Instructs the model to unify redundant infrastructure (databases, caches, brokers)
20
- * into shared instances while preserving application-specific services.
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 a Docker Compose optimization expert. Given multiple docker-compose files from a workspace of microservices, produce the most optimized unified compose possible.
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 goals (in priority order):
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
- Example: If service-a has postgres:16 on port 5432 and service-b has postgres:15 on port 5433, produce ONE postgres:16 container with both databases created via POSTGRES_MULTIPLE_DATABASES env or an init script volume.
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 exact structure:
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 {