openvibe 0.58.3 → 0.60.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +50 -3019
  2. package/README.md +267 -98
  3. package/dist/core/agent-modes.d.ts +16 -0
  4. package/dist/core/agent-modes.d.ts.map +1 -0
  5. package/dist/core/agent-modes.js +88 -0
  6. package/dist/core/agent-modes.js.map +1 -0
  7. package/dist/core/agent-session.d.ts +26 -0
  8. package/dist/core/agent-session.d.ts.map +1 -1
  9. package/dist/core/agent-session.js +84 -1
  10. package/dist/core/agent-session.js.map +1 -1
  11. package/dist/core/compaction/compaction.d.ts.map +1 -1
  12. package/dist/core/compaction/compaction.js +1 -1
  13. package/dist/core/compaction/compaction.js.map +1 -1
  14. package/dist/core/context-architecture.d.ts +12 -0
  15. package/dist/core/context-architecture.d.ts.map +1 -0
  16. package/dist/core/context-architecture.js +14 -0
  17. package/dist/core/context-architecture.js.map +1 -0
  18. package/dist/core/context-manager.d.ts +162 -0
  19. package/dist/core/context-manager.d.ts.map +1 -0
  20. package/dist/core/context-manager.js +311 -0
  21. package/dist/core/context-manager.js.map +1 -0
  22. package/dist/core/context-provider-interface.d.ts +134 -0
  23. package/dist/core/context-provider-interface.d.ts.map +1 -0
  24. package/dist/core/context-provider-interface.js +6 -0
  25. package/dist/core/context-provider-interface.js.map +1 -0
  26. package/dist/core/context-provider-registry.d.ts +78 -0
  27. package/dist/core/context-provider-registry.d.ts.map +1 -0
  28. package/dist/core/context-provider-registry.js +164 -0
  29. package/dist/core/context-provider-registry.js.map +1 -0
  30. package/dist/core/index.d.ts +2 -0
  31. package/dist/core/index.d.ts.map +1 -1
  32. package/dist/core/index.js +9 -0
  33. package/dist/core/index.js.map +1 -1
  34. package/dist/core/large-context-provider.d.ts +87 -0
  35. package/dist/core/large-context-provider.d.ts.map +1 -0
  36. package/dist/core/large-context-provider.js +391 -0
  37. package/dist/core/large-context-provider.js.map +1 -0
  38. package/dist/core/skills.d.ts.map +1 -1
  39. package/dist/core/skills.js +52 -5
  40. package/dist/core/skills.js.map +1 -1
  41. package/dist/core/slash-commands.d.ts.map +1 -1
  42. package/dist/core/slash-commands.js +1 -0
  43. package/dist/core/slash-commands.js.map +1 -1
  44. package/dist/core/system-prompt.d.ts +6 -4
  45. package/dist/core/system-prompt.d.ts.map +1 -1
  46. package/dist/core/system-prompt.js +129 -63
  47. package/dist/core/system-prompt.js.map +1 -1
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +2 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/modes/interactive/components/skills-selector.d.ts +13 -0
  53. package/dist/modes/interactive/components/skills-selector.d.ts.map +1 -0
  54. package/dist/modes/interactive/components/skills-selector.js +49 -0
  55. package/dist/modes/interactive/components/skills-selector.js.map +1 -0
  56. package/dist/modes/interactive/interactive-mode.d.ts +2 -2
  57. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  58. package/dist/modes/interactive/interactive-mode.js +44 -37
  59. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  60. package/docs/system-prompt-template.md +176 -0
  61. package/examples/skills/README.md +93 -0
  62. package/examples/skills/api-design/SKILL.md +80 -0
  63. package/examples/skills/code-review/SKILL.md +68 -0
  64. package/examples/skills/git-workflow/SKILL.md +108 -0
  65. package/examples/skills/testing/SKILL.md +94 -0
  66. package/package.json +2 -2
@@ -4,7 +4,7 @@ import * as os from "node:os";
4
4
  import * as path from "node:path";
5
5
  import { CombinedAutocompleteProvider, Container, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, Text, TruncatedText, TUI, visibleWidth, } from "@mariozechner/pi-tui";
6
6
  import { spawn, spawnSync } from "child_process";
7
- import { APP_NAME, getDebugLogPath, getShareViewerUrl, getUpdateInstruction, VERSION, } from "../../config.js";
7
+ import { APP_NAME, getDebugLogPath, getShareViewerUrl, VERSION, } from "../../config.js";
8
8
  import { parseSkillBlock } from "../../core/agent-session.js";
9
9
  import { getProductName } from "../../core/branded-ai.js";
10
10
  import { FooterDataProvider } from "../../core/footer-data-provider.js";
@@ -35,6 +35,7 @@ import { appKey, appKeyHint, editorKey, keyHint, rawKeyHint } from "./components
35
35
  import { SessionSelectorComponent } from "./components/session-selector.js";
36
36
  import { SettingsSelectorComponent } from "./components/settings-selector.js";
37
37
  import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
38
+ import { SkillsSelectorComponent } from "./components/skills-selector.js";
38
39
  import { ToolExecutionComponent } from "./components/tool-execution.js";
39
40
  import { TreeSelectorComponent } from "./components/tree-selector.js";
40
41
  import { UserMessageComponent } from "./components/user-message.js";
@@ -86,6 +87,7 @@ export class InteractiveMode {
86
87
  compactionQueuedMessages = [];
87
88
  shutdownRequested = false;
88
89
  extensionSelector = undefined;
90
+ skillsSelector = undefined;
89
91
  extensionInput = undefined;
90
92
  extensionEditor = undefined;
91
93
  extensionTerminalInputUnsubscribers = new Set();
@@ -269,11 +271,6 @@ export class InteractiveMode {
269
271
  }
270
272
  async run() {
271
273
  await this.init();
272
- this.checkForNewVersion().then((newVersion) => {
273
- if (newVersion) {
274
- this.showNewVersionNotification(newVersion);
275
- }
276
- });
277
274
  this.checkTmuxKeyboardSetup().then((warning) => {
278
275
  if (warning) {
279
276
  this.showWarning(warning);
@@ -311,26 +308,6 @@ export class InteractiveMode {
311
308
  }
312
309
  }
313
310
  }
314
- async checkForNewVersion() {
315
- if (process.env.PI_SKIP_VERSION_CHECK || process.env.PI_OFFLINE)
316
- return undefined;
317
- try {
318
- const response = await fetch("https://registry.npmjs.org/@mariozechner/pi/latest", {
319
- signal: AbortSignal.timeout(10000),
320
- });
321
- if (!response.ok)
322
- return undefined;
323
- const data = (await response.json());
324
- const latestVersion = data.version;
325
- if (latestVersion && latestVersion !== this.version) {
326
- return latestVersion;
327
- }
328
- return undefined;
329
- }
330
- catch {
331
- return undefined;
332
- }
333
- }
334
311
  async checkTmuxKeyboardSetup() {
335
312
  if (!process.env.TMUX)
336
313
  return undefined;
@@ -1373,6 +1350,11 @@ export class InteractiveMode {
1373
1350
  await this.handleReloadCommand();
1374
1351
  return;
1375
1352
  }
1353
+ if (text === "/skills") {
1354
+ this.showSkillsSelector();
1355
+ this.editor.setText("");
1356
+ return;
1357
+ }
1376
1358
  if (text === "/debug") {
1377
1359
  this.handleDebugCommand();
1378
1360
  this.editor.setText("");
@@ -2012,17 +1994,6 @@ export class InteractiveMode {
2012
1994
  this.chatContainer.addChild(new Text(theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
2013
1995
  this.ui.requestRender();
2014
1996
  }
2015
- showNewVersionNotification(newVersion) {
2016
- const action = theme.fg("accent", getUpdateInstruction("@mariozechner/pi-coding-agent"));
2017
- const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. `) + action;
2018
- const changelogUrl = theme.fg("accent", "https://github.com/mariozechner/openvibe/blob/main/CHANGELOG.md");
2019
- const changelogLine = theme.fg("muted", "Changelog: ") + changelogUrl;
2020
- this.chatContainer.addChild(new Spacer(1));
2021
- this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
2022
- this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction}\n${changelogLine}`, 1, 0));
2023
- this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
2024
- this.ui.requestRender();
2025
- }
2026
1997
  getAllQueuedMessages() {
2027
1998
  return {
2028
1999
  steering: [
@@ -3017,6 +2988,42 @@ export class InteractiveMode {
3017
2988
  void this.flushCompactionQueue({ willRetry: false });
3018
2989
  return result;
3019
2990
  }
2991
+ showSkillsSelector() {
2992
+ const skills = this.session.resourceLoader.getSkills().skills;
2993
+ this.showSelector((done) => {
2994
+ const selector = new SkillsSelectorComponent(skills, {
2995
+ onSelect: async (skill) => {
2996
+ done();
2997
+ // Show skill invocation message
2998
+ this.chatContainer.addChild(new Spacer(1));
2999
+ this.chatContainer.addChild(new Text(theme.fg("accent", `▶ Invoking skill: `) + theme.fg("muted", skill.name), 1, 0));
3000
+ this.chatContainer.addChild(new Text(theme.fg("dim", ` Location: ${skill.filePath}`), 1, 0));
3001
+ this.ui.requestRender();
3002
+ // Read the skill file content and send as context
3003
+ try {
3004
+ const fs = await import("node:fs/promises");
3005
+ const skillContent = await fs.readFile(skill.filePath, "utf-8");
3006
+ // Extract the content after frontmatter
3007
+ const frontmatterEnd = skillContent.indexOf("---", 4);
3008
+ const content = frontmatterEnd !== -1
3009
+ ? skillContent.slice(frontmatterEnd + 3).trim()
3010
+ : skillContent;
3011
+ // Create a prompt that includes the skill
3012
+ const prompt = `<skill name="${skill.name}" location="${skill.filePath}">\n${content}\n</skill>\n\nPlease apply the "${skill.name}" skill to help me.`;
3013
+ // Send the skill to the agent
3014
+ await this.session.prompt(prompt);
3015
+ }
3016
+ catch (error) {
3017
+ this.showError(`Failed to load skill "${skill.name}": ${error instanceof Error ? error.message : "Unknown error"}`);
3018
+ }
3019
+ },
3020
+ onCancel: () => {
3021
+ done();
3022
+ },
3023
+ });
3024
+ return { component: selector, focus: selector };
3025
+ });
3026
+ }
3020
3027
  stop() {
3021
3028
  if (this.loadingAnimation) {
3022
3029
  this.loadingAnimation.stop();