Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/appkit/src/plugin/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export abstract class Plugin<
config.name ??
(this.constructor as { manifest?: { name: string } }).manifest?.name ??
"plugin";
this.streamManager = new StreamManager();
this.streamManager = new StreamManager(config.streamConfig);
this.app = new AppManager();
this.devFileReader = DevFileReader.getInstance();
this.context = (config as Record<string, unknown>).context as
Expand Down
13 changes: 13 additions & 0 deletions packages/appkit/src/plugin/tests/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,19 @@ describe("Plugin", () => {
expect(AppManager).toHaveBeenCalledTimes(1);
expect(StreamManager).toHaveBeenCalledTimes(1);
});

test("should forward streamConfig to the StreamManager", () => {
const streamConfig = { maxEventSize: 20 * 1024 * 1024 };
new TestPlugin({ ...config, streamConfig });

expect(StreamManager).toHaveBeenCalledWith(streamConfig);
});

test("should construct the StreamManager with defaults when no streamConfig", () => {
new TestPlugin(config);

expect(StreamManager).toHaveBeenCalledWith(undefined);
});
});

describe("setup", () => {
Expand Down
9 changes: 9 additions & 0 deletions packages/shared/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type express from "express";
import type { JSONSchema7 } from "json-schema";

import type { StreamConfig } from "./execute";
import type {
DiscoveryDescriptor,
PluginManifest as GeneratedPluginManifest,
Expand Down Expand Up @@ -72,6 +73,14 @@ export interface BasePluginConfig {
* @default true for all telemetry types
*/
telemetry?: TelemetryOptions;

/**
* SSE stream configuration for this plugin's `executeStream()` calls (buffer
* sizes, `maxEventSize`, TTL, heartbeat). Sets the plugin's StreamManager
* defaults; a per-call `stream` config still overrides these. Use it to raise
* `maxEventSize` above the 5 MiB default when a stream emits larger events.
*/
streamConfig?: StreamConfig;
}

export type TelemetryOptions =
Expand Down
Loading