@prodisco/k8s-mcp 0.1.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 (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +226 -0
  3. package/dist/codegen/generateTypes.d.ts +8 -0
  4. package/dist/codegen/generateTypes.d.ts.map +1 -0
  5. package/dist/codegen/generateTypes.js +96 -0
  6. package/dist/codegen/generateTypes.js.map +1 -0
  7. package/dist/codegen/interfaceGenerator.d.ts +9 -0
  8. package/dist/codegen/interfaceGenerator.d.ts.map +1 -0
  9. package/dist/codegen/interfaceGenerator.js +185 -0
  10. package/dist/codegen/interfaceGenerator.js.map +1 -0
  11. package/dist/codegen/toolMapping.d.ts +11 -0
  12. package/dist/codegen/toolMapping.d.ts.map +1 -0
  13. package/dist/codegen/toolMapping.js +78 -0
  14. package/dist/codegen/toolMapping.js.map +1 -0
  15. package/dist/codegen/typeExtractor.d.ts +23 -0
  16. package/dist/codegen/typeExtractor.d.ts.map +1 -0
  17. package/dist/codegen/typeExtractor.js +112 -0
  18. package/dist/codegen/typeExtractor.js.map +1 -0
  19. package/dist/kube/client.d.ts +37 -0
  20. package/dist/kube/client.d.ts.map +1 -0
  21. package/dist/kube/client.js +161 -0
  22. package/dist/kube/client.js.map +1 -0
  23. package/dist/kube/types.d.ts +27 -0
  24. package/dist/kube/types.d.ts.map +1 -0
  25. package/dist/kube/types.js +2 -0
  26. package/dist/kube/types.js.map +1 -0
  27. package/dist/resources/filesystem.d.ts +15 -0
  28. package/dist/resources/filesystem.d.ts.map +1 -0
  29. package/dist/resources/filesystem.js +54 -0
  30. package/dist/resources/filesystem.js.map +1 -0
  31. package/dist/server.d.ts +3 -0
  32. package/dist/server.d.ts.map +1 -0
  33. package/dist/server.js +127 -0
  34. package/dist/server.js.map +1 -0
  35. package/dist/tools/index.d.ts +3 -0
  36. package/dist/tools/index.d.ts.map +1 -0
  37. package/dist/tools/index.js +3 -0
  38. package/dist/tools/index.js.map +1 -0
  39. package/dist/tools/kubernetes/index.d.ts +5 -0
  40. package/dist/tools/kubernetes/index.d.ts.map +1 -0
  41. package/dist/tools/kubernetes/index.js +6 -0
  42. package/dist/tools/kubernetes/index.js.map +1 -0
  43. package/dist/tools/kubernetes/metadata.d.ts +110 -0
  44. package/dist/tools/kubernetes/metadata.d.ts.map +1 -0
  45. package/dist/tools/kubernetes/metadata.js +19 -0
  46. package/dist/tools/kubernetes/metadata.js.map +1 -0
  47. package/dist/tools/kubernetes/searchTools-old.d.ts +35 -0
  48. package/dist/tools/kubernetes/searchTools-old.d.ts.map +1 -0
  49. package/dist/tools/kubernetes/searchTools-old.js +414 -0
  50. package/dist/tools/kubernetes/searchTools-old.js.map +1 -0
  51. package/dist/tools/kubernetes/searchTools-v2.d.ts +35 -0
  52. package/dist/tools/kubernetes/searchTools-v2.d.ts.map +1 -0
  53. package/dist/tools/kubernetes/searchTools-v2.js +269 -0
  54. package/dist/tools/kubernetes/searchTools-v2.js.map +1 -0
  55. package/dist/tools/kubernetes/searchTools.d.ts +87 -0
  56. package/dist/tools/kubernetes/searchTools.d.ts.map +1 -0
  57. package/dist/tools/kubernetes/searchTools.js +529 -0
  58. package/dist/tools/kubernetes/searchTools.js.map +1 -0
  59. package/dist/tools/kubernetes/typeDefinitions.d.ts +24 -0
  60. package/dist/tools/kubernetes/typeDefinitions.d.ts.map +1 -0
  61. package/dist/tools/kubernetes/typeDefinitions.js +518 -0
  62. package/dist/tools/kubernetes/typeDefinitions.js.map +1 -0
  63. package/dist/tools/types.d.ts +10 -0
  64. package/dist/tools/types.d.ts.map +1 -0
  65. package/dist/tools/types.js +2 -0
  66. package/dist/tools/types.js.map +1 -0
  67. package/dist/util/manifest.d.ts +5 -0
  68. package/dist/util/manifest.d.ts.map +1 -0
  69. package/dist/util/manifest.js +31 -0
  70. package/dist/util/manifest.js.map +1 -0
  71. package/dist/util/paths.d.ts +7 -0
  72. package/dist/util/paths.d.ts.map +1 -0
  73. package/dist/util/paths.js +14 -0
  74. package/dist/util/paths.js.map +1 -0
  75. package/dist/util/summary.d.ts +403 -0
  76. package/dist/util/summary.d.ts.map +1 -0
  77. package/dist/util/summary.js +211 -0
  78. package/dist/util/summary.js.map +1 -0
  79. package/package.json +61 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Harshad Patil
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,226 @@
1
+ # ProDisco (Progressive Disclosure Kuberentes MCP Server)
2
+
3
+ ProDisco gives MCP agents Kubernetes access that exactly follows Anthropic’s [Progressive Disclosure](https://www.anthropic.com/engineering/code-execution-with-mcp) pattern: the server exposes TypeScript modules, agents discover them through the filesystem, write code, and only the final console output returns to the chat.
4
+
5
+ ## Why Progressive Disclosure Matters
6
+
7
+ Anthropic’s latest guidance explains why MCP servers should progressively reveal capabilities instead of dumping every tool definition into the model context. When agents explore a filesystem of TypeScript modules, as they do with ProDisco, they only load what they need and process data inside the execution environment, then return a concise result to the chat. This keeps token usage low, improves latency, and avoids copying large intermediate payloads through the model ([source](https://www.anthropic.com/engineering/code-execution-with-mcp)).
8
+
9
+ In practice that means:
10
+ - Agents only see a single advertised tool (`kubernetes.searchTools`); they call it with structured parameters (resourceType, action, scope) to discover the TypeScript modules (get pods, list nodes, fetch logs, etc.) that the server exposes, then write their own code to compose those modules without loading unused schemas.
11
+ - Letting the model issue one instruction instead of micromanaging dozens of sequential tool calls.
12
+ - Agents can mix and match multiple Kubernetes modules joining pod stats with node health, or correlating events with logs without shuttling raw outputs between tools in the chat loop, which dramatically cuts token usage.
13
+
14
+ ProDisco ships with this layout out of the box, so any Claude Code or MCP-enabled agent can immediately adopt the progressive-disclosure workflow.
15
+
16
+ ---
17
+
18
+ ## Quick Start
19
+
20
+ ```bash
21
+ npm install
22
+ npm run build
23
+ claude mcp add --transport stdio prodisco -- node dist/server.js
24
+ claude mcp remove prodisco # remove when you're done
25
+ ```
26
+
27
+ Only **one tool** (`kubernetes.searchTools`) is advertised to the agent. Everything else is discovered via resources, so agents naturally stay in code mode.
28
+
29
+ ### Scripts cache convention
30
+
31
+ **Script Location:** `~/.prodisco/scripts/cache/`
32
+
33
+ ProDisco automatically creates a `~/.prodisco/scripts/cache/` directory in your home directory for storing helper scripts. This ensures scripts work from any directory and persist across sessions.
34
+
35
+ **How it works:**
36
+
37
+ 1. Call `kubernetes.searchTools` to get the `paths` object:
38
+ - `scriptsDirectory`: Where to write scripts (e.g., `~/.prodisco/scripts/cache/`)
39
+ - `packageDirectory`: Where dependencies are installed (use for imports)
40
+
41
+ 2. Write scripts to the `scriptsDirectory` path
42
+
43
+ 3. Import Kubernetes client from the `packageDirectory`:
44
+ ```typescript
45
+ import * as k8s from '/path/to/packageDirectory/node_modules/@kubernetes/client-node';
46
+ ```
47
+
48
+ 4. Execute with absolute paths:
49
+ ```bash
50
+ npx tsx ~/.prodisco/scripts/cache/<yourscript>.ts --flag=value
51
+ ```
52
+
53
+ **Best practices:**
54
+ - Always use paths from `kubernetes.searchTools` response (don't hardcode)
55
+ - Scripts must parse CLI args or env vars for all required values
56
+ - Print a brief usage message if arguments are missing
57
+ - Scripts persist across sessions and work from any directory
58
+
59
+ ---
60
+
61
+ ## Available Tools
62
+
63
+ ProDisco exposes two main tools for agents to discover and interact with the Kubernetes API:
64
+
65
+ ### 1. kubernetes.searchTools
66
+
67
+ Find Kubernetes API methods by resource type and action.
68
+
69
+ **Input:**
70
+ ```typescript
71
+ {
72
+ resourceType: string; // e.g., "Pod", "Deployment", "Service"
73
+ action?: string; // e.g., "list", "read", "create", "delete", "patch", "replace", "connect"
74
+ scope?: 'namespaced' | 'cluster' | 'all'; // default: 'all'
75
+ exclude?: { // Optional: filter out methods
76
+ actions?: string[]; // e.g., ["delete", "create"]
77
+ apiClasses?: string[]; // e.g., ["CoreV1Api"]
78
+ };
79
+ limit?: number; // Max results (default: 10, max: 50)
80
+ }
81
+ ```
82
+
83
+ **Example Queries:**
84
+ ```typescript
85
+ // List all Pod-related methods
86
+ { resourceType: "Pod" }
87
+
88
+ // List namespaced Pods
89
+ { resourceType: "Pod", action: "list", scope: "namespaced" }
90
+
91
+ // Create Deployment
92
+ { resourceType: "Deployment", action: "create" }
93
+
94
+ // Pod methods excluding delete actions
95
+ { resourceType: "Pod", exclude: { actions: ["delete"] } }
96
+
97
+ // Pod methods excluding CoreV1Api (shows only PolicyV1Api, AutoscalingV1Api, etc.)
98
+ { resourceType: "Pod", exclude: { apiClasses: ["CoreV1Api"] } }
99
+
100
+ // Pod methods excluding delete from CoreV1Api only (AND logic)
101
+ { resourceType: "Pod", exclude: { actions: ["delete"], apiClasses: ["CoreV1Api"] } }
102
+ ```
103
+
104
+ **Output Example:**
105
+ ```
106
+ Found 1 method(s) for resource "Pod", action "list", scope "namespaced"
107
+
108
+ 1. CoreV1Api.listNamespacedPod
109
+ method_args: { namespace: "string" }
110
+ return_values: response.items (array of Pod)
111
+ return_types: export class V1PodList {
112
+ key properties: apiVersion?: string;, items: Array<V1Pod>;, kind?: string;
113
+ (use kubernetes.getTypeDefinition for complete type details)
114
+
115
+ USAGE:
116
+ - All methods require object parameter: await api.method({ param: value })
117
+ - Write scripts to: /Users/you/.prodisco/scripts/cache/<yourscript>.ts
118
+ - Run scripts with: npx tsx /Users/you/.prodisco/scripts/cache/<yourscript>.ts
119
+ - Import dependencies from: /path/to/package/node_modules/@kubernetes/client-node
120
+
121
+ Paths (use these in your scripts):
122
+ {
123
+ "scriptsDirectory": "/Users/you/.prodisco/scripts/cache",
124
+ "packageDirectory": "/path/to/kubernetes-mcp"
125
+ }
126
+ ```
127
+
128
+ **Key Features:**
129
+ - Structured parameter matching: specify resource type, action, and scope
130
+ - **Exclude filtering for precise results**: Use the `exclude` parameter to filter out unwanted methods by actions and/or API classes
131
+ - Actions only: `{ actions: ["delete"] }` excludes all delete methods
132
+ - Multiple actions: `{ actions: ["delete", "create"] }` excludes both
133
+ - API classes only: `{ apiClasses: ["CoreV1Api"] }` excludes all CoreV1Api methods
134
+ - Both (AND logic): `{ actions: ["delete"], apiClasses: ["CoreV1Api"] }` excludes **only** delete methods from CoreV1Api (keeps other CoreV1Api methods and delete methods from other classes)
135
+ - **TIP**: Exclude is especially useful when broad searches return too many results (e.g., "Pod" matches CoreV1Api, AutoscalingV1Api, PolicyV1Api methods)
136
+ - Shows all required parameters (including special cases like CustomObjectsApi)
137
+ - Clear indication of return structure (`response` vs `response.items`)
138
+ - Brief inline type information with key properties
139
+ - Available actions: list, read, create, delete, patch, replace, connect, get, watch
140
+
141
+ **Common Search Patterns:**
142
+ ```typescript
143
+ // Pod logs: use "Log" or "PodLog", not "Pod" with "connect"
144
+ { resourceType: "Log" } // Returns: CoreV1Api.readNamespacedPodLog
145
+
146
+ // Pod exec/attach: use "Pod" with "connect"
147
+ { resourceType: "Pod", action: "connect" } // Returns: connectGetNamespacedPodExec, connectPostNamespacedPodAttach
148
+
149
+ // Pod eviction (drain nodes): use "Eviction" or "PodEviction"
150
+ { resourceType: "Eviction" } // Returns: CoreV1Api.createNamespacedPodEviction
151
+
152
+ // Binding pods to nodes: use "Binding" or "PodBinding"
153
+ { resourceType: "Binding" } // Returns: CoreV1Api.createNamespacedPodBinding
154
+
155
+ // Service account tokens: use "ServiceAccountToken"
156
+ { resourceType: "ServiceAccountToken" } // Returns: CoreV1Api.createNamespacedServiceAccountToken
157
+
158
+ // Cluster health: use "ComponentStatus"
159
+ { resourceType: "ComponentStatus" } // Returns: CoreV1Api.listComponentStatus
160
+
161
+ // Status subresources: search for the full resource name
162
+ { resourceType: "DeploymentStatus" } // Returns: readNamespacedDeploymentStatus, patchNamespacedDeploymentStatus
163
+
164
+ // Scale subresources: similar pattern
165
+ { resourceType: "DeploymentScale" } // Returns: readNamespacedDeploymentScale, patchNamespacedDeploymentScale
166
+ ```
167
+
168
+ ### 2. kubernetes.getTypeDefinition
169
+
170
+ Get detailed TypeScript type definitions for Kubernetes types.
171
+
172
+ **Input:**
173
+ ```typescript
174
+ {
175
+ types: string[]; // Type names or property paths
176
+ // Examples: ["V1Pod", "V1Deployment.spec", "V1Pod.spec.containers"]
177
+ depth?: number; // Nested type depth (default: 1, max: 2)
178
+ }
179
+ ```
180
+
181
+ **Dot Notation Support:**
182
+ Navigate directly to nested types:
183
+ - `V1Deployment.spec` → Returns `V1DeploymentSpec` type
184
+ - `V1Pod.spec.containers` → Returns `V1Container` type (array element)
185
+ - `V1Pod.status.conditions` → Returns `V1PodCondition` type
186
+
187
+ **Example Output:**
188
+ ```typescript
189
+ {
190
+ "V1Pod": {
191
+ "name": "V1Pod",
192
+ "definition": "V1Pod {\n apiVersion?: string\n kind?: string\n metadata?: V1ObjectMeta\n spec?: V1PodSpec\n status?: V1PodStatus\n ...\n}",
193
+ "nestedTypes": ["V1ObjectMeta", "V1PodSpec", "V1PodStatus"]
194
+ }
195
+ }
196
+ ```
197
+
198
+ **Key Features:**
199
+ - Native TypeScript parsing (uses TypeScript Compiler API, no regex)
200
+ - Dot notation for navigating nested types
201
+ - Automatic resolution of `Array<T>`, unions, and type references
202
+ - Controlled depth to avoid overwhelming output
203
+
204
+ **Type Definitions Location:**
205
+ All type definitions are read from:
206
+ ```
207
+ node_modules/@kubernetes/client-node/dist/gen/models/
208
+ ```
209
+ This directory contains 852 `.d.ts` files with complete Kubernetes type information.
210
+
211
+ ---
212
+
213
+ ## Integration Tests
214
+
215
+ End-to-end testing instructions (KIND cluster + Claude Agent SDK driver) now live in `docs/integration-testing.md`. The workflow is manual-only for now and assumes your Anthropic credentials are already configured. Run it locally with:
216
+
217
+ ```bash
218
+ npm run test:integration
219
+ ```
220
+
221
+ ---
222
+
223
+ ## License
224
+
225
+ MIT
226
+
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Generate inline TypeScript interfaces for Kubernetes tools
4
+ *
5
+ * Usage: npm run codegen
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=generateTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateTypes.d.ts","sourceRoot":"","sources":["../../src/codegen/generateTypes.ts"],"names":[],"mappings":";AACA;;;;GAIG"}
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Generate inline TypeScript interfaces for Kubernetes tools
4
+ *
5
+ * Usage: npm run codegen
6
+ */
7
+ import * as fs from 'fs';
8
+ import * as path from 'path';
9
+ import * as ts from 'typescript';
10
+ import { extractInterfaceFromFile, findKubernetesTypeFile } from './typeExtractor.js';
11
+ import { generateExpandedInterface } from './interfaceGenerator.js';
12
+ import { TOOL_TYPE_MAPPINGS } from './toolMapping.js';
13
+ const DRY_RUN = process.argv.includes('--dry-run');
14
+ console.log('🔧 Kubernetes Type Generator');
15
+ console.log('============================\n');
16
+ if (DRY_RUN) {
17
+ console.log('⚠️ DRY RUN MODE - No files will be modified\n');
18
+ }
19
+ for (const mapping of TOOL_TYPE_MAPPINGS) {
20
+ console.log(`📄 Processing ${mapping.toolFile}...`);
21
+ console.log(` Type: ${mapping.kubernetesType} -> ${mapping.resultTypeName}`);
22
+ // Special handling for simple types
23
+ if (mapping.kubernetesType === 'string' ||
24
+ mapping.kubernetesType.startsWith('Array<') ||
25
+ mapping.kubernetesType === 'object') {
26
+ console.log(` ⏭️ Skipping (simple type)\n`);
27
+ continue;
28
+ }
29
+ // Find the Kubernetes type file
30
+ const typeFile = findKubernetesTypeFile(mapping.kubernetesType);
31
+ if (!typeFile) {
32
+ console.log(` ❌ Could not find type file for ${mapping.kubernetesType}\n`);
33
+ continue;
34
+ }
35
+ console.log(` 📖 Reading from ${path.basename(typeFile)}`);
36
+ // Extract the interface
37
+ const interfaceInfo = extractInterfaceFromFile(typeFile, mapping.kubernetesType);
38
+ if (!interfaceInfo) {
39
+ console.log(` ❌ Could not extract interface ${mapping.kubernetesType}\n`);
40
+ continue;
41
+ }
42
+ console.log(` ✅ Extracted ${interfaceInfo.fields.length} fields`);
43
+ // Generate the inline interface code
44
+ const interfaceCode = generateExpandedInterface(mapping.resultTypeName, mapping.kubernetesType, interfaceInfo);
45
+ if (DRY_RUN) {
46
+ console.log(` 📝 Generated interface (${interfaceCode.split('\n').length} lines)`);
47
+ console.log(`\n${interfaceCode}\n`);
48
+ continue;
49
+ }
50
+ // Read the tool file
51
+ const toolFilePath = path.resolve(process.cwd(), mapping.toolFile);
52
+ if (!fs.existsSync(toolFilePath)) {
53
+ console.log(` ❌ Tool file not found: ${toolFilePath}\n`);
54
+ continue;
55
+ }
56
+ const toolFileContent = fs.readFileSync(toolFilePath, 'utf-8');
57
+ // Parse the tool file using TypeScript compiler
58
+ const sourceFile = ts.createSourceFile(toolFilePath, toolFileContent, ts.ScriptTarget.Latest, true);
59
+ // Find the interface declaration
60
+ let interfaceNode;
61
+ let interfaceStart = -1;
62
+ let interfaceEnd = -1;
63
+ function visit(node) {
64
+ if (ts.isInterfaceDeclaration(node) &&
65
+ node.name.text === mapping.resultTypeName &&
66
+ node.modifiers?.some(m => m.kind === ts.SyntaxKind.ExportKeyword)) {
67
+ interfaceNode = node;
68
+ // Get the full start (including JSDoc)
69
+ interfaceStart = node.getFullStart();
70
+ interfaceEnd = node.getEnd();
71
+ }
72
+ ts.forEachChild(node, visit);
73
+ }
74
+ visit(sourceFile);
75
+ if (!interfaceNode) {
76
+ console.log(` ⚠️ Could not find existing interface ${mapping.resultTypeName} to replace`);
77
+ console.log();
78
+ continue;
79
+ }
80
+ // Replace the interface
81
+ const beforeInterface = toolFileContent.substring(0, interfaceStart);
82
+ const afterInterface = toolFileContent.substring(interfaceEnd);
83
+ const newContent = beforeInterface + interfaceCode + afterInterface;
84
+ fs.writeFileSync(toolFilePath, newContent, 'utf-8');
85
+ console.log(` ✅ Updated interface in ${mapping.toolFile}`);
86
+ console.log();
87
+ }
88
+ console.log('✨ Done!\n');
89
+ if (!DRY_RUN) {
90
+ console.log('💡 Next steps:');
91
+ console.log(' 1. Review the generated interfaces');
92
+ console.log(' 2. Run: npm run build');
93
+ console.log(' 3. Run: npm test');
94
+ console.log(' 4. Commit the changes\n');
95
+ }
96
+ //# sourceMappingURL=generateTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateTypes.js","sourceRoot":"","sources":["../../src/codegen/generateTypes.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAEnD,OAAO,CAAC,GAAG,CAAC,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"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generate inline TypeScript interfaces from Kubernetes types
3
+ */
4
+ import { InterfaceInfo } from './typeExtractor.js';
5
+ /**
6
+ * Generate expanded inline interface with detailed nested types
7
+ */
8
+ export declare function generateExpandedInterface(resultTypeName: string, kubernetesType: string, interfaceInfo: InterfaceInfo): string;
9
+ //# sourceMappingURL=interfaceGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaceGenerator.d.ts","sourceRoot":"","sources":["../../src/codegen/interfaceGenerator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAoD,MAAM,oBAAoB,CAAC;AAsLrG;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,aAAa,GAC3B,MAAM,CAoCR"}
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Generate inline TypeScript interfaces from Kubernetes types
3
+ */
4
+ import { extractInterfaceFromFile, findKubernetesTypeFile } from './typeExtractor.js';
5
+ /**
6
+ * Types that should NOT be expanded (too complex or rarely used)
7
+ */
8
+ const DONT_EXPAND_TYPES = new Set([
9
+ // Complex scheduling/affinity rules
10
+ 'V1Affinity', 'V1NodeAffinity', 'V1PodAffinity', 'V1PodAntiAffinity',
11
+ 'V1NodeSelector', 'V1NodeSelectorRequirement',
12
+ 'V1LabelSelectorRequirement',
13
+ // Complex security contexts
14
+ 'V1SecurityContext', 'V1PodSecurityContext', 'V1SELinuxOptions',
15
+ 'V1SeccompProfile', 'V1WindowsSecurityContextOptions', 'V1Capabilities',
16
+ 'V1AppArmorProfile',
17
+ // Probes (detailed structure not commonly needed)
18
+ 'V1Probe', 'V1HTTPGetAction', 'V1TCPSocketAction', 'V1ExecAction',
19
+ 'V1GRPCAction', 'V1SleepAction', 'V1HTTPHeader',
20
+ // Lifecycle hooks
21
+ 'V1Lifecycle', 'V1LifecycleHandler',
22
+ // Volume types (too many variants)
23
+ 'V1VolumeMount', 'V1PersistentVolumeClaimVolumeSource',
24
+ 'V1ConfigMapVolumeSource', 'V1SecretVolumeSource', 'V1EmptyDirVolumeSource',
25
+ 'V1HostPathVolumeSource', 'V1ProjectedVolumeSource', 'V1CSIVolumeSource',
26
+ // Resource references
27
+ 'V1ResourceClaim', 'V1TypedLocalObjectReference',
28
+ 'V1LocalObjectReference', 'V1ObjectReference',
29
+ // Field selectors
30
+ 'V1EnvVarSource', 'V1ConfigMapKeySelector', 'V1SecretKeySelector',
31
+ 'V1ObjectFieldSelector', 'V1ResourceFieldSelector',
32
+ 'V1ConfigMapEnvSource', 'V1SecretEnvSource',
33
+ // Tolerations and taints
34
+ 'V1Taint',
35
+ // Topology
36
+ 'V1TopologySpreadConstraint', 'V1PodAffinityTerm', 'V1WeightedPodAffinityTerm',
37
+ // Other complex types
38
+ 'V1PodReadinessGate', 'V1PodResourceClaim', 'V1ContainerResizePolicy',
39
+ 'V1EphemeralContainer', 'V1HostAlias', 'V1PodOS',
40
+ ]);
41
+ /**
42
+ * Check if a type should not be expanded (return generic object instead)
43
+ */
44
+ function shouldNotExpand(typeName) {
45
+ return DONT_EXPAND_TYPES.has(typeName);
46
+ }
47
+ /**
48
+ * Check if a type is a primitive or should not be expanded
49
+ */
50
+ function isPrimitiveType(typeName) {
51
+ const primitives = [
52
+ 'string', 'number', 'boolean', 'unknown', 'any', 'void', 'null', 'undefined',
53
+ 'Date', 'object', 'never'
54
+ ];
55
+ // Check if it's a primitive
56
+ if (primitives.includes(typeName)) {
57
+ return true;
58
+ }
59
+ // Check if it's a Record type
60
+ if (typeName.startsWith('Record<') || typeName.startsWith('{')) {
61
+ return true;
62
+ }
63
+ // Check if it's a union with primitives
64
+ if (typeName.includes('|')) {
65
+ return true;
66
+ }
67
+ return false;
68
+ }
69
+ /**
70
+ * Extract the inner type from Array<T>
71
+ */
72
+ function extractArrayType(typeName) {
73
+ const match = typeName.match(/^Array<(.+)>$/);
74
+ return match && match[1] ? match[1] : null;
75
+ }
76
+ /**
77
+ * Recursively expand a type into an inline interface definition
78
+ */
79
+ function expandType(typeName, indent = ' ', depth = 0, visited = new Set()) {
80
+ // Prevent infinite recursion - limit to 3 levels for reasonable file sizes
81
+ if (depth > 3) {
82
+ return '{ [key: string]: unknown }';
83
+ }
84
+ // Convert Date to string
85
+ if (typeName === 'Date') {
86
+ return 'string';
87
+ }
88
+ // Check if this type should not be expanded (too complex)
89
+ if (shouldNotExpand(typeName)) {
90
+ return '{ [key: string]: unknown }';
91
+ }
92
+ // Check if it's a primitive
93
+ if (isPrimitiveType(typeName)) {
94
+ return typeName === 'object' ? '{ [key: string]: unknown }' : typeName;
95
+ }
96
+ // Handle Array types
97
+ const arrayInnerType = extractArrayType(typeName);
98
+ if (arrayInnerType) {
99
+ const expandedInner = expandType(arrayInnerType, indent, depth + 1, visited);
100
+ // If the inner type is complex (multiline), format it properly
101
+ if (expandedInner.includes('\n')) {
102
+ return `Array<${expandedInner}>`;
103
+ }
104
+ return `Array<${expandedInner}>`;
105
+ }
106
+ // Check for circular reference
107
+ if (visited.has(typeName)) {
108
+ return '{ [key: string]: unknown }';
109
+ }
110
+ // Try to find and expand Kubernetes types
111
+ if (typeName.startsWith('V1') || typeName.startsWith('V2')) {
112
+ const typeFile = findKubernetesTypeFile(typeName);
113
+ if (typeFile) {
114
+ const typeInfo = extractInterfaceFromFile(typeFile, typeName);
115
+ if (typeInfo) {
116
+ visited.add(typeName);
117
+ const expanded = expandTypeInfo(typeInfo, indent + ' ', depth + 1, visited);
118
+ visited.delete(typeName);
119
+ return expanded;
120
+ }
121
+ }
122
+ }
123
+ // Fallback
124
+ return '{ [key: string]: unknown }';
125
+ }
126
+ /**
127
+ * Expand a complete InterfaceInfo into inline type definition
128
+ */
129
+ function expandTypeInfo(typeInfo, indent, depth, visited) {
130
+ const lines = [];
131
+ lines.push('{');
132
+ for (const field of typeInfo.fields) {
133
+ // Skip static/internal fields
134
+ if (['discriminator', 'mapping', 'attributeTypeMap'].includes(field.name)) {
135
+ continue;
136
+ }
137
+ // Add field JSDoc if present
138
+ if (field.jsDoc) {
139
+ lines.push(`${indent}/** ${field.jsDoc} */`);
140
+ }
141
+ const optional = field.optional ? '?' : '';
142
+ const expandedType = expandType(field.type, indent, depth, visited);
143
+ // Handle multiline expanded types
144
+ if (expandedType.includes('\n')) {
145
+ lines.push(`${indent}${field.name}${optional}: ${expandedType};`);
146
+ }
147
+ else {
148
+ lines.push(`${indent}${field.name}${optional}: ${expandedType};`);
149
+ }
150
+ }
151
+ lines.push(indent.slice(0, -2) + '}');
152
+ return lines.join('\n');
153
+ }
154
+ /**
155
+ * Generate expanded inline interface with detailed nested types
156
+ */
157
+ export function generateExpandedInterface(resultTypeName, kubernetesType, interfaceInfo) {
158
+ const lines = [];
159
+ // Add interface JSDoc
160
+ if (interfaceInfo.jsDoc) {
161
+ lines.push('/**');
162
+ lines.push(` * ${interfaceInfo.jsDoc}`);
163
+ lines.push(' */');
164
+ }
165
+ lines.push(`export interface ${resultTypeName} {`);
166
+ const visited = new Set();
167
+ visited.add(kubernetesType);
168
+ // Generate fields with recursive expansion
169
+ for (const field of interfaceInfo.fields) {
170
+ // Skip static fields
171
+ if (['discriminator', 'mapping', 'attributeTypeMap'].includes(field.name)) {
172
+ continue;
173
+ }
174
+ // Add field JSDoc
175
+ if (field.jsDoc) {
176
+ lines.push(` /** ${field.jsDoc} */`);
177
+ }
178
+ const optional = field.optional ? '?' : '';
179
+ const expandedType = expandType(field.type, ' ', 0, visited);
180
+ lines.push(` ${field.name}${optional}: ${expandedType};`);
181
+ }
182
+ lines.push('}');
183
+ return lines.join('\n');
184
+ }
185
+ //# sourceMappingURL=interfaceGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaceGenerator.js","sourceRoot":"","sources":["../../src/codegen/interfaceGenerator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAiB,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,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O,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Mapping of tool files to their Kubernetes types
3
+ */
4
+ export interface ToolTypeMapping {
5
+ toolFile: string;
6
+ resultTypeName: string;
7
+ kubernetesType: string;
8
+ description?: string;
9
+ }
10
+ export declare const TOOL_TYPE_MAPPINGS: ToolTypeMapping[];
11
+ //# sourceMappingURL=toolMapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolMapping.d.ts","sourceRoot":"","sources":["../../src/codegen/toolMapping.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,EAyE/C,CAAC"}