@immorterm/types 0.1.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/package.json +21 -0
- package/src/index.ts +87 -0
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@immorterm/types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared TypeScript types for ImmorTerm",
|
|
5
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ImmorTerm/immorterm.git",
|
|
9
|
+
"directory": "libs/types"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./src/index.ts",
|
|
13
|
+
"types": "./src/index.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./src/index.ts"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"src"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type LicenseTier = "free" | "pro" | "memory-pro" | (string & {});
|
|
2
|
+
|
|
3
|
+
/** Human-readable tier label for display surfaces (CLI, TUI, webviews). */
|
|
4
|
+
export function tierDisplayLabel(tier?: string | null): string {
|
|
5
|
+
switch (tier) {
|
|
6
|
+
case "memory-pro":
|
|
7
|
+
return "Memory Pro";
|
|
8
|
+
case "pro":
|
|
9
|
+
case undefined:
|
|
10
|
+
case null:
|
|
11
|
+
// A valid paid license with no stored tier is legacy Pro.
|
|
12
|
+
return "Pro";
|
|
13
|
+
case "free":
|
|
14
|
+
return "Free";
|
|
15
|
+
default:
|
|
16
|
+
return tier.charAt(0).toUpperCase() + tier.slice(1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface LicenseInfo {
|
|
21
|
+
tier: LicenseTier;
|
|
22
|
+
key?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
expiresAt?: string;
|
|
25
|
+
machineId?: string;
|
|
26
|
+
instanceId?: string;
|
|
27
|
+
/** Dodo product id (prod_xxx); number kept for legacy LS configs on disk */
|
|
28
|
+
productId?: string | number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface UserConfig {
|
|
32
|
+
license: LicenseInfo;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Tier-specific resource limits, consumed by CLI, MCP server, and extension */
|
|
36
|
+
export interface TierLimits {
|
|
37
|
+
maxProjects: number;
|
|
38
|
+
maxTerminals: number;
|
|
39
|
+
maxThemes: number;
|
|
40
|
+
/** Memory retrieval window in hours (Infinity = unlimited) */
|
|
41
|
+
memoryRetentionHours: number;
|
|
42
|
+
/** Max search results per query */
|
|
43
|
+
memorySearchResults: number;
|
|
44
|
+
/** Max sessions for recall (1 = last session only) */
|
|
45
|
+
memorySessionRecall: number;
|
|
46
|
+
knowledgePacks: boolean;
|
|
47
|
+
graphSearch: boolean;
|
|
48
|
+
maxGatewayServers: number;
|
|
49
|
+
dashboardControl: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const FREE_LIMITS: TierLimits = {
|
|
53
|
+
maxProjects: 1,
|
|
54
|
+
maxTerminals: 3,
|
|
55
|
+
maxThemes: 5,
|
|
56
|
+
memoryRetentionHours: 24,
|
|
57
|
+
memorySearchResults: 3,
|
|
58
|
+
memorySessionRecall: 1,
|
|
59
|
+
knowledgePacks: false,
|
|
60
|
+
graphSearch: false,
|
|
61
|
+
maxGatewayServers: 2,
|
|
62
|
+
dashboardControl: false,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const PRO_LIMITS: TierLimits = {
|
|
66
|
+
maxProjects: Infinity,
|
|
67
|
+
maxTerminals: Infinity,
|
|
68
|
+
maxThemes: Infinity,
|
|
69
|
+
memoryRetentionHours: Infinity,
|
|
70
|
+
memorySearchResults: Infinity,
|
|
71
|
+
memorySessionRecall: Infinity,
|
|
72
|
+
knowledgePacks: true,
|
|
73
|
+
graphSearch: true,
|
|
74
|
+
maxGatewayServers: Infinity,
|
|
75
|
+
dashboardControl: true,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* ImmorTerm Memory Pro ($9/mo) — memory caps lifted ONLY.
|
|
80
|
+
* Themes, terminals, knowledge packs, etc. stay at free-tier levels.
|
|
81
|
+
*/
|
|
82
|
+
export const MEMORY_PRO_LIMITS: TierLimits = {
|
|
83
|
+
...FREE_LIMITS,
|
|
84
|
+
memoryRetentionHours: Infinity,
|
|
85
|
+
memorySearchResults: Infinity,
|
|
86
|
+
memorySessionRecall: Infinity,
|
|
87
|
+
};
|