@kubbisec/ai-linux-arm64 0.1.21 → 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.
Files changed (130) hide show
  1. package/bundled/clarify/clarify-gate-state.d.ts +1 -1
  2. package/bundled/clarify/clarify-gate-state.js +3 -3
  3. package/bundled/clarify/clarify-gate.d.ts +21 -14
  4. package/bundled/clarify/clarify-gate.js +118 -111
  5. package/bundled/clarify/clarify-select-panel.d.ts +16 -9
  6. package/bundled/clarify/clarify-select-panel.js +65 -67
  7. package/bundled/clarify/clarify-ui-state.d.ts +12 -10
  8. package/bundled/clarify/clarify-ui-state.js +26 -26
  9. package/bundled/clarify/parse-clarify-answer.d.ts +29 -18
  10. package/bundled/clarify/parse-clarify-answer.js +39 -45
  11. package/bundled/clarify/question-format.d.ts +34 -23
  12. package/bundled/clarify/question-format.js +112 -119
  13. package/bundled/clarify/questionnaire-tool.d.ts +28 -17
  14. package/bundled/clarify/questionnaire-tool.js +180 -144
  15. package/bundled/clarify/scope-discovery.d.ts +8 -5
  16. package/bundled/clarify/scope-discovery.js +102 -110
  17. package/bundled/clarify/session-questionnaire.d.ts +48 -13
  18. package/bundled/clarify/session-questionnaire.js +304 -312
  19. package/bundled/clarify/session-questionnaire.types.d.ts +29 -27
  20. package/bundled/clarify/session-questionnaire.types.js +10 -10
  21. package/bundled/components/kubbisec-model-selector.d.ts +47 -34
  22. package/bundled/components/kubbisec-model-selector.js +187 -177
  23. package/bundled/config/config.d.ts +6 -6
  24. package/bundled/config/config.js +55 -55
  25. package/bundled/config/detect-local-llm-providers.d.ts +26 -16
  26. package/bundled/config/detect-local-llm-providers.js +130 -142
  27. package/bundled/config/ensure-kubbisec-project-settings.d.ts +9 -9
  28. package/bundled/config/ensure-kubbisec-project-settings.js +44 -48
  29. package/bundled/config/extended-context.d.ts +5 -6
  30. package/bundled/config/extended-context.js +23 -22
  31. package/bundled/config/feature-flags.d.ts +10 -2
  32. package/bundled/config/feature-flags.js +8 -2
  33. package/bundled/config/format-kubbisec-footer-status.d.ts +1 -1
  34. package/bundled/config/format-kubbisec-footer-status.js +26 -31
  35. package/bundled/config/kubbisec-extension-manifest.d.ts +22 -2
  36. package/bundled/config/kubbisec-extension-manifest.js +20 -20
  37. package/bundled/config/llm-config-mutations.d.ts +51 -25
  38. package/bundled/config/llm-config-mutations.js +173 -182
  39. package/bundled/config/llm-config.d.ts +54 -41
  40. package/bundled/config/llm-config.js +199 -199
  41. package/bundled/config/llm-provider-catalog.d.ts +18 -15
  42. package/bundled/config/llm-provider-catalog.js +45 -46
  43. package/bundled/config/materialize-kubbisec-pi-resources.d.ts +1 -1
  44. package/bundled/config/materialize-kubbisec-pi-resources.js +174 -183
  45. package/bundled/config/register-custom-llm-providers.d.ts +11 -5
  46. package/bundled/config/register-custom-llm-providers.js +17 -15
  47. package/bundled/config/register-kubbisec-llm-provider.d.ts +14 -10
  48. package/bundled/config/register-kubbisec-llm-provider.js +50 -42
  49. package/bundled/config/resolve-agents-context-file.d.ts +1 -1
  50. package/bundled/config/resolve-agents-context-file.js +33 -34
  51. package/bundled/config/resource-budget.d.ts +12 -12
  52. package/bundled/config/resource-budget.js +28 -28
  53. package/bundled/config/sync-kubbisec-pi-models.d.ts +6 -3
  54. package/bundled/config/sync-kubbisec-pi-models.js +58 -58
  55. package/bundled/copy/cli-reference-index.d.ts +3 -2
  56. package/bundled/copy/cli-reference-index.js +1 -1
  57. package/bundled/copy/kubbisec-shell-copy.d.ts +11 -6
  58. package/bundled/copy/kubbisec-shell-copy.js +1 -1
  59. package/bundled/extensions/cli-local-shared.d.ts +45 -26
  60. package/bundled/extensions/cli-local-shared.js +128 -118
  61. package/bundled/extensions/kubbisec-aspm-local.extension.d.ts +18 -15
  62. package/bundled/extensions/kubbisec-aspm-local.extension.js +118 -114
  63. package/bundled/extensions/kubbisec-brand.extension.d.ts +1 -1
  64. package/bundled/extensions/kubbisec-brand.extension.js +25 -25
  65. package/bundled/extensions/kubbisec-byok-provider.extension.d.ts +1 -1
  66. package/bundled/extensions/kubbisec-byok-provider.extension.js +2 -2
  67. package/bundled/extensions/kubbisec-clarify.extension.d.ts +64 -35
  68. package/bundled/extensions/kubbisec-clarify.extension.js +323 -305
  69. package/bundled/extensions/kubbisec-exit.extension.d.ts +1 -1
  70. package/bundled/extensions/kubbisec-exit.extension.js +29 -32
  71. package/bundled/extensions/kubbisec-extended-context.extension.d.ts +1 -1
  72. package/bundled/extensions/kubbisec-extended-context.extension.js +56 -43
  73. package/bundled/extensions/kubbisec-footer.extension.d.ts +14 -14
  74. package/bundled/extensions/kubbisec-footer.extension.js +205 -215
  75. package/bundled/extensions/kubbisec-github-local.extension.d.ts +26 -18
  76. package/bundled/extensions/kubbisec-github-local.extension.js +123 -116
  77. package/bundled/extensions/kubbisec-llm-config.extension.d.ts +1 -1
  78. package/bundled/extensions/kubbisec-llm-config.extension.js +200 -181
  79. package/bundled/extensions/kubbisec-memory.extension.d.ts +9 -7
  80. package/bundled/extensions/kubbisec-memory.extension.js +88 -95
  81. package/bundled/extensions/kubbisec-naus-local.extension.d.ts +18 -15
  82. package/bundled/extensions/kubbisec-naus-local.extension.js +132 -111
  83. package/bundled/extensions/kubbisec-platform-tools.extension.d.ts +31 -21
  84. package/bundled/extensions/kubbisec-platform-tools.extension.js +152 -152
  85. package/bundled/extensions/kubbisec-runtime-status.extension.d.ts +10 -8
  86. package/bundled/extensions/kubbisec-runtime-status.extension.js +15 -13
  87. package/bundled/extensions/kubbisec-scope.extension.d.ts +12 -7
  88. package/bundled/extensions/kubbisec-scope.extension.js +13 -13
  89. package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts +27 -16
  90. package/bundled/extensions/kubbisec-skill-mentions.extension.js +73 -63
  91. package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts +2 -3
  92. package/bundled/extensions/kubbisec-skill-telemetry.extension.js +59 -64
  93. package/bundled/extensions/kubbisec-theme-lock.extension.d.ts +1 -1
  94. package/bundled/extensions/kubbisec-theme-lock.extension.js +33 -34
  95. package/bundled/extensions/kubbisec-ui.extension.d.ts +1 -1
  96. package/bundled/extensions/kubbisec-ui.extension.js +114 -109
  97. package/bundled/extensions/kubbisec-workflow.extension.d.ts +20 -18
  98. package/bundled/extensions/kubbisec-workflow.extension.js +138 -140
  99. package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts +2 -0
  100. package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts.map +1 -0
  101. package/bundled/node_modules/@aspm/shared/dist/redaction.test.js +626 -0
  102. package/bundled/node_modules/@aspm/shared/dist/redaction.test.js.map +1 -0
  103. package/bundled/resolve-bundled-dist-root.js +122 -131
  104. package/bundled/skills/at-path-mentions.d.ts +1 -1
  105. package/bundled/skills/at-path-mentions.js +146 -153
  106. package/bundled/skills/chat-mention-render.d.ts +2 -2
  107. package/bundled/skills/chat-mention-render.js +121 -126
  108. package/bundled/skills/chat-mentions.d.ts +17 -8
  109. package/bundled/skills/chat-mentions.js +76 -76
  110. package/bundled/skills/list-bundled-skills.d.ts +3 -3
  111. package/bundled/skills/list-bundled-skills.js +33 -35
  112. package/bundled/skills/skill-mention.d.ts +10 -2
  113. package/bundled/skills/skill-mention.js +10 -2
  114. package/bundled/theme/clear-terminal.d.ts +1 -1
  115. package/bundled/theme/clear-terminal.js +3 -4
  116. package/bundled/theme/footer-render-hook.d.ts +1 -1
  117. package/bundled/theme/footer-render-hook.js +3 -3
  118. package/bundled/theme/kubbisec-brand-fg.d.ts +1 -1
  119. package/bundled/theme/kubbisec-brand-fg.js +2 -2
  120. package/bundled/theme/kubbisec-menu-themes.d.ts +7 -7
  121. package/bundled/theme/kubbisec-menu-themes.js +30 -31
  122. package/bundled/theme/kubbisec-theme-name.d.ts +1 -1
  123. package/bundled/theme/kubbisec-theme-name.js +1 -1
  124. package/bundled/theme/patch-pi-settings-theme.runtime.d.ts +1 -1
  125. package/bundled/theme/patch-pi-settings-theme.runtime.js +11 -10
  126. package/bundled/theme/render-compact-header.d.ts +13 -5
  127. package/bundled/theme/render-compact-header.js +127 -129
  128. package/bundled/workflow/session-workflow-mode.d.ts +1 -1
  129. package/bundled/workflow/session-workflow-mode.js +33 -33
  130. package/package.json +1 -1
@@ -1,47 +1,46 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { isAbsolute, relative, resolve, sep } from "node:path";
4
+
4
5
  const CONTEXT_FILENAMES = ["AGENTS.md", "CLAUDE.md"];
5
6
  export function findAgentsContextFile(startDir) {
6
- let dir = path.resolve(startDir);
7
- while (true) {
8
- for (const name of CONTEXT_FILENAMES) {
9
- const candidate = path.join(dir, name);
10
- if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {
11
- return candidate;
12
- }
13
- }
14
- const parent = path.dirname(dir);
15
- if (parent === dir)
16
- return undefined;
17
- dir = parent;
7
+ let dir = path.resolve(startDir);
8
+ while (true) {
9
+ for (const name of CONTEXT_FILENAMES) {
10
+ const candidate = path.join(dir, name);
11
+ if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {
12
+ return candidate;
13
+ }
18
14
  }
15
+ const parent = path.dirname(dir);
16
+ if (parent === dir) return undefined;
17
+ dir = parent;
18
+ }
19
19
  }
20
20
  export function formatAgentsContextLabel(filePath, home) {
21
- const base = path.basename(filePath);
22
- const homeDir = home?.trim();
23
- if (!homeDir)
24
- return base;
25
- const resolved = resolve(filePath);
26
- const resolvedHome = resolve(homeDir);
27
- const rel = relative(resolvedHome, resolved);
28
- const insideHome = rel === "" || (rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));
29
- if (!insideHome) {
30
- return `${base} (${truncatePathMiddle(resolved, 48)})`;
31
- }
32
- const short = rel === "" ? `~/${base}` : `~${sep}${rel}`;
33
- return truncatePathMiddle(short, 56);
21
+ const base = path.basename(filePath);
22
+ const homeDir = home?.trim();
23
+ if (!homeDir) return base;
24
+ const resolved = resolve(filePath);
25
+ const resolvedHome = resolve(homeDir);
26
+ const rel = relative(resolvedHome, resolved);
27
+ const insideHome =
28
+ rel === "" || (rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));
29
+ if (!insideHome) {
30
+ return `${base} (${truncatePathMiddle(resolved, 48)})`;
31
+ }
32
+ const short = rel === "" ? `~/${base}` : `~${sep}${rel}`;
33
+ return truncatePathMiddle(short, 56);
34
34
  }
35
35
  function truncatePathMiddle(text, maxLen) {
36
- if (text.length <= maxLen)
37
- return text;
38
- const ellipsis = "…";
39
- const room = Math.max(4, maxLen - ellipsis.length);
40
- const head = Math.max(2, Math.ceil(room * 0.45));
41
- const tail = Math.max(2, room - head);
42
- return text.slice(0, head) + ellipsis + text.slice(-tail);
36
+ if (text.length <= maxLen) return text;
37
+ const ellipsis = "…";
38
+ const room = Math.max(4, maxLen - ellipsis.length);
39
+ const head = Math.max(2, Math.ceil(room * 0.45));
40
+ const tail = Math.max(2, room - head);
41
+ return text.slice(0, head) + ellipsis + text.slice(-tail);
43
42
  }
44
43
  export function formatKubbisecContextStatus(filePath, home) {
45
- return `ctx ${formatAgentsContextLabel(filePath, home)}`;
44
+ return `ctx ${formatAgentsContextLabel(filePath, home)}`;
46
45
  }
47
- //# sourceMappingURL=resolve-agents-context-file.js.map
46
+ //# sourceMappingURL=resolve-agents-context-file.js.map
@@ -1,17 +1,17 @@
1
1
  export type ResourceBudget = {
2
- lowResource: boolean;
3
- maxActiveSkills: number;
4
- maxSkillsArgv: number;
5
- routerTopK: number;
6
- gateSampleSize: number;
7
- orchestratorParallel: number;
8
- onlineTrainerConcurrency: number;
9
- telemetryMaxStepsPerFlush: number;
10
- mem0AutoCapture: boolean;
11
- clarifyMaxRounds: number;
12
- editBudgetMaxOps: number;
2
+ lowResource: boolean;
3
+ maxActiveSkills: number;
4
+ maxSkillsArgv: number;
5
+ routerTopK: number;
6
+ gateSampleSize: number;
7
+ orchestratorParallel: number;
8
+ onlineTrainerConcurrency: number;
9
+ telemetryMaxStepsPerFlush: number;
10
+ mem0AutoCapture: boolean;
11
+ clarifyMaxRounds: number;
12
+ editBudgetMaxOps: number;
13
13
  };
14
14
  export declare const LOW_RESOURCE_DEFAULTS: Omit<ResourceBudget, "lowResource">;
15
15
  export declare const NORMAL_RESOURCE_DEFAULTS: Omit<ResourceBudget, "lowResource">;
16
16
  export declare function resolveResourceBudget(env?: NodeJS.ProcessEnv): ResourceBudget;
17
- //# sourceMappingURL=resource-budget.d.ts.map
17
+ //# sourceMappingURL=resource-budget.d.ts.map
@@ -1,35 +1,35 @@
1
1
  import { envFlagOn, isMemoryEnabled } from "./feature-flags.js";
2
2
  export const LOW_RESOURCE_DEFAULTS = {
3
- maxActiveSkills: 2,
4
- maxSkillsArgv: 2,
5
- routerTopK: 2,
6
- gateSampleSize: 2,
7
- orchestratorParallel: 1,
8
- onlineTrainerConcurrency: 1,
9
- telemetryMaxStepsPerFlush: 20,
10
- mem0AutoCapture: false,
11
- clarifyMaxRounds: 1,
12
- editBudgetMaxOps: 6,
3
+ maxActiveSkills: 2,
4
+ maxSkillsArgv: 2,
5
+ routerTopK: 2,
6
+ gateSampleSize: 2,
7
+ orchestratorParallel: 1,
8
+ onlineTrainerConcurrency: 1,
9
+ telemetryMaxStepsPerFlush: 20,
10
+ mem0AutoCapture: false,
11
+ clarifyMaxRounds: 1,
12
+ editBudgetMaxOps: 6,
13
13
  };
14
14
  export const NORMAL_RESOURCE_DEFAULTS = {
15
- maxActiveSkills: 3,
16
- maxSkillsArgv: 3,
17
- routerTopK: 3,
18
- gateSampleSize: 8,
19
- orchestratorParallel: 3,
20
- onlineTrainerConcurrency: 2,
21
- telemetryMaxStepsPerFlush: 50,
22
- mem0AutoCapture: true,
23
- clarifyMaxRounds: 2,
24
- editBudgetMaxOps: 12,
15
+ maxActiveSkills: 3,
16
+ maxSkillsArgv: 3,
17
+ routerTopK: 3,
18
+ gateSampleSize: 8,
19
+ orchestratorParallel: 3,
20
+ onlineTrainerConcurrency: 2,
21
+ telemetryMaxStepsPerFlush: 50,
22
+ mem0AutoCapture: true,
23
+ clarifyMaxRounds: 2,
24
+ editBudgetMaxOps: 12,
25
25
  };
26
26
  export function resolveResourceBudget(env = process.env) {
27
- const lowResource = envFlagOn(env, "KUBBISEC_LOW_RESOURCE");
28
- const defaults = lowResource ? LOW_RESOURCE_DEFAULTS : NORMAL_RESOURCE_DEFAULTS;
29
- return {
30
- lowResource,
31
- ...defaults,
32
- mem0AutoCapture: lowResource ? false : isMemoryEnabled(env),
33
- };
27
+ const lowResource = envFlagOn(env, "KUBBISEC_LOW_RESOURCE");
28
+ const defaults = lowResource ? LOW_RESOURCE_DEFAULTS : NORMAL_RESOURCE_DEFAULTS;
29
+ return {
30
+ lowResource,
31
+ ...defaults,
32
+ mem0AutoCapture: lowResource ? false : isMemoryEnabled(env),
33
+ };
34
34
  }
35
- //# sourceMappingURL=resource-budget.js.map
35
+ //# sourceMappingURL=resource-budget.js.map
@@ -6,7 +6,10 @@ export declare function resolvePiAgentModelsJsonPath(): string;
6
6
  * Materialize KubbiSec (and custom BYOK/local) providers into `~/.kubbisec/agent/models.json`
7
7
  * so chat bootstrap can use `defaultProvider` from `.kubbisec/llm.json`.
8
8
  */
9
- export declare function syncKubbisecProvidersToPiModelsJson(cwd?: string, options?: {
9
+ export declare function syncKubbisecProvidersToPiModelsJson(
10
+ cwd?: string,
11
+ options?: {
10
12
  modelsJsonPath?: string;
11
- }): boolean;
12
- //# sourceMappingURL=sync-kubbisec-pi-models.d.ts.map
13
+ },
14
+ ): boolean;
15
+ //# sourceMappingURL=sync-kubbisec-pi-models.d.ts.map
@@ -3,51 +3,51 @@ import * as os from "node:os";
3
3
  import * as path from "node:path";
4
4
  import { readLlmConfig, resolveApiKeyValue } from "./llm-config.js";
5
5
  import { KUBBISEC_LLM_PROVIDER_ID, toProviderModelConfig } from "./llm-provider-catalog.js";
6
- import { buildKubbisecLlmProviderConfig, } from "./register-kubbisec-llm-provider.js";
6
+ import { buildKubbisecLlmProviderConfig } from "./register-kubbisec-llm-provider.js";
7
7
  /** Matches Pi `getAgentDir()` when runtime is branded (`piConfig.configDir: ".kubbisec"`). */
8
8
  export const KUBBISEC_PI_AGENT_CONFIG_DIR = ".kubbisec";
9
9
  function expandTildePath(filePath) {
10
- if (filePath === "~")
11
- return os.homedir();
12
- if (filePath.startsWith("~/"))
13
- return path.join(os.homedir(), filePath.slice(2));
14
- return filePath;
10
+ if (filePath === "~") return os.homedir();
11
+ if (filePath.startsWith("~/")) return path.join(os.homedir(), filePath.slice(2));
12
+ return filePath;
15
13
  }
16
14
  export function resolvePiAgentModelsJsonPath() {
17
- const envDir = process.env.KUBBISEC_CODING_AGENT_DIR?.trim();
18
- if (envDir) {
19
- return path.join(expandTildePath(envDir), "models.json");
20
- }
21
- return path.join(os.homedir(), KUBBISEC_PI_AGENT_CONFIG_DIR, "agent", "models.json");
15
+ const envDir = process.env.KUBBISEC_CODING_AGENT_DIR?.trim();
16
+ if (envDir) {
17
+ return path.join(expandTildePath(envDir), "models.json");
18
+ }
19
+ return path.join(os.homedir(), KUBBISEC_PI_AGENT_CONFIG_DIR, "agent", "models.json");
22
20
  }
23
21
  function readPiModelsJson(filePath) {
24
- try {
25
- const parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
26
- if (parsed &&
27
- typeof parsed === "object" &&
28
- !Array.isArray(parsed) &&
29
- typeof parsed.providers === "object" &&
30
- parsed.providers !== null) {
31
- return parsed;
32
- }
33
- }
34
- catch {
35
- /* missing or invalid */
22
+ try {
23
+ const parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
24
+ if (
25
+ parsed &&
26
+ typeof parsed === "object" &&
27
+ !Array.isArray(parsed) &&
28
+ typeof parsed.providers === "object" &&
29
+ parsed.providers !== null
30
+ ) {
31
+ return parsed;
36
32
  }
37
- return { providers: {} };
33
+ } catch {
34
+ /* missing or invalid */
35
+ }
36
+ return { providers: {} };
38
37
  }
39
38
  function buildCustomProviderPiEntry(provider) {
40
- const apiKey = resolveApiKeyValue(provider.apiKey) ?? (provider.autodetected ? provider.apiKey : undefined);
41
- return {
42
- name: provider.name?.trim() || provider.id,
43
- baseUrl: provider.baseUrl,
44
- ...(apiKey ? { apiKey } : {}),
45
- api: provider.api ?? "openai-completions",
46
- ...(provider.headers && Object.keys(provider.headers).length > 0
47
- ? { headers: provider.headers }
48
- : {}),
49
- models: provider.models.map(toProviderModelConfig),
50
- };
39
+ const apiKey =
40
+ resolveApiKeyValue(provider.apiKey) ?? (provider.autodetected ? provider.apiKey : undefined);
41
+ return {
42
+ name: provider.name?.trim() || provider.id,
43
+ baseUrl: provider.baseUrl,
44
+ ...(apiKey ? { apiKey } : {}),
45
+ api: provider.api ?? "openai-completions",
46
+ ...(provider.headers && Object.keys(provider.headers).length > 0
47
+ ? { headers: provider.headers }
48
+ : {}),
49
+ models: provider.models.map(toProviderModelConfig),
50
+ };
51
51
  }
52
52
  /**
53
53
  * Pi resolves `--provider` from models.json before extensions load.
@@ -55,27 +55,27 @@ function buildCustomProviderPiEntry(provider) {
55
55
  * so chat bootstrap can use `defaultProvider` from `.kubbisec/llm.json`.
56
56
  */
57
57
  export function syncKubbisecProvidersToPiModelsJson(cwd = process.cwd(), options) {
58
- const kubbisec = buildKubbisecLlmProviderConfig(cwd);
59
- const customProviders = readLlmConfig(cwd).providers ?? [];
60
- if (!kubbisec && customProviders.length === 0) {
61
- return false;
62
- }
63
- const filePath = options?.modelsJsonPath ?? resolvePiAgentModelsJsonPath();
64
- fs.mkdirSync(path.dirname(filePath), { recursive: true, mode: 0o755 });
65
- const existing = readPiModelsJson(filePath);
66
- const providers = {
67
- ...existing.providers,
68
- };
69
- if (kubbisec) {
70
- providers[KUBBISEC_LLM_PROVIDER_ID] = kubbisec;
71
- }
72
- for (const provider of customProviders) {
73
- providers[provider.id] = buildCustomProviderPiEntry(provider);
74
- }
75
- fs.writeFileSync(filePath, `${JSON.stringify({ providers }, null, 2)}\n`, {
76
- encoding: "utf8",
77
- mode: 0o600,
78
- });
79
- return Boolean(kubbisec);
58
+ const kubbisec = buildKubbisecLlmProviderConfig(cwd);
59
+ const customProviders = readLlmConfig(cwd).providers ?? [];
60
+ if (!kubbisec && customProviders.length === 0) {
61
+ return false;
62
+ }
63
+ const filePath = options?.modelsJsonPath ?? resolvePiAgentModelsJsonPath();
64
+ fs.mkdirSync(path.dirname(filePath), { recursive: true, mode: 0o755 });
65
+ const existing = readPiModelsJson(filePath);
66
+ const providers = {
67
+ ...existing.providers,
68
+ };
69
+ if (kubbisec) {
70
+ providers[KUBBISEC_LLM_PROVIDER_ID] = kubbisec;
71
+ }
72
+ for (const provider of customProviders) {
73
+ providers[provider.id] = buildCustomProviderPiEntry(provider);
74
+ }
75
+ fs.writeFileSync(filePath, `${JSON.stringify({ providers }, null, 2)}\n`, {
76
+ encoding: "utf8",
77
+ mode: 0o600,
78
+ });
79
+ return Boolean(kubbisec);
80
80
  }
81
- //# sourceMappingURL=sync-kubbisec-pi-models.js.map
81
+ //# sourceMappingURL=sync-kubbisec-pi-models.js.map
@@ -2,5 +2,6 @@
2
2
  * Compact CLI index preloaded into kubbisec chat system prompt.
3
3
  * Keep in sync with apps/web/.../aspm-commands.md, naus-commands.md, and ai-commands.md.
4
4
  */
5
- export declare const KUBBISEC_CLI_REFERENCE_INDEX = "<cli-reference-index>\nASPM CLI (npm install -g @kubbisec/aspm):\n| Command | Purpose |\n| aspm init | Interactive setup |\n| aspm login | Configure credentials |\n| aspm whoami | Show current config |\n| aspm doctor | Diagnose configuration |\n| aspm scan <file> -s <source> | Local parse only (no API upload) |\n| aspm parse <file> -s <source> | Local dry-run parse |\n| aspm upload <file> -s <source> | Upload security report to API |\n| aspm coverage <file> | Upload coverage (lcov) |\n| aspm parse-coverage <file> | Local coverage parse |\n| aspm gate | Evaluate local reports against inline rules |\n| aspm projects | List org projects |\n| aspm dashboard | Terminal security posture summary |\nGlobal flags: -k/--api-key, -o/--org (org slug, e.g. minha-empresa), -p/--project\nAPI key: Perfil \u2192 API Keys (/profile/api-keys), prefix aspm_\nEnv: KUBBISEC_API_KEY, KUBBISEC_ORG_ID (slug), KUBBISEC_PROJECT (aliases ASPM_API_URL, ASPM_API_KEY, ASPM_ORG_ID)\nScanners (-s): trivy, gitleaks, syft, osv, semgrep, sonar, nmap, skipfish\nReport files: trivy-report.json, gitleaks-report.json, sbom.json, osv-report.json, semgrep-report.json, sonar-report.json, nmap-report.xml, skipfish-report.json\nPer-scanner install (Linux/macOS/Windows): kubbisec://aspm/aspm-scanner-{name} (e.g. aspm-scanner-trivy, aspm-scanner-semgrep)\nCoverage frameworks: kubbisec://aspm/aspm-coverage (Jest, Vitest, pytest, JaCoCo\u2192lcov, PHPUnit/clover, Go)\n\nNAUS CLI (npm install -g @kubbisec/naus):\n| Command | Purpose |\n| naus register [token] [--renew] | Enroll runner (mTLS bootstrap) |\n| naus start [--daemon] [--allow-privileged] | Start runner daemon |\n| naus migrate | Migrate legacy token runner to mTLS |\n| naus validate <file> / naus check <file> | Validate pipeline YAML |\n| naus plan <file> [--format mermaid] | Show dependency waves |\n| naus run <file> | Execute pipeline locally |\n| naus daemon list / naus daemon stop | Background runner sessions |\nDefault pipeline file: .naus.yml\nLocal env: naus run .naus.yml [--env-file .env] [--secret-file .secrets|.secret] (repeatable; defaults .env/.secrets in cwd).\nCloud secrets: Env Packs in KubbiSec UI (not .secrets on remote runner).\nEnv: NAUS_BOOTSTRAP_TOKEN, NAUS_RENEW_RUNNER\n\nKubbiSec AI CLI (npm install -g @kubbisec/ai):\n| Command | Purpose |\n| kubbisec login / logout / whoami | API session |\n| kubbisec doctor | Diagnose CLI setup |\n| kubbisec ls / show <id> | List/show findings |\n| kubbisec fix <id> [-m auto] | AI remediation |\n| kubbisec chat | Interactive terminal chat |\n| kubbisec do [intent] | Orchestrated agent run |\n| kubbisec watch [--logs] | Remediation queue daemon |\n| kubbisec daemon list|logs|stop | Manage watch sessions |\n| kubbisec ap | Trigger Autopilot cycle |\n| kubbisec naus \u2026 / kubbisec aspm \u2026 | CLI hub forwarding |\nAPI key: Perfil \u2192 API Keys (/profile/api-keys), prefix kbs_\nOrg: -o minha-empresa (slug)\nFull docs: kubbisec://ai/README, section ai-commands\n\nNAUS YAML (NOT GitHub Actions): top-level run: (never jobs:); script: + depends_on: (never commands:/needs:); ASPM jobs kind: aspm|aspm_matrix|aspm_gate with tool: (never scanner:).\nFull docs via tools: aspm_docs (section aspm-commands), naus_pipeline_docs (naus-commands, naus-pipeline-overview, naus-aspm-integration), kubbisec://ai/* (KubbiSec AI CLI).\naspm-cicd.md is GitHub Actions only \u2014 do not use for NAUS pipelines.\n</cli-reference-index>";
6
- //# sourceMappingURL=cli-reference-index.d.ts.map
5
+ export declare const KUBBISEC_CLI_REFERENCE_INDEX =
6
+ "<cli-reference-index>\nASPM CLI (npm install -g @kubbisec/aspm):\n| Command | Purpose |\n| aspm init | Interactive setup |\n| aspm login | Configure credentials |\n| aspm whoami | Show current config |\n| aspm doctor | Diagnose configuration |\n| aspm scan <file> -s <source> | Local parse only (no API upload) |\n| aspm parse <file> -s <source> | Local dry-run parse |\n| aspm upload <file> -s <source> | Upload security report to API |\n| aspm coverage <file> | Upload coverage (lcov) |\n| aspm parse-coverage <file> | Local coverage parse |\n| aspm gate | Evaluate local reports against inline rules |\n| aspm projects | List org projects |\n| aspm dashboard | Terminal security posture summary |\nGlobal flags: -k/--api-key, -o/--org (org slug, e.g. minha-empresa), -p/--project\nAPI key: Perfil \u2192 API Keys (/profile/api-keys), prefix aspm_\nEnv: KUBBISEC_API_KEY, KUBBISEC_ORG_ID (slug), KUBBISEC_PROJECT (aliases ASPM_API_URL, ASPM_API_KEY, ASPM_ORG_ID)\nScanners (-s): trivy, gitleaks, syft, osv, semgrep, sonar, nmap, skipfish\nReport files: trivy-report.json, gitleaks-report.json, sbom.json, osv-report.json, semgrep-report.json, sonar-report.json, nmap-report.xml, skipfish-report.json\nPer-scanner install (Linux/macOS/Windows): kubbisec://aspm/aspm-scanner-{name} (e.g. aspm-scanner-trivy, aspm-scanner-semgrep)\nCoverage frameworks: kubbisec://aspm/aspm-coverage (Jest, Vitest, pytest, JaCoCo\u2192lcov, PHPUnit/clover, Go)\n\nNAUS CLI (npm install -g @kubbisec/naus):\n| Command | Purpose |\n| naus register [token] [--renew] | Enroll runner (mTLS bootstrap) |\n| naus start [--daemon] [--allow-privileged] | Start runner daemon |\n| naus migrate | Migrate legacy token runner to mTLS |\n| naus validate <file> / naus check <file> | Validate pipeline YAML |\n| naus plan <file> [--format mermaid] | Show dependency waves |\n| naus run <file> | Execute pipeline locally |\n| naus daemon list / naus daemon stop | Background runner sessions |\nDefault pipeline file: .naus.yml\nLocal env: naus run .naus.yml [--env-file .env] [--secret-file .secrets|.secret] (repeatable; defaults .env/.secrets in cwd).\nCloud secrets: Env Packs in KubbiSec UI (not .secrets on remote runner).\nEnv: NAUS_BOOTSTRAP_TOKEN, NAUS_RENEW_RUNNER\n\nKubbiSec AI CLI (npm install -g @kubbisec/ai):\n| Command | Purpose |\n| kubbisec login / logout / whoami | API session |\n| kubbisec doctor | Diagnose CLI setup |\n| kubbisec ls / show <id> | List/show findings |\n| kubbisec fix <id> [-m auto] | AI remediation |\n| kubbisec chat | Interactive terminal chat |\n| kubbisec do [intent] | Orchestrated agent run |\n| kubbisec watch [--logs] | Remediation queue daemon |\n| kubbisec daemon list|logs|stop | Manage watch sessions |\n| kubbisec ap | Trigger Autopilot cycle |\n| kubbisec naus \u2026 / kubbisec aspm \u2026 | CLI hub forwarding |\nAPI key: Perfil \u2192 API Keys (/profile/api-keys), prefix kbs_\nOrg: -o minha-empresa (slug)\nFull docs: kubbisec://ai/README, section ai-commands\n\nNAUS YAML (NOT GitHub Actions): top-level run: (never jobs:); script: + depends_on: (never commands:/needs:); ASPM jobs kind: aspm|aspm_matrix|aspm_gate with tool: (never scanner:).\nFull docs via tools: aspm_docs (section aspm-commands), naus_pipeline_docs (naus-commands, naus-pipeline-overview, naus-aspm-integration), kubbisec://ai/* (KubbiSec AI CLI).\naspm-cicd.md is GitHub Actions only \u2014 do not use for NAUS pipelines.\n</cli-reference-index>";
7
+ //# sourceMappingURL=cli-reference-index.d.ts.map
@@ -59,4 +59,4 @@ NAUS YAML (NOT GitHub Actions): top-level run: (never jobs:); script: + depends_
59
59
  Full docs via tools: aspm_docs (section aspm-commands), naus_pipeline_docs (naus-commands, naus-pipeline-overview, naus-aspm-integration), kubbisec://ai/* (KubbiSec AI CLI).
60
60
  aspm-cicd.md is GitHub Actions only — do not use for NAUS pipelines.
61
61
  </cli-reference-index>`;
62
- //# sourceMappingURL=cli-reference-index.js.map
62
+ //# sourceMappingURL=cli-reference-index.js.map
@@ -1,21 +1,26 @@
1
1
  /** Shared KubbiSec AI TUI copy (CLI extensions). */
2
2
  export declare const KUBBISEC_PRODUCT_NAME = "KubbiSec Assistant";
3
- export declare const KUBBISEC_SUBTITLE_LINE = "Assistant \u00B7 ASPM Remediation \u00B7 Naus CI \u00B7 Coding";
4
- export declare const KUBBISEC_COMPACT_HEADER_TAGLINE = "Assistant \u00B7 ASPM Remediation \u00B7 Naus CI \u00B7 Coding";
3
+ export declare const KUBBISEC_SUBTITLE_LINE =
4
+ "Assistant \u00B7 ASPM Remediation \u00B7 Naus CI \u00B7 Coding";
5
+ export declare const KUBBISEC_COMPACT_HEADER_TAGLINE =
6
+ "Assistant \u00B7 ASPM Remediation \u00B7 Naus CI \u00B7 Coding";
5
7
  export declare const KUBBISEC_WORDMARK = "KUBBISEC";
6
8
  export declare const KUBBISEC_EDITOR_LABEL = "Coding";
7
9
  export declare const KUBBISEC_EDITOR_PLACEHOLDER = "Ask anything...";
8
10
  /** Skill invoke pattern shown in the chat header hints row. */
9
11
  export declare const KUBBISEC_HEADER_HINTS_SKILL = "@skill name";
10
12
  export declare const KUBBISEC_EXIT_SLASH_COMMAND = "/exit";
11
- export declare const KUBBISEC_HEADER_HINTS_COMMANDS = "kubbisec fix \u00B7 kubbisec watch \u00B7 kubbisec ls \u00B7 /help \u00B7 /exit";
13
+ export declare const KUBBISEC_HEADER_HINTS_COMMANDS =
14
+ "kubbisec fix \u00B7 kubbisec watch \u00B7 kubbisec ls \u00B7 /help \u00B7 /exit";
12
15
  /** @deprecated Use KUBBISEC_HEADER_HINTS_SKILL + KUBBISEC_HEADER_HINTS_COMMANDS */
13
- export declare const KUBBISEC_HEADER_HINTS = "@skill name \u00B7 kubbisec fix \u00B7 kubbisec watch \u00B7 kubbisec ls \u00B7 /help \u00B7 /exit";
16
+ export declare const KUBBISEC_HEADER_HINTS =
17
+ "@skill name \u00B7 kubbisec fix \u00B7 kubbisec watch \u00B7 kubbisec ls \u00B7 /help \u00B7 /exit";
14
18
  /** @deprecated Verbose TUI only (KUBBISEC_TUI_VERBOSE=1) */
15
19
  export declare const KUBBISEC_RAIL_HINT = "chat \u00B7 org BYOK";
16
20
  export declare const KUBBISEC_PROVIDER_LABEL = "kubbisec";
17
21
  /** @deprecated Verbose TUI only */
18
22
  export declare const KUBBISEC_RAIL_LINE = "KubbiSec Assistant \u00B7 chat \u00B7 org BYOK";
19
23
  /** @deprecated Verbose TUI only */
20
- export declare const KUBBISEC_HEADER_TAGLINE = "Assistant \u00B7 ASPM Remediation \u00B7 Naus CI \u00B7 Coding";
21
- //# sourceMappingURL=kubbisec-shell-copy.d.ts.map
24
+ export declare const KUBBISEC_HEADER_TAGLINE =
25
+ "Assistant \u00B7 ASPM Remediation \u00B7 Naus CI \u00B7 Coding";
26
+ //# sourceMappingURL=kubbisec-shell-copy.d.ts.map
@@ -18,4 +18,4 @@ export const KUBBISEC_PROVIDER_LABEL = "kubbisec";
18
18
  export const KUBBISEC_RAIL_LINE = `${KUBBISEC_PRODUCT_NAME} · ${KUBBISEC_RAIL_HINT}`;
19
19
  /** @deprecated Verbose TUI only */
20
20
  export const KUBBISEC_HEADER_TAGLINE = KUBBISEC_SUBTITLE_LINE;
21
- //# sourceMappingURL=kubbisec-shell-copy.js.map
21
+ //# sourceMappingURL=kubbisec-shell-copy.js.map
@@ -2,45 +2,64 @@ export { extendedContextEnabled } from "../config/extended-context.js";
2
2
  export declare const CLI_LOCAL_MAX_OUTPUT_CHARS = 12000;
3
3
  export declare const NAUS_LOCAL_RUN_TIMEOUT_MS: number;
4
4
  export type ExecCaptureResult = {
5
- code: number;
6
- stdout: string;
7
- stderr: string;
5
+ code: number;
6
+ stdout: string;
7
+ stderr: string;
8
8
  };
9
9
  export type CliToolDetails = {
10
- ok: boolean;
11
- exitCode: number;
12
- userMessage: string;
10
+ ok: boolean;
11
+ exitCode: number;
12
+ userMessage: string;
13
13
  };
14
14
  export declare function resolveWorkspace(): string;
15
15
  export declare function truncateCliOutput(text: string, max?: number): string;
16
16
  export declare function denyExtendedContextMessage(): {
17
- content: Array<{
18
- type: "text";
19
- text: string;
20
- }>;
17
+ content: Array<{
18
+ type: "text";
19
+ text: string;
20
+ }>;
21
21
  };
22
22
  /** Full subprocess output for model debug (extended context + debug flag). */
23
- export declare function formatExecResultForModel(bin: string, args: string[], cwd: string, result: ExecCaptureResult): string;
23
+ export declare function formatExecResultForModel(
24
+ bin: string,
25
+ args: string[],
26
+ cwd: string,
27
+ result: ExecCaptureResult,
28
+ ): string;
24
29
  /** @deprecated use formatExecResultForModel */
25
30
  export declare const formatExecResult: typeof formatExecResultForModel;
26
- export declare function formatExecResultForUser(bin: string, result: ExecCaptureResult): CliToolDetails;
27
- export declare function buildCliToolResult(bin: string, args: string[], cwd: string, result: ExecCaptureResult, suffix?: string): {
28
- content: Array<{
29
- type: "text";
30
- text: string;
31
- }>;
32
- details: CliToolDetails;
31
+ export declare function formatExecResultForUser(
32
+ bin: string,
33
+ result: ExecCaptureResult,
34
+ ): CliToolDetails;
35
+ export declare function buildCliToolResult(
36
+ bin: string,
37
+ args: string[],
38
+ cwd: string,
39
+ result: ExecCaptureResult,
40
+ suffix?: string,
41
+ ): {
42
+ content: Array<{
43
+ type: "text";
44
+ text: string;
45
+ }>;
46
+ details: CliToolDetails;
33
47
  };
34
48
  export declare function cliToolErrorContent(error: unknown): {
35
- content: Array<{
36
- type: "text";
37
- text: string;
38
- }>;
39
- details: CliToolDetails;
49
+ content: Array<{
50
+ type: "text";
51
+ text: string;
52
+ }>;
53
+ details: CliToolDetails;
40
54
  };
41
- export declare function execCapture(bin: string, args: string[], cwd: string, options?: {
55
+ export declare function execCapture(
56
+ bin: string,
57
+ args: string[],
58
+ cwd: string,
59
+ options?: {
42
60
  signal?: AbortSignal;
43
61
  timeoutMs?: number;
44
- }): Promise<ExecCaptureResult>;
62
+ },
63
+ ): Promise<ExecCaptureResult>;
45
64
  export declare function resolvePathInWorkspace(relativePath: string, workspace: string): string;
46
- //# sourceMappingURL=cli-local-shared.d.ts.map
65
+ //# sourceMappingURL=cli-local-shared.d.ts.map