pi-spotify-widget 0.1.9 → 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 CHANGED
@@ -1,81 +1,107 @@
1
- # Changelog
2
-
3
- ## Unreleased
4
-
5
- ## [0.1.9] - 2026-08-04
6
-
7
- ### Changed
8
-
9
- - Bump package version for the Discord release webhook verification.
10
-
11
- ## [0.1.8] - 2026-07-20
12
-
13
- ### Fixed
14
-
15
- - Align README release command with `npm version patch --no-git-tag-version` so tagging stays with `auto-release.yml`.
16
-
17
- ### Changed
18
-
19
- - Add `version:check` PR guard and align CI bootstrap with the Pi extension template.
20
-
21
- ## [0.1.7] - 2026-07-04
22
-
23
- ### Fixed
24
-
25
- - 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.
26
-
27
- ## [0.1.6] - 2026-07-04
28
-
29
- ### Fixed
30
-
31
- - Trigger a fresh release after npm Trusted Publishing was reconfigured so the hardened publish workflow can publish the package successfully.
32
-
33
- ## [0.1.5] - 2026-07-04
34
-
35
- ### Fixed
36
-
37
- - 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.
38
- - Clarify release docs and contributor release steps around `npm version patch --no-git-tag-version` and Trusted Publishing troubleshooting.
39
-
40
- ## [0.1.4] - 2026-07-04
41
-
42
- ### Changed
43
-
44
- - Add Buy Me a Coffee sponsor button to README and native GitHub funding link via `.github/FUNDING.yml`.
45
-
46
- All notable changes to this project will be documented in this file.
47
-
48
- This project follows semantic versioning.
49
-
50
- ## [0.1.3] - 2026-06-27
51
-
52
- ### Changed
53
-
54
- - 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.
55
-
56
- ## [0.1.2] - 2026-06-06
57
-
58
- ### Fixed
59
-
60
- - 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.
61
-
62
- ## [0.1.1] - 2026-06-05
63
-
64
- ### Changed
65
-
66
- - Removed template-maintenance docs (`github-template.md`, `repository-settings.md`, `typescript.md`) from the published package.
67
- - Updated README doc links to match remaining docs.
68
-
69
- ## [0.1.0] - 2026-06-03
70
-
71
- ### Added
72
-
73
- - Now Playing widget in Pi prompt editor (track, artist, playing/paused, progress seek bar).
74
- - OAuth 2.0 + PKCE login via `/spotify:login` with localhost callback on port 8888.
75
- - Interactive Client ID setup (Dashboard opens in browser; optional `PI_SPOTIFY_CLIENT_ID` env override).
76
- - Secret-safe `/spotify:status`, `/spotify:logout`, and `/spotify:refresh`.
77
- - Playback controls (`/spotify:prev`, `/spotify:next`, `/spotify:pause`, `/spotify:play`) and `/spotify:play-uri`.
78
- - `/spotify:share` for X compose (intent URL; optional API credentials via env).
79
- - `spotify-playback` Agent Skill for playback and share workflows.
80
- - Token refresh lifecycle and adaptive polling with stale snapshot fallback.
81
- - CI workflow and npm Trusted Publishing setup.
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
- [![Join dotfield.xyz on Discord](https://img.shields.io/badge/Join%20dotfield.xyz%20on%20Discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/4945dXZVW5)
2
+
3
+ [![Join dotfield.xyz on Discord](https://img.shields.io/badge/Join%20dotfield.xyz%20on%20Discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/4945dXZVW5)
4
4
 
5
5
  [![CI](https://github.com/eiei114/pi-spotify-widget/actions/workflows/ci.yml/badge.svg)](https://github.com/eiei114/pi-spotify-widget/actions/workflows/ci.yml)
6
6
  [![Publish](https://github.com/eiei114/pi-spotify-widget/actions/workflows/publish.yml/badge.svg)](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.3
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/SECURITY.md ADDED
@@ -0,0 +1,20 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ Only the latest published version receives security fixes.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Open a private security advisory on GitHub, or contact the maintainer by the preferred channel listed in the repository profile.
10
+
11
+ Please include:
12
+
13
+ - Affected version
14
+ - Impact
15
+ - Reproduction steps
16
+ - Suggested fix, if known
17
+
18
+ ## Pi package security note
19
+
20
+ Pi packages can execute code with local user permissions. Review installed packages and avoid running untrusted extensions.
@@ -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
- try {
236
- ctx.ui.setWidget(WIDGET_ID, lastSnapshot.track ? renderSnapshot(lastSnapshot, ctx.ui.theme) : renderIdle(lastSnapshot, ctx.ui.theme));
237
- } catch (error) {
238
- if (isStaleContextError(error)) clearDisplayTimer();
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;
@@ -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,63 +1,64 @@
1
- {
2
- "name": "pi-spotify-widget",
3
- "version": "0.1.9",
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
- "LICENSE",
28
- "CHANGELOG.md",
29
- "skills/"
30
- ],
31
- "scripts": {
32
- "typecheck": "tsc --noEmit",
33
- "test": "node --test tests/*.test.mjs",
34
- "ci": "npm run typecheck && npm test && npm run pack:check",
35
- "pack:check": "npm pack --dry-run",
36
- "version:check": "node scripts/check-version-bump.mjs"
37
- },
38
- "pi": {
39
- "extensions": [
40
- "./extensions"
41
- ],
42
- "skills": [
43
- "./skills/spotify-playback"
44
- ]
45
- },
46
- "publishConfig": {
47
- "access": "public"
48
- },
49
- "peerDependencies": {
50
- "@earendil-works/pi-ai": "*",
51
- "@earendil-works/pi-coding-agent": "*",
52
- "@earendil-works/pi-tui": "*",
53
- "typebox": "*"
54
- },
55
- "devDependencies": {
56
- "@earendil-works/pi-ai": "^0.82.1",
57
- "@earendil-works/pi-coding-agent": "^0.82.1",
58
- "@earendil-works/pi-tui": "latest",
59
- "typebox": "latest",
60
- "@types/node": "^26.0.0",
61
- "typescript": "^6.0.3"
62
- }
63
- }
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
+ }