Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Build
run: npm run build

- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Verify package version matches tag
run: |
PKG_VERSION=$(node -p "require('./package.json').version")
if [ "$PKG_VERSION" != "${{ steps.version.outputs.VERSION }}" ]; then
echo "::error::package.json version ($PKG_VERSION) does not match tag (${{ steps.version.outputs.VERSION }})"
exit 1
fi

- name: Package dist artifacts
run: |
cd dist
tar -czf ../goclaw-webchat-${{ steps.version.outputs.VERSION }}.tar.gz .
cd ..

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
goclaw-webchat-${{ steps.version.outputs.VERSION }}.tar.gz
dist/goclaw-webchat.umd.js
dist/goclaw-webchat.es.js

- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ For production deployment with nginx reverse proxy, see `examples/docker-compose
| `customCss` | `string` | — | Extra CSS for Shadow DOM |
| `reconnect` | `boolean` | `true` | Auto-reconnect on disconnect |
| `maxReconnectAttempts` | `number` | `10` | Max reconnection attempts |
| `showToolCalls` | `boolean` | `false` | Show tool call indicators in chat |
| `zIndex` | `number` | `999999` | CSS z-index |

## Proxy Server Configuration
Expand Down
4 changes: 2 additions & 2 deletions src/chat-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ export class ChatWidget implements GoClawWidget {
contentEl.innerHTML = renderMarkdown(msg.content);
}

// Update tool call indicators
if (msg.toolCalls?.length) {
// Update tool call indicators (only if showToolCalls is enabled)
if (this.config.showToolCalls && msg.toolCalls?.length) {
let toolContainer = el.querySelector('.gc-msg-tools');
if (!toolContainer) {
toolContainer = document.createElement('div');
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export interface GoClawConfig {
container?: HTMLElement;
/** Z-index for the widget (default: 999999) */
zIndex?: number;
/** Show tool call indicators in chat UI (default: false).
* Tool call data is still available via onMessage callback regardless of this setting. */
showToolCalls?: boolean;
/** Locale for i18n (default: 'en') */
locale?: string;
/** Callback hooks */
Expand Down
Loading