Skip to content

release: core 0.5.0, server 0.6.0, widget 0.6.0 with protocol v1, shared storage and endpoint protection - #320

Merged
anurag629 merged 81 commits into
productionfrom
dev
Oct 23, 2026
Merged

anurag629 merged 81 commits into
productionfrom
dev

Conversation

@anurag629

Copy link
Copy Markdown
Member

The P1 release: the new reply engine, protocol v1 on the wire, shared storage, and endpoint protection. This was planned as two releases (0.6 in December, 0.7 in January). All of it is on dev and ready, so it ships as one.

Versions after the version PR: @chatcops/core 0.4.0 to 0.5.0, @chatcops/server 0.5.0 to 0.6.0, @chatcops/widget 0.5.0 to 0.6.0. The four store packages are still private and don't publish here. Their first publish comes after this release. The version PR will try to bump them to 1.0.0, because they list core as a peer dependency and core moves from 0.4 to 0.5, so I'll set them to 0.1.0 in that PR before it's merged.

What's in it

Core

Server

Widget

Docs: upgrade guide, security page, protocol reference, storage page with scheduled purge, pre-chat form guide, providers page.

Upgrade notes

All of it is on the new "Upgrading from 0.5" page. The parts most likely to need action:

  • Budgets are on by default: 200 replies per conversation and 2M tokens per IP per day. Set budgets to change them.
  • Per-IP limits need a trusted IP. Vercel, Cloudflare and Express (trust proxy) work as is. Other hosts need clientIp, or per-IP limits are skipped.
  • Provider classes moved to @chatcops/core/providers/claude, /openai and /gemini. createProvider() doesn't change.
  • cors and conversationStore are deprecated in favor of allowedOrigins and storage.

How it was tested

On dev at 5b31899: build, typecheck, 1152 unit tests and 15 Chromium e2e tests pass. The e2e tests include the published 0.5.0 widget against this server. Live run with real Claude, OpenAI and Gemini keys, all 14 checks passed:

  • a text reply through the server handler in protocol v1
  • a tool with nested input
  • two tools in one step
  • abort in under 10 ms on all three providers
  • Claude dropping temperature with one warning
  • a Claude prompt cache read on the second request (9,116 tokens)

anurag629 and others added 30 commits October 20, 2026 10:53
* Fixes #83

* Fixes #183

* Update README.md

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>

* Update packages/widget/README.md

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* chore: add biome linter and fix genuine lint violations (#191)

* chore: add empty changeset for internal lint improvements (#191)

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
POST /api/visitors incremented the counter on every call. The EVAL
script in incrementVisitors now runs SET <key> 1 NX EX 86400 first and
only increments when it succeeds, so a visit still costs one Upstash
command. The key is a SHA-256 hash of the cf-connecting-ip header and
the UTC date; the raw IP is never stored. Without the header (local
dev), every call still counts.
A provider whose setup rejects (unknown provider.type, SDK that throws on
a missing key) is now handled where it is created: logged once with the
[chatcops] prefix, message only, so no API key or config is logged. Each
chat request then gets provider_error instead of an unhandled rejection
that stops the server process. Request validation and rate limiting run
before the provider is awaited, as before.

Closes #175

Co-authored-by: Saif Ullah jafri <saifullahjafri@Saifs-MacBook-Air.local>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
…225)

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
)

Types only, no behavior change. ChatMessage gains optional parts, status,
usage and aiGenerated; Conversation gains an optional version. partsOf()
and messageText() read parts from any message, including ones saved
without them. ProviderEvent and an optional AIProvider.step() describe a
single model request. WirePart, ChatRequestV1 and the error body describe
protocol v1, which the widget will ask for with protocol: 1 in the body.

Type-level tests (*.test-d.ts) now run through tsc in the core project.
* FIxed bot answer docs

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>

* Update promt

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>

* update promt

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>

---------

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
…uite (#243)

ConversationStore gains optional append (atomic, versioned, ConflictError
on a stale expectedVersion), updateMessage, removeMessage, list and purge.
CounterStore, KeyValueStore and EventSink join it in ChatCopsStorage.

memoryStorage() implements every capability in process with bounded maps
and lazy expiry, so it needs no timers. withAppend() gives a 0.4 store the
new conversation methods. @chatcops/core/testing exports
runStorageConformance() for store packages and custom stores.
#244)

vitest projects and publint now cover every packages/* folder, so a new
store package needs no root changes. The test job starts Redis, the Upstash
REST emulator and Postgres and exposes them as CHATCOPS_TEST_* variables
for the conformance suite. Store packages get their own coverage minimum,
peer dependents of core only bump when out of range, and CONTRIBUTING has
a section on writing a store package.
…tartup (#250)

ToolDefinition and ChatTool take an inputSchema (any JSON Schema with an
object root). The flat 0.4 parameters form still works and is converted
by toolInputSchema(). execute() gets a context with the conversation id
and an AbortSignal. The server runs validateTools() when it starts, so an
invalid or duplicate name or a bad schema fails at boot with every
problem listed.
#251)

ConversationManager takes a ChatCopsStorage, defaults to memoryStorage()
and writes through append (wrapping 0.4 stores with withAppend and a
one-time warning), so two instances on one conversation keep every
message. A conversation is saved with its first message, not on first
read. History for the model is trimmed by an estimated token budget,
keeping the first user turn. New appendMessages, updateMessage,
getHistory and acquireTurn. normalizeHistory moves to providers/history.
* Use randomId

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>

* added changeset

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>

* Address review

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>

---------

Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>
* fix(website): add secret salt to visitor hash (#223)

* docs: document VISITOR_HASH_SALT in CONTRIBUTING.md (#223)

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* feat(widget): mark assistant messages with data-ai-generated

* docs(widget): explain reaching ai generated replies through the shadow root

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
abelzach and others added 29 commits October 21, 2026 17:18
* docs: add server storage guide

* docs: address storage review feedback

* docs: finalize storage retention section

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
)

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* feat(server): sign and verify session tokens with HS256 (#230)

* fix(server): address maintainer corrections for session token (#230)

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* perf(widget): drop xmlns from the inline icons

The icons are set with innerHTML, and the HTML parser already puts <svg>
in the SVG namespace, so the xmlns attribute does nothing. The same
36-character string was repeated in five icons (panel, fab, input).

Script tag bundle: 13798 -> 13769 bytes gzipped (-29).

* perf(widget): drop the default easing keyword and shorten the shadow token

"ease" is the default transition timing function, so "0.2s ease" and
"0.2s" give the same computed styles. Also write the --cc-shadow custom
property compactly, since custom property values are kept as written.

I tried the same for the spaces after ":" in the other custom
properties, but theme.test.ts reads the stylesheet text and looks for
"--cc-accent: ", so those stay as they are.

Script tag bundle: 13769 -> 13761 bytes gzipped (-8).

* chore: add a changeset for the widget bundle trim

---------

Co-authored-by: Saif Ullah jafri <saifullahjafri@Saifs-MacBook-Air.local>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* feat: add SQLite storage package

* fix: address SQLite store review feedback

* style: format SQLite conversation store

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* test(e2e): cover cross-origin chat requests

* test(e2e): fix cross-origin request assertion

* test(e2e): address cross-origin review feedback

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
…ider and provider imports (#308)

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* docs(server): add protocol reference for custom clients

* docs(server): address protocol reference review

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
… Objects (#296)

* feat(store-cloudflare): add Cloudflare storage for D1, KV and Durable Objects (#249)

* fix(store-cloudflare): fix concurrency bottlenecks and increase vitest timeout

* fix(store-cloudflare): address maintainer review feedback for PR #296

---------

Co-authored-by: Bhushan Agrawal <bhushanagrawal@Bhushans-MacBook-Air.local>
* feat(core): buffer analytics events into sinks

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(core): document buffered analytics sinks

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* docs: add scheduled purge recipes

* docs(server): address purge scheduling review feedback

---------

Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
Adds checkSecuritySettings() in packages/server/src/security/startup-checks.ts
and tests. Reports errors/warnings for:
- session secrets < 32 bytes (UTF-8)
- secret matches NEXT_PUBLIC_, VITE_, PUBLIC_, NUXT_PUBLIC_, EXPO_PUBLIC_, REACT_APP_ env vars
- allowed origin not http(s):// or *
- origin with path/query/trailing slash
- * combined with other origins
- duplicate secrets (warn)
- http:// origin not localhost/127.0.0.1 (warn)

Not exported from @chatcops/server yet.

Closes #231
@anurag629
anurag629 merged commit 4f7a0ea into production Oct 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.