@openspecui/server 3.3.0 → 3.4.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/dist/index.mjs +25 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CliExecutor, CodeEditorThemeSchema, ConfigManager, DASHBOARD_METRIC_KEYS, DashboardConfigSchema, GitConfigSchema, HOSTED_SHELL_PROTOCOL_VERSION, MarkdownParser, OPENSPECUI_HOOKS_VERSION, OpenSpecAdapter, OpenSpecWatcher, OpsxConfigSchema, OpsxKernel, PtyClientMessageSchema, ReactiveContext, TerminalConfigSchema, TerminalRendererEngineSchema, getAllTools, getAvailableTools, getConfiguredTools, getDefaultCliCommandString, getDetectedProjectTools, getToolInitStates, getWatcherRuntimeStatus, initWatcherPool, isWatcherPoolInitialized, sniffGlobalCli, subscribeWatcherRuntimeStatus } from "@openspecui/core";
|
|
1
|
+
import { CliExecutor, CodeEditorThemeSchema, ConfigManager, DASHBOARD_METRIC_KEYS, DashboardConfigSchema, GitConfigSchema, HOSTED_SHELL_PROTOCOL_VERSION, MarkdownParser, OPENSPECUI_HOOKS_VERSION, OpenSpecAdapter, OpenSpecWatcher, OpsxConfigSchema, OpsxKernel, PtyClientMessageSchema, ReactiveContext, TerminalConfigSchema, TerminalRendererEngineSchema, getAllTools, getAvailableTools, getConfiguredTools, getDefaultCliCommandString, getDetectedProjectTools, getToolInitStates, getWatcherRuntimeStatus, initWatcherPool, isWatcherPoolInitialized, resolveTerminalShellDefaults, sniffGlobalCli, subscribeWatcherRuntimeStatus } from "@openspecui/core";
|
|
2
2
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { access, mkdir, readFile, realpath, rm, stat, writeFile } from "node:fs/promises";
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -1423,6 +1423,15 @@ function resolveDefaultShell(platform, env) {
|
|
|
1423
1423
|
if (platform === "windows") return env.ComSpec?.trim() || "cmd.exe";
|
|
1424
1424
|
return env.SHELL?.trim() || "/bin/sh";
|
|
1425
1425
|
}
|
|
1426
|
+
function resolvePtyShellDefaults(opts) {
|
|
1427
|
+
return resolveTerminalShellDefaults({
|
|
1428
|
+
platform: opts.platform,
|
|
1429
|
+
env: {
|
|
1430
|
+
SHELL: opts.env.SHELL,
|
|
1431
|
+
ComSpec: opts.env.ComSpec
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1426
1435
|
function resolvePtyCommand(opts) {
|
|
1427
1436
|
const command = opts.command?.trim();
|
|
1428
1437
|
if (command) return {
|
|
@@ -1560,6 +1569,12 @@ var PtyManager = class {
|
|
|
1560
1569
|
this.defaultCwd = defaultCwd;
|
|
1561
1570
|
this.platform = detectPtyPlatform();
|
|
1562
1571
|
}
|
|
1572
|
+
getShellDefaults() {
|
|
1573
|
+
return resolvePtyShellDefaults({
|
|
1574
|
+
platform: this.platform,
|
|
1575
|
+
env: process.env
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1563
1578
|
create(opts) {
|
|
1564
1579
|
const id = `pty-${++this.idCounter}`;
|
|
1565
1580
|
const session = new PtySession(id, {
|
|
@@ -3039,6 +3054,15 @@ const configRouter = router({
|
|
|
3039
3054
|
}),
|
|
3040
3055
|
subscribe: publicProcedure.subscription(({ ctx }) => {
|
|
3041
3056
|
return createReactiveSubscription(() => ctx.configManager.readConfig());
|
|
3057
|
+
}),
|
|
3058
|
+
getTerminalShellDefaults: publicProcedure.query(async () => {
|
|
3059
|
+
return resolveTerminalShellDefaults({
|
|
3060
|
+
platform: process.platform === "win32" ? "windows" : process.platform === "darwin" ? "macos" : "common",
|
|
3061
|
+
env: {
|
|
3062
|
+
SHELL: process.env.SHELL,
|
|
3063
|
+
ComSpec: process.env.ComSpec
|
|
3064
|
+
}
|
|
3065
|
+
});
|
|
3042
3066
|
})
|
|
3043
3067
|
});
|
|
3044
3068
|
/**
|