@scalix-world/sdk 1.1.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 (90) hide show
  1. package/README.md +39 -57
  2. package/dist/client.d.ts +39 -13
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +67 -21
  5. package/dist/client.js.map +1 -1
  6. package/dist/index.d.ts +4 -4
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -3
  9. package/dist/index.js.map +1 -1
  10. package/dist/services/account.js +1 -1
  11. package/dist/services/account.js.map +1 -1
  12. package/dist/services/audio.d.ts +16 -15
  13. package/dist/services/audio.d.ts.map +1 -1
  14. package/dist/services/audio.js +22 -14
  15. package/dist/services/audio.js.map +1 -1
  16. package/dist/services/auth.d.ts +80 -0
  17. package/dist/services/auth.d.ts.map +1 -0
  18. package/dist/services/auth.js +54 -0
  19. package/dist/services/auth.js.map +1 -0
  20. package/dist/services/base.d.ts +5 -0
  21. package/dist/services/base.d.ts.map +1 -1
  22. package/dist/services/base.js +24 -1
  23. package/dist/services/base.js.map +1 -1
  24. package/dist/services/compute.d.ts +36 -0
  25. package/dist/services/compute.d.ts.map +1 -0
  26. package/dist/services/compute.js +27 -0
  27. package/dist/services/compute.js.map +1 -0
  28. package/dist/services/cron.d.ts +22 -0
  29. package/dist/services/cron.d.ts.map +1 -0
  30. package/dist/services/cron.js +16 -0
  31. package/dist/services/cron.js.map +1 -0
  32. package/dist/services/database.d.ts +34 -0
  33. package/dist/services/database.d.ts.map +1 -0
  34. package/dist/services/database.js +20 -0
  35. package/dist/services/database.js.map +1 -0
  36. package/dist/services/docgen.d.ts +1 -0
  37. package/dist/services/docgen.d.ts.map +1 -1
  38. package/dist/services/docgen.js +6 -0
  39. package/dist/services/docgen.js.map +1 -1
  40. package/dist/services/domains.d.ts +23 -0
  41. package/dist/services/domains.d.ts.map +1 -0
  42. package/dist/services/domains.js +16 -0
  43. package/dist/services/domains.js.map +1 -0
  44. package/dist/services/embeddings.d.ts +24 -0
  45. package/dist/services/embeddings.d.ts.map +1 -0
  46. package/dist/services/embeddings.js +14 -0
  47. package/dist/services/embeddings.js.map +1 -0
  48. package/dist/services/events.d.ts +18 -0
  49. package/dist/services/events.d.ts.map +1 -0
  50. package/dist/services/events.js +18 -0
  51. package/dist/services/events.js.map +1 -0
  52. package/dist/services/functions.d.ts +36 -0
  53. package/dist/services/functions.d.ts.map +1 -0
  54. package/dist/services/functions.js +21 -0
  55. package/dist/services/functions.js.map +1 -0
  56. package/dist/services/images.d.ts +12 -22
  57. package/dist/services/images.d.ts.map +1 -1
  58. package/dist/services/images.js +14 -15
  59. package/dist/services/images.js.map +1 -1
  60. package/dist/services/index.d.ts +24 -2
  61. package/dist/services/index.d.ts.map +1 -1
  62. package/dist/services/index.js +11 -0
  63. package/dist/services/index.js.map +1 -1
  64. package/dist/services/kv.d.ts +14 -0
  65. package/dist/services/kv.d.ts.map +1 -0
  66. package/dist/services/kv.js +20 -0
  67. package/dist/services/kv.js.map +1 -0
  68. package/dist/services/models.js +1 -1
  69. package/dist/services/models.js.map +1 -1
  70. package/dist/services/rag.d.ts +1 -0
  71. package/dist/services/rag.d.ts.map +1 -1
  72. package/dist/services/rag.js +6 -0
  73. package/dist/services/rag.js.map +1 -1
  74. package/dist/services/realtime.d.ts +75 -0
  75. package/dist/services/realtime.d.ts.map +1 -0
  76. package/dist/services/realtime.js +297 -0
  77. package/dist/services/realtime.js.map +1 -0
  78. package/dist/services/run.d.ts +54 -0
  79. package/dist/services/run.d.ts.map +1 -0
  80. package/dist/services/run.js +44 -0
  81. package/dist/services/run.js.map +1 -0
  82. package/dist/services/search.d.ts +32 -0
  83. package/dist/services/search.d.ts.map +1 -0
  84. package/dist/services/search.js +25 -0
  85. package/dist/services/search.js.map +1 -0
  86. package/dist/services/shield.d.ts +48 -0
  87. package/dist/services/shield.d.ts.map +1 -0
  88. package/dist/services/shield.js +59 -0
  89. package/dist/services/shield.js.map +1 -0
  90. package/package.json +12 -6
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Scalix SDK — TypeScript
2
2
 
3
- One SDK, one API key. `scalix.completions` gives you full OpenAI-compatible chat (tools, vision, streaming). The rest of the SDK gives you Research, RAG, DocGen, Audio, Images, Text — services that only Scalix has.
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
 
@@ -13,17 +13,17 @@ npm install @scalix-world/sdk openai
13
13
  ```typescript
14
14
  import { Scalix } from '@scalix-world/sdk';
15
15
 
16
- const scalix = new Scalix('sk_scalix_...');
16
+ const scalix = new Scalix('scalix_sk_...');
17
17
 
18
18
  // Chat completions — full OpenAI-compatible (tools, vision, streaming)
19
19
  const response = await scalix.completions.create({
20
- model: 'scalix-world-ai',
20
+ model: 'scalix-lumio-lite',
21
21
  messages: [{ role: 'user', content: 'Hello!' }],
22
22
  });
23
23
 
24
24
  // Streaming
25
25
  const stream = await scalix.completions.create({
26
- model: 'scalix-world-ai',
26
+ model: 'scalix-lumio-lite',
27
27
  messages: [{ role: 'user', content: 'Tell me a story' }],
28
28
  stream: true,
29
29
  });
@@ -34,69 +34,50 @@ for await (const chunk of stream) {
34
34
 
35
35
  ## Platform Services
36
36
 
37
- These are Scalix-only services — no other SDK can reach them.
38
-
39
- ### Research — web search and deep research
40
-
41
- ```typescript
42
- const results = await scalix.research.search('quantum computing');
43
- const report = await scalix.research.deep('AI trends 2026');
44
- const answer = await scalix.research.research('What is GraphQL?');
45
- ```
46
-
47
- ### Text — sentiment, summarization, translation, grammar, autocomplete
48
-
49
- ```typescript
50
- const sentiment = await scalix.text.sentiment('I love this product!');
51
- const summary = await scalix.text.summarize(longArticle);
52
- const translated = await scalix.text.translate('Hello', 'es');
53
- const grammar = await scalix.text.grammar('Me and him goes to store');
54
- const completion = await scalix.text.autocomplete('The quick brown');
55
- ```
37
+ These are Scalix-only services — no other SDK can reach them. The services wired
38
+ onto the `Scalix` client are listed below.
56
39
 
57
40
  ### Audio — transcription and text-to-speech
58
41
 
59
42
  ```typescript
60
43
  const transcript = await scalix.audio.transcribe(audioBlob);
61
- const audio = await scalix.audio.speak('Hello world', { voice: 'af_heart' });
62
- const voices = await scalix.audio.voices();
63
- const languages = await scalix.audio.languages();
44
+ // speak() returns the raw audio Response — read .arrayBuffer()/.blob() yourself
45
+ const audio = await scalix.audio.speak('Hello world', { voice: 'alloy' });
64
46
  ```
65
47
 
66
- ### Images — generation with sync and async modes
48
+ ### Images — OpenAI-compatible generation
67
49
 
68
50
  ```typescript
69
51
  const image = await scalix.images.generate('A sunset over mountains');
70
- const job = await scalix.images.generateAsync('A detailed cityscape');
71
- const status = await scalix.images.getJob(job.job_id);
72
- const models = await scalix.images.models();
73
- ```
74
-
75
- ### Document Generation — PDF, DOCX, CSV, XLSX
76
-
77
- ```typescript
78
- const doc = await scalix.docgen.create({ prompt: 'Q1 report', format: 'pdf' });
79
- const history = await scalix.docgen.history();
80
- const formats = await scalix.docgen.formats();
81
- const templates = await scalix.docgen.templates();
82
- await scalix.docgen.share(doc.doc_id, 'colleague@company.com');
83
- ```
84
-
85
- ### RAG — upload and query documents
86
-
87
- ```typescript
88
- const doc = await scalix.rag.upload(pdfBlob, { filename: 'report.pdf' });
89
- const answer = await scalix.rag.query('revenue growth');
90
- const docs = await scalix.rag.documents();
91
- await scalix.rag.deleteDocument(docId);
52
+ // image.data[0].url (OpenAI-compatible response shape)
92
53
  ```
93
54
 
94
55
  ### Storage — presigned upload URLs
95
56
 
96
57
  ```typescript
97
- const { uploadUrl } = await scalix.storage.getUploadUrl('application/pdf');
58
+ const { uploadUrl, fileUrl } = await scalix.storage.getUploadUrl('application/pdf');
98
59
  ```
99
60
 
61
+ ### Other wired services
62
+
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/`.
66
+
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.
80
+
100
81
  ### Account — health, info, budget, usage
101
82
 
102
83
  ```typescript
@@ -116,7 +97,7 @@ const models = await scalix.models.list();
116
97
  ## Configuration
117
98
 
118
99
  ```typescript
119
- const scalix = new Scalix('sk_scalix_...', {
100
+ const scalix = new Scalix('scalix_sk_...', {
120
101
  baseURL: 'https://api.scalix.world', // default
121
102
  maxRetries: 2, // auto-retry with exponential backoff
122
103
  timeout: 60000, // request timeout in ms
@@ -125,12 +106,13 @@ const scalix = new Scalix('sk_scalix_...', {
125
106
 
126
107
  ## Available Models
127
108
 
128
- | Model | Description | Best For |
129
- |-------|-------------|----------|
130
- | `scalix-world-ai` | Default model — fast, balanced | General use, chat, quick tasks |
131
- | `scalix-world-advanced` | Most capable — deep reasoning | Complex analysis, coding, agents |
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 |
132
114
 
133
- Plus 12 more models — run `scalix.models.list()` to see all available for your plan.
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.
134
116
 
135
117
  ## Error Handling
136
118
 
@@ -138,7 +120,7 @@ Plus 12 more models — run `scalix.models.list()` to see all available for your
138
120
  import { Scalix, ScalixError, AuthenticationError, RateLimitError } from '@scalix-world/sdk';
139
121
 
140
122
  try {
141
- await scalix.research.search('...');
123
+ await scalix.account.info();
142
124
  } catch (error) {
143
125
  if (error instanceof AuthenticationError) {
144
126
  console.error('Invalid API key');
package/dist/client.d.ts CHANGED
@@ -1,35 +1,48 @@
1
1
  /**
2
- * Scalix — unified client for the Scalix platform.
2
+ * Scalix — the official client for Scalix Cloud.
3
3
  *
4
- * Chat completions delegate to the OpenAI SDK (Scalix's API is OpenAI-compatible).
5
- * Platform services (research, RAG, database, etc.) use a native HTTP client.
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.
6
6
  *
7
7
  * @example
8
8
  * ```typescript
9
9
  * import { Scalix } from '@scalix-world/sdk';
10
10
  *
11
- * const scalix = new Scalix('sk_scalix_...');
11
+ * const scalix = new Scalix('scalix_sk_...');
12
12
  *
13
13
  * // Chat — full OpenAI-compatible (tools, vision, streaming)
14
14
  * const response = await scalix.completions.create({
15
- * model: 'scalix-world-ai',
15
+ * model: 'scalix-lumio-lite',
16
16
  * messages: [{ role: 'user', content: 'Hello!' }],
17
17
  * });
18
18
  *
19
19
  * // Platform services
20
- * const results = await scalix.research.search('AI trends');
20
+ * const result = await scalix.database.query('select 1');
21
21
  * ```
22
22
  */
23
23
  import OpenAI from 'openai';
24
24
  import { AccountService } from './services/account.js';
25
25
  import { AudioService } from './services/audio.js';
26
- import { DocGenService } from './services/docgen.js';
26
+ import { AuthService } from './services/auth.js';
27
+ import { ComputeService } from './services/compute.js';
28
+ import { CronService } from './services/cron.js';
29
+ import { DatabaseService } from './services/database.js';
30
+ import { DomainsService } from './services/domains.js';
31
+ import { EventsService } from './services/events.js';
32
+ import { FunctionsService } from './services/functions.js';
27
33
  import { ImagesService } from './services/images.js';
34
+ import { KvService } from './services/kv.js';
28
35
  import { ModelsService } from './services/models.js';
29
- import { RAGService } from './services/rag.js';
30
- import { ResearchService } from './services/research.js';
31
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';
32
42
  import { TextService } from './services/text.js';
43
+ import { EmbeddingsService } from './services/embeddings.js';
44
+ import { SearchService } from './services/search.js';
45
+ import { ShieldService } from './services/shield.js';
33
46
  export interface ScalixOptions {
34
47
  baseURL?: string;
35
48
  maxRetries?: number;
@@ -42,14 +55,27 @@ export declare class Scalix {
42
55
  readonly openai: OpenAI;
43
56
  readonly account: AccountService;
44
57
  readonly audio: AudioService;
45
- readonly docgen: DocGenService;
58
+ readonly auth: AuthService;
59
+ readonly compute: ComputeService;
60
+ readonly cron: CronService;
61
+ readonly database: DatabaseService;
62
+ readonly domains: DomainsService;
63
+ readonly events: EventsService;
64
+ readonly functions: FunctionsService;
46
65
  readonly images: ImagesService;
66
+ readonly kv: KvService;
47
67
  readonly models: ModelsService;
48
- readonly rag: RAGService;
49
- readonly research: ResearchService;
50
68
  readonly storage: StorageService;
69
+ readonly realtime: RealtimeService;
70
+ readonly run: RunService;
71
+ readonly research: ResearchService;
72
+ readonly rag: RAGService;
73
+ readonly docgen: DocGenService;
51
74
  readonly text: TextService;
52
- constructor(apiKey: string, options?: ScalixOptions);
75
+ readonly embeddings: EmbeddingsService;
76
+ readonly search: SearchService;
77
+ readonly shield: ShieldService;
78
+ constructor(apiKey?: string, options?: ScalixOptions);
53
79
  }
54
80
  /** @deprecated Use `Scalix` instead */
55
81
  export declare const ScalixClient: typeof Scalix;
@@ -1 +1 @@
1
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IACnC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;gBAEnB,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;CA+CrD;AAED,uCAAuC;AACvC,eAAO,MAAM,YAAY,eAAS,CAAC"}
package/dist/client.js CHANGED
@@ -1,35 +1,48 @@
1
1
  /**
2
- * Scalix — unified client for the Scalix platform.
2
+ * Scalix — the official client for Scalix Cloud.
3
3
  *
4
- * Chat completions delegate to the OpenAI SDK (Scalix's API is OpenAI-compatible).
5
- * Platform services (research, RAG, database, etc.) use a native HTTP client.
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.
6
6
  *
7
7
  * @example
8
8
  * ```typescript
9
9
  * import { Scalix } from '@scalix-world/sdk';
10
10
  *
11
- * const scalix = new Scalix('sk_scalix_...');
11
+ * const scalix = new Scalix('scalix_sk_...');
12
12
  *
13
13
  * // Chat — full OpenAI-compatible (tools, vision, streaming)
14
14
  * const response = await scalix.completions.create({
15
- * model: 'scalix-world-ai',
15
+ * model: 'scalix-lumio-lite',
16
16
  * messages: [{ role: 'user', content: 'Hello!' }],
17
17
  * });
18
18
  *
19
19
  * // Platform services
20
- * const results = await scalix.research.search('AI trends');
20
+ * const result = await scalix.database.query('select 1');
21
21
  * ```
22
22
  */
23
23
  import OpenAI from 'openai';
24
24
  import { AccountService } from './services/account.js';
25
25
  import { AudioService } from './services/audio.js';
26
- import { DocGenService } from './services/docgen.js';
26
+ import { AuthService } from './services/auth.js';
27
+ import { ComputeService } from './services/compute.js';
28
+ import { CronService } from './services/cron.js';
29
+ import { DatabaseService } from './services/database.js';
30
+ import { DomainsService } from './services/domains.js';
31
+ import { EventsService } from './services/events.js';
32
+ import { FunctionsService } from './services/functions.js';
27
33
  import { ImagesService } from './services/images.js';
34
+ import { KvService } from './services/kv.js';
28
35
  import { ModelsService } from './services/models.js';
29
- import { RAGService } from './services/rag.js';
30
- import { ResearchService } from './services/research.js';
31
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';
32
42
  import { TextService } from './services/text.js';
43
+ import { EmbeddingsService } from './services/embeddings.js';
44
+ import { SearchService } from './services/search.js';
45
+ import { ShieldService } from './services/shield.js';
33
46
  export class Scalix {
34
47
  /** OpenAI-compatible chat completions — full tool calling, vision, streaming */
35
48
  completions;
@@ -37,33 +50,66 @@ export class Scalix {
37
50
  openai;
38
51
  account;
39
52
  audio;
40
- docgen;
53
+ auth;
54
+ compute;
55
+ cron;
56
+ database;
57
+ domains;
58
+ events;
59
+ functions;
41
60
  images;
61
+ kv;
42
62
  models;
43
- rag;
44
- research;
45
63
  storage;
64
+ realtime;
65
+ run;
66
+ research;
67
+ rag;
68
+ docgen;
46
69
  text;
70
+ embeddings;
71
+ search;
72
+ shield;
47
73
  constructor(apiKey, options) {
48
- const base = options?.baseURL ?? 'https://api.scalix.world';
49
- const baseURL = base.endsWith('/v1') ? base : `${base}/v1`;
50
- const baseUrl = baseURL.replace(/\/v1$/, '');
51
- const config = { apiKey, baseUrl, maxRetries: options?.maxRetries, timeout: options?.timeout };
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.');
78
+ }
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 };
52
85
  this.openai = new OpenAI({
53
- baseURL,
54
- apiKey,
86
+ baseURL: `${baseUrl}/v1/ai`,
87
+ apiKey: resolvedKey,
55
88
  defaultHeaders: { 'User-Agent': 'Scalix-SDK/2.0' },
56
89
  });
57
90
  this.completions = this.openai.chat.completions;
58
91
  this.account = new AccountService(config);
59
92
  this.audio = new AudioService(config);
60
- this.docgen = new DocGenService(config);
93
+ this.auth = new AuthService(config);
94
+ this.compute = new ComputeService(config);
95
+ this.cron = new CronService(config);
96
+ this.database = new DatabaseService(config);
97
+ this.domains = new DomainsService(config);
98
+ this.events = new EventsService(config);
99
+ this.functions = new FunctionsService(config);
61
100
  this.images = new ImagesService(config);
101
+ this.kv = new KvService(config);
62
102
  this.models = new ModelsService(config);
63
- this.rag = new RAGService(config);
64
- this.research = new ResearchService(config);
65
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);
66
109
  this.text = new TextService(config);
110
+ this.embeddings = new EmbeddingsService(config);
111
+ this.search = new SearchService(config);
112
+ this.shield = new ShieldService(config);
67
113
  }
68
114
  }
69
115
  /** @deprecated Use `Scalix` instead */
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,cAAc,EAA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C,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF;AAED,uCAAuC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC"}
package/dist/index.d.ts CHANGED
@@ -8,11 +8,11 @@
8
8
  * ```typescript
9
9
  * import { Scalix } from '@scalix-world/sdk';
10
10
  *
11
- * const scalix = new Scalix('sk_scalix_...');
11
+ * const scalix = new Scalix('scalix_sk_...');
12
12
  *
13
13
  * // Chat — full OpenAI-compatible (tools, vision, streaming)
14
14
  * const response = await scalix.completions.create({
15
- * model: 'scalix-world-ai',
15
+ * model: 'scalix-lumio-lite',
16
16
  * messages: [{ role: 'user', content: 'Hello!' }],
17
17
  * });
18
18
  *
@@ -26,6 +26,6 @@ export { Scalix, ScalixClient } from './client.js';
26
26
  export type { ScalixOptions } from './client.js';
27
27
  export type { ScalixConfig } from './config.js';
28
28
  export { ScalixError, AuthenticationError, BadRequestError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, } from './errors.js';
29
- export { AccountService, AudioService, DocGenService, ImagesService, ModelsService, RAGService, ResearchService, StorageService, TextService, } from './services/index.js';
30
- export type { UserInfo, UserBudget, UserUsage, ScalixModel, DocFormat, DocStyle, DocGenOptions, DocGenResult, DocTemplate, DocFormatInfo, ImageGenerateOptions, ImageResult, ImageJobStatus, RAGDocument, RAGQueryResult, RAGUploadResult, SentimentResult, SummaryResult, TranslationResult, GrammarResult, AutocompleteResult, VectorSearchResult, UploadUrlResult, TranscriptionResult, SpeechOptions, SearchResult, ResearchResult, } from './services/index.js';
29
+ export { AccountService, AudioService, AuthService, ComputeService, CronService, DatabaseService, DocGenService, DomainsService, EventsService, FunctionsService, ImagesService, KvService, ModelsService, RAGService, ResearchService, StorageService, TextService, } from './services/index.js';
30
+ export type { AuthResponse, AutocompleteResult, ColumnInfo, CreateDeploymentOptions, CreateFunctionOptions, CreateScheduleOptions, Deployment, DocFormat, DocFormatInfo, DocGenOptions, DocGenResult, DocStyle, DocTemplate, Domain, GrammarResult, CreateImageOptions, OpenAIImageResult, Instance, InvocationResult, KvValue, LogEntry, QueryResult, RAGDocument, RAGQueryResult, RAGUploadResult, ResearchResult, ScalixFunction, ScalixModel, Schedule, SchemaInfo, SearchResult, SentimentResult, CreateSpeechOptions, Subscription, SummaryResult, TableData, TableInfo, Topic, TranscriptionResult, TranslationResult, UploadUrlResult, User, UserBudget, UserInfo, UserUsage, VectorSearchResult, VerificationResult, } from './services/index.js';
31
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,QAAQ,EACR,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,aAAa,EACb,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,WAAW,EACX,WAAW,EACX,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -8,11 +8,11 @@
8
8
  * ```typescript
9
9
  * import { Scalix } from '@scalix-world/sdk';
10
10
  *
11
- * const scalix = new Scalix('sk_scalix_...');
11
+ * const scalix = new Scalix('scalix_sk_...');
12
12
  *
13
13
  * // Chat — full OpenAI-compatible (tools, vision, streaming)
14
14
  * const response = await scalix.completions.create({
15
- * model: 'scalix-world-ai',
15
+ * model: 'scalix-lumio-lite',
16
16
  * messages: [{ role: 'user', content: 'Hello!' }],
17
17
  * });
18
18
  *
@@ -24,5 +24,5 @@
24
24
  */
25
25
  export { Scalix, ScalixClient } from './client.js';
26
26
  export { ScalixError, AuthenticationError, BadRequestError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, } from './errors.js';
27
- export { AccountService, AudioService, DocGenService, ImagesService, ModelsService, RAGService, ResearchService, StorageService, TextService, } from './services/index.js';
27
+ export { AccountService, AudioService, AuthService, ComputeService, CronService, DatabaseService, DocGenService, DomainsService, EventsService, FunctionsService, ImagesService, KvService, ModelsService, RAGService, ResearchService, StorageService, TextService, } from './services/index.js';
28
28
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,qBAAqB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { BaseService } from './base.js';
2
2
  export class AccountService extends BaseService {
3
3
  async health() {
4
- return this.request('GET', '/health');
4
+ return this.request('GET', '/api/v1/health');
5
5
  }
6
6
  async info() {
7
7
  return this.request('GET', '/v1/user/info');
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/services/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAwBxC,MAAM,OAAO,cAAe,SAAQ,WAAW;IAE7C,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,OAAO,CAAW,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,OAAO,CAAa,KAAK,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,OAAO,CAAY,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAC1D,CAAC;CACF"}
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/services/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAwBxC,MAAM,OAAO,cAAe,SAAQ,WAAW;IAE7C,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,OAAO,CAAW,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,OAAO,CAAa,KAAK,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,OAAO,CAAY,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAC1D,CAAC;CACF"}
@@ -4,24 +4,25 @@ export interface TranscriptionResult {
4
4
  language?: string;
5
5
  duration?: number;
6
6
  }
7
- export interface SpeechOptions {
7
+ export interface CreateTranscriptionOptions {
8
+ language?: string;
9
+ model?: string;
10
+ response_format?: string;
11
+ }
12
+ export interface CreateSpeechOptions {
13
+ model?: string;
8
14
  voice?: string;
9
- format?: string;
15
+ response_format?: string;
10
16
  speed?: number;
11
17
  }
12
18
  export declare class AudioService extends BaseService {
13
- transcribe(file: Blob, options?: {
14
- language?: string;
15
- }): Promise<TranscriptionResult>;
16
- speak(text: string, options?: SpeechOptions): Promise<Response>;
17
- voices(): Promise<{
18
- voices: Array<{
19
- id: string;
20
- name: string;
21
- }>;
22
- }>;
23
- languages(): Promise<{
24
- languages: string[];
25
- }>;
19
+ /** Speech-to-text (OpenAI-compatible). */
20
+ transcribe(file: Blob, options?: CreateTranscriptionOptions): Promise<TranscriptionResult>;
21
+ /** @deprecated Use transcribe(). */
22
+ createTranscription(file: Blob, options?: CreateTranscriptionOptions): Promise<TranscriptionResult>;
23
+ /** Text-to-speech (OpenAI-compatible). Returns the raw audio Response. */
24
+ speak(input: string, options?: CreateSpeechOptions): Promise<Response>;
25
+ /** @deprecated Use speak(). */
26
+ createSpeech(input: string, options?: CreateSpeechOptions): Promise<Response>;
26
27
  }
27
28
  //# sourceMappingURL=audio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/services/audio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,YAAa,SAAQ,WAAW;IACrC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOrF,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQ/D,MAAM,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IAIlE,SAAS,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAGpD"}
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/services/audio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,YAAa,SAAQ,WAAW;IAC3C,0CAA0C;IACpC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAShG,oCAAoC;IAC9B,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIzG,0EAA0E;IACpE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAY5E,+BAA+B;IACzB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAGpF"}
@@ -1,27 +1,35 @@
1
1
  import { BaseService } from './base.js';
2
2
  export class AudioService extends BaseService {
3
+ /** Speech-to-text (OpenAI-compatible). */
3
4
  async transcribe(file, options) {
4
5
  const formData = new FormData();
5
6
  formData.append('file', file);
7
+ formData.append('model', options?.model ?? 'scalix-transcribe');
6
8
  if (options?.language)
7
9
  formData.append('language', options.language);
8
- return this.requestMultipart('/v1/audio/transcribe', formData);
10
+ if (options?.response_format)
11
+ formData.append('response_format', options.response_format);
12
+ return this.requestMultipart('/v1/ai/audio/transcriptions', formData);
9
13
  }
10
- async speak(text, options) {
11
- const params = new URLSearchParams({ text });
12
- if (options?.voice)
13
- params.set('voice', options.voice);
14
- if (options?.format)
15
- params.set('format', options.format);
16
- if (options?.speed != null)
17
- params.set('speed', String(options.speed));
18
- return this.requestRaw('POST', `/v1/audio/speak/kokoro?${params}`);
14
+ /** @deprecated Use transcribe(). */
15
+ async createTranscription(file, options) {
16
+ return this.transcribe(file, options);
19
17
  }
20
- async voices() {
21
- return this.request('GET', '/v1/audio/kokoro/voices');
18
+ /** Text-to-speech (OpenAI-compatible). Returns the raw audio Response. */
19
+ async speak(input, options) {
20
+ return this.requestRaw('POST', '/v1/ai/audio/speech', {
21
+ body: {
22
+ input,
23
+ model: options?.model ?? 'scalix-tts',
24
+ voice: options?.voice ?? 'alloy',
25
+ response_format: options?.response_format ?? 'wav',
26
+ speed: options?.speed ?? 1.0,
27
+ },
28
+ });
22
29
  }
23
- async languages() {
24
- return this.request('GET', '/v1/audio/kokoro/languages');
30
+ /** @deprecated Use speak(). */
31
+ async createSpeech(input, options) {
32
+ return this.speak(input, options);
25
33
  }
26
34
  }
27
35
  //# sourceMappingURL=audio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"audio.js","sourceRoot":"","sources":["../../src/services/audio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAcxC,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,KAAK,CAAC,UAAU,CAAC,IAAU,EAAE,OAA+B;QAC1D,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,IAAI,OAAO,EAAE,QAAQ;YAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,CA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