@matrix-ai/sdk 1.6.1 → 1.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { type Config } from "./gen/client/types.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { type Config as OpencodeClientConfig, OpencodeClient };
5
- export declare function createOpencodeClient(config?: Config & {
3
+ import { MatrixClient } from "./gen/sdk.gen.js";
4
+ export { type Config as MatrixClientConfig, MatrixClient };
5
+ export declare function createMatrixClient(config?: Config & {
6
6
  directory?: string;
7
- }): OpencodeClient;
7
+ }): MatrixClient;
package/dist/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { createClient } from "./gen/client/client.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { OpencodeClient };
3
+ import { MatrixClient } from "./gen/sdk.gen.js";
4
+ export { MatrixClient };
5
5
  function pick(value, fallback) {
6
6
  if (!value)
7
7
  return;
@@ -16,7 +16,7 @@ function pick(value, fallback) {
16
16
  function rewrite(request, directory) {
17
17
  if (request.method !== "GET" && request.method !== "HEAD")
18
18
  return request;
19
- const value = pick(request.headers.get("x-opencode-directory"), directory);
19
+ const value = pick(request.headers.get("x-matrix-directory"), directory);
20
20
  if (!value)
21
21
  return request;
22
22
  const url = new URL(request.url);
@@ -24,10 +24,10 @@ function rewrite(request, directory) {
24
24
  url.searchParams.set("directory", value);
25
25
  }
26
26
  const next = new Request(url, request);
27
- next.headers.delete("x-opencode-directory");
27
+ next.headers.delete("x-matrix-directory");
28
28
  return next;
29
29
  }
30
- export function createOpencodeClient(config) {
30
+ export function createMatrixClient(config) {
31
31
  if (!config?.fetch) {
32
32
  const customFetch = (req) => {
33
33
  // @ts-ignore
@@ -42,10 +42,10 @@ export function createOpencodeClient(config) {
42
42
  if (config?.directory) {
43
43
  config.headers = {
44
44
  ...config.headers,
45
- "x-opencode-directory": encodeURIComponent(config.directory),
45
+ "x-matrix-directory": encodeURIComponent(config.directory),
46
46
  };
47
47
  }
48
48
  const client = createClient(config);
49
49
  client.interceptors.request.use((request) => rewrite(request, config?.directory));
50
- return new OpencodeClient({ client });
50
+ return new MatrixClient({ client });
51
51
  }
@@ -374,7 +374,7 @@ declare class Event extends _HeyApiClient {
374
374
  */
375
375
  subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<EventSubscribeResponses, unknown>>;
376
376
  }
377
- export declare class OpencodeClient extends _HeyApiClient {
377
+ export declare class MatrixClient extends _HeyApiClient {
378
378
  /**
379
379
  * Respond to a permission request
380
380
  */
@@ -844,7 +844,7 @@ class Event extends _HeyApiClient {
844
844
  });
845
845
  }
846
846
  }
847
- export class OpencodeClient extends _HeyApiClient {
847
+ export class MatrixClient extends _HeyApiClient {
848
848
  /**
849
849
  * Respond to a permission request
850
850
  */
@@ -1050,7 +1050,7 @@ export type Config = {
1050
1050
  diff_style?: "auto" | "stacked";
1051
1051
  };
1052
1052
  /**
1053
- * Command configuration, see https://opencode.ai/docs/commands
1053
+ * Command configuration, see https://y-square-t3.github.io/matrix/docs/commands
1054
1054
  */
1055
1055
  command?: {
1056
1056
  [key: string]: {
@@ -1107,7 +1107,7 @@ export type Config = {
1107
1107
  [key: string]: AgentConfig | undefined;
1108
1108
  };
1109
1109
  /**
1110
- * Agent configuration, see https://opencode.ai/docs/agent
1110
+ * Agent configuration, see https://y-square-t3.github.io/matrix/docs/agent
1111
1111
  */
1112
1112
  agent?: {
1113
1113
  plan?: AgentConfig;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from "./client.js";
2
2
  export * from "./server.js";
3
3
  import type { ServerOptions } from "./server.js";
4
- export declare function createOpencode(options?: ServerOptions): Promise<{
5
- client: import("./client.js").OpencodeClient;
4
+ export declare function createMatrix(options?: ServerOptions): Promise<{
5
+ client: import("./client.js").MatrixClient;
6
6
  server: {
7
7
  url: string;
8
8
  close(): void;
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export * from "./client.js";
2
2
  export * from "./server.js";
3
- import { createOpencodeClient } from "./client.js";
4
- import { createOpencodeServer } from "./server.js";
5
- export async function createOpencode(options) {
6
- const server = await createOpencodeServer({
3
+ import { createMatrixClient } from "./client.js";
4
+ import { createMatrixServer } from "./server.js";
5
+ export async function createMatrix(options) {
6
+ const server = await createMatrixServer({
7
7
  ...options,
8
8
  });
9
- const client = createOpencodeClient({
9
+ const client = createMatrixClient({
10
10
  baseUrl: server.url,
11
11
  });
12
12
  return {
package/dist/process.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { spawnSync } from "node:child_process";
2
- // Duplicated from `packages/opencode/src/util/process.ts` because the SDK cannot
3
- // import `opencode` without creating a cycle (`opencode` depends on `@opencode-ai/sdk`).
2
+ // Duplicated from `packages/matrix/src/util/process.ts` because the SDK cannot
3
+ // import `matrix` without creating a cycle (`matrix` depends on `@matrix-ai/sdk`).
4
4
  export function stop(proc) {
5
5
  if (proc.exitCode !== null || proc.signalCode !== null)
6
6
  return;
package/dist/server.d.ts CHANGED
@@ -14,10 +14,10 @@ export type TuiOptions = {
14
14
  signal?: AbortSignal;
15
15
  config?: Config;
16
16
  };
17
- export declare function createOpencodeServer(options?: ServerOptions): Promise<{
17
+ export declare function createMatrixServer(options?: ServerOptions): Promise<{
18
18
  url: string;
19
19
  close(): void;
20
20
  }>;
21
- export declare function createOpencodeTui(options?: TuiOptions): {
21
+ export declare function createMatrixTui(options?: TuiOptions): {
22
22
  close(): void;
23
23
  };
package/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import launch from "cross-spawn";
2
2
  import { stop, bindAbort } from "./process.js";
3
- export async function createOpencodeServer(options) {
3
+ export async function createMatrixServer(options) {
4
4
  options = Object.assign({
5
5
  hostname: "127.0.0.1",
6
6
  port: 4096,
@@ -9,10 +9,10 @@ export async function createOpencodeServer(options) {
9
9
  const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`];
10
10
  if (options.config?.logLevel)
11
11
  args.push(`--log-level=${options.config.logLevel}`);
12
- const proc = launch(`opencode`, args, {
12
+ const proc = launch(`matrix`, args, {
13
13
  env: {
14
14
  ...process.env,
15
- OPENCODE_CONFIG_CONTENT: JSON.stringify(options.config ?? {}),
15
+ MATRIX_CONFIG_CONTENT: JSON.stringify(options.config ?? {}),
16
16
  },
17
17
  });
18
18
  let clear = () => { };
@@ -30,7 +30,7 @@ export async function createOpencodeServer(options) {
30
30
  output += chunk.toString();
31
31
  const lines = output.split("\n");
32
32
  for (const line of lines) {
33
- if (line.startsWith("opencode server listening")) {
33
+ if (line.startsWith("matrix server listening")) {
34
34
  const match = line.match(/on\s+(https?:\/\/[^\s]+)/);
35
35
  if (!match) {
36
36
  clear();
@@ -74,7 +74,7 @@ export async function createOpencodeServer(options) {
74
74
  },
75
75
  };
76
76
  }
77
- export function createOpencodeTui(options) {
77
+ export function createMatrixTui(options) {
78
78
  const args = [];
79
79
  if (options?.project) {
80
80
  args.push(`--project=${options.project}`);
@@ -88,11 +88,11 @@ export function createOpencodeTui(options) {
88
88
  if (options?.agent) {
89
89
  args.push(`--agent=${options.agent}`);
90
90
  }
91
- const proc = launch(`opencode`, args, {
91
+ const proc = launch(`matrix`, args, {
92
92
  stdio: "inherit",
93
93
  env: {
94
94
  ...process.env,
95
- OPENCODE_CONFIG_CONTENT: JSON.stringify(options?.config ?? {}),
95
+ MATRIX_CONFIG_CONTENT: JSON.stringify(options?.config ?? {}),
96
96
  },
97
97
  });
98
98
  const clear = bindAbort(proc, options?.signal);
@@ -1,8 +1,8 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { type Config } from "./gen/client/types.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { type Config as OpencodeClientConfig, OpencodeClient };
5
- export declare function createOpencodeClient(config?: Config & {
3
+ import { MatrixClient } from "./gen/sdk.gen.js";
4
+ export { type Config as MatrixClientConfig, MatrixClient };
5
+ export declare function createMatrixClient(config?: Config & {
6
6
  directory?: string;
7
7
  experimental_workspaceID?: string;
8
- }): OpencodeClient;
8
+ }): MatrixClient;
package/dist/v2/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { createClient } from "./gen/client/client.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { OpencodeClient };
3
+ import { MatrixClient } from "./gen/sdk.gen.js";
4
+ export { MatrixClient };
5
5
  function pick(value, fallback, encode) {
6
6
  if (!value)
7
7
  return;
@@ -19,8 +19,8 @@ function rewrite(request, values) {
19
19
  const url = new URL(request.url);
20
20
  let changed = false;
21
21
  for (const [name, key] of [
22
- ["x-opencode-directory", "directory"],
23
- ["x-opencode-workspace", "workspace"],
22
+ ["x-matrix-directory", "directory"],
23
+ ["x-matrix-workspace", "workspace"],
24
24
  ]) {
25
25
  const value = pick(request.headers.get(name), key === "directory" ? values.directory : values.workspace, key === "directory" ? encodeURIComponent : undefined);
26
26
  if (!value)
@@ -33,11 +33,11 @@ function rewrite(request, values) {
33
33
  if (!changed)
34
34
  return request;
35
35
  const next = new Request(url, request);
36
- next.headers.delete("x-opencode-directory");
37
- next.headers.delete("x-opencode-workspace");
36
+ next.headers.delete("x-matrix-directory");
37
+ next.headers.delete("x-matrix-workspace");
38
38
  return next;
39
39
  }
40
- export function createOpencodeClient(config) {
40
+ export function createMatrixClient(config) {
41
41
  if (!config?.fetch) {
42
42
  const customFetch = (req) => {
43
43
  // @ts-ignore
@@ -52,13 +52,13 @@ export function createOpencodeClient(config) {
52
52
  if (config?.directory) {
53
53
  config.headers = {
54
54
  ...config.headers,
55
- "x-opencode-directory": encodeURIComponent(config.directory),
55
+ "x-matrix-directory": encodeURIComponent(config.directory),
56
56
  };
57
57
  }
58
58
  if (config?.experimental_workspaceID) {
59
59
  config.headers = {
60
60
  ...config.headers,
61
- "x-opencode-workspace": config.experimental_workspaceID,
61
+ "x-matrix-workspace": config.experimental_workspaceID,
62
62
  };
63
63
  }
64
64
  const client = createClient(config);
@@ -66,5 +66,5 @@ export function createOpencodeClient(config) {
66
66
  directory: config?.directory,
67
67
  workspace: config?.experimental_workspaceID,
68
68
  }));
69
- return new OpencodeClient({ client });
69
+ return new MatrixClient({ client });
70
70
  }
@@ -37,13 +37,13 @@ export declare class Config extends HeyApiClient {
37
37
  /**
38
38
  * Get global configuration
39
39
  *
40
- * Retrieve the current global OpenCode configuration settings and preferences.
40
+ * Retrieve the current global Matrix configuration settings and preferences.
41
41
  */
42
42
  get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<GlobalConfigGetResponses, unknown, ThrowOnError, "fields">;
43
43
  /**
44
44
  * Update global configuration
45
45
  *
46
- * Update global OpenCode configuration settings and preferences.
46
+ * Update global Matrix configuration settings and preferences.
47
47
  */
48
48
  update<ThrowOnError extends boolean = false>(parameters?: {
49
49
  config?: Config3;
@@ -53,25 +53,25 @@ export declare class Global extends HeyApiClient {
53
53
  /**
54
54
  * Get health
55
55
  *
56
- * Get health information about the OpenCode server.
56
+ * Get health information about the Matrix server.
57
57
  */
58
58
  health<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<GlobalHealthResponses, unknown, ThrowOnError, "fields">;
59
59
  /**
60
60
  * Get global events
61
61
  *
62
- * Subscribe to global events from the OpenCode system using server-sent events.
62
+ * Subscribe to global events from the Matrix system using server-sent events.
63
63
  */
64
64
  event<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<GlobalEventResponses, unknown>>;
65
65
  /**
66
66
  * Dispose instance
67
67
  *
68
- * Clean up and dispose all OpenCode instances, releasing all resources.
68
+ * Clean up and dispose all Matrix instances, releasing all resources.
69
69
  */
70
70
  dispose<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<GlobalDisposeResponses, unknown, ThrowOnError, "fields">;
71
71
  /**
72
- * Upgrade opencode
72
+ * Upgrade matrix
73
73
  *
74
- * Upgrade opencode to the specified version or latest if not specified.
74
+ * Upgrade matrix to the specified version or latest if not specified.
75
75
  */
76
76
  upgrade<ThrowOnError extends boolean = false>(parameters?: {
77
77
  target?: string;
@@ -119,7 +119,7 @@ export declare class App extends HeyApiClient {
119
119
  /**
120
120
  * List agents
121
121
  *
122
- * Get a list of all available AI agents in the OpenCode system.
122
+ * Get a list of all available AI agents in the Matrix system.
123
123
  */
124
124
  agents<ThrowOnError extends boolean = false>(parameters?: {
125
125
  directory?: string;
@@ -128,7 +128,7 @@ export declare class App extends HeyApiClient {
128
128
  /**
129
129
  * List skills
130
130
  *
131
- * Get a list of all available skills in the OpenCode system.
131
+ * Get a list of all available skills in the Matrix system.
132
132
  */
133
133
  skills<ThrowOnError extends boolean = false>(parameters?: {
134
134
  directory?: string;
@@ -139,7 +139,7 @@ export declare class Project extends HeyApiClient {
139
139
  /**
140
140
  * List all projects
141
141
  *
142
- * Get a list of projects that have been opened with OpenCode.
142
+ * Get a list of projects that have been opened with Matrix.
143
143
  */
144
144
  list<ThrowOnError extends boolean = false>(parameters?: {
145
145
  directory?: string;
@@ -148,7 +148,7 @@ export declare class Project extends HeyApiClient {
148
148
  /**
149
149
  * Get current project
150
150
  *
151
- * Retrieve the currently active project that OpenCode is working with.
151
+ * Retrieve the currently active project that Matrix is working with.
152
152
  */
153
153
  current<ThrowOnError extends boolean = false>(parameters?: {
154
154
  directory?: string;
@@ -190,7 +190,7 @@ export declare class Pty extends HeyApiClient {
190
190
  /**
191
191
  * List PTY sessions
192
192
  *
193
- * Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
193
+ * Get a list of all active pseudo-terminal (PTY) sessions managed by Matrix.
194
194
  */
195
195
  list<ThrowOnError extends boolean = false>(parameters?: {
196
196
  directory?: string;
@@ -262,7 +262,7 @@ export declare class Config2 extends HeyApiClient {
262
262
  /**
263
263
  * Get configuration
264
264
  *
265
- * Retrieve the current OpenCode configuration settings and preferences.
265
+ * Retrieve the current Matrix configuration settings and preferences.
266
266
  */
267
267
  get<ThrowOnError extends boolean = false>(parameters?: {
268
268
  directory?: string;
@@ -271,7 +271,7 @@ export declare class Config2 extends HeyApiClient {
271
271
  /**
272
272
  * Update configuration
273
273
  *
274
- * Update OpenCode configuration settings and preferences.
274
+ * Update Matrix configuration settings and preferences.
275
275
  */
276
276
  update<ThrowOnError extends boolean = false>(parameters?: {
277
277
  directory?: string;
@@ -348,7 +348,7 @@ export declare class Session extends HeyApiClient {
348
348
  /**
349
349
  * List sessions
350
350
  *
351
- * Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
351
+ * Get a list of all Matrix sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
352
352
  */
353
353
  list<ThrowOnError extends boolean = false>(parameters?: {
354
354
  directory?: string;
@@ -425,7 +425,7 @@ export declare class Session2 extends HeyApiClient {
425
425
  /**
426
426
  * List sessions
427
427
  *
428
- * Get a list of all OpenCode sessions, sorted by most recently updated.
428
+ * Get a list of all Matrix sessions, sorted by most recently updated.
429
429
  */
430
430
  list<ThrowOnError extends boolean = false>(parameters?: {
431
431
  directory?: string;
@@ -438,7 +438,7 @@ export declare class Session2 extends HeyApiClient {
438
438
  /**
439
439
  * Create session
440
440
  *
441
- * Create a new OpenCode session for interacting with AI assistants and managing conversations.
441
+ * Create a new Matrix session for interacting with AI assistants and managing conversations.
442
442
  */
443
443
  create<ThrowOnError extends boolean = false>(parameters?: {
444
444
  directory?: string;
@@ -470,7 +470,7 @@ export declare class Session2 extends HeyApiClient {
470
470
  /**
471
471
  * Get session
472
472
  *
473
- * Retrieve detailed information about a specific OpenCode session.
473
+ * Retrieve detailed information about a specific Matrix session.
474
474
  */
475
475
  get<ThrowOnError extends boolean = false>(parameters: {
476
476
  sessionID: string;
@@ -1173,7 +1173,7 @@ export declare class Instance extends HeyApiClient {
1173
1173
  /**
1174
1174
  * Dispose instance
1175
1175
  *
1176
- * Clean up and dispose the current OpenCode instance, releasing all resources.
1176
+ * Clean up and dispose the current Matrix instance, releasing all resources.
1177
1177
  */
1178
1178
  dispose<ThrowOnError extends boolean = false>(parameters?: {
1179
1179
  directory?: string;
@@ -1184,7 +1184,7 @@ export declare class Path extends HeyApiClient {
1184
1184
  /**
1185
1185
  * Get paths
1186
1186
  *
1187
- * Retrieve the current working directory and related path information for the OpenCode instance.
1187
+ * Retrieve the current working directory and related path information for the Matrix instance.
1188
1188
  */
1189
1189
  get<ThrowOnError extends boolean = false>(parameters?: {
1190
1190
  directory?: string;
@@ -1216,7 +1216,7 @@ export declare class Command extends HeyApiClient {
1216
1216
  /**
1217
1217
  * List commands
1218
1218
  *
1219
- * Get a list of all available commands in the OpenCode system.
1219
+ * Get a list of all available commands in the Matrix system.
1220
1220
  */
1221
1221
  list<ThrowOnError extends boolean = false>(parameters?: {
1222
1222
  directory?: string;
@@ -1245,8 +1245,8 @@ export declare class Formatter extends HeyApiClient {
1245
1245
  workspace?: string;
1246
1246
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<FormatterStatusResponses, unknown, ThrowOnError, "fields">;
1247
1247
  }
1248
- export declare class OpencodeClient extends HeyApiClient {
1249
- static readonly __registry: HeyApiRegistry<OpencodeClient>;
1248
+ export declare class MatrixClient extends HeyApiClient {
1249
+ static readonly __registry: HeyApiRegistry<MatrixClient>;
1250
1250
  constructor(args?: {
1251
1251
  client?: Client;
1252
1252
  key?: string;
@@ -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 OpencodeClient()" to fix this error.`);
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
  }
@@ -38,7 +38,7 @@ export class Config extends HeyApiClient {
38
38
  /**
39
39
  * Get global configuration
40
40
  *
41
- * Retrieve the current global OpenCode configuration settings and preferences.
41
+ * Retrieve the current global Matrix configuration settings and preferences.
42
42
  */
43
43
  get(options) {
44
44
  return (options?.client ?? this.client).get({
@@ -49,7 +49,7 @@ export class Config extends HeyApiClient {
49
49
  /**
50
50
  * Update global configuration
51
51
  *
52
- * Update global OpenCode configuration settings and preferences.
52
+ * Update global Matrix configuration settings and preferences.
53
53
  */
54
54
  update(parameters, options) {
55
55
  const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }]);
@@ -69,7 +69,7 @@ export class Global extends HeyApiClient {
69
69
  /**
70
70
  * Get health
71
71
  *
72
- * Get health information about the OpenCode server.
72
+ * Get health information about the Matrix server.
73
73
  */
74
74
  health(options) {
75
75
  return (options?.client ?? this.client).get({
@@ -80,7 +80,7 @@ export class Global extends HeyApiClient {
80
80
  /**
81
81
  * Get global events
82
82
  *
83
- * Subscribe to global events from the OpenCode system using server-sent events.
83
+ * Subscribe to global events from the Matrix system using server-sent events.
84
84
  */
85
85
  event(options) {
86
86
  return (options?.client ?? this.client).sse.get({
@@ -91,7 +91,7 @@ export class Global extends HeyApiClient {
91
91
  /**
92
92
  * Dispose instance
93
93
  *
94
- * Clean up and dispose all OpenCode instances, releasing all resources.
94
+ * Clean up and dispose all Matrix instances, releasing all resources.
95
95
  */
96
96
  dispose(options) {
97
97
  return (options?.client ?? this.client).post({
@@ -100,9 +100,9 @@ export class Global extends HeyApiClient {
100
100
  });
101
101
  }
102
102
  /**
103
- * Upgrade opencode
103
+ * Upgrade matrix
104
104
  *
105
- * Upgrade opencode to the specified version or latest if not specified.
105
+ * Upgrade matrix to the specified version or latest if not specified.
106
106
  */
107
107
  upgrade(parameters, options) {
108
108
  const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }]);
@@ -199,7 +199,7 @@ export class App extends HeyApiClient {
199
199
  /**
200
200
  * List agents
201
201
  *
202
- * Get a list of all available AI agents in the OpenCode system.
202
+ * Get a list of all available AI agents in the Matrix system.
203
203
  */
204
204
  agents(parameters, options) {
205
205
  const params = buildClientParams([parameters], [
@@ -219,7 +219,7 @@ export class App extends HeyApiClient {
219
219
  /**
220
220
  * List skills
221
221
  *
222
- * Get a list of all available skills in the OpenCode system.
222
+ * Get a list of all available skills in the Matrix system.
223
223
  */
224
224
  skills(parameters, options) {
225
225
  const params = buildClientParams([parameters], [
@@ -241,7 +241,7 @@ export class Project extends HeyApiClient {
241
241
  /**
242
242
  * List all projects
243
243
  *
244
- * Get a list of projects that have been opened with OpenCode.
244
+ * Get a list of projects that have been opened with Matrix.
245
245
  */
246
246
  list(parameters, options) {
247
247
  const params = buildClientParams([parameters], [
@@ -261,7 +261,7 @@ export class Project extends HeyApiClient {
261
261
  /**
262
262
  * Get current project
263
263
  *
264
- * Retrieve the currently active project that OpenCode is working with.
264
+ * Retrieve the currently active project that Matrix is working with.
265
265
  */
266
266
  current(parameters, options) {
267
267
  const params = buildClientParams([parameters], [
@@ -332,7 +332,7 @@ export class Pty extends HeyApiClient {
332
332
  /**
333
333
  * List PTY sessions
334
334
  *
335
- * Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
335
+ * Get a list of all active pseudo-terminal (PTY) sessions managed by Matrix.
336
336
  */
337
337
  list(parameters, options) {
338
338
  const params = buildClientParams([parameters], [
@@ -475,7 +475,7 @@ export class Config2 extends HeyApiClient {
475
475
  /**
476
476
  * Get configuration
477
477
  *
478
- * Retrieve the current OpenCode configuration settings and preferences.
478
+ * Retrieve the current Matrix configuration settings and preferences.
479
479
  */
480
480
  get(parameters, options) {
481
481
  const params = buildClientParams([parameters], [
@@ -495,7 +495,7 @@ export class Config2 extends HeyApiClient {
495
495
  /**
496
496
  * Update configuration
497
497
  *
498
- * Update OpenCode configuration settings and preferences.
498
+ * Update Matrix configuration settings and preferences.
499
499
  */
500
500
  update(parameters, options) {
501
501
  const params = buildClientParams([parameters], [
@@ -659,7 +659,7 @@ export class Session extends HeyApiClient {
659
659
  /**
660
660
  * List sessions
661
661
  *
662
- * Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
662
+ * Get a list of all Matrix sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
663
663
  */
664
664
  list(parameters, options) {
665
665
  const params = buildClientParams([parameters], [
@@ -823,7 +823,7 @@ export class Session2 extends HeyApiClient {
823
823
  /**
824
824
  * List sessions
825
825
  *
826
- * Get a list of all OpenCode sessions, sorted by most recently updated.
826
+ * Get a list of all Matrix sessions, sorted by most recently updated.
827
827
  */
828
828
  list(parameters, options) {
829
829
  const params = buildClientParams([parameters], [
@@ -847,7 +847,7 @@ export class Session2 extends HeyApiClient {
847
847
  /**
848
848
  * Create session
849
849
  *
850
- * Create a new OpenCode session for interacting with AI assistants and managing conversations.
850
+ * Create a new Matrix session for interacting with AI assistants and managing conversations.
851
851
  */
852
852
  create(parameters, options) {
853
853
  const params = buildClientParams([parameters], [
@@ -917,7 +917,7 @@ export class Session2 extends HeyApiClient {
917
917
  /**
918
918
  * Get session
919
919
  *
920
- * Retrieve detailed information about a specific OpenCode session.
920
+ * Retrieve detailed information about a specific Matrix session.
921
921
  */
922
922
  get(parameters, options) {
923
923
  const params = buildClientParams([parameters], [
@@ -2377,7 +2377,7 @@ export class Instance extends HeyApiClient {
2377
2377
  /**
2378
2378
  * Dispose instance
2379
2379
  *
2380
- * Clean up and dispose the current OpenCode instance, releasing all resources.
2380
+ * Clean up and dispose the current Matrix instance, releasing all resources.
2381
2381
  */
2382
2382
  dispose(parameters, options) {
2383
2383
  const params = buildClientParams([parameters], [
@@ -2399,7 +2399,7 @@ export class Path extends HeyApiClient {
2399
2399
  /**
2400
2400
  * Get paths
2401
2401
  *
2402
- * Retrieve the current working directory and related path information for the OpenCode instance.
2402
+ * Retrieve the current working directory and related path information for the Matrix instance.
2403
2403
  */
2404
2404
  get(parameters, options) {
2405
2405
  const params = buildClientParams([parameters], [
@@ -2464,7 +2464,7 @@ export class Command extends HeyApiClient {
2464
2464
  /**
2465
2465
  * List commands
2466
2466
  *
2467
- * Get a list of all available commands in the OpenCode system.
2467
+ * Get a list of all available commands in the Matrix system.
2468
2468
  */
2469
2469
  list(parameters, options) {
2470
2470
  const params = buildClientParams([parameters], [
@@ -2526,11 +2526,11 @@ export class Formatter extends HeyApiClient {
2526
2526
  });
2527
2527
  }
2528
2528
  }
2529
- export class OpencodeClient extends HeyApiClient {
2529
+ export class MatrixClient extends HeyApiClient {
2530
2530
  static __registry = new HeyApiRegistry();
2531
2531
  constructor(args) {
2532
2532
  super(args);
2533
- OpencodeClient.__registry.set(this, args?.key);
2533
+ MatrixClient.__registry.set(this, args?.key);
2534
2534
  }
2535
2535
  _global;
2536
2536
  get global() {
@@ -1,8 +1,8 @@
1
1
  export * from "./client.js";
2
2
  export * from "./server.js";
3
3
  import type { ServerOptions } from "./server.js";
4
- export declare function createOpencode(options?: ServerOptions): Promise<{
5
- client: import("./client.js").OpencodeClient;
4
+ export declare function createMatrix(options?: ServerOptions): Promise<{
5
+ client: import("./client.js").MatrixClient;
6
6
  server: {
7
7
  url: string;
8
8
  close(): void;
package/dist/v2/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export * from "./client.js";
2
2
  export * from "./server.js";
3
- import { createOpencodeClient } from "./client.js";
4
- import { createOpencodeServer } from "./server.js";
5
- export async function createOpencode(options) {
6
- const server = await createOpencodeServer({
3
+ import { createMatrixClient } from "./client.js";
4
+ import { createMatrixServer } from "./server.js";
5
+ export async function createMatrix(options) {
6
+ const server = await createMatrixServer({
7
7
  ...options,
8
8
  });
9
- const client = createOpencodeClient({
9
+ const client = createMatrixClient({
10
10
  baseUrl: server.url,
11
11
  });
12
12
  return {
@@ -14,10 +14,10 @@ export type TuiOptions = {
14
14
  signal?: AbortSignal;
15
15
  config?: Config;
16
16
  };
17
- export declare function createOpencodeServer(options?: ServerOptions): Promise<{
17
+ export declare function createMatrixServer(options?: ServerOptions): Promise<{
18
18
  url: string;
19
19
  close(): void;
20
20
  }>;
21
- export declare function createOpencodeTui(options?: TuiOptions): {
21
+ export declare function createMatrixTui(options?: TuiOptions): {
22
22
  close(): void;
23
23
  };
package/dist/v2/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import launch from "cross-spawn";
2
2
  import { stop, bindAbort } from "../process.js";
3
- export async function createOpencodeServer(options) {
3
+ export async function createMatrixServer(options) {
4
4
  options = Object.assign({
5
5
  hostname: "127.0.0.1",
6
6
  port: 4096,
@@ -9,10 +9,10 @@ export async function createOpencodeServer(options) {
9
9
  const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`];
10
10
  if (options.config?.logLevel)
11
11
  args.push(`--log-level=${options.config.logLevel}`);
12
- const proc = launch(`opencode`, args, {
12
+ const proc = launch(`matrix`, args, {
13
13
  env: {
14
14
  ...process.env,
15
- OPENCODE_CONFIG_CONTENT: JSON.stringify(options.config ?? {}),
15
+ MATRIX_CONFIG_CONTENT: JSON.stringify(options.config ?? {}),
16
16
  },
17
17
  });
18
18
  let clear = () => { };
@@ -30,7 +30,7 @@ export async function createOpencodeServer(options) {
30
30
  output += chunk.toString();
31
31
  const lines = output.split("\n");
32
32
  for (const line of lines) {
33
- if (line.startsWith("opencode server listening")) {
33
+ if (line.startsWith("matrix server listening")) {
34
34
  const match = line.match(/on\s+(https?:\/\/[^\s]+)/);
35
35
  if (!match) {
36
36
  clear();
@@ -74,7 +74,7 @@ export async function createOpencodeServer(options) {
74
74
  },
75
75
  };
76
76
  }
77
- export function createOpencodeTui(options) {
77
+ export function createMatrixTui(options) {
78
78
  const args = [];
79
79
  if (options?.project) {
80
80
  args.push(`--project=${options.project}`);
@@ -88,11 +88,11 @@ export function createOpencodeTui(options) {
88
88
  if (options?.agent) {
89
89
  args.push(`--agent=${options.agent}`);
90
90
  }
91
- const proc = launch(`opencode`, args, {
91
+ const proc = launch(`matrix`, args, {
92
92
  stdio: "inherit",
93
93
  env: {
94
94
  ...process.env,
95
- OPENCODE_CONFIG_CONTENT: JSON.stringify(options?.config ?? {}),
95
+ MATRIX_CONFIG_CONTENT: JSON.stringify(options?.config ?? {}),
96
96
  },
97
97
  });
98
98
  const clear = bindAbort(proc, options?.signal);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@matrix-ai/sdk",
4
- "version": "1.6.1",
4
+ "version": "1.6.3",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {