Skip to content

chore: bump gui-chat-protocol to ^2.0.0 and plugin to 2.0.0 - #25

Merged
isamu merged 1 commit into
mainfrom
chore/protocol-2.0-20260803
Aug 3, 2026
Merged

chore: bump gui-chat-protocol to ^2.0.0 and plugin to 2.0.0#25
isamu merged 1 commit into
mainfrom
chore/protocol-2.0-20260803

Conversation

@isamu

@isamu isamu commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Bumps gui-chat-protocol to ^2.0.0 and this plugin to 2.0.0 (from 1.1.1).

gui-chat-protocol 2.0.0 changed ToolContextApp's index signature from (...args: any[]) => any to => unknown, so every host-backend call has to be narrowed by the plugin. This PR narrows getImageConfig with type guards in a new src/core/hostResponse.ts (no as casts), covered by tests/hostResponse.test.ts.

Items to Confirm / Review

  • Are the type guards strict enough / too strict? They check exactly the fields this plugin reads back. A host response that fails the guard now returns a narrate-only error result instead of being trusted — please confirm that fallback message is the right behavior.
  • The guards were written against the shapes the previous any-typed code assumed. If a host returns extra or differently-typed fields, the guard will reject it — worth a sanity check against the real MulmoClaude host.

User Prompt

https://www.npmjs.com/package/gui-chat-protocol 2.0.0 になった。
一部 breaking change があるので、
https://github.com/receptron/gui-chat-protocol/releases
をよくよんで、このdir以下で gui-chat-protocol を使っているものは全部あげていく。
npm があるものは全部 publish する。そのときに major のバージョンを上げる。
同時に型問題とかで refactor できるものはしておいてね。

Breaking changes in gui-chat-protocol 2.0.0

Four public signatures stopped accepting a caller-named type parameter and now take a reader instead — dispatch, subscribe, getConfig, publish ("a type parameter appearing only in return position is a type assertion with nicer syntax"). No plugin in this family calls any of them, so that half of the migration is a no-op here.

What does reach the plugins is the same rule applied to ToolContextApp:

-export interface ToolContextApp extends Record<string, (...args: any[]) => any> {
-    getConfig: <T = unknown>(key: string) => T | undefined;
+export interface ToolContextApp extends Record<string, (...args: any[]) => unknown> {
+    getConfig: {
+        (key: string): unknown;
+        <T>(key: string, parse: (raw: unknown) => T): T | undefined;
+    };

Verification

Run locally on this branch: yarn typecheck, yarn lint, yarn build, yarn test — all green.

- gui-chat-protocol ^1.2.0 -> ^2.0.0
- plugin version bumped: 1.1.1 -> 2.0.0
- narrow host responses (getImageConfig) with type guards in
  src/core/hostResponse.ts: ToolContextApp's index signature now
  returns `unknown` instead of `any`

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgui-chat-protocol@​1.2.0 ⏵ 2.0.076 +1100100 +195 +1100

View full report

@isamu
isamu merged commit b691401 into main Aug 3, 2026
11 checks passed
@isamu
isamu deleted the chore/protocol-2.0-20260803 branch August 3, 2026 01:28
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.

1 participant