fix(plugins): remove raw session binding runtime exposure
This commit is contained in:
parent
b934c0be57
commit
50df0bb00e
@ -69,19 +69,6 @@ export function createPluginRuntimeMock(overrides: DeepPartial<PluginRuntime> =
|
||||
registerMemoryCli: vi.fn() as unknown as PluginRuntime["tools"]["registerMemoryCli"],
|
||||
},
|
||||
channel: {
|
||||
bindings: {
|
||||
bind: vi.fn(),
|
||||
getCapabilities: vi.fn(() => ({
|
||||
adapterAvailable: true,
|
||||
bindSupported: true,
|
||||
unbindSupported: true,
|
||||
placements: ["current", "child"] as Array<"current" | "child">,
|
||||
})),
|
||||
listBySession: vi.fn(() => []),
|
||||
resolveByConversation: vi.fn(() => null),
|
||||
touch: vi.fn(),
|
||||
unbind: vi.fn(() => Promise.resolve([])),
|
||||
},
|
||||
text: {
|
||||
chunkByNewline: vi.fn((text: string) => (text ? [text] : [])),
|
||||
chunkMarkdownText: vi.fn((text: string) => [text]),
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { onAgentEvent } from "../../infra/agent-events.js";
|
||||
import { requestHeartbeatNow } from "../../infra/heartbeat-wake.js";
|
||||
import { getSessionBindingService } from "../../infra/outbound/session-binding-service.js";
|
||||
import { onSessionTranscriptUpdate } from "../../sessions/transcript-events.js";
|
||||
|
||||
const runCommandWithTimeoutMock = vi.hoisted(() => vi.fn());
|
||||
@ -50,11 +49,6 @@ describe("plugin runtime command execution", () => {
|
||||
expect(runtime.events.onSessionTranscriptUpdate).toBe(onSessionTranscriptUpdate);
|
||||
});
|
||||
|
||||
it("exposes runtime.channel.bindings", () => {
|
||||
const runtime = createPluginRuntime();
|
||||
expect(runtime.channel.bindings).toBe(getSessionBindingService());
|
||||
});
|
||||
|
||||
it("exposes runtime.system.requestHeartbeatNow", () => {
|
||||
const runtime = createPluginRuntime();
|
||||
expect(runtime.system.requestHeartbeatNow).toBe(requestHeartbeatNow);
|
||||
|
||||
@ -96,7 +96,6 @@ import {
|
||||
updateLastRoute,
|
||||
} from "../../config/sessions.js";
|
||||
import { getChannelActivity, recordChannelActivity } from "../../infra/channel-activity.js";
|
||||
import { getSessionBindingService } from "../../infra/outbound/session-binding-service.js";
|
||||
import {
|
||||
listLineAccountIds,
|
||||
normalizeAccountId as normalizeLineAccountId,
|
||||
@ -132,7 +131,6 @@ import type { PluginRuntime } from "./types.js";
|
||||
|
||||
export function createRuntimeChannel(): PluginRuntime["channel"] {
|
||||
return {
|
||||
bindings: getSessionBindingService(),
|
||||
text: {
|
||||
chunkByNewline,
|
||||
chunkMarkdownText,
|
||||
|
||||
@ -2,8 +2,6 @@ type ReadChannelAllowFromStore =
|
||||
typeof import("../../pairing/pairing-store.js").readChannelAllowFromStore;
|
||||
type UpsertChannelPairingRequest =
|
||||
typeof import("../../pairing/pairing-store.js").upsertChannelPairingRequest;
|
||||
type SessionBindingService =
|
||||
typeof import("../../infra/outbound/session-binding-service.js").getSessionBindingService;
|
||||
|
||||
type ReadChannelAllowFromStoreForAccount = (params: {
|
||||
channel: Parameters<ReadChannelAllowFromStore>[0];
|
||||
@ -16,7 +14,6 @@ type UpsertChannelPairingRequestForAccount = (
|
||||
) => ReturnType<UpsertChannelPairingRequest>;
|
||||
|
||||
export type PluginRuntimeChannel = {
|
||||
bindings: ReturnType<SessionBindingService>;
|
||||
text: {
|
||||
chunkByNewline: typeof import("../../auto-reply/chunk.js").chunkByNewline;
|
||||
chunkMarkdownText: typeof import("../../auto-reply/chunk.js").chunkMarkdownText;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user