openvibe 0.60.3 → 0.60.7
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/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +18 -6
- package/dist/core/skills.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +5 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/utils/version-check.d.ts +2 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +115 -0
- package/dist/utils/version-check.js.map +1 -0
- package/examples/extensions/built-in-tool-renderer.ts +1 -1
- package/examples/extensions/custom-footer.ts +1 -1
- package/examples/extensions/message-renderer.ts +1 -1
- package/examples/extensions/minimal-mode.ts +1 -1
- package/examples/extensions/modal-editor.ts +1 -1
- package/examples/extensions/overlay-qa-tests.ts +1 -1
- package/examples/extensions/overlay-test.ts +1 -1
- package/examples/extensions/plan-mode/index.ts +1 -1
- package/examples/extensions/preset.ts +1 -1
- package/examples/extensions/question.ts +1 -1
- package/examples/extensions/questionnaire.ts +1 -1
- package/examples/extensions/snake.ts +1 -1
- package/examples/extensions/space-invaders.ts +1 -1
- package/examples/extensions/subagent/index.ts +1 -1
- package/examples/extensions/summarize.ts +1 -1
- package/examples/extensions/todo.ts +1 -1
- package/examples/extensions/tools.ts +1 -1
- package/examples/extensions/truncated-tool.ts +1 -1
- package/examples/rpc-extension-ui.ts +9 -1
- package/package.json +4 -4
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
3
|
+
import { homedir } from "os";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
const CACHE_DIR = join(homedir(), ".openvibe");
|
|
6
|
+
const CACHE_FILE = join(CACHE_DIR, "version-check.json");
|
|
7
|
+
const CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours
|
|
8
|
+
function getCurrentVersion() {
|
|
9
|
+
// Read version from package.json
|
|
10
|
+
try {
|
|
11
|
+
const pkg = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf-8"));
|
|
12
|
+
return pkg.version;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return "0.0.0";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function parseVersion(version) {
|
|
19
|
+
return version.split(".").map((v) => parseInt(v, 10));
|
|
20
|
+
}
|
|
21
|
+
function isNewer(current, latest) {
|
|
22
|
+
const currentParts = parseVersion(current);
|
|
23
|
+
const latestParts = parseVersion(latest);
|
|
24
|
+
for (let i = 0; i < Math.max(currentParts.length, latestParts.length); i++) {
|
|
25
|
+
const currentPart = currentParts[i] || 0;
|
|
26
|
+
const latestPart = latestParts[i] || 0;
|
|
27
|
+
if (latestPart > currentPart)
|
|
28
|
+
return true;
|
|
29
|
+
if (latestPart < currentPart)
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
async function fetchLatestVersion() {
|
|
35
|
+
try {
|
|
36
|
+
const controller = new AbortController();
|
|
37
|
+
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
38
|
+
const response = await fetch("https://registry.npmjs.org/openvibe", {
|
|
39
|
+
signal: controller.signal,
|
|
40
|
+
});
|
|
41
|
+
clearTimeout(timeout);
|
|
42
|
+
if (!response.ok)
|
|
43
|
+
return null;
|
|
44
|
+
const data = (await response.json());
|
|
45
|
+
return data["dist-tags"]?.latest || null;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function readCache() {
|
|
52
|
+
try {
|
|
53
|
+
if (!existsSync(CACHE_FILE))
|
|
54
|
+
return null;
|
|
55
|
+
const content = readFileSync(CACHE_FILE, "utf-8");
|
|
56
|
+
return JSON.parse(content);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function writeCache(cache) {
|
|
63
|
+
try {
|
|
64
|
+
if (!existsSync(CACHE_DIR)) {
|
|
65
|
+
mkdirSync(CACHE_DIR, { recursive: true });
|
|
66
|
+
}
|
|
67
|
+
writeFileSync(CACHE_FILE, JSON.stringify(cache));
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Ignore cache write errors
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export async function checkForUpdates() {
|
|
74
|
+
const currentVersion = getCurrentVersion();
|
|
75
|
+
const cache = readCache();
|
|
76
|
+
const now = Date.now();
|
|
77
|
+
let latestVersion;
|
|
78
|
+
// Use cached version if checked recently
|
|
79
|
+
if (cache && now - cache.lastCheck < CHECK_INTERVAL) {
|
|
80
|
+
latestVersion = cache.latestVersion;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// Fetch from npm registry
|
|
84
|
+
latestVersion = await fetchLatestVersion();
|
|
85
|
+
if (latestVersion) {
|
|
86
|
+
writeCache({ lastCheck: now, latestVersion });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (latestVersion && isNewer(currentVersion, latestVersion)) {
|
|
90
|
+
console.log();
|
|
91
|
+
console.log(chalk.yellow("┌─────────────────────────────────────────────────────────┐"));
|
|
92
|
+
console.log(chalk.yellow("│") +
|
|
93
|
+
" " +
|
|
94
|
+
chalk.bold("Update Available") +
|
|
95
|
+
" " +
|
|
96
|
+
chalk.yellow("│"));
|
|
97
|
+
console.log(chalk.yellow("│") +
|
|
98
|
+
` Current: ${chalk.gray(currentVersion)}` +
|
|
99
|
+
" " +
|
|
100
|
+
chalk.yellow("│"));
|
|
101
|
+
console.log(chalk.yellow("│") +
|
|
102
|
+
` Latest: ${chalk.green(latestVersion)}` +
|
|
103
|
+
" " +
|
|
104
|
+
chalk.yellow("│"));
|
|
105
|
+
console.log(chalk.yellow("│") + " " + chalk.yellow("│"));
|
|
106
|
+
console.log(chalk.yellow("│") +
|
|
107
|
+
" Run " +
|
|
108
|
+
chalk.cyan("npm i -g openvibe") +
|
|
109
|
+
" to update " +
|
|
110
|
+
chalk.yellow("│"));
|
|
111
|
+
console.log(chalk.yellow("└─────────────────────────────────────────────────────────┘"));
|
|
112
|
+
console.log();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=version-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-check.js","sourceRoot":"","sources":["../../src/utils/version-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AACzD,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;AAOvD,SAAS,iBAAiB,GAAW;IACpC,iCAAiC;IACjC,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,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AAG,CAAC,CAAC,CAAC;QAClH,OAAO,CAAC,GAAG,CACV,KAAK,CAAC,MAAM,CAAC,KAAG,CAAC;YAChB,QAAQ;YACR,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC;YAC/B,iCAAiC;YACjC,KAAK,CAAC,MAAM,CAAC,KAAG,CAAC,CAClB,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,mLAA6D,CAAC,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;AAAA,CACD","sourcesContent":["import chalk from \"chalk\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { homedir } from \"os\";\nimport { join } from \"path\";\n\nconst CACHE_DIR = join(homedir(), \".openvibe\");\nconst CACHE_FILE = join(CACHE_DIR, \"version-check.json\");\nconst CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours\n\ninterface VersionCache {\n\tlastCheck: number;\n\tlatestVersion: string;\n}\n\nfunction getCurrentVersion(): string {\n\t// Read version from package.json\n\ttry {\n\t\tconst pkg = JSON.parse(readFileSync(new URL(\"../../package.json\", import.meta.url), \"utf-8\"));\n\t\treturn pkg.version;\n\t} catch {\n\t\treturn \"0.0.0\";\n\t}\n}\n\nfunction parseVersion(version: string): number[] {\n\treturn version.split(\".\").map((v) => parseInt(v, 10));\n}\n\nfunction isNewer(current: string, latest: string): boolean {\n\tconst currentParts = parseVersion(current);\n\tconst latestParts = parseVersion(latest);\n\n\tfor (let i = 0; i < Math.max(currentParts.length, latestParts.length); i++) {\n\t\tconst currentPart = currentParts[i] || 0;\n\t\tconst latestPart = latestParts[i] || 0;\n\t\tif (latestPart > currentPart) return true;\n\t\tif (latestPart < currentPart) return false;\n\t}\n\treturn false;\n}\n\nasync function fetchLatestVersion(): Promise<string | null> {\n\ttry {\n\t\tconst controller = new AbortController();\n\t\tconst timeout = setTimeout(() => controller.abort(), 5000);\n\n\t\tconst response = await fetch(\"https://registry.npmjs.org/openvibe\", {\n\t\t\tsignal: controller.signal,\n\t\t});\n\t\tclearTimeout(timeout);\n\n\t\tif (!response.ok) return null;\n\n\t\tconst data = (await response.json()) as { \"dist-tags\"?: { latest?: string } };\n\t\treturn data[\"dist-tags\"]?.latest || null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction readCache(): VersionCache | null {\n\ttry {\n\t\tif (!existsSync(CACHE_FILE)) return null;\n\t\tconst content = readFileSync(CACHE_FILE, \"utf-8\");\n\t\treturn JSON.parse(content);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction writeCache(cache: VersionCache): void {\n\ttry {\n\t\tif (!existsSync(CACHE_DIR)) {\n\t\t\tmkdirSync(CACHE_DIR, { recursive: true });\n\t\t}\n\t\twriteFileSync(CACHE_FILE, JSON.stringify(cache));\n\t} catch {\n\t\t// Ignore cache write errors\n\t}\n}\n\nexport async function checkForUpdates(): Promise<void> {\n\tconst currentVersion = getCurrentVersion();\n\tconst cache = readCache();\n\tconst now = Date.now();\n\n\tlet latestVersion: string | null;\n\n\t// Use cached version if checked recently\n\tif (cache && now - cache.lastCheck < CHECK_INTERVAL) {\n\t\tlatestVersion = cache.latestVersion;\n\t} else {\n\t\t// Fetch from npm registry\n\t\tlatestVersion = await fetchLatestVersion();\n\t\tif (latestVersion) {\n\t\t\twriteCache({ lastCheck: now, latestVersion });\n\t\t}\n\t}\n\n\tif (latestVersion && isNewer(currentVersion, latestVersion)) {\n\t\tconsole.log();\n\t\tconsole.log(chalk.yellow(\"┌─────────────────────────────────────────────────────────┐\"));\n\t\tconsole.log(\n\t\t\tchalk.yellow(\"│\") +\n\t\t\t\t\" \" +\n\t\t\t\tchalk.bold(\"Update Available\") +\n\t\t\t\t\" \" +\n\t\t\t\tchalk.yellow(\"│\"),\n\t\t);\n\t\tconsole.log(\n\t\t\tchalk.yellow(\"│\") +\n\t\t\t\t` Current: ${chalk.gray(currentVersion)}` +\n\t\t\t\t\" \" +\n\t\t\t\tchalk.yellow(\"│\"),\n\t\t);\n\t\tconsole.log(\n\t\t\tchalk.yellow(\"│\") +\n\t\t\t\t` Latest: ${chalk.green(latestVersion)}` +\n\t\t\t\t\" \" +\n\t\t\t\tchalk.yellow(\"│\"),\n\t\t);\n\t\tconsole.log(chalk.yellow(\"│\") + \" \" + chalk.yellow(\"│\"));\n\t\tconsole.log(\n\t\t\tchalk.yellow(\"│\") +\n\t\t\t\t\" Run \" +\n\t\t\t\tchalk.cyan(\"npm i -g openvibe\") +\n\t\t\t\t\" to update \" +\n\t\t\t\tchalk.yellow(\"│\"),\n\t\t);\n\t\tconsole.log(chalk.yellow(\"└─────────────────────────────────────────────────────────┘\"));\n\t\tconsole.log();\n\t}\n}\n"]}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* pi -e ./built-in-tool-renderer.ts
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
+
import { Text } from "@boxiaolanya2008/pi-tui";
|
|
26
27
|
import type { BashToolDetails, EditToolDetails, ExtensionAPI, ReadToolDetails } from "@mariozechner/pi-coding-agent";
|
|
27
28
|
import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@mariozechner/pi-coding-agent";
|
|
28
|
-
import { Text } from "@boxiaolanya2008/pi-tui";
|
|
29
29
|
|
|
30
30
|
export default function (pi: ExtensionAPI) {
|
|
31
31
|
const cwd = process.cwd();
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { AssistantMessage } from "@boxiaolanya2008/pi-ai";
|
|
12
|
-
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
13
12
|
import { truncateToWidth, visibleWidth } from "@boxiaolanya2008/pi-tui";
|
|
13
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
14
14
|
|
|
15
15
|
export default function (pi: ExtensionAPI) {
|
|
16
16
|
let enabled = false;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Usage: /status [message] - sends a status message with custom rendering
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
11
10
|
import { Box, Text } from "@boxiaolanya2008/pi-tui";
|
|
11
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
12
12
|
|
|
13
13
|
export default function (pi: ExtensionAPI) {
|
|
14
14
|
// Register custom renderer for "status-update" messages
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* Then use ctrl+o to toggle between minimal (collapsed) and full (expanded) views.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { Text } from "@boxiaolanya2008/pi-tui";
|
|
19
20
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
20
21
|
import {
|
|
21
22
|
createBashTool,
|
|
@@ -26,7 +27,6 @@ import {
|
|
|
26
27
|
createReadTool,
|
|
27
28
|
createWriteTool,
|
|
28
29
|
} from "@mariozechner/pi-coding-agent";
|
|
29
|
-
import { Text } from "@boxiaolanya2008/pi-tui";
|
|
30
30
|
import { homedir } from "os";
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - ctrl+c, ctrl+d, etc. work in both modes
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { CustomEditor, type ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
13
12
|
import { matchesKey, truncateToWidth, visibleWidth } from "@boxiaolanya2008/pi-tui";
|
|
13
|
+
import { CustomEditor, type ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
14
14
|
|
|
15
15
|
// Normal mode key mappings: key -> escape sequence (or null for mode switch)
|
|
16
16
|
const NORMAL_KEYS: Record<string, string | null> = {
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
* /overlay-streaming - Multiple input panels with simulated streaming (Tab to cycle focus)
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@mariozechner/pi-coding-agent";
|
|
23
22
|
import type { Component, OverlayAnchor, OverlayHandle, OverlayOptions, TUI } from "@boxiaolanya2008/pi-tui";
|
|
24
23
|
import { matchesKey, truncateToWidth, visibleWidth } from "@boxiaolanya2008/pi-tui";
|
|
24
|
+
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@mariozechner/pi-coding-agent";
|
|
25
25
|
import { spawn } from "child_process";
|
|
26
26
|
|
|
27
27
|
// Global handle for toggle demo (in real code, use a more elegant pattern)
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* - Edge case tests (wide chars, styled text, emoji)
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@mariozechner/pi-coding-agent";
|
|
12
11
|
import { CURSOR_MARKER, type Focusable, matchesKey, visibleWidth } from "@boxiaolanya2008/pi-tui";
|
|
12
|
+
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@mariozechner/pi-coding-agent";
|
|
13
13
|
|
|
14
14
|
export default function (pi: ExtensionAPI) {
|
|
15
15
|
pi.registerCommand("overlay-test", {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
import type { AgentMessage } from "@boxiaolanya2008/pi-agent-core";
|
|
16
16
|
import type { AssistantMessage, TextContent } from "@boxiaolanya2008/pi-ai";
|
|
17
|
-
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
18
17
|
import { Key } from "@boxiaolanya2008/pi-tui";
|
|
18
|
+
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
19
19
|
import { extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.js";
|
|
20
20
|
|
|
21
21
|
// Tools
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
import { existsSync, readFileSync } from "node:fs";
|
|
42
42
|
import { homedir } from "node:os";
|
|
43
43
|
import { join } from "node:path";
|
|
44
|
+
import { Container, Key, type SelectItem, SelectList, Text } from "@boxiaolanya2008/pi-tui";
|
|
44
45
|
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
45
46
|
import { DynamicBorder } from "@mariozechner/pi-coding-agent";
|
|
46
|
-
import { Container, Key, type SelectItem, SelectList, Text } from "@boxiaolanya2008/pi-tui";
|
|
47
47
|
|
|
48
48
|
// Preset configuration
|
|
49
49
|
interface Preset {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Escape in editor returns to options, Escape in options cancels
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
8
7
|
import { Editor, type EditorTheme, Key, matchesKey, Text, truncateToWidth } from "@boxiaolanya2008/pi-tui";
|
|
8
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
9
9
|
import { Type } from "@sinclair/typebox";
|
|
10
10
|
|
|
11
11
|
interface OptionWithDesc {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Multiple questions: tab bar navigation between questions
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
9
8
|
import { Editor, type EditorTheme, Key, matchesKey, Text, truncateToWidth } from "@boxiaolanya2008/pi-tui";
|
|
9
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
10
10
|
import { Type } from "@sinclair/typebox";
|
|
11
11
|
|
|
12
12
|
// Types
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Snake game extension - play snake with /snake command
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
6
5
|
import { matchesKey, visibleWidth } from "@boxiaolanya2008/pi-tui";
|
|
6
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
7
7
|
|
|
8
8
|
const GAME_WIDTH = 40;
|
|
9
9
|
const GAME_HEIGHT = 15;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Uses Kitty keyboard protocol for smooth movement (press/release detection)
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
7
6
|
import { isKeyRelease, Key, matchesKey, visibleWidth } from "@boxiaolanya2008/pi-tui";
|
|
7
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
8
8
|
|
|
9
9
|
const GAME_WIDTH = 60;
|
|
10
10
|
const GAME_HEIGHT = 24;
|
|
@@ -19,8 +19,8 @@ import * as path from "node:path";
|
|
|
19
19
|
import type { AgentToolResult } from "@boxiaolanya2008/pi-agent-core";
|
|
20
20
|
import type { Message } from "@boxiaolanya2008/pi-ai";
|
|
21
21
|
import { StringEnum } from "@boxiaolanya2008/pi-ai";
|
|
22
|
-
import { type ExtensionAPI, getMarkdownTheme } from "@mariozechner/pi-coding-agent";
|
|
23
22
|
import { Container, Markdown, Spacer, Text } from "@boxiaolanya2008/pi-tui";
|
|
23
|
+
import { type ExtensionAPI, getMarkdownTheme } from "@mariozechner/pi-coding-agent";
|
|
24
24
|
import { Type } from "@sinclair/typebox";
|
|
25
25
|
import { type AgentConfig, type AgentScope, discoverAgents } from "./agents.js";
|
|
26
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { complete, getModel } from "@boxiaolanya2008/pi-ai";
|
|
2
|
+
import { Container, Markdown, matchesKey, Text } from "@boxiaolanya2008/pi-tui";
|
|
2
3
|
import type { ExtensionAPI, ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
|
|
3
4
|
import { DynamicBorder, getMarkdownTheme } from "@mariozechner/pi-coding-agent";
|
|
4
|
-
import { Container, Markdown, matchesKey, Text } from "@boxiaolanya2008/pi-tui";
|
|
5
5
|
|
|
6
6
|
type ContentBlock = {
|
|
7
7
|
type?: string;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { StringEnum } from "@boxiaolanya2008/pi-ai";
|
|
14
|
-
import type { ExtensionAPI, ExtensionContext, Theme } from "@mariozechner/pi-coding-agent";
|
|
15
14
|
import { matchesKey, Text, truncateToWidth } from "@boxiaolanya2008/pi-tui";
|
|
15
|
+
import type { ExtensionAPI, ExtensionContext, Theme } from "@mariozechner/pi-coding-agent";
|
|
16
16
|
import { Type } from "@sinclair/typebox";
|
|
17
17
|
|
|
18
18
|
interface Todo {
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* 2. Use /tools to open the tool selector
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import { Container, type SettingItem, SettingsList } from "@boxiaolanya2008/pi-tui";
|
|
12
13
|
import type { ExtensionAPI, ExtensionContext, ToolInfo } from "@mariozechner/pi-coding-agent";
|
|
13
14
|
import { getSettingsListTheme } from "@mariozechner/pi-coding-agent";
|
|
14
|
-
import { Container, type SettingItem, SettingsList } from "@boxiaolanya2008/pi-tui";
|
|
15
15
|
|
|
16
16
|
// State persisted to session
|
|
17
17
|
interface ToolsState {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* built-in `grep` tool in src/core/tools/grep.ts for a more complete implementation.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { Text } from "@boxiaolanya2008/pi-tui";
|
|
17
18
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
18
19
|
import {
|
|
19
20
|
DEFAULT_MAX_BYTES,
|
|
@@ -22,7 +23,6 @@ import {
|
|
|
22
23
|
type TruncationResult,
|
|
23
24
|
truncateHead,
|
|
24
25
|
} from "@mariozechner/pi-coding-agent";
|
|
25
|
-
import { Text } from "@boxiaolanya2008/pi-tui";
|
|
26
26
|
import { Type } from "@sinclair/typebox";
|
|
27
27
|
import { execSync } from "child_process";
|
|
28
28
|
import { mkdtempSync, writeFileSync } from "fs";
|
|
@@ -18,7 +18,15 @@ import { spawn } from "node:child_process";
|
|
|
18
18
|
import { dirname, join } from "node:path";
|
|
19
19
|
import * as readline from "node:readline";
|
|
20
20
|
import { fileURLToPath } from "node:url";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
type Component,
|
|
23
|
+
Container,
|
|
24
|
+
Input,
|
|
25
|
+
matchesKey,
|
|
26
|
+
ProcessTerminal,
|
|
27
|
+
SelectList,
|
|
28
|
+
TUI,
|
|
29
|
+
} from "@boxiaolanya2008/pi-tui";
|
|
22
30
|
|
|
23
31
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
24
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openvibe",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.7",
|
|
4
4
|
"description": "OpenVibe - AI Coding Assistant CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@mariozechner/jiti": "^2.6.2",
|
|
44
|
-
"@boxiaolanya2008/pi-agent-core": "^0.60.
|
|
45
|
-
"@boxiaolanya2008/pi-ai": "^0.60.
|
|
46
|
-
"@boxiaolanya2008/pi-tui": "^0.60.
|
|
44
|
+
"@boxiaolanya2008/pi-agent-core": "^0.60.7",
|
|
45
|
+
"@boxiaolanya2008/pi-ai": "^0.60.7",
|
|
46
|
+
"@boxiaolanya2008/pi-tui": "^0.60.7",
|
|
47
47
|
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
48
48
|
"chalk": "^5.5.0",
|
|
49
49
|
"cli-highlight": "^2.1.11",
|