@mysten-incubation/memwal-mcp 0.0.14-dev.0 → 0.0.14-dev.2

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 CHANGED
@@ -152,6 +152,45 @@ Credentials are stored locally in `~/.memwal/credentials.json`. To remove them:
152
152
  npx -y @mysten-incubation/memwal-mcp --logout
153
153
  ```
154
154
 
155
+ ### Per-project credentials
156
+
157
+ A project can keep its own `.memwal/credentials.json` so memory written from it
158
+ goes to a separate account. That file lives inside the repository, where anyone
159
+ who can commit to it — or who can get you to open a clone — could otherwise
160
+ choose the account and relayer your memories go to. So it is **ignored until you
161
+ approve it**, once per machine:
162
+
163
+ ```sh
164
+ cd path/to/project
165
+ npx -y @mysten-incubation/memwal-mcp approve-project
166
+ ```
167
+
168
+ Until then the global credentials are used, and a line on stderr names the file
169
+ that was skipped and the destination it wanted. An approval covers one exact
170
+ project path, account, delegate key and relayer: if any of those change, it has
171
+ to be approved again. The record is kept in `~/.memwal/project-approvals.json`,
172
+ outside the repository, so a repository cannot carry its own approval.
173
+ `revoke-project` withdraws it.
174
+
175
+ Approving also picks the file that is **written**: a later sign-in from that
176
+ project saves a delegate private key into `.memwal/credentials.json` in plain
177
+ text, inside the repository. `approve-project` says so, and so does the sign-in
178
+ warning. Add `.memwal/` to your `.gitignore`. (The short-lived login
179
+ write-ahead record is kept outside the repository either way.)
180
+
181
+ `MEMWAL_CREDS_DIR` points both the credentials and the approval record at a
182
+ directory of your choosing and overrides project resolution entirely, with no
183
+ approval. Because it skips the gate, it must be an **absolute path outside the
184
+ current project**: a relative value would resolve against the working directory
185
+ and put the approval record inside the repository, and an MCP client passes on
186
+ the `env` block it reads from `.cursor/mcp.json` / `.vscode/mcp.json` /
187
+ `.claude/settings.json` in the checkout — where `${workspaceFolder}` is expanded,
188
+ so an in-project absolute path is not proof you chose it. Anything else is
189
+ refused with an error naming the value, rather than quietly ignored. An empty
190
+ value means unset.
191
+
192
+ `memwal_health` reports the destination in use as `account=… relayer=…`.
193
+
155
194
  ## License
156
195
 
157
196
  Apache-2.0
@@ -22,6 +22,226 @@
22
22
  * and coexist.
23
23
  */
24
24
  import { type MemWalCredentials } from "./auth.js";
25
+ /** Tool names the OLDEST relayer this bridge still talks to serves.
26
+ *
27
+ * The bridge ships on npm and updates itself; a relayer ships per environment
28
+ * and does not, so the bridge is routinely NEWER than the relayer it dials —
29
+ * 0.0.14-dev.0 against prod and staging on 0.0.13, which is GH #928. The
30
+ * cold-start list is served before any relayer capability is known, so every
31
+ * name in it that the dialled relayer does not serve is a tool the agent can
32
+ * be told about and then cannot call.
33
+ *
34
+ * Cold start is therefore a FLOOR, not a forecast: add a name here only once
35
+ * the tool has shipped to prod, never when it lands on dev. Newer tools reach
36
+ * the client a beat later anyway — the relayer's own `tools/list` replaces
37
+ * this one and `notifications/tools/list_changed` tells the client to re-read
38
+ * it. `memwal_remember_status` is the worked example: it exists on dev, not on
39
+ * prod/staging, and belongs here only after a prod release carries it. */
40
+ export declare const BASELINE_RELAYER_TOOLS: ReadonlySet<string>;
41
+ /** Every tool this bridge can describe, baseline or not. Only the baseline
42
+ * subset is advertised at cold start; this is what the schema tests pin, so a
43
+ * newer tool's shape stays reviewed while it waits for a prod release. */
44
+ export declare const ALL_TOOL_DEFINITIONS: ({
45
+ name: string;
46
+ title: string;
47
+ annotations: {
48
+ readOnlyHint: boolean;
49
+ destructiveHint: boolean;
50
+ };
51
+ description: string;
52
+ inputSchema: {
53
+ type: string;
54
+ properties: {
55
+ text: {
56
+ type: string;
57
+ minLength: number;
58
+ };
59
+ namespace: {
60
+ type: string;
61
+ minLength?: undefined;
62
+ };
63
+ facts?: undefined;
64
+ job_id?: undefined;
65
+ job_ids?: undefined;
66
+ waitMs?: undefined;
67
+ query?: undefined;
68
+ limit?: undefined;
69
+ maxDistance?: undefined;
70
+ };
71
+ required: string[];
72
+ additionalProperties: boolean;
73
+ };
74
+ } | {
75
+ name: string;
76
+ title: string;
77
+ annotations: {
78
+ readOnlyHint: boolean;
79
+ destructiveHint: boolean;
80
+ };
81
+ description: string;
82
+ inputSchema: {
83
+ type: string;
84
+ properties: {
85
+ facts: {
86
+ type: string;
87
+ items: {
88
+ type: string;
89
+ minLength: number;
90
+ };
91
+ minItems: number;
92
+ maxItems: number;
93
+ };
94
+ namespace: {
95
+ type: string;
96
+ minLength?: undefined;
97
+ };
98
+ text?: undefined;
99
+ job_id?: undefined;
100
+ job_ids?: undefined;
101
+ waitMs?: undefined;
102
+ query?: undefined;
103
+ limit?: undefined;
104
+ maxDistance?: undefined;
105
+ };
106
+ required: string[];
107
+ additionalProperties: boolean;
108
+ };
109
+ } | {
110
+ name: string;
111
+ title: string;
112
+ annotations: {
113
+ readOnlyHint: boolean;
114
+ destructiveHint: boolean;
115
+ };
116
+ description: string;
117
+ inputSchema: {
118
+ type: string;
119
+ properties: {
120
+ job_id: {
121
+ type: string;
122
+ minLength: number;
123
+ };
124
+ job_ids: {
125
+ type: string;
126
+ items: {
127
+ type: string;
128
+ minLength: number;
129
+ };
130
+ minItems: number;
131
+ maxItems: number;
132
+ };
133
+ waitMs: {
134
+ type: string;
135
+ minimum: number;
136
+ maximum: number;
137
+ default: number;
138
+ };
139
+ text?: undefined;
140
+ namespace?: undefined;
141
+ facts?: undefined;
142
+ query?: undefined;
143
+ limit?: undefined;
144
+ maxDistance?: undefined;
145
+ };
146
+ additionalProperties: boolean;
147
+ required?: undefined;
148
+ };
149
+ } | {
150
+ name: string;
151
+ title: string;
152
+ annotations: {
153
+ readOnlyHint: boolean;
154
+ destructiveHint: boolean;
155
+ };
156
+ description: string;
157
+ inputSchema: {
158
+ type: string;
159
+ properties: {
160
+ query: {
161
+ type: string;
162
+ minLength: number;
163
+ };
164
+ limit: {
165
+ type: string;
166
+ minimum: number;
167
+ maximum: number;
168
+ default: number;
169
+ };
170
+ namespace: {
171
+ type: string;
172
+ minLength?: undefined;
173
+ };
174
+ maxDistance: {
175
+ type: string;
176
+ minimum: number;
177
+ description: string;
178
+ };
179
+ text?: undefined;
180
+ facts?: undefined;
181
+ job_id?: undefined;
182
+ job_ids?: undefined;
183
+ waitMs?: undefined;
184
+ };
185
+ required: string[];
186
+ additionalProperties: boolean;
187
+ };
188
+ } | {
189
+ name: string;
190
+ title: string;
191
+ annotations: {
192
+ readOnlyHint: boolean;
193
+ destructiveHint: boolean;
194
+ };
195
+ description: string;
196
+ inputSchema: {
197
+ type: string;
198
+ properties: {
199
+ namespace: {
200
+ type: string;
201
+ minLength: number;
202
+ };
203
+ limit: {
204
+ type: string;
205
+ minimum: number;
206
+ maximum: number;
207
+ default: number;
208
+ };
209
+ text?: undefined;
210
+ facts?: undefined;
211
+ job_id?: undefined;
212
+ job_ids?: undefined;
213
+ waitMs?: undefined;
214
+ query?: undefined;
215
+ maxDistance?: undefined;
216
+ };
217
+ required: string[];
218
+ additionalProperties: boolean;
219
+ };
220
+ } | {
221
+ name: string;
222
+ title: string;
223
+ annotations: {
224
+ readOnlyHint: boolean;
225
+ destructiveHint: boolean;
226
+ };
227
+ description: string;
228
+ inputSchema: {
229
+ type: string;
230
+ properties: {
231
+ text?: undefined;
232
+ namespace?: undefined;
233
+ facts?: undefined;
234
+ job_id?: undefined;
235
+ job_ids?: undefined;
236
+ waitMs?: undefined;
237
+ query?: undefined;
238
+ limit?: undefined;
239
+ maxDistance?: undefined;
240
+ };
241
+ additionalProperties: boolean;
242
+ required?: undefined;
243
+ };
244
+ })[];
25
245
  /** Signed-in cold-start list (bridge). Credentials exist; the relayer session
26
246
  * is not up yet. Proactive wording so clients that keep the first tools/list
27
247
  * still save/recall without being asked. */
@@ -1 +1 @@
1
- {"version":3,"file":"auth-required.d.ts","sourceRoot":"","sources":["../src/auth-required.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAiLzE;;4CAE4C;AAC5C,eAAO,MAAM,gBAAgB;;;;;;;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EAAE,CAAC;CAC1B;AAwID;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,qBAAqB,CACvC,MAAM,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAgE7B"}
@@ -29,7 +29,7 @@ import { startOrReuseLoginFlow, resolveLoginTimeoutMs } from "./login.js";
29
29
  import { AUTH_REQUIRED_INSTRUCTIONS } from "./instructions.js";
30
30
  import { MEMWAL_MCP_VERSION } from "./version.js";
31
31
  const SIGNED_OUT_REMEMBER = "Save a fact to the user's Walrus Memory personal memory. Call ONLY when the user explicitly asks to remember/save something. Pass the full, detailed text — never summarize.";
32
- const SIGNED_IN_REMEMBER = "Save a durable fact about the user or project to their Walrus Memory. Call this PROACTIVELY whenever the user states a preference, decision, constraint, correction, identity detail, or recurring workflow — even if they did not say 'remember this'. Skip one-off tasks, the current file or bug, and small talk. Pass the full statement; do not summarize. To save several facts at once, use memwal_remember_bulk instead. A Walrus write takes 30-60s and this call waits for it, so a success carries a blob_id and means the fact is stored. If it outruns that budget you get a job_id and the fact is NOT yet saved say so rather than claiming it is stored, and resolve it with memwal_remember_status.";
32
+ const SIGNED_IN_REMEMBER = "Save a durable fact about the user or project to their Walrus Memory. Call this PROACTIVELY whenever the user states a preference, decision, constraint, correction, identity detail, or recurring workflow — even if they did not say 'remember this'. Skip one-off tasks, the current file or bug, and small talk. Pass the full statement; do not summarize. To save several facts at once, use memwal_remember_bulk instead. By default this returns in ~1s once the relayer has accepted the job (job_id) the Walrus write is still in flight and the fact is NOT stored yet. Do not claim it is saved. Settle it with the job-status tool this server advertises (re-list tools if you do not see one). A blob_id in the same reply means it already stored (optional wait budget).";
33
33
  const SIGNED_OUT_RECALL = "Search the user's Walrus Memory for facts relevant to a query. Returns matching memories ranked by relevance.";
34
34
  const SIGNED_IN_RECALL = "Search the user's Walrus Memory for relevant facts before responding. Call this PROACTIVELY at the start of a task, or whenever the user references past work, prior decisions, their preferences, or anything you may have stored earlier — don't wait to be asked. A single focused query is usually enough — recall is a real retrieval over encrypted storage, so do NOT fire multiple redundant searches for the same question. Returns matching memories ranked by relevance.";
35
35
  /** Build the static memory-tool list. `proactive` is true for the signed-in
@@ -56,7 +56,7 @@ function buildToolDefinitions(proactive) {
56
56
  name: "memwal_remember_bulk",
57
57
  title: "Remember Multiple Facts",
58
58
  annotations: { readOnlyHint: false, destructiveHint: false },
59
- description: "Save multiple durable facts in one call. Use when you learned several distinct facts at once (onboarding details, a list of preferences, decisions from a discussion). Pass an array of complete fact statements (max 20) — do not summarize. Prefer this over repeated memwal_remember calls. A Walrus write takes 30-60s and this call waits for them, so a success carries blob_ids and means the facts are stored. If they outrun that budget you get job_ids and the facts are NOT yet saved say they are being saved rather than stored, and resolve them with memwal_remember_status.",
59
+ description: "Save multiple durable facts in one call. Use when you learned several distinct facts at once (onboarding details, a list of preferences, decisions from a discussion). Pass an array of complete fact statements (max 20) — do not summarize. Prefer this over repeated memwal_remember calls. By default this returns in ~1s once the relayer has accepted the batch (job_ids) the Walrus writes are still in flight and the facts are NOT stored yet. Do not claim they are saved. Settle them with the job-status tool this server advertises (re-list tools if you do not see one). A blob_id in the same reply means that fact already stored (optional wait budget).",
60
60
  inputSchema: {
61
61
  type: "object",
62
62
  properties: {
@@ -175,14 +175,48 @@ function buildToolDefinitions(proactive) {
175
175
  },
176
176
  ];
177
177
  }
178
+ /** Tool names the OLDEST relayer this bridge still talks to serves.
179
+ *
180
+ * The bridge ships on npm and updates itself; a relayer ships per environment
181
+ * and does not, so the bridge is routinely NEWER than the relayer it dials —
182
+ * 0.0.14-dev.0 against prod and staging on 0.0.13, which is GH #928. The
183
+ * cold-start list is served before any relayer capability is known, so every
184
+ * name in it that the dialled relayer does not serve is a tool the agent can
185
+ * be told about and then cannot call.
186
+ *
187
+ * Cold start is therefore a FLOOR, not a forecast: add a name here only once
188
+ * the tool has shipped to prod, never when it lands on dev. Newer tools reach
189
+ * the client a beat later anyway — the relayer's own `tools/list` replaces
190
+ * this one and `notifications/tools/list_changed` tells the client to re-read
191
+ * it. `memwal_remember_status` is the worked example: it exists on dev, not on
192
+ * prod/staging, and belongs here only after a prod release carries it. */
193
+ export const BASELINE_RELAYER_TOOLS = new Set([
194
+ "memwal_remember",
195
+ "memwal_remember_bulk",
196
+ "memwal_recall",
197
+ "memwal_analyze",
198
+ "memwal_restore",
199
+ "memwal_health",
200
+ ]);
201
+ /** Served by this process, so no relayer has to know about it. Advertising it
202
+ * at cold start is always safe. */
203
+ const LOCALLY_SERVED_TOOLS = new Set(["memwal_login"]);
204
+ /** Every tool this bridge can describe, baseline or not. Only the baseline
205
+ * subset is advertised at cold start; this is what the schema tests pin, so a
206
+ * newer tool's shape stays reviewed while it waits for a prod release. */
207
+ export const ALL_TOOL_DEFINITIONS = buildToolDefinitions(true);
208
+ /** Drop anything the oldest supported relayer would not serve. */
209
+ function coldStartTools(proactive) {
210
+ return buildToolDefinitions(proactive).filter((t) => BASELINE_RELAYER_TOOLS.has(t.name) || LOCALLY_SERVED_TOOLS.has(t.name));
211
+ }
178
212
  /** Signed-in cold-start list (bridge). Credentials exist; the relayer session
179
213
  * is not up yet. Proactive wording so clients that keep the first tools/list
180
214
  * still save/recall without being asked. */
181
- export const TOOL_DEFINITIONS = buildToolDefinitions(true);
215
+ export const TOOL_DEFINITIONS = coldStartTools(true);
182
216
  /** Signed-out list (auth-required). No credentials, so every memory call
183
217
  * fails: keep conservative wording or the model will spam remember and get
184
218
  * a stream of auth errors. */
185
- export const SIGNED_OUT_TOOL_DEFINITIONS = buildToolDefinitions(false);
219
+ export const SIGNED_OUT_TOOL_DEFINITIONS = coldStartTools(false);
186
220
  /** How long to wait for the local listener to bind + emit its URL before we
187
221
  * give up and return an error. Should be near-instant; 5s is paranoia. */
188
222
  const URL_READY_TIMEOUT_MS = 5_000;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-required.js","sourceRoot":"","sources":["../src/auth-required.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;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,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC"}
package/dist/auth.d.ts CHANGED
@@ -21,25 +21,163 @@ export interface MemWalCredentials {
21
21
  version: 1;
22
22
  }
23
23
  /**
24
- * Which credentials file this process should read and write.
24
+ * Refusal of a `MEMWAL_CREDS_DIR` that cannot be trusted to sit outside a
25
+ * repository. Thrown, never swallowed — see {@link credsDirOverride}.
26
+ */
27
+ export declare class UntrustedCredsDirError extends Error {
28
+ constructor(message: string);
29
+ }
30
+ /** The approval store. Outside every repository, on purpose. */
31
+ export declare function projectApprovalsPath(): string;
32
+ /**
33
+ * What approval is granted against: the destination, not the file's bytes.
25
34
  *
26
- * The nearest project-local `.memwal/credentials.json` at or above the working
27
- * directory wins over the global one, the way `.npmrc` and `.git/config`
28
- * resolve. Signing in from one project otherwise repoints every other project
29
- * on the machine at a different account and delegate key, silently — memories
30
- * then land on the wrong account, on immutable storage, with no delete path
31
- * (GH #628).
35
+ * Account, delegate and relayer are the three fields that decide WHERE a
36
+ * memory ends up and WHO signs for it. Hashing them means a project file may
37
+ * be re-saved, relabelled or reformatted freely, while any edit that moves the
38
+ * destination invalidates the approval and has to be approved again. The
39
+ * delegate private key is deliberately NOT part of it it must never be read
40
+ * into a record that gets written back out.
41
+ */
42
+ export declare function credentialsFingerprint(creds: {
43
+ accountId: string;
44
+ delegateAddress: string;
45
+ relayerUrl: string;
46
+ }): string;
47
+ /** One approved project credentials file. Contains no secret. */
48
+ export interface ProjectApproval {
49
+ /** Canonical path of the approved `.memwal/credentials.json`. */
50
+ path: string;
51
+ fingerprint: string;
52
+ accountId: string;
53
+ delegateAddress: string;
54
+ relayerUrl: string;
55
+ approvedAt: string;
56
+ }
57
+ /** Why a project credentials file was, or was not, used. */
58
+ export type ProjectCredsDecision =
59
+ /** Approved for exactly this account + delegate + relayer: in use. */
60
+ "approved"
61
+ /** Never approved on this machine. Ignored. */
62
+ | "unapproved"
63
+ /** Approved once, but the destination has since changed. Ignored. */
64
+ | "changed"
65
+ /** Present but not valid credentials, so there is nothing to approve. */
66
+ | "unreadable";
67
+ export interface ProjectCredsInfo {
68
+ /** The project-local file that was found. */
69
+ path: string;
70
+ decision: ProjectCredsDecision;
71
+ /** Destination it points at. Absent when the file could not be read — and
72
+ * never the delegate private key, which no caller of this ever needs. */
73
+ accountId?: string;
74
+ relayerUrl?: string;
75
+ }
76
+ /** Which file won, and what happened to any project-local file that did not. */
77
+ export interface CredsResolution {
78
+ /** The file this process reads and writes. */
79
+ path: string;
80
+ source: "override" | "project" | "global";
81
+ /** The project-local file found by the walk, if any — present whether or
82
+ * not it was used, so callers can report one they ignored. */
83
+ project?: ProjectCredsInfo;
84
+ }
85
+ /**
86
+ * Which credentials file this process should read and write, and why.
32
87
  *
33
- * Presence-based on purpose: creating the local file is the opt-in, so this is
34
- * purely additive. Resolved per call rather than at module load, because the
35
- * working directory is not knowable at import time.
88
+ * `MEMWAL_CREDS_DIR` wins outright, and skips the approval gate but only a
89
+ * value {@link credsDirOverride} accepts, i.e. a non-empty ABSOLUTE path
90
+ * outside the current project. It is "trusted" exactly as far as whoever set
91
+ * the environment is, and an MCP client will hand this process an `env` block
92
+ * it read out of the checkout, so a value that could have been committed is
93
+ * refused rather than obeyed. Otherwise the nearest project-local
94
+ * `.memwal/credentials.json` at or above the working directory is used IF the
95
+ * user has approved that exact destination on this machine (WALM-639), and the
96
+ * global file is used in every other case — including an unapproved, altered
97
+ * or malformed project file. Falling back rather than failing keeps a machine
98
+ * that has never seen a project file behaving exactly as it always did.
36
99
  *
37
- * `MEMWAL_CREDS_DIR` overrides both project and global resolution when set,
38
- * and is re-read on every call.
100
+ * Resolved per call rather than at module load, because neither the working
101
+ * directory nor the approval store is knowable at import time.
39
102
  */
103
+ export declare function resolveCreds(): CredsResolution;
104
+ /** The credentials file in use. Thin wrapper over {@link resolveCreds} so the
105
+ * many callers that only need a path are unchanged. */
40
106
  export declare function credsPath(): string;
41
107
  /** Load credentials from disk. Returns null if missing or malformed. */
42
108
  export declare function loadCreds(): MemWalCredentials | null;
109
+ /** What {@link approveProjectCreds} did. */
110
+ export interface ApproveProjectResult {
111
+ outcome:
112
+ /** Newly approved. */
113
+ "approved"
114
+ /** Approved again after the destination changed. */
115
+ | "reapproved"
116
+ /** Already approved for this exact destination; nothing written. */
117
+ | "already-approved"
118
+ /** No project-local credentials file at or above the working directory. */
119
+ | "none"
120
+ /** A project file exists but is not valid credentials. */
121
+ | "unreadable"
122
+ /** `MEMWAL_CREDS_DIR` is set, so project resolution never runs. */
123
+ | "overridden";
124
+ projectPath?: string;
125
+ accountId?: string;
126
+ relayerUrl?: string;
127
+ /** Destination the previous approval covered, when this replaced one. */
128
+ previousAccountId?: string;
129
+ previousRelayerUrl?: string;
130
+ approvalsPath: string;
131
+ }
132
+ /**
133
+ * Approve the project-local credentials found from the working directory.
134
+ *
135
+ * Deliberately takes no arguments: it approves what resolution would otherwise
136
+ * ignore, from the same directory, so "what am I approving" and "what will be
137
+ * used" cannot drift apart.
138
+ */
139
+ export declare function approveProjectCreds(): ApproveProjectResult;
140
+ /** What {@link revokeProjectCredsApproval} did. */
141
+ export interface RevokeProjectResult {
142
+ outcome: "revoked" | "none";
143
+ projectPath?: string;
144
+ approvalsPath: string;
145
+ }
146
+ /**
147
+ * Withdraw the approval for the project-local credentials here.
148
+ *
149
+ * Keyed on the path rather than on the file's current contents, so an approval
150
+ * can be withdrawn even after the file it covered was edited or deleted — a
151
+ * revoke that only worked while the destination still matched would be
152
+ * useless exactly when it is wanted.
153
+ */
154
+ export declare function revokeProjectCredsApproval(): RevokeProjectResult;
155
+ /**
156
+ * The warning for a project credentials file that was found and NOT used, or
157
+ * null when there is nothing to report.
158
+ *
159
+ * Says which file was ignored, where memory is going instead, and the exact
160
+ * command that approves it — a silent fallback would be the mirror image of
161
+ * the silent redirect this gate exists to stop. Never contains a key: the only
162
+ * fields it reads are the account id and the relayer URL.
163
+ */
164
+ export declare function formatProjectCredsNotice(resolution?: CredsResolution): string | null;
165
+ /**
166
+ * What approving a project credentials file costs, beyond redirecting reads.
167
+ *
168
+ * Approval does not just decide which file is READ — it decides which file is
169
+ * WRITTEN. `saveCreds` writes to `credsPath()`, so from here on every sign-in
170
+ * from this project puts a fresh 64-hex Ed25519 delegate seed, in plaintext,
171
+ * into a directory that is inside the repository. An attacker who planted the
172
+ * file planted the directory too, so it is already tracked rather than ignored,
173
+ * and `git add -A` stages the key. The user cannot weigh that if nobody says
174
+ * it, and "you approved a destination" is not the same sentence as "you
175
+ * approved storing a private key in your repo".
176
+ *
177
+ * Separate from {@link formatProjectCredsNotice} on purpose: that one is about
178
+ * a file that was IGNORED, this one is about a file that is about to be used.
179
+ */
180
+ export declare function formatProjectCredsStorageWarning(projectPath: string): string;
43
181
  /**
44
182
  * Write credentials with secure (`0600`) permission, to whichever file
45
183
  * `credsPath()` resolves to.
@@ -102,6 +240,11 @@ export interface SaveCredsResult {
102
240
  * callback arrives, by which point a delegate key has already been registered
103
241
  * on-chain — so a warning that waits for both ids is a warning that arrives
104
242
  * too late to act on.
243
+ *
244
+ * When the file being replaced is an approved project one, that is also the
245
+ * last moment before a new private key lands inside a repository, so the
246
+ * storage warning is repeated here rather than left behind at approval time —
247
+ * approval may have been months ago, or done by someone else on the machine.
105
248
  */
106
249
  export declare function formatPendingSignInWarning(): string | null;
107
250
  /**
@@ -156,8 +299,26 @@ export interface PendingLogin {
156
299
  createdAt: string;
157
300
  version: 1;
158
301
  }
159
- /** Sits beside whichever credentials file `credsPath()` resolves to, so a
160
- * project-local sign-in recovers into that same project. */
302
+ /**
303
+ * Where the write-ahead record lives never inside a repository.
304
+ *
305
+ * It used to sit beside whichever credentials file `credsPath()` resolved to,
306
+ * which reads as "recover into the project you signed in from" and is the right
307
+ * intent. But for an approved project that path is `<repo>/.memwal/`, so every
308
+ * sign-in dropped a plaintext 64-hex delegate seed into the working tree —
309
+ * under a directory an attacker who planted the credentials file had already
310
+ * created, so tracked rather than ignored, and staged by `git add -A`.
311
+ *
312
+ * Nothing about this record needs to be in the repo. It is short-lived
313
+ * handshake state, nobody edits it by hand, and the only property that matters
314
+ * is that the project which started a sign-in is the one that can reclaim it.
315
+ * So it moves to the trusted state directory, keyed by a hash of the
316
+ * credentials path: same per-project scoping, no key material in the checkout.
317
+ *
318
+ * The non-project cases are byte-for-byte where they always were —
319
+ * `dirname(credsPath())` IS `trustedStateDir()` for both the override and the
320
+ * global file — so a machine that has never approved a project sees no change.
321
+ */
161
322
  export declare function pendingLoginPath(): string;
162
323
  /**
163
324
  * Persist the pending keypair. Throws if it cannot.
@@ -168,10 +329,10 @@ export declare function pendingLoginPath(): string;
168
329
  * the connect URL while claiming a durability that does not exist — the
169
330
  * original WALM-332 loss, now silent.
170
331
  *
171
- * Failing the login costs the user nothing: this file sits beside
172
- * `credentials.json`, so a directory that cannot take it cannot take the
173
- * credentials either. The same login would have failed at the callback anyway,
174
- * one on-chain `add_delegate_key` later.
332
+ * Failing the login costs the user nothing: this file lives in the same
333
+ * trusted state directory the approval record does, so a directory that cannot
334
+ * take it is one this process cannot keep state in at all. The same login would
335
+ * have failed at the callback anyway, one on-chain `add_delegate_key` later.
175
336
  */
176
337
  export declare function savePendingLogin(pending: PendingLogin): void;
177
338
  /**