@kubbisec/ai-linux-arm64 0.1.20 → 0.1.22
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/bin/kubbisec +0 -0
- package/bundled/clarify/clarify-gate-state.d.ts +1 -1
- package/bundled/clarify/clarify-gate-state.js +3 -3
- package/bundled/clarify/clarify-gate.d.ts +21 -14
- package/bundled/clarify/clarify-gate.js +118 -111
- package/bundled/clarify/clarify-select-panel.d.ts +16 -9
- package/bundled/clarify/clarify-select-panel.js +65 -67
- package/bundled/clarify/clarify-ui-state.d.ts +12 -10
- package/bundled/clarify/clarify-ui-state.js +26 -26
- package/bundled/clarify/parse-clarify-answer.d.ts +29 -18
- package/bundled/clarify/parse-clarify-answer.js +39 -45
- package/bundled/clarify/question-format.d.ts +34 -23
- package/bundled/clarify/question-format.js +112 -119
- package/bundled/clarify/questionnaire-tool.d.ts +28 -17
- package/bundled/clarify/questionnaire-tool.js +180 -144
- package/bundled/clarify/scope-discovery.d.ts +8 -5
- package/bundled/clarify/scope-discovery.js +102 -110
- package/bundled/clarify/session-questionnaire.d.ts +48 -13
- package/bundled/clarify/session-questionnaire.js +304 -312
- package/bundled/clarify/session-questionnaire.types.d.ts +29 -27
- package/bundled/clarify/session-questionnaire.types.js +10 -10
- package/bundled/components/kubbisec-model-selector.d.ts +47 -34
- package/bundled/components/kubbisec-model-selector.js +187 -177
- package/bundled/config/config.d.ts +6 -6
- package/bundled/config/config.js +55 -55
- package/bundled/config/detect-local-llm-providers.d.ts +26 -16
- package/bundled/config/detect-local-llm-providers.js +130 -142
- package/bundled/config/ensure-kubbisec-project-settings.d.ts +9 -9
- package/bundled/config/ensure-kubbisec-project-settings.js +44 -48
- package/bundled/config/extended-context.d.ts +5 -6
- package/bundled/config/extended-context.js +23 -22
- package/bundled/config/feature-flags.d.ts +10 -2
- package/bundled/config/feature-flags.js +8 -2
- package/bundled/config/format-kubbisec-footer-status.d.ts +1 -1
- package/bundled/config/format-kubbisec-footer-status.js +26 -31
- package/bundled/config/kubbisec-extension-manifest.d.ts +22 -2
- package/bundled/config/kubbisec-extension-manifest.js +20 -20
- package/bundled/config/llm-config-mutations.d.ts +51 -25
- package/bundled/config/llm-config-mutations.js +173 -182
- package/bundled/config/llm-config.d.ts +54 -41
- package/bundled/config/llm-config.js +199 -199
- package/bundled/config/llm-provider-catalog.d.ts +18 -15
- package/bundled/config/llm-provider-catalog.js +45 -46
- package/bundled/config/materialize-kubbisec-pi-resources.d.ts +1 -1
- package/bundled/config/materialize-kubbisec-pi-resources.js +174 -183
- package/bundled/config/register-custom-llm-providers.d.ts +11 -5
- package/bundled/config/register-custom-llm-providers.js +17 -15
- package/bundled/config/register-kubbisec-llm-provider.d.ts +14 -10
- package/bundled/config/register-kubbisec-llm-provider.js +50 -42
- package/bundled/config/resolve-agents-context-file.d.ts +1 -1
- package/bundled/config/resolve-agents-context-file.js +33 -34
- package/bundled/config/resource-budget.d.ts +12 -12
- package/bundled/config/resource-budget.js +28 -28
- package/bundled/config/sync-kubbisec-pi-models.d.ts +6 -3
- package/bundled/config/sync-kubbisec-pi-models.js +58 -58
- package/bundled/copy/cli-reference-index.d.ts +3 -2
- package/bundled/copy/cli-reference-index.js +1 -1
- package/bundled/copy/kubbisec-shell-copy.d.ts +11 -6
- package/bundled/copy/kubbisec-shell-copy.js +1 -1
- package/bundled/extensions/cli-local-shared.d.ts +45 -26
- package/bundled/extensions/cli-local-shared.js +128 -118
- package/bundled/extensions/kubbisec-aspm-local.extension.d.ts +18 -15
- package/bundled/extensions/kubbisec-aspm-local.extension.js +118 -114
- package/bundled/extensions/kubbisec-brand.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-brand.extension.js +25 -25
- package/bundled/extensions/kubbisec-byok-provider.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-byok-provider.extension.js +2 -2
- package/bundled/extensions/kubbisec-clarify.extension.d.ts +64 -35
- package/bundled/extensions/kubbisec-clarify.extension.js +323 -305
- package/bundled/extensions/kubbisec-exit.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-exit.extension.js +29 -32
- package/bundled/extensions/kubbisec-extended-context.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-extended-context.extension.js +56 -43
- package/bundled/extensions/kubbisec-footer.extension.d.ts +14 -14
- package/bundled/extensions/kubbisec-footer.extension.js +205 -215
- package/bundled/extensions/kubbisec-github-local.extension.d.ts +26 -18
- package/bundled/extensions/kubbisec-github-local.extension.js +123 -116
- package/bundled/extensions/kubbisec-llm-config.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-llm-config.extension.js +200 -181
- package/bundled/extensions/kubbisec-memory.extension.d.ts +9 -7
- package/bundled/extensions/kubbisec-memory.extension.js +88 -95
- package/bundled/extensions/kubbisec-naus-local.extension.d.ts +18 -15
- package/bundled/extensions/kubbisec-naus-local.extension.js +132 -111
- package/bundled/extensions/kubbisec-platform-tools.extension.d.ts +31 -21
- package/bundled/extensions/kubbisec-platform-tools.extension.js +152 -152
- package/bundled/extensions/kubbisec-runtime-status.extension.d.ts +10 -8
- package/bundled/extensions/kubbisec-runtime-status.extension.js +15 -13
- package/bundled/extensions/kubbisec-scope.extension.d.ts +12 -7
- package/bundled/extensions/kubbisec-scope.extension.js +13 -13
- package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts +27 -16
- package/bundled/extensions/kubbisec-skill-mentions.extension.js +73 -63
- package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts +2 -3
- package/bundled/extensions/kubbisec-skill-telemetry.extension.js +59 -64
- package/bundled/extensions/kubbisec-theme-lock.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-theme-lock.extension.js +33 -34
- package/bundled/extensions/kubbisec-ui.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-ui.extension.js +114 -109
- package/bundled/extensions/kubbisec-workflow.extension.d.ts +20 -18
- package/bundled/extensions/kubbisec-workflow.extension.js +138 -140
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts +2 -0
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts.map +1 -0
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.js +626 -0
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.js.map +1 -0
- package/bundled/resolve-bundled-dist-root.js +122 -131
- package/bundled/skills/at-path-mentions.d.ts +1 -1
- package/bundled/skills/at-path-mentions.js +146 -153
- package/bundled/skills/chat-mention-render.d.ts +2 -2
- package/bundled/skills/chat-mention-render.js +121 -126
- package/bundled/skills/chat-mentions.d.ts +17 -8
- package/bundled/skills/chat-mentions.js +76 -76
- package/bundled/skills/list-bundled-skills.d.ts +3 -3
- package/bundled/skills/list-bundled-skills.js +33 -35
- package/bundled/skills/skill-mention.d.ts +10 -2
- package/bundled/skills/skill-mention.js +10 -2
- package/bundled/theme/clear-terminal.d.ts +1 -1
- package/bundled/theme/clear-terminal.js +3 -4
- package/bundled/theme/footer-render-hook.d.ts +1 -1
- package/bundled/theme/footer-render-hook.js +3 -3
- package/bundled/theme/kubbisec-brand-fg.d.ts +1 -1
- package/bundled/theme/kubbisec-brand-fg.js +2 -2
- package/bundled/theme/kubbisec-menu-themes.d.ts +7 -7
- package/bundled/theme/kubbisec-menu-themes.js +30 -31
- package/bundled/theme/kubbisec-theme-name.d.ts +1 -1
- package/bundled/theme/kubbisec-theme-name.js +1 -1
- package/bundled/theme/patch-pi-settings-theme.runtime.d.ts +1 -1
- package/bundled/theme/patch-pi-settings-theme.runtime.js +11 -10
- package/bundled/theme/render-compact-header.d.ts +13 -5
- package/bundled/theme/render-compact-header.js +127 -129
- package/bundled/workflow/session-workflow-mode.d.ts +1 -1
- package/bundled/workflow/session-workflow-mode.js +33 -33
- package/package.json +1 -1
|
@@ -1,207 +1,198 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import {
|
|
2
|
+
applyLlmConfigToPiSettings,
|
|
3
|
+
readLlmConfig,
|
|
4
|
+
resolveApiKeyValue,
|
|
5
|
+
resolveLlmConfigPath,
|
|
6
|
+
writeLlmConfig,
|
|
7
|
+
} from "./llm-config.js";
|
|
8
|
+
import {
|
|
9
|
+
KUBBISEC_LLM_PROVIDER_ID,
|
|
10
|
+
KUBBISEC_LLM_PROVIDER_NAME,
|
|
11
|
+
mergeKubbisecModelCatalog,
|
|
12
|
+
} from "./llm-provider-catalog.js";
|
|
13
|
+
|
|
14
|
+
const THINKING_LEVELS = new Set(["off", "minimal", "low", "medium", "high", "xhigh"]);
|
|
11
15
|
export function isKubbisecThinkingLevel(value) {
|
|
12
|
-
|
|
16
|
+
return THINKING_LEVELS.has(value);
|
|
13
17
|
}
|
|
14
18
|
export function maskApiKeyHint(apiKey) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (raw.length <= 8)
|
|
21
|
-
return "••••";
|
|
22
|
-
return `${raw.slice(0, 4)}…${raw.slice(-4)}`;
|
|
19
|
+
const raw = apiKey?.trim();
|
|
20
|
+
if (!raw) return undefined;
|
|
21
|
+
if (/^[A-Z][A-Z0-9_]*$/.test(raw)) return `env:${raw}`;
|
|
22
|
+
if (raw.length <= 8) return "••••";
|
|
23
|
+
return `${raw.slice(0, 4)}…${raw.slice(-4)}`;
|
|
23
24
|
}
|
|
24
25
|
export function parseModelSpec(spec) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
...(reasoning ? { reasoning: true } : {}),
|
|
37
|
-
};
|
|
26
|
+
const trimmed = spec.trim();
|
|
27
|
+
if (!trimmed) throw new Error("Model spec cannot be empty");
|
|
28
|
+
const [idPart, namePart, flag] = trimmed.split(":").map((part) => part.trim());
|
|
29
|
+
const id = idPart?.trim();
|
|
30
|
+
if (!id) throw new Error(`Invalid model spec: ${spec}`);
|
|
31
|
+
const reasoning = flag === "reasoning" || flag === "true";
|
|
32
|
+
return {
|
|
33
|
+
id,
|
|
34
|
+
...(namePart ? { name: namePart } : {}),
|
|
35
|
+
...(reasoning ? { reasoning: true } : {}),
|
|
36
|
+
};
|
|
38
37
|
}
|
|
39
38
|
function findCustomProvider(config, providerId) {
|
|
40
|
-
|
|
39
|
+
return config.providers?.find((provider) => provider.id === providerId);
|
|
41
40
|
}
|
|
42
41
|
function persistLlmConfig(cwd, config) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
writeLlmConfig(cwd, config);
|
|
43
|
+
applyLlmConfigToPiSettings(cwd, config);
|
|
44
|
+
return config;
|
|
46
45
|
}
|
|
47
46
|
export function setLlmDefaults(cwd, options) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
next.temperature = Math.min(2, Math.max(0, options.temperature));
|
|
58
|
-
}
|
|
59
|
-
return persistLlmConfig(cwd, next);
|
|
47
|
+
const current = readLlmConfig(cwd);
|
|
48
|
+
const next = { ...current };
|
|
49
|
+
if (options.provider?.trim()) next.defaultProvider = options.provider.trim();
|
|
50
|
+
if (options.model?.trim()) next.defaultModel = options.model.trim();
|
|
51
|
+
if (options.thinking) next.defaultThinkingLevel = options.thinking;
|
|
52
|
+
if (options.temperature != null && Number.isFinite(options.temperature)) {
|
|
53
|
+
next.temperature = Math.min(2, Math.max(0, options.temperature));
|
|
54
|
+
}
|
|
55
|
+
return persistLlmConfig(cwd, next);
|
|
60
56
|
}
|
|
61
57
|
export function addCustomProvider(cwd, input) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
return persistLlmConfig(cwd, { ...current, providers });
|
|
58
|
+
const id = input.id.trim();
|
|
59
|
+
if (!id) throw new Error("Provider id is required");
|
|
60
|
+
if (id === KUBBISEC_LLM_PROVIDER_ID) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
`Provider "${KUBBISEC_LLM_PROVIDER_ID}" is managed by KubbiSec BYOK. Use "kubbisec llm model add --provider kubbisec".`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (!input.baseUrl.trim()) throw new Error("Provider baseUrl is required");
|
|
66
|
+
if (!input.models.length) throw new Error("At least one model is required");
|
|
67
|
+
const current = readLlmConfig(cwd);
|
|
68
|
+
const providers = [...(current.providers ?? [])];
|
|
69
|
+
const existingIndex = providers.findIndex((provider) => provider.id === id);
|
|
70
|
+
const normalized = {
|
|
71
|
+
...input,
|
|
72
|
+
id,
|
|
73
|
+
baseUrl: input.baseUrl.trim(),
|
|
74
|
+
models: input.models.map((model) => ({ ...model, id: model.id.trim() })),
|
|
75
|
+
};
|
|
76
|
+
if (existingIndex >= 0) {
|
|
77
|
+
providers[existingIndex] = { ...providers[existingIndex], ...normalized };
|
|
78
|
+
} else {
|
|
79
|
+
providers.push(normalized);
|
|
80
|
+
}
|
|
81
|
+
return persistLlmConfig(cwd, { ...current, providers });
|
|
88
82
|
}
|
|
89
83
|
export function updateCustomProvider(cwd, providerId, patch) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return persistLlmConfig(cwd, { ...current, providers });
|
|
84
|
+
const id = providerId.trim();
|
|
85
|
+
if (id === KUBBISEC_LLM_PROVIDER_ID) {
|
|
86
|
+
throw new Error(`Provider "${KUBBISEC_LLM_PROVIDER_ID}" cannot be updated via CLI.`);
|
|
87
|
+
}
|
|
88
|
+
const current = readLlmConfig(cwd);
|
|
89
|
+
const providers = [...(current.providers ?? [])];
|
|
90
|
+
const index = providers.findIndex((provider) => provider.id === id);
|
|
91
|
+
if (index < 0) throw new Error(`Provider not found: ${id}`);
|
|
92
|
+
const existing = providers[index];
|
|
93
|
+
providers[index] = {
|
|
94
|
+
...existing,
|
|
95
|
+
...(patch.name !== undefined ? { name: patch.name } : {}),
|
|
96
|
+
...(patch.baseUrl !== undefined ? { baseUrl: patch.baseUrl.trim() } : {}),
|
|
97
|
+
...(patch.apiKey !== undefined ? { apiKey: patch.apiKey } : {}),
|
|
98
|
+
...(patch.api !== undefined ? { api: patch.api } : {}),
|
|
99
|
+
...(patch.headers !== undefined ? { headers: patch.headers } : {}),
|
|
100
|
+
...(patch.models !== undefined ? { models: patch.models } : {}),
|
|
101
|
+
};
|
|
102
|
+
return persistLlmConfig(cwd, { ...current, providers });
|
|
110
103
|
}
|
|
111
104
|
export function removeCustomProvider(cwd, providerId) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
105
|
+
const id = providerId.trim();
|
|
106
|
+
if (id === KUBBISEC_LLM_PROVIDER_ID) {
|
|
107
|
+
throw new Error(`Provider "${KUBBISEC_LLM_PROVIDER_ID}" cannot be removed.`);
|
|
108
|
+
}
|
|
109
|
+
const current = readLlmConfig(cwd);
|
|
110
|
+
const providers = (current.providers ?? []).filter((provider) => provider.id !== id);
|
|
111
|
+
if (providers.length === (current.providers ?? []).length) {
|
|
112
|
+
throw new Error(`Provider not found: ${id}`);
|
|
113
|
+
}
|
|
114
|
+
const next = { ...current, providers };
|
|
115
|
+
if (current.defaultProvider === id) {
|
|
116
|
+
next.defaultProvider = KUBBISEC_LLM_PROVIDER_ID;
|
|
117
|
+
}
|
|
118
|
+
return persistLlmConfig(cwd, next);
|
|
126
119
|
}
|
|
127
120
|
export function addLlmModel(cwd, providerId, model) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const models = [...provider.models.filter((entry) => entry.id !== modelId), model];
|
|
147
|
-
return updateCustomProvider(cwd, id, { models });
|
|
121
|
+
const id = providerId.trim();
|
|
122
|
+
const modelId = model.id.trim();
|
|
123
|
+
if (!modelId) throw new Error("Model id is required");
|
|
124
|
+
const current = readLlmConfig(cwd);
|
|
125
|
+
if (id === KUBBISEC_LLM_PROVIDER_ID) {
|
|
126
|
+
const models = mergeKubbisecModelCatalog(current.defaultModel, [
|
|
127
|
+
...(current.kubbisec?.models ?? []),
|
|
128
|
+
model,
|
|
129
|
+
]);
|
|
130
|
+
return persistLlmConfig(cwd, {
|
|
131
|
+
...current,
|
|
132
|
+
kubbisec: { models },
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const provider = findCustomProvider(current, id);
|
|
136
|
+
if (!provider) throw new Error(`Provider not found: ${id}`);
|
|
137
|
+
const models = [...provider.models.filter((entry) => entry.id !== modelId), model];
|
|
138
|
+
return updateCustomProvider(cwd, id, { models });
|
|
148
139
|
}
|
|
149
140
|
export function removeLlmModel(cwd, providerId, modelId) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
return persistLlmConfig(cwd, {
|
|
159
|
-
...current,
|
|
160
|
-
kubbisec: { models },
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
const custom = findCustomProvider(current, provider);
|
|
164
|
-
if (!custom)
|
|
165
|
-
throw new Error(`Provider not found: ${provider}`);
|
|
166
|
-
const models = custom.models.filter((entry) => entry.id !== id);
|
|
167
|
-
if (models.length === custom.models.length) {
|
|
168
|
-
throw new Error(`Model not found: ${provider}/${id}`);
|
|
169
|
-
}
|
|
170
|
-
if (models.length === 0) {
|
|
171
|
-
throw new Error("Cannot remove the last model. Remove the provider instead.");
|
|
141
|
+
const provider = providerId.trim();
|
|
142
|
+
const id = modelId.trim();
|
|
143
|
+
const current = readLlmConfig(cwd);
|
|
144
|
+
if (provider === KUBBISEC_LLM_PROVIDER_ID) {
|
|
145
|
+
const models = (current.kubbisec?.models ?? []).filter((entry) => entry.id !== id);
|
|
146
|
+
if (models.length === (current.kubbisec?.models ?? []).length) {
|
|
147
|
+
throw new Error(`Model not found: ${KUBBISEC_LLM_PROVIDER_ID}/${id}`);
|
|
172
148
|
}
|
|
173
|
-
return
|
|
149
|
+
return persistLlmConfig(cwd, {
|
|
150
|
+
...current,
|
|
151
|
+
kubbisec: { models },
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
const custom = findCustomProvider(current, provider);
|
|
155
|
+
if (!custom) throw new Error(`Provider not found: ${provider}`);
|
|
156
|
+
const models = custom.models.filter((entry) => entry.id !== id);
|
|
157
|
+
if (models.length === custom.models.length) {
|
|
158
|
+
throw new Error(`Model not found: ${provider}/${id}`);
|
|
159
|
+
}
|
|
160
|
+
if (models.length === 0) {
|
|
161
|
+
throw new Error("Cannot remove the last model. Remove the provider instead.");
|
|
162
|
+
}
|
|
163
|
+
return updateCustomProvider(cwd, provider, { models });
|
|
174
164
|
}
|
|
175
165
|
export function summarizeLlmConfig(cwd = process.cwd(), config = readLlmConfig(cwd)) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
166
|
+
const kubbisecModels = mergeKubbisecModelCatalog(config.defaultModel, config.kubbisec?.models);
|
|
167
|
+
const providers = [
|
|
168
|
+
{
|
|
169
|
+
id: KUBBISEC_LLM_PROVIDER_ID,
|
|
170
|
+
name: KUBBISEC_LLM_PROVIDER_NAME,
|
|
171
|
+
apiKeyConfigured: true,
|
|
172
|
+
apiKeyHint: "org BYOK proxy",
|
|
173
|
+
models: kubbisecModels,
|
|
174
|
+
builtin: true,
|
|
175
|
+
},
|
|
176
|
+
...(config.providers ?? []).map((provider) => ({
|
|
177
|
+
id: provider.id,
|
|
178
|
+
name: provider.name?.trim() || provider.id,
|
|
179
|
+
baseUrl: provider.baseUrl,
|
|
180
|
+
api: provider.api,
|
|
181
|
+
apiKeyConfigured:
|
|
182
|
+
provider.autodetected === true || Boolean(resolveApiKeyValue(provider.apiKey)),
|
|
183
|
+
apiKeyHint: provider.autodetected ? "local server" : maskApiKeyHint(provider.apiKey),
|
|
184
|
+
models: provider.models,
|
|
185
|
+
builtin: false,
|
|
186
|
+
autodetected: provider.autodetected === true,
|
|
187
|
+
})),
|
|
188
|
+
];
|
|
189
|
+
return {
|
|
190
|
+
path: resolveLlmConfigPath(cwd),
|
|
191
|
+
defaultProvider: config.defaultProvider ?? KUBBISEC_LLM_PROVIDER_ID,
|
|
192
|
+
defaultModel: config.defaultModel,
|
|
193
|
+
defaultThinkingLevel: config.defaultThinkingLevel,
|
|
194
|
+
temperature: config.temperature,
|
|
195
|
+
providers,
|
|
196
|
+
};
|
|
206
197
|
}
|
|
207
|
-
//# sourceMappingURL=llm-config-mutations.js.map
|
|
198
|
+
//# sourceMappingURL=llm-config-mutations.js.map
|
|
@@ -1,66 +1,79 @@
|
|
|
1
1
|
export type KubbisecThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
2
2
|
export type KubbisecLlmModelDef = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
id: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
reasoning?: boolean;
|
|
6
|
+
contextWindow?: number;
|
|
7
|
+
maxTokens?: number;
|
|
8
8
|
};
|
|
9
9
|
export type KubbisecLocalLlmDetectConfig = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
/** Default true — set false to skip Ollama / LM Studio probing. */
|
|
11
|
+
autoDetect?: boolean;
|
|
12
|
+
ollama?: {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
};
|
|
16
|
+
lmstudio?: {
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
};
|
|
20
20
|
};
|
|
21
21
|
export type KubbisecCustomProviderDef = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
id: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
baseUrl: string;
|
|
25
|
+
/** Literal key or env var name (e.g. OPENROUTER_API_KEY). */
|
|
26
|
+
apiKey?: string;
|
|
27
|
+
api?: "openai-completions" | "openai-responses" | "anthropic-messages";
|
|
28
|
+
models: KubbisecLlmModelDef[];
|
|
29
|
+
headers?: Record<string, string>;
|
|
30
|
+
/** Set when discovered via local server autodetect. */
|
|
31
|
+
autodetected?: boolean;
|
|
32
|
+
detectSource?: "ollama" | "lmstudio";
|
|
33
33
|
};
|
|
34
34
|
export type KubbisecLlmConfig = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
defaultProvider?: string;
|
|
36
|
+
defaultModel?: string;
|
|
37
|
+
defaultThinkingLevel?: KubbisecThinkingLevel;
|
|
38
|
+
temperature?: number;
|
|
39
|
+
localLlm?: KubbisecLocalLlmDetectConfig;
|
|
40
|
+
kubbisec?: {
|
|
41
|
+
models?: KubbisecLlmModelDef[];
|
|
42
|
+
};
|
|
43
|
+
providers?: KubbisecCustomProviderDef[];
|
|
44
44
|
};
|
|
45
45
|
export declare function resolveLlmConfigPath(cwd?: string): string;
|
|
46
46
|
export declare function parseLlmConfig(raw: unknown): KubbisecLlmConfig;
|
|
47
47
|
export declare function readLlmConfig(cwd?: string): KubbisecLlmConfig;
|
|
48
48
|
export declare function writeLlmConfig(cwd: string, config: KubbisecLlmConfig): void;
|
|
49
|
-
export declare function ensureLlmConfigFromOrg(
|
|
49
|
+
export declare function ensureLlmConfigFromOrg(
|
|
50
|
+
cwd: string,
|
|
51
|
+
options: {
|
|
50
52
|
model?: string | null;
|
|
51
53
|
provider?: string | null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
+
},
|
|
55
|
+
): KubbisecLlmConfig;
|
|
56
|
+
export declare function applyLlmConfigToAgentSettings(
|
|
57
|
+
cwd?: string,
|
|
58
|
+
config?: KubbisecLlmConfig,
|
|
59
|
+
): void;
|
|
54
60
|
/** @deprecated Use applyLlmConfigToAgentSettings */
|
|
55
61
|
export declare const applyLlmConfigToPiSettings: typeof applyLlmConfigToAgentSettings;
|
|
56
62
|
export declare function resolveApiKeyValue(apiKey?: string): string | undefined;
|
|
57
63
|
export declare function getRuntimeTemperature(config?: KubbisecLlmConfig): number | undefined;
|
|
58
64
|
export declare function setRuntimeTemperature(value: number | undefined, cwd?: string): void;
|
|
59
|
-
export declare function applyTemperatureToProviderPayload(
|
|
65
|
+
export declare function applyTemperatureToProviderPayload(
|
|
66
|
+
payload: unknown,
|
|
67
|
+
temperature: number | undefined,
|
|
68
|
+
): unknown;
|
|
60
69
|
export declare function resolveChatModelId(cwd?: string, orgModel?: string | null): string;
|
|
61
70
|
export declare function resolveChatProviderId(cwd?: string): string;
|
|
62
71
|
export declare const FOOTER_INFERENCE_UNSET = "\u2014";
|
|
63
72
|
/** Footer model ref: `provider/id` (no provider display name or KubbiSec branding). */
|
|
64
73
|
export declare function formatModelFooterLabel(provider: string, modelId: string): string;
|
|
65
|
-
export declare function formatModelFooterWithInferenceSettings(
|
|
66
|
-
|
|
74
|
+
export declare function formatModelFooterWithInferenceSettings(
|
|
75
|
+
modelRef: string,
|
|
76
|
+
thinkingLevel?: string | null,
|
|
77
|
+
temperature?: number | null,
|
|
78
|
+
): string;
|
|
79
|
+
//# sourceMappingURL=llm-config.d.ts.map
|