@pi-unipi/updater 2.3.0 → 2.4.1
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 +4 -3
- package/types.ts +69 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/updater",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Auto-updater, changelog browser, and readme browser for Unipi — checks npm registry, renders CHANGELOG.md and README.md files in TUI overlays",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "index.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "Neuron Mr White",
|
|
9
9
|
"repository": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"files": [
|
|
24
24
|
"index.ts",
|
|
25
|
+
"types.ts",
|
|
25
26
|
"src/**/*.ts",
|
|
26
27
|
"skills/**/*",
|
|
27
28
|
"README.md"
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"access": "public"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@pi-unipi/core": "2.
|
|
37
|
+
"@pi-unipi/core": "2.4.1"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"@earendil-works/pi-coding-agent": "^0.80.0",
|
package/types.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @pi-unipi/updater — Type definitions
|
|
3
|
+
*
|
|
4
|
+
* All interfaces for the updater, changelog browser, and readme browser.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Configuration for the updater module */
|
|
8
|
+
export interface UpdaterConfig {
|
|
9
|
+
/** Check interval in milliseconds (default: 3600000 = 1 hour) */
|
|
10
|
+
checkIntervalMs: number;
|
|
11
|
+
/** Auto-update mode */
|
|
12
|
+
autoUpdate: "disabled" | "notify" | "auto";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Cache entry written after each update check */
|
|
16
|
+
export interface LastCheckCache {
|
|
17
|
+
/** ISO timestamp of last check */
|
|
18
|
+
lastCheck: string;
|
|
19
|
+
/** Latest version found on npm */
|
|
20
|
+
latestVersion: string;
|
|
21
|
+
/** Version the user chose to skip */
|
|
22
|
+
skippedVersion?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A parsed changelog version entry */
|
|
26
|
+
export interface ChangelogEntry {
|
|
27
|
+
/** Version string, e.g. "0.1.15" */
|
|
28
|
+
version: string;
|
|
29
|
+
/** Date string, e.g. "2026-04-30" (empty for Unreleased) */
|
|
30
|
+
date: string;
|
|
31
|
+
/** Sections: key = section name (Added, Fixed, etc.), value = list items */
|
|
32
|
+
sections: Record<string, string[]>;
|
|
33
|
+
/** Raw body text (for rendering) */
|
|
34
|
+
body: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A discovered README entry */
|
|
38
|
+
export interface ReadmeEntry {
|
|
39
|
+
/** Short package name, e.g. "workflow" */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Full npm package name, e.g. "@pi-unipi/workflow" */
|
|
42
|
+
packageName: string;
|
|
43
|
+
/** Installed version */
|
|
44
|
+
version: string;
|
|
45
|
+
/** Absolute path to README.md */
|
|
46
|
+
path: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Result of an update check */
|
|
50
|
+
export interface UpdateCheckResult {
|
|
51
|
+
/** Whether an update is available */
|
|
52
|
+
updateAvailable: boolean;
|
|
53
|
+
/** Latest version on npm (empty if check failed) */
|
|
54
|
+
latestVersion: string;
|
|
55
|
+
/** Currently installed version */
|
|
56
|
+
currentVersion: string;
|
|
57
|
+
/** Error message if check failed */
|
|
58
|
+
error?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Result of an install attempt */
|
|
62
|
+
export interface InstallResult {
|
|
63
|
+
/** Whether install succeeded */
|
|
64
|
+
success: boolean;
|
|
65
|
+
/** New version after install */
|
|
66
|
+
version?: string;
|
|
67
|
+
/** Error message if install failed */
|
|
68
|
+
error?: string;
|
|
69
|
+
}
|