pi-cursor-bridge 0.1.8 → 0.1.10
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/.codex-plugin/plugin.json +3 -3
- package/README.md +1 -1
- package/dist/cursor-bridge.mjs +975 -158
- package/extensions/index.ts +1 -1
- package/package.json +3 -3
- package/skills/cursor-delegate/SKILL.md +18 -3
package/extensions/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ const hostWorkspaceId = hostCwd.replace(/\\/g, "/").toLowerCase();
|
|
|
10
10
|
export default createStdioMcpExtension({
|
|
11
11
|
label: "Cursor Bridge",
|
|
12
12
|
clientName: "pi-cursor-bridge",
|
|
13
|
-
packageVersion: "0.1.
|
|
13
|
+
packageVersion: "0.1.10",
|
|
14
14
|
serverName: "cursor-bridge",
|
|
15
15
|
serverScript: join(packageRoot, "dist", "cursor-bridge.mjs"),
|
|
16
16
|
cwd: hostCwd,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-cursor-bridge",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Use Cursor Context Engine and bounded Cursor Agent execution from the Pi coding agent.",
|
|
3
|
+
"version": "0.1.10",
|
|
4
|
+
"description": "Use Cursor Context Engine and bounded, explicitly continuous Cursor Agent execution from the Pi coding agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Vanyangyang",
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
},
|
|
48
48
|
"piPackage": {
|
|
49
49
|
"embeddedProduct": "Cursor Bridge",
|
|
50
|
-
"embeddedProductVersion": "5.
|
|
50
|
+
"embeddedProductVersion": "5.8.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cursor-delegate
|
|
3
|
-
description: "Delegate bounded light-to-medium implementation,
|
|
3
|
+
description: "Delegate bounded light-to-medium implementation, investigation, documentation, configuration, testing, and tooling work to Cursor Bridge after the primary agent owns direction and risk boundaries. Also use when the user explicitly asks to create, keep, continue, inspect, or close the same Cursor execution session, including phrases such as '持续会话', '同一个 Cursor 会话', or 'continue the Cursor session'. Generic '继续' is not enough to reuse a session. Collect each turn by task_id and verify it in the primary agent. Do not use when the user opts out, cursor_do is unavailable or administrator-disabled, or for product direction, architecture decisions, exclusive GUI operations, formal verification verdicts, governance state decisions, or unbounded investigation."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Cursor Delegate
|
|
@@ -57,12 +57,24 @@ For an exact known-file or known-symbol lookup, establish the cheapest determini
|
|
|
57
57
|
|
|
58
58
|
Do not choose parallel execution merely because there are many tasks. When dependency or path relationships are unclear, use `fifo`.
|
|
59
59
|
|
|
60
|
+
## Choose isolated or continuous delivery
|
|
61
|
+
|
|
62
|
+
- Keep `session_mode=isolated` as the default. It preserves the existing clean-task behavior.
|
|
63
|
+
- Use `session_mode=create` only when the user explicitly asks to keep later Cursor turns in the same conversation, for example “开启 Cursor 持续会话”, “后续都在同一个 Cursor 会话处理”, or “keep using the same Cursor Agent”.
|
|
64
|
+
- Use `session_mode=continue` only with the exact `session_id` previously returned by Bridge. “继续 Cursor 会话 <session_id>” is explicit. “继续”, “接着做”, “再改一下”, or “发给 Cursor” alone must not select a session.
|
|
65
|
+
- “刚才的 Cursor 会话” may resolve without restating the ID only when the current host task has exactly one ready session for the current workspace. Otherwise report `SESSION_REQUIRED` or `SESSION_AMBIGUOUS`; never guess from the selected, newest, or similarly named Agent.
|
|
66
|
+
- “新开”, “独立”, “干净会话”, or “不要继承上下文” always means isolated/new work and overrides continuity.
|
|
67
|
+
- Start a new session when the workspace, product objective, model/effort, read-only/write boundary, or maximum `allowed_paths` changes. Independent review and final verification also use fresh context.
|
|
68
|
+
- Persistent sessions require `parallel_agent` and never fall back to FIFO. One session permits only one active turn; different sessions remain subject to the existing path-overlap rules.
|
|
69
|
+
- Every continued turn gets a new `task_id`, repeats `read_only=true` or an `allowed_paths` subset, and may provide a `request_id` so an immediate client retry returns the existing turn instead of sending twice.
|
|
70
|
+
- `session_id` is the stable public association. `agent_id` remains internal evidence and may be promoted from a provisional Cursor identity; never use it as the caller's session key.
|
|
71
|
+
|
|
60
72
|
## Dispatch a task
|
|
61
73
|
|
|
62
74
|
1. Record the relevant pre-dispatch workspace state so later review can distinguish existing user changes.
|
|
63
75
|
2. Form one independent task envelope per task using [delegation-contract.md](references/delegation-contract.md). Write its narrative instructions in the language of the user's current substantive task unless the user explicitly requests another language. Do not persist an inferred language or replace a clear conversational signal with the host/OS locale.
|
|
64
|
-
3. Call `cursor_do` with `background=true
|
|
65
|
-
4. Save each returned `task_id`; also save `
|
|
76
|
+
3. Call `cursor_do` with `background=true`. Use only the documented `session_mode` and `session_id` fields when continuity is explicit; never infer continuity from the visible chat.
|
|
77
|
+
4. Save each returned `task_id`; for persistent work also save `session_id`. Treat `agent_id` as verification evidence, not the continuation handle.
|
|
66
78
|
5. If a parallel submission does not return a usable `agent_id`, stop expanding the parallel batch and use `fifo` or report the ambiguous state.
|
|
67
79
|
|
|
68
80
|
The envelope may contain a small number of local implementation `open_questions`, but it must also provide `fixed_decisions`, `allowed_paths`, prohibitions, and acceptance checks. Cursor may solve local questions; it must stop and report any branch that would change product direction, architecture, or scope.
|
|
@@ -89,6 +101,9 @@ Read [delegation-contract.md](references/delegation-contract.md) for state inter
|
|
|
89
101
|
- Use `action=abandon` only after manual verification and an explicit user decision to accept the risk. It requires `confirm=true`, a non-empty reason, `acknowledge_may_still_write=true`, and the exact `expected_agent_id` when one is already bound; report that the underlying Agent may still run or write.
|
|
90
102
|
- If Cursor shows a final UI response but Bridge has not collected it, use explicit `reap` against the original bound task. A `terminal_uncollected` result keeps the reservation for retry. Do not add a completion marker, increase a response-length requirement, or submit the same task again.
|
|
91
103
|
- Task identity and reservations are process-local. After an MCP/Codex restart, do not claim the old `task_id` is recoverable; inspect Cursor Agent History and workspace changes manually before overlapping work.
|
|
104
|
+
- A ready persistent `session_id` is stored outside the versioned plugin cache and may survive MCP/Codex restart or plugin update. Query `cursor_status(session_id)` before continuing. If it reports `needs_attention`, an expired sender lease, or a missing exact Agent binding, do not resubmit or silently create a replacement session.
|
|
105
|
+
- Use `cursor_session_control(action=reconcile)` to check the exact Agent twice after an interrupted adapter. It may return the session to `ready` only from stable terminal evidence; an interrupted completed reply remains explicitly uncollected.
|
|
106
|
+
- `cursor_session_control(action=abandon)` is the last resort for an uncertain session and requires `confirm=true`, a non-empty reason, and `acknowledge_may_still_write=true`. It closes only the Bridge mapping and does not prove that Cursor stopped.
|
|
92
107
|
- If a timed-out task changed files, inspect the changes before deciding whether to continue, retry, or revert.
|
|
93
108
|
- If changes exceed `allowed_paths`, stop accepting the result and report the scope violation.
|
|
94
109
|
- If parallel tasks conflict, stop further integration and return to primary-agent review or serial execution.
|