opencode-m365-copilot 2.1.1 → 2.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.
package/README.md CHANGED
@@ -217,7 +217,8 @@ What `WorkSearch` reaches (all verified against a live tenant, except where note
217
217
  | Third-party **Graph connectors** (Jira, ServiceNow, …) | ✅ *if your admin configured them* |
218
218
 
219
219
  Select one in opencode (the model picker, or pin a `work` sub-agent to it) when you want
220
- this context; every other model stays coding/web-only and never reaches your account. A
220
+ this context; they are listed as `Work · …`. Every other model is listed as `Code · …`,
221
+ stays coding/web-only and never reaches your account. A
221
222
  grounded turn switches the request to the Outlook side-pane scenario, sends that surface's
222
223
  feature variants, and attaches the built-in agent with the `WorkSearch` capability — the
223
224
  combination that actually grounds on the signed-in account — then strips Copilot's inline
@@ -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-MaGKSmnd.mjs";
1
+ import { _ as createLogger, b as AGENT_FILE, d as POWERPLATFORM_SCOPE, l as BAP_SCOPE, y as writePrivateFile } from "./server-Dhpnsh1N.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { createHash } from "node:crypto";
4
4
  // src/agent.ts
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { A as DEFAULT_MODEL, C as SECRETS_FILE, O as mergeOpencodeConfig, S as CONFIG_DIR, T as PROVIDER_ID, a as startServer, b as AGENT_FILE, g as createTokenClient, j as LOCAL_TITLE_MODEL, x as CACHE_FILE } from "./server-MaGKSmnd.mjs";
3
- import { t as getOrCreateAgent } from "./agent-Do_zx7Ev.mjs";
2
+ import { A as DEFAULT_MODEL, C as SECRETS_FILE, O as mergeOpencodeConfig, S as CONFIG_DIR, T as PROVIDER_ID, a as startServer, b as AGENT_FILE, g as createTokenClient, j as LOCAL_TITLE_MODEL, x as CACHE_FILE } from "./server-Dhpnsh1N.mjs";
3
+ import { t as getOrCreateAgent } from "./agent-DDZ4B7E6.mjs";
4
4
  import { homedir } from "node:os";
5
5
  import { dirname, join, resolve } from "node:path";
6
6
  import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -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--nn76uPy.mjs");
49
+ const { login } = await import("./login-DAXgPgtX.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 __toESM, N as __commonJSMin, P as __require } from "./server-MaGKSmnd.mjs";
1
+ import { F as __toESM, N as __commonJSMin, P as __require } from "./server-Dhpnsh1N.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-MaGKSmnd.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-Dhpnsh1N.mjs";
2
2
  import { join } from "node:path";
3
3
  import { chmodSync, existsSync, readFileSync, statSync } from "node:fs";
4
4
  // 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-DoXU8l_x.mjs");
99
+ const { PublicClientApplication, CryptoProvider } = await import("./dist-CN4xwvMF.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 DEFAULT_MODEL, D as buildProviderInfo, E as buildModelInfos, M as isLocalModel, T as PROVIDER_ID, _ as createLogger, a as startServer, g as createTokenClient, k as resolveOptions, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER, w as PLUGIN_ID } from "./server-MaGKSmnd.mjs";
2
- import { t as getOrCreateAgent } from "./agent-Do_zx7Ev.mjs";
1
+ import { A as DEFAULT_MODEL, D as buildProviderInfo, E as buildModelInfos, M as isLocalModel, T as PROVIDER_ID, _ as createLogger, a as startServer, g as createTokenClient, k as resolveOptions, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER, w as PLUGIN_ID } from "./server-Dhpnsh1N.mjs";
2
+ import { t as getOrCreateAgent } from "./agent-DDZ4B7E6.mjs";
3
3
  // src/runtime.ts
4
4
  /**
5
5
  * What the plugin stands on: the OpenAI-compatible proxy, started in-process (or an
@@ -60,8 +60,8 @@ const LOCAL_TITLE_MODEL = "local-title";
60
60
  */
61
61
  const DEFAULT_MODEL = "gpt-5.5-think-deeper";
62
62
  const MODELS = [
63
- m("work", "M365 Copilot (Work — reads your mailbox)", "magic", false, true),
64
- m("work-think", "M365 Copilot (Work, Think Deeper)", "Gpt_5_5_Reasoning", true, true),
63
+ m("work", "Ask your mail, Teams & files", "magic", false, true),
64
+ m("work-think", "Ask your mail, Teams & files (Think Deeper)", "Gpt_5_5_Reasoning", true, true),
65
65
  m("gpt-5.6-think-deeper", "GPT-5.6 (Think Deeper)", "Gpt_5_6_Reasoning", true),
66
66
  m("gpt-5.5-think-deeper", "GPT-5.5 (Think Deeper)", "Gpt_5_5_Reasoning", true),
67
67
  m("gpt-5.5", "GPT-5.5", "Gpt_5_5_Chat", false),
@@ -87,7 +87,7 @@ const MODELS = [
87
87
  function m(id, name, tone, reasoning, grounded = false) {
88
88
  return {
89
89
  id,
90
- name,
90
+ name: pickerName(name, tone, grounded),
91
91
  tone,
92
92
  reasoning,
93
93
  grounded,
@@ -97,6 +97,15 @@ function m(id, name, tone, reasoning, grounded = false) {
97
97
  }
98
98
  };
99
99
  }
100
+ /**
101
+ * Lead with what the model is for. opencode 2's `Model.Info` has no description, so
102
+ * the name is the only thing that separates reading your account from writing code.
103
+ * The local titler is neither.
104
+ */
105
+ function pickerName(name, tone, grounded) {
106
+ if (tone === null) return name;
107
+ return `${grounded ? "Work" : "Code"} · ${name}`;
108
+ }
100
109
  const BY_ID = new Map(MODELS.map((model) => [model.id, model]));
101
110
  /**
102
111
  * Look up a model, falling back to the default for anything we do not know.
@@ -949,7 +958,7 @@ function createTokenClient(options = {}) {
949
958
  const cache = /* @__PURE__ */ new Map();
950
959
  async function client() {
951
960
  if (app) return app;
952
- const { PublicClientApplication } = await import("./dist-DoXU8l_x.mjs");
961
+ const { PublicClientApplication } = await import("./dist-CN4xwvMF.mjs");
953
962
  app = new PublicClientApplication({
954
963
  auth: {
955
964
  clientId: CLIENT_ID,
package/dist/server.mjs CHANGED
@@ -1 +1 @@
1
- export { t as AUX_REQUEST_KIND_HEADER, n as DEFAULT_MAX_BODY_BYTES, A as DEFAULT_MODEL, r as SESSION_ID_HEADER, i as generateApiKey, a as startServer } from "./server-MaGKSmnd.mjs";
1
+ export { t as AUX_REQUEST_KIND_HEADER, n as DEFAULT_MAX_BODY_BYTES, A as DEFAULT_MODEL, r as SESSION_ID_HEADER, i as generateApiKey, a as startServer } from "./server-Dhpnsh1N.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-m365-copilot",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Use your org's Microsoft 365 Copilot as the model backend for opencode",
5
5
  "license": "MIT",
6
6
  "type": "module",