@veilio-inc/mcp 0.1.0 → 0.3.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/LICENSE +30 -5
- package/README.md +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/namespace.d.ts +70 -0
- package/dist/namespace.d.ts.map +1 -0
- package/dist/namespace.js +268 -0
- package/dist/namespace.js.map +1 -0
- package/dist/rules.d.ts +15 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +75 -0
- package/dist/rules.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -1
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +86 -5
- package/dist/tools.js.map +1 -1
- package/package.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Veilio Community License
|
|
2
2
|
|
|
3
|
-
_Version 1.
|
|
3
|
+
_Version 1.1 · Effective 2026-09-25_
|
|
4
4
|
|
|
5
5
|
**Copyright © 2026 Veilio**
|
|
6
6
|
|
|
@@ -10,7 +10,8 @@ _Version 1.0 · Effective 2026-08-08_
|
|
|
10
10
|
> The one thing you may not do without written permission is sell Veilio itself:
|
|
11
11
|
> reselling it, white-labeling it, or running it as a hosted service for other
|
|
12
12
|
> people. Contributions are welcome. For a commercial or redistribution license,
|
|
13
|
-
> email `hello@veilio.dev`.
|
|
13
|
+
> email `hello@veilio.dev`. Veilio is not licensed for use in or from Russia or
|
|
14
|
+
> Belarus, or by sanctioned persons (Section 5A).
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
|
|
@@ -48,11 +49,17 @@ For the purposes of this License:
|
|
|
48
49
|
|
|
49
50
|
**"Competing Product"** means a commercially offered product or service whose primary purpose and core functionality substantially overlap with the Software or Cloud Edition.
|
|
50
51
|
|
|
52
|
+
**"Applicable Sanctions"** means any economic, financial, trade or other restrictive measures applicable to Veilio or the relevant transaction under the laws of the European Union or the Republic of Poland, including applicable asset-freezing and prohibition-on-making-available measures, and any other sanctions or trade restrictions that are legally binding on Veilio.
|
|
53
|
+
|
|
54
|
+
**"Restricted Person"** means any natural or legal person, entity or body that: (a) is designated or otherwise subject to restrictive measures under Applicable Sanctions, (b) is directly or indirectly owned or controlled by such a person, entity or body, (c) acts on behalf of or at the direction of such a person, entity or body; or (d) is otherwise a person to whom Veilio is prohibited under Applicable Sanctions from providing the Software, funds or economic resources.
|
|
55
|
+
|
|
56
|
+
**"Restricted Territory"** means the Russian Federation and the Republic of Belarus.
|
|
57
|
+
|
|
51
58
|
---
|
|
52
59
|
|
|
53
60
|
## 3. Permissions
|
|
54
61
|
|
|
55
|
-
Subject to the restrictions in this License, you are granted a worldwide, royalty-free, non-exclusive license to:
|
|
62
|
+
Subject to the restrictions in this License, including Section 5A, you are granted a worldwide, royalty-free, non-exclusive license to:
|
|
56
63
|
|
|
57
64
|
* use the Software for personal purposes;
|
|
58
65
|
* use the Software for internal commercial purposes;
|
|
@@ -114,6 +121,24 @@ Requests for written permission may be sent to `hello@veilio.dev`.
|
|
|
114
121
|
|
|
115
122
|
---
|
|
116
123
|
|
|
124
|
+
## 5A. Restricted Territories and Sanctions
|
|
125
|
+
|
|
126
|
+
**5A.1.** No license or other right to the Software is granted to:
|
|
127
|
+
|
|
128
|
+
* persons or entities incorporated, registered, established or headquartered in a Restricted Territory;
|
|
129
|
+
* natural persons whose principal place of business or ordinary residence is in a Restricted Territory; or
|
|
130
|
+
* Restricted Persons.
|
|
131
|
+
|
|
132
|
+
**5A.2.** You must not access or use the Software from a Restricted Territory, make the Software available to any person located in a Restricted Territory, or use the Software directly or indirectly for the benefit of a Restricted Person or a person or entity incorporated, registered, established or headquartered in a Restricted Territory.
|
|
133
|
+
|
|
134
|
+
**5A.3.** By using the Software, you represent and warrant, both when you first use it and throughout your use of it, that you are not a Restricted Person and do not fall within any of the territorial restrictions set out in this Section.
|
|
135
|
+
|
|
136
|
+
**5A.4.** You must not use an intermediary, affiliate, nominee, proxy, VPN or other arrangement for the purpose of circumventing the restrictions set out in this Section or Applicable Sanctions.
|
|
137
|
+
|
|
138
|
+
**5A.5.** Any breach of this Section is a material violation of this License and terminates your rights under it (Section 14). Veilio does not grant written permission for exceptions to this Section.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
117
142
|
## 6. Cloud Edition
|
|
118
143
|
|
|
119
144
|
The Cloud Edition is the official commercial hosted offering of the project.
|
|
@@ -218,7 +243,7 @@ TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL THE AUTHORS
|
|
|
218
243
|
|
|
219
244
|
## 14. Termination
|
|
220
245
|
|
|
221
|
-
Your rights under this License terminate automatically if you materially violate its terms.
|
|
246
|
+
Your rights under this License terminate automatically if you materially violate its terms. Any breach of Section 5A is a material violation.
|
|
222
247
|
|
|
223
248
|
Upon termination, you must cease the activities that are prohibited by this License.
|
|
224
249
|
|
|
@@ -244,5 +269,5 @@ Each version will be identified by a version number. Unless explicitly stated ot
|
|
|
244
269
|
|
|
245
270
|
**Project:** Veilio
|
|
246
271
|
**Copyright:** © 2026 Veilio
|
|
247
|
-
**License:** Veilio Community License, Version 1.
|
|
272
|
+
**License:** Veilio Community License, Version 1.1
|
|
248
273
|
**Contact:** `hello@veilio.dev`
|
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ tools/call anonymize_file { "path": "src/gateway.ts" }
|
|
|
14
14
|
→ Source: src/gateway.ts
|
|
15
15
|
Language: TypeScript / JavaScript
|
|
16
16
|
Placeholders in map: 7
|
|
17
|
+
Namespace: local
|
|
17
18
|
Credentials detected — 1 critical:
|
|
18
19
|
critical line 2:24 Stripe secret key — sk_l…MNOP (31 chars) (redacted, not recoverable)
|
|
19
20
|
|
|
@@ -36,6 +37,8 @@ tools/call anonymize_file { "path": "src/gateway.ts" }
|
|
|
36
37
|
| `scan_secrets` | Detect credentials without modifying anything, and without putting the values in context. |
|
|
37
38
|
| `symbol_map_summary` | Placeholder counts by kind. Returns keys only, never real names. |
|
|
38
39
|
|
|
40
|
+
Setup for Claude Code, Claude Desktop, Xcode, Cursor and VS Code, plus troubleshooting: [docs/USING-THE-CLI-AND-MCP.md](../../docs/USING-THE-CLI-AND-MCP.md).
|
|
41
|
+
|
|
39
42
|
## Install
|
|
40
43
|
|
|
41
44
|
```jsonc
|
|
@@ -52,6 +55,27 @@ tools/call anonymize_file { "path": "src/gateway.ts" }
|
|
|
52
55
|
|
|
53
56
|
`--root <dir>` scopes every path the server will read; `--map <path>` overrides the symbol-map location. Paths outside the root are refused — the server reads files on the agent's behalf, so traversal would make it an arbitrary-file-read primitive.
|
|
54
57
|
|
|
58
|
+
## Team namespace (Team plan and above)
|
|
59
|
+
|
|
60
|
+
Sign in once with the `veilio` CLI — `veilio login` — and every anonymize
|
|
61
|
+
result from this server states which namespace produced its placeholders:
|
|
62
|
+
|
|
63
|
+
- **`team`** — resolved against the team's shared dictionary, fetched from
|
|
64
|
+
Cloud once at startup and reused for the life of the process, so every
|
|
65
|
+
teammate's agent produces the same placeholder for the same identifier.
|
|
66
|
+
- **`local`** — resolved locally: never signed in, offline, or the plan
|
|
67
|
+
doesn't include shared dictionaries. This is the normal, fully-functional
|
|
68
|
+
state for anyone not on a paid team — the server never blocks on it, and
|
|
69
|
+
the fallback is always stated, never silent.
|
|
70
|
+
|
|
71
|
+
There is no separate sign-in for the MCP server; it reads the same credential
|
|
72
|
+
file `veilio login` already wrote.
|
|
73
|
+
|
|
74
|
+
The account's custom rules are fetched at startup the same way and applied to
|
|
75
|
+
every anonymize call. Each result states their source: `from Cloud`, `cached`
|
|
76
|
+
(Cloud did not answer, so the last `veilio rules pull` is used, with its age),
|
|
77
|
+
or `none`.
|
|
78
|
+
|
|
55
79
|
## Design properties
|
|
56
80
|
|
|
57
81
|
- **Zero runtime dependencies.** JSON-RPC framing is implemented directly. Pulling a transitive tree into the component that reads your source would undercut the product's own claim.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACrF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// here corrupts the protocol and the client drops the connection. Diagnostics
|
|
6
6
|
// go to stderr, which MCP clients surface as server logs.
|
|
7
7
|
import { FrameReader } from './server.js';
|
|
8
|
+
import { primeNamespace } from './namespace.js';
|
|
9
|
+
import { primeRules } from './rules.js';
|
|
8
10
|
export { FrameReader, handleFrame, handleMessage, SERVER_VERSION } from './server.js';
|
|
9
11
|
export { TOOLS, callTool } from './tools.js';
|
|
10
12
|
function parseCliContext(argv) {
|
|
@@ -20,18 +22,23 @@ function parseCliContext(argv) {
|
|
|
20
22
|
}
|
|
21
23
|
return { cwd, mapPath };
|
|
22
24
|
}
|
|
23
|
-
function start() {
|
|
25
|
+
async function start() {
|
|
24
26
|
const ctx = parseCliContext(process.argv.slice(2));
|
|
25
27
|
const send = (response) => {
|
|
26
28
|
process.stdout.write(`${JSON.stringify(response)}\n`);
|
|
27
29
|
};
|
|
28
30
|
const reader = new FrameReader(ctx, send);
|
|
31
|
+
// Resolved once, before a single byte of stdin is read, so every tool call
|
|
32
|
+
// for the rest of this process sees the answer already settled rather than
|
|
33
|
+
// racing the first one in (contracts/shared-namespace.md R-007). Never
|
|
34
|
+
// throws — see namespace.ts — so this can only delay startup, not fail it.
|
|
35
|
+
await Promise.all([primeNamespace(), primeRules()]);
|
|
29
36
|
process.stdin.setEncoding('utf8');
|
|
30
37
|
process.stdin.on('data', (chunk) => reader.push(chunk));
|
|
31
38
|
process.stdin.on('end', () => process.exit(0));
|
|
32
39
|
process.stderr.write(`veilio-mcp: serving ${ctx.cwd}\n`);
|
|
33
40
|
}
|
|
34
41
|
if (process.argv[1] !== undefined && import.meta.url === `file://${process.argv[1]}`) {
|
|
35
|
-
start();
|
|
42
|
+
void start();
|
|
36
43
|
}
|
|
37
44
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,0BAA0B;AAC1B,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,0BAA0B;AAC1B,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACrF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE5C,SAAS,eAAe,CAAC,IAAuB;IAC9C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IACvB,IAAI,OAAO,GAAkB,IAAI,CAAA;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAA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AAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,GAAG,CAAC,GAAG,IAAI,CAAC,CAAA;AAC1D,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACrF,KAAK,KAAK,EAAE,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type TeamMapEntry } from '@veilio-inc/engine';
|
|
2
|
+
export type NamespaceSource = 'team' | 'local';
|
|
3
|
+
export interface ResolvedNamespace {
|
|
4
|
+
source: NamespaceSource;
|
|
5
|
+
/** Placeholder -> identifier. Empty for 'local' — there is nothing to merge. */
|
|
6
|
+
namespace: Record<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* Placeholders the team's saved maps give DIFFERENT identifiers (maps saved
|
|
9
|
+
* before Cloud reserved numbers - spec 017). Left out of `namespace`, so this
|
|
10
|
+
* server never emits one, and `restore_text` refuses to guess them.
|
|
11
|
+
*/
|
|
12
|
+
conflicts: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Highest number per placeholder base in ANY readable team map, conflicts
|
|
15
|
+
* included. New names are numbered above it, so this server never hands a
|
|
16
|
+
* new identifier a number the team already uses for something else.
|
|
17
|
+
*/
|
|
18
|
+
highest: Record<string, number>;
|
|
19
|
+
}
|
|
20
|
+
/** Highest number per base across every readable map. */
|
|
21
|
+
export declare function highestAcross(entries: readonly TeamMapEntry[]): Record<string, number>;
|
|
22
|
+
/** Placeholders that readable maps give more than one identifier. */
|
|
23
|
+
export declare function findConflicts(entries: readonly TeamMapEntry[]): string[];
|
|
24
|
+
/**
|
|
25
|
+
* Resolve the namespace once and cache it for the rest of the process.
|
|
26
|
+
*
|
|
27
|
+
* Concurrent callers share one in-flight fetch (R-007) rather than each firing
|
|
28
|
+
* their own request. `home` is injectable for tests; production leaves it
|
|
29
|
+
* undefined and `readCredential` falls back to the real home directory.
|
|
30
|
+
*/
|
|
31
|
+
export declare function primeNamespace(home?: string): Promise<ResolvedNamespace>;
|
|
32
|
+
/** The already-resolved namespace. `local` (with an empty namespace) until
|
|
33
|
+
* `primeNamespace` has been called and settled — the safe default for any
|
|
34
|
+
* caller that never primes, including every existing offline-only test. */
|
|
35
|
+
export declare function getNamespace(): ResolvedNamespace;
|
|
36
|
+
/** Test-only: forget the cached result so the next `primeNamespace` refetches. */
|
|
37
|
+
export declare function resetNamespaceCache(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Overlay a team namespace onto a local map, safely.
|
|
40
|
+
*
|
|
41
|
+
* Both are `Record<placeholder, identifier>`, and that similarity is a trap: the
|
|
42
|
+
* two placeholder spaces are numbered independently — the local map by this
|
|
43
|
+
* project's own engine, the team's by `mergeTeamNamespace` walking every
|
|
44
|
+
* member's own maps — so `__CLS__1` in one has no relation to `__CLS__1` in the
|
|
45
|
+
* other beyond coincidence. A blind `{ ...local, ...team }` merge treats that
|
|
46
|
+
* coincidence as identity: two different identifiers that happen to land on the
|
|
47
|
+
* same key collide, `saveMap` then refuses the write as data loss (or, worse,
|
|
48
|
+
* silently drops one identifier's real mapping if the guard is bypassed), and
|
|
49
|
+
* text already restored under the shadowed placeholder now resolves to the
|
|
50
|
+
* wrong name.
|
|
51
|
+
*
|
|
52
|
+
* So this reconciles by IDENTIFIER, which is the thing two teammates actually
|
|
53
|
+
* want to agree on, and it only ever ADDS to `local` — never overwrites an
|
|
54
|
+
* existing key, never introduces a second placeholder for an identifier `local`
|
|
55
|
+
* already has under a different one:
|
|
56
|
+
*
|
|
57
|
+
* - an identifier already known locally (under any placeholder) keeps its
|
|
58
|
+
* local placeholder — converging it to the team's would relabel every
|
|
59
|
+
* already-anonymized reference to it, which is not this call's to decide
|
|
60
|
+
* - a team entry whose placeholder KEY is already taken locally by a
|
|
61
|
+
* DIFFERENT identifier is dropped rather than forced in; that one
|
|
62
|
+
* identifier just doesn't converge with the team this round and gets a
|
|
63
|
+
* fresh local placeholder from the engine instead, which is a safe
|
|
64
|
+
* degradation, not a corruption
|
|
65
|
+
* - everything else — a team identifier neither known locally nor colliding
|
|
66
|
+
* on key — is added under the team's placeholder, which is the case two
|
|
67
|
+
* fresh sessions (T044) actually converge through
|
|
68
|
+
*/
|
|
69
|
+
export declare function mergeNamespace(local: Record<string, string>, team: Record<string, string>): Record<string, string>;
|
|
70
|
+
//# sourceMappingURL=namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"AA4BA,OAAO,EAKL,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAA;AAE3B,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAA;AAE9C,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,eAAe,CAAA;IACvB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;;;;OAIG;IACH,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAMD,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAStF;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,EAAE,CAUxE;AAkLD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAQxE;AAED;;4EAE4E;AAC5E,wBAAgB,YAAY,IAAI,iBAAiB,CAEhD;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// The team's shared placeholder namespace — fetched once per MCP session, with
|
|
2
|
+
// a fallback that is never silent (spec 005 US4, contracts/shared-namespace.md).
|
|
3
|
+
//
|
|
4
|
+
// A coding agent must keep working when Cloud is down, when the user never
|
|
5
|
+
// signed in, or when the plan does not include shared dictionaries. All three
|
|
6
|
+
// fall back to the local namespace identically. What must never happen is a
|
|
7
|
+
// SILENT fallback: two teammates' agents quietly disagreeing about placeholder
|
|
8
|
+
// names is indistinguishable from success until someone tries to share a map,
|
|
9
|
+
// which is exactly the failure Constitution V exists to prevent.
|
|
10
|
+
//
|
|
11
|
+
// Session lifetime here is process lifetime — an MCP server is spawned per
|
|
12
|
+
// client session — so the fetch happens once, at startup (`primeNamespace`,
|
|
13
|
+
// called from index.ts before stdin is wired up), and every tool handler reads
|
|
14
|
+
// the already-resolved result synchronously (`getNamespace`). This keeps the
|
|
15
|
+
// whole JSON-RPC pipeline (server.ts, tools.ts) synchronous rather than
|
|
16
|
+
// threading a Promise through 78 existing call sites for one network call that
|
|
17
|
+
// happens once per process.
|
|
18
|
+
import { readCredential } from '@veilio-inc/cli/credential';
|
|
19
|
+
import { CloudError, listMaps, getMap, getTeamEnvelopes, } from '@veilio-inc/cli/cloud';
|
|
20
|
+
import { readTeamUnlock } from '@veilio-inc/cli/team-unlock';
|
|
21
|
+
import { importTeamKey, decryptTeamMapWithAny, mergeTeamNamespace, } from '@veilio-inc/engine';
|
|
22
|
+
const LOCAL = { source: 'local', namespace: {}, conflicts: [], highest: {} };
|
|
23
|
+
const NUMBERED = /^(__[A-Z][A-Z0-9_]*__)(\d+)$/;
|
|
24
|
+
/** Highest number per base across every readable map. */
|
|
25
|
+
export function highestAcross(entries) {
|
|
26
|
+
const out = {};
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
for (const placeholder of Object.keys(entry.map ?? {})) {
|
|
29
|
+
const m = NUMBERED.exec(placeholder);
|
|
30
|
+
if (m && Number(m[2]) > (out[m[1]] ?? 0))
|
|
31
|
+
out[m[1]] = Number(m[2]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
/** Placeholders that readable maps give more than one identifier. */
|
|
37
|
+
export function findConflicts(entries) {
|
|
38
|
+
const meanings = new Map();
|
|
39
|
+
for (const entry of entries) {
|
|
40
|
+
for (const [placeholder, identifier] of Object.entries(entry.map ?? {})) {
|
|
41
|
+
const seen = meanings.get(placeholder) ?? new Set();
|
|
42
|
+
seen.add(identifier);
|
|
43
|
+
meanings.set(placeholder, seen);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return [...meanings].filter(([, seen]) => seen.size > 1).map(([p]) => p);
|
|
47
|
+
}
|
|
48
|
+
let current = LOCAL;
|
|
49
|
+
let priming = null;
|
|
50
|
+
/**
|
|
51
|
+
* Build the team namespace from maps this member can actually open.
|
|
52
|
+
*
|
|
53
|
+
* Cloud used to merge these server-side and send the result. It stopped,
|
|
54
|
+
* because merging meant decrypting every team map, and that was the only reason
|
|
55
|
+
* it held a key that could read them. So the merge happens here now, over maps
|
|
56
|
+
* only this member can decrypt, and the server holds nothing that would let it
|
|
57
|
+
* do the same (spec 010).
|
|
58
|
+
*
|
|
59
|
+
* Entitlement is still not decided here, and still does not need to be. Cloud
|
|
60
|
+
* serves team maps only for teams in `access.teams`, and refuses a non-member's
|
|
61
|
+
* request for a team key outright. A user outside a paid team gets neither, so
|
|
62
|
+
* there is nothing to merge — the gate is the data, not a flag this code reads.
|
|
63
|
+
*/
|
|
64
|
+
async function buildTeamNamespace(credential, keys, list) {
|
|
65
|
+
// A member's OWN team maps arrive under personalMaps — the listing splits by
|
|
66
|
+
// ownership, not by scope — so both lists have to be considered or this
|
|
67
|
+
// member's own placeholders drop out of the shared namespace.
|
|
68
|
+
const teamScoped = [...list.personalMaps, ...list.teamMaps].filter((m) => m.scope === 'team');
|
|
69
|
+
const entries = await readTeamEntries(credential, keys, teamScoped);
|
|
70
|
+
const merged = mergeTeamNamespace(entries);
|
|
71
|
+
// Every map unreadable is not a team namespace, it is a failed one. Saying
|
|
72
|
+
// `local` is honest; an empty `team` would claim agreement that is not there.
|
|
73
|
+
if (Object.keys(merged).length === 0)
|
|
74
|
+
return null;
|
|
75
|
+
const conflicts = findConflicts(entries);
|
|
76
|
+
const namespace = Object.fromEntries(Object.entries(merged).filter(([p]) => !conflicts.includes(p)));
|
|
77
|
+
return { namespace, conflicts, highest: highestAcross(entries) };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The team keys this machine has unlocked, if any.
|
|
81
|
+
*
|
|
82
|
+
* Read from disk rather than derived, because an MCP server starts inside a
|
|
83
|
+
* coding agent with nobody present to type a vault passphrase. `veilio team
|
|
84
|
+
* unlock` is the interactive run that puts them there; see the CLI's
|
|
85
|
+
* `team-unlock.ts` for what is stored and what it costs.
|
|
86
|
+
*
|
|
87
|
+
* Absent, expired, or belonging to another account all read the same way —
|
|
88
|
+
* nothing unlocked — because all three mean the same thing here.
|
|
89
|
+
*/
|
|
90
|
+
async function heldTeamKeys(credential, home, teamId) {
|
|
91
|
+
const unlock = readTeamUnlock({ instance: credential.instance, account: credential.account }, home);
|
|
92
|
+
if (!unlock)
|
|
93
|
+
return [];
|
|
94
|
+
// Unlocked for a different team than the one this account is currently in.
|
|
95
|
+
// Possible after leaving one team and joining another without re-unlocking.
|
|
96
|
+
if (unlock.teamId !== teamId)
|
|
97
|
+
return [];
|
|
98
|
+
const keys = [];
|
|
99
|
+
for (const stored of unlock.keys) {
|
|
100
|
+
try {
|
|
101
|
+
keys.push({ version: stored.version, key: await importTeamKey(stored.key) });
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// A damaged entry. Skipped rather than fatal, for the same reason an
|
|
105
|
+
// unopenable map is: the others may still carry the team's namespace.
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return keys;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Every team map, opened with the held keys. One request where Cloud offers it;
|
|
113
|
+
* one per map only for an instance that predates it (404). A failure of the
|
|
114
|
+
* single request is NOT turned into skipped maps: it throws, and the caller
|
|
115
|
+
* reports `local` - a namespace missing a teammate's newest map restored their
|
|
116
|
+
* placeholders wrong (found on staging, 2026-09-26).
|
|
117
|
+
*/
|
|
118
|
+
async function readTeamEntries(credential, keys, teamScoped) {
|
|
119
|
+
let bulk;
|
|
120
|
+
try {
|
|
121
|
+
bulk = await getTeamEnvelopes(credential);
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
if (err instanceof CloudError && err.status === 404) {
|
|
125
|
+
return Promise.all(teamScoped.map((m) => openTeamMap(credential, m, keys)));
|
|
126
|
+
}
|
|
127
|
+
throw err;
|
|
128
|
+
}
|
|
129
|
+
return Promise.all(bulk.maps.map(async (row) => {
|
|
130
|
+
try {
|
|
131
|
+
const envelope = JSON.parse(row.map_data);
|
|
132
|
+
return { createdAt: row.created_at, map: await decryptTeamMapWithAny(keys, envelope) };
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
// A version this member was never granted: skipped, not fatal.
|
|
136
|
+
return { createdAt: row.created_at, map: null };
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
/** One team map, opened if any held key fits. */
|
|
141
|
+
async function openTeamMap(credential, summary, keys) {
|
|
142
|
+
const miss = { createdAt: summary.created_at, map: null };
|
|
143
|
+
try {
|
|
144
|
+
const full = await getMap(credential, summary.id);
|
|
145
|
+
// A server-decrypted map arrives as an object. Nothing to open, and nothing
|
|
146
|
+
// that should be here — but reading it is safe and losing it would drop a
|
|
147
|
+
// teammate's placeholders for no reason.
|
|
148
|
+
if (typeof full.map_data !== 'string') {
|
|
149
|
+
return { createdAt: summary.created_at, map: full.map_data };
|
|
150
|
+
}
|
|
151
|
+
const envelope = JSON.parse(full.map_data);
|
|
152
|
+
return {
|
|
153
|
+
createdAt: summary.created_at,
|
|
154
|
+
map: await decryptTeamMapWithAny(keys, envelope),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
// One unreadable map must never cost the team its namespace. `null` is how
|
|
159
|
+
// mergeTeamNamespace is told to skip it.
|
|
160
|
+
return miss;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
async function fetchNamespace(home) {
|
|
164
|
+
const credential = readCredential(home);
|
|
165
|
+
// Not signed in. No request — a signed-out terminal has nothing to ask Cloud.
|
|
166
|
+
if (!credential)
|
|
167
|
+
return LOCAL;
|
|
168
|
+
try {
|
|
169
|
+
const list = await listMaps(credential);
|
|
170
|
+
// An older self-hosted Cloud may still merge server-side, and that answer
|
|
171
|
+
// needs no key at all. Checked before the vault key so such a deployment
|
|
172
|
+
// keeps working for a member who has not unlocked one.
|
|
173
|
+
if (list.teamNamespace) {
|
|
174
|
+
return { source: 'team', namespace: list.teamNamespace, conflicts: [], highest: {} };
|
|
175
|
+
}
|
|
176
|
+
// Past here everything must be decrypted locally, so without keys on disk
|
|
177
|
+
// there is nothing further to try. That is the state until somebody has run
|
|
178
|
+
// `veilio team unlock` in a terminal.
|
|
179
|
+
const teamId = list.team?.id;
|
|
180
|
+
if (!teamId)
|
|
181
|
+
return LOCAL;
|
|
182
|
+
const keys = await heldTeamKeys(credential, home, teamId);
|
|
183
|
+
if (keys.length === 0)
|
|
184
|
+
return LOCAL;
|
|
185
|
+
const built = await buildTeamNamespace(credential, keys, list);
|
|
186
|
+
if (!built)
|
|
187
|
+
return LOCAL;
|
|
188
|
+
return { source: 'team', ...built };
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// Unreachable, revoked session, timed out — every network or auth failure
|
|
192
|
+
// degrades the same way. A coding agent must keep working when Cloud is
|
|
193
|
+
// down; the fallback itself is what gets reported, not this failure.
|
|
194
|
+
return LOCAL;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Resolve the namespace once and cache it for the rest of the process.
|
|
199
|
+
*
|
|
200
|
+
* Concurrent callers share one in-flight fetch (R-007) rather than each firing
|
|
201
|
+
* their own request. `home` is injectable for tests; production leaves it
|
|
202
|
+
* undefined and `readCredential` falls back to the real home directory.
|
|
203
|
+
*/
|
|
204
|
+
export function primeNamespace(home) {
|
|
205
|
+
if (!priming) {
|
|
206
|
+
priming = fetchNamespace(home).then((resolved) => {
|
|
207
|
+
current = resolved;
|
|
208
|
+
return resolved;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return priming;
|
|
212
|
+
}
|
|
213
|
+
/** The already-resolved namespace. `local` (with an empty namespace) until
|
|
214
|
+
* `primeNamespace` has been called and settled — the safe default for any
|
|
215
|
+
* caller that never primes, including every existing offline-only test. */
|
|
216
|
+
export function getNamespace() {
|
|
217
|
+
return current;
|
|
218
|
+
}
|
|
219
|
+
/** Test-only: forget the cached result so the next `primeNamespace` refetches. */
|
|
220
|
+
export function resetNamespaceCache() {
|
|
221
|
+
current = LOCAL;
|
|
222
|
+
priming = null;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Overlay a team namespace onto a local map, safely.
|
|
226
|
+
*
|
|
227
|
+
* Both are `Record<placeholder, identifier>`, and that similarity is a trap: the
|
|
228
|
+
* two placeholder spaces are numbered independently — the local map by this
|
|
229
|
+
* project's own engine, the team's by `mergeTeamNamespace` walking every
|
|
230
|
+
* member's own maps — so `__CLS__1` in one has no relation to `__CLS__1` in the
|
|
231
|
+
* other beyond coincidence. A blind `{ ...local, ...team }` merge treats that
|
|
232
|
+
* coincidence as identity: two different identifiers that happen to land on the
|
|
233
|
+
* same key collide, `saveMap` then refuses the write as data loss (or, worse,
|
|
234
|
+
* silently drops one identifier's real mapping if the guard is bypassed), and
|
|
235
|
+
* text already restored under the shadowed placeholder now resolves to the
|
|
236
|
+
* wrong name.
|
|
237
|
+
*
|
|
238
|
+
* So this reconciles by IDENTIFIER, which is the thing two teammates actually
|
|
239
|
+
* want to agree on, and it only ever ADDS to `local` — never overwrites an
|
|
240
|
+
* existing key, never introduces a second placeholder for an identifier `local`
|
|
241
|
+
* already has under a different one:
|
|
242
|
+
*
|
|
243
|
+
* - an identifier already known locally (under any placeholder) keeps its
|
|
244
|
+
* local placeholder — converging it to the team's would relabel every
|
|
245
|
+
* already-anonymized reference to it, which is not this call's to decide
|
|
246
|
+
* - a team entry whose placeholder KEY is already taken locally by a
|
|
247
|
+
* DIFFERENT identifier is dropped rather than forced in; that one
|
|
248
|
+
* identifier just doesn't converge with the team this round and gets a
|
|
249
|
+
* fresh local placeholder from the engine instead, which is a safe
|
|
250
|
+
* degradation, not a corruption
|
|
251
|
+
* - everything else — a team identifier neither known locally nor colliding
|
|
252
|
+
* on key — is added under the team's placeholder, which is the case two
|
|
253
|
+
* fresh sessions (T044) actually converge through
|
|
254
|
+
*/
|
|
255
|
+
export function mergeNamespace(local, team) {
|
|
256
|
+
const merged = { ...local };
|
|
257
|
+
const knownIdentifiers = new Set(Object.values(local));
|
|
258
|
+
for (const [placeholder, identifier] of Object.entries(team)) {
|
|
259
|
+
if (knownIdentifiers.has(identifier))
|
|
260
|
+
continue;
|
|
261
|
+
if (placeholder in merged)
|
|
262
|
+
continue;
|
|
263
|
+
merged[placeholder] = identifier;
|
|
264
|
+
knownIdentifiers.add(identifier);
|
|
265
|
+
}
|
|
266
|
+
return merged;
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=namesp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cAAc,CAC5B,KAA6B,EAC7B,IAA4B;IAE5B,MAAM,MAAM,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;IAC3B,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACtD,KAAK,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7D,IAAI,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC;YAAE,SAAQ;QAC9C,IAAI,WAAW,IAAI,MAAM;YAAE,SAAQ;QACnC,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAA;QAChC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAClC,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/rules.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CustomRule } from '@veilio-inc/engine';
|
|
2
|
+
export interface ResolvedRules {
|
|
3
|
+
/** 'cloud' fetched now; 'cached' Cloud did not answer, so the last pull; 'none'. */
|
|
4
|
+
source: 'cloud' | 'cached' | 'none';
|
|
5
|
+
rules: CustomRule[];
|
|
6
|
+
/** When the cached rules were pulled. Only for 'cached'. */
|
|
7
|
+
pulledAt?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Resolve once per process; concurrent callers share the one request. */
|
|
10
|
+
export declare function primeRules(home?: string): Promise<ResolvedRules>;
|
|
11
|
+
/** The resolved rules. 'none' until primed - the safe default for offline tests. */
|
|
12
|
+
export declare function getRules(): ResolvedRules;
|
|
13
|
+
/** Test-only. */
|
|
14
|
+
export declare function resetRulesCache(): void;
|
|
15
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IACnC,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAiDD,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAQhE;AAED,oFAAoF;AACpF,wBAAgB,QAAQ,IAAI,aAAa,CAExC;AAED,iBAAiB;AACjB,wBAAgB,eAAe,IAAI,IAAI,CAGtC"}
|
package/dist/rules.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// The account's custom rules - fetched once per MCP session, like the team
|
|
2
|
+
// namespace (see namespace.ts for why once, at startup, and never inside a
|
|
3
|
+
// tool call).
|
|
4
|
+
//
|
|
5
|
+
// Before this the server applied no custom rules at all, so an agent masked the
|
|
6
|
+
// same code differently from the web app (found on staging, 2026-09-26). The
|
|
7
|
+
// fallback is stated on every result, never silent: rules from Cloud, the
|
|
8
|
+
// cache `veilio rules pull` left, or none.
|
|
9
|
+
import { readCredential } from '@veilio-inc/cli/credential';
|
|
10
|
+
import { CloudError, listRules } from '@veilio-inc/cli/cloud';
|
|
11
|
+
import { mergeRules, readRules, removeRules, writeRules } from '@veilio-inc/cli/rules';
|
|
12
|
+
const NONE = { source: 'none', rules: [] };
|
|
13
|
+
let current = NONE;
|
|
14
|
+
let priming = null;
|
|
15
|
+
async function fetchRules(home) {
|
|
16
|
+
const credential = readCredential(home);
|
|
17
|
+
if (!credential)
|
|
18
|
+
return NONE;
|
|
19
|
+
try {
|
|
20
|
+
const fetched = await listRules(credential);
|
|
21
|
+
const rules = mergeRules(fetched.rules ?? [], fetched.teamRules ?? []);
|
|
22
|
+
// Refresh the CLI's cache too, so `veilio scrub` on this machine agrees
|
|
23
|
+
// with the agent. A failed write costs nothing here.
|
|
24
|
+
try {
|
|
25
|
+
writeRules({
|
|
26
|
+
instance: credential.instance,
|
|
27
|
+
account: credential.account,
|
|
28
|
+
pulledAt: new Date().toISOString(),
|
|
29
|
+
rules,
|
|
30
|
+
}, home);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// ignore
|
|
34
|
+
}
|
|
35
|
+
return { source: 'cloud', rules };
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
// The plan no longer includes rules: stop applying the old ones, here and
|
|
39
|
+
// in the CLI, rather than letting a stale whitelist keep names readable.
|
|
40
|
+
if (err instanceof CloudError && err.kind === 'unentitled') {
|
|
41
|
+
try {
|
|
42
|
+
removeRules(home);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// ignore
|
|
46
|
+
}
|
|
47
|
+
return NONE;
|
|
48
|
+
}
|
|
49
|
+
const cached = readRules(credential, home);
|
|
50
|
+
if (cached && cached.rules.length > 0) {
|
|
51
|
+
return { source: 'cached', rules: cached.rules, pulledAt: cached.pulledAt };
|
|
52
|
+
}
|
|
53
|
+
return NONE;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Resolve once per process; concurrent callers share the one request. */
|
|
57
|
+
export function primeRules(home) {
|
|
58
|
+
if (!priming) {
|
|
59
|
+
priming = fetchRules(home).then((resolved) => {
|
|
60
|
+
current = resolved;
|
|
61
|
+
return resolved;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return priming;
|
|
65
|
+
}
|
|
66
|
+
/** The resolved rules. 'none' until primed - the safe default for offline tests. */
|
|
67
|
+
export function getRules() {
|
|
68
|
+
return current;
|
|
69
|
+
}
|
|
70
|
+
/** Test-only. */
|
|
71
|
+
export function resetRulesCache() {
|
|
72
|
+
current = NONE;
|
|
73
|
+
priming = null;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
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C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,0EAA0E;QAC1E,yEAAyE;QACzE,IAAI,GAAG,YAAY,UAAU,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC3D,IAAI,CAAC;gBACH,WAAW,CAAC,IAAI,CAAC,CAAA;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QAC1C,IAAI,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAA;QAC7E,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,UAAU,CAAC,IAAa;IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC3C,OAAO,GAAG,QAAQ,CAAA;YAClB,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,QAAQ;IACtB,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,iBAAiB;AACjB,MAAM,UAAU,eAAe;IAC7B,OAAO,GAAG,IAAI,CAAA;IACd,OAAO,GAAG,IAAI,CAAA;AAChB,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ToolContext } from './tools.js';
|
|
2
|
-
export declare const SERVER_VERSION
|
|
2
|
+
export declare const SERVER_VERSION: string;
|
|
3
3
|
/** Protocol revisions this server implements. If the client asks for one of
|
|
4
4
|
* these we echo it back; otherwise we answer with our newest and let the
|
|
5
5
|
* client decide whether it can proceed. */
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AASA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAI9D,eAAO,MAAM,cAAc,EAAE,MAEpB,CAAA;AAET;;4CAE4C;AAC5C,eAAO,MAAM,2BAA2B,UAA6C,CAAA;AAGrF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,KAAK,CAAA;IACd,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAA;IACd,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC1D;AAeD;4BAC4B;AAC5B,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,GAAG,eAAe,GAAG,IAAI,CAkExF;AAED,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,eAAe,GAAG,IAAI,CAQlF;AAED;0EAC0E;AAC1E,qBAAa,WAAW;IAIpB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJvB,OAAO,CAAC,MAAM,CAAK;gBAGA,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI;IAG5D,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAW1B"}
|
package/dist/server.js
CHANGED
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
// auditable, local, dependency-free code; pulling a transitive tree into the
|
|
5
5
|
// component that reads your files to undercut that would be an odd trade for
|
|
6
6
|
// ~150 lines of message plumbing.
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
7
8
|
import { PRODUCT_NAME } from '@veilio-inc/engine';
|
|
8
9
|
import { callTool, TOOLS } from './tools.js';
|
|
9
|
-
|
|
10
|
+
// Read from the package, not typed here - told to every MCP client, and a
|
|
11
|
+
// literal drifted from what npm published (found 2026-09-26).
|
|
12
|
+
export const SERVER_VERSION = createRequire(import.meta.url)('../package.json').version;
|
|
10
13
|
/** Protocol revisions this server implements. If the client asks for one of
|
|
11
14
|
* these we echo it back; otherwise we answer with our newest and let the
|
|
12
15
|
* client decide whether it can proceed. */
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,6EAA6E;AAC7E,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAoB,MAAM,YAAY,CAAA;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,gFAAgF;AACh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3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACnC,CAAC;AAED;0EAC0E;AAC1E,MAAM,OAAO,WAAW;IAIH;IACA;IAJX,MAAM,GAAG,EAAE,CAAA;IAEnB,YACmB,GAAgB,EAChB,IAAyC;QADzC,QAAG,GAAH,GAAG,CAAa;QAChB,SAAI,GAAJ,IAAI,CAAqC;IACzD,CAAC;IAEJ,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;QACpB,IAAI,KAAa,CAAA;QACjB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAA;YAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;YAC1C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAQ;YAC/B,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;YAC5C,IAAI,QAAQ,KAAK,IAAI;gBAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;CACF"}
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAA;IACX,yEAAyE;IACzE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,WAAW,KAAK,UAAU,CAAA;CACzE;AAkPD,eAAO,MAAM,KAAK,EAAE,cAAc,EAqJjC,CAAA;AAED,eAAO,MAAM,aAAa,6BAAyC,CAAA;AAEnE;;wEAEwE;AACxE,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,WAAW,GACf,UAAU,CASZ"}
|
package/dist/tools.js
CHANGED
|
@@ -19,6 +19,9 @@ import { readFileSync } from 'node:fs';
|
|
|
19
19
|
import { isAbsolute, relative, resolve } from 'node:path';
|
|
20
20
|
import { anonymize, detectSecrets, isPlaceholder, restore, summarizeSecrets, withAiPreamble, BIN_NAME, LANGUAGES, LANGUAGE_LABELS, PRODUCT_NAME, } from '@veilio-inc/engine';
|
|
21
21
|
import { loadMap, resolveMapPath, saveMap } from '@veilio-inc/cli/store';
|
|
22
|
+
import { getNamespace, mergeNamespace } from './namespace.js';
|
|
23
|
+
import { getRules } from './rules.js';
|
|
24
|
+
import { describeAge } from '@veilio-inc/cli/rules';
|
|
22
25
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
23
26
|
class ToolError extends Error {
|
|
24
27
|
}
|
|
@@ -44,6 +47,13 @@ function safeResolve(path, cwd) {
|
|
|
44
47
|
}
|
|
45
48
|
return abs;
|
|
46
49
|
}
|
|
50
|
+
/** Whether `placeholder` appears in `text` as a whole token, not as a prefix of
|
|
51
|
+
* a longer one — `__CLS__1` must not match inside `__CLS__10`. Used to decide
|
|
52
|
+
* which team-namespace entries a masking result actually leaned on. */
|
|
53
|
+
function appearsAsToken(text, placeholder) {
|
|
54
|
+
const escaped = placeholder.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
55
|
+
return new RegExp(`(?<![A-Za-z0-9_$])${escaped}(?![A-Za-z0-9_$])`).test(text);
|
|
56
|
+
}
|
|
47
57
|
function readTarget(args, ctx) {
|
|
48
58
|
const path = str(args, 'path');
|
|
49
59
|
const text = str(args, 'text');
|
|
@@ -108,6 +118,41 @@ function restoreReportLines(report) {
|
|
|
108
118
|
}
|
|
109
119
|
return parts.length > 0 ? `\n\n${parts.join('\n\n')}` : '';
|
|
110
120
|
}
|
|
121
|
+
function rulesLine(r) {
|
|
122
|
+
if (r.source === 'none')
|
|
123
|
+
return 'Custom rules: none';
|
|
124
|
+
const n = `${r.rules.length} custom rule${r.rules.length === 1 ? '' : 's'}`;
|
|
125
|
+
if (r.source === 'cloud')
|
|
126
|
+
return `Custom rules: ${n} from Cloud`;
|
|
127
|
+
return `Custom rules: ${n} cached, pulled ${describeAge(r.pulledAt ?? '')} - Cloud did not answer`;
|
|
128
|
+
}
|
|
129
|
+
const NUMBERED = /^(__[A-Z][A-Z0-9_]*__)(\d+)$/;
|
|
130
|
+
const FLOOR_MARKER = '\u0000floor:';
|
|
131
|
+
/**
|
|
132
|
+
* Anonymize with every NEW number above `floors[base]` (spec 017).
|
|
133
|
+
*
|
|
134
|
+
* The engine numbers above the highest number in the map it is given, so a
|
|
135
|
+
* marker entry at the floor moves the counter there. Markers hold a NUL no
|
|
136
|
+
* identifier contains, match nothing in the text, and are stripped from the
|
|
137
|
+
* returned map. Only added above the map's own highest, where they cannot
|
|
138
|
+
* overwrite a real entry. Same technique as the Cloud web app.
|
|
139
|
+
*/
|
|
140
|
+
function anonymizeAbove(source, options, floors) {
|
|
141
|
+
const inMap = {};
|
|
142
|
+
for (const p of Object.keys(options.existingMap)) {
|
|
143
|
+
const m = NUMBERED.exec(p);
|
|
144
|
+
if (m && Number(m[2]) > (inMap[m[1]] ?? 0))
|
|
145
|
+
inMap[m[1]] = Number(m[2]);
|
|
146
|
+
}
|
|
147
|
+
const seeded = { ...options.existingMap };
|
|
148
|
+
for (const [base, floor] of Object.entries(floors)) {
|
|
149
|
+
if (floor > (inMap[base] ?? 0))
|
|
150
|
+
seeded[`${base}${floor}`] = `${FLOOR_MARKER}${base}`;
|
|
151
|
+
}
|
|
152
|
+
const result = anonymize(source, { ...options, existingMap: seeded });
|
|
153
|
+
const map = Object.fromEntries(Object.entries(result.map).filter(([, identifier]) => !identifier.startsWith(FLOOR_MARKER)));
|
|
154
|
+
return { ...result, map };
|
|
155
|
+
}
|
|
111
156
|
const LANGUAGE_ENUM = ['auto', ...LANGUAGES];
|
|
112
157
|
const LANGUAGE_PROP = {
|
|
113
158
|
type: 'string',
|
|
@@ -116,10 +161,28 @@ const LANGUAGE_PROP = {
|
|
|
116
161
|
};
|
|
117
162
|
function runAnonymize(source, label, args, ctx) {
|
|
118
163
|
const mapPath = resolveMapPath(ctx.mapPath, ctx.cwd);
|
|
119
|
-
const
|
|
164
|
+
const localMap = loadMap(mapPath);
|
|
165
|
+
// Overlaid, not merged by key — the two placeholder spaces are numbered
|
|
166
|
+
// independently and a shared key is coincidence, not identity. See
|
|
167
|
+
// mergeNamespace's own comment for why a naive `{ ...local, ...namespace }`
|
|
168
|
+
// corrupts the store (spec 005 US4).
|
|
169
|
+
const { source: namespaceSource, namespace, highest } = getNamespace();
|
|
170
|
+
const existingMap = mergeNamespace(localMap, namespace);
|
|
120
171
|
const language = (str(args, 'language') ?? 'auto');
|
|
121
|
-
const
|
|
122
|
-
|
|
172
|
+
const rules = getRules();
|
|
173
|
+
const result = anonymizeAbove(source, { existingMap, language, secrets: 'redact', rules: rules.rules }, highest);
|
|
174
|
+
// Persist local-original, whatever this call genuinely minted, and only the
|
|
175
|
+
// team-overlay entries this call actually USED — never the rest of the team
|
|
176
|
+
// namespace. Persisting all of it would bake entries this project never
|
|
177
|
+
// references into the store, unboundedly, and they'd outlive the entitlement
|
|
178
|
+
// that fetched them: lose Cloud access later and the store keeps quietly
|
|
179
|
+
// resolving through team placeholders while truthfully reporting `local`.
|
|
180
|
+
// Persisting none of it, the other extreme, breaks `restore_text` for a
|
|
181
|
+
// team placeholder that IS sitting in the output this call just returned.
|
|
182
|
+
const toPersist = Object.fromEntries(Object.entries(result.map).filter(([placeholder]) => !(placeholder in namespace) ||
|
|
183
|
+
placeholder in localMap ||
|
|
184
|
+
appearsAsToken(result.anonymized, placeholder)));
|
|
185
|
+
saveMap(mapPath, toPersist);
|
|
123
186
|
const body = args.preamble === true ? withAiPreamble(result.anonymized, result.map) : result.anonymized;
|
|
124
187
|
// The model reading this is about to reason over the masked text, and these
|
|
125
188
|
// two lines are the only place it can learn what the masking did NOT cover.
|
|
@@ -141,7 +204,13 @@ function runAnonymize(source, label, args, ctx) {
|
|
|
141
204
|
const notes = [
|
|
142
205
|
`Source: ${label}`,
|
|
143
206
|
`Language: ${LANGUAGE_LABELS[result.language]}`,
|
|
144
|
-
`Placeholders in map: ${Object.keys(
|
|
207
|
+
`Placeholders in map: ${Object.keys(toPersist).length}`,
|
|
208
|
+
// Never absent (FR-016, Constitution V): a result that cannot say where its
|
|
209
|
+
// names came from is the silent fallback this line exists to rule out.
|
|
210
|
+
`Namespace: ${namespaceSource}`,
|
|
211
|
+
// Stated every time, like the namespace: an agent whose masking ignored the
|
|
212
|
+
// team's rules must be able to tell.
|
|
213
|
+
rulesLine(rules),
|
|
145
214
|
secretSummary(result.secrets),
|
|
146
215
|
...caveats,
|
|
147
216
|
].join('\n');
|
|
@@ -226,11 +295,23 @@ export const TOOLS = [
|
|
|
226
295
|
if (Object.keys(map).length === 0) {
|
|
227
296
|
throw new ToolError(`no symbol map yet — run anonymize_file (or "${BIN_NAME} scrub") first`);
|
|
228
297
|
}
|
|
298
|
+
// A placeholder the team's maps disagree about is never guessed (spec
|
|
299
|
+
// 017): a wrong restore reads exactly like a right one. It stays in the
|
|
300
|
+
// text and is named, whatever the local store says it means.
|
|
301
|
+
const { conflicts } = getNamespace();
|
|
302
|
+
for (const placeholder of conflicts)
|
|
303
|
+
delete map[placeholder];
|
|
304
|
+
const ambiguous = conflicts.filter((p) => appearsAsToken(text, p));
|
|
229
305
|
const result = restore(text, map);
|
|
306
|
+
const ambiguity = ambiguous.length === 0
|
|
307
|
+
? ''
|
|
308
|
+
: `\n\nWARNING: left as is: ${ambiguous.join(', ')}. The team's saved maps give ` +
|
|
309
|
+
`${ambiguous.length === 1 ? 'this placeholder' : 'these placeholders'} different ` +
|
|
310
|
+
`identifiers, so restoring would be a guess.`;
|
|
230
311
|
return {
|
|
231
312
|
text: `Restored ${result.report.resolved.length} of ${Object.keys(map).length} placeholders; ` +
|
|
232
313
|
`stripped ${result.strippedCount} AI artifact(s).` +
|
|
233
|
-
`${restoreReportLines(result.report)}\n\n--- restored ---\n${result.restored}`,
|
|
314
|
+
`${restoreReportLines(result.report)}${ambiguity}\n\n--- restored ---\n${result.restored}`,
|
|
234
315
|
};
|
|
235
316
|
},
|
|
236
317
|
},
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,oCAAoC;AACpC,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,aAAa;AACb,EAAE;AACF,8EAA8E;AAC9E,mEAAmE;AACnE,iFAAiF;AACjF,yEAAyE;AACzE,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,iFA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+
"version": "0.3.0",
|
|
4
4
|
"description": "MCP server exposing the anonymizer to coding agents, so a model can work on masked code without the real identifiers ever entering its context.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "SEE LICENSE IN LICENSE",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@veilio-inc/engine": "^1.
|
|
31
|
-
"@veilio-inc/cli": "^0.
|
|
30
|
+
"@veilio-inc/engine": "^1.6.2",
|
|
31
|
+
"@veilio-inc/cli": "^0.3.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsc",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"typescript": "^5.4.0",
|
|
43
|
-
"vitest": "^
|
|
44
|
-
"@vitest/coverage-v8": "^
|
|
43
|
+
"vitest": "^5.0.1",
|
|
44
|
+
"@vitest/coverage-v8": "^5.0.1"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|