@percher/shared 0.1.6 → 0.1.8
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 +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/internal-sig.d.ts +40 -0
- package/dist/internal-sig.d.ts.map +1 -0
- package/dist/internal-sig.js +36 -0
- package/dist/internal-sig.js.map +1 -0
- package/dist/limits.d.ts +33 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +33 -0
- package/dist/limits.js.map +1 -1
- package/dist/platform.d.ts +14 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +14 -0
- package/dist/platform.js.map +1 -0
- package/dist/waitlist.d.ts +18 -0
- package/dist/waitlist.d.ts.map +1 -0
- package/dist/waitlist.js +18 -0
- package/dist/waitlist.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { APP_NAME_RE } from "./app-name.js";
|
|
2
|
-
export {
|
|
2
|
+
export { INTERNAL_SIG_HEADER, INTERNAL_SIG_MAX_SKEW_MS, INTERNAL_SIG_VERSION, INTERNAL_TS_HEADER, type InternalSigParts, internalSigPayload, } from "./internal-sig.js";
|
|
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";
|
|
3
4
|
export { MAX_LOG_SEARCH_LENGTH } from "./logs.js";
|
|
5
|
+
export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, } from "./platform.js";
|
|
4
6
|
export { canonicalInjectedKey, isPercherInjected, PERCHER_INJECTED_ENV_KEYS, } from "./platform-env.js";
|
|
5
7
|
export { DEFAULT_NODE_VERSION_LABEL, DEFAULT_NODE_VERSION_MAJOR } from "./runtime.js";
|
|
6
8
|
export { TIMEOUTS, type TimeoutKey } from "./timeouts.js";
|
|
9
|
+
export { WAITLIST_THROTTLE_WINDOW_MS } from "./waitlist.js";
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,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,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { APP_NAME_RE } from "./app-name.js";
|
|
2
|
-
export {
|
|
2
|
+
export { INTERNAL_SIG_HEADER, INTERNAL_SIG_MAX_SKEW_MS, INTERNAL_SIG_VERSION, INTERNAL_TS_HEADER, internalSigPayload, } from "./internal-sig.js";
|
|
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";
|
|
3
4
|
export { MAX_LOG_SEARCH_LENGTH } from "./logs.js";
|
|
5
|
+
export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, } from "./platform.js";
|
|
4
6
|
export { canonicalInjectedKey, isPercherInjected, PERCHER_INJECTED_ENV_KEYS, } from "./platform-env.js";
|
|
5
7
|
export { DEFAULT_NODE_VERSION_LABEL, DEFAULT_NODE_VERSION_MAJOR } from "./runtime.js";
|
|
6
8
|
export { TIMEOUTS } from "./timeouts.js";
|
|
9
|
+
export { WAITLIST_THROTTLE_WINDOW_MS } from "./waitlist.js";
|
|
7
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,
|
|
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;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contract for X-Internal-Secret HMAC request signing.
|
|
3
|
+
*
|
|
4
|
+
* The legacy scheme sends the shared internal secret verbatim in a header, so a
|
|
5
|
+
* single captured/logged request grants every `/internal/*` endpoint forever.
|
|
6
|
+
* Signing binds a credential to one (method, path, body, timestamp): a captured
|
|
7
|
+
* request can't be replayed against a different endpoint or outside the skew
|
|
8
|
+
* window, and the raw secret never has to ride on the wire once enforce is on.
|
|
9
|
+
*
|
|
10
|
+
* This module is the single source of truth for the canonical string both sides
|
|
11
|
+
* HMAC, so the API verifier and every signer (the dashboard today; the external
|
|
12
|
+
* CLABBE runner per docs/integrations/CLABBE_SECURITY_INGEST.md) can't drift. It
|
|
13
|
+
* is dependency-free on purpose — no crypto here — so it bundles cleanly into the
|
|
14
|
+
* dashboard (Node) as well as the API (Bun). Each side wraps it with its own
|
|
15
|
+
* `node:crypto` HMAC.
|
|
16
|
+
*/
|
|
17
|
+
/** Hex HMAC-SHA256 of {@link internalSigPayload}, keyed with the shared secret. */
|
|
18
|
+
export declare const INTERNAL_SIG_HEADER = "X-Internal-Signature";
|
|
19
|
+
/** Unix-epoch milliseconds (as a decimal string) the signature was minted at. */
|
|
20
|
+
export declare const INTERNAL_TS_HEADER = "X-Internal-Timestamp";
|
|
21
|
+
/** Reject a signed request whose timestamp is more than this far from now. */
|
|
22
|
+
export declare const INTERNAL_SIG_MAX_SKEW_MS = 300000;
|
|
23
|
+
/** Canonical-form version. Bumps if the payload shape changes; a verifier can
|
|
24
|
+
* refuse a version it doesn't understand rather than mis-compare. */
|
|
25
|
+
export declare const INTERNAL_SIG_VERSION = "v1";
|
|
26
|
+
export interface InternalSigParts {
|
|
27
|
+
/** HTTP method, case-insensitive — normalized to upper-case in the payload. */
|
|
28
|
+
method: string;
|
|
29
|
+
/** Request path WITHOUT query string, exactly as it appears on the wire
|
|
30
|
+
* (already-percent-encoded; sign what you send). */
|
|
31
|
+
path: string;
|
|
32
|
+
/** The value placed in {@link INTERNAL_TS_HEADER}. Stringified verbatim so the
|
|
33
|
+
* verifier signs the exact header bytes — no Number round-trip. */
|
|
34
|
+
timestamp: number | string;
|
|
35
|
+
/** Lower-case hex SHA-256 of the raw request body ("" body → sha256 of ""). */
|
|
36
|
+
bodyHash: string;
|
|
37
|
+
}
|
|
38
|
+
/** The exact string both the signer and verifier feed to HMAC-SHA256. */
|
|
39
|
+
export declare function internalSigPayload(parts: InternalSigParts): string;
|
|
40
|
+
//# sourceMappingURL=internal-sig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-sig.d.ts","sourceRoot":"","sources":["../src/internal-sig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAC1D,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAEzD,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAEhD;sEACsE;AACtE,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf;yDACqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb;wEACoE;IACpE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAQlE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contract for X-Internal-Secret HMAC request signing.
|
|
3
|
+
*
|
|
4
|
+
* The legacy scheme sends the shared internal secret verbatim in a header, so a
|
|
5
|
+
* single captured/logged request grants every `/internal/*` endpoint forever.
|
|
6
|
+
* Signing binds a credential to one (method, path, body, timestamp): a captured
|
|
7
|
+
* request can't be replayed against a different endpoint or outside the skew
|
|
8
|
+
* window, and the raw secret never has to ride on the wire once enforce is on.
|
|
9
|
+
*
|
|
10
|
+
* This module is the single source of truth for the canonical string both sides
|
|
11
|
+
* HMAC, so the API verifier and every signer (the dashboard today; the external
|
|
12
|
+
* CLABBE runner per docs/integrations/CLABBE_SECURITY_INGEST.md) can't drift. It
|
|
13
|
+
* is dependency-free on purpose — no crypto here — so it bundles cleanly into the
|
|
14
|
+
* dashboard (Node) as well as the API (Bun). Each side wraps it with its own
|
|
15
|
+
* `node:crypto` HMAC.
|
|
16
|
+
*/
|
|
17
|
+
/** Hex HMAC-SHA256 of {@link internalSigPayload}, keyed with the shared secret. */
|
|
18
|
+
export const INTERNAL_SIG_HEADER = "X-Internal-Signature";
|
|
19
|
+
/** Unix-epoch milliseconds (as a decimal string) the signature was minted at. */
|
|
20
|
+
export const INTERNAL_TS_HEADER = "X-Internal-Timestamp";
|
|
21
|
+
/** Reject a signed request whose timestamp is more than this far from now. */
|
|
22
|
+
export const INTERNAL_SIG_MAX_SKEW_MS = 300_000;
|
|
23
|
+
/** Canonical-form version. Bumps if the payload shape changes; a verifier can
|
|
24
|
+
* refuse a version it doesn't understand rather than mis-compare. */
|
|
25
|
+
export const INTERNAL_SIG_VERSION = "v1";
|
|
26
|
+
/** The exact string both the signer and verifier feed to HMAC-SHA256. */
|
|
27
|
+
export function internalSigPayload(parts) {
|
|
28
|
+
return [
|
|
29
|
+
INTERNAL_SIG_VERSION,
|
|
30
|
+
parts.method.toUpperCase(),
|
|
31
|
+
parts.path,
|
|
32
|
+
String(parts.timestamp),
|
|
33
|
+
parts.bodyHash,
|
|
34
|
+
].join("\n");
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=internal-sig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-sig.js","sourceRoot":"","sources":["../src/internal-sig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAC1D,iFAAiF;AACjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAEhD;sEACsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAezC,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,OAAO;QACL,oBAAoB;QACpB,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QAC1B,KAAK,CAAC,IAAI;QACV,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;QACvB,KAAK,CAAC,QAAQ;KACf,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/limits.d.ts
CHANGED
|
@@ -19,4 +19,37 @@ export declare const MAX_TARBALL_BYTES: number;
|
|
|
19
19
|
* (`percher_deploy`), not inline.
|
|
20
20
|
*/
|
|
21
21
|
export declare const MAX_INLINE_PUBLISH_BYTES: number;
|
|
22
|
+
/**
|
|
23
|
+
* Chunked inline upload (publish sessions) — the multi-call variant of
|
|
24
|
+
* inline publish for apps too large to travel in ONE model-generated
|
|
25
|
+
* tool call (~100 KB practical per-turn ceiling). Bytes move as
|
|
26
|
+
* hash-verified chunks into a staging session; commit re-enters the
|
|
27
|
+
* standard inline-publish path.
|
|
28
|
+
*/
|
|
29
|
+
/** Max RAW (decoded) bytes per uploaded chunk. Clients default lower
|
|
30
|
+
* (32 KB) and shrink on repeated hash mismatches; the server rejects
|
|
31
|
+
* anything over this cap. */
|
|
32
|
+
export declare const MAX_UPLOAD_CHUNK_BYTES: number;
|
|
33
|
+
/** Min RAW bytes per uploaded chunk, EXCEPT the final piece of a file.
|
|
34
|
+
* Enforced server-side because tiny chunks are a death spiral for the
|
|
35
|
+
* model-text transport (live dogfood 2026-07-08: an agent shrank
|
|
36
|
+
* 8→4→2 KB after one mismatch and hit the per-message output ceiling
|
|
37
|
+
* before finishing): every extra call costs a full model turn AND all
|
|
38
|
+
* payloads count against ONE assistant message's max length. */
|
|
39
|
+
export declare const MIN_UPLOAD_CHUNK_BYTES: number;
|
|
40
|
+
/** Idle TTL for an open upload session — refreshed on every accepted
|
|
41
|
+
* chunk, so it measures INACTIVITY, not total duration. Live dogfood
|
|
42
|
+
* 2026-07-08: a fixed 1 h total expired twice mid-upload because the
|
|
43
|
+
* chat channel's real cadence includes approval prompts, max-length
|
|
44
|
+
* "Continue" pauses, and the human walking away. */
|
|
45
|
+
export declare const UPLOAD_SESSION_TTL_MS: number;
|
|
46
|
+
/** Absolute cap on an upload session's lifetime from creation — bounds
|
|
47
|
+
* the rolling idle-refresh so periodically-pinged sessions can't hold
|
|
48
|
+
* staged bytes forever. */
|
|
49
|
+
export declare const UPLOAD_SESSION_MAX_LIFETIME_MS: number;
|
|
50
|
+
/** Max simultaneously-open upload sessions per user. A session stages up
|
|
51
|
+
* to MAX_INLINE_PUBLISH_BYTES, so this bounds per-user staged bytes. */
|
|
52
|
+
export declare const MAX_OPEN_UPLOAD_SESSIONS_PER_USER = 2;
|
|
53
|
+
/** Max files a single upload-session manifest may declare. */
|
|
54
|
+
export declare const MAX_UPLOAD_SESSION_FILES = 400;
|
|
22
55
|
//# sourceMappingURL=limits.d.ts.map
|
package/dist/limits.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAoB,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,QAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAoB,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,QAAmB,CAAC;AAEzD;;;;;;GAMG;AAEH;;8BAE8B;AAC9B,eAAO,MAAM,sBAAsB,QAAY,CAAC;AAEhD;;;;;iEAKiE;AACjE,eAAO,MAAM,sBAAsB,QAAY,CAAC;AAEhD;;;;qDAIqD;AACrD,eAAO,MAAM,qBAAqB,QAAqB,CAAC;AAExD;;4BAE4B;AAC5B,eAAO,MAAM,8BAA8B,QAAsB,CAAC;AAElE;yEACyE;AACzE,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,MAAM,CAAC"}
|
package/dist/limits.js
CHANGED
|
@@ -19,4 +19,37 @@ export const MAX_TARBALL_BYTES = 500 * 1024 * 1024;
|
|
|
19
19
|
* (`percher_deploy`), not inline.
|
|
20
20
|
*/
|
|
21
21
|
export const MAX_INLINE_PUBLISH_BYTES = 25 * 1024 * 1024;
|
|
22
|
+
/**
|
|
23
|
+
* Chunked inline upload (publish sessions) — the multi-call variant of
|
|
24
|
+
* inline publish for apps too large to travel in ONE model-generated
|
|
25
|
+
* tool call (~100 KB practical per-turn ceiling). Bytes move as
|
|
26
|
+
* hash-verified chunks into a staging session; commit re-enters the
|
|
27
|
+
* standard inline-publish path.
|
|
28
|
+
*/
|
|
29
|
+
/** Max RAW (decoded) bytes per uploaded chunk. Clients default lower
|
|
30
|
+
* (32 KB) and shrink on repeated hash mismatches; the server rejects
|
|
31
|
+
* anything over this cap. */
|
|
32
|
+
export const MAX_UPLOAD_CHUNK_BYTES = 64 * 1024;
|
|
33
|
+
/** Min RAW bytes per uploaded chunk, EXCEPT the final piece of a file.
|
|
34
|
+
* Enforced server-side because tiny chunks are a death spiral for the
|
|
35
|
+
* model-text transport (live dogfood 2026-07-08: an agent shrank
|
|
36
|
+
* 8→4→2 KB after one mismatch and hit the per-message output ceiling
|
|
37
|
+
* before finishing): every extra call costs a full model turn AND all
|
|
38
|
+
* payloads count against ONE assistant message's max length. */
|
|
39
|
+
export const MIN_UPLOAD_CHUNK_BYTES = 16 * 1024;
|
|
40
|
+
/** Idle TTL for an open upload session — refreshed on every accepted
|
|
41
|
+
* chunk, so it measures INACTIVITY, not total duration. Live dogfood
|
|
42
|
+
* 2026-07-08: a fixed 1 h total expired twice mid-upload because the
|
|
43
|
+
* chat channel's real cadence includes approval prompts, max-length
|
|
44
|
+
* "Continue" pauses, and the human walking away. */
|
|
45
|
+
export const UPLOAD_SESSION_TTL_MS = 6 * 60 * 60 * 1000;
|
|
46
|
+
/** Absolute cap on an upload session's lifetime from creation — bounds
|
|
47
|
+
* the rolling idle-refresh so periodically-pinged sessions can't hold
|
|
48
|
+
* staged bytes forever. */
|
|
49
|
+
export const UPLOAD_SESSION_MAX_LIFETIME_MS = 24 * 60 * 60 * 1000;
|
|
50
|
+
/** Max simultaneously-open upload sessions per user. A session stages up
|
|
51
|
+
* to MAX_INLINE_PUBLISH_BYTES, so this bounds per-user staged bytes. */
|
|
52
|
+
export const MAX_OPEN_UPLOAD_SESSIONS_PER_USER = 2;
|
|
53
|
+
/** Max files a single upload-session manifest may declare. */
|
|
54
|
+
export const MAX_UPLOAD_SESSION_FILES = 400;
|
|
22
55
|
//# sourceMappingURL=limits.js.map
|
package/dist/limits.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzD;;;;;;GAMG;AAEH;;8BAE8B;AAC9B,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;;iEAKiE;AACjE,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;qDAIqD;AACrD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAExD;;4BAE4B;AAC5B,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAElE;yEACyE;AACzE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC;AAEnD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-process platform defaults. These are the fallback values used when the
|
|
3
|
+
* corresponding env var is unset; the authoritative production values live in
|
|
4
|
+
* infra/docker-compose.yml. Kept here (not in any one package) so the API, the
|
|
5
|
+
* worker daemon, and the MCP transport agree on a single source of truth
|
|
6
|
+
* without depending on each other.
|
|
7
|
+
*/
|
|
8
|
+
/** Default PocketBase sidecar image when PERCHER_POCKETBASE_IMAGE is unset. */
|
|
9
|
+
export declare const DEFAULT_POCKETBASE_IMAGE = "percher/pocketbase:0.39.9";
|
|
10
|
+
/** Default app domain suffix when PERCHER_DOMAIN_SUFFIX is unset. */
|
|
11
|
+
export declare const DEFAULT_DOMAIN_SUFFIX = "percher.run";
|
|
12
|
+
/** Default hosted-MCP HTTP port when PERCHER_MCP_HTTP_PORT is unset. */
|
|
13
|
+
export declare const DEFAULT_MCP_HTTP_PORT = 8787;
|
|
14
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/platform.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-process platform defaults. These are the fallback values used when the
|
|
3
|
+
* corresponding env var is unset; the authoritative production values live in
|
|
4
|
+
* infra/docker-compose.yml. Kept here (not in any one package) so the API, the
|
|
5
|
+
* worker daemon, and the MCP transport agree on a single source of truth
|
|
6
|
+
* without depending on each other.
|
|
7
|
+
*/
|
|
8
|
+
/** Default PocketBase sidecar image when PERCHER_POCKETBASE_IMAGE is unset. */
|
|
9
|
+
export const DEFAULT_POCKETBASE_IMAGE = "percher/pocketbase:0.39.9";
|
|
10
|
+
/** Default app domain suffix when PERCHER_DOMAIN_SUFFIX is unset. */
|
|
11
|
+
export const DEFAULT_DOMAIN_SUFFIX = "percher.run";
|
|
12
|
+
/** Default hosted-MCP HTTP port when PERCHER_MCP_HTTP_PORT is unset. */
|
|
13
|
+
export const DEFAULT_MCP_HTTP_PORT = 8787;
|
|
14
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -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"}
|
package/dist/waitlist.js
ADDED
|
@@ -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.
|
|
3
|
+
"version": "0.1.8",
|
|
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",
|