Driven by a customer's lead-scoring rubric (A/B/C keyword tiers, bonuses,
deductions, compliance-risk words, lead fields):
- the judge returns score/signals/risk/risk_reason/reason; levels come
from configurable high_score (60) and ask_score (30), so medium and
high intent are asked once; 0.1/0.2-style strong_intent answers still
map to a score
- compliance risk (configurable risk_prompt) marks the lead "risk": no
contact request, no sales email, listed for review
- once contact details arrive, configurable lead_fields are extracted
from the whole conversation and shown at the top of the email (subject
now carries level and score) and on the page
- Page: score/level column, risk total and filter, lead fields and
per-judgment signals in the detail view
- bump to 0.3.0
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
Record every purchase-intent judgment per conversation (result, reason,
the user's message, an AI reply excerpt) plus the contact request,
captured contact, email attempts and errors as a per-user timeline
(latest 100 events). Users who were judged but not asked now get an
"idle" row; asking still happens at most once.
Add a read-only Page (留资判断记录 / Lead judgments): totals, a filterable
and searchable conversation list, and a detail panel with the timeline
and the 30 most recent messages. i18n en_US / zh_Hans. Bump to 0.2.0.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
Storage: MAX_SESSION_STORAGE_BYTES was only ever checked and raised; nothing
evicted by bytes. A 300-message cap cannot bound a session whose images are
stored inline as data: URLs, so two large images hit the 8 MiB ceiling and the
reply failed with "history has not been truncated". Evict the oldest messages
until the payload fits and keep the newest ones.
Console: the 5s poll only reloaded the session list and takeover status, never
the conversation, so replies from the other side never appeared without
switching sessions. Add a silent refresh that keeps the input enabled, preserves
scroll unless already at the bottom, and yields to scroll-up pagination.
Source was 0.1.7 while the shipped artifact is 0.2.7, so this also carries the
intermediate work; version 0.2.8.
Co-authored-by: multica-agent <github@multica.ai>
Review asked for copy to be synchronous instead of falling back to a `/item`
round trip: `/list` already returned the whole item and it is in `cache`, so
the URL is in hand. Removing the awaited hop matters beyond latency — the
`execCommand` tier needs the click's user-gesture window, and an await can
spend it before the write happens.
An empty URL still toasts instead of silently "succeeding", and the copy
handler no longer awaits anything. Verified in a real blob: iframe with the
real sandbox: the click issues no `/item` request at all, the clipboard ends up
byte-identical to the expected absolute URL, and it still does with
`navigator.clipboard` deleted.
Co-authored-by: multica-agent <github@multica.ai>
Copy was broken twice over. `langbot.api()` already resolves the unwrapped
payload (PageResponse.ok -> HTTP data -> resp.data.data -> the SDK's
resolve(data.data)), so `item.data.url` was always `undefined` and the page
copied an empty string. `writeText('')` resolves without throwing, so it also
never reached the fallback: the UI said "copied" while the clipboard stayed
empty.
The iframe is worse than assumed. It is a `blob:` document under
`sandbox="allow-scripts allow-forms"`, so its origin is opaque: `location.origin`
is "null", relative asset URLs do not load, and `navigator.clipboard` rejects
with NotAllowedError. `/list` returns relative URLs while `public_base_url` is
empty, so even a correct value would have pasted as an unusable path. URLs are
now made absolute against `location.ancestorOrigins[0]` before either the
clipboard or an `<img src>`, and copy reads `item.url` from the list cache
instead of making a redundant `/item` round trip.
Every other call had the same layer mistake: `res.error` is never set on a
resolved value, because failures reject the promise, so no failure ever
surfaced. All call sites now catch, and an empty URL toasts an error rather
than claiming success.
Verified in a real blob: iframe with the real sandbox: relative url -> absolute
-> clipboard read back byte for byte, and the same URL loads as the preview
(0 `/image` calls). Also passes with `navigator.clipboard` removed, proving the
execCommand tier is what carries it.
The host is untouched now, so this is plugin-only; the `allow-modals` flip is
dropped and the clear confirmation stays in-page.
Co-authored-by: multica-agent <github@multica.ai>
New misc plugin langbot-team/LeadCapture 0.1.0 (购买意向留资):
- after each AI reply (NormalMessageResponded) a configured LLM judges
strong purchase intent against a configurable prompt over the recent
conversation (monitoring.messages, read-only)
- on strong intent, a fixed contact-request text is appended to that
reply, once per bot+user
- user messages are then checked for contact details (patterns for CN
mobile/landline, email, WeChat; LLM extraction as fallback)
- on capture, the full conversation is emailed via Resend (configurable
API key, sender, recipients) with a .txt transcript attachment; failed
sends are retried on later replies, up to 3 attempts; an optional
thank-you is appended to the next reply
- every failure is logged and never breaks the conversation
Misc plugin CI now uses any plugin's own requirements-dev.txt.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* feat(plugins): generalize OASlackBridge into HandoffBridge
Rename langbot-team/OASlackBridge to langbot-team/HandoffBridge (人工客服
转接 / Human Handoff Bridge) 0.1.0 and make it platform-neutral:
- customer side: any bot (source_bot); staff side: any bot whose
send_message returns message_id and whose inbound replies carry a Quote
(Slack, Lark, QQ OneBot v11), posting to a group/channel or a private chat
- staff can reply to (quote) the request or any forwarded message; every
forwarded message is mapped and all mappings are removed on close
- Slack escaping/decoding only when the staff bot is Slack (bot.read)
- the WeChat 48-hour rule becomes reply_window_hours (0 = no limit)
- components renamed to handoff (EventListener) and staff_reply (Runner)
READMEs rewritten for users, including how to find group IDs on each
platform and how to migrate from OASlackBridge. Misc plugin CI now uses
any plugin's own requirements-dev.txt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* feat(HandoffBridge): platform-neutral handoff between any customer and staff bots
Content changes for the rename in the previous commit: generic config
(source_bot, staff_bot, staff_target_type/id, reply_window_hours),
per-message reply references, Slack formatting only for Slack staff bots,
user-facing READMEs, catalog/index/CI updates and tests for non-Slack and
private-chat staff targets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
After the Slack root message, reply in its thread with the user's full
OpenID, session ID, Official Account bot, message count, first contact
time and the most recent user/AI messages (history_messages, default 10,
max 50). Data comes from the read-only monitoring.messages Workspace
operation, now declared; without the grant the details fall back to the
basic fields with a hint. Never blocks the takeover. Toggle with
send_user_details. Bump to 0.4.0.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
ai-source-v2 finding F-01 for RockChinQ/GitHubKit 0.2.3: the background poller
wrapped its whole lifetime in bind_invocation(handler, config, binding), so
after the scheduling command ended the loop still ran under a freshly created,
active invocation - tenant config, GitHub token and Host authority retained
outside the SDK's invocation lifetime.
Background Host calls (plugin KV read/write and message pushes) now pass the
immutable installation binding as their explicit action_context. call_action
validates it against the live connection (Workspace, installation, revision and
artifact), so the Host decides whether that installation may still act and
refuses a detached or superseded revision. The poller task starts in an empty
Context and keeps no invocation and no config snapshot; GC-visible token,
interval and language settings are re-read when the poller is (re)created.
Co-authored-by: multica-agent <github@multica.ai>
ai-source-v2 finding F1 for langbot-team/ScheNotify 0.2.7: the detached
scheduler wrapped its whole lifetime in bind_invocation, so a reminder fired
after the scheduling call ended still ran under a freshly created, active
invocation - authority re-established outside the SDK's invocation lifetime.
Each delivery now passes the immutable installation binding as the explicit
action_context of the Host action. call_action resolves and validates that
context against the connection binding (Workspace, installation, revision and
artifact), so the Host - not the plugin - decides whether this installation may
still act, a superseded revision or detached installation is refused, and the
loop needs neither an invocation nor a configuration snapshot. The manifest and
permissions are unchanged: delivery is still the bot.message.send capability.
Co-authored-by: multica-agent <github@multica.ai>
* feat(OASlackBridge): notify the Official Account user when takeover starts and ends
Add start_notice / end_notice config (default Chinese texts, empty
disables). The start notice is sent after the Slack root message; the end
notice after !close or an observed expiration, before the AI reply. No
end notice past the 48-hour window or when the expired user's message
starts a new takeover. A failed notice never undoes the takeover change
and is reported in the Slack thread with the readable errcode.
Bump to 0.3.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* docs(OASlackBridge): rewrite README for end users
Step-by-step setup (Official Account auto mode, Slack app scopes/events,
finding the channel ID, permissions, processor subscription), staff usage,
troubleshooting and limits, in en and zh_Hans.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
ai-source-v2 finding F1 for langbot-team/URLSummary 0.1.10: the URL extraction
pattern keeps control characters (a DEL survives the trailing punctuation
strip), so http.client raised InvalidURL quoting the whole relative request
target — query string included. The redaction boundaries only matched absolute
URLs, so a signed query reached the shared log verbatim.
Refuse control characters in validate_url before a request target exists,
skip such URLs during detection, and log only an exception class instead of
raw exception text (and frames only, not traceback.format_exc() tail).
Co-authored-by: multica-agent <github@multica.ai>
The API key travelled as a `key` query parameter. httpx logs
`HTTP Request: GET <full url>` at INFO level, so a successful request wrote
the installation's credential into the shared plugin runtime log (ai-source-v2
finding F-01 for langbot-team/QWeather 0.1.7). QWeather supports API KEY
authentication through the `X-QW-Api-Key` header, so pass the key there and
keep it out of the URL, and stop logging whole provider payloads at debug
level.
Co-authored-by: multica-agent <github@multica.ai>
Every listed version still carries the old langbot-plugins repository link,
and many also have unpublished source changes. Bump the patch version so
each can be republished from the LangBot repository. SDK requirements stay
as ranges.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* feat(plugins): add timezone config to ScheNotify for all tools (LANG-319)
Add a `timezone` plugin config (IANA name, UTC, or an offset such as
UTC+8; empty keeps the server's local timezone). get_current_time_str
reports the time in it, schedule_notify interprets time_str in it, and
!sche / !dsche display reminder times in it. Reminders now store aware
instants, so the detached scheduler compares against UTC without reading
installation config. Bump to 0.2.7 and add tzdata.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* fix(plugins): deliver ScheNotify reminders under audit-correlating SDKs (LANG-319)
The scheduler task was created with a copy of the scheduling invocation's
context, which carries the SDK's per-action audit correlation. SDKs that
close that correlation when the action returns (langbot-plugin 0.7.21,
pinned by Core) then rejected every delivery with "Plugin audit
invocation has ended", so no reminder was ever sent. Start the loop from
an empty context; it already re-enters the captured invocation.
Found during live acceptance; adds a regression test that relays the
audit correlation like the real handler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>