@mahekara28/context-relay 0.0.0-stage → 0.3.0-beta.1
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/LICENSE +21 -0
- package/README.md +128 -2
- package/README.python.md +246 -0
- package/dist/adapters/capture.d.ts +4 -0
- package/dist/adapters/capture.js +286 -0
- package/dist/adapters/capture.js.map +1 -0
- package/dist/adapters/config.d.ts +11 -0
- package/dist/adapters/config.js +139 -0
- package/dist/adapters/config.js.map +1 -0
- package/dist/adapters/manager.d.ts +57 -0
- package/dist/adapters/manager.js +220 -0
- package/dist/adapters/manager.js.map +1 -0
- package/dist/adapters/normalize.d.ts +9 -0
- package/dist/adapters/normalize.js +166 -0
- package/dist/adapters/normalize.js.map +1 -0
- package/dist/adapters/rpc.d.ts +12 -0
- package/dist/adapters/rpc.js +100 -0
- package/dist/adapters/rpc.js.map +1 -0
- package/dist/adapters/types.d.ts +59 -0
- package/dist/adapters/types.js +51 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +427 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +11 -0
- package/dist/client.js +136 -0
- package/dist/client.js.map +1 -0
- package/dist/delivery.d.ts +9 -0
- package/dist/delivery.js +35 -0
- package/dist/delivery.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +3 -0
- package/dist/mcp.js +109 -0
- package/dist/mcp.js.map +1 -0
- package/dist/model.d.ts +169 -0
- package/dist/model.js +79 -0
- package/dist/model.js.map +1 -0
- package/dist/proposals.d.ts +65 -0
- package/dist/proposals.js +134 -0
- package/dist/proposals.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +375 -0
- package/dist/server.js.map +1 -0
- package/dist/store.d.ts +33 -0
- package/dist/store.js +393 -0
- package/dist/store.js.map +1 -0
- package/dist/ui/app.js +845 -0
- package/dist/ui/assets/THIRD_PARTY_LICENSE.txt +25 -0
- package/dist/ui/assets/claude.svg +1 -0
- package/dist/ui/assets/codex.svg +1 -0
- package/dist/ui/assets/goose.svg +1 -0
- package/dist/ui/assets/opencode.svg +1 -0
- package/dist/ui/assets/relay.svg +1 -0
- package/dist/ui/index.html +23 -0
- package/dist/ui/style.css +989 -0
- package/dist/util.d.ts +16 -0
- package/dist/util.js +86 -0
- package/dist/util.js.map +1 -0
- package/docs/HARNESS_CONNECTIONS.md +53 -0
- package/docs/NPM_QUICKSTART.md +150 -0
- package/docs/WORKSPACE.md +61 -0
- package/docs/releases/NPM_PUBLISHING.md +60 -0
- package/package.json +78 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Context Relay contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,129 @@
|
|
|
1
|
-
|
|
1
|
+
<picture>
|
|
2
|
+
<img src="https://raw.githubusercontent.com/mahekara28/context-relay/main/docs/assets/workspace/hero.svg" alt="Context Relay — keep the work, change the thread. A local CLI, workspace and MCP server for coding context." width="100%" />
|
|
3
|
+
</picture>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/mahekara28/context-relay/actions/workflows/npm.yml"><img src="https://github.com/mahekara28/context-relay/actions/workflows/npm.yml/badge.svg" alt="npm product checks" /></a>
|
|
7
|
+
<a href="https://github.com/mahekara28/context-relay/blob/main/package.json"><img src="https://img.shields.io/badge/Node-22.16%2B-456b55?labelColor=252d29" alt="Node 22.16 or newer" /></a>
|
|
8
|
+
<a href="https://github.com/mahekara28/context-relay/blob/main/docs/releases/NPM_RELEASE_PLAN.md"><img src="https://img.shields.io/badge/release-0.3.0--beta.1-c84429?labelColor=252d29" alt="Release 0.3.0 beta 1" /></a>
|
|
9
|
+
<a href="https://github.com/mahekara28/context-relay/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-68716b?labelColor=252d29" alt="MIT license" /></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center"><strong>Your next coding session should inherit the decisions, not the confusion.</strong></p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://mahekara28.github.io/context-relay/">Website & interactive tour</a> · <a href="#why-context-relay">Why Relay</a> · <a href="#try-it-locally">Install</a> · <a href="#the-workflow">Workflow</a> · <a href="#where-mcp-fits">Architecture</a> · <a href="#what-is-verified">Verification</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
## Why Context Relay?
|
|
19
|
+
|
|
20
|
+
You've spent hours in a coding thread. Requirements changed. A tool failed. The agent tried three approaches. The context keeps growing, and starting a fresh thread means explaining everything again.
|
|
21
|
+
|
|
22
|
+
**Context Relay turns that history into a reviewed handoff.** Find a session, select its evidence, capture the current instructions and open work, then continue in a fresh thread—even in another harness.
|
|
23
|
+
|
|
24
|
+
- **See the history.** Browse captured threads from Claude Code, Codex, OpenCode and Goose, with visible source events and character growth.
|
|
25
|
+
- **Keep the corrections.** Review instructions beside the evidence they cite. Merge checkpoints with explicit conflict choices.
|
|
26
|
+
- **Continue with a receipt.** Offer an immutable packet to a destination agent through MCP, or export readable Markdown. Check source revisions, recorded files and Git HEAD before acceptance.
|
|
27
|
+
|
|
28
|
+
<picture>
|
|
29
|
+
<source media="(prefers-reduced-motion: reduce)" srcset="https://raw.githubusercontent.com/mahekara28/context-relay/main/docs/assets/workspace/threads.png" />
|
|
30
|
+
<source media="(max-width: 600px)" srcset="https://raw.githubusercontent.com/mahekara28/context-relay/main/docs/assets/workspace/mobile-dark.png" />
|
|
31
|
+
<img src="https://raw.githubusercontent.com/mahekara28/context-relay/main/docs/assets/workspace/workflow.gif" alt="Real local workspace: browse a Claude Code thread, review a corrected seven-day retention instruction, offer a Codex handoff, and inspect the architecture." width="100%" />
|
|
32
|
+
</picture>
|
|
33
|
+
<p align="center"><sub>Actual npm workspace, synthetic example data. No model calls or task execution in this demo.<br /><a href="https://github.com/mahekara28/context-relay/blob/main/docs/assets/workspace/README.md">Demo description</a> · <a href="https://github.com/mahekara28/context-relay/blob/main/docs/assets/workspace/threads.png">Still image</a> · <a href="https://github.com/mahekara28/context-relay/blob/main/scripts/npm/render-demo.mjs">Reproduce the capture</a></sub></p>
|
|
34
|
+
|
|
35
|
+
## Try it locally
|
|
36
|
+
|
|
37
|
+
**Node 22.16+ · npm · no Python or model API key required**
|
|
38
|
+
|
|
39
|
+
Install the public beta from [npm](https://www.npmjs.com/package/@mahekara28/context-relay):
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm install --global @mahekara28/context-relay@beta
|
|
43
|
+
relay demo
|
|
44
|
+
relay ui
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or try it with **npx**, without a global installation:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
npx @mahekara28/context-relay@beta demo
|
|
51
|
+
npx @mahekara28/context-relay@beta ui
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use `@0.3.0-beta.1` instead of `@beta` to pin this release. Both methods use the same local workspace. The package is a beta; live model-quality evaluation remains pending.
|
|
55
|
+
|
|
56
|
+
The package includes the compiled CLI, local service, MCP server, SQLite store and UI assets. After installation, Relay needs no frontend build step or CDN. `relay demo` creates explicitly synthetic sessions in its own demo project. `relay stop` stops the local service.
|
|
57
|
+
|
|
58
|
+
Use `--data-dir /path/to/workspace` on any command for a separate profile. The default is `~/.context-relay`. [Installation and CLI reference →](https://github.com/mahekara28/context-relay/blob/main/docs/NPM_QUICKSTART.md)
|
|
59
|
+
|
|
60
|
+
## The workflow
|
|
61
|
+
|
|
62
|
+
| Step | What happens |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| **1. Connect** | Register a project and connect a harness. Relay can add a project MCP entry while preserving unrelated settings. |
|
|
65
|
+
| **2. Capture** | Discover matching sessions and choose what to import. Background jobs expose progress, failures and cancellation. |
|
|
66
|
+
| **3. Review** | Select source events. Write the current goal, cited instructions, acceptance criteria and open work. Optionally generate a draft with Nebius. |
|
|
67
|
+
| **4. Merge** | Combine existing checkpoints into a new snapshot. Resolve conflicting instruction keys explicitly. |
|
|
68
|
+
| **5. Continue** | Offer the packet to a harness. Open a fresh session, inspect the handoff and accept it through MCP; or use a Markdown export. |
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
relay project add --root /absolute/path/to/project
|
|
72
|
+
relay connect --project PROJECT_ID --harness claude
|
|
73
|
+
relay discover --id CONNECTION_ID
|
|
74
|
+
relay sync --id CONNECTION_ID
|
|
75
|
+
relay ui
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For a configured Claude Code or Codex destination, `relay launch --id HANDOFF_ID` opens a fresh interactive session with the continuation prompt and the harness's normal approvals. OpenCode and Goose use the copied prompt or export. Relay never writes into native chat databases.
|
|
79
|
+
|
|
80
|
+
## Where MCP fits
|
|
81
|
+
|
|
82
|
+
<img src="https://raw.githubusercontent.com/mahekara28/context-relay/main/docs/assets/workspace/architecture.svg" alt="Harness-specific capture and MCP context access connect to one local service. SQLite stores reviewed state; optional Nebius drafts require review." width="100%" />
|
|
83
|
+
|
|
84
|
+
**Capture and MCP solve different parts of the workflow.** Native adapters read history. MCP gives agents a standard way to inspect Relay's context and accept an addressed handoff. Installing MCP alone does not make a harness's conversation history available.
|
|
85
|
+
|
|
86
|
+
| Harness | Capture | MCP configuration | Fresh continuation |
|
|
87
|
+
| --- | --- | --- | --- |
|
|
88
|
+
| Claude Code | Project-filtered JSONL | `.mcp.json` | Interactive CLI launch or copied prompt |
|
|
89
|
+
| Codex | App-server, completed turns | `.codex/config.toml` | Interactive CLI launch or copied prompt |
|
|
90
|
+
| OpenCode | Loopback session/messages API | `opencode.json` | Copied prompt or Markdown |
|
|
91
|
+
| Goose | CLI JSON list/export | Project extension command manifest | Copied prompt or Markdown |
|
|
92
|
+
|
|
93
|
+
All four have implemented capture adapters. Native format coverage and limits are explicit in the [connection guide](https://github.com/mahekara28/context-relay/blob/main/docs/HARNESS_CONNECTIONS.md); they are not a claim that every harness version has been live-certified.
|
|
94
|
+
|
|
95
|
+
### Optional Nebius Token Factory
|
|
96
|
+
|
|
97
|
+
Manual checkpoints work without a key. To request model-assisted drafts, set `NEBIUS_API_KEY` and `NEBIUS_MODEL` in the service environment and restart Relay. The UI previews the exact selected, redacted evidence before sending it. Responses must pass schema and citation validation, then return to the editor for review.
|
|
98
|
+
|
|
99
|
+
No automatic summarization loop, hidden provider fallback or model-written authoritative state. [Provider setup and data flow →](https://github.com/mahekara28/context-relay/blob/main/docs/WORKSPACE.md#nebius-proposals)
|
|
100
|
+
|
|
101
|
+
## What is verified
|
|
102
|
+
|
|
103
|
+
- **19 Node tests:** transactional imports, provenance, explicit merge conflicts, packet budgets, stale source/file rejection, recipient checks, adapters, provider validation and launch planning.
|
|
104
|
+
- **Real transports:** an MCP stdio client, a JSON-RPC subprocess, a loopback HTTP capture source and an isolated installed Codex app-server initialization/listing check.
|
|
105
|
+
- **4 Chromium workflows:** source review → handoff → export, conflict resolution, mobile/dark navigation and unauthenticated entry.
|
|
106
|
+
- **Installed package gates:** anonymous global and npm exec/npx tarball installation, CLI/service lifecycle, bundled UI assets, authentication and restart persistence on Linux, macOS and Windows CI.
|
|
107
|
+
|
|
108
|
+
The model quality benchmark remains pending: no live Nebius completion or cross-harness coding result is claimed. Acceptance proves delivery, not successful task completion. [Detailed verification and release boundaries →](https://github.com/mahekara28/context-relay/blob/main/docs/releases/NPM_VERIFICATION.md)
|
|
109
|
+
|
|
110
|
+
## Local by default
|
|
111
|
+
|
|
112
|
+
Relay binds to `127.0.0.1`, authenticates API requests and rejects foreign origins and host headers. The browser token is passed in a URL fragment, removed immediately and retained in the current tab's session storage. Drafts stay in memory until saved. Files are referenced by path and digest; they are not transferred.
|
|
113
|
+
|
|
114
|
+
Capture and discovery are explicit. Recognized credentials are redacted before persistence, but this is best effort: inspect sensitive material before sharing it. Nebius receives only evidence you explicitly select and approve. [Workspace operations →](https://github.com/mahekara28/context-relay/blob/main/docs/WORKSPACE.md)
|
|
115
|
+
|
|
116
|
+
## Develop and contribute
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
npm ci
|
|
120
|
+
npm run typecheck
|
|
121
|
+
npm test
|
|
122
|
+
npm run test:package
|
|
123
|
+
npx playwright install chromium
|
|
124
|
+
npm run test:browser
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The TypeScript product lives in [`packages/relay`](https://github.com/mahekara28/context-relay/blob/main/packages/relay). The existing Python research/API implementation remains available with its own database and versioning; see the [Python reference](https://github.com/mahekara28/context-relay/blob/main/README.python.md). No automatic migration or shared writable database is implied.
|
|
128
|
+
|
|
129
|
+
See the [release series](https://github.com/mahekara28/context-relay/blob/main/docs/releases/NPM_RELEASE_PLAN.md), [contribution guide](https://github.com/mahekara28/context-relay/blob/main/CONTRIBUTING.md) and [license](https://github.com/mahekara28/context-relay/blob/main/LICENSE). Harness logos are bundled from the MIT-licensed Lobe Icons package with [attribution](https://github.com/mahekara28/context-relay/blob/main/packages/relay/ui/assets/THIRD_PARTY_LICENSE.txt); product names identify integrations and do not imply endorsement.
|
package/README.python.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<picture>
|
|
2
|
+
<source media="(prefers-color-scheme: dark) and (max-width: 600px)" srcset="docs/assets/banner-dark-mobile.svg" />
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/banner-dark.svg" />
|
|
4
|
+
<source media="(max-width: 600px)" srcset="docs/assets/banner-light-mobile.svg" />
|
|
5
|
+
<img src="docs/assets/banner-light.svg" alt="Context Relay — task context across agent harnesses. Experimental source preview." width="100%" />
|
|
6
|
+
</picture>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/mahekara28/context-relay/actions/workflows/alpha.yml"><img src="https://github.com/mahekara28/context-relay/actions/workflows/alpha.yml/badge.svg?branch=main" alt="Alpha checks on main" /></a>
|
|
10
|
+
<a href="docs/TASK_QUICKSTART.md"><img src="https://img.shields.io/badge/status-source_preview-e65241?labelColor=25292f" alt="Status: source preview" /></a>
|
|
11
|
+
<a href="pyproject.toml"><img src="https://img.shields.io/badge/Python-3.10%2B-555b64?labelColor=25292f" alt="Core: Python 3.10 or newer" /></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-555b64?labelColor=25292f" alt="MIT license" /></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center"><strong>Pick up the task with its current instructions, sources and open work.</strong></p>
|
|
16
|
+
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-reduced-motion: reduce) and (max-width: 600px)" srcset="docs/assets/demo-mobile.png" />
|
|
19
|
+
<source media="(prefers-reduced-motion: reduce)" srcset="docs/assets/demo.png" />
|
|
20
|
+
<source media="(max-width: 600px)" srcset="docs/assets/demo-mobile.gif" />
|
|
21
|
+
<img src="docs/assets/demo.gif" alt="Local example: CSV is explicitly superseded by JSON. The receiver accepts revision 2 with Use JSON active. Task verification is not recorded. No model or network calls." width="100%" />
|
|
22
|
+
</picture>
|
|
23
|
+
|
|
24
|
+
<p align="center"><sub>Output from the runnable local example; playback timing edited for readability.<br />
|
|
25
|
+
<a href="examples/task_handoff_demo.py">Run it yourself</a> · <a href="docs/assets/demo-transcript.txt">Text transcript</a> · <a href="docs/assets/demo.png">Still image</a></sub></p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="#quick-start">Quick start</a> ·
|
|
29
|
+
<a href="#connect-an-agent">Connect an agent</a> ·
|
|
30
|
+
<a href="#how-it-works">Architecture</a> ·
|
|
31
|
+
<a href="#evidence">Evidence</a> ·
|
|
32
|
+
<a href="#roadmap">Roadmap</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<picture>
|
|
36
|
+
<source media="(prefers-color-scheme: dark) and (max-width: 600px)" srcset="docs/assets/capabilities-dark-mobile.svg" />
|
|
37
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/capabilities-dark.svg" />
|
|
38
|
+
<source media="(max-width: 600px)" srcset="docs/assets/capabilities-light-mobile.svg" />
|
|
39
|
+
<img src="docs/assets/capabilities-light.svg" alt="Current source: 8 MCP tools, 2 project configuration generators, 0 core runtime dependencies." width="100%" />
|
|
40
|
+
</picture>
|
|
41
|
+
|
|
42
|
+
## Why Relay
|
|
43
|
+
|
|
44
|
+
An agent starts a report. You change the output from CSV to JSON. Another agent
|
|
45
|
+
picks up the work later. Which instruction is current? Where did it come from?
|
|
46
|
+
What still needs doing?
|
|
47
|
+
|
|
48
|
+
Context Relay stores those answers as a **versioned task packet** in local SQLite:
|
|
49
|
+
|
|
50
|
+
- **Current instructions with history.** Explicitly replace an instruction while
|
|
51
|
+
keeping the old version and its source available for inspection.
|
|
52
|
+
- **Handoffs with checks.** Freeze a revision, name its recipient, and check packet
|
|
53
|
+
integrity and revision freshness when the recipient accepts it.
|
|
54
|
+
- **Completion backed by evidence.** Host-run checks bind verification to artifact
|
|
55
|
+
state. An accepted handoff or a model's report alone does not prove completion.
|
|
56
|
+
|
|
57
|
+
> **Source preview.** The task API is experimental. Install from this checkout;
|
|
58
|
+
> the bundled v0.22.0a3 wheel predates it. Live model handoff evaluation is pending.
|
|
59
|
+
|
|
60
|
+
<a id="install"></a>
|
|
61
|
+
|
|
62
|
+
## Quick start
|
|
63
|
+
|
|
64
|
+
**Python 3.10+** · No model API key · No core runtime dependencies
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
git clone https://github.com/mahekara28/context-relay.git
|
|
68
|
+
cd context-relay
|
|
69
|
+
python -m venv .venv
|
|
70
|
+
source .venv/bin/activate
|
|
71
|
+
python -m pip install .
|
|
72
|
+
python examples/task_handoff_demo.py
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
On Windows PowerShell, activate with `.venv\Scripts\Activate.ps1`.
|
|
76
|
+
Source installation may download build tools; this alpha is not published on PyPI.
|
|
77
|
+
|
|
78
|
+
The example creates a temporary database, replaces `Use CSV` with `Use JSON`,
|
|
79
|
+
and accepts a handoff as the named receiver. It checks the resulting state before
|
|
80
|
+
printing it, then removes the database. Add `--json` to inspect the selected result
|
|
81
|
+
fields. It does not call a model or implement the report.
|
|
82
|
+
|
|
83
|
+
For a persistent task and the equivalent CLI commands, follow the
|
|
84
|
+
[task quickstart](docs/TASK_QUICKSTART.md).
|
|
85
|
+
|
|
86
|
+
<a id="integrations"></a>
|
|
87
|
+
<a id="connect-to-your-agent"></a>
|
|
88
|
+
|
|
89
|
+
## Connect an agent
|
|
90
|
+
|
|
91
|
+
Use **Python 3.11+** for the optional MCP server. Choose the project configuration
|
|
92
|
+
generator for your harness:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
python -m pip install '.[mcp]'
|
|
96
|
+
|
|
97
|
+
context-relay connector claude configure --root .
|
|
98
|
+
# Or:
|
|
99
|
+
context-relay connector codex configure --root .
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
| Entry point | Included today |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| **Claude Code** | Project MCP configuration generator and diagnostics |
|
|
105
|
+
| **Codex CLI** | Project MCP configuration generator and diagnostics |
|
|
106
|
+
| **Other MCP clients** | Stdio server; configure and check compatibility manually |
|
|
107
|
+
| **CLI / Python** | Direct access to task state, packets, handoffs and diagnostics |
|
|
108
|
+
|
|
109
|
+
Reload your harness, then invoke the MCP tools explicitly. Diagnose the generated
|
|
110
|
+
configuration with `context-relay connector claude diagnose --root .` (or `codex`).
|
|
111
|
+
These are configuration integrations; a live Claude-to-Codex model evaluation is
|
|
112
|
+
still needed. See [MCP setup](docs/MCP_TASK_SERVER.md).
|
|
113
|
+
|
|
114
|
+
## How it works
|
|
115
|
+
|
|
116
|
+
<picture>
|
|
117
|
+
<source media="(prefers-color-scheme: dark) and (max-width: 600px)" srcset="docs/assets/architecture-dark-mobile.svg" />
|
|
118
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/architecture-dark.svg" />
|
|
119
|
+
<source media="(max-width: 600px)" srcset="docs/assets/architecture-light-mobile.svg" />
|
|
120
|
+
<img src="docs/assets/architecture-light.svg" alt="MCP clients call the optional stdio server. MCP, CLI and Python access the task service and local SQLite. The host supplies identity, context injection and completion checks." width="100%" />
|
|
121
|
+
</picture>
|
|
122
|
+
|
|
123
|
+
The eight MCP tools expose health, task inspection, packets, diffs, reports and
|
|
124
|
+
handoff inspection/acceptance. Authoritative instruction changes and handoff
|
|
125
|
+
offers use the CLI or Python API. The host supplies identity and policy, decides
|
|
126
|
+
when to inject context, and runs completion checks.
|
|
127
|
+
|
|
128
|
+
A packet carries the goal and criteria, active instructions and sources, Git
|
|
129
|
+
workspace identity, artifact references, evidence and open work. It has a
|
|
130
|
+
**character budget**: required state must fit; omitted optional entries are counted.
|
|
131
|
+
Artifact references do not transfer file bytes. The receiver checks their availability
|
|
132
|
+
and recorded state.
|
|
133
|
+
|
|
134
|
+
<details>
|
|
135
|
+
<summary><strong>Inspect the example's packet fields</strong></summary>
|
|
136
|
+
|
|
137
|
+
Selected fields from the [checked example output](docs/assets/demo-output.json);
|
|
138
|
+
IDs, timestamps and workspace paths are omitted here.
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"revision": 2,
|
|
143
|
+
"goal": "Produce a regional revenue report",
|
|
144
|
+
"instructions": [
|
|
145
|
+
{"text": "Use JSON", "source": {"kind": "user", "ref": "message-2"}}
|
|
146
|
+
],
|
|
147
|
+
"open_work": ["Implement JSON export", "Run the report oracle"]
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The full contract is in the [JSON Schema](schemas/task-context-v1alpha1.schema.json).
|
|
152
|
+
See the [design](docs/TASK_CONTEXT_ADR.md) and [packet compiler](src/context_relay/task_packet.py).
|
|
153
|
+
|
|
154
|
+
</details>
|
|
155
|
+
|
|
156
|
+
<details>
|
|
157
|
+
<summary><strong>Using the earlier Python memory API?</strong></summary>
|
|
158
|
+
|
|
159
|
+
The existing session and provider APIs remain available:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from context_relay import auto_connect
|
|
163
|
+
|
|
164
|
+
with auto_connect(existing_client, conversation="report-42") as ai:
|
|
165
|
+
response = ai(messages=full_history, model=your_model)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Pass your actual client, model and full original message history; append messages
|
|
169
|
+
without rewriting previous ones. Async clients use `async with` and `await`.
|
|
170
|
+
Calls through the original client bypass Relay. Anthropic also requires
|
|
171
|
+
`max_tokens`. Reuse the conversation name and storage location across restarts.
|
|
172
|
+
|
|
173
|
+
Paths include Python callables, Ollama, OpenAI, Anthropic and an optional
|
|
174
|
+
LangChain/LangGraph bridge. See [connection options](docs/AUTO_CONNECT.md),
|
|
175
|
+
[named memory](docs/NAMED_MEMORY.md), [provider support and recovery](docs/RESPONSES_WORKFLOW.md),
|
|
176
|
+
and [instruction clarification](docs/INSTRUCTION_CLARIFICATION.md).
|
|
177
|
+
|
|
178
|
+
Run `python -m context_relay quickstart` for the offline memory check supported
|
|
179
|
+
by the bundled wheel. See [distribution notes](PUBLIC_DISTRIBUTION.md) and
|
|
180
|
+
[Verified Release Desk](examples/verified_release_desk.py) with its
|
|
181
|
+
[setup guide](docs/PROTECTION_PROFILE.md).
|
|
182
|
+
|
|
183
|
+
</details>
|
|
184
|
+
|
|
185
|
+
<a id="what-has-been-tested"></a>
|
|
186
|
+
|
|
187
|
+
## Evidence
|
|
188
|
+
|
|
189
|
+
| Check | What it establishes |
|
|
190
|
+
| --- | --- |
|
|
191
|
+
| [Core CI: Linux and Windows](https://github.com/mahekara28/context-relay/actions/workflows/alpha.yml) | Regression coverage, installed-package checks and offline examples |
|
|
192
|
+
| [MCP adapter tests](tests/test_mcp_adapter.py) | Two-client task handoffs and a real stdio subprocess client |
|
|
193
|
+
| [Concurrency](tests/test_task_concurrency.py) / [restart recovery](tests/test_task_effect_restart.py) | Conflicting revisions and interrupted file effects under the covered conditions |
|
|
194
|
+
| [Continuation fixture](evaluations/continuation/README.md) | A disclosed stale CSV implementation fails an independent JSON report oracle |
|
|
195
|
+
|
|
196
|
+
These checks do not establish a model quality improvement. A live cross-harness
|
|
197
|
+
run and a matched Markdown baseline remain open. Earlier memory evaluation
|
|
198
|
+
results and limits are in the [validation report](docs/VALIDATION.md).
|
|
199
|
+
|
|
200
|
+
## Limits and trust
|
|
201
|
+
|
|
202
|
+
- **Local storage.** SQLite state is plaintext. Keep it private to your OS user.
|
|
203
|
+
A subject label is not remote authentication; distributed reliability is unproven.
|
|
204
|
+
- **Host responsibility.** MCP registration does not capture sessions automatically.
|
|
205
|
+
Reports retain their provenance; verification depends on the supplied checks
|
|
206
|
+
and sources. Receipts cannot undo external writes, and interrupted effects need
|
|
207
|
+
destination evidence to resolve their outcome.
|
|
208
|
+
- **Explicit instruction updates.** The legacy parser recognised only 1 of 11
|
|
209
|
+
clear changes in a separate wording test. Broad natural-language interpretation
|
|
210
|
+
remains future work.
|
|
211
|
+
|
|
212
|
+
[Storage and privacy](docs/STORAGE_PRIVACY.md) ·
|
|
213
|
+
[Task trust model](docs/TASK_CONTEXT_ADR.md#trust-and-scope) ·
|
|
214
|
+
[Recovery](docs/RESPONSES_WORKFLOW.md#results-and-recovery)
|
|
215
|
+
|
|
216
|
+
## Roadmap
|
|
217
|
+
|
|
218
|
+
- [x] Versioned task state, sourced updates and immutable handoff offers
|
|
219
|
+
- [x] Local MCP server, project configuration generators and host verification APIs
|
|
220
|
+
- [ ] Publish a reproducible task finished across two coding harnesses
|
|
221
|
+
- [ ] Compare it with a matched Markdown handoff and independent completion oracle
|
|
222
|
+
- [ ] Evaluate optional Nebius-assisted interpretation and additional harness adapters
|
|
223
|
+
|
|
224
|
+
See the [design direction](docs/TASK_CONTEXT_ADR.md) and
|
|
225
|
+
[evaluation fixture](evaluations/continuation/README.md). Remote collaboration
|
|
226
|
+
comes after local validation.
|
|
227
|
+
|
|
228
|
+
## Contributing
|
|
229
|
+
|
|
230
|
+
Bring a failing handoff, missed instruction, stale artifact or reproducible harness
|
|
231
|
+
integration. [Open an issue](https://github.com/mahekara28/context-relay/issues)
|
|
232
|
+
with expected behavior, actual behavior and synthetic input.
|
|
233
|
+
|
|
234
|
+
```sh
|
|
235
|
+
python -m pip install -e .
|
|
236
|
+
python -m unittest discover -s tests -v
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Add regression coverage for behavior changes. Optional SDK tests may skip;
|
|
240
|
+
see [validation dependencies](requirements-validation.txt). Install `'.[mcp]'`
|
|
241
|
+
for the MCP tests. The [artwork and replay](docs/assets/README.md) are reproducible
|
|
242
|
+
from source.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
[MIT license](LICENSE) · [Task quickstart](docs/TASK_QUICKSTART.md) · [Design notes](docs/TASK_CONTEXT_ADR.md)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Project, type SessionImport } from "../model.js";
|
|
2
|
+
import { type HarnessConnection, type DiscoveredSession } from "./types.js";
|
|
3
|
+
export declare function discover(connection: HarnessConnection, project: Project): Promise<DiscoveredSession[]>;
|
|
4
|
+
export declare function capture(connection: HarnessConnection, project: Project, session: DiscoveredSession): Promise<SessionImport>;
|