@kwirthmagnify/kwirth-common-ai 0.5.61 → 0.5.62

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/front.js CHANGED
@@ -95,9 +95,9 @@ const AiConfigLlm = (props) => {
95
95
  const [key, setKey] = (0, react_1.useState)('');
96
96
  const [inputCostPerMillion, setInputCostPerMillion] = (0, react_1.useState)(0);
97
97
  const [outputCostPerMillion, setOutputCostPerMillion] = (0, react_1.useState)(0);
98
- // Re-sincroniza el estado cuando llegan los modelos async (mismo fix de race que AiConfigProvider): al abrir,
99
- // el padre monta el diálogo con props.llms vacío y los pide por WS; sin esto, la lista quedaba vacía hasta
100
- // cerrar/reabrir.
98
+ // Re-syncs state when the models arrive asynchronously (same race fix as AiConfigProvider): on open,
99
+ // the parent mounts the dialog with props.llms empty and requests them over WS; without this, the list
100
+ // stayed empty until the dialog was closed and reopened.
101
101
  (0, react_1.useEffect)(() => {
102
102
  setLlms(JSON.parse(JSON.stringify(props.llms)));
103
103
  setSelectedIndex(null);
package/dist/index.d.ts CHANGED
@@ -38,37 +38,37 @@ export interface IAgent {
38
38
  steps: number;
39
39
  readOnly: boolean;
40
40
  }
41
- /** Que le hace una tool al mundo. */
41
+ /** What a tool does to the world. */
42
42
  export declare enum EToolEffect {
43
43
  READ = "read",
44
44
  WRITE = "write"
45
45
  }
46
46
  export declare enum EToolSensitivity {
47
- PUBLIC = "public",// inventario, formas, nombres
48
- INTERNAL = "internal",// configuracion, eventos, logs
47
+ PUBLIC = "public",// inventory, shapes, names
48
+ INTERNAL = "internal",// configuration, events, logs
49
49
  SECRET = "secret"
50
50
  }
51
51
  export declare enum ECapability {
52
- K8S = "k8s",// acceso al cluster
53
- METRICS = "metrics",// metricas, actuales e historicas
54
- EVENTS = "events",// buffer de eventos del cluster
52
+ K8S = "k8s",// cluster access
53
+ METRICS = "metrics",// metrics, current and historical
54
+ EVENTS = "events",// cluster event buffer
55
55
  REPOS = "repos"
56
56
  }
57
- /** Separador de una referencia cualificada a una tool: '<toolset>/<tool>'. */
57
+ /** Separator of a qualified reference to a tool: '<toolset>/<tool>'. */
58
58
  export declare const TOOL_REF_SEPARATOR = "/";
59
59
  export declare const toolRef: (toolsetId: string, toolName: string) => string;
60
60
  export declare const parseToolRef: (ref: string) => {
61
61
  toolsetId: string;
62
62
  toolName: string;
63
63
  } | undefined;
64
- /** Una tool, sin lo necesario para ejecutarla. Es lo que viaja al front. */
64
+ /** A tool, without what it takes to run it. This is what travels to the front end. */
65
65
  export interface IAiToolInfo {
66
66
  name: string;
67
67
  description: string;
68
68
  effect: EToolEffect;
69
69
  sensitivity: EToolSensitivity;
70
70
  }
71
- /** Un toolset, sin lo necesario para ejecutar sus tools. Es lo que viaja al front. */
71
+ /** A toolset, without what it takes to run its tools. This is what travels to the front end. */
72
72
  export interface IAiToolsetInfo {
73
73
  id: string;
74
74
  version: string;
package/dist/index.js CHANGED
@@ -6,46 +6,46 @@ exports.STORAGE_KEY_LLMS = 'kwirth-ai-llms';
6
6
  exports.PROVIDERS_AVAILABLE = ['google', 'openai', 'openrouter', 'mistral', 'groq', 'deepseek', 'anthropic', 'openai-compat'];
7
7
  exports.STORAGE_KEY_AGENTS = 'kwirth-ai-agents';
8
8
  // ─────────────────────────────────────────────────────────────────────────────────────────────────────
9
- // Contrato de toolsets de IA (plan: plans/ai-tools/PLAN.md, S1)
9
+ // AI toolset contract (plan: plans/ai-tools/PLAN.md, S1)
10
10
  //
11
- // La unidad es el TOOLSET, no la tool: ninguna tool es alcanzable fuera de uno. Para gestionar una tool
12
- // sola se empaqueta un toolset con una sola tool, y asi no existe el concepto de 'tool suelta' ni en el
13
- // modelo, ni en la configuracion, ni en la UI.
11
+ // The unit is the TOOLSET, not the tool: no tool is reachable outside one. To manage a single tool you
12
+ // package a toolset holding just that tool, and so the notion of a 'loose tool' does not exist in the
13
+ // model, in the configuration, or in the UI.
14
14
  //
15
- // Lo de aqui es ISOMORFICO: lo que hace falta para DECIDIR sobre una tool (mostrarla, agruparla,
16
- // autorizarla, configurarla). Lo que hace falta para EJECUTARLA —inputSchema y execute— vive en back.ts,
17
- // porque el front ni lo necesita ni debe cargarlo.
15
+ // What lives here is ISOMORPHIC: what it takes to DECIDE about a tool (show it, group it, authorize it,
16
+ // configure it). What it takes to RUN it — inputSchema and execute — lives in back.ts, because the front
17
+ // end neither needs it nor should load it.
18
18
  // ─────────────────────────────────────────────────────────────────────────────────────────────────────
19
- /** Que le hace una tool al mundo. */
19
+ /** What a tool does to the world. */
20
20
  var EToolEffect;
21
21
  (function (EToolEffect) {
22
22
  EToolEffect["READ"] = "read";
23
23
  EToolEffect["WRITE"] = "write";
24
24
  })(EToolEffect || (exports.EToolEffect = EToolEffect = {}));
25
- // Que EXPONE una tool, que no es lo mismo que que le hace al mundo. El caso que obliga a separarlo es
26
- // get_secret: lee Secrets de Kubernetes, o sea que es READ y es lo mas peligroso del catalogo. Con una
27
- // sola dimension no hay forma de denegarla sin denegar tambien 'listar namespaces'.
25
+ // What a tool EXPOSES, which is not the same as what it does to the world. The case that forces the split
26
+ // is get_secret: it reads Kubernetes Secrets, so it is READ and it is the most dangerous thing in the
27
+ // catalogue. With a single dimension there is no way to deny it without also denying 'list namespaces'.
28
28
  var EToolSensitivity;
29
29
  (function (EToolSensitivity) {
30
30
  EToolSensitivity["PUBLIC"] = "public";
31
31
  EToolSensitivity["INTERNAL"] = "internal";
32
- EToolSensitivity["SECRET"] = "secret"; // credenciales y material sensible
32
+ EToolSensitivity["SECRET"] = "secret"; // credentials and sensitive material
33
33
  })(EToolSensitivity || (exports.EToolSensitivity = EToolSensitivity = {}));
34
- // Lo que un toolset necesita del host para funcionar. El host provisiona SOLO lo declarado, que es lo que
35
- // evita el cajon de sastre de hoy (siete campos que recibe todo el mundo por si acaso, con 'sourceRepos'
36
- // existiendo para una sola de las 43 tools).
34
+ // What a toolset needs from the host in order to work. The host provisions ONLY what was declared, which
35
+ // is what avoids today's catch-all (seven fields everyone receives just in case, with 'sourceRepos'
36
+ // existing for one single tool out of the 43).
37
37
  var ECapability;
38
38
  (function (ECapability) {
39
39
  ECapability["K8S"] = "k8s";
40
40
  ECapability["METRICS"] = "metrics";
41
41
  ECapability["EVENTS"] = "events";
42
- ECapability["REPOS"] = "repos"; // credenciales de repositorios fuente
42
+ ECapability["REPOS"] = "repos"; // source repository credentials
43
43
  })(ECapability || (exports.ECapability = ECapability = {}));
44
- /** Separador de una referencia cualificada a una tool: '<toolset>/<tool>'. */
44
+ /** Separator of a qualified reference to a tool: '<toolset>/<tool>'. */
45
45
  exports.TOOL_REF_SEPARATOR = '/';
46
- // ⚠️ Una tool se referencia SIEMPRE cualificada por su toolset ('k8s-inventory/list_namespaces'), nunca
47
- // por su nombre a secas. Es lo que se persiste en la configuracion de agentes y techos, asi que no puede
48
- // volverse ambiguo el dia que dos toolsets de terceros traigan los dos un 'get_pod_logs'.
46
+ // ⚠️ A tool is ALWAYS referenced qualified by its toolset ('k8s-inventory/list_namespaces'), never by its
47
+ // bare name. This is what gets persisted in agent and ceiling configuration, so it cannot turn ambiguous
48
+ // the day two third-party toolsets both bring a 'get_pod_logs'.
49
49
  const toolRef = (toolsetId, toolName) => `${toolsetId}${exports.TOOL_REF_SEPARATOR}${toolName}`;
50
50
  exports.toolRef = toolRef;
51
51
  const parseToolRef = (ref) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-ai",
3
- "version": "0.5.61",
3
+ "version": "0.5.62",
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",