pi-spotify-widget 0.1.10 → 0.1.15
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/CHANGELOG.md +107 -87
- package/README.md +4 -4
- package/extensions/index.ts +7 -4
- package/lib/refresh-schedule.ts +6 -0
- package/package.json +64 -64
package/CHANGELOG.md
CHANGED
|
@@ -1,87 +1,107 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.15] - 2026-09-27
|
|
4
|
+
|
|
5
|
+
- chore: periodic patch bump after 7+ days without npm publish
|
|
6
|
+
|
|
7
|
+
## 0.1.14 - 2026-09-27
|
|
8
|
+
|
|
9
|
+
- chore: periodic patch bump after 7+ days without npm publish
|
|
10
|
+
|
|
11
|
+
## 0.1.13 - 2026-09-27
|
|
12
|
+
|
|
13
|
+
- chore: periodic patch bump after 7+ days without npm publish
|
|
14
|
+
|
|
15
|
+
## 0.1.12 - 2026-09-27
|
|
16
|
+
|
|
17
|
+
- chore: periodic patch bump after 7+ days without npm publish
|
|
18
|
+
|
|
19
|
+
## 0.1.11 - 2026-09-27
|
|
20
|
+
|
|
21
|
+
- chore: periodic patch bump after 7+ days without npm publish
|
|
22
|
+
|
|
23
|
+
## Unreleased
|
|
24
|
+
|
|
25
|
+
## [0.1.10] - 2026-08-22
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Merge the 2026-08-22 managed OSS dependency and maintenance PR batch.
|
|
30
|
+
|
|
31
|
+
## [0.1.9] - 2026-08-04
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Bump package version for the Discord release webhook verification.
|
|
36
|
+
|
|
37
|
+
## [0.1.8] - 2026-07-20
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- Align README release command with `npm version patch --no-git-tag-version` so tagging stays with `auto-release.yml`.
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- Add `version:check` PR guard and align CI bootstrap with the Pi extension template.
|
|
46
|
+
|
|
47
|
+
## [0.1.7] - 2026-07-04
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- Move the npm publish workflow to Node 24, print runtime versions for diagnosis, and publish with `--provenance --access public` so npm Trusted Publishing has a fully compatible environment.
|
|
52
|
+
|
|
53
|
+
## [0.1.6] - 2026-07-04
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
- Trigger a fresh release after npm Trusted Publishing was reconfigured so the hardened publish workflow can publish the package successfully.
|
|
58
|
+
|
|
59
|
+
## [0.1.5] - 2026-07-04
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- Harden npm publish workflow: support release-trigger fallback, skip already-published versions, publish with explicit public access, and print a direct Trusted Publishing hint on npm 404 failures.
|
|
64
|
+
- Clarify release docs and contributor release steps around `npm version patch --no-git-tag-version` and Trusted Publishing troubleshooting.
|
|
65
|
+
|
|
66
|
+
## [0.1.4] - 2026-07-04
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
- Add Buy Me a Coffee sponsor button to README and native GitHub funding link via `.github/FUNDING.yml`.
|
|
71
|
+
|
|
72
|
+
All notable changes to this project will be documented in this file.
|
|
73
|
+
|
|
74
|
+
This project follows semantic versioning.
|
|
75
|
+
|
|
76
|
+
## [0.1.3] - 2026-06-27
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
|
|
80
|
+
- README aligned with the current Pi OSS template baseline: expanded install paths (project-local, version pin, `pi -e npm:`), accurate package contents (`skills/`), and explicit `npm run ci` / `npm pack --dry-run` guidance in Development and Release.
|
|
81
|
+
|
|
82
|
+
## [0.1.2] - 2026-06-06
|
|
83
|
+
|
|
84
|
+
### Fixed
|
|
85
|
+
|
|
86
|
+
- Auto-release workflow was added in 0.1.1 but version never changed in that commit, preventing npm publish. This release bumps the version so auto-release triggers and publishes to npm.
|
|
87
|
+
|
|
88
|
+
## [0.1.1] - 2026-06-05
|
|
89
|
+
|
|
90
|
+
### Changed
|
|
91
|
+
|
|
92
|
+
- Removed template-maintenance docs (`github-template.md`, `repository-settings.md`, `typescript.md`) from the published package.
|
|
93
|
+
- Updated README doc links to match remaining docs.
|
|
94
|
+
|
|
95
|
+
## [0.1.0] - 2026-06-03
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
|
|
99
|
+
- Now Playing widget in Pi prompt editor (track, artist, playing/paused, progress seek bar).
|
|
100
|
+
- OAuth 2.0 + PKCE login via `/spotify:login` with localhost callback on port 8888.
|
|
101
|
+
- Interactive Client ID setup (Dashboard opens in browser; optional `PI_SPOTIFY_CLIENT_ID` env override).
|
|
102
|
+
- Secret-safe `/spotify:status`, `/spotify:logout`, and `/spotify:refresh`.
|
|
103
|
+
- Playback controls (`/spotify:prev`, `/spotify:next`, `/spotify:pause`, `/spotify:play`) and `/spotify:play-uri`.
|
|
104
|
+
- `/spotify:share` for X compose (intent URL; optional API credentials via env).
|
|
105
|
+
- `spotify-playback` Agent Skill for playback and share workflows.
|
|
106
|
+
- Token refresh lifecycle and adaptive polling with stale snapshot fallback.
|
|
107
|
+
- CI workflow and npm Trusted Publishing setup.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pi-spotify-widget
|
|
2
|
-
|
|
3
|
-
[](https://discord.gg/4945dXZVW5)
|
|
2
|
+
|
|
3
|
+
[](https://discord.gg/4945dXZVW5)
|
|
4
4
|
|
|
5
5
|
[](https://github.com/eiei114/pi-spotify-widget/actions/workflows/ci.yml)
|
|
6
6
|
[](https://github.com/eiei114/pi-spotify-widget/actions/workflows/publish.yml)
|
|
@@ -38,7 +38,7 @@ pi install npm:pi-spotify-widget
|
|
|
38
38
|
Pin a specific version when you want reproducible installs:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
pi install npm:pi-spotify-widget@0.1.
|
|
41
|
+
pi install npm:pi-spotify-widget@0.1.15
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Install into the current project instead of your user Pi settings:
|
|
@@ -182,4 +182,4 @@ Review extensions before installing third-party packages. For vulnerability repo
|
|
|
182
182
|
|
|
183
183
|
## License
|
|
184
184
|
|
|
185
|
-
MIT
|
|
185
|
+
MIT
|
package/extensions/index.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
} from "../lib/playback-commands.ts";
|
|
30
30
|
import {
|
|
31
31
|
computeRefreshDelayMs,
|
|
32
|
+
needsDisplayProgressUpdate,
|
|
32
33
|
shouldRefreshAtTrackEnd,
|
|
33
34
|
trackIdentity,
|
|
34
35
|
} from "../lib/refresh-schedule.ts";
|
|
@@ -232,10 +233,12 @@ function resetDisplayTimer(ctx: WidgetCtx): void {
|
|
|
232
233
|
clearDisplayTimer();
|
|
233
234
|
displayTimer = setInterval(() => {
|
|
234
235
|
if (!lastSnapshot) return;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
if (needsDisplayProgressUpdate(lastSnapshot)) {
|
|
237
|
+
try {
|
|
238
|
+
ctx.ui.setWidget(WIDGET_ID, renderSnapshot(lastSnapshot, ctx.ui.theme));
|
|
239
|
+
} catch (error) {
|
|
240
|
+
if (isStaleContextError(error)) clearDisplayTimer();
|
|
241
|
+
}
|
|
239
242
|
}
|
|
240
243
|
if (!lastSnapshot.isPlaying || !lastSnapshot.track) return;
|
|
241
244
|
if (!shouldRefreshAtTrackEnd(lastSnapshot)) return;
|
package/lib/refresh-schedule.ts
CHANGED
|
@@ -38,9 +38,15 @@ export function trackIdentity(snapshot: PlaybackSnapshot | null): string {
|
|
|
38
38
|
return `${snapshot.track}::${snapshot.artist}`;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/** True when the 1s display tick should re-render (extrapolated progress changes). */
|
|
42
|
+
export function needsDisplayProgressUpdate(snapshot: PlaybackSnapshot | null): boolean {
|
|
43
|
+
return Boolean(snapshot?.track && snapshot.isPlaying);
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
export const __testing = {
|
|
42
47
|
remainingMs,
|
|
43
48
|
computeRefreshDelayMs,
|
|
44
49
|
shouldRefreshAtTrackEnd,
|
|
45
50
|
trackIdentity,
|
|
51
|
+
needsDisplayProgressUpdate,
|
|
46
52
|
};
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pi-spotify-widget",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Lightweight Spotify Now Playing widget for Pi Coding Agent.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"author": "eiei114",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"pi-package",
|
|
10
|
-
"pi",
|
|
11
|
-
"agent-skill",
|
|
12
|
-
"typescript"
|
|
13
|
-
],
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/eiei114/pi-spotify-widget.git"
|
|
17
|
-
},
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/eiei114/pi-spotify-widget/issues"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/eiei114/pi-spotify-widget#readme",
|
|
22
|
-
"files": [
|
|
23
|
-
"extensions/",
|
|
24
|
-
"lib/",
|
|
25
|
-
"docs/",
|
|
26
|
-
"README.md",
|
|
27
|
-
"SECURITY.md",
|
|
28
|
-
"LICENSE",
|
|
29
|
-
"CHANGELOG.md",
|
|
30
|
-
"skills/"
|
|
31
|
-
],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"typecheck": "tsc --noEmit",
|
|
34
|
-
"test": "node --test tests/*.test.mjs",
|
|
35
|
-
"ci": "npm run typecheck && npm test && npm run pack:check",
|
|
36
|
-
"pack:check": "npm pack --dry-run",
|
|
37
|
-
"version:check": "node scripts/check-version-bump.mjs"
|
|
38
|
-
},
|
|
39
|
-
"pi": {
|
|
40
|
-
"extensions": [
|
|
41
|
-
"./extensions"
|
|
42
|
-
],
|
|
43
|
-
"skills": [
|
|
44
|
-
"./skills/spotify-playback"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"publishConfig": {
|
|
48
|
-
"access": "public"
|
|
49
|
-
},
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"@earendil-works/pi-ai": "*",
|
|
52
|
-
"@earendil-works/pi-coding-agent": "*",
|
|
53
|
-
"@earendil-works/pi-tui": "*",
|
|
54
|
-
"typebox": "*"
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@earendil-works/pi-ai": "^0.84.1",
|
|
58
|
-
"@earendil-works/pi-coding-agent": "^0.84.1",
|
|
59
|
-
"@earendil-works/pi-tui": "latest",
|
|
60
|
-
"typebox": "latest",
|
|
61
|
-
"@types/node": "^26.0.0",
|
|
62
|
-
"typescript": "^7.0.2"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-spotify-widget",
|
|
3
|
+
"version": "0.1.15",
|
|
4
|
+
"description": "Lightweight Spotify Now Playing widget for Pi Coding Agent.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "eiei114",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"pi-package",
|
|
10
|
+
"pi",
|
|
11
|
+
"agent-skill",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/eiei114/pi-spotify-widget.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/eiei114/pi-spotify-widget/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/eiei114/pi-spotify-widget#readme",
|
|
22
|
+
"files": [
|
|
23
|
+
"extensions/",
|
|
24
|
+
"lib/",
|
|
25
|
+
"docs/",
|
|
26
|
+
"README.md",
|
|
27
|
+
"SECURITY.md",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"CHANGELOG.md",
|
|
30
|
+
"skills/"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"typecheck": "tsc --noEmit",
|
|
34
|
+
"test": "node --test tests/*.test.mjs",
|
|
35
|
+
"ci": "npm run typecheck && npm test && npm run pack:check",
|
|
36
|
+
"pack:check": "npm pack --dry-run",
|
|
37
|
+
"version:check": "node scripts/check-version-bump.mjs"
|
|
38
|
+
},
|
|
39
|
+
"pi": {
|
|
40
|
+
"extensions": [
|
|
41
|
+
"./extensions"
|
|
42
|
+
],
|
|
43
|
+
"skills": [
|
|
44
|
+
"./skills/spotify-playback"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@earendil-works/pi-ai": "*",
|
|
52
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
53
|
+
"@earendil-works/pi-tui": "*",
|
|
54
|
+
"typebox": "*"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@earendil-works/pi-ai": "^0.84.1",
|
|
58
|
+
"@earendil-works/pi-coding-agent": "^0.84.1",
|
|
59
|
+
"@earendil-works/pi-tui": "latest",
|
|
60
|
+
"typebox": "latest",
|
|
61
|
+
"@types/node": "^26.0.0",
|
|
62
|
+
"typescript": "^7.0.2"
|
|
63
|
+
}
|
|
64
|
+
}
|