inovabiz-opencode-companion 0.1.1 → 0.1.2

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.
@@ -1,3 +1,6 @@
1
+ import { dirname, join } from "node:path";
2
+ import { createRequire } from "node:module";
3
+ import { pathToFileURL } from "node:url";
1
4
  export async function createDpapiPersistence(cachePath) {
2
5
  const { FilePersistenceWithDataProtection } = await importMsalNodeExtensionModule("persistence/FilePersistenceWithDataProtection.mjs");
3
6
  return FilePersistenceWithDataProtection.create(cachePath, "CurrentUser");
@@ -7,5 +10,7 @@ export async function createPersistenceCachePlugin(persistence) {
7
10
  return new PersistenceCachePlugin(persistence);
8
11
  }
9
12
  function importMsalNodeExtensionModule(modulePath) {
10
- return import(new URL(`../node_modules/@azure/msal-node-extensions/dist/${modulePath}`, import.meta.url).href);
13
+ const require = createRequire(import.meta.url);
14
+ const packageRoot = dirname(require.resolve("@azure/msal-node-extensions/package.json"));
15
+ return import(pathToFileURL(join(packageRoot, "dist", modulePath)).href);
11
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inovabiz-opencode-companion",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "OpenCode companion plugin for corporate provider authentication and gateway integration.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",