@kwirthmagnify/kwirth-common-ai 0.5.19 → 0.5.20

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/dist/back.d.ts CHANGED
@@ -20,6 +20,13 @@ export interface IToolInfo {
20
20
  }
21
21
  export declare const runWithToolContext: <T>(context: IToolContext, fn: () => Promise<T>) => Promise<T>;
22
22
  export declare const tools: {
23
+ readonly list_namespaces: import("ai").Tool<Record<string, never>, {
24
+ namespaces: any;
25
+ error?: undefined;
26
+ } | {
27
+ error: any;
28
+ namespaces?: undefined;
29
+ }>;
23
30
  readonly get_node_data: import("ai").Tool<Record<string, never>, any>;
24
31
  readonly get_cluster_data: import("ai").Tool<Record<string, never>, {
25
32
  name: any;
package/dist/back.js CHANGED
@@ -202,6 +202,30 @@ function mapToJson(data) {
202
202
  }
203
203
  exports.tools = {
204
204
  // ── CLUSTER CONFIG ───────────────────────────────────────────────────────
205
+ list_namespaces: (0, ai_1.tool)({
206
+ description: 'Lists all namespaces in the cluster with their status and labels.',
207
+ inputSchema: zod_1.z.object({}),
208
+ execute: async () => {
209
+ var _a;
210
+ ctx().trace('list_namespaces', {});
211
+ try {
212
+ const resp = await ctx().clusterInfo.coreApi.listNamespace();
213
+ return {
214
+ namespaces: resp.items.map((ns) => {
215
+ var _a, _b, _c, _d;
216
+ return ({
217
+ name: (_a = ns.metadata) === null || _a === void 0 ? void 0 : _a.name,
218
+ status: (_b = ns.status) === null || _b === void 0 ? void 0 : _b.phase,
219
+ labels: (_d = (_c = ns.metadata) === null || _c === void 0 ? void 0 : _c.labels) !== null && _d !== void 0 ? _d : {}
220
+ });
221
+ })
222
+ };
223
+ }
224
+ catch (err) {
225
+ return { error: (_a = err.message) !== null && _a !== void 0 ? _a : String(err) };
226
+ }
227
+ }
228
+ }),
205
229
  get_node_data: (0, ai_1.tool)({
206
230
  description: 'Returns configuration info about all Kubernetes nodes (name, IP). Configuration only — not workload or usage data.',
207
231
  inputSchema: zod_1.z.object({}),
@@ -662,6 +686,7 @@ exports.tools = {
662
686
  }),
663
687
  };
664
688
  exports.toolInfoList = [
689
+ { name: 'list_namespaces', description: 'Lists all namespaces in the cluster with their status and labels.' },
665
690
  { name: 'get_node_data', description: 'Returns configuration info about all Kubernetes nodes (name, IP). Configuration only — not workload or usage data.' },
666
691
  { name: 'get_cluster_data', description: 'Returns general cluster info: name, flavour (AKS/EKS/GKE/k3s/k3d), total vCPUs, total memory, node count and readiness status.' },
667
692
  { name: 'get_workload_data', description: 'Returns all workloads in the cluster: deployments, statefulsets, daemonsets, pods and services. Optionally filter by namespace.' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-ai",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "description": "Shared AI/LLM types and utilities for Kwirth AI plugins",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q 2>nul & tsc"