opencode-m365-copilot 0.3.4 → 0.3.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.
@@ -1,4 +1,4 @@
1
- import { _ as createLogger, b as AGENT_FILE, d as POWERPLATFORM_SCOPE, l as BAP_SCOPE, y as writePrivateFile } from "./server-DQW-8ns2.mjs";
1
+ import { _ as createLogger, b as AGENT_FILE, d as POWERPLATFORM_SCOPE, l as BAP_SCOPE, y as writePrivateFile } from "./server-CvdPE1oi.mjs";
2
2
  import { createHash } from "node:crypto";
3
3
  import { readFileSync } from "node:fs";
4
4
  //#region src/agent.ts
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { C as SECRETS_FILE, M as LOCAL_TITLE_MODEL, S as CONFIG_DIR, T as PROVIDER_ID, a as startServer, b as AGENT_FILE, g as createTokenClient, j as DEFAULT_MODEL, k as mergeOpencodeConfig, x as CACHE_FILE } from "./server-DQW-8ns2.mjs";
3
- import { t as getOrCreateAgent } from "./agent-Cd7BGDdu.mjs";
2
+ import { C as SECRETS_FILE, M as LOCAL_TITLE_MODEL, S as CONFIG_DIR, T as PROVIDER_ID, a as startServer, b as AGENT_FILE, g as createTokenClient, j as DEFAULT_MODEL, k as mergeOpencodeConfig, x as CACHE_FILE } from "./server-CvdPE1oi.mjs";
3
+ import { t as getOrCreateAgent } from "./agent-gllWWI9m.mjs";
4
4
  import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { homedir } from "node:os";
6
6
  import { dirname, join, resolve } from "node:path";
@@ -46,7 +46,7 @@ to complete SSO/MFA by hand once — the only option on tenants with push-only
46
46
  MFA, FIDO2, or a federated IdP.`);
47
47
  }
48
48
  async function doLogin(args) {
49
- const { login } = await import("./login-DTenVKcz.mjs");
49
+ const { login } = await import("./login-DGT4kHJ1.mjs");
50
50
  const interactive = args.includes("--interactive");
51
51
  try {
52
52
  const account = await login({
@@ -1,4 +1,4 @@
1
- import { F as __require, I as __toESM, P as __commonJSMin } from "./server-DQW-8ns2.mjs";
1
+ import { F as __require, I as __toESM, P as __commonJSMin } from "./server-CvdPE1oi.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import http from "http";
4
4
  import crypto, { createHash as createHash$1 } from "crypto";
@@ -1,4 +1,4 @@
1
- import { C as SECRETS_FILE, S as CONFIG_DIR, _ as createLogger, c as AUTHORITY, f as REDIRECT_URI, h as createCachePlugin, m as authCodeFromUrl, o as object, p as SYDNEY_SCOPES, s as string, u as CLIENT_ID, v as ensurePrivateDir } from "./server-DQW-8ns2.mjs";
1
+ import { C as SECRETS_FILE, S as CONFIG_DIR, _ as createLogger, c as AUTHORITY, f as REDIRECT_URI, h as createCachePlugin, m as authCodeFromUrl, o as object, p as SYDNEY_SCOPES, s as string, u as CLIENT_ID, v as ensurePrivateDir } from "./server-CvdPE1oi.mjs";
2
2
  import { chmodSync, existsSync, readFileSync, statSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  //#region src/login.ts
@@ -96,7 +96,7 @@ async function login(options = {}) {
96
96
  const secrets = loadSecrets(options.secretsFile);
97
97
  const interactive = options.interactive ?? !secrets?.mfaSecret;
98
98
  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.`);
99
- const { PublicClientApplication, CryptoProvider } = await import("./dist-CMVPFMhc.mjs");
99
+ const { PublicClientApplication, CryptoProvider } = await import("./dist-CQqDXRJD.mjs");
100
100
  const app = new PublicClientApplication({
101
101
  auth: {
102
102
  clientId: CLIENT_ID,
package/dist/plugin.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { A as resolveOptions, D as buildModelInfos, E as applyPluginConfig, N as isLocalModel, O as buildProviderInfo, T as PROVIDER_ID, _ as createLogger, a as startServer, g as createTokenClient, j as DEFAULT_MODEL, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER, w as PLUGIN_ID } from "./server-DQW-8ns2.mjs";
2
- import { t as getOrCreateAgent } from "./agent-Cd7BGDdu.mjs";
1
+ import { A as resolveOptions, D as buildModelInfos, E as applyPluginConfig, N as isLocalModel, O as buildProviderInfo, T as PROVIDER_ID, _ as createLogger, a as startServer, g as createTokenClient, j as DEFAULT_MODEL, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER, w as PLUGIN_ID } from "./server-CvdPE1oi.mjs";
2
+ import { t as getOrCreateAgent } from "./agent-gllWWI9m.mjs";
3
3
  //#region src/runtime.ts
4
4
  /**
5
5
  * The part of the plugin that is the same under both opencode plugin APIs.
@@ -1004,7 +1004,7 @@ function createTokenClient(options = {}) {
1004
1004
  const cache = /* @__PURE__ */ new Map();
1005
1005
  async function client() {
1006
1006
  if (app) return app;
1007
- const { PublicClientApplication } = await import("./dist-CMVPFMhc.mjs");
1007
+ const { PublicClientApplication } = await import("./dist-CQqDXRJD.mjs");
1008
1008
  app = new PublicClientApplication({
1009
1009
  auth: {
1010
1010
  clientId: CLIENT_ID,
@@ -5335,6 +5335,17 @@ function prefixIssues(path, issues) {
5335
5335
  function unwrapMessage(message) {
5336
5336
  return typeof message === "string" ? message : message?.message;
5337
5337
  }
5338
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
5339
+ function sizeCaps(defChecks) {
5340
+ const caps = [];
5341
+ for (const ch of defChecks ?? []) {
5342
+ const d = ch._zod.def;
5343
+ if (!/_(length|size)$|_equals$/.test(d.check)) break;
5344
+ const max = d.maximum ?? d.length ?? d.size;
5345
+ if (max >= 0) caps.push([max, ch]);
5346
+ }
5347
+ return caps;
5348
+ }
5338
5349
  function attachSchema(issues, start, inst) {
5339
5350
  var _a;
5340
5351
  for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
@@ -6382,7 +6393,7 @@ var Doc = class {
6382
6393
  const version = {
6383
6394
  major: 4,
6384
6395
  minor: 6,
6385
- patch: 5
6396
+ patch: 7
6386
6397
  };
6387
6398
  //#endregion
6388
6399
  //#region node_modules/zod/v4/core/schemas.js
@@ -6902,6 +6913,26 @@ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
6902
6913
  return payload;
6903
6914
  };
6904
6915
  });
6916
+ function capSize(inst, size) {
6917
+ const caps = sizeCaps(inst._zod.def.checks);
6918
+ if (!caps.length) return;
6919
+ const cap = Math.min(...caps.map((c) => c[0]));
6920
+ const parse = inst._zod.parse;
6921
+ inst._zod.parse = (payload, ctx) => {
6922
+ const n = size(payload.value);
6923
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
6924
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
6925
+ const start = payload.issues.length;
6926
+ ch._zod.check(payload);
6927
+ payload.issues[start].continue = false;
6928
+ attachSchema(payload.issues, start, inst);
6929
+ return payload;
6930
+ }
6931
+ }
6932
+ return parse(payload, ctx);
6933
+ };
6934
+ }
6935
+ const arraySize = (input) => Array.isArray(input) ? input.length : -1;
6905
6936
  function handleArrayResult(result, final, index) {
6906
6937
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
6907
6938
  final.value[index] = result.value;
@@ -6939,6 +6970,7 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
6939
6970
  if (proms.length) return Promise.all(proms).then(() => payload);
6940
6971
  return payload;
6941
6972
  };
6973
+ capSize(inst, arraySize);
6942
6974
  });
6943
6975
  function handlePropertyResult(result, final, key, input, optin, optout) {
6944
6976
  const isPresent = key in input;
@@ -7047,7 +7079,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
7047
7079
  }
7048
7080
  return propValues;
7049
7081
  });
7050
- const isObject$2 = isObject;
7082
+ const isObject$1 = isObject;
7051
7083
  const catchall = def.catchall;
7052
7084
  let value;
7053
7085
  const memo = globalConfig.memoizer;
@@ -7055,7 +7087,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
7055
7087
  inst._zod.parse = (payload, ctx) => {
7056
7088
  value ?? (value = _normalized.value);
7057
7089
  const input = payload.value;
7058
- if (!isObject$2(input)) {
7090
+ if (!isObject$1(input)) {
7059
7091
  payload.issues.push({
7060
7092
  expected: "object",
7061
7093
  code: "invalid_type",
@@ -7185,7 +7217,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
7185
7217
  return doc.compile();
7186
7218
  };
7187
7219
  let fastpass;
7188
- const isObject$1 = isObject;
7220
+ const isObject$2 = isObject;
7189
7221
  const jit = !globalConfig.jitless;
7190
7222
  const fastEnabled = jit && allowsEval.value;
7191
7223
  const catchall = def.catchall;
@@ -7193,7 +7225,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
7193
7225
  inst._zod.parse = (payload, ctx) => {
7194
7226
  value ?? (value = _normalized.value);
7195
7227
  const input = payload.value;
7196
- if (!isObject$1(input)) {
7228
+ if (!isObject$2(input)) {
7197
7229
  payload.issues.push({
7198
7230
  expected: "object",
7199
7231
  code: "invalid_type",
package/dist/server.mjs CHANGED
@@ -1,2 +1 @@
1
- import { a as startServer, i as generateApiKey, j as DEFAULT_MODEL, n as DEFAULT_MAX_BODY_BYTES, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER } from "./server-DQW-8ns2.mjs";
2
- export { AUX_REQUEST_KIND_HEADER, DEFAULT_MAX_BODY_BYTES, DEFAULT_MODEL, SESSION_ID_HEADER, generateApiKey, startServer };
1
+ export { t as AUX_REQUEST_KIND_HEADER, n as DEFAULT_MAX_BODY_BYTES, j as DEFAULT_MODEL, r as SESSION_ID_HEADER, i as generateApiKey, a as startServer } from "./server-CvdPE1oi.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-m365-copilot",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Use your org's Microsoft 365 Copilot as the model backend for opencode",
5
5
  "license": "MIT",
6
6
  "type": "module",