@cntyclub/agent-react 0.4.0 → 0.5.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/dist/components/agent-panel.d.ts +3 -1
- package/dist/components/agent-panel.d.ts.map +1 -1
- package/dist/components/agent-widget.d.ts.map +1 -1
- package/dist/components/message-item.d.ts +5 -1
- package/dist/components/message-item.d.ts.map +1 -1
- package/dist/components/tool-activity-group.d.ts +15 -0
- package/dist/components/tool-activity-group.d.ts.map +1 -0
- package/dist/components/tool-approval-card.d.ts +10 -5
- package/dist/components/tool-approval-card.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +353 -93
- package/dist/index.js.map +1 -1
- package/dist/message-group.d.ts +37 -0
- package/dist/message-group.d.ts.map +1 -0
- package/dist/tool-presentation.d.ts +20 -0
- package/dist/tool-presentation.d.ts.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/use-always-approve.d.ts +15 -0
- package/dist/use-always-approve.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -10,11 +10,13 @@ export interface AgentPanelProps {
|
|
|
10
10
|
canToggleAgentMode: boolean;
|
|
11
11
|
onToggleAgentMode: () => void;
|
|
12
12
|
onClose: () => void;
|
|
13
|
+
/** Remember a write tool and auto-approve its future prompts. */
|
|
14
|
+
onAlwaysApprove: (toolName: string) => void;
|
|
13
15
|
className?: string;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* The chat surface shared by the popup panel and fullscreen Agent Mode.
|
|
17
19
|
* Header (title, history, new chat, expand/collapse, close) + messages + input.
|
|
18
20
|
*/
|
|
19
|
-
export declare function AgentPanel({ agentMode, canToggleAgentMode, chat, className, config, onClose, onToggleAgentMode, }: AgentPanelProps): React.JSX.Element;
|
|
21
|
+
export declare function AgentPanel({ agentMode, canToggleAgentMode, chat, className, config, onAlwaysApprove, onClose, onToggleAgentMode, }: AgentPanelProps): React.JSX.Element;
|
|
20
22
|
//# sourceMappingURL=agent-panel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-panel.d.ts","sourceRoot":"","sources":["../../src/components/agent-panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-panel.d.ts","sourceRoot":"","sources":["../../src/components/agent-panel.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAAC;IACxC,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iEAAiE;IACjE,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,kBAAkB,EAClB,IAAI,EACJ,SAAS,EACT,MAAM,EACN,eAAe,EACf,OAAO,EACP,iBAAiB,GAClB,EAAE,eAAe,qBA2NjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-widget.d.ts","sourceRoot":"","sources":["../../src/components/agent-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-widget.d.ts","sourceRoot":"","sources":["../../src/components/agent-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;AAK1D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,wCAAwC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,gBAAgB,qBAkH3F"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { AgentMessage } from "../types";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Renders a user or assistant *text* message. Tool activity (assistant
|
|
5
|
+
* tool_calls and tool results) is grouped and rendered by `ToolActivityGroup`
|
|
6
|
+
* via `groupMessages`, so this component ignores tool messages.
|
|
7
|
+
*/
|
|
4
8
|
export declare function MessageItem({ message }: {
|
|
5
9
|
message: AgentMessage;
|
|
6
10
|
}): React.JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-item.d.ts","sourceRoot":"","sources":["../../src/components/message-item.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-item.d.ts","sourceRoot":"","sources":["../../src/components/message-item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,4BAqBjE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { DescribeToolCall } from "../types";
|
|
3
|
+
import type { ToolStep } from "../message-group";
|
|
4
|
+
export interface ToolActivityGroupProps {
|
|
5
|
+
steps: ToolStep[];
|
|
6
|
+
describeToolCall?: DescribeToolCall;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A collapsed run of tool activity. Normally shows just the latest step as a
|
|
10
|
+
* chip with a disclosure toggle; expanding reveals every step in plain language
|
|
11
|
+
* with a per-step raw-JSON dropdown. Result tables always render below so the
|
|
12
|
+
* data the user asked for is never hidden behind the toggle.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ToolActivityGroup({ describeToolCall, steps }: ToolActivityGroupProps): React.JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=tool-activity-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-activity-group.d.ts","sourceRoot":"","sources":["../../src/components/tool-activity-group.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA+EjD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,sBAAsB,4BAmDpF"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { PendingApproval } from "../types";
|
|
2
|
+
import type { DescribeToolCall, PendingApproval } from "../types";
|
|
3
3
|
export interface ToolApprovalCardProps {
|
|
4
4
|
approval: PendingApproval;
|
|
5
5
|
resolving: boolean;
|
|
6
6
|
onResolve: (callId: string, approve: boolean) => void;
|
|
7
|
+
/** Host-app hook that turns the tool call into plain language. */
|
|
8
|
+
describeToolCall?: DescribeToolCall;
|
|
9
|
+
/** Remember this tool and auto-approve it from now on. */
|
|
10
|
+
onAlwaysApprove: (toolName: string) => void;
|
|
7
11
|
}
|
|
8
12
|
/**
|
|
9
|
-
* Approval prompt for a write action the agent wants to perform.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
13
|
+
* Approval prompt for a write action the agent wants to perform. Arguments are
|
|
14
|
+
* shown in plain language (technical ids/keys hidden, or a host-provided
|
|
15
|
+
* description) so the user understands exactly what will change. The primary
|
|
16
|
+
* action is a split button: "Approve" once, or "Always approve" this tool.
|
|
12
17
|
*/
|
|
13
|
-
export declare function ToolApprovalCard({ approval, onResolve, resolving }: ToolApprovalCardProps): React.JSX.Element;
|
|
18
|
+
export declare function ToolApprovalCard({ approval, describeToolCall, onAlwaysApprove, onResolve, resolving, }: ToolApprovalCardProps): React.JSX.Element;
|
|
14
19
|
//# sourceMappingURL=tool-approval-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-approval-card.d.ts","sourceRoot":"","sources":["../../src/components/tool-approval-card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-approval-card.d.ts","sourceRoot":"","sources":["../../src/components/tool-approval-card.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,0DAA0D;IAC1D,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,SAAS,GACV,EAAE,qBAAqB,qBAgEvB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,13 @@ export { AgentApiClient, AgentApiError } from "./api-client";
|
|
|
2
2
|
export { AgentPanel, type AgentPanelProps } from "./components/agent-panel";
|
|
3
3
|
export { AgentWidget, type AgentWidgetProps } from "./components/agent-widget";
|
|
4
4
|
export { MessageItem } from "./components/message-item";
|
|
5
|
+
export { ToolActivityGroup, type ToolActivityGroupProps } from "./components/tool-activity-group";
|
|
5
6
|
export { ToolApprovalCard, type ToolApprovalCardProps } from "./components/tool-approval-card";
|
|
6
7
|
export { defineAgentConfig } from "./config";
|
|
7
|
-
export
|
|
8
|
+
export { groupMessages, type RenderItem, type ToolStep } from "./message-group";
|
|
9
|
+
export { deriveDetails, humanizeToolName, resolveToolPresentation, type ResolvedToolPresentation, } from "./tool-presentation";
|
|
10
|
+
export { useAlwaysApprove, type AlwaysApproveStore } from "./use-always-approve";
|
|
11
|
+
export type { AgentConfig, AgentMessage, AgentModeSchemas, AgentPageMapping, AgentPublicConfig, ApprovalRequest, ChatRequest, ChatResponse, ConversationSummary, DescribeToolCall, MessageBlock, PendingApproval, TableBlock, ToolCallDescription, ToolCallDetail, ToolCallInfo, } from "./types";
|
|
8
12
|
export type { components as AgentModeComponents, operations as AgentModeOperations, paths as AgentModePaths, } from "./api/schema";
|
|
9
13
|
export { useAgentChat, type AgentChatActions, type AgentChatState, } from "./use-agent-chat";
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAA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