@vibecontrols/vibe-plugin-security-archive 2026.601.1 → 2026.1110.1

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +35 -22
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var __require=import.meta.require;import{ProviderRegistry,TelemetryEmitter,createLifecycleHooks}from"@vibecontrols/plugin-sdk";import{createHash}from"crypto";import{promises as fs}from"fs";import*as path from"path";import{fingerprint}from"@vibecontrols/vibe-plugin-security/fingerprint";var TOOL_VERSION="tombstone-retention@1.0.0";class TombstoneRetentionProvider{name="tombstone-retention";stage="archive.offboard";toolVersion=TOOL_VERSION;host;async init(host){this.host=host}async ensureToolInstalled(){}async run(input){let startedAt=Date.now(),cfg=input.config??{},retentionDays=typeof cfg.retentionDays==="number"?cfg.retentionDays:90;input.onProgress?.({pct:10,message:"Reading local scan history"});let stats=await this.readScanHistory(input.vibeId);input.onProgress?.({pct:60,message:"Writing tombstone.json"});let tombstone={vibeId:input.vibeId,workspaceId:input.workspaceId,repoUrl:input.repoUrl,archivedAt:new Date().toISOString(),scanRunCount:stats.scanRunCount,lastConclusion:stats.lastConclusion,retentionDays,producedBy:this.name},tombstonePath=path.join(input.workdir,"tombstone.json"),tombstoneJson=JSON.stringify(tombstone,null,2);await fs.mkdir(input.workdir,{recursive:!0}),await fs.writeFile(tombstonePath,tombstoneJson,"utf-8");let sha256=createHash("sha256").update(tombstoneJson).digest("hex"),stat=await fs.stat(tombstonePath),evidence=[{type:"opa-decision",localPath:tombstonePath,sha256,sizeBytes:stat.size}],finding={fingerprint:fingerprint({providerName:this.name,ruleId:"archive.tombstone",file:tombstonePath}),ruleId:"archive.tombstone",title:`Vibe archived \u2014 tombstone written (${stats.scanRunCount} historical scan run(s))`,description:`Vibe ${input.vibeId} archived at ${tombstone.archivedAt}. Last conclusion: ${stats.lastConclusion??"n/a"}. Retention policy: ${retentionDays} day(s). Tombstone artifact persisted at ${tombstonePath}.`,severity:"info",category:"policy",rawProviderRef:"tombstone"};return input.onProgress?.({pct:100,message:"Archive complete"}),{runId:input.runId,status:"succeeded",findings:[finding],evidence,durationMs:Date.now()-startedAt,summary:summarize([finding])}}async cancel(_runId){}metadata(){return{stage:this.stage,supportedProfiles:["backend","frontend","cli","sdk","mcp","chrome-extension","vscode-extension","container","iac"],toolVersion:this.toolVersion,description:"Archive / offboard provider \u2014 emits a tombstone.json summary for archived vibes."}}async readScanHistory(vibeId){let dataDir=this.host?.getDataDir?.();if(!dataDir)return{scanRunCount:0};let dbPath=path.join(dataDir,"security","security.sqlite");try{await fs.access(dbPath)}catch{return{scanRunCount:0}}try{let{Database}=await import("bun:sqlite"),db=new Database(dbPath,{readonly:!0});try{let countRow=db.prepare("SELECT COUNT(*) AS c FROM security_scan_runs WHERE vibe_id = $vibe_id").get({$vibe_id:vibeId}),lastRow=db.prepare("SELECT conclusion FROM security_scan_runs WHERE vibe_id = $vibe_id ORDER BY started_at DESC LIMIT 1").get({$vibe_id:vibeId});return{scanRunCount:countRow?.c??0,lastConclusion:lastRow?.conclusion??void 0}}finally{db.close()}}catch(err){return this.host?.logger?.warn?.("security-archive-provider",`scan history read failed; defaulting to zero counts: ${String(err)}`),{scanRunCount:0}}}}function summarize(findings){let s={critical:0,high:0,medium:0,low:0,info:0};for(let f of findings)s[f.severity]++;return s}var PLUGIN_NAME="security-archive",PLUGIN_VERSION="2026.528.1",createPlugin=(_ctx)=>{let provider=new TombstoneRetentionProvider,telemetry=new TelemetryEmitter(PLUGIN_NAME,PLUGIN_VERSION),lifecycle=createLifecycleHooks({name:PLUGIN_NAME,telemetryEventName:"security.archive.ready",onInit:async(host)=>{await provider.init(host),new ProviderRegistry(host).registerProvider("security.archive","tombstone-retention",provider),telemetry.emit("security.archive.registered",{provider:"tombstone-retention",toolVersion:provider.toolVersion})}});return{name:PLUGIN_NAME,version:PLUGIN_VERSION,description:"Archive / offboard provider for the archive.offboard lifecycle stage \u2014 writes a tombstone.json summarising final scan state.",tags:["backend","provider","integration"],capabilities:{storage:"rw",audit:!0,telemetry:!0},onServerStart:lifecycle.onServerStart,onServerStop:lifecycle.onServerStop}},src_default=createPlugin;export{src_default as default,createPlugin,TombstoneRetentionProvider};
2
+ import{ProviderRegistry,TelemetryEmitter,createLifecycleHooks}from"@vibecontrols/plugin-sdk";import{createHash}from"crypto";import{promises as fs}from"fs";import*as path from"path";import{fingerprint}from"@vibecontrols/vibe-plugin-security/fingerprint";var TOOL_VERSION="tombstone-retention@1.0.0";class TombstoneRetentionProvider{name="tombstone-retention";stage="archive.offboard";toolVersion=TOOL_VERSION;host;async init(host){this.host=host}async ensureToolInstalled(){}async run(input){let startedAt=Date.now(),cfg=input.config??{},retentionDays=typeof cfg.retentionDays==="number"?cfg.retentionDays:90;input.onProgress?.({pct:10,message:"Reading local scan history"});let stats=await this.readScanHistory(input.vibeId);input.onProgress?.({pct:60,message:"Writing tombstone.json"});let tombstone={vibeId:input.vibeId,workspaceId:input.workspaceId,repoUrl:input.repoUrl,archivedAt:new Date().toISOString(),scanRunCount:stats.scanRunCount,lastConclusion:stats.lastConclusion,retentionDays,producedBy:this.name},tombstonePath=path.join(input.workdir,"tombstone.json"),tombstoneJson=JSON.stringify(tombstone,null,2);await fs.mkdir(input.workdir,{recursive:!0}),await fs.writeFile(tombstonePath,tombstoneJson,"utf-8");let sha256=createHash("sha256").update(tombstoneJson).digest("hex"),stat=await fs.stat(tombstonePath),evidence=[{type:"opa-decision",localPath:tombstonePath,sha256,sizeBytes:stat.size}],finding={fingerprint:fingerprint({providerName:this.name,ruleId:"archive.tombstone",file:tombstonePath}),ruleId:"archive.tombstone",title:`Vibe archived \u2014 tombstone written (${stats.scanRunCount} historical scan run(s))`,description:`Vibe ${input.vibeId} archived at ${tombstone.archivedAt}. Last conclusion: ${stats.lastConclusion??"n/a"}. Retention policy: ${retentionDays} day(s). Tombstone artifact persisted at ${tombstonePath}.`,severity:"info",category:"policy",rawProviderRef:"tombstone"};return input.onProgress?.({pct:100,message:"Archive complete"}),{runId:input.runId,status:"succeeded",findings:[finding],evidence,durationMs:Date.now()-startedAt,summary:summarize([finding])}}async cancel(_runId){}metadata(){return{stage:this.stage,supportedProfiles:["backend","frontend","cli","sdk","mcp","chrome-extension","vscode-extension","container","iac"],toolVersion:this.toolVersion,description:"Archive / offboard provider \u2014 emits a tombstone.json summary for archived vibes."}}async readScanHistory(vibeId){let dataDir=this.host?.getDataDir?.();if(!dataDir)return{scanRunCount:0};let dbPath=path.join(dataDir,"security","security.sqlite");try{await fs.access(dbPath)}catch{return{scanRunCount:0}}try{let{Database}=await import("bun:sqlite"),db=new Database(dbPath,{readonly:!0});try{let countRow=db.prepare("SELECT COUNT(*) AS c FROM security_scan_runs WHERE vibe_id = $vibe_id").get({$vibe_id:vibeId}),lastRow=db.prepare("SELECT conclusion FROM security_scan_runs WHERE vibe_id = $vibe_id ORDER BY started_at DESC LIMIT 1").get({$vibe_id:vibeId});return{scanRunCount:countRow?.c??0,lastConclusion:lastRow?.conclusion??void 0}}finally{db.close()}}catch(err){return this.host?.logger?.warn?.("security-archive-provider",`scan history read failed; defaulting to zero counts: ${String(err)}`),{scanRunCount:0}}}}function summarize(findings){let s={critical:0,high:0,medium:0,low:0,info:0};for(let f of findings)s[f.severity]++;return s}var PLUGIN_NAME="security-archive",PLUGIN_VERSION="2026.528.1",createPlugin=(_ctx)=>{let provider=new TombstoneRetentionProvider,telemetry=new TelemetryEmitter(PLUGIN_NAME,PLUGIN_VERSION),lifecycle=createLifecycleHooks({name:PLUGIN_NAME,telemetryEventName:"security.archive.ready",onInit:async(host)=>{await provider.init(host),new ProviderRegistry(host).registerProvider("security.archive","tombstone-retention",provider),telemetry.emit("security.archive.registered",{provider:"tombstone-retention",toolVersion:provider.toolVersion})}});return{name:PLUGIN_NAME,version:PLUGIN_VERSION,description:"Archive / offboard provider for the archive.offboard lifecycle stage \u2014 writes a tombstone.json summarising final scan state.",tags:["backend","provider","integration"],capabilities:{storage:"rw",audit:!0,telemetry:!0},onServerStart:lifecycle.onServerStart,onServerStop:lifecycle.onServerStop}},src_default=createPlugin;export{TombstoneRetentionProvider,createPlugin,src_default as default};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@vibecontrols/vibe-plugin-security-archive",
3
- "version": "2026.601.1",
3
+ "version": "2026.1110.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "description": "Archive / offboard handler for the archive.offboard lifecycle stage. Walks the agent SQLite scan_runs table for the vibe and writes a tombstone.json evidence artifact summarising final state. Honors retention policies from input.config.",
8
8
  "engines": {
9
- "bun": ">=1.3.14"
9
+ "bun": ">=1.4.4"
10
10
  },
11
11
  "author": {
12
12
  "name": "Vignesh T.V",
@@ -14,32 +14,31 @@
14
14
  },
15
15
  "license": "MIT",
16
16
  "scripts": {
17
- "build": "bun build ./src/index.ts --outdir ./dist --target bun --minify-syntax --minify-whitespace --external elysia --external @vibecontrols/vibe-plugin-security --external @vibecontrols/plugin-sdk && tsc --emitDeclarationOnly --declaration --outDir ./dist",
18
- "dev": "tsc --watch",
19
- "lint": "eslint ./src ./tests",
20
- "format": "bunx prettier . --write",
21
- "format:check": "bunx prettier . --check",
22
- "type:check": "tsc --noEmit",
23
- "test": "bun test ./tests",
17
+ "build": "bun build ./src/index.ts --outdir ./dist --target bun --minify-syntax --minify-whitespace --external elysia --external @vibecontrols/vibe-plugin-security --external @vibecontrols/plugin-sdk && tsc -p tsconfig.build.json",
18
+ "dev": "tsc -p tsconfig.build.json --watch",
19
+ "lint": "eslint .",
20
+ "format": "bun fmt",
21
+ "format:check": "bun fmt --check",
22
+ "type:check": "boff gate -- bun check --no-pretty",
23
+ "test": "bun test",
24
24
  "clean": "rimraf dist",
25
25
  "prebuild": "bun run clean",
26
26
  "prepublishOnly": "bun run build",
27
- "sanity": "bun run format:check && bun run lint && bun run type:check && bun run test && bun run build"
27
+ "sanity": "boff sanity",
28
+ "sanity:force": "boff sanity --force",
29
+ "audit": "bun audit --audit-level=high"
28
30
  },
29
31
  "dependencies": {
30
32
  "@vibecontrols/plugin-sdk": "2026.527.1",
31
33
  "@vibecontrols/vibe-plugin-security": "2026.528.1"
32
34
  },
33
35
  "devDependencies": {
34
- "@eslint/js": "^10.0.1",
35
- "@types/node": "^22.0.0",
36
- "bun-types": "^1.3.9",
37
- "eslint": "^9.30.1",
38
- "globals": "^17.3.0",
39
- "prettier": "^3.6.2",
40
- "rimraf": "^6.0.1",
41
- "typescript": "^5.9.3",
42
- "typescript-eslint": "^8.56.0"
36
+ "@burdenoff/toolchain": "2026.1107.14",
37
+ "@types/bun": "^1.4.4",
38
+ "eslint": "^9.39.5",
39
+ "knip": "^6.44.1",
40
+ "rimraf": "^6.1.4",
41
+ "typescript": "6.0.3"
43
42
  },
44
43
  "peerDependencies": {
45
44
  "@vibecontrols/agent": ">=2026.428.0"
@@ -62,10 +61,10 @@
62
61
  ],
63
62
  "repository": {
64
63
  "type": "git",
65
- "url": "git+https://github.com/algoshred/vibe-plugin-security-archive.git"
64
+ "url": "git+https://github.com/Algoshred/vibe-plugin-security-archive.git"
66
65
  },
67
66
  "bugs": {
68
- "url": "https://github.com/algoshred/vibe-plugin-security-archive/issues"
67
+ "url": "https://github.com/Algoshred/vibe-plugin-security-archive/issues"
69
68
  },
70
69
  "homepage": "https://vibecontrols.com",
71
70
  "publishConfig": {
@@ -77,5 +76,19 @@
77
76
  "!dist/**/*.map",
78
77
  "README.md",
79
78
  "LICENSE"
80
- ]
79
+ ],
80
+ "packageManager": "bun@1.4.4",
81
+ "boff": {
82
+ "type": "plugin",
83
+ "sanity": {
84
+ "steps": [
85
+ "format",
86
+ "lint",
87
+ "typecheck",
88
+ "build",
89
+ "test",
90
+ "knip"
91
+ ]
92
+ }
93
+ }
81
94
  }