@arcteninc/core 0.0.176 → 0.0.177

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 (103) hide show
  1. package/README.md +73 -78
  2. package/dist/index.cjs +3 -16
  3. package/dist/index.d.ts +1 -6
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.mjs +851 -8410
  6. package/dist/lib/useAgent.d.ts +1 -2
  7. package/dist/lib/useAgent.d.ts.map +1 -1
  8. package/dist/types/use-agent.d.ts +3 -44
  9. package/dist/types/use-agent.d.ts.map +1 -1
  10. package/dist/utils/extract-tool-metadata.d.ts.map +1 -1
  11. package/package.json +7 -46
  12. package/scripts/arcten-cli.cjs +14 -108
  13. package/scripts/cli-extract-types-auto.ts +22 -4
  14. package/scripts/update-core.cjs +124 -0
  15. package/dist/components/ArctenAgent.d.ts +0 -52
  16. package/dist/components/ArctenAgent.d.ts.map +0 -1
  17. package/dist/components/ai-elements/prompt-input.d.ts +0 -187
  18. package/dist/components/ai-elements/prompt-input.d.ts.map +0 -1
  19. package/dist/components/ai-elements/reasoning.d.ts +0 -17
  20. package/dist/components/ai-elements/reasoning.d.ts.map +0 -1
  21. package/dist/components/ai-elements/response.d.ts +0 -8
  22. package/dist/components/ai-elements/response.d.ts.map +0 -1
  23. package/dist/components/ai-elements/shimmer.d.ts +0 -10
  24. package/dist/components/ai-elements/shimmer.d.ts.map +0 -1
  25. package/dist/components/citation-button.d.ts +0 -14
  26. package/dist/components/citation-button.d.ts.map +0 -1
  27. package/dist/components/citation-text-renderer.d.ts +0 -31
  28. package/dist/components/citation-text-renderer.d.ts.map +0 -1
  29. package/dist/components/secure-modals/EmailModal.d.ts +0 -10
  30. package/dist/components/secure-modals/EmailModal.d.ts.map +0 -1
  31. package/dist/components/secure-modals/FormModal.d.ts +0 -20
  32. package/dist/components/secure-modals/FormModal.d.ts.map +0 -1
  33. package/dist/components/secure-modals/PasswordModal.d.ts +0 -10
  34. package/dist/components/secure-modals/PasswordModal.d.ts.map +0 -1
  35. package/dist/components/secure-modals/PhoneModal.d.ts +0 -10
  36. package/dist/components/secure-modals/PhoneModal.d.ts.map +0 -1
  37. package/dist/components/secure-modals/PinModal.d.ts +0 -11
  38. package/dist/components/secure-modals/PinModal.d.ts.map +0 -1
  39. package/dist/components/secure-modals/SecureModalProvider.d.ts +0 -13
  40. package/dist/components/secure-modals/SecureModalProvider.d.ts.map +0 -1
  41. package/dist/components/secure-modals/TextModal.d.ts +0 -11
  42. package/dist/components/secure-modals/TextModal.d.ts.map +0 -1
  43. package/dist/components/secure-modals/index.d.ts +0 -10
  44. package/dist/components/secure-modals/index.d.ts.map +0 -1
  45. package/dist/components/secure-modals/types.d.ts +0 -34
  46. package/dist/components/secure-modals/types.d.ts.map +0 -1
  47. package/dist/components/tool-call-approval.d.ts +0 -9
  48. package/dist/components/tool-call-approval.d.ts.map +0 -1
  49. package/dist/components/tool-call-result.d.ts +0 -8
  50. package/dist/components/tool-call-result.d.ts.map +0 -1
  51. package/dist/components/ui/autotextarea.d.ts +0 -19
  52. package/dist/components/ui/autotextarea.d.ts.map +0 -1
  53. package/dist/components/ui/badge.d.ts +0 -10
  54. package/dist/components/ui/badge.d.ts.map +0 -1
  55. package/dist/components/ui/button.d.ts +0 -14
  56. package/dist/components/ui/button.d.ts.map +0 -1
  57. package/dist/components/ui/collapsible.d.ts +0 -6
  58. package/dist/components/ui/collapsible.d.ts.map +0 -1
  59. package/dist/components/ui/command.d.ts +0 -19
  60. package/dist/components/ui/command.d.ts.map +0 -1
  61. package/dist/components/ui/dialog.d.ts +0 -16
  62. package/dist/components/ui/dialog.d.ts.map +0 -1
  63. package/dist/components/ui/dropdown-menu.d.ts +0 -26
  64. package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
  65. package/dist/components/ui/hover-card.d.ts +0 -7
  66. package/dist/components/ui/hover-card.d.ts.map +0 -1
  67. package/dist/components/ui/input-group.d.ts +0 -17
  68. package/dist/components/ui/input-group.d.ts.map +0 -1
  69. package/dist/components/ui/input.d.ts +0 -4
  70. package/dist/components/ui/input.d.ts.map +0 -1
  71. package/dist/components/ui/kbd.d.ts +0 -4
  72. package/dist/components/ui/kbd.d.ts.map +0 -1
  73. package/dist/components/ui/select.d.ts +0 -16
  74. package/dist/components/ui/select.d.ts.map +0 -1
  75. package/dist/components/ui/textarea.d.ts +0 -4
  76. package/dist/components/ui/textarea.d.ts.map +0 -1
  77. package/dist/components/ui/tooltip.d.ts +0 -8
  78. package/dist/components/ui/tooltip.d.ts.map +0 -1
  79. package/dist/core.css +0 -1
  80. package/dist/utils/form-generator.d.ts +0 -29
  81. package/dist/utils/form-generator.d.ts.map +0 -1
  82. package/dist/utils/secure-param-detector.d.ts +0 -26
  83. package/dist/utils/secure-param-detector.d.ts.map +0 -1
  84. package/scripts/cli-agent-inject.ts +0 -205
  85. package/scripts/cli-agent-wrapper.cjs +0 -51
  86. package/scripts/cli-agent.ts +0 -483
  87. package/scripts/cli-create-project.ts +0 -608
  88. package/scripts/cli-create-wrapper.cjs +0 -60
  89. package/scripts/cli-init-wizard-wrapper.cjs +0 -58
  90. package/scripts/cli-init-wizard.ts +0 -646
  91. package/scripts/cli-prompt-wrapper.cjs +0 -51
  92. package/scripts/cli-prompt.ts +0 -306
  93. package/scripts/cli-sync-wrapper.cjs +0 -69
  94. package/scripts/cli-sync.ts +0 -915
  95. package/scripts/cli-tools-wrapper.cjs +0 -51
  96. package/scripts/cli-tools.ts +0 -320
  97. package/scripts/cli-uninstall-wrapper.cjs +0 -66
  98. package/scripts/cli-uninstall.ts +0 -173
  99. package/scripts/config-parser.ts +0 -432
  100. package/scripts/dashboard-sync.ts +0 -454
  101. package/scripts/tree-sitter-discover.ts +0 -526
  102. package/scripts/wasm/tree-sitter-tsx.wasm +0 -0
  103. package/scripts/wasm/tree-sitter-typescript.wasm +0 -0
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, types, and utilities for building AI-powered agent interfaces.
4
4
 
5
5
  ## Installation
6
6
 
@@ -14,114 +14,109 @@ pnpm add @arcteninc/core
14
14
  bun add @arcteninc/core
15
15
  ```
16
16
 
17
- ## Requirements
17
+ > **Note:** For the pre-built UI component (`<ArctenAgent>`), install `@arcteninc/ui` instead. See [@arcteninc/ui](../ui/README.md) for details.
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
+ ## What's in this package
20
20
 
21
- The UI components use Tailwind utility classes for styling.
21
+ This package provides the **headless** building blocks for creating AI agent interfaces:
22
22
 
23
- ### Setting up Tailwind CSS
24
-
25
- 1. Install Tailwind CSS (if not already installed):
26
-
27
- ```bash
28
- npm install -D tailwindcss
29
- npx tailwindcss init
30
- ```
31
-
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: [],
46
- }
47
- ```
48
-
49
- 3. Include Tailwind directives in your CSS:
50
-
51
- ```css
52
- @tailwind base;
53
- @tailwind components;
54
- @tailwind utilities;
55
- ```
23
+ - **`useAgent`** - React hook for managing agent conversations, tool calls, and state
24
+ - **`useGenerate`** - React hook for one-off AI text/object generation
25
+ - **Types** - TypeScript types for tool definitions, conversations, and configurations
26
+ - **Utilities** - Helper functions like `extractToolsMetadata`
56
27
 
57
28
  ## Usage
58
29
 
59
- ### Complete Example
30
+ ### useAgent Hook
60
31
 
61
32
  ```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";
33
+ import { useAgent } from "@arcteninc/core";
34
+ import type { UseAgentOptions } from "@arcteninc/core";
35
+
36
+ function MyCustomChat() {
37
+ const {
38
+ messages,
39
+ sendMessage,
40
+ status,
41
+ stop,
42
+ } = useAgent({
43
+ apiBaseUrl: "https://api.arcten.com",
44
+ user: { id: "user-123" },
45
+ tools: myTools,
46
+ });
67
47
 
68
- function App() {
69
48
  return (
70
- <ArctenAgent
71
- title="My AI Assistant"
72
- tokenEndpoint="/api/arcten/token"
73
- />
49
+ <div>
50
+ {messages.map((msg) => (
51
+ <div key={msg.id}>{msg.content}</div>
52
+ ))}
53
+ <button onClick={() => sendMessage({ text: "Hello!" })}>
54
+ Send
55
+ </button>
56
+ </div>
74
57
  );
75
58
  }
76
59
  ```
77
60
 
78
- **⚠️ Important:** Importing the component does NOT automatically include styles. You must import the CSS separately (see below).
61
+ ### useGenerate Hook
79
62
 
80
- ### Import Styles
63
+ ```tsx
64
+ import { useGenerate } from "@arcteninc/core";
81
65
 
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.
66
+ function MyComponent() {
67
+ const { generateText, generateObject, isLoading } = useGenerate({
68
+ apiBaseUrl: "https://api.arcten.com",
69
+ });
83
70
 
84
- #### Option 1: Import in your CSS file (Recommended)
71
+ const handleGenerate = async () => {
72
+ const result = await generateText({
73
+ prompt: "Write a haiku about coding",
74
+ });
75
+ console.log(result);
76
+ };
85
77
 
86
- ```css
87
- /* In your globals.css or main CSS file */
88
- @import "@arcteninc/core/styles";
78
+ return <button onClick={handleGenerate}>Generate</button>;
79
+ }
89
80
  ```
90
81
 
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";
96
- ```
82
+ ## Pre-built UI Component
97
83
 
98
- #### Option 3: Import via CDN (if using unpkg or similar)
84
+ If you want a ready-to-use chat interface, use the `@arcteninc/ui` package:
99
85
 
100
- ```html
101
- <link rel="stylesheet" href="https://unpkg.com/@arcteninc/core@latest/dist/core.css" />
86
+ ```bash
87
+ npm install @arcteninc/core @arcteninc/ui
102
88
  ```
103
- ## Development
104
89
 
105
- To install dependencies:
90
+ ```tsx
91
+ import { ArctenAgent } from "@arcteninc/ui";
92
+ import "@arcteninc/ui/styles";
106
93
 
107
- ```bash
108
- bun install
94
+ function App() {
95
+ return (
96
+ <ArctenAgent
97
+ apiBaseUrl="https://api.arcten.com"
98
+ user={{ id: "user-123" }}
99
+ />
100
+ );
101
+ }
109
102
  ```
110
103
 
111
- To build:
104
+ ## CLI Utilities
105
+
106
+ This package includes a utility for extracting tool metadata:
112
107
 
113
108
  ```bash
114
- bun run build
109
+ # Extract tool types and metadata
110
+ npx arcten extract-types
111
+
112
+ # Or specify a custom tools file
113
+ npx arcten extract-types --tools ./src/tools.ts
115
114
  ```
116
115
 
117
- To watch for changes:
116
+ ## Development
118
117
 
119
118
  ```bash
120
- bun run dev
119
+ bun install # Install dependencies
120
+ bun run build # Build the package
121
+ bun run dev # Watch for changes
121
122
  ```
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