Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
jules-core
Core models, traits, builders, and error types for Jules-SDK — no network I/O.
This crate is an internal implementation detail of
jules-sdk. Most users should depend onjules-sdkinstead — it re-exports the stable parts of this crate's public API. Depend onjules-coredirectly only if you're implementing an alternative transport or need types this facade doesn't re-export yet.
Status: Pre-Alpha. Types here are stable enough to build and test against, but the public shape may still change before
1.0. See the workspace PROJECT_STATE.md for authoritative status.
What's in here
jules-core defines the transport-agnostic building blocks that jules-api implements against:
| Module | Purpose |
|---|---|
config |
Config / ConfigBuilder — API key and timeout configuration |
session |
Session / SessionBuilder, SourceContext, GithubRepoContext — mirrors the real v1alpha Session resource |
source |
Source — the v1alpha Source resource (e.g. connected GitHub repos) |
activity |
Activity — the v1alpha sessions.activities resource |
conversation |
Conversation — an in-memory, ordered list of Messages |
message |
Message, Role — a single conversation turn |
client |
ClientRequest — the generic request wrapper passed to Client::send_request |
response |
ClientResponse — the generic response wrapper |
traits |
Client — the trait jules-api's JulesClient implements |
errors |
SDKError and its variants (Authentication, Api, Network, Streaming, Tool, Validation) |
pagination |
Page<T> — items plus an optional next_page_token |
builder |
Internal builder helpers used by the higher-level model builders |
middleware (feature middleware) |
MiddlewarePipeline, RetryMiddleware, logging middleware |
tool (feature tools) |
Tool / DynTool traits, ToolParameters for tool-calling |
wasm (feature wasm) |
WebAssembly-specific glue |
None of these types perform network I/O — that's jules-api's job. jules-core is safe to depend on from wasm32 targets and from anything that just needs to build or parse Jules API data shapes.
Installation
[]
= "0.1"
Usage
Building a Session from a real API response
Session deserializes directly from the real v1alpha API's camelCase JSON:
use Session;
let json = r#"{
"name": "sessions/11413719004378428992",
"title": "Example session",
"state": "AWAITING_USER_FEEDBACK",
"sourceContext": {
"source": "sources/github/example-owner/example-repo",
"githubRepoContext": { "startingBranch": "main" }
}
}"#;
let session: Session = from_str?;
assert_eq!;
# Ok::
Implementing the Client trait
Anything that can turn a ClientRequest into a ClientResponse can act as a Jules-SDK client — this is how jules-api's JulesClient plugs in, and how you'd write a test double:
use ClientRequest;
use Conversation;
use SDKError;
use ;
use ClientResponse;
use Client;
;
# async
Feature Flags
| Flag | Default | Enables |
|---|---|---|
streaming |
✅ | The streaming module |
tools |
✅ | The tool module and Message's tool_calls/tool_call_id fields |
middleware |
— | The middleware module (pulls in tokio's time feature) |
telemetry |
— | Tracing/metrics instrumentation points |
cli |
— | Support code shared with jules-cli |
wasm |
— | The wasm module |
experimental |
— | Unstable, no-notice-required-to-break APIs |
More
- jules-sdk — the facade crate most users should depend on instead
- jules-api — the real HTTP client built on top of these types
- Root README · PROJECT_STATE.md · ARCHITECTURE.md
References
Type shapes (in particular Session, SourceContext, and GithubRepoContext) were modeled directly from the Jules API REST reference and cross-checked against google-labs-code/jules-sdk.
License
Dual-licensed under MIT or Apache-2.0, at your option.