openvibe 0.58.2 → 0.59.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/README.md +1 -1
- package/dist/core/agent-modes.d.ts +16 -0
- package/dist/core/agent-modes.d.ts.map +1 -0
- package/dist/core/agent-modes.js +88 -0
- package/dist/core/agent-modes.js.map +1 -0
- package/dist/core/agent-session.d.ts +26 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +84 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +23 -3
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts +2 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +9 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type AgentMode = "default" | "plan" | "spec";
|
|
2
|
+
export interface AgentModeConfig {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
systemPromptAddition: string;
|
|
6
|
+
tools: string[];
|
|
7
|
+
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
8
|
+
}
|
|
9
|
+
export declare const AGENT_MODES: Record<AgentMode, AgentModeConfig>;
|
|
10
|
+
export declare function getAgentModeConfig(mode: AgentMode): AgentModeConfig;
|
|
11
|
+
export declare function getModePromptAddition(mode: AgentMode): string;
|
|
12
|
+
export declare function getModeTools(mode: AgentMode): string[];
|
|
13
|
+
export declare function getModeThinkingLevel(mode: AgentMode): "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
14
|
+
export declare function getAllModes(): AgentMode[];
|
|
15
|
+
export declare function getClaudeSkillsPath(): string;
|
|
16
|
+
//# sourceMappingURL=agent-modes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-modes.d.ts","sourceRoot":"","sources":["../../src/core/agent-modes.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;CACvE;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,eAAe,CAkE1D,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,eAAe,CAEnE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE7D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,CAEtD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAE7G;AAED,wBAAgB,WAAW,IAAI,SAAS,EAAE,CAEzC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C","sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nexport type AgentMode = \"default\" | \"plan\" | \"spec\";\n\nexport interface AgentModeConfig {\n\tname: string;\n\tdescription: string;\n\tsystemPromptAddition: string;\n\ttools: string[];\n\tthinkingLevel: \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\";\n}\n\nexport const AGENT_MODES: Record<AgentMode, AgentModeConfig> = {\n\tdefault: {\n\t\tname: \"Default\",\n\t\tdescription: \"Standard coding assistant mode with full tool access\",\n\t\tsystemPromptAddition: ``,\n\t\ttools: [\"read\", \"bash\", \"edit\", \"write\", \"grep\", \"find\", \"ls\"],\n\t\tthinkingLevel: \"off\",\n\t},\n\tplan: {\n\t\tname: \"Plan\",\n\t\tdescription: \"Planning mode focused on analysis and design. Read-only tools, high reasoning.\",\n\t\tsystemPromptAddition: `\nYou are in **Planning Mode**. Your role is to analyze, design, and create detailed plans.\n\n**Guidelines for Planning Mode:**\n1. Focus on understanding the problem thoroughly before proposing solutions\n2. Break down complex tasks into manageable steps\n3. Consider edge cases, error handling, and potential issues\n4. Provide clear, actionable implementation plans\n5. Use high-level reasoning to explore multiple approaches\n6. Document dependencies and prerequisites\n7. Identify risks and mitigation strategies\n8. Create clear milestones and deliverables\n\n**Output Format:**\n- Start with a brief problem analysis\n- Present the approach with rationale\n- Provide step-by-step implementation plan\n- Include consideration of alternatives\n- End with a summary of key decisions\n\nYou have read-only access to tools. You cannot modify files directly.\n`,\n\t\ttools: [\"read\", \"bash\", \"grep\", \"find\", \"ls\"],\n\t\tthinkingLevel: \"high\",\n\t},\n\tspec: {\n\t\tname: \"Specification\",\n\t\tdescription: \"Specification mode for creating detailed technical specs. Read-only tools, maximum reasoning.\",\n\t\tsystemPromptAddition: `\nYou are in **Specification Mode**. Your role is to create detailed technical specifications.\n\n**Guidelines for Specification Mode:**\n1. Produce comprehensive technical documentation\n2. Define clear interfaces, data structures, and contracts\n3. Specify behavior, constraints, and invariants\n4. Include error conditions and recovery procedures\n5. Define testing requirements and acceptance criteria\n6. Document performance requirements and constraints\n7. Specify security considerations\n8. Create API contracts and data models\n\n**Output Format:**\n- Overview and objectives\n- Detailed specifications with types and constraints\n- Interface definitions\n- Behavior specifications\n- Error handling specifications\n- Testing requirements\n- Implementation notes\n\nYou have read-only access to tools. You cannot modify files directly.\n`,\n\t\ttools: [\"read\", \"bash\", \"grep\", \"find\", \"ls\"],\n\t\tthinkingLevel: \"xhigh\",\n\t},\n};\n\nexport function getAgentModeConfig(mode: AgentMode): AgentModeConfig {\n\treturn AGENT_MODES[mode];\n}\n\nexport function getModePromptAddition(mode: AgentMode): string {\n\treturn AGENT_MODES[mode].systemPromptAddition;\n}\n\nexport function getModeTools(mode: AgentMode): string[] {\n\treturn AGENT_MODES[mode].tools;\n}\n\nexport function getModeThinkingLevel(mode: AgentMode): \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" {\n\treturn AGENT_MODES[mode].thinkingLevel;\n}\n\nexport function getAllModes(): AgentMode[] {\n\treturn [\"default\", \"plan\", \"spec\"];\n}\n\nexport function getClaudeSkillsPath(): string {\n\treturn join(homedir(), \".claude\", \"skills\");\n}\n"]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
export const AGENT_MODES = {
|
|
4
|
+
default: {
|
|
5
|
+
name: "Default",
|
|
6
|
+
description: "Standard coding assistant mode with full tool access",
|
|
7
|
+
systemPromptAddition: ``,
|
|
8
|
+
tools: ["read", "bash", "edit", "write", "grep", "find", "ls"],
|
|
9
|
+
thinkingLevel: "off",
|
|
10
|
+
},
|
|
11
|
+
plan: {
|
|
12
|
+
name: "Plan",
|
|
13
|
+
description: "Planning mode focused on analysis and design. Read-only tools, high reasoning.",
|
|
14
|
+
systemPromptAddition: `
|
|
15
|
+
You are in **Planning Mode**. Your role is to analyze, design, and create detailed plans.
|
|
16
|
+
|
|
17
|
+
**Guidelines for Planning Mode:**
|
|
18
|
+
1. Focus on understanding the problem thoroughly before proposing solutions
|
|
19
|
+
2. Break down complex tasks into manageable steps
|
|
20
|
+
3. Consider edge cases, error handling, and potential issues
|
|
21
|
+
4. Provide clear, actionable implementation plans
|
|
22
|
+
5. Use high-level reasoning to explore multiple approaches
|
|
23
|
+
6. Document dependencies and prerequisites
|
|
24
|
+
7. Identify risks and mitigation strategies
|
|
25
|
+
8. Create clear milestones and deliverables
|
|
26
|
+
|
|
27
|
+
**Output Format:**
|
|
28
|
+
- Start with a brief problem analysis
|
|
29
|
+
- Present the approach with rationale
|
|
30
|
+
- Provide step-by-step implementation plan
|
|
31
|
+
- Include consideration of alternatives
|
|
32
|
+
- End with a summary of key decisions
|
|
33
|
+
|
|
34
|
+
You have read-only access to tools. You cannot modify files directly.
|
|
35
|
+
`,
|
|
36
|
+
tools: ["read", "bash", "grep", "find", "ls"],
|
|
37
|
+
thinkingLevel: "high",
|
|
38
|
+
},
|
|
39
|
+
spec: {
|
|
40
|
+
name: "Specification",
|
|
41
|
+
description: "Specification mode for creating detailed technical specs. Read-only tools, maximum reasoning.",
|
|
42
|
+
systemPromptAddition: `
|
|
43
|
+
You are in **Specification Mode**. Your role is to create detailed technical specifications.
|
|
44
|
+
|
|
45
|
+
**Guidelines for Specification Mode:**
|
|
46
|
+
1. Produce comprehensive technical documentation
|
|
47
|
+
2. Define clear interfaces, data structures, and contracts
|
|
48
|
+
3. Specify behavior, constraints, and invariants
|
|
49
|
+
4. Include error conditions and recovery procedures
|
|
50
|
+
5. Define testing requirements and acceptance criteria
|
|
51
|
+
6. Document performance requirements and constraints
|
|
52
|
+
7. Specify security considerations
|
|
53
|
+
8. Create API contracts and data models
|
|
54
|
+
|
|
55
|
+
**Output Format:**
|
|
56
|
+
- Overview and objectives
|
|
57
|
+
- Detailed specifications with types and constraints
|
|
58
|
+
- Interface definitions
|
|
59
|
+
- Behavior specifications
|
|
60
|
+
- Error handling specifications
|
|
61
|
+
- Testing requirements
|
|
62
|
+
- Implementation notes
|
|
63
|
+
|
|
64
|
+
You have read-only access to tools. You cannot modify files directly.
|
|
65
|
+
`,
|
|
66
|
+
tools: ["read", "bash", "grep", "find", "ls"],
|
|
67
|
+
thinkingLevel: "xhigh",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
export function getAgentModeConfig(mode) {
|
|
71
|
+
return AGENT_MODES[mode];
|
|
72
|
+
}
|
|
73
|
+
export function getModePromptAddition(mode) {
|
|
74
|
+
return AGENT_MODES[mode].systemPromptAddition;
|
|
75
|
+
}
|
|
76
|
+
export function getModeTools(mode) {
|
|
77
|
+
return AGENT_MODES[mode].tools;
|
|
78
|
+
}
|
|
79
|
+
export function getModeThinkingLevel(mode) {
|
|
80
|
+
return AGENT_MODES[mode].thinkingLevel;
|
|
81
|
+
}
|
|
82
|
+
export function getAllModes() {
|
|
83
|
+
return ["default", "plan", "spec"];
|
|
84
|
+
}
|
|
85
|
+
export function getClaudeSkillsPath() {
|
|
86
|
+
return join(homedir(), ".claude", "skills");
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=agent-modes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-modes.js","sourceRoot":"","sources":["../../src/core/agent-modes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAYjC,MAAM,CAAC,MAAM,WAAW,GAAuC;IAC9D,OAAO,EAAE;QACR,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,sDAAsD;QACnE,oBAAoB,EAAE,EAAE;QACxB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC;QAC9D,aAAa,EAAE,KAAK;KACpB;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,gFAAgF;QAC7F,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBvB;QACC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC;QAC7C,aAAa,EAAE,MAAM;KACrB;IACD,IAAI,EAAE;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,+FAA+F;QAC5G,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;CAuBvB;QACC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC;QAC7C,aAAa,EAAE,OAAO;KACtB;CACD,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,IAAe,EAAmB;IACpE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAAA,CACzB;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAe,EAAU;IAC9D,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC;AAAA,CAC9C;AAED,MAAM,UAAU,YAAY,CAAC,IAAe,EAAY;IACvD,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;AAAA,CAC/B;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAA2D;IAC9G,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC;AAAA,CACvC;AAED,MAAM,UAAU,WAAW,GAAgB;IAC1C,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAAA,CACnC;AAED,MAAM,UAAU,mBAAmB,GAAW;IAC7C,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,CAC5C","sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nexport type AgentMode = \"default\" | \"plan\" | \"spec\";\n\nexport interface AgentModeConfig {\n\tname: string;\n\tdescription: string;\n\tsystemPromptAddition: string;\n\ttools: string[];\n\tthinkingLevel: \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\";\n}\n\nexport const AGENT_MODES: Record<AgentMode, AgentModeConfig> = {\n\tdefault: {\n\t\tname: \"Default\",\n\t\tdescription: \"Standard coding assistant mode with full tool access\",\n\t\tsystemPromptAddition: ``,\n\t\ttools: [\"read\", \"bash\", \"edit\", \"write\", \"grep\", \"find\", \"ls\"],\n\t\tthinkingLevel: \"off\",\n\t},\n\tplan: {\n\t\tname: \"Plan\",\n\t\tdescription: \"Planning mode focused on analysis and design. Read-only tools, high reasoning.\",\n\t\tsystemPromptAddition: `\nYou are in **Planning Mode**. Your role is to analyze, design, and create detailed plans.\n\n**Guidelines for Planning Mode:**\n1. Focus on understanding the problem thoroughly before proposing solutions\n2. Break down complex tasks into manageable steps\n3. Consider edge cases, error handling, and potential issues\n4. Provide clear, actionable implementation plans\n5. Use high-level reasoning to explore multiple approaches\n6. Document dependencies and prerequisites\n7. Identify risks and mitigation strategies\n8. Create clear milestones and deliverables\n\n**Output Format:**\n- Start with a brief problem analysis\n- Present the approach with rationale\n- Provide step-by-step implementation plan\n- Include consideration of alternatives\n- End with a summary of key decisions\n\nYou have read-only access to tools. You cannot modify files directly.\n`,\n\t\ttools: [\"read\", \"bash\", \"grep\", \"find\", \"ls\"],\n\t\tthinkingLevel: \"high\",\n\t},\n\tspec: {\n\t\tname: \"Specification\",\n\t\tdescription: \"Specification mode for creating detailed technical specs. Read-only tools, maximum reasoning.\",\n\t\tsystemPromptAddition: `\nYou are in **Specification Mode**. Your role is to create detailed technical specifications.\n\n**Guidelines for Specification Mode:**\n1. Produce comprehensive technical documentation\n2. Define clear interfaces, data structures, and contracts\n3. Specify behavior, constraints, and invariants\n4. Include error conditions and recovery procedures\n5. Define testing requirements and acceptance criteria\n6. Document performance requirements and constraints\n7. Specify security considerations\n8. Create API contracts and data models\n\n**Output Format:**\n- Overview and objectives\n- Detailed specifications with types and constraints\n- Interface definitions\n- Behavior specifications\n- Error handling specifications\n- Testing requirements\n- Implementation notes\n\nYou have read-only access to tools. You cannot modify files directly.\n`,\n\t\ttools: [\"read\", \"bash\", \"grep\", \"find\", \"ls\"],\n\t\tthinkingLevel: \"xhigh\",\n\t},\n};\n\nexport function getAgentModeConfig(mode: AgentMode): AgentModeConfig {\n\treturn AGENT_MODES[mode];\n}\n\nexport function getModePromptAddition(mode: AgentMode): string {\n\treturn AGENT_MODES[mode].systemPromptAddition;\n}\n\nexport function getModeTools(mode: AgentMode): string[] {\n\treturn AGENT_MODES[mode].tools;\n}\n\nexport function getModeThinkingLevel(mode: AgentMode): \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" {\n\treturn AGENT_MODES[mode].thinkingLevel;\n}\n\nexport function getAllModes(): AgentMode[] {\n\treturn [\"default\", \"plan\", \"spec\"];\n}\n\nexport function getClaudeSkillsPath(): string {\n\treturn join(homedir(), \".claude\", \"skills\");\n}\n"]}
|
|
@@ -24,6 +24,7 @@ import type { ResourceLoader } from "./resource-loader.js";
|
|
|
24
24
|
import type { BranchSummaryEntry, SessionManager } from "./session-manager.js";
|
|
25
25
|
import type { SettingsManager } from "./settings-manager.js";
|
|
26
26
|
import type { BashOperations } from "./tools/bash.js";
|
|
27
|
+
import type { AgentMode } from "./agent-modes.js";
|
|
27
28
|
/** Parsed skill block from a user message */
|
|
28
29
|
export interface ParsedSkillBlock {
|
|
29
30
|
name: string;
|
|
@@ -84,6 +85,8 @@ export interface AgentSessionConfig {
|
|
|
84
85
|
extensionRunnerRef?: {
|
|
85
86
|
current?: ExtensionRunner;
|
|
86
87
|
};
|
|
88
|
+
/** Initial agent mode. Default: "default" */
|
|
89
|
+
initialMode?: AgentMode;
|
|
87
90
|
}
|
|
88
91
|
export interface ExtensionBindings {
|
|
89
92
|
uiContext?: ExtensionUIContext;
|
|
@@ -170,6 +173,7 @@ export declare class AgentSession {
|
|
|
170
173
|
private _toolPromptSnippets;
|
|
171
174
|
private _toolPromptGuidelines;
|
|
172
175
|
private _baseSystemPrompt;
|
|
176
|
+
private _mode;
|
|
173
177
|
constructor(config: AgentSessionConfig);
|
|
174
178
|
/** Model registry for API key resolution and model discovery */
|
|
175
179
|
get modelRegistry(): ModelRegistry;
|
|
@@ -216,6 +220,28 @@ export declare class AgentSession {
|
|
|
216
220
|
get model(): Model<any> | undefined;
|
|
217
221
|
/** Current thinking level */
|
|
218
222
|
get thinkingLevel(): ThinkingLevel;
|
|
223
|
+
/** Current agent mode */
|
|
224
|
+
get mode(): AgentMode;
|
|
225
|
+
/**
|
|
226
|
+
* Set agent mode.
|
|
227
|
+
* Updates tools, thinking level, and system prompt based on the mode.
|
|
228
|
+
*/
|
|
229
|
+
setMode(mode: AgentMode): void;
|
|
230
|
+
/**
|
|
231
|
+
* Cycle to next agent mode.
|
|
232
|
+
* @returns New mode name
|
|
233
|
+
*/
|
|
234
|
+
cycleMode(): AgentMode;
|
|
235
|
+
/**
|
|
236
|
+
* Set the model for the agent.
|
|
237
|
+
* Updates thinking level based on model capabilities.
|
|
238
|
+
*/
|
|
239
|
+
setModel(model: Model<any>): Promise<void>;
|
|
240
|
+
/**
|
|
241
|
+
* Cycle to next model in scoped models list.
|
|
242
|
+
* @returns Model cycle result or undefined if no scoped models
|
|
243
|
+
*/
|
|
244
|
+
cycleModel(): Promise<ModelCycleResult | undefined>;
|
|
219
245
|
/** Whether agent is currently streaming a response */
|
|
220
246
|
get isStreaming(): boolean;
|
|
221
247
|
/** Current effective system prompt (includes any per-turn extension modifications) */
|