Add session permission updates
Some checks failed
Test / test (3.3) (push) Failing after 9m59s
Test / test (3.4) (push) Failing after 10m0s
Test / test (3.2) (push) Failing after 10m3s

This commit is contained in:
2026-07-10 19:29:31 -07:00
parent 889d38332f
commit 8dbd3de81c
5 changed files with 50 additions and 2 deletions

View File

@@ -144,6 +144,10 @@ module Opencode
execute(request)
end
def update_session(session_id, permissions:)
patch("/session/#{session_id}", { permission: permissions })
end
def children(session_id)
uri = build_uri("/session/#{session_id}/children")
request = Net::HTTP::Get.new(uri)
@@ -434,6 +438,13 @@ module Opencode
execute(request)
end
def patch(path, body)
uri = build_uri(path)
request = Net::HTTP::Patch.new(uri)
request.body = body.to_json
execute(request)
end
def build_uri(path, scoped: true)
uri = @uri.dup
uri.path = path

View File

@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Opencode
VERSION = "0.0.1.alpha2"
VERSION = "0.0.1.alpha3"
end