pi-extensions 0.1.21 → 0.1.22

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.
@@ -0,0 +1,86 @@
1
+ name: weather-native-bridge
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: read
8
+ id-token: write
9
+
10
+ jobs:
11
+ build-prebuilt:
12
+ name: build (${{ matrix.target }})
13
+ runs-on: ${{ matrix.runner }}
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ include:
18
+ - runner: macos-14
19
+ target: aarch64-apple-darwin
20
+ - runner: macos-14
21
+ target: x86_64-apple-darwin
22
+ - runner: ubuntu-latest
23
+ target: x86_64-unknown-linux-gnu
24
+ - runner: windows-latest
25
+ target: x86_64-pc-windows-msvc
26
+
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ - name: Setup Node.js
31
+ uses: actions/setup-node@v4
32
+ with:
33
+ node-version: 20
34
+
35
+ - name: Setup Rust toolchain
36
+ uses: dtolnay/rust-toolchain@stable
37
+ with:
38
+ targets: ${{ matrix.target }}
39
+
40
+ - name: Install bridge dependencies
41
+ working-directory: weather/native/weathr-bridge
42
+ run: npm install --no-package-lock
43
+
44
+ - name: Build prebuilt binary
45
+ working-directory: weather/native/weathr-bridge
46
+ run: npx napi build --platform --release --dts native.d.ts --target ${{ matrix.target }}
47
+
48
+ - name: Upload binary artifact
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: bindings-${{ matrix.target }}
52
+ path: weather/native/weathr-bridge/pi_weather_bridge.*.node
53
+ if-no-files-found: error
54
+
55
+ publish-platform-packages:
56
+ name: publish prebuilt packages
57
+ runs-on: ubuntu-latest
58
+ needs: build-prebuilt
59
+
60
+ steps:
61
+ - uses: actions/checkout@v4
62
+
63
+ - name: Setup Node.js
64
+ uses: actions/setup-node@v4
65
+ with:
66
+ node-version: 20
67
+ registry-url: https://registry.npmjs.org
68
+
69
+ - name: Download artifacts
70
+ uses: actions/download-artifact@v4
71
+ with:
72
+ path: weather/native/weathr-bridge/artifacts
73
+
74
+ - name: Prepare npm package folders
75
+ working-directory: weather
76
+ run: npm run native:prepare-packages
77
+
78
+ - name: Sync artifacts into npm package folders
79
+ working-directory: weather
80
+ run: npm run native:sync-artifacts
81
+
82
+ - name: Publish platform packages
83
+ working-directory: weather
84
+ run: npm run native:publish-packages
85
+ env:
86
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmustier/pi-files-widget",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "In-terminal file browser and viewer for Pi.",
5
5
  "license": "MIT",
6
6
  "author": "Thomas Mustier",
@@ -15,8 +15,8 @@
15
15
  "bugs": "https://github.com/tmustier/pi-extensions/issues",
16
16
  "homepage": "https://github.com/tmustier/pi-extensions/tree/main/files-widget",
17
17
  "peerDependencies": {
18
- "@mariozechner/pi-coding-agent": "^0.50.0",
19
- "@mariozechner/pi-tui": "^0.50.0"
18
+ "@mariozechner/pi-coding-agent": "*",
19
+ "@mariozechner/pi-tui": "*"
20
20
  },
21
21
  "scripts": {
22
22
  "postinstall": "node -e \"console.log('pi-files-widget: required deps: bat, delta, glow. Install with: brew install bat git-delta glow')\""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-extensions",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "keywords": [
@@ -602,6 +602,11 @@ Examples:
602
602
  name: "ralph_start",
603
603
  label: "Start Ralph Loop",
604
604
  description: "Start a long-running development loop. Use for complex multi-iteration tasks.",
605
+ promptSnippet: "Start a persistent multi-iteration development loop with pacing and reflection controls.",
606
+ promptGuidelines: [
607
+ "Use this tool when the user explicitly wants an iterative loop, autonomous repeated passes, or paced multi-step execution.",
608
+ "After starting a loop, continue each finished iteration with ralph_done unless the completion marker has already been emitted.",
609
+ ],
605
610
  parameters: Type.Object({
606
611
  name: Type.String({ description: "Loop name (e.g., 'refactor-auth')" }),
607
612
  taskContent: Type.String({ description: "Task in markdown with goals and checklist" }),
@@ -653,6 +658,11 @@ Examples:
653
658
  name: "ralph_done",
654
659
  label: "Ralph Iteration Done",
655
660
  description: "Signal that you've completed this iteration of the Ralph loop. Call this after making progress to get the next iteration prompt. Do NOT call this if you've output the completion marker.",
661
+ promptSnippet: "Advance an active Ralph loop after completing the current iteration.",
662
+ promptGuidelines: [
663
+ "Call this after making real iteration progress so Ralph can queue the next prompt.",
664
+ "Do not call this if there is no active loop, if pending messages are already queued, or if the completion marker has already been emitted.",
665
+ ],
656
666
  parameters: Type.Object({}),
657
667
  async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
658
668
  if (!currentLoop) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmustier/pi-ralph-wiggum",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Long-running agent loops for iterative development in Pi.",
5
5
  "license": "MIT",
6
6
  "author": "Thomas Mustier",
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 - 2026-02-12
4
+ - Added an embedded demo GIF in the README that links to the MP4 demo hosted on GitHub.
5
+ - Kept demo media out of npm installs while improving README preview on GitHub/npm.
6
+
7
+ ## 0.1.0 - 2026-02-12
8
+ - Initial release of `/weather` weather widget extension.
9
+ - Added native Rust bridge (`native/weathr-bridge`) with automatic shell fallback.
10
+ - Added ANSI color preservation in the weather widget output.
11
+ - Fixed shell fallback PTY bootstrap under Bun by binding `script` stdin to `/dev/null` (avoids socket `tcgetattr` errors without stealing ESC input from Pi).
12
+ - `/weather-config` now warns when `location.auto=true` (which overrides manual latitude/longitude).
13
+ - Added optional dependency support for platform prebuilt native bridge packages (`@tmustier/pi-weather-bridge-*`).
14
+ - Added release automation workflow for publishing native bridge platform packages (`.github/workflows/weather-native-bridge.yml`).
15
+ - `/weather` now renders in the main custom UI area (above the editor) instead of centered overlay mode.
16
+ - Added `/weather-config` command and isolated config at `~/.pi/weather-widget/weathr/config.toml`.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Thomas Mustier
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,132 @@
1
+ # Weather Widget Extension
2
+
3
+ Run the [weathr](https://github.com/veirt/weathr) terminal weather app inside Pi via `/weather`.
4
+
5
+ It opens in the main widget area above the input box (same interaction style as `/snake`), supports live weather + simulation flags, keeps controls inside Pi, and preserves ANSI colors.
6
+
7
+ The extension prefers a Rust N-API bridge (`native/weathr-bridge`) and falls back to a shell bridge if native isn't built.
8
+
9
+ ## Demo
10
+
11
+ [![Weather widget demo](https://raw.githubusercontent.com/tmustier/pi-extensions/main/weather/assets/weather-demo.gif)](https://raw.githubusercontent.com/tmustier/pi-extensions/main/weather/assets/weather-demo.mp4)
12
+
13
+ [Open MP4 demo directly](https://raw.githubusercontent.com/tmustier/pi-extensions/main/weather/assets/weather-demo.mp4)
14
+
15
+ _Demo media is loaded from GitHub links and kept out of npm installs (package `files` whitelist + repo `.npmignore`)._
16
+
17
+ ## Install
18
+
19
+ ### Pi package manager
20
+
21
+ ```bash
22
+ pi install npm:@tmustier/pi-weather
23
+ ```
24
+
25
+ ```bash
26
+ pi install git:github.com/tmustier/pi-extensions
27
+ ```
28
+
29
+ Then filter to just this extension in `~/.pi/agent/settings.json`:
30
+
31
+ ```json
32
+ {
33
+ "packages": [
34
+ {
35
+ "source": "git:github.com/tmustier/pi-extensions",
36
+ "extensions": ["weather/index.ts"]
37
+ }
38
+ ]
39
+ }
40
+ ```
41
+
42
+ ### Local clone
43
+
44
+ ```bash
45
+ ln -s ~/pi-extensions/weather ~/.pi/agent/extensions/weather
46
+ ```
47
+
48
+ Or add to `~/.pi/agent/settings.json`:
49
+
50
+ ```json
51
+ {
52
+ "extensions": ["~/pi-extensions/weather"]
53
+ }
54
+ ```
55
+
56
+ ## Commands
57
+
58
+ - `/weather` — open live weather widget
59
+ - `/weather rain` — shortcut for `--simulate rain`
60
+ - `/weather --simulate snow --night`
61
+ - `/weather-config` — edit widget config (`config.toml`)
62
+
63
+ While open:
64
+ - `Esc` or `Q` closes the widget
65
+ - `R` restarts the weather process
66
+
67
+ ## Requirements
68
+
69
+ - `weathr` installed and available on PATH (or in `~/.cargo/bin/weathr`)
70
+ - `script` command available (macOS default, `util-linux` on Linux)
71
+
72
+ Install weathr:
73
+
74
+ ```bash
75
+ cargo install weathr
76
+ ```
77
+
78
+ Build the native Rust bridge locally (optional, for development):
79
+
80
+ ```bash
81
+ cd ~/pi-extensions/weather
82
+ npm run build:native
83
+ ```
84
+
85
+ Requires Rust + Node.
86
+
87
+ For npm users, the extension can load prebuilt optional packages (`@tmustier/pi-weather-bridge-*`) when published.
88
+
89
+ Troubleshooting:
90
+
91
+ - The extension auto-falls back to shell mode if native bridge has no output.
92
+ - If no matching prebuilt native package is installed for your platform, it falls back to shell mode.
93
+ - It explicitly unsets `NO_COLOR` for the weather child process and sets `COLORTERM=truecolor` when missing.
94
+ - Shell fallback binds `script` stdin to `/dev/null` (avoids Bun socket `tcgetattr` issues while preserving ANSI color output and ESC handling in Pi).
95
+ - Force shell mode manually:
96
+
97
+ ```bash
98
+ PI_WEATHER_NATIVE=0 pi
99
+ ```
100
+
101
+ ## Config Location
102
+
103
+ The extension uses an isolated config home:
104
+
105
+ - `~/.pi/weather-widget/weathr/config.toml`
106
+
107
+ Use `/weather-config` to edit it.
108
+
109
+ > If you set custom `latitude`/`longitude`, also set `location.auto = false` or `weathr` will keep auto-detecting your location.
110
+
111
+ ## Publishing native prebuilt packages
112
+
113
+ To ship `weathr-bridge` without requiring Rust at install time:
114
+
115
+ - Run GitHub Actions workflow `.github/workflows/weather-native-bridge.yml` (manual `workflow_dispatch`).
116
+ - The workflow builds prebuilt `.node` files per target, syncs them into `native/weathr-bridge/npm/*`, and publishes `@tmustier/pi-weather-bridge-*` platform packages.
117
+ - Then publish `@tmustier/pi-weather` (this extension) so consumers pick up the matching optional dependency versions.
118
+ - Keep versions in sync (`weather/package.json`, `native/weathr-bridge/package.json`, and `native/weathr-bridge/npm/*/package.json`).
119
+
120
+ Manual fallback (if not using the workflow):
121
+
122
+ ```bash
123
+ cd ~/pi-extensions/weather
124
+ npm run native:prepare-packages
125
+ # build / download per-target pi_weather_bridge.<target>.node files into native/weathr-bridge/artifacts
126
+ npm run native:sync-artifacts
127
+ npm run native:publish-packages
128
+ ```
129
+
130
+ ## Changelog
131
+
132
+ See `CHANGELOG.md`.