@kwirthmagnify/kwirth-common-ai 0.5.58 → 0.5.59

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
@@ -5,7 +5,7 @@ interface ILogChannel {
5
5
  logWarning?: (msg: string) => void;
6
6
  logError?: (msg: string) => void;
7
7
  }
8
- import { LanguageModel, ToolSet } from 'ai';
8
+ import { LanguageModel, Tool, ToolSet } from 'ai';
9
9
  import { z } from 'zod';
10
10
  export declare const buildModel: (llm: ILlm, providers: ILlmProvider[]) => LanguageModel | null;
11
11
  export interface IVisionResult<T> {
@@ -275,15 +275,15 @@ export interface IAgentToolHooks {
275
275
  */
276
276
  export declare const buildAgentTools: (config: IToolsetConfig, context: IToolContext, hooks?: IAgentToolHooks) => ToolSet;
277
277
  export declare const tools: {
278
- readonly list_namespaces: import("ai").Tool<Record<string, never>, {
278
+ readonly list_namespaces: Tool<Record<string, never>, {
279
279
  namespaces: any;
280
280
  error?: undefined;
281
281
  } | {
282
282
  error: any;
283
283
  namespaces?: undefined;
284
284
  }>;
285
- readonly get_node_data: import("ai").Tool<Record<string, never>, any>;
286
- readonly get_cluster_data: import("ai").Tool<Record<string, never>, {
285
+ readonly get_node_data: Tool<Record<string, never>, any>;
286
+ readonly get_cluster_data: Tool<Record<string, never>, {
287
287
  name: any;
288
288
  flavour: any;
289
289
  vcpus: any;
@@ -300,7 +300,7 @@ export declare const tools: {
300
300
  nodeCount?: undefined;
301
301
  nodes?: undefined;
302
302
  }>;
303
- readonly get_workload_data: import("ai").Tool<{
303
+ readonly get_workload_data: Tool<{
304
304
  namespace?: string | undefined;
305
305
  }, {
306
306
  deployments: any;
@@ -317,7 +317,7 @@ export declare const tools: {
317
317
  pods?: undefined;
318
318
  services?: undefined;
319
319
  }>;
320
- readonly get_space_data: import("ai").Tool<{
320
+ readonly get_space_data: Tool<{
321
321
  namespace: string;
322
322
  }, {
323
323
  namespace: string;
@@ -342,10 +342,10 @@ export declare const tools: {
342
342
  services?: undefined;
343
343
  configMaps?: undefined;
344
344
  }>;
345
- readonly get_namespace_yaml: import("ai").Tool<{
345
+ readonly get_namespace_yaml: Tool<{
346
346
  name: string;
347
347
  }, any>;
348
- readonly describe_service: import("ai").Tool<{
348
+ readonly describe_service: Tool<{
349
349
  namespace: string;
350
350
  name: string;
351
351
  }, {
@@ -375,7 +375,7 @@ export declare const tools: {
375
375
  endpoints?: undefined;
376
376
  endpointCount?: undefined;
377
377
  }>;
378
- readonly describe_ingress: import("ai").Tool<{
378
+ readonly describe_ingress: Tool<{
379
379
  namespace: string;
380
380
  name: string;
381
381
  }, {
@@ -397,7 +397,7 @@ export declare const tools: {
397
397
  tls?: undefined;
398
398
  loadBalancer?: undefined;
399
399
  }>;
400
- readonly describe_controller: import("ai").Tool<{
400
+ readonly describe_controller: Tool<{
401
401
  namespace: string;
402
402
  kind: "Deployment" | "StatefulSet" | "DaemonSet" | "ReplicaSet";
403
403
  name: string;
@@ -438,11 +438,11 @@ export declare const tools: {
438
438
  selector?: undefined;
439
439
  template?: undefined;
440
440
  }>;
441
- readonly get_service_yaml: import("ai").Tool<{
441
+ readonly get_service_yaml: Tool<{
442
442
  namespace: string;
443
443
  name: string;
444
444
  }, any>;
445
- readonly list_services: import("ai").Tool<{
445
+ readonly list_services: Tool<{
446
446
  namespace?: string | undefined;
447
447
  }, {
448
448
  services: any;
@@ -451,7 +451,7 @@ export declare const tools: {
451
451
  error: any;
452
452
  services?: undefined;
453
453
  }>;
454
- readonly list_ingresses: import("ai").Tool<{
454
+ readonly list_ingresses: Tool<{
455
455
  namespace?: string | undefined;
456
456
  }, {
457
457
  ingresses: any;
@@ -460,11 +460,11 @@ export declare const tools: {
460
460
  error: any;
461
461
  ingresses?: undefined;
462
462
  }>;
463
- readonly get_ingress_yaml: import("ai").Tool<{
463
+ readonly get_ingress_yaml: Tool<{
464
464
  namespace: string;
465
465
  name: string;
466
466
  }, any>;
467
- readonly get_cluster_usage: import("ai").Tool<Record<string, never>, {
467
+ readonly get_cluster_usage: Tool<Record<string, never>, {
468
468
  error: string;
469
469
  vcpus?: undefined;
470
470
  memoryGB?: undefined;
@@ -483,10 +483,10 @@ export declare const tools: {
483
483
  metricsIntervalSeconds: any;
484
484
  error?: undefined;
485
485
  }>;
486
- readonly get_node_usage: import("ai").Tool<{
486
+ readonly get_node_usage: Tool<{
487
487
  nodeName?: string | undefined;
488
488
  }, any>;
489
- readonly get_deployment_usage: import("ai").Tool<{
489
+ readonly get_deployment_usage: Tool<{
490
490
  namespace: string;
491
491
  name: string;
492
492
  }, {
@@ -506,7 +506,7 @@ export declare const tools: {
506
506
  memoryMB?: undefined;
507
507
  timestamp?: undefined;
508
508
  }>;
509
- readonly get_prev_cluster_usage: import("ai").Tool<{
509
+ readonly get_prev_cluster_usage: Tool<{
510
510
  count?: number | undefined;
511
511
  }, {
512
512
  vcpus: any;
@@ -518,7 +518,7 @@ export declare const tools: {
518
518
  }[] | {
519
519
  error: string;
520
520
  }>;
521
- readonly get_prev_node_usage: import("ai").Tool<{
521
+ readonly get_prev_node_usage: Tool<{
522
522
  nodeName?: string | undefined;
523
523
  count?: number | undefined;
524
524
  }, {
@@ -526,7 +526,7 @@ export declare const tools: {
526
526
  }[] | {
527
527
  error: string;
528
528
  }>;
529
- readonly get_prev_deployment_usage: import("ai").Tool<{
529
+ readonly get_prev_deployment_usage: Tool<{
530
530
  namespace: string;
531
531
  name: string;
532
532
  count?: number | undefined;
@@ -540,7 +540,7 @@ export declare const tools: {
540
540
  }[] | {
541
541
  error: any;
542
542
  }>;
543
- readonly get_prev_space_data: import("ai").Tool<{
543
+ readonly get_prev_space_data: Tool<{
544
544
  namespace: string;
545
545
  count?: number | undefined;
546
546
  }, {
@@ -552,7 +552,7 @@ export declare const tools: {
552
552
  }[] | {
553
553
  error: string;
554
554
  }>;
555
- readonly add_node: import("ai").Tool<{
555
+ readonly add_node: Tool<{
556
556
  nodeName?: string | undefined;
557
557
  nodePoolName?: string | undefined;
558
558
  }, {
@@ -574,7 +574,7 @@ export declare const tools: {
574
574
  stderr?: undefined;
575
575
  error?: undefined;
576
576
  }>;
577
- readonly remove_node: import("ai").Tool<{
577
+ readonly remove_node: Tool<{
578
578
  nodeName: string;
579
579
  nodePoolName?: string | undefined;
580
580
  }, {
@@ -596,7 +596,7 @@ export declare const tools: {
596
596
  stderr?: undefined;
597
597
  error?: undefined;
598
598
  }>;
599
- readonly stop_node: import("ai").Tool<{
599
+ readonly stop_node: Tool<{
600
600
  nodeName: string;
601
601
  }, {
602
602
  success: boolean;
@@ -617,7 +617,7 @@ export declare const tools: {
617
617
  stderr: string;
618
618
  error?: undefined;
619
619
  }>;
620
- readonly start_node: import("ai").Tool<{
620
+ readonly start_node: Tool<{
621
621
  nodeName: string;
622
622
  }, {
623
623
  success: boolean;
@@ -638,7 +638,7 @@ export declare const tools: {
638
638
  stderr?: undefined;
639
639
  error?: undefined;
640
640
  }>;
641
- readonly add_replica: import("ai").Tool<{
641
+ readonly add_replica: Tool<{
642
642
  namespace: string;
643
643
  name: string;
644
644
  }, {
@@ -650,7 +650,7 @@ export declare const tools: {
650
650
  error: any;
651
651
  message?: undefined;
652
652
  }>;
653
- readonly remove_replica: import("ai").Tool<{
653
+ readonly remove_replica: Tool<{
654
654
  namespace: string;
655
655
  name: string;
656
656
  }, {
@@ -662,7 +662,7 @@ export declare const tools: {
662
662
  error: any;
663
663
  message?: undefined;
664
664
  }>;
665
- readonly restart_deployment: import("ai").Tool<{
665
+ readonly restart_deployment: Tool<{
666
666
  namespace: string;
667
667
  name: string;
668
668
  }, {
@@ -674,7 +674,7 @@ export declare const tools: {
674
674
  error: any;
675
675
  message?: undefined;
676
676
  }>;
677
- readonly delete_pod: import("ai").Tool<{
677
+ readonly delete_pod: Tool<{
678
678
  namespace: string;
679
679
  name: string;
680
680
  }, {
@@ -686,17 +686,17 @@ export declare const tools: {
686
686
  error: any;
687
687
  message?: undefined;
688
688
  }>;
689
- readonly times_two: import("ai").Tool<{
689
+ readonly times_two: Tool<{
690
690
  data: number;
691
691
  }, number>;
692
- readonly father_of: import("ai").Tool<{
692
+ readonly father_of: Tool<{
693
693
  data: string;
694
694
  }, string>;
695
- readonly get_certificate_info: import("ai").Tool<{
695
+ readonly get_certificate_info: Tool<{
696
696
  hostname: string;
697
697
  port?: number | undefined;
698
698
  }, unknown>;
699
- readonly get_cluster_events: import("ai").Tool<{
699
+ readonly get_cluster_events: Tool<{
700
700
  warningsOnly?: boolean | undefined;
701
701
  namespace?: string | undefined;
702
702
  limit?: number | undefined;
@@ -704,14 +704,14 @@ export declare const tools: {
704
704
  count: number;
705
705
  events: Record<string, unknown>[];
706
706
  }>;
707
- readonly get_object_events: import("ai").Tool<{
707
+ readonly get_object_events: Tool<{
708
708
  namespace: string;
709
709
  name: string;
710
710
  }, {
711
711
  count: number;
712
712
  events: Record<string, unknown>[];
713
713
  }>;
714
- readonly get_pod_logs: import("ai").Tool<{
714
+ readonly get_pod_logs: Tool<{
715
715
  namespace: string;
716
716
  name: string;
717
717
  container?: string | undefined;
@@ -734,7 +734,7 @@ export declare const tools: {
734
734
  truncated?: undefined;
735
735
  logs?: undefined;
736
736
  }>;
737
- readonly describe_pod: import("ai").Tool<{
737
+ readonly describe_pod: Tool<{
738
738
  namespace: string;
739
739
  name: string;
740
740
  }, {
@@ -774,20 +774,20 @@ export declare const tools: {
774
774
  initContainers?: undefined;
775
775
  spec?: undefined;
776
776
  }>;
777
- readonly get_pod_yaml: import("ai").Tool<{
777
+ readonly get_pod_yaml: Tool<{
778
778
  namespace: string;
779
779
  name: string;
780
780
  }, any>;
781
- readonly get_deployment_yaml: import("ai").Tool<{
781
+ readonly get_deployment_yaml: Tool<{
782
782
  namespace: string;
783
783
  name: string;
784
784
  }, any>;
785
- readonly get_controller_yaml: import("ai").Tool<{
785
+ readonly get_controller_yaml: Tool<{
786
786
  namespace: string;
787
787
  kind: "Deployment" | "StatefulSet" | "DaemonSet" | "ReplicaSet";
788
788
  name: string;
789
789
  }, any>;
790
- readonly get_rollout_history: import("ai").Tool<{
790
+ readonly get_rollout_history: Tool<{
791
791
  namespace: string;
792
792
  name: string;
793
793
  }, {
@@ -803,7 +803,7 @@ export declare const tools: {
803
803
  revisionCount?: undefined;
804
804
  revisions?: undefined;
805
805
  }>;
806
- readonly get_configmap: import("ai").Tool<{
806
+ readonly get_configmap: Tool<{
807
807
  namespace: string;
808
808
  name: string;
809
809
  }, {
@@ -823,7 +823,7 @@ export declare const tools: {
823
823
  data?: undefined;
824
824
  binaryDataKeys?: undefined;
825
825
  }>;
826
- readonly get_secret: import("ai").Tool<{
826
+ readonly get_secret: Tool<{
827
827
  namespace: string;
828
828
  name: string;
829
829
  }, {
@@ -843,7 +843,7 @@ export declare const tools: {
843
843
  lastModified?: undefined;
844
844
  keys?: undefined;
845
845
  }>;
846
- readonly get_workload_config_refs: import("ai").Tool<{
846
+ readonly get_workload_config_refs: Tool<{
847
847
  namespace: string;
848
848
  name: string;
849
849
  }, {
@@ -868,7 +868,7 @@ export declare const tools: {
868
868
  namespace?: undefined;
869
869
  refs?: undefined;
870
870
  }>;
871
- readonly get_source_file: import("ai").Tool<{
871
+ readonly get_source_file: Tool<{
872
872
  repo: string;
873
873
  ref: string;
874
874
  path: string;
package/dist/back.js CHANGED
@@ -543,9 +543,15 @@ const buildAgentTools = (config, context, hooks = {}) => {
543
543
  const { effective } = (0, exports.resolveTools)(config);
544
544
  const entries = effective.map(e => {
545
545
  const invocationOf = (args) => ({ ref: e.ref, toolsetId: e.toolsetId, toolName: e.name, args });
546
- // `dynamicTool` y no `tool`: el esquema de una tool empaquetada no se conoce en compilacion, y el
547
- // helper tipado infiere `never` para un ZodTypeAny generico.
548
- return [e.name, (0, ai_1.dynamicTool)({
546
+ // ⚠️ Un objeto PLANO, no `dynamicTool`. Parece equivalente y no lo es:
547
+ // tool(t) => t (solo ayuda de tipos, no toca nada)
548
+ // dynamicTool(t) => { ...t, type: 'dynamic' } (marca la tool en RUNTIME)
549
+ // Una tool marcada como dinamica la trata el SDK por otro camino, y con `Output.object` la
550
+ // ejecucion acaba en AI_NoOutputGeneratedError: la tool corre, devuelve, y la respuesta
551
+ // estructurada no se genera. Se uso `dynamicTool` para esquivar una friccion de tipos —el helper
552
+ // `tool()` infiere `never` con un ZodTypeAny generico— y el precio fue cambiar el comportamiento.
553
+ // El casteo es la forma honesta: lo que el SDK necesita es exactamente este objeto.
554
+ return [e.name, {
549
555
  description: e.tool.description,
550
556
  inputSchema: e.tool.inputSchema,
551
557
  execute: async (rawArgs) => {
@@ -576,7 +582,7 @@ const buildAgentTools = (config, context, hooks = {}) => {
576
582
  return { error: message };
577
583
  }
578
584
  }
579
- })];
585
+ }];
580
586
  });
581
587
  return Object.fromEntries(entries);
582
588
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-ai",
3
- "version": "0.5.58",
3
+ "version": "0.5.59",
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",