opencode-m365-copilot 0.1.0

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.
@@ -0,0 +1,51 @@
1
+ //#region src/models.d.ts
2
+ /**
3
+ * Default when a request carries no model.
4
+ *
5
+ * Their README measures `gpt-5.5-think-deeper` at 100% tool compliance with the
6
+ * declarative agent + fenced/shell-routing path, and a request with no model already
7
+ * defaults to it there. Note this conflicts with `m365-copilot-api.md` quirk #13,
8
+ * which says reasoning tones meta-analyse the injected prompt and disengage — that
9
+ * note predates the GPT-5.5 measurements. See README for the full story.
10
+ */
11
+ declare const DEFAULT_MODEL = "gpt-5.5-think-deeper";
12
+ //#endregion
13
+ //#region src/server.d.ts
14
+ interface ServerDeps {
15
+ /** Supplies a Sydney chat token. */
16
+ getToken: () => Promise<string>;
17
+ /**
18
+ * Resolves the declarative agent id, or null to go without one.
19
+ *
20
+ * Called lazily and only once — provisioning is slow, and only tool requests need it.
21
+ */
22
+ resolveAgent?: () => Promise<string | null>;
23
+ /** Override the M365 origin. Tests point this at a stub. */
24
+ endpoint?: string;
25
+ /** Keep every tool call the model emits rather than only the first. */
26
+ allowMultiTool?: boolean;
27
+ /**
28
+ * Trim the harness's toolset before the model sees it.
29
+ *
30
+ * The enforcement point for lean mode — opencode's own `tools` config does not
31
+ * filter the outgoing request. See `selectLeanTools`.
32
+ */
33
+ lean?: boolean;
34
+ /**
35
+ * Replace the harness's prose system prompt with this leaner one.
36
+ *
37
+ * Done here rather than in the plugin because opencode's own system-prompt hook
38
+ * does not affect the outgoing request — see `condenseSystemPrompt`.
39
+ */
40
+ leanSystemPrompt?: string;
41
+ port?: number;
42
+ host?: string;
43
+ }
44
+ interface ProxyHandle {
45
+ url: string;
46
+ port: number;
47
+ close(): Promise<void>;
48
+ }
49
+ declare function startServer(deps: ServerDeps): Promise<ProxyHandle>;
50
+ //#endregion
51
+ export { DEFAULT_MODEL, ProxyHandle, ServerDeps, startServer };
@@ -0,0 +1,2 @@
1
+ import { o as DEFAULT_MODEL, t as startServer } from "./server-CeGQPDdE.mjs";
2
+ export { DEFAULT_MODEL, startServer };
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "opencode-m365-copilot",
3
+ "version": "0.1.0",
4
+ "description": "Use your org's Microsoft 365 Copilot as the model backend for opencode",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=22"
9
+ },
10
+ "bin": {
11
+ "opencode-m365": "./dist/cli.mjs"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/plugin.d.mts",
16
+ "import": "./dist/plugin.mjs"
17
+ },
18
+ "./server": {
19
+ "types": "./dist/server.d.mts",
20
+ "import": "./dist/server.mjs"
21
+ }
22
+ },
23
+ "main": "./dist/plugin.mjs",
24
+ "types": "./dist/plugin.d.mts",
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "scripts": {
29
+ "build": "tsdown",
30
+ "test": "vitest run",
31
+ "test:watch": "vitest",
32
+ "typecheck": "tsc --noEmit"
33
+ },
34
+ "dependencies": {
35
+ "@azure/msal-node": "^5.1.1",
36
+ "otpauth": "^9.5.0",
37
+ "ws": "^8.20.0",
38
+ "zod": "^4.3.6"
39
+ },
40
+ "optionalDependencies": {
41
+ "playwright": "^1.58.2"
42
+ },
43
+ "devDependencies": {
44
+ "@opencode-ai/plugin": "^1.18.18",
45
+ "@types/node": "^26.2.0",
46
+ "@types/ws": "^8.18.1",
47
+ "tsdown": "^0.22.14",
48
+ "typescript": "^7.0.2",
49
+ "vitest": "^4.1.10"
50
+ },
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "keywords": [
55
+ "opencode",
56
+ "opencode-plugin",
57
+ "microsoft-365",
58
+ "copilot",
59
+ "m365",
60
+ "openai-compatible",
61
+ "llm"
62
+ ],
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "git+https://github.com/chrischall/opencode-copilot-plugin.git"
66
+ },
67
+ "peerDependencies": {
68
+ "@opencode-ai/plugin": ">=1.18.0"
69
+ },
70
+ "peerDependenciesMeta": {
71
+ "@opencode-ai/plugin": {
72
+ "optional": true
73
+ }
74
+ }
75
+ }