@scalix-world/sdk 1.0.0 → 1.2.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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -159
  3. package/dist/client.d.ts +59 -18
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +86 -23
  6. package/dist/client.js.map +1 -1
  7. package/dist/config.d.ts +3 -4
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/config.js +1 -21
  10. package/dist/config.js.map +1 -1
  11. package/dist/errors.d.ts +22 -2
  12. package/dist/errors.d.ts.map +1 -1
  13. package/dist/errors.js +42 -4
  14. package/dist/errors.js.map +1 -1
  15. package/dist/index.d.ts +18 -10
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +16 -9
  18. package/dist/index.js.map +1 -1
  19. package/dist/services/account.d.ts +22 -10
  20. package/dist/services/account.d.ts.map +1 -1
  21. package/dist/services/account.js +7 -21
  22. package/dist/services/account.js.map +1 -1
  23. package/dist/services/audio.d.ts +16 -15
  24. package/dist/services/audio.d.ts.map +1 -1
  25. package/dist/services/audio.js +22 -9
  26. package/dist/services/audio.js.map +1 -1
  27. package/dist/services/auth.d.ts +80 -0
  28. package/dist/services/auth.d.ts.map +1 -0
  29. package/dist/services/auth.js +54 -0
  30. package/dist/services/auth.js.map +1 -0
  31. package/dist/services/base.d.ts +9 -2
  32. package/dist/services/base.d.ts.map +1 -1
  33. package/dist/services/base.js +153 -28
  34. package/dist/services/base.js.map +1 -1
  35. package/dist/services/compute.d.ts +36 -0
  36. package/dist/services/compute.d.ts.map +1 -0
  37. package/dist/services/compute.js +27 -0
  38. package/dist/services/compute.js.map +1 -0
  39. package/dist/services/cron.d.ts +22 -0
  40. package/dist/services/cron.d.ts.map +1 -0
  41. package/dist/services/cron.js +16 -0
  42. package/dist/services/cron.js.map +1 -0
  43. package/dist/services/database.d.ts +21 -232
  44. package/dist/services/database.d.ts.map +1 -1
  45. package/dist/services/database.js +10 -185
  46. package/dist/services/database.js.map +1 -1
  47. package/dist/services/docgen.d.ts +6 -0
  48. package/dist/services/docgen.d.ts.map +1 -1
  49. package/dist/services/docgen.js +11 -0
  50. package/dist/services/docgen.js.map +1 -1
  51. package/dist/services/domains.d.ts +23 -0
  52. package/dist/services/domains.d.ts.map +1 -0
  53. package/dist/services/domains.js +16 -0
  54. package/dist/services/domains.js.map +1 -0
  55. package/dist/services/embeddings.d.ts +24 -0
  56. package/dist/services/embeddings.d.ts.map +1 -0
  57. package/dist/services/embeddings.js +14 -0
  58. package/dist/services/embeddings.js.map +1 -0
  59. package/dist/services/events.d.ts +18 -0
  60. package/dist/services/events.d.ts.map +1 -0
  61. package/dist/services/events.js +18 -0
  62. package/dist/services/events.js.map +1 -0
  63. package/dist/services/functions.d.ts +36 -0
  64. package/dist/services/functions.d.ts.map +1 -0
  65. package/dist/services/functions.js +21 -0
  66. package/dist/services/functions.js.map +1 -0
  67. package/dist/services/images.d.ts +12 -22
  68. package/dist/services/images.d.ts.map +1 -1
  69. package/dist/services/images.js +14 -15
  70. package/dist/services/images.js.map +1 -1
  71. package/dist/services/index.d.ts +27 -6
  72. package/dist/services/index.d.ts.map +1 -1
  73. package/dist/services/index.js +11 -1
  74. package/dist/services/index.js.map +1 -1
  75. package/dist/services/kv.d.ts +14 -0
  76. package/dist/services/kv.d.ts.map +1 -0
  77. package/dist/services/kv.js +20 -0
  78. package/dist/services/kv.js.map +1 -0
  79. package/dist/services/models.d.ts +16 -0
  80. package/dist/services/models.d.ts.map +1 -0
  81. package/dist/services/models.js +12 -0
  82. package/dist/services/models.js.map +1 -0
  83. package/dist/services/rag.d.ts +1 -0
  84. package/dist/services/rag.d.ts.map +1 -1
  85. package/dist/services/rag.js +6 -0
  86. package/dist/services/rag.js.map +1 -1
  87. package/dist/services/realtime.d.ts +75 -0
  88. package/dist/services/realtime.d.ts.map +1 -0
  89. package/dist/services/realtime.js +297 -0
  90. package/dist/services/realtime.js.map +1 -0
  91. package/dist/services/research.js +4 -3
  92. package/dist/services/research.js.map +1 -1
  93. package/dist/services/run.d.ts +54 -0
  94. package/dist/services/run.d.ts.map +1 -0
  95. package/dist/services/run.js +44 -0
  96. package/dist/services/run.js.map +1 -0
  97. package/dist/services/search.d.ts +32 -0
  98. package/dist/services/search.d.ts.map +1 -0
  99. package/dist/services/search.js +25 -0
  100. package/dist/services/search.js.map +1 -0
  101. package/dist/services/shield.d.ts +48 -0
  102. package/dist/services/shield.d.ts.map +1 -0
  103. package/dist/services/shield.js +59 -0
  104. package/dist/services/shield.js.map +1 -0
  105. package/dist/services/text.d.ts +31 -0
  106. package/dist/services/text.d.ts.map +1 -1
  107. package/dist/services/text.js +15 -0
  108. package/dist/services/text.js.map +1 -1
  109. package/package.json +16 -6
  110. package/dist/services/chat.d.ts +0 -38
  111. package/dist/services/chat.d.ts.map +0 -1
  112. package/dist/services/chat.js +0 -53
  113. package/dist/services/chat.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Scalix World Private Limited
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,215 +1,137 @@
1
1
  # Scalix SDK — TypeScript
2
2
 
3
- TypeScript client for the Scalix API. Provides typed access to chat, research, audio, images, text, RAG, document generation, database, storage, and account management.
3
+ One SDK, one API key. `scalix.completions` gives you full OpenAI-compatible chat (tools, vision, streaming). The rest of the SDK gives you Audio, Images, Storage, Database, Functions, KV and more — plus Research, RAG, DocGen and Text service classes (see the wiring note under Platform Services).
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @scalix-world/sdk
8
+ npm install @scalix-world/sdk openai
9
9
  ```
10
10
 
11
11
  ## Quick Start
12
12
 
13
13
  ```typescript
14
- import { ScalixClient } from '@scalix-world/sdk';
14
+ import { Scalix } from '@scalix-world/sdk';
15
15
 
16
- const scalix = new ScalixClient({ apiKey: 'sk_scalix_...' });
16
+ const scalix = new Scalix('scalix_sk_...');
17
17
 
18
- // Chat completion (OpenAI-compatible)
19
- const reply = await scalix.chat.complete({
20
- model: 'scalix-world-ai',
18
+ // Chat completions — full OpenAI-compatible (tools, vision, streaming)
19
+ const response = await scalix.completions.create({
20
+ model: 'scalix-lumio-lite',
21
21
  messages: [{ role: 'user', content: 'Hello!' }],
22
22
  });
23
23
 
24
- // Streaming chat
25
- for await (const chunk of scalix.chat.stream({
26
- model: 'scalix-world-ai',
24
+ // Streaming
25
+ const stream = await scalix.completions.create({
26
+ model: 'scalix-lumio-lite',
27
27
  messages: [{ role: 'user', content: 'Tell me a story' }],
28
- })) {
29
- process.stdout.write(chunk);
28
+ stream: true,
29
+ });
30
+ for await (const chunk of stream) {
31
+ process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
30
32
  }
33
+ ```
34
+
35
+ ## Platform Services
31
36
 
32
- // Web search
33
- const results = await scalix.research.search('quantum computing');
37
+ These are Scalix-only services — no other SDK can reach them. The services wired
38
+ onto the `Scalix` client are listed below.
34
39
 
35
- // Audio transcription
40
+ ### Audio — transcription and text-to-speech
41
+
42
+ ```typescript
36
43
  const transcript = await scalix.audio.transcribe(audioBlob);
44
+ // speak() returns the raw audio Response — read .arrayBuffer()/.blob() yourself
45
+ const audio = await scalix.audio.speak('Hello world', { voice: 'alloy' });
46
+ ```
37
47
 
38
- // Text-to-speech
39
- const audio = await scalix.audio.speak('Hello world');
48
+ ### Images — OpenAI-compatible generation
40
49
 
41
- // Image generation
50
+ ```typescript
42
51
  const image = await scalix.images.generate('A sunset over mountains');
43
- const job = await scalix.images.generateAsync('A detailed cityscape');
52
+ // image.data[0].url (OpenAI-compatible response shape)
53
+ ```
44
54
 
45
- // Text utilities
46
- const sentiment = await scalix.text.sentiment('I love this product!');
47
- const summary = await scalix.text.summarize(longArticle);
48
- const translated = await scalix.text.translate('Hello', 'es');
55
+ ### Storage — presigned upload URLs
49
56
 
50
- // RAG — upload and query documents
51
- const doc = await scalix.rag.upload(pdfBlob, { filename: 'report.pdf' });
52
- const hits = await scalix.rag.query('revenue growth');
57
+ ```typescript
58
+ const { uploadUrl, fileUrl } = await scalix.storage.getUploadUrl('application/pdf');
59
+ ```
53
60
 
54
- // Document generation
55
- const report = await scalix.docgen.create({ prompt: 'Q1 report', format: 'pdf' });
61
+ ### Other wired services
56
62
 
57
- // ScalixDB
58
- const dbs = await scalix.database.list();
59
- const db = await scalix.database.create({ name: 'my-app-db' });
60
- const result = await scalix.database.query(db.database.id, 'SELECT * FROM users');
63
+ The client also exposes `scalix.database`, `scalix.functions`, `scalix.kv`,
64
+ `scalix.events`, `scalix.cron`, `scalix.compute`, `scalix.run`, `scalix.domains`,
65
+ `scalix.auth`, and `scalix.realtime`. See the typed methods in `src/services/`.
61
66
 
62
- // Storage — presigned upload URL
63
- const { uploadUrl } = await scalix.storage.getUploadUrl('application/pdf');
67
+ > **Note (service wiring gap):** `ResearchService`, `TextService`, `DocGenService`,
68
+ > `RAGService`, and `EmbeddingsService` are implemented and exported from the
69
+ > package, but are **not yet attached to the `Scalix` client** (no `scalix.research`,
70
+ > `scalix.text`, `scalix.docgen`, `scalix.rag`, `scalix.embeddings`). Until they are
71
+ > wired in `src/client.ts`, construct them directly, e.g.:
72
+ >
73
+ > ```typescript
74
+ > import { ResearchService } from '@scalix-world/sdk';
75
+ > const research = new ResearchService({ apiKey: 'scalix_sk_...', baseUrl: 'https://api.scalix.world' });
76
+ > const results = await research.search('quantum computing');
77
+ > ```
78
+ >
79
+ > The Python SDK wires all of these onto its client.
64
80
 
65
- // Account — manage API keys
66
- const keys = await scalix.account.listApiKeys();
67
- const newKey = await scalix.account.createApiKey({ name: 'production-key' });
81
+ ### Account — health, info, budget, usage
68
82
 
69
- // Usage tracking
70
- const usage = await scalix.account.usage({ startDate: '2026-04-01' });
83
+ ```typescript
84
+ const health = await scalix.account.health();
85
+ const info = await scalix.account.info(); // email, plan
86
+ const budget = await scalix.account.budget(); // credits remaining
87
+ const usage = await scalix.account.usage(); // usage stats
71
88
  ```
72
89
 
73
- ## Configuration
90
+ ### Models — list available models
74
91
 
75
92
  ```typescript
76
- import { ScalixClient } from '@scalix-world/sdk';
93
+ const models = await scalix.models.list();
94
+ // Each model includes: id, context_window, max_output_tokens, plan_required
95
+ ```
96
+
97
+ ## Configuration
77
98
 
78
- const scalix = new ScalixClient({
79
- apiKey: 'sk_scalix_...',
80
- baseUrl: 'https://api.scalix.world', // default
99
+ ```typescript
100
+ const scalix = new Scalix('scalix_sk_...', {
101
+ baseURL: 'https://api.scalix.world', // default
102
+ maxRetries: 2, // auto-retry with exponential backoff
103
+ timeout: 60000, // request timeout in ms
81
104
  });
82
105
  ```
83
106
 
84
- ### Environment Variables
85
-
86
- | Variable | Description |
87
- |----------|-------------|
88
- | `SCALIX_API_KEY` | Scalix API key |
89
- | `SCALIX_BASE_URL` | Override API base URL (default: `https://api.scalix.world`) |
90
-
91
- ## API Reference
92
-
93
- ### Chat
94
-
95
- | Method | Endpoint | SDK Method |
96
- |--------|----------|------------|
97
- | POST | `/v1/chat/completions` | `scalix.chat.complete(options)` |
98
- | POST | `/v1/chat/completions` | `scalix.chat.stream(options)` (streaming) |
99
- | GET | `/v1/models` | `scalix.chat.models()` |
100
-
101
- ### Research
102
-
103
- | Method | Endpoint | SDK Method |
104
- |--------|----------|------------|
105
- | POST | `/v1/research/search` | `scalix.research.search(query)` |
106
- | POST | `/v1/research` | `scalix.research.research(query)` |
107
- | POST | `/v1/research/deep` | `scalix.research.deep(query)` |
108
-
109
- ### Audio
110
-
111
- | Method | Endpoint | SDK Method |
112
- |--------|----------|------------|
113
- | POST | `/v1/audio/transcribe` | `scalix.audio.transcribe(file)` (multipart) |
114
- | POST | `/v1/audio/speak/kokoro` | `scalix.audio.speak(text)` |
115
- | GET | `/v1/audio/kokoro/voices` | `scalix.audio.voices()` |
116
- | GET | `/v1/audio/kokoro/languages` | `scalix.audio.languages()` |
117
-
118
- ### Images
119
-
120
- | Method | Endpoint | SDK Method |
121
- |--------|----------|------------|
122
- | POST | `/v1/images/generate` | `scalix.images.generate(prompt)` |
123
- | POST | `/v1/images/generate/queue` | `scalix.images.generateAsync(prompt)` |
124
- | GET | `/v1/images/jobs/{jobId}` | `scalix.images.getJob(jobId)` |
125
- | GET | `/v1/images/jobs/{jobId}/result` | `scalix.images.getJobResult(jobId)` |
126
- | GET | `/v1/images/models` | `scalix.images.models()` |
127
-
128
- ### Text
129
-
130
- | Method | Endpoint | SDK Method |
131
- |--------|----------|------------|
132
- | POST | `/v1/text/sentiment` | `scalix.text.sentiment(text)` |
133
- | POST | `/v1/text/summarize` | `scalix.text.summarize(text)` |
134
- | POST | `/v1/text/translate` | `scalix.text.translate(text, targetLang)` |
135
-
136
- ### RAG
137
-
138
- | Method | Endpoint | SDK Method |
139
- |--------|----------|------------|
140
- | POST | `/v1/rag/upload` | `scalix.rag.upload(file)` (multipart) |
141
- | POST | `/v1/rag/query` | `scalix.rag.query(query)` |
142
- | GET | `/v1/rag/documents` | `scalix.rag.documents()` |
143
- | DELETE | `/v1/rag/documents/{docId}` | `scalix.rag.deleteDocument(docId)` |
144
-
145
- ### Document Generation
146
-
147
- | Method | Endpoint | SDK Method |
148
- |--------|----------|------------|
149
- | POST | `/v1/docgen/create` | `scalix.docgen.create(options)` |
150
- | POST | `/v1/docgen/preview` | `scalix.docgen.preview(options)` |
151
- | GET | `/v1/docgen/formats` | `scalix.docgen.formats()` |
152
- | GET | `/v1/docgen/templates` | `scalix.docgen.templates()` |
153
- | GET | `/v1/docgen/history` | `scalix.docgen.history()` |
154
- | POST | `/v1/docgen/revise` | `scalix.docgen.revise(docId, prompt)` |
155
- | GET | `/v1/docgen/versions/{docId}` | `scalix.docgen.versions(docId)` |
156
-
157
- ### Storage
158
-
159
- | Method | Endpoint | SDK Method |
160
- |--------|----------|------------|
161
- | POST | `/v1/storage/upload-url` | `scalix.storage.getUploadUrl(mimeType)` |
162
-
163
- ### ScalixDB
164
-
165
- | Method | Endpoint | SDK Method |
166
- |--------|----------|------------|
167
- | GET | `/api/scalixdb/databases` | `scalix.database.list()` |
168
- | POST | `/api/scalixdb/databases` | `scalix.database.create(options)` |
169
- | GET | `/api/scalixdb/databases/{id}` | `scalix.database.get(id)` |
170
- | DELETE | `/api/scalixdb/databases/{id}` | `scalix.database.delete(id)` |
171
- | POST | `/api/scalixdb/databases/{id}/query` | `scalix.database.query(id, sql)` |
172
- | GET | `/api/scalixdb/databases/{id}/tables` | `scalix.database.listTables(id)` |
173
- | GET | `/api/scalixdb/databases/{id}/metrics` | `scalix.database.getMetrics(id)` |
174
-
175
- ### Account
176
-
177
- | Method | Endpoint | SDK Method |
178
- |--------|----------|------------|
179
- | GET | `/health` | `scalix.account.health()` |
180
- | GET | `/api/dashboard/api-keys` | `scalix.account.listApiKeys()` |
181
- | POST | `/api/dashboard/api-keys` | `scalix.account.createApiKey({ name })` |
182
- | DELETE | `/api/dashboard/api-keys/{id}` | `scalix.account.deleteApiKey(keyId)` |
183
- | GET | `/api/billing/usage` | `scalix.account.usage()` |
107
+ ## Available Models
108
+
109
+ | Model | Description | Availability |
110
+ |-------|-------------|--------------|
111
+ | `scalix-lumio-lite` | Fastest, lightest tier — the default model | Available |
112
+ | `scalix-lumio-pro` | Balanced quality for general use and production apps | Coming soon |
113
+ | `scalix-candela` | Most capable — deep reasoning and complex agents | Coming soon |
114
+
115
+ `scalix-lumio-lite` is generally available and is the default — calls that omit `model` use it. `scalix-lumio-pro` and `scalix-candela` are announced and coming soon (not callable yet). Run `scalix.models.list()` to see the models enabled for your plan.
184
116
 
185
117
  ## Error Handling
186
118
 
187
119
  ```typescript
188
- import { ScalixClient, ScalixError, AuthenticationError } from '@scalix-world/sdk';
189
-
190
- const scalix = new ScalixClient({ apiKey: 'sk_scalix_...' });
120
+ import { Scalix, ScalixError, AuthenticationError, RateLimitError } from '@scalix-world/sdk';
191
121
 
192
122
  try {
193
- const result = await scalix.chat.complete({
194
- model: 'scalix-world-ai',
195
- messages: [{ role: 'user', content: 'Hello!' }],
196
- });
123
+ await scalix.account.info();
197
124
  } catch (error) {
198
125
  if (error instanceof AuthenticationError) {
199
126
  console.error('Invalid API key');
127
+ } else if (error instanceof RateLimitError) {
128
+ console.error('Rate limited — SDK retries automatically');
200
129
  } else if (error instanceof ScalixError) {
201
130
  console.error('API error:', error.message);
202
131
  }
203
132
  }
204
133
  ```
205
134
 
206
- ## Available Models
207
-
208
- | Model | Description | Best For |
209
- |-------|-------------|----------|
210
- | `scalix-world-ai` | Default model — fast, balanced | General use, chat, quick tasks |
211
- | `scalix-advanced` | Most capable model — deep reasoning | Complex analysis, coding, agents |
212
-
213
135
  ## License
214
136
 
215
- See [LICENSE](../../LICENSE) for details.
137
+ MIT — see [LICENSE](./LICENSE) for details.
package/dist/client.d.ts CHANGED
@@ -1,41 +1,82 @@
1
1
  /**
2
- * ScalixClient — unified access to all Scalix API services.
2
+ * Scalix — the official client for Scalix Cloud.
3
+ *
4
+ * Chat completions delegate to the OpenAI SDK (Scalix's AI API is OpenAI-compatible).
5
+ * Platform services (database, functions, storage, KV, etc.) use a native HTTP client.
3
6
  *
4
7
  * @example
5
8
  * ```typescript
6
- * import { ScalixClient } from '@scalix-world/sdk';
9
+ * import { Scalix } from '@scalix-world/sdk';
10
+ *
11
+ * const scalix = new Scalix('scalix_sk_...');
7
12
  *
8
- * const scalix = new ScalixClient({ apiKey: 'sk_scalix_...' });
9
- * const reply = await scalix.chat.complete({
10
- * model: 'scalix-world-ai',
13
+ * // Chat — full OpenAI-compatible (tools, vision, streaming)
14
+ * const response = await scalix.completions.create({
15
+ * model: 'scalix-lumio-lite',
11
16
  * messages: [{ role: 'user', content: 'Hello!' }],
12
17
  * });
18
+ *
19
+ * // Platform services
20
+ * const result = await scalix.database.query('select 1');
13
21
  * ```
14
22
  */
15
- import { type ScalixConfig } from './config.js';
23
+ import OpenAI from 'openai';
16
24
  import { AccountService } from './services/account.js';
17
25
  import { AudioService } from './services/audio.js';
18
- import { ChatService } from './services/chat.js';
26
+ import { AuthService } from './services/auth.js';
27
+ import { ComputeService } from './services/compute.js';
28
+ import { CronService } from './services/cron.js';
19
29
  import { DatabaseService } from './services/database.js';
20
- import { DocGenService } from './services/docgen.js';
30
+ import { DomainsService } from './services/domains.js';
31
+ import { EventsService } from './services/events.js';
32
+ import { FunctionsService } from './services/functions.js';
21
33
  import { ImagesService } from './services/images.js';
22
- import { RAGService } from './services/rag.js';
23
- import { ResearchService } from './services/research.js';
34
+ import { KvService } from './services/kv.js';
35
+ import { ModelsService } from './services/models.js';
24
36
  import { StorageService } from './services/storage.js';
37
+ import { RealtimeService } from './services/realtime.js';
38
+ import { RunService } from './services/run.js';
39
+ import { ResearchService } from './services/research.js';
40
+ import { RAGService } from './services/rag.js';
41
+ import { DocGenService } from './services/docgen.js';
25
42
  import { TextService } from './services/text.js';
26
- export declare class ScalixClient {
43
+ import { EmbeddingsService } from './services/embeddings.js';
44
+ import { SearchService } from './services/search.js';
45
+ import { ShieldService } from './services/shield.js';
46
+ export interface ScalixOptions {
47
+ baseURL?: string;
48
+ maxRetries?: number;
49
+ timeout?: number;
50
+ }
51
+ export declare class Scalix {
52
+ /** OpenAI-compatible chat completions — full tool calling, vision, streaming */
53
+ readonly completions: OpenAI['chat']['completions'];
54
+ /** Pre-configured OpenAI client for advanced usage (embeddings, raw access, etc.) */
55
+ readonly openai: OpenAI;
27
56
  readonly account: AccountService;
28
57
  readonly audio: AudioService;
29
- readonly chat: ChatService;
58
+ readonly auth: AuthService;
59
+ readonly compute: ComputeService;
60
+ readonly cron: CronService;
30
61
  readonly database: DatabaseService;
31
- readonly docgen: DocGenService;
62
+ readonly domains: DomainsService;
63
+ readonly events: EventsService;
64
+ readonly functions: FunctionsService;
32
65
  readonly images: ImagesService;
33
- readonly rag: RAGService;
34
- readonly research: ResearchService;
66
+ readonly kv: KvService;
67
+ readonly models: ModelsService;
35
68
  readonly storage: StorageService;
69
+ readonly realtime: RealtimeService;
70
+ readonly run: RunService;
71
+ readonly research: ResearchService;
72
+ readonly rag: RAGService;
73
+ readonly docgen: DocGenService;
36
74
  readonly text: TextService;
37
- constructor(options?: {
38
- apiKey?: string;
39
- } & Partial<ScalixConfig>);
75
+ readonly embeddings: EmbeddingsService;
76
+ readonly search: SearchService;
77
+ readonly shield: ShieldService;
78
+ constructor(apiKey?: string, options?: ScalixOptions);
40
79
  }
80
+ /** @deprecated Use `Scalix` instead */
81
+ export declare const ScalixClient: typeof Scalix;
41
82
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,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alix — the official client for Scalix Cloud.
3
+ *
4
+ * Chat completions delegate to the OpenAI SDK (Scalix's AI API is OpenAI-compatible).
5
+ * Platform services (database, functions, storage, KV, etc.) use a native HTTP client.
3
6
  *
4
7
  * @example
5
8
  * ```typescript
6
- * import { ScalixClient } from '@scalix-world/sdk';
9
+ * import { Scalix } from '@scalix-world/sdk';
10
+ *
11
+ * const scalix = new Scalix('scalix_sk_...');
7
12
  *
8
- * const scalix = new ScalixClient({ apiKey: 'sk_scalix_...' });
9
- * const reply = await scalix.chat.complete({
10
- * model: 'scalix-world-ai',
13
+ * // Chat — full OpenAI-compatible (tools, vision, streaming)
14
+ * const response = await scalix.completions.create({
15
+ * model: 'scalix-lumio-lite',
11
16
  * messages: [{ role: 'user', content: 'Hello!' }],
12
17
  * });
18
+ *
19
+ * // Platform services
20
+ * const result = await scalix.database.query('select 1');
13
21
  * ```
14
22
  */
15
- import { configure, getConfig } from './config.js';
23
+ import OpenAI from 'openai';
16
24
  import { AccountService } from './services/account.js';
17
25
  import { AudioService } from './services/audio.js';
18
- import { ChatService } from './services/chat.js';
26
+ import { AuthService } from './services/auth.js';
27
+ import { ComputeService } from './services/compute.js';
28
+ import { CronService } from './services/cron.js';
19
29
  import { DatabaseService } from './services/database.js';
20
- import { DocGenService } from './services/docgen.js';
30
+ import { DomainsService } from './services/domains.js';
31
+ import { EventsService } from './services/events.js';
32
+ import { FunctionsService } from './services/functions.js';
21
33
  import { ImagesService } from './services/images.js';
22
- import { RAGService } from './services/rag.js';
23
- import { ResearchService } from './services/research.js';
34
+ import { KvService } from './services/kv.js';
35
+ import { ModelsService } from './services/models.js';
24
36
  import { StorageService } from './services/storage.js';
37
+ import { RealtimeService } from './services/realtime.js';
38
+ import { RunService } from './services/run.js';
39
+ import { ResearchService } from './services/research.js';
40
+ import { RAGService } from './services/rag.js';
41
+ import { DocGenService } from './services/docgen.js';
25
42
  import { TextService } from './services/text.js';
26
- export class ScalixClient {
43
+ import { EmbeddingsService } from './services/embeddings.js';
44
+ import { SearchService } from './services/search.js';
45
+ import { ShieldService } from './services/shield.js';
46
+ export class Scalix {
47
+ /** OpenAI-compatible chat completions — full tool calling, vision, streaming */
48
+ completions;
49
+ /** Pre-configured OpenAI client for advanced usage (embeddings, raw access, etc.) */
50
+ openai;
27
51
  account;
28
52
  audio;
29
- chat;
53
+ auth;
54
+ compute;
55
+ cron;
30
56
  database;
31
- docgen;
57
+ domains;
58
+ events;
59
+ functions;
32
60
  images;
33
- rag;
34
- research;
61
+ kv;
62
+ models;
35
63
  storage;
64
+ realtime;
65
+ run;
66
+ research;
67
+ rag;
68
+ docgen;
36
69
  text;
37
- constructor(options) {
38
- if (options) {
39
- configure(options);
70
+ embeddings;
71
+ search;
72
+ shield;
73
+ constructor(apiKey, options) {
74
+ const resolvedKey = apiKey ?? process.env.SCALIX_API_KEY ?? process.env.SCALIX_TOKEN;
75
+ if (!resolvedKey) {
76
+ throw new Error('No API key provided. Pass apiKey or set SCALIX_API_KEY / SCALIX_TOKEN env var, ' +
77
+ 'or run `scalix login` to save credentials.');
40
78
  }
41
- const config = getConfig();
79
+ // Host root (e.g. https://api.scalix.world). Native services call full
80
+ // paths like /v1/user/info and /api/v1/sql, so config.baseUrl must be the
81
+ // bare host. The OpenAI-compatible AI surface is served under /v1/ai.
82
+ const base = (options?.baseURL ?? 'https://api.scalix.world').replace(/\/+$/, '');
83
+ const baseUrl = base.replace(/\/v1(\/ai)?$/, '');
84
+ const config = { apiKey: resolvedKey, baseUrl, maxRetries: options?.maxRetries, timeout: options?.timeout };
85
+ this.openai = new OpenAI({
86
+ baseURL: `${baseUrl}/v1/ai`,
87
+ apiKey: resolvedKey,
88
+ defaultHeaders: { 'User-Agent': 'Scalix-SDK/2.0' },
89
+ });
90
+ this.completions = this.openai.chat.completions;
42
91
  this.account = new AccountService(config);
43
92
  this.audio = new AudioService(config);
44
- this.chat = new ChatService(config);
93
+ this.auth = new AuthService(config);
94
+ this.compute = new ComputeService(config);
95
+ this.cron = new CronService(config);
45
96
  this.database = new DatabaseService(config);
46
- this.docgen = new DocGenService(config);
97
+ this.domains = new DomainsService(config);
98
+ this.events = new EventsService(config);
99
+ this.functions = new FunctionsService(config);
47
100
  this.images = new ImagesService(config);
48
- this.rag = new RAGService(config);
49
- this.research = new ResearchService(config);
101
+ this.kv = new KvService(config);
102
+ this.models = new ModelsService(config);
50
103
  this.storage = new StorageService(config);
104
+ this.realtime = new RealtimeService(config);
105
+ this.run = new RunService(config);
106
+ this.research = new ResearchService(config);
107
+ this.rag = new RAGService(config);
108
+ this.docgen = new DocGenService(config);
51
109
  this.text = new TextService(config);
110
+ this.embeddings = new EmbeddingsService(config);
111
+ this.search = new SearchService(config);
112
+ this.shield = new ShieldService(config);
52
113
  }
53
114
  }
115
+ /** @deprecated Use `Scalix` instead */
116
+ export const ScalixClient = Scalix;
54
117
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO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,IAAI,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF;AAED,uCAAuC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC"}
package/dist/config.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  export interface ScalixConfig {
2
- apiKey?: string;
2
+ apiKey: string;
3
3
  baseUrl: string;
4
- defaultModel: string;
4
+ maxRetries?: number;
5
+ timeout?: number;
5
6
  }
6
- export declare function configure(options: Partial<ScalixConfig>): ScalixConfig;
7
- export declare function getConfig(): ScalixConfig;
8
7
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AASD,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAStE;AAED,wBAAgB,SAAS,IAAI,YAAY,CAKxC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
package/dist/config.js CHANGED
@@ -1,22 +1,2 @@
1
- const DEFAULT_CONFIG = {
2
- baseUrl: 'https://api.scalix.world',
3
- defaultModel: 'scalix-world-ai',
4
- };
5
- let _config = null;
6
- export function configure(options) {
7
- const env = typeof process !== 'undefined' ? process.env : {};
8
- _config = {
9
- ...DEFAULT_CONFIG,
10
- ...(env.SCALIX_API_KEY && { apiKey: env.SCALIX_API_KEY }),
11
- ...(env.SCALIX_BASE_URL && { baseUrl: env.SCALIX_BASE_URL }),
12
- ...options,
13
- };
14
- return _config;
15
- }
16
- export function getConfig() {
17
- if (!_config) {
18
- _config = configure({});
19
- }
20
- return _config;
21
- }
1
+ export {};
22
2
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAMA,MAAM,cAAc,GAAiB;IACnC,OAAO,EAAE,0BAA0B;IACnC,YAAY,EAAE,iBAAiB;CAChC,CAAC;AAEF,IAAI,OAAO,GAAwB,IAAI,CAAC;AAExC,MAAM,UAAU,SAAS,CAAC,OAA8B;IACtD,MAAM,GAAG,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,OAAO,GAAG;QACR,GAAG,cAAc;QACjB,GAAG,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC;QACzD,GAAG,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC;QAC5D,GAAG,OAAO;KACX,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":""}