@f5-sales-demo/pi-agent-core 23.3.4 → 23.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/pi-agent-core",
4
- "version": "23.3.4",
4
+ "version": "23.4.0",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -35,8 +35,8 @@
35
35
  "fmt": "biome format --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@f5-sales-demo/pi-ai": "23.3.4",
39
- "@f5-sales-demo/pi-utils": "23.3.4"
38
+ "@f5-sales-demo/pi-ai": "23.4.0",
39
+ "@f5-sales-demo/pi-utils": "23.4.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@sinclair/typebox": "0.34.52",
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  export * from "./agent";
3
3
  // Loop functions
4
4
  export * from "./agent-loop";
5
+ export type * from "./plugin-presentation";
5
6
  // Proxy utilities
6
7
  export * from "./proxy";
7
8
  // Thinking selectors
@@ -0,0 +1,25 @@
1
+ /** Data-only presentation contract. Plugins do not import a renderer at runtime. */
2
+ export type PluginSection =
3
+ | { kind: "fields"; title?: string; values: Readonly<Record<string, unknown>> }
4
+ | {
5
+ kind: "table";
6
+ title?: string;
7
+ columns: readonly { key: string; label?: string; align?: "left" | "right" }[];
8
+ rows: readonly Readonly<Record<string, unknown>>[];
9
+ }
10
+ | { kind: "markdown"; title?: string; text: string }
11
+ | { kind: "code"; title?: string; text: string; language?: string };
12
+
13
+ export interface PluginView {
14
+ summary?: string;
15
+ warnings?: readonly string[];
16
+ sections?: readonly PluginSection[];
17
+ }
18
+ export interface PluginPresentationOptions {
19
+ readonly expanded: boolean;
20
+ readonly isPartial: boolean;
21
+ }
22
+ export interface PluginPresentation<TArgs = unknown, TResult = unknown> {
23
+ call?: (args: TArgs, options: PluginPresentationOptions) => PluginView | undefined;
24
+ result?: (result: TResult, options: PluginPresentationOptions, args: TArgs) => PluginView | undefined;
25
+ }
package/src/types.ts CHANGED
@@ -274,6 +274,12 @@ export interface AgentTool<TParameters extends TSchema = TSchema, TDetails = any
274
274
  lenientArgValidation?: boolean;
275
275
  execute: AgentToolExecFn<TParameters, TDetails, TTheme>;
276
276
 
277
+ /** Optional data-only view; the host owns layout and theme. */
278
+ presentation?: import("./plugin-presentation").PluginPresentation<
279
+ Static<TParameters>,
280
+ AgentToolResult<TDetails, TParameters>
281
+ >;
282
+
277
283
  /** Optional custom rendering for tool call display (returns UI component) */
278
284
  renderCall?: (args: Static<TParameters>, options: RenderResultOptions, theme: TTheme) => unknown;
279
285