@industry-theme/xterm-terminal-panel 0.5.22 → 0.5.24
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
|
@@ -32,7 +32,152 @@ import {
|
|
|
32
32
|
context,
|
|
33
33
|
SpanStatusCode
|
|
34
34
|
} from "@opentelemetry/api";
|
|
35
|
-
|
|
35
|
+
// package.json
|
|
36
|
+
var package_default = {
|
|
37
|
+
name: "@industry-theme/xterm-terminal-panel",
|
|
38
|
+
version: "0.5.23",
|
|
39
|
+
description: "Industry-themed xterm.js terminal components with panel framework integration",
|
|
40
|
+
type: "module",
|
|
41
|
+
main: "dist/index.js",
|
|
42
|
+
module: "dist/index.js",
|
|
43
|
+
types: "dist/index.d.ts",
|
|
44
|
+
exports: {
|
|
45
|
+
".": {
|
|
46
|
+
types: "./dist/index.d.ts",
|
|
47
|
+
import: "./dist/index.js",
|
|
48
|
+
require: "./dist/index.js",
|
|
49
|
+
default: "./dist/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./tools": {
|
|
52
|
+
types: "./dist/tools/index.d.ts",
|
|
53
|
+
import: "./dist/tools.bundle.js",
|
|
54
|
+
require: "./dist/tools.bundle.js",
|
|
55
|
+
default: "./dist/tools.bundle.js"
|
|
56
|
+
},
|
|
57
|
+
"./styles.css": "./dist/styles.css",
|
|
58
|
+
"./package.json": "./package.json"
|
|
59
|
+
},
|
|
60
|
+
scripts: {
|
|
61
|
+
build: "bun run clean && bun run build:esm && bun run build:tools && bun run build:types && bun run build:styles",
|
|
62
|
+
"build:esm": "NODE_ENV=production bun build ./index.ts --outdir ./dist --entry-naming [dir]/[name].[ext] --format esm --target browser --external react --external react-dom --external @xterm/xterm --external @xterm/addon-fit --external @xterm/addon-search --external @xterm/addon-web-links --external @xterm/addon-webgl --external @principal-ade/industry-theme --external @principal-ade/panel-framework-core --external @principal-ade/panels --external lucide-react --external clsx --external @opentelemetry/api",
|
|
63
|
+
"build:tools": "bun build ./src/tools/index.ts --outfile ./dist/tools.bundle.js --format esm --target browser",
|
|
64
|
+
"build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
|
|
65
|
+
"build:styles": "cp src/styles/terminal-theme.css dist/styles.css",
|
|
66
|
+
dev: "bun run build --watch",
|
|
67
|
+
test: "bun test",
|
|
68
|
+
"test:watch": "bun test --watch",
|
|
69
|
+
typecheck: "tsc --noEmit",
|
|
70
|
+
lint: "eslint . --ext .ts,.tsx",
|
|
71
|
+
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
|
72
|
+
format: "prettier --write .",
|
|
73
|
+
"format:check": "prettier --check .",
|
|
74
|
+
clean: "rm -rf dist coverage",
|
|
75
|
+
storybook: "storybook dev -p 6009",
|
|
76
|
+
"build-storybook": "storybook build"
|
|
77
|
+
},
|
|
78
|
+
keywords: [
|
|
79
|
+
"terminal",
|
|
80
|
+
"xterm",
|
|
81
|
+
"xterm.js",
|
|
82
|
+
"pty",
|
|
83
|
+
"theme",
|
|
84
|
+
"industry",
|
|
85
|
+
"panel",
|
|
86
|
+
"panel-framework",
|
|
87
|
+
"panel-extension"
|
|
88
|
+
],
|
|
89
|
+
author: "Principal ADE Team",
|
|
90
|
+
license: "MIT",
|
|
91
|
+
dependencies: {
|
|
92
|
+
clsx: "^2.1.1",
|
|
93
|
+
"react-resizable-panels": "^4.7.3"
|
|
94
|
+
},
|
|
95
|
+
peerDependencies: {
|
|
96
|
+
"@opentelemetry/api": ">=1.8.0",
|
|
97
|
+
"@principal-ade/industry-theme": ">=0.1.8",
|
|
98
|
+
"@principal-ade/panel-framework-core": ">=0.5.1",
|
|
99
|
+
"@principal-ade/panel-layouts": ">=0.4.0",
|
|
100
|
+
"@principal-ade/panels": ">=1.0.79",
|
|
101
|
+
"@principal-ade/utcp-panel-event": ">=0.1.0",
|
|
102
|
+
"@xterm/addon-fit": ">=0.10.0",
|
|
103
|
+
"@xterm/addon-search": ">=0.15.0",
|
|
104
|
+
"@xterm/addon-web-links": ">=0.11.0",
|
|
105
|
+
"@xterm/addon-webgl": ">=0.18.0",
|
|
106
|
+
"@xterm/xterm": ">=5.5.0",
|
|
107
|
+
"lucide-react": ">=0.263.0",
|
|
108
|
+
react: ">=19.0.0",
|
|
109
|
+
"react-dom": ">=19.0.0"
|
|
110
|
+
},
|
|
111
|
+
peerDependenciesMeta: {
|
|
112
|
+
"@opentelemetry/api": {
|
|
113
|
+
optional: true
|
|
114
|
+
},
|
|
115
|
+
"lucide-react": {
|
|
116
|
+
optional: true
|
|
117
|
+
},
|
|
118
|
+
"@xterm/addon-webgl": {
|
|
119
|
+
optional: true
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
devDependencies: {
|
|
123
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
124
|
+
"@eslint/js": "^9.32.0",
|
|
125
|
+
"@industry-theme/agent-panels": "^0.3.0",
|
|
126
|
+
"@opentelemetry/api": "^1.9.0",
|
|
127
|
+
"@principal-ade/industry-theme": "^0.1.8",
|
|
128
|
+
"@principal-ade/panel-framework-core": "0.5.1",
|
|
129
|
+
"@principal-ade/panels": "^1.0.79",
|
|
130
|
+
"@principal-ai/repository-abstraction": "^0.5.7",
|
|
131
|
+
"@principal-ai/storybook-addon-otel": "^0.3.22",
|
|
132
|
+
"@storybook/addon-docs": "10.1.2",
|
|
133
|
+
"@storybook/addon-links": "10.1.2",
|
|
134
|
+
"@storybook/addon-onboarding": "10.1.2",
|
|
135
|
+
"@storybook/react-vite": "10.1.2",
|
|
136
|
+
"@types/bun": "latest",
|
|
137
|
+
"@types/node": "^22.15.26",
|
|
138
|
+
"@types/react": "^19.1.12",
|
|
139
|
+
"@types/react-dom": "^19.1.8",
|
|
140
|
+
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
141
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
142
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
143
|
+
"@xterm/addon-fit": "^0.10.0",
|
|
144
|
+
"@xterm/addon-search": "^0.15.0",
|
|
145
|
+
"@xterm/addon-web-links": "^0.11.0",
|
|
146
|
+
"@xterm/addon-webgl": "^0.18.0",
|
|
147
|
+
"@xterm/xterm": "^5.5.0",
|
|
148
|
+
esbuild: "^0.25.8",
|
|
149
|
+
eslint: "^9.32.0",
|
|
150
|
+
"eslint-config-prettier": "^10.1.8",
|
|
151
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
152
|
+
"eslint-plugin-import": "^2.32.0",
|
|
153
|
+
"eslint-plugin-react": "^7.37.2",
|
|
154
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
155
|
+
"eslint-plugin-storybook": "10.1.2",
|
|
156
|
+
"lucide-react": "^0.552.0",
|
|
157
|
+
prettier: "^3.6.2",
|
|
158
|
+
react: "^19.1.1",
|
|
159
|
+
"react-dom": "^19.1.1",
|
|
160
|
+
"react-markdown": "^10.1.0",
|
|
161
|
+
"remark-gfm": "^4.0.1",
|
|
162
|
+
storybook: "10.1.2",
|
|
163
|
+
typescript: "^5.0.4",
|
|
164
|
+
"typescript-eslint": "^8.38.0",
|
|
165
|
+
vite: "^6.0.7"
|
|
166
|
+
},
|
|
167
|
+
files: [
|
|
168
|
+
"dist",
|
|
169
|
+
"README.md",
|
|
170
|
+
"LICENSE"
|
|
171
|
+
],
|
|
172
|
+
repository: {
|
|
173
|
+
type: "git",
|
|
174
|
+
url: "git+https://github.com/industry-theme/xterm-terminal-panel.git"
|
|
175
|
+
},
|
|
176
|
+
homepage: "https://principal-ade.com"
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// src/telemetry.ts
|
|
180
|
+
var PACKAGE_VERSION = package_default.version;
|
|
36
181
|
var TRACER_NAME = "@industry-theme/xterm-terminal-panel";
|
|
37
182
|
var TRACER_VERSION = PACKAGE_VERSION;
|
|
38
183
|
function getTracer() {
|
|
@@ -1975,15 +2120,36 @@ function TerminalTabContentInner(props, ref) {
|
|
|
1975
2120
|
const initSession = async () => {
|
|
1976
2121
|
try {
|
|
1977
2122
|
if (sessionId) {
|
|
2123
|
+
const tracer2 = getTracer();
|
|
2124
|
+
const reconnectSpan = tracer2.startSpan("terminal.session.reconnect", {
|
|
2125
|
+
attributes: {
|
|
2126
|
+
"session.id": sessionId,
|
|
2127
|
+
"session.context": `${terminalContext}:${tab.id}`,
|
|
2128
|
+
"session.isForeign": isForeign
|
|
2129
|
+
}
|
|
2130
|
+
});
|
|
2131
|
+
reconnectSpan.addEvent("terminal.session.reconnecting", {
|
|
2132
|
+
"session.id": sessionId,
|
|
2133
|
+
"reconnect.reason": "component_remount"
|
|
2134
|
+
});
|
|
1978
2135
|
if (isForeign && actions.checkTerminalOwnership) {
|
|
1979
2136
|
const status = await actions.checkTerminalOwnership(sessionId);
|
|
1980
2137
|
if (status.ownedByWindowId && !status.ownedByThisWindow) {
|
|
1981
2138
|
setShouldRenderTerminal(false);
|
|
1982
2139
|
setOwnerWindowId(status.ownedByWindowId);
|
|
2140
|
+
reconnectSpan.addEvent("terminal.session.reconnect_blocked", {
|
|
2141
|
+
"session.id": sessionId,
|
|
2142
|
+
"owner.windowId": status.ownedByWindowId
|
|
2143
|
+
});
|
|
1983
2144
|
}
|
|
1984
2145
|
} else {
|
|
1985
2146
|
await claimAndConnect(sessionId);
|
|
2147
|
+
reconnectSpan.addEvent("terminal.session.reconnected", {
|
|
2148
|
+
"session.id": sessionId
|
|
2149
|
+
});
|
|
1986
2150
|
}
|
|
2151
|
+
reconnectSpan.setStatus({ code: SpanStatusCode.OK });
|
|
2152
|
+
reconnectSpan.end();
|
|
1987
2153
|
setLocalSessionId(sessionId);
|
|
1988
2154
|
setIsInitialized(true);
|
|
1989
2155
|
return;
|
|
@@ -2045,13 +2211,45 @@ function TerminalTabContentInner(props, ref) {
|
|
|
2045
2211
|
if (!actions.onTerminalData) {
|
|
2046
2212
|
return;
|
|
2047
2213
|
}
|
|
2214
|
+
const tracer = getTracer();
|
|
2215
|
+
const subscribeSpan = tracer.startSpan("terminal.data.subscribe", {
|
|
2216
|
+
attributes: {
|
|
2217
|
+
"session.id": localSessionId,
|
|
2218
|
+
"tab.id": tab.id
|
|
2219
|
+
}
|
|
2220
|
+
});
|
|
2221
|
+
subscribeSpan.addEvent("terminal.data.subscribed", {
|
|
2222
|
+
"session.id": localSessionId
|
|
2223
|
+
});
|
|
2048
2224
|
console.log("[TerminalTabContent] SUBSCRIBING to terminal data", { tabId: tab.id, sessionId: localSessionId });
|
|
2225
|
+
let hasReceivedData = false;
|
|
2049
2226
|
const unsubscribe = actions.onTerminalData(localSessionId, (data) => {
|
|
2050
2227
|
if (terminalRef.current) {
|
|
2228
|
+
if (!hasReceivedData) {
|
|
2229
|
+
hasReceivedData = true;
|
|
2230
|
+
subscribeSpan.addEvent("terminal.data.first_received", {
|
|
2231
|
+
"session.id": localSessionId,
|
|
2232
|
+
"data.length": data.length
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2051
2235
|
terminalRef.current.write(data);
|
|
2052
2236
|
}
|
|
2053
2237
|
});
|
|
2238
|
+
subscribeSpan.setStatus({ code: SpanStatusCode.OK });
|
|
2239
|
+
subscribeSpan.end();
|
|
2054
2240
|
return () => {
|
|
2241
|
+
const unsubscribeSpan = tracer.startSpan("terminal.data.unsubscribe", {
|
|
2242
|
+
attributes: {
|
|
2243
|
+
"session.id": localSessionId,
|
|
2244
|
+
"tab.id": tab.id,
|
|
2245
|
+
"data.wasReceived": hasReceivedData
|
|
2246
|
+
}
|
|
2247
|
+
});
|
|
2248
|
+
unsubscribeSpan.addEvent("terminal.data.unsubscribed", {
|
|
2249
|
+
"session.id": localSessionId
|
|
2250
|
+
});
|
|
2251
|
+
unsubscribeSpan.setStatus({ code: SpanStatusCode.OK });
|
|
2252
|
+
unsubscribeSpan.end();
|
|
2055
2253
|
console.log("[TerminalTabContent] UNSUBSCRIBING from terminal data", { tabId: tab.id, sessionId: localSessionId });
|
|
2056
2254
|
unsubscribe();
|
|
2057
2255
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabbedTerminalPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/TabbedTerminalPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAMZ,MAAM,gBAAgB,CAAC;AAkExB,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"TabbedTerminalPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/TabbedTerminalPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAMZ,MAAM,gBAAgB,CAAC;AAkExB,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AA8jDD,eAAO,MAAM,mBAAmB,EAAkC,CAAC,IAAI,SAAS,OAAO,cAAc,EAAE,OAAO,GAAG,WAAW,EAC1H,KAAK,EAAE,wBAAwB,CAAC,IAAI,CAAC,KAClC,KAAK,CAAC,YAAY,CAAC"}
|
package/dist/src/telemetry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { trace, context, SpanStatusCode, type Tracer, type Span } from '@opentelemetry/api';
|
|
2
2
|
export declare const TRACER_NAME = "@industry-theme/xterm-terminal-panel";
|
|
3
|
-
export declare const TRACER_VERSION
|
|
3
|
+
export declare const TRACER_VERSION: string;
|
|
4
4
|
export declare function getTracer(): Tracer;
|
|
5
5
|
export declare function getActiveSpan(): Span | undefined;
|
|
6
6
|
export declare function withSpan<T>(span: Span, fn: () => Promise<T>): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/telemetry.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,EACL,OAAO,EACP,cAAc,EACd,KAAK,MAAM,EACX,KAAK,IAAI,EACV,MAAM,oBAAoB,CAAC;AAM5B,eAAO,MAAM,WAAW,yCAAyC,CAAC;AAClE,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/telemetry.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,EACL,OAAO,EACP,cAAc,EACd,KAAK,MAAM,EACX,KAAK,IAAI,EACV,MAAM,oBAAoB,CAAC;AAM5B,eAAO,MAAM,WAAW,yCAAyC,CAAC;AAClE,eAAO,MAAM,cAAc,QAAkB,CAAC;AAM9C,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAMD,wBAAgB,aAAa,IAAI,IAAI,GAAG,SAAS,CAEhD;AAMD,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAEZ;AAKD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE1D;AAGD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1C,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED