@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.
- package/bundled/clarify/clarify-gate-state.d.ts +1 -1
- package/bundled/clarify/clarify-gate-state.js +3 -3
- package/bundled/clarify/clarify-gate.d.ts +21 -14
- package/bundled/clarify/clarify-gate.js +118 -111
- package/bundled/clarify/clarify-select-panel.d.ts +16 -9
- package/bundled/clarify/clarify-select-panel.js +65 -67
- package/bundled/clarify/clarify-ui-state.d.ts +12 -10
- package/bundled/clarify/clarify-ui-state.js +26 -26
- package/bundled/clarify/parse-clarify-answer.d.ts +29 -18
- package/bundled/clarify/parse-clarify-answer.js +39 -45
- package/bundled/clarify/question-format.d.ts +34 -23
- package/bundled/clarify/question-format.js +112 -119
- package/bundled/clarify/questionnaire-tool.d.ts +28 -17
- package/bundled/clarify/questionnaire-tool.js +180 -144
- package/bundled/clarify/scope-discovery.d.ts +8 -5
- package/bundled/clarify/scope-discovery.js +102 -110
- package/bundled/clarify/session-questionnaire.d.ts +48 -13
- package/bundled/clarify/session-questionnaire.js +304 -312
- package/bundled/clarify/session-questionnaire.types.d.ts +29 -27
- package/bundled/clarify/session-questionnaire.types.js +10 -10
- package/bundled/components/kubbisec-model-selector.d.ts +47 -34
- package/bundled/components/kubbisec-model-selector.js +187 -177
- package/bundled/config/config.d.ts +6 -6
- package/bundled/config/config.js +55 -55
- package/bundled/config/detect-local-llm-providers.d.ts +26 -16
- package/bundled/config/detect-local-llm-providers.js +130 -142
- package/bundled/config/ensure-kubbisec-project-settings.d.ts +9 -9
- package/bundled/config/ensure-kubbisec-project-settings.js +44 -48
- package/bundled/config/extended-context.d.ts +5 -6
- package/bundled/config/extended-context.js +23 -22
- package/bundled/config/feature-flags.d.ts +10 -2
- package/bundled/config/feature-flags.js +8 -2
- package/bundled/config/format-kubbisec-footer-status.d.ts +1 -1
- package/bundled/config/format-kubbisec-footer-status.js +26 -31
- package/bundled/config/kubbisec-extension-manifest.d.ts +22 -2
- package/bundled/config/kubbisec-extension-manifest.js +20 -20
- package/bundled/config/llm-config-mutations.d.ts +51 -25
- package/bundled/config/llm-config-mutations.js +173 -182
- package/bundled/config/llm-config.d.ts +54 -41
- package/bundled/config/llm-config.js +199 -199
- package/bundled/config/llm-provider-catalog.d.ts +18 -15
- package/bundled/config/llm-provider-catalog.js +45 -46
- package/bundled/config/materialize-kubbisec-pi-resources.d.ts +1 -1
- package/bundled/config/materialize-kubbisec-pi-resources.js +174 -183
- package/bundled/config/register-custom-llm-providers.d.ts +11 -5
- package/bundled/config/register-custom-llm-providers.js +17 -15
- package/bundled/config/register-kubbisec-llm-provider.d.ts +14 -10
- package/bundled/config/register-kubbisec-llm-provider.js +50 -42
- package/bundled/config/resolve-agents-context-file.d.ts +1 -1
- package/bundled/config/resolve-agents-context-file.js +33 -34
- package/bundled/config/resource-budget.d.ts +12 -12
- package/bundled/config/resource-budget.js +28 -28
- package/bundled/config/sync-kubbisec-pi-models.d.ts +6 -3
- package/bundled/config/sync-kubbisec-pi-models.js +58 -58
- package/bundled/copy/cli-reference-index.d.ts +3 -2
- package/bundled/copy/cli-reference-index.js +1 -1
- package/bundled/copy/kubbisec-shell-copy.d.ts +11 -6
- package/bundled/copy/kubbisec-shell-copy.js +1 -1
- package/bundled/extensions/cli-local-shared.d.ts +45 -26
- package/bundled/extensions/cli-local-shared.js +128 -118
- package/bundled/extensions/kubbisec-aspm-local.extension.d.ts +18 -15
- package/bundled/extensions/kubbisec-aspm-local.extension.js +118 -114
- package/bundled/extensions/kubbisec-brand.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-brand.extension.js +25 -25
- package/bundled/extensions/kubbisec-byok-provider.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-byok-provider.extension.js +2 -2
- package/bundled/extensions/kubbisec-clarify.extension.d.ts +64 -35
- package/bundled/extensions/kubbisec-clarify.extension.js +323 -305
- package/bundled/extensions/kubbisec-exit.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-exit.extension.js +29 -32
- package/bundled/extensions/kubbisec-extended-context.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-extended-context.extension.js +56 -43
- package/bundled/extensions/kubbisec-footer.extension.d.ts +14 -14
- package/bundled/extensions/kubbisec-footer.extension.js +205 -215
- package/bundled/extensions/kubbisec-github-local.extension.d.ts +26 -18
- package/bundled/extensions/kubbisec-github-local.extension.js +123 -116
- package/bundled/extensions/kubbisec-llm-config.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-llm-config.extension.js +200 -181
- package/bundled/extensions/kubbisec-memory.extension.d.ts +9 -7
- package/bundled/extensions/kubbisec-memory.extension.js +88 -95
- package/bundled/extensions/kubbisec-naus-local.extension.d.ts +18 -15
- package/bundled/extensions/kubbisec-naus-local.extension.js +132 -111
- package/bundled/extensions/kubbisec-platform-tools.extension.d.ts +31 -21
- package/bundled/extensions/kubbisec-platform-tools.extension.js +152 -152
- package/bundled/extensions/kubbisec-runtime-status.extension.d.ts +10 -8
- package/bundled/extensions/kubbisec-runtime-status.extension.js +15 -13
- package/bundled/extensions/kubbisec-scope.extension.d.ts +12 -7
- package/bundled/extensions/kubbisec-scope.extension.js +13 -13
- package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts +27 -16
- package/bundled/extensions/kubbisec-skill-mentions.extension.js +73 -63
- package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts +2 -3
- package/bundled/extensions/kubbisec-skill-telemetry.extension.js +59 -64
- package/bundled/extensions/kubbisec-theme-lock.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-theme-lock.extension.js +33 -34
- package/bundled/extensions/kubbisec-ui.extension.d.ts +1 -1
- package/bundled/extensions/kubbisec-ui.extension.js +114 -109
- package/bundled/extensions/kubbisec-workflow.extension.d.ts +20 -18
- package/bundled/extensions/kubbisec-workflow.extension.js +138 -140
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts +2 -0
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.d.ts.map +1 -0
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.js +626 -0
- package/bundled/node_modules/@aspm/shared/dist/redaction.test.js.map +1 -0
- package/bundled/resolve-bundled-dist-root.js +122 -131
- package/bundled/skills/at-path-mentions.d.ts +1 -1
- package/bundled/skills/at-path-mentions.js +146 -153
- package/bundled/skills/chat-mention-render.d.ts +2 -2
- package/bundled/skills/chat-mention-render.js +121 -126
- package/bundled/skills/chat-mentions.d.ts +17 -8
- package/bundled/skills/chat-mentions.js +76 -76
- package/bundled/skills/list-bundled-skills.d.ts +3 -3
- package/bundled/skills/list-bundled-skills.js +33 -35
- package/bundled/skills/skill-mention.d.ts +10 -2
- package/bundled/skills/skill-mention.js +10 -2
- package/bundled/theme/clear-terminal.d.ts +1 -1
- package/bundled/theme/clear-terminal.js +3 -4
- package/bundled/theme/footer-render-hook.d.ts +1 -1
- package/bundled/theme/footer-render-hook.js +3 -3
- package/bundled/theme/kubbisec-brand-fg.d.ts +1 -1
- package/bundled/theme/kubbisec-brand-fg.js +2 -2
- package/bundled/theme/kubbisec-menu-themes.d.ts +7 -7
- package/bundled/theme/kubbisec-menu-themes.js +30 -31
- package/bundled/theme/kubbisec-theme-name.d.ts +1 -1
- package/bundled/theme/kubbisec-theme-name.js +1 -1
- package/bundled/theme/patch-pi-settings-theme.runtime.d.ts +1 -1
- package/bundled/theme/patch-pi-settings-theme.runtime.js +11 -10
- package/bundled/theme/render-compact-header.d.ts +13 -5
- package/bundled/theme/render-compact-header.js +127 -129
- package/bundled/workflow/session-workflow-mode.d.ts +1 -1
- package/bundled/workflow/session-workflow-mode.js +33 -33
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
let requestRender;
|
|
2
2
|
export function setKubbisecFooterRequestRender(handler) {
|
|
3
|
-
|
|
3
|
+
requestRender = handler;
|
|
4
4
|
}
|
|
5
5
|
export function requestKubbisecFooterRender() {
|
|
6
|
-
|
|
6
|
+
requestRender?.();
|
|
7
7
|
}
|
|
8
|
-
//# sourceMappingURL=footer-render-hook.js.map
|
|
8
|
+
//# sourceMappingURL=footer-render-hook.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Brand cyan #28DCF9 — kubbisec.json `accent`, footer branch, hex `mark.ansi`. */
|
|
2
2
|
export declare const KUBBISEC_BRAND_CYAN_ANSI = "\u001B[38;2;40;220;249m";
|
|
3
3
|
export declare function kubbisecBrandFg(text: string): string;
|
|
4
|
-
//# sourceMappingURL=kubbisec-brand-fg.d.ts.map
|
|
4
|
+
//# sourceMappingURL=kubbisec-brand-fg.d.ts.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
export const KUBBISEC_BRAND_CYAN_ANSI = "\x1b[38;2;40;220;249m";
|
|
3
3
|
const ANSI_RESET = "\x1b[0m";
|
|
4
4
|
export function kubbisecBrandFg(text) {
|
|
5
|
-
|
|
5
|
+
return `${KUBBISEC_BRAND_CYAN_ANSI}${text}${ANSI_RESET}`;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=kubbisec-brand-fg.js.map
|
|
7
|
+
//# sourceMappingURL=kubbisec-brand-fg.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { EditorTheme } from "@earendil-works/pi-tui";
|
|
2
|
+
|
|
2
3
|
declare function dimText(text: string): string;
|
|
3
4
|
/** `/settings` list — current value column and cursor use brand cyan (#28DCF9). */
|
|
4
5
|
export declare function buildKubbisecSettingsListTheme(): {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
label: (text: string, selected: boolean) => string;
|
|
7
|
+
value: (text: string, _selected: boolean) => string;
|
|
8
|
+
description: typeof dimText;
|
|
9
|
+
cursor: string;
|
|
10
|
+
hint: typeof dimText;
|
|
10
11
|
};
|
|
11
12
|
/** Map Pi `accent` role to exact brand RGB (footer branch, header). */
|
|
12
13
|
export declare function patchGlobalThemeAccent(): void;
|
|
13
14
|
/** Slash-command autocomplete inside the editor — selected row uses brand cyan (#28DCF9). */
|
|
14
15
|
export declare function withKubbisecSelectListTheme(theme: EditorTheme): EditorTheme;
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=kubbisec-menu-themes.d.ts.map
|
|
16
|
+
//# sourceMappingURL=kubbisec-menu-themes.d.ts.map
|
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
import { kubbisecBrandFg } from "./kubbisec-brand-fg.js";
|
|
2
|
+
|
|
2
3
|
const brand = (text) => kubbisecBrandFg(text);
|
|
3
4
|
const PI_THEME_KEY = Symbol.for("@earendil-works/pi-coding-agent:theme");
|
|
4
5
|
function getPiThemeInstance() {
|
|
5
|
-
|
|
6
|
+
return globalThis[PI_THEME_KEY];
|
|
6
7
|
}
|
|
7
8
|
function dimText(text) {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const instance = getPiThemeInstance();
|
|
10
|
+
return instance ? instance.fg("dim", text) : text;
|
|
10
11
|
}
|
|
11
12
|
/** `/settings` list — current value column and cursor use brand cyan (#28DCF9). */
|
|
12
13
|
export function buildKubbisecSettingsListTheme() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
return {
|
|
15
|
+
label: (text, selected) => (selected ? brand(text) : text),
|
|
16
|
+
value: (text, _selected) => brand(text),
|
|
17
|
+
description: dimText,
|
|
18
|
+
cursor: brand("→ "),
|
|
19
|
+
hint: dimText,
|
|
20
|
+
};
|
|
20
21
|
}
|
|
21
22
|
/** Map Pi `accent` role to exact brand RGB (footer branch, header). */
|
|
22
23
|
export function patchGlobalThemeAccent() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
instance.__kubbisecMenuPatched = true;
|
|
24
|
+
const instance = getPiThemeInstance();
|
|
25
|
+
if (!instance || instance.__kubbisecMenuPatched) return;
|
|
26
|
+
const originalFg = instance.fg.bind(instance);
|
|
27
|
+
instance.fg = (role, text) => {
|
|
28
|
+
if (role === "accent") return brand(text);
|
|
29
|
+
return originalFg(role, text);
|
|
30
|
+
};
|
|
31
|
+
instance.__kubbisecMenuPatched = true;
|
|
33
32
|
}
|
|
34
33
|
/** Slash-command autocomplete inside the editor — selected row uses brand cyan (#28DCF9). */
|
|
35
34
|
export function withKubbisecSelectListTheme(theme) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
return {
|
|
36
|
+
...theme,
|
|
37
|
+
selectList: {
|
|
38
|
+
selectedPrefix: brand,
|
|
39
|
+
selectedText: brand,
|
|
40
|
+
description: theme.selectList.description,
|
|
41
|
+
scrollInfo: theme.selectList.scrollInfo,
|
|
42
|
+
noMatch: theme.selectList.noMatch,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
46
45
|
}
|
|
47
|
-
//# sourceMappingURL=kubbisec-menu-themes.js.map
|
|
46
|
+
//# sourceMappingURL=kubbisec-menu-themes.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const KUBBISEC_THEME_NAME = "kubbisec";
|
|
2
|
-
//# sourceMappingURL=kubbisec-theme-name.d.ts.map
|
|
2
|
+
//# sourceMappingURL=kubbisec-theme-name.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const KUBBISEC_THEME_NAME = "kubbisec";
|
|
2
|
-
//# sourceMappingURL=kubbisec-theme-name.js.map
|
|
2
|
+
//# sourceMappingURL=kubbisec-theme-name.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Runtime patch for Pi `/settings` current-value column (deep import via require.resolve). */
|
|
2
2
|
export declare function patchPiSettingsListTheme(): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=patch-pi-settings-theme.runtime.d.ts.map
|
|
3
|
+
//# sourceMappingURL=patch-pi-settings-theme.runtime.d.ts.map
|
|
@@ -3,14 +3,15 @@ import { pathToFileURL } from "node:url";
|
|
|
3
3
|
import { buildKubbisecSettingsListTheme } from "./kubbisec-menu-themes.js";
|
|
4
4
|
/** Runtime patch for Pi `/settings` current-value column (deep import via require.resolve). */
|
|
5
5
|
export async function patchPiSettingsListTheme() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
try {
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const themePath = require.resolve(
|
|
9
|
+
"@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js",
|
|
10
|
+
);
|
|
11
|
+
const themeMod = await import(pathToFileURL(themePath).href);
|
|
12
|
+
themeMod.getSettingsListTheme = buildKubbisecSettingsListTheme;
|
|
13
|
+
} catch {
|
|
14
|
+
// Pi bundle layout differs — accent patch still applies to selected rows.
|
|
15
|
+
}
|
|
15
16
|
}
|
|
16
|
-
//# sourceMappingURL=patch-pi-settings-theme.runtime.js.map
|
|
17
|
+
//# sourceMappingURL=patch-pi-settings-theme.runtime.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type CompactHeaderTheme = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
fg: (role: string, text: string) => string;
|
|
3
|
+
bold: (text: string) => string;
|
|
4
4
|
};
|
|
5
5
|
/** Works from `dist/theme/` and from materialized `<cwd>/.pi/theme/`. */
|
|
6
6
|
export declare function resolveTerminalAssetsDir(moduleUrl?: string): string;
|
|
@@ -16,6 +16,14 @@ export declare function renderHeaderHintsLine(theme: CompactHeaderTheme): string
|
|
|
16
16
|
/** Single-line brand row: mark + wordmark + version + subtitle. */
|
|
17
17
|
export declare function renderCompactHeaderLine(theme: CompactHeaderTheme, version: string): string;
|
|
18
18
|
/** Default chat chrome: hex block, wordmark, version, spacer, subtitle, hints. */
|
|
19
|
-
export declare function renderCompactHeaderLines(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
export declare function renderCompactHeaderLines(
|
|
20
|
+
theme: CompactHeaderTheme,
|
|
21
|
+
version: string,
|
|
22
|
+
width?: number,
|
|
23
|
+
): string[];
|
|
24
|
+
export declare function renderChatHeaderLines(
|
|
25
|
+
theme: CompactHeaderTheme,
|
|
26
|
+
version: string,
|
|
27
|
+
width: number,
|
|
28
|
+
): string[];
|
|
29
|
+
//# sourceMappingURL=render-compact-header.d.ts.map
|
|
@@ -1,197 +1,195 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
KUBBISEC_HEADER_HINTS_COMMANDS,
|
|
6
|
+
KUBBISEC_HEADER_HINTS_SKILL,
|
|
7
|
+
KUBBISEC_SUBTITLE_LINE,
|
|
8
|
+
KUBBISEC_WORDMARK,
|
|
9
|
+
} from "../copy/kubbisec-shell-copy.js";
|
|
5
10
|
import { kubbisecBrandFg } from "./kubbisec-brand-fg.js";
|
|
11
|
+
|
|
6
12
|
const FALLBACK_MARK = "◆";
|
|
7
13
|
const EMBEDDED_WORDMARK = /\s+K\s+U\s+B\s+B\s+I\s+S\s+E\s+C\s*$/i;
|
|
8
14
|
/** Works from `dist/theme/` and from materialized `<cwd>/.pi/theme/`. */
|
|
9
15
|
export function resolveTerminalAssetsDir(moduleUrl = import.meta.url) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
16
|
+
const here = path.dirname(fileURLToPath(moduleUrl));
|
|
17
|
+
const candidates = [
|
|
18
|
+
path.join(here, "../assets/terminal"),
|
|
19
|
+
path.join(here, "../../assets/terminal"),
|
|
20
|
+
];
|
|
21
|
+
for (const candidate of candidates) {
|
|
22
|
+
if (fs.existsSync(candidate)) {
|
|
23
|
+
return candidate;
|
|
19
24
|
}
|
|
20
|
-
|
|
25
|
+
}
|
|
26
|
+
return candidates[0];
|
|
21
27
|
}
|
|
22
28
|
function readAnsiFile(name) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.filter((l) => l.length > 0);
|
|
29
|
+
const file = path.join(resolveTerminalAssetsDir(), name);
|
|
30
|
+
if (!fs.existsSync(file)) return null;
|
|
31
|
+
return fs
|
|
32
|
+
.readFileSync(file, "utf8")
|
|
33
|
+
.split("\n")
|
|
34
|
+
.map((l) => l.replace(/\r$/, ""))
|
|
35
|
+
.filter((l) => l.length > 0);
|
|
31
36
|
}
|
|
32
37
|
function isVerboseBrand() {
|
|
33
|
-
|
|
38
|
+
return process.env.KUBBISEC_TUI_VERBOSE === "1";
|
|
34
39
|
}
|
|
35
40
|
export function stripAnsi(value) {
|
|
36
|
-
|
|
41
|
+
return value.replace(/\x1b\[[0-9;]*m/g, "");
|
|
37
42
|
}
|
|
38
43
|
export function visibleWidth(text) {
|
|
39
|
-
|
|
44
|
+
return stripAnsi(text).length;
|
|
40
45
|
}
|
|
41
46
|
export function centerLine(text, width) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const pad = Math.floor((width - lineWidth) / 2);
|
|
48
|
-
return `${" ".repeat(pad)}${text}`;
|
|
47
|
+
if (width <= 0) return text;
|
|
48
|
+
const lineWidth = visibleWidth(text);
|
|
49
|
+
if (lineWidth >= width) return text;
|
|
50
|
+
const pad = Math.floor((width - lineWidth) / 2);
|
|
51
|
+
return `${" ".repeat(pad)}${text}`;
|
|
49
52
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
53
|
+
function _centerLines(lines, width) {
|
|
54
|
+
return lines.map((line) => centerLine(line, width));
|
|
52
55
|
}
|
|
53
56
|
/** Center a multi-line ANSI block with uniform left padding (preserves row alignment). */
|
|
54
57
|
export function centerLinesAsBlock(lines, width) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return lines.map((line) => `${prefix}${line}`);
|
|
58
|
+
if (lines.length === 0) return [];
|
|
59
|
+
const blockWidth = Math.max(...lines.map(visibleWidth));
|
|
60
|
+
const pad = width > blockWidth ? Math.floor((width - blockWidth) / 2) : 0;
|
|
61
|
+
const prefix = " ".repeat(pad);
|
|
62
|
+
return lines.map((line) => `${prefix}${line}`);
|
|
61
63
|
}
|
|
62
64
|
/** Remove inline "K U B B I S E C" suffix from generated logo rows. */
|
|
63
65
|
export function stripEmbeddedWordmark(line) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
i = end + 1;
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
out += line[i];
|
|
82
|
-
visible += 1;
|
|
83
|
-
i += 1;
|
|
66
|
+
const plain = stripAnsi(line);
|
|
67
|
+
const match = plain.match(EMBEDDED_WORDMARK);
|
|
68
|
+
if (!match || match.index === undefined) return line.trimEnd();
|
|
69
|
+
const cutPlainLen = match.index;
|
|
70
|
+
let visible = 0;
|
|
71
|
+
let i = 0;
|
|
72
|
+
let out = "";
|
|
73
|
+
while (i < line.length && visible < cutPlainLen) {
|
|
74
|
+
if (line[i] === "\x1b") {
|
|
75
|
+
const end = line.indexOf("m", i);
|
|
76
|
+
if (end === -1) break;
|
|
77
|
+
out += line.slice(i, end + 1);
|
|
78
|
+
i = end + 1;
|
|
79
|
+
continue;
|
|
84
80
|
}
|
|
85
|
-
|
|
81
|
+
out += line[i];
|
|
82
|
+
visible += 1;
|
|
83
|
+
i += 1;
|
|
84
|
+
}
|
|
85
|
+
return out.trimEnd();
|
|
86
86
|
}
|
|
87
87
|
function symbolOnlyLines(logo) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
return logo
|
|
89
|
+
.map((line) => stripEmbeddedWordmark(line))
|
|
90
|
+
.filter((line) => stripAnsi(line).length > 0);
|
|
91
91
|
}
|
|
92
92
|
/** Read once at module load — avoids sync I/O on every TUI frame. */
|
|
93
93
|
const CACHED_MARK_LINES = readAnsiFile("mark.ansi") ?? [];
|
|
94
94
|
const CACHED_WORDMARK_INLINE = readAnsiFile("wordmark-inline.ansi");
|
|
95
95
|
/** Pi TUI widgets do not render iTerm 1337 inline PNGs — opt-in only. */
|
|
96
96
|
function isInlineWordmarkEnabled() {
|
|
97
|
-
|
|
97
|
+
return process.env.KUBBISEC_TUI_INLINE_IMAGES === "1";
|
|
98
98
|
}
|
|
99
99
|
/** Brand cyan — same RGB as footer branch (`#28DCF9`). */
|
|
100
100
|
function brandText(_theme, text) {
|
|
101
|
-
|
|
101
|
+
return kubbisecBrandFg(text);
|
|
102
102
|
}
|
|
103
103
|
function renderSpacedWordmarkFallback(theme) {
|
|
104
|
-
|
|
104
|
+
return brandText(theme, KUBBISEC_WORDMARK.split("").join(" "));
|
|
105
105
|
}
|
|
106
106
|
/** Centered hex mark only — never inline logotipo with embedded wordmark. */
|
|
107
107
|
function loadSymbolBlock(verbose) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return symbolOnlyLines(logo);
|
|
113
|
-
}
|
|
108
|
+
if (verbose) {
|
|
109
|
+
for (const name of ["logotipo-wide-fallback.ansi", "mark.ansi"]) {
|
|
110
|
+
const logo = readAnsiFile(name);
|
|
111
|
+
if (logo?.length) return symbolOnlyLines(logo);
|
|
114
112
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
}
|
|
114
|
+
const mark = readAnsiFile("mark.ansi");
|
|
115
|
+
if (mark?.length) return mark;
|
|
116
|
+
return null;
|
|
119
117
|
}
|
|
120
118
|
function renderWordmarkLine(theme, width) {
|
|
121
|
-
|
|
119
|
+
return centerLine(theme.bold(theme.fg("accent", KUBBISEC_WORDMARK)), width);
|
|
122
120
|
}
|
|
123
121
|
function renderVersionLine(theme, version) {
|
|
124
|
-
|
|
122
|
+
return theme.fg("dim", `v${version}`);
|
|
125
123
|
}
|
|
126
124
|
/** Hints row with brand cyan on `@skill` and dim example + commands. */
|
|
127
125
|
export function renderHeaderHintsLine(theme) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
const [skillToken, ...exampleParts] = KUBBISEC_HEADER_HINTS_SKILL.split(/\s+/);
|
|
127
|
+
const example = exampleParts.join(" ");
|
|
128
|
+
const skill = brandText(theme, skillToken ?? "@skill");
|
|
129
|
+
const exampleLabel = example ? theme.fg("dim", ` ${example}`) : "";
|
|
130
|
+
const separator = theme.fg("dim", " · ");
|
|
131
|
+
const commands = theme.fg("dim", KUBBISEC_HEADER_HINTS_COMMANDS);
|
|
132
|
+
return `${skill}${exampleLabel}${separator}${commands}`;
|
|
135
133
|
}
|
|
136
134
|
function appendSubtitleAndHints(theme, lines, width) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
return [
|
|
136
|
+
...lines,
|
|
137
|
+
centerLine(brandText(theme, KUBBISEC_SUBTITLE_LINE), width),
|
|
138
|
+
centerLine(renderHeaderHintsLine(theme), width),
|
|
139
|
+
];
|
|
142
140
|
}
|
|
143
141
|
function renderStackedBrandBlock(theme, version, width, verbose) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return appendSubtitleAndHints(theme, lines, width);
|
|
142
|
+
const symbol = loadSymbolBlock(verbose);
|
|
143
|
+
const lines = [];
|
|
144
|
+
if (symbol?.length) {
|
|
145
|
+
lines.push(...centerLinesAsBlock(symbol, width));
|
|
146
|
+
} else {
|
|
147
|
+
lines.push(centerLine(theme.fg("accent", FALLBACK_MARK), width));
|
|
148
|
+
}
|
|
149
|
+
lines.push("");
|
|
150
|
+
lines.push(renderWordmarkLine(theme, width));
|
|
151
|
+
lines.push(centerLine(renderVersionLine(theme, version), width));
|
|
152
|
+
lines.push("");
|
|
153
|
+
return appendSubtitleAndHints(theme, lines, width);
|
|
157
154
|
}
|
|
158
155
|
/** Single-line brand row: mark + wordmark + version + subtitle. */
|
|
159
156
|
export function renderCompactHeaderLine(theme, version) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
const mark = theme.fg("accent", FALLBACK_MARK);
|
|
158
|
+
const subtitle = theme.fg("dim", ` · ${KUBBISEC_SUBTITLE_LINE}`);
|
|
159
|
+
return `${mark} ${theme.bold(theme.fg("accent", KUBBISEC_WORDMARK))} ${renderVersionLine(theme, version)}${subtitle}`;
|
|
163
160
|
}
|
|
164
161
|
function renderWordmarkBlock(theme, version, width) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
const wordmark =
|
|
163
|
+
isInlineWordmarkEnabled() && CACHED_WORDMARK_INLINE?.[0]
|
|
164
|
+
? CACHED_WORDMARK_INLINE[0]
|
|
165
|
+
: renderSpacedWordmarkFallback(theme);
|
|
166
|
+
return [centerLine(wordmark, width), centerLine(renderVersionLine(theme, version), width)];
|
|
169
167
|
}
|
|
170
168
|
/** Default chat chrome: hex block, wordmark, version, spacer, subtitle, hints. */
|
|
171
169
|
export function renderCompactHeaderLines(theme, version, width = 80) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return [
|
|
176
|
-
centerLine(renderCompactHeaderLine(theme, version), width),
|
|
177
|
-
"",
|
|
178
|
-
subtitleLine,
|
|
179
|
-
hintsLine,
|
|
180
|
-
];
|
|
181
|
-
}
|
|
170
|
+
const hintsLine = centerLine(renderHeaderHintsLine(theme), width);
|
|
171
|
+
const subtitleLine = centerLine(brandText(theme, KUBBISEC_SUBTITLE_LINE), width);
|
|
172
|
+
if (CACHED_MARK_LINES.length === 0) {
|
|
182
173
|
return [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
subtitleLine,
|
|
188
|
-
hintsLine,
|
|
174
|
+
centerLine(renderCompactHeaderLine(theme, version), width),
|
|
175
|
+
"",
|
|
176
|
+
subtitleLine,
|
|
177
|
+
hintsLine,
|
|
189
178
|
];
|
|
179
|
+
}
|
|
180
|
+
return [
|
|
181
|
+
...centerLinesAsBlock(CACHED_MARK_LINES, width),
|
|
182
|
+
"",
|
|
183
|
+
...renderWordmarkBlock(theme, version, width),
|
|
184
|
+
"",
|
|
185
|
+
subtitleLine,
|
|
186
|
+
hintsLine,
|
|
187
|
+
];
|
|
190
188
|
}
|
|
191
189
|
export function renderChatHeaderLines(theme, version, width) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
if (isVerboseBrand()) {
|
|
191
|
+
return renderStackedBrandBlock(theme, version, width, true);
|
|
192
|
+
}
|
|
193
|
+
return renderCompactHeaderLines(theme, version, width);
|
|
196
194
|
}
|
|
197
|
-
//# sourceMappingURL=render-compact-header.js.map
|
|
195
|
+
//# sourceMappingURL=render-compact-header.js.map
|
|
@@ -7,4 +7,4 @@ export declare function resetSessionWorkflowMode(): void;
|
|
|
7
7
|
/** Plain footer badge (no ANSI); null when default mode. */
|
|
8
8
|
export declare function getSessionWorkflowFooterBadge(): string | null;
|
|
9
9
|
export declare function onSessionWorkflowStatusChange(listener: () => void): () => void;
|
|
10
|
-
//# sourceMappingURL=session-workflow-mode.d.ts.map
|
|
10
|
+
//# sourceMappingURL=session-workflow-mode.d.ts.map
|
|
@@ -2,50 +2,50 @@ let sessionMode = "default";
|
|
|
2
2
|
let specApproved = false;
|
|
3
3
|
let statusChangeListener;
|
|
4
4
|
export function getSessionWorkflowMode() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return sessionMode;
|
|
5
|
+
const env = process.env.KUBBISEC_CHAT_MODE?.trim().toLowerCase();
|
|
6
|
+
if (env === "plan" || env === "review") return env;
|
|
7
|
+
return sessionMode;
|
|
9
8
|
}
|
|
10
9
|
export function isSessionSpecApproved() {
|
|
11
|
-
|
|
10
|
+
return specApproved;
|
|
12
11
|
}
|
|
13
12
|
export function setSessionWorkflowMode(mode) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
sessionMode = mode;
|
|
14
|
+
if (mode === "plan" || mode === "review") {
|
|
15
|
+
process.env.KUBBISEC_CHAT_MODE = mode;
|
|
16
|
+
} else if (
|
|
17
|
+
process.env.KUBBISEC_CHAT_MODE === "plan" ||
|
|
18
|
+
process.env.KUBBISEC_CHAT_MODE === "review"
|
|
19
|
+
) {
|
|
20
|
+
delete process.env.KUBBISEC_CHAT_MODE;
|
|
21
|
+
}
|
|
22
|
+
statusChangeListener?.();
|
|
23
23
|
}
|
|
24
24
|
export function setSessionSpecApproved(approved) {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
specApproved = approved;
|
|
26
|
+
statusChangeListener?.();
|
|
27
27
|
}
|
|
28
28
|
export function resetSessionWorkflowMode() {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
sessionMode = "default";
|
|
30
|
+
specApproved = false;
|
|
31
31
|
}
|
|
32
32
|
/** Plain footer badge (no ANSI); null when default mode. */
|
|
33
33
|
export function getSessionWorkflowFooterBadge() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
const mode = getSessionWorkflowMode();
|
|
35
|
+
if (mode === "plan") {
|
|
36
|
+
return specApproved ? "@plan" : "@plan · gate";
|
|
37
|
+
}
|
|
38
|
+
if (mode === "review") {
|
|
39
|
+
return "review";
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
42
|
}
|
|
43
43
|
export function onSessionWorkflowStatusChange(listener) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
statusChangeListener = listener;
|
|
45
|
+
return () => {
|
|
46
|
+
if (statusChangeListener === listener) {
|
|
47
|
+
statusChangeListener = undefined;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
50
|
}
|
|
51
|
-
//# sourceMappingURL=session-workflow-mode.js.map
|
|
51
|
+
//# sourceMappingURL=session-workflow-mode.js.map
|