@matrix-ai/sdk 1.6.0 → 1.6.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/dist/client.d.ts +4 -4
- package/dist/client.js +31 -5
- package/dist/gen/sdk.gen.d.ts +1 -1
- package/dist/gen/sdk.gen.js +1 -1
- package/dist/gen/types.gen.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/process.d.ts +3 -0
- package/dist/process.js +33 -0
- package/dist/server.d.ts +2 -2
- package/dist/server.js +30 -19
- package/dist/v2/client.d.ts +4 -4
- package/dist/v2/client.js +45 -8
- package/dist/v2/gen/sdk.gen.d.ts +79 -58
- package/dist/v2/gen/sdk.gen.js +124 -85
- package/dist/v2/gen/types.gen.d.ts +551 -417
- package/dist/v2/index.d.ts +2 -2
- package/dist/v2/index.js +5 -5
- package/dist/v2/server.d.ts +2 -2
- package/dist/v2/server.js +30 -19
- package/package.json +7 -4
package/dist/v2/gen/sdk.gen.js
CHANGED
|
@@ -13,7 +13,7 @@ class HeyApiRegistry {
|
|
|
13
13
|
get(key) {
|
|
14
14
|
const instance = this.instances.get(key ?? this.defaultKey);
|
|
15
15
|
if (!instance) {
|
|
16
|
-
throw new Error(`No SDK client found. Create one with "new
|
|
16
|
+
throw new Error(`No SDK client found. Create one with "new MatrixClient()" to fix this error.`);
|
|
17
17
|
}
|
|
18
18
|
return instance;
|
|
19
19
|
}
|
|
@@ -21,11 +21,24 @@ class HeyApiRegistry {
|
|
|
21
21
|
this.instances.set(key ?? this.defaultKey, value);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
export class SyncEvent extends HeyApiClient {
|
|
25
|
+
/**
|
|
26
|
+
* Subscribe to global sync events
|
|
27
|
+
*
|
|
28
|
+
* Get global sync events
|
|
29
|
+
*/
|
|
30
|
+
subscribe(options) {
|
|
31
|
+
return (options?.client ?? this.client).sse.get({
|
|
32
|
+
url: "/global/sync-event",
|
|
33
|
+
...options,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
24
37
|
export class Config extends HeyApiClient {
|
|
25
38
|
/**
|
|
26
39
|
* Get global configuration
|
|
27
40
|
*
|
|
28
|
-
* Retrieve the current global
|
|
41
|
+
* Retrieve the current global Matrix configuration settings and preferences.
|
|
29
42
|
*/
|
|
30
43
|
get(options) {
|
|
31
44
|
return (options?.client ?? this.client).get({
|
|
@@ -36,7 +49,7 @@ export class Config extends HeyApiClient {
|
|
|
36
49
|
/**
|
|
37
50
|
* Update global configuration
|
|
38
51
|
*
|
|
39
|
-
* Update global
|
|
52
|
+
* Update global Matrix configuration settings and preferences.
|
|
40
53
|
*/
|
|
41
54
|
update(parameters, options) {
|
|
42
55
|
const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }]);
|
|
@@ -56,7 +69,7 @@ export class Global extends HeyApiClient {
|
|
|
56
69
|
/**
|
|
57
70
|
* Get health
|
|
58
71
|
*
|
|
59
|
-
* Get health information about the
|
|
72
|
+
* Get health information about the Matrix server.
|
|
60
73
|
*/
|
|
61
74
|
health(options) {
|
|
62
75
|
return (options?.client ?? this.client).get({
|
|
@@ -67,7 +80,7 @@ export class Global extends HeyApiClient {
|
|
|
67
80
|
/**
|
|
68
81
|
* Get global events
|
|
69
82
|
*
|
|
70
|
-
* Subscribe to global events from the
|
|
83
|
+
* Subscribe to global events from the Matrix system using server-sent events.
|
|
71
84
|
*/
|
|
72
85
|
event(options) {
|
|
73
86
|
return (options?.client ?? this.client).sse.get({
|
|
@@ -78,7 +91,7 @@ export class Global extends HeyApiClient {
|
|
|
78
91
|
/**
|
|
79
92
|
* Dispose instance
|
|
80
93
|
*
|
|
81
|
-
* Clean up and dispose all
|
|
94
|
+
* Clean up and dispose all Matrix instances, releasing all resources.
|
|
82
95
|
*/
|
|
83
96
|
dispose(options) {
|
|
84
97
|
return (options?.client ?? this.client).post({
|
|
@@ -87,9 +100,9 @@ export class Global extends HeyApiClient {
|
|
|
87
100
|
});
|
|
88
101
|
}
|
|
89
102
|
/**
|
|
90
|
-
* Upgrade
|
|
103
|
+
* Upgrade matrix
|
|
91
104
|
*
|
|
92
|
-
* Upgrade
|
|
105
|
+
* Upgrade matrix to the specified version or latest if not specified.
|
|
93
106
|
*/
|
|
94
107
|
upgrade(parameters, options) {
|
|
95
108
|
const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }]);
|
|
@@ -104,6 +117,10 @@ export class Global extends HeyApiClient {
|
|
|
104
117
|
},
|
|
105
118
|
});
|
|
106
119
|
}
|
|
120
|
+
_syncEvent;
|
|
121
|
+
get syncEvent() {
|
|
122
|
+
return (this._syncEvent ??= new SyncEvent({ client: this.client }));
|
|
123
|
+
}
|
|
107
124
|
_config;
|
|
108
125
|
get config() {
|
|
109
126
|
return (this._config ??= new Config({ client: this.client }));
|
|
@@ -149,11 +166,82 @@ export class Auth extends HeyApiClient {
|
|
|
149
166
|
});
|
|
150
167
|
}
|
|
151
168
|
}
|
|
169
|
+
export class App extends HeyApiClient {
|
|
170
|
+
/**
|
|
171
|
+
* Write log
|
|
172
|
+
*
|
|
173
|
+
* Write a log entry to the server logs with specified level and metadata.
|
|
174
|
+
*/
|
|
175
|
+
log(parameters, options) {
|
|
176
|
+
const params = buildClientParams([parameters], [
|
|
177
|
+
{
|
|
178
|
+
args: [
|
|
179
|
+
{ in: "query", key: "directory" },
|
|
180
|
+
{ in: "query", key: "workspace" },
|
|
181
|
+
{ in: "body", key: "service" },
|
|
182
|
+
{ in: "body", key: "level" },
|
|
183
|
+
{ in: "body", key: "message" },
|
|
184
|
+
{ in: "body", key: "extra" },
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
]);
|
|
188
|
+
return (options?.client ?? this.client).post({
|
|
189
|
+
url: "/log",
|
|
190
|
+
...options,
|
|
191
|
+
...params,
|
|
192
|
+
headers: {
|
|
193
|
+
"Content-Type": "application/json",
|
|
194
|
+
...options?.headers,
|
|
195
|
+
...params.headers,
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* List agents
|
|
201
|
+
*
|
|
202
|
+
* Get a list of all available AI agents in the Matrix system.
|
|
203
|
+
*/
|
|
204
|
+
agents(parameters, options) {
|
|
205
|
+
const params = buildClientParams([parameters], [
|
|
206
|
+
{
|
|
207
|
+
args: [
|
|
208
|
+
{ in: "query", key: "directory" },
|
|
209
|
+
{ in: "query", key: "workspace" },
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
]);
|
|
213
|
+
return (options?.client ?? this.client).get({
|
|
214
|
+
url: "/agent",
|
|
215
|
+
...options,
|
|
216
|
+
...params,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* List skills
|
|
221
|
+
*
|
|
222
|
+
* Get a list of all available skills in the Matrix system.
|
|
223
|
+
*/
|
|
224
|
+
skills(parameters, options) {
|
|
225
|
+
const params = buildClientParams([parameters], [
|
|
226
|
+
{
|
|
227
|
+
args: [
|
|
228
|
+
{ in: "query", key: "directory" },
|
|
229
|
+
{ in: "query", key: "workspace" },
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
]);
|
|
233
|
+
return (options?.client ?? this.client).get({
|
|
234
|
+
url: "/skill",
|
|
235
|
+
...options,
|
|
236
|
+
...params,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
152
240
|
export class Project extends HeyApiClient {
|
|
153
241
|
/**
|
|
154
242
|
* List all projects
|
|
155
243
|
*
|
|
156
|
-
* Get a list of projects that have been opened with
|
|
244
|
+
* Get a list of projects that have been opened with Matrix.
|
|
157
245
|
*/
|
|
158
246
|
list(parameters, options) {
|
|
159
247
|
const params = buildClientParams([parameters], [
|
|
@@ -173,7 +261,7 @@ export class Project extends HeyApiClient {
|
|
|
173
261
|
/**
|
|
174
262
|
* Get current project
|
|
175
263
|
*
|
|
176
|
-
* Retrieve the currently active project that
|
|
264
|
+
* Retrieve the currently active project that Matrix is working with.
|
|
177
265
|
*/
|
|
178
266
|
current(parameters, options) {
|
|
179
267
|
const params = buildClientParams([parameters], [
|
|
@@ -244,7 +332,7 @@ export class Pty extends HeyApiClient {
|
|
|
244
332
|
/**
|
|
245
333
|
* List PTY sessions
|
|
246
334
|
*
|
|
247
|
-
* Get a list of all active pseudo-terminal (PTY) sessions managed by
|
|
335
|
+
* Get a list of all active pseudo-terminal (PTY) sessions managed by Matrix.
|
|
248
336
|
*/
|
|
249
337
|
list(parameters, options) {
|
|
250
338
|
const params = buildClientParams([parameters], [
|
|
@@ -387,7 +475,7 @@ export class Config2 extends HeyApiClient {
|
|
|
387
475
|
/**
|
|
388
476
|
* Get configuration
|
|
389
477
|
*
|
|
390
|
-
* Retrieve the current
|
|
478
|
+
* Retrieve the current Matrix configuration settings and preferences.
|
|
391
479
|
*/
|
|
392
480
|
get(parameters, options) {
|
|
393
481
|
const params = buildClientParams([parameters], [
|
|
@@ -407,7 +495,7 @@ export class Config2 extends HeyApiClient {
|
|
|
407
495
|
/**
|
|
408
496
|
* Update configuration
|
|
409
497
|
*
|
|
410
|
-
* Update
|
|
498
|
+
* Update Matrix configuration settings and preferences.
|
|
411
499
|
*/
|
|
412
500
|
update(parameters, options) {
|
|
413
501
|
const params = buildClientParams([parameters], [
|
|
@@ -571,7 +659,7 @@ export class Session extends HeyApiClient {
|
|
|
571
659
|
/**
|
|
572
660
|
* List sessions
|
|
573
661
|
*
|
|
574
|
-
* Get a list of all
|
|
662
|
+
* Get a list of all Matrix sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
|
|
575
663
|
*/
|
|
576
664
|
list(parameters, options) {
|
|
577
665
|
const params = buildClientParams([parameters], [
|
|
@@ -735,7 +823,7 @@ export class Session2 extends HeyApiClient {
|
|
|
735
823
|
/**
|
|
736
824
|
* List sessions
|
|
737
825
|
*
|
|
738
|
-
* Get a list of all
|
|
826
|
+
* Get a list of all Matrix sessions, sorted by most recently updated.
|
|
739
827
|
*/
|
|
740
828
|
list(parameters, options) {
|
|
741
829
|
const params = buildClientParams([parameters], [
|
|
@@ -759,7 +847,7 @@ export class Session2 extends HeyApiClient {
|
|
|
759
847
|
/**
|
|
760
848
|
* Create session
|
|
761
849
|
*
|
|
762
|
-
* Create a new
|
|
850
|
+
* Create a new Matrix session for interacting with AI assistants and managing conversations.
|
|
763
851
|
*/
|
|
764
852
|
create(parameters, options) {
|
|
765
853
|
const params = buildClientParams([parameters], [
|
|
@@ -829,7 +917,7 @@ export class Session2 extends HeyApiClient {
|
|
|
829
917
|
/**
|
|
830
918
|
* Get session
|
|
831
919
|
*
|
|
832
|
-
* Retrieve detailed information about a specific
|
|
920
|
+
* Retrieve detailed information about a specific Matrix session.
|
|
833
921
|
*/
|
|
834
922
|
get(parameters, options) {
|
|
835
923
|
const params = buildClientParams([parameters], [
|
|
@@ -1269,6 +1357,7 @@ export class Session2 extends HeyApiClient {
|
|
|
1269
1357
|
{ in: "path", key: "sessionID" },
|
|
1270
1358
|
{ in: "query", key: "directory" },
|
|
1271
1359
|
{ in: "query", key: "workspace" },
|
|
1360
|
+
{ in: "body", key: "messageID" },
|
|
1272
1361
|
{ in: "body", key: "agent" },
|
|
1273
1362
|
{ in: "body", key: "model" },
|
|
1274
1363
|
{ in: "body", key: "command" },
|
|
@@ -2288,7 +2377,7 @@ export class Instance extends HeyApiClient {
|
|
|
2288
2377
|
/**
|
|
2289
2378
|
* Dispose instance
|
|
2290
2379
|
*
|
|
2291
|
-
* Clean up and dispose the current
|
|
2380
|
+
* Clean up and dispose the current Matrix instance, releasing all resources.
|
|
2292
2381
|
*/
|
|
2293
2382
|
dispose(parameters, options) {
|
|
2294
2383
|
const params = buildClientParams([parameters], [
|
|
@@ -2310,7 +2399,7 @@ export class Path extends HeyApiClient {
|
|
|
2310
2399
|
/**
|
|
2311
2400
|
* Get paths
|
|
2312
2401
|
*
|
|
2313
|
-
* Retrieve the current working directory and related path information for the
|
|
2402
|
+
* Retrieve the current working directory and related path information for the Matrix instance.
|
|
2314
2403
|
*/
|
|
2315
2404
|
get(parameters, options) {
|
|
2316
2405
|
const params = buildClientParams([parameters], [
|
|
@@ -2349,85 +2438,35 @@ export class Vcs extends HeyApiClient {
|
|
|
2349
2438
|
...params,
|
|
2350
2439
|
});
|
|
2351
2440
|
}
|
|
2352
|
-
}
|
|
2353
|
-
export class Command extends HeyApiClient {
|
|
2354
2441
|
/**
|
|
2355
|
-
*
|
|
2442
|
+
* Get VCS diff
|
|
2356
2443
|
*
|
|
2357
|
-
*
|
|
2444
|
+
* Retrieve the current git diff for the working tree or against the default branch.
|
|
2358
2445
|
*/
|
|
2359
|
-
|
|
2446
|
+
diff(parameters, options) {
|
|
2360
2447
|
const params = buildClientParams([parameters], [
|
|
2361
2448
|
{
|
|
2362
2449
|
args: [
|
|
2363
2450
|
{ in: "query", key: "directory" },
|
|
2364
2451
|
{ in: "query", key: "workspace" },
|
|
2452
|
+
{ in: "query", key: "mode" },
|
|
2365
2453
|
],
|
|
2366
2454
|
},
|
|
2367
2455
|
]);
|
|
2368
2456
|
return (options?.client ?? this.client).get({
|
|
2369
|
-
url: "/
|
|
2457
|
+
url: "/vcs/diff",
|
|
2370
2458
|
...options,
|
|
2371
2459
|
...params,
|
|
2372
2460
|
});
|
|
2373
2461
|
}
|
|
2374
2462
|
}
|
|
2375
|
-
export class
|
|
2376
|
-
/**
|
|
2377
|
-
* Write log
|
|
2378
|
-
*
|
|
2379
|
-
* Write a log entry to the server logs with specified level and metadata.
|
|
2380
|
-
*/
|
|
2381
|
-
log(parameters, options) {
|
|
2382
|
-
const params = buildClientParams([parameters], [
|
|
2383
|
-
{
|
|
2384
|
-
args: [
|
|
2385
|
-
{ in: "query", key: "directory" },
|
|
2386
|
-
{ in: "query", key: "workspace" },
|
|
2387
|
-
{ in: "body", key: "service" },
|
|
2388
|
-
{ in: "body", key: "level" },
|
|
2389
|
-
{ in: "body", key: "message" },
|
|
2390
|
-
{ in: "body", key: "extra" },
|
|
2391
|
-
],
|
|
2392
|
-
},
|
|
2393
|
-
]);
|
|
2394
|
-
return (options?.client ?? this.client).post({
|
|
2395
|
-
url: "/log",
|
|
2396
|
-
...options,
|
|
2397
|
-
...params,
|
|
2398
|
-
headers: {
|
|
2399
|
-
"Content-Type": "application/json",
|
|
2400
|
-
...options?.headers,
|
|
2401
|
-
...params.headers,
|
|
2402
|
-
},
|
|
2403
|
-
});
|
|
2404
|
-
}
|
|
2405
|
-
/**
|
|
2406
|
-
* List agents
|
|
2407
|
-
*
|
|
2408
|
-
* Get a list of all available AI agents in the OpenCode system.
|
|
2409
|
-
*/
|
|
2410
|
-
agents(parameters, options) {
|
|
2411
|
-
const params = buildClientParams([parameters], [
|
|
2412
|
-
{
|
|
2413
|
-
args: [
|
|
2414
|
-
{ in: "query", key: "directory" },
|
|
2415
|
-
{ in: "query", key: "workspace" },
|
|
2416
|
-
],
|
|
2417
|
-
},
|
|
2418
|
-
]);
|
|
2419
|
-
return (options?.client ?? this.client).get({
|
|
2420
|
-
url: "/agent",
|
|
2421
|
-
...options,
|
|
2422
|
-
...params,
|
|
2423
|
-
});
|
|
2424
|
-
}
|
|
2463
|
+
export class Command extends HeyApiClient {
|
|
2425
2464
|
/**
|
|
2426
|
-
* List
|
|
2465
|
+
* List commands
|
|
2427
2466
|
*
|
|
2428
|
-
* Get a list of all available
|
|
2467
|
+
* Get a list of all available commands in the Matrix system.
|
|
2429
2468
|
*/
|
|
2430
|
-
|
|
2469
|
+
list(parameters, options) {
|
|
2431
2470
|
const params = buildClientParams([parameters], [
|
|
2432
2471
|
{
|
|
2433
2472
|
args: [
|
|
@@ -2437,7 +2476,7 @@ export class App extends HeyApiClient {
|
|
|
2437
2476
|
},
|
|
2438
2477
|
]);
|
|
2439
2478
|
return (options?.client ?? this.client).get({
|
|
2440
|
-
url: "/
|
|
2479
|
+
url: "/command",
|
|
2441
2480
|
...options,
|
|
2442
2481
|
...params,
|
|
2443
2482
|
});
|
|
@@ -2487,11 +2526,11 @@ export class Formatter extends HeyApiClient {
|
|
|
2487
2526
|
});
|
|
2488
2527
|
}
|
|
2489
2528
|
}
|
|
2490
|
-
export class
|
|
2529
|
+
export class MatrixClient extends HeyApiClient {
|
|
2491
2530
|
static __registry = new HeyApiRegistry();
|
|
2492
2531
|
constructor(args) {
|
|
2493
2532
|
super(args);
|
|
2494
|
-
|
|
2533
|
+
MatrixClient.__registry.set(this, args?.key);
|
|
2495
2534
|
}
|
|
2496
2535
|
_global;
|
|
2497
2536
|
get global() {
|
|
@@ -2501,6 +2540,10 @@ export class OpencodeClient extends HeyApiClient {
|
|
|
2501
2540
|
get auth() {
|
|
2502
2541
|
return (this._auth ??= new Auth({ client: this.client }));
|
|
2503
2542
|
}
|
|
2543
|
+
_app;
|
|
2544
|
+
get app() {
|
|
2545
|
+
return (this._app ??= new App({ client: this.client }));
|
|
2546
|
+
}
|
|
2504
2547
|
_project;
|
|
2505
2548
|
get project() {
|
|
2506
2549
|
return (this._project ??= new Project({ client: this.client }));
|
|
@@ -2581,10 +2624,6 @@ export class OpencodeClient extends HeyApiClient {
|
|
|
2581
2624
|
get command() {
|
|
2582
2625
|
return (this._command ??= new Command({ client: this.client }));
|
|
2583
2626
|
}
|
|
2584
|
-
_app;
|
|
2585
|
-
get app() {
|
|
2586
|
-
return (this._app ??= new App({ client: this.client }));
|
|
2587
|
-
}
|
|
2588
2627
|
_lsp;
|
|
2589
2628
|
get lsp() {
|
|
2590
2629
|
return (this._lsp ??= new Lsp({ client: this.client }));
|