@kubbisec/ai-linux-x64 0.1.22 → 0.1.23

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 (109) hide show
  1. package/bin/kubbisec +0 -0
  2. package/bundled/components/kubbisec-model-selector.d.ts +47 -34
  3. package/bundled/components/kubbisec-model-selector.js +187 -177
  4. package/bundled/config/config.d.ts +6 -6
  5. package/bundled/config/config.js +54 -52
  6. package/bundled/config/detect-local-llm-providers.d.ts +26 -16
  7. package/bundled/config/detect-local-llm-providers.js +130 -142
  8. package/bundled/config/ensure-kbs-project-settings.d.ts +8 -8
  9. package/bundled/config/ensure-kbs-project-settings.js +27 -28
  10. package/bundled/config/ensure-kubbisec-project-settings.d.ts +9 -9
  11. package/bundled/config/ensure-kubbisec-project-settings.js +62 -67
  12. package/bundled/config/extended-context.d.ts +5 -6
  13. package/bundled/config/extended-context.js +23 -22
  14. package/bundled/config/feature-flags.d.ts +10 -2
  15. package/bundled/config/feature-flags.js +8 -2
  16. package/bundled/config/format-kubbisec-footer-status.d.ts +1 -1
  17. package/bundled/config/format-kubbisec-footer-status.js +26 -31
  18. package/bundled/config/kubbisec-extension-manifest.d.ts +21 -2
  19. package/bundled/config/kubbisec-extension-manifest.js +19 -19
  20. package/bundled/config/llm-config-mutations.d.ts +51 -25
  21. package/bundled/config/llm-config-mutations.js +173 -182
  22. package/bundled/config/llm-config.d.ts +54 -41
  23. package/bundled/config/llm-config.js +199 -199
  24. package/bundled/config/llm-provider-catalog.d.ts +18 -15
  25. package/bundled/config/llm-provider-catalog.js +45 -46
  26. package/bundled/config/materialize-kubbisec-pi-resources.d.ts +1 -1
  27. package/bundled/config/materialize-kubbisec-pi-resources.js +173 -182
  28. package/bundled/config/register-custom-llm-providers.d.ts +11 -5
  29. package/bundled/config/register-custom-llm-providers.js +17 -15
  30. package/bundled/config/register-kubbisec-llm-provider.d.ts +14 -10
  31. package/bundled/config/register-kubbisec-llm-provider.js +50 -42
  32. package/bundled/config/resolve-agents-context-file.d.ts +1 -1
  33. package/bundled/config/resolve-agents-context-file.js +33 -34
  34. package/bundled/config/resource-budget.d.ts +12 -12
  35. package/bundled/config/resource-budget.js +28 -28
  36. package/bundled/config/sync-kubbisec-pi-models.d.ts +6 -3
  37. package/bundled/config/sync-kubbisec-pi-models.js +58 -58
  38. package/bundled/copy/cli-reference-index.d.ts +1 -1
  39. package/bundled/copy/cli-reference-index.js +1 -1
  40. package/bundled/copy/kubbisec-shell-copy.d.ts +11 -6
  41. package/bundled/copy/kubbisec-shell-copy.js +1 -1
  42. package/bundled/extensions/cli-local-shared.d.ts +56 -32
  43. package/bundled/extensions/cli-local-shared.js +135 -125
  44. package/bundled/extensions/kubbisec-aspm-local.extension.d.ts +18 -15
  45. package/bundled/extensions/kubbisec-aspm-local.extension.js +109 -106
  46. package/bundled/extensions/kubbisec-brand.extension.d.ts +1 -1
  47. package/bundled/extensions/kubbisec-brand.extension.js +25 -25
  48. package/bundled/extensions/kubbisec-byok-provider.extension.d.ts +1 -1
  49. package/bundled/extensions/kubbisec-byok-provider.extension.js +2 -2
  50. package/bundled/extensions/kubbisec-clarify.extension.d.ts +64 -35
  51. package/bundled/extensions/kubbisec-clarify.extension.js +323 -305
  52. package/bundled/extensions/kubbisec-exit.extension.d.ts +1 -1
  53. package/bundled/extensions/kubbisec-exit.extension.js +29 -32
  54. package/bundled/extensions/kubbisec-extended-context.extension.d.ts +1 -1
  55. package/bundled/extensions/kubbisec-extended-context.extension.js +56 -43
  56. package/bundled/extensions/kubbisec-footer.extension.d.ts +14 -14
  57. package/bundled/extensions/kubbisec-footer.extension.js +205 -215
  58. package/bundled/extensions/kubbisec-github-local.extension.d.ts +26 -18
  59. package/bundled/extensions/kubbisec-github-local.extension.js +430 -417
  60. package/bundled/extensions/kubbisec-llm-config.extension.d.ts +1 -1
  61. package/bundled/extensions/kubbisec-llm-config.extension.js +200 -181
  62. package/bundled/extensions/kubbisec-memory.extension.d.ts +9 -7
  63. package/bundled/extensions/kubbisec-memory.extension.js +88 -95
  64. package/bundled/extensions/kubbisec-naus-local.extension.d.ts +18 -15
  65. package/bundled/extensions/kubbisec-naus-local.extension.js +123 -103
  66. package/bundled/extensions/kubbisec-platform-tools.extension.d.ts +31 -21
  67. package/bundled/extensions/kubbisec-platform-tools.extension.js +152 -152
  68. package/bundled/extensions/kubbisec-runtime-status.extension.d.ts +10 -8
  69. package/bundled/extensions/kubbisec-runtime-status.extension.js +15 -13
  70. package/bundled/extensions/kubbisec-scope.extension.d.ts +12 -7
  71. package/bundled/extensions/kubbisec-scope.extension.js +13 -13
  72. package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts +27 -16
  73. package/bundled/extensions/kubbisec-skill-mentions.extension.js +74 -64
  74. package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts +2 -3
  75. package/bundled/extensions/kubbisec-skill-telemetry.extension.js +59 -64
  76. package/bundled/extensions/kubbisec-theme-lock.extension.d.ts +1 -1
  77. package/bundled/extensions/kubbisec-theme-lock.extension.js +33 -34
  78. package/bundled/extensions/kubbisec-ui.extension.d.ts +1 -1
  79. package/bundled/extensions/kubbisec-ui.extension.js +90 -92
  80. package/bundled/extensions/kubbisec-workflow.extension.d.ts +20 -18
  81. package/bundled/extensions/kubbisec-workflow.extension.js +138 -140
  82. package/bundled/resolve-bundled-dist-root.js +121 -130
  83. package/bundled/skills/at-path-mentions.d.ts +1 -1
  84. package/bundled/skills/at-path-mentions.js +146 -153
  85. package/bundled/skills/chat-mention-render.d.ts +2 -2
  86. package/bundled/skills/chat-mention-render.js +121 -126
  87. package/bundled/skills/chat-mentions.d.ts +17 -8
  88. package/bundled/skills/chat-mentions.js +76 -76
  89. package/bundled/skills/list-bundled-skills.d.ts +3 -3
  90. package/bundled/skills/list-bundled-skills.js +33 -35
  91. package/bundled/skills/skill-mention.d.ts +10 -2
  92. package/bundled/skills/skill-mention.js +10 -2
  93. package/bundled/theme/clear-terminal.d.ts +1 -1
  94. package/bundled/theme/clear-terminal.js +3 -4
  95. package/bundled/theme/footer-render-hook.d.ts +1 -1
  96. package/bundled/theme/footer-render-hook.js +3 -3
  97. package/bundled/theme/kubbisec-brand-fg.d.ts +1 -1
  98. package/bundled/theme/kubbisec-brand-fg.js +2 -2
  99. package/bundled/theme/kubbisec-menu-themes.d.ts +7 -7
  100. package/bundled/theme/kubbisec-menu-themes.js +30 -31
  101. package/bundled/theme/kubbisec-theme-name.d.ts +1 -1
  102. package/bundled/theme/kubbisec-theme-name.js +1 -1
  103. package/bundled/theme/patch-pi-settings-theme.runtime.d.ts +1 -1
  104. package/bundled/theme/patch-pi-settings-theme.runtime.js +11 -10
  105. package/bundled/theme/render-compact-header.d.ts +13 -5
  106. package/bundled/theme/render-compact-header.js +126 -128
  107. package/bundled/workflow/session-workflow-mode.d.ts +1 -1
  108. package/bundled/workflow/session-workflow-mode.js +33 -33
  109. 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,7 +1,7 @@
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
7
  // import {
@@ -10,75 +10,73 @@ import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
10
10
  // setClarifyUiSnapshot,
11
11
  // } from "../clarify/clarify-ui-state.js";
12
12
  // import { formatSelectionSubmit } from "../clarify/parse-clarify-answer.js";
13
- 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";
14
17
  import { renderLineWithMentionChips } from "../skills/chat-mention-render.js";
15
18
  import { withKubbisecSelectListTheme } from "../theme/kubbisec-menu-themes.js";
19
+
16
20
  /** Horizontal inset inside the cyan editor frame (per side). */
17
21
  const EDITOR_PADDING_X = 1;
18
22
  function buildPlaceholderContent(theme, innerWidth, rawLine) {
19
- if (innerWidth <= 0)
20
- return "";
21
- const showCursor = rawLine.includes("\x1b[7m");
22
- const dim = (text) => theme.fg("dim", text);
23
- const inset = " ".repeat(EDITOR_PADDING_X);
24
- if (!showCursor) {
25
- const text = `${inset}${dim(KUBBISEC_EDITOR_PLACEHOLDER)}`;
26
- const pad = Math.max(0, innerWidth - visibleWidth(text));
27
- return `${text}${" ".repeat(pad)}`;
28
- }
29
- const first = KUBBISEC_EDITOR_PLACEHOLDER[0] ?? " ";
30
- const rest = KUBBISEC_EDITOR_PLACEHOLDER.slice(1);
31
- const cursor = `\x1b[7m${first}\x1b[0m`;
32
- const content = `${inset}${cursor}${dim(rest)}`;
33
- const pad = Math.max(0, innerWidth - visibleWidth(content));
34
- 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)}`;
35
38
  }
36
39
  function horizontalBorder(width, leftCap, rightCap, border) {
37
- if (width <= 0)
38
- return "";
39
- if (width === 1)
40
- return border(leftCap);
41
- const mid = Math.max(0, width - 2);
42
- 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)}`;
43
44
  }
44
45
  function wrapWithVerticalBorders(content, width, border) {
45
- if (width <= 0)
46
- return "";
47
- if (width === 1)
48
- return border("");
49
- const innerWidth = Math.max(0, width - 2);
50
- const inner = truncateToWidth(content, innerWidth, "");
51
- const pad = Math.max(0, innerWidth - visibleWidth(inner));
52
- 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("")}`;
53
52
  }
54
53
  export default function kubbisecUi(pi) {
55
- pi.on("session_start", (_event, ctx) => {
56
- if (!ctx.hasUI)
57
- return;
58
- ctx.ui.setWorkingVisible(false);
59
- ctx.ui.setHiddenThinkingLabel("reasoning");
60
- ctx.ui.setWorkingIndicator({ frames: ["◆", "◇", "◆", "◇"], intervalMs: 120 });
61
- class KubbisecBorderEditor extends CustomEditor {
62
- constructor(tui, theme, keybindings) {
63
- super(tui, withKubbisecSelectListTheme(theme), keybindings, {
64
- paddingX: EDITOR_PADDING_X,
65
- autocompleteMaxVisible: 12,
66
- });
67
- this.installExitSlashRedirect();
68
- }
69
- installExitSlashRedirect() {
70
- let submitHandler;
71
- Object.defineProperty(this, "onSubmit", {
72
- configurable: true,
73
- enumerable: true,
74
- get: () => submitHandler,
75
- set: (handler) => {
76
- submitHandler = handler
77
- ? async (text) => {
78
- if (text.trim() === "/quit") {
79
- return handler(KUBBISEC_EXIT_SLASH_COMMAND);
80
- }
81
- /*
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
+ /*
82
80
  if (isClarifyAsking()) {
83
81
  const snapshot = getClarifyUiSnapshot();
84
82
  const trimmed = text.trim();
@@ -93,14 +91,14 @@ export default function kubbisecUi(pi) {
93
91
  }
94
92
  }
95
93
  */
96
- return handler(text);
97
- }
98
- : undefined;
99
- },
100
- });
101
- }
102
- handleInput(data) {
103
- /*
94
+ return handler(text);
95
+ }
96
+ : undefined;
97
+ },
98
+ });
99
+ }
100
+ handleInput(data) {
101
+ /*
104
102
  if (isClarifyAsking()) {
105
103
  const snapshot = getClarifyUiSnapshot();
106
104
  const result = handleClarifyPanelKey(snapshot, data);
@@ -114,30 +112,30 @@ export default function kubbisecUi(pi) {
114
112
  }
115
113
  }
116
114
  */
117
- super.handleInput(data);
118
- }
119
- render(width) {
120
- const lines = super.render(width);
121
- if (lines.length < 2)
122
- return lines;
123
- const thm = ctx.ui.theme;
124
- const borderColor = (text) => thm.fg("borderAccent", text);
125
- const isEmpty = this.getText().length === 0;
126
- const innerWidth = Math.max(0, width - 2);
127
- lines[0] = horizontalBorder(width, "┌", "┐", borderColor);
128
- for (let i = 1; i < lines.length - 1; i += 1) {
129
- const rawLine = lines[i] ?? "";
130
- const base = isEmpty && i === 1
131
- ? buildPlaceholderContent(thm, innerWidth, rawLine)
132
- : rawLine;
133
- const content = renderLineWithMentionChips(base, thm);
134
- lines[i] = wrapWithVerticalBorders(content, width, borderColor);
135
- }
136
- lines[lines.length - 1] = horizontalBorder(width, "└", "┘", borderColor);
137
- return lines;
138
- }
115
+ super.handleInput(data);
116
+ }
117
+ render(width) {
118
+ const lines = super.render(width);
119
+ if (lines.length < 2) return lines;
120
+ const thm = ctx.ui.theme;
121
+ const borderColor = (text) => thm.fg("borderAccent", text);
122
+ const isEmpty = this.getText().length === 0;
123
+ const innerWidth = Math.max(0, width - 2);
124
+ lines[0] = horizontalBorder(width, "┌", "┐", borderColor);
125
+ for (let i = 1; i < lines.length - 1; i += 1) {
126
+ const rawLine = lines[i] ?? "";
127
+ const base =
128
+ isEmpty && i === 1 ? buildPlaceholderContent(thm, innerWidth, rawLine) : rawLine;
129
+ const content = renderLineWithMentionChips(base, thm);
130
+ lines[i] = wrapWithVerticalBorders(content, width, borderColor);
139
131
  }
140
- ctx.ui.setEditorComponent((tui, theme, keybindings) => new KubbisecBorderEditor(tui, theme, keybindings));
141
- });
132
+ lines[lines.length - 1] = horizontalBorder(width, "└", "┘", borderColor);
133
+ return lines;
134
+ }
135
+ }
136
+ ctx.ui.setEditorComponent(
137
+ (tui, theme, keybindings) => new KubbisecBorderEditor(tui, theme, keybindings),
138
+ );
139
+ });
142
140
  }
143
- //# sourceMappingURL=kubbisec-ui.extension.js.map
141
+ //# 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) => undefined | 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