@magpie-community/opencode-cursor-auth 0.2.13 → 0.2.15

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
@@ -35,7 +35,7 @@ plugin's `fetch` answers them on Cursor's agent API:
35
35
  the account (a team may be served in one region only), else
36
36
  `agentn.global.api5.cursor.sh`. A refusal that names a region is tried
37
37
  once more with the config asked again.
38
- - Each request is one `agent.v1.AgentService/Run`, a Connect stream both
38
+ - A fresh request opens `agent.v1.AgentService/Run`, a Connect stream both
39
39
  ways over HTTP/2, with the CLI's headers (`x-cursor-client-type: cli`,
40
40
  its version, privacy mode on).
41
41
  - Where HTTP/2 can't open a Run (an error before its response, or none in
@@ -50,7 +50,7 @@ plugin's `fetch` answers them on Cursor's agent API:
50
50
  to try HTTP/2 again. A region error over HTTP/1.1 sends the Run back to
51
51
  HTTP/2 at the region's agent host. A BidiAppend with no answer in 60 s
52
52
  (more for a large one) ends the Run, as cursor-agent does.
53
- - The whole conversation goes each time, as AI SDK messages kept as blobs
53
+ - A new Run imports the whole conversation as AI SDK messages kept as blobs
54
54
  the server asks for. The caller's tools are MCP tools, listed in the
55
55
  system prompt; the model calls them through Cursor's `CallDynamicTool`,
56
56
  and the calls come back as chat completion tool calls. Cursor's own tools
@@ -90,6 +90,57 @@ plugin's `fetch` answers them on Cursor's agent API:
90
90
  Failures keep their statuses: 401 to sign in again, 429 at the
91
91
  usage limit, 400 for a prompt too long, 403 for a region refusal.
92
92
 
93
+ Tool results can continue a retained Run in the same plugin process. The owner
94
+ uses the same session/cache key and first user message as `conversation_id`, so
95
+ Task subagents sharing their parent's session can run independently. Retention
96
+ waits at most 120 seconds for a result batch and 15 minutes for a Run's total
97
+ lifetime. The pool holds at most 8 owners per account and 32 per process, with
98
+ bounded history, blobs, arguments, and pending writes. When pending writes
99
+ reach their bound (a long history asks for its blobs at once, and a slow link
100
+ drains them slowly), the Run waits for the link to drain, and fails only if it
101
+ doesn't for 30 seconds.
102
+
103
+ Cursor's count of a step's tool calls includes calls the plugin answers itself:
104
+ a tool the request doesn't have is refused to the model, and Cursor's own
105
+ `get_mcp_tools` is answered with the request's tools. The step's calls are the
106
+ rest.
107
+
108
+ These are retention limits. A missing, expired, restarted, busy, incompatible,
109
+ or full owner uses the original history reconstruction and stateless decoder
110
+ on a new Run. Pending parent calls and new input can take that path without
111
+ cancelling the parent's owner. Already supplied client tool results become
112
+ history; the plugin never executes those external tools. A failed native result
113
+ write is reported to that request because its outcome may be uncertain. A later
114
+ request can rebuild from its supplied history without submitting the result to
115
+ the old native exec again.
116
+
117
+ A native tool handoff reports zero usage with `magpie_native.accounting=pending`;
118
+ the final native answer reports the turn's totals. An identical completed retry
119
+ replays the saved response with zero usage. A native final also collects earlier
120
+ stateless debt as `usage.magpie_deferred`, separately from its own prompt total.
121
+ If a started native Run is abandoned after a pending handoff, its dashboard
122
+ count is owed once to the same account and conversation. Successful final
123
+ snapshots, including explicit zero, and cached replays do not enroll that debt.
124
+
125
+ Dashboard attribution uses event timestamps, rather than when events arrive.
126
+ Older debt is bounded strictly before the native Run's start, and keeps that
127
+ bound across later stateless Runs so an authoritative native event is not
128
+ billed again. An earlier event stamped on or after that boundary cannot be
129
+ identified reliably and stays unknown. Missing or ambiguous debt expires after
130
+ 10 minutes; at most 64 distinct bounded debt groups are kept per account and
131
+ conversation, dropping the oldest on overflow. These counts are never guessed
132
+ as prior usage. Stateless Runs otherwise keep the dashboard accounting above.
133
+ `X-Magpie-Cursor-Continuity` identifies `same-run` or `stateless`, with the fallback
134
+ reason where available. A missing native batch count can retry stateless once
135
+ before any output is exposed or native result submitted; progressive output is
136
+ kept and its later errors are surfaced.
137
+
138
+ The existing request builder and model selection remain in use, including the
139
+ legacy `thinking=false` mapping for explicit `none`/`off`. Retention adds no
140
+ request-field whitelist or strict generation-option validation. Native tool
141
+ results preserve ordered text and data-URL images and explicit error flags;
142
+ unsupported native result shapes use the legacy history path.
143
+
93
144
  ## Models
94
145
 
95
146
  The `config` hook declares `auto` (Cursor's pick). Once signed in, the