Commit Graph

3773 Commits

Author SHA1 Message Date
huanghuoguoguo b29ff78d7b fix(debug-chat): preserve websocket pipeline routing 2026-07-19 22:41:31 +08:00
huanghuoguoguo 517986bd10 feat(agent-runner): support scoped token counting 2026-07-19 22:41:31 +08:00
Junyan Qin a87ebd8a5f i18n: add missing agents block to es-ES, ru-RU, th-TH, vi-VN, zh-Hant
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:31 +08:00
Junyan Qin 668210c533 feat(sidebar): add group-by-type toggle to installed extensions section
- Add group-by-type button to extensions category header (mirrors the
  agent group-by-kind pattern) — syncs with the extensions page Switch
  via shared SidebarDataContext state
- Relocate both group and refresh controls to sit left-aligned
  immediately after the title for both Agent and Extensions sections
- Add plugins.groupByTypeShort i18n key to all 8 locales

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:31 +08:00
Junyan Qin 6cda1e4260 feat(sidebar): add group-by-kind toggle to Agent section
Add a toggle (left of the "+" button) that groups the Agent section by
kind, showing "Agent" and "Pipeline" sub-headers. State persists in
localStorage, mirroring the extensions group-by-type pattern.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:31 +08:00
Junyan Qin 2e619f1684 refine(sidebar): show Agent/Pipeline marker as icon only
Drop the text label; keep the icon with a title tooltip so names have
more room in the narrow sidebar.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:31 +08:00
Junyan Qin 56cd6a74d4 feat(sidebar): mark Agent entries as Agent or Pipeline
Add a trailing badge (icon + label) to each entry in the sidebar Agent
section so users can tell Agent orchestration apart from legacy Pipeline.
Thread the agent `kind` field through SidebarEntityItem.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:31 +08:00
Junyan Qin ef344ec8cc fix(bots): hide redundant namespace wildcard and show raw event code
- Only surface `ns.*` wildcard when the namespace has 2+ concrete events,
  so single-event adapters (legacy) show just the one event
- Show raw event code as a muted subtitle under each option's label

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:31 +08:00
Junyan Qin 95f3409d55 feat(bots): refine event binding editor UI and i18n
- Move conditions toggle between event select and arrow; drop "IF" label
- Remove "all events" (*) option from event select
- Add i18n labels for concrete event names (zh/en/ja) via bots.eventNames
- Narrow fallback event set to message.received for adapters without
  declared supported_events (legacy adapters only emit message.received)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:30 +08:00
Junyan Qin 68d43834bd fix(adapters): add categories to telegram EBA manifest
The Telegram (EBA) manifest was missing spec.categories, so it fell
into the uncategorized/protocol bucket. Restore popular + global to
match the legacy telegram adapter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:30 +08:00
Junyan Qin 9044f2d747 feat(adapters): mark EBA-superseded adapters as legacy and collapse them
The 12 old adapters that now have an EBA replacement are tagged
`spec.legacy: true` in their source manifests. Principle: don't delete,
de-emphasize.

- sources/*.yaml (aiocqhttp, dingtalk, discord, kook, lark,
  officialaccount, qqofficial, slack, telegram, wecom, wecombot,
  wecomcs): add spec.legacy: true
- Adapter / IChooseAdapterEntity types: add optional legacy flag
- BotForm adapter Select: split legacy adapters into a collapsed,
  grayscale group at the bottom with an explanatory hint; auto-expand
  when the bot already uses a legacy adapter
- Wizard platform picker: same collapsed legacy section
- i18n: legacyAdapters / legacyAdaptersHint (zh-Hans, en-US)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:30 +08:00
Junyan Qin 7dbdddd062 fix(web): remove discard option from event target selector
Unorchestrated events are discarded by default, so an explicit discard
target is redundant. Drop the discard CommandGroup (and the now-unused
CommandSeparator import); the currentLabel() discard branch is kept so
any pre-existing discard bindings still render correctly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:30 +08:00
Junyan Qin fd53c40ee6 fix(web): place each adapter in a single category bucket
groupByCategory pushed multi-category adapters (lark, wecom, discord,
slack) into every matching bucket, so the adapter Select rendered
duplicate SelectItem values — triggering React duplicate-key warnings
and corrupting Radix item tracking. Assign each item to its highest
-priority matching category only. Also de-dupes the wizard card grid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:30 +08:00
Junyan Qin 7d801cfb68 feat(eba): consolidate event bindings, fix command.tsx pointer-events
- Replace legacy pipeline binding card + RoutingRulesEditor with unified
  EventBindingsEditor; remove use_pipeline_uuid/pipeline_routing_rules
  from bot form schema and API update handler
- Add _augment_event_data() to botmgr for filter virtual fields
  (message_text, message_element_types, chat_type)
- Add alembic migration 0009: migrate use_pipeline_uuid and
  pipeline_routing_rules into event_bindings on first run
- Fix command.tsx: data-[disabled] -> data-[disabled=true] so cmdk 1.x
  items (data-disabled=false) are not pointer-events:none
- EventBindingsEditor: onSelect on CommandItems, filter conditions panel,
  disabled bindings section, dnd reorder
- i18n: add filter/condition keys for zh-Hans and en-US
- Update tests to match new bot service behavior

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:41:30 +08:00
huanghuoguoguo 9a0081c4d2 test(agent): cover agent service event bindings 2026-07-19 22:41:30 +08:00
huanghuoguoguo 5bda2167bd test(agent): cover pluginized agent runner runtime 2026-07-19 22:41:30 +08:00
Junyan Qin 27b43c1731 feat(agent): add event orchestration surface 2026-07-19 22:41:30 +08:00
Junyan Qin c6596b98e6 fix(web): add agent runner component i18n 2026-07-19 22:41:30 +08:00
huanghuoguoguo efc57f3347 docs(agent): update pluginization status 2026-07-19 22:41:30 +08:00
huanghuoguoguo 25ae1de5b4 test(agent): align tests with agent runner plugin path 2026-07-19 22:41:30 +08:00
huanghuoguoguo 07a19136c6 test(agent): remove obsolete local agent runner attachment tests 2026-07-19 22:41:30 +08:00
huanghuoguoguo a64fb976c3 refactor(tools): unify tool-detail normalization in ToolManager
Drop the PluginToolLoader.get_tool() override that returned a raw
ComponentManifest, so every loader's get_tool() now returns a uniform
resource_tool.LLMTool (PluginToolLoader.get_tools() already did this
conversion). This removes the only source of tool-shape heterogeneity.

- ToolManager.get_tool_schema(): drop the ComponentManifest-vs-LLMTool branch
- ToolManager.get_tool_detail(): new host-level shape {name, description,
  human_desc, parameters}
- handler.py GET_TOOL_DETAIL: call tool_mgr.get_tool_detail(); delete the
  handler-local _build_tool_detail + _i18n_to_dict/_i18n_to_text adapters and
  the litellm TODO
- ToolLookupResult is now just LLMTool

The dropped label/spec fields were not consumed by any runner (local-agent
build_llm_tool and external harnesses use only name/description/parameters).
2026-07-19 22:41:30 +08:00
huanghuoguoguo ae0faa425a refactor(plugin): split agent-runner action handlers out of handler.py
Extract the AgentRunner Protocol v1 host-side surface from the giant
RuntimeConnectionHandler.__init__ into sibling modules using a registration-
function pattern (behavior-preserving; @h.action == @self.action):

- agent_run_support.py: shared constants + authorization/scope/projection helpers
- agent_pull_actions.py: register(h) for history/event pull APIs
- agent_runner_actions.py: register(h) for run/runtime/stats/claim lifecycle
- agent_state_actions.py: register(h) for steering/state APIs

__init__ now calls the three register(self) functions. handler.py keeps the
pre-existing plugin/llm/vector/knowledge handlers, get_prompt/call_tool/
get_tool_detail (coupled to retained helpers), shared helpers, and outbound
methods; it re-imports _validate_agent_run_session so external imports keep
working. handler.py: 4066 -> 1871 lines.

test_state_api_auth.py: repoint get_session_registry patch targets to
agent_run_support (the lookup moved modules). 385 agent unit tests pass; ruff clean.
2026-07-19 22:41:30 +08:00
huanghuoguoguo 478c587693 test(qa): sandbox-skill-authoring OPERATE passes on nsjail + docker (#2271 fixed)
- nsjail: full create→exec→register→activate→exec-from-activated-path chain
  returns exit 0; activated mount runs scripts/use.py (reads data/input.json)
  and writes activated_writeback.txt through to the host skill store.
- docker: same chain now passes after langbot-plugin-sdk#87 (recreate sandbox
  container when extra_mounts change). Corrected #2271 root cause from
  'docker masks nested bind mount' to container-reuse: extra_mounts was not in
  the box session compatibility check, so docker reused a running container and
  could not append the activated skill's bind mount.
- Exit criterion 3 (real end-to-end skill use) now DONE; all 5 criteria met.
- Documents the nsjail stale-docker-artifact environment gotcha.
2026-07-19 22:41:30 +08:00
huanghuoguoguo 9e3b653c4f test(qa): correct acp parity verdict — passes on clean runtime, no public-url
Prior matrix recorded acp as blocked needing langbot-assets-gateway-public-url
(PROBEDONE 0 0 / timeout). That was an environment artifact: a duplicate
LangBot-master/ backend contending on box ws-control-port 5410 plus a wedged
plugin runtime (host emit_event / list_agent_runners timing out). On a clean
single-instance runtime acp discovers skills via the SDK SSH reverse tunnel
with no public-url: PROBEDONE 1 17 (8-24s), parity with claude-code (1 15).
2026-07-19 22:41:30 +08:00
huanghuoguoguo 22731ea3de test(qa): record claude-code-agent skill discovery PASS + acp transport finding
- claude-code-agent (new pipeline, remote-ssh->101): langbot_list_assets returns
  skills=1 tools=15 in 24s -> all-tool 'skills' asset class is discoverable
  end-to-end by an external harness on the unmodified branch
- document the runner transport difference: claude-code uses a stdio bridge
  (works on remote-ssh out of the box), acp uses an HTTP proxy (needs
  langbot-assets-gateway-public-url on remote-ssh). This is a runner-plugin
  detail, not a host all-tool-branch issue
2026-07-19 22:41:30 +08:00
huanghuoguoguo 81179aa534 test(qa): skill all-tool acceptance matrix + mcp-gateway discovery case
- references/skill-all-tool-acceptance.md: acceptance matrix for the skill
  all-tool model (runner x lifecycle x backend), case status, exit criteria,
  and the #2271 known issue (pre-existing box nested-mount, not this branch)
- cases/skill-discovery-via-mcp-gateway.yaml: schema-valid case proving an
  external harness discovers skills via langbot_list_assets (the new 'skills'
  asset class); marked blocked-env until remote claude-code is responsive
2026-07-19 22:41:30 +08:00
huanghuoguoguo 5f65f962c5 feat(skill): unify skill activation as authorized tools
Expose skill tools (activate/register_skill/native exec) like native tools
instead of gating them behind the skill_authoring capability:
- toolmgr.get_all_tools drops include_skill_authoring; SkillToolLoader
  self-gates on sandbox + skill_mgr
- preproc drops the include_skill_authoring branch; pipeline-bound skills
  and the skills resource gate on skill_mgr presence

Persist activated skills into host.activated_skills conversation state so
they survive across runs (host writes at activate; last-write-wins); drop
the dead restore_activated_skills helper.

Prefill ToolResource.parameters host-side (tool_mgr.get_tool_schema) so
runners build LLM tools without per-tool get_tool_detail round-trips.

Align agent-runner-pluginization design docs to the all-tool model.
2026-07-19 22:41:30 +08:00
huanghuoguoguo cb9930c9e4 feat(agent-runner): add plugin runner host integration 2026-07-19 22:41:30 +08:00
Junyan Qin d992bad93a docs(eba): record agent-unified orchestration direction and final product form 2026-07-19 22:40:16 +08:00
Junyan Qin 7a36c68720 chore(deps): pin langbot-plugin to 0.5.0a2 2026-07-19 22:40:16 +08:00
Junyan Qin 5ee0d53060 test(api): adapt bot service webhook tests to manifest-driven detection 2026-07-19 22:40:16 +08:00
Junyan Qin b1b82d4243 chore(deps): pin langbot-plugin to 0.5.0a1 2026-07-19 22:40:16 +08:00
wangcham 1167d9e951 feat(kook): add eba adapter 2026-07-19 22:40:16 +08:00
WangCham 7b2698f476 feat(platform): add slack eba adapter 2026-07-19 22:40:16 +08:00
WangCham adfd88e477 feat(platform): add qqofficial eba adapter 2026-07-19 22:40:16 +08:00
WangCham 67e2d19459 feat(officialaccount): add eba adapter 2026-07-19 22:40:16 +08:00
WangCham 377d96ea4f feat(platform): add wecom customer service eba adapter 2026-07-19 22:40:16 +08:00
WangCham 1caabd4193 feat(platform): add wecom eba adapters 2026-07-19 22:40:16 +08:00
Junyan Qin 1919733daf feat(platform): add lark eba adapter 2026-07-19 22:39:15 +08:00
Junyan Qin dbaaf4f0cf docs: update eba inbound media evidence 2026-07-19 22:39:15 +08:00
Junyan Qin 9161ed6ae2 feat(platform): add dingtalk eba adapter 2026-07-19 22:39:15 +08:00
Junyan Qin f105343efe feat: complete eba adapter acceptance path 2026-07-19 22:38:10 +08:00
Junyan Qin bba87cf728 docs: add eba adapter acceptance report 2026-07-19 22:38:10 +08:00
Junyan Qin 3f7a97e541 feat: migrate aiocqhttp adapter to eba 2026-07-19 22:38:10 +08:00
Junyan Qin e04c8b65a5 feat: add discord eba adapter 2026-07-19 22:38:10 +08:00
Junyan Qin 4393736445 docs: add eba adapter migration records 2026-07-19 22:38:10 +08:00
Junyan Qin 13365c7d5b test: cover telegram upload file capability 2026-07-19 22:38:10 +08:00
Junyan Qin 7a12f93019 test: expand telegram eba api coverage 2026-07-19 22:38:10 +08:00
Junyan Qin 6c7d3cd204 feat: route telegram eba events to plugins 2026-07-19 22:38:10 +08:00