openpencil/crates
Kayshen-X e570886883 feat(shell-core/chat): ChatState::send_via_provider — streams through ChatProvider
Wires the existing chat widget to the `ChatProvider` trait
(commit `548c5336`). The old `send()` echo-stub stays for the
zero-provider fallback path; `send_via_provider(provider,
system_prompt, max_tokens)` is the real entry that:
  - Pushes the input as a `ChatRole::User` message
  - Builds a `ChatRequest` and calls `provider.send(req)`
  - Drains the delta iterator into a single accumulated assistant
    message (TextDelta + Thinking concatenate; Error replaces with
    "error: ..."; Done breaks the loop; ToolUse is ignored — that
    flow belongs to the agent runtime port)
  - Returns the delta count for streaming-progress reporting

Synchronous wrapper — the caller polls the iterator to completion.
A future async-capable widget can replace the inner loop with one
delta per render frame; the trait signature already returns an
`Iterator + Send`.

Tests (3): EchoProvider streams two text fragments → assistant
body "Hello, world!"; provider error surfaces as assistant body
"error: rate limited"; empty input is a no-op.

#6 AI chat now ~25% — types + trait + chat-widget integration
working end-to-end with a test double. Real HTTP transport
(reqwest + Anthropic / OpenAI-compat / Ollama backends) is the
remaining multi-week port — but the seam is in place.

Tests total: 239 shell-core (+3). Wasm32 build clean.
2026-05-14 15:45:50 +08:00
..
openpencil-app feat(openpencil-app): skeleton crate (Stage F entry placeholder) 2026-05-03 22:05:00 +08:00
openpencil-desktop fix(shell): 3 codex stop-gate regressions (anchor drag, MCP id, doc load reset) 2026-05-14 15:18:02 +08:00
openpencil-shell-core feat(shell-core/chat): ChatState::send_via_provider — streams through ChatProvider 2026-05-14 15:45:50 +08:00
openpencil-shell-native fix(shell): 3 codex stop-gate regressions (anchor drag, MCP id, doc load reset) 2026-05-14 15:18:02 +08:00
openpencil-shell-web feat(shell): export dialog + multi-format raster (PNG/JPEG/WEBP) + Property-panel preview 2026-05-14 14:02:52 +08:00
pen-codegen chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-core chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-engine chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-figma chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-types feat(pen-types): skeleton crate (bucket A) 2026-05-03 22:35:00 +08:00
wasm-libc-shim style(shell): cargo fmt --all (rustfmt-clean) 2026-05-10 18:47:33 +08:00
CLAUDE.md feat(shell): canonical .op loader + jian-core layout + visual fidelity pass 2026-05-14 09:26:08 +08:00