@todesktop/shared 7.192.0 → 7.194.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @todesktop/shared
2
2
 
3
+ ## 7.194.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dc5fe40: Add build introspection feature for interactive shell access to
8
+ in-progress builds
9
+ - `todesktop build --introspect` enables introspection on all platforms during
10
+ build creation
11
+ - New `todesktop introspect [buildId]` command for connecting to running
12
+ builds with interactive shell access
13
+ - Agent Introspection Service (AIS) runs on build agents, providing secure
14
+ WebSocket terminal access via Cloudflare Quick Tunnels
15
+ - Firebase function `startIntrospectionSession` handles authentication and
16
+ session management
17
+ - Builds with introspection sessions cannot be released (security safeguard)
18
+ - Session limits: 30 min inactivity timeout, 60 min absolute TTL, single
19
+ concurrent session per platform
20
+
3
21
  ## 7.191.1
4
22
 
5
23
  ### Patch Changes
@@ -3,6 +3,8 @@ export * from './desktopify';
3
3
  export * from './desktopify2';
4
4
  export * from './getSiteInfo';
5
5
  export * from './hsm';
6
+ export * from './introspection/breakpoints';
7
+ export * from './introspection/status';
6
8
  export * from './invitePermissionLabels';
7
9
  export * from './personalAccessTokens';
8
10
  export * from './plans';
package/lib/cjs/index.js CHANGED
@@ -24,6 +24,8 @@ __exportStar(require("./desktopify"), exports);
24
24
  __exportStar(require("./desktopify2"), exports);
25
25
  __exportStar(require("./getSiteInfo"), exports);
26
26
  __exportStar(require("./hsm"), exports);
27
+ __exportStar(require("./introspection/breakpoints"), exports);
28
+ __exportStar(require("./introspection/status"), exports);
27
29
  __exportStar(require("./invitePermissionLabels"), exports);
28
30
  __exportStar(require("./personalAccessTokens"), exports);
29
31
  __exportStar(require("./plans"), exports);
@@ -0,0 +1,17 @@
1
+ import type { Build, IntrospectBreakpointStatus, IntrospectShellStatus } from '../desktopify';
2
+ export type IntrospectPlatformName = 'linux' | 'mac' | 'windows';
3
+ /**
4
+ * Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
5
+ * Builds that were introspected cannot be released.
6
+ */
7
+ export declare function wasIntrospected(build: Build): boolean;
8
+ /**
9
+ * Get list of platform names that were introspected (have connectedAt or disconnectedAt).
10
+ * Returns capitalized platform names (e.g., ['Mac', 'Windows']).
11
+ */
12
+ export declare function getIntrospectedPlatformNames(build: Build): string[];
13
+ /**
14
+ * Format introspection status as a human-readable string.
15
+ * Combines breakpoint status and shell status into a single label.
16
+ */
17
+ export declare function formatIntrospectionStatus(breakpointStatus?: IntrospectBreakpointStatus, shellStatus?: IntrospectShellStatus): string;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wasIntrospected = wasIntrospected;
4
+ exports.getIntrospectedPlatformNames = getIntrospectedPlatformNames;
5
+ exports.formatIntrospectionStatus = formatIntrospectionStatus;
6
+ const PLATFORM_LABELS = {
7
+ linux: 'Linux',
8
+ mac: 'Mac',
9
+ windows: 'Windows',
10
+ };
11
+ /**
12
+ * Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
13
+ * Builds that were introspected cannot be released.
14
+ */
15
+ function wasIntrospected(build) {
16
+ const { introspect } = build;
17
+ if (!introspect)
18
+ return false;
19
+ const platforms = ['mac', 'windows', 'linux'];
20
+ for (const platform of platforms) {
21
+ const data = introspect[platform];
22
+ if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
23
+ return true;
24
+ }
25
+ }
26
+ return false;
27
+ }
28
+ /**
29
+ * Get list of platform names that were introspected (have connectedAt or disconnectedAt).
30
+ * Returns capitalized platform names (e.g., ['Mac', 'Windows']).
31
+ */
32
+ function getIntrospectedPlatformNames(build) {
33
+ const { introspect } = build;
34
+ if (!introspect)
35
+ return [];
36
+ const platforms = ['mac', 'windows', 'linux'];
37
+ const result = [];
38
+ for (const platform of platforms) {
39
+ const data = introspect[platform];
40
+ if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
41
+ result.push(PLATFORM_LABELS[platform]);
42
+ }
43
+ }
44
+ return result;
45
+ }
46
+ /**
47
+ * Format introspection status as a human-readable string.
48
+ * Combines breakpoint status and shell status into a single label.
49
+ */
50
+ function formatIntrospectionStatus(breakpointStatus, shellStatus) {
51
+ if (breakpointStatus === 'paused') {
52
+ if (shellStatus === 'connected') {
53
+ return 'paused (shell connected)';
54
+ }
55
+ if (shellStatus === 'disconnected') {
56
+ return 'paused (shell disconnected)';
57
+ }
58
+ return 'paused';
59
+ }
60
+ if (breakpointStatus === 'ready') {
61
+ if (shellStatus === 'connected') {
62
+ return 'ready (shell connected)';
63
+ }
64
+ if (shellStatus === 'disconnected') {
65
+ return 'ready (shell disconnected)';
66
+ }
67
+ return 'ready';
68
+ }
69
+ if (breakpointStatus === 'resuming') {
70
+ return 'resuming';
71
+ }
72
+ if (breakpointStatus === 'initializing') {
73
+ return 'initializing';
74
+ }
75
+ if (breakpointStatus === 'finished') {
76
+ return 'finished';
77
+ }
78
+ if (breakpointStatus === 'error' || shellStatus === 'error') {
79
+ return 'error';
80
+ }
81
+ return 'status unknown';
82
+ }
@@ -4,6 +4,7 @@ export * from './desktopify2.js';
4
4
  export * from './getSiteInfo.js';
5
5
  export * from './hsm.js';
6
6
  export * from './introspection/breakpoints.js';
7
+ export * from './introspection/status.js';
7
8
  export * from './invitePermissionLabels.js';
8
9
  export * from './personalAccessTokens.js';
9
10
  export * from './plans.js';
package/lib/esm/index.js CHANGED
@@ -6,6 +6,7 @@ export * from './desktopify2.js';
6
6
  export * from './getSiteInfo.js';
7
7
  export * from './hsm.js';
8
8
  export * from './introspection/breakpoints.js';
9
+ export * from './introspection/status.js';
9
10
  export * from './invitePermissionLabels.js';
10
11
  export * from './personalAccessTokens.js';
11
12
  export * from './plans.js';
@@ -0,0 +1,17 @@
1
+ import type { Build, IntrospectBreakpointStatus, IntrospectShellStatus } from '../desktopify';
2
+ export type IntrospectPlatformName = 'linux' | 'mac' | 'windows';
3
+ /**
4
+ * Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
5
+ * Builds that were introspected cannot be released.
6
+ */
7
+ export declare function wasIntrospected(build: Build): boolean;
8
+ /**
9
+ * Get list of platform names that were introspected (have connectedAt or disconnectedAt).
10
+ * Returns capitalized platform names (e.g., ['Mac', 'Windows']).
11
+ */
12
+ export declare function getIntrospectedPlatformNames(build: Build): string[];
13
+ /**
14
+ * Format introspection status as a human-readable string.
15
+ * Combines breakpoint status and shell status into a single label.
16
+ */
17
+ export declare function formatIntrospectionStatus(breakpointStatus?: IntrospectBreakpointStatus, shellStatus?: IntrospectShellStatus): string;
@@ -0,0 +1,77 @@
1
+ const PLATFORM_LABELS = {
2
+ linux: 'Linux',
3
+ mac: 'Mac',
4
+ windows: 'Windows',
5
+ };
6
+ /**
7
+ * Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
8
+ * Builds that were introspected cannot be released.
9
+ */
10
+ export function wasIntrospected(build) {
11
+ const { introspect } = build;
12
+ if (!introspect)
13
+ return false;
14
+ const platforms = ['mac', 'windows', 'linux'];
15
+ for (const platform of platforms) {
16
+ const data = introspect[platform];
17
+ if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
18
+ return true;
19
+ }
20
+ }
21
+ return false;
22
+ }
23
+ /**
24
+ * Get list of platform names that were introspected (have connectedAt or disconnectedAt).
25
+ * Returns capitalized platform names (e.g., ['Mac', 'Windows']).
26
+ */
27
+ export function getIntrospectedPlatformNames(build) {
28
+ const { introspect } = build;
29
+ if (!introspect)
30
+ return [];
31
+ const platforms = ['mac', 'windows', 'linux'];
32
+ const result = [];
33
+ for (const platform of platforms) {
34
+ const data = introspect[platform];
35
+ if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
36
+ result.push(PLATFORM_LABELS[platform]);
37
+ }
38
+ }
39
+ return result;
40
+ }
41
+ /**
42
+ * Format introspection status as a human-readable string.
43
+ * Combines breakpoint status and shell status into a single label.
44
+ */
45
+ export function formatIntrospectionStatus(breakpointStatus, shellStatus) {
46
+ if (breakpointStatus === 'paused') {
47
+ if (shellStatus === 'connected') {
48
+ return 'paused (shell connected)';
49
+ }
50
+ if (shellStatus === 'disconnected') {
51
+ return 'paused (shell disconnected)';
52
+ }
53
+ return 'paused';
54
+ }
55
+ if (breakpointStatus === 'ready') {
56
+ if (shellStatus === 'connected') {
57
+ return 'ready (shell connected)';
58
+ }
59
+ if (shellStatus === 'disconnected') {
60
+ return 'ready (shell disconnected)';
61
+ }
62
+ return 'ready';
63
+ }
64
+ if (breakpointStatus === 'resuming') {
65
+ return 'resuming';
66
+ }
67
+ if (breakpointStatus === 'initializing') {
68
+ return 'initializing';
69
+ }
70
+ if (breakpointStatus === 'finished') {
71
+ return 'finished';
72
+ }
73
+ if (breakpointStatus === 'error' || shellStatus === 'error') {
74
+ return 'error';
75
+ }
76
+ return 'status unknown';
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.192.0",
3
+ "version": "7.194.0",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
package/src/index.cjs.ts CHANGED
@@ -8,6 +8,8 @@ export * from './desktopify';
8
8
  export * from './desktopify2';
9
9
  export * from './getSiteInfo';
10
10
  export * from './hsm';
11
+ export * from './introspection/breakpoints';
12
+ export * from './introspection/status';
11
13
  export * from './invitePermissionLabels';
12
14
  export * from './personalAccessTokens';
13
15
  export * from './plans';
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ export * from './desktopify2.js';
7
7
  export * from './getSiteInfo.js';
8
8
  export * from './hsm.js';
9
9
  export * from './introspection/breakpoints.js';
10
+ export * from './introspection/status.js';
10
11
  export * from './invitePermissionLabels.js';
11
12
  export * from './personalAccessTokens.js';
12
13
  export * from './plans.js';
@@ -0,0 +1,101 @@
1
+ import type {
2
+ Build,
3
+ IntrospectBreakpointStatus,
4
+ IntrospectShellStatus,
5
+ } from '../desktopify';
6
+
7
+ export type IntrospectPlatformName = 'linux' | 'mac' | 'windows';
8
+
9
+ const PLATFORM_LABELS: Record<IntrospectPlatformName, string> = {
10
+ linux: 'Linux',
11
+ mac: 'Mac',
12
+ windows: 'Windows',
13
+ };
14
+
15
+ /**
16
+ * Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
17
+ * Builds that were introspected cannot be released.
18
+ */
19
+ export function wasIntrospected(build: Build): boolean {
20
+ const { introspect } = build;
21
+ if (!introspect) return false;
22
+
23
+ const platforms: IntrospectPlatformName[] = ['mac', 'windows', 'linux'];
24
+
25
+ for (const platform of platforms) {
26
+ const data = introspect[platform];
27
+ if (data?.connectedAt || data?.disconnectedAt) {
28
+ return true;
29
+ }
30
+ }
31
+
32
+ return false;
33
+ }
34
+
35
+ /**
36
+ * Get list of platform names that were introspected (have connectedAt or disconnectedAt).
37
+ * Returns capitalized platform names (e.g., ['Mac', 'Windows']).
38
+ */
39
+ export function getIntrospectedPlatformNames(build: Build): string[] {
40
+ const { introspect } = build;
41
+ if (!introspect) return [];
42
+
43
+ const platforms: IntrospectPlatformName[] = ['mac', 'windows', 'linux'];
44
+ const result: string[] = [];
45
+
46
+ for (const platform of platforms) {
47
+ const data = introspect[platform];
48
+ if (data?.connectedAt || data?.disconnectedAt) {
49
+ result.push(PLATFORM_LABELS[platform]);
50
+ }
51
+ }
52
+
53
+ return result;
54
+ }
55
+
56
+ /**
57
+ * Format introspection status as a human-readable string.
58
+ * Combines breakpoint status and shell status into a single label.
59
+ */
60
+ export function formatIntrospectionStatus(
61
+ breakpointStatus?: IntrospectBreakpointStatus,
62
+ shellStatus?: IntrospectShellStatus,
63
+ ): string {
64
+ if (breakpointStatus === 'paused') {
65
+ if (shellStatus === 'connected') {
66
+ return 'paused (shell connected)';
67
+ }
68
+ if (shellStatus === 'disconnected') {
69
+ return 'paused (shell disconnected)';
70
+ }
71
+ return 'paused';
72
+ }
73
+
74
+ if (breakpointStatus === 'ready') {
75
+ if (shellStatus === 'connected') {
76
+ return 'ready (shell connected)';
77
+ }
78
+ if (shellStatus === 'disconnected') {
79
+ return 'ready (shell disconnected)';
80
+ }
81
+ return 'ready';
82
+ }
83
+
84
+ if (breakpointStatus === 'resuming') {
85
+ return 'resuming';
86
+ }
87
+
88
+ if (breakpointStatus === 'initializing') {
89
+ return 'initializing';
90
+ }
91
+
92
+ if (breakpointStatus === 'finished') {
93
+ return 'finished';
94
+ }
95
+
96
+ if (breakpointStatus === 'error' || shellStatus === 'error') {
97
+ return 'error';
98
+ }
99
+
100
+ return 'status unknown';
101
+ }