clawdforge/clients
Kayos 42b1516bc3 clients/php: v0.2 multi-turn Session API
- Session class with try/finally pattern + Client::session(callable) block helper
- Idempotent Session::close (in-memory + server idempotent)
- __destruct best-effort close fallback (errors logged via error_log, never raised)
- Client::createSession / ::session / ::listSessions / ::getSession
- TurnResult::text() helper concatenating text events
- TurnEvent value object preserves tool_call / thinking / text uniformly
- SessionState value object for list/get responses
- ClosedSessionException for use-after-close guard
- Session::__debugInfo redacts forge back-reference (no bearer in var_dump)
- tests/SessionTest.php: 15 tests covering create/close/turn/idempotency/exception/list/state/text/destruct/regression
- README "Multi-turn / Sessions (v0.2)" section + try/finally + block-form
  + __destruct + __debugInfo notes; exception tree updated

v0.1 surface unchanged — 44 existing ClientTest tests still green, +15 new
v0.2 tests in SessionTest. Client.php diff is purely additive (285 lines
appended, zero v0.1 lines touched).

Naming follows the existing PHP SDK convention: Clawdforge\Client (not the
spec's generic Sulkta\Clawdforge\Forge), with the new types living in the
same Clawdforge\ namespace and Exception\ClosedSessionException slotted
under the existing ForgeException tree.

Spec: memory/spec-clawdforge-v0.2.md
Server core: 940861f
2026-04-29 06:51:17 -07:00
..
bash clients/bash: apply audit findings — security hardening + correctness fixes (347fdde → new) 2026-04-28 23:09:06 -07:00
c clients/c: apply audit findings — security + CVE bump (a69e924 → new) 2026-04-28 23:25:22 -07:00
cpp clients/cpp: apply audit findings — protocol-error guard + libcurl redirect clamp (bae34a7 → next) 2026-04-28 23:41:41 -07:00
csharp clients/csharp: apply audit findings — JSON depth caps + stream lifecycle (09aca58 → new) 2026-04-28 23:22:58 -07:00
go clients/go: v0.2 multi-turn Session API 2026-04-29 06:34:12 -07:00
java clients/java: v0.2 multi-turn Session API 2026-04-29 06:50:02 -07:00
kotlin clients/kotlin: apply audit findings — per-call HTTP timeout + token redaction (cc54cfb → next) 2026-04-28 23:33:08 -07:00
mcp clients/mcp: v0.2 multi-turn session tools 2026-04-29 06:49:49 -07:00
php clients/php: v0.2 multi-turn Session API 2026-04-29 06:51:17 -07:00
python clients/python: v0.2 multi-turn Session API 2026-04-29 06:35:27 -07:00
ruby clients/ruby: v0.2 multi-turn Session API 2026-04-29 06:46:52 -07:00
rust clients/rust: v0.2 multi-turn Session API 2026-04-29 06:39:37 -07:00
swift clients/swift: apply audit findings — multipart fix + token redaction (e4e8192 → HEAD) 2026-04-28 23:12:17 -07:00
typescript clients/typescript: v0.2 multi-turn Session API 2026-04-29 06:38:55 -07:00