@vfarcic/dot-ai 0.192.0 → 0.193.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.
Files changed (65) hide show
  1. package/README.md +2 -0
  2. package/dist/core/base-vector-service.d.ts +6 -0
  3. package/dist/core/base-vector-service.d.ts.map +1 -1
  4. package/dist/core/base-vector-service.js +18 -8
  5. package/dist/core/capabilities.d.ts +12 -0
  6. package/dist/core/capabilities.d.ts.map +1 -1
  7. package/dist/core/capability-operations.d.ts +3 -0
  8. package/dist/core/capability-operations.d.ts.map +1 -1
  9. package/dist/core/capability-operations.js +88 -5
  10. package/dist/core/capability-scan-workflow.d.ts +35 -5
  11. package/dist/core/capability-scan-workflow.d.ts.map +1 -1
  12. package/dist/core/capability-scan-workflow.js +169 -145
  13. package/dist/core/capability-vector-service.d.ts +11 -2
  14. package/dist/core/capability-vector-service.d.ts.map +1 -1
  15. package/dist/core/capability-vector-service.js +50 -0
  16. package/dist/core/discovery.d.ts +34 -0
  17. package/dist/core/discovery.d.ts.map +1 -1
  18. package/dist/core/discovery.js +105 -19
  19. package/dist/core/kubectl-tools.d.ts +5 -0
  20. package/dist/core/kubectl-tools.d.ts.map +1 -1
  21. package/dist/core/kubectl-tools.js +74 -2
  22. package/dist/core/kubernetes-utils.d.ts +1 -0
  23. package/dist/core/kubernetes-utils.d.ts.map +1 -1
  24. package/dist/core/kubernetes-utils.js +92 -49
  25. package/dist/core/packaging.d.ts.map +1 -1
  26. package/dist/core/packaging.js +1 -0
  27. package/dist/core/resource-tools.d.ts +163 -1
  28. package/dist/core/resource-tools.d.ts.map +1 -1
  29. package/dist/core/resource-tools.js +343 -23
  30. package/dist/core/resource-vector-service.d.ts +17 -0
  31. package/dist/core/resource-vector-service.d.ts.map +1 -1
  32. package/dist/core/resource-vector-service.js +67 -3
  33. package/dist/core/vector-db-service.d.ts +7 -0
  34. package/dist/core/vector-db-service.d.ts.map +1 -1
  35. package/dist/core/vector-db-service.js +165 -61
  36. package/dist/core/visualization.d.ts +16 -1
  37. package/dist/core/visualization.d.ts.map +1 -1
  38. package/dist/core/visualization.js +64 -1
  39. package/dist/interfaces/rest-api.d.ts +63 -2
  40. package/dist/interfaces/rest-api.d.ts.map +1 -1
  41. package/dist/interfaces/rest-api.js +611 -51
  42. package/dist/tools/answer-question.d.ts.map +1 -1
  43. package/dist/tools/answer-question.js +18 -0
  44. package/dist/tools/choose-solution.d.ts.map +1 -1
  45. package/dist/tools/choose-solution.js +22 -1
  46. package/dist/tools/deploy-manifests.d.ts.map +1 -1
  47. package/dist/tools/deploy-manifests.js +16 -2
  48. package/dist/tools/generate-manifests.js +3 -3
  49. package/dist/tools/organizational-data.d.ts +1 -1
  50. package/dist/tools/organizational-data.d.ts.map +1 -1
  51. package/dist/tools/organizational-data.js +6 -0
  52. package/dist/tools/query.d.ts +2 -11
  53. package/dist/tools/query.d.ts.map +1 -1
  54. package/dist/tools/query.js +63 -44
  55. package/dist/tools/recommend.d.ts +18 -1
  56. package/dist/tools/recommend.d.ts.map +1 -1
  57. package/dist/tools/recommend.js +44 -10
  58. package/package.json +1 -1
  59. package/prompts/partials/query-simple-output.md +11 -0
  60. package/prompts/partials/visualization-output.md +93 -0
  61. package/prompts/query-system.md +8 -12
  62. package/prompts/resource-selection.md +4 -0
  63. package/prompts/visualize.md +1 -68
  64. package/scripts/reset-sync-and-scan-test-cluster.sh +120 -0
  65. package/shared-prompts/prd-create.md +1 -1
@@ -0,0 +1,93 @@
1
+ ## Output Format
2
+
3
+ When you have gathered sufficient information, respond with ONLY a JSON object (no markdown code fences, no extra text):
4
+
5
+ {
6
+ "title": "Descriptive title based on what was found",
7
+ "visualizations": [...],
8
+ "insights": [...]
9
+ }
10
+
11
+ **If you cannot fulfill the user's request**, return (still as raw JSON, no code fences):
12
+
13
+ {
14
+ "title": "Unable to Perform Operation",
15
+ "visualizations": [],
16
+ "insights": ["Explanation of why the request cannot be fulfilled and what tool or action should be used instead."],
17
+ "status": "error"
18
+ }
19
+
20
+ ## Visualization Types
21
+
22
+ Generate as many or as few visualizations as add value. You can:
23
+ - Include multiple visualizations of the same type
24
+ - Skip any type entirely if it doesn't add value for this data
25
+ - Use whatever combination best represents what you found
26
+
27
+ Each visualization:
28
+ ```
29
+ {
30
+ "id": "unique-id",
31
+ "label": "Tab Label",
32
+ "type": "mermaid" | "table" | "cards" | "code" | "bar-chart",
33
+ "content": <type-specific-content>
34
+ }
35
+ ```
36
+
37
+ ### mermaid
38
+ - `content`: Valid Mermaid diagram string
39
+ - Use `graph TD` or `graph LR` depending on relationship type
40
+ - Use subgraphs to group related items
41
+ - Arrows: `-->` for direct relationships, `-.->` for indirect/inferred
42
+ - **Styling rules**:
43
+ - Only style nodes that represent errors or problems
44
+ - For error nodes: `style NodeId fill:#ef4444,stroke:#dc2626,color:#ffffff` (white text on red background)
45
+ - **CRITICAL: Text contrast** - Always ensure text is readable against the background:
46
+ - Dark backgrounds (red, gray, etc.) → use `color:#ffffff` (white text)
47
+ - Light backgrounds → use `color:#ffffff` or `color:#000000` depending on shade
48
+ - NEVER use similar colors for text and background (e.g., red text on pink background)
49
+ - Do NOT add colors or styling to healthy/normal nodes - use default Mermaid styling
50
+ - Truncate UUIDs to first 8 characters (e.g., `pvc-508555a4...`)
51
+ - Keep node labels under 30 characters when possible
52
+
53
+ ### table
54
+ - `content`: `{ "headers": ["Col1", "Col2"], "rows": [["val1", "val2"]], "rowStatuses": ["error", null, "ok"] }`
55
+ - Choose columns relevant to the data present
56
+ - Include status/condition information when available
57
+ - Optional `rowStatuses` array: Indicate row-level status. Values: `"error"`, `"warning"`, `"ok"`, or `null`. Array length should match rows.
58
+
59
+ ### cards
60
+ - `content`: `[{ "id": "unique", "title": "Name", "subtitle": "Type or status", "description": "Details", "tags": ["tag1"], "status": "error" }]`
61
+ - Use for items where individual status or comparison matters
62
+ - Tags should reflect actual state from the data
63
+ - Optional `status` field: Indicate item status. Values: `"error"`, `"warning"`, `"ok"`. Omit for neutral items.
64
+
65
+ ### code
66
+ - `content`: `{ "language": "yaml" | "json" | "bash", "code": "..." }`
67
+ - Use sparingly - only when raw output adds value
68
+
69
+ ### bar-chart
70
+ - `content`: `{ "data": [{ "label": "...", "value": 8.5, "max": 10, "status": "ok" }], "unit": "Gi", "orientation": "horizontal" }`
71
+ - `data[].label`: Category label
72
+ - `data[].value`: Numeric value
73
+ - `data[].max`: Optional maximum for percentage calculation
74
+ - `data[].status`: Optional `"error"`, `"warning"`, `"ok"`. Omit for neutral items.
75
+ - `unit`: Optional unit label
76
+ - `orientation`: Optional `"horizontal"` (default) or `"vertical"`
77
+
78
+ ## Insights
79
+
80
+ Generate insights that add value beyond what someone could see by just reading the raw data. Prioritize non-obvious findings over summaries.
81
+
82
+ Each insight should:
83
+ - Reference specific items from the data
84
+ - Explain WHY it matters, not just WHAT you found
85
+ - Be actionable when highlighting issues
86
+
87
+ ## Rules
88
+
89
+ 1. **Data-driven only** - Base visualizations on actual data present
90
+ 2. **Skip empty visualizations** - Don't include visualizations with no meaningful content
91
+ 3. **Valid output** - Ensure Mermaid syntax is correct and JSON is valid
92
+ 4. **JSON only** - No markdown fences, no explanations outside the JSON structure
93
+ 5. **Use validate_mermaid** - Before returning any Mermaid diagrams, validate them using the validate_mermaid tool
@@ -1,6 +1,12 @@
1
1
  # Kubernetes Cluster Query Agent
2
2
 
3
- You are a Kubernetes cluster analyst. Use the available tools to answer the user's query.
3
+ You are a read-only Kubernetes cluster analyst. Use the available tools to answer questions about cluster state, resources, and capabilities.
4
+
5
+ ## Critical Constraint: Read-Only Operations
6
+
7
+ You can ONLY query information. You CANNOT modify the cluster (scale, create, update, delete, restart, patch, rollback, etc.).
8
+
9
+ If the user requests a modification, immediately return a response (following the output format below) explaining that you can only query cluster information and they should use the `operate` tool instead. Do not investigate or ask clarifying questions about modification requests.
4
10
 
5
11
  ## Thoroughness
6
12
 
@@ -8,14 +14,4 @@ You are a Kubernetes cluster analyst. Use the available tools to answer the user
8
14
  - For conceptual queries, check ALL resource kinds returned by capability search
9
15
  - When in doubt, search more rather than less
10
16
 
11
- ## Output Format
12
-
13
- When you have gathered sufficient information, respond with ONLY this JSON:
14
-
15
- ```json
16
- {
17
- "summary": "Human-readable summary of what was found"
18
- }
19
- ```
20
-
21
- No text before or after the JSON.
17
+ {{{outputInstructions}}}
@@ -86,6 +86,10 @@ Respond with ONLY a JSON object. The format depends on whether capabilities can
86
86
 
87
87
  Return solutions with resources. Include the `resourceName` field for each resource (extract from Available Resources list).
88
88
 
89
+ **Solution type field (REQUIRED):**
90
+ - `"type": "single"` - when the solution uses exactly ONE resource
91
+ - `"type": "combination"` - when the solution uses TWO OR MORE resources together
92
+
89
93
  ```json
90
94
  {
91
95
  "solutions": [
@@ -16,71 +16,4 @@ You are a Kubernetes visualization expert. Analyze the provided data and generat
16
16
 
17
17
  If the provided data isn't sufficient for deep analysis, **actively use tools** to gather additional information. Don't just note uncertainties - investigate them.
18
18
 
19
- ## Output Format
20
-
21
- Respond with ONLY a JSON object (no markdown code fences, no extra text):
22
-
23
- {
24
- "title": "Descriptive title based on what was found",
25
- "visualizations": [...],
26
- "insights": [...]
27
- }
28
-
29
- ## Visualization Types
30
-
31
- Generate as many or as few visualizations as add value. You can:
32
- - Include multiple visualizations of the same type
33
- - Skip any type entirely if it doesn't add value for this data
34
- - Use whatever combination best represents what you found
35
-
36
- Each visualization:
37
- ```
38
- {
39
- "id": "unique-id",
40
- "label": "Tab Label",
41
- "type": "mermaid" | "table" | "cards" | "code",
42
- "content": <type-specific-content>
43
- }
44
- ```
45
-
46
- ### mermaid
47
- - `content`: Valid Mermaid diagram string
48
- - Use `graph TD` or `graph LR` depending on relationship type
49
- - Use subgraphs to group related items
50
- - Arrows: `-->` for direct relationships, `-.->` for indirect/inferred
51
- - **Syntax rules**:
52
- - Node names in `class` statements MUST be comma-separated: `class a,b,c style` (not space-separated)
53
- - If using `classDef`, ALWAYS specify both `fill` AND `color` (text) with sufficient contrast
54
- - Truncate UUIDs to first 8 characters (e.g., `pvc-508555a4...`)
55
- - Keep node labels under 30 characters when possible
56
-
57
- ### table
58
- - `content`: `{ "headers": ["Col1", "Col2"], "rows": [["val1", "val2"]] }`
59
- - Choose columns relevant to the data present
60
- - Include status/condition information when available
61
-
62
- ### cards
63
- - `content`: `[{ "id": "unique", "title": "Name", "subtitle": "Type or status", "description": "Details", "tags": ["tag1"] }]`
64
- - Use for items where individual status or comparison matters
65
- - Tags should reflect actual state from the data
66
-
67
- ### code
68
- - `content`: `{ "language": "yaml" | "json" | "bash", "code": "..." }`
69
- - Use sparingly - only when raw output adds value
70
-
71
- ## Insights
72
-
73
- Generate insights that add value beyond what someone could see by just reading the raw data. Prioritize non-obvious findings over summaries.
74
-
75
- Each insight should:
76
- - Reference specific items from the data
77
- - Explain WHY it matters, not just WHAT you found
78
- - Be actionable when highlighting issues
79
-
80
- ## Rules
81
-
82
- 1. **Data-driven only** - Base visualizations on actual data present
83
- 2. **Skip empty visualizations** - Don't include visualizations with no meaningful content
84
- 3. **Valid output** - Ensure Mermaid syntax is correct and JSON is valid
85
- 4. **JSON only** - No markdown fences, no explanations outside the JSON structure
86
- 5. **Use validate_mermaid** - Before returning any Mermaid diagrams, validate them using the validate_mermaid tool
19
+ {{{visualizationOutput}}}
@@ -0,0 +1,120 @@
1
+ #!/bin/bash
2
+
3
+ # Reset ResourceSyncConfig and CapabilityScanConfig
4
+ # This script:
5
+ # 1. Deletes ResourceSyncConfig and CapabilityScanConfig CRs from the cluster
6
+ # 2. Deletes all capabilities data via MCP API
7
+ # 3. Re-applies the CRs in the dot-ai namespace
8
+ #
9
+ # Usage:
10
+ # ./scripts/reset-sync-and-scan-test-cluster.sh
11
+
12
+ set -e
13
+
14
+ # Configuration - defaults match test cluster settings
15
+ KUBECONFIG="${KUBECONFIG:-./kubeconfig-test.yaml}"
16
+ export KUBECONFIG
17
+
18
+ NAMESPACE="${NAMESPACE:-dot-ai}"
19
+ MCP_URL="${MCP_URL:-http://dot-ai.127.0.0.1.nip.io:8180}"
20
+ AUTH_TOKEN="${AUTH_TOKEN:-test-auth-token-integration}"
21
+ RESOURCE_SYNC_NAME="${RESOURCE_SYNC_NAME:-default-sync}"
22
+ CAPABILITY_SCAN_NAME="${CAPABILITY_SCAN_NAME:-default-scan}"
23
+
24
+ # Colors for output
25
+ RED='\033[0;31m'
26
+ GREEN='\033[0;32m'
27
+ YELLOW='\033[1;33m'
28
+ NC='\033[0m' # No Color
29
+
30
+ echo -e "${YELLOW}=== Reset ResourceSyncConfig and CapabilityScanConfig ===${NC}"
31
+ echo "Kubeconfig: $KUBECONFIG"
32
+ echo "Namespace: $NAMESPACE"
33
+ echo "MCP URL: $MCP_URL"
34
+ echo ""
35
+
36
+ # Step 1: Delete existing CRs
37
+ echo -e "${YELLOW}Step 1: Deleting existing CRs...${NC}"
38
+
39
+ if kubectl get resourcesyncconfig "$RESOURCE_SYNC_NAME" -n "$NAMESPACE" &>/dev/null; then
40
+ echo "Deleting ResourceSyncConfig/$RESOURCE_SYNC_NAME..."
41
+ kubectl delete resourcesyncconfig "$RESOURCE_SYNC_NAME" -n "$NAMESPACE" --ignore-not-found
42
+ echo -e "${GREEN}ResourceSyncConfig deleted${NC}"
43
+ else
44
+ echo "ResourceSyncConfig/$RESOURCE_SYNC_NAME not found, skipping..."
45
+ fi
46
+
47
+ if kubectl get capabilityscanconfig "$CAPABILITY_SCAN_NAME" -n "$NAMESPACE" &>/dev/null; then
48
+ echo "Deleting CapabilityScanConfig/$CAPABILITY_SCAN_NAME..."
49
+ kubectl delete capabilityscanconfig "$CAPABILITY_SCAN_NAME" -n "$NAMESPACE" --ignore-not-found
50
+ echo -e "${GREEN}CapabilityScanConfig deleted${NC}"
51
+ else
52
+ echo "CapabilityScanConfig/$CAPABILITY_SCAN_NAME not found, skipping..."
53
+ fi
54
+
55
+ echo ""
56
+
57
+ # Step 2: Delete all capabilities via MCP API
58
+ echo -e "${YELLOW}Step 2: Deleting all capabilities via MCP API...${NC}"
59
+
60
+ response=$(curl -s -X POST "$MCP_URL/api/v1/tools/manageOrgData" \
61
+ -H "Content-Type: application/json" \
62
+ -H "Authorization: Bearer $AUTH_TOKEN" \
63
+ -d '{"dataType": "capabilities", "operation": "deleteAll"}')
64
+
65
+ if echo "$response" | grep -q '"success":true'; then
66
+ echo -e "${GREEN}All capabilities deleted${NC}"
67
+ else
68
+ echo -e "${RED}Failed to delete capabilities: $response${NC}"
69
+ fi
70
+
71
+ echo ""
72
+
73
+ # Step 3: Apply the CRs
74
+ echo -e "${YELLOW}Step 3: Applying CRs to namespace $NAMESPACE...${NC}"
75
+
76
+ # Create ResourceSyncConfig
77
+ echo "Creating ResourceSyncConfig..."
78
+ cat <<EOF | kubectl apply -f -
79
+ apiVersion: dot-ai.devopstoolkit.live/v1alpha1
80
+ kind: ResourceSyncConfig
81
+ metadata:
82
+ name: $RESOURCE_SYNC_NAME
83
+ namespace: $NAMESPACE
84
+ spec:
85
+ mcpEndpoint: http://dot-ai.$NAMESPACE.svc.cluster.local:3456/api/v1/resources/sync
86
+ mcpAuthSecretRef:
87
+ name: dot-ai-secrets
88
+ key: auth-token
89
+ debounceWindowSeconds: 10
90
+ resyncIntervalMinutes: 60
91
+ EOF
92
+ echo -e "${GREEN}ResourceSyncConfig created${NC}"
93
+
94
+ # Create CapabilityScanConfig
95
+ echo "Creating CapabilityScanConfig..."
96
+ cat <<EOF | kubectl apply -f -
97
+ apiVersion: dot-ai.devopstoolkit.live/v1alpha1
98
+ kind: CapabilityScanConfig
99
+ metadata:
100
+ name: $CAPABILITY_SCAN_NAME
101
+ namespace: $NAMESPACE
102
+ spec:
103
+ mcp:
104
+ endpoint: http://dot-ai.$NAMESPACE.svc.cluster.local:3456/api/v1/tools/manageOrgData
105
+ authSecretRef:
106
+ name: dot-ai-secrets
107
+ key: auth-token
108
+ EOF
109
+ echo -e "${GREEN}CapabilityScanConfig created${NC}"
110
+
111
+ echo ""
112
+ echo -e "${GREEN}=== Reset complete ===${NC}"
113
+ echo ""
114
+ echo "The controller will now:"
115
+ echo " - Start syncing resources to the 'resources' collection"
116
+ echo " - Start scanning capabilities to the 'capabilities' collection"
117
+ echo ""
118
+ echo "Monitor progress with:"
119
+ echo " kubectl get resourcesyncconfig $RESOURCE_SYNC_NAME -n $NAMESPACE -o yaml"
120
+ echo " kubectl get capabilityscanconfig $CAPABILITY_SCAN_NAME -n $NAMESPACE -o yaml"
@@ -11,7 +11,7 @@ category: project-management
11
11
  You are helping create a Product Requirements Document (PRD) for a new feature. This process involves two main components:
12
12
 
13
13
  1. **GitHub Issue**: Short, immutable concept description that links to the detailed PRD
14
- 2. **PRD File**: Project management document with milestone tracking, progress logs, and implementation plan
14
+ 2. **PRD File**: Project management document with milestone tracking and implementation plan
15
15
 
16
16
  ## Process
17
17