新增quickcommand.runCode,quickcommand.runInTerminal支持warp

This commit is contained in:
fofolee
2025-01-13 01:15:42 +08:00
parent 4053f7a9c2
commit 0a8c24374a
9 changed files with 366 additions and 105 deletions

View File

@@ -17,7 +17,7 @@ import { imageCommands } from "./imageCommands";
import { windowsCommands } from "./windowsCommands";
import { statusCommands } from "./statusCommands";
import { macosCommands } from "./macosCommands";
import { scriptCommands } from "./scriptCommands";
let commands = [
fileCommands,
networkCommands,
@@ -30,6 +30,7 @@ let commands = [
dataCommands,
codingCommands,
controlCommands,
scriptCommands,
uiCommands,
simulateCommands,
mathCommands,

View File

@@ -0,0 +1,53 @@
export const scriptCommands = {
label: "编程相关",
icon: "integration_instructions",
commands: [
{
value: "",
label: "赋值",
icon: "script",
outputVariable: "value",
saveOutput: true,
config: [
{
label: "值或表达式",
component: "VariableInput",
width: 12,
},
],
},
{
value: "(function(code){new Function(code)()})",
label: "注入JS脚本",
icon: "script",
config: [
{
label: "JS脚本",
component: "CodeEditor",
width: 12,
},
],
},
{
value: "quickcommand.runAppleScript",
label: "执行 AppleScript",
icon: "script",
outputVariable: "result",
saveOutput: true,
config: [
{
label: "脚本",
component: "CodeEditor",
width: 12,
},
],
},
{
value: "quickcommand.runCsharp",
label: "执行C#脚本",
icon: "script",
outputVariable: "result",
saveOutput: true,
},
],
};