@agentick/react
Advanced tools
+12
-12
| { | ||
| "name": "@agentick/react", | ||
| "version": "0.2.0", | ||
| "version": "0.2.1", | ||
| "description": "React hooks and components for Agentick applications", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/agenticklabs/agentick.git", | ||
| "directory": "packages/react" | ||
| }, | ||
| "files": [ | ||
@@ -19,4 +24,4 @@ "dist", | ||
| "dependencies": { | ||
| "@agentick/client": "0.2.0", | ||
| "@agentick/shared": "0.2.0" | ||
| "@agentick/client": "0.2.1", | ||
| "@agentick/shared": "0.2.1" | ||
| }, | ||
@@ -26,8 +31,8 @@ "devDependencies": { | ||
| "@types/node": "^22.10.5", | ||
| "@types/react": "^18.3.0", | ||
| "@types/react": "^19.2.13", | ||
| "happy-dom": "^17.0.0", | ||
| "react": "^18.3.0", | ||
| "react-dom": "^18.3.0", | ||
| "react": "^19.2.4", | ||
| "react-dom": "^19.2.4", | ||
| "typescript": "^5.7.3", | ||
| "vitest": "^3.0.0" | ||
| "vitest": "^4.0.18" | ||
| }, | ||
@@ -37,7 +42,2 @@ "peerDependencies": { | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/agenticklabs/agentick.git", | ||
| "directory": "packages/react" | ||
| }, | ||
| "scripts": { | ||
@@ -44,0 +44,0 @@ "build": "tsc -p tsconfig.build.json", |
+49
-49
@@ -57,13 +57,13 @@ # @agentick/react | ||
| const { | ||
| sessionId, // Current session ID | ||
| isSubscribed, // Whether subscribed to session events | ||
| subscribe, // Subscribe to session events | ||
| unsubscribe, // Unsubscribe from session events | ||
| send, // Send a message | ||
| abort, // Abort current execution | ||
| close, // Close the session | ||
| accessor, // Direct SessionAccessor for advanced use | ||
| sessionId, // Current session ID | ||
| isSubscribed, // Whether subscribed to session events | ||
| subscribe, // Subscribe to session events | ||
| unsubscribe, // Unsubscribe from session events | ||
| send, // Send a message | ||
| abort, // Abort current execution | ||
| close, // Close the session | ||
| accessor, // Direct SessionAccessor for advanced use | ||
| } = useSession({ | ||
| sessionId: "my-session", // Optional - creates ephemeral session if omitted | ||
| autoSubscribe: true, // Auto-subscribe on mount | ||
| sessionId: "my-session", // Optional - creates ephemeral session if omitted | ||
| autoSubscribe: true, // Auto-subscribe on mount | ||
| }); | ||
@@ -89,7 +89,7 @@ | ||
| const { | ||
| text, // Accumulated text from current response | ||
| text, // Accumulated text from current response | ||
| isStreaming, // Whether currently receiving text | ||
| clear, // Clear accumulated text | ||
| clear, // Clear accumulated text | ||
| } = useStreamingText({ | ||
| enabled: true, // Enable/disable subscription | ||
| enabled: true, // Enable/disable subscription | ||
| }); | ||
@@ -101,3 +101,3 @@ | ||
| {isStreaming && <span className="cursor">|</span>} | ||
| </div> | ||
| </div>; | ||
| ``` | ||
@@ -111,22 +111,22 @@ | ||
| const { | ||
| contextInfo, // Latest context info (null before first response) | ||
| clear, // Clear context info | ||
| contextInfo, // Latest context info (null before first response) | ||
| clear, // Clear context info | ||
| } = useContextInfo({ | ||
| sessionId: "my-session", // Optional - filter by session | ||
| enabled: true, // Enable/disable subscription | ||
| sessionId: "my-session", // Optional - filter by session | ||
| enabled: true, // Enable/disable subscription | ||
| }); | ||
| if (contextInfo) { | ||
| console.log(contextInfo.modelId); // "gpt-4o" | "claude-3-5-sonnet" | etc. | ||
| console.log(contextInfo.modelName); // Human-readable name | ||
| console.log(contextInfo.provider); // "openai" | "anthropic" | etc. | ||
| console.log(contextInfo.contextWindow); // Total context window size | ||
| console.log(contextInfo.inputTokens); // Input tokens this tick | ||
| console.log(contextInfo.outputTokens); // Output tokens this tick | ||
| console.log(contextInfo.totalTokens); // Total tokens this tick | ||
| console.log(contextInfo.utilization); // Context utilization % (0-100) | ||
| console.log(contextInfo.modelId); // "gpt-4o" | "claude-3-5-sonnet" | etc. | ||
| console.log(contextInfo.modelName); // Human-readable name | ||
| console.log(contextInfo.provider); // "openai" | "anthropic" | etc. | ||
| console.log(contextInfo.contextWindow); // Total context window size | ||
| console.log(contextInfo.inputTokens); // Input tokens this tick | ||
| console.log(contextInfo.outputTokens); // Output tokens this tick | ||
| console.log(contextInfo.totalTokens); // Total tokens this tick | ||
| console.log(contextInfo.utilization); // Context utilization % (0-100) | ||
| console.log(contextInfo.maxOutputTokens); // Max output tokens for model | ||
| console.log(contextInfo.supportsVision); // Model supports vision | ||
| console.log(contextInfo.supportsVision); // Model supports vision | ||
| console.log(contextInfo.supportsToolUse); // Model supports tools | ||
| console.log(contextInfo.isReasoningModel);// Extended thinking model | ||
| console.log(contextInfo.isReasoningModel); // Extended thinking model | ||
@@ -144,15 +144,15 @@ // Cumulative usage across all ticks in execution | ||
| interface ContextInfo { | ||
| modelId: string; // Model identifier (e.g., "gpt-4o") | ||
| modelName?: string; // Human-readable name | ||
| provider?: string; // Provider name | ||
| contextWindow?: number; // Context window size in tokens | ||
| inputTokens: number; // Input tokens this tick | ||
| outputTokens: number; // Output tokens this tick | ||
| totalTokens: number; // Total tokens this tick | ||
| utilization?: number; // Context utilization % (0-100) | ||
| maxOutputTokens?: number; // Max output tokens | ||
| supportsVision?: boolean; // Vision capability | ||
| modelId: string; // Model identifier (e.g., "gpt-4o") | ||
| modelName?: string; // Human-readable name | ||
| provider?: string; // Provider name | ||
| contextWindow?: number; // Context window size in tokens | ||
| inputTokens: number; // Input tokens this tick | ||
| outputTokens: number; // Output tokens this tick | ||
| totalTokens: number; // Total tokens this tick | ||
| utilization?: number; // Context utilization % (0-100) | ||
| maxOutputTokens?: number; // Max output tokens | ||
| supportsVision?: boolean; // Vision capability | ||
| supportsToolUse?: boolean; // Tool use capability | ||
| isReasoningModel?: boolean;// Extended thinking capability | ||
| tick: number; // Current tick number | ||
| isReasoningModel?: boolean; // Extended thinking capability | ||
| tick: number; // Current tick number | ||
| cumulativeUsage?: { | ||
@@ -173,6 +173,6 @@ inputTokens: number; | ||
| const { | ||
| event, // Latest event | ||
| clear, // Clear current event | ||
| event, // Latest event | ||
| clear, // Clear current event | ||
| } = useEvents({ | ||
| sessionId: "my-session", // Optional - filter by session | ||
| sessionId: "my-session", // Optional - filter by session | ||
| filter: ["tool_call", "tool_result"], // Optional - filter by event type | ||
@@ -195,5 +195,5 @@ enabled: true, | ||
| const { | ||
| state, // "disconnected" | "connecting" | "connected" | ||
| isConnected, // Convenience boolean | ||
| isConnecting, // Convenience boolean | ||
| state, // "disconnected" | "connecting" | "connected" | ||
| isConnected, // Convenience boolean | ||
| isConnecting, // Convenience boolean | ||
| } = useConnection(); | ||
@@ -203,3 +203,3 @@ | ||
| {isConnected ? "Connected" : "Disconnected"} | ||
| </div> | ||
| </div>; | ||
| ``` | ||
@@ -237,4 +237,4 @@ | ||
| clientConfig={{ | ||
| baseUrl: "https://api.example.com", // Required - API base URL | ||
| token: "auth-token", // Optional - auth token | ||
| baseUrl: "https://api.example.com", // Required - API base URL | ||
| token: "auth-token", // Optional - auth token | ||
| }} | ||
@@ -241,0 +241,0 @@ > |
101988
-0.23%+ Added
+ Added
- Removed
- Removed
Updated
Updated