@computesdk/workbench 3.1.6 → 3.1.7

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/index.js CHANGED
@@ -1537,6 +1537,53 @@ function injectWorkbenchCommands(replServer, state) {
1537
1537
  };
1538
1538
  }
1539
1539
  };
1540
+ replServer.context.server = {
1541
+ get start() {
1542
+ return async (options) => {
1543
+ const sandbox = state.currentSandbox;
1544
+ if (!sandbox) {
1545
+ throw new Error("No active sandbox. Run a command to auto-create one.");
1546
+ }
1547
+ return sandbox.server.start(options);
1548
+ };
1549
+ },
1550
+ get list() {
1551
+ return async () => {
1552
+ const sandbox = state.currentSandbox;
1553
+ if (!sandbox) {
1554
+ throw new Error("No active sandbox. Run a command to auto-create one.");
1555
+ }
1556
+ return sandbox.server.list();
1557
+ };
1558
+ },
1559
+ get retrieve() {
1560
+ return async (slug) => {
1561
+ const sandbox = state.currentSandbox;
1562
+ if (!sandbox) {
1563
+ throw new Error("No active sandbox. Run a command to auto-create one.");
1564
+ }
1565
+ return sandbox.server.retrieve(slug);
1566
+ };
1567
+ },
1568
+ get stop() {
1569
+ return async (slug) => {
1570
+ const sandbox = state.currentSandbox;
1571
+ if (!sandbox) {
1572
+ throw new Error("No active sandbox. Run a command to auto-create one.");
1573
+ }
1574
+ return sandbox.server.stop(slug);
1575
+ };
1576
+ },
1577
+ get restart() {
1578
+ return async (slug) => {
1579
+ const sandbox = state.currentSandbox;
1580
+ if (!sandbox) {
1581
+ throw new Error("No active sandbox. Run a command to auto-create one.");
1582
+ }
1583
+ return sandbox.server.restart(slug);
1584
+ };
1585
+ }
1586
+ };
1540
1587
  replServer.context.terminal = {
1541
1588
  get create() {
1542
1589
  return async (options) => {