ez-agent-lib/src/main/java/name/devnull/ezagent/lib/session/package-info.java
/**
* Asynchronous client operations modeled on ez-agent-ruby/lib/ez_agent/api/sessions.rb.
* Every operation uses a correlated {@code RpcTransport.request}; no service runs locally.
*
* <h2>Coverage</h2>
* <ul>
* <li>Roots: list_roots / root_list.</li>
* <li>Sessions: create_leaf / leaf_created (create and source-turn fork), list_leaves /
* leaf_list, rename_leaf / leaf_renamed, delete_leaf / leaf_deleted, rewind_leaf /
* leaf_rewound, list_queued / queued_list, leaf_stats / leaf_stats_response.</li>
* <li>Metadata: update_leaf_meta / leaf_meta_updated; options use name, set_config,
* delete_config. LeafConfig is the required mutation route for effective agent config.</li>
* <li>LeafConfig: get_leaf_config / leaf_config_value, set_leaf_config / leaf_config_set,
* delete_leaf_config / leaf_config_deleted, list_leaf_config / leaf_config_list,
* effective_config / effective_config (optional leaf).</li>
* <li>Turns: list_history / history_list, get_turn / turn_content, list_turn_tree /
* turn_tree_list, create_virtual_root / virtual_root_created, and asynchronous canonical
* history hydration with summary/cut verification.</li>
* <li>RunControl and Sessions: prompt / prompt_accepted, steer / steer_accepted,
* abort / abort_received. Acceptance is not terminal run completion. Queued inputs are
* queried through Sessions. There is no invented enqueue or queue-delete RPC.</li>
* <li>Questions: question_reply / question_reply_ack for an exact project-config trust
* revision. Pending questions arrive in complete leaf_updated event snapshots; there is
* no separate pending-question lookup RPC. The event package handles these snapshots.</li>
* <li>Subscriptions: switch_leaf / leaf_switched, drop_feed / feed_dropped.
* Ruby's switch alias is named switchLeaf because switch is a Java keyword.</li>
* </ul>
*
* <h2>Options, identity and results</h2>
* <p>Options use exact snake_case wire keys, not renamed Java fields: for example create
* accepts name, model, thinking_level, cwd, active_tools, active_plugins, autosubscribe,
* and is_temp (Ruby's temporary option). Unknown fields are forwarded. Caller-supplied
* type, itr, request_id and method-owned routing members are rejected, including null
* overrides. Create/fork derive tools_explicit and plugins_explicit, which cannot be
* overridden. Empty active lists explicitly select none; unspecified lists send the
* protocol's required null members. Other nullable options are omitted; false, zero,
* empty arrays, empty objects and empty strings remain present.</p>
* <p>All open response envelopes remain JSONObject values without dropping unknown fields.
* LeafInfo, PendingTurn and AttachmentBlob snapshot their data and return defensive copies.
* Roots contain ancestry; leaves are persistent handles. Fork takes a source turn ID,
* tree takes a root ID, and history takes a leaf ID. Rewind's empty new tip explicitly
* selects the root boundary. Prompt/steer's required nullable parent_turn_id differs from
* an explicit empty root-boundary string. No leaf filtering or sorting is applied.</p>
* <p>Every RPC, including each canonical-history hydration, waits without a deadline
* for its response, transport closure/failure, or cancellation; see
* {@link name.devnull.ezagent.lib.RpcTransport}. Missing heartbeats do not fail work.
* No method blocks, retries, reconnects or replays.</p>
*
* <h2>Remote paths and attachments</h2>
* <p>Any cwd is an already-remote server-side path. Unlike Ruby's Dir.pwd default, this
* library never substitutes an Android local directory; absent cwd leaves selection to
* the connected service. Structured replies retain any remote wire paths untouched.
* Android content:// URIs and local paths are not remote paths, payload references or
* uploads. URI access, permissions, preview, lifetime, separate SSH file transfer and
* any staging/upload policy belong outside this library.</p>
* <p>The current PendingTurn attachment contract is attachment_blob containing file_array
* and matching meta_files. Entries carry filename, mime_type, size in decoded bytes,
* encoding (b64 or utf8), and payload. Filename is display metadata, not a file to open
* remotely. AttachmentBlob's byte/text helpers encode inline payloads directly into
* JSONL; neither a path encoding nor an image-specific upload RPC is invented. Existing
* turn_content.meta_files remains an open response field, not an assumed upload API.</p>
*
* <p>Transport dialing, SSH, Android/UI behavior, daemon lifecycle automation, provider
* hosting and Workflow admission/cancellation policy are deliberately outside this
* package. It contains all client operations from Ruby sessions.rb, not daemon handlers.</p>
*/
package name.devnull.ezagent.lib.session;