@asiyst/sdk 0.1.0
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 +63 -0
- package/dist/index.cjs +2366 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +301 -0
- package/dist/index.d.ts +301 -0
- package/dist/index.js +2346 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @asiyst/sdk
|
|
2
|
+
|
|
3
|
+
Client-side runtime that connects a website to Asiyst Cloud.
|
|
4
|
+
|
|
5
|
+
This package does not contain model keys, database credentials, or other server secrets. Identify the project with `projectId` and `publicKey` only. Those values are public project credentials, not secrets.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @asiyst/sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then connect the project:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx asiyst init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`asiyst init` opens [https://asiyst.com](https://asiyst.com) so you can create a project and copy credentials. Avatar appearance and behavior live in Asiyst Cloud so you can change them without redeploying the site.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { Asiyst } from "@asiyst/sdk";
|
|
25
|
+
|
|
26
|
+
await Asiyst.init({
|
|
27
|
+
projectId: "asiyst_project_id",
|
|
28
|
+
publicKey: "asiyst_public_key",
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Mark important controls so the assistant can find them across layouts:
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<button data-asiyst="pricing">Pricing</button>
|
|
36
|
+
<button
|
|
37
|
+
data-asiyst="checkout"
|
|
38
|
+
data-asiyst-description="Proceed to checkout"
|
|
39
|
+
>
|
|
40
|
+
Checkout
|
|
41
|
+
</button>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Local development
|
|
45
|
+
|
|
46
|
+
Point the SDK at a local Cloud implementation:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
await Asiyst.init({
|
|
50
|
+
projectId: "dev_project",
|
|
51
|
+
publicKey: "dev_public_key",
|
|
52
|
+
apiBaseUrl: "http://localhost:8787",
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If Cloud is unreachable, the SDK keeps a fallback avatar configuration and continues to run local APIs (`avatar.moveTo`, highlighting, events). Conversation replies and task plans are not invented locally; those requests fail until Cloud responds.
|
|
57
|
+
|
|
58
|
+
## Documentation
|
|
59
|
+
|
|
60
|
+
- Architecture: `docs/ARCHITECTURE.md`
|
|
61
|
+
- API and events: `docs/API.md`
|
|
62
|
+
- Security: `docs/SECURITY.md`
|
|
63
|
+
- Troubleshooting: `docs/TROUBLESHOOTING.md`
|