From c34ad083dfcf28ce9cb60fdcfa7aa11af651bb56 Mon Sep 17 00:00:00 2001 From: divyanshujethi Date: Wed, 25 Nov 2026 00:57:15 +0530 Subject: [PATCH] fix(ci): pin @types/vscode to ~1.85.0 to satisfy vsce engines gate --- .github/dependabot.yml | 7 +++++++ dist/extension.js | 4 ++-- package-lock.json | 12 ++++++------ package.json | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 782a0ad..7b8819d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,14 @@ updates: directory: "/" schedule: interval: "weekly" + ignore: + - dependency-name: "@types/vscode" + versions: [">= 1.86.0"] - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" + groups: + codeql-action: + patterns: + - "github/codeql-action*" diff --git a/dist/extension.js b/dist/extension.js index b839504..63c4a75 100644 --- a/dist/extension.js +++ b/dist/extension.js @@ -1,3 +1,3 @@ -"use strict";var L=Object.create;var w=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var $=(o,i)=>{for(var s in i)w(o,s,{get:i[s],enumerable:!0})},D=(o,i,s,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of M(i))!_.call(o,n)&&n!==s&&w(o,n,{get:()=>i[n],enumerable:!(t=R(i,n))||t.enumerable});return o};var x=(o,i,s)=>(s=o!=null?L(B(o)):{},D(i||!o||!o.__esModule?w(s,"default",{value:o,enumerable:!0}):s,o)),N=o=>D(w({},"__esModule",{value:!0}),o);var W={};$(W,{MutationApprovalProvider:()=>b,MutationTreeItem:()=>S,SandboxProfileProvider:()=>A,SandboxProfileTreeItem:()=>d,activate:()=>O,deactivate:()=>K});module.exports=N(W);var I=x(require("node:os")),e=x(require("vscode")),G=[{id:"OPENAI_KEY",name:"OpenAI Secret Key",regex:/\b(sk-[a-zA-Z0-9]{20,64})\b/g},{id:"AWS_ACCESS_KEY",name:"AWS Access Key",regex:/\b(AKIA[0-9A-Z]{16})\b/g},{id:"ANTHROPIC_KEY",name:"Anthropic API Key",regex:/\b(sk-ant-[a-zA-Z0-9_\-]{20,80})\b/g},{id:"GITHUB_PAT",name:"GitHub Personal Access Token",regex:/\b(ghp_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})\b/g},{id:"SLACK_TOKEN",name:"Slack Bot Token",regex:/\b(xox[baprs]-[0-9a-zA-Z]{10,48})\b/g},{id:"STRIPE_KEY",name:"Stripe Live Secret Key",regex:/\b(sk_live_[0-9a-zA-Z]{24,34})\b/g},{id:"PROC_ENVIRON",name:"/proc/self/environ Read",regex:/(?:\/proc\/(?:self|\d+)\/environ|\.e["']?n["']?v)/gi}],a,u,h,g,T=0,v="Strict",m=[{id:"mut_drop_cust",timestamp:Date.now()-15e3,database:"production_pg",query:"DROP TABLE users_shadow CASCADE;",statementType:"DDL",riskLevel:"CRITICAL",affectedRowsEstimated:14200,agentPid:4912,status:"PENDING"},{id:"mut_upd_bal",timestamp:Date.now()-5e3,database:"billing_core",query:"UPDATE customer_credits SET balance = 0 WHERE is_trial = true;",statementType:"DML_BULK",riskLevel:"HIGH",affectedRowsEstimated:850,agentPid:5120,status:"PENDING"}],S=class extends e.TreeItem{constructor(s){super(s.query,e.TreeItemCollapsibleState.None);this.mutation=s;this.tooltip=`DB: ${s.database} | Risk: ${s.riskLevel} | PID: ${s.agentPid} -Query: ${s.query}`,this.description=`[${s.riskLevel}] ${s.database} (${s.affectedRowsEstimated} rows)`,this.contextValue="mutationPending",s.riskLevel==="CRITICAL"?this.iconPath=new e.ThemeIcon("error",new e.ThemeColor("charts.red")):s.riskLevel==="HIGH"?this.iconPath=new e.ThemeIcon("warning",new e.ThemeColor("charts.yellow")):this.iconPath=new e.ThemeIcon("database",new e.ThemeColor("charts.blue"))}mutation},b=class{_onDidChangeTreeData=new e.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;refresh(){this._onDidChangeTreeData.fire()}getTreeItem(i){return i}getChildren(){let i=m.filter(s=>s.status==="PENDING");return Promise.resolve(i.map(s=>new S(s)))}approve(i){let s=m.find(t=>t.id===i);s&&(s.status="APPROVED",this.refresh(),e.window.showInformationMessage(`\u2705 DBShield: Approved mutation '${s.id}' on ${s.database}. Transaction committed.`))}reject(i){let s=m.find(t=>t.id===i);s&&(s.status="REJECTED",this.refresh(),e.window.showWarningMessage(`\u{1F6D1} DBShield: Rejected mutation '${s.id}' on ${s.database}. Aborted with ROLLBACK.`))}addSimulation(i){m.push(i),this.refresh()}},d=class extends e.TreeItem{constructor(i,s,t="shield"){super(i,e.TreeItemCollapsibleState.None),this.description=s,this.iconPath=new e.ThemeIcon(t)}},A=class{getTreeItem(i){return i}getChildren(){let i=I.platform(),s="Bubblewrap (Linux Namespaces)";i==="darwin"&&(s="Seatbelt (Apple Sandbox API)"),i==="win32"&&(s="Windows LowBox AppContainer");let t=[new d("Sandbox Engine",s,"server-process"),new d("Current Profile",v,"lock"),new d("Network Egress","Allow Git Only (Port 22/443)","globe"),new d("IMDS Isolation","169.254.169.254 Blocked","shield-check"),new d("Filesystem Jail","Workspace Directory Only (r/w)","folder"),new d("Volatile Surrogates","Active (RD_SURROGATE_)","pass")];return Promise.resolve(t)}};function O(o){a=e.window.createStatusBarItem(e.StatusBarAlignment.Right,102),a.command="agentshield.showStatusMenu",P(0),a.show(),u=e.window.createStatusBarItem(e.StatusBarAlignment.Right,101),u.command="agentshield.switchSandboxProfile",E(),u.show(),h=e.window.createStatusBarItem(e.StatusBarAlignment.Right,100),h.text="$(globe) Net: Git Only",h.tooltip="AgentShield Egress Filter: AI agent outbound network access confined strictly to Git repositories.",h.show(),o.subscriptions.push(a,u,h);let i=new b;e.window.registerTreeDataProvider("agentshield.mutationsView",i);let s=new A;e.window.registerTreeDataProvider("agentshield.sandboxView",s),g=e.languages.createDiagnosticCollection("agentshield"),o.subscriptions.push(g),e.window.activeTextEditor&&f(e.window.activeTextEditor.document),o.subscriptions.push(e.workspace.onDidChangeTextDocument(t=>f(t.document)),e.workspace.onDidOpenTextDocument(t=>f(t)),e.workspace.onDidCloseTextDocument(t=>g.delete(t.uri))),o.subscriptions.push(e.commands.registerCommand("agentshield.approveMutation",t=>{if(t?.mutation)i.approve(t.mutation.id);else{let n=m.filter(c=>c.status==="PENDING");n.length>0?i.approve(n[0].id):e.window.showInformationMessage("DBShield: No pending mutations to approve.")}}),e.commands.registerCommand("agentshield.rejectMutation",t=>{if(t?.mutation)i.reject(t.mutation.id);else{let n=m.filter(c=>c.status==="PENDING");n.length>0?i.reject(n[0].id):e.window.showInformationMessage("DBShield: No pending mutations to reject.")}}),e.commands.registerCommand("agentshield.refreshMutations",()=>{i.refresh(),e.window.showInformationMessage("DBShield: Refreshed pending mutations queue.")}),e.commands.registerCommand("agentshield.simulateMutation",()=>{let t=`mut_sim_${Math.floor(1e3+Math.random()*9e3)}`;i.addSimulation({id:t,timestamp:Date.now(),database:"production_pg",query:"ALTER TABLE api_tokens DROP COLUMN hashed_secret;",statementType:"DDL",riskLevel:"CRITICAL",affectedRowsEstimated:45e3,agentPid:6184,status:"PENDING"}),e.window.showWarningMessage(`\u26A0\uFE0F DBShield: Intercepted simulated mutation '${t}' requiring human approval!`)}),e.commands.registerCommand("agentshield.switchSandboxProfile",async()=>{let t=await e.window.showQuickPick([{label:"$(shield) Strict (Zero Network)",detail:"Air-gapped filesystem jail with zero outbound network access.",profile:"Strict"},{label:"$(globe) Standard (Git Only)",detail:"Egress restricted strictly to GitHub/GitLab over Port 443/22.",profile:"Standard"},{label:"$(tools) Permissive (Dev/Localhost)",detail:"Allows localhost IPC and internal private corporate subnets.",profile:"Permissive"}],{placeHolder:`Current Sandbox Profile: ${v}`});t&&(v=t.profile,E(),e.window.showInformationMessage(`\u{1F6E1}\uFE0F AgentShield: Activated OS Sandbox Profile: ${t.label}`))}),e.commands.registerCommand("agentshield.showStatusMenu",async()=>{let t=await e.window.showQuickPick([{label:"$(shield) Scan Active File",detail:"Check current file for unmasked credentials"},{label:"$(search) Audit Entire Workspace",detail:"Scan all workspace files with AgentShield CLI"},{label:"$(database) Review DBShield Mutations",detail:"Review pending SQL modifications in Activity Bar"},{label:"$(play) Open Adversarial Attack Playground",detail:"Test hostile evasion payloads in browser"},{label:"$(verified) View Trust Center & SIG Lite",detail:"Inspect SOC 2 Type II and DPDP compliance"}],{placeHolder:`AgentShield Defense Status: ${T===0?"Guarded (Zero Leaks)":`${T} Leaks Detected`}`});t&&(t.label.includes("Scan Active File")?e.commands.executeCommand("agentshield.scanActiveFile"):t.label.includes("Audit Entire Workspace")?e.commands.executeCommand("agentshield.auditWorkspace"):t.label.includes("DBShield Mutations")?e.commands.executeCommand("workbench.view.extension.agentshield-sidebar"):t.label.includes("Playground")?e.commands.executeCommand("agentshield.openPlayground"):t.label.includes("Trust Center")&&e.commands.executeCommand("agentshield.openTrustCenter"))}),e.commands.registerCommand("agentshield.scanActiveFile",()=>{let t=e.window.activeTextEditor;if(!t){e.window.showInformationMessage("AgentShield: No active file to scan.");return}let n=f(t.document);n===0?e.window.showInformationMessage("\u{1F6E1}\uFE0F AgentShield: No credential leaks found in active file."):e.window.showWarningMessage(`\u26A0\uFE0F AgentShield: Intercepted ${n} unmasked secret(s) in this file!`)}),e.commands.registerCommand("agentshield.auditWorkspace",()=>{let t=e.window.createTerminal("AgentShield Audit");t.show(),t.sendText("npx @ritualdev-lab/agentshield ci --enforce")}),e.commands.registerCommand("agentshield.openPlayground",()=>{e.env.openExternal(e.Uri.parse("https://ritualdev.in/playground"))}),e.commands.registerCommand("agentshield.openTrustCenter",()=>{e.env.openExternal(e.Uri.parse("https://ritualdev.in/trust"))}),e.languages.registerCodeActionsProvider({scheme:"file"},{provideCodeActions(t,n,c){let p=[];for(let l of c.diagnostics)if(l.source==="AgentShield"){let r=new e.CodeAction("\u{1F6E1}\uFE0F Redact Secret with AgentShield",e.CodeActionKind.QuickFix);r.isPreferred=!0,r.diagnostics=[l];let C=new e.WorkspaceEdit,k=Math.random().toString(36).substring(2,8),y=`[AGENTSHIELD_REDACTED:${l.code||"SECRET"}:${k}]`;C.replace(t.uri,l.range,y),r.edit=C,p.push(r)}return p}},{providedCodeActionKinds:[e.CodeActionKind.QuickFix]})),console.log("AgentShield VS Code / Cursor extension active with DBShield mutation drawer.")}function P(o){T=o,o===0?(a.text="$(shield) AgentShield: Guarded",a.tooltip="AgentShield: Zero-leak secret defense active. Workspace safe.",a.backgroundColor=void 0):(a.text=`$(alert) AgentShield: ${o} Leaks!`,a.tooltip=`AgentShield: Detected ${o} unredacted secret(s)! Click to review findings.`,a.backgroundColor=new e.ThemeColor("statusBarItem.errorBackground"))}function E(){let o=I.platform(),i="LowBox AppContainer";o==="linux"&&(i="Bubblewrap"),o==="darwin"&&(i="Seatbelt"),u.text=`$(lock) Sandbox: ${i} [${v}]`,u.tooltip=`AgentShield Kernel Sandbox: ${i} active with ${v} profile. Click to change.`}function f(o){if(o.uri.scheme!=="file"&&o.uri.scheme!=="untitled")return 0;let i=o.getText(),s=[];for(let t of G){t.regex.lastIndex=0;let n;for(;(n=t.regex.exec(i))!==null;){let c=o.positionAt(n.index),p=o.positionAt(n.index+n[0].length),l=new e.Range(c,p),r=new e.Diagnostic(l,`[AgentShield Zero-Leak Guard] Unmasked ${t.name} detected. Avoid committing or passing raw credentials to AI coding agents.`,e.DiagnosticSeverity.Warning);r.source="AgentShield",r.code=t.id,s.push(r)}}return g.set(o.uri,s),P(s.length),s.length}function K(){g&&g.clear()}0&&(module.exports={MutationApprovalProvider,MutationTreeItem,SandboxProfileProvider,SandboxProfileTreeItem,activate,deactivate}); +"use strict";var B=Object.create;var S=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var O=(o,t)=>{for(var s in t)S(o,s,{get:t[s],enumerable:!0})},E=(o,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $(t))!G.call(o,i)&&i!==s&&S(o,i,{get:()=>t[i],enumerable:!(n=_(t,i))||n.enumerable});return o};var k=(o,t,s)=>(s=o!=null?B(N(o)):{},E(t||!o||!o.__esModule?S(s,"default",{value:o,enumerable:!0}):s,o)),K=o=>E(S({},"__esModule",{value:!0}),o);var Z={};O(Z,{MutationApprovalProvider:()=>I,MutationTreeItem:()=>b,SandboxProfileProvider:()=>A,SandboxProfileTreeItem:()=>a,SkillPrismStatusProvider:()=>C,activate:()=>W,deactivate:()=>H});module.exports=K(Z);var P=k(require("node:os")),e=k(require("vscode")),U=[{id:"OPENAI_KEY",name:"OpenAI Secret Key",regex:/\b(sk-[a-zA-Z0-9]{20,64})\b/g},{id:"AWS_ACCESS_KEY",name:"AWS Access Key",regex:/\b(AKIA[0-9A-Z]{16})\b/g},{id:"ANTHROPIC_KEY",name:"Anthropic API Key",regex:/\b(sk-ant-[a-zA-Z0-9_\-]{20,80})\b/g},{id:"GITHUB_PAT",name:"GitHub Personal Access Token",regex:/\b(ghp_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})\b/g},{id:"SLACK_TOKEN",name:"Slack Bot Token",regex:/\b(xox[baprs]-[0-9a-zA-Z]{10,48})\b/g},{id:"STRIPE_KEY",name:"Stripe Live Secret Key",regex:/\b(sk_live_[0-9a-zA-Z]{24,34})\b/g},{id:"PROC_ENVIRON",name:"/proc/self/environ Read",regex:/(?:\/proc\/(?:self|\d+)\/environ|\.e["']?n["']?v)/gi}],d,u,v,m,h,D=0,p="Strict",g=[{id:"mut_drop_cust",timestamp:Date.now()-15e3,database:"production_pg",query:"DROP TABLE users_shadow CASCADE;",statementType:"DDL",riskLevel:"CRITICAL",affectedRowsEstimated:14200,agentPid:4912,status:"PENDING"},{id:"mut_upd_bal",timestamp:Date.now()-5e3,database:"billing_core",query:"UPDATE customer_credits SET balance = 0 WHERE is_trial = true;",statementType:"DML_BULK",riskLevel:"HIGH",affectedRowsEstimated:850,agentPid:5120,status:"PENDING"}],b=class extends e.TreeItem{constructor(s){super(s.query,e.TreeItemCollapsibleState.None);this.mutation=s;this.tooltip=`DB: ${s.database} | Risk: ${s.riskLevel} | PID: ${s.agentPid} +Query: ${s.query}`,this.description=`[${s.riskLevel}] ${s.database} (${s.affectedRowsEstimated} rows)`,this.contextValue="mutationPending",s.riskLevel==="CRITICAL"?this.iconPath=new e.ThemeIcon("error",new e.ThemeColor("charts.red")):s.riskLevel==="HIGH"?this.iconPath=new e.ThemeIcon("warning",new e.ThemeColor("charts.yellow")):this.iconPath=new e.ThemeIcon("database",new e.ThemeColor("charts.blue"))}mutation},I=class{_onDidChangeTreeData=new e.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;refresh(){this._onDidChangeTreeData.fire()}getTreeItem(t){return t}getChildren(){let t=g.filter(s=>s.status==="PENDING");return Promise.resolve(t.map(s=>new b(s)))}approve(t){let s=g.find(n=>n.id===t);s&&(s.status="APPROVED",this.refresh(),e.window.showInformationMessage(`\u2705 DBShield: Approved mutation '${s.id}' on ${s.database}. Transaction committed.`))}reject(t){let s=g.find(n=>n.id===t);s&&(s.status="REJECTED",this.refresh(),e.window.showWarningMessage(`\u{1F6D1} DBShield: Rejected mutation '${s.id}' on ${s.database}. Aborted with ROLLBACK.`))}addSimulation(t){g.push(t),this.refresh()}},a=class extends e.TreeItem{constructor(t,s,n="shield"){super(t,e.TreeItemCollapsibleState.None),this.description=s,this.iconPath=new e.ThemeIcon(n)}},A=class{getTreeItem(t){return t}getChildren(){let t=P.platform(),s="Bubblewrap (Linux Namespaces)";t==="darwin"&&(s="Seatbelt (Apple Sandbox API)"),t==="win32"&&(s="Windows LowBox AppContainer");let n=[new a("Sandbox Engine",s,"server-process"),new a("Current Profile",p,"lock"),new a("Network Egress","Allow Git Only (Port 22/443)","globe"),new a("IMDS Isolation","169.254.169.254 Blocked","shield-check"),new a("Filesystem Jail","Workspace Directory Only (r/w)","folder"),new a("Volatile Surrogates","Active (RD_SURROGATE_)","pass")];return Promise.resolve(n)}},C=class{_onDidChangeTreeData=new e.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;refresh(){this._onDidChangeTreeData.fire()}getTreeItem(t){return t}getChildren(){let t=[new a("MCP Compactor","JIT Tool Receipts Active","zap"),new a("Prompt-Injection Guard","Enabled (Phase 7 Sanitizer)","shield"),new a("Redis Failover","Automatic Local SQLite/LRU Fallback","database"),new a("Unified Orchestrator","ritual.policy.yaml (agentshield up)","layers")];return Promise.resolve(t)}};function W(o){d=e.window.createStatusBarItem(e.StatusBarAlignment.Right,102),d.command="agentshield.showStatusMenu",R(0),d.show(),u=e.window.createStatusBarItem(e.StatusBarAlignment.Right,101),u.command="agentshield.switchSandboxProfile",y(),u.show(),v=e.window.createStatusBarItem(e.StatusBarAlignment.Right,100),v.text="$(globe) Net: Git Only",v.tooltip="AgentShield Egress Filter: AI agent outbound network access confined strictly to Git repositories.",v.show(),m=e.window.createStatusBarItem(e.StatusBarAlignment.Right,99),m.command="agentshield.refreshSkillPrism",m.text="$(zap) SkillPrism: JIT Active",m.tooltip="SkillPrism MCP Context Compactor & Prompt-Injection Guard status. Click to refresh.",m.show(),o.subscriptions.push(d,u,v,m);let t=new I;e.window.registerTreeDataProvider("agentshield.mutationsView",t);let s=new A;e.window.registerTreeDataProvider("agentshield.sandboxView",s);let n=new C;e.window.registerTreeDataProvider("agentshield.skillprismView",n),h=e.languages.createDiagnosticCollection("agentshield"),o.subscriptions.push(h),e.window.activeTextEditor&&T(e.window.activeTextEditor.document),o.subscriptions.push(e.workspace.onDidChangeTextDocument(i=>T(i.document)),e.workspace.onDidOpenTextDocument(i=>T(i)),e.workspace.onDidCloseTextDocument(i=>h.delete(i.uri))),o.subscriptions.push(e.commands.registerCommand("agentshield.approveMutation",i=>{if(i?.mutation)t.approve(i.mutation.id);else{let r=g.filter(l=>l.status==="PENDING");r.length>0?t.approve(r[0].id):e.window.showInformationMessage("DBShield: No pending mutations to approve.")}}),e.commands.registerCommand("agentshield.rejectMutation",i=>{if(i?.mutation)t.reject(i.mutation.id);else{let r=g.filter(l=>l.status==="PENDING");r.length>0?t.reject(r[0].id):e.window.showInformationMessage("DBShield: No pending mutations to reject.")}}),e.commands.registerCommand("agentshield.refreshMutations",()=>{t.refresh(),e.window.showInformationMessage("DBShield: Refreshed pending mutations queue.")}),e.commands.registerCommand("agentshield.simulateMutation",()=>{let i=`mut_sim_${Math.floor(1e3+Math.random()*9e3)}`;t.addSimulation({id:i,timestamp:Date.now(),database:"production_pg",query:"ALTER TABLE api_tokens DROP COLUMN hashed_secret;",statementType:"DDL",riskLevel:"CRITICAL",affectedRowsEstimated:45e3,agentPid:6184,status:"PENDING"}),e.window.showWarningMessage(`\u26A0\uFE0F DBShield: Intercepted simulated mutation '${i}' requiring human approval!`)}),e.commands.registerCommand("agentshield.switchSandboxProfile",async()=>{let i=await e.window.showQuickPick([{label:"$(shield) Strict (Zero Network)",detail:"Air-gapped filesystem jail with zero outbound network access.",profile:"Strict"},{label:"$(globe) Standard (Git Only)",detail:"Egress restricted strictly to GitHub/GitLab over Port 443/22.",profile:"Standard"},{label:"$(tools) Permissive (Dev/Localhost)",detail:"Allows localhost IPC and internal private corporate subnets.",profile:"Permissive"}],{placeHolder:`Current Sandbox Profile: ${p}`});i&&(p=i.profile,y(),e.window.showInformationMessage(`\u{1F6E1}\uFE0F AgentShield: Activated OS Sandbox Profile: ${i.label}`))}),e.commands.registerCommand("agentshield.showStatusMenu",async()=>{let i=await e.window.showQuickPick([{label:"$(shield) Scan Active File",detail:"Check current file for unmasked credentials"},{label:"$(search) Audit Entire Workspace",detail:"Scan all workspace files with AgentShield CLI"},{label:"$(database) Review DBShield Mutations",detail:"Review pending SQL modifications in Activity Bar"},{label:"$(play) Open Adversarial Attack Playground",detail:"Test hostile evasion payloads in browser"},{label:"$(verified) View Trust Center & SIG Lite",detail:"Inspect SOC 2 Type II and DPDP compliance"}],{placeHolder:`AgentShield Defense Status: ${D===0?"Guarded (Zero Leaks)":`${D} Leaks Detected`}`});i&&(i.label.includes("Scan Active File")?e.commands.executeCommand("agentshield.scanActiveFile"):i.label.includes("Audit Entire Workspace")?e.commands.executeCommand("agentshield.auditWorkspace"):i.label.includes("DBShield Mutations")?e.commands.executeCommand("workbench.view.extension.agentshield-sidebar"):i.label.includes("Playground")?e.commands.executeCommand("agentshield.openPlayground"):i.label.includes("Trust Center")&&e.commands.executeCommand("agentshield.openTrustCenter"))}),e.commands.registerCommand("agentshield.scanActiveFile",()=>{let i=e.window.activeTextEditor;if(!i){e.window.showInformationMessage("AgentShield: No active file to scan.");return}let r=T(i.document);r===0?e.window.showInformationMessage("\u{1F6E1}\uFE0F AgentShield: No credential leaks found in active file."):e.window.showWarningMessage(`\u26A0\uFE0F AgentShield: Intercepted ${r} unmasked secret(s) in this file!`)}),e.commands.registerCommand("agentshield.auditWorkspace",()=>{let i=e.window.createTerminal("AgentShield Audit");i.show(),i.sendText("npx @ritualdev-lab/agentshield ci --enforce")}),e.commands.registerCommand("agentshield.openPlayground",()=>{e.env.openExternal(e.Uri.parse("https://ritualdev.in/playground"))}),e.commands.registerCommand("agentshield.openTrustCenter",()=>{e.env.openExternal(e.Uri.parse("https://ritualdev.in/trust"))}),e.commands.registerCommand("agentshield.refreshSkillPrism",()=>{n.refresh(),e.window.showInformationMessage("\u26A1 SkillPrism: Refreshed MCP Context Compactor & Prompt-Injection Guard status.")}),e.commands.registerCommand("agentshield.runUnifiedUp",()=>{let i=e.window.createTerminal("AgentShield Unified Stack");i.show(),i.sendText("npx @ritualdev-lab/agentshield up --dry-run")}),e.languages.registerCodeActionsProvider({scheme:"file"},{provideCodeActions(i,r,l){let w=[];for(let c of l.diagnostics)if(c.source==="AgentShield"){let f=new e.CodeAction("\u{1F6E1}\uFE0F Redact Secret with AgentShield",e.CodeActionKind.QuickFix);f.isPreferred=!0,f.diagnostics=[c];let x=new e.WorkspaceEdit,L=Math.random().toString(36).substring(2,8),M=`[AGENTSHIELD_REDACTED:${c.code||"SECRET"}:${L}]`;x.replace(i.uri,c.range,M),f.edit=x,w.push(f)}return w}},{providedCodeActionKinds:[e.CodeActionKind.QuickFix]})),console.log("AgentShield VS Code / Cursor extension active with DBShield mutation drawer.")}function R(o){D=o,o===0?(d.text="$(shield) AgentShield: Guarded",d.tooltip="AgentShield: Zero-leak secret defense active. Workspace safe.",d.backgroundColor=void 0):(d.text=`$(alert) AgentShield: ${o} Leaks!`,d.tooltip=`AgentShield: Detected ${o} unredacted secret(s)! Click to review findings.`,d.backgroundColor=new e.ThemeColor("statusBarItem.errorBackground"))}function y(){let o=P.platform(),t="LowBox AppContainer";o==="linux"&&(t="Bubblewrap"),o==="darwin"&&(t="Seatbelt"),u.text=`$(lock) Sandbox: ${t} [${p}]`,u.tooltip=`AgentShield Kernel Sandbox: ${t} active with ${p} profile. Click to change.`}function T(o){if(o.uri.scheme!=="file"&&o.uri.scheme!=="untitled")return 0;let t=o.getText(),s=[];for(let n of U){n.regex.lastIndex=0;let i;for(;(i=n.regex.exec(t))!==null;){let r=o.positionAt(i.index),l=o.positionAt(i.index+i[0].length),w=new e.Range(r,l),c=new e.Diagnostic(w,`[AgentShield Zero-Leak Guard] Unmasked ${n.name} detected. Avoid committing or passing raw credentials to AI coding agents.`,e.DiagnosticSeverity.Warning);c.source="AgentShield",c.code=n.id,s.push(c)}}return h.set(o.uri,s),R(s.length),s.length}function H(){h&&h.clear()}0&&(module.exports={MutationApprovalProvider,MutationTreeItem,SandboxProfileProvider,SandboxProfileTreeItem,SkillPrismStatusProvider,activate,deactivate}); //# sourceMappingURL=extension.js.map diff --git a/package-lock.json b/package-lock.json index 2db2000..890d9c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "agentshield-defense", - "version": "0.2.1", + "version": "0.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "agentshield-defense", - "version": "0.2.1", + "version": "0.2.2", "license": "MIT", "devDependencies": { "@types/node": "^26.6.6", - "@types/vscode": "^1.85.0", + "@types/vscode": "~1.85.0", "esbuild": "^0.28.2", "typescript": "^7.0.2" }, @@ -471,9 +471,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.145.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.145.0.tgz", - "integrity": "sha512-mADZK4SF/j1n0+Qk4bH8NT1qTQGYDAsbhb5hStbzuB3hKP3mRH7xja5yUaIm7ExCh65Ff+C9XGwxcBvSlTCvkQ==", + "version": "1.85.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.85.0.tgz", + "integrity": "sha512-CF/RBon/GXwdfmnjZj0WTUMZN5H6YITOfBCP4iEZlOtVQXuzw6t7Le7+cR+7JzdMrnlm7Mfp49Oj2TuSXIWo3g==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index bd1c8ec..8c09797 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ }, "devDependencies": { "@types/node": "^26.6.6", - "@types/vscode": "^1.85.0", + "@types/vscode": "~1.85.0", "esbuild": "^0.28.2", "typescript": "^7.0.2" }