@vfarcic/dot-ai 0.4.9 → 0.5.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.
- package/.claude/commands/context-load.md +11 -0
- package/.claude/commands/context-save.md +16 -0
- package/.claude/commands/prd-done.md +115 -0
- package/.claude/commands/prd-get.md +25 -0
- package/.claude/commands/prd-start.md +87 -0
- package/.claude/commands/task-done.md +77 -0
- package/.claude/commands/tests-reminder.md +32 -0
- package/.claude/settings.local.json +20 -0
- package/.eslintrc.json +25 -0
- package/.github/workflows/ci.yml +170 -0
- package/.prettierrc.json +10 -0
- package/.teller.yml +8 -0
- package/CLAUDE.md +162 -0
- package/assets/images/logo.png +0 -0
- package/bin/dot-ai.ts +47 -0
- package/destroy.sh +45 -0
- package/devbox.json +13 -0
- package/devbox.lock +225 -0
- package/docs/API.md +449 -0
- package/docs/CONTEXT.md +49 -0
- package/docs/DEVELOPMENT.md +203 -0
- package/docs/NEXT_STEPS.md +97 -0
- package/docs/STAGE_BASED_API.md +97 -0
- package/docs/cli-guide.md +798 -0
- package/docs/design.md +750 -0
- package/docs/discovery-engine.md +515 -0
- package/docs/error-handling.md +429 -0
- package/docs/function-registration.md +157 -0
- package/docs/mcp-guide.md +416 -0
- package/package.json +2 -123
- package/renovate.json +51 -0
- package/setup.sh +111 -0
- package/{dist/cli.js → src/cli.ts} +26 -19
- package/src/core/claude.ts +280 -0
- package/src/core/deploy-operation.ts +127 -0
- package/src/core/discovery.ts +900 -0
- package/src/core/error-handling.ts +562 -0
- package/src/core/index.ts +143 -0
- package/src/core/kubernetes-utils.ts +218 -0
- package/src/core/memory.ts +148 -0
- package/src/core/schema.ts +830 -0
- package/src/core/session-utils.ts +97 -0
- package/src/core/workflow.ts +234 -0
- package/src/index.ts +18 -0
- package/src/interfaces/cli.ts +872 -0
- package/src/interfaces/mcp.ts +183 -0
- package/src/mcp/server.ts +131 -0
- package/src/tools/answer-question.ts +807 -0
- package/src/tools/choose-solution.ts +169 -0
- package/src/tools/deploy-manifests.ts +94 -0
- package/src/tools/generate-manifests.ts +502 -0
- package/src/tools/index.ts +41 -0
- package/src/tools/recommend.ts +370 -0
- package/tests/__mocks__/@kubernetes/client-node.ts +106 -0
- package/tests/build-system.test.ts +345 -0
- package/tests/configuration.test.ts +226 -0
- package/tests/core/deploy-operation.test.ts +38 -0
- package/tests/core/discovery.test.ts +1648 -0
- package/tests/core/error-handling.test.ts +632 -0
- package/tests/core/schema.test.ts +1658 -0
- package/tests/core/session-utils.test.ts +245 -0
- package/tests/core.test.ts +439 -0
- package/tests/fixtures/configmap-no-labels.yaml +8 -0
- package/tests/fixtures/crossplane-app-configuration.yaml +6 -0
- package/tests/fixtures/crossplane-providers.yaml +45 -0
- package/tests/fixtures/crossplane-rbac.yaml +48 -0
- package/tests/fixtures/invalid-configmap.yaml +8 -0
- package/tests/fixtures/invalid-deployment.yaml +17 -0
- package/tests/fixtures/test-deployment.yaml +28 -0
- package/tests/fixtures/valid-configmap.yaml +15 -0
- package/tests/infrastructure.test.ts +426 -0
- package/tests/interfaces/cli.test.ts +1036 -0
- package/tests/interfaces/mcp.test.ts +139 -0
- package/tests/kubernetes-utils.test.ts +200 -0
- package/tests/mcp/server.test.ts +126 -0
- package/tests/setup.ts +31 -0
- package/tests/tools/answer-question.test.ts +367 -0
- package/tests/tools/choose-solution.test.ts +481 -0
- package/tests/tools/deploy-manifests.test.ts +185 -0
- package/tests/tools/generate-manifests.test.ts +441 -0
- package/tests/tools/index.test.ts +111 -0
- package/tests/tools/recommend.test.ts +180 -0
- package/tsconfig.json +34 -0
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/core/claude.d.ts +0 -42
- package/dist/core/claude.d.ts.map +0 -1
- package/dist/core/claude.js +0 -229
- package/dist/core/deploy-operation.d.ts +0 -38
- package/dist/core/deploy-operation.d.ts.map +0 -1
- package/dist/core/deploy-operation.js +0 -101
- package/dist/core/discovery.d.ts +0 -162
- package/dist/core/discovery.d.ts.map +0 -1
- package/dist/core/discovery.js +0 -758
- package/dist/core/error-handling.d.ts +0 -167
- package/dist/core/error-handling.d.ts.map +0 -1
- package/dist/core/error-handling.js +0 -399
- package/dist/core/index.d.ts +0 -42
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -123
- package/dist/core/kubernetes-utils.d.ts +0 -38
- package/dist/core/kubernetes-utils.d.ts.map +0 -1
- package/dist/core/kubernetes-utils.js +0 -177
- package/dist/core/memory.d.ts +0 -45
- package/dist/core/memory.d.ts.map +0 -1
- package/dist/core/memory.js +0 -113
- package/dist/core/schema.d.ts +0 -187
- package/dist/core/schema.d.ts.map +0 -1
- package/dist/core/schema.js +0 -655
- package/dist/core/session-utils.d.ts +0 -29
- package/dist/core/session-utils.d.ts.map +0 -1
- package/dist/core/session-utils.js +0 -121
- package/dist/core/workflow.d.ts +0 -70
- package/dist/core/workflow.d.ts.map +0 -1
- package/dist/core/workflow.js +0 -161
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -32
- package/dist/interfaces/cli.d.ts +0 -74
- package/dist/interfaces/cli.d.ts.map +0 -1
- package/dist/interfaces/cli.js +0 -769
- package/dist/interfaces/mcp.d.ts +0 -30
- package/dist/interfaces/mcp.d.ts.map +0 -1
- package/dist/interfaces/mcp.js +0 -105
- package/dist/mcp/server.d.ts +0 -9
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -151
- package/dist/tools/answer-question.d.ts +0 -27
- package/dist/tools/answer-question.d.ts.map +0 -1
- package/dist/tools/answer-question.js +0 -696
- package/dist/tools/choose-solution.d.ts +0 -23
- package/dist/tools/choose-solution.d.ts.map +0 -1
- package/dist/tools/choose-solution.js +0 -171
- package/dist/tools/deploy-manifests.d.ts +0 -25
- package/dist/tools/deploy-manifests.d.ts.map +0 -1
- package/dist/tools/deploy-manifests.js +0 -74
- package/dist/tools/generate-manifests.d.ts +0 -23
- package/dist/tools/generate-manifests.d.ts.map +0 -1
- package/dist/tools/generate-manifests.js +0 -424
- package/dist/tools/index.d.ts +0 -11
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -34
- package/dist/tools/recommend.d.ts +0 -23
- package/dist/tools/recommend.d.ts.map +0 -1
- package/dist/tools/recommend.js +0 -332
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Next Development Steps
|
|
2
|
+
|
|
3
|
+
## Immediate Priority: Detailed API Specifications
|
|
4
|
+
|
|
5
|
+
**Current Status**: Architecture and workflow design complete
|
|
6
|
+
**Next Task**: Define detailed JSON schemas and examples for all MCP functions
|
|
7
|
+
|
|
8
|
+
### 1. MCP Function Specifications
|
|
9
|
+
|
|
10
|
+
Create detailed specs for each function in a new `API_SPECS.md` file:
|
|
11
|
+
|
|
12
|
+
#### `create_application`
|
|
13
|
+
- **Input schema**: `{}` (no parameters)
|
|
14
|
+
- **Output schema**: Discovery results + initial workflow guidance
|
|
15
|
+
- **Error handling**: Cluster access failures, discovery errors
|
|
16
|
+
- **State management**: How to track session state
|
|
17
|
+
|
|
18
|
+
#### `continue_workflow`
|
|
19
|
+
- **Input schema**: User choice + context from previous steps
|
|
20
|
+
- **Output schema**: Next question + workflow guidance
|
|
21
|
+
- **Error handling**: Invalid choices, context missing
|
|
22
|
+
- **State management**: Progressive workflow state
|
|
23
|
+
|
|
24
|
+
#### `deploy_application`
|
|
25
|
+
- **Input schema**: Complete configuration object
|
|
26
|
+
- **Output schema**: Deployment status + monitoring guidance
|
|
27
|
+
- **Error handling**: Manifest validation, deployment failures
|
|
28
|
+
- **State management**: Deployment tracking
|
|
29
|
+
|
|
30
|
+
#### `get_deployment_status`
|
|
31
|
+
- **Input schema**: Deployment identifier
|
|
32
|
+
- **Output schema**: Status + resource details + lessons learned
|
|
33
|
+
- **Error handling**: Deployment not found, cluster access issues
|
|
34
|
+
- **State management**: Status polling patterns
|
|
35
|
+
|
|
36
|
+
### 2. Supporting Schemas
|
|
37
|
+
|
|
38
|
+
Define schemas for:
|
|
39
|
+
- **Discovery Results**: CRDs, capabilities, cluster info
|
|
40
|
+
- **Workflow Context**: Session state, user choices, progress
|
|
41
|
+
- **Memory Lessons**: Success patterns, failure modes, troubleshooting
|
|
42
|
+
- **Governance Policies**: Plain English rule interpretation
|
|
43
|
+
- **Error Responses**: Consistent error structure across all functions
|
|
44
|
+
|
|
45
|
+
### 3. Implementation Patterns
|
|
46
|
+
|
|
47
|
+
Document:
|
|
48
|
+
- **Claude Code SDK Integration**: How to structure the agent core
|
|
49
|
+
- **Kubernetes API Patterns**: Standard kubectl operations and error handling
|
|
50
|
+
- **Memory System**: JSON file structure and retrieval patterns
|
|
51
|
+
- **Policy Interpretation**: How to parse plain English governance rules
|
|
52
|
+
|
|
53
|
+
## File Structure to Create
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
mcp-app-management/
|
|
57
|
+
├── docs/
|
|
58
|
+
│ ├── API_SPECS.md # ← CREATE THIS (detailed JSON schemas)
|
|
59
|
+
│ ├── IMPLEMENTATION.md # ← CREATE THIS (Claude Code SDK integration)
|
|
60
|
+
│ ├── MEMORY_SYSTEM.md # ← CREATE THIS (lesson storage design)
|
|
61
|
+
│ └── TESTING_STRATEGY.md # ← CREATE THIS (how to test the system)
|
|
62
|
+
├── examples/
|
|
63
|
+
│ ├── governance/ # ← CREATE THIS (example policy files)
|
|
64
|
+
│ └── workflows/ # ← CREATE THIS (example interaction flows)
|
|
65
|
+
└── schemas/
|
|
66
|
+
├── mcp-functions.json # ← CREATE THIS (JSON Schema definitions)
|
|
67
|
+
└── memory-lessons.json # ← CREATE THIS (Memory structure schema)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Success Criteria
|
|
71
|
+
|
|
72
|
+
After completing API specifications, you should have:
|
|
73
|
+
|
|
74
|
+
✅ **Complete JSON schemas** for all 4 MCP functions
|
|
75
|
+
✅ **Error handling patterns** documented
|
|
76
|
+
✅ **State management** approach defined
|
|
77
|
+
✅ **Memory system** structure specified
|
|
78
|
+
✅ **Governance integration** details
|
|
79
|
+
✅ **Implementation roadmap** for Claude Code SDK
|
|
80
|
+
|
|
81
|
+
## Ready to Start?
|
|
82
|
+
|
|
83
|
+
1. Read `design.md` for complete architecture understanding
|
|
84
|
+
2. Review `CONTEXT.md` for key decisions
|
|
85
|
+
3. Start with `API_SPECS.md` - define the JSON schemas
|
|
86
|
+
4. Use the examples in `design.md` as starting points
|
|
87
|
+
5. Focus on making the schemas precise and implementable
|
|
88
|
+
|
|
89
|
+
## Key Principles to Remember
|
|
90
|
+
|
|
91
|
+
- **Discovery-driven**: Everything adapts to what's found in the cluster
|
|
92
|
+
- **Resource-agnostic**: No hardcoded platform assumptions
|
|
93
|
+
- **Plain English governance**: Policies in natural language
|
|
94
|
+
- **Memory-enhanced**: Learn from every deployment
|
|
95
|
+
- **Dual-mode**: Same intelligence, different interfaces
|
|
96
|
+
|
|
97
|
+
The foundation is solid - now we need the detailed specifications to make it implementable! 🚀
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Stage-Based Question Flow API Design
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Replace the current `done` parameter and multi-group responses with explicit stage-based workflow validation.
|
|
5
|
+
|
|
6
|
+
## API Contract
|
|
7
|
+
|
|
8
|
+
### Request Format
|
|
9
|
+
```typescript
|
|
10
|
+
{
|
|
11
|
+
"solutionId": "sol_2025-07-02T134102_b665a82ca41d",
|
|
12
|
+
"stage": "required" | "basic" | "advanced" | "open",
|
|
13
|
+
"answers": {
|
|
14
|
+
"questionId": "value",
|
|
15
|
+
// ... more answers for this stage only
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Response Format
|
|
21
|
+
```typescript
|
|
22
|
+
{
|
|
23
|
+
"status": "stage_questions" | "ready_for_manifest_generation" | "stage_error",
|
|
24
|
+
"solutionId": "sol_xxx",
|
|
25
|
+
"currentStage": "required" | "basic" | "advanced" | "open",
|
|
26
|
+
"questions": [...], // Only questions for current stage
|
|
27
|
+
"nextStage": "basic" | "advanced" | "open" | null,
|
|
28
|
+
"message": "Stage-specific message",
|
|
29
|
+
"timestamp": "..."
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Stage Progression Rules
|
|
34
|
+
|
|
35
|
+
### Valid Transitions
|
|
36
|
+
- `required` → `basic`, `open`
|
|
37
|
+
- `basic` → `advanced`, `open`
|
|
38
|
+
- `advanced` → `open`
|
|
39
|
+
- `open` → (triggers manifest generation)
|
|
40
|
+
|
|
41
|
+
### Stage Skip Logic
|
|
42
|
+
- **Required**: Cannot skip (must have at least one answer)
|
|
43
|
+
- **Basic**: Can skip (send `{"stage": "basic", "answers": {}}`)
|
|
44
|
+
- **Advanced**: Can skip (send `{"stage": "advanced", "answers": {}}`)
|
|
45
|
+
- **Open**: Complete with "N/A" (send `{"stage": "open", "answers": {"open": "N/A"}}`)
|
|
46
|
+
|
|
47
|
+
### Completion Logic
|
|
48
|
+
- Completing the `open` stage triggers manifest generation
|
|
49
|
+
- No more `done` parameter or separate `complete` stage needed
|
|
50
|
+
|
|
51
|
+
## Error Handling
|
|
52
|
+
|
|
53
|
+
### Stage Mismatch
|
|
54
|
+
```typescript
|
|
55
|
+
{
|
|
56
|
+
"status": "stage_error",
|
|
57
|
+
"error": "stage_mismatch",
|
|
58
|
+
"expected": "basic",
|
|
59
|
+
"received": "advanced",
|
|
60
|
+
"message": "You're in 'basic' stage but provided 'advanced'. Complete basic questions first or skip them explicitly."
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Invalid Transition
|
|
65
|
+
```typescript
|
|
66
|
+
{
|
|
67
|
+
"status": "stage_error",
|
|
68
|
+
"error": "invalid_transition",
|
|
69
|
+
"from": "required",
|
|
70
|
+
"to": "advanced",
|
|
71
|
+
"message": "Cannot jump from 'required' to 'advanced'. Must complete 'basic' stage first or skip to 'open'."
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Implementation Benefits
|
|
76
|
+
|
|
77
|
+
1. **Code-Only Validation**: No AI needed for workflow logic
|
|
78
|
+
2. **Explicit Intent**: Clear distinction between skip vs incomplete
|
|
79
|
+
3. **Single Question Group**: Always return one stage at a time
|
|
80
|
+
4. **Predictable Flow**: State machine with clear transitions
|
|
81
|
+
5. **Better Error Messages**: Specific stage-related feedback
|
|
82
|
+
|
|
83
|
+
## Breaking Changes
|
|
84
|
+
|
|
85
|
+
- Remove `done` parameter from answerQuestion
|
|
86
|
+
- Add required `stage` parameter (enum: required, basic, advanced, open)
|
|
87
|
+
- Remove `complete` stage - completion handled by `open` stage
|
|
88
|
+
- Single-group question responses only
|
|
89
|
+
- New error response formats
|
|
90
|
+
|
|
91
|
+
## Migration Path
|
|
92
|
+
|
|
93
|
+
1. Update answerQuestion tool input schema
|
|
94
|
+
2. Implement stage validation logic
|
|
95
|
+
3. Replace multi-group responses with single-stage
|
|
96
|
+
4. Update all tests
|
|
97
|
+
5. Test end-to-end workflow
|