wave-agent-sdk 0.9.2 → 0.9.4
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/plugin.d.ts +4 -0
- package/dist/core/plugin.d.ts.map +1 -1
- package/dist/core/plugin.js +6 -0
- package/dist/core/session.d.ts +1 -1
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/managers/liveConfigManager.d.ts +1 -5
- package/dist/managers/liveConfigManager.d.ts.map +1 -1
- package/dist/managers/liveConfigManager.js +12 -126
- package/dist/managers/permissionManager.d.ts.map +1 -1
- package/dist/managers/permissionManager.js +27 -2
- package/dist/managers/pluginManager.d.ts.map +1 -1
- package/dist/managers/pluginManager.js +4 -0
- package/dist/managers/skillManager.d.ts.map +1 -1
- package/dist/managers/skillManager.js +3 -1
- package/dist/managers/slashCommandManager.d.ts.map +1 -1
- package/dist/managers/slashCommandManager.js +0 -8
- package/dist/services/GitService.d.ts.map +1 -1
- package/dist/services/GitService.js +6 -0
- package/dist/services/MarketplaceService.d.ts +11 -1
- package/dist/services/MarketplaceService.d.ts.map +1 -1
- package/dist/services/MarketplaceService.js +68 -3
- package/dist/services/configurationService.d.ts +1 -20
- package/dist/services/configurationService.d.ts.map +1 -1
- package/dist/services/configurationService.js +14 -93
- package/dist/services/pluginLoader.d.ts.map +1 -1
- package/dist/services/pluginLoader.js +1 -6
- package/dist/tools/exitPlanMode.d.ts.map +1 -1
- package/dist/tools/exitPlanMode.js +7 -0
- package/dist/types/commands.d.ts +0 -1
- package/dist/types/commands.d.ts.map +1 -1
- package/dist/types/history.d.ts +1 -0
- package/dist/types/history.d.ts.map +1 -1
- package/dist/types/marketplace.d.ts +1 -0
- package/dist/types/marketplace.d.ts.map +1 -1
- package/dist/types/permissions.d.ts +1 -0
- package/dist/types/permissions.d.ts.map +1 -1
- package/dist/types/permissions.js +1 -0
- package/dist/utils/bashParser.d.ts.map +1 -1
- package/dist/utils/bashParser.js +7 -0
- package/dist/utils/configPaths.d.ts +5 -5
- package/dist/utils/configPaths.js +6 -6
- package/dist/utils/promptHistory.d.ts +9 -3
- package/dist/utils/promptHistory.d.ts.map +1 -1
- package/dist/utils/promptHistory.js +16 -7
- package/package.json +1 -1
- package/src/core/plugin.ts +7 -0
- package/src/core/session.ts +1 -0
- package/src/managers/liveConfigManager.ts +20 -163
- package/src/managers/permissionManager.ts +32 -2
- package/src/managers/pluginManager.ts +6 -0
- package/src/managers/skillManager.ts +4 -1
- package/src/managers/slashCommandManager.ts +0 -16
- package/src/services/GitService.ts +10 -0
- package/src/services/MarketplaceService.ts +95 -3
- package/src/services/configurationService.ts +14 -116
- package/src/services/pluginLoader.ts +1 -7
- package/src/tools/exitPlanMode.ts +7 -0
- package/src/types/commands.ts +0 -3
- package/src/types/history.ts +1 -0
- package/src/types/marketplace.ts +1 -0
- package/src/types/permissions.ts +2 -0
- package/src/utils/bashParser.ts +7 -0
- package/src/utils/configPaths.ts +6 -6
- package/src/utils/promptHistory.ts +27 -6
|
@@ -36,41 +36,27 @@ export class ConfigurationService {
|
|
|
36
36
|
*/
|
|
37
37
|
async loadMergedConfiguration(workdir) {
|
|
38
38
|
try {
|
|
39
|
-
const userConfigPaths = getUserConfigPaths();
|
|
40
|
-
const projectConfigPaths = getProjectConfigPaths(workdir);
|
|
41
39
|
// Use the merged configuration function (this loads user and project configs internally)
|
|
42
40
|
const mergedConfig = loadMergedWaveConfig(workdir);
|
|
43
|
-
// Track loading context for better error messages by checking which files exist
|
|
44
|
-
const loadingContext = [];
|
|
45
|
-
const userPath = userConfigPaths.find((path) => existsSync(path));
|
|
46
|
-
if (userPath) {
|
|
47
|
-
loadingContext.push(`user config from ${userPath}`);
|
|
48
|
-
}
|
|
49
|
-
const projectPath = projectConfigPaths.find((path) => existsSync(path));
|
|
50
|
-
if (projectPath) {
|
|
51
|
-
loadingContext.push(`project config from ${projectPath}`);
|
|
52
|
-
}
|
|
53
41
|
if (!mergedConfig) {
|
|
54
|
-
const message = loadingContext.length > 0
|
|
55
|
-
? `No valid configuration found despite attempting to load: ${loadingContext.join(", ")}`
|
|
56
|
-
: "No configuration files found in user or project directories";
|
|
57
42
|
// Still set system environment variables even if no config is found
|
|
58
43
|
const env = { WAVE_PROJECT_DIR: workdir };
|
|
59
44
|
this.setEnvironmentVars(env);
|
|
60
45
|
return {
|
|
61
46
|
configuration: { env },
|
|
62
47
|
success: true, // No config is valid
|
|
63
|
-
warnings: [
|
|
48
|
+
warnings: [
|
|
49
|
+
"No configuration files found in user or project directories",
|
|
50
|
+
],
|
|
64
51
|
};
|
|
65
52
|
}
|
|
66
53
|
// Comprehensive validation
|
|
67
54
|
const validation = this.validateConfiguration(mergedConfig);
|
|
68
55
|
if (!validation.isValid) {
|
|
69
|
-
const sourcePaths = loadingContext.join(" and ");
|
|
70
56
|
return {
|
|
71
57
|
configuration: null,
|
|
72
58
|
success: false,
|
|
73
|
-
error: `Merged configuration validation failed
|
|
59
|
+
error: `Merged configuration validation failed: ${validation.errors.join(", ")}`,
|
|
74
60
|
warnings: validation.warnings,
|
|
75
61
|
};
|
|
76
62
|
}
|
|
@@ -83,11 +69,10 @@ export class ConfigurationService {
|
|
|
83
69
|
};
|
|
84
70
|
this.setEnvironmentVars(env);
|
|
85
71
|
mergedConfig.env = env;
|
|
86
|
-
const sourcePaths = loadingContext.join(" and ");
|
|
87
72
|
return {
|
|
88
73
|
configuration: mergedConfig,
|
|
89
74
|
success: true,
|
|
90
|
-
sourcePath:
|
|
75
|
+
sourcePath: "merged configuration",
|
|
91
76
|
warnings: validation.warnings,
|
|
92
77
|
};
|
|
93
78
|
}
|
|
@@ -260,12 +245,6 @@ export class ConfigurationService {
|
|
|
260
245
|
return result;
|
|
261
246
|
}
|
|
262
247
|
// Utility operations
|
|
263
|
-
/**
|
|
264
|
-
* Get currently loaded configuration
|
|
265
|
-
*/
|
|
266
|
-
getCurrentConfiguration() {
|
|
267
|
-
return this.currentConfiguration;
|
|
268
|
-
}
|
|
269
248
|
/**
|
|
270
249
|
* Set environment variables from configuration
|
|
271
250
|
* This replaces direct process.env modification
|
|
@@ -318,15 +297,6 @@ export class ConfigurationService {
|
|
|
318
297
|
else {
|
|
319
298
|
resolvedBaseURL = this.env.WAVE_BASE_URL || "";
|
|
320
299
|
}
|
|
321
|
-
// If we have a parent configuration, use it as a fallback for API key and base URL
|
|
322
|
-
if (this.currentConfiguration?.env) {
|
|
323
|
-
if (resolvedApiKey === undefined) {
|
|
324
|
-
resolvedApiKey = this.currentConfiguration.env.WAVE_API_KEY;
|
|
325
|
-
}
|
|
326
|
-
if (!resolvedBaseURL) {
|
|
327
|
-
resolvedBaseURL = this.currentConfiguration.env.WAVE_BASE_URL || "";
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
300
|
// Fallback to process.env if still not resolved (for dynamic updates in tests)
|
|
331
301
|
if (resolvedApiKey === undefined) {
|
|
332
302
|
resolvedApiKey = process.env.WAVE_API_KEY;
|
|
@@ -376,16 +346,10 @@ export class ConfigurationService {
|
|
|
376
346
|
const DEFAULT_FAST_MODEL = "gemini-2.5-flash";
|
|
377
347
|
// Resolve agent model: override > options > env (settings.json) > process.env > default
|
|
378
348
|
let resolvedAgentModel = model || this.options.model || this.env.WAVE_MODEL;
|
|
379
|
-
if (!resolvedAgentModel && this.currentConfiguration?.env?.WAVE_MODEL) {
|
|
380
|
-
resolvedAgentModel = this.currentConfiguration.env.WAVE_MODEL;
|
|
381
|
-
}
|
|
382
349
|
resolvedAgentModel =
|
|
383
350
|
resolvedAgentModel || process.env.WAVE_MODEL || DEFAULT_AGENT_MODEL;
|
|
384
351
|
// Resolve fast model: override > options > env (settings.json) > process.env > default
|
|
385
352
|
let resolvedFastModel = fastModel || this.options.fastModel || this.env.WAVE_FAST_MODEL;
|
|
386
|
-
if (!resolvedFastModel && this.currentConfiguration?.env?.WAVE_FAST_MODEL) {
|
|
387
|
-
resolvedFastModel = this.currentConfiguration.env.WAVE_FAST_MODEL;
|
|
388
|
-
}
|
|
389
353
|
resolvedFastModel =
|
|
390
354
|
resolvedFastModel || process.env.WAVE_FAST_MODEL || DEFAULT_FAST_MODEL;
|
|
391
355
|
// Resolve max output tokens
|
|
@@ -502,7 +466,7 @@ export class ConfigurationService {
|
|
|
502
466
|
};
|
|
503
467
|
}
|
|
504
468
|
/**
|
|
505
|
-
* Add a permission rule to the
|
|
469
|
+
* Add a permission rule to the local settings.local.json
|
|
506
470
|
*/
|
|
507
471
|
async addAllowedRule(workdir, rule) {
|
|
508
472
|
const localConfigPath = path.join(workdir, ".wave", "settings.local.json");
|
|
@@ -541,13 +505,13 @@ export class ConfigurationService {
|
|
|
541
505
|
}
|
|
542
506
|
let configPath;
|
|
543
507
|
if (scope === "user") {
|
|
544
|
-
configPath = getUserConfigPaths()[
|
|
508
|
+
configPath = getUserConfigPaths()[0]; // settings.json
|
|
545
509
|
}
|
|
546
510
|
else if (scope === "project") {
|
|
547
511
|
configPath = getProjectConfigPaths(workdir)[1]; // settings.json
|
|
548
512
|
}
|
|
549
513
|
else {
|
|
550
|
-
configPath = getProjectConfigPaths(workdir)[0]; // settings.local.json
|
|
514
|
+
configPath = getProjectConfigPaths(workdir)[0]; // local settings.local.json
|
|
551
515
|
}
|
|
552
516
|
// Ensure directory exists
|
|
553
517
|
const configDir = path.dirname(configPath);
|
|
@@ -579,13 +543,13 @@ export class ConfigurationService {
|
|
|
579
543
|
}
|
|
580
544
|
let configPath;
|
|
581
545
|
if (scope === "user") {
|
|
582
|
-
configPath = getUserConfigPaths()[
|
|
546
|
+
configPath = getUserConfigPaths()[0]; // settings.json
|
|
583
547
|
}
|
|
584
548
|
else if (scope === "project") {
|
|
585
549
|
configPath = getProjectConfigPaths(workdir)[1]; // settings.json
|
|
586
550
|
}
|
|
587
551
|
else {
|
|
588
|
-
configPath = getProjectConfigPaths(workdir)[0]; // settings.local.json
|
|
552
|
+
configPath = getProjectConfigPaths(workdir)[0]; // local settings.local.json
|
|
589
553
|
}
|
|
590
554
|
if (!existsSync(configPath)) {
|
|
591
555
|
return; // Nothing to remove
|
|
@@ -710,21 +674,6 @@ export function loadWaveConfigFromFile(filePath) {
|
|
|
710
674
|
try {
|
|
711
675
|
const content = readFileSync(filePath, "utf-8");
|
|
712
676
|
const config = JSON.parse(content);
|
|
713
|
-
// Validate basic structure
|
|
714
|
-
if (!config || typeof config !== "object") {
|
|
715
|
-
throw new Error(`Invalid configuration structure in ${filePath}`);
|
|
716
|
-
}
|
|
717
|
-
// Validate environment variables if present
|
|
718
|
-
if (config.env !== undefined) {
|
|
719
|
-
const envValidation = validateEnvironmentConfig(config.env, filePath);
|
|
720
|
-
if (!envValidation.isValid) {
|
|
721
|
-
throw new Error(`Environment variable validation failed in ${filePath}: ${envValidation.errors.join(", ")}`);
|
|
722
|
-
}
|
|
723
|
-
// Log warnings if any
|
|
724
|
-
if (envValidation.warnings.length > 0) {
|
|
725
|
-
console.warn(`Environment variable warnings in ${filePath}:\n- ${envValidation.warnings.join("\n- ")}`);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
677
|
return {
|
|
729
678
|
hooks: config.hooks || undefined,
|
|
730
679
|
env: config.env || undefined,
|
|
@@ -744,48 +693,20 @@ export function loadWaveConfigFromFile(filePath) {
|
|
|
744
693
|
throw error;
|
|
745
694
|
}
|
|
746
695
|
}
|
|
747
|
-
/**
|
|
748
|
-
* Load Wave configuration from multiple file paths in priority order
|
|
749
|
-
* Returns the first valid configuration found, or null if none exist
|
|
750
|
-
*/
|
|
751
|
-
export function loadWaveConfigFromFiles(filePaths) {
|
|
752
|
-
for (const filePath of filePaths) {
|
|
753
|
-
const config = loadWaveConfigFromFile(filePath);
|
|
754
|
-
if (config !== null) {
|
|
755
|
-
return config;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
return null;
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* Load user-specific Wave configuration
|
|
762
|
-
* Checks .local.json first, then falls back to .json
|
|
763
|
-
*/
|
|
764
|
-
export function loadUserWaveConfig() {
|
|
765
|
-
return loadWaveConfigFromFiles(getUserConfigPaths());
|
|
766
|
-
}
|
|
767
|
-
/**
|
|
768
|
-
* Load project-specific Wave configuration
|
|
769
|
-
* Checks .local.json first, then falls back to .json
|
|
770
|
-
*/
|
|
771
|
-
export function loadProjectWaveConfig(workdir) {
|
|
772
|
-
return loadWaveConfigFromFiles(getProjectConfigPaths(workdir));
|
|
773
|
-
}
|
|
774
696
|
/**
|
|
775
697
|
* Load and merge Wave configuration from both user and project sources
|
|
776
698
|
* Project configuration takes precedence over user configuration
|
|
777
699
|
* Checks .local.json files first, then falls back to .json files
|
|
778
700
|
*/
|
|
779
701
|
export function loadMergedWaveConfig(workdir) {
|
|
780
|
-
const userPaths = getUserConfigPaths(); // [
|
|
702
|
+
const userPaths = getUserConfigPaths(); // [json]
|
|
781
703
|
const projectPaths = getProjectConfigPaths(workdir); // [local, json]
|
|
782
704
|
// Priority order (lowest to highest):
|
|
783
|
-
// user settings.json ->
|
|
705
|
+
// user settings.json -> project settings.json -> local settings.local.json
|
|
784
706
|
const pathsToLoad = [
|
|
785
|
-
userPaths[
|
|
786
|
-
userPaths[0], // user settings.local.json
|
|
707
|
+
userPaths[0], // user settings.json
|
|
787
708
|
projectPaths[1], // project settings.json
|
|
788
|
-
projectPaths[0], //
|
|
709
|
+
projectPaths[0], // local settings.local.json
|
|
789
710
|
];
|
|
790
711
|
const configs = [];
|
|
791
712
|
for (const path of pathsToLoad) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginLoader.d.ts","sourceRoot":"","sources":["../../src/services/pluginLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,SAAS,EACT,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAI3B,qBAAa,YAAY;IACvB;;;OAGG;WACU,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA6CtE;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,EAAE;
|
|
1
|
+
{"version":3,"file":"pluginLoader.d.ts","sourceRoot":"","sources":["../../src/services/pluginLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,SAAS,EACT,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAI3B,qBAAa,YAAY;IACvB;;;OAGG;WACU,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA6CtE;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAK7D;;;OAGG;WACU,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAsC7D;;OAEG;WACU,aAAa,CACxB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAUjC;;OAEG;WACU,aAAa,CACxB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAUjC;;OAEG;WACU,eAAe,CAC1B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAUhD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAgBhC"}
|
|
@@ -45,12 +45,7 @@ export class PluginLoader {
|
|
|
45
45
|
*/
|
|
46
46
|
static loadCommands(pluginPath) {
|
|
47
47
|
const commandsPath = path.join(pluginPath, "commands");
|
|
48
|
-
|
|
49
|
-
// Attach plugin path to each command for WAVE_PLUGIN_ROOT support
|
|
50
|
-
return commands.map((command) => ({
|
|
51
|
-
...command,
|
|
52
|
-
pluginPath,
|
|
53
|
-
}));
|
|
48
|
+
return scanCommandsDirectory(commandsPath);
|
|
54
49
|
}
|
|
55
50
|
/**
|
|
56
51
|
* Load skills from a plugin's skills directory
|
|
@@ -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;
|
|
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,UAkH9B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from "fs/promises";
|
|
2
2
|
import { logger } from "../utils/globalLogger.js";
|
|
3
3
|
import { EXIT_PLAN_MODE_TOOL_NAME } from "../constants/tools.js";
|
|
4
|
+
import { OPERATION_CANCELLED_BY_USER } from "../types/permissions.js";
|
|
4
5
|
/**
|
|
5
6
|
* Exit Plan Mode Tool Plugin
|
|
6
7
|
*/
|
|
@@ -75,6 +76,12 @@ Ensure your plan is complete and unambiguous:
|
|
|
75
76
|
const permissionContext = context.permissionManager.createContext(EXIT_PLAN_MODE_TOOL_NAME, context.permissionMode || "plan", context.canUseToolCallback, { plan_content: planContent });
|
|
76
77
|
const permissionResult = await context.permissionManager.checkPermission(permissionContext);
|
|
77
78
|
if (permissionResult.behavior === "deny") {
|
|
79
|
+
if (permissionResult.message === OPERATION_CANCELLED_BY_USER) {
|
|
80
|
+
return {
|
|
81
|
+
success: false,
|
|
82
|
+
content: OPERATION_CANCELLED_BY_USER,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
78
85
|
return {
|
|
79
86
|
success: false,
|
|
80
87
|
content: `Please update your proposal based on the following user feedback: ${permissionResult.message || "Plan rejected by user"}`,
|
package/dist/types/commands.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/types/commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/types/commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC"}
|
package/dist/types/history.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/types/history.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC"}
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/types/history.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../../src/types/marketplace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED,MAAM,MAAM,iBAAiB,GACzB;IACE,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GACD;IACE,MAAM,EAAE,KAAK,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEN,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../../src/types/marketplace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED,MAAM,MAAM,iBAAiB,GACzB;IACE,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GACD;IACE,MAAM,EAAE,KAAK,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEN,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B"}
|
|
@@ -39,5 +39,6 @@ export interface ToolPermissionContext {
|
|
|
39
39
|
export declare const RESTRICTED_TOOLS: readonly ["Edit", "Bash", "Write", "ExitPlanMode", "AskUserQuestion"];
|
|
40
40
|
/** Type for restricted tool names */
|
|
41
41
|
export type RestrictedTool = (typeof RESTRICTED_TOOLS)[number];
|
|
42
|
+
export declare const OPERATION_CANCELLED_BY_USER = "Operation cancelled by user";
|
|
42
43
|
export type { AskUserQuestion, AskUserQuestionInput, AskUserQuestionOption };
|
|
43
44
|
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AASpB,oCAAoC;AACpC,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,mBAAmB,GACnB,aAAa,GACb,MAAM,CAAC;AAEX,mCAAmC;AACnC,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,cAAc,CAAC;IACnC,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,qBAAqB,KAC3B,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,mDAAmD;AACnD,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2FAA2F;IAC3F,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,uEAMnB,CAAC;AAEX,qCAAqC;AACrC,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AASpB,oCAAoC;AACpC,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,mBAAmB,GACnB,aAAa,GACb,MAAM,CAAC;AAEX,mCAAmC;AACnC,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,cAAc,CAAC;IACnC,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,qBAAqB,KAC3B,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,mDAAmD;AACnD,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2FAA2F;IAC3F,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,uEAMnB,CAAC;AAEX,qCAAqC;AACrC,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bashParser.d.ts","sourceRoot":"","sources":["../../src/utils/bashParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAmH1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2CpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAuHzD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAsC7D;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAa9B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"bashParser.d.ts","sourceRoot":"","sources":["../../src/utils/bashParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAmH1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2CpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAuHzD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAsC7D;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAa9B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8L7D"}
|
package/dist/utils/bashParser.js
CHANGED
|
@@ -424,6 +424,13 @@ export function getSmartPrefix(command) {
|
|
|
424
424
|
"stash",
|
|
425
425
|
];
|
|
426
426
|
if (safeGitSubcommands.includes(subCommand)) {
|
|
427
|
+
if (subCommand === "branch") {
|
|
428
|
+
// Check for destructive flags
|
|
429
|
+
const destructiveFlags = ["-d", "-D", "--delete"];
|
|
430
|
+
if (tokens.some((t) => destructiveFlags.includes(t))) {
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
427
434
|
prefixParts.push(subCommand);
|
|
428
435
|
return prefixParts.join(" ");
|
|
429
436
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Configuration Path Utilities
|
|
3
3
|
*
|
|
4
4
|
* Centralized utilities for resolving Wave configuration file paths.
|
|
5
|
-
* Supports both regular settings.json and settings.local.json with proper priority.
|
|
5
|
+
* Supports both regular settings.json and local settings.local.json with proper priority.
|
|
6
6
|
*
|
|
7
7
|
* Priority system:
|
|
8
|
-
* - User configs: ~/.wave/settings.
|
|
9
|
-
* -
|
|
8
|
+
* - User configs: ~/.wave/settings.json
|
|
9
|
+
* - Local configs: {workdir}/.wave/settings.local.json > {workdir}/.wave/settings.json
|
|
10
10
|
* - Project configs override user configs (existing behavior)
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
@@ -21,7 +21,7 @@ export declare function getUserConfigPath(): string;
|
|
|
21
21
|
export declare function getProjectConfigPath(workdir: string): string;
|
|
22
22
|
/**
|
|
23
23
|
* Get the user-specific configuration file paths in priority order
|
|
24
|
-
* Returns array with .
|
|
24
|
+
* Returns array with .json only
|
|
25
25
|
*/
|
|
26
26
|
export declare function getUserConfigPaths(): string[];
|
|
27
27
|
/**
|
|
@@ -29,7 +29,7 @@ export declare function getUserConfigPaths(): string[];
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function getPluginsDir(): string;
|
|
31
31
|
/**
|
|
32
|
-
* Get the
|
|
32
|
+
* Get the local configuration file paths in priority order
|
|
33
33
|
* Returns array with .local.json first, then .json
|
|
34
34
|
*/
|
|
35
35
|
export declare function getProjectConfigPaths(workdir: string): string[];
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Configuration Path Utilities
|
|
3
3
|
*
|
|
4
4
|
* Centralized utilities for resolving Wave configuration file paths.
|
|
5
|
-
* Supports both regular settings.json and settings.local.json with proper priority.
|
|
5
|
+
* Supports both regular settings.json and local settings.local.json with proper priority.
|
|
6
6
|
*
|
|
7
7
|
* Priority system:
|
|
8
|
-
* - User configs: ~/.wave/settings.
|
|
9
|
-
* -
|
|
8
|
+
* - User configs: ~/.wave/settings.json
|
|
9
|
+
* - Local configs: {workdir}/.wave/settings.local.json > {workdir}/.wave/settings.json
|
|
10
10
|
* - Project configs override user configs (existing behavior)
|
|
11
11
|
*/
|
|
12
12
|
import { join } from "path";
|
|
@@ -28,11 +28,11 @@ export function getProjectConfigPath(workdir) {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Get the user-specific configuration file paths in priority order
|
|
31
|
-
* Returns array with .
|
|
31
|
+
* Returns array with .json only
|
|
32
32
|
*/
|
|
33
33
|
export function getUserConfigPaths() {
|
|
34
34
|
const baseDir = join(homedir(), ".wave");
|
|
35
|
-
return [join(baseDir, "settings.
|
|
35
|
+
return [join(baseDir, "settings.json")];
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Get the plugins directory path
|
|
@@ -41,7 +41,7 @@ export function getPluginsDir() {
|
|
|
41
41
|
return join(homedir(), ".wave", "plugins");
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Get the
|
|
44
|
+
* Get the local configuration file paths in priority order
|
|
45
45
|
* Returns array with .local.json first, then .json
|
|
46
46
|
*/
|
|
47
47
|
export function getProjectConfigPaths(workdir) {
|
|
@@ -3,7 +3,7 @@ export declare class PromptHistoryManager {
|
|
|
3
3
|
/**
|
|
4
4
|
* Add a new prompt to history
|
|
5
5
|
*/
|
|
6
|
-
static addEntry(prompt: string, sessionId?: string, longTextMap?: Record<string, string
|
|
6
|
+
static addEntry(prompt: string, sessionId?: string, longTextMap?: Record<string, string>, workdir?: string): Promise<void>;
|
|
7
7
|
/**
|
|
8
8
|
* Trim history file to MAX_HISTORY_ENTRIES
|
|
9
9
|
*/
|
|
@@ -11,10 +11,16 @@ export declare class PromptHistoryManager {
|
|
|
11
11
|
/**
|
|
12
12
|
* Get all history entries
|
|
13
13
|
*/
|
|
14
|
-
static getHistory(
|
|
14
|
+
static getHistory(options?: {
|
|
15
|
+
sessionId?: string | string[];
|
|
16
|
+
workdir?: string;
|
|
17
|
+
}): Promise<PromptEntry[]>;
|
|
15
18
|
/**
|
|
16
19
|
* Search history by query
|
|
17
20
|
*/
|
|
18
|
-
static searchHistory(query: string,
|
|
21
|
+
static searchHistory(query: string, options?: {
|
|
22
|
+
sessionId?: string | string[];
|
|
23
|
+
workdir?: string;
|
|
24
|
+
}): Promise<PromptEntry[]>;
|
|
19
25
|
}
|
|
20
26
|
//# sourceMappingURL=promptHistory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptHistory.d.ts","sourceRoot":"","sources":["../../src/utils/promptHistory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAiBlD,qBAAa,oBAAoB;IAC/B;;OAEG;WACU,QAAQ,CACnB,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"promptHistory.d.ts","sourceRoot":"","sources":["../../src/utils/promptHistory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAiBlD,qBAAa,oBAAoB;IAC/B;;OAEG;WACU,QAAQ,CACnB,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IA0BhB;;OAEG;mBACkB,WAAW;IAoBhC;;OAEG;WACU,UAAU,CAAC,OAAO,CAAC,EAAE;QAChC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IA0D1B;;OAEG;WACU,aAAa,CACxB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GACA,OAAO,CAAC,WAAW,EAAE,CAAC;CAgB1B"}
|
|
@@ -19,7 +19,7 @@ export class PromptHistoryManager {
|
|
|
19
19
|
/**
|
|
20
20
|
* Add a new prompt to history
|
|
21
21
|
*/
|
|
22
|
-
static async addEntry(prompt, sessionId, longTextMap) {
|
|
22
|
+
static async addEntry(prompt, sessionId, longTextMap, workdir) {
|
|
23
23
|
try {
|
|
24
24
|
if (!prompt.trim())
|
|
25
25
|
return;
|
|
@@ -29,6 +29,7 @@ export class PromptHistoryManager {
|
|
|
29
29
|
timestamp: Date.now(),
|
|
30
30
|
sessionId,
|
|
31
31
|
longTextMap,
|
|
32
|
+
workdir,
|
|
32
33
|
};
|
|
33
34
|
const line = JSON.stringify(entry) + "\n";
|
|
34
35
|
await fs.promises.appendFile(PROMPT_HISTORY_FILE, line, "utf-8");
|
|
@@ -63,7 +64,7 @@ export class PromptHistoryManager {
|
|
|
63
64
|
/**
|
|
64
65
|
* Get all history entries
|
|
65
66
|
*/
|
|
66
|
-
static async getHistory(
|
|
67
|
+
static async getHistory(options) {
|
|
67
68
|
try {
|
|
68
69
|
if (!fs.existsSync(PROMPT_HISTORY_FILE)) {
|
|
69
70
|
return [];
|
|
@@ -82,9 +83,17 @@ export class PromptHistoryManager {
|
|
|
82
83
|
})
|
|
83
84
|
.filter((entry) => entry !== null);
|
|
84
85
|
// Filter by sessionId if provided
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
let filteredEntries = entries;
|
|
87
|
+
if (options?.sessionId) {
|
|
88
|
+
const sessionIds = Array.isArray(options.sessionId)
|
|
89
|
+
? options.sessionId
|
|
90
|
+
: [options.sessionId];
|
|
91
|
+
filteredEntries = filteredEntries.filter((entry) => entry.sessionId && sessionIds.includes(entry.sessionId));
|
|
92
|
+
}
|
|
93
|
+
// Filter by workdir if provided
|
|
94
|
+
if (options?.workdir) {
|
|
95
|
+
filteredEntries = filteredEntries.filter((entry) => entry.workdir === options.workdir);
|
|
96
|
+
}
|
|
88
97
|
// Deduplicate by prompt, keeping the most recent one
|
|
89
98
|
const uniqueEntries = [];
|
|
90
99
|
const seenPrompts = new Set();
|
|
@@ -106,9 +115,9 @@ export class PromptHistoryManager {
|
|
|
106
115
|
/**
|
|
107
116
|
* Search history by query
|
|
108
117
|
*/
|
|
109
|
-
static async searchHistory(query,
|
|
118
|
+
static async searchHistory(query, options) {
|
|
110
119
|
try {
|
|
111
|
-
const history = await this.getHistory(
|
|
120
|
+
const history = await this.getHistory(options);
|
|
112
121
|
if (!query.trim()) {
|
|
113
122
|
return history;
|
|
114
123
|
}
|
package/package.json
CHANGED
package/src/core/plugin.ts
CHANGED
|
@@ -96,6 +96,13 @@ export class PluginCore {
|
|
|
96
96
|
return await this.marketplaceService.updatePlugin(pluginId);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Toggles auto-update for a marketplace
|
|
101
|
+
*/
|
|
102
|
+
async toggleAutoUpdate(name: string, enabled: boolean): Promise<void> {
|
|
103
|
+
await this.marketplaceService.toggleAutoUpdate(name, enabled);
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
/**
|
|
100
107
|
* Lists all plugins from all registered marketplaces with their installation and enabled status
|
|
101
108
|
*/
|