@cadraos/sdk 0.1.6 → 0.1.8
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 +38 -5
- package/dist/chat/index.cjs +1180 -36
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +229 -15
- package/dist/chat/index.d.ts +229 -15
- package/dist/chat/index.js +1180 -39
- package/dist/chat/index.js.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
# @cadraos/sdk
|
|
2
2
|
|
|
3
|
-
Official SDK for the
|
|
3
|
+
Official SDK for the CadraOS platform - programmatic access to agents, skills, tools, and artifacts.
|
|
4
|
+
|
|
5
|
+
> **Note**: For React chat components, use the new [@cadraos/react](https://www.npmjs.com/package/@cadraos/react) package.
|
|
6
|
+
> The `@cadraos/sdk/chat` subpath is deprecated.
|
|
7
|
+
|
|
8
|
+
## Deprecation Notice
|
|
9
|
+
|
|
10
|
+
The `@cadraos/sdk/chat` subpath is **deprecated** and will be removed in a future version.
|
|
11
|
+
|
|
12
|
+
**If you're using React chat components**, please migrate to `@cadraos/react`:
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
// Before (deprecated)
|
|
16
|
+
import { AgentChat, ChatConfigProvider } from '@cadraos/sdk/chat';
|
|
17
|
+
import '@cadraos/sdk/chat/styles.css';
|
|
18
|
+
|
|
19
|
+
// After (recommended)
|
|
20
|
+
import '@cadraos/react/styles.css';
|
|
21
|
+
import { CadraCopilot } from '@cadraos/react';
|
|
22
|
+
|
|
23
|
+
function App() {
|
|
24
|
+
return (
|
|
25
|
+
<CadraCopilot
|
|
26
|
+
apiKey="cdr_live_xxx"
|
|
27
|
+
orgId={123}
|
|
28
|
+
agentId="agent-uuid"
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For full migration instructions, see the [migration guide](https://github.com/cadraos/cadra-sdk/blob/main/packages/react/MIGRATION.md).
|
|
4
35
|
|
|
5
36
|
## Installation
|
|
6
37
|
|
|
@@ -15,12 +46,12 @@ yarn add @cadraos/sdk
|
|
|
15
46
|
## Quick Start
|
|
16
47
|
|
|
17
48
|
```typescript
|
|
18
|
-
import {
|
|
49
|
+
import { CadraClient } from '@cadraos/sdk';
|
|
19
50
|
|
|
20
51
|
// Initialize the client
|
|
21
|
-
const client = new
|
|
22
|
-
apiKey: process.env.
|
|
23
|
-
orgId: Number(process.env.
|
|
52
|
+
const client = new CadraClient({
|
|
53
|
+
apiKey: process.env.CADRA_API_KEY!, // e.g., cdr_live_xxx
|
|
54
|
+
orgId: Number(process.env.CADRA_ORG_ID),
|
|
24
55
|
});
|
|
25
56
|
|
|
26
57
|
// List available agents
|
|
@@ -34,6 +65,8 @@ const execution = await client.agents.executeSync(agents[0].uuid, {
|
|
|
34
65
|
console.log('Result:', execution.output);
|
|
35
66
|
```
|
|
36
67
|
|
|
68
|
+
> **Note**: `AISaaSClient` is deprecated but still works as an alias for `CadraClient`.
|
|
69
|
+
|
|
37
70
|
## Authentication
|
|
38
71
|
|
|
39
72
|
The SDK supports three authentication methods:
|