@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.
Files changed (131) hide show
  1. package/bin/kubbisec +0 -0
  2. package/bundled/clarify/clarify-gate-state.d.ts +1 -1
  3. package/bundled/clarify/clarify-gate-state.js +3 -3
  4. package/bundled/clarify/clarify-gate.d.ts +21 -14
  5. package/bundled/clarify/clarify-gate.js +118 -111
  6. package/bundled/clarify/clarify-select-panel.d.ts +16 -9
  7. package/bundled/clarify/clarify-select-panel.js +65 -67
  8. package/bundled/clarify/clarify-ui-state.d.ts +12 -10
  9. package/bundled/clarify/clarify-ui-state.js +26 -26
  10. package/bundled/clarify/parse-clarify-answer.d.ts +29 -18
  11. package/bundled/clarify/parse-clarify-answer.js +39 -45
  12. package/bundled/clarify/question-format.d.ts +34 -23
  13. package/bundled/clarify/question-format.js +112 -119
  14. package/bundled/clarify/questionnaire-tool.d.ts +28 -17
  15. package/bundled/clarify/questionnaire-tool.js +180 -144
  16. package/bundled/clarify/scope-discovery.d.ts +8 -5
  17. package/bundled/clarify/scope-discovery.js +102 -110
  18. package/bundled/clarify/session-questionnaire.d.ts +48 -13
  19. package/bundled/clarify/session-questionnaire.js +304 -312
  20. package/bundled/clarify/session-questionnaire.types.d.ts +29 -27
  21. package/bundled/clarify/session-questionnaire.types.js +10 -10
  22. package/bundled/components/kubbisec-model-selector.d.ts +47 -34
  23. package/bundled/components/kubbisec-model-selector.js +187 -177
  24. package/bundled/config/config.d.ts +6 -6
  25. package/bundled/config/config.js +55 -55
  26. package/bundled/config/detect-local-llm-providers.d.ts +26 -16
  27. package/bundled/config/detect-local-llm-providers.js +130 -142
  28. package/bundled/config/ensure-kubbisec-project-settings.d.ts +9 -9
  29. package/bundled/config/ensure-kubbisec-project-settings.js +44 -48
  30. package/bundled/config/extended-context.d.ts +5 -6
  31. package/bundled/config/extended-context.js +23 -22
  32. package/bundled/config/feature-flags.d.ts +10 -2
  33. package/bundled/config/feature-flags.js +8 -2
  34. package/bundled/config/format-kubbisec-footer-status.d.ts +1 -1
  35. package/bundled/config/format-kubbisec-footer-status.js +26 -31
  36. package/bundled/config/kubbisec-extension-manifest.d.ts +22 -2
  37. package/bundled/config/kubbisec-extension-manifest.js +20 -20
  38. package/bundled/config/llm-config-mutations.d.ts +51 -25
  39. package/bundled/config/llm-config-mutations.js +173 -182
  40. package/bundled/config/llm-config.d.ts +54 -41
  41. package/bundled/config/llm-config.js +199 -199
  42. package/bundled/config/llm-provider-catalog.d.ts +18 -15
  43. package/bundled/config/llm-provider-catalog.js +45 -46
  44. package/bundled/config/materialize-kubbisec-pi-resources.d.ts +1 -1
  45. package/bundled/config/materialize-kubbisec-pi-resources.js +174 -183
  46. package/bundled/config/register-custom-llm-providers.d.ts +11 -5
  47. package/bundled/config/register-custom-llm-providers.js +17 -15
  48. package/bundled/config/register-kubbisec-llm-provider.d.ts +14 -10
  49. package/bundled/config/register-kubbisec-llm-provider.js +50 -42
  50. package/bundled/config/resolve-agents-context-file.d.ts +1 -1
  51. package/bundled/config/resolve-agents-context-file.js +33 -34
  52. package/bundled/config/resource-budget.d.ts +12 -12
  53. package/bundled/config/resource-budget.js +28 -28
  54. package/bundled/config/sync-kubbisec-pi-models.d.ts +6 -3
  55. package/bundled/config/sync-kubbisec-pi-models.js +58 -58
  56. package/bundled/copy/cli-reference-index.d.ts +3 -2
  57. package/bundled/copy/cli-reference-index.js +1 -1
  58. package/bundled/copy/kubbisec-shell-copy.d.ts +11 -6
  59. package/bundled/copy/kubbisec-shell-copy.js +1 -1
  60. package/bundled/extensions/cli-local-shared.d.ts +45 -26
  61. package/bundled/extensions/cli-local-shared.js +128 -118
  62. package/bundled/extensions/kubbisec-aspm-local.extension.d.ts +18 -15
  63. package/bundled/extensions/kubbisec-aspm-local.extension.js +118 -114
  64. package/bundled/extensions/kubbisec-brand.extension.d.ts +1 -1
  65. package/bundled/extensions/kubbisec-brand.extension.js +25 -25
  66. package/bundled/extensions/kubbisec-byok-provider.extension.d.ts +1 -1
  67. package/bundled/extensions/kubbisec-byok-provider.extension.js +2 -2
  68. package/bundled/extensions/kubbisec-clarify.extension.d.ts +64 -35
  69. package/bundled/extensions/kubbisec-clarify.extension.js +323 -305
  70. package/bundled/extensions/kubbisec-exit.extension.d.ts +1 -1
  71. package/bundled/extensions/kubbisec-exit.extension.js +29 -32
  72. package/bundled/extensions/kubbisec-extended-context.extension.d.ts +1 -1
  73. package/bundled/extensions/kubbisec-extended-context.extension.js +56 -43
  74. package/bundled/extensions/kubbisec-footer.extension.d.ts +14 -14
  75. package/bundled/extensions/kubbisec-footer.extension.js +205 -215
  76. package/bundled/extensions/kubbisec-github-local.extension.d.ts +26 -18
  77. package/bundled/extensions/kubbisec-github-local.extension.js +123 -116
  78. package/bundled/extensions/kubbisec-llm-config.extension.d.ts +1 -1
  79. package/bundled/extensions/kubbisec-llm-config.extension.js +200 -181
  80. package/bundled/extensions/kubbisec-memory.extension.d.ts +9 -7
  81. package/bundled/extensions/kubbisec-memory.extension.js +88 -95
  82. package/bundled/extensions/kubbisec-naus-local.extension.d.ts +18 -15
  83. package/bundled/extensions/kubbisec-naus-local.extension.js +132 -111
  84. package/bundled/extensions/kubbisec-platform-tools.extension.d.ts +31 -21
  85. package/bundled/extensions/kubbisec-platform-tools.extension.js +152 -152
  86. package/bundled/extensions/kubbisec-runtime-status.extension.d.ts +10 -8
  87. package/bundled/extensions/kubbisec-runtime-status.extension.js +15 -13
  88. package/bundled/extensions/kubbisec-scope.extension.d.ts +12 -7
  89. package/bundled/extensions/kubbisec-scope.extension.js +13 -13
  90. package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts +27 -16
  91. package/bundled/extensions/kubbisec-skill-mentions.extension.js +73 -63
  92. package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts +2 -3
  93. package/bundled/extensions/kubbisec-skill-telemetry.extension.js +59 -64
  94. package/bundled/extensions/kubbisec-theme-lock.extension.d.ts +1 -1
  95. package/bundled/extensions/kubbisec-theme-lock.extension.js +33 -34
  96. package/bundled/extensions/kubbisec-ui.extension.d.ts +1 -1
  97. package/bundled/extensions/kubbisec-ui.extension.js +114 -109
  98. package/bundled/extensions/kubbisec-workflow.extension.d.ts +20 -18
  99. package/bundled/extensions/kubbisec-workflow.extension.js +138 -140
  100. package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts +2 -0
  101. package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts.map +1 -0
  102. package/bundled/node_modules/@aspm/shared/dist/redaction.test.js +626 -0
  103. package/bundled/node_modules/@aspm/shared/dist/redaction.test.js.map +1 -0
  104. package/bundled/resolve-bundled-dist-root.js +122 -131
  105. package/bundled/skills/at-path-mentions.d.ts +1 -1
  106. package/bundled/skills/at-path-mentions.js +146 -153
  107. package/bundled/skills/chat-mention-render.d.ts +2 -2
  108. package/bundled/skills/chat-mention-render.js +121 -126
  109. package/bundled/skills/chat-mentions.d.ts +17 -8
  110. package/bundled/skills/chat-mentions.js +76 -76
  111. package/bundled/skills/list-bundled-skills.d.ts +3 -3
  112. package/bundled/skills/list-bundled-skills.js +33 -35
  113. package/bundled/skills/skill-mention.d.ts +10 -2
  114. package/bundled/skills/skill-mention.js +10 -2
  115. package/bundled/theme/clear-terminal.d.ts +1 -1
  116. package/bundled/theme/clear-terminal.js +3 -4
  117. package/bundled/theme/footer-render-hook.d.ts +1 -1
  118. package/bundled/theme/footer-render-hook.js +3 -3
  119. package/bundled/theme/kubbisec-brand-fg.d.ts +1 -1
  120. package/bundled/theme/kubbisec-brand-fg.js +2 -2
  121. package/bundled/theme/kubbisec-menu-themes.d.ts +7 -7
  122. package/bundled/theme/kubbisec-menu-themes.js +30 -31
  123. package/bundled/theme/kubbisec-theme-name.d.ts +1 -1
  124. package/bundled/theme/kubbisec-theme-name.js +1 -1
  125. package/bundled/theme/patch-pi-settings-theme.runtime.d.ts +1 -1
  126. package/bundled/theme/patch-pi-settings-theme.runtime.js +11 -10
  127. package/bundled/theme/render-compact-header.d.ts +13 -5
  128. package/bundled/theme/render-compact-header.js +127 -129
  129. package/bundled/workflow/session-workflow-mode.d.ts +1 -1
  130. package/bundled/workflow/session-workflow-mode.js +33 -33
  131. package/package.json +1 -1
@@ -1,6 +1,5 @@
1
1
  type ExtensionApi = {
2
- on: (event: string, handler: (event: unknown, ctx: unknown) => void | Promise<void>) => void;
2
+ on: (event: string, handler: (event: unknown, ctx: unknown) => void | Promise<void>) => void;
3
3
  };
4
4
  export default function kubbisecSkillTelemetry(api: ExtensionApi): void;
5
- export {};
6
- //# sourceMappingURL=kubbisec-skill-telemetry.extension.d.ts.map
5
+ //# sourceMappingURL=kubbisec-skill-telemetry.extension.d.ts.map
@@ -2,84 +2,79 @@
2
2
  * KubbiSec trajectory telemetry — forwards Pi TUI events to parent adapter via JSONL file.
3
3
  */
4
4
  import * as fs from "node:fs";
5
+
5
6
  function isOptOut() {
6
- return process.env.KUBBISEC_TELEMETRY_OPT_OUT === "1";
7
+ return process.env.KUBBISEC_TELEMETRY_OPT_OUT === "1";
7
8
  }
8
9
  function eventsPath() {
9
- const sessionId = process.env.KUBBISEC_TELEMETRY_SESSION_ID?.trim();
10
- const eventsFile = process.env.KUBBISEC_TELEMETRY_EVENTS_PATH?.trim();
11
- if (!sessionId || !eventsFile)
12
- return null;
13
- return eventsFile;
10
+ const sessionId = process.env.KUBBISEC_TELEMETRY_SESSION_ID?.trim();
11
+ const eventsFile = process.env.KUBBISEC_TELEMETRY_EVENTS_PATH?.trim();
12
+ if (!sessionId || !eventsFile) return null;
13
+ return eventsFile;
14
14
  }
15
15
  function shouldEmit(surface) {
16
- if (isOptOut())
17
- return false;
18
- if (surface === "chat" && process.env.KUBBISEC_TELEMETRY_CHAT !== "1") {
19
- return process.env.KUBBISEC_SKILL_ROUTER === "1";
20
- }
21
- if (surface === "fix" && process.env.KUBBISEC_TELEMETRY_FIX !== "1")
22
- return false;
23
- return true;
16
+ if (isOptOut()) return false;
17
+ if (surface === "chat" && process.env.KUBBISEC_TELEMETRY_CHAT !== "1") {
18
+ return process.env.KUBBISEC_SKILL_ROUTER === "1";
19
+ }
20
+ if (surface === "fix" && process.env.KUBBISEC_TELEMETRY_FIX !== "1") return false;
21
+ return true;
24
22
  }
25
23
  function resolveSurface() {
26
- return process.env.KUBBISEC_TELEMETRY_SURFACE === "fix" ? "fix" : "chat";
24
+ return process.env.KUBBISEC_TELEMETRY_SURFACE === "fix" ? "fix" : "chat";
27
25
  }
28
26
  const SECRET_ARG_PATTERN = /KUBBISEC_API_KEY|GITHUB_TOKEN|password=/i;
29
27
  function scrubToolArgs(args) {
30
- const raw = typeof args === "string" ? args : JSON.stringify(args ?? "");
31
- if (SECRET_ARG_PATTERN.test(raw)) {
32
- return "[REDACTED]";
33
- }
34
- return args;
28
+ const raw = typeof args === "string" ? args : JSON.stringify(args ?? "");
29
+ if (SECRET_ARG_PATTERN.test(raw)) {
30
+ return "[REDACTED]";
31
+ }
32
+ return args;
35
33
  }
36
34
  function appendEvent(kind, payload) {
37
- const file = eventsPath();
38
- if (!file)
39
- return;
40
- const surface = resolveSurface();
41
- if (!shouldEmit(surface))
42
- return;
43
- try {
44
- const line = JSON.stringify({
45
- ts: new Date().toISOString(),
46
- kind,
47
- payload,
48
- });
49
- fs.appendFileSync(file, `${line}\n`, { encoding: "utf8", mode: 0o600 });
50
- }
51
- catch {
52
- /* swallow — telemetry must not block TUI */
53
- }
35
+ const file = eventsPath();
36
+ if (!file) return;
37
+ const surface = resolveSurface();
38
+ if (!shouldEmit(surface)) return;
39
+ try {
40
+ const line = JSON.stringify({
41
+ ts: new Date().toISOString(),
42
+ kind,
43
+ payload,
44
+ });
45
+ fs.appendFileSync(file, `${line}\n`, { encoding: "utf8", mode: 0o600 });
46
+ } catch {
47
+ /* swallow telemetry must not block TUI */
48
+ }
54
49
  }
55
50
  export default function kubbisecSkillTelemetry(api) {
56
- if (isOptOut() || !eventsPath()) {
57
- return;
58
- }
59
- api.on("input", async (event) => {
60
- const input = event;
61
- const text = typeof input.text === "string" ? input.text : "";
62
- if (!text.trim())
63
- return;
64
- appendEvent("user_message", { text: text.slice(0, 4096) });
65
- });
66
- api.on("tool_start", async (event) => {
67
- const tool = event;
68
- appendEvent("tool_call", {
69
- name: tool.name ?? "unknown",
70
- args: scrubToolArgs(tool.args),
71
- });
51
+ if (isOptOut() || !eventsPath()) {
52
+ return;
53
+ }
54
+ api.on("input", async (event) => {
55
+ const input = event;
56
+ const text = typeof input.text === "string" ? input.text : "";
57
+ if (!text.trim()) return;
58
+ appendEvent("user_message", { text: text.slice(0, 4096) });
59
+ });
60
+ api.on("tool_start", async (event) => {
61
+ const tool = event;
62
+ appendEvent("tool_call", {
63
+ name: tool.name ?? "unknown",
64
+ args: scrubToolArgs(tool.args),
72
65
  });
73
- api.on("tool_end", async (event) => {
74
- const tool = event;
75
- const output = typeof tool.output === "string" && tool.output.length > 2048
76
- ? `${tool.output.slice(0, 2048)}…`
77
- : tool.output;
78
- appendEvent("tool_result", {
79
- name: tool.name ?? "unknown",
80
- exitCode: tool.exitCode ?? null,
81
- output,
82
- });
66
+ });
67
+ api.on("tool_end", async (event) => {
68
+ const tool = event;
69
+ const output =
70
+ typeof tool.output === "string" && tool.output.length > 2048
71
+ ? `${tool.output.slice(0, 2048)}…`
72
+ : tool.output;
73
+ appendEvent("tool_result", {
74
+ name: tool.name ?? "unknown",
75
+ exitCode: tool.exitCode ?? null,
76
+ output,
83
77
  });
78
+ });
84
79
  }
85
- //# sourceMappingURL=kubbisec-skill-telemetry.extension.js.map
80
+ //# sourceMappingURL=kubbisec-skill-telemetry.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 kubbisecThemeLock(api: ExtensionAPI): void;
6
- //# sourceMappingURL=kubbisec-theme-lock.extension.d.ts.map
6
+ //# sourceMappingURL=kubbisec-theme-lock.extension.d.ts.map
@@ -1,43 +1,42 @@
1
1
  import { patchGlobalThemeAccent } from "../theme/kubbisec-menu-themes.js";
2
2
  import { KUBBISEC_THEME_NAME } from "../theme/kubbisec-theme-name.js";
3
+
3
4
  const THEME_GUARD_MS = 1_500;
4
5
  const NOTIFY_COOLDOWN_MS = 8_000;
5
- const THEME_LOCKED_MESSAGE = "O tema KubbiSec é fixo. Alterações em /settings ou /reload não mudam o visual.";
6
+ const THEME_LOCKED_MESSAGE =
7
+ "O tema KubbiSec é fixo. Alterações em /settings ou /reload não mudam o visual.";
6
8
  let lastNotifyAt = 0;
7
9
  function lockTheme(ctx, notify) {
8
- if (!ctx.hasUI)
9
- return;
10
- if (ctx.ui.theme.name === KUBBISEC_THEME_NAME)
11
- return;
12
- const result = ctx.ui.setTheme(KUBBISEC_THEME_NAME);
13
- if (!result.success || !notify)
14
- return;
15
- const now = Date.now();
16
- if (now - lastNotifyAt < NOTIFY_COOLDOWN_MS)
17
- return;
18
- lastNotifyAt = now;
19
- ctx.ui.notify(THEME_LOCKED_MESSAGE, "info");
10
+ if (!ctx.hasUI) return;
11
+ if (ctx.ui.theme.name === KUBBISEC_THEME_NAME) return;
12
+ const result = ctx.ui.setTheme(KUBBISEC_THEME_NAME);
13
+ if (!result.success || !notify) return;
14
+ const now = Date.now();
15
+ if (now - lastNotifyAt < NOTIFY_COOLDOWN_MS) return;
16
+ lastNotifyAt = now;
17
+ ctx.ui.notify(THEME_LOCKED_MESSAGE, "info");
20
18
  }
21
19
  export default function kubbisecThemeLock(api) {
22
- let guardTimer;
23
- const stopGuard = () => {
24
- if (!guardTimer)
25
- return;
26
- clearInterval(guardTimer);
27
- guardTimer = undefined;
28
- };
29
- const startGuard = (ctx) => {
30
- stopGuard();
31
- guardTimer = setInterval(() => lockTheme(ctx, true), THEME_GUARD_MS);
32
- };
33
- api.on("session_start", async (_event, ctx) => {
34
- lockTheme(ctx, false);
35
- patchGlobalThemeAccent();
36
- await import("../theme/patch-pi-settings-theme.runtime.js").then((mod) => mod.patchPiSettingsListTheme());
37
- startGuard(ctx);
38
- });
39
- api.on("session_shutdown", () => {
40
- stopGuard();
41
- });
20
+ let guardTimer;
21
+ const stopGuard = () => {
22
+ if (!guardTimer) return;
23
+ clearInterval(guardTimer);
24
+ guardTimer = undefined;
25
+ };
26
+ const startGuard = (ctx) => {
27
+ stopGuard();
28
+ guardTimer = setInterval(() => lockTheme(ctx, true), THEME_GUARD_MS);
29
+ };
30
+ api.on("session_start", async (_event, ctx) => {
31
+ lockTheme(ctx, false);
32
+ patchGlobalThemeAccent();
33
+ await import("../theme/patch-pi-settings-theme.runtime.js").then((mod) =>
34
+ mod.patchPiSettingsListTheme(),
35
+ );
36
+ startGuard(ctx);
37
+ });
38
+ api.on("session_shutdown", () => {
39
+ stopGuard();
40
+ });
42
41
  }
43
- //# sourceMappingURL=kubbisec-theme-lock.extension.js.map
42
+ //# sourceMappingURL=kubbisec-theme-lock.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 kubbisecUi(pi: ExtensionAPI): void;
6
- //# sourceMappingURL=kubbisec-ui.extension.d.ts.map
6
+ //# sourceMappingURL=kubbisec-ui.extension.d.ts.map
@@ -1,132 +1,137 @@
1
1
  /**
2
2
  * KubbiSec AI shell: closed cyan editor frame (┌─┐ │ │ └─┘) around the chat input.
3
3
  */
4
- import { CustomEditor, } from "@earendil-works/pi-coding-agent";
4
+ import { CustomEditor } from "@earendil-works/pi-coding-agent";
5
5
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
6
6
  import { handleClarifyPanelKey } from "../clarify/clarify-select-panel.js";
7
- import { getClarifyUiSnapshot, isClarifyAsking, setClarifyUiSnapshot, } from "../clarify/clarify-ui-state.js";
7
+ import {
8
+ getClarifyUiSnapshot,
9
+ isClarifyAsking,
10
+ setClarifyUiSnapshot,
11
+ } from "../clarify/clarify-ui-state.js";
8
12
  import { formatSelectionSubmit } from "../clarify/parse-clarify-answer.js";
9
- import { KUBBISEC_EDITOR_PLACEHOLDER, KUBBISEC_EXIT_SLASH_COMMAND, } from "../copy/kubbisec-shell-copy.js";
13
+ import {
14
+ KUBBISEC_EDITOR_PLACEHOLDER,
15
+ KUBBISEC_EXIT_SLASH_COMMAND,
16
+ } from "../copy/kubbisec-shell-copy.js";
10
17
  import { renderLineWithMentionChips } from "../skills/chat-mention-render.js";
11
18
  import { withKubbisecSelectListTheme } from "../theme/kubbisec-menu-themes.js";
19
+
12
20
  /** Horizontal inset inside the cyan editor frame (per side). */
13
21
  const EDITOR_PADDING_X = 1;
14
22
  function buildPlaceholderContent(theme, innerWidth, rawLine) {
15
- if (innerWidth <= 0)
16
- return "";
17
- const showCursor = rawLine.includes("\x1b[7m");
18
- const dim = (text) => theme.fg("dim", text);
19
- const inset = " ".repeat(EDITOR_PADDING_X);
20
- if (!showCursor) {
21
- const text = `${inset}${dim(KUBBISEC_EDITOR_PLACEHOLDER)}`;
22
- const pad = Math.max(0, innerWidth - visibleWidth(text));
23
- return `${text}${" ".repeat(pad)}`;
24
- }
25
- const first = KUBBISEC_EDITOR_PLACEHOLDER[0] ?? " ";
26
- const rest = KUBBISEC_EDITOR_PLACEHOLDER.slice(1);
27
- const cursor = `\x1b[7m${first}\x1b[0m`;
28
- const content = `${inset}${cursor}${dim(rest)}`;
29
- const pad = Math.max(0, innerWidth - visibleWidth(content));
30
- return `${content}${" ".repeat(pad)}`;
23
+ if (innerWidth <= 0) return "";
24
+ const showCursor = rawLine.includes("\x1b[7m");
25
+ const dim = (text) => theme.fg("dim", text);
26
+ const inset = " ".repeat(EDITOR_PADDING_X);
27
+ if (!showCursor) {
28
+ const text = `${inset}${dim(KUBBISEC_EDITOR_PLACEHOLDER)}`;
29
+ const pad = Math.max(0, innerWidth - visibleWidth(text));
30
+ return `${text}${" ".repeat(pad)}`;
31
+ }
32
+ const first = KUBBISEC_EDITOR_PLACEHOLDER[0] ?? " ";
33
+ const rest = KUBBISEC_EDITOR_PLACEHOLDER.slice(1);
34
+ const cursor = `\x1b[7m${first}\x1b[0m`;
35
+ const content = `${inset}${cursor}${dim(rest)}`;
36
+ const pad = Math.max(0, innerWidth - visibleWidth(content));
37
+ return `${content}${" ".repeat(pad)}`;
31
38
  }
32
39
  function horizontalBorder(width, leftCap, rightCap, border) {
33
- if (width <= 0)
34
- return "";
35
- if (width === 1)
36
- return border(leftCap);
37
- const mid = Math.max(0, width - 2);
38
- return `${border(leftCap)}${border("─".repeat(mid))}${border(rightCap)}`;
40
+ if (width <= 0) return "";
41
+ if (width === 1) return border(leftCap);
42
+ const mid = Math.max(0, width - 2);
43
+ return `${border(leftCap)}${border("─".repeat(mid))}${border(rightCap)}`;
39
44
  }
40
45
  function wrapWithVerticalBorders(content, width, border) {
41
- if (width <= 0)
42
- return "";
43
- if (width === 1)
44
- return border("");
45
- const innerWidth = Math.max(0, width - 2);
46
- const inner = truncateToWidth(content, innerWidth, "");
47
- const pad = Math.max(0, innerWidth - visibleWidth(inner));
48
- return `${border("│")}${inner}${" ".repeat(pad)}${border("│")}`;
46
+ if (width <= 0) return "";
47
+ if (width === 1) return border("");
48
+ const innerWidth = Math.max(0, width - 2);
49
+ const inner = truncateToWidth(content, innerWidth, "");
50
+ const pad = Math.max(0, innerWidth - visibleWidth(inner));
51
+ return `${border("│")}${inner}${" ".repeat(pad)}${border("")}`;
49
52
  }
50
53
  export default function kubbisecUi(pi) {
51
- pi.on("session_start", (_event, ctx) => {
52
- if (!ctx.hasUI)
53
- return;
54
- ctx.ui.setWorkingVisible(false);
55
- ctx.ui.setHiddenThinkingLabel("reasoning");
56
- ctx.ui.setWorkingIndicator({ frames: ["◆", "◇", "◆", "◇"], intervalMs: 120 });
57
- class KubbisecBorderEditor extends CustomEditor {
58
- constructor(tui, theme, keybindings) {
59
- super(tui, withKubbisecSelectListTheme(theme), keybindings, {
60
- paddingX: EDITOR_PADDING_X,
61
- autocompleteMaxVisible: 12,
62
- });
63
- this.installExitSlashRedirect();
64
- }
65
- installExitSlashRedirect() {
66
- let submitHandler;
67
- Object.defineProperty(this, "onSubmit", {
68
- configurable: true,
69
- enumerable: true,
70
- get: () => submitHandler,
71
- set: (handler) => {
72
- submitHandler = handler
73
- ? async (text) => {
74
- if (text.trim() === "/quit") {
75
- return handler(KUBBISEC_EXIT_SLASH_COMMAND);
76
- }
77
- if (isClarifyAsking()) {
78
- const snapshot = getClarifyUiSnapshot();
79
- const trimmed = text.trim();
80
- if (!trimmed) {
81
- const fromPanel = formatSelectionSubmit(new Set(snapshot.selected), snapshot.selectionMode);
82
- if (fromPanel) {
83
- return handler(fromPanel);
84
- }
85
- }
86
- }
87
- return handler(text);
88
- }
89
- : undefined;
90
- },
91
- });
92
- }
93
- handleInput(data) {
94
- if (isClarifyAsking()) {
54
+ pi.on("session_start", (_event, ctx) => {
55
+ if (!ctx.hasUI) return;
56
+ ctx.ui.setWorkingVisible(false);
57
+ ctx.ui.setHiddenThinkingLabel("reasoning");
58
+ ctx.ui.setWorkingIndicator({ frames: ["", "◇", "◆", "◇"], intervalMs: 120 });
59
+ class KubbisecBorderEditor extends CustomEditor {
60
+ constructor(tui, theme, keybindings) {
61
+ super(tui, withKubbisecSelectListTheme(theme), keybindings, {
62
+ paddingX: EDITOR_PADDING_X,
63
+ autocompleteMaxVisible: 12,
64
+ });
65
+ this.installExitSlashRedirect();
66
+ }
67
+ installExitSlashRedirect() {
68
+ let submitHandler;
69
+ Object.defineProperty(this, "onSubmit", {
70
+ configurable: true,
71
+ enumerable: true,
72
+ get: () => submitHandler,
73
+ set: (handler) => {
74
+ submitHandler = handler
75
+ ? async (text) => {
76
+ if (text.trim() === "/quit") {
77
+ return handler(KUBBISEC_EXIT_SLASH_COMMAND);
78
+ }
79
+ if (isClarifyAsking()) {
95
80
  const snapshot = getClarifyUiSnapshot();
96
- const result = handleClarifyPanelKey(snapshot, data);
97
- if (result.consumed) {
98
- setClarifyUiSnapshot(result.snapshot);
99
- if (result.submitText && this.onSubmit) {
100
- void this.onSubmit(result.submitText);
101
- return;
102
- }
103
- return;
81
+ const trimmed = text.trim();
82
+ if (!trimmed) {
83
+ const fromPanel = formatSelectionSubmit(
84
+ new Set(snapshot.selected),
85
+ snapshot.selectionMode,
86
+ );
87
+ if (fromPanel) {
88
+ return handler(fromPanel);
89
+ }
104
90
  }
91
+ }
92
+ return handler(text);
105
93
  }
106
- super.handleInput(data);
107
- }
108
- render(width) {
109
- const lines = super.render(width);
110
- if (lines.length < 2)
111
- return lines;
112
- const thm = ctx.ui.theme;
113
- const borderColor = (text) => thm.fg("borderAccent", text);
114
- const isEmpty = this.getText().length === 0;
115
- const innerWidth = Math.max(0, width - 2);
116
- lines[0] = horizontalBorder(width, "┌", "┐", borderColor);
117
- for (let i = 1; i < lines.length - 1; i += 1) {
118
- const rawLine = lines[i] ?? "";
119
- const base = isEmpty && i === 1
120
- ? buildPlaceholderContent(thm, innerWidth, rawLine)
121
- : rawLine;
122
- const content = renderLineWithMentionChips(base, thm);
123
- lines[i] = wrapWithVerticalBorders(content, width, borderColor);
124
- }
125
- lines[lines.length - 1] = horizontalBorder(width, "└", "┘", borderColor);
126
- return lines;
94
+ : undefined;
95
+ },
96
+ });
97
+ }
98
+ handleInput(data) {
99
+ if (isClarifyAsking()) {
100
+ const snapshot = getClarifyUiSnapshot();
101
+ const result = handleClarifyPanelKey(snapshot, data);
102
+ if (result.consumed) {
103
+ setClarifyUiSnapshot(result.snapshot);
104
+ if (result.submitText && this.onSubmit) {
105
+ void this.onSubmit(result.submitText);
106
+ return;
127
107
  }
108
+ return;
109
+ }
128
110
  }
129
- ctx.ui.setEditorComponent((tui, theme, keybindings) => new KubbisecBorderEditor(tui, theme, keybindings));
130
- });
111
+ super.handleInput(data);
112
+ }
113
+ render(width) {
114
+ const lines = super.render(width);
115
+ if (lines.length < 2) return lines;
116
+ const thm = ctx.ui.theme;
117
+ const borderColor = (text) => thm.fg("borderAccent", text);
118
+ const isEmpty = this.getText().length === 0;
119
+ const innerWidth = Math.max(0, width - 2);
120
+ lines[0] = horizontalBorder(width, "┌", "┐", borderColor);
121
+ for (let i = 1; i < lines.length - 1; i += 1) {
122
+ const rawLine = lines[i] ?? "";
123
+ const base =
124
+ isEmpty && i === 1 ? buildPlaceholderContent(thm, innerWidth, rawLine) : rawLine;
125
+ const content = renderLineWithMentionChips(base, thm);
126
+ lines[i] = wrapWithVerticalBorders(content, width, borderColor);
127
+ }
128
+ lines[lines.length - 1] = horizontalBorder(width, "└", "┘", borderColor);
129
+ return lines;
130
+ }
131
+ }
132
+ ctx.ui.setEditorComponent(
133
+ (tui, theme, keybindings) => new KubbisecBorderEditor(tui, theme, keybindings),
134
+ );
135
+ });
131
136
  }
132
- //# sourceMappingURL=kubbisec-ui.extension.js.map
137
+ //# sourceMappingURL=kubbisec-ui.extension.js.map
@@ -1,38 +1,40 @@
1
1
  export type ChatWorkflowMode = "default" | "plan" | "review";
2
2
  export type SessionWorkflowState = {
3
- mode: ChatWorkflowMode;
4
- specApproved: boolean;
5
- specPath?: string;
3
+ mode: ChatWorkflowMode;
4
+ specApproved: boolean;
5
+ specPath?: string;
6
6
  };
7
7
  export declare function isMutationTool(toolName: string): boolean;
8
8
  export declare function detectModeFromPrompt(prompt: string, envMode?: string): ChatWorkflowMode;
9
9
  export declare function parseRuntimeSpecStatus(content: string): string | null;
10
10
  export declare function findApprovedSpec(cwd: string): {
11
- approved: boolean;
12
- specPath?: string;
11
+ approved: boolean;
12
+ specPath?: string;
13
13
  };
14
14
  export declare function resolveSpecApproval(cwd: string): {
15
- approved: boolean;
16
- specPath?: string;
15
+ approved: boolean;
16
+ specPath?: string;
17
17
  };
18
18
  export declare function shouldBlockMutationTool(state: SessionWorkflowState): boolean;
19
19
  export declare function userApprovedSpecKeyword(text: string): boolean;
20
20
  export declare function buildPlanModeContextMessage(): string;
21
21
  export declare function buildReviewModeContextMessage(): string;
22
22
  type ExtensionApi = {
23
- on: (event: string, handler: (event: unknown, ctx: ExtensionContext) => void | Promise<unknown>) => void;
23
+ on: (
24
+ event: string,
25
+ handler: (event: unknown, ctx: ExtensionContext) => undefined | Promise<unknown>,
26
+ ) => void;
24
27
  };
25
28
  type ExtensionContext = {
26
- hasUI: boolean;
27
- cwd: string;
28
- ui: {
29
- notify: (message: string, level?: string) => void;
30
- setStatus: (key: string, text: string | undefined) => void;
31
- theme: {
32
- fg: (role: string, text: string) => string;
33
- };
29
+ hasUI: boolean;
30
+ cwd: string;
31
+ ui: {
32
+ notify: (message: string, level?: string) => void;
33
+ setStatus: (key: string, text: string | undefined) => void;
34
+ theme: {
35
+ fg: (role: string, text: string) => string;
34
36
  };
37
+ };
35
38
  };
36
39
  export default function kubbisecWorkflow(api: ExtensionApi): void;
37
- export {};
38
- //# sourceMappingURL=kubbisec-workflow.extension.d.ts.map
40
+ //# sourceMappingURL=kubbisec-workflow.extension.d.ts.map