alchemylab 1.0.3 → 1.0.5

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/939.js CHANGED
@@ -1,13 +1,14 @@
1
1
  "use strict"
2
- exports.id=939,exports.ids=[939],exports.modules={9939(e,exports,s){function t(e){try{const s=r.default.readFileSync(e)
3
- return u.default.createHash("md5").update(s).digest("hex")}catch{return null}}var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}}
4
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.syncPlugins=async function(e,s,o,i){const d={synced:[],skipped:[],errors:[]},l=i||function(e){const s=process.argv[1],t=n.default.dirname(s)
5
- return e?t:n.default.dirname(t)}(s),c=n.default.join(e,".opencode","plugin")
6
- try{await r.default.promises.mkdir(c,{recursive:!0})}catch(e){return o.error("Failed to create plugin directory",{destDir:c,error:e instanceof Error?e.message:"Unknown error"}),d}for(const e of a){const s=n.default.join(l,e.sourceName),a=n.default.join(c,e.destName)
7
- try{if(!r.default.existsSync(s)){o.warn("Plugin source not found: "+e.sourceName,{sourcePath:s}),d.errors.push(e.destName)
8
- continue}const i=await r.default.promises.readFile(s,"utf8").catch((()=>null))
9
- if(null===i){o.warn("Could not read plugin source: "+e.sourceName),d.errors.push(e.destName)
10
- continue}const l=e.destName.startsWith("lib/")?i:["const __plugin = (function() {\n const module = { exports: {} };\n const exports = module.exports;\n (function() {",i," })();\n return module.exports.default || module.exports;\n})();\nexport default __plugin;"].join("\n"),p=u.default.createHash("md5").update(l).digest("hex"),m=t(a)
2
+ exports.id=939,exports.ids=[939],exports.modules={9939(e,exports,s){function t(e){try{const s=o.default.readFileSync(e)
3
+ return u.default.createHash("md5").update(s).digest("hex")}catch{return null}}var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}}
4
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.syncPlugins=async function(e,s,r,i){const l={synced:[],skipped:[],errors:[]},d=i||function(){const e=process.argv[1]
5
+ let s=e
6
+ try{s=o.default.realpathSync(e)}catch{}return n.default.dirname(s)}(),c=n.default.join(e,".opencode","plugin")
7
+ try{await o.default.promises.mkdir(c,{recursive:!0})}catch(e){return r.error("Failed to create plugin directory",{destDir:c,error:e instanceof Error?e.message:"Unknown error"}),l}for(const e of a){const s=n.default.join(d,e.sourceName),a=n.default.join(c,e.destName)
8
+ try{if(!o.default.existsSync(s)){r.warn("Plugin source not found: "+e.sourceName,{sourcePath:s}),l.errors.push(e.destName)
9
+ continue}const i=await o.default.promises.readFile(s,"utf8").catch((()=>null))
10
+ if(null===i){r.warn("Could not read plugin source: "+e.sourceName),l.errors.push(e.destName)
11
+ continue}const d=e.destName.startsWith("lib/")?i:["const __plugin = (function() {\n const module = { exports: {} };\n const exports = module.exports;\n (function() {",i," })();\n return module.exports.default || module.exports;\n})();\nexport default __plugin;"].join("\n"),p=u.default.createHash("md5").update(d).digest("hex"),m=t(a)
11
12
  if(null===m||p!==m){const s=n.default.dirname(a)
12
- s!==c&&await r.default.promises.mkdir(s,{recursive:!0}),await r.default.promises.writeFile(a,l,"utf8"),o.info("Synced plugin: "+e.destName,{reason:null===m?"not installed":"updated"}),d.synced.push(e.destName)}else d.skipped.push(e.destName)}catch(s){o.error("Failed to sync plugin: "+e.destName,{error:s instanceof Error?s.message:"Unknown error"}),d.errors.push(e.destName)}}return d}
13
- const r=o(s(9896)),n=o(s(6928)),u=o(s(6982)),a=[{sourceName:"plugins/hooks/plugin.js",destName:"event-hooks.js"},{sourceName:"plugins/hooks/lib/condition-evaluator.js",destName:"lib/condition-evaluator.js"},{sourceName:"plugins/hooks/lib/hook-utils.js",destName:"lib/hook-utils.js"},{sourceName:"plugins/hooks/lib/dedup-utils.js",destName:"lib/dedup-utils.js"},{sourceName:"plugins/inject-session.js",destName:"inject-session.js"},{sourceName:"plugins/anthropic-auth.js",destName:"anthropic-auth.js"},{sourceName:"plugins/system-logger.js",destName:"system-logger.js"}]}}
13
+ s!==c&&await o.default.promises.mkdir(s,{recursive:!0}),await o.default.promises.writeFile(a,d,"utf8"),r.info("Synced plugin: "+e.destName,{reason:null===m?"not installed":"updated"}),l.synced.push(e.destName)}else l.skipped.push(e.destName)}catch(s){r.error("Failed to sync plugin: "+e.destName,{error:s instanceof Error?s.message:"Unknown error"}),l.errors.push(e.destName)}}return l}
14
+ const o=r(s(9896)),n=r(s(6928)),u=r(s(6982)),a=[{sourceName:"plugins/hooks/plugin.js",destName:"event-hooks.js"},{sourceName:"plugins/hooks/lib/condition-evaluator.js",destName:"lib/condition-evaluator.js"},{sourceName:"plugins/hooks/lib/hook-utils.js",destName:"lib/hook-utils.js"},{sourceName:"plugins/hooks/lib/dedup-utils.js",destName:"lib/dedup-utils.js"},{sourceName:"plugins/inject-session.js",destName:"inject-session.js"},{sourceName:"plugins/system-logger.js",destName:"system-logger.js"}]}}