wave-code 0.6.4 → 0.7.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/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/commands/plugin/disable.d.ts.map +1 -1
- package/dist/commands/plugin/disable.js +3 -10
- package/dist/commands/plugin/enable.d.ts.map +1 -1
- package/dist/commands/plugin/enable.js +3 -10
- package/dist/commands/plugin/install.d.ts.map +1 -1
- package/dist/commands/plugin/install.js +4 -11
- package/dist/commands/plugin/list.d.ts.map +1 -1
- package/dist/commands/plugin/list.js +5 -39
- package/dist/commands/plugin/marketplace.js +9 -9
- package/dist/commands/plugin/uninstall.d.ts.map +1 -1
- package/dist/commands/plugin/uninstall.js +4 -17
- package/dist/commands/plugin/update.js +3 -3
- package/dist/components/App.d.ts +1 -0
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +4 -4
- package/dist/components/BackgroundTaskManager.d.ts.map +1 -1
- package/dist/components/BackgroundTaskManager.js +14 -6
- package/dist/components/ConfirmationDetails.d.ts.map +1 -1
- package/dist/components/ConfirmationDetails.js +1 -5
- package/dist/components/DiffDisplay.d.ts.map +1 -1
- package/dist/components/DiffDisplay.js +2 -7
- package/dist/components/MessageItem.d.ts.map +1 -1
- package/dist/components/MessageItem.js +1 -1
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList.js +2 -18
- package/dist/contexts/useChat.d.ts +1 -0
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +3 -1
- package/dist/hooks/usePluginManager.d.ts.map +1 -1
- package/dist/hooks/usePluginManager.js +20 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/print-cli.d.ts +1 -0
- package/dist/print-cli.d.ts.map +1 -1
- package/dist/print-cli.js +2 -1
- package/dist/utils/toolParameterTransforms.d.ts +1 -5
- package/dist/utils/toolParameterTransforms.d.ts.map +1 -1
- package/dist/utils/toolParameterTransforms.js +0 -11
- package/package.json +2 -2
- package/src/cli.tsx +3 -0
- package/src/commands/plugin/disable.ts +3 -17
- package/src/commands/plugin/enable.ts +3 -17
- package/src/commands/plugin/install.ts +4 -18
- package/src/commands/plugin/list.ts +5 -55
- package/src/commands/plugin/marketplace.ts +9 -9
- package/src/commands/plugin/uninstall.ts +4 -26
- package/src/commands/plugin/update.ts +3 -3
- package/src/components/App.tsx +10 -2
- package/src/components/BackgroundTaskManager.tsx +49 -32
- package/src/components/ConfirmationDetails.tsx +0 -6
- package/src/components/DiffDisplay.tsx +2 -16
- package/src/components/MessageItem.tsx +2 -6
- package/src/components/MessageList.tsx +2 -30
- package/src/contexts/useChat.tsx +4 -0
- package/src/hooks/usePluginManager.ts +21 -57
- package/src/index.ts +17 -0
- package/src/print-cli.ts +3 -0
- package/src/utils/toolParameterTransforms.ts +0 -18
package/dist/cli.d.ts
CHANGED
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFjE"}
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { render } from "ink";
|
|
|
3
3
|
import { App } from "./components/App.js";
|
|
4
4
|
import { cleanupLogs } from "./utils/logger.js";
|
|
5
5
|
export async function startCli(options) {
|
|
6
|
-
const { restoreSessionId, continueLastSession, bypassPermissions, pluginDirs, } = options;
|
|
6
|
+
const { restoreSessionId, continueLastSession, bypassPermissions, pluginDirs, tools, } = options;
|
|
7
7
|
// Continue with ink-based UI for normal mode
|
|
8
8
|
// Global cleanup tracker
|
|
9
9
|
let isCleaningUp = false;
|
|
@@ -45,7 +45,7 @@ export async function startCli(options) {
|
|
|
45
45
|
cleanup();
|
|
46
46
|
});
|
|
47
47
|
// Render the application
|
|
48
|
-
const { unmount } = render(_jsx(App, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, bypassPermissions: bypassPermissions, pluginDirs: pluginDirs }));
|
|
48
|
+
const { unmount } = render(_jsx(App, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, bypassPermissions: bypassPermissions, pluginDirs: pluginDirs, tools: tools }));
|
|
49
49
|
// Store unmount function for cleanup when process exits normally
|
|
50
50
|
process.on("exit", () => {
|
|
51
51
|
if (!appUnmounted) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/disable.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/disable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEnD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,iBAeA"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginCore } from "wave-agent-sdk";
|
|
2
2
|
export async function disablePluginCommand(argv) {
|
|
3
3
|
const workdir = process.cwd();
|
|
4
|
-
const
|
|
5
|
-
const pluginManager = new PluginManager({ workdir });
|
|
6
|
-
const scopeManager = new PluginScopeManager({
|
|
7
|
-
workdir,
|
|
8
|
-
configurationService,
|
|
9
|
-
pluginManager,
|
|
10
|
-
});
|
|
11
|
-
const scope = argv.scope || scopeManager.findPluginScope(argv.plugin) || "user";
|
|
4
|
+
const pluginCore = new PluginCore(workdir);
|
|
12
5
|
try {
|
|
13
|
-
await
|
|
6
|
+
const scope = await pluginCore.disablePlugin(argv.plugin, argv.scope);
|
|
14
7
|
console.log(`Successfully disabled plugin: ${argv.plugin} in ${scope} scope`);
|
|
15
8
|
process.exit(0);
|
|
16
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/enable.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/enable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEnD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,iBAeA"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginCore } from "wave-agent-sdk";
|
|
2
2
|
export async function enablePluginCommand(argv) {
|
|
3
3
|
const workdir = process.cwd();
|
|
4
|
-
const
|
|
5
|
-
const pluginManager = new PluginManager({ workdir });
|
|
6
|
-
const scopeManager = new PluginScopeManager({
|
|
7
|
-
workdir,
|
|
8
|
-
configurationService,
|
|
9
|
-
pluginManager,
|
|
10
|
-
});
|
|
11
|
-
const scope = argv.scope || scopeManager.findPluginScope(argv.plugin) || "user";
|
|
4
|
+
const pluginCore = new PluginCore(workdir);
|
|
12
5
|
try {
|
|
13
|
-
await
|
|
6
|
+
const scope = await pluginCore.enablePlugin(argv.plugin, argv.scope);
|
|
14
7
|
console.log(`Successfully enabled plugin: ${argv.plugin} in ${scope} scope`);
|
|
15
8
|
process.exit(0);
|
|
16
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/install.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEnD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,iBAuBA"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginCore } from "wave-agent-sdk";
|
|
2
2
|
export async function installPluginCommand(argv) {
|
|
3
|
-
const marketplaceService = new MarketplaceService();
|
|
4
3
|
const workdir = process.cwd();
|
|
4
|
+
const pluginCore = new PluginCore(workdir);
|
|
5
5
|
try {
|
|
6
|
-
const installed = await
|
|
6
|
+
const installed = await pluginCore.installPlugin(argv.plugin);
|
|
7
7
|
console.log(`Successfully installed plugin: ${installed.name} v${installed.version} from ${installed.marketplace}`);
|
|
8
8
|
console.log(`Cache path: ${installed.cachePath}`);
|
|
9
9
|
if (argv.scope) {
|
|
10
|
-
const configurationService = new ConfigurationService();
|
|
11
|
-
const pluginManager = new PluginManager({ workdir });
|
|
12
|
-
const scopeManager = new PluginScopeManager({
|
|
13
|
-
workdir,
|
|
14
|
-
configurationService,
|
|
15
|
-
pluginManager,
|
|
16
|
-
});
|
|
17
10
|
const pluginId = `${installed.name}@${installed.marketplace}`;
|
|
18
|
-
await
|
|
11
|
+
await pluginCore.enablePlugin(pluginId, argv.scope);
|
|
19
12
|
console.log(`Plugin ${pluginId} enabled in ${argv.scope} scope`);
|
|
20
13
|
}
|
|
21
14
|
process.exit(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/list.ts"],"names":[],"mappings":"AAEA,wBAAsB,kBAAkB,kBA6BvC"}
|
|
@@ -1,48 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginCore } from "wave-agent-sdk";
|
|
2
2
|
export async function listPluginsCommand() {
|
|
3
|
-
const
|
|
4
|
-
const marketplaceService = new MarketplaceService();
|
|
5
|
-
const workdir = process.cwd();
|
|
6
|
-
const pluginManager = new PluginManager({
|
|
7
|
-
workdir,
|
|
8
|
-
configurationService,
|
|
9
|
-
});
|
|
10
|
-
const pluginScopeManager = new PluginScopeManager({
|
|
11
|
-
workdir,
|
|
12
|
-
configurationService,
|
|
13
|
-
pluginManager,
|
|
14
|
-
});
|
|
3
|
+
const pluginCore = new PluginCore(process.cwd());
|
|
15
4
|
try {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const mergedEnabled = configurationService.getMergedEnabledPlugins(workdir);
|
|
19
|
-
// Collect all plugins from all marketplaces
|
|
20
|
-
const allMarketplacePlugins = [];
|
|
21
|
-
for (const m of marketplaces) {
|
|
22
|
-
try {
|
|
23
|
-
const manifest = await marketplaceService.loadMarketplaceManifest(marketplaceService.getMarketplacePath(m));
|
|
24
|
-
manifest.plugins.forEach((p) => {
|
|
25
|
-
const pluginId = `${p.name}@${m.name}`;
|
|
26
|
-
const installed = installedPlugins.plugins.find((ip) => ip.name === p.name && ip.marketplace === m.name);
|
|
27
|
-
allMarketplacePlugins.push({
|
|
28
|
-
name: p.name,
|
|
29
|
-
marketplace: m.name,
|
|
30
|
-
installed: !!installed,
|
|
31
|
-
version: installed?.version,
|
|
32
|
-
scope: pluginScopeManager.findPluginScope(pluginId) || undefined,
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
// Skip marketplaces that fail to load
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (allMarketplacePlugins.length === 0) {
|
|
5
|
+
const { plugins, mergedEnabled } = await pluginCore.listPlugins();
|
|
6
|
+
if (plugins.length === 0) {
|
|
41
7
|
console.log("No plugins found in registered marketplaces.");
|
|
42
8
|
}
|
|
43
9
|
else {
|
|
44
10
|
console.log("Plugins:");
|
|
45
|
-
|
|
11
|
+
plugins.forEach((p) => {
|
|
46
12
|
const pluginId = `${p.name}@${p.marketplace}`;
|
|
47
13
|
const isEnabled = mergedEnabled[pluginId] !== false;
|
|
48
14
|
const status = p.installed
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginCore } from "wave-agent-sdk";
|
|
2
2
|
export async function addMarketplaceCommand(argv) {
|
|
3
|
-
const
|
|
3
|
+
const pluginCore = new PluginCore(process.cwd());
|
|
4
4
|
try {
|
|
5
|
-
const marketplace = await
|
|
5
|
+
const marketplace = await pluginCore.addMarketplace(argv.input);
|
|
6
6
|
const source = marketplace.source;
|
|
7
7
|
let sourceInfo = "";
|
|
8
8
|
if (source.source === "directory") {
|
|
@@ -24,9 +24,9 @@ export async function addMarketplaceCommand(argv) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
export async function listMarketplacesCommand() {
|
|
27
|
-
const
|
|
27
|
+
const pluginCore = new PluginCore(process.cwd());
|
|
28
28
|
try {
|
|
29
|
-
const marketplaces = await
|
|
29
|
+
const marketplaces = await pluginCore.listMarketplaces();
|
|
30
30
|
if (marketplaces.length === 0) {
|
|
31
31
|
console.log("No marketplaces registered.");
|
|
32
32
|
}
|
|
@@ -57,9 +57,9 @@ export async function listMarketplacesCommand() {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
export async function removeMarketplaceCommand(argv) {
|
|
60
|
-
const
|
|
60
|
+
const pluginCore = new PluginCore(process.cwd());
|
|
61
61
|
try {
|
|
62
|
-
await
|
|
62
|
+
await pluginCore.removeMarketplace(argv.name);
|
|
63
63
|
console.log(`Successfully removed marketplace: ${argv.name}`);
|
|
64
64
|
process.exit(0);
|
|
65
65
|
}
|
|
@@ -70,12 +70,12 @@ export async function removeMarketplaceCommand(argv) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
export async function updateMarketplaceCommand(argv) {
|
|
73
|
-
const
|
|
73
|
+
const pluginCore = new PluginCore(process.cwd());
|
|
74
74
|
try {
|
|
75
75
|
console.log(argv.name
|
|
76
76
|
? `Updating marketplace: ${argv.name}...`
|
|
77
77
|
: "Updating all marketplaces...");
|
|
78
|
-
await
|
|
78
|
+
await pluginCore.updateMarketplace(argv.name);
|
|
79
79
|
console.log("Successfully updated.");
|
|
80
80
|
process.exit(0);
|
|
81
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/uninstall.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/uninstall.ts"],"names":[],"mappings":"AAEA,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,iBAcpE"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginCore } from "wave-agent-sdk";
|
|
2
2
|
export async function uninstallPluginCommand(argv) {
|
|
3
|
-
const marketplaceService = new MarketplaceService();
|
|
4
3
|
const workdir = process.cwd();
|
|
4
|
+
const pluginCore = new PluginCore(workdir);
|
|
5
5
|
try {
|
|
6
|
-
await
|
|
6
|
+
await pluginCore.uninstallPlugin(argv.plugin);
|
|
7
7
|
console.log(`Successfully uninstalled plugin: ${argv.plugin}`);
|
|
8
|
-
|
|
9
|
-
const pluginManager = new PluginManager({ workdir });
|
|
10
|
-
const scopeManager = new PluginScopeManager({
|
|
11
|
-
workdir,
|
|
12
|
-
configurationService,
|
|
13
|
-
pluginManager,
|
|
14
|
-
});
|
|
15
|
-
try {
|
|
16
|
-
await scopeManager.removePluginFromAllScopes(argv.plugin);
|
|
17
|
-
console.log(`Cleaned up plugin configuration from all scopes`);
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.warn(`Warning: Could not clean up all plugin configurations: ${error instanceof Error ? error.message : String(error)}`);
|
|
21
|
-
}
|
|
8
|
+
console.log(`Cleaned up plugin configuration from all scopes`);
|
|
22
9
|
process.exit(0);
|
|
23
10
|
}
|
|
24
11
|
catch (error) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginCore } from "wave-agent-sdk";
|
|
2
2
|
export async function updatePluginCommand(argv) {
|
|
3
|
-
const
|
|
3
|
+
const pluginCore = new PluginCore(process.cwd());
|
|
4
4
|
try {
|
|
5
|
-
const updated = await
|
|
5
|
+
const updated = await pluginCore.updatePlugin(argv.plugin);
|
|
6
6
|
console.log(`Successfully updated plugin: ${updated.name} v${updated.version} from ${updated.marketplace}`);
|
|
7
7
|
console.log(`Cache path: ${updated.cachePath}`);
|
|
8
8
|
process.exit(0);
|
package/dist/components/App.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,QAAQ;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,QAAQ;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAiED,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAmBlC,CAAC"}
|
package/dist/components/App.js
CHANGED
|
@@ -4,8 +4,8 @@ import { useStdout } from "ink";
|
|
|
4
4
|
import { ChatInterface } from "./ChatInterface.js";
|
|
5
5
|
import { ChatProvider, useChat } from "../contexts/useChat.js";
|
|
6
6
|
import { AppProvider } from "../contexts/useAppConfig.js";
|
|
7
|
-
const AppWithProviders = ({ bypassPermissions, pluginDirs }) => {
|
|
8
|
-
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, pluginDirs: pluginDirs, children: _jsx(ChatInterfaceWithRemount, {}) }));
|
|
7
|
+
const AppWithProviders = ({ bypassPermissions, pluginDirs, tools }) => {
|
|
8
|
+
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, pluginDirs: pluginDirs, tools: tools, children: _jsx(ChatInterfaceWithRemount, {}) }));
|
|
9
9
|
};
|
|
10
10
|
const ChatInterfaceWithRemount = () => {
|
|
11
11
|
const { stdout } = useStdout();
|
|
@@ -43,6 +43,6 @@ const ChatInterfaceWithRemount = () => {
|
|
|
43
43
|
]);
|
|
44
44
|
return _jsx(ChatInterface, {}, remountKey);
|
|
45
45
|
};
|
|
46
|
-
export const App = ({ restoreSessionId, continueLastSession, bypassPermissions, pluginDirs, }) => {
|
|
47
|
-
return (_jsx(AppProvider, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, children: _jsx(AppWithProviders, { bypassPermissions: bypassPermissions, pluginDirs: pluginDirs }) }));
|
|
46
|
+
export const App = ({ restoreSessionId, continueLastSession, bypassPermissions, pluginDirs, tools, }) => {
|
|
47
|
+
return (_jsx(AppProvider, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, children: _jsx(AppWithProviders, { bypassPermissions: bypassPermissions, pluginDirs: pluginDirs, tools: tools }) }));
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundTaskManager.d.ts","sourceRoot":"","sources":["../../src/components/BackgroundTaskManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAcnD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,
|
|
1
|
+
{"version":3,"file":"BackgroundTaskManager.d.ts","sourceRoot":"","sources":["../../src/components/BackgroundTaskManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAcnD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA8TtE,CAAC"}
|
|
@@ -6,6 +6,7 @@ export const BackgroundTaskManager = ({ onCancel, }) => {
|
|
|
6
6
|
const { backgroundTasks, getBackgroundTaskOutput, stopBackgroundTask } = useChat();
|
|
7
7
|
const [tasks, setTasks] = useState([]);
|
|
8
8
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
9
|
+
const MAX_VISIBLE_ITEMS = 3;
|
|
9
10
|
const [viewMode, setViewMode] = useState("list");
|
|
10
11
|
const [detailTaskId, setDetailTaskId] = useState(null);
|
|
11
12
|
const [detailOutput, setDetailOutput] = useState(null);
|
|
@@ -43,6 +44,9 @@ export const BackgroundTaskManager = ({ onCancel, }) => {
|
|
|
43
44
|
const stopTask = (taskId) => {
|
|
44
45
|
stopBackgroundTask(taskId);
|
|
45
46
|
};
|
|
47
|
+
// Calculate visible window
|
|
48
|
+
const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2), Math.max(0, tasks.length - MAX_VISIBLE_ITEMS)));
|
|
49
|
+
const visibleTasks = tasks.slice(startIndex, startIndex + MAX_VISIBLE_ITEMS);
|
|
46
50
|
useInput((input, key) => {
|
|
47
51
|
if (viewMode === "list") {
|
|
48
52
|
// List mode navigation
|
|
@@ -105,10 +109,14 @@ export const BackgroundTaskManager = ({ onCancel, }) => {
|
|
|
105
109
|
if (tasks.length === 0) {
|
|
106
110
|
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", borderBottom: false, borderLeft: false, borderRight: false, paddingTop: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "Background Tasks" }), _jsx(Text, { children: "No background tasks found" }), _jsx(Text, { dimColor: true, children: "Press Escape to close" })] }));
|
|
107
111
|
}
|
|
108
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", borderBottom: false, borderLeft: false, borderRight: false, paddingTop: 1, gap: 1, children: [_jsx(Box, { children: _jsx(Text, { color: "cyan", bold: true, children: "Background Tasks" }) }), _jsx(Text, { dimColor: true, children: "Select a task to view details" }),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", borderBottom: false, borderLeft: false, borderRight: false, paddingTop: 1, gap: 1, children: [_jsx(Box, { children: _jsx(Text, { color: "cyan", bold: true, children: "Background Tasks" }) }), _jsx(Text, { dimColor: true, children: "Select a task to view details" }), _jsx(Box, { flexDirection: "column", children: visibleTasks.map((task, index) => {
|
|
113
|
+
const actualIndex = startIndex + index;
|
|
114
|
+
const isSelected = actualIndex === selectedIndex;
|
|
115
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: isSelected ? "black" : "white", backgroundColor: isSelected ? "cyan" : undefined, children: [isSelected ? "▶ " : " ", actualIndex + 1, ". [", task.id, "] ", task.type, task.description ? `: ${task.description}` : "", _jsxs(Text, { color: task.status === "running"
|
|
116
|
+
? "green"
|
|
117
|
+
: task.status === "completed"
|
|
118
|
+
? "blue"
|
|
119
|
+
: "red", children: [" ", "(", task.status, ")"] })] }), isSelected && (_jsx(Box, { marginLeft: 4, flexDirection: "column", children: _jsxs(Text, { color: "gray", dimColor: true, children: ["Started: ", formatTime(task.startTime), task.runtime !== undefined &&
|
|
120
|
+
` | Runtime: ${formatDuration(task.runtime)}`, task.exitCode !== undefined && ` | Exit: ${task.exitCode}`] }) }))] }, task.id));
|
|
121
|
+
}) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["\u2191/\u2193 to select \u00B7 Enter to view \u00B7", " ", tasks[selectedIndex]?.status === "running" ? "k to stop · " : "", "Esc to close"] }) })] }));
|
|
114
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationDetails.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmationDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfirmationDetails.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmationDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAqCjE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuDlE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
3
3
|
import { Box, Text, useStdout, measureElement, Static } from "ink";
|
|
4
|
-
import { BASH_TOOL_NAME, EDIT_TOOL_NAME,
|
|
4
|
+
import { BASH_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, EXIT_PLAN_MODE_TOOL_NAME, ASK_USER_QUESTION_TOOL_NAME, } from "wave-agent-sdk";
|
|
5
5
|
import { DiffDisplay } from "./DiffDisplay.js";
|
|
6
6
|
import { PlanDisplay } from "./PlanDisplay.js";
|
|
7
7
|
// Helper function to generate descriptive action text
|
|
@@ -14,10 +14,6 @@ const getActionDescription = (toolName, toolInput) => {
|
|
|
14
14
|
return `Execute command: ${toolInput.command || "unknown command"}`;
|
|
15
15
|
case EDIT_TOOL_NAME:
|
|
16
16
|
return `Edit file: ${toolInput.file_path || "unknown file"}`;
|
|
17
|
-
case MULTI_EDIT_TOOL_NAME:
|
|
18
|
-
return `Edit multiple sections in: ${toolInput.file_path || "unknown file"}`;
|
|
19
|
-
case DELETE_FILE_TOOL_NAME:
|
|
20
|
-
return `Delete file: ${toolInput.target_file || "unknown file"}`;
|
|
21
17
|
case WRITE_TOOL_NAME:
|
|
22
18
|
return `Write to file: ${toolInput.file_path || "unknown file"}`;
|
|
23
19
|
case EXIT_PLAN_MODE_TOOL_NAME:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiffDisplay.d.ts","sourceRoot":"","sources":["../../src/components/DiffDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DiffDisplay.d.ts","sourceRoot":"","sources":["../../src/components/DiffDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwSlD,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
|
-
import { WRITE_TOOL_NAME, EDIT_TOOL_NAME
|
|
4
|
+
import { WRITE_TOOL_NAME, EDIT_TOOL_NAME } from "wave-agent-sdk";
|
|
5
5
|
import { transformToolBlockToChanges } from "../utils/toolParameterTransforms.js";
|
|
6
6
|
import { diffLines, diffWords } from "diff";
|
|
7
7
|
export const DiffDisplay = ({ toolName, parameters, }) => {
|
|
8
|
-
const showDiff = toolName &&
|
|
9
|
-
[WRITE_TOOL_NAME, EDIT_TOOL_NAME, MULTI_EDIT_TOOL_NAME].includes(toolName);
|
|
8
|
+
const showDiff = toolName && [WRITE_TOOL_NAME, EDIT_TOOL_NAME].includes(toolName);
|
|
10
9
|
// Diff detection and transformation using typed parameters
|
|
11
10
|
const changes = useMemo(() => {
|
|
12
11
|
if (!showDiff || !toolName || !parameters)
|
|
@@ -62,10 +61,6 @@ export const DiffDisplay = ({ toolName, parameters, }) => {
|
|
|
62
61
|
const allElements = [];
|
|
63
62
|
changes.forEach((change, changeIndex) => {
|
|
64
63
|
try {
|
|
65
|
-
// Add ellipsis between non-contiguous edits in MultiEdit
|
|
66
|
-
if (toolName === MULTI_EDIT_TOOL_NAME && changeIndex > 0) {
|
|
67
|
-
allElements.push(_jsx(Box, { children: _jsx(Text, { color: "gray", children: "..." }) }, `multi-edit-separator-${changeIndex}`));
|
|
68
|
-
}
|
|
69
64
|
// Get line-level diff to understand the structure
|
|
70
65
|
const lineDiffs = diffLines(change.oldContent || "", change.newContent || "");
|
|
71
66
|
// Process line diffs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageItem.d.ts","sourceRoot":"","sources":["../../src/components/MessageItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,GAAI,yBAAyB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MessageItem.d.ts","sourceRoot":"","sources":["../../src/components/MessageItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,GAAI,yBAAyB,gBAAgB,mDAgEpE,CAAC"}
|
|
@@ -9,5 +9,5 @@ import { Markdown } from "./Markdown.js";
|
|
|
9
9
|
export const MessageItem = ({ message, isExpanded }) => {
|
|
10
10
|
if (message.blocks.length === 0)
|
|
11
11
|
return null;
|
|
12
|
-
return (_jsx(Box, { flexDirection: "column", gap: 1, marginTop: 1, children: _jsx(Box, { flexDirection: "column", gap: 1, children: message.blocks.map((block, blockIndex) => (_jsxs(Box, { children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.customCommandContent && (_jsx(Text, { color: "cyan", bold: true, children: "$" })), block.source === MessageSource.HOOK && (_jsx(Text, { color: "magenta", bold: true, children: "~" })), message.role === "user" ? (_jsx(Text, { backgroundColor: "gray", color: "white", children: block.content })) : (_jsx(Markdown, { children: block.content }))] })), block.type === "error" && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", block.content] }) })), block.type === "command_output" && (_jsx(CommandOutputDisplay, { block: block, isExpanded: isExpanded })), block.type === "tool" && (_jsx(ToolDisplay, { block: block, isExpanded: isExpanded })), block.type === "image" && (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", bold: true, children: "# Image" }), block.imageUrls && block.imageUrls.length > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", block.imageUrls.length, ")"] }))] })), block.type === "compress" && (_jsx(CompressDisplay, { block: block, isExpanded: isExpanded })), block.type === "reasoning" && _jsx(ReasoningDisplay, { block: block })] }, blockIndex))) }) }));
|
|
12
|
+
return (_jsx(Box, { flexDirection: "column", gap: 1, marginTop: 1, children: _jsx(Box, { flexDirection: "column", gap: 1, children: message.blocks.map((block, blockIndex) => (_jsxs(Box, { children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.customCommandContent && (_jsx(Text, { color: "cyan", bold: true, children: "$ " })), block.source === MessageSource.HOOK && (_jsx(Text, { color: "magenta", bold: true, children: "~ " })), message.role === "user" ? (_jsx(Text, { backgroundColor: "gray", color: "white", children: block.content })) : (_jsx(Markdown, { children: block.content }))] })), block.type === "error" && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", block.content] }) })), block.type === "command_output" && (_jsx(CommandOutputDisplay, { block: block, isExpanded: isExpanded })), block.type === "tool" && (_jsx(ToolDisplay, { block: block, isExpanded: isExpanded })), block.type === "image" && (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", bold: true, children: "# Image" }), block.imageUrls && block.imageUrls.length > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", block.imageUrls.length, ")"] }))] })), block.type === "compress" && (_jsx(CompressDisplay, { block: block, isExpanded: isExpanded })), block.type === "reasoning" && _jsx(ReasoningDisplay, { block: block })] }, blockIndex))) }) }));
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,WAAW,6GAOnB,gBAAgB,6CA4EpB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Box, Text, Static } from "ink";
|
|
4
|
-
import { TASK_CREATE_TOOL_NAME, TASK_GET_TOOL_NAME, TASK_UPDATE_TOOL_NAME, TASK_LIST_TOOL_NAME, } from "wave-agent-sdk";
|
|
5
4
|
import { MessageItem } from "./MessageItem.js";
|
|
6
5
|
export const MessageList = React.memo(({ messages, isLoading = false, isCommandRunning = false, isExpanded = false, forceStaticLastMessage = false, }) => {
|
|
7
6
|
// Empty message state
|
|
@@ -11,24 +10,9 @@ export const MessageList = React.memo(({ messages, isLoading = false, isCommandR
|
|
|
11
10
|
// Limit messages when expanded to prevent long rendering times
|
|
12
11
|
const maxExpandedMessages = 20;
|
|
13
12
|
const shouldLimitMessages = isExpanded && messages.length > maxExpandedMessages;
|
|
14
|
-
// Filter out task management tools and empty messages
|
|
15
|
-
const taskMgmtTools = [
|
|
16
|
-
TASK_CREATE_TOOL_NAME,
|
|
17
|
-
TASK_GET_TOOL_NAME,
|
|
18
|
-
TASK_UPDATE_TOOL_NAME,
|
|
19
|
-
TASK_LIST_TOOL_NAME,
|
|
20
|
-
];
|
|
21
|
-
const filteredMessages = messages
|
|
22
|
-
.map((message) => ({
|
|
23
|
-
...message,
|
|
24
|
-
blocks: message.blocks.filter((block) => !(block.type === "tool" &&
|
|
25
|
-
typeof block.name === "string" &&
|
|
26
|
-
taskMgmtTools.includes(block.name))),
|
|
27
|
-
}))
|
|
28
|
-
.filter((message) => message.blocks.length > 0);
|
|
29
13
|
const displayMessages = shouldLimitMessages
|
|
30
|
-
?
|
|
31
|
-
:
|
|
14
|
+
? messages.slice(-maxExpandedMessages)
|
|
15
|
+
: messages;
|
|
32
16
|
// Compute which messages to render statically vs dynamically
|
|
33
17
|
const lastMessage = displayMessages[displayMessages.length - 1];
|
|
34
18
|
const hasNonEndTool = lastMessage?.blocks.some((block) => block.type === "tool" && block.stage !== "end");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/contexts/useChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAUxB,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IAEvB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEjD,SAAS,EAAE,MAAM,CAAC;IACl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AO,MAAM,OAAO,uBAMnB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyepD,CAAC"}
|
package/dist/contexts/useChat.js
CHANGED
|
@@ -13,7 +13,7 @@ export const useChat = () => {
|
|
|
13
13
|
}
|
|
14
14
|
return context;
|
|
15
15
|
};
|
|
16
|
-
export const ChatProvider = ({ children, bypassPermissions, pluginDirs, }) => {
|
|
16
|
+
export const ChatProvider = ({ children, bypassPermissions, pluginDirs, tools, }) => {
|
|
17
17
|
const { restoreSessionId, continueLastSession } = useAppConfig();
|
|
18
18
|
// Message Display State
|
|
19
19
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
@@ -139,6 +139,7 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, }) => {
|
|
|
139
139
|
canUseTool: permissionCallback,
|
|
140
140
|
stream: false, // 关闭流式模式
|
|
141
141
|
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
142
|
+
tools,
|
|
142
143
|
});
|
|
143
144
|
agentRef.current = agent;
|
|
144
145
|
// Get initial state
|
|
@@ -167,6 +168,7 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, }) => {
|
|
|
167
168
|
bypassPermissions,
|
|
168
169
|
showConfirmation,
|
|
169
170
|
pluginDirs,
|
|
171
|
+
tools,
|
|
170
172
|
]);
|
|
171
173
|
// Cleanup on unmount
|
|
172
174
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePluginManager.d.ts","sourceRoot":"","sources":["../../src/hooks/usePluginManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePluginManager.d.ts","sourceRoot":"","sources":["../../src/hooks/usePluginManager.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAE7C,wBAAgB,gBAAgB,IAAI,wBAAwB,CA4P3D"}
|