Files
2026-01-19 03:32:49 +08:00

2 lines
1.7 KiB
JavaScript

"use strict";var g=Object.create;var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var C=(n,o)=>{for(var t in o)a(n,t,{get:o[t],enumerable:!0})},l=(n,o,t,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of v(o))!f.call(n,s)&&s!==t&&a(n,s,{get:()=>o[s],enumerable:!(d=p(o,s))||d.enumerable});return n};var x=(n,o,t)=>(t=n!=null?g(w(n)):{},l(o||!n||!n.__esModule?a(t,"default",{value:n,enumerable:!0}):t,n)),k=n=>l(a({},"__esModule",{value:!0}),n);var $={};C($,{activate:()=>T,deactivate:()=>h});module.exports=k($);var e=x(require("vscode"));function T(n){console.log("skill-runner extension is now active!");let o=async()=>{let r=e.workspace.getConfiguration("skill-runner").get("command","opencode run"),i=e.window.activeTextEditor,c=i?.document.getText(i.selection)||"";c&&(c=c.trim().replace(/\s+/g," "));let u=e.window.createTerminal("Opencode Runner");c?u.sendText(`${r} ${c}`):u.sendText(r),u.show(),e.window.showInformationMessage(`Executing: ${c?`${r} ${c}`:r}`)},t=e.commands.registerCommand("skill-runner.run",o),d=e.commands.registerCommand("skill-runner.runPalette",o),s=e.commands.registerCommand("skill-runner.configure",async()=>{let m=e.workspace.getConfiguration("skill-runner"),r=m.get("command","opencode run"),i=await e.window.showInputBox({prompt:"Enter the command to run",value:r,placeHolder:"e.g., opencode run, npm run dev, etc."});i!==void 0&&(await m.update("command",i,e.ConfigurationTarget.Global),e.window.showInformationMessage(`Command updated to: ${i}`))});n.subscriptions.push(t,d,s)}function h(){}0&&(module.exports={activate,deactivate});