@arcteninc/core 0.0.108 → 0.0.110

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.
Files changed (82) hide show
  1. package/README.md +53 -66
  2. package/dist/index.cjs +3 -16
  3. package/dist/index.d.ts +5 -7
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.mjs +447 -8679
  6. package/dist/lib/useAgent.d.ts +1 -2
  7. package/dist/lib/useAgent.d.ts.map +1 -1
  8. package/dist/types/tool-description.d.ts +1 -0
  9. package/dist/types/tool-description.d.ts.map +1 -1
  10. package/dist/types/use-agent.d.ts +2 -45
  11. package/dist/types/use-agent.d.ts.map +1 -1
  12. package/package.json +2 -26
  13. package/scripts/cli-extract-types-auto.ts +0 -0
  14. package/dist/components/ArctenAgent.d.ts +0 -46
  15. package/dist/components/ArctenAgent.d.ts.map +0 -1
  16. package/dist/components/ai-elements/prompt-input.d.ts +0 -187
  17. package/dist/components/ai-elements/prompt-input.d.ts.map +0 -1
  18. package/dist/components/ai-elements/reasoning.d.ts +0 -17
  19. package/dist/components/ai-elements/reasoning.d.ts.map +0 -1
  20. package/dist/components/ai-elements/response.d.ts +0 -8
  21. package/dist/components/ai-elements/response.d.ts.map +0 -1
  22. package/dist/components/ai-elements/shimmer.d.ts +0 -10
  23. package/dist/components/ai-elements/shimmer.d.ts.map +0 -1
  24. package/dist/components/citation-button.d.ts +0 -14
  25. package/dist/components/citation-button.d.ts.map +0 -1
  26. package/dist/components/citation-text-renderer.d.ts +0 -31
  27. package/dist/components/citation-text-renderer.d.ts.map +0 -1
  28. package/dist/components/secure-modals/EmailModal.d.ts +0 -10
  29. package/dist/components/secure-modals/EmailModal.d.ts.map +0 -1
  30. package/dist/components/secure-modals/FormModal.d.ts +0 -20
  31. package/dist/components/secure-modals/FormModal.d.ts.map +0 -1
  32. package/dist/components/secure-modals/PasswordModal.d.ts +0 -10
  33. package/dist/components/secure-modals/PasswordModal.d.ts.map +0 -1
  34. package/dist/components/secure-modals/PhoneModal.d.ts +0 -10
  35. package/dist/components/secure-modals/PhoneModal.d.ts.map +0 -1
  36. package/dist/components/secure-modals/PinModal.d.ts +0 -11
  37. package/dist/components/secure-modals/PinModal.d.ts.map +0 -1
  38. package/dist/components/secure-modals/SecureModalProvider.d.ts +0 -13
  39. package/dist/components/secure-modals/SecureModalProvider.d.ts.map +0 -1
  40. package/dist/components/secure-modals/TextModal.d.ts +0 -11
  41. package/dist/components/secure-modals/TextModal.d.ts.map +0 -1
  42. package/dist/components/secure-modals/index.d.ts +0 -10
  43. package/dist/components/secure-modals/index.d.ts.map +0 -1
  44. package/dist/components/secure-modals/types.d.ts +0 -34
  45. package/dist/components/secure-modals/types.d.ts.map +0 -1
  46. package/dist/components/tool-call-approval.d.ts +0 -9
  47. package/dist/components/tool-call-approval.d.ts.map +0 -1
  48. package/dist/components/tool-call-result.d.ts +0 -8
  49. package/dist/components/tool-call-result.d.ts.map +0 -1
  50. package/dist/components/ui/autotextarea.d.ts +0 -19
  51. package/dist/components/ui/autotextarea.d.ts.map +0 -1
  52. package/dist/components/ui/badge.d.ts +0 -10
  53. package/dist/components/ui/badge.d.ts.map +0 -1
  54. package/dist/components/ui/button.d.ts +0 -14
  55. package/dist/components/ui/button.d.ts.map +0 -1
  56. package/dist/components/ui/collapsible.d.ts +0 -6
  57. package/dist/components/ui/collapsible.d.ts.map +0 -1
  58. package/dist/components/ui/command.d.ts +0 -19
  59. package/dist/components/ui/command.d.ts.map +0 -1
  60. package/dist/components/ui/dialog.d.ts +0 -16
  61. package/dist/components/ui/dialog.d.ts.map +0 -1
  62. package/dist/components/ui/dropdown-menu.d.ts +0 -26
  63. package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
  64. package/dist/components/ui/hover-card.d.ts +0 -7
  65. package/dist/components/ui/hover-card.d.ts.map +0 -1
  66. package/dist/components/ui/input-group.d.ts +0 -17
  67. package/dist/components/ui/input-group.d.ts.map +0 -1
  68. package/dist/components/ui/input.d.ts +0 -4
  69. package/dist/components/ui/input.d.ts.map +0 -1
  70. package/dist/components/ui/kbd.d.ts +0 -4
  71. package/dist/components/ui/kbd.d.ts.map +0 -1
  72. package/dist/components/ui/select.d.ts +0 -16
  73. package/dist/components/ui/select.d.ts.map +0 -1
  74. package/dist/components/ui/textarea.d.ts +0 -4
  75. package/dist/components/ui/textarea.d.ts.map +0 -1
  76. package/dist/components/ui/tooltip.d.ts +0 -8
  77. package/dist/components/ui/tooltip.d.ts.map +0 -1
  78. package/dist/core.css +0 -1
  79. package/dist/utils/form-generator.d.ts +0 -29
  80. package/dist/utils/form-generator.d.ts.map +0 -1
  81. package/dist/utils/secure-param-detector.d.ts +0 -26
  82. package/dist/utils/secure-param-detector.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @arcteninc/core
2
2
 
3
- React component library for building AI-powered agent interfaces.
3
+ Core hooks, utilities, and types for building AI-powered agent interfaces. This package contains the headless functionality - for UI components, see `@arcteninc/ui`.
4
4
 
5
5
  ## Installation
6
6
 
@@ -14,92 +14,85 @@ pnpm add @arcteninc/core
14
14
  bun add @arcteninc/core
15
15
  ```
16
16
 
17
- ## Requirements
17
+ ## Package Split
18
18
 
19
- **Tailwind CSS is only required if you're using the visual components** (like `<ArctenAgent>`). If you're only using the headless hooks (like `useAgent`), Tailwind is not needed.
19
+ This package has been split into two packages:
20
20
 
21
- The UI components use Tailwind utility classes for styling.
21
+ - **@arcteninc/core** (this package): Hooks (`useAgent`), utilities, types, and CLI tools
22
+ - **@arcteninc/ui**: React components (`ArctenAgent`) and UI primitives
22
23
 
23
- ### Setting up Tailwind CSS
24
+ This split allows you to use only the core functionality without the UI bundle if you're building a custom interface.
24
25
 
25
- 1. Install Tailwind CSS (if not already installed):
26
+ ## Usage
26
27
 
27
- ```bash
28
- npm install -D tailwindcss
29
- npx tailwindcss init
30
- ```
28
+ ### Using the `useAgent` Hook
31
29
 
32
- 2. Configure Tailwind to scan the library's components by adding the package path to your `content` array in `tailwind.config.js`:
33
-
34
- ```js
35
- /** @type {import('tailwindcss').Config} */
36
- module.exports = {
37
- content: [
38
- "./src/**/*.{js,ts,jsx,tsx,mdx}",
39
- // Add this line to include @arcteninc/core components:
40
- "./node_modules/@arcteninc/core/dist/**/*.{js,mjs}"
41
- ],
42
- theme: {
43
- extend: {},
44
- },
45
- plugins: [],
30
+ ```tsx
31
+ import { useAgent } from "@arcteninc/core";
32
+
33
+ function MyCustomAgent() {
34
+ const {
35
+ messages,
36
+ sendMessage,
37
+ status,
38
+ error,
39
+ stop,
40
+ } = useAgent({
41
+ apiBaseUrl: "https://api.arcten.com",
42
+ tokenEndpoint: "/api/arcten/token",
43
+ user: { id: "user-123" },
44
+ tools: [/* your tools */],
45
+ });
46
+
47
+ // Build your custom UI using the hook
48
+ return (
49
+ <div>
50
+ {messages.map((msg) => (
51
+ <div key={msg.id}>{msg.content}</div>
52
+ ))}
53
+ <input
54
+ onKeyDown={(e) => {
55
+ if (e.key === "Enter") {
56
+ sendMessage({ text: e.target.value });
57
+ }
58
+ }}
59
+ />
60
+ </div>
61
+ );
46
62
  }
47
63
  ```
48
64
 
49
- 3. Include Tailwind directives in your CSS:
65
+ ### Using the UI Component
50
66
 
51
- ```css
52
- @tailwind base;
53
- @tailwind components;
54
- @tailwind utilities;
55
- ```
56
-
57
- ## Usage
67
+ If you want the pre-built UI component, install and use `@arcteninc/ui`:
58
68
 
59
- ### Complete Example
69
+ ```bash
70
+ npm install @arcteninc/ui
71
+ ```
60
72
 
61
73
  ```tsx
62
- // 1. Import the component
63
- import { ArctenAgent } from "@arcteninc/core";
64
-
65
- // 2. Import the styles (REQUIRED - styles are NOT auto-applied)
66
- import "@arcteninc/core/styles";
74
+ import { ArctenAgent } from "@arcteninc/ui";
75
+ import "@arcteninc/ui/styles";
67
76
 
68
77
  function App() {
69
78
  return (
70
79
  <ArctenAgent
71
- title="My AI Assistant"
80
+ apiBaseUrl="https://api.arcten.com"
72
81
  tokenEndpoint="/api/arcten/token"
82
+ user={{ id: "user-123" }}
73
83
  />
74
84
  );
75
85
  }
76
86
  ```
77
87
 
78
- **⚠️ Important:** Importing the component does NOT automatically include styles. You must import the CSS separately (see below).
88
+ ## CLI Tools
79
89
 
80
- ### Import Styles
90
+ This package includes CLI tools for type extraction:
81
91
 
82
- **Required:** You MUST import the CSS styles separately for the components to display correctly. The styles are pre-compiled and self-contained - they work regardless of whether you're using Tailwind CSS in your project.
83
-
84
- #### Option 1: Import in your CSS file (Recommended)
85
-
86
- ```css
87
- /* In your globals.css or main CSS file */
88
- @import "@arcteninc/core/styles";
89
- ```
90
-
91
- #### Option 2: Import in your JavaScript/TypeScript
92
-
93
- ```tsx
94
- // In your main entry file (e.g., app.tsx, _app.tsx, layout.tsx)
95
- import "@arcteninc/core/styles";
92
+ ```bash
93
+ npx @arcteninc/core arcten-extract-types
96
94
  ```
97
95
 
98
- #### Option 3: Import via CDN (if using unpkg or similar)
99
-
100
- ```html
101
- <link rel="stylesheet" href="https://unpkg.com/@arcteninc/core@latest/dist/core.css" />
102
- ```
103
96
  ## Development
104
97
 
105
98
  To install dependencies:
@@ -119,9 +112,3 @@ To watch for changes:
119
112
  ```bash
120
113
  bun run dev
121
114
  ```
122
-
123
- ## Notes
124
-
125
- - The CSS is pre-compiled and includes all necessary Tailwind styles
126
- - You don't need to configure Tailwind CSS in your project to use this package
127
- - The styles are self-contained and won't conflict with your existing styles