wayform 0.1.8 → 0.2.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/README.md +85 -50
- package/dist/cli.js +8 -3
- package/dist/cli.js.map +1 -1
- package/dist/config.js +6 -6
- package/dist/config.js.map +1 -1
- package/dist/credential-store.js +77 -0
- package/dist/credential-store.js.map +1 -0
- package/dist/doctor.js +30 -26
- package/dist/doctor.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/init-configs.js +60 -21
- package/dist/init-configs.js.map +1 -1
- package/dist/init-env.js +13 -6
- package/dist/init-env.js.map +1 -1
- package/dist/init-remote.js +159 -95
- package/dist/init-remote.js.map +1 -1
- package/dist/init.js +7 -3
- package/dist/init.js.map +1 -1
- package/dist/keychain.js +31 -0
- package/dist/keychain.js.map +1 -0
- package/dist/oauth-login.js +149 -0
- package/dist/oauth-login.js.map +1 -0
- package/dist/oauth-session.js +122 -0
- package/dist/oauth-session.js.map +1 -0
- package/dist/remote-read.js +11 -13
- package/dist/remote-read.js.map +1 -1
- package/dist/space-create.js +17 -201
- package/dist/space-create.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -75,21 +75,21 @@ or SSH. No accounts, no separate auth.
|
|
|
75
75
|
From your project repo:
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
|
|
78
|
+
wayform init
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
`init` writes, idempotently and without clobbering existing config:
|
|
82
82
|
|
|
83
83
|
- **Session-start read hooks + MCP registration** for Claude Code
|
|
84
84
|
(`.claude/settings.json`, `.mcp.json`), Cursor (`.cursor/hooks.json`,
|
|
85
|
-
`.cursor/mcp.json`), and Codex (`.codex/hooks.json
|
|
86
|
-
|
|
85
|
+
`.cursor/mcp.json`), and Codex (`.codex/hooks.json` and project
|
|
86
|
+
`.codex/config.toml`)
|
|
87
87
|
- **End-of-turn write-review hooks** (the Stop hook — see
|
|
88
88
|
[The loop](#the-loop-how-reads-and-writes-actually-happen))
|
|
89
89
|
- Your per-user, **gitignored** `.memorylayer-hook.env` (identity + repo URL —
|
|
90
90
|
secrets never enter git)
|
|
91
91
|
|
|
92
|
-
One person commits the project configs; each teammate runs `
|
|
92
|
+
One person commits the project configs; each teammate runs `wayform init`
|
|
93
93
|
once to set their own identity. Done — the next coding session in that project
|
|
94
94
|
starts with the team's context already loaded.
|
|
95
95
|
|
|
@@ -100,33 +100,66 @@ anyone pasting it. That round-trip is the product.
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
## Hosted gateway
|
|
103
|
+
## Hosted gateway
|
|
104
104
|
|
|
105
105
|
The local mode above needs each member to hold a git token. The **hosted
|
|
106
|
-
gateway** removes even that: a stateless Cloudflare Worker exposes the same
|
|
107
|
-
tools over MCP Streamable HTTP
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
106
|
+
gateway** removes even that: a stateless Cloudflare Worker exposes the same
|
|
107
|
+
tools over **MCP Streamable HTTP**. Identity is **GitHub OAuth** (the same App
|
|
108
|
+
that writes the memory repo). Members never copy, paste, or store a Wayform
|
|
109
|
+
credential.
|
|
110
|
+
|
|
111
|
+
Wayform is **vendor-neutral**. The same URL works in Cursor, Claude Code,
|
|
112
|
+
Codex, Devin, Antigravity, or any MCP client that speaks Streamable HTTP +
|
|
113
|
+
OAuth. Configure it in **this product repo** (the codebase you work in) — never
|
|
114
|
+
as a user-global MCP, or it will follow you into unrelated folders.
|
|
115
|
+
|
|
116
|
+
Every customer is a new team. The operator allowlists their GitHub user or org;
|
|
117
|
+
they create their own private memory repo, initialize project-scoped config,
|
|
118
|
+
and select that memory repo in the guided App installation. Teammates are
|
|
119
|
+
invited in-agent by GitHub username.
|
|
120
|
+
|
|
121
|
+
**Operator (once per client):** add their GitHub login or org to the allowlist,
|
|
122
|
+
then send the MCP URL. Never send a token.
|
|
123
|
+
|
|
124
|
+
**They do:**
|
|
125
|
+
|
|
126
|
+
1. On GitHub, create a **private** team-memory repo and give it a first commit
|
|
127
|
+
(for example, initialize it with a README).
|
|
128
|
+
2. In the product repo, run
|
|
129
|
+
`wayform init --remote --clients cursor,claude` with the clients the team
|
|
130
|
+
actually uses. This writes URL-only, project-scoped configuration.
|
|
131
|
+
3. Connect the `wayform` MCP server. Sign in with GitHub, follow the guided App
|
|
132
|
+
installation, and select only the private memory repo from step 1.
|
|
133
|
+
4. Run `wayform login` once on the machine so session hooks can authenticate.
|
|
134
|
+
5. Run `wayform doctor`; resolve every failed hosted check before continuing.
|
|
135
|
+
6. Ask the agent to record a test decision, then open a new session and confirm
|
|
136
|
+
that decision is already present.
|
|
137
|
+
7. Commit the URL-only project configuration. Teammates run remote init and
|
|
138
|
+
authenticate; nobody copies a credential.
|
|
139
|
+
|
|
140
|
+
### Client setup (project-scoped, OAuth)
|
|
141
|
+
|
|
142
|
+
Same URL everywhere. OAuth credentials are managed internally by each MCP
|
|
143
|
+
client or the native OS credential store; users never copy or configure them.
|
|
144
|
+
|
|
145
|
+
| Client | Project file (commit this) | Do **not** use (global) | Authenticate |
|
|
146
|
+
|---|---|---|---|
|
|
147
|
+
| **Cursor** | `.cursor/mcp.json` → `{ "mcpServers": { "wayform": { "url": "…" } } }` | `~/.cursor/mcp.json` | Connect |
|
|
148
|
+
| **Claude Code** | `.mcp.json` (same JSON), or `claude mcp add --transport http --scope project wayform <url>` | `--scope user` | `claude mcp login wayform` |
|
|
149
|
+
| **Codex** | `.codex/config.toml` → `url` + `auth = "oauth"` | `~/.codex/config.toml` | `codex mcp login wayform` |
|
|
150
|
+
| **Devin CLI** | `.devin/mcp_config.json` → `{ "url": "…", "transport": "http" }` | `--scope user` / `~/.config/devin/mcp_config.json` | `devin mcp login wayform` |
|
|
151
|
+
| **Antigravity** | `.agents/mcp_config.json` → `{ "serverUrl": "…" }` | `~/.gemini/config/mcp_config.json` | Authenticate in MCP settings (DCR) |
|
|
152
|
+
|
|
153
|
+
`wayform init --remote --clients cursor,claude` writes **only** those
|
|
154
|
+
clients' files. With `--yes` and no `--clients`, it updates folders
|
|
155
|
+
already in the repo and does not create the rest. `wayform doctor` says
|
|
156
|
+
"run wayform login" when the hook session is missing — never "paste a token".
|
|
157
|
+
|
|
158
|
+
Do **not** add Wayform as a Devin Cloud **organization-wide** MCP if you only
|
|
159
|
+
want it in this repo — that surface is shared across the org, not one folder.
|
|
160
|
+
|
|
161
|
+
Endpoints, allowlist, and the deploy runbook live in
|
|
162
|
+
[gateway/README.md](gateway/README.md).
|
|
130
163
|
|
|
131
164
|
---
|
|
132
165
|
|
|
@@ -171,8 +204,9 @@ coding session. (The flip side: failures are quiet — that's what `doctor` is
|
|
|
171
204
|
for.)
|
|
172
205
|
|
|
173
206
|
**Claude Desktop** has no hook system, so it's MCP-pull-only: register
|
|
174
|
-
`
|
|
175
|
-
reads when the model chooses to — path 1 is your write path
|
|
207
|
+
`wayform` as a stdio server (or point Desktop at the hosted gateway URL and
|
|
208
|
+
Connect) and it reads when the model chooses to — path 1 is your write path
|
|
209
|
+
there.
|
|
176
210
|
|
|
177
211
|
## Configuration (`.memorylayer-hook.env`)
|
|
178
212
|
|
|
@@ -182,18 +216,22 @@ into hook subprocesses:
|
|
|
182
216
|
|
|
183
217
|
| Var | Required | Meaning |
|
|
184
218
|
|-----|----------|---------|
|
|
185
|
-
| `CONTEXT_REPO_URL` |
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
219
|
+
| `CONTEXT_REPO_URL` | local mode | Shared context repo URL (may embed a git token). |
|
|
220
|
+
| `MEMORYLAYER_GATEWAY_URL` | hosted mode | Gateway base URL. Presence selects hosted (no clone). |
|
|
221
|
+
| `MEMORYLAYER_AUTHOR` | local mode | Your name — local commit author / attribution. Hosted attribution comes from GitHub OAuth. |
|
|
222
|
+
| `MEMORYLAYER_AUTHOR_EMAIL` | no | Local commit email. Defaults from author name. |
|
|
188
223
|
| `MEMORYLAYER_PROJECT` | no | Project/space name. Default: repo directory name. |
|
|
189
224
|
| `CONTEXT_REPO_PATH` | no | Local clone path. Default: keyed per repo URL under `$XDG_DATA_HOME/memorylayer/clones/<repo-slug>-<hash>` (falls back to `~/.local/share/...`), so two spaces can never share a clone. |
|
|
190
225
|
| `MEMORYLAYER_READ_BUDGET_TOKENS` | no | Read token budget. Default 4000; `<=0` = unlimited. |
|
|
191
226
|
| `MEMORYLAYER_AUTO_PUSH` | no | `false` to skip pushing (local smoke tests). |
|
|
192
227
|
|
|
228
|
+
Hosted hook env contains only project settings and the gateway URL. The OAuth
|
|
229
|
+
session is held by the native OS credential store after `wayform login`.
|
|
230
|
+
|
|
193
231
|
## Diagnostics
|
|
194
232
|
|
|
195
233
|
```bash
|
|
196
|
-
|
|
234
|
+
wayform doctor
|
|
197
235
|
```
|
|
198
236
|
|
|
199
237
|
Read-only. Checks the env file, resolved config, clone health and origin,
|
|
@@ -209,9 +247,11 @@ write "silently" does nothing — fail-open means problems hide here first.
|
|
|
209
247
|
`context/`; error output redacts embedded tokens.
|
|
210
248
|
- **Hosted mode:** the gateway is a stateless proxy — the source of truth stays
|
|
211
249
|
a private GitHub repo in *your* account. The App holds Contents-only
|
|
212
|
-
permission on exactly one repo per space;
|
|
213
|
-
|
|
214
|
-
store, never in code or git.
|
|
250
|
+
permission on exactly one repo per space; members are keyed by GitHub user
|
|
251
|
+
id after OAuth. The Worker holds operator secrets in Cloudflare's secret
|
|
252
|
+
store, never in code or git. Members never see a Wayform API key. For now,
|
|
253
|
+
one GitHub user can belong to one Wayform space; multi-space membership is a
|
|
254
|
+
deferred product decision.
|
|
215
255
|
- **Trust boundary to know about:** everything a space member writes is
|
|
216
256
|
injected into every member's sessions. You trust the people in your space —
|
|
217
257
|
that's the model, stated plainly.
|
|
@@ -220,24 +260,19 @@ write "silently" does nothing — fail-open means problems hide here first.
|
|
|
220
260
|
|
|
221
261
|
| Symptom | Cause & fix |
|
|
222
262
|
|---|---|
|
|
223
|
-
| `
|
|
263
|
+
| `wayform: command not found` right after `npm install -g github:...` | npm 10 git-global-install bug: the global bin points at an ephemeral cache clone with no files. Fix: the clone-then-install path from the Quickstart, or `npm pack` + `npm install -g ./wayform-*.tgz`. |
|
|
224
264
|
| `ENOTDIR` reinstalling over a previous failed install | Same bug, stale symlink. Remove the target dir shown in the error, then clone-then-install. |
|
|
225
|
-
| Reads/writes silently do nothing | `
|
|
265
|
+
| Reads/writes silently do nothing | `wayform doctor`. Hosted: usually `wayform login`. Local: missing `.memorylayer-hook.env`, no repo access, or unpushed local commits (self-heals on next read). |
|
|
226
266
|
| Teammates still see old behavior after an upgrade | The fix lives in the **global binary** — each teammate must reinstall it (committed project configs aren't enough), and a running MCP server needs a restart to pick it up. |
|
|
227
267
|
| macOS `curl` fails TLS against the hosted gateway (`workers.dev`) | LibreSSL negotiation quirk — add `--tlsv1.2`. Client-side only; SDK-based MCP clients are unaffected. |
|
|
228
268
|
|
|
229
269
|
## Project status
|
|
230
270
|
|
|
231
|
-
Working and in daily two-person dogfood
|
|
232
|
-
|
|
233
|
-
byte-intact by the local tool). Currently running a multi-week reliance pilot —
|
|
234
|
-
the success signal is a collaborator who **stops re-explaining decisions**
|
|
235
|
-
because they trust the shared space.
|
|
271
|
+
Working and in daily two-person dogfood on GitHub OAuth (no member API keys).
|
|
272
|
+
Hosted onboarding is Connect + GitHub App install on your private memory repo.
|
|
236
273
|
|
|
237
|
-
**Deliberately not built yet
|
|
238
|
-
|
|
239
|
-
engine (git *is* the merge engine). Next increments: gateway client shims
|
|
240
|
-
(`init --remote`), space-provisioning CLI.
|
|
274
|
+
**Deliberately not built yet:** Stripe/paid plans, per-space extract caps,
|
|
275
|
+
dashboard UI, custom merge engine (git *is* the merge engine).
|
|
241
276
|
|
|
242
277
|
## Repo layout
|
|
243
278
|
|
|
@@ -255,7 +290,7 @@ test/ node:test suites (gateway has its own under gateway/test/)
|
|
|
255
290
|
```bash
|
|
256
291
|
npm test # build + full local suite, lint: npm run lint
|
|
257
292
|
npm run test:gateway # gateway suite (Node >= 20)
|
|
258
|
-
|
|
293
|
+
wayform --help # subcommands: init, login, hook, doctor, space
|
|
259
294
|
```
|
|
260
295
|
|
|
261
296
|
Both planes share the entry format modules (`src/frontmatter.ts`,
|
package/dist/cli.js
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* wayform hook <client> -> read hook
|
|
8
8
|
* wayform prompt-hook <client> -> Claude UserPromptSubmit → /hook/prompt
|
|
9
9
|
* wayform stop-review <client> -> Stop no-op (legacy; re-engagement removed)
|
|
10
|
+
* wayform login -> GitHub OAuth; tokens go to the OS keychain
|
|
10
11
|
* wayform init [flags] -> installer (add --remote for hosted members)
|
|
11
12
|
* wayform doctor -> local diagnostics
|
|
12
|
-
* wayform space create [flags] ->
|
|
13
|
+
* wayform space create [flags] -> print App install URL + allowlist reminder
|
|
13
14
|
*
|
|
14
15
|
* `hook`/`prompt-hook`/`stop-review` set MEMORYLAYER_HOOK_CLIENT from the positional arg, then
|
|
15
16
|
* delegate to the neutral run functions (which self-load .memorylayer-hook.env).
|
|
@@ -22,6 +23,7 @@ import { runStopHook } from "./stop-hook.js";
|
|
|
22
23
|
import { runInit } from "./init.js";
|
|
23
24
|
import { runDoctor } from "./doctor.js";
|
|
24
25
|
import { runSpaceCreate } from "./space-create.js";
|
|
26
|
+
import { runLogin } from "./oauth-login.js";
|
|
25
27
|
async function main() {
|
|
26
28
|
// Self-load .memorylayer-hook.env from the project cwd for every subcommand,
|
|
27
29
|
// so the command is self-contained (no bash launcher). loadConfig stays pure.
|
|
@@ -49,19 +51,22 @@ async function main() {
|
|
|
49
51
|
case "doctor":
|
|
50
52
|
await runDoctor();
|
|
51
53
|
return;
|
|
54
|
+
case "login":
|
|
55
|
+
await runLogin(rest);
|
|
56
|
+
return;
|
|
52
57
|
case "space":
|
|
53
58
|
if (rest[0] === "create") {
|
|
54
59
|
await runSpaceCreate(rest.slice(1));
|
|
55
60
|
return;
|
|
56
61
|
}
|
|
57
|
-
console.error(`Unknown "space" subcommand "${rest[0]}". Use: wayform space create --
|
|
62
|
+
console.error(`Unknown "space" subcommand "${rest[0]}". Use: wayform space create --owner <github-login>`);
|
|
58
63
|
process.exit(1);
|
|
59
64
|
return;
|
|
60
65
|
case undefined:
|
|
61
66
|
await runServer();
|
|
62
67
|
return;
|
|
63
68
|
default:
|
|
64
|
-
console.error(`Unknown command "${sub}". Use: wayform [hook|prompt-hook|stop-review|init|doctor|space] …`);
|
|
69
|
+
console.error(`Unknown command "${sub}". Use: wayform [hook|prompt-hook|stop-review|init|doctor|login|space] …`);
|
|
65
70
|
process.exit(1);
|
|
66
71
|
}
|
|
67
72
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAA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AC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,OAAO;QACT,KAAK,SAAS;YACZ,MAAM,SAAS,EAAE,CAAC;YAClB,OAAO;QACT;YACE,OAAO,CAAC,KAAK,CACX,oBAAoB,GAAG,0EAA0E,CAClG,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -29,7 +29,6 @@ const HOOK_ENV_ALLOWLIST = new Set([
|
|
|
29
29
|
"MEMORYLAYER_HOOK_CLIENT",
|
|
30
30
|
"MEMORYLAYER_READ_BUDGET_TOKENS",
|
|
31
31
|
"MEMORYLAYER_GATEWAY_URL",
|
|
32
|
-
"MEMORYLAYER_GATEWAY_TOKEN",
|
|
33
32
|
]);
|
|
34
33
|
/**
|
|
35
34
|
* Load `.memorylayer-hook.env` (KEY=VALUE lines) from `cwd` into process.env,
|
|
@@ -137,11 +136,9 @@ export function defaultProject(cwd = process.cwd()) {
|
|
|
137
136
|
return path.basename(cwd) || "unknown";
|
|
138
137
|
}
|
|
139
138
|
export function loadConfig() {
|
|
140
|
-
const author = required("MEMORYLAYER_AUTHOR");
|
|
141
139
|
const gatewayUrl = process.env.MEMORYLAYER_GATEWAY_URL?.trim().replace(/\/+$/, "") ||
|
|
142
140
|
undefined;
|
|
143
|
-
const
|
|
144
|
-
const hasGateway = Boolean(gatewayUrl && gatewayToken);
|
|
141
|
+
const hasGateway = Boolean(gatewayUrl);
|
|
145
142
|
// Gateway-only members have no local clone. CONTEXT_REPO_URL is optional when a
|
|
146
143
|
// gateway is configured; without a gateway it stays required (local-only mode).
|
|
147
144
|
// We use "" as a clear "no clone" sentinel rather than making repoUrl/repoPath
|
|
@@ -155,6 +152,8 @@ export function loadConfig() {
|
|
|
155
152
|
? process.env.CONTEXT_REPO_PATH?.trim() ||
|
|
156
153
|
path.join(dataHome(), "clones", cloneKey(repoUrl))
|
|
157
154
|
: "";
|
|
155
|
+
const author = process.env.MEMORYLAYER_AUTHOR?.trim() ||
|
|
156
|
+
(repoUrl ? required("MEMORYLAYER_AUTHOR") : "GitHub");
|
|
158
157
|
const rawBudget = Number(process.env.MEMORYLAYER_READ_BUDGET_TOKENS);
|
|
159
158
|
const readBudgetTokens = Number.isFinite(rawBudget) && rawBudget > 0
|
|
160
159
|
? rawBudget
|
|
@@ -164,11 +163,12 @@ export function loadConfig() {
|
|
|
164
163
|
repoPath,
|
|
165
164
|
author,
|
|
166
165
|
authorEmail: process.env.MEMORYLAYER_AUTHOR_EMAIL?.trim() ||
|
|
167
|
-
|
|
166
|
+
(repoUrl
|
|
167
|
+
? `${author.replace(/\s+/g, ".").toLowerCase()}@memorylayer.local`
|
|
168
|
+
: "github@users.noreply.github.com"),
|
|
168
169
|
autoPush: (process.env.MEMORYLAYER_AUTO_PUSH?.trim() || "true") !== "false",
|
|
169
170
|
readBudgetTokens,
|
|
170
171
|
gatewayUrl,
|
|
171
|
-
gatewayToken,
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,qB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ACN,WAAW,EACT,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,IAAI,EAAE;YAC5C,CAAC,OAAO;gBACN,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,oBAAoB;gBAClE,CAAC,CAAC,iCAAiC,CAAC;QACxC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,EAAE,IAAI,MAAM,CAAC,KAAK,OAAO;QAC3E,gBAAgB;QAChB,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { Entry } from "@napi-rs/keyring";
|
|
4
|
+
const SERVICE = "wayform-oauth";
|
|
5
|
+
const BACKEND_ERROR = "Wayform could not access this operating system's credential store. " +
|
|
6
|
+
"Configure Keychain, Secret Service, or Credential Manager and run `wayform login` again.";
|
|
7
|
+
function readFile(file) {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(fs.readFileSync(file, "utf8"));
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function writeFile(file, values) {
|
|
16
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
17
|
+
fs.writeFileSync(file, JSON.stringify(values), { mode: 0o600 });
|
|
18
|
+
try {
|
|
19
|
+
fs.chmodSync(file, 0o600);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// Windows does not expose POSIX permission bits.
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function testFileCredentialStore(file) {
|
|
26
|
+
return {
|
|
27
|
+
get(account) {
|
|
28
|
+
return readFile(file)[account] ?? null;
|
|
29
|
+
},
|
|
30
|
+
set(account, secret) {
|
|
31
|
+
const values = readFile(file);
|
|
32
|
+
values[account] = secret;
|
|
33
|
+
writeFile(file, values);
|
|
34
|
+
},
|
|
35
|
+
delete(account) {
|
|
36
|
+
const values = readFile(file);
|
|
37
|
+
delete values[account];
|
|
38
|
+
writeFile(file, values);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function credentialError(error) {
|
|
43
|
+
return new Error(BACKEND_ERROR, { cause: error });
|
|
44
|
+
}
|
|
45
|
+
export function createCredentialStore(env = process.env, entryFactory = (service, account) => new Entry(service, account)) {
|
|
46
|
+
const testFile = env.WAYFORM_KEYCHAIN_FILE?.trim();
|
|
47
|
+
if (env.NODE_ENV === "test" && testFile) {
|
|
48
|
+
return testFileCredentialStore(testFile);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
get(account) {
|
|
52
|
+
try {
|
|
53
|
+
return entryFactory(SERVICE, account).getPassword();
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw credentialError(error);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
set(account, secret) {
|
|
60
|
+
try {
|
|
61
|
+
entryFactory(SERVICE, account).setPassword(secret);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
throw credentialError(error);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
delete(account) {
|
|
68
|
+
try {
|
|
69
|
+
entryFactory(SERVICE, account).deletePassword();
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
throw credentialError(error);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=credential-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-store.js","sourceRoot":"","sources":["../src/credential-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE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ACF,CAAC;AACJ,CAAC"}
|
package/dist/doctor.js
CHANGED
|
@@ -2,15 +2,12 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { execFile } from "node:child_process";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
|
+
import { oauthFetch } from "./oauth-session.js";
|
|
5
6
|
import { defaultProject, loadConfig, normalizeRepoUrl, } from "./config.js";
|
|
6
7
|
const execFileAsync = promisify(execFile);
|
|
7
8
|
const GATEWAY_PROBE_TIMEOUT_MS = 4000;
|
|
8
|
-
/** Files
|
|
9
|
-
const SECRET_FILES = [
|
|
10
|
-
".memorylayer-hook.env",
|
|
11
|
-
".cursor/mcp.json",
|
|
12
|
-
".codex/config.toml",
|
|
13
|
-
];
|
|
9
|
+
/** Files that used to carry a member credential. Hook env is URL-only now. */
|
|
10
|
+
const SECRET_FILES = [".memorylayer-hook.env"];
|
|
14
11
|
export async function runDoctor(options = {}) {
|
|
15
12
|
const cwd = options.cwd ?? process.cwd();
|
|
16
13
|
const setExitCode = options.setExitCode ?? true;
|
|
@@ -42,8 +39,8 @@ export async function runDoctor(options = {}) {
|
|
|
42
39
|
// Hosted (gateway) members have repoUrl="" — the git checks would run
|
|
43
40
|
// against an empty URL and fail a perfectly healthy setup. Probe the
|
|
44
41
|
// gateway instead; run the git checks only when a clone is configured.
|
|
45
|
-
if (cfg.gatewayUrl
|
|
46
|
-
results.push(await checkGateway(cfg, cwd, options.fetchImpl ?? fetch));
|
|
42
|
+
if (cfg.gatewayUrl) {
|
|
43
|
+
results.push(await checkGateway(cfg, cwd, options.fetchImpl ?? fetch, options.credentialStore));
|
|
47
44
|
}
|
|
48
45
|
if (cfg.repoUrl) {
|
|
49
46
|
results.push(await checkClone(cfg, gitRunner));
|
|
@@ -76,13 +73,9 @@ export function checkEnvFile(cwd, env) {
|
|
|
76
73
|
const has = (key) => keys.has(key) || Boolean(env[key]?.trim());
|
|
77
74
|
// Hosted members get a gateway-only env (init --remote writes no
|
|
78
75
|
// CONTEXT_REPO_URL); local members need the repo URL instead.
|
|
79
|
-
const hosted = has("MEMORYLAYER_GATEWAY_URL")
|
|
76
|
+
const hosted = has("MEMORYLAYER_GATEWAY_URL");
|
|
80
77
|
const required = hosted
|
|
81
|
-
? [
|
|
82
|
-
"MEMORYLAYER_GATEWAY_URL",
|
|
83
|
-
"MEMORYLAYER_GATEWAY_TOKEN",
|
|
84
|
-
"MEMORYLAYER_AUTHOR",
|
|
85
|
-
]
|
|
78
|
+
? ["MEMORYLAYER_GATEWAY_URL"]
|
|
86
79
|
: ["CONTEXT_REPO_URL", "MEMORYLAYER_AUTHOR"];
|
|
87
80
|
const missing = required.filter((key) => !has(key));
|
|
88
81
|
if (missing.length > 0) {
|
|
@@ -128,31 +121,34 @@ export function checkSecretPerms(cwd) {
|
|
|
128
121
|
];
|
|
129
122
|
}
|
|
130
123
|
/**
|
|
131
|
-
* One authed GET /hook/read proves reachability AND that the
|
|
132
|
-
* accepted — the same call the session hook makes
|
|
133
|
-
*
|
|
124
|
+
* One authed GET /hook/read proves reachability AND that the OAuth session is
|
|
125
|
+
* accepted — the same call the session hook makes. Missing/expired session
|
|
126
|
+
* tells the user to run `wayform login`, never to paste a token.
|
|
134
127
|
*/
|
|
135
|
-
export async function checkGateway(cfg, cwd, fetchImpl) {
|
|
136
|
-
|
|
128
|
+
export async function checkGateway(cfg, cwd, fetchImpl, credentialStore) {
|
|
129
|
+
if (!cfg.gatewayUrl)
|
|
130
|
+
return {
|
|
131
|
+
status: "fail",
|
|
132
|
+
name: "gateway",
|
|
133
|
+
message: "gateway URL is not configured",
|
|
134
|
+
};
|
|
135
|
+
const url = new URL(`${cfg.gatewayUrl}/mcp/hook/read`);
|
|
137
136
|
url.searchParams.set("project", defaultProject(cwd));
|
|
138
137
|
url.searchParams.set("budget", "1");
|
|
139
138
|
try {
|
|
140
|
-
const res = await
|
|
141
|
-
headers: { authorization: `Bearer ${cfg.gatewayToken}` },
|
|
142
|
-
signal: AbortSignal.timeout(GATEWAY_PROBE_TIMEOUT_MS),
|
|
143
|
-
});
|
|
139
|
+
const res = await oauthFetch(cfg.gatewayUrl, url.toString(), { signal: AbortSignal.timeout(GATEWAY_PROBE_TIMEOUT_MS) }, { fetchImpl, store: credentialStore });
|
|
144
140
|
if (res.ok) {
|
|
145
141
|
return {
|
|
146
142
|
status: "ok",
|
|
147
143
|
name: "gateway",
|
|
148
|
-
message: `reachable
|
|
144
|
+
message: `reachable (${cfg.gatewayUrl})`,
|
|
149
145
|
};
|
|
150
146
|
}
|
|
151
147
|
if (res.status === 401 || res.status === 403) {
|
|
152
148
|
return {
|
|
153
149
|
status: "fail",
|
|
154
150
|
name: "gateway",
|
|
155
|
-
message: "
|
|
151
|
+
message: "logged-out or expired — run: wayform login",
|
|
156
152
|
};
|
|
157
153
|
}
|
|
158
154
|
return {
|
|
@@ -162,10 +158,18 @@ export async function checkGateway(cfg, cwd, fetchImpl) {
|
|
|
162
158
|
};
|
|
163
159
|
}
|
|
164
160
|
catch (err) {
|
|
161
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
162
|
+
if (/run: wayform login/i.test(message)) {
|
|
163
|
+
return {
|
|
164
|
+
status: "fail",
|
|
165
|
+
name: "gateway",
|
|
166
|
+
message: "not logged in — run: wayform login",
|
|
167
|
+
};
|
|
168
|
+
}
|
|
165
169
|
return {
|
|
166
170
|
status: "fail",
|
|
167
171
|
name: "gateway",
|
|
168
|
-
message: `unreachable: ${redactSecrets(
|
|
172
|
+
message: `unreachable: ${redactSecrets(message)}`,
|
|
169
173
|
};
|
|
170
174
|
}
|
|
171
175
|
}
|
package/dist/doctor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,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CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,aAAa,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACzE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,sBAAsB,cAAc,CAAC,GAAG,CAAC,EAAE;KACrD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,OAAO,CAAC,OAAO,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;AAChE,CAAC;AAED,KAAK,UAAU,MAAM,CACnB,GAAuB,EACvB,IAAc;IAEd,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CACnB,OAAsB,EACtB,KAA6B;IAE7B,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACxB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -67,7 +67,7 @@ export async function runServer() {
|
|
|
67
67
|
type: "text",
|
|
68
68
|
text: "read_context could not reach the hosted gateway and this member " +
|
|
69
69
|
"is gateway-only (no local clone to fall back to). Retry online, " +
|
|
70
|
-
"or
|
|
70
|
+
"or run: wayform login",
|
|
71
71
|
},
|
|
72
72
|
],
|
|
73
73
|
isError: true,
|
|
@@ -185,7 +185,7 @@ export async function runServer() {
|
|
|
185
185
|
{
|
|
186
186
|
type: "text",
|
|
187
187
|
text: "search_memory needs the hosted gateway and it was not reachable " +
|
|
188
|
-
"(
|
|
188
|
+
"(run: wayform login, or retry online). " +
|
|
189
189
|
"Use read_context for the local recency view.",
|
|
190
190
|
},
|
|
191
191
|
],
|