wave-agent-sdk 0.8.0 → 0.8.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.
@@ -1 +1 @@
1
- {"version":3,"file":"slashCommandManager.d.ts","sourceRoot":"","sources":["../../src/managers/slashCommandManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAQ1E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,mBAAmB;IAO5B,OAAO,CAAC,SAAS;IANnB,OAAO,CAAC,QAAQ,CAAmC;IACnD,OAAO,CAAC,cAAc,CAAyC;IAC/D,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,OAAO,CAAS;gBAGd,SAAS,EAAE,SAAS,EAC5B,OAAO,EAAE,0BAA0B;IAK9B,UAAU,IAAI,IAAI;IAKzB,OAAO,KAAK,cAAc,GAEzB;IAED,OAAO,KAAK,SAAS,GAEpB;IAED,OAAO,KAAK,qBAAqB,GAEhC;IAED,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,CAAC,yBAAyB;IAoBjC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAyD1B;;OAEG;IACI,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI;IAyD3D;;OAEG;IACI,sBAAsB,CAC3B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,kBAAkB,EAAE,GAC7B,IAAI;IAwDP;;OAEG;IACI,oBAAoB,IAAI,IAAI;IAWnC;;OAEG;IACI,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAKnD;;OAEG;IACH,OAAO,CAAC,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{
71
71
  processedContent = processedContent.replace(/\$WAVE_PLUGIN_ROOT/g, command.pluginPath);
72
72
  }
73
73
  if (args) {
74
- if (hasParameterPlaceholders(processedContent)) {
75
- processedContent = substituteCommandParameters(processedContent, args);
76
- }
77
- else {
78
- // If no placeholders, append arguments to the content
79
- processedContent = `${processedContent.trim()} ${args}`;
80
- }
74
+ processedContent = substituteCommandParameters(processedContent, args);
81
75
  }
82
76
  await this.executeCustomCommandInMainAgent(command.name, processedContent, command.config, args);
83
77
  },
@@ -161,13 +155,7 @@ export class SlashCommandManager {
161
155
  processedContent = processedContent.replace(/\$WAVE_PLUGIN_ROOT/g, command.pluginPath);
162
156
  }
163
157
  if (args) {
164
- if (hasParameterPlaceholders(processedContent)) {
165
- processedContent = substituteCommandParameters(processedContent, args);
166
- }
167
- else {
168
- // If no placeholders, append arguments to the content
169
- processedContent = `${processedContent.trim()} ${args}`;
170
- }
158
+ processedContent = substituteCommandParameters(processedContent, args);
171
159
  }
172
160
  await this.executeCustomCommandInMainAgent(namespacedName, processedContent, command.config, args);
173
161
  },
@@ -55,9 +55,9 @@ function getModelConfig(modelName, baseConfig = {}) {
55
55
  ...baseConfig,
56
56
  };
57
57
  // Configuration rules for specific models
58
- if (modelName.includes("gpt-5-codex")) {
59
- // gpt-5-codex model sets temperature to undefined
60
- config.temperature = undefined;
58
+ if (modelName.includes("gpt-5")) {
59
+ // gpt-5 models should not have temperature field
60
+ delete config.temperature;
61
61
  }
62
62
  return config;
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"globTool.d.ts","sourceRoot":"","sources":["../../src/tools/globTool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAKtE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UAoItB,CAAC"}
1
+ {"version":3,"file":"globTool.d.ts","sourceRoot":"","sources":["../../src/tools/globTool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAUtE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UA4ItB,CAAC"}
@@ -3,6 +3,10 @@ import { stat } from "fs/promises";
3
3
  import { resolvePath, getDisplayPath } from "../utils/path.js";
4
4
  import { getGlobIgnorePatterns } from "../utils/fileFilter.js";
5
5
  import { GLOB_TOOL_NAME } from "../constants/tools.js";
6
+ /**
7
+ * Maximum number of files returned by glob tool
8
+ */
9
+ const MAX_GLOB_RESULTS = 1000;
6
10
  /**
7
11
  * Glob Tool Plugin - Fast file pattern matching
8
12
  */
@@ -90,14 +94,20 @@ export const globTool = {
90
94
  .value)
91
95
  .sort((a, b) => b.mtime.getTime() - a.mtime.getTime()) // Most recently modified files first
92
96
  .map((item) => item.path);
97
+ const totalCount = sortedFiles.length;
98
+ const finalFiles = sortedFiles.slice(0, MAX_GLOB_RESULTS);
93
99
  // Format output
94
- const output = sortedFiles
100
+ const output = finalFiles
95
101
  .map((file, index) => `${index + 1}. ${file}`)
96
102
  .join("\n");
103
+ const isTruncated = totalCount > MAX_GLOB_RESULTS;
104
+ const shortResult = isTruncated
105
+ ? `Found ${totalCount} files (showing first ${MAX_GLOB_RESULTS})`
106
+ : `Found ${totalCount} file${totalCount === 1 ? "" : "s"}`;
97
107
  return {
98
108
  success: true,
99
109
  content: output,
100
- shortResult: `Found ${sortedFiles.length} file${sortedFiles.length === 1 ? "" : "s"}`,
110
+ shortResult,
101
111
  };
102
112
  }
103
113
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"commandArgumentParser.d.ts","sourceRoot":"","sources":["../../src/utils/commandArgumentParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA+DlE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,MAAM,CAsBR;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAsBA;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGtE"}
1
+ {"version":3,"file":"commandArgumentParser.d.ts","sourceRoot":"","sources":["../../src/utils/commandArgumentParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA+DlE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,MAAM,CA8BR;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAsBA;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGtE"}
@@ -68,6 +68,13 @@ export function parseCommandArguments(argsString) {
68
68
  * Substitute command parameters in content
69
69
  */
70
70
  export function substituteCommandParameters(content, argsString) {
71
+ if (!hasParameterPlaceholders(content)) {
72
+ if (!argsString.trim()) {
73
+ return content;
74
+ }
75
+ const separator = content && !/\s$/.test(content) ? " " : "";
76
+ return `${content}${separator}${argsString}`;
77
+ }
71
78
  const args = parseCommandArguments(argsString);
72
79
  let result = content;
73
80
  // Replace $ARGUMENTS with all arguments
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-agent-sdk",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "SDK for building AI-powered development tools and agents",
5
5
  "keywords": [
6
6
  "ai",
@@ -117,15 +117,10 @@ export class SlashCommandManager {
117
117
  }
118
118
 
119
119
  if (args) {
120
- if (hasParameterPlaceholders(processedContent)) {
121
- processedContent = substituteCommandParameters(
122
- processedContent,
123
- args,
124
- );
125
- } else {
126
- // If no placeholders, append arguments to the content
127
- processedContent = `${processedContent.trim()} ${args}`;
128
- }
120
+ processedContent = substituteCommandParameters(
121
+ processedContent,
122
+ args,
123
+ );
129
124
  }
130
125
 
131
126
  await this.executeCustomCommandInMainAgent(
@@ -240,15 +235,10 @@ export class SlashCommandManager {
240
235
  }
241
236
 
242
237
  if (args) {
243
- if (hasParameterPlaceholders(processedContent)) {
244
- processedContent = substituteCommandParameters(
245
- processedContent,
246
- args,
247
- );
248
- } else {
249
- // If no placeholders, append arguments to the content
250
- processedContent = `${processedContent.trim()} ${args}`;
251
- }
238
+ processedContent = substituteCommandParameters(
239
+ processedContent,
240
+ args,
241
+ );
252
242
  }
253
243
 
254
244
  await this.executeCustomCommandInMainAgent(
@@ -132,9 +132,9 @@ function getModelConfig(
132
132
  };
133
133
 
134
134
  // Configuration rules for specific models
135
- if (modelName.includes("gpt-5-codex")) {
136
- // gpt-5-codex model sets temperature to undefined
137
- config.temperature = undefined;
135
+ if (modelName.includes("gpt-5")) {
136
+ // gpt-5 models should not have temperature field
137
+ delete config.temperature;
138
138
  }
139
139
 
140
140
  return config;
@@ -5,6 +5,11 @@ import { resolvePath, getDisplayPath } from "../utils/path.js";
5
5
  import { getGlobIgnorePatterns } from "../utils/fileFilter.js";
6
6
  import { GLOB_TOOL_NAME } from "../constants/tools.js";
7
7
 
8
+ /**
9
+ * Maximum number of files returned by glob tool
10
+ */
11
+ const MAX_GLOB_RESULTS = 1000;
12
+
8
13
  /**
9
14
  * Glob Tool Plugin - Fast file pattern matching
10
15
  */
@@ -109,15 +114,23 @@ export const globTool: ToolPlugin = {
109
114
  .sort((a, b) => b.mtime.getTime() - a.mtime.getTime()) // Most recently modified files first
110
115
  .map((item) => item.path);
111
116
 
117
+ const totalCount = sortedFiles.length;
118
+ const finalFiles = sortedFiles.slice(0, MAX_GLOB_RESULTS);
119
+
112
120
  // Format output
113
- const output = sortedFiles
121
+ const output = finalFiles
114
122
  .map((file, index) => `${index + 1}. ${file}`)
115
123
  .join("\n");
116
124
 
125
+ const isTruncated = totalCount > MAX_GLOB_RESULTS;
126
+ const shortResult = isTruncated
127
+ ? `Found ${totalCount} files (showing first ${MAX_GLOB_RESULTS})`
128
+ : `Found ${totalCount} file${totalCount === 1 ? "" : "s"}`;
129
+
117
130
  return {
118
131
  success: true,
119
132
  content: output,
120
- shortResult: `Found ${sortedFiles.length} file${sortedFiles.length === 1 ? "" : "s"}`,
133
+ shortResult,
121
134
  };
122
135
  } catch (error) {
123
136
  return {
@@ -83,6 +83,14 @@ export function substituteCommandParameters(
83
83
  content: string,
84
84
  argsString: string,
85
85
  ): string {
86
+ if (!hasParameterPlaceholders(content)) {
87
+ if (!argsString.trim()) {
88
+ return content;
89
+ }
90
+ const separator = content && !/\s$/.test(content) ? " " : "";
91
+ return `${content}${separator}${argsString}`;
92
+ }
93
+
86
94
  const args = parseCommandArguments(argsString);
87
95
 
88
96
  let result = content;