Persist sandbox creation lifecycle events to the activity log, surface progress in the dashboard, and expose controller gateway override diagnostics.
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { NextResponse } from 'next/server'
|
|
import {
|
|
OPENSHELL_BIN,
|
|
OPENSHELL_HOME,
|
|
OPENSHELL_XDG_CONFIG_HOME,
|
|
openshellGatewayAddressEnv,
|
|
} from '@/app/lib/hostCommands'
|
|
|
|
export async function GET() {
|
|
try {
|
|
const gatewayAddressEnv = openshellGatewayAddressEnv()
|
|
return NextResponse.json({
|
|
ok: true,
|
|
enabled: true,
|
|
openshellBin: OPENSHELL_BIN,
|
|
openshellHome: OPENSHELL_HOME,
|
|
xdgConfigHome: OPENSHELL_XDG_CONFIG_HOME,
|
|
gatewayAddressEnv,
|
|
gatewayOverrideActive: Boolean(gatewayAddressEnv.OPENSHELL_GATEWAY_URL || gatewayAddressEnv.OPENSHELL_GATEWAY_HOST),
|
|
note: 'These values are passed to controller-launched OpenShell/NemoClaw child processes. Upstream CLIs must still honor them for full gateway override support.',
|
|
})
|
|
} catch (error) {
|
|
return NextResponse.json(
|
|
{ ok: false, error: error instanceof Error ? error.message : 'Failed to fetch OpenShell config' },
|
|
{ status: 500 }
|
|
)
|
|
}
|
|
}
|
|
|
|
export async function POST() {
|
|
return NextResponse.json(
|
|
{ ok: false, error: 'OpenShell config is read from environment variables or ~/.config/openshell/*.json; update those files and restart the controller.' },
|
|
{ status: 405 }
|
|
)
|
|
}
|