mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-02 12:51:57 +00:00
ACP: harden startup and move configured routing behind plugin seams (#48197)
* ACPX: keep plugin-local runtime installs out of dist * Gateway: harden ACP startup and service PATH * ACP: reinitialize error-state configured bindings * ACP: classify pre-turn runtime failures as session init failures * Plugins: move configured ACP routing behind channel seams * Telegram tests: align startup probe assertions after rebase * Discord: harden ACP configured binding recovery * ACP: recover Discord bindings after stale runtime exits * ACPX: replace dead sessions during ensure * Discord: harden ACP binding recovery * Discord: fix review follow-ups * ACP bindings: load channel snapshots across workspaces * ACP bindings: cache snapshot channel plugin resolution * Experiments: add ACP pluginification holy grail plan * Experiments: rename ACP pluginification plan doc * Experiments: drop old ACP pluginification doc path * ACP: move configured bindings behind plugin services * Experiments: update bindings capability architecture plan * Bindings: isolate configured binding routing and targets * Discord tests: fix runtime env helper path * Tests: fix channel binding CI regressions * Tests: normalize ACP workspace assertion on Windows * Bindings: isolate configured binding registry * Bindings: finish configured binding cleanup * Bindings: finish generic cleanup * Bindings: align runtime approval callbacks * ACP: delete residual bindings barrel * Bindings: restore legacy compatibility * Revert "Bindings: restore legacy compatibility" This reverts commit ac2ed68fa2426ecc874d68278c71c71ad363fcfe. * Tests: drop ACP route legacy helper names * Discord/ACP: fix binding regressions --------- Co-authored-by: Onur <2453968+osolmaz@users.noreply.github.com>
This commit is contained in:
48
src/bindings/records.ts
Normal file
48
src/bindings/records.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import {
|
||||
getSessionBindingService,
|
||||
type ConversationRef,
|
||||
type SessionBindingBindInput,
|
||||
type SessionBindingCapabilities,
|
||||
type SessionBindingRecord,
|
||||
type SessionBindingUnbindInput,
|
||||
} from "../infra/outbound/session-binding-service.js";
|
||||
|
||||
// Shared binding record helpers used by both configured bindings and
|
||||
// runtime-created plugin conversation bindings.
|
||||
export async function createConversationBindingRecord(
|
||||
input: SessionBindingBindInput,
|
||||
): Promise<SessionBindingRecord> {
|
||||
return await getSessionBindingService().bind(input);
|
||||
}
|
||||
|
||||
export function getConversationBindingCapabilities(params: {
|
||||
channel: string;
|
||||
accountId: string;
|
||||
}): SessionBindingCapabilities {
|
||||
return getSessionBindingService().getCapabilities(params);
|
||||
}
|
||||
|
||||
export function listSessionBindingRecords(targetSessionKey: string): SessionBindingRecord[] {
|
||||
return getSessionBindingService().listBySession(targetSessionKey);
|
||||
}
|
||||
|
||||
export function resolveConversationBindingRecord(
|
||||
conversation: ConversationRef,
|
||||
): SessionBindingRecord | null {
|
||||
return getSessionBindingService().resolveByConversation(conversation);
|
||||
}
|
||||
|
||||
export function touchConversationBindingRecord(bindingId: string, at?: number): void {
|
||||
const service = getSessionBindingService();
|
||||
if (typeof at === "number") {
|
||||
service.touch(bindingId, at);
|
||||
return;
|
||||
}
|
||||
service.touch(bindingId);
|
||||
}
|
||||
|
||||
export async function unbindConversationBindingRecord(
|
||||
input: SessionBindingUnbindInput,
|
||||
): Promise<SessionBindingRecord[]> {
|
||||
return await getSessionBindingService().unbind(input);
|
||||
}
|
||||
Reference in New Issue
Block a user