@percher/shared 0.1.7 → 0.1.9

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/index.d.ts CHANGED
@@ -2,8 +2,9 @@ export { APP_NAME_RE } from "./app-name.js";
2
2
  export { INTERNAL_SIG_HEADER, INTERNAL_SIG_MAX_SKEW_MS, INTERNAL_SIG_VERSION, INTERNAL_TS_HEADER, type InternalSigParts, internalSigPayload, } from "./internal-sig.js";
3
3
  export { MAX_INLINE_PUBLISH_BYTES, MAX_OPEN_UPLOAD_SESSIONS_PER_USER, MAX_TARBALL_BYTES, MAX_UPLOAD_CHUNK_BYTES, MAX_UPLOAD_SESSION_FILES, MIN_UPLOAD_CHUNK_BYTES, UPLOAD_SESSION_MAX_LIFETIME_MS, UPLOAD_SESSION_TTL_MS, } from "./limits.js";
4
4
  export { MAX_LOG_SEARCH_LENGTH } from "./logs.js";
5
- export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, } from "./platform.js";
5
+ export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, MCP_TOOL_COUNT_HOSTED, MCP_TOOL_COUNT_LOCAL, } from "./platform.js";
6
6
  export { canonicalInjectedKey, isPercherInjected, PERCHER_INJECTED_ENV_KEYS, } from "./platform-env.js";
7
7
  export { DEFAULT_NODE_VERSION_LABEL, DEFAULT_NODE_VERSION_MAJOR } from "./runtime.js";
8
8
  export { TIMEOUTS, type TimeoutKey } from "./timeouts.js";
9
+ export { WAITLIST_THROTTLE_WINDOW_MS } from "./waitlist.js";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB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AC;AACxB,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@ export { APP_NAME_RE } from "./app-name.js";
2
2
  export { INTERNAL_SIG_HEADER, INTERNAL_SIG_MAX_SKEW_MS, INTERNAL_SIG_VERSION, INTERNAL_TS_HEADER, internalSigPayload, } from "./internal-sig.js";
3
3
  export { MAX_INLINE_PUBLISH_BYTES, MAX_OPEN_UPLOAD_SESSIONS_PER_USER, MAX_TARBALL_BYTES, MAX_UPLOAD_CHUNK_BYTES, MAX_UPLOAD_SESSION_FILES, MIN_UPLOAD_CHUNK_BYTES, UPLOAD_SESSION_MAX_LIFETIME_MS, UPLOAD_SESSION_TTL_MS, } from "./limits.js";
4
4
  export { MAX_LOG_SEARCH_LENGTH } from "./logs.js";
5
- export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, } from "./platform.js";
5
+ export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, MCP_TOOL_COUNT_HOSTED, MCP_TOOL_COUNT_LOCAL, } from "./platform.js";
6
6
  export { canonicalInjectedKey, isPercherInjected, PERCHER_INJECTED_ENV_KEYS, } from "./platform-env.js";
7
7
  export { DEFAULT_NODE_VERSION_LABEL, DEFAULT_NODE_VERSION_MAJOR } from "./runtime.js";
8
8
  export { TIMEOUTS } from "./timeouts.js";
9
+ export { WAITLIST_THROTTLE_WINDOW_MS } from "./waitlist.js";
9
10
  //# 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":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAElB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAmB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAElB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAmB,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Public legal-document versions used by both the dashboard and API.
3
+ *
4
+ * Keep these values in lock-step with the canonical files under legal/. The
5
+ * acceptance version is selected by trusted server code, never by a browser
6
+ * header.
7
+ */
8
+ export declare const LEGAL_DOCUMENT_VERSIONS: {
9
+ readonly terms: "2.1";
10
+ readonly aup: "2.1";
11
+ readonly privacy: "2.1";
12
+ };
13
+ export declare const CURRENT_TERMS_VERSION: "2.1";
14
+ export declare const LEGAL_DOCUMENT_LAST_UPDATED = "10 August 2026";
15
+ //# sourceMappingURL=legal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal.d.ts","sourceRoot":"","sources":["../src/legal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAEX,eAAO,MAAM,qBAAqB,OAAgC,CAAC;AACnE,eAAO,MAAM,2BAA2B,mBAAmB,CAAC"}
package/dist/legal.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Public legal-document versions used by both the dashboard and API.
3
+ *
4
+ * Keep these values in lock-step with the canonical files under legal/. The
5
+ * acceptance version is selected by trusted server code, never by a browser
6
+ * header.
7
+ */
8
+ export const LEGAL_DOCUMENT_VERSIONS = {
9
+ terms: "2.1",
10
+ aup: "2.1",
11
+ privacy: "2.1",
12
+ };
13
+ export const CURRENT_TERMS_VERSION = LEGAL_DOCUMENT_VERSIONS.terms;
14
+ export const LEGAL_DOCUMENT_LAST_UPDATED = "10 August 2026";
15
+ //# sourceMappingURL=legal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal.js","sourceRoot":"","sources":["../src/legal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE,KAAK;IACZ,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,KAAK;CACN,CAAC;AAEX,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,KAAK,CAAC;AACnE,MAAM,CAAC,MAAM,2BAA2B,GAAG,gBAAgB,CAAC"}
@@ -11,4 +11,21 @@ export declare const DEFAULT_POCKETBASE_IMAGE = "percher/pocketbase:0.39.9";
11
11
  export declare const DEFAULT_DOMAIN_SUFFIX = "percher.run";
12
12
  /** Default hosted-MCP HTTP port when PERCHER_MCP_HTTP_PORT is unset. */
13
13
  export declare const DEFAULT_MCP_HTTP_PORT = 8787;
14
+ /**
15
+ * Number of tools the LOCAL stdio MCP server registers, and the number the
16
+ * HOSTED connector exposes (a deny-by-default allowlist — a strict subset in
17
+ * spirit, though it also carries a few hosted-only names).
18
+ *
19
+ * These live here so public copy can state a figure without importing
20
+ * `@percher/mcp` (the dashboard doesn't depend on it). They are NOT the source
21
+ * of truth: `packages/mcp/test/tools.test.ts` asserts the real registry and
22
+ * allowlist match these constants, so bumping the tool set fails the build
23
+ * until the number is updated in exactly one place.
24
+ *
25
+ * The previous arrangement hardcoded the count in six unrelated files; they
26
+ * drifted to three different values (51/52/53), and one shipped artifact
27
+ * disagreed with itself on two lines.
28
+ */
29
+ export declare const MCP_TOOL_COUNT_LOCAL = 53;
30
+ export declare const MCP_TOOL_COUNT_HOSTED = 22;
14
31
  //# sourceMappingURL=platform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,OAAO,CAAC"}
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,qBAAqB,KAAK,CAAC"}
package/dist/platform.js CHANGED
@@ -11,4 +11,21 @@ export const DEFAULT_POCKETBASE_IMAGE = "percher/pocketbase:0.39.9";
11
11
  export const DEFAULT_DOMAIN_SUFFIX = "percher.run";
12
12
  /** Default hosted-MCP HTTP port when PERCHER_MCP_HTTP_PORT is unset. */
13
13
  export const DEFAULT_MCP_HTTP_PORT = 8787;
14
+ /**
15
+ * Number of tools the LOCAL stdio MCP server registers, and the number the
16
+ * HOSTED connector exposes (a deny-by-default allowlist — a strict subset in
17
+ * spirit, though it also carries a few hosted-only names).
18
+ *
19
+ * These live here so public copy can state a figure without importing
20
+ * `@percher/mcp` (the dashboard doesn't depend on it). They are NOT the source
21
+ * of truth: `packages/mcp/test/tools.test.ts` asserts the real registry and
22
+ * allowlist match these constants, so bumping the tool set fails the build
23
+ * until the number is updated in exactly one place.
24
+ *
25
+ * The previous arrangement hardcoded the count in six unrelated files; they
26
+ * drifted to three different values (51/52/53), and one shipped artifact
27
+ * disagreed with itself on two lines.
28
+ */
29
+ export const MCP_TOOL_COUNT_LOCAL = 53;
30
+ export const MCP_TOOL_COUNT_HOSTED = 22;
14
31
  //# sourceMappingURL=platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE,qEAAqE;AACrE,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAEnD,wEAAwE;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE,qEAAqE;AACrE,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAEnD,wEAAwE;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../src/timeouts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;OAKG;;IAGH;;;;;;OAMG;;IAGH;;;;;OAKG;;IAGH,2CAA2C;;IAG3C,2CAA2C;;IAG3C,uEAAuE;;IAGvE;;;;;;OAMG;;CAEK,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,QAAQ,CAAC"}
1
+ {"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../src/timeouts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;OAKG;aACH,qBAAqB;IAErB;;;;;;OAMG;aACH,qBAAqB;IAErB;;;;;OAKG;aACH,iBAAiB;IAEjB,2CAA2C;aAC3C,iBAAiB,EAAE,IAAK;IAExB,2CAA2C;aAC3C,YAAY,EAAE,KAAM;IAEpB,uEAAuE;aACvE,oBAAoB,EAAE,KAAM;IAE5B;;;;;;OAMG;aACH,gBAAgB;CACR,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Rolling window for the waitlist's per-IP throttle.
3
+ *
4
+ * It is also, exactly, how long that IP address is kept. The waitlist row holds
5
+ * an email address and the IP the submission came from, and the IP has ONE
6
+ * purpose: counting a single submitter's inserts inside this window. Once the
7
+ * window has passed the value can never be read again, so keeping it is storage
8
+ * without a purpose (GDPR Art. 5.1.b/e) next to an email address that identifies
9
+ * the person — which is what makes the pair worth separating on a clock.
10
+ *
11
+ * Lives in `@percher/shared` because two processes act on it and they must not
12
+ * drift: the dashboard enforces the throttle and clears expired IPs on each
13
+ * submission, and the API's retention sweep clears them when submissions stop.
14
+ * A backstop shorter than the throttle window would delete IPs the throttle
15
+ * still needs and silently stop rate-limiting.
16
+ */
17
+ export declare const WAITLIST_THROTTLE_WINDOW_MS: number;
18
+ //# sourceMappingURL=waitlist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitlist.d.ts","sourceRoot":"","sources":["../src/waitlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Rolling window for the waitlist's per-IP throttle.
3
+ *
4
+ * It is also, exactly, how long that IP address is kept. The waitlist row holds
5
+ * an email address and the IP the submission came from, and the IP has ONE
6
+ * purpose: counting a single submitter's inserts inside this window. Once the
7
+ * window has passed the value can never be read again, so keeping it is storage
8
+ * without a purpose (GDPR Art. 5.1.b/e) next to an email address that identifies
9
+ * the person — which is what makes the pair worth separating on a clock.
10
+ *
11
+ * Lives in `@percher/shared` because two processes act on it and they must not
12
+ * drift: the dashboard enforces the throttle and clears expired IPs on each
13
+ * submission, and the API's retention sweep clears them when submissions stop.
14
+ * A backstop shorter than the throttle window would delete IPs the throttle
15
+ * still needs and silently stop rate-limiting.
16
+ */
17
+ export const WAITLIST_THROTTLE_WINDOW_MS = 60 * 60 * 1000;
18
+ //# sourceMappingURL=waitlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitlist.js","sourceRoot":"","sources":["../src/waitlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percher/shared",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Shared constants and contracts (timeouts, etc.) used across the Percher CLI, API, MCP, and worker. Internal — values change in lockstep across packages.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",