opencode-m365-copilot 0.1.0 → 0.2.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.
@@ -1,7 +1,6 @@
1
- import { _ as createLogger, b as CONFIG_DIR, c as AUTHORITY, f as REDIRECT_URI, h as createCachePlugin, m as authCodeFromUrl, p as SYDNEY_SCOPES, u as CLIENT_ID, x as SECRETS_FILE } from "./server-CeGQPDdE.mjs";
1
+ import { C as SECRETS_FILE, S as CONFIG_DIR, _ as createCachePlugin, f as CLIENT_ID, g as authCodeFromUrl, h as SYDNEY_SCOPES, m as REDIRECT_URI, n as object, r as string, u as AUTHORITY, y as createLogger } from "./server-DDD-Hlhx.mjs";
2
2
  import { existsSync, mkdirSync, readFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
- import { z } from "zod";
5
4
  //#region src/login.ts
6
5
  /**
7
6
  * Interactive / automated sign-in. Loaded only by the CLI, never by the plugin.
@@ -21,14 +20,14 @@ import { z } from "zod";
21
20
  * Either way it is a one-time cost — afterwards `auth.ts` refreshes silently.
22
21
  */
23
22
  const log = createLogger("login");
24
- const SecretsSchema = z.object({
25
- email: z.string().min(3),
26
- password: z.string().min(1),
23
+ const SecretsSchema = object({
24
+ email: string().min(3),
25
+ password: string().min(1),
27
26
  /**
28
27
  * The base32 TOTP seed — what your authenticator derives its 6-digit codes from,
29
28
  * not a code. Optional: without it, only interactive sign-in is possible.
30
29
  */
31
- mfaSecret: z.string().optional()
30
+ mfaSecret: string().optional()
32
31
  });
33
32
  /** Read stored credentials, if any. Returns undefined when the file is absent. */
34
33
  function loadSecrets(file = SECRETS_FILE) {
@@ -63,7 +62,7 @@ function normaliseTotpSecret(raw) {
63
62
  }
64
63
  /** Current 6-digit code for a base32 seed. */
65
64
  async function totpCode(secret) {
66
- const { TOTP, Secret } = await import("otpauth");
65
+ const { TOTP, Secret } = await import("./otpauth.node-klD_z4Tx.mjs");
67
66
  return new TOTP({
68
67
  secret: Secret.fromBase32(normaliseTotpSecret(secret)),
69
68
  digits: 6,
@@ -80,7 +79,7 @@ async function login(options = {}) {
80
79
  const secrets = loadSecrets(options.secretsFile);
81
80
  const interactive = options.interactive ?? !secrets?.mfaSecret;
82
81
  if (!interactive && !secrets) throw new Error(`No credentials at ${options.secretsFile ?? SECRETS_FILE}. Create it with { "email", "password", "mfaSecret" }, or sign in interactively with --interactive.`);
83
- const { PublicClientApplication, CryptoProvider } = await import("@azure/msal-node");
82
+ const { PublicClientApplication, CryptoProvider } = await import("./dist-CX5bv-4h.mjs");
84
83
  const app = new PublicClientApplication({
85
84
  auth: {
86
85
  clientId: CLIENT_ID,
@@ -185,7 +184,7 @@ async function importPlaywright() {
185
184
  try {
186
185
  return await import("playwright");
187
186
  } catch {
188
- throw new Error("Playwright is not installed. It ships as an optional dependency — run `npm i playwright && npx playwright install chromium`, or set CHROMIUM_PATH to an existing browser.");
187
+ throw new Error("Playwright is not installed. It is an optional peer dependency, deliberately not pulled in by the plugin itself — install it alongside this CLI with `npm i -g playwright && npx playwright install chromium`, or set CHROMIUM_PATH to an existing browser.");
189
188
  }
190
189
  }
191
190
  //#endregion