@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.
@@ -33,6 +33,16 @@ declare const EXTERNAL_EVENTS: {
33
33
  readonly AUTHORIZATION_REQUEST: "external:authorization-request";
34
34
  };
35
35
  type ExternalEvent = typeof EXTERNAL_EVENTS[keyof typeof EXTERNAL_EVENTS];
36
+ /**
37
+ * Events for shell/PTY sessions
38
+ */
39
+ declare const SHELL_EVENTS: {
40
+ /** PTY output data from a shell session */
41
+ readonly OUTPUT: "shell:output";
42
+ /** Shell session has exited */
43
+ readonly EXIT: "shell:exit";
44
+ };
45
+ type ShellEvent = typeof SHELL_EVENTS[keyof typeof SHELL_EVENTS];
36
46
 
37
47
  declare const DEFAULT_TIMEOUT = 30000;
38
48
  declare const TABLE_SEPARATOR = "__";
@@ -381,4 +391,4 @@ declare class HaexVaultSdkError extends Error {
381
391
  };
382
392
  }
383
393
 
384
- export { type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type PermissionDeniedError as G, type HaexHubConfig as H, type IdentityClaim as I, type PermissionErrorBase as J, PermissionErrorCode as K, type PermissionPromptError as L, type Migration as M, PermissionStatus as N, type SearchQuery as O, type PermissionResponse as P, type SearchRequestEvent as Q, type SyncTablesUpdatedEvent as R, type SearchResult as S, TABLE_SEPARATOR as T, getTableName as U, isPermissionDeniedError as V, type WebRequestOptions as W, isPermissionError as X, isPermissionPromptError as Y, type ExtensionInfo as a, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type DatabasePermissionRequest as f, type EventCallback as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
394
+ export { type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type PermissionDeniedError as G, type HaexHubConfig as H, type IdentityClaim as I, type PermissionErrorBase as J, PermissionErrorCode as K, type PermissionPromptError as L, type Migration as M, PermissionStatus as N, SHELL_EVENTS as O, type PermissionResponse as P, type SearchQuery as Q, type SearchRequestEvent as R, type SearchResult as S, type ShellEvent as T, type SyncTablesUpdatedEvent as U, TABLE_SEPARATOR as V, type WebRequestOptions as W, getTableName as X, isPermissionDeniedError as Y, isPermissionError as Z, isPermissionPromptError as _, type ExtensionInfo as a, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type EventCallback as f, type DatabasePermissionRequest as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
@@ -33,6 +33,16 @@ declare const EXTERNAL_EVENTS: {
33
33
  readonly AUTHORIZATION_REQUEST: "external:authorization-request";
34
34
  };
35
35
  type ExternalEvent = typeof EXTERNAL_EVENTS[keyof typeof EXTERNAL_EVENTS];
36
+ /**
37
+ * Events for shell/PTY sessions
38
+ */
39
+ declare const SHELL_EVENTS: {
40
+ /** PTY output data from a shell session */
41
+ readonly OUTPUT: "shell:output";
42
+ /** Shell session has exited */
43
+ readonly EXIT: "shell:exit";
44
+ };
45
+ type ShellEvent = typeof SHELL_EVENTS[keyof typeof SHELL_EVENTS];
36
46
 
37
47
  declare const DEFAULT_TIMEOUT = 30000;
38
48
  declare const TABLE_SEPARATOR = "__";
@@ -381,4 +391,4 @@ declare class HaexVaultSdkError extends Error {
381
391
  };
382
392
  }
383
393
 
384
- export { type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type PermissionDeniedError as G, type HaexHubConfig as H, type IdentityClaim as I, type PermissionErrorBase as J, PermissionErrorCode as K, type PermissionPromptError as L, type Migration as M, PermissionStatus as N, type SearchQuery as O, type PermissionResponse as P, type SearchRequestEvent as Q, type SyncTablesUpdatedEvent as R, type SearchResult as S, TABLE_SEPARATOR as T, getTableName as U, isPermissionDeniedError as V, type WebRequestOptions as W, isPermissionError as X, isPermissionPromptError as Y, type ExtensionInfo as a, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type DatabasePermissionRequest as f, type EventCallback as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
394
+ export { type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type PermissionDeniedError as G, type HaexHubConfig as H, type IdentityClaim as I, type PermissionErrorBase as J, PermissionErrorCode as K, type PermissionPromptError as L, type Migration as M, PermissionStatus as N, SHELL_EVENTS as O, type PermissionResponse as P, type SearchQuery as Q, type SearchRequestEvent as R, type SearchResult as S, type ShellEvent as T, type SyncTablesUpdatedEvent as U, TABLE_SEPARATOR as V, type WebRequestOptions as W, getTableName as X, isPermissionDeniedError as Y, isPermissionError as Z, isPermissionPromptError as _, type ExtensionInfo as a, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type EventCallback as f, type DatabasePermissionRequest as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
package/dist/vue.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client-Bjbn7M-G.mjs';
1
+ import { H as HaexVaultSdk, S as StorageAPI } from './client-B_S7ntUI.mjs';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
3
  import { Ref } from 'vue';
4
- import { H as HaexHubConfig } from './types-DkB9cExr.mjs';
4
+ import { H as HaexHubConfig } from './types-B1O6KckK.mjs';
5
5
 
6
6
  /**
7
7
  * Vue 3 composable for HaexVault SDK
package/dist/vue.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client--kKvwWc0.js';
1
+ import { H as HaexVaultSdk, S as StorageAPI } from './client-Bl2s5tIZ.js';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
3
  import { Ref } from 'vue';
4
- import { H as HaexHubConfig } from './types-DkB9cExr.js';
4
+ import { H as HaexHubConfig } from './types-B1O6KckK.js';
5
5
 
6
6
  /**
7
7
  * Vue 3 composable for HaexVault SDK
package/dist/vue.js CHANGED
@@ -614,6 +614,18 @@ var SPACE_COMMANDS = {
614
614
  listBackends: "extension_space_list_backends"
615
615
  };
616
616
 
617
+ // src/commands/shell.ts
618
+ var SHELL_COMMANDS = {
619
+ /** Create a new PTY shell session */
620
+ create: "extension_shell_create",
621
+ /** Write data to a shell session's stdin */
622
+ write: "extension_shell_write",
623
+ /** Resize a shell session's terminal */
624
+ resize: "extension_shell_resize",
625
+ /** Close a shell session */
626
+ close: "extension_shell_close"
627
+ };
628
+
617
629
  // src/api/storage.ts
618
630
  var StorageAPI = class {
619
631
  constructor(client) {
@@ -1481,6 +1493,71 @@ var SpacesAPI = class {
1481
1493
  }
1482
1494
  };
1483
1495
 
1496
+ // src/api/shell.ts
1497
+ var ShellAPI = class {
1498
+ constructor(sdk) {
1499
+ this.sdk = sdk;
1500
+ }
1501
+ /**
1502
+ * Create a new PTY shell session.
1503
+ * Returns a session ID used for subsequent write/resize/close operations.
1504
+ * Listen for shell output via `sdk.shell.onData()`.
1505
+ */
1506
+ async create(options = {}) {
1507
+ const result = await this.sdk.request(
1508
+ SHELL_COMMANDS.create,
1509
+ { options }
1510
+ );
1511
+ return result.sessionId;
1512
+ }
1513
+ /**
1514
+ * Write data to a shell session's stdin.
1515
+ * Typically used to forward terminal keystrokes.
1516
+ */
1517
+ async write(sessionId, data) {
1518
+ await this.sdk.request(SHELL_COMMANDS.write, { sessionId, data });
1519
+ }
1520
+ /**
1521
+ * Resize a shell session's terminal.
1522
+ * Should be called when the terminal view is resized.
1523
+ */
1524
+ async resize(sessionId, cols, rows) {
1525
+ await this.sdk.request(SHELL_COMMANDS.resize, { sessionId, cols, rows });
1526
+ }
1527
+ /**
1528
+ * Close a shell session.
1529
+ * This terminates the underlying PTY process.
1530
+ */
1531
+ async close(sessionId) {
1532
+ await this.sdk.request(SHELL_COMMANDS.close, { sessionId });
1533
+ }
1534
+ /**
1535
+ * Register a callback for shell output data.
1536
+ * The callback receives output from the PTY's stdout/stderr.
1537
+ */
1538
+ onData(callback) {
1539
+ this.sdk.on("shell:output", callback);
1540
+ }
1541
+ /**
1542
+ * Register a callback for shell session exit.
1543
+ */
1544
+ onExit(callback) {
1545
+ this.sdk.on("shell:exit", callback);
1546
+ }
1547
+ /**
1548
+ * Remove a shell output callback.
1549
+ */
1550
+ offData(callback) {
1551
+ this.sdk.off("shell:output", callback);
1552
+ }
1553
+ /**
1554
+ * Remove a shell exit callback.
1555
+ */
1556
+ offExit(callback) {
1557
+ this.sdk.off("shell:exit", callback);
1558
+ }
1559
+ };
1560
+
1484
1561
  // src/client/tableName.ts
1485
1562
  function validatePublicKey(publicKey) {
1486
1563
  if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
@@ -2106,6 +2183,7 @@ var HaexVaultSdk = class {
2106
2183
  this.remoteStorage = new RemoteStorageAPI(this);
2107
2184
  this.localsend = new LocalSendAPI(this);
2108
2185
  this.spaces = new SpacesAPI(this);
2186
+ this.shell = new ShellAPI(this);
2109
2187
  installConsoleForwarding(this.config.debug);
2110
2188
  this.readyPromise = new Promise((resolve) => {
2111
2189
  this.resolveReady = resolve;