@magpie-community/opencode-cursor-auth 0.2.13 → 0.2.14
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 +45 -2
- package/index.mjs +420 -84
- package/native-session.mjs +845 -0
- package/package.json +2 -2
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
|
-
-
|
|
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
|
-
-
|
|
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,49 @@ 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.
|
|
99
|
+
|
|
100
|
+
These are retention limits. A missing, expired, restarted, busy, incompatible,
|
|
101
|
+
or full owner uses the original history reconstruction and stateless decoder
|
|
102
|
+
on a new Run. Pending parent calls and new input can take that path without
|
|
103
|
+
cancelling the parent's owner. Already supplied client tool results become
|
|
104
|
+
history; the plugin never executes those external tools. A failed native result
|
|
105
|
+
write is reported to that request because its outcome may be uncertain. A later
|
|
106
|
+
request can rebuild from its supplied history without submitting the result to
|
|
107
|
+
the old native exec again.
|
|
108
|
+
|
|
109
|
+
A native tool handoff reports zero usage with `magpie_native.accounting=pending`;
|
|
110
|
+
the final native answer reports the turn's totals. An identical completed retry
|
|
111
|
+
replays the saved response with zero usage. A native final also collects earlier
|
|
112
|
+
stateless debt as `usage.magpie_deferred`, separately from its own prompt total.
|
|
113
|
+
If a started native Run is abandoned after a pending handoff, its dashboard
|
|
114
|
+
count is owed once to the same account and conversation. Successful final
|
|
115
|
+
snapshots, including explicit zero, and cached replays do not enroll that debt.
|
|
116
|
+
|
|
117
|
+
Dashboard attribution uses event timestamps, rather than when events arrive.
|
|
118
|
+
Older debt is bounded strictly before the native Run's start, and keeps that
|
|
119
|
+
bound across later stateless Runs so an authoritative native event is not
|
|
120
|
+
billed again. An earlier event stamped on or after that boundary cannot be
|
|
121
|
+
identified reliably and stays unknown. Missing or ambiguous debt expires after
|
|
122
|
+
10 minutes; at most 64 distinct bounded debt groups are kept per account and
|
|
123
|
+
conversation, dropping the oldest on overflow. These counts are never guessed
|
|
124
|
+
as prior usage. Stateless Runs otherwise keep the dashboard accounting above.
|
|
125
|
+
`X-Magpie-Cursor-Continuity` identifies `same-run` or `stateless`, with the fallback
|
|
126
|
+
reason where available. A missing native batch count can retry stateless once
|
|
127
|
+
before any output is exposed or native result submitted; progressive output is
|
|
128
|
+
kept and its later errors are surfaced.
|
|
129
|
+
|
|
130
|
+
The existing request builder and model selection remain in use, including the
|
|
131
|
+
legacy `thinking=false` mapping for explicit `none`/`off`. Retention adds no
|
|
132
|
+
request-field whitelist or strict generation-option validation. Native tool
|
|
133
|
+
results preserve ordered text and data-URL images and explicit error flags;
|
|
134
|
+
unsupported native result shapes use the legacy history path.
|
|
135
|
+
|
|
93
136
|
## Models
|
|
94
137
|
|
|
95
138
|
The `config` hook declares `auto` (Cursor's pick). Once signed in, the
|