bs-agent 0.0.12 → 0.0.16
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/agent-BuA0m5H-.d.cts +305 -0
- package/dist/agent-BuA0m5H-.d.ts +305 -0
- package/dist/core/index.cjs +71 -20
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +3 -120
- package/dist/core/index.d.ts +3 -120
- package/dist/core/index.js +71 -20
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.cjs +695 -427
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +28 -28
- package/dist/react/index.d.ts +28 -28
- package/dist/react/index.js +695 -427
- package/dist/react/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/types-DryLPWU9.d.cts +0 -160
- package/dist/types-DryLPWU9.d.ts +0 -160
package/dist/react/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as ToolType, B as BuildShipAgent } from '../agent-BuA0m5H-.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
@@ -77,6 +77,32 @@ type ToolConfig = {
|
|
|
77
77
|
await?: boolean;
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
interface UseAgentOptions {
|
|
81
|
+
textDeltaModifier?: (delta: string, fullText: string, meta: {
|
|
82
|
+
executionId: string;
|
|
83
|
+
sequence: number;
|
|
84
|
+
agentId: string;
|
|
85
|
+
}) => string;
|
|
86
|
+
}
|
|
87
|
+
declare function useAgent(agent: BuildShipAgent, options?: UseAgentOptions): {
|
|
88
|
+
inProgress: boolean;
|
|
89
|
+
messages: Message[];
|
|
90
|
+
handleSend: (input: string, options?: {
|
|
91
|
+
context?: object;
|
|
92
|
+
skipUserMessage?: boolean;
|
|
93
|
+
additionalHeaders?: Record<string, string>;
|
|
94
|
+
additionalBody?: Record<string, unknown>;
|
|
95
|
+
}) => Promise<void>;
|
|
96
|
+
resumeTool: (callId: string, result: any) => Promise<void>;
|
|
97
|
+
addOptimisticMessage: (input: string) => void;
|
|
98
|
+
abort: () => void;
|
|
99
|
+
sessionId: string;
|
|
100
|
+
switchSession: (sessionId?: string) => void;
|
|
101
|
+
deleteSession: (sessionId: string) => void;
|
|
102
|
+
sessions: Session[];
|
|
103
|
+
debugData: Record<string, DebugDataType>;
|
|
104
|
+
};
|
|
105
|
+
|
|
80
106
|
/**
|
|
81
107
|
* Infer the output type from a Zod schema's structural shape (`_zod.output`).
|
|
82
108
|
* Falls back to `any` for raw JSON Schema objects or untyped parameters.
|
|
@@ -227,7 +253,7 @@ declare const AgentToolContext: react.Context<AgentToolContextValue | null>;
|
|
|
227
253
|
declare function AgentContextProvider({ children }: {
|
|
228
254
|
children: ReactNode;
|
|
229
255
|
}): react_jsx_runtime.JSX.Element;
|
|
230
|
-
declare function useAgentContext(agentId: string, agentUrl: string, accessKey?: string): AgentRunner;
|
|
256
|
+
declare function useAgentContext(agentId: string, agentUrl: string, accessKey?: string, options?: UseAgentOptions): AgentRunner;
|
|
231
257
|
declare function useAgentGlobalState(): {
|
|
232
258
|
allSessions: Record<string, Record<string, Session>>;
|
|
233
259
|
setAllSessions: (value: Record<string, Record<string, Session>> | ((prev: Record<string, Record<string, Session>>) => Record<string, Record<string, Session>>)) => void;
|
|
@@ -235,32 +261,6 @@ declare function useAgentGlobalState(): {
|
|
|
235
261
|
setDebugData: (value: Record<string, DebugDataType> | ((prev: Record<string, DebugDataType>) => Record<string, DebugDataType>)) => void;
|
|
236
262
|
};
|
|
237
263
|
|
|
238
|
-
declare function useAgent(agentId: string, agentUrl: string, accessKey?: string): {
|
|
239
|
-
inProgress: boolean;
|
|
240
|
-
messages: Message[];
|
|
241
|
-
handleSend: (input: string, options?: {
|
|
242
|
-
context?: object;
|
|
243
|
-
skipUserMessage?: boolean;
|
|
244
|
-
additionalHeaders?: Record<string, string>;
|
|
245
|
-
additionalBody?: Record<string, unknown>;
|
|
246
|
-
/** @deprecated Use `useClientTool` hook instead. */
|
|
247
|
-
clientTools?: Array<{
|
|
248
|
-
name: string;
|
|
249
|
-
description: string;
|
|
250
|
-
parameters: unknown;
|
|
251
|
-
await?: boolean;
|
|
252
|
-
}>;
|
|
253
|
-
}) => Promise<void>;
|
|
254
|
-
resumeTool: (callId: string, result: any) => Promise<void>;
|
|
255
|
-
addOptimisticMessage: (input: string) => void;
|
|
256
|
-
abort: () => void;
|
|
257
|
-
sessionId: string;
|
|
258
|
-
switchSession: (sessionId?: string) => void;
|
|
259
|
-
deleteSession: (sessionId: string) => void;
|
|
260
|
-
sessions: Session[];
|
|
261
|
-
debugData: Record<string, DebugDataType>;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
264
|
declare const AGENT_SESSIONS_KEY = "buildship:agent:conversations";
|
|
265
265
|
declare const AGENT_DEBUG_DATA_KEY = "buildship:agent:debug";
|
|
266
266
|
declare const DEFAULT_SESSION_NAME = "New Chat";
|