@arcteninc/core 0.0.33 → 0.0.35

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 (61) hide show
  1. package/dist/index.d.ts +132 -7
  2. package/dist/server.d.ts +22 -9
  3. package/package.json +1 -1
  4. package/scripts/cli-extract-types-auto.js +3 -3
  5. package/scripts/cli-extract-types-auto.ts +568 -124
  6. package/dist/components/ArctenAgent.d.ts +0 -25
  7. package/dist/components/ArctenAgent.d.ts.map +0 -1
  8. package/dist/components/ai-elements/prompt-input.d.ts +0 -187
  9. package/dist/components/ai-elements/prompt-input.d.ts.map +0 -1
  10. package/dist/components/ai-elements/reasoning.d.ts +0 -17
  11. package/dist/components/ai-elements/reasoning.d.ts.map +0 -1
  12. package/dist/components/ai-elements/response.d.ts +0 -8
  13. package/dist/components/ai-elements/response.d.ts.map +0 -1
  14. package/dist/components/ai-elements/shimmer.d.ts +0 -10
  15. package/dist/components/ai-elements/shimmer.d.ts.map +0 -1
  16. package/dist/components/tool-call-approval.d.ts +0 -9
  17. package/dist/components/tool-call-approval.d.ts.map +0 -1
  18. package/dist/components/tool-call-result.d.ts +0 -8
  19. package/dist/components/tool-call-result.d.ts.map +0 -1
  20. package/dist/components/ui/autotextarea.d.ts +0 -19
  21. package/dist/components/ui/autotextarea.d.ts.map +0 -1
  22. package/dist/components/ui/badge.d.ts +0 -10
  23. package/dist/components/ui/badge.d.ts.map +0 -1
  24. package/dist/components/ui/button.d.ts +0 -14
  25. package/dist/components/ui/button.d.ts.map +0 -1
  26. package/dist/components/ui/collapsible.d.ts +0 -6
  27. package/dist/components/ui/collapsible.d.ts.map +0 -1
  28. package/dist/components/ui/command.d.ts +0 -19
  29. package/dist/components/ui/command.d.ts.map +0 -1
  30. package/dist/components/ui/dialog.d.ts +0 -16
  31. package/dist/components/ui/dialog.d.ts.map +0 -1
  32. package/dist/components/ui/dropdown-menu.d.ts +0 -26
  33. package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
  34. package/dist/components/ui/hover-card.d.ts +0 -7
  35. package/dist/components/ui/hover-card.d.ts.map +0 -1
  36. package/dist/components/ui/input-group.d.ts +0 -17
  37. package/dist/components/ui/input-group.d.ts.map +0 -1
  38. package/dist/components/ui/input.d.ts +0 -4
  39. package/dist/components/ui/input.d.ts.map +0 -1
  40. package/dist/components/ui/kbd.d.ts +0 -4
  41. package/dist/components/ui/kbd.d.ts.map +0 -1
  42. package/dist/components/ui/select.d.ts +0 -16
  43. package/dist/components/ui/select.d.ts.map +0 -1
  44. package/dist/components/ui/textarea.d.ts +0 -4
  45. package/dist/components/ui/textarea.d.ts.map +0 -1
  46. package/dist/components/ui/tooltip.d.ts +0 -8
  47. package/dist/components/ui/tooltip.d.ts.map +0 -1
  48. package/dist/index.d.ts.map +0 -1
  49. package/dist/lib/useAgent.d.ts +0 -3
  50. package/dist/lib/useAgent.d.ts.map +0 -1
  51. package/dist/lib/utils.d.ts +0 -3
  52. package/dist/lib/utils.d.ts.map +0 -1
  53. package/dist/server.d.ts.map +0 -1
  54. package/dist/types/tool-description.d.ts +0 -18
  55. package/dist/types/tool-description.d.ts.map +0 -1
  56. package/dist/types/use-agent.d.ts +0 -73
  57. package/dist/types/use-agent.d.ts.map +0 -1
  58. package/dist/utils/extract-tool-metadata.d.ts +0 -26
  59. package/dist/utils/extract-tool-metadata.d.ts.map +0 -1
  60. package/dist/verifyToken.d.ts +0 -19
  61. package/dist/verifyToken.d.ts.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,7 +1,132 @@
1
- export { ArctenAgent } from './components/ArctenAgent';
2
- export type { ArctenAgentProps, ToolFunction } from './components/ArctenAgent';
3
- export { verifyToken } from './verifyToken';
4
- export type { VerifyTokenOptions, TokenResponse } from './verifyToken';
5
- export { useAgent } from './lib/useAgent';
6
- export type { UseAgentOptions, UseAgentReturn, ToolCall, OnToolCallOptions, OnFinishOptions, Conversation, } from './types/use-agent';
7
- //# sourceMappingURL=index.d.ts.map
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { UIMessage } from '@ai-sdk/react';
3
+
4
+ export declare function ArctenAgent({ theme, layout, model, animated, title, logo, defaultWidth, minWidth, maxWidth, initiallyExpanded, tools, safeTools, toolMetadata, systemPrompt, tokenEndpoint, apiBaseUrl, user, }: ArctenAgentProps): JSX.Element | null;
5
+
6
+ export declare interface ArctenAgentProps {
7
+ theme?: "light" | "dark" | "auto";
8
+ layout?: "sidebar";
9
+ model?: "auto" | "anthropic:sonnet-4.5" | "groq:oss-120b" | "openai:gpt-5";
10
+ animated?: boolean;
11
+ title?: string;
12
+ logo?: React.ReactNode;
13
+ defaultWidth?: number;
14
+ minWidth?: number;
15
+ maxWidth?: number;
16
+ initiallyExpanded?: boolean;
17
+ tools?: ToolFunction[];
18
+ safeTools?: ToolFunction[];
19
+ toolMetadata?: any;
20
+ systemPrompt?: string;
21
+ tokenEndpoint?: string;
22
+ apiBaseUrl?: string;
23
+ user?: {
24
+ id: string;
25
+ [key: string]: any;
26
+ };
27
+ }
28
+
29
+ export declare interface Conversation {
30
+ _id: string;
31
+ chatId: string;
32
+ title: string;
33
+ updatedAt: number;
34
+ messages?: UIMessage[];
35
+ }
36
+
37
+ export declare interface OnFinishOptions {
38
+ message: UIMessage;
39
+ messages: UIMessage[];
40
+ isAbort: boolean;
41
+ isDisconnect: boolean;
42
+ isError: boolean;
43
+ }
44
+
45
+ export declare interface OnToolCallOptions {
46
+ toolCall: ToolCall;
47
+ }
48
+
49
+ export declare interface TokenResponse {
50
+ clientToken: string;
51
+ expiresAt: number;
52
+ projectId?: string;
53
+ }
54
+
55
+ export declare interface ToolCall {
56
+ toolCallId: string;
57
+ toolName: string;
58
+ args: Record<string, any>;
59
+ }
60
+
61
+ export declare type ToolFunction = (...args: any[]) => any;
62
+
63
+ declare type ToolFunction_2 = (...args: any[]) => any;
64
+
65
+ export declare function useAgent({ apiBaseUrl, tokenEndpoint, clientToken: providedToken, skipTokenFetch, user, tools, safeTools, toolMetadata, systemPrompt, initialMessages, conversationId: initialConversationId, onToolCall, onFinish, ragFilters, }?: UseAgentOptions): UseAgentReturn;
66
+
67
+ export declare interface UseAgentOptions {
68
+ apiBaseUrl?: string;
69
+ tokenEndpoint?: string;
70
+ clientToken?: string;
71
+ skipTokenFetch?: boolean;
72
+ user?: {
73
+ id: string;
74
+ [key: string]: any;
75
+ };
76
+ tools?: ToolFunction_2[];
77
+ safeTools?: ToolFunction_2[];
78
+ toolMetadata?: any;
79
+ systemPrompt?: string;
80
+ initialMessages?: UIMessage[];
81
+ conversationId?: string;
82
+ onToolCall?: (options: OnToolCallOptions) => void | Promise<void>;
83
+ onFinish?: (options: OnFinishOptions) => void;
84
+ ragFilters?: {
85
+ docIds?: string[];
86
+ pageIds?: string[];
87
+ site?: string;
88
+ lang?: string;
89
+ tags?: string[];
90
+ };
91
+ }
92
+
93
+ export declare interface UseAgentReturn {
94
+ id: string | null;
95
+ messages: UIMessage[];
96
+ status: "ready" | "submitted" | "streaming" | "error";
97
+ error: Error | undefined;
98
+ sendMessage: (message: {
99
+ text: string;
100
+ }) => void;
101
+ stop: () => void;
102
+ addToolOutput: (result: {
103
+ toolCallId: string;
104
+ tool: string;
105
+ output: any;
106
+ }) => void;
107
+ setMessages: (messages: UIMessage[]) => void;
108
+ conversations: Conversation[];
109
+ loadConversation: (conversationId: string) => Promise<void>;
110
+ deleteConversation: (conversationId: string) => Promise<void>;
111
+ startNewConversation: () => void;
112
+ isLoadingConversations: boolean;
113
+ clientToken: string | null;
114
+ tokenError: string | null;
115
+ }
116
+
117
+ export declare function verifyToken(options: VerifyTokenOptions): Promise<TokenResponse>;
118
+
119
+ /**
120
+ * Verify token with Arcten API
121
+ * This function should be called from your backend API route
122
+ */
123
+ export declare interface VerifyTokenOptions {
124
+ apiKey: string;
125
+ user?: {
126
+ id: string;
127
+ [key: string]: any;
128
+ };
129
+ apiUrl?: string;
130
+ }
131
+
132
+ export { }
package/dist/server.d.ts CHANGED
@@ -1,9 +1,22 @@
1
- /**
2
- * Server-only exports for @arcteninc/core
3
- *
4
- * This module is safe to import in server environments like Next.js API routes,
5
- * as it doesn't include any React components or hooks.
6
- */
7
- export { verifyToken } from './verifyToken';
8
- export type { VerifyTokenOptions, TokenResponse } from './verifyToken';
9
- //# sourceMappingURL=server.d.ts.map
1
+ export declare interface TokenResponse {
2
+ clientToken: string;
3
+ expiresAt: number;
4
+ projectId?: string;
5
+ }
6
+
7
+ export declare function verifyToken(options: VerifyTokenOptions): Promise<TokenResponse>;
8
+
9
+ /**
10
+ * Verify token with Arcten API
11
+ * This function should be called from your backend API route
12
+ */
13
+ export declare interface VerifyTokenOptions {
14
+ apiKey: string;
15
+ user?: {
16
+ id: string;
17
+ [key: string]: any;
18
+ };
19
+ apiUrl?: string;
20
+ }
21
+
22
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcteninc/core",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -35,10 +35,10 @@ async function main() {
35
35
  }
36
36
 
37
37
  const args = process.argv.slice(2);
38
-
38
+
39
39
  // Check for bun first (faster and preferred if available)
40
40
  const hasBun = await checkCommand('bun');
41
-
41
+
42
42
  if (hasBun) {
43
43
  // Use bun directly - it's faster and can run TypeScript natively
44
44
  const bunProcess = spawn('bun', [tsScript, ...args], {
@@ -62,7 +62,7 @@ async function main() {
62
62
 
63
63
  async function tryTsxFallback(args) {
64
64
  const hasNpx = await checkCommand('npx');
65
-
65
+
66
66
  if (hasNpx) {
67
67
  // Use tsx via npx - it's lightweight and works great with Node.js
68
68
  const tsxProcess = spawn('npx', ['-y', 'tsx', tsScript, ...args], {