@karma42/agent 0.1.0-beta.2 → 0.1.0-beta.4
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 +17 -85
- package/package.json +4 -3
- package/runtime/manifest.json +1 -6
- package/runtime/project-tools.json +510 -0
- package/src/browser-pairing.mjs +140 -0
- package/src/cli.mjs +28 -68
- package/src/mcp-configuration.mjs +35 -0
- package/src/project-identity.mjs +15 -0
- package/src/reusable-stdio.mjs +163 -0
- package/src/session-stdio.mjs +7 -4
- package/src/session.mjs +8 -104
- package/src/state.mjs +11 -29
- package/src/system.mjs +4 -40
- package/src/version.mjs +1 -0
- package/runtime/AGENT_PROMPT_V2.md +0 -115
- package/runtime/claude-settings.json +0 -82
- package/runtime/launcher.mjs +0 -55
- package/runtime/providers.mjs +0 -284
- package/runtime/runner.mjs +0 -591
- package/runtime/runtime.mjs +0 -67
- package/src/connection.mjs +0 -214
- package/src/doctor.mjs +0 -28
- package/src/plan.mjs +0 -88
- package/src/supervisor.mjs +0 -17
- package/src/terminal.mjs +0 -33
package/README.md
CHANGED
|
@@ -1,103 +1,35 @@
|
|
|
1
|
-
# Karma42
|
|
1
|
+
# Karma42 MCP connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`0.1.0-beta.4` is an **unpublished draft**. It connects an existing MCP-capable AI client to a Karma42 project. It does not select, download or run a model. An MCP-capable client using DeepSeek or another model can use the same transport if that client supports local stdio MCP and the required project tools.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## First-time setup
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Each service/project/agent combination has its own ID, credentials and MCP name. Local and production services are distinct even when their IDs match. Several catalogs may load without claiming their agents. The first `get_project` call claims only its connection and verifies `you.agentId` and `you.agentName`; other tool calls are refused until this succeeds. Use a separate named agent for concurrent sessions. A second process using one identity is refused without takeover. Workspace scoping is client configuration, not a security sandbox; credentials are scoped by the service to their project agent.
|
|
10
|
-
|
|
11
|
-
Commands: `session-connect`, `session-prepare --connection ID` (recover interrupted pairing), `session-config --connection ID` (print the secret-free entry), `session-status` (local records only), and `session-serve --connection ID` (stdio transport, started by the MCP client). Session commands use separate private storage at `~/.karma42/sessions/SERVICE_PROJECT_HASH/AGENT_ID`; `--state-dir` selects a private test root. A saved pairing receipt survives cancellation. New setup codes rotate that identity’s service credential, so disconnect its old bridge/runner first. Other identities and their history are preserved.
|
|
12
|
-
|
|
13
|
-
The client owns the bridge process. EOF or SIGINT/SIGTERM/SIGHUP reports stopping, closes polling and releases the local identity lock. Closing a chat does not necessarily close the client-owned process; explicitly disconnect the named MCP entry to release it. A crash/SIGKILL cannot send a final report: the backend’s existing lease/fencing and stale-lock recovery still apply. No remote kill of the coding client is promised. Catalog discovery and connection contact are not evidence of model work or measured spending. The bridge retains the canonical bounded deferred-send journal/retries, only while connected. Revocation, stale runs, paused/not-started mutations and urgent runtime barriers remain enforced by the service; the bridge never downloads or executes cloud-selected runner updates to bypass a refusal.
|
|
14
|
-
|
|
15
|
-
The pinned beta.1 foreground-runner path remains for identified existing users. It uses different private storage and is not silently migrated. The commands below describe that legacy path; new onboarding uses the current-session commands above. OPE-12/OPE-43 own migration and eventual retirement after independent acceptance.
|
|
16
|
-
|
|
17
|
-
## Existing foreground runner
|
|
18
|
-
|
|
19
|
-
# Karma42 agent — beta release
|
|
20
|
-
|
|
21
|
-
Version `0.1.0-beta.1`. The package implements connection preparation, permission approval and a separate foreground start using the existing Karma42 agent runtime. This beta is prepared for public npm distribution. Publication status is recorded in the release plan. The deployed website still uses the existing setup instructions.
|
|
22
|
-
|
|
23
|
-
## The participant flow
|
|
24
|
-
|
|
25
|
-
1. Join the project in Karma42. In project **My agents**, create an agent or choose Reconnect and obtain its short-lived setup code.
|
|
26
|
-
2. In your terminal, run **connect**, explicitly choosing Claude Code or Codex and guarded or bypass permissions. Local prerequisites are checked before the setup code is consumed. Paste the code into a hidden prompt; it never belongs in a command, environment variable or chat transcript.
|
|
27
|
-
3. Pairing retrieves the authoritative agent identity and repository. Review the repository, local checkout, GitHub account, permissions, model-usage risks and current service-managed update policy. Answer each acknowledgement yourself. Bypass also requires the isolated-environment acknowledgement and typing `BYPASS`.
|
|
28
|
-
4. Preparation clones or validates the checkout, installs the packaged canonical kit, and reports readiness to Karma42. It does **not** start an agent. Git can invoke local hooks/filters while cloning. Model sign-in remains owned by your local coding client.
|
|
29
|
-
5. Run **start** separately. The confirmation shows the provider, saved permissions and newly checked GitHub account. On an active project the model can work immediately and consume usage; while preparing or paused it waits. Keep the terminal open. **Ctrl+C** stops this foreground runner; completed changes and external actions remain.
|
|
30
|
-
6. Use **status** for local preparation/approval/check timestamps. Open **My agents** for service-observed contact and activity. A local lock, missing contact or past readiness check is not proof an agent is currently working or stopped.
|
|
31
|
-
|
|
32
|
-
Project approval, joining, agent connection and the owner's Start project remain separate actions.
|
|
33
|
-
|
|
34
|
-
## Build and install locally
|
|
35
|
-
|
|
36
|
-
Supported package verification: macOS with Node 22+, Git, GitHub CLI and Claude Code 2.1.259+ or Codex CLI 0.160.0+. POSIX paths and private filesystem permissions are required. Linux and independent-operator acceptance remain release checks; Windows is not claimed as supported in this iteration.
|
|
37
|
-
|
|
38
|
-
From the repository:
|
|
7
|
+
Once per computer and client, print its registration instructions:
|
|
39
8
|
|
|
40
9
|
```sh
|
|
41
|
-
|
|
42
|
-
npm pack ./packages/agent-cli --pack-destination /private/tmp
|
|
43
|
-
npm install --global --offline --ignore-scripts --no-audit --no-fund /private/tmp/karma42-agent-0.1.0-beta.1.tgz
|
|
44
|
-
karma42-agent --help
|
|
10
|
+
npx --ignore-scripts @karma42/agent@0.1.0-beta.4 mcp-config --client claude
|
|
45
11
|
```
|
|
46
12
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
For a real project, replace `PROJECT_ID` and `SERVICE_ORIGIN` with its service URL from My agents:
|
|
50
|
-
|
|
51
|
-
```sh
|
|
52
|
-
karma42-agent doctor --provider claude
|
|
53
|
-
karma42-agent connect --project-url https://SERVICE_ORIGIN/p/PROJECT_ID --provider claude --mode guarded
|
|
54
|
-
karma42-agent status
|
|
55
|
-
karma42-agent start --connection PROJECT_ID/AGENT_ID
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
The example placeholders are not runnable projects. Do not use production setup codes for automated tests. Start is an explicit authorization to run the installed provider, subject to project state and current service authorization.
|
|
59
|
-
|
|
60
|
-
Optional: `--folder /absolute/real/checkout` selects an existing repository root or a new checkout under an existing real directory. Its HTTPS origin must match the project's repository exactly (optional `.git` suffix is normalized). The CLI never resets files, pulls changes or changes the origin. Custom checkouts must be separate from private connection storage, without symbolic-link paths. Existing working files are preserved.
|
|
61
|
-
|
|
62
|
-
## Commands and recovery
|
|
63
|
-
|
|
64
|
-
| Command | What it does |
|
|
65
|
-
| --- | --- |
|
|
66
|
-
| `connect --project-url … --provider claude\|codex --mode guarded\|bypass` | Checks versions, privately exchanges a code, records permission approval, prepares checkout and reports readiness. Never starts. |
|
|
67
|
-
| `prepare --connection ID` | Recovers an interrupted pairing or repeats preparation/readiness using the saved credential, without consuming another code. Renews preparation approval. |
|
|
68
|
-
| `start --connection ID` | Validates saved approval, bundle, checkout and current service authorization, refreshes GitHub evidence, asks to start, then runs in the foreground. |
|
|
69
|
-
| `reconnect --connection ID` | Privately exchanges a fresh code for the same agent/repository, rotates its credential and prepares again. Preserves checkout, sessions, logs and recovery files. Stop the previous runner first. |
|
|
70
|
-
| `permissions --connection ID --mode guarded\|bypass [--provider claude\|codex]` | Reviews and records the chosen permissions, refreshes preparation, and leaves the runner stopped. |
|
|
71
|
-
| `status [--connection ID] [--json]` | Lists local records and pending recovery, without contacting the server or claiming online/working state. |
|
|
72
|
-
| `doctor --provider claude\|codex [--json]` | Checks installed versions only. No account, model sign-in or repository-access claim. |
|
|
73
|
-
| `preview --provider … --mode … --project-url … --repo … --folder … [--json]` | Displays unverified onboarding copy with no connection or persisted approval. |
|
|
74
|
-
|
|
75
|
-
Connection commands accept `--state-dir /absolute/private/directory` for isolated tests or explicit local storage. Repeat the same option on later commands. The default is `~/.karma42/connections`.
|
|
76
|
-
|
|
77
|
-
An expired/refused code requires a new code in My agents. After a lost exchange response, its consumption is uncertain: do not blindly retry; generate a fresh code. After a successful response, an interrupted local application leaves a private receipt that `prepare` can recover. `status` identifies pending preparation. A mismatched reconnect never overwrites the previous identity or checkout; review the indicated connection separately. Repository identity changes are refused rather than silently authorized.
|
|
78
|
-
|
|
79
|
-
If GitHub access is unconfirmed, preparation reports **action required**. Sign in with `gh`, ask the owner for repository access and accept the invitation, then rerun `prepare`. Start requires an additional warning acknowledgement if write access remains unconfirmed; this preserves the existing warning behavior while the broader blocking policy remains undecided.
|
|
80
|
-
|
|
81
|
-
A lock prevents simultaneous package operations. After an unexpected kill, inspect the PID in `operation.lock` and confirm that the process has stopped before removing that lock. There is no automatic takeover or background service. Use the same `start` command to return after a normal stop.
|
|
13
|
+
Use `--client codex` for Codex, or `--client other` for the generic stdio configuration. **Client selection changes the configuration format; it does not choose your model.** These npm commands become available after publication; source-draft testing uses the locally built package.
|
|
82
14
|
|
|
83
|
-
|
|
15
|
+
Review and approve adding the single **karma42** connection. Claude Code uses user scope; Codex uses user configuration. Other clients receive a JSON command/arguments entry to adapt to their configuration schema. Inspect an existing `karma42` entry before changing it, and preserve other connections and native permissions. This command prints instructions only and makes no settings changes.
|
|
84
16
|
|
|
85
|
-
|
|
17
|
+
Start a project conversation with the connector loaded and approve any native trust prompt. First-time installation may require a client reload. Merely printing or saving configuration does not verify that its tools loaded.
|
|
86
18
|
|
|
87
|
-
|
|
19
|
+
References: [Claude Code MCP setup](https://code.claude.com/docs/en/mcp-quickstart), [official OpenAI MCP documentation](https://developers.openai.com/codex/mcp).
|
|
88
20
|
|
|
89
|
-
|
|
21
|
+
## Project-agent onboarding
|
|
90
22
|
|
|
91
|
-
|
|
23
|
+
Copy the project-agent instructions from [Karma42](https://karma42.ai) into the conversation. Approve connecting the named agent in its project and working folder. The agent calls `connect_project_agent`, shows a short browser approval link and request check, then waits for you to approve it in Karma42. Review the project, agent and requested folder; the browser cannot independently verify that folder.
|
|
92
24
|
|
|
93
|
-
|
|
25
|
+
After approval, `finish_project_agent_connection` uses the returned connection_ref to finish binding. `get_project` with that reference verifies identity and reads context. Keep the same reference on every subsequent project tool call. Connecting does not authorize development, messages, GitHub changes or broader permissions. Your client controls those actions and model usage.
|
|
94
26
|
|
|
95
|
-
|
|
27
|
+
The connector supports separate processes and hosts that share one MCP process across conversations. Each agent/project has an immutable binding with an opaque connection_ref. Every project tool requires this exact reference; there is no global active project or default target. Different bindings can work concurrently. Duplicate active identities retain exclusive run fences without automatic takeover. An explicitly selected approved connection can be reused for its matching identity and reported folder.
|
|
96
28
|
|
|
97
|
-
|
|
29
|
+
## Transport and private state
|
|
98
30
|
|
|
99
|
-
|
|
31
|
+
The client runs `mcp-serve`, which serves JSON-RPC over stdin/stdout without launching a model or background service. Node 22+ is required. `disconnect_project_agent` releases only the specified binding; EOF or transport termination releases all bindings in that process; completed external actions are not undone. Run fences, membership, revocation and project-state checks remain enforced by the service.
|
|
100
32
|
|
|
101
|
-
|
|
33
|
+
Private records use `~/.karma42/mcp` or `--state-dir /absolute/private/directory`. Storage must be private and outside the working folder. Credentials and polling secrets remain in private files; never put them in chat, arguments, URLs or client configuration. Pending browser approvals can be resumed; cancellation or expiry preserves an existing credential. Replacement requires explicit browser approval.
|
|
102
34
|
|
|
103
|
-
|
|
35
|
+
This source contains only the current MCP connector. Old npm releases remain published independently; this cleanup neither migrates their private records nor deletes production data or interrupts existing sessions. Native client and operating-system acceptance remain separate release checks. Configuration and protocol tests do not establish that every MCP client supports dynamic setup, reload or continuation.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karma42/agent",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
4
|
-
"description": "Karma42
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
|
+
"description": "Model-independent Karma42 MCP connector for project agents",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -30,5 +30,6 @@
|
|
|
30
30
|
"registry": "https://registry.npmjs.org/",
|
|
31
31
|
"access": "public",
|
|
32
32
|
"tag": "beta"
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://karma42.ai"
|
|
34
35
|
}
|
package/runtime/manifest.json
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": "pilot/agent-kit",
|
|
3
3
|
"files": {
|
|
4
|
-
"runner.mjs": "984d2eabc54f2561397a04c851c29f8362d83e9521063222c2a3ce2725e3e06f",
|
|
5
4
|
"control-v2.mjs": "02e325b642669b8f29c7b25582b1afaf4b74cbc63d2b463c11bf02abac90ca12",
|
|
6
|
-
"
|
|
7
|
-
"launcher.mjs": "4254a649e02597f21b5f3c1b146490554a19cc9919933a3dfdc55113cbf140aa",
|
|
8
|
-
"claude-settings.json": "bf3bfaaf38de37cda60a7dc48cb8c186c1864df61bd5ff500715ee2d1db4333e",
|
|
9
|
-
"AGENT_PROMPT_V2.md": "1a4f28e8105db39d384b63ef32cf06a9b14057da2e12fd2d0a0c0f3f1ca02d80",
|
|
10
|
-
"providers.mjs": "90e70acd1d2363f28584c8ccbc5cce7f9851c4aae1864309ff408822050a10ef"
|
|
5
|
+
"project-tools.json": "e0b97987df7887bb10926651de61cf886d6fd19b774ee1ecf3a67241e5cc98bd"
|
|
11
6
|
}
|
|
12
7
|
}
|