pi-cursor-bridge 0.1.6 → 0.1.8
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 +1 -1
- package/README.md +3 -3
- package/dist/cursor-bridge.mjs +25785 -24444
- package/dist/cursor-lifecycle-supervisor.mjs +1452 -1416
- package/extensions/index.ts +1 -1
- package/package.json +2 -2
- package/skills/cce-routing/SKILL.md +58 -58
- package/skills/cce-routing/agents/openai.yaml +13 -13
- package/skills/cursor-delegate/SKILL.md +16 -16
- package/skills/cursor-delegate/references/delegation-contract.md +2 -2
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.8",
|
|
14
14
|
serverName: "cursor-bridge",
|
|
15
15
|
serverScript: join(packageRoot, "dist", "cursor-bridge.mjs"),
|
|
16
16
|
cwd: hostCwd,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-cursor-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Use Cursor Context Engine and bounded Cursor Agent execution from the Pi coding agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
},
|
|
48
48
|
"piPackage": {
|
|
49
49
|
"embeddedProduct": "Cursor Bridge",
|
|
50
|
-
"embeddedProductVersion": "5.
|
|
50
|
+
"embeddedProductVersion": "5.7.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cce-routing
|
|
3
|
-
description: "Use Cursor Bridge's read-only cursor_context_engine for unfamiliar project understanding when the exact code location is unknown or the task requires tracing behavior, symbols, callers and callees, data flow, registrations, interface implementations, ownership boundaries, or cross-module relationships. Trigger for questions such as where something is implemented, what owns state, how a project flow works, or when local search would otherwise guess paths or repeat blind queries; for these semantic questions, try CCE before generic context-mode or grep discovery. Do not use when a known exact file or symbol can answer the question through direct reading or exact search, for content already loaded in context, trivial single-file edits, tests, logs, builds, Git work, external documentation, or when the user opts out of Cursor. Verify returned path:line evidence in the real files."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# CCE Routing
|
|
7
|
-
|
|
8
|
-
`cursor_context_engine` automatically inherits the persistent CCE model and reasoning-effort default configured through `cursor_model`. Do not change or reset that default unless the user explicitly asks; if selection cannot be confirmed, report the pre-send failure instead of retrying with Auto.
|
|
9
|
-
|
|
10
|
-
Route project-understanding questions to the cheapest evidence surface that can answer them without guessing.
|
|
11
|
-
|
|
12
|
-
## Choose CCE for project semantics
|
|
13
|
-
|
|
14
|
-
Call `cursor_context_engine` when one or more of these are true:
|
|
15
|
-
|
|
16
|
-
- The implementation location is unknown and finding it locally would require guessing directories or repeating broad searches.
|
|
17
|
-
- The question asks where or how a project behavior is implemented, what owns a state or responsibility, or why a flow behaves as it does.
|
|
18
|
-
- The answer requires tracing callers and callees, producer-consumer flow, configuration and registration, interface implementations, data ownership, or relationships across modules.
|
|
19
|
-
- An unfamiliar indexed project needs semantic context before a safe edit or review can begin.
|
|
20
|
-
|
|
21
|
-
Prefer one CCE investigation over starting an Explore subagent merely to locate or understand project code. Let Cursor choose focused or extended depth from what it discovers.
|
|
22
|
-
|
|
23
|
-
When these semantic conditions match, make CCE the first project-discovery surface. Do not establish the answer through generic context-mode, grep, or blind local exploration before trying CCE. If Claude Code denies an initial context-mode collection call with a CCE routing message, call `cursor_context_engine` once instead of retrying another `ctx_*` tool. A failed, denied, unavailable, or `NOT_FOUND` CCE attempt releases this priority and allows a bounded local fallback.
|
|
24
|
-
|
|
25
|
-
## Keep deterministic work local
|
|
26
|
-
|
|
27
|
-
Do not call CCE when any of these apply:
|
|
28
|
-
|
|
29
|
-
- The exact file, symbol, or location is already known and a direct read or exact search is sufficient.
|
|
30
|
-
- The needed code is already present in the current context.
|
|
31
|
-
- The work is a trivial single-file edit or only requires running tests, inspecting logs, checking a build, or examining Git state.
|
|
32
|
-
- The question concerns external libraries, APIs, current documentation, or the public web.
|
|
33
|
-
- The user opted out of Cursor, CCE is unavailable, or the workspace is not initialized.
|
|
34
|
-
|
|
35
|
-
Do not submit the same lookup to CCE and another semantic system in parallel. Use a second evidence surface only to close a specific gap or verify a consequential claim.
|
|
36
|
-
|
|
37
|
-
## Submit one natural-language intent
|
|
38
|
-
|
|
39
|
-
Call `cursor_context_engine` once with the question's real intent. Include a known symbol, subsystem, or path only when it is a useful lead.
|
|
40
|
-
|
|
41
|
-
- Describe the relationship or behavior to establish and the evidence needed.
|
|
42
|
-
- Preserve the language of the user's current substantive request unless the user explicitly asks for another language. Do not infer or persist a different language from the operating system when the conversation already provides a clear signal.
|
|
43
|
-
- Do not prescribe Cursor's internal search sequence, harness, Explore usage, or number of files.
|
|
44
|
-
- Do not invent hidden parameters; the public input is only `query`.
|
|
45
|
-
- Allow a cold or large workspace enough time to complete its serialized Cursor UI turn.
|
|
46
|
-
|
|
47
|
-
## Verify and continue
|
|
48
|
-
|
|
49
|
-
Treat CCE output as evidence leads, not final authority.
|
|
50
|
-
|
|
51
|
-
1. Read the returned workspace-relative `path:line` anchors in the real working tree before relying on them.
|
|
52
|
-
2. Distinguish exact references and demonstrated flows from semantic similarity.
|
|
53
|
-
3. If CCE returns `NOT_FOUND` or names gaps, report those gaps or perform one bounded fallback search; do not guess from framework convention.
|
|
54
|
-
4. Keep edits, final review, tests, and acceptance with the primary agent unless a separate bounded delegation is appropriate.
|
|
55
|
-
|
|
56
|
-
Explain the result in the language of the user's current task unless an explicit language override applies. Preserve `CCE_SEARCH_RESULT`, field names, enum values, `NOT_FOUND`, paths, symbols, line anchors, hashes, IDs, commands, and error/status codes verbatim. When a result was authored in another host task or language, keep the evidence unchanged and explain it in the current task language rather than rewriting the artifact.
|
|
57
|
-
|
|
58
|
-
CCE is strongly prompted and audited for read-only investigation, but it is not a filesystem sandbox. Preserve user changes and normal workspace safety boundaries.
|
|
1
|
+
---
|
|
2
|
+
name: cce-routing
|
|
3
|
+
description: "Use Cursor Bridge's read-only cursor_context_engine for unfamiliar project understanding when the exact code location is unknown or the task requires tracing behavior, symbols, callers and callees, data flow, registrations, interface implementations, ownership boundaries, or cross-module relationships. Trigger for questions such as where something is implemented, what owns state, how a project flow works, or when local search would otherwise guess paths or repeat blind queries; for these semantic questions, try CCE before generic context-mode or grep discovery. Do not use when a known exact file or symbol can answer the question through direct reading or exact search, for content already loaded in context, trivial single-file edits, tests, logs, builds, Git work, external documentation, or when the user opts out of Cursor. Verify returned path:line evidence in the real files."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CCE Routing
|
|
7
|
+
|
|
8
|
+
`cursor_context_engine` automatically inherits the persistent CCE model and reasoning-effort default configured through `cursor_model`. Do not change or reset that default unless the user explicitly asks; if selection cannot be confirmed, report the pre-send failure instead of retrying with Auto.
|
|
9
|
+
|
|
10
|
+
Route project-understanding questions to the cheapest evidence surface that can answer them without guessing.
|
|
11
|
+
|
|
12
|
+
## Choose CCE for project semantics
|
|
13
|
+
|
|
14
|
+
Call `cursor_context_engine` when one or more of these are true:
|
|
15
|
+
|
|
16
|
+
- The implementation location is unknown and finding it locally would require guessing directories or repeating broad searches.
|
|
17
|
+
- The question asks where or how a project behavior is implemented, what owns a state or responsibility, or why a flow behaves as it does.
|
|
18
|
+
- The answer requires tracing callers and callees, producer-consumer flow, configuration and registration, interface implementations, data ownership, or relationships across modules.
|
|
19
|
+
- An unfamiliar indexed project needs semantic context before a safe edit or review can begin.
|
|
20
|
+
|
|
21
|
+
Prefer one CCE investigation over starting an Explore subagent merely to locate or understand project code. Let Cursor choose focused or extended depth from what it discovers.
|
|
22
|
+
|
|
23
|
+
When these semantic conditions match, make CCE the first project-discovery surface. Do not establish the answer through generic context-mode, grep, or blind local exploration before trying CCE. If Claude Code denies an initial context-mode collection call with a CCE routing message, call `cursor_context_engine` once instead of retrying another `ctx_*` tool. A failed, denied, unavailable, or `NOT_FOUND` CCE attempt releases this priority and allows a bounded local fallback.
|
|
24
|
+
|
|
25
|
+
## Keep deterministic work local
|
|
26
|
+
|
|
27
|
+
Do not call CCE when any of these apply:
|
|
28
|
+
|
|
29
|
+
- The exact file, symbol, or location is already known and a direct read or exact search is sufficient.
|
|
30
|
+
- The needed code is already present in the current context.
|
|
31
|
+
- The work is a trivial single-file edit or only requires running tests, inspecting logs, checking a build, or examining Git state.
|
|
32
|
+
- The question concerns external libraries, APIs, current documentation, or the public web.
|
|
33
|
+
- The user opted out of Cursor, CCE is unavailable, or the workspace is not initialized.
|
|
34
|
+
|
|
35
|
+
Do not submit the same lookup to CCE and another semantic system in parallel. Use a second evidence surface only to close a specific gap or verify a consequential claim.
|
|
36
|
+
|
|
37
|
+
## Submit one natural-language intent
|
|
38
|
+
|
|
39
|
+
Call `cursor_context_engine` once with the question's real intent. Include a known symbol, subsystem, or path only when it is a useful lead.
|
|
40
|
+
|
|
41
|
+
- Describe the relationship or behavior to establish and the evidence needed.
|
|
42
|
+
- Preserve the language of the user's current substantive request unless the user explicitly asks for another language. Do not infer or persist a different language from the operating system when the conversation already provides a clear signal.
|
|
43
|
+
- Do not prescribe Cursor's internal search sequence, harness, Explore usage, or number of files.
|
|
44
|
+
- Do not invent hidden parameters; the public input is only `query`.
|
|
45
|
+
- Allow a cold or large workspace enough time to complete its serialized Cursor UI turn.
|
|
46
|
+
|
|
47
|
+
## Verify and continue
|
|
48
|
+
|
|
49
|
+
Treat CCE output as evidence leads, not final authority.
|
|
50
|
+
|
|
51
|
+
1. Read the returned workspace-relative `path:line` anchors in the real working tree before relying on them.
|
|
52
|
+
2. Distinguish exact references and demonstrated flows from semantic similarity.
|
|
53
|
+
3. If CCE returns `NOT_FOUND` or names gaps, report those gaps or perform one bounded fallback search; do not guess from framework convention.
|
|
54
|
+
4. Keep edits, final review, tests, and acceptance with the primary agent unless a separate bounded delegation is appropriate.
|
|
55
|
+
|
|
56
|
+
Explain the result in the language of the user's current task unless an explicit language override applies. Preserve `CCE_SEARCH_RESULT`, field names, enum values, `NOT_FOUND`, paths, symbols, line anchors, hashes, IDs, commands, and error/status codes verbatim. When a result was authored in another host task or language, keep the evidence unchanged and explain it in the current task language rather than rewriting the artifact.
|
|
57
|
+
|
|
58
|
+
CCE is strongly prompted and audited for read-only investigation, but it is not a filesystem sandbox. Preserve user changes and normal workspace safety boundaries.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "CCE Routing"
|
|
3
|
-
short_description: "Route unfamiliar project questions to Cursor CCE"
|
|
4
|
-
default_prompt: "Use $cce-routing to locate and verify unfamiliar project behavior with Cursor CCE."
|
|
5
|
-
|
|
6
|
-
dependencies:
|
|
7
|
-
tools:
|
|
8
|
-
- type: "mcp"
|
|
9
|
-
value: "cursor-bridge"
|
|
10
|
-
description: "Use Cursor CCE to find and verify project context"
|
|
11
|
-
|
|
12
|
-
policy:
|
|
13
|
-
allow_implicit_invocation: true
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "CCE Routing"
|
|
3
|
+
short_description: "Route unfamiliar project questions to Cursor CCE"
|
|
4
|
+
default_prompt: "Use $cce-routing to locate and verify unfamiliar project behavior with Cursor CCE."
|
|
5
|
+
|
|
6
|
+
dependencies:
|
|
7
|
+
tools:
|
|
8
|
+
- type: "mcp"
|
|
9
|
+
value: "cursor-bridge"
|
|
10
|
+
description: "Use Cursor CCE to find and verify project context"
|
|
11
|
+
|
|
12
|
+
policy:
|
|
13
|
+
allow_implicit_invocation: true
|
|
@@ -7,13 +7,13 @@ description: "Delegate bounded light-to-medium implementation, limited investiga
|
|
|
7
7
|
|
|
8
8
|
Use Cursor as an execution partner. Keep direction, scope decisions, risk ownership, result review, and final verification with the primary agent.
|
|
9
9
|
|
|
10
|
-
## Respect execution controls
|
|
10
|
+
## Respect execution controls
|
|
11
11
|
|
|
12
12
|
- Do not call `cursor_do` when the user explicitly says not to use Cursor or not to delegate. A direct user opt-out always wins.
|
|
13
13
|
- If `cursor_do` is unavailable, or `cursor_status` reports delegation as disabled, do not bypass the setting, repeatedly retry, or ask Cursor to re-enable itself. Complete the work in the primary agent.
|
|
14
14
|
- Treat `CURSOR_BRIDGE_DELEGATION=off` as an administrator-level host switch. It disables delegated execution but does not by itself disable `cursor_context_engine`, `cursor_init`, or `cursor_status`.
|
|
15
|
-
- Cursor Bridge exposes one fixed delegation contract. Do not invent participation levels, call-frequency controls, or slash commands.
|
|
16
|
-
- `cursor_model` owns persistent model and reasoning-effort defaults. Call its `set` or `reset` action only when the user explicitly asks to change those defaults; ordinary delegation must inherit the stored `cursor_do` choice without silently changing it.
|
|
15
|
+
- Cursor Bridge exposes one fixed delegation contract. Do not invent participation levels, call-frequency controls, or slash commands.
|
|
16
|
+
- `cursor_model` owns persistent model and reasoning-effort defaults. Call its `set` or `reset` action only when the user explicitly asks to change those defaults; ordinary delegation must inherit the stored `cursor_do` choice without silently changing it.
|
|
17
17
|
|
|
18
18
|
## Follow the default workflow
|
|
19
19
|
|
|
@@ -57,11 +57,11 @@ 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
|
-
## Dispatch a task
|
|
61
|
-
|
|
62
|
-
1. Record the relevant pre-dispatch workspace state so later review can distinguish existing user changes.
|
|
63
|
-
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`; do not invent a chat-selection parameter.
|
|
60
|
+
## Dispatch a task
|
|
61
|
+
|
|
62
|
+
1. Record the relevant pre-dispatch workspace state so later review can distinguish existing user changes.
|
|
63
|
+
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`; do not invent a chat-selection parameter.
|
|
65
65
|
4. Save each returned `task_id`; also save `agent_id` whenever `cursor_status` publishes one.
|
|
66
66
|
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
67
|
|
|
@@ -71,14 +71,14 @@ The envelope may contain a small number of local implementation `open_questions`
|
|
|
71
71
|
|
|
72
72
|
1. Always query `cursor_status(task_id)` for the exact task. Do not treat the currently visible Cursor chat as task identity.
|
|
73
73
|
2. Treat `submitting`, `running`, and `collecting` as normal in-progress states. More than two minutes is not itself a failure; wait for an explicit terminal state.
|
|
74
|
-
3. Compare Cursor's claimed work with the real diff, `allowed_paths`, and acceptance contract.
|
|
75
|
-
4. When `cursor_status` reports a configured model default, confirm `modelSelection.applied=true` and preserve its configured/effective model and effort fields in any failure report.
|
|
76
|
-
5. Run risk-proportionate verification in the primary agent. Cursor's response alone cannot support a formal pass, verified state, or governance transition.
|
|
77
|
-
6. Record each task as complete, partial, failed, timed out, or ambiguous before summarizing the batch.
|
|
78
|
-
|
|
79
|
-
Report the accepted result in the language of the user's current task. Keep `task_id`, `agent_id`, tool names, states, enum values, paths, commands, hashes, exact permission options, and error/status codes verbatim. If Cursor returned an artifact or report in another language, preserve it and summarize the relevant facts in the current task language.
|
|
80
|
-
|
|
81
|
-
Read [delegation-contract.md](references/delegation-contract.md) for state interpretation and recovery details.
|
|
74
|
+
3. Compare Cursor's claimed work with the real diff, `allowed_paths`, and acceptance contract.
|
|
75
|
+
4. When `cursor_status` reports a configured model default, confirm `modelSelection.applied=true` and preserve its configured/effective model and effort fields in any failure report.
|
|
76
|
+
5. Run risk-proportionate verification in the primary agent. Cursor's response alone cannot support a formal pass, verified state, or governance transition.
|
|
77
|
+
6. Record each task as complete, partial, failed, timed out, or ambiguous before summarizing the batch.
|
|
78
|
+
|
|
79
|
+
Report the accepted result in the language of the user's current task. Keep `task_id`, `agent_id`, tool names, states, enum values, paths, commands, hashes, exact permission options, and error/status codes verbatim. If Cursor returned an artifact or report in another language, preserve it and summarize the relevant facts in the current task language.
|
|
80
|
+
|
|
81
|
+
Read [delegation-contract.md](references/delegation-contract.md) for state interpretation and recovery details.
|
|
82
82
|
|
|
83
83
|
## Handle abnormal states
|
|
84
84
|
|
|
@@ -15,11 +15,11 @@ Provide every task independently:
|
|
|
15
15
|
|
|
16
16
|
| Field | Requirement |
|
|
17
17
|
|---|---|
|
|
18
|
-
| `prompt` | State one objective, the necessary context, prohibited actions, and the expected report. Use the current user-task language unless the user explicitly requests another language. Do not ask Cursor to repeat the primary agent's scope decision. |
|
|
18
|
+
| `prompt` | State one objective, the necessary context, prohibited actions, and the expected report. Use the current user-task language unless the user explicitly requests another language. Do not ask Cursor to repeat the primary agent's scope decision. |
|
|
19
19
|
| `execution` | Use only `fifo` or `parallel_agent`. Use `fifo` when safe parallelism cannot be demonstrated. |
|
|
20
20
|
| `read_only` | Use `true` for lookup and analysis; use `false` for any file modification. |
|
|
21
21
|
| `allowed_paths` | Required when `read_only=false`. Provide the smallest workspace-relative path set, with no glob, absolute path, or workspace-escaping `..`. Omit it when `read_only=true`. This is not a filesystem sandbox. |
|
|
22
|
-
| `completion_contract` | State the deliverables, validation commands, permitted incomplete items, final report format, and that narrative output should follow the task language. Preserve paths, commands, identifiers, and machine tokens verbatim. |
|
|
22
|
+
| `completion_contract` | State the deliverables, validation commands, permitted incomplete items, final report format, and that narrative output should follow the task language. Preserve paths, commands, identifiers, and machine tokens verbatim. |
|
|
23
23
|
| `background` | Default to `true` so the primary agent may continue independent work. |
|
|
24
24
|
|
|
25
25
|
## Routing contract
|