wave-agent-sdk 0.16.13 → 0.17.1
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/builtin/skills/settings/MCP.md +49 -4
- package/builtin/skills/settings/PERMISSIONS.md +31 -0
- package/dist/managers/aiManager.d.ts +19 -0
- package/dist/managers/aiManager.d.ts.map +1 -1
- package/dist/managers/aiManager.js +335 -209
- package/dist/managers/hookManager.d.ts +22 -0
- package/dist/managers/hookManager.d.ts.map +1 -1
- package/dist/managers/hookManager.js +95 -17
- package/dist/managers/mcpManager.d.ts.map +1 -1
- package/dist/managers/mcpManager.js +49 -39
- package/dist/managers/messageManager.d.ts +4 -0
- package/dist/managers/messageManager.d.ts.map +1 -1
- package/dist/managers/messageManager.js +9 -0
- package/dist/managers/permissionManager.d.ts +6 -0
- package/dist/managers/permissionManager.d.ts.map +1 -1
- package/dist/managers/permissionManager.js +14 -0
- package/dist/managers/planManager.d.ts.map +1 -1
- package/dist/managers/planManager.js +10 -0
- package/dist/managers/pluginManager.d.ts.map +1 -1
- package/dist/managers/pluginManager.js +28 -3
- package/dist/managers/slashCommandManager.d.ts.map +1 -1
- package/dist/managers/slashCommandManager.js +14 -0
- package/dist/managers/subagentManager.d.ts.map +1 -1
- package/dist/managers/subagentManager.js +4 -0
- package/dist/prompts/index.d.ts +0 -4
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +0 -3
- package/dist/prompts/planModeReminders.d.ts +6 -0
- package/dist/prompts/planModeReminders.d.ts.map +1 -0
- package/dist/prompts/planModeReminders.js +112 -0
- package/dist/services/aiService.d.ts +1 -0
- package/dist/services/aiService.d.ts.map +1 -1
- package/dist/services/aiService.js +3 -1
- package/dist/services/configurationService.d.ts.map +1 -1
- package/dist/services/configurationService.js +5 -3
- package/dist/services/initializationService.d.ts.map +1 -1
- package/dist/services/initializationService.js +13 -12
- package/dist/tools/bashTool.d.ts.map +1 -1
- package/dist/tools/bashTool.js +6 -8
- package/dist/tools/editTool.d.ts.map +1 -1
- package/dist/tools/editTool.js +21 -8
- package/dist/tools/exitPlanMode.d.ts.map +1 -1
- package/dist/tools/exitPlanMode.js +2 -0
- package/dist/types/agent.d.ts +2 -0
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/hooks.d.ts +5 -1
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/hooks.js +2 -0
- package/dist/types/mcp.d.ts +1 -0
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/utils/editUtils.d.ts +3 -2
- package/dist/utils/editUtils.d.ts.map +1 -1
- package/dist/utils/editUtils.js +5 -3
- package/package.json +2 -2
- package/src/managers/aiManager.ts +416 -253
- package/src/managers/hookManager.ts +122 -18
- package/src/managers/mcpManager.ts +60 -47
- package/src/managers/messageManager.ts +10 -0
- package/src/managers/permissionManager.ts +18 -0
- package/src/managers/planManager.ts +11 -0
- package/src/managers/pluginManager.ts +52 -6
- package/src/managers/slashCommandManager.ts +17 -0
- package/src/managers/subagentManager.ts +4 -0
- package/src/prompts/index.ts +0 -8
- package/src/prompts/planModeReminders.ts +138 -0
- package/src/services/aiService.ts +4 -1
- package/src/services/configurationService.ts +5 -3
- package/src/services/initializationService.ts +16 -15
- package/src/tools/bashTool.ts +6 -7
- package/src/tools/editTool.ts +25 -8
- package/src/tools/exitPlanMode.ts +3 -0
- package/src/types/agent.ts +2 -0
- package/src/types/hooks.ts +9 -1
- package/src/types/mcp.ts +1 -0
- package/src/utils/editUtils.ts +6 -3
package/dist/prompts/index.js
CHANGED
|
@@ -214,9 +214,6 @@ export function buildSystemPrompt(basePrompt, tools, options = {}) {
|
|
|
214
214
|
if (options.language) {
|
|
215
215
|
prompt += `\n\n# Language\nAlways respond in ${options.language}. Use ${options.language} for all explanations, comments, and communications with the user. Technical terms and code identifiers should remain in their original form.`;
|
|
216
216
|
}
|
|
217
|
-
if (options.planMode) {
|
|
218
|
-
prompt += `\n\n${buildPlanModePrompt(options.planMode.planFilePath, options.planMode.planExists, options.isSubagent)}`;
|
|
219
|
-
}
|
|
220
217
|
if (options.workdir) {
|
|
221
218
|
const isGitRepo = isGitRepository(options.workdir);
|
|
222
219
|
const platform = os.platform();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function wrapInSystemReminder(content: string): string;
|
|
2
|
+
export declare function buildPlanModeReminder(planFilePath: string, planExists: boolean, isSubagent?: boolean): string;
|
|
3
|
+
export declare function buildPlanModeSparseReminder(planFilePath: string): string;
|
|
4
|
+
export declare function buildPlanModeReEntryReminder(planFilePath: string): string;
|
|
5
|
+
export declare function buildExitedPlanModeReminder(planFilePath?: string, planExists?: boolean): string;
|
|
6
|
+
//# sourceMappingURL=planModeReminders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planModeReminders.d.ts","sourceRoot":"","sources":["../../src/prompts/planModeReminders.ts"],"names":[],"mappings":"AAYA,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,EACnB,UAAU,GAAE,OAAe,GAC1B,MAAM,CAsFR;AAED,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAIxE;AAED,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAczE;AAED,wBAAgB,2BAA2B,CACzC,YAAY,CAAC,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,OAAO,GACnB,MAAM,CAIR"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ASK_USER_QUESTION_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, EXIT_PLAN_MODE_TOOL_NAME, AGENT_TOOL_NAME, } from "../constants/tools.js";
|
|
2
|
+
import { EXPLORE_SUBAGENT_TYPE, PLAN_SUBAGENT_TYPE, } from "../constants/subagents.js";
|
|
3
|
+
export function wrapInSystemReminder(content) {
|
|
4
|
+
return `<system-reminder>\n${content}\n</system-reminder>`;
|
|
5
|
+
}
|
|
6
|
+
export function buildPlanModeReminder(planFilePath, planExists, isSubagent = false) {
|
|
7
|
+
const planFileInfo = planExists
|
|
8
|
+
? `A plan file already exists at ${planFilePath}. You can read it and make incremental edits using the ${EDIT_TOOL_NAME} tool if you need to.`
|
|
9
|
+
: `No plan file exists yet. You should create your plan at ${planFilePath} using the ${WRITE_TOOL_NAME} tool if you need to.`;
|
|
10
|
+
const subagentPlanFileInfo = planExists
|
|
11
|
+
? `A plan file already exists at ${planFilePath}. You can read it for context if needed.`
|
|
12
|
+
: `No plan file exists yet.`;
|
|
13
|
+
if (isSubagent) {
|
|
14
|
+
return wrapInSystemReminder(`Plan mode is active. The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supercedes any other instructions you have received (for example, to make edits). Instead, your role is to explore the codebase and return your findings as text output. Do NOT attempt to write or edit any files — the parent agent will write the plan file based on your text response.
|
|
15
|
+
|
|
16
|
+
## Plan File Info:
|
|
17
|
+
${subagentPlanFileInfo}
|
|
18
|
+
Answer the user's query comprehensively, using the ${ASK_USER_QUESTION_TOOL_NAME} tool if you need to ask the user clarifying questions. If you do use the ${ASK_USER_QUESTION_TOOL_NAME}, make sure to ask all clarifying questions you need to fully understand the user's intent before proceeding.`);
|
|
19
|
+
}
|
|
20
|
+
return wrapInSystemReminder(`Plan mode is active. The user indicated that they do not want you to execute yet -- you MUST NOT make any edits (with the exception of the plan file mentioned below), run any non-readonly tools (including making configs or making commits), or otherwise make any changes to the system. This supercedes any other instructions you have received.
|
|
21
|
+
|
|
22
|
+
## Plan File Info:
|
|
23
|
+
${planFileInfo}
|
|
24
|
+
You should build your plan incrementally by writing to or editing this file. NOTE that this is the only file you are allowed to edit - other than this you are only allowed to take READ-ONLY actions.
|
|
25
|
+
|
|
26
|
+
## Plan Workflow
|
|
27
|
+
|
|
28
|
+
### Phase 1: Initial Understanding
|
|
29
|
+
Goal: Gain a comprehensive understanding of the user's request by reading through code and asking them questions. Critical: In this phase you should only use the ${AGENT_TOOL_NAME} tool with subagent_type=${EXPLORE_SUBAGENT_TYPE}.
|
|
30
|
+
|
|
31
|
+
1. Focus on understanding the user's request and the code associated with their request. Actively search for existing functions, utilities, and patterns that can be reused — avoid proposing new code when suitable implementations already exist.
|
|
32
|
+
|
|
33
|
+
2. **Launch up to 3 ${EXPLORE_SUBAGENT_TYPE} agents IN PARALLEL** (single message, multiple tool calls) to efficiently explore the codebase.
|
|
34
|
+
- Use 1 agent when the task is isolated to known files, the user provided specific file paths, or you're making a small targeted change.
|
|
35
|
+
- Use multiple agents when: the scope is uncertain, multiple areas of the codebase are involved, or you need to understand existing patterns before planning.
|
|
36
|
+
- Quality over quantity - 3 agents maximum, but you should try to use the minimum number of agents necessary (usually just 1)
|
|
37
|
+
- If using multiple agents: Provide each agent with a specific search focus or area to explore. Example: One agent searches for existing implementations, another explores related components, a third investigating testing patterns
|
|
38
|
+
|
|
39
|
+
### Phase 2: Design
|
|
40
|
+
Goal: Design an implementation approach.
|
|
41
|
+
|
|
42
|
+
Launch agent(s) with subagent_type=${PLAN_SUBAGENT_TYPE} to design the implementation based on the user's intent and your exploration results from Phase 1.
|
|
43
|
+
|
|
44
|
+
You can launch up to 3 agent(s) in parallel.
|
|
45
|
+
|
|
46
|
+
**Guidelines:**
|
|
47
|
+
- **Default**: Launch at least 1 Plan agent for most tasks - it helps validate your understanding and consider alternatives
|
|
48
|
+
- **Skip agents**: Only for truly trivial tasks (typo fixes, single-line changes, simple renames)
|
|
49
|
+
- **Multiple agents**: Use up to 3 agents for complex tasks that benefit from different perspectives
|
|
50
|
+
|
|
51
|
+
Examples of when to use multiple agents:
|
|
52
|
+
- The task touches multiple parts of the codebase
|
|
53
|
+
- It's a large refactor or architectural change
|
|
54
|
+
- There are many edge cases to consider
|
|
55
|
+
- You'd benefit from exploring different approaches
|
|
56
|
+
|
|
57
|
+
Example perspectives by task type:
|
|
58
|
+
- New feature: simplicity vs performance vs maintainability
|
|
59
|
+
- Bug fix: root cause vs workaround vs prevention
|
|
60
|
+
- Refactoring: minimal change vs clean architecture
|
|
61
|
+
|
|
62
|
+
In the agent prompt:
|
|
63
|
+
- Provide comprehensive background context from Phase 1 exploration including filenames and code path traces
|
|
64
|
+
- Describe requirements and constraints
|
|
65
|
+
- Request a detailed implementation plan
|
|
66
|
+
|
|
67
|
+
### Phase 3: Review
|
|
68
|
+
Goal: Review the plan(s) from Phase 2 and ensure alignment with the user's intentions.
|
|
69
|
+
1. Read the critical files identified by agents to deepen your understanding
|
|
70
|
+
2. Ensure that the plans align with the user's original request
|
|
71
|
+
3. Use ${ASK_USER_QUESTION_TOOL_NAME} to clarify any remaining questions with the user
|
|
72
|
+
|
|
73
|
+
### Phase 4: Final Plan
|
|
74
|
+
Goal: Write your final plan to the plan file (the only file you can edit).
|
|
75
|
+
- Begin with a **Context** section: explain why this change is being made — the problem or need it addresses, what prompted it, and the intended outcome
|
|
76
|
+
- Include only your recommended approach, not all alternatives
|
|
77
|
+
- Ensure that the plan file is concise enough to scan quickly, but detailed enough to execute effectively
|
|
78
|
+
- Include the paths of critical files to be modified
|
|
79
|
+
- Reference existing functions and utilities you found that should be reused, with their file paths
|
|
80
|
+
- Include a verification section describing how to test the changes end-to-end (run the code, use MCP tools, run tests)
|
|
81
|
+
|
|
82
|
+
### Phase 5: Call ${EXIT_PLAN_MODE_TOOL_NAME}
|
|
83
|
+
At the very end of your turn, once you have asked the user questions and are happy with your final plan file - you should always call ${EXIT_PLAN_MODE_TOOL_NAME} to indicate to the user that you are done planning.
|
|
84
|
+
This is critical - your turn should only end with either using the ${ASK_USER_QUESTION_TOOL_NAME} tool OR calling ${EXIT_PLAN_MODE_TOOL_NAME}. Do not stop unless it's for these 2 reasons
|
|
85
|
+
|
|
86
|
+
**Important:** Use ${ASK_USER_QUESTION_TOOL_NAME} ONLY to clarify requirements or choose between approaches. Use ${EXIT_PLAN_MODE_TOOL_NAME} to request plan approval. Do NOT ask about plan approval in any other way - no text questions, no AskUserQuestion. Phrases like "Is this plan okay?", "Should I proceed?", "How does this plan look?", "Any changes before we start?", or similar MUST use ${EXIT_PLAN_MODE_TOOL_NAME}.
|
|
87
|
+
|
|
88
|
+
NOTE: At any point in time through this workflow you should feel free to ask the user questions or clarifications using the ${ASK_USER_QUESTION_TOOL_NAME} tool. Don't make large assumptions about user intent. The goal is to present a well researched plan to the user, and tie any loose ends before implementation begins.`);
|
|
89
|
+
}
|
|
90
|
+
export function buildPlanModeSparseReminder(planFilePath) {
|
|
91
|
+
return wrapInSystemReminder(`Plan mode still active (see full instructions earlier in conversation). Read-only except plan file at ${planFilePath}. End turns with ${ASK_USER_QUESTION_TOOL_NAME} or ${EXIT_PLAN_MODE_TOOL_NAME}.`);
|
|
92
|
+
}
|
|
93
|
+
export function buildPlanModeReEntryReminder(planFilePath) {
|
|
94
|
+
return wrapInSystemReminder(`## Re-entering Plan Mode
|
|
95
|
+
|
|
96
|
+
You are returning to plan mode after having previously exited it. A plan file exists at ${planFilePath} from your previous planning session.
|
|
97
|
+
|
|
98
|
+
**Before proceeding with any new planning, you should:**
|
|
99
|
+
1. Read the existing plan file to understand what was previously planned
|
|
100
|
+
2. Evaluate the user's current request against that plan
|
|
101
|
+
3. Decide how to proceed:
|
|
102
|
+
- **Different task**: If the user's request is for a different task—even if it's similar or related—start fresh by overwriting the existing plan
|
|
103
|
+
- **Same task, continuing**: If this is explicitly a continuation or refinement of the exact same task, modify the existing plan while cleaning up outdated or irrelevant sections
|
|
104
|
+
4. Continue on with the plan process and most importantly you should always edit the plan file one way or the other before calling ${EXIT_PLAN_MODE_TOOL_NAME}
|
|
105
|
+
|
|
106
|
+
Treat this as a fresh planning session. Do not assume the existing plan is relevant without evaluating it first.`);
|
|
107
|
+
}
|
|
108
|
+
export function buildExitedPlanModeReminder(planFilePath, planExists) {
|
|
109
|
+
return wrapInSystemReminder(`## Exited Plan Mode
|
|
110
|
+
|
|
111
|
+
You have exited plan mode. You can now make edits, run tools, and take actions.${planExists ? ` The plan file is located at ${planFilePath} if you need to reference it.` : ""}`);
|
|
112
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiService.d.ts","sourceRoot":"","sources":["../../src/services/aiService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAGL,0BAA0B,EAC1B,0BAA0B,EAE3B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAgEvC;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AA6DD,MAAM,WAAW,gBAAgB;IAE/B,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IAGzB,QAAQ,EAAE,0BAA0B,EAAE,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,0BAA0B,EAAE,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE;QACxB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,KAAK,CAAC;KACnD,KAA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,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QACN,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,wBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAuFjE"}
|
|
@@ -499,7 +499,9 @@ export async function compactMessages(options) {
|
|
|
499
499
|
...cleanedMessages,
|
|
500
500
|
{
|
|
501
501
|
role: "user",
|
|
502
|
-
content:
|
|
502
|
+
content: options.customInstructions
|
|
503
|
+
? `Please create a detailed summary of the conversation so far. Pay special attention to these instructions: ${options.customInstructions}`
|
|
504
|
+
: `Please create a detailed summary of the conversation so far.`,
|
|
503
505
|
},
|
|
504
506
|
],
|
|
505
507
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurationService.d.ts","sourceRoot":"","sources":["../../src/services/configurationService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACL,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,WAAW,EAGX,cAAc,EACd,YAAY,EACb,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAQvC;;;;;GAKG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,oBAAoB,CAAkC;IAC9D,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,kBAAkB,CAAqB;IAE/C;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAMvC;;OAEG;IACG,uBAAuB,CAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,uBAAuB,CAAC;IAkEnC;;OAEG;IACH,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,gBAAgB;IAkLlE;;OAEG;IACH,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB;IAwC7D;;;OAGG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAcrD;;OAEG;IACH,OAAO,CAAC,YAAY;IAepB;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,EAC5C,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,GAC7B,aAAa;IA8EhB;;;;;;;;OAQG;IACH,kBAAkB,CAChB,KAAK,CAAC,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,cAAc,GAC9B,WAAW;
|
|
1
|
+
{"version":3,"file":"configurationService.d.ts","sourceRoot":"","sources":["../../src/services/configurationService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACL,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,WAAW,EAGX,cAAc,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B,CACvB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAmChB;;OAEG;IACH,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAKjE;;;OAGG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;CAGnE;AAKD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,EACZ,UAAU,CAAC,EAAE,MAAM,GAClB,2BAA2B,CAsD7B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAC3C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAC9C,OAAO,GAAE,uBAA4B,GACpC,wBAAwB,CAoC1B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GACf,iBAAiB,GAAG,IAAI,CA+B1B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GACd,iBAAiB,GAAG,IAAI,CA0K1B"}
|
|
@@ -402,11 +402,13 @@ export class ConfigurationService {
|
|
|
402
402
|
* @returns Resolved model configuration with defaults
|
|
403
403
|
*/
|
|
404
404
|
resolveModelConfig(model, fastModel, maxTokens, permissionMode) {
|
|
405
|
-
// Resolve agent model: override > options >
|
|
405
|
+
// Resolve agent model: override > options > currentConfiguration (settings.json model, possibly remote-merged) > process.env
|
|
406
|
+
// Priority: user's explicit model field > admin's env.WAVE_MODEL default.
|
|
407
|
+
// If admin wants hard enforcement, they set the `model` scalar field (overwrites local in mergeRemoteSettings).
|
|
406
408
|
const resolvedAgentModel = model ||
|
|
407
409
|
this.options.model ||
|
|
408
|
-
|
|
409
|
-
|
|
410
|
+
this.currentConfiguration?.model ||
|
|
411
|
+
process.env.WAVE_MODEL;
|
|
410
412
|
// Resolve fast model: override > options > process.env (includes settings.json env)
|
|
411
413
|
const resolvedFastModel = fastModel || this.options.fastModel || process.env.WAVE_FAST_MODEL;
|
|
412
414
|
// Validate required fields
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializationService.d.ts","sourceRoot":"","sources":["../../src/services/initializationService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,YAAY,EACZ,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,WAAW,CAAC;IACxB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,WAAW,EAAE,WAAW,CAAC;IACzB,wBAAwB,EAAE,MAAM,IAAI,CAAC;CACtC;AAED,qBAAa,qBAAqB;WACZ,UAAU,CAC5B,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE;QACR,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;KACtB,GACA,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"initializationService.d.ts","sourceRoot":"","sources":["../../src/services/initializationService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,YAAY,EACZ,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,mBAA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AC,EAAE,OAAO,EAAE,CAAC;KACtB,GACA,OAAO,CAAC,IAAI,CAAC;CAkSjB"}
|
|
@@ -7,6 +7,8 @@ export class InitializationService {
|
|
|
7
7
|
static async initialize(context, options) {
|
|
8
8
|
const { skillManager, subagentManager, container, toolManager, pluginManager, options: agentOptions, slashCommandManager, logger, mcpManager, workdir, lspManager, configurationService, hookManager, messageManager, memoryRuleManager, liveConfigManager, taskManager, resolveAndValidateConfig, } = context;
|
|
9
9
|
const startTime = performance.now();
|
|
10
|
+
// Set global logger early so managers can use it during initialization
|
|
11
|
+
setGlobalLogger(logger || null);
|
|
10
12
|
// Initialize managers first
|
|
11
13
|
try {
|
|
12
14
|
const phaseStart = performance.now();
|
|
@@ -42,6 +44,17 @@ export class InitializationService {
|
|
|
42
44
|
logger?.error("Failed to initialize MCP servers:", error);
|
|
43
45
|
// Don't throw error to prevent app startup failure
|
|
44
46
|
}
|
|
47
|
+
// Initialize remote settings (load disk cache synchronously, then fetch in background)
|
|
48
|
+
// Must happen BEFORE loadMergedConfiguration so remote env vars are available
|
|
49
|
+
try {
|
|
50
|
+
const phaseStart = performance.now();
|
|
51
|
+
await remoteSettingsService.initialize();
|
|
52
|
+
logger?.debug(`Initialization Phase [Remote Settings] took ${(performance.now() - phaseStart).toFixed(2)}ms`);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
logger?.error("Failed to initialize remote settings:", error);
|
|
56
|
+
// Don't throw error to prevent app startup failure - continue without remote settings
|
|
57
|
+
}
|
|
45
58
|
// Initialize hooks configuration
|
|
46
59
|
try {
|
|
47
60
|
const phaseStart = performance.now();
|
|
@@ -142,8 +155,6 @@ export class InitializationService {
|
|
|
142
155
|
catch (error) {
|
|
143
156
|
logger?.error("Failed to initialize auto-memory directory:", error);
|
|
144
157
|
}
|
|
145
|
-
// Set global logger for SDK-wide access before discovering rules
|
|
146
|
-
setGlobalLogger(logger || null);
|
|
147
158
|
// Discover modular memory rules
|
|
148
159
|
try {
|
|
149
160
|
const phaseStart = performance.now();
|
|
@@ -163,16 +174,6 @@ export class InitializationService {
|
|
|
163
174
|
logger?.error("Failed to initialize live configuration reload:", error);
|
|
164
175
|
// Don't throw error to prevent app startup failure - continue without live reload
|
|
165
176
|
}
|
|
166
|
-
// Initialize remote settings (fetch server-managed config)
|
|
167
|
-
try {
|
|
168
|
-
const phaseStart = performance.now();
|
|
169
|
-
await remoteSettingsService.initialize();
|
|
170
|
-
logger?.debug(`Initialization Phase [Remote Settings] took ${(performance.now() - phaseStart).toFixed(2)}ms`);
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
logger?.error("Failed to initialize remote settings:", error);
|
|
174
|
-
// Don't throw error to prevent app startup failure - continue without remote settings
|
|
175
|
-
}
|
|
176
177
|
// Memory is lazy-cached on first getCombinedMemoryContent call
|
|
177
178
|
// No explicit loading needed during initialization
|
|
178
179
|
// Handle session restoration or set provided messages
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bashTool.d.ts","sourceRoot":"","sources":["../../src/tools/bashTool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAYtE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"bashTool.d.ts","sourceRoot":"","sources":["../../src/tools/bashTool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAYtE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UAyetB,CAAC"}
|
package/dist/tools/bashTool.js
CHANGED
|
@@ -366,24 +366,22 @@ The working directory persists between commands. Try to maintain your current wo
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
// If CWD changed, call the onCwdChange callback and add notification
|
|
369
|
-
let
|
|
369
|
+
let cwdMessage;
|
|
370
370
|
if (newCwd && newCwd !== context.workdir && context.onCwdChange) {
|
|
371
371
|
const isInSafeZone = context.permissionManager?.isPathInSafeZone?.(newCwd) ?? true;
|
|
372
|
-
if (isInSafeZone) {
|
|
373
|
-
context.onCwdChange(newCwd);
|
|
374
|
-
}
|
|
375
|
-
else if (context.originalWorkdir) {
|
|
372
|
+
if (!isInSafeZone && context.originalWorkdir) {
|
|
376
373
|
context.onCwdChange(context.originalWorkdir);
|
|
377
|
-
|
|
374
|
+
cwdMessage = `Shell cwd was reset to ${context.originalWorkdir}`;
|
|
378
375
|
}
|
|
379
376
|
else {
|
|
380
377
|
context.onCwdChange(newCwd);
|
|
378
|
+
cwdMessage = `Shell working directory changed to ${newCwd}`;
|
|
381
379
|
}
|
|
382
380
|
}
|
|
383
381
|
const exitCode = code ?? 0;
|
|
384
382
|
const combinedOutput = outputBuffer + (errorBuffer ? "\n" + errorBuffer : "");
|
|
385
|
-
// Prepend CWD
|
|
386
|
-
const finalOutput = (
|
|
383
|
+
// Prepend CWD change message to output if present
|
|
384
|
+
const finalOutput = (cwdMessage ? cwdMessage + "\n" : "") +
|
|
387
385
|
(combinedOutput || `Command executed with exit code: ${exitCode}`);
|
|
388
386
|
const content = processToolResult(finalOutput, BASH_MAX_OUTPUT_CHARS, "bash");
|
|
389
387
|
const lines = combinedOutput.trim().split("\n");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editTool.d.ts","sourceRoot":"","sources":["../../src/tools/editTool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAgBtE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"editTool.d.ts","sourceRoot":"","sources":["../../src/tools/editTool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAgBtE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UAqPtB,CAAC"}
|
package/dist/tools/editTool.js
CHANGED
|
@@ -23,6 +23,7 @@ Usage:
|
|
|
23
23
|
- When editing text from ${READ_TOOL_NAME} tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: spaces + line number + tab. Everything after that tab is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.
|
|
24
24
|
- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
|
|
25
25
|
- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
|
|
26
|
+
- Use the smallest \`old_string\` that's clearly unique — usually 2-4 adjacent lines is sufficient. Avoid including 10+ lines of context when less uniquely identifies the target. Shorter matches are less likely to contain reproduction errors.
|
|
26
27
|
- The edit will FAIL if \`old_string\` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use \`replace_all\` to change every instance of \`old_string\`.
|
|
27
28
|
- Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.`,
|
|
28
29
|
config: {
|
|
@@ -92,6 +93,15 @@ Usage:
|
|
|
92
93
|
}
|
|
93
94
|
// Touch file to track it in context
|
|
94
95
|
context.messageManager?.touchFile(filePath);
|
|
96
|
+
// Enforce read-before-edit: the file must have been read first
|
|
97
|
+
if (context.messageManager &&
|
|
98
|
+
!context.messageManager.hasFileInContext(filePath)) {
|
|
99
|
+
return {
|
|
100
|
+
success: false,
|
|
101
|
+
content: "",
|
|
102
|
+
error: `You must read the file with the ${READ_TOOL_NAME} tool before editing it. Use ${READ_TOOL_NAME} on ${filePath} first.`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
95
105
|
try {
|
|
96
106
|
const resolvedPath = resolvePath(filePath, context.workdir);
|
|
97
107
|
// Read file content
|
|
@@ -106,17 +116,20 @@ Usage:
|
|
|
106
116
|
error: `Failed to read file: ${readError instanceof Error ? readError.message : String(readError)}`,
|
|
107
117
|
};
|
|
108
118
|
}
|
|
119
|
+
// Normalize line endings for matching
|
|
120
|
+
const normalizedContent = originalContent.replace(/\r\n/g, "\n");
|
|
121
|
+
const normalizedOldString = oldString.replace(/\r\n/g, "\n");
|
|
109
122
|
// Check if old_string exists
|
|
110
|
-
const index =
|
|
111
|
-
const matchedOldString = index !== -1 ?
|
|
123
|
+
const index = normalizedContent.indexOf(normalizedOldString);
|
|
124
|
+
const matchedOldString = index !== -1 ? normalizedOldString : null;
|
|
112
125
|
const startLineNumber = index !== -1
|
|
113
|
-
?
|
|
126
|
+
? normalizedContent.substring(0, index).split("\n").length
|
|
114
127
|
: undefined;
|
|
115
128
|
if (!matchedOldString) {
|
|
116
129
|
return {
|
|
117
130
|
success: false,
|
|
118
131
|
content: "",
|
|
119
|
-
error: analyzeEditMismatch(),
|
|
132
|
+
error: analyzeEditMismatch(normalizedOldString),
|
|
120
133
|
};
|
|
121
134
|
}
|
|
122
135
|
let newContent;
|
|
@@ -124,12 +137,12 @@ Usage:
|
|
|
124
137
|
if (replaceAll) {
|
|
125
138
|
// Replace all matches
|
|
126
139
|
const regex = new RegExp(escapeRegExp(matchedOldString), "g");
|
|
127
|
-
newContent =
|
|
128
|
-
replacementCount = (
|
|
140
|
+
newContent = normalizedContent.replace(regex, newString);
|
|
141
|
+
replacementCount = (normalizedContent.match(regex) || []).length;
|
|
129
142
|
}
|
|
130
143
|
else {
|
|
131
144
|
// Replace only the first match, but first check if it's unique
|
|
132
|
-
const matches =
|
|
145
|
+
const matches = normalizedContent.split(matchedOldString).length - 1;
|
|
133
146
|
if (matches > 1) {
|
|
134
147
|
return {
|
|
135
148
|
success: false,
|
|
@@ -137,7 +150,7 @@ Usage:
|
|
|
137
150
|
error: `old_string appears ${matches} times in the file. Either provide a larger string with more surrounding context to make it unique or use replace_all=true to change every instance.`,
|
|
138
151
|
};
|
|
139
152
|
}
|
|
140
|
-
newContent =
|
|
153
|
+
newContent = normalizedContent.replace(matchedOldString, newString);
|
|
141
154
|
replacementCount = 1;
|
|
142
155
|
}
|
|
143
156
|
// Permission check after validation but before real operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exitPlanMode.d.ts","sourceRoot":"","sources":["../../src/tools/exitPlanMode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAItE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"exitPlanMode.d.ts","sourceRoot":"","sources":["../../src/tools/exitPlanMode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAItE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAuH9B,CAAC"}
|
|
@@ -88,6 +88,8 @@ Ensure your plan is complete and unambiguous:
|
|
|
88
88
|
error: permissionResult.message ? undefined : "Plan rejected by user",
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
+
context.permissionManager.setHasExitedPlanMode(true);
|
|
92
|
+
context.permissionManager.setNeedsPlanModeExitAttachment(true);
|
|
91
93
|
return {
|
|
92
94
|
success: true,
|
|
93
95
|
content: "Plan approved. Exiting plan mode.",
|
package/dist/types/agent.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface AgentOptions {
|
|
|
19
19
|
/** Wave server URL for SSO authentication (fallback to WAVE_SERVER_URL env var) */
|
|
20
20
|
serverUrl?: string;
|
|
21
21
|
defaultHeaders?: Record<string, string>;
|
|
22
|
+
/** Per-subagent-type headers, merged into defaultHeaders for matching subagents */
|
|
23
|
+
subagentHeaders?: Record<string, Record<string, string>>;
|
|
22
24
|
fetchOptions?: ClientOptions["fetchOptions"];
|
|
23
25
|
fetch?: ClientOptions["fetch"];
|
|
24
26
|
model?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EACV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K,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,wBAAwB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CAC9D"}
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* enabling automated actions at specific workflow points.
|
|
6
6
|
*/
|
|
7
7
|
export type { WaveConfiguration, HookConfiguration, PartialHookConfiguration, HookConfigurationRecord, } from "./configuration.js";
|
|
8
|
-
export type HookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "SubagentStop" | "PermissionRequest" | "WorktreeCreate" | "WorktreeRemove" | "CwdChanged" | "SessionStart" | "SessionEnd";
|
|
8
|
+
export type HookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "SubagentStop" | "PermissionRequest" | "WorktreeCreate" | "WorktreeRemove" | "CwdChanged" | "SessionStart" | "SessionEnd" | "PreCompact" | "PostCompact";
|
|
9
9
|
export interface HookCommand {
|
|
10
10
|
type: "command";
|
|
11
11
|
command: string;
|
|
@@ -74,6 +74,8 @@ export interface HookJsonInput {
|
|
|
74
74
|
source?: SessionStartSource;
|
|
75
75
|
agent_type?: string;
|
|
76
76
|
end_source?: SessionEndSource;
|
|
77
|
+
compact_instructions?: string;
|
|
78
|
+
compact_summary?: string;
|
|
77
79
|
}
|
|
78
80
|
export interface ExtendedHookExecutionContext extends HookExecutionContext {
|
|
79
81
|
sessionId?: string;
|
|
@@ -90,6 +92,8 @@ export interface ExtendedHookExecutionContext extends HookExecutionContext {
|
|
|
90
92
|
source?: SessionStartSource;
|
|
91
93
|
agentType?: string;
|
|
92
94
|
endSource?: SessionEndSource;
|
|
95
|
+
compactInstructions?: string;
|
|
96
|
+
compactSummary?: string;
|
|
93
97
|
}
|
|
94
98
|
export interface HookEnvironment {
|
|
95
99
|
WAVE_PROJECT_DIR: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/types/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/types/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,aAAa,CAAC;AAGlB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,eAAe;IAC9B,OAAO,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AAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB"}
|
package/dist/types/hooks.js
CHANGED
package/dist/types/mcp.d.ts
CHANGED
package/dist/types/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/types/mcp.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED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AC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EACF,cAAc,GACd,WAAW,GACX,YAAY,GACZ,cAAc,GACd,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function escapeRegExp(string: string): string;
|
|
8
8
|
/**
|
|
9
|
-
* Returns
|
|
9
|
+
* Returns an error message when old_string is not found, including
|
|
10
|
+
* the attempted string to help the model self-correct on retry.
|
|
10
11
|
*/
|
|
11
|
-
export declare function analyzeEditMismatch(): string;
|
|
12
|
+
export declare function analyzeEditMismatch(oldString: string): string;
|
|
12
13
|
//# sourceMappingURL=editUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editUtils.d.ts","sourceRoot":"","sources":["../../src/utils/editUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED
|
|
1
|
+
{"version":3,"file":"editUtils.d.ts","sourceRoot":"","sources":["../../src/utils/editUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAI7D"}
|
package/dist/utils/editUtils.js
CHANGED
|
@@ -8,8 +8,10 @@ export function escapeRegExp(string) {
|
|
|
8
8
|
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* Returns
|
|
11
|
+
* Returns an error message when old_string is not found, including
|
|
12
|
+
* the attempted string to help the model self-correct on retry.
|
|
12
13
|
*/
|
|
13
|
-
export function analyzeEditMismatch() {
|
|
14
|
-
|
|
14
|
+
export function analyzeEditMismatch(oldString) {
|
|
15
|
+
const displayString = oldString.length > 200 ? oldString.substring(0, 200) + "..." : oldString;
|
|
16
|
+
return `String to replace not found in file.\nString: ${displayString}`;
|
|
15
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-agent-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "SDK for building AI-powered development tools and agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
32
32
|
"@opentelemetry/api": "^1.9.0",
|
|
33
33
|
"@opentelemetry/api-logs": "^0.217.0",
|
|
34
34
|
"@opentelemetry/exporter-logs-otlp-http": "^0.217.0",
|