@haex-space/vault-sdk 2.5.126 → 2.6.1

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.
@@ -1,7 +1,7 @@
1
1
  import * as nuxt_app from 'nuxt/app';
2
2
  import { ShallowRef } from 'vue';
3
- import { H as HaexVaultSdk } from '../client-Bjbn7M-G.mjs';
4
- import { A as ApplicationContext } from '../types-DkB9cExr.mjs';
3
+ import { H as HaexVaultSdk } from '../client-Cgt1hI4U.mjs';
4
+ import { A as ApplicationContext } from '../types-B1O6KckK.mjs';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
7
7
  declare const _default: nuxt_app.Plugin<{
@@ -1,7 +1,7 @@
1
1
  import * as nuxt_app from 'nuxt/app';
2
2
  import { ShallowRef } from 'vue';
3
- import { H as HaexVaultSdk } from '../client--kKvwWc0.js';
4
- import { A as ApplicationContext } from '../types-DkB9cExr.js';
3
+ import { H as HaexVaultSdk } from '../client-BW9GSwtY.js';
4
+ import { A as ApplicationContext } from '../types-B1O6KckK.js';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
7
7
  declare const _default: nuxt_app.Plugin<{
@@ -248,6 +248,18 @@ var SPACE_COMMANDS = {
248
248
  listBackends: "extension_space_list_backends"
249
249
  };
250
250
 
251
+ // src/commands/shell.ts
252
+ var SHELL_COMMANDS = {
253
+ /** Create a new PTY shell session */
254
+ create: "extension_shell_create",
255
+ /** Write data to a shell session's stdin */
256
+ write: "extension_shell_write",
257
+ /** Resize a shell session's terminal */
258
+ resize: "extension_shell_resize",
259
+ /** Close a shell session */
260
+ close: "extension_shell_close"
261
+ };
262
+
251
263
  // src/api/storage.ts
252
264
  var StorageAPI = class {
253
265
  constructor(client) {
@@ -1140,6 +1152,70 @@ var SpacesAPI = class {
1140
1152
  }
1141
1153
  };
1142
1154
 
1155
+ // src/api/shell.ts
1156
+ var ShellAPI = class {
1157
+ constructor(sdk) {
1158
+ this.sdk = sdk;
1159
+ }
1160
+ /**
1161
+ * Create a new PTY shell session.
1162
+ * Returns a session ID used for subsequent write/resize/close operations.
1163
+ * Listen for shell output via `sdk.shell.onData()`.
1164
+ */
1165
+ async create(options = {}) {
1166
+ return await this.sdk.request(
1167
+ SHELL_COMMANDS.create,
1168
+ { options }
1169
+ );
1170
+ }
1171
+ /**
1172
+ * Write data to a shell session's stdin.
1173
+ * Typically used to forward terminal keystrokes.
1174
+ */
1175
+ async write(sessionId, data) {
1176
+ await this.sdk.request(SHELL_COMMANDS.write, { sessionId, data });
1177
+ }
1178
+ /**
1179
+ * Resize a shell session's terminal.
1180
+ * Should be called when the terminal view is resized.
1181
+ */
1182
+ async resize(sessionId, cols, rows) {
1183
+ await this.sdk.request(SHELL_COMMANDS.resize, { sessionId, cols, rows });
1184
+ }
1185
+ /**
1186
+ * Close a shell session.
1187
+ * This terminates the underlying PTY process.
1188
+ */
1189
+ async close(sessionId) {
1190
+ await this.sdk.request(SHELL_COMMANDS.close, { sessionId });
1191
+ }
1192
+ /**
1193
+ * Register a callback for shell output data.
1194
+ * The callback receives output from the PTY's stdout/stderr.
1195
+ */
1196
+ onData(callback) {
1197
+ this.sdk.on("shell:output", callback);
1198
+ }
1199
+ /**
1200
+ * Register a callback for shell session exit.
1201
+ */
1202
+ onExit(callback) {
1203
+ this.sdk.on("shell:exit", callback);
1204
+ }
1205
+ /**
1206
+ * Remove a shell output callback.
1207
+ */
1208
+ offData(callback) {
1209
+ this.sdk.off("shell:output", callback);
1210
+ }
1211
+ /**
1212
+ * Remove a shell exit callback.
1213
+ */
1214
+ offExit(callback) {
1215
+ this.sdk.off("shell:exit", callback);
1216
+ }
1217
+ };
1218
+
1143
1219
  // src/messages.ts
1144
1220
  var HAEXSPACE_MESSAGE_TYPES = {
1145
1221
  /** Debug message for development/troubleshooting */
@@ -1839,6 +1915,7 @@ var HaexVaultSdk = class {
1839
1915
  this.remoteStorage = new RemoteStorageAPI(this);
1840
1916
  this.localsend = new LocalSendAPI(this);
1841
1917
  this.spaces = new SpacesAPI(this);
1918
+ this.shell = new ShellAPI(this);
1842
1919
  installConsoleForwarding(this.config.debug);
1843
1920
  this.readyPromise = new Promise((resolve) => {
1844
1921
  this.resolveReady = resolve;