opencode-m365-copilot 2.1.2 → 2.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.
package/dist/server.d.mts CHANGED
@@ -12,13 +12,30 @@
12
12
  /**
13
13
  * Default when a request carries no model.
14
14
  *
15
- * Their README measures `gpt-5.5-think-deeper` at 100% tool compliance with the
16
- * declarative agent + fenced/shell-routing path, and a request with no model already
17
- * defaults to it there. Note this conflicts with `m365-copilot-api.md` quirk #13,
18
- * which says reasoning tones meta-analyse the injected prompt and disengage — that
19
- * note predates the GPT-5.5 measurements. See README for the full story.
15
+ * A chat tone, because a coding backend has to call tools. Measured on a live tenant
16
+ * (2026-11-09): `quick` made real tool calls 4/4, while `gpt-5.5-think-deeper` claimed
17
+ * to have no tools 3/3 — matching `m365-copilot-api.md` quirk #13, and contradicting
18
+ * the 100% that project's README reports for it.
20
19
  */
21
- export declare const DEFAULT_MODEL = "gpt-5.5-think-deeper";
20
+ export declare const DEFAULT_MODEL = "quick";
21
+ interface ThrottleState {
22
+ current: number;
23
+ max: number;
24
+ }
25
+ interface TurnResult {
26
+ text: string;
27
+ /** Per-conversation quota, when the server reported it. */
28
+ throttle?: ThrottleState;
29
+ /** Which backend answered — `DeepLeo` is the reasoning pipeline. */
30
+ contentOrigin?: string;
31
+ /** Server-side turn count for this conversation. */
32
+ turnCount?: number;
33
+ /** Classifier scores. `dea_violation` rises before Disengaged fires. */
34
+ scores?: Record<string, number>;
35
+ /** The final item's verdict: `Success`, or why M365 did not serve the turn. */
36
+ resultValue?: string;
37
+ errorCode?: string;
38
+ }
22
39
  /**
23
40
  * Header a harness uses to declare what an auxiliary request is *for*.
24
41
  *
@@ -62,6 +79,12 @@ export interface ServerDeps {
62
79
  * does not affect the outgoing request — see `condenseSystemPrompt`.
63
80
  */
64
81
  leanSystemPrompt?: string;
82
+ /**
83
+ * Receives one entry per M365 turn: the raw reply, what was parsed from it, and
84
+ * M365's diagnostics. Defaults to a JSONL file at `M365_TURN_LOG` when that is set,
85
+ * and to nothing otherwise — the raw reply can hold anything from the workspace.
86
+ */
87
+ turnLog?: (entry: TurnLogEntry) => void;
65
88
  port?: number;
66
89
  /** Loopback only: `127.0.0.1` (the default), `::1` or `localhost`. Anything else throws. */
67
90
  host?: string;
@@ -93,4 +116,37 @@ export interface ProxyHandle {
93
116
  export declare const DEFAULT_MAX_BODY_BYTES: number;
94
117
  /** A fresh per-launch secret: 32 random bytes, base64url. */
95
118
  export declare function generateApiKey(): string;
96
- export declare function startServer(deps: ServerDeps): Promise<ProxyHandle>;
119
+ export declare function startServer(deps: ServerDeps): Promise<ProxyHandle>;
120
+ export interface TurnLogEntry {
121
+ time: string;
122
+ model: string;
123
+ tone: string | null;
124
+ agent: boolean;
125
+ /** How the tool block was worded, on a tool turn. */
126
+ framing?: "default" | "relay";
127
+ tools: string[];
128
+ reply?: string;
129
+ toolCalls?: string[];
130
+ contentOrigin?: string;
131
+ turnCount?: number;
132
+ throttle?: TurnResult["throttle"];
133
+ scores?: Record<string, number>;
134
+ resultValue?: string;
135
+ /** This turn was the follow-up sent after a give-up. */
136
+ nudged?: boolean;
137
+ error?: string;
138
+ }
139
+ /**
140
+ * One line for the next turn when the last reply was not run as written. Without
141
+ * it the model assumes every block it wrote ran, and the reference project measured
142
+ * early "task already complete" endings falling from 9 in 56 runs to 0 in 70 once
143
+ * it was told.
144
+ */
145
+ export declare function noteAbout(parsed: {
146
+ toolCalls: {
147
+ name: string;
148
+ }[];
149
+ skippedCalls: number;
150
+ inventedResult: boolean;
151
+ }): string | undefined;
152
+ export {};
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-Dhpnsh1N.mjs";
1
+ export { t as AUX_REQUEST_KIND_HEADER, n as DEFAULT_MAX_BODY_BYTES, M as DEFAULT_MODEL, r as SESSION_ID_HEADER, i as generateApiKey, a as noteAbout, o as startServer } from "./server-MqggZMCR.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-m365-copilot",
3
- "version": "2.1.2",
3
+ "version": "2.2.1",
4
4
  "description": "Use your org's Microsoft 365 Copilot as the model backend for opencode",
5
5
  "license": "MIT",
6
6
  "type": "module",