@tnunamak/dalan 0.5.2 → 0.6.0
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/CHANGELOG.md +29 -25
- package/PROTOCOL.md +16 -4
- package/README.md +127 -260
- package/SECURITY.md +1 -1
- package/bin/dalan.mjs +5 -0
- package/bin/dot-worker.mjs +35 -26
- package/docs/chatgpt-worker-onboarding.md +5 -5
- package/docs/claude-worker-onboarding.md +5 -5
- package/docs/codex-to-muse.md +175 -0
- package/docs/connect-chatgpt.md +9 -4
- package/docs/connection-longevity.md +7 -1
- package/docs/dalan-upgrade.md +17 -13
- package/docs/deadman.md +5 -3
- package/docs/local-agent-mcp.md +8 -6
- package/docs/manual-setup.md +8 -8
- package/docs/mirror-fetch.md +1 -2
- package/docs/operations.md +90 -42
- package/docs/operator-duties.md +1 -1
- package/docs/owner-integrator.md +2 -2
- package/docs/portable-auth-profile.md +12 -14
- package/docs/pr-head-reviewer.md +21 -5
- package/docs/pr-preflight.md +2 -0
- package/docs/pull-queue.md +131 -0
- package/docs/pull-workers.md +7 -10
- package/docs/redaction.md +1 -1
- package/docs/service-setup.md +56 -3
- package/docs/setup-reference.md +1 -1
- package/docs/t3-integration.md +2 -0
- package/docs/t3-result-retry-delivery.md +2 -2
- package/docs/t3-reverse-control.md +7 -7
- package/docs/usage.md +19 -15
- package/docs/worker-clients.md +18 -13
- package/package.json +3 -1
- package/scripts/dalan-try-selfcheck.mjs +29 -0
- package/scripts/worker-bridge-setup.mjs +1 -1
- package/src/acp-bridge.mjs +18 -12
- package/src/as.mjs +41 -0
- package/src/child-exit.mjs +18 -0
- package/src/child-registry.mjs +94 -0
- package/src/cli-help.mjs +25 -11
- package/src/demo-worker.mjs +2 -2
- package/src/drained-owner.mjs +26 -0
- package/src/drained-slot.mjs +20 -3
- package/src/mcp-outcome.mjs +10 -1
- package/src/mcp-sse.mjs +62 -0
- package/src/pr-head-reviewer.mjs +3 -3
- package/src/process-inspection.mjs +36 -0
- package/src/pull-queue.mjs +159 -0
- package/src/route-setting.mjs +24 -0
- package/src/server.mjs +157 -29
- package/src/service-migrate-workers.mjs +113 -0
- package/src/service.mjs +388 -0
- package/src/setup.mjs +63 -0
- package/src/store.mjs +21 -9
- package/src/tool-registry.mjs +3 -1
- package/src/try-exposure.mjs +908 -0
- package/src/try-hosted-clients.mjs +46 -0
- package/src/try-hosted.mjs +444 -0
- package/src/try-selfcheck.mjs +168 -0
- package/src/try.mjs +63 -17
- package/src/workers.mjs +33 -23
- package/src/workspace.mjs +10 -3
package/README.md
CHANGED
|
@@ -1,349 +1,216 @@
|
|
|
1
1
|
# Dalan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Give a coding agent in ChatGPT, Claude on the web, or another MCP client a job from your computer, then review its report.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- **Any MCP client can be the worker.** Claude Code, Codex CLI, ChatGPT, Muse Spark (Meta) or your own agent connect over MCP (Model Context Protocol) with OAuth sign-in. Dalan does not run a model itself. See [Connect any MCP worker](#connect-any-mcp-worker) and [Connect ChatGPT](docs/connect-chatgpt.md). [T3 Code](docs/t3-integration.md#use-dalan-from-t3-code) can delegate to any of them.
|
|
9
|
-
- **The bridge listens only on your computer** until you choose to expose it.
|
|
10
|
-
|
|
11
|
-
**Not for:** Dalan does not run, schedule or start agents for you, and it does not merge code. It queues work and returns reports for you to review.
|
|
5
|
+
```sh
|
|
6
|
+
npx -y @tnunamak/dalan try
|
|
7
|
+
```
|
|
12
8
|
|
|
13
|
-
**
|
|
9
|
+
**Success:** Dalan prints a connector URL and a prompt. Add the connector to your hosted client, compare the sign-in code with the one in your terminal, approve the match, then paste the prompt into a chat with the connector enabled. The agent's report returns to your terminal.
|
|
14
10
|
|
|
15
11
|
<a id="quickstart"></a>
|
|
16
12
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
You need:
|
|
13
|
+
## Try it with your MCP client
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
- **Node.js 24 or newer.** Run `node --version`; it must print `v24` or higher. If it does not, install Node.js from the [official download page](https://nodejs.org/en/download) and open a new shell.
|
|
23
|
-
- **Optional: Git and Python 3.8 or newer**, for the repository part of the demo. Run `git --version` and `python3 --version`. Without them, the demo skips that part and says so.
|
|
15
|
+
You need Node.js 24 or newer, Linux or macOS (or WSL), and a hosted client account or workspace that permits custom MCP connectors.
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
Start Dalan in an interactive terminal:
|
|
26
18
|
|
|
27
19
|
```sh
|
|
28
|
-
npx @tnunamak/dalan try
|
|
20
|
+
npx -y @tnunamak/dalan try
|
|
29
21
|
```
|
|
30
22
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`try` starts a bridge on `127.0.0.1` and runs a built-in demo worker against it. The first run takes about half a minute. npx asks once to install the package; answer `y`. A first run prints this (the request ID is shortened):
|
|
34
|
-
|
|
35
|
-
```text
|
|
36
|
-
$ npx @tnunamak/dalan try
|
|
37
|
-
Need to install the following packages:
|
|
38
|
-
@tnunamak/dalan@0.5.2
|
|
39
|
-
Ok to proceed? (y) y
|
|
40
|
-
npm notice run npx
|
|
41
|
-
npm notice run 'dalan' try
|
|
42
|
-
Dalan trial. Home: /home/you/.local/share/dalan-trial
|
|
43
|
-
✔ Bridge up on http://127.0.0.1:8799. Loopback only. Log: /home/you/.local/share/dalan-trial/server.log
|
|
44
|
-
✔ Self-check passed in 2.6 s: a demo worker, approved by this command, finished a job; the repository grant works and a second repository is refused.
|
|
45
|
-
|
|
46
|
-
Connect your worker as an HTTP MCP server with OAuth:
|
|
47
|
-
MCP URL file: /home/you/.local/share/dalan-trial/resource-url
|
|
48
|
-
MCP URL (secret hidden): http://127.0.0.1:8799/<secret>/mcp
|
|
49
|
-
Keep the URL private.
|
|
50
|
-
How to connect Claude Code, Codex or another client: https://github.com/tnunamak/dalan/blob/v0.5.2/README.md#connect-your-own-worker
|
|
51
|
-
Callbacks: http://127.0.0.1/callback, http://localhost/callback. To add one, restart with:
|
|
52
|
-
npx @tnunamak/dalan try --home '/home/you/.local/share/dalan-trial' --callback PATTERN
|
|
53
|
-
Job req_01234567… is queued for your worker. When it is connected, send it:
|
|
54
|
-
"Request req_01234567… is your only job: claim it with Dalan, do what its brief asks, report progress and finish it with the claim_id. Stop if it is missing or cancelled. Claim no other job."
|
|
55
|
-
Waiting for your worker. Ctrl-C stops the bridge.
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**Check:** look for the `✔ Self-check passed` line. The demo worker signed in through OAuth, finished a text job, read the one demo repository that it was granted and was refused another. The demo repository is local, so no network or GitHub login is used.
|
|
59
|
-
|
|
60
|
-
`try` now keeps the bridge running and has queued a second job for your own worker. Leave this terminal open and continue below. Ctrl-C stops the bridge and keeps the trial home for the next run ([The trial home](#the-trial-home)).
|
|
61
|
-
|
|
62
|
-
<a id="connect-your-own-worker"></a>
|
|
63
|
-
|
|
64
|
-
## Connect your own worker
|
|
65
|
-
|
|
66
|
-
This step proves that your own client can do a job. You need a worker client installed and signed in on this computer, such as [Claude Code](https://code.claude.com/docs/en/quickstart), [Codex CLI](https://developers.openai.com/codex/cli/) or [opencode](docs/worker-clients.md#cli-worker-opencode). A client that runs on its provider's servers (ChatGPT, Claude on the web) cannot reach `127.0.0.1`; see [Expose the bridge](#expose-your-bridge) instead.
|
|
23
|
+
Choose ChatGPT or Claude on the web. In `auto` mode, a saved Gozar choice or an older saved localhost.run choice selects Gozar. Otherwise Dalan uses Tailscale when a route is usable, and Gozar when Tailscale is not usable.
|
|
67
24
|
|
|
68
|
-
|
|
25
|
+
When Dalan selects Gozar, it names tunnl.gg, links its [terms](https://tunnl.gg/terms) and [privacy notice](https://tunnl.gg/privacy), and asks for consent before exposure. After you consent, Gozar creates a key for this installation and opens a route through its key-bound `tunnl-gg` relay. Dalan does not use or pass your SSH keys. The relay terminates TLS and can see the connector URL and traffic. Keep private code and secrets out of the demo.
|
|
69
26
|
|
|
70
|
-
|
|
27
|
+
A temporary demo link can change or stop without warning, including within minutes. Dalan checks the original address and ends the trial when it detects a route change or loss. The trial ends after three hours at most; that is a limit on the trial, not a promise about the link. If the address changes or the route stops, start a fresh trial and replace the connector URL.
|
|
71
28
|
|
|
72
|
-
1. **Add the
|
|
29
|
+
1. **Add the connector.** Follow Dalan's instructions to add the complete connector URL in your hosted client and start sign-in. Keep the URL private.
|
|
30
|
+
2. **Approve the sign-in.** Compare the code in the browser with the code in your terminal. Approve only when they match.
|
|
31
|
+
3. **Send the prompt.** Paste Dalan's prompt into a chat with the connector enabled. Dalan queues the demo job; it does not start the hosted chat for you.
|
|
32
|
+
4. **Review the report.** Read the report in your terminal before you accept or reject it.
|
|
73
33
|
|
|
74
|
-
|
|
34
|
+
The hosted demo is a text job, not a repository review. It grants no repository access. Your agent uses its own account, limits and billing; Dalan does not run a model.
|
|
75
35
|
|
|
76
|
-
|
|
77
|
-
claude mcp add --transport http --scope user local "$(cat ~/.local/share/dalan-trial/resource-url)"
|
|
78
|
-
claude mcp login local
|
|
79
|
-
```
|
|
36
|
+
### Stop a trial
|
|
80
37
|
|
|
81
|
-
|
|
38
|
+
Ctrl-C stops the trial. It also cancels a route that is still starting. Dalan closes its forwarding gate and attempts to remove its route. If it cannot confirm cleanup, it reports that. When Gozar cannot confirm route ownership, Dalan leaves the route alone and gives no stop command; use a different port and home for another trial.
|
|
82
39
|
|
|
83
|
-
|
|
40
|
+
If Gozar returns a cleanup-pending status for this trial, Dalan provides a recovery command that stops by port. Gozar does not bind that command to a session ID, so the route can change before the command runs. Inspect the current route before using it.
|
|
84
41
|
|
|
85
|
-
|
|
86
|
-
codex mcp add local --url "$(cat ~/.local/share/dalan-trial/resource-url)"
|
|
87
|
-
```
|
|
42
|
+
On stop, Dalan removes the connector URL file. It also removes the bridge's secret file for temporary routes. It keeps the bridge configuration when a Tailscale route reuses the same home.
|
|
88
43
|
|
|
89
|
-
|
|
44
|
+
### Try without a public route
|
|
90
45
|
|
|
91
|
-
|
|
46
|
+
```sh
|
|
47
|
+
npx -y @tnunamak/dalan try --local
|
|
48
|
+
```
|
|
92
49
|
|
|
93
|
-
|
|
50
|
+
This runs a self-check with a built-in demo worker and then lets you connect a client on this computer. It does not open a public route. To connect a worker client by hand, see [manual setup](docs/manual-setup.md#worker-setup).
|
|
94
51
|
|
|
95
|
-
|
|
52
|
+
## Use a Tailscale route
|
|
96
53
|
|
|
97
|
-
|
|
54
|
+
`npx -y @tnunamak/dalan setup` saves a route choice for public trials. If Tailscale is ready for Funnel, setup asks whether to save Tailscale or Gozar for temporary links. If Tailscale is not ready, setup prints Tailscale installation instructions or lets you save Gozar. It does not install a background service or move a connector to a new address.
|
|
98
55
|
|
|
99
|
-
|
|
56
|
+
Use Tailscale explicitly:
|
|
100
57
|
|
|
101
|
-
|
|
58
|
+
```sh
|
|
59
|
+
npx -y @tnunamak/dalan setup
|
|
60
|
+
npx -y @tnunamak/dalan try --public --route tailscale --client chatgpt
|
|
61
|
+
```
|
|
102
62
|
|
|
103
|
-
|
|
104
|
-
- **No approval block appears in the `try` terminal.** After a while, `try` prints the `dalan connect pending` and `dalan status` commands to run in another terminal, and it shows each new attempt as it arrives.
|
|
105
|
-
- **`npx @tnunamak/dalan try` fails with an npm error such as `ECONNREFUSED`, `ETIMEDOUT` or `ENOTFOUND`.** npm cannot reach the registry. Check the network or proxy with `npm config get registry` and `npm config get proxy`, then run the command again.
|
|
106
|
-
- **Your client uses a different callback.** `try` allows `http://127.0.0.1/callback` and `http://localhost/callback` on any port. Stop `try` and start it again with `--callback PATTERN` ([pattern rules](docs/setup-reference.md#callback-patterns)).
|
|
63
|
+
Use `--client claude` for claude.ai. Tailscale login, client sign-in and approval may still be required. An explicit `--route tailscale` does not fall back to a trial link: if the route cannot start, Dalan stops and explains why.
|
|
107
64
|
|
|
108
|
-
|
|
65
|
+
An explicit `--route tailscale` trial uses HTTPS port 443. When the port is available, Dalan opens its own Funnel rule for the trial and attempts to remove only that rule when it stops. If another rule already holds port 443, Dalan can start an isolated, temporary Tailscale node instead. It does not reuse or change the other rule. That node uses a new address and may need a one-time sign-in. A new address needs a new client sign-in.
|
|
109
66
|
|
|
110
|
-
|
|
67
|
+
If the public address does not answer, the trial prints `TLS certificate: ok` or `TLS certificate: error (...)`. The trial keeps a masked copy of the temporary node's log as `tailscaled.log` in the trial home.
|
|
111
68
|
|
|
112
|
-
|
|
69
|
+
### Choose another relay
|
|
113
70
|
|
|
114
|
-
|
|
71
|
+
`--route gozar` explicitly selects the Gozar relay. Dalan still asks for consent before it exposes the route.
|
|
115
72
|
|
|
116
|
-
|
|
73
|
+
`--route localhost.run` remains available as an explicit option. It uses OpenSSH and a temporary third-party relay. The relay terminates TLS and can inspect the connector URL and forwarded traffic. Dalan prints this notice before it starts the route. The address can change or stop without warning. Dalan attempts to close the route and reports cleanup it cannot confirm.
|
|
117
74
|
|
|
118
|
-
|
|
119
|
-
|---|---|
|
|
120
|
-
| Run `dalan` commands against the trial bridge | Run `npm install -g @tnunamak/dalan`, then `export DALAN_HOME=~/.local/share/dalan-trial` in each shell. Try `dalan status` and `dalan inbox --all`. |
|
|
121
|
-
| Give your worker a task of your own, with no file to write | [Your own first job](#your-own-first-job) |
|
|
122
|
-
| Give your worker a job on a real repository | [Give a worker a repository job](#separate-repository-assignment) |
|
|
123
|
-
| Let a coding agent submit and read jobs as tool calls | [`dalan mcp`](docs/local-agent-mcp.md) |
|
|
124
|
-
| Connect a worker on another computer, or a hosted client such as ChatGPT | [Expose the bridge](#expose-your-bridge), then [Connect any MCP worker](#connect-any-mcp-worker) |
|
|
125
|
-
| Keep a bridge running as a service | [Run Dalan as a service](docs/service-setup.md) |
|
|
126
|
-
| Delegate T3 Code tasks to your worker, or give a worker T3 tools | [T3 and orchestration integration](docs/t3-integration.md#use-dalan-from-t3-code) and [T3 tools](docs/t3-reverse-control.md) |
|
|
127
|
-
| See every command | `dalan help --all` |
|
|
75
|
+
In `auto` mode, a saved Gozar choice or an older saved localhost.run choice selects Gozar. Otherwise, auto uses a usable Tailscale route and selects Gozar when Tailscale is unavailable.
|
|
128
76
|
|
|
129
|
-
<a id="your-
|
|
77
|
+
<a id="expose-your-bridge"></a>
|
|
130
78
|
|
|
131
|
-
|
|
79
|
+
## Install a long-running bridge
|
|
132
80
|
|
|
133
|
-
|
|
81
|
+
Install the CLI:
|
|
134
82
|
|
|
135
83
|
```sh
|
|
136
84
|
npm install -g @tnunamak/dalan
|
|
137
|
-
export DALAN_HOME=~/.local/share/dalan-trial
|
|
138
|
-
printf 'Your task, on one line: '; IFS= read -r task
|
|
139
85
|
```
|
|
140
86
|
|
|
141
|
-
|
|
87
|
+
For a bridge that runs in the background on Linux, follow [Run Dalan as a service](docs/service-setup.md). `dalan service install` installs a systemd user service and registers an existing HTTPS origin with Gozar. It does not configure your reverse proxy. One bridge can serve several workers with built-in sign-in and a stable tool catalog.
|
|
142
88
|
|
|
143
|
-
|
|
89
|
+
For an existing bridge, migrate worker settings into a new home before you install the service. Repeat `--source` for each old workers file. Use `--workspace-worker` for each worker that needs workspace access:
|
|
144
90
|
|
|
145
91
|
```sh
|
|
146
|
-
dalan
|
|
92
|
+
dalan service migrate-workers \
|
|
93
|
+
--home "$HOME/.local/share/dalan-service" \
|
|
94
|
+
--source "$HOME/OLD_BRIDGE/.config/dot-bridge/workers.json" \
|
|
95
|
+
--source-db "$HOME/OLD_BRIDGE/.local/share/dot-bridge/bridge.db" \
|
|
96
|
+
--workspace-worker WORKER
|
|
147
97
|
```
|
|
148
98
|
|
|
149
|
-
|
|
99
|
+
Migration reads source files without changing them. It copies only repository grants backed by validated audit records. If a checkpoint fails, all source grants are denied until the owner re-approves them. It denies and reports unaudited additions. It preserves supported worker settings, but does not copy OAuth connections, tokens, jobs, results or old destination approvals. The new service defaults execution to `none`. It preserves explicit `workspaceAllowed` settings. Workspace access stays denied by default; pass `--workspace-worker NAME` to grant it to each worker that needs it. Pair every connector again, create new subscriptions with fresh signing keys, and approve each new destination revision. See [service setup](docs/service-setup.md#install-one-bridge-for-several-workers) for details.
|
|
100
|
+
|
|
101
|
+
For a new service home, pass `--worker NAME` once for each worker instead of migrating. See `dalan help service` for the install options.
|
|
102
|
+
|
|
103
|
+
## Give your connected agent a job
|
|
104
|
+
|
|
105
|
+
In another terminal, replace `WORKER` with the name of your connected worker:
|
|
150
106
|
|
|
151
107
|
```sh
|
|
152
|
-
dalan
|
|
108
|
+
dalan submit --worker WORKER --execution none --deliver none --brief "Explain what a database index does. Do not read files, run commands or call external services."
|
|
153
109
|
```
|
|
154
110
|
|
|
155
|
-
|
|
111
|
+
Send the agent the request ID that Dalan prints. Ask it to claim that job, follow its brief and return a report. Queuing a job does not start the agent.
|
|
156
112
|
|
|
157
|
-
|
|
113
|
+
Replace `REQUEST_ID` with that ID, then wait and read the result:
|
|
158
114
|
|
|
159
|
-
|
|
115
|
+
```sh
|
|
116
|
+
dalan wait REQUEST_ID
|
|
117
|
+
dalan get REQUEST_ID --json
|
|
118
|
+
```
|
|
160
119
|
|
|
161
|
-
|
|
120
|
+
Read the report before recording your decision:
|
|
162
121
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
122
|
+
```sh
|
|
123
|
+
dalan decide REQUEST_ID accepted
|
|
124
|
+
```
|
|
166
125
|
|
|
167
|
-
|
|
126
|
+
A finished job and an accepted result are separate steps. Acceptance does not apply a patch. After review, apply a finished job's patch with:
|
|
168
127
|
|
|
169
|
-
|
|
128
|
+
```sh
|
|
129
|
+
dalan apply REQUEST_ID --dir PATH
|
|
130
|
+
```
|
|
170
131
|
|
|
171
132
|
<a id="separate-repository-assignment"></a>
|
|
172
133
|
|
|
173
134
|
## Give a worker a repository job
|
|
174
135
|
|
|
175
|
-
The first job needs no repository.
|
|
176
|
-
|
|
177
|
-
A bridge started by `dalan try` already has workspaces on. Leave `try` running and use a second shell with `DALAN_HOME` set ([Next steps](#next-steps)). For a bridge you started by hand, add `DALAN_ENABLE_WORKSPACE=1` to the server command from [step 3 of the manual setup](docs/manual-setup.md#owner-and-requester-setup) and restart it. Without that setting, repository calls fail with `capability_not_enabled`.
|
|
178
|
-
|
|
179
|
-
The repository can come from GitHub or from a clone on this computer:
|
|
180
|
-
|
|
181
|
-
- **A GitHub repository.** The bridge fetches with `gh auth token`. Install the [GitHub CLI](https://cli.github.com/) and run `gh auth login` as the user who runs the bridge. A service with its own home needs its own [GitHub access](docs/operations.md#service-github-access).
|
|
182
|
-
- **A clone on this computer (no GitHub login).** Pick a name `OWNER/REPO` for it, for example `local/my-project`. Start the bridge with a variable named `DALAN_GITHUB_URL_` plus that name in capitals, with every other character replaced by `_`, set to the clone's absolute path. For `local/my-project` the variable is `DALAN_GITHUB_URL_LOCAL_MY_PROJECT`. To use the trial bridge, stop `try` with Ctrl-C and start it again with the variable:
|
|
183
|
-
|
|
184
|
-
```sh
|
|
185
|
-
DALAN_GITHUB_URL_LOCAL_MY_PROJECT=/path/to/my-project npx @tnunamak/dalan try
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
The restart replaces your worker's connection with the demo worker again, so sign your worker in again as in [Connect your own worker](#connect-your-own-worker). For a bridge you started by hand, add the same variable to the server command instead. Use `local/my-project` wherever the steps below say `OWNER/REPO`. The clone needs at least one commit.
|
|
189
|
-
|
|
190
|
-
1. As owner, grant the worker one exact repository, then check the grant.
|
|
191
|
-
|
|
192
|
-
```sh
|
|
193
|
-
dalan worker allow local OWNER/REPO
|
|
194
|
-
dalan worker list local --json
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**Check:** the list contains only the repositories that you intend to allow. A new worker can use no repository; a grant for one repository does not grant its owner's other repositories. Grants take effect without a restart.
|
|
198
|
-
|
|
199
|
-
2. As requester, find the commit to pin. For a GitHub repository, `git ls-remote https://github.com/OWNER/REPO HEAD` prints it in the first column; for a local clone, run `git -C /path/to/my-project rev-parse HEAD`. Make a new request ID with `node -e "console.log(require('node:crypto').randomUUID())"`.
|
|
200
|
-
|
|
201
|
-
3. Save this job as `repository-job.json`, with your repository, commit and request ID. The job reads `README.md`; if the repository has none in its top directory, name another file.
|
|
202
|
-
|
|
203
|
-
```json
|
|
204
|
-
{
|
|
205
|
-
"schema_version": 1,
|
|
206
|
-
"request_id": "req_<new UUID>",
|
|
207
|
-
"brief": "Read README.md at the pinned commit and report its title. Do not run checks or change files.",
|
|
208
|
-
"inputs": [{"github_repo": "OWNER/REPO", "base_sha": "<full 40-character commit SHA>"}],
|
|
209
|
-
"expected_output": "README title and pinned revision; no patch or check claim.",
|
|
210
|
-
"scope_paths": ["README.md"],
|
|
211
|
-
"execution_scope": "read-only"
|
|
212
|
-
}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
4. Submit the job.
|
|
216
|
-
|
|
217
|
-
```sh
|
|
218
|
-
dalan submit --worker local --execution none --deliver none --file repository-job.json --json
|
|
219
|
-
```
|
|
136
|
+
The first job needs no repository. Repository jobs need Git and Python 3.8 or newer on the bridge computer, workspaces enabled, and an exact repository grant for the worker. The hosted demo does not enable repository work. A repository grant and a job's read/write scope are separate limits; host checks are another capability.
|
|
220
137
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
Then wait for the result, read it and record your decision:
|
|
226
|
-
|
|
227
|
-
```sh
|
|
228
|
-
dalan wait REQUEST_ID
|
|
229
|
-
dalan get REQUEST_ID
|
|
230
|
-
dalan decide REQUEST_ID accepted
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
**Check:** the report names the file's title and the exact commit that you pinned. Each repository job takes one repository; submit separate jobs for more.
|
|
234
|
-
|
|
235
|
-
If submission or claim says the repository is not allowed, run `dalan paths --json` to confirm that you are in the bridge's home, then `dalan worker list local --json`, and grant the exact repository. A queued job that loses its grant stays queued until the grant returns or you cancel the job. A GitHub authentication error means the bridge's home has no working GitHub credential.
|
|
236
|
-
|
|
237
|
-
Repository workspaces and host checks (tests that the bridge runs) are separate capabilities. `try` does not turn on host checks. They need Linux, explicit owner opt-in, an allowlisted repository and check, and resource budgets; see [execution and evidence](docs/operations.md#execution-capability-and-check-evidence). A finished job or a passing check never authorizes a merge.
|
|
238
|
-
|
|
239
|
-
<a id="expose-your-bridge"></a>
|
|
240
|
-
|
|
241
|
-
## Expose the bridge to other machines
|
|
242
|
-
|
|
243
|
-
A worker connects from wherever its MCP client runs. `127.0.0.1` reaches only the bridge computer. A worker on another computer needs a network route to the bridge, and a hosted client such as ChatGPT needs a public HTTPS address.
|
|
138
|
+
```sh
|
|
139
|
+
dalan worker allow WORKER OWNER/REPO
|
|
140
|
+
dalan worker list WORKER --json
|
|
141
|
+
```
|
|
244
142
|
|
|
245
|
-
|
|
143
|
+
Revoke access when the worker no longer needs it:
|
|
246
144
|
|
|
247
|
-
|
|
248
|
-
|
|
145
|
+
```sh
|
|
146
|
+
dalan worker deny WORKER OWNER/REPO
|
|
147
|
+
```
|
|
249
148
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
149
|
+
For a read-only repository job, replace the request ID, repository and full commit SHA below. Choose a file that exists at that commit:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"schema_version": 1,
|
|
154
|
+
"request_id": "req_<new UUID>",
|
|
155
|
+
"brief": "Read README.md at the pinned commit and report its title. Do not run checks or change files.",
|
|
156
|
+
"inputs": [{"github_repo": "OWNER/REPO", "base_sha": "<full 40-character commit SHA>"}],
|
|
157
|
+
"expected_output": "README title and pinned revision; no patch or check claim.",
|
|
158
|
+
"scope_paths": ["README.md"],
|
|
159
|
+
"execution_scope": "read-only"
|
|
160
|
+
}
|
|
161
|
+
```
|
|
253
162
|
|
|
254
|
-
|
|
163
|
+
Save it as `repository-job.json`, then submit, wait, read the report and record your decision:
|
|
255
164
|
|
|
256
|
-
|
|
257
|
-
|
|
165
|
+
```sh
|
|
166
|
+
dalan submit --worker WORKER --execution none --deliver none --file repository-job.json --json
|
|
167
|
+
dalan wait REQUEST_ID
|
|
168
|
+
dalan get REQUEST_ID
|
|
169
|
+
dalan decide REQUEST_ID accepted
|
|
170
|
+
```
|
|
258
171
|
|
|
259
|
-
|
|
172
|
+
The host's GitHub credential must be able to read the repository. For local clones, manual bridge setup and workspace configuration, see [manual setup](docs/manual-setup.md#owner-and-requester-setup) and the [setup reference](docs/setup-reference.md). Keep private repository credentials out of the job brief.
|
|
260
173
|
|
|
261
174
|
<a id="support-matrix"></a>
|
|
175
|
+
<a id="connect-your-own-worker"></a>
|
|
262
176
|
|
|
263
177
|
## Connect any MCP worker
|
|
264
178
|
|
|
265
|
-
Any client that speaks HTTP MCP and completes the bridge's OAuth sign-in can be a worker. Start with the [worker guide](docs/worker-clients.md);
|
|
179
|
+
Any client that speaks HTTP MCP and completes the bridge's OAuth sign-in can be a worker. Start with the [worker guide](docs/worker-clients.md); client recipes add registration details, while job tools and grant rules stay the same.
|
|
266
180
|
|
|
267
181
|
| Client | Guide |
|
|
268
182
|
|---|---|
|
|
269
|
-
| Any MCP client | [Connect a worker client](docs/worker-clients.md)
|
|
183
|
+
| Any MCP client | [Connect a worker client](docs/worker-clients.md) |
|
|
270
184
|
| Codex CLI | [Native CLI worker: Codex CLI](docs/worker-clients.md#native-cli-worker-codex-cli) |
|
|
271
185
|
| Claude Code | [Native CLI worker: Claude Code](docs/worker-clients.md#native-cli-worker-claude-code) |
|
|
272
|
-
| opencode | [CLI worker: opencode](docs/worker-clients.md#cli-worker-opencode)
|
|
186
|
+
| opencode | [CLI worker: opencode](docs/worker-clients.md#cli-worker-opencode) |
|
|
273
187
|
| ChatGPT | [Connect ChatGPT](docs/connect-chatgpt.md) |
|
|
274
|
-
|
|
|
275
|
-
| Claude on the web (hosted) | [Claude cloud worker](docs/claude-worker-onboarding.md); separate from Claude Code |
|
|
276
|
-
|
|
277
|
-
Start each new worker by hand for its first job. Dalan never starts a worker, including after a reboot.
|
|
278
|
-
|
|
279
|
-
<a id="the-trial-home"></a>
|
|
188
|
+
| Claude on the web | [Claude cloud worker](docs/claude-worker-onboarding.md) |
|
|
280
189
|
|
|
281
|
-
##
|
|
190
|
+
## Upgrade
|
|
282
191
|
|
|
283
|
-
|
|
192
|
+
Read the release notes and follow the ordered [upgrade guide](docs/dalan-upgrade.md) before an upgrade. This release changes the worker tool list. After you upgrade, refresh the Dalan connection once in each worker client.
|
|
284
193
|
|
|
285
|
-
-
|
|
286
|
-
- **Keep it dedicated.** A directory that has the marker is reused without checking its other files. On exit, `try` deletes `demo/` and every `req_*.json` request file in the home, revokes the demo grant and deletes the demo repository. A run that was killed is cleaned up at the next start.
|
|
287
|
-
- **Use a short path on a local disk.** The bridge's admin socket path has a length limit, and network or FUSE file systems are not supported. If a home is too long or not on a local disk, use a new short directory: `npx @tnunamak/dalan try --home /short/local/path`. Do not use an existing bridge home.
|
|
288
|
-
- **A second run reuses the home**, its worker profile, job history and port. It first replaces the worker's connection with the demo worker, so sign in again in your client and approve it again after the demo.
|
|
289
|
-
- **To start over**, stop `try` and delete the trial home.
|
|
290
|
-
- **For scripts**, run `dalan try < /dev/null`: with standard input closed, `try` runs the self-check and stops.
|
|
194
|
+
For a compatible-code restart, built-in OAuth keeps an unexpired access token only when the bridge uses the same private home and issuer and its grant and connection remain live. Access tokens last up to one hour. Before an upgrade or restore, stop the bridge and every other writer, then make a consistent SQLite backup. Preserve the complete active private config directory, including `as.json`, `as-jwks.json`, `as-cookie-keys.json`, `as.sqlite` and its sibling `as-storage.key`; the keys alone cannot restore sign-ins. Follow the [backup and rollback steps](docs/operations.md#upgrade-and-rollback).
|
|
291
195
|
|
|
292
|
-
|
|
196
|
+
For the built-in public-client flow, a client that loses a refresh response can recover it only by retrying the identical request within five seconds, while the successor token and connection remain live. A retry after that window can fail and require the client to pair again. This is not a promise of recovery after a longer outage or across incompatible code or storage changes.
|
|
293
197
|
|
|
294
|
-
|
|
295
|
-
- `--port N`: the bridge port. The default is the port that the home used before, otherwise 8799 or the next free port. A home keeps its port; for another port, start a separate trial with `--home NEW_DIR --port N`.
|
|
296
|
-
- `--callback PATTERN`: allow one more OAuth callback pattern; repeatable.
|
|
297
|
-
|
|
298
|
-
`try` turns repository workspaces on (with at least 256 MiB of free disk) and makes only the demo repository available locally. Every other repository stays denied until you grant it. `try` does not turn on host checks.
|
|
299
|
-
|
|
300
|
-
**Commands against the trial.** Set `DALAN_HOME` as in [Next steps](#next-steps). While the default trial home `~/.local/share/dalan-trial` exists and `DALAN_HOME` is unset, every command except `dalan help`, `dalan paths`, `dalan doctor`, `dalan try`, `dalan mcp`, `dalan --version` and `dalan -v` stops with `DALAN_HOME is not set` and prints the `export` line to run, so it cannot use your normal home by mistake. `dalan doctor` runs instead, reports that no bridge home is selected and prints the `export` line to run. Without that trial home, an unset `DALAN_HOME` means your normal home.
|
|
301
|
-
|
|
302
|
-
**If the bridge does not start or stops.** `try` prints the path of `server.log` and three commands: one to read the log, one to retry the same home and port, and one to start in a new home with a free port. Read the log before you retry. `--port` alone cannot move an existing trial to another port.
|
|
303
|
-
|
|
304
|
-
<a id="step-by-step"></a>
|
|
305
|
-
|
|
306
|
-
## Advanced: the same setup by hand
|
|
307
|
-
|
|
308
|
-
`try` runs ordinary `dalan` commands in a private trial home. To run each piece yourself (a foreground bridge, your own worker name, or a client that `try` does not cover), follow [Manual setup](docs/manual-setup.md).
|
|
309
|
-
|
|
310
|
-
<a id="owner-and-requester-setup"></a>
|
|
311
|
-
<a id="worker-setup"></a>
|
|
312
|
-
<a id="submit-finish-and-read-the-result"></a>
|
|
313
|
-
|
|
314
|
-
It has three parts: [owner and requester setup](docs/manual-setup.md#owner-and-requester-setup), [worker setup](docs/manual-setup.md#worker-setup), and [submit, finish and read the result](docs/manual-setup.md#submit-finish-and-read-the-result), which has a complete first job in `first-job.json`. To give a job to the trial bridge with no file, see [Your own first job](#your-own-first-job).
|
|
315
|
-
|
|
316
|
-
<a id="commands-that-matter"></a>
|
|
317
|
-
|
|
318
|
-
## Operate and recover
|
|
319
|
-
|
|
320
|
-
- **Settings and commands.** The [setup reference](docs/setup-reference.md) lists environment settings and requester commands. The [protocol](PROTOCOL.md) defines the worker tools and lease rules.
|
|
321
|
-
- **Before you change a deployed bridge**, read [operations](docs/operations.md). Before an upgrade, read the [release notes](CHANGELOG.md) and follow [upgrade and rollback](docs/operations.md#upgrade-and-rollback): older code can refuse an upgraded database.
|
|
322
|
-
- **Backups.** Stop every process that writes to the bridge, then follow the [backup checklist](docs/dalan-upgrade.md#pre-upgrade-checklist). Back up receipts, artifacts and encryption keys with the databases. After a restore of older authorization state, a worker's newer token can fail with `invalid_grant`; connect that worker again.
|
|
323
|
-
- **Optional integrations.** Besides [T3 Code](docs/t3-integration.md#use-dalan-from-t3-code), the [setup reference](docs/setup-reference.md) lists the other optional integrations, and ordinary jobs need none of them.
|
|
324
|
-
- **Uninstall a trial.** Stop `dalan try` (Ctrl-C) and remove the connection from your client: `claude mcp remove --scope user local` or `codex mcp remove local`. Remove the `dalan` command as the [removal table](docs/operations.md#remove-an-installation) describes. The trial home holds private keys, connections and receipts: delete it only when you no longer need them. For a generated service, follow [service removal](docs/service-setup.md#remove-a-generated-service).
|
|
325
|
-
|
|
326
|
-
<a id="repository-layout"></a>
|
|
327
|
-
|
|
328
|
-
## Names you may see
|
|
329
|
-
|
|
330
|
-
Earlier versions of Dalan used other names, and some remain so that existing installations keep working. Use `dalan` and `DALAN_*` names for anything new. The [setup reference](docs/setup-reference.md#names-you-may-see) lists the older names and the optional integrations.
|
|
331
|
-
|
|
332
|
-
<a id="from-source"></a>
|
|
333
|
-
|
|
334
|
-
## Install from source
|
|
335
|
-
|
|
336
|
-
To work on Dalan, or to run the bridge by hand from a checkout:
|
|
337
|
-
|
|
338
|
-
```sh
|
|
339
|
-
git clone https://github.com/tnunamak/dalan.git
|
|
340
|
-
cd dalan
|
|
341
|
-
npm ci
|
|
342
|
-
node bin/dalan.mjs try
|
|
343
|
-
```
|
|
198
|
+
## Reference
|
|
344
199
|
|
|
345
|
-
|
|
200
|
+
| Need | Command or guide |
|
|
201
|
+
| --- | --- |
|
|
202
|
+
| Command help | `dalan help --all` |
|
|
203
|
+
| Trial options | `dalan help try` |
|
|
204
|
+
| Bridge and queue state | `dalan status --json` |
|
|
205
|
+
| Results needing attention | `dalan inbox --all` |
|
|
206
|
+
| A full job record | `dalan get REQUEST_ID --json` |
|
|
207
|
+
| Host diagnostics | `dalan doctor --json` |
|
|
208
|
+
| File locations | `dalan paths --json` |
|
|
209
|
+
| Cancel a job | `dalan cancel REQUEST_ID` |
|
|
210
|
+
| Run a bridge in the background | [Service setup](docs/service-setup.md) |
|
|
211
|
+
| Upgrade or remove an installation | [Operations](docs/operations.md) |
|
|
212
|
+
| Release changes | [Changelog](CHANGELOG.md) |
|
|
346
213
|
|
|
347
|
-
|
|
214
|
+
When asking for help, share the failing step and error. Do not share private connector URLs, pairing codes or credentials.
|
|
348
215
|
|
|
349
|
-
Licensed under
|
|
216
|
+
Licensed under Apache-2.0.
|
package/SECURITY.md
CHANGED
|
@@ -12,7 +12,7 @@ Include the affected revision, impact, and steps to reproduce with sanitized exa
|
|
|
12
12
|
|
|
13
13
|
## Secret redaction
|
|
14
14
|
|
|
15
|
-
The bridge masks credentials in logs, alerts, errors, in the report text and progress notes it shows the owner, and in stored report artifacts. The local database keeps the exact text a worker sent, so protect the database and its backups. Redaction catches accidental leaks of registered secrets and known formats, including JSON-escaped spellings such as a `\u0073` escape inside a JSON string or key. It cannot stop a worker that deliberately encodes a secret it knows.
|
|
15
|
+
The bridge masks credentials in logs, alerts, errors, in the report text and progress notes it shows the owner, and in stored report artifacts. The local database keeps the exact text a worker sent, so protect the database and its backups. Redaction catches accidental leaks of registered secrets and known formats, including JSON-escaped spellings such as a `\u0073` escape inside a JSON string or key. It cannot stop a worker that deliberately encodes a secret it knows. Examples that can pass unmasked include base64-encoded unregistered secrets and secrets split across log lines. See [docs/redaction.md](docs/redaction.md).
|
|
16
16
|
|
|
17
17
|
## Known limits
|
|
18
18
|
|
package/bin/dalan.mjs
CHANGED
|
@@ -22,6 +22,11 @@ if (help) {
|
|
|
22
22
|
} else if (process.argv[2] === 'mcp') {
|
|
23
23
|
// stdout is the protocol channel: nothing else may print to it. The tools run the CLI, which applies the DALAN_HOME rules.
|
|
24
24
|
await (await import('../src/mcp-stdio.mjs')).main();
|
|
25
|
+
} else if (process.argv[2] === 'setup') {
|
|
26
|
+
await (await import('../src/setup.mjs')).main();
|
|
27
|
+
} else if (process.argv[2] === 'service') {
|
|
28
|
+
try { await (await import('../src/service.mjs')).serviceMain(process.argv.slice(3)); }
|
|
29
|
+
catch (error) { process.stderr.write(`dalan: service: ${error.message}\n`); process.exitCode = 1; }
|
|
25
30
|
} else if (process.argv[2] === 'try') {
|
|
26
31
|
await (await import('../src/try.mjs')).main();
|
|
27
32
|
} else {
|