@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,148 +1,158 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import * as path from "node:path";
3
- import { isCliDebugMode, summarizeSubprocessFailure, toUserError, } from "@aspm/shared/cli-user-error";
4
- import { EXTENDED_CONTEXT_DENY_MESSAGE, extendedContextEnabled, resolveExtendedWorkspace, } from "../config/extended-context.js";
3
+ import {
4
+ isCliDebugMode,
5
+ summarizeSubprocessFailure,
6
+ toUserError,
7
+ } from "@aspm/shared/cli-user-error";
8
+ import {
9
+ EXTENDED_CONTEXT_DENY_MESSAGE,
10
+ extendedContextEnabled,
11
+ resolveExtendedWorkspace,
12
+ } from "../config/extended-context.js";
13
+
5
14
  export { extendedContextEnabled } from "../config/extended-context.js";
6
15
  export const CLI_LOCAL_MAX_OUTPUT_CHARS = 12_000;
7
16
  export const NAUS_LOCAL_RUN_TIMEOUT_MS = 15 * 60 * 1000;
8
17
  export function resolveWorkspace() {
9
- return resolveExtendedWorkspace();
18
+ return resolveExtendedWorkspace();
10
19
  }
11
20
  export function truncateCliOutput(text, max = CLI_LOCAL_MAX_OUTPUT_CHARS) {
12
- if (text.length <= max)
13
- return text;
14
- return `${text.slice(0, max)}\n\n… (output truncated at ${max} chars)`;
21
+ if (text.length <= max) return text;
22
+ return `${text.slice(0, max)}\n\n… (output truncated at ${max} chars)`;
15
23
  }
16
24
  export function denyExtendedContextMessage() {
17
- return {
18
- content: [
19
- {
20
- type: "text",
21
- text: EXTENDED_CONTEXT_DENY_MESSAGE,
22
- },
23
- ],
24
- };
25
+ return {
26
+ content: [
27
+ {
28
+ type: "text",
29
+ text: EXTENDED_CONTEXT_DENY_MESSAGE,
30
+ },
31
+ ],
32
+ };
25
33
  }
26
34
  /** Full subprocess output for model debug (extended context + debug flag). */
27
35
  export function formatExecResultForModel(bin, args, cwd, result) {
28
- const combined = [result.stdout, result.stderr].filter(Boolean).join("\n");
29
- return truncateCliOutput([
30
- `command: ${bin} ${args.join(" ")}`,
31
- `cwd: ${cwd}`,
32
- `exit: ${result.code}`,
33
- "",
34
- combined.trim() || "(no output)",
35
- ].join("\n"));
36
+ const combined = [result.stdout, result.stderr].filter(Boolean).join("\n");
37
+ return truncateCliOutput(
38
+ [
39
+ `command: ${bin} ${args.join(" ")}`,
40
+ `cwd: ${cwd}`,
41
+ `exit: ${result.code}`,
42
+ "",
43
+ combined.trim() || "(no output)",
44
+ ].join("\n"),
45
+ );
36
46
  }
37
47
  /** @deprecated use formatExecResultForModel */
38
48
  export const formatExecResult = formatExecResultForModel;
39
49
  export function formatExecResultForUser(bin, result) {
40
- const ok = result.code === 0;
41
- if (ok) {
42
- const hint = result.stdout
43
- .trim()
44
- .split(/\r?\n/)
45
- .find((line) => line.trim())
46
- ?.trim();
47
- const userMessage = hint
48
- ? `${bin} concluiu: ${hint.length > 160 ? `${hint.slice(0, 157)}…` : hint}`
49
- : `${bin} concluiu com sucesso.`;
50
- return { ok: true, exitCode: result.code, userMessage };
51
- }
52
- return {
53
- ok: false,
54
- exitCode: result.code,
55
- userMessage: summarizeSubprocessFailure({
56
- bin,
57
- code: result.code,
58
- stderr: result.stderr,
59
- stdout: result.stdout,
60
- }),
61
- };
50
+ const ok = result.code === 0;
51
+ if (ok) {
52
+ const hint = result.stdout
53
+ .trim()
54
+ .split(/\r?\n/)
55
+ .find((line) => line.trim())
56
+ ?.trim();
57
+ const userMessage = hint
58
+ ? `${bin} concluiu: ${hint.length > 160 ? `${hint.slice(0, 157)}…` : hint}`
59
+ : `${bin} concluiu com sucesso.`;
60
+ return { ok: true, exitCode: result.code, userMessage };
61
+ }
62
+ return {
63
+ ok: false,
64
+ exitCode: result.code,
65
+ userMessage: summarizeSubprocessFailure({
66
+ bin,
67
+ code: result.code,
68
+ stderr: result.stderr,
69
+ stdout: result.stdout,
70
+ }),
71
+ };
62
72
  }
63
73
  export function buildCliToolResult(bin, args, cwd, result, suffix = "") {
64
- const details = formatExecResultForUser(bin, result);
65
- const useFullDump = extendedContextEnabled() && isCliDebugMode();
66
- const text = (useFullDump ? formatExecResultForModel(bin, args, cwd, result) : details.userMessage) + suffix;
67
- return {
68
- content: [{ type: "text", text }],
69
- details,
70
- };
74
+ const details = formatExecResultForUser(bin, result);
75
+ const useFullDump = extendedContextEnabled() && isCliDebugMode();
76
+ const text =
77
+ (useFullDump ? formatExecResultForModel(bin, args, cwd, result) : details.userMessage) + suffix;
78
+ return {
79
+ content: [{ type: "text", text }],
80
+ details,
81
+ };
71
82
  }
72
83
  export function cliToolErrorContent(error) {
73
- const shaped = toUserError(error, "Falha ao executar comando local");
74
- return {
75
- content: [{ type: "text", text: shaped.detail }],
76
- details: { ok: false, exitCode: 127, userMessage: shaped.detail },
77
- };
84
+ const shaped = toUserError(error, "Falha ao executar comando local");
85
+ return {
86
+ content: [{ type: "text", text: shaped.detail }],
87
+ details: { ok: false, exitCode: 127, userMessage: shaped.detail },
88
+ };
78
89
  }
79
90
  export function execCapture(bin, args, cwd, options) {
80
- return new Promise((resolve) => {
81
- const child = spawn(bin, args, {
82
- cwd,
83
- env: process.env,
84
- stdio: ["ignore", "pipe", "pipe"],
85
- });
86
- let stdout = "";
87
- let stderr = "";
88
- let timedOut = false;
89
- const timer = options?.timeoutMs != null
90
- ? setTimeout(() => {
91
- timedOut = true;
92
- child.kill("SIGTERM");
93
- }, options.timeoutMs)
94
- : undefined;
95
- const onAbort = () => {
91
+ return new Promise((resolve) => {
92
+ const child = spawn(bin, args, {
93
+ cwd,
94
+ env: process.env,
95
+ stdio: ["ignore", "pipe", "pipe"],
96
+ });
97
+ let stdout = "";
98
+ let stderr = "";
99
+ let timedOut = false;
100
+ const timer =
101
+ options?.timeoutMs != null
102
+ ? setTimeout(() => {
103
+ timedOut = true;
96
104
  child.kill("SIGTERM");
97
- };
98
- options?.signal?.addEventListener("abort", onAbort);
99
- child.stdout?.on("data", (c) => {
100
- stdout += String(c);
101
- });
102
- child.stderr?.on("data", (c) => {
103
- stderr += String(c);
104
- });
105
- child.on("error", (err) => {
106
- if (timer)
107
- clearTimeout(timer);
108
- options?.signal?.removeEventListener("abort", onAbort);
109
- resolve({
110
- code: 127,
111
- stdout: "",
112
- stderr: toUserError(err).detail,
113
- });
105
+ }, options.timeoutMs)
106
+ : undefined;
107
+ const onAbort = () => {
108
+ child.kill("SIGTERM");
109
+ };
110
+ options?.signal?.addEventListener("abort", onAbort);
111
+ child.stdout?.on("data", (c) => {
112
+ stdout += String(c);
113
+ });
114
+ child.stderr?.on("data", (c) => {
115
+ stderr += String(c);
116
+ });
117
+ child.on("error", (err) => {
118
+ if (timer) clearTimeout(timer);
119
+ options?.signal?.removeEventListener("abort", onAbort);
120
+ resolve({
121
+ code: 127,
122
+ stdout: "",
123
+ stderr: toUserError(err).detail,
124
+ });
125
+ });
126
+ child.on("close", (code) => {
127
+ if (timer) clearTimeout(timer);
128
+ options?.signal?.removeEventListener("abort", onAbort);
129
+ if (options?.signal?.aborted) {
130
+ resolve({
131
+ code: 130,
132
+ stdout,
133
+ stderr: `${stderr}\n(aborted)`.trim(),
114
134
  });
115
- child.on("close", (code) => {
116
- if (timer)
117
- clearTimeout(timer);
118
- options?.signal?.removeEventListener("abort", onAbort);
119
- if (options?.signal?.aborted) {
120
- resolve({
121
- code: 130,
122
- stdout,
123
- stderr: `${stderr}\n(aborted)`.trim(),
124
- });
125
- return;
126
- }
127
- if (timedOut) {
128
- resolve({
129
- code: 124,
130
- stdout,
131
- stderr: `${stderr}\n(timed out after ${options?.timeoutMs}ms)`.trim(),
132
- });
133
- return;
134
- }
135
- resolve({ code: code ?? 1, stdout, stderr });
135
+ return;
136
+ }
137
+ if (timedOut) {
138
+ resolve({
139
+ code: 124,
140
+ stdout,
141
+ stderr: `${stderr}\n(timed out after ${options?.timeoutMs}ms)`.trim(),
136
142
  });
143
+ return;
144
+ }
145
+ resolve({ code: code ?? 1, stdout, stderr });
137
146
  });
147
+ });
138
148
  }
139
149
  export function resolvePathInWorkspace(relativePath, workspace) {
140
- const resolved = path.resolve(workspace, relativePath);
141
- const ws = path.resolve(workspace);
142
- const relative = path.relative(ws, resolved);
143
- if (relative.startsWith("..") || path.isAbsolute(relative)) {
144
- throw new Error("path must stay inside the workspace");
145
- }
146
- return resolved;
150
+ const resolved = path.resolve(workspace, relativePath);
151
+ const ws = path.resolve(workspace);
152
+ const relative = path.relative(ws, resolved);
153
+ if (relative.startsWith("..") || path.isAbsolute(relative)) {
154
+ throw new Error("path must stay inside the workspace");
155
+ }
156
+ return resolved;
147
157
  }
148
- //# sourceMappingURL=cli-local-shared.js.map
158
+ //# sourceMappingURL=cli-local-shared.js.map
@@ -1,18 +1,21 @@
1
1
  type ExtensionApi = {
2
- registerTool: (def: {
3
- name: string;
4
- label: string;
5
- description: string;
6
- parameters: unknown;
7
- execute: (toolCallId: string, params: Record<string, unknown>, signal: AbortSignal) => Promise<{
8
- content: Array<{
9
- type: "text";
10
- text: string;
11
- }>;
12
- details?: unknown;
13
- }>;
14
- }) => void;
2
+ registerTool: (def: {
3
+ name: string;
4
+ label: string;
5
+ description: string;
6
+ parameters: unknown;
7
+ execute: (
8
+ toolCallId: string,
9
+ params: Record<string, unknown>,
10
+ signal: AbortSignal,
11
+ ) => Promise<{
12
+ content: Array<{
13
+ type: "text";
14
+ text: string;
15
+ }>;
16
+ details?: unknown;
17
+ }>;
18
+ }) => void;
15
19
  };
16
20
  export default function kubbisecAspmLocal(api: ExtensionApi): void;
17
- export {};
18
- //# sourceMappingURL=kubbisec-aspm-local.extension.d.ts.map
21
+ //# sourceMappingURL=kubbisec-aspm-local.extension.d.ts.map
@@ -2,119 +2,123 @@
2
2
  * Local `aspm` CLI tools — only when KUBBISEC_CHAT_EXTENDED_CONTEXT=1
3
3
  */
4
4
  import { Type } from "@earendil-works/pi-ai";
5
- import { buildCliToolResult, denyExtendedContextMessage, execCapture, extendedContextEnabled, resolvePathInWorkspace, resolveWorkspace, } from "./cli-local-shared.js";
6
- const ASPM_SOURCES = [
7
- "trivy",
8
- "sonar",
9
- "semgrep",
10
- "nmap",
11
- "skipfish",
12
- "osv",
13
- "gitleaks",
14
- "syft",
15
- ];
5
+ import {
6
+ buildCliToolResult,
7
+ denyExtendedContextMessage,
8
+ execCapture,
9
+ extendedContextEnabled,
10
+ resolvePathInWorkspace,
11
+ resolveWorkspace,
12
+ } from "./cli-local-shared.js";
13
+
14
+ const ASPM_SOURCES = ["trivy", "sonar", "semgrep", "nmap", "skipfish", "osv", "gitleaks", "syft"];
16
15
  export default function kubbisecAspmLocal(api) {
17
- api.registerTool({
18
- name: "aspm_local_status",
19
- label: "ASPM CLI status",
20
- description: "Checks if `aspm` is on PATH and shows version/help (requires kubbisec chat --extended-context).",
21
- parameters: Type.Object({}),
22
- async execute() {
23
- if (!extendedContextEnabled())
24
- return denyExtendedContextMessage();
25
- const cwd = resolveWorkspace();
26
- const parts = [`workspace: ${cwd}`];
27
- const which = await execCapture("which", ["aspm"], cwd);
28
- if (which.code !== 0) {
29
- return {
30
- content: [
31
- {
32
- type: "text",
33
- text: `${parts.join("\n")}\n\naspm: not installed or not on PATH (npm install -g @kubbisec/aspm)`,
34
- },
35
- ],
36
- details: { ok: false, exitCode: which.code, userMessage: "aspm não está no PATH." },
37
- };
38
- }
39
- const version = await execCapture("aspm", ["--version"], cwd);
40
- const versionResult = buildCliToolResult("aspm", ["--version"], cwd, version);
41
- return {
42
- content: [
43
- { type: "text", text: `${parts.join("\n")}\n\n${versionResult.content[0]?.text ?? ""}` },
44
- ],
45
- details: versionResult.details,
46
- };
47
- },
48
- });
49
- api.registerTool({
50
- name: "aspm_local_doctor",
51
- label: "ASPM doctor",
52
- description: "Runs `aspm doctor` (config, API, git, optional scanner binaries).",
53
- parameters: Type.Object({}),
54
- async execute() {
55
- if (!extendedContextEnabled())
56
- return denyExtendedContextMessage();
57
- const cwd = resolveWorkspace();
58
- const result = await execCapture("aspm", ["doctor"], cwd);
59
- return buildCliToolResult("aspm", ["doctor"], cwd, result);
60
- },
61
- });
62
- api.registerTool({
63
- name: "aspm_local_scan",
64
- label: "ASPM scan (local)",
65
- description: "Runs `aspm scan <file> -s <source>` without uploading to the platform.",
66
- parameters: Type.Object({
67
- file: Type.String({ description: "Report file path relative to workspace" }),
68
- source: Type.Union(ASPM_SOURCES.map((s) => Type.Literal(s)), { description: "Scanner source id" }),
69
- }),
70
- async execute(_id, params) {
71
- if (!extendedContextEnabled())
72
- return denyExtendedContextMessage();
73
- const cwd = resolveWorkspace();
74
- const filePath = resolvePathInWorkspace(String(params.file), cwd);
75
- const source = String(params.source);
76
- const args = ["scan", filePath, "-s", source];
77
- const result = await execCapture("aspm", args, cwd);
78
- return buildCliToolResult("aspm", args, cwd, result);
79
- },
80
- });
81
- api.registerTool({
82
- name: "aspm_local_upload",
83
- label: "ASPM upload",
84
- description: "Runs `aspm upload <file> -s <source> -p <projectId>` using local ~/.kubbisec config for API key.",
85
- parameters: Type.Object({
86
- file: Type.String({ description: "Report file path relative to workspace" }),
87
- source: Type.Union(ASPM_SOURCES.map((s) => Type.Literal(s)), { description: "Scanner source id" }),
88
- projectId: Type.String({
89
- description: "KubbiSec project id (required; also KUBBISEC_CONTEXT_PROJECT_ID if omitted)",
90
- }),
91
- }),
92
- async execute(_id, params) {
93
- if (!extendedContextEnabled())
94
- return denyExtendedContextMessage();
95
- const cwd = resolveWorkspace();
96
- const filePath = resolvePathInWorkspace(String(params.file), cwd);
97
- const source = String(params.source);
98
- const projectId = String(params.projectId).trim() || process.env.KUBBISEC_CONTEXT_PROJECT_ID?.trim() || "";
99
- if (!projectId) {
100
- return {
101
- content: [
102
- {
103
- type: "text",
104
- text: "Indique o projectId ou configure KUBBISEC_CONTEXT_PROJECT_ID (kubbisec chat -p).",
105
- },
106
- ],
107
- details: {
108
- ok: false,
109
- exitCode: 1,
110
- userMessage: "projectId em falta para upload ASPM.",
111
- },
112
- };
113
- }
114
- const args = ["upload", filePath, "-s", source, "-p", projectId];
115
- const result = await execCapture("aspm", args, cwd);
116
- return buildCliToolResult("aspm", args, cwd, result);
117
- },
118
- });
16
+ api.registerTool({
17
+ name: "aspm_local_status",
18
+ label: "ASPM CLI status",
19
+ description:
20
+ "Checks if `aspm` is on PATH and shows version/help (requires kubbisec chat --extended-context).",
21
+ parameters: Type.Object({}),
22
+ async execute() {
23
+ if (!extendedContextEnabled()) return denyExtendedContextMessage();
24
+ const cwd = resolveWorkspace();
25
+ const parts = [`workspace: ${cwd}`];
26
+ const which = await execCapture("which", ["aspm"], cwd);
27
+ if (which.code !== 0) {
28
+ return {
29
+ content: [
30
+ {
31
+ type: "text",
32
+ text: `${parts.join("\n")}\n\naspm: not installed or not on PATH (npm install -g @kubbisec/aspm)`,
33
+ },
34
+ ],
35
+ details: { ok: false, exitCode: which.code, userMessage: "aspm não está no PATH." },
36
+ };
37
+ }
38
+ const version = await execCapture("aspm", ["--version"], cwd);
39
+ const versionResult = buildCliToolResult("aspm", ["--version"], cwd, version);
40
+ return {
41
+ content: [
42
+ { type: "text", text: `${parts.join("\n")}\n\n${versionResult.content[0]?.text ?? ""}` },
43
+ ],
44
+ details: versionResult.details,
45
+ };
46
+ },
47
+ });
48
+ api.registerTool({
49
+ name: "aspm_local_doctor",
50
+ label: "ASPM doctor",
51
+ description: "Runs `aspm doctor` (config, API, git, optional scanner binaries).",
52
+ parameters: Type.Object({}),
53
+ async execute() {
54
+ if (!extendedContextEnabled()) return denyExtendedContextMessage();
55
+ const cwd = resolveWorkspace();
56
+ const result = await execCapture("aspm", ["doctor"], cwd);
57
+ return buildCliToolResult("aspm", ["doctor"], cwd, result);
58
+ },
59
+ });
60
+ api.registerTool({
61
+ name: "aspm_local_scan",
62
+ label: "ASPM scan (local)",
63
+ description: "Runs `aspm scan <file> -s <source>` without uploading to the platform.",
64
+ parameters: Type.Object({
65
+ file: Type.String({ description: "Report file path relative to workspace" }),
66
+ source: Type.Union(
67
+ ASPM_SOURCES.map((s) => Type.Literal(s)),
68
+ { description: "Scanner source id" },
69
+ ),
70
+ }),
71
+ async execute(_id, params) {
72
+ if (!extendedContextEnabled()) return denyExtendedContextMessage();
73
+ const cwd = resolveWorkspace();
74
+ const filePath = resolvePathInWorkspace(String(params.file), cwd);
75
+ const source = String(params.source);
76
+ const args = ["scan", filePath, "-s", source];
77
+ const result = await execCapture("aspm", args, cwd);
78
+ return buildCliToolResult("aspm", args, cwd, result);
79
+ },
80
+ });
81
+ api.registerTool({
82
+ name: "aspm_local_upload",
83
+ label: "ASPM upload",
84
+ description:
85
+ "Runs `aspm upload <file> -s <source> -p <projectId>` using local ~/.kubbisec config for API key.",
86
+ parameters: Type.Object({
87
+ file: Type.String({ description: "Report file path relative to workspace" }),
88
+ source: Type.Union(
89
+ ASPM_SOURCES.map((s) => Type.Literal(s)),
90
+ { description: "Scanner source id" },
91
+ ),
92
+ projectId: Type.String({
93
+ description: "KubbiSec project id (required; also KUBBISEC_CONTEXT_PROJECT_ID if omitted)",
94
+ }),
95
+ }),
96
+ async execute(_id, params) {
97
+ if (!extendedContextEnabled()) return denyExtendedContextMessage();
98
+ const cwd = resolveWorkspace();
99
+ const filePath = resolvePathInWorkspace(String(params.file), cwd);
100
+ const source = String(params.source);
101
+ const projectId =
102
+ String(params.projectId).trim() || process.env.KUBBISEC_CONTEXT_PROJECT_ID?.trim() || "";
103
+ if (!projectId) {
104
+ return {
105
+ content: [
106
+ {
107
+ type: "text",
108
+ text: "Indique o projectId ou configure KUBBISEC_CONTEXT_PROJECT_ID (kubbisec chat -p).",
109
+ },
110
+ ],
111
+ details: {
112
+ ok: false,
113
+ exitCode: 1,
114
+ userMessage: "projectId em falta para upload ASPM.",
115
+ },
116
+ };
117
+ }
118
+ const args = ["upload", filePath, "-s", source, "-p", projectId];
119
+ const result = await execCapture("aspm", args, cwd);
120
+ return buildCliToolResult("aspm", args, cwd, result);
121
+ },
122
+ });
119
123
  }
120
- //# sourceMappingURL=kubbisec-aspm-local.extension.js.map
124
+ //# sourceMappingURL=kubbisec-aspm-local.extension.js.map
@@ -1,3 +1,3 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  export default function kubbisecBrand(api: ExtensionAPI): void;
3
- //# sourceMappingURL=kubbisec-brand.extension.d.ts.map
3
+ //# sourceMappingURL=kubbisec-brand.extension.d.ts.map
@@ -1,32 +1,32 @@
1
1
  import * as path from "node:path";
2
2
  import { KUBBISEC_PRODUCT_NAME } from "../copy/kubbisec-shell-copy.js";
3
3
  import { renderChatHeaderLines } from "../theme/render-compact-header.js";
4
+
4
5
  function buildBrandHeaderComponent(theme, version) {
5
- let cachedWidth = 0;
6
- let cachedLines = renderChatHeaderLines(theme, version, 80);
7
- return {
8
- render(width) {
9
- if (width !== cachedWidth) {
10
- cachedWidth = width;
11
- cachedLines = renderChatHeaderLines(theme, version, width);
12
- }
13
- return cachedLines;
14
- },
15
- invalidate() {
16
- cachedWidth = 0;
17
- },
18
- };
6
+ let cachedWidth = 0;
7
+ let cachedLines = renderChatHeaderLines(theme, version, 80);
8
+ return {
9
+ render(width) {
10
+ if (width !== cachedWidth) {
11
+ cachedWidth = width;
12
+ cachedLines = renderChatHeaderLines(theme, version, width);
13
+ }
14
+ return cachedLines;
15
+ },
16
+ invalidate() {
17
+ cachedWidth = 0;
18
+ },
19
+ };
19
20
  }
20
21
  export default function kubbisecBrand(api) {
21
- const version = process.env.KUBBISEC_AI_VERSION?.trim() || "0.1.0";
22
- api.on("session_start", (_event, ctx) => {
23
- if (!ctx.hasUI)
24
- return;
25
- // Header sits above the chat log so messages never render above KubbiSec chrome.
26
- ctx.ui.setHeader((_tui, theme) => buildBrandHeaderComponent(theme, version));
27
- const cwd = process.cwd();
28
- const base = path.basename(cwd) || cwd;
29
- ctx.ui.setTitle(`${KUBBISEC_PRODUCT_NAME} — ${base}`);
30
- });
22
+ const version = process.env.KUBBISEC_AI_VERSION?.trim() || "0.1.0";
23
+ api.on("session_start", (_event, ctx) => {
24
+ if (!ctx.hasUI) return;
25
+ // Header sits above the chat log so messages never render above KubbiSec chrome.
26
+ ctx.ui.setHeader((_tui, theme) => buildBrandHeaderComponent(theme, version));
27
+ const cwd = process.cwd();
28
+ const base = path.basename(cwd) || cwd;
29
+ ctx.ui.setTitle(`${KUBBISEC_PRODUCT_NAME} ${base}`);
30
+ });
31
31
  }
32
- //# sourceMappingURL=kubbisec-brand.extension.js.map
32
+ //# sourceMappingURL=kubbisec-brand.extension.js.map
@@ -3,4 +3,4 @@
3
3
  */
4
4
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
5
5
  export default function kubbisecByokProvider(api: ExtensionAPI): void;
6
- //# sourceMappingURL=kubbisec-byok-provider.extension.d.ts.map
6
+ //# sourceMappingURL=kubbisec-byok-provider.extension.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { registerKubbisecLlmProvider } from "../config/register-kubbisec-llm-provider.js";
2
2
  export default function kubbisecByokProvider(api) {
3
- registerKubbisecLlmProvider(api.registerProvider.bind(api));
3
+ registerKubbisecLlmProvider(api.registerProvider.bind(api));
4
4
  }
5
- //# sourceMappingURL=kubbisec-byok-provider.extension.js.map
5
+ //# sourceMappingURL=kubbisec-byok-provider.extension.js.map