@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.
- package/README.md +73 -78
- package/dist/index.cjs +3 -16
- package/dist/index.d.ts +1 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +851 -8410
- package/dist/lib/useAgent.d.ts +1 -2
- package/dist/lib/useAgent.d.ts.map +1 -1
- package/dist/types/use-agent.d.ts +3 -44
- package/dist/types/use-agent.d.ts.map +1 -1
- package/dist/utils/extract-tool-metadata.d.ts.map +1 -1
- package/package.json +7 -46
- package/scripts/arcten-cli.cjs +14 -108
- package/scripts/cli-extract-types-auto.ts +22 -4
- package/scripts/update-core.cjs +124 -0
- package/dist/components/ArctenAgent.d.ts +0 -52
- package/dist/components/ArctenAgent.d.ts.map +0 -1
- package/dist/components/ai-elements/prompt-input.d.ts +0 -187
- package/dist/components/ai-elements/prompt-input.d.ts.map +0 -1
- package/dist/components/ai-elements/reasoning.d.ts +0 -17
- package/dist/components/ai-elements/reasoning.d.ts.map +0 -1
- package/dist/components/ai-elements/response.d.ts +0 -8
- package/dist/components/ai-elements/response.d.ts.map +0 -1
- package/dist/components/ai-elements/shimmer.d.ts +0 -10
- package/dist/components/ai-elements/shimmer.d.ts.map +0 -1
- package/dist/components/citation-button.d.ts +0 -14
- package/dist/components/citation-button.d.ts.map +0 -1
- package/dist/components/citation-text-renderer.d.ts +0 -31
- package/dist/components/citation-text-renderer.d.ts.map +0 -1
- package/dist/components/secure-modals/EmailModal.d.ts +0 -10
- package/dist/components/secure-modals/EmailModal.d.ts.map +0 -1
- package/dist/components/secure-modals/FormModal.d.ts +0 -20
- package/dist/components/secure-modals/FormModal.d.ts.map +0 -1
- package/dist/components/secure-modals/PasswordModal.d.ts +0 -10
- package/dist/components/secure-modals/PasswordModal.d.ts.map +0 -1
- package/dist/components/secure-modals/PhoneModal.d.ts +0 -10
- package/dist/components/secure-modals/PhoneModal.d.ts.map +0 -1
- package/dist/components/secure-modals/PinModal.d.ts +0 -11
- package/dist/components/secure-modals/PinModal.d.ts.map +0 -1
- package/dist/components/secure-modals/SecureModalProvider.d.ts +0 -13
- package/dist/components/secure-modals/SecureModalProvider.d.ts.map +0 -1
- package/dist/components/secure-modals/TextModal.d.ts +0 -11
- package/dist/components/secure-modals/TextModal.d.ts.map +0 -1
- package/dist/components/secure-modals/index.d.ts +0 -10
- package/dist/components/secure-modals/index.d.ts.map +0 -1
- package/dist/components/secure-modals/types.d.ts +0 -34
- package/dist/components/secure-modals/types.d.ts.map +0 -1
- package/dist/components/tool-call-approval.d.ts +0 -9
- package/dist/components/tool-call-approval.d.ts.map +0 -1
- package/dist/components/tool-call-result.d.ts +0 -8
- package/dist/components/tool-call-result.d.ts.map +0 -1
- package/dist/components/ui/autotextarea.d.ts +0 -19
- package/dist/components/ui/autotextarea.d.ts.map +0 -1
- package/dist/components/ui/badge.d.ts +0 -10
- package/dist/components/ui/badge.d.ts.map +0 -1
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/collapsible.d.ts +0 -6
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/command.d.ts +0 -19
- package/dist/components/ui/command.d.ts.map +0 -1
- package/dist/components/ui/dialog.d.ts +0 -16
- package/dist/components/ui/dialog.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.d.ts +0 -26
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/hover-card.d.ts +0 -7
- package/dist/components/ui/hover-card.d.ts.map +0 -1
- package/dist/components/ui/input-group.d.ts +0 -17
- package/dist/components/ui/input-group.d.ts.map +0 -1
- package/dist/components/ui/input.d.ts +0 -4
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/kbd.d.ts +0 -4
- package/dist/components/ui/kbd.d.ts.map +0 -1
- package/dist/components/ui/select.d.ts +0 -16
- package/dist/components/ui/select.d.ts.map +0 -1
- package/dist/components/ui/textarea.d.ts +0 -4
- package/dist/components/ui/textarea.d.ts.map +0 -1
- package/dist/components/ui/tooltip.d.ts +0 -8
- package/dist/components/ui/tooltip.d.ts.map +0 -1
- package/dist/core.css +0 -1
- package/dist/utils/form-generator.d.ts +0 -29
- package/dist/utils/form-generator.d.ts.map +0 -1
- package/dist/utils/secure-param-detector.d.ts +0 -26
- package/dist/utils/secure-param-detector.d.ts.map +0 -1
- package/scripts/cli-agent-inject.ts +0 -205
- package/scripts/cli-agent-wrapper.cjs +0 -51
- package/scripts/cli-agent.ts +0 -483
- package/scripts/cli-create-project.ts +0 -608
- package/scripts/cli-create-wrapper.cjs +0 -60
- package/scripts/cli-init-wizard-wrapper.cjs +0 -58
- package/scripts/cli-init-wizard.ts +0 -646
- package/scripts/cli-prompt-wrapper.cjs +0 -51
- package/scripts/cli-prompt.ts +0 -306
- package/scripts/cli-sync-wrapper.cjs +0 -69
- package/scripts/cli-sync.ts +0 -915
- package/scripts/cli-tools-wrapper.cjs +0 -51
- package/scripts/cli-tools.ts +0 -320
- package/scripts/cli-uninstall-wrapper.cjs +0 -66
- package/scripts/cli-uninstall.ts +0 -173
- package/scripts/config-parser.ts +0 -432
- package/scripts/dashboard-sync.ts +0 -454
- package/scripts/tree-sitter-discover.ts +0 -526
- package/scripts/wasm/tree-sitter-tsx.wasm +0 -0
- package/scripts/wasm/tree-sitter-typescript.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @arcteninc/core
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
17
|
+
> **Note:** For the pre-built UI component (`<ArctenAgent>`), install `@arcteninc/ui` instead. See [@arcteninc/ui](../ui/README.md) for details.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## What's in this package
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
This package provides the **headless** building blocks for creating AI agent interfaces:
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
###
|
|
30
|
+
### useAgent Hook
|
|
60
31
|
|
|
61
32
|
```tsx
|
|
62
|
-
|
|
63
|
-
import {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
61
|
+
### useGenerate Hook
|
|
79
62
|
|
|
80
|
-
|
|
63
|
+
```tsx
|
|
64
|
+
import { useGenerate } from "@arcteninc/core";
|
|
81
65
|
|
|
82
|
-
|
|
66
|
+
function MyComponent() {
|
|
67
|
+
const { generateText, generateObject, isLoading } = useGenerate({
|
|
68
|
+
apiBaseUrl: "https://api.arcten.com",
|
|
69
|
+
});
|
|
83
70
|
|
|
84
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
@import "@arcteninc/core/styles";
|
|
78
|
+
return <button onClick={handleGenerate}>Generate</button>;
|
|
79
|
+
}
|
|
89
80
|
```
|
|
90
81
|
|
|
91
|
-
|
|
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
|
-
|
|
84
|
+
If you want a ready-to-use chat interface, use the `@arcteninc/ui` package:
|
|
99
85
|
|
|
100
|
-
```
|
|
101
|
-
|
|
86
|
+
```bash
|
|
87
|
+
npm install @arcteninc/core @arcteninc/ui
|
|
102
88
|
```
|
|
103
|
-
## Development
|
|
104
89
|
|
|
105
|
-
|
|
90
|
+
```tsx
|
|
91
|
+
import { ArctenAgent } from "@arcteninc/ui";
|
|
92
|
+
import "@arcteninc/ui/styles";
|
|
106
93
|
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
104
|
+
## CLI Utilities
|
|
105
|
+
|
|
106
|
+
This package includes a utility for extracting tool metadata:
|
|
112
107
|
|
|
113
108
|
```bash
|
|
114
|
-
|
|
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
|
-
|
|
116
|
+
## Development
|
|
118
117
|
|
|
119
118
|
```bash
|
|
120
|
-
bun
|
|
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
|