@opencode-ai/sdk 1.1.24 → 1.1.26

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.
@@ -331,37 +331,32 @@ export class Tool extends HeyApiClient {
331
331
  });
332
332
  }
333
333
  }
334
- export class Instance extends HeyApiClient {
335
- /**
336
- * Dispose instance
337
- *
338
- * Clean up and dispose the current OpenCode instance, releasing all resources.
339
- */
340
- dispose(parameters, options) {
341
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
342
- return (options?.client ?? this.client).post({
343
- url: "/instance/dispose",
344
- ...options,
345
- ...params,
346
- });
347
- }
348
- }
349
- export class Path extends HeyApiClient {
334
+ export class Worktree extends HeyApiClient {
350
335
  /**
351
- * Get paths
336
+ * Remove worktree
352
337
  *
353
- * Retrieve the current working directory and related path information for the OpenCode instance.
338
+ * Remove a git worktree and delete its branch.
354
339
  */
355
- get(parameters, options) {
356
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
357
- return (options?.client ?? this.client).get({
358
- url: "/path",
340
+ remove(parameters, options) {
341
+ const params = buildClientParams([parameters], [
342
+ {
343
+ args: [
344
+ { in: "query", key: "directory" },
345
+ { key: "worktreeRemoveInput", map: "body" },
346
+ ],
347
+ },
348
+ ]);
349
+ return (options?.client ?? this.client).delete({
350
+ url: "/experimental/worktree",
359
351
  ...options,
360
352
  ...params,
353
+ headers: {
354
+ "Content-Type": "application/json",
355
+ ...options?.headers,
356
+ ...params.headers,
357
+ },
361
358
  });
362
359
  }
363
- }
364
- export class Worktree extends HeyApiClient {
365
360
  /**
366
361
  * List worktrees
367
362
  *
@@ -400,22 +395,53 @@ export class Worktree extends HeyApiClient {
400
395
  },
401
396
  });
402
397
  }
398
+ /**
399
+ * Reset worktree
400
+ *
401
+ * Reset a worktree branch to the primary default branch.
402
+ */
403
+ reset(parameters, options) {
404
+ const params = buildClientParams([parameters], [
405
+ {
406
+ args: [
407
+ { in: "query", key: "directory" },
408
+ { key: "worktreeResetInput", map: "body" },
409
+ ],
410
+ },
411
+ ]);
412
+ return (options?.client ?? this.client).post({
413
+ url: "/experimental/worktree/reset",
414
+ ...options,
415
+ ...params,
416
+ headers: {
417
+ "Content-Type": "application/json",
418
+ ...options?.headers,
419
+ ...params.headers,
420
+ },
421
+ });
422
+ }
403
423
  }
404
- export class Vcs extends HeyApiClient {
424
+ export class Resource extends HeyApiClient {
405
425
  /**
406
- * Get VCS info
426
+ * Get MCP resources
407
427
  *
408
- * Retrieve version control system (VCS) information for the current project, such as git branch.
428
+ * Get all available MCP resources from connected servers. Optionally filter by name.
409
429
  */
410
- get(parameters, options) {
430
+ list(parameters, options) {
411
431
  const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
412
432
  return (options?.client ?? this.client).get({
413
- url: "/vcs",
433
+ url: "/experimental/resource",
414
434
  ...options,
415
435
  ...params,
416
436
  });
417
437
  }
418
438
  }
439
+ export class Experimental extends HeyApiClient {
440
+ _resource;
441
+ get resource() {
442
+ return (this._resource ??= new Resource({ client: this.client }));
443
+ }
444
+ }
419
445
  export class Session extends HeyApiClient {
420
446
  /**
421
447
  * List sessions
@@ -702,9 +728,9 @@ export class Session extends HeyApiClient {
702
728
  });
703
729
  }
704
730
  /**
705
- * Get session diff
731
+ * Get message diff
706
732
  *
707
- * Get all file changes (diffs) made during this session.
733
+ * Get the file changes (diff) that resulted from a specific user message in the session.
708
734
  */
709
735
  diff(parameters, options) {
710
736
  const params = buildClientParams([parameters], [
@@ -1146,21 +1172,6 @@ export class Question extends HeyApiClient {
1146
1172
  });
1147
1173
  }
1148
1174
  }
1149
- export class Command extends HeyApiClient {
1150
- /**
1151
- * List commands
1152
- *
1153
- * Get a list of all available commands in the OpenCode system.
1154
- */
1155
- list(parameters, options) {
1156
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1157
- return (options?.client ?? this.client).get({
1158
- url: "/command",
1159
- ...options,
1160
- ...params,
1161
- });
1162
- }
1163
- }
1164
1175
  export class Oauth extends HeyApiClient {
1165
1176
  /**
1166
1177
  * OAuth authorize
@@ -1368,49 +1379,6 @@ export class File extends HeyApiClient {
1368
1379
  });
1369
1380
  }
1370
1381
  }
1371
- export class App extends HeyApiClient {
1372
- /**
1373
- * Write log
1374
- *
1375
- * Write a log entry to the server logs with specified level and metadata.
1376
- */
1377
- log(parameters, options) {
1378
- const params = buildClientParams([parameters], [
1379
- {
1380
- args: [
1381
- { in: "query", key: "directory" },
1382
- { in: "body", key: "service" },
1383
- { in: "body", key: "level" },
1384
- { in: "body", key: "message" },
1385
- { in: "body", key: "extra" },
1386
- ],
1387
- },
1388
- ]);
1389
- return (options?.client ?? this.client).post({
1390
- url: "/log",
1391
- ...options,
1392
- ...params,
1393
- headers: {
1394
- "Content-Type": "application/json",
1395
- ...options?.headers,
1396
- ...params.headers,
1397
- },
1398
- });
1399
- }
1400
- /**
1401
- * List agents
1402
- *
1403
- * Get a list of all available AI agents in the OpenCode system.
1404
- */
1405
- agents(parameters, options) {
1406
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1407
- return (options?.client ?? this.client).get({
1408
- url: "/agent",
1409
- ...options,
1410
- ...params,
1411
- });
1412
- }
1413
- }
1414
1382
  export class Auth extends HeyApiClient {
1415
1383
  /**
1416
1384
  * Remove MCP OAuth
@@ -1580,57 +1548,6 @@ export class Mcp extends HeyApiClient {
1580
1548
  return (this._auth ??= new Auth({ client: this.client }));
1581
1549
  }
1582
1550
  }
1583
- export class Resource extends HeyApiClient {
1584
- /**
1585
- * Get MCP resources
1586
- *
1587
- * Get all available MCP resources from connected servers. Optionally filter by name.
1588
- */
1589
- list(parameters, options) {
1590
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1591
- return (options?.client ?? this.client).get({
1592
- url: "/experimental/resource",
1593
- ...options,
1594
- ...params,
1595
- });
1596
- }
1597
- }
1598
- export class Experimental extends HeyApiClient {
1599
- _resource;
1600
- get resource() {
1601
- return (this._resource ??= new Resource({ client: this.client }));
1602
- }
1603
- }
1604
- export class Lsp extends HeyApiClient {
1605
- /**
1606
- * Get LSP status
1607
- *
1608
- * Get LSP server status
1609
- */
1610
- status(parameters, options) {
1611
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1612
- return (options?.client ?? this.client).get({
1613
- url: "/lsp",
1614
- ...options,
1615
- ...params,
1616
- });
1617
- }
1618
- }
1619
- export class Formatter extends HeyApiClient {
1620
- /**
1621
- * Get formatter status
1622
- *
1623
- * Get formatter status
1624
- */
1625
- status(parameters, options) {
1626
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1627
- return (options?.client ?? this.client).get({
1628
- url: "/formatter",
1629
- ...options,
1630
- ...params,
1631
- });
1632
- }
1633
- }
1634
1551
  export class Control extends HeyApiClient {
1635
1552
  /**
1636
1553
  * Get next TUI request
@@ -1869,6 +1786,152 @@ export class Tui extends HeyApiClient {
1869
1786
  return (this._control ??= new Control({ client: this.client }));
1870
1787
  }
1871
1788
  }
1789
+ export class Instance extends HeyApiClient {
1790
+ /**
1791
+ * Dispose instance
1792
+ *
1793
+ * Clean up and dispose the current OpenCode instance, releasing all resources.
1794
+ */
1795
+ dispose(parameters, options) {
1796
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1797
+ return (options?.client ?? this.client).post({
1798
+ url: "/instance/dispose",
1799
+ ...options,
1800
+ ...params,
1801
+ });
1802
+ }
1803
+ }
1804
+ export class Path extends HeyApiClient {
1805
+ /**
1806
+ * Get paths
1807
+ *
1808
+ * Retrieve the current working directory and related path information for the OpenCode instance.
1809
+ */
1810
+ get(parameters, options) {
1811
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1812
+ return (options?.client ?? this.client).get({
1813
+ url: "/path",
1814
+ ...options,
1815
+ ...params,
1816
+ });
1817
+ }
1818
+ }
1819
+ export class Vcs extends HeyApiClient {
1820
+ /**
1821
+ * Get VCS info
1822
+ *
1823
+ * Retrieve version control system (VCS) information for the current project, such as git branch.
1824
+ */
1825
+ get(parameters, options) {
1826
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1827
+ return (options?.client ?? this.client).get({
1828
+ url: "/vcs",
1829
+ ...options,
1830
+ ...params,
1831
+ });
1832
+ }
1833
+ }
1834
+ export class Command extends HeyApiClient {
1835
+ /**
1836
+ * List commands
1837
+ *
1838
+ * Get a list of all available commands in the OpenCode system.
1839
+ */
1840
+ list(parameters, options) {
1841
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1842
+ return (options?.client ?? this.client).get({
1843
+ url: "/command",
1844
+ ...options,
1845
+ ...params,
1846
+ });
1847
+ }
1848
+ }
1849
+ export class App extends HeyApiClient {
1850
+ /**
1851
+ * Write log
1852
+ *
1853
+ * Write a log entry to the server logs with specified level and metadata.
1854
+ */
1855
+ log(parameters, options) {
1856
+ const params = buildClientParams([parameters], [
1857
+ {
1858
+ args: [
1859
+ { in: "query", key: "directory" },
1860
+ { in: "body", key: "service" },
1861
+ { in: "body", key: "level" },
1862
+ { in: "body", key: "message" },
1863
+ { in: "body", key: "extra" },
1864
+ ],
1865
+ },
1866
+ ]);
1867
+ return (options?.client ?? this.client).post({
1868
+ url: "/log",
1869
+ ...options,
1870
+ ...params,
1871
+ headers: {
1872
+ "Content-Type": "application/json",
1873
+ ...options?.headers,
1874
+ ...params.headers,
1875
+ },
1876
+ });
1877
+ }
1878
+ /**
1879
+ * List agents
1880
+ *
1881
+ * Get a list of all available AI agents in the OpenCode system.
1882
+ */
1883
+ agents(parameters, options) {
1884
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1885
+ return (options?.client ?? this.client).get({
1886
+ url: "/agent",
1887
+ ...options,
1888
+ ...params,
1889
+ });
1890
+ }
1891
+ /**
1892
+ * List skills
1893
+ *
1894
+ * Get a list of all available skills in the OpenCode system.
1895
+ */
1896
+ skills(parameters, options) {
1897
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1898
+ return (options?.client ?? this.client).get({
1899
+ url: "/skill",
1900
+ ...options,
1901
+ ...params,
1902
+ });
1903
+ }
1904
+ }
1905
+ export class Lsp extends HeyApiClient {
1906
+ /**
1907
+ * Get LSP status
1908
+ *
1909
+ * Get LSP server status
1910
+ */
1911
+ status(parameters, options) {
1912
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1913
+ return (options?.client ?? this.client).get({
1914
+ url: "/lsp",
1915
+ ...options,
1916
+ ...params,
1917
+ });
1918
+ }
1919
+ }
1920
+ export class Formatter extends HeyApiClient {
1921
+ /**
1922
+ * Get formatter status
1923
+ *
1924
+ * Get formatter status
1925
+ */
1926
+ status(parameters, options) {
1927
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1928
+ return (options?.client ?? this.client).get({
1929
+ url: "/formatter",
1930
+ ...options,
1931
+ ...params,
1932
+ });
1933
+ }
1934
+ }
1872
1935
  export class Auth2 extends HeyApiClient {
1873
1936
  /**
1874
1937
  * Set auth credentials
@@ -1938,21 +2001,13 @@ export class OpencodeClient extends HeyApiClient {
1938
2001
  get tool() {
1939
2002
  return (this._tool ??= new Tool({ client: this.client }));
1940
2003
  }
1941
- _instance;
1942
- get instance() {
1943
- return (this._instance ??= new Instance({ client: this.client }));
1944
- }
1945
- _path;
1946
- get path() {
1947
- return (this._path ??= new Path({ client: this.client }));
1948
- }
1949
2004
  _worktree;
1950
2005
  get worktree() {
1951
2006
  return (this._worktree ??= new Worktree({ client: this.client }));
1952
2007
  }
1953
- _vcs;
1954
- get vcs() {
1955
- return (this._vcs ??= new Vcs({ client: this.client }));
2008
+ _experimental;
2009
+ get experimental() {
2010
+ return (this._experimental ??= new Experimental({ client: this.client }));
1956
2011
  }
1957
2012
  _session;
1958
2013
  get session() {
@@ -1970,10 +2025,6 @@ export class OpencodeClient extends HeyApiClient {
1970
2025
  get question() {
1971
2026
  return (this._question ??= new Question({ client: this.client }));
1972
2027
  }
1973
- _command;
1974
- get command() {
1975
- return (this._command ??= new Command({ client: this.client }));
1976
- }
1977
2028
  _provider;
1978
2029
  get provider() {
1979
2030
  return (this._provider ??= new Provider({ client: this.client }));
@@ -1986,17 +2037,33 @@ export class OpencodeClient extends HeyApiClient {
1986
2037
  get file() {
1987
2038
  return (this._file ??= new File({ client: this.client }));
1988
2039
  }
1989
- _app;
1990
- get app() {
1991
- return (this._app ??= new App({ client: this.client }));
1992
- }
1993
2040
  _mcp;
1994
2041
  get mcp() {
1995
2042
  return (this._mcp ??= new Mcp({ client: this.client }));
1996
2043
  }
1997
- _experimental;
1998
- get experimental() {
1999
- return (this._experimental ??= new Experimental({ client: this.client }));
2044
+ _tui;
2045
+ get tui() {
2046
+ return (this._tui ??= new Tui({ client: this.client }));
2047
+ }
2048
+ _instance;
2049
+ get instance() {
2050
+ return (this._instance ??= new Instance({ client: this.client }));
2051
+ }
2052
+ _path;
2053
+ get path() {
2054
+ return (this._path ??= new Path({ client: this.client }));
2055
+ }
2056
+ _vcs;
2057
+ get vcs() {
2058
+ return (this._vcs ??= new Vcs({ client: this.client }));
2059
+ }
2060
+ _command;
2061
+ get command() {
2062
+ return (this._command ??= new Command({ client: this.client }));
2063
+ }
2064
+ _app;
2065
+ get app() {
2066
+ return (this._app ??= new App({ client: this.client }));
2000
2067
  }
2001
2068
  _lsp;
2002
2069
  get lsp() {
@@ -2006,10 +2073,6 @@ export class OpencodeClient extends HeyApiClient {
2006
2073
  get formatter() {
2007
2074
  return (this._formatter ??= new Formatter({ client: this.client }));
2008
2075
  }
2009
- _tui;
2010
- get tui() {
2011
- return (this._tui ??= new Tui({ client: this.client }));
2012
- }
2013
2076
  _auth;
2014
2077
  get auth() {
2015
2078
  return (this._auth ??= new Auth2({ client: this.client }));