@castari/sdk 0.1.1 → 0.1.2
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 +9 -4
- package/dist/client.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,7 +77,9 @@ import { CastariClient } from '@castari/sdk/client'
|
|
|
77
77
|
|
|
78
78
|
const client = new CastariClient({
|
|
79
79
|
snapshot: 'my-agent',
|
|
80
|
-
|
|
80
|
+
clientId: process.env.CASTARI_CLIENT_ID,
|
|
81
|
+
platformApiKey: process.env.CASTARI_API_KEY,
|
|
82
|
+
anthropicApiKey: process.env.ANTHROPIC_API_KEY,
|
|
81
83
|
})
|
|
82
84
|
|
|
83
85
|
await client.start()
|
|
@@ -99,11 +101,14 @@ await client.stop()
|
|
|
99
101
|
|
|
100
102
|
| Property | Type | Description |
|
|
101
103
|
|----------|------|-------------|
|
|
102
|
-
| `platformUrl` | `string` | URL of the Castari Platform |
|
|
103
104
|
| `snapshot` | `string` | Name of the snapshot to use |
|
|
105
|
+
| `clientId` | `string` | Your Castari client ID |
|
|
106
|
+
| `platformApiKey` | `string` | Your Castari API key |
|
|
107
|
+
| `anthropicApiKey` | `string` | Your Anthropic API key |
|
|
104
108
|
| `volume` | `string` | (Optional) Volume name for persistent storage |
|
|
105
|
-
| `connectionUrl` | `string` | (Optional) Direct URL for local development |
|
|
106
109
|
| `labels` | `Record<string, string>` | (Optional) Labels for sandbox reuse |
|
|
110
|
+
| `connectionUrl` | `string` | (Optional) Direct URL for local development |
|
|
111
|
+
| `platformUrl` | `string` | (Optional) Override the platform URL (advanced) |
|
|
107
112
|
|
|
108
113
|
#### Methods
|
|
109
114
|
|
|
@@ -139,8 +144,8 @@ await client.stop({ delete: false })
|
|
|
139
144
|
| Variable | Description |
|
|
140
145
|
|----------|-------------|
|
|
141
146
|
| `ANTHROPIC_API_KEY` | Your Anthropic API key |
|
|
142
|
-
| `CASTARI_PLATFORM_URL` | URL of the Castari Platform |
|
|
143
147
|
| `CASTARI_CLIENT_ID` | Your Castari client ID |
|
|
148
|
+
| `CASTARI_API_KEY` | Your Castari API key |
|
|
144
149
|
|
|
145
150
|
## License
|
|
146
151
|
|
package/dist/client.js
CHANGED
|
@@ -127,7 +127,7 @@ export class CastariClient {
|
|
|
127
127
|
if (!this.resolvedClientId) {
|
|
128
128
|
throw new Error('CASTARI_CLIENT_ID is required when connecting via the Castari Platform');
|
|
129
129
|
}
|
|
130
|
-
const platformUrl = this.options.platformUrl || process.env.CASTARI_PLATFORM_URL || DEFAULT_PLATFORM_URL;
|
|
130
|
+
const platformUrl = (this.options.platformUrl || process.env.CASTARI_PLATFORM_URL || DEFAULT_PLATFORM_URL).replace(/\/$/, '');
|
|
131
131
|
if (this.options.debug) {
|
|
132
132
|
console.log(`🚀 Requesting sandbox from ${platformUrl}...`);
|
|
133
133
|
}
|
|
@@ -191,7 +191,7 @@ export class CastariClient {
|
|
|
191
191
|
this.ws.close();
|
|
192
192
|
}
|
|
193
193
|
if (this.sandboxId) {
|
|
194
|
-
const platformUrl = this.options.platformUrl || process.env.CASTARI_PLATFORM_URL || DEFAULT_PLATFORM_URL;
|
|
194
|
+
const platformUrl = (this.options.platformUrl || process.env.CASTARI_PLATFORM_URL || DEFAULT_PLATFORM_URL).replace(/\/$/, '');
|
|
195
195
|
try {
|
|
196
196
|
const clientId = this.resolvedClientId || this.options.clientId || process.env.CASTARI_CLIENT_ID;
|
|
197
197
|
const apiKey = this.resolvedPlatformApiKey || this.options.platformApiKey || process.env.CASTARI_API_KEY;
|