opencode-m365-copilot 2.2.0 → 2.3.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.
package/dist/server.d.mts CHANGED
@@ -79,6 +79,12 @@ export interface ServerDeps {
79
79
  * does not affect the outgoing request — see `condenseSystemPrompt`.
80
80
  */
81
81
  leanSystemPrompt?: string;
82
+ /**
83
+ * Reach opencode 2's MCP tools only through the proxy's `mcp` tool: the Code Mode
84
+ * catalogue and `execute` never reach M365, a search is answered here, and a call
85
+ * becomes an `execute` call for opencode to run. Off unless set.
86
+ */
87
+ mcpProxy?: boolean;
82
88
  /**
83
89
  * Receives one entry per M365 turn: the raw reply, what was parsed from it, and
84
90
  * M365's diagnostics. Defaults to a JSONL file at `M365_TURN_LOG` when that is set,
@@ -116,12 +122,19 @@ export interface ProxyHandle {
116
122
  export declare const DEFAULT_MAX_BODY_BYTES: number;
117
123
  /** A fresh per-launch secret: 32 random bytes, base64url. */
118
124
  export declare function generateApiKey(): string;
125
+ /**
126
+ * `mcp` blocks the proxy answers itself per request — searches, unknown paths and
127
+ * unreadable blocks — before the reply goes back to the client as it is.
128
+ */
129
+ export declare const MAX_MCP_SEARCHES = 3;
119
130
  export declare function startServer(deps: ServerDeps): Promise<ProxyHandle>;
120
131
  export interface TurnLogEntry {
121
132
  time: string;
122
133
  model: string;
123
134
  tone: string | null;
124
135
  agent: boolean;
136
+ /** How the tool block was worded, on a tool turn. */
137
+ framing?: "default" | "relay";
125
138
  tools: string[];
126
139
  reply?: string;
127
140
  toolCalls?: string[];
@@ -132,6 +145,31 @@ export interface TurnLogEntry {
132
145
  resultValue?: string;
133
146
  /** This turn was the follow-up sent after a give-up. */
134
147
  nudged?: boolean;
148
+ /** This turn was the reply to an `mcp` search the proxy answered; the query. */
149
+ mcpSearch?: string;
150
+ /**
151
+ * This turn's reply was an `mcp` call the proxy sent to opencode as an `execute`
152
+ * call: the tool's path, or `search` for opencode's own search.
153
+ */
154
+ mcpCall?: string;
135
155
  error?: string;
136
156
  }
157
+ /**
158
+ * One line for the next turn when the last reply was not run as written. Without
159
+ * it the model assumes every block it wrote ran, and the reference project measured
160
+ * early "task already complete" endings falling from 9 in 56 runs to 0 in 70 once
161
+ * it was told.
162
+ */
163
+ export declare function noteAbout(parsed: {
164
+ toolCalls: {
165
+ name: string;
166
+ }[];
167
+ skippedCalls: number;
168
+ inventedResult: boolean;
169
+ }): string | undefined;
170
+ /**
171
+ * Drop every `mcp` block from a reply. Past the search cap the client gets the
172
+ * reply's prose (and any real call in it), never a call to the proxy's own tool.
173
+ */
174
+ export declare function stripMcpCalls(text: string): string;
137
175
  export {};
package/dist/server.mjs CHANGED
@@ -1 +1 @@
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-BRXlKFEJ.mjs";
1
+ export { t as AUX_REQUEST_KIND_HEADER, n as DEFAULT_MAX_BODY_BYTES, P as DEFAULT_MODEL, r as MAX_MCP_SEARCHES, i as SESSION_ID_HEADER, a as generateApiKey, o as noteAbout, s as startServer, c as stripMcpCalls } from "./server-DXznAk1h.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-m365-copilot",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Use your org's Microsoft 365 Copilot as the model backend for opencode",
5
5
  "license": "MIT",
6
6
  "type": "module",