@selesai/code 0.2.1 → 0.3.0
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/dist/config.d.ts +4 -15
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -45
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +8 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/model-registry.d.ts +4 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +101 -51
- package/dist/core/model-registry.js.map +1 -1
- package/dist/defaults/models.json +64 -113
- package/dist/extensions/copy-turn.ts +2 -2
- package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +2 -2
- package/dist/extensions/pi-powerline-footer/index.ts +31 -31
- package/dist/extensions/pi-powerline-footer/package.json +2 -2
- package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +10 -10
- package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +1 -1
- package/dist/extensions/pi-powerline-footer/tests/working-vibes.test.ts +2 -2
- package/dist/extensions/pi-powerline-footer/theme.ts +6 -6
- package/dist/extensions/pi-powerline-footer/tps.ts +1 -1
- package/dist/extensions/pi-powerline-footer/types.ts +7 -7
- package/dist/extensions/pi-powerline-footer/working-vibes.ts +51 -51
- package/dist/extensions/pi-subagents/agents/architect.md +188 -0
- package/dist/extensions/pi-subagents/agents/builder.md +120 -0
- package/dist/extensions/pi-subagents/agents/commentator.md +131 -0
- package/dist/extensions/pi-subagents/agents/explorer.md +51 -0
- package/dist/extensions/pi-subagents/agents/recapper.md +21 -0
- package/dist/extensions/pi-subagents/src/shared/utils.ts +9 -3
- package/dist/extensions/pi-web-agent/package.json +2 -2
- package/dist/extensions/pi-web-agent/src/backends/settings-reader.ts +2 -2
- package/dist/extensions/pi-web-agent/src/commands/web-agent-config.ts +1 -1
- package/dist/extensions/pi-web-agent/src/extension.ts +1 -1
- package/dist/extensions/pi-web-agent/src/presentation/config-store.ts +1 -1
- package/dist/extensions/question/helpers.ts +3 -3
- package/dist/extensions/question/index.ts +2 -2
- package/dist/extensions/question/navigation.ts +2 -2
- package/dist/extensions/question/package.json +2 -2
- package/dist/extensions/question/question-list.ts +2 -2
- package/dist/extensions/question/tests/question-list.test.ts +2 -2
- package/dist/extensions/question/tui-adapter.ts +2 -2
- package/dist/extensions/question/types.ts +2 -2
- package/dist/extensions/question/ui-protocol.ts +2 -2
- package/dist/extensions/rtk.ts +2 -2
- package/dist/extensions/tokenin-onboarding.ts +2 -2
- package/dist/extensions/undo.ts +1 -1
- package/dist/extensions/web-agent-onboarding.ts +3 -3
- package/dist/extensions/workflow/adapter.ts +16 -8
- package/dist/extensions/workflow/extension.ts +1 -1
- package/dist/extensions/workflow/package.json +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +2 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/utils/thinking-tags.d.ts +7 -0
- package/dist/utils/thinking-tags.d.ts.map +1 -0
- package/dist/utils/thinking-tags.js +63 -0
- package/dist/utils/thinking-tags.js.map +1 -0
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type ExtensionAPI,
|
|
4
4
|
type ReadonlyFooterDataProvider,
|
|
5
5
|
type Theme,
|
|
6
|
-
} from "@
|
|
6
|
+
} from "@selesai/code";
|
|
7
7
|
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
8
8
|
import { isKeyRelease, matchesKey, type AutocompleteProvider, type SelectItem, SelectList, truncateToWidth, TUI_KEYBINDINGS, visibleWidth } from "@earendil-works/pi-tui";
|
|
9
9
|
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from "node:fs";
|
|
@@ -44,9 +44,9 @@ import {
|
|
|
44
44
|
shortcutUsesSuper,
|
|
45
45
|
} from "./shortcuts.ts";
|
|
46
46
|
import {
|
|
47
|
-
initVibeManager,
|
|
48
|
-
onVibeBeforeAgentStart,
|
|
49
|
-
onVibeAgentStart,
|
|
47
|
+
initVibeManager,
|
|
48
|
+
onVibeBeforeAgentStart,
|
|
49
|
+
onVibeAgentStart,
|
|
50
50
|
onVibeAgentEnd,
|
|
51
51
|
onVibeToolCall,
|
|
52
52
|
getVibeTheme,
|
|
@@ -885,7 +885,7 @@ function computeResponsiveLayout(
|
|
|
885
885
|
): { topContent: string; secondaryContent: string } {
|
|
886
886
|
const separatorDef = getSeparator(presetDef.separator);
|
|
887
887
|
const sepWidth = visibleWidth(separatorDef.left); // separator, no surrounding spaces
|
|
888
|
-
|
|
888
|
+
|
|
889
889
|
const mergedSegments = mergeSegmentsWithCustomItems(presetDef, config.customItems);
|
|
890
890
|
const renderIds = (ids: StatusLineSegmentId[]): string[] => {
|
|
891
891
|
const parts: string[] = [];
|
|
@@ -956,7 +956,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
956
956
|
let bashTranscript = new BashTranscriptStore(bashModeSettings);
|
|
957
957
|
let bashCompletionEngine = new BashCompletionEngine();
|
|
958
958
|
let shellSession: ManagedShellSession | null = null;
|
|
959
|
-
|
|
959
|
+
|
|
960
960
|
// Cache for the top and secondary powerline widgets.
|
|
961
961
|
let lastLayoutWidth = 0;
|
|
962
962
|
let lastLayoutResult: { topContent: string; secondaryContent: string } | null = null;
|
|
@@ -1208,10 +1208,10 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1208
1208
|
if (ctx.hasUI) {
|
|
1209
1209
|
ctx.ui.setStatus("stash", undefined);
|
|
1210
1210
|
}
|
|
1211
|
-
|
|
1211
|
+
|
|
1212
1212
|
// Initialize vibe manager (needs modelRegistry from ctx)
|
|
1213
1213
|
initVibeManager(ctx);
|
|
1214
|
-
|
|
1214
|
+
|
|
1215
1215
|
if (enabled && ctx.hasUI) {
|
|
1216
1216
|
setupCustomEditor(ctx);
|
|
1217
1217
|
if (event.reason === "startup") {
|
|
@@ -1369,18 +1369,18 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1369
1369
|
onVibeToolCall(event.toolName, event.input, ctx.ui.setWorkingMessage, agentContext);
|
|
1370
1370
|
}
|
|
1371
1371
|
});
|
|
1372
|
-
|
|
1372
|
+
|
|
1373
1373
|
// Helper to extract recent agent response text (skipping thinking blocks)
|
|
1374
1374
|
function getRecentAgentContext(ctx: any): string | undefined {
|
|
1375
1375
|
const sessionEvents = ctx.sessionManager?.getBranch?.() ?? [];
|
|
1376
|
-
|
|
1376
|
+
|
|
1377
1377
|
// Find the most recent assistant message
|
|
1378
1378
|
for (let i = sessionEvents.length - 1; i >= 0; i--) {
|
|
1379
1379
|
const e = sessionEvents[i];
|
|
1380
1380
|
if (e.type === "message" && e.message?.role === "assistant") {
|
|
1381
1381
|
const content = e.message.content;
|
|
1382
1382
|
if (!Array.isArray(content)) continue;
|
|
1383
|
-
|
|
1383
|
+
|
|
1384
1384
|
// Extract text content, skip thinking blocks
|
|
1385
1385
|
for (const block of content) {
|
|
1386
1386
|
if (block.type === "text" && block.text) {
|
|
@@ -1690,7 +1690,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1690
1690
|
handler: async (args, ctx) => {
|
|
1691
1691
|
// Update context reference (command ctx may have more methods)
|
|
1692
1692
|
currentCtx = ctx;
|
|
1693
|
-
|
|
1693
|
+
|
|
1694
1694
|
if (!args?.trim()) {
|
|
1695
1695
|
// Toggle
|
|
1696
1696
|
enabled = !enabled;
|
|
@@ -1910,7 +1910,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1910
1910
|
handler: async (args, ctx) => {
|
|
1911
1911
|
const parts = args?.trim().split(/\s+/) || [];
|
|
1912
1912
|
const subcommand = parts[0]?.toLowerCase();
|
|
1913
|
-
|
|
1913
|
+
|
|
1914
1914
|
// No args: show current status
|
|
1915
1915
|
if (!args || !args.trim()) {
|
|
1916
1916
|
const theme = getVibeTheme();
|
|
@@ -1924,7 +1924,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1924
1924
|
ctx.ui.notify(status, "info");
|
|
1925
1925
|
return;
|
|
1926
1926
|
}
|
|
1927
|
-
|
|
1927
|
+
|
|
1928
1928
|
// /vibe model [spec] - show or set model
|
|
1929
1929
|
if (subcommand === "model") {
|
|
1930
1930
|
const modelSpec = parts.slice(1).join(" ");
|
|
@@ -1945,7 +1945,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1945
1945
|
}
|
|
1946
1946
|
return;
|
|
1947
1947
|
}
|
|
1948
|
-
|
|
1948
|
+
|
|
1949
1949
|
// /vibe mode [generate|file] - show or set mode
|
|
1950
1950
|
if (subcommand === "mode") {
|
|
1951
1951
|
const newMode = parts[1]?.toLowerCase();
|
|
@@ -1971,7 +1971,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
return;
|
|
1973
1973
|
}
|
|
1974
|
-
|
|
1974
|
+
|
|
1975
1975
|
// /vibe generate <theme> [count] - generate vibes and save to file
|
|
1976
1976
|
if (subcommand === "generate") {
|
|
1977
1977
|
const theme = parts[1];
|
|
@@ -1988,7 +1988,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1988
1988
|
ctx.ui.notify(`Generating ${count} vibes for "${theme}"...`, "info");
|
|
1989
1989
|
|
|
1990
1990
|
const result = await generateVibesBatch(theme, count);
|
|
1991
|
-
|
|
1991
|
+
|
|
1992
1992
|
if (result.success) {
|
|
1993
1993
|
ctx.ui.notify(`Generated ${result.count} vibes for "${theme}" → ${result.filePath}`, "info");
|
|
1994
1994
|
} else {
|
|
@@ -1996,7 +1996,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1996
1996
|
}
|
|
1997
1997
|
return;
|
|
1998
1998
|
}
|
|
1999
|
-
|
|
1999
|
+
|
|
2000
2000
|
// /vibe off - disable
|
|
2001
2001
|
if (subcommand === "off") {
|
|
2002
2002
|
const persisted = setVibeTheme(null);
|
|
@@ -2007,7 +2007,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2007
2007
|
}
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
|
-
|
|
2010
|
+
|
|
2011
2011
|
// /vibe <theme> - set theme (preserve original casing)
|
|
2012
2012
|
const theme = args.trim();
|
|
2013
2013
|
const persisted = setVibeTheme(theme);
|
|
@@ -2046,7 +2046,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2046
2046
|
let input = 0, output = 0, cacheRead = 0, cacheWrite = 0, cost = 0;
|
|
2047
2047
|
let lastAssistant: AssistantMessage | undefined;
|
|
2048
2048
|
let thinkingLevelFromSession: string | null = null;
|
|
2049
|
-
|
|
2049
|
+
|
|
2050
2050
|
const sessionEvents = ctx.sessionManager?.getBranch?.() ?? [];
|
|
2051
2051
|
for (const e of sessionEvents) {
|
|
2052
2052
|
if (!isRecord(e)) {
|
|
@@ -2145,17 +2145,17 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2145
2145
|
return lastLayoutResult;
|
|
2146
2146
|
}
|
|
2147
2147
|
}
|
|
2148
|
-
|
|
2148
|
+
|
|
2149
2149
|
const presetDef = getPreset(config.preset);
|
|
2150
2150
|
const segmentCtx = buildSegmentContext(currentCtx, theme);
|
|
2151
|
-
|
|
2151
|
+
|
|
2152
2152
|
lastLayoutWidth = width;
|
|
2153
2153
|
lastLayoutResult = computeResponsiveLayout(segmentCtx, presetDef, width);
|
|
2154
2154
|
lastLayoutSessionName = currentSessionName;
|
|
2155
2155
|
lastLayoutTimestamp = now;
|
|
2156
2156
|
layoutDirty = false;
|
|
2157
2157
|
forceNextLayoutRecompute = false;
|
|
2158
|
-
|
|
2158
|
+
|
|
2159
2159
|
return lastLayoutResult;
|
|
2160
2160
|
}
|
|
2161
2161
|
|
|
@@ -2717,10 +2717,10 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2717
2717
|
const providerName = ctx.model?.provider || "Unknown";
|
|
2718
2718
|
const loadedCounts = discoverLoadedCounts();
|
|
2719
2719
|
const recentSessions = getRecentSessions(3);
|
|
2720
|
-
|
|
2720
|
+
|
|
2721
2721
|
const header = new WelcomeHeader(modelName, providerName, recentSessions, loadedCounts);
|
|
2722
2722
|
welcomeHeaderActive = true;
|
|
2723
|
-
|
|
2723
|
+
|
|
2724
2724
|
ctx.ui.setHeader(() => {
|
|
2725
2725
|
return {
|
|
2726
2726
|
render(width: number): string[] {
|
|
@@ -2738,7 +2738,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2738
2738
|
const providerName = ctx.model?.provider || "Unknown";
|
|
2739
2739
|
const loadedCounts = discoverLoadedCounts();
|
|
2740
2740
|
const recentSessions = getRecentSessions(3);
|
|
2741
|
-
|
|
2741
|
+
|
|
2742
2742
|
const overlaySessionGeneration = sessionGeneration;
|
|
2743
2743
|
|
|
2744
2744
|
// Small delay to let pi-mono finish initialization
|
|
@@ -2747,7 +2747,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2747
2747
|
welcomeOverlayShouldDismiss = false;
|
|
2748
2748
|
return;
|
|
2749
2749
|
}
|
|
2750
|
-
|
|
2750
|
+
|
|
2751
2751
|
const sessionEvents = ctx.sessionManager?.getBranch?.() ?? [];
|
|
2752
2752
|
const hasActivity = sessionEvents.some((entry: unknown) => {
|
|
2753
2753
|
if (!isRecord(entry)) return false;
|
|
@@ -2757,7 +2757,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2757
2757
|
if (hasActivity) {
|
|
2758
2758
|
return;
|
|
2759
2759
|
}
|
|
2760
|
-
|
|
2760
|
+
|
|
2761
2761
|
ctx.ui.custom(
|
|
2762
2762
|
(tui: any, _theme: any, _keybindings: any, done: (result: void) => void) => {
|
|
2763
2763
|
const welcome = new WelcomeComponent(
|
|
@@ -2766,11 +2766,11 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2766
2766
|
recentSessions,
|
|
2767
2767
|
loadedCounts,
|
|
2768
2768
|
);
|
|
2769
|
-
|
|
2769
|
+
|
|
2770
2770
|
let countdown = 30;
|
|
2771
2771
|
let dismissed = false;
|
|
2772
2772
|
let interval: ReturnType<typeof setInterval> | null = null;
|
|
2773
|
-
|
|
2773
|
+
|
|
2774
2774
|
const dismiss = () => {
|
|
2775
2775
|
if (dismissed) return;
|
|
2776
2776
|
dismissed = true;
|
|
@@ -2778,7 +2778,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2778
2778
|
dismissWelcomeOverlay = null;
|
|
2779
2779
|
done();
|
|
2780
2780
|
};
|
|
2781
|
-
|
|
2781
|
+
|
|
2782
2782
|
interval = setInterval(() => {
|
|
2783
2783
|
if (dismissed) return;
|
|
2784
2784
|
countdown--;
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@earendil-works/pi-ai": "^0.75.0",
|
|
33
|
-
"@
|
|
33
|
+
"@selesai/code": "*",
|
|
34
34
|
"@earendil-works/pi-tui": "^0.75.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@earendil-works/pi-ai": "^0.75.0",
|
|
38
|
-
"@
|
|
38
|
+
"@selesai/code": "^0.1.0",
|
|
39
39
|
"@earendil-works/pi-tui": "^0.75.0"
|
|
40
40
|
},
|
|
41
41
|
"pi": {
|
|
@@ -29,11 +29,11 @@ function ensureEditorModuleLinks(): { cleanup: () => void } {
|
|
|
29
29
|
const links = [
|
|
30
30
|
{
|
|
31
31
|
link: join(nodeModulesDir, "pi-coding-agent"),
|
|
32
|
-
target: "/opt/homebrew/lib/node_modules/@
|
|
32
|
+
target: "/opt/homebrew/lib/node_modules/@selesai/code",
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
link: join(nodeModulesDir, "pi-tui"),
|
|
36
|
-
target: "/opt/homebrew/lib/node_modules/@
|
|
36
|
+
target: "/opt/homebrew/lib/node_modules/@selesai/code/node_modules/@earendil-works/pi-tui",
|
|
37
37
|
},
|
|
38
38
|
];
|
|
39
39
|
|
|
@@ -559,7 +559,7 @@ test("bash editor does not submit pasted multiline input while bracketed paste i
|
|
|
559
559
|
|
|
560
560
|
try {
|
|
561
561
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
562
|
-
const { CustomEditor } = await import(new URL("../node_modules/@
|
|
562
|
+
const { CustomEditor } = await import(new URL("../node_modules/@selesai/code/dist/modes/interactive/components/custom-editor.js", import.meta.url).href);
|
|
563
563
|
|
|
564
564
|
let delegated = 0;
|
|
565
565
|
let submitted = 0;
|
|
@@ -607,7 +607,7 @@ test("bash editor refreshes shell ghost state after a bracketed paste completes"
|
|
|
607
607
|
|
|
608
608
|
try {
|
|
609
609
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
610
|
-
const { CustomEditor } = await import(new URL("../node_modules/@
|
|
610
|
+
const { CustomEditor } = await import(new URL("../node_modules/@selesai/code/dist/modes/interactive/components/custom-editor.js", import.meta.url).href);
|
|
611
611
|
|
|
612
612
|
let delegated = 0;
|
|
613
613
|
let scheduled = 0;
|
|
@@ -666,7 +666,7 @@ test("bash editor inserts Finder file drops as path strings", async () => {
|
|
|
666
666
|
|
|
667
667
|
try {
|
|
668
668
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
669
|
-
const { KeybindingsManager } = await import(new URL("../node_modules/@
|
|
669
|
+
const { KeybindingsManager } = await import(new URL("../node_modules/@selesai/code/dist/core/keybindings.js", import.meta.url).href);
|
|
670
670
|
const keybindings = KeybindingsManager.create();
|
|
671
671
|
let scheduled = 0;
|
|
672
672
|
const editor = new BashModeEditor(
|
|
@@ -988,7 +988,7 @@ test("bash editor runs copied Pi app action handlers for alt-enter", async () =>
|
|
|
988
988
|
|
|
989
989
|
try {
|
|
990
990
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
991
|
-
const { KeybindingsManager } = await import(new URL("../node_modules/@
|
|
991
|
+
const { KeybindingsManager } = await import(new URL("../node_modules/@selesai/code/dist/core/keybindings.js", import.meta.url).href);
|
|
992
992
|
const { setKittyProtocolActive } = await import(new URL("../node_modules/@earendil-works/pi-tui/dist/keys.js", import.meta.url).href);
|
|
993
993
|
const keybindings = KeybindingsManager.create();
|
|
994
994
|
const editor = new BashModeEditor(
|
|
@@ -1034,7 +1034,7 @@ test("bash editor command-z undoes deleted text for supported encodings only", a
|
|
|
1034
1034
|
|
|
1035
1035
|
try {
|
|
1036
1036
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
1037
|
-
const { KeybindingsManager } = await import(new URL("../node_modules/@
|
|
1037
|
+
const { KeybindingsManager } = await import(new URL("../node_modules/@selesai/code/dist/core/keybindings.js", import.meta.url).href);
|
|
1038
1038
|
const keybindings = KeybindingsManager.create();
|
|
1039
1039
|
const createEditor = (options: {
|
|
1040
1040
|
keybindings?: typeof keybindings;
|
|
@@ -1124,7 +1124,7 @@ test("bash editor command-z resets shell history and updates ghost state", async
|
|
|
1124
1124
|
|
|
1125
1125
|
try {
|
|
1126
1126
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
1127
|
-
const { KeybindingsManager } = await import(new URL("../node_modules/@
|
|
1127
|
+
const { KeybindingsManager } = await import(new URL("../node_modules/@selesai/code/dist/core/keybindings.js", import.meta.url).href);
|
|
1128
1128
|
const keybindings = KeybindingsManager.create();
|
|
1129
1129
|
const createEditor = (options: {
|
|
1130
1130
|
isBashModeActive?: () => boolean;
|
|
@@ -1183,7 +1183,7 @@ test("bash editor command arrows jump to editor boundaries", async () => {
|
|
|
1183
1183
|
|
|
1184
1184
|
try {
|
|
1185
1185
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
1186
|
-
const { KeybindingsManager } = await import(new URL("../node_modules/@
|
|
1186
|
+
const { KeybindingsManager } = await import(new URL("../node_modules/@selesai/code/dist/core/keybindings.js", import.meta.url).href);
|
|
1187
1187
|
const keybindings = KeybindingsManager.create();
|
|
1188
1188
|
let renderRequests = 0;
|
|
1189
1189
|
const editor = new BashModeEditor(
|
|
@@ -1381,7 +1381,7 @@ test("one-off bang submit does not accept ghost text before submitting", async (
|
|
|
1381
1381
|
|
|
1382
1382
|
try {
|
|
1383
1383
|
const { BashModeEditor } = await import("../bash-mode/editor.ts");
|
|
1384
|
-
const { CustomEditor } = await import(new URL("../node_modules/@
|
|
1384
|
+
const { CustomEditor } = await import(new URL("../node_modules/@selesai/code/dist/modes/interactive/components/custom-editor.js", import.meta.url).href);
|
|
1385
1385
|
|
|
1386
1386
|
let delegated = 0;
|
|
1387
1387
|
const superHandleInput = CustomEditor.prototype.handleInput;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
|
-
import { KEYBINDINGS } from "../node_modules/@
|
|
4
|
+
import { KEYBINDINGS } from "../node_modules/@selesai/code/dist/core/keybindings.js";
|
|
5
5
|
import {
|
|
6
6
|
isSupportedSuperShortcut,
|
|
7
7
|
matchesConfiguredShortcut,
|
|
@@ -12,11 +12,11 @@ function ensurePiModuleLinks(): { cleanup: () => void } {
|
|
|
12
12
|
const links = [
|
|
13
13
|
{
|
|
14
14
|
link: join(nodeModulesDir, "pi-coding-agent"),
|
|
15
|
-
target: "/opt/homebrew/lib/node_modules/@
|
|
15
|
+
target: "/opt/homebrew/lib/node_modules/@selesai/code",
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
link: join(nodeModulesDir, "pi-ai"),
|
|
19
|
-
target: "/opt/homebrew/lib/node_modules/@
|
|
19
|
+
target: "/opt/homebrew/lib/node_modules/@selesai/code/node_modules/@earendil-works/pi-ai",
|
|
20
20
|
},
|
|
21
21
|
];
|
|
22
22
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme system for powerline-footer
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Colors are resolved in order:
|
|
5
5
|
* 1. User overrides from theme.json (if exists)
|
|
6
6
|
* 2. Preset colors
|
|
7
7
|
* 3. Default colors
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { Theme, ThemeColor } from "@
|
|
10
|
+
import type { Theme, ThemeColor } from "@selesai/code";
|
|
11
11
|
import { existsSync, readFileSync } from "node:fs";
|
|
12
12
|
import { join, dirname } from "node:path";
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
@@ -40,7 +40,7 @@ const DEFAULT_COLORS: Required<ColorScheme> = {
|
|
|
40
40
|
|
|
41
41
|
// Rainbow colors for high thinking levels
|
|
42
42
|
const RAINBOW_COLORS = [
|
|
43
|
-
"#b281d6", "#d787af", "#febc38", "#e4c00f",
|
|
43
|
+
"#b281d6", "#d787af", "#febc38", "#e4c00f",
|
|
44
44
|
"#89d281", "#00afaf", "#178fb9", "#b281d6",
|
|
45
45
|
];
|
|
46
46
|
|
|
@@ -137,10 +137,10 @@ export function resolveColor(
|
|
|
137
137
|
presetColors?: ColorScheme
|
|
138
138
|
): ColorValue {
|
|
139
139
|
const userTheme = loadUserTheme();
|
|
140
|
-
|
|
140
|
+
|
|
141
141
|
// Priority: user overrides > preset colors > defaults
|
|
142
|
-
return userTheme[semantic]
|
|
143
|
-
?? presetColors?.[semantic]
|
|
142
|
+
return userTheme[semantic]
|
|
143
|
+
?? presetColors?.[semantic]
|
|
144
144
|
?? DEFAULT_COLORS[semantic];
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* into a combined "main + subagents" TPS at agent_end.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type { ExtensionAPI } from "@
|
|
15
|
+
import type { ExtensionAPI } from "@selesai/code";
|
|
16
16
|
|
|
17
17
|
export function setupTpsTracker(pi: ExtensionAPI): void {
|
|
18
18
|
/** Timestamp when the current assistant message event started. Used as a fallback. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Theme, ThemeColor } from "@
|
|
1
|
+
import type { Theme, ThemeColor } from "@selesai/code";
|
|
2
2
|
|
|
3
3
|
// Theme color - either a pi theme color name or a custom hex color
|
|
4
4
|
export type ColorValue = ThemeColor | `#${string}`;
|
|
@@ -80,7 +80,7 @@ export type StatusLinePreset =
|
|
|
80
80
|
// Per-segment options
|
|
81
81
|
export interface StatusLineSegmentOptions {
|
|
82
82
|
model?: { showThinkingLevel?: boolean };
|
|
83
|
-
path?: {
|
|
83
|
+
path?: {
|
|
84
84
|
mode?: "basename" | "abbreviated" | "full";
|
|
85
85
|
maxLength?: number;
|
|
86
86
|
};
|
|
@@ -148,7 +148,7 @@ export interface SegmentContext {
|
|
|
148
148
|
sessionId: string | undefined;
|
|
149
149
|
sessionName: string | undefined;
|
|
150
150
|
cwd?: string;
|
|
151
|
-
|
|
151
|
+
|
|
152
152
|
// Computed
|
|
153
153
|
usageStats: UsageStats;
|
|
154
154
|
contextPercent: number;
|
|
@@ -161,18 +161,18 @@ export interface SegmentContext {
|
|
|
161
161
|
shellRunning: boolean;
|
|
162
162
|
shellName: string | null;
|
|
163
163
|
shellCwd: string | null;
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
// Git
|
|
166
166
|
git: GitStatus;
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
// Extension statuses
|
|
169
169
|
extensionStatuses: ReadonlyMap<string, string>;
|
|
170
170
|
hiddenExtensionStatusKeys: ReadonlySet<string>;
|
|
171
171
|
customItemsById: ReadonlyMap<string, CustomStatusItem>;
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
// Options
|
|
174
174
|
options: StatusLineSegmentOptions;
|
|
175
|
-
|
|
175
|
+
|
|
176
176
|
// Theming
|
|
177
177
|
theme: ThemeLike;
|
|
178
178
|
colors: ColorScheme;
|