@haex-space/vault-sdk 2.5.126 → 2.6.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.
package/dist/react.mjs CHANGED
@@ -612,6 +612,18 @@ var SPACE_COMMANDS = {
612
612
  listBackends: "extension_space_list_backends"
613
613
  };
614
614
 
615
+ // src/commands/shell.ts
616
+ var SHELL_COMMANDS = {
617
+ /** Create a new PTY shell session */
618
+ create: "extension_shell_create",
619
+ /** Write data to a shell session's stdin */
620
+ write: "extension_shell_write",
621
+ /** Resize a shell session's terminal */
622
+ resize: "extension_shell_resize",
623
+ /** Close a shell session */
624
+ close: "extension_shell_close"
625
+ };
626
+
615
627
  // src/api/storage.ts
616
628
  var StorageAPI = class {
617
629
  constructor(client) {
@@ -1479,6 +1491,71 @@ var SpacesAPI = class {
1479
1491
  }
1480
1492
  };
1481
1493
 
1494
+ // src/api/shell.ts
1495
+ var ShellAPI = class {
1496
+ constructor(sdk) {
1497
+ this.sdk = sdk;
1498
+ }
1499
+ /**
1500
+ * Create a new PTY shell session.
1501
+ * Returns a session ID used for subsequent write/resize/close operations.
1502
+ * Listen for shell output via `sdk.shell.onData()`.
1503
+ */
1504
+ async create(options = {}) {
1505
+ const result = await this.sdk.request(
1506
+ SHELL_COMMANDS.create,
1507
+ { options }
1508
+ );
1509
+ return result.sessionId;
1510
+ }
1511
+ /**
1512
+ * Write data to a shell session's stdin.
1513
+ * Typically used to forward terminal keystrokes.
1514
+ */
1515
+ async write(sessionId, data) {
1516
+ await this.sdk.request(SHELL_COMMANDS.write, { sessionId, data });
1517
+ }
1518
+ /**
1519
+ * Resize a shell session's terminal.
1520
+ * Should be called when the terminal view is resized.
1521
+ */
1522
+ async resize(sessionId, cols, rows) {
1523
+ await this.sdk.request(SHELL_COMMANDS.resize, { sessionId, cols, rows });
1524
+ }
1525
+ /**
1526
+ * Close a shell session.
1527
+ * This terminates the underlying PTY process.
1528
+ */
1529
+ async close(sessionId) {
1530
+ await this.sdk.request(SHELL_COMMANDS.close, { sessionId });
1531
+ }
1532
+ /**
1533
+ * Register a callback for shell output data.
1534
+ * The callback receives output from the PTY's stdout/stderr.
1535
+ */
1536
+ onData(callback) {
1537
+ this.sdk.on("shell:output", callback);
1538
+ }
1539
+ /**
1540
+ * Register a callback for shell session exit.
1541
+ */
1542
+ onExit(callback) {
1543
+ this.sdk.on("shell:exit", callback);
1544
+ }
1545
+ /**
1546
+ * Remove a shell output callback.
1547
+ */
1548
+ offData(callback) {
1549
+ this.sdk.off("shell:output", callback);
1550
+ }
1551
+ /**
1552
+ * Remove a shell exit callback.
1553
+ */
1554
+ offExit(callback) {
1555
+ this.sdk.off("shell:exit", callback);
1556
+ }
1557
+ };
1558
+
1482
1559
  // src/client/tableName.ts
1483
1560
  function validatePublicKey(publicKey) {
1484
1561
  if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
@@ -2104,6 +2181,7 @@ var HaexVaultSdk = class {
2104
2181
  this.remoteStorage = new RemoteStorageAPI(this);
2105
2182
  this.localsend = new LocalSendAPI(this);
2106
2183
  this.spaces = new SpacesAPI(this);
2184
+ this.shell = new ShellAPI(this);
2107
2185
  installConsoleForwarding(this.config.debug);
2108
2186
  this.readyPromise = new Promise((resolve) => {
2109
2187
  this.resolveReady = resolve;