@hachej/boring-agent 0.1.93 → 0.1.95

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.
@@ -1,7 +1,7 @@
1
+ import { T as ToolUiMetadata, B as BoringChatPart, a as BoringChatMessage, P as PiChatStatus, Q as QueuedUserMessage, C as ChatError, b as PiChatEvent, c as PromptPayload, d as PromptReceipt, F as FollowUpPayload, e as FollowUpReceipt, f as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, h as CommandReceipt, i as StopPayload, j as StopReceipt, k as SessionSummary } from '../piChatEvent-BsMp3MSo.js';
1
2
  import * as react from 'react';
2
3
  import { ComponentProps, HTMLAttributes, FormEvent, ReactNode, ComponentType } from 'react';
3
4
  import { FileUIPart, ChatStatus, UIMessage } from 'ai';
4
- import { T as ToolUiMetadata, B as BoringChatPart, a as BoringChatMessage, P as PiChatStatus, Q as QueuedUserMessage, C as ChatError, b as PiChatEvent, c as PromptPayload, d as PromptReceipt, F as FollowUpPayload, e as FollowUpReceipt, f as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, h as CommandReceipt, i as StopPayload, j as StopReceipt, k as SessionSummary } from '../piChatEvent-BsMp3MSo.js';
5
5
  import { InputGroupAddon, InputGroupButton, InputGroupTextarea, Button, Collapsible, CollapsibleContent, CollapsibleTrigger } from '@hachej/boring-ui-kit';
6
6
  import { Streamdown } from 'streamdown';
7
7
  import { StickToBottom } from 'use-stick-to-bottom';
@@ -137,11 +137,13 @@ interface ChatEmptyStateProps {
137
137
  * resolves this to `sendMessage` with the suggestion's prompt.
138
138
  */
139
139
  onSelect?: (suggestion: ChatSuggestion) => void;
140
+ /** Uses the concise empty-chat hierarchy. */
141
+ hero?: boolean;
140
142
  /** Optional content rendered below the suggestion grid. */
141
143
  footer?: ReactNode;
142
144
  className?: string;
143
145
  }
144
- declare function ChatEmptyState({ eyebrow, title, description, suggestions, onSelect, footer, className, }: ChatEmptyStateProps): react.JSX.Element;
146
+ declare function ChatEmptyState({ eyebrow, title, description, suggestions, onSelect, hero, footer, className, }: ChatEmptyStateProps): react.JSX.Element;
145
147
 
146
148
  interface ParsedCommand {
147
149
  name: string;
@@ -176,6 +178,11 @@ interface SlashCommand {
176
178
  source?: 'local' | 'extension' | 'prompt' | 'skill';
177
179
  /** Originating plugin/package name (when known), shown as a tag. */
178
180
  sourcePlugin?: string;
181
+ /**
182
+ * Narrow browser-local escape hatch for independent controls that must remain
183
+ * usable while Pi is running. The predicate must admit only exact safe subcommands.
184
+ */
185
+ allowWhileBusy?: (args: string) => boolean;
179
186
  handler: SlashCommandHandler;
180
187
  }
181
188
  interface SlashCommandContext {
@@ -210,7 +217,7 @@ declare function createCommandRegistry(initial?: SlashCommand[]): CommandRegistr
210
217
 
211
218
  declare const builtinCommands: SlashCommand[];
212
219
 
213
- type ToolState = 'input-streaming' | 'input-available' | 'approval-requested' | 'approval-responded' | 'output-available' | 'output-error' | 'output-denied' | 'aborted';
220
+ type ToolState$1 = 'input-streaming' | 'input-available' | 'approval-requested' | 'approval-responded' | 'output-available' | 'output-error' | 'output-denied' | 'aborted';
214
221
 
215
222
  type BoringToolCallPart = Extract<BoringChatPart, {
216
223
  type: 'tool-call';
@@ -220,25 +227,25 @@ interface ToolRendererResolution {
220
227
  source: 'rendererId' | 'toolName' | 'fallback';
221
228
  requestedRendererId?: string;
222
229
  }
223
- interface ToolPart {
230
+ interface ToolPart$1 {
224
231
  /** Neutral render-model type. Legacy `tool-<name>` values are accepted at the renderer boundary. */
225
232
  type: 'tool-call' | `tool-${string}` | 'dynamic-tool';
226
233
  toolName: string;
227
234
  /** Stable tool call id; for Pi-native BoringChatPart this is BoringChatPart.id. */
228
235
  toolCallId: string;
229
- state: ToolState;
236
+ state: ToolState$1;
230
237
  input?: unknown;
231
238
  output?: unknown;
232
239
  errorText?: string;
233
240
  ui?: ToolUiMetadata;
234
241
  rendererResolution?: ToolRendererResolution;
235
242
  }
236
- type ToolRenderablePart = ToolPart | BoringToolCallPart | unknown;
237
- type ToolRenderer = (part: ToolPart) => ReactNode;
243
+ type ToolRenderablePart = ToolPart$1 | BoringToolCallPart | unknown;
244
+ type ToolRenderer = (part: ToolPart$1) => ReactNode;
238
245
  type ToolRendererOverrides = Partial<Record<string, ToolRenderer>>;
239
246
  declare const defaultToolRenderers: Record<string, ToolRenderer>;
240
247
  declare function mergeToolRenderers(overrides?: ToolRendererOverrides): Record<string, ToolRenderer>;
241
- declare function resolveToolRenderer(toolNameOrPart: string | ToolPart, overrides?: ToolRendererOverrides): ToolRenderer;
248
+ declare function resolveToolRenderer(toolNameOrPart: string | ToolPart$1, overrides?: ToolRendererOverrides): ToolRenderer;
242
249
 
243
250
  type ChatPanelRuntimeDependenciesWarmupStatus = {
244
251
  state: 'preparing' | 'ready' | 'failed';
@@ -770,6 +777,37 @@ interface AgentCommandOptions {
770
777
  }
771
778
  declare function getAgentCommands(options?: AgentCommandOptions): AgentCommandContribution[];
772
779
 
780
+ type ComposerDraftUpdate = (currentDraft: string) => string;
781
+ interface ComposerActionContributionProps {
782
+ updateDraft(update: ComposerDraftUpdate, options?: {
783
+ focus?: boolean;
784
+ }): void;
785
+ }
786
+ interface ComposerContribution {
787
+ id: string;
788
+ Top?: ComponentType;
789
+ Action?: ComponentType<ComposerActionContributionProps>;
790
+ commands?: readonly SlashCommand[];
791
+ }
792
+ declare function ComposerContributionProvider({ contribution, children, }: {
793
+ contribution: ComposerContribution;
794
+ children: ReactNode;
795
+ }): react.JSX.Element;
796
+
797
+ interface ChatMessageContributionProps {
798
+ message: BoringChatMessage;
799
+ }
800
+ interface ChatMessageContribution {
801
+ id: string;
802
+ /** Pure, hook-free claim predicate. */
803
+ matches(message: BoringChatMessage): boolean;
804
+ Component: ComponentType<ChatMessageContributionProps>;
805
+ }
806
+ declare function ChatMessageContributionProvider({ contribution, children, }: {
807
+ contribution: ChatMessageContribution;
808
+ children: ReactNode;
809
+ }): react.JSX.Element;
810
+
773
811
  declare function mergeShadcnToolRenderers(overrides?: ToolRendererOverrides): Record<string, ToolRenderer>;
774
812
 
775
813
  type GroupedToolEntry = {
@@ -832,6 +870,30 @@ type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {
832
870
  };
833
871
  declare const CodeBlock: ({ code, language, showLineNumbers, className, children, ...props }: CodeBlockProps) => react.JSX.Element;
834
872
 
873
+ type ToolProps = ComponentProps<typeof Collapsible>;
874
+ declare const Tool: ({ className, ...props }: ToolProps) => react.JSX.Element;
875
+ type ToolState = "input-streaming" | "input-available" | "approval-requested" | "approval-responded" | "output-available" | "output-denied" | "output-error" | "aborted";
876
+ type ToolPart = {
877
+ type: `tool-${string}` | "dynamic-tool" | "tool-call";
878
+ state: ToolState;
879
+ toolName?: string;
880
+ input?: unknown;
881
+ output?: unknown;
882
+ errorText?: string;
883
+ };
884
+ type ToolHeaderProps = {
885
+ title?: ReactNode;
886
+ className?: string;
887
+ icon?: ReactNode;
888
+ type: ToolPart["type"];
889
+ state: ToolState;
890
+ toolName?: string;
891
+ statusLabel?: string;
892
+ };
893
+ declare const ToolHeader: ({ className, title, type, state, icon, toolName, statusLabel, ...props }: ToolHeaderProps) => react.JSX.Element;
894
+ type ToolContentProps = ComponentProps<typeof CollapsibleContent>;
895
+ declare const ToolContent: ({ className, ...props }: ToolContentProps) => react.JSX.Element;
896
+
835
897
  declare function cn(...inputs: ClassValue[]): string;
836
898
 
837
- export { type AgentCommandContribution, type AgentCommandOptions, type AgentPluginReloadResult, ArtifactOpenProvider, type AvailableModel, ChatEmptyState, type ChatEmptyStateProps, PiChatPanel as ChatPanel, type PiChatPanelProps as ChatPanelProps, type ChatSuggestion, CodeBlock, type CommandRegistry, type ComposerBlocker, type ComposerBlockerAction, Conversation, ConversationContent, ConversationScrollButton, DebugDrawer, type GroupedToolEntry, Message, MessageAction, MessageActions, MessageContent, MessageResponse, ModelPickerMenu, ModelSelect, ModelSelectTrigger, type ModelSelection, type OpenArtifactHandler, type ParsedCommand, PiChatPanel, type PiChatPanelProps, SessionBrowser as PiSessionBrowser, type PiSessionCreateInit, SessionList as PiSessionList, type PiSessionSearchItem, type PiSessionSearchOptions, type PiSessionSearchSortMode, PromptInput, PromptInputFooter, PromptInputSubmit, PromptInputTextarea, Reasoning, ReasoningContent, ReasoningTrigger, type SessionListProps, type SlashCommand, type SlashCommandContext, type ThinkingLevel, ThinkingSelect, ToolCallGroup, type ToolPart, type ToolRenderer, type ToolRendererOverrides, type UploadFileOptions, type UploadFileResult, type UsePiSessionsOptions, type UsePiSessionsResult, activeSessionStorageKey, builtinCommands, clearActiveSessionId, cn, createCommandRegistry, defaultChatSuggestions, defaultToolRenderers, getAgentCommands, matchPiSessionSearch, mergeShadcnToolRenderers, mergeToolRenderers, parsePiSessionSearchQuery, parseSlashCommand, readActiveSessionId, resolveToolRenderer, searchPiSessions, uploadFile, useOpenArtifact, usePiSessions, writeActiveSessionId };
899
+ export { type AgentCommandContribution, type AgentCommandOptions, type AgentPluginReloadResult, ArtifactOpenProvider, type AvailableModel, BoringChatMessage, ChatEmptyState, type ChatEmptyStateProps, type ChatMessageContribution, type ChatMessageContributionProps, ChatMessageContributionProvider, PiChatPanel as ChatPanel, type PiChatPanelProps as ChatPanelProps, type ChatSuggestion, CodeBlock, type CommandRegistry, type ComposerActionContributionProps, type ComposerBlocker, type ComposerBlockerAction, type ComposerContribution, ComposerContributionProvider, type ComposerDraftUpdate, Conversation, ConversationContent, ConversationScrollButton, DebugDrawer, type GroupedToolEntry, Message, MessageAction, MessageActions, MessageContent, MessageResponse, ModelPickerMenu, ModelSelect, ModelSelectTrigger, type ModelSelection, type OpenArtifactHandler, type ParsedCommand, PiChatPanel, type PiChatPanelProps, SessionBrowser as PiSessionBrowser, type PiSessionCreateInit, SessionList as PiSessionList, type PiSessionSearchItem, type PiSessionSearchOptions, type PiSessionSearchSortMode, PromptInput, PromptInputFooter, PromptInputSubmit, PromptInputTextarea, Reasoning, ReasoningContent, ReasoningTrigger, type SessionListProps, type SlashCommand, type SlashCommandContext, type ThinkingLevel, ThinkingSelect, Tool, ToolCallGroup, ToolContent, ToolHeader, type ToolPart$1 as ToolPart, type ToolRenderer, type ToolRendererOverrides, type UploadFileOptions, type UploadFileResult, type UsePiSessionsOptions, type UsePiSessionsResult, activeSessionStorageKey, builtinCommands, clearActiveSessionId, cn, createCommandRegistry, defaultChatSuggestions, defaultToolRenderers, getAgentCommands, matchPiSessionSearch, mergeShadcnToolRenderers, mergeToolRenderers, parsePiSessionSearchQuery, parseSlashCommand, readActiveSessionId, resolveToolRenderer, searchPiSessions, uploadFile, useOpenArtifact, usePiSessions, writeActiveSessionId };