pi-agent-rb 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +15 -1
- data/lib/pi_agent/client.rb +9 -1
- data/lib/pi_agent/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cdd468a7f13c6052da92efa8f7668c92fc22516d297752aece27540c5c641ce
|
|
4
|
+
data.tar.gz: 35b8f85f7b20f4eef389eaaaebf051f33c02d7b14911741f77678801657bd4bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f90120b7d6a89dc6f65e2ad00df17f856a896b1f581326e4e2e9488adaf43625e7a57e63001e570b0f236787ffe020d4f77a4871a09b2e8ac9e0e51518e7e40e
|
|
7
|
+
data.tar.gz: 14ce207ea90d9eb89e35a58c9543273908bb452f0e3898cbb4b28f17733fcac6d5fb1eac5102eef4178cf25e7211c6f3d20566c59ad9b6cd710005de2b51a7af
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.4] - 2026-06-09
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Bumped pinned upstream `pi-coding-agent` version to `0.79.0` (cache-hit
|
|
14
|
+
visibility in footer, richer SDK exports, and assorted fixes; the RPC wire
|
|
15
|
+
protocol this gem drives is unchanged).
|
|
16
|
+
- **Behavior change in pi 0.79.0:** project-local inputs (`.pi/settings.json`,
|
|
17
|
+
project extensions, resources, packages) are now trust-gated. In RPC mode pi
|
|
18
|
+
does not prompt — without a saved trust decision it silently ignores them.
|
|
19
|
+
Pass the new `approve: true` option to keep loading them (see Added).
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- `approve:` option on `Client.new` / `PiAgent.session` / `PiAgent.open`:
|
|
23
|
+
`true` appends `--approve` to the pi spawn args (trust the project),
|
|
24
|
+
`false` appends `--no-approve` (explicitly ignore project inputs); the
|
|
25
|
+
default `nil` leaves pi's own behavior untouched.
|
|
26
|
+
|
|
10
27
|
## [0.1.3] - 2026-05-29
|
|
11
28
|
|
|
12
29
|
### Changed
|
data/README.md
CHANGED
|
@@ -14,7 +14,7 @@ building interactive agent UIs (web, TUI) on top of pi.
|
|
|
14
14
|
|
|
15
15
|
- Ruby 3.3+
|
|
16
16
|
- `pi` on `PATH` (install via `npm i -g @earendil-works/pi-coding-agent`)
|
|
17
|
-
- This gem is pinned against pi `0.
|
|
17
|
+
- This gem is pinned against pi `0.79.0`; other versions may work but are not verified.
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
@@ -100,6 +100,20 @@ Supported formats: png, jpeg, gif, webp.
|
|
|
100
100
|
For low-level RPC access (raw `request`/`notify`/`subscribe`), use
|
|
101
101
|
`PiAgent.open`, which yields a `PiAgent::Client`.
|
|
102
102
|
|
|
103
|
+
## Project trust
|
|
104
|
+
|
|
105
|
+
Since pi `0.79.0`, project-local inputs (`.pi/settings.json`, project
|
|
106
|
+
extensions, resources, and packages) are trust-gated. In RPC mode pi never
|
|
107
|
+
prompts: unless the project was already trusted (e.g. interactively on the
|
|
108
|
+
same machine), it **silently ignores them**. Pass `approve: true` to trust
|
|
109
|
+
the project, or `approve: false` to explicitly ignore project inputs:
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
PiAgent.session(cwd: "/path/to/project", approve: true) do |session|
|
|
113
|
+
# project .pi extensions and settings are loaded
|
|
114
|
+
end
|
|
115
|
+
```
|
|
116
|
+
|
|
103
117
|
## Extension UI
|
|
104
118
|
|
|
105
119
|
pi extensions can request user interaction (confirm, select, input,
|
data/lib/pi_agent/client.rb
CHANGED
|
@@ -15,6 +15,12 @@ module PiAgent
|
|
|
15
15
|
# Pass `transport_factory:` — a callable `(on_message:, on_stderr:) ->
|
|
16
16
|
# transport` — to run pi somewhere else (e.g. inside a remote sandbox).
|
|
17
17
|
# See Transport for the transport contract.
|
|
18
|
+
#
|
|
19
|
+
# Since pi 0.79.0 project-local inputs (.pi/settings.json, project
|
|
20
|
+
# extensions, resources, packages) are trust-gated, and in RPC mode pi
|
|
21
|
+
# silently ignores them unless the project was already trusted. Pass
|
|
22
|
+
# `approve: true` to trust the project (`--approve`), or `approve: false`
|
|
23
|
+
# to explicitly ignore project inputs (`--no-approve`).
|
|
18
24
|
class Client
|
|
19
25
|
DEFAULT_BIN = "pi"
|
|
20
26
|
DEFAULT_ARGS = ["--mode", "rpc"].freeze
|
|
@@ -45,8 +51,10 @@ module PiAgent
|
|
|
45
51
|
nil
|
|
46
52
|
end
|
|
47
53
|
|
|
48
|
-
def initialize(bin: nil, args: DEFAULT_ARGS, env: {}, cwd: nil,
|
|
54
|
+
def initialize(bin: nil, args: DEFAULT_ARGS, env: {}, cwd: nil, approve: nil,
|
|
55
|
+
extension_ui: nil, transport_factory: nil)
|
|
49
56
|
@extension_ui_handler = extension_ui
|
|
57
|
+
args = [*args, approve ? "--approve" : "--no-approve"] unless approve.nil?
|
|
50
58
|
@transport_factory = transport_factory || build_subprocess_factory(bin, args, env, cwd)
|
|
51
59
|
@pending = {}
|
|
52
60
|
@pending_mutex = Mutex.new
|
data/lib/pi_agent/version.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module PiAgent
|
|
4
|
-
VERSION = "0.1.
|
|
4
|
+
VERSION = "0.1.4"
|
|
5
5
|
|
|
6
6
|
# Pinned upstream pi-coding-agent version this gem is verified against.
|
|
7
7
|
# See: https://www.npmjs.com/package/@earendil-works/pi-coding-agent
|
|
8
|
-
SUPPORTED_PI_VERSION = "0.
|
|
8
|
+
SUPPORTED_PI_VERSION = "0.79.0"
|
|
9
9
|
end
|