@camstack/addon-terminal 0.1.8 → 0.1.9

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/addon.js CHANGED
@@ -38279,7 +38279,11 @@ function buildProfiles(options) {
38279
38279
  label: "System Monitor",
38280
38280
  description: "bottom (btm) — CPU, memory, network and process monitor",
38281
38281
  file: options.btmPath.trim().length > 0 ? options.btmPath.trim() : "btm",
38282
- args: []
38282
+ args: [],
38283
+ ...options.btmPath.trim().length === 0 ? { fallbacks: [{
38284
+ file: "top",
38285
+ args: []
38286
+ }] } : {}
38283
38287
  }];
38284
38288
  if (options.allowShell) profiles.push({
38285
38289
  profileId: "shell",
@@ -38388,11 +38392,17 @@ var TerminalSessionManager = class {
38388
38392
  const cols = clampDimension(input.cols, MAX_COLS);
38389
38393
  const rows = clampDimension(input.rows, MAX_ROWS);
38390
38394
  const sessionId = this.mintId();
38391
- const resolvedFile = this.resolveBinary(profile.file);
38392
- if (resolvedFile === null) throw new Error(`Terminal profile '${profile.profileId}' cannot start: executable '${profile.file}' was not found on PATH. Install it in the server image or set its path in Terminal settings.`);
38395
+ const executable = [{
38396
+ file: profile.file,
38397
+ args: profile.args
38398
+ }, ...profile.fallbacks ?? []].map((candidate) => ({
38399
+ ...candidate,
38400
+ resolvedFile: this.resolveBinary(candidate.file)
38401
+ })).find((candidate) => candidate.resolvedFile !== null);
38402
+ if (executable === void 0) throw new Error(`Terminal profile '${profile.profileId}' cannot start: executable '${profile.file}' was not found on PATH. Install it in the server image or set its path in Terminal settings.`);
38393
38403
  const pty = this.opts.spawn({
38394
- file: resolvedFile,
38395
- args: profile.args,
38404
+ file: executable.resolvedFile,
38405
+ args: executable.args,
38396
38406
  cols,
38397
38407
  rows,
38398
38408
  ...profile.cwd !== void 0 || this.opts.cwd !== void 0 ? { cwd: profile.cwd ?? this.opts.cwd } : {},
package/dist/addon.mjs CHANGED
@@ -38257,7 +38257,11 @@ function buildProfiles(options) {
38257
38257
  label: "System Monitor",
38258
38258
  description: "bottom (btm) — CPU, memory, network and process monitor",
38259
38259
  file: options.btmPath.trim().length > 0 ? options.btmPath.trim() : "btm",
38260
- args: []
38260
+ args: [],
38261
+ ...options.btmPath.trim().length === 0 ? { fallbacks: [{
38262
+ file: "top",
38263
+ args: []
38264
+ }] } : {}
38261
38265
  }];
38262
38266
  if (options.allowShell) profiles.push({
38263
38267
  profileId: "shell",
@@ -38366,11 +38370,17 @@ var TerminalSessionManager = class {
38366
38370
  const cols = clampDimension(input.cols, MAX_COLS);
38367
38371
  const rows = clampDimension(input.rows, MAX_ROWS);
38368
38372
  const sessionId = this.mintId();
38369
- const resolvedFile = this.resolveBinary(profile.file);
38370
- if (resolvedFile === null) throw new Error(`Terminal profile '${profile.profileId}' cannot start: executable '${profile.file}' was not found on PATH. Install it in the server image or set its path in Terminal settings.`);
38373
+ const executable = [{
38374
+ file: profile.file,
38375
+ args: profile.args
38376
+ }, ...profile.fallbacks ?? []].map((candidate) => ({
38377
+ ...candidate,
38378
+ resolvedFile: this.resolveBinary(candidate.file)
38379
+ })).find((candidate) => candidate.resolvedFile !== null);
38380
+ if (executable === void 0) throw new Error(`Terminal profile '${profile.profileId}' cannot start: executable '${profile.file}' was not found on PATH. Install it in the server image or set its path in Terminal settings.`);
38371
38381
  const pty = this.opts.spawn({
38372
- file: resolvedFile,
38373
- args: profile.args,
38382
+ file: executable.resolvedFile,
38383
+ args: executable.args,
38374
38384
  cols,
38375
38385
  rows,
38376
38386
  ...profile.cwd !== void 0 || this.opts.cwd !== void 0 ? { cwd: profile.cwd ?? this.opts.cwd } : {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-terminal",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",