@veilio-inc/mcp 0.3.0 → 0.3.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 +61 -9
- package/dist/namespace.d.ts +52 -45
- package/dist/namespace.d.ts.map +1 -1
- package/dist/namespace.js +121 -206
- package/dist/namespace.js.map +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +78 -25
- package/dist/tools.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ tools/call anonymize_file { "path": "src/gateway.ts" }
|
|
|
15
15
|
Language: TypeScript / JavaScript
|
|
16
16
|
Placeholders in map: 7
|
|
17
17
|
Namespace: local
|
|
18
|
+
Custom rules: none
|
|
18
19
|
Credentials detected — 1 critical:
|
|
19
20
|
critical line 2:24 Stripe secret key — sk_l…MNOP (31 chars) (redacted, not recoverable)
|
|
20
21
|
|
|
@@ -27,13 +28,19 @@ tools/call anonymize_file { "path": "src/gateway.ts" }
|
|
|
27
28
|
}
|
|
28
29
|
```
|
|
29
30
|
|
|
31
|
+
Two more lines appear when they apply, and both are the model's only warning
|
|
32
|
+
that the masking did not cover something: one when no language marker matched
|
|
33
|
+
(the file was masked as TypeScript, which may be wrong), and one counting the
|
|
34
|
+
**comment prose left exactly as written** — names and ticket numbers in comments
|
|
35
|
+
are still real.
|
|
36
|
+
|
|
30
37
|
## Tools
|
|
31
38
|
|
|
32
39
|
| Tool | Purpose |
|
|
33
40
|
|---|---|
|
|
34
41
|
| `anonymize_file` | Read a file and return only its masked form. **Preferred.** |
|
|
35
42
|
| `anonymize_text` | Mask text the agent already holds (a user paste). Not for file contents. |
|
|
36
|
-
| `restore_text` | Swap placeholders back and strip AI-generated noise. |
|
|
43
|
+
| `restore_text` | Swap placeholders back and strip AI-generated noise — the team's placeholders too, under the rule below. |
|
|
37
44
|
| `scan_secrets` | Detect credentials without modifying anything, and without putting the values in context. |
|
|
38
45
|
| `symbol_map_summary` | Placeholder counts by kind. Returns keys only, never real names. |
|
|
39
46
|
|
|
@@ -53,29 +60,74 @@ Setup for Claude Code, Claude Desktop, Xcode, Cursor and VS Code, plus troublesh
|
|
|
53
60
|
}
|
|
54
61
|
```
|
|
55
62
|
|
|
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.
|
|
63
|
+
`--root <dir>` (or `-r`) scopes every path the server will read; `--map <path>` (or `-m`) 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.
|
|
57
64
|
|
|
58
65
|
## Team namespace (Team plan and above)
|
|
59
66
|
|
|
60
67
|
Sign in once with the `veilio` CLI — `veilio login` — and every anonymize
|
|
61
68
|
result from this server states which namespace produced its placeholders:
|
|
62
69
|
|
|
63
|
-
- **`team`** — resolved against the team's shared dictionary,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
the
|
|
70
|
+
- **`team`** — resolved against the team's shared dictionary, read at startup,
|
|
71
|
+
so every teammate's agent produces the same placeholder for the same
|
|
72
|
+
identifier. Reused for the life of the process, with one exception: run
|
|
73
|
+
`veilio team unlock` after the server started and the next call says it is
|
|
74
|
+
loading the team's maps rather than making you restart the agent.
|
|
75
|
+
- **`local`** — resolved locally: not signed in, no team key unlocked on this
|
|
76
|
+
machine, offline, or the plan doesn't include shared dictionaries. This is the
|
|
77
|
+
normal, fully-functional state for anyone not on a paid team — the server never
|
|
78
|
+
blocks on it, and the fallback is always stated, never silent.
|
|
70
79
|
|
|
71
80
|
There is no separate sign-in for the MCP server; it reads the same credential
|
|
72
81
|
file `veilio login` already wrote.
|
|
73
82
|
|
|
83
|
+
The merge happens **here, not in Cloud**: team maps arrive sealed under the team
|
|
84
|
+
key, which the server cannot read. So on a Team plan the namespace is `team` only
|
|
85
|
+
once `veilio team unlock` has opened that key on this machine — it is kept for
|
|
86
|
+
seven days, and a key rotation ends it sooner. Signed in with nothing unlocked,
|
|
87
|
+
the server reports `local`: there is nothing it could decrypt. A single map it
|
|
88
|
+
cannot open is skipped rather than fatal, but a failed read of the namespace as a
|
|
89
|
+
whole reports `local` too, because a namespace missing a teammate's newest map
|
|
90
|
+
would restore their placeholders wrong. An older self-hosted Cloud that still
|
|
91
|
+
merges server-side is honoured as it is, with no key needed here.
|
|
92
|
+
|
|
93
|
+
The `local` line says which of those it was — `local (the team key is locked on
|
|
94
|
+
this machine - run \`veilio team unlock\`)` or `local (could not read the team's
|
|
95
|
+
maps: …)` — so a fallback is never read as agreement.
|
|
96
|
+
|
|
74
97
|
The account's custom rules are fetched at startup the same way and applied to
|
|
75
98
|
every anonymize call. Each result states their source: `from Cloud`, `cached`
|
|
76
99
|
(Cloud did not answer, so the last `veilio rules pull` is used, with its age),
|
|
77
100
|
or `none`.
|
|
78
101
|
|
|
102
|
+
### One restore rule, and what the server refuses to guess
|
|
103
|
+
|
|
104
|
+
`restore_text` resolves the team's maps first — aliases included — and this
|
|
105
|
+
project's map on top of them. Two kinds of placeholder are deliberately left in
|
|
106
|
+
the output, each named in a warning rather than substituted:
|
|
107
|
+
|
|
108
|
+
- one this project's store and the team use for **different** identifiers, and
|
|
109
|
+
- one this project **numbered on its own** while the team was out of reach.
|
|
110
|
+
|
|
111
|
+
Either could be restored to a name that is not the one a teammate meant, and a
|
|
112
|
+
confident wrong identifier is worse than a token the reader can see is
|
|
113
|
+
unresolved. They are also excluded from the "invented or altered" count, since
|
|
114
|
+
they were left for a stated reason.
|
|
115
|
+
|
|
116
|
+
When the team's maps *should* have been used and could not be — the key is
|
|
117
|
+
locked, or Cloud could not be read — the call comes back as an **error result**
|
|
118
|
+
saying which, even if some placeholders did restore. An older self-hosted Cloud
|
|
119
|
+
that merges the namespace server-side is used for anonymizing but never for
|
|
120
|
+
restoring: it cannot tell a disputed placeholder from a first-written one.
|
|
121
|
+
|
|
122
|
+
### After a lapse
|
|
123
|
+
|
|
124
|
+
Anonymizing while signed out, or while Cloud was unreachable, numbers new names
|
|
125
|
+
locally. Once the team's maps are back, an identifier the team already knows
|
|
126
|
+
takes the **team's** placeholder, and anything new is numbered above both the
|
|
127
|
+
team's highest and this project's own. The entries minted during the lapse stay
|
|
128
|
+
in the local store — text was already sent with them, so they are still needed
|
|
129
|
+
to restore it — but they are not handed to a teammate as the team's meaning.
|
|
130
|
+
|
|
79
131
|
## Design properties
|
|
80
132
|
|
|
81
133
|
- **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/namespace.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type TeamNamespaceResult } from '@veilio-inc/cli/team-namespace';
|
|
2
2
|
export type NamespaceSource = 'team' | 'local';
|
|
3
3
|
export interface ResolvedNamespace {
|
|
4
4
|
source: NamespaceSource;
|
|
5
|
-
/** Placeholder -> identifier
|
|
5
|
+
/** Placeholder -> identifier, WITHOUT the disputed placeholders - so this
|
|
6
|
+
* server never emits one. Empty for 'local'. */
|
|
6
7
|
namespace: Record<string, string>;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
conflicts: string
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
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
|
-
*/
|
|
8
|
+
/** A second number a team map kept for an identifier that already had one
|
|
9
|
+
* (spec 017): text sent with it must restore too (spec 028). */
|
|
10
|
+
aliases: Record<string, string>;
|
|
11
|
+
/** Placeholders the team's saved maps give DIFFERENT identifiers -> how many.
|
|
12
|
+
* Never emitted, never guessed back (spec 017). */
|
|
13
|
+
conflicts: Record<string, number>;
|
|
14
|
+
/** Highest number per placeholder base in any readable team map, conflicts
|
|
15
|
+
* included: new names are numbered above it. */
|
|
18
16
|
highest: Record<string, number>;
|
|
17
|
+
/** What the CLI's resolver found - including why it is 'local' when the team
|
|
18
|
+
* exists but its maps were not read (locked, unavailable). Never silent. */
|
|
19
|
+
found: TeamNamespaceResult;
|
|
20
|
+
/** False for an older instance's server-merged namespace: usable to anonymize,
|
|
21
|
+
* never to restore - it cannot tell a disputed placeholder (spec 028). */
|
|
22
|
+
conflictDetection: boolean;
|
|
19
23
|
}
|
|
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
24
|
/**
|
|
25
25
|
* Resolve the namespace once and cache it for the rest of the process.
|
|
26
26
|
*
|
|
@@ -28,7 +28,20 @@ export declare function findConflicts(entries: readonly TeamMapEntry[]): string[
|
|
|
28
28
|
* their own request. `home` is injectable for tests; production leaves it
|
|
29
29
|
* undefined and `readCredential` falls back to the real home directory.
|
|
30
30
|
*/
|
|
31
|
-
export declare function primeNamespace(home?: string
|
|
31
|
+
export declare function primeNamespace(home?: string, opts?: {
|
|
32
|
+
retryDelayMs?: number;
|
|
33
|
+
}): Promise<ResolvedNamespace>;
|
|
34
|
+
/**
|
|
35
|
+
* The cache must not outlive the reason it was cached (review): `veilio team
|
|
36
|
+
* unlock` run after this server started said "restore again" and every retry
|
|
37
|
+
* met the same cached `locked`. Called at the start of each tool call. Cheap
|
|
38
|
+
* and synchronous - a local file read - and never waits: when there is
|
|
39
|
+
* something new to fetch it starts the fetch and says 'loading'; the next call
|
|
40
|
+
* sees the result. A settled `team` or `local` is kept for the process.
|
|
41
|
+
*/
|
|
42
|
+
export declare function refreshNamespaceIfStale(): 'unlocked' | 'retrying' | null;
|
|
43
|
+
/** Test support and callers that can wait: the in-flight (or last) resolution. */
|
|
44
|
+
export declare function namespaceSettled(): Promise<ResolvedNamespace>;
|
|
32
45
|
/** The already-resolved namespace. `local` (with an empty namespace) until
|
|
33
46
|
* `primeNamespace` has been called and settled — the safe default for any
|
|
34
47
|
* caller that never primes, including every existing offline-only test. */
|
|
@@ -36,35 +49,29 @@ export declare function getNamespace(): ResolvedNamespace;
|
|
|
36
49
|
/** Test-only: forget the cached result so the next `primeNamespace` refetches. */
|
|
37
50
|
export declare function resetNamespaceCache(): void;
|
|
38
51
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* text already restored under the shadowed placeholder now resolves to the
|
|
50
|
-
* wrong name.
|
|
52
|
+
* The namespace line every anonymize result carries, with the reason when the
|
|
53
|
+
* team exists but was not used - so a fallback is never mistaken for agreement.
|
|
54
|
+
*/
|
|
55
|
+
export declare function namespaceLine(resolved: ResolvedNamespace): string;
|
|
56
|
+
/**
|
|
57
|
+
* The map handed to the engine to anonymize: this project's store and the
|
|
58
|
+
* team's namespace, reconciled so that nothing emitted can mean something else
|
|
59
|
+
* to a teammate (spec 028 R5; this replaced spec 005's "the local placeholder
|
|
60
|
+
* wins", which after a lapse emitted staging's `createInvoice` as __FN__1 - the
|
|
61
|
+
* team's `chargeCustomer`).
|
|
51
62
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* existing key, never introduces a second placeholder for an identifier `local`
|
|
55
|
-
* already has under a different one:
|
|
63
|
+
* The two placeholder spaces are numbered independently, so a shared key is
|
|
64
|
+
* coincidence, not identity:
|
|
56
65
|
*
|
|
57
|
-
* -
|
|
58
|
-
*
|
|
59
|
-
* already
|
|
60
|
-
* -
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* on key — is added under the team's placeholder, which is the case two
|
|
67
|
-
* fresh sessions (T044) actually converge through
|
|
66
|
+
* - An identifier the team knows takes the TEAM's placeholder. The project's
|
|
67
|
+
* own placeholder for it is left out (it stays in the store, for restoring
|
|
68
|
+
* text already sent) - one placeholder per identifier, always.
|
|
69
|
+
* - A placeholder the project's store and the team use for DIFFERENT
|
|
70
|
+
* identifiers is used for neither: the store must keep its meaning (text was
|
|
71
|
+
* sent with it; `saveMap` refuses to lose it), and emitting it would mean the
|
|
72
|
+
* team's identifier to every teammate. Both identifiers get fresh numbers.
|
|
73
|
+
* - Everything else - a local entry the team does not contradict, a team entry
|
|
74
|
+
* the store does not contradict - is used as it is.
|
|
68
75
|
*/
|
|
69
76
|
export declare function mergeNamespace(local: Record<string, string>, team: Record<string, string>): Record<string, string>;
|
|
70
77
|
//# sourceMappingURL=namespace.d.ts.map
|
package/dist/namespace.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAI/F,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAA;AAE9C,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,eAAe,CAAA;IACvB;qDACiD;IACjD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;qEACiE;IACjE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B;wDACoD;IACpD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;qDACiD;IACjD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B;iFAC6E;IAC7E,KAAK,EAAE,mBAAmB,CAAA;IAC1B;+EAC2E;IAC3E,iBAAiB,EAAE,OAAO,CAAA;CAC3B;AA2CD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,CAAC,EAAE,MAAM,EACb,IAAI,GAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,GACnC,OAAO,CAAC,iBAAiB,CAAC,CAY5B;AAUD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,IAAI,UAAU,GAAG,UAAU,GAAG,IAAI,CAqBxE;AAGD,kFAAkF;AAClF,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAE7D;AAED;;4EAE4E;AAC5E,wBAAgB,YAAY,IAAI,iBAAiB,CAEhD;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,IAAI,IAAI,CAM1C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAQjE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;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,CAgBxB"}
|
package/dist/namespace.js
CHANGED
|
@@ -15,184 +15,43 @@
|
|
|
15
15
|
// whole JSON-RPC pipeline (server.ts, tools.ts) synchronous rather than
|
|
16
16
|
// threading a Promise through 78 existing call sites for one network call that
|
|
17
17
|
// happens once per process.
|
|
18
|
+
import { resolveTeamNamespace } from '@veilio-inc/cli/team-namespace';
|
|
18
19
|
import { readCredential } from '@veilio-inc/cli/credential';
|
|
19
|
-
import { CloudError, listMaps, getMap, getTeamEnvelopes, } from '@veilio-inc/cli/cloud';
|
|
20
20
|
import { readTeamUnlock } from '@veilio-inc/cli/team-unlock';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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);
|
|
21
|
+
function localFrom(found) {
|
|
22
|
+
return {
|
|
23
|
+
source: 'local',
|
|
24
|
+
namespace: {},
|
|
25
|
+
aliases: {},
|
|
26
|
+
conflicts: {},
|
|
27
|
+
highest: {},
|
|
28
|
+
found,
|
|
29
|
+
conflictDetection: true,
|
|
30
|
+
};
|
|
47
31
|
}
|
|
32
|
+
const LOCAL = localFrom({ status: 'local' });
|
|
48
33
|
let current = LOCAL;
|
|
49
34
|
let priming = null;
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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;
|
|
35
|
+
/** The CLI's resolver, shaped for this server (spec 028: one resolver for both). */
|
|
36
|
+
async function fetchNamespace(home, opts) {
|
|
37
|
+
const found = await resolveTeamNamespace(home, opts);
|
|
38
|
+
if (found.status !== 'team')
|
|
39
|
+
return localFrom(found);
|
|
40
|
+
const { namespace, aliases, conflicts, highest } = found.analysis;
|
|
41
|
+
// A team with no maps yet has no namespace to share: 'local', as before. (A
|
|
42
|
+
// team whose maps exist but none opened is 'unavailable', from the resolver.)
|
|
43
|
+
if (Object.keys(namespace).length === 0 && Object.keys(conflicts).length === 0) {
|
|
44
|
+
return localFrom({ status: 'local' });
|
|
195
45
|
}
|
|
46
|
+
return {
|
|
47
|
+
source: 'team',
|
|
48
|
+
namespace: Object.fromEntries(Object.entries(namespace).filter(([p]) => !(p in conflicts))),
|
|
49
|
+
aliases,
|
|
50
|
+
conflicts,
|
|
51
|
+
highest,
|
|
52
|
+
found,
|
|
53
|
+
conflictDetection: found.conflictDetection,
|
|
54
|
+
};
|
|
196
55
|
}
|
|
197
56
|
/**
|
|
198
57
|
* Resolve the namespace once and cache it for the rest of the process.
|
|
@@ -201,15 +60,57 @@ async function fetchNamespace(home) {
|
|
|
201
60
|
* their own request. `home` is injectable for tests; production leaves it
|
|
202
61
|
* undefined and `readCredential` falls back to the real home directory.
|
|
203
62
|
*/
|
|
204
|
-
export function primeNamespace(home) {
|
|
63
|
+
export function primeNamespace(home, opts = {}) {
|
|
64
|
+
primedWith = { home, opts };
|
|
65
|
+
lastAttemptAt = Date.now();
|
|
205
66
|
if (!priming) {
|
|
206
|
-
priming = fetchNamespace(home).then((resolved) => {
|
|
67
|
+
priming = fetchNamespace(home, { deadlineMs: STARTUP_DEADLINE_MS, ...opts }).then((resolved) => {
|
|
207
68
|
current = resolved;
|
|
208
69
|
return resolved;
|
|
209
70
|
});
|
|
210
71
|
}
|
|
211
72
|
return priming;
|
|
212
73
|
}
|
|
74
|
+
/** A hung instance must not hold the agent's first tool call for 30 s. */
|
|
75
|
+
const STARTUP_DEADLINE_MS = 10_000;
|
|
76
|
+
/** How often an 'unavailable' team is asked again, from a tool call. */
|
|
77
|
+
const UNAVAILABLE_RECHECK_MS = 30_000;
|
|
78
|
+
let primedWith = { opts: {} };
|
|
79
|
+
let lastAttemptAt = 0;
|
|
80
|
+
/**
|
|
81
|
+
* The cache must not outlive the reason it was cached (review): `veilio team
|
|
82
|
+
* unlock` run after this server started said "restore again" and every retry
|
|
83
|
+
* met the same cached `locked`. Called at the start of each tool call. Cheap
|
|
84
|
+
* and synchronous - a local file read - and never waits: when there is
|
|
85
|
+
* something new to fetch it starts the fetch and says 'loading'; the next call
|
|
86
|
+
* sees the result. A settled `team` or `local` is kept for the process.
|
|
87
|
+
*/
|
|
88
|
+
export function refreshNamespaceIfStale() {
|
|
89
|
+
const status = current.found.status;
|
|
90
|
+
if (status !== 'locked' && status !== 'unavailable')
|
|
91
|
+
return null;
|
|
92
|
+
if (priming && !settledFlag)
|
|
93
|
+
return status === 'locked' ? 'unlocked' : 'retrying';
|
|
94
|
+
const now = Date.now();
|
|
95
|
+
const credential = status === 'locked' ? readCredential(primedWith.home) : null;
|
|
96
|
+
const due = status === 'locked'
|
|
97
|
+
? credential !== null &&
|
|
98
|
+
readTeamUnlock({ instance: credential.instance, account: credential.account }, primedWith.home) !== null
|
|
99
|
+
: now - lastAttemptAt >= UNAVAILABLE_RECHECK_MS;
|
|
100
|
+
if (!due)
|
|
101
|
+
return null;
|
|
102
|
+
priming = null;
|
|
103
|
+
settledFlag = false;
|
|
104
|
+
void primeNamespace(primedWith.home, primedWith.opts).then(() => {
|
|
105
|
+
settledFlag = true;
|
|
106
|
+
});
|
|
107
|
+
return status === 'locked' ? 'unlocked' : 'retrying';
|
|
108
|
+
}
|
|
109
|
+
let settledFlag = true;
|
|
110
|
+
/** Test support and callers that can wait: the in-flight (or last) resolution. */
|
|
111
|
+
export function namespaceSettled() {
|
|
112
|
+
return priming ?? Promise.resolve(current);
|
|
113
|
+
}
|
|
213
114
|
/** The already-resolved namespace. `local` (with an empty namespace) until
|
|
214
115
|
* `primeNamespace` has been called and settled — the safe default for any
|
|
215
116
|
* caller that never primes, including every existing offline-only test. */
|
|
@@ -220,48 +121,62 @@ export function getNamespace() {
|
|
|
220
121
|
export function resetNamespaceCache() {
|
|
221
122
|
current = LOCAL;
|
|
222
123
|
priming = null;
|
|
124
|
+
settledFlag = true;
|
|
125
|
+
lastAttemptAt = 0;
|
|
126
|
+
primedWith = { opts: {} };
|
|
223
127
|
}
|
|
224
128
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
129
|
+
* The namespace line every anonymize result carries, with the reason when the
|
|
130
|
+
* team exists but was not used - so a fallback is never mistaken for agreement.
|
|
131
|
+
*/
|
|
132
|
+
export function namespaceLine(resolved) {
|
|
133
|
+
if (resolved.source === 'team')
|
|
134
|
+
return 'Namespace: team';
|
|
135
|
+
const { found } = resolved;
|
|
136
|
+
if (found.status === 'locked')
|
|
137
|
+
return 'Namespace: local (the team key is locked on this machine - run `veilio team unlock`)';
|
|
138
|
+
if (found.status === 'unavailable')
|
|
139
|
+
return `Namespace: local (could not read the team's maps: ${found.reason})`;
|
|
140
|
+
return 'Namespace: local';
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The map handed to the engine to anonymize: this project's store and the
|
|
144
|
+
* team's namespace, reconciled so that nothing emitted can mean something else
|
|
145
|
+
* to a teammate (spec 028 R5; this replaced spec 005's "the local placeholder
|
|
146
|
+
* wins", which after a lapse emitted staging's `createInvoice` as __FN__1 - the
|
|
147
|
+
* team's `chargeCustomer`).
|
|
237
148
|
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* existing key, never introduces a second placeholder for an identifier `local`
|
|
241
|
-
* already has under a different one:
|
|
149
|
+
* The two placeholder spaces are numbered independently, so a shared key is
|
|
150
|
+
* coincidence, not identity:
|
|
242
151
|
*
|
|
243
|
-
* -
|
|
244
|
-
*
|
|
245
|
-
* already
|
|
246
|
-
* -
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* on key — is added under the team's placeholder, which is the case two
|
|
253
|
-
* fresh sessions (T044) actually converge through
|
|
152
|
+
* - An identifier the team knows takes the TEAM's placeholder. The project's
|
|
153
|
+
* own placeholder for it is left out (it stays in the store, for restoring
|
|
154
|
+
* text already sent) - one placeholder per identifier, always.
|
|
155
|
+
* - A placeholder the project's store and the team use for DIFFERENT
|
|
156
|
+
* identifiers is used for neither: the store must keep its meaning (text was
|
|
157
|
+
* sent with it; `saveMap` refuses to lose it), and emitting it would mean the
|
|
158
|
+
* team's identifier to every teammate. Both identifiers get fresh numbers.
|
|
159
|
+
* - Everything else - a local entry the team does not contradict, a team entry
|
|
160
|
+
* the store does not contradict - is used as it is.
|
|
254
161
|
*/
|
|
255
162
|
export function mergeNamespace(local, team) {
|
|
256
|
-
const merged = {
|
|
257
|
-
const
|
|
163
|
+
const merged = {};
|
|
164
|
+
const placed = new Set();
|
|
258
165
|
for (const [placeholder, identifier] of Object.entries(team)) {
|
|
259
|
-
if (
|
|
166
|
+
if (placeholder in local && local[placeholder] !== identifier)
|
|
167
|
+
continue;
|
|
168
|
+
if (placed.has(identifier))
|
|
169
|
+
continue;
|
|
170
|
+
merged[placeholder] = identifier;
|
|
171
|
+
placed.add(identifier);
|
|
172
|
+
}
|
|
173
|
+
for (const [placeholder, identifier] of Object.entries(local)) {
|
|
174
|
+
if (placeholder in team && team[placeholder] !== identifier)
|
|
260
175
|
continue;
|
|
261
|
-
if (
|
|
176
|
+
if (placed.has(identifier))
|
|
262
177
|
continue;
|
|
263
178
|
merged[placeholder] = identifier;
|
|
264
|
-
|
|
179
|
+
placed.add(identifier);
|
|
265
180
|
}
|
|
266
181
|
return merged;
|
|
267
182
|
}
|
package/dist/namespace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,iFAAiF;AACjF,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,+EAA+E;AAC/E,8EAA8E;AAC9E,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,wEAAwE;AACxE,+EAA+E;AAC/E,4BAA4B;AAE5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,iFAAiF;AACjF,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,+EAA+E;AAC/E,8EAA8E;AAC9E,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,wEAAwE;AACxE,+EAA+E;AAC/E,4BAA4B;AAE5B,OAAO,EAAE,oBAAoB,EAA4B,MAAM,gCAAgC,CAAA;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AA0B5D,SAAS,SAAS,CAAC,KAA0B;IAC3C,OAAO;QACL,MAAM,EAAE,OAAO;QACf,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,KAAK;QACL,iBAAiB,EAAE,IAAI;KACxB,CAAA;AACH,CAAC;AAED,MAAM,KAAK,GAAsB,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;AAE/D,IAAI,OAAO,GAAsB,KAAK,CAAA;AACtC,IAAI,OAA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CAAA;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;IAChC,KAAK,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7D,IAAI,WAAW,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,UAAU;YAAE,SAAQ;QACvE,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC;YAAE,SAAQ;QACpC,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAA;QAChC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACxB,CAAC;IACD,KAAK,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,IAAI,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,UAAU;YAAE,SAAQ;QACrE,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC;YAAE,SAAQ;QACpC,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAA;QAChC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACxB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
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":"AAuDA,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;AA0QD,eAAO,MAAM,KAAK,EAAE,cAAc,EAiLjC,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
|
@@ -17,9 +17,16 @@
|
|
|
17
17
|
// model does not reach for it out of convenience and quietly defeat the purpose.
|
|
18
18
|
import { readFileSync } from 'node:fs';
|
|
19
19
|
import { isAbsolute, relative, resolve } from 'node:path';
|
|
20
|
-
import { anonymize, detectSecrets, isPlaceholder, restore, summarizeSecrets, withAiPreamble, BIN_NAME, LANGUAGES, LANGUAGE_LABELS, PRODUCT_NAME, } from '@veilio-inc/engine';
|
|
20
|
+
import { anonymize, detectSecrets, isPlaceholder, restore, restoreLayers, disputedNote, locallyNumberedNote, 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';
|
|
22
|
+
import { getNamespace, mergeNamespace, namespaceLine, refreshNamespaceIfStale, } from './namespace.js';
|
|
23
|
+
import { teamLayerNote } from '@veilio-inc/cli/team-namespace';
|
|
24
|
+
/** Said when a tool call has just started reloading the team's maps. */
|
|
25
|
+
function loadingNote(why) {
|
|
26
|
+
return why === 'unlocked'
|
|
27
|
+
? "Note: the team key was unlocked - loading the team's maps now; call again in a moment to use them."
|
|
28
|
+
: "Note: asking Cloud for the team's maps again; call again in a moment to use them.";
|
|
29
|
+
}
|
|
23
30
|
import { getRules } from './rules.js';
|
|
24
31
|
import { describeAge } from '@veilio-inc/cli/rules';
|
|
25
32
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
@@ -137,6 +144,16 @@ const FLOOR_MARKER = '\u0000floor:';
|
|
|
137
144
|
* returned map. Only added above the map's own highest, where they cannot
|
|
138
145
|
* overwrite a real entry. Same technique as the Cloud web app.
|
|
139
146
|
*/
|
|
147
|
+
/** The team's highest number per base, raised to this project's own where higher. */
|
|
148
|
+
function floorsWith(highest, local) {
|
|
149
|
+
const floors = { ...highest };
|
|
150
|
+
for (const placeholder of Object.keys(local)) {
|
|
151
|
+
const m = NUMBERED.exec(placeholder);
|
|
152
|
+
if (m && Number(m[2]) > (floors[m[1]] ?? 0))
|
|
153
|
+
floors[m[1]] = Number(m[2]);
|
|
154
|
+
}
|
|
155
|
+
return floors;
|
|
156
|
+
}
|
|
140
157
|
function anonymizeAbove(source, options, floors) {
|
|
141
158
|
const inMap = {};
|
|
142
159
|
for (const p of Object.keys(options.existingMap)) {
|
|
@@ -166,11 +183,16 @@ function runAnonymize(source, label, args, ctx) {
|
|
|
166
183
|
// independently and a shared key is coincidence, not identity. See
|
|
167
184
|
// mergeNamespace's own comment for why a naive `{ ...local, ...namespace }`
|
|
168
185
|
// corrupts the store (spec 005 US4).
|
|
169
|
-
const
|
|
186
|
+
const refreshing = refreshNamespaceIfStale();
|
|
187
|
+
const resolved = getNamespace();
|
|
188
|
+
const { namespace, highest } = resolved;
|
|
170
189
|
const existingMap = mergeNamespace(localMap, namespace);
|
|
171
190
|
const language = (str(args, 'language') ?? 'auto');
|
|
172
191
|
const rules = getRules();
|
|
173
|
-
|
|
192
|
+
// New names go above the team's numbers AND this project's own: an entry
|
|
193
|
+
// mergeNamespace left out (a lapse-era number) stays in the store, and a new
|
|
194
|
+
// identifier must never be handed its number (spec 028 R5).
|
|
195
|
+
const result = anonymizeAbove(source, { existingMap, language, secrets: 'redact', rules: rules.rules }, floorsWith(highest, localMap));
|
|
174
196
|
// Persist local-original, whatever this call genuinely minted, and only the
|
|
175
197
|
// team-overlay entries this call actually USED — never the rest of the team
|
|
176
198
|
// namespace. Persisting all of it would bake entries this project never
|
|
@@ -179,9 +201,14 @@ function runAnonymize(source, label, args, ctx) {
|
|
|
179
201
|
// resolving through team placeholders while truthfully reporting `local`.
|
|
180
202
|
// Persisting none of it, the other extreme, breaks `restore_text` for a
|
|
181
203
|
// team placeholder that IS sitting in the output this call just returned.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
204
|
+
// Every entry the store already held is kept - including one mergeNamespace
|
|
205
|
+
// left out of this call - because text was already sent with it.
|
|
206
|
+
const toPersist = {
|
|
207
|
+
...localMap,
|
|
208
|
+
...Object.fromEntries(Object.entries(result.map).filter(([placeholder]) => !(placeholder in namespace) ||
|
|
209
|
+
placeholder in localMap ||
|
|
210
|
+
appearsAsToken(result.anonymized, placeholder))),
|
|
211
|
+
};
|
|
185
212
|
saveMap(mapPath, toPersist);
|
|
186
213
|
const body = args.preamble === true ? withAiPreamble(result.anonymized, result.map) : result.anonymized;
|
|
187
214
|
// The model reading this is about to reason over the masked text, and these
|
|
@@ -207,7 +234,8 @@ function runAnonymize(source, label, args, ctx) {
|
|
|
207
234
|
`Placeholders in map: ${Object.keys(toPersist).length}`,
|
|
208
235
|
// Never absent (FR-016, Constitution V): a result that cannot say where its
|
|
209
236
|
// names came from is the silent fallback this line exists to rule out.
|
|
210
|
-
|
|
237
|
+
namespaceLine(resolved),
|
|
238
|
+
...(refreshing ? [loadingNote(refreshing)] : []),
|
|
211
239
|
// Stated every time, like the namespace: an agent whose masking ignored the
|
|
212
240
|
// team's rules must be able to tell.
|
|
213
241
|
rulesLine(rules),
|
|
@@ -291,27 +319,52 @@ export const TOOLS = [
|
|
|
291
319
|
},
|
|
292
320
|
handler: (args, ctx) => {
|
|
293
321
|
const text = str(args, 'text', true);
|
|
294
|
-
const
|
|
295
|
-
|
|
322
|
+
const own = loadMap(resolveMapPath(ctx.mapPath, ctx.cwd));
|
|
323
|
+
// The one restore rule (spec 028), shared with the web app and the CLI:
|
|
324
|
+
// the team's maps - aliases included, disputed placeholders left out -
|
|
325
|
+
// then this project's map on top where it is in the team's numbering.
|
|
326
|
+
const refreshing = refreshNamespaceIfStale();
|
|
327
|
+
const resolved = getNamespace();
|
|
328
|
+
const team = resolved.source === 'team' && resolved.conflictDetection
|
|
329
|
+
? {
|
|
330
|
+
namespace: resolved.namespace,
|
|
331
|
+
aliases: resolved.aliases,
|
|
332
|
+
conflicts: resolved.conflicts,
|
|
333
|
+
}
|
|
334
|
+
: null;
|
|
335
|
+
const unexplained = restore(text, own).report.unresolved;
|
|
336
|
+
const found = resolved.found;
|
|
337
|
+
const note = team ? null : teamLayerNote(found, unexplained);
|
|
338
|
+
if (Object.keys(own).length === 0 && !team && !note) {
|
|
296
339
|
throw new ToolError(`no symbol map yet — run anonymize_file (or "${BIN_NAME} scrub") first`);
|
|
297
340
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
341
|
+
const layers = restoreLayers({ own, team });
|
|
342
|
+
const disputed = layers.disputedIn(text);
|
|
343
|
+
const localOnly = layers.locallyNumberedIn(text);
|
|
344
|
+
const result = restore(text, layers.map);
|
|
345
|
+
// Measured against this project's map, not the whole team layer (review),
|
|
346
|
+
// and a placeholder left for a named reason is not "invented".
|
|
347
|
+
const report = {
|
|
348
|
+
...result.report,
|
|
349
|
+
missing: result.report.missing.filter((p) => p in own),
|
|
350
|
+
unresolved: result.report.unresolved.filter((p) => !disputed.includes(p) && !localOnly.includes(p)),
|
|
351
|
+
};
|
|
352
|
+
const counted = new Set([...Object.keys(own), ...result.report.resolved]).size;
|
|
353
|
+
const warnings = [
|
|
354
|
+
...(refreshing ? [loadingNote(refreshing)] : []),
|
|
355
|
+
...(note ? [`WARNING: ${note}`] : []),
|
|
356
|
+
...(disputed.length ? [`WARNING: ${disputedNote(disputed)}`] : []),
|
|
357
|
+
...(localOnly.length ? [`WARNING: ${locallyNumberedNote(localOnly)}`] : []),
|
|
358
|
+
];
|
|
359
|
+
// Unrestored team placeholders because the team's maps could not be used
|
|
360
|
+
// (locked, unreadable): not a success, whatever else restored (FR-005).
|
|
361
|
+
const failed = found.status === 'locked' || found.status === 'unavailable';
|
|
311
362
|
return {
|
|
312
|
-
|
|
363
|
+
isError: note !== null && failed,
|
|
364
|
+
text: `Restored ${result.report.resolved.length} of ${counted} placeholders; ` +
|
|
313
365
|
`stripped ${result.strippedCount} AI artifact(s).` +
|
|
314
|
-
`${restoreReportLines(
|
|
366
|
+
`${restoreReportLines(report)}` +
|
|
367
|
+
`${warnings.length ? `\n\n${warnings.join('\n')}` : ''}\n\n--- restored ---\n${result.restored}`,
|
|
315
368
|
};
|
|
316
369
|
},
|
|
317
370
|
},
|
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,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,QAAQ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,EAAE,IAAI,EAAE,CAAA;IAC/D,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veilio-inc/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
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.3.
|
|
30
|
+
"@veilio-inc/engine": "^1.7.0",
|
|
31
|
+
"@veilio-inc/cli": "^0.3.2"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsc",
|