@veilio-inc/cli 0.2.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/dist/rules.js ADDED
@@ -0,0 +1,103 @@
1
+ // The account's custom rules, cached on this machine.
2
+ //
3
+ // Custom rules are defined in the web app and live in Cloud. Before this file
4
+ // the terminal and the MCP server never applied them: the same code masked
5
+ // differently in the browser than in `veilio scrub`, and a whitelisted name
6
+ // that the browser left readable came back as a placeholder here (found on
7
+ // staging, 2026-09-26).
8
+ //
9
+ // `veilio scrub` must stay offline (see offline.test.ts), so it cannot ask Cloud
10
+ // for them. `veilio rules pull` fetches them and writes this cache; `scrub`
11
+ // applies what the cache holds and says how old it is. Reads tolerate absence
12
+ // and damage the way credential.ts does: a broken cache reads as "no rules",
13
+ // never as a failed scrub.
14
+ import { chmodSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
15
+ import { dirname, join } from 'node:path';
16
+ import { homedir } from 'node:os';
17
+ import { STORE_DIR } from '@veilio-inc/engine';
18
+ export const RULES_FILE = 'rules.json';
19
+ export function rulesPath(home = homedir()) {
20
+ return join(home, STORE_DIR, RULES_FILE);
21
+ }
22
+ /**
23
+ * Personal and team rules in the order the web app applies them:
24
+ * team whitelist, personal whitelist, team replace, personal replace.
25
+ *
26
+ * Whitelists first so a name either list keeps readable is never renamed by a
27
+ * replace rule; team before personal so the team's naming wins on a clash,
28
+ * which is what keeps two members' output interchangeable. Disabled rules are
29
+ * dropped and sort_order renumbered 0..n-1, so the engine sees one sequence.
30
+ * Must match `useMergedRules` in the Cloud frontend.
31
+ */
32
+ export function mergeRules(personal, team) {
33
+ const byOrder = (a, b) => a.sort_order - b.sort_order;
34
+ const on = (list, type) => list.filter((r) => r.enabled && r.type === type).sort(byOrder);
35
+ return [
36
+ ...on(team, 'whitelist'),
37
+ ...on(personal, 'whitelist'),
38
+ ...on(team, 'replace'),
39
+ ...on(personal, 'replace'),
40
+ ].map((r, i) => ({ ...r, sort_order: i }));
41
+ }
42
+ function isRule(value) {
43
+ if (typeof value !== 'object' || value === null)
44
+ return false;
45
+ const r = value;
46
+ if (typeof r.pattern !== 'string' || typeof r.sort_order !== 'number')
47
+ return false;
48
+ if (r.type === 'whitelist')
49
+ return true;
50
+ return r.type === 'replace' && typeof r.placeholder === 'string';
51
+ }
52
+ /** The cached rules for this account, or null. Null for every kind of failure. */
53
+ export function readRules(owner, home = homedir()) {
54
+ let parsed;
55
+ try {
56
+ parsed = JSON.parse(readFileSync(rulesPath(home), 'utf8'));
57
+ }
58
+ catch {
59
+ return null;
60
+ }
61
+ if (typeof parsed !== 'object' || parsed === null)
62
+ return null;
63
+ const c = parsed;
64
+ if (c.instance !== owner.instance || c.account !== owner.account)
65
+ return null;
66
+ if (typeof c.pulledAt !== 'string' || !Array.isArray(c.rules) || !c.rules.every(isRule)) {
67
+ return null;
68
+ }
69
+ return parsed;
70
+ }
71
+ /** 0600: the patterns name what a team considers sensitive. */
72
+ export function writeRules(cached, home = homedir()) {
73
+ const path = rulesPath(home);
74
+ mkdirSync(dirname(path), { recursive: true });
75
+ writeFileSync(path, `${JSON.stringify(cached, null, 2)}\n`, { mode: 0o600 });
76
+ chmodSync(path, 0o600);
77
+ }
78
+ /** Remove the cache. Missing is not an error; failing to delete is. */
79
+ export function removeRules(home = homedir()) {
80
+ const path = rulesPath(home);
81
+ try {
82
+ statSync(path);
83
+ }
84
+ catch {
85
+ return false;
86
+ }
87
+ rmSync(path, { recursive: true, force: true });
88
+ return true;
89
+ }
90
+ /** "3 hours ago" - coarse on purpose; it answers "is this stale", no more. */
91
+ export function describeAge(pulledAt, now = new Date()) {
92
+ const ms = now.getTime() - new Date(pulledAt).getTime();
93
+ if (!Number.isFinite(ms))
94
+ return 'at an unknown time';
95
+ const minutes = Math.max(0, Math.floor(ms / 60_000));
96
+ if (minutes < 60)
97
+ return minutes <= 1 ? 'just now' : `${minutes} minutes ago`;
98
+ const hours = Math.floor(minutes / 60);
99
+ if (hours < 48)
100
+ return `${hours} hour${hours === 1 ? '' : 's'} ago`;
101
+ return `${Math.floor(hours / 24)} days ago`;
102
+ }
103
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.js","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,4EAA4E;AAC5E,2EAA2E;AAC3E,wBAAwB;AACxB,EAAE;AACF,iFAAiF;AACjF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,2BAA2B;AAE3B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,SAAS,EAAmB,MAAM,oBAAoB,CAAA;AAE/D,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAA;AAYtC,MAAM,UAAU,SAAS,CAAC,OAAe,OAAO,EAAE;IAChD,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;AAC1C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,QAA+B,EAC/B,IAA2B;IAE3B,MAAM,OAAO,GAAG,CAAC,CAAa,EAAE,CAAa,EAAU,EAAE,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAA;IACrF,MAAM,EAAE,GAAG,CAAC,IAA2B,EAAE,IAAwB,EAAgB,EAAE,CACjF,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC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QAAgB,EAAE,MAAY,IAAI,IAAI,EAAE;IAClE,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAA;IACvD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAAE,OAAO,oBAAoB,CAAA;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAA;IACpD,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,cAAc,CAAA;IAC7E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAA;IACtC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAA;IACnE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,WAAW,CAAA;AAC7C,CAAC"}
@@ -0,0 +1,49 @@
1
+ export declare const TEAM_UNLOCK_FILE = "team-keys.json";
2
+ /** How long an unlock lasts unless asked for something shorter. */
3
+ export declare const DEFAULT_UNLOCK_DAYS = 7;
4
+ export interface StoredTeamKey {
5
+ version: number;
6
+ /** Raw AES-256 key, base64. */
7
+ key: string;
8
+ }
9
+ export interface TeamUnlock {
10
+ v: 1;
11
+ /** Bound to the instance and account that unlocked it, so a file left behind
12
+ * by one sign-in is never used by another. The same reasoning as the wrap
13
+ * context: material that is valid somewhere must not be valid everywhere. */
14
+ instance: string;
15
+ account: string;
16
+ teamId: string;
17
+ /** ISO-8601. Past this, reads return null and the file is ignored. */
18
+ expiresAt: string;
19
+ keys: StoredTeamKey[];
20
+ }
21
+ /** Where the unlocked keys live: beside the credential, not in a project. */
22
+ export declare function teamUnlockPath(home?: string): string;
23
+ /**
24
+ * The unlocked keys, or null.
25
+ *
26
+ * Null means "not unlocked", for every reason it can mean that. `now` is
27
+ * injectable so the expiry can be tested without waiting a week.
28
+ */
29
+ export declare function readTeamUnlock(binding: {
30
+ instance: string;
31
+ account: string;
32
+ }, home?: string, now?: Date): TeamUnlock | null;
33
+ /** Write the unlocked keys, readable only by this user. */
34
+ export declare function writeTeamUnlock(unlock: TeamUnlock, home?: string): void;
35
+ /**
36
+ * Remove the unlocked keys. Returns whether there were any to remove.
37
+ *
38
+ * Called by `team lock` and by `logout` — signing out must not leave live team
39
+ * keys behind, which would be exactly the gap between what a person believes
40
+ * they revoked and what is still readable on disk.
41
+ *
42
+ * A failure to DELETE throws rather than returning false, for the reason
43
+ * `removeCredential` gives: reporting "nothing to remove" while key material
44
+ * sits there inverts the whole point of the call.
45
+ */
46
+ export declare function removeTeamUnlock(home?: string): boolean;
47
+ /** When an unlock made now should expire. */
48
+ export declare function expiryFrom(now: Date, days?: number): string;
49
+ //# sourceMappingURL=team-unlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-unlock.d.ts","sourceRoot":"","sources":["../src/team-unlock.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,gBAAgB,mBAAmB,CAAA;AAEhD,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,IAAI,CAAA;AAEpC,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,CAAC,CAAA;IACJ;;kFAE8E;IAC9E,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,aAAa,EAAE,CAAA;CACtB;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAE/D;AAiBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC9C,IAAI,GAAE,MAAkB,EACxB,GAAG,GAAE,IAAiB,GACrB,UAAU,GAAG,IAAI,CAyBnB;AAED,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,MAAkB,GAAG,IAAI,CAQlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAAkB,GAAG,OAAO,CASlE;AAED,6CAA6C;AAC7C,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,GAAE,MAA4B,GAAG,MAAM,CAEhF"}
@@ -0,0 +1,134 @@
1
+ // The team keys, unlocked for processes that have nobody to ask.
2
+ //
3
+ // An MCP server starts inside a coding agent. There is no terminal attached and
4
+ // no one present to type a vault passphrase, so a key it needs must have been
5
+ // put here by an earlier run in a terminal where somebody was. `veilio team
6
+ // unlock` is that run.
7
+ //
8
+ // WHAT THIS FILE HOLDS, AND WHY IT IS THE NARROWER OF TWO BAD OPTIONS
9
+ //
10
+ // It holds unwrapped TEAM keys. The obvious alternative — storing the vault key
11
+ // and re-deriving everything per process — is worse in every direction that
12
+ // matters: the vault key also opens every personal map, and unwraps the private
13
+ // key, which in turn opens any wrap ever addressed to this account, including
14
+ // ones granted after the file was written. A team key opens team maps and
15
+ // nothing else, and a team already shares them by construction.
16
+ //
17
+ // It is still real key material at rest. Whoever holds this file can read the
18
+ // team's maps until the keys rotate. It is written 0600 beside the session
19
+ // token, which is the same posture the token itself gets, and it expires — so a
20
+ // machine compromised weeks after somebody ran `unlock` does not hand over a
21
+ // live key for a forgotten session.
22
+ //
23
+ // WHAT IT DOES NOT SURVIVE
24
+ //
25
+ // A rotation. Removing a member mints a new version, and the copy here is of
26
+ // the old one, so maps rewritten under the new key stop opening. That is
27
+ // deliberate: the stale file degrades into "some maps cannot be read", which
28
+ // `decryptTeamMapWithAny` already handles by skipping them, rather than into
29
+ // continued access a rotation was meant to end. Re-running `unlock` picks up
30
+ // the new version.
31
+ //
32
+ // Reads tolerate everything, exactly as `credential.ts` does: a missing file,
33
+ // a corrupt one, an expired one and one belonging to another account all mean
34
+ // the same thing to every caller — not unlocked, resolve locally.
35
+ import { chmodSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
36
+ import { dirname, join } from 'node:path';
37
+ import { homedir } from 'node:os';
38
+ import { STORE_DIR } from '@veilio-inc/engine';
39
+ export const TEAM_UNLOCK_FILE = 'team-keys.json';
40
+ /** How long an unlock lasts unless asked for something shorter. */
41
+ export const DEFAULT_UNLOCK_DAYS = 7;
42
+ /** Where the unlocked keys live: beside the credential, not in a project. */
43
+ export function teamUnlockPath(home = homedir()) {
44
+ return join(home, STORE_DIR, TEAM_UNLOCK_FILE);
45
+ }
46
+ function isTeamUnlock(value) {
47
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
48
+ return false;
49
+ const u = value;
50
+ if (u.v !== 1)
51
+ return false;
52
+ for (const field of ['instance', 'account', 'teamId', 'expiresAt']) {
53
+ if (typeof u[field] !== 'string' || u[field] === '')
54
+ return false;
55
+ }
56
+ if (!Array.isArray(u.keys) || u.keys.length === 0)
57
+ return false;
58
+ return u.keys.every((k) => {
59
+ if (typeof k !== 'object' || k === null)
60
+ return false;
61
+ const key = k;
62
+ return typeof key.version === 'number' && typeof key.key === 'string' && key.key !== '';
63
+ });
64
+ }
65
+ /**
66
+ * The unlocked keys, or null.
67
+ *
68
+ * Null means "not unlocked", for every reason it can mean that. `now` is
69
+ * injectable so the expiry can be tested without waiting a week.
70
+ */
71
+ export function readTeamUnlock(binding, home = homedir(), now = new Date()) {
72
+ let raw;
73
+ try {
74
+ raw = readFileSync(teamUnlockPath(home), 'utf8');
75
+ }
76
+ catch {
77
+ return null;
78
+ }
79
+ let parsed;
80
+ try {
81
+ parsed = JSON.parse(raw);
82
+ }
83
+ catch {
84
+ return null;
85
+ }
86
+ if (!isTeamUnlock(parsed))
87
+ return null;
88
+ // Someone else's unlock, or one from another instance. Not an error — a
89
+ // machine can be signed in to a self-hosted instance today and to the hosted
90
+ // one tomorrow, and the leftover file is simply not ours.
91
+ if (parsed.instance !== binding.instance || parsed.account !== binding.account)
92
+ return null;
93
+ const expiresAt = Date.parse(parsed.expiresAt);
94
+ if (Number.isNaN(expiresAt) || expiresAt <= now.getTime())
95
+ return null;
96
+ return parsed;
97
+ }
98
+ /** Write the unlocked keys, readable only by this user. */
99
+ export function writeTeamUnlock(unlock, home = homedir()) {
100
+ const path = teamUnlockPath(home);
101
+ mkdirSync(dirname(path), { recursive: true });
102
+ // `chmodSync` after the write for the same reason `writeCredential` does it:
103
+ // `mode` applies only when the file is created, so re-unlocking over a
104
+ // world-readable file left from an earlier mistake would keep it that way.
105
+ writeFileSync(path, `${JSON.stringify(unlock, null, 2)}\n`, { mode: 0o600 });
106
+ chmodSync(path, 0o600);
107
+ }
108
+ /**
109
+ * Remove the unlocked keys. Returns whether there were any to remove.
110
+ *
111
+ * Called by `team lock` and by `logout` — signing out must not leave live team
112
+ * keys behind, which would be exactly the gap between what a person believes
113
+ * they revoked and what is still readable on disk.
114
+ *
115
+ * A failure to DELETE throws rather than returning false, for the reason
116
+ * `removeCredential` gives: reporting "nothing to remove" while key material
117
+ * sits there inverts the whole point of the call.
118
+ */
119
+ export function removeTeamUnlock(home = homedir()) {
120
+ const path = teamUnlockPath(home);
121
+ try {
122
+ statSync(path);
123
+ }
124
+ catch {
125
+ return false;
126
+ }
127
+ rmSync(path, { recursive: true, force: true });
128
+ return true;
129
+ }
130
+ /** When an unlock made now should expire. */
131
+ export function expiryFrom(now, days = DEFAULT_UNLOCK_DAYS) {
132
+ return new Date(now.getTime() + days * 24 * 60 * 60 * 1000).toISOString();
133
+ }
134
+ //# sourceMappingURL=team-unlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-unlock.js","sourceRoot":"","sources":["../src/team-unlock.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,4EAA4E;AAC5E,uBAAuB;AACvB,EAAE;AACF,sEAAsE;AACtE,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,0EAA0E;AAC1E,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,gFAAgF;AAChF,6EAA6E;AAC7E,oCAAoC;AACpC,EAAE;AACF,2BAA2B;AAC3B,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,mBAAmB;AACnB,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,kEAAkE;AAElE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAA;AAEhD,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAqBpC,6EAA6E;AAC7E,MAAM,UAAU,cAAc,CAAC,OAAe,OAAO,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAA;AAChD,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC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AG,cAAc,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,CAAC;QACH,QAAQ,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IAC9C,OAAO,IAAI,CAAA;AACb,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,UAAU,CAAC,GAAS,EAAE,OAAe,mBAAmB;IACtE,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAA;AAC3E,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veilio-inc/cli",
3
- "version": "0.2.0",
4
- "description": "Anonymize identifiers and redact credentials in source code before it reaches an LLM — from the terminal, a pipe, or a pre-commit hook.",
3
+ "version": "0.3.0",
4
+ "description": "Anonymize identifiers and redact credentials in source code before it reaches an LLM \u2014 from the terminal, a pipe, or a pre-commit hook.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "veilio": "dist/index.js"
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "license": "SEE LICENSE IN LICENSE",
30
30
  "dependencies": {
31
- "@veilio-inc/engine": "^1.6.0"
31
+ "@veilio-inc/engine": "^1.6.2"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "tsc",
@@ -47,7 +47,9 @@
47
47
  ".": "./dist/index.js",
48
48
  "./store": "./dist/store.js",
49
49
  "./credential": "./dist/credential.js",
50
- "./cloud": "./dist/cloud.js"
50
+ "./cloud": "./dist/cloud.js",
51
+ "./team-unlock": "./dist/team-unlock.js",
52
+ "./rules": "./dist/rules.js"
51
53
  },
52
54
  "repository": {
53
55
  "type": "git",