// app/javascript/controllers/char_agent_controller.js
import { Controller } from "@hotwired/stimulus"
import '@mcp-b/char/web-component';
export default class extends Controller {
static values = { token: String, clientId: String }
connect() {
if (this.tokenValue && this.clientIdValue) {
this.element.connect({ idToken: this.tokenValue, clientId: this.clientIdValue });
}
}
tokenValueChanged() {
if (this.tokenValue && this.clientIdValue) {
this.element.connect({ idToken: this.tokenValue, clientId: this.clientIdValue });
}
}
}