@vosjs/shared 0.2.0 → 0.4.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/README.md +18 -17
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -26
- package/dist/acquisition.d.ts +0 -59
- package/dist/acquisition.js +0 -92
- package/dist/acquisition.js.map +0 -1
- package/dist/backdrops.d.ts +0 -29
- package/dist/backdrops.js +0 -6
- package/dist/backdrops.js.map +0 -1
- package/dist/chunk-K7EIJSYQ.js +0 -1
- package/dist/chunk-K7EIJSYQ.js.map +0 -1
- package/dist/chunk-RDD5SU6G.js +0 -25
- package/dist/chunk-RDD5SU6G.js.map +0 -1
- package/dist/diff/index.d.ts +0 -65
- package/dist/diff/index.js +0 -568
- package/dist/diff/index.js.map +0 -1
- package/dist/limits.d.ts +0 -76
- package/dist/limits.js +0 -59
- package/dist/limits.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/utils/index.d.ts +0 -23
- package/dist/utils/index.js +0 -13
- package/dist/utils/index.js.map +0 -1
package/dist/limits.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The plan limits table.
|
|
3
|
-
*
|
|
4
|
-
* ONE table, keyed by `user.plan`, read by every quota verdict on the API
|
|
5
|
-
* and by every client that states a limit before the user hits it (the
|
|
6
|
-
* recorder's countdown, the CLI's `record`, the settings usage strip).
|
|
7
|
-
* 'free' is the only row today and nothing writes `user.plan`; a paid plan
|
|
8
|
-
* is a second row here plus a server-side writer, never a rewrite of the
|
|
9
|
-
* guards. An unknown or absent plan resolves to free — never to a grant.
|
|
10
|
-
*
|
|
11
|
-
* Numbers are proposals that can be retuned as data: every
|
|
12
|
-
* refusal prints its number from here, so the copy can never disagree.
|
|
13
|
-
*/
|
|
14
|
-
type Plan = 'free';
|
|
15
|
-
declare const PLANS: readonly Plan[];
|
|
16
|
-
interface PlanLimits {
|
|
17
|
-
/** Session vos creates per rolling 24h. */
|
|
18
|
-
dailySaves: number;
|
|
19
|
-
/** Private voses held at once (counted at create). */
|
|
20
|
-
privateVoses: number;
|
|
21
|
-
/** Key-authed .glb/.gltf uploads per 24h, per owning user. */
|
|
22
|
-
keyModelUploads: number;
|
|
23
|
-
/** Key-authed recording uploads per 24h, per owning user. */
|
|
24
|
-
keyRecordingUploads: number;
|
|
25
|
-
/** Key-authed image uploads per 24h (posters/stills an agent files into a project). */
|
|
26
|
-
keyImageUploads: number;
|
|
27
|
-
/** Session recording uploads per 24h (uploads count as uploads). */
|
|
28
|
-
recordingUploads: number;
|
|
29
|
-
/** Session image / HDR / audio uploads per 24h. */
|
|
30
|
-
otherUploads: number;
|
|
31
|
-
/** Longest hosted recording, seconds (stated before you record). */
|
|
32
|
-
recordingMaxSeconds: number;
|
|
33
|
-
/** Largest single recording upload, bytes (the ingest ceiling). */
|
|
34
|
-
recordingMaxBytes: number;
|
|
35
|
-
/** Total asset bytes an account may hold (said in hours in the UI). */
|
|
36
|
-
storageBytes: number;
|
|
37
|
-
/** Session versions per vos per 24h. */
|
|
38
|
-
versionsPerVosDay: number;
|
|
39
|
-
/** Key-authed version pushes per 24h across every vos. */
|
|
40
|
-
keyVersionsPerDay: number;
|
|
41
|
-
/** Voses + assets + recipes one folder may hold. */
|
|
42
|
-
folderItems: number;
|
|
43
|
-
/** Subfolders one folder may hold. */
|
|
44
|
-
subfolders: number;
|
|
45
|
-
/** Plumbing media enqueues (preview + thumbnail) per vos per hour. */
|
|
46
|
-
mediaPerVosHour: number;
|
|
47
|
-
/** Plumbing media enqueues per account per 24h. Past it, media DEFERS. */
|
|
48
|
-
mediaPerAccountDay: number;
|
|
49
|
-
/** Artifact render output-minutes per account per 24h (armed with cloud export). */
|
|
50
|
-
artifactRenderMinutesPerDay: number;
|
|
51
|
-
/** Own-vos backdrop bakes per account per 24h (cache hits never count). */
|
|
52
|
-
backdropBakesPerDay: number;
|
|
53
|
-
/** Folders per user, across every nesting level. */
|
|
54
|
-
folders: number;
|
|
55
|
-
/** Recipe files (.md assets) per user. */
|
|
56
|
-
recipes: number;
|
|
57
|
-
/** Key-authed recipe creates per 24h. */
|
|
58
|
-
keyRecipeCreates: number;
|
|
59
|
-
/** Recipe body byte cap (upload + in-place replace). */
|
|
60
|
-
recipeBodyBytes: number;
|
|
61
|
-
}
|
|
62
|
-
/** Unknown or absent ⇒ free. A plan the table does not know is never a grant. */
|
|
63
|
-
declare function planLimits(plan?: string | null): PlanLimits;
|
|
64
|
-
/**
|
|
65
|
-
* The storage ceiling in the unit a human can picture. Footage at ~5 Mbps
|
|
66
|
-
* is ~0.375 GB per 10 minutes, so 5 GB reads as "about 2 hours"; the guard
|
|
67
|
-
* counts bytes, the sentence says hours. Rounded to a half hour.
|
|
68
|
-
*/
|
|
69
|
-
declare const FOOTAGE_BYTES_PER_SECOND: number;
|
|
70
|
-
declare function bytesAsFootageHours(bytes: number): number;
|
|
71
|
-
/** `1.2 GB`, `640 MB`, `12 KB` — for the usage strip and refusals. */
|
|
72
|
-
declare function formatBytes(bytes: number): string;
|
|
73
|
-
/** `30 min`, `1 h 30 min`, `45 s` — the duration cap in words. */
|
|
74
|
-
declare function formatDurationCap(seconds: number): string;
|
|
75
|
-
|
|
76
|
-
export { FOOTAGE_BYTES_PER_SECOND, PLANS, type Plan, type PlanLimits, bytesAsFootageHours, formatBytes, formatDurationCap, planLimits };
|
package/dist/limits.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// src/limits.ts
|
|
2
|
-
var PLANS = ["free"];
|
|
3
|
-
var FREE = {
|
|
4
|
-
dailySaves: 10,
|
|
5
|
-
privateVoses: 20,
|
|
6
|
-
keyModelUploads: 10,
|
|
7
|
-
keyRecordingUploads: 20,
|
|
8
|
-
keyImageUploads: 40,
|
|
9
|
-
recordingUploads: 20,
|
|
10
|
-
otherUploads: 50,
|
|
11
|
-
recordingMaxSeconds: 30 * 60,
|
|
12
|
-
recordingMaxBytes: 512 * 1024 * 1024,
|
|
13
|
-
storageBytes: 5 * 1024 * 1024 * 1024,
|
|
14
|
-
versionsPerVosDay: 100,
|
|
15
|
-
keyVersionsPerDay: 200,
|
|
16
|
-
folderItems: 500,
|
|
17
|
-
subfolders: 50,
|
|
18
|
-
mediaPerVosHour: 20,
|
|
19
|
-
mediaPerAccountDay: 300,
|
|
20
|
-
artifactRenderMinutesPerDay: 60,
|
|
21
|
-
backdropBakesPerDay: 20,
|
|
22
|
-
// Folders & recipes: sanity caps, not a paywall — organization
|
|
23
|
-
// stays free at every size that isn't abuse.
|
|
24
|
-
folders: 50,
|
|
25
|
-
recipes: 200,
|
|
26
|
-
keyRecipeCreates: 20,
|
|
27
|
-
recipeBodyBytes: 64 * 1024
|
|
28
|
-
};
|
|
29
|
-
var LIMITS = { free: FREE };
|
|
30
|
-
function planLimits(plan) {
|
|
31
|
-
return LIMITS[plan ?? "free"] ?? FREE;
|
|
32
|
-
}
|
|
33
|
-
var FOOTAGE_BYTES_PER_SECOND = 5e6 / 8 * 1;
|
|
34
|
-
function bytesAsFootageHours(bytes) {
|
|
35
|
-
return Math.round(bytes / FOOTAGE_BYTES_PER_SECOND / 3600 * 2) / 2;
|
|
36
|
-
}
|
|
37
|
-
function formatBytes(bytes) {
|
|
38
|
-
if (bytes >= 1024 ** 3) return `${(bytes / 1024 ** 3).toFixed(1)} GB`;
|
|
39
|
-
if (bytes >= 1024 ** 2) return `${Math.round(bytes / 1024 ** 2)} MB`;
|
|
40
|
-
if (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`;
|
|
41
|
-
return `${bytes} B`;
|
|
42
|
-
}
|
|
43
|
-
function formatDurationCap(seconds) {
|
|
44
|
-
if (seconds < 60) return `${seconds} s`;
|
|
45
|
-
const m = Math.round(seconds / 60);
|
|
46
|
-
if (m < 60) return `${m} min`;
|
|
47
|
-
const h = Math.floor(m / 60);
|
|
48
|
-
const rest = m % 60;
|
|
49
|
-
return rest ? `${h} h ${rest} min` : `${h} h`;
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
FOOTAGE_BYTES_PER_SECOND,
|
|
53
|
-
PLANS,
|
|
54
|
-
bytesAsFootageHours,
|
|
55
|
-
formatBytes,
|
|
56
|
-
formatDurationCap,
|
|
57
|
-
planLimits
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=limits.js.map
|
package/dist/limits.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/limits.ts"],"sourcesContent":["/**\n * The plan limits table.\n *\n * ONE table, keyed by `user.plan`, read by every quota verdict on the API\n * and by every client that states a limit before the user hits it (the\n * recorder's countdown, the CLI's `record`, the settings usage strip).\n * 'free' is the only row today and nothing writes `user.plan`; a paid plan\n * is a second row here plus a server-side writer, never a rewrite of the\n * guards. An unknown or absent plan resolves to free — never to a grant.\n *\n * Numbers are proposals that can be retuned as data: every\n * refusal prints its number from here, so the copy can never disagree.\n */\n\nexport type Plan = 'free'\n\nexport const PLANS: readonly Plan[] = ['free']\n\nexport interface PlanLimits {\n /** Session vos creates per rolling 24h. */\n dailySaves: number\n /** Private voses held at once (counted at create). */\n privateVoses: number\n /** Key-authed .glb/.gltf uploads per 24h, per owning user. */\n keyModelUploads: number\n /** Key-authed recording uploads per 24h, per owning user. */\n keyRecordingUploads: number\n /** Key-authed image uploads per 24h (posters/stills an agent files into a project). */\n keyImageUploads: number\n /** Session recording uploads per 24h (uploads count as uploads). */\n recordingUploads: number\n /** Session image / HDR / audio uploads per 24h. */\n otherUploads: number\n /** Longest hosted recording, seconds (stated before you record). */\n recordingMaxSeconds: number\n /** Largest single recording upload, bytes (the ingest ceiling). */\n recordingMaxBytes: number\n /** Total asset bytes an account may hold (said in hours in the UI). */\n storageBytes: number\n /** Session versions per vos per 24h. */\n versionsPerVosDay: number\n /** Key-authed version pushes per 24h across every vos. */\n keyVersionsPerDay: number\n /** Voses + assets + recipes one folder may hold. */\n folderItems: number\n /** Subfolders one folder may hold. */\n subfolders: number\n /** Plumbing media enqueues (preview + thumbnail) per vos per hour. */\n mediaPerVosHour: number\n /** Plumbing media enqueues per account per 24h. Past it, media DEFERS. */\n mediaPerAccountDay: number\n /** Artifact render output-minutes per account per 24h (armed with cloud export). */\n artifactRenderMinutesPerDay: number\n /** Own-vos backdrop bakes per account per 24h (cache hits never count). */\n backdropBakesPerDay: number\n /** Folders per user, across every nesting level. */\n folders: number\n /** Recipe files (.md assets) per user. */\n recipes: number\n /** Key-authed recipe creates per 24h. */\n keyRecipeCreates: number\n /** Recipe body byte cap (upload + in-place replace). */\n recipeBodyBytes: number\n}\n\nconst FREE: PlanLimits = {\n dailySaves: 10,\n privateVoses: 20,\n keyModelUploads: 10,\n keyRecordingUploads: 20,\n keyImageUploads: 40,\n recordingUploads: 20,\n otherUploads: 50,\n recordingMaxSeconds: 30 * 60,\n recordingMaxBytes: 512 * 1024 * 1024,\n storageBytes: 5 * 1024 * 1024 * 1024,\n versionsPerVosDay: 100,\n keyVersionsPerDay: 200,\n folderItems: 500,\n subfolders: 50,\n mediaPerVosHour: 20,\n mediaPerAccountDay: 300,\n artifactRenderMinutesPerDay: 60,\n backdropBakesPerDay: 20,\n // Folders & recipes: sanity caps, not a paywall — organization\n // stays free at every size that isn't abuse.\n folders: 50,\n recipes: 200,\n keyRecipeCreates: 20,\n recipeBodyBytes: 64 * 1024,\n}\n\n// Keyed by string on purpose: the column is free text at the wire, so a\n// value the table does not know must fall through to free, never throw.\nconst LIMITS: Partial<Record<string, PlanLimits>> = { free: FREE }\n\n/** Unknown or absent ⇒ free. A plan the table does not know is never a grant. */\nexport function planLimits(plan?: string | null): PlanLimits {\n return LIMITS[plan ?? 'free'] ?? FREE\n}\n\n/**\n * The storage ceiling in the unit a human can picture. Footage at ~5 Mbps\n * is ~0.375 GB per 10 minutes, so 5 GB reads as \"about 2 hours\"; the guard\n * counts bytes, the sentence says hours. Rounded to a half hour.\n */\nexport const FOOTAGE_BYTES_PER_SECOND = (5_000_000 / 8) * 1\nexport function bytesAsFootageHours(bytes: number): number {\n return Math.round((bytes / FOOTAGE_BYTES_PER_SECOND / 3600) * 2) / 2\n}\n\n/** `1.2 GB`, `640 MB`, `12 KB` — for the usage strip and refusals. */\nexport function formatBytes(bytes: number): string {\n if (bytes >= 1024 ** 3) return `${(bytes / 1024 ** 3).toFixed(1)} GB`\n if (bytes >= 1024 ** 2) return `${Math.round(bytes / 1024 ** 2)} MB`\n if (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`\n return `${bytes} B`\n}\n\n/** `30 min`, `1 h 30 min`, `45 s` — the duration cap in words. */\nexport function formatDurationCap(seconds: number): string {\n if (seconds < 60) return `${seconds} s`\n const m = Math.round(seconds / 60)\n if (m < 60) return `${m} min`\n const h = Math.floor(m / 60)\n const rest = m % 60\n return rest ? `${h} h ${rest} min` : `${h} h`\n}\n"],"mappings":";AAgBO,IAAM,QAAyB,CAAC,MAAM;AAiD7C,IAAM,OAAmB;AAAA,EACvB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,qBAAqB,KAAK;AAAA,EAC1B,mBAAmB,MAAM,OAAO;AAAA,EAChC,cAAc,IAAI,OAAO,OAAO;AAAA,EAChC,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,qBAAqB;AAAA;AAAA;AAAA,EAGrB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,iBAAiB,KAAK;AACxB;AAIA,IAAM,SAA8C,EAAE,MAAM,KAAK;AAG1D,SAAS,WAAW,MAAkC;AAC3D,SAAO,OAAO,QAAQ,MAAM,KAAK;AACnC;AAOO,IAAM,2BAA4B,MAAY,IAAK;AACnD,SAAS,oBAAoB,OAAuB;AACzD,SAAO,KAAK,MAAO,QAAQ,2BAA2B,OAAQ,CAAC,IAAI;AACrE;AAGO,SAAS,YAAY,OAAuB;AACjD,MAAI,SAAS,QAAQ,EAAG,QAAO,IAAI,QAAQ,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAChE,MAAI,SAAS,QAAQ,EAAG,QAAO,GAAG,KAAK,MAAM,QAAQ,QAAQ,CAAC,CAAC;AAC/D,MAAI,SAAS,KAAM,QAAO,GAAG,KAAK,MAAM,QAAQ,IAAI,CAAC;AACrD,SAAO,GAAG,KAAK;AACjB;AAGO,SAAS,kBAAkB,SAAyB;AACzD,MAAI,UAAU,GAAI,QAAO,GAAG,OAAO;AACnC,QAAM,IAAI,KAAK,MAAM,UAAU,EAAE;AACjC,MAAI,IAAI,GAAI,QAAO,GAAG,CAAC;AACvB,QAAM,IAAI,KAAK,MAAM,IAAI,EAAE;AAC3B,QAAM,OAAO,IAAI;AACjB,SAAO,OAAO,GAAG,CAAC,MAAM,IAAI,SAAS,GAAG,CAAC;AAC3C;","names":[]}
|
package/dist/types/index.d.ts
DELETED
package/dist/types/index.js
DELETED
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Utilities
|
|
3
|
-
* Common utility functions used across frontend and backend
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Format a filename to a human-readable label
|
|
7
|
-
* @example formatLabel('basic-fade') => 'Basic Fade'
|
|
8
|
-
*/
|
|
9
|
-
declare function formatLabel(filename: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Generate a unique ID
|
|
12
|
-
*/
|
|
13
|
-
declare function generateId(): string;
|
|
14
|
-
/**
|
|
15
|
-
* Sleep for a specified duration
|
|
16
|
-
*/
|
|
17
|
-
declare function sleep(ms: number): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Safely parse JSON with a fallback
|
|
20
|
-
*/
|
|
21
|
-
declare function safeJsonParse<T>(json: string, fallback: T): T;
|
|
22
|
-
|
|
23
|
-
export { formatLabel, generateId, safeJsonParse, sleep };
|
package/dist/utils/index.js
DELETED
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|