Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/prompts/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,15 @@ export class PromptStore {
}

private ensureDefaultFiles(): void {
if (existsSync(this.paths.defaultsDir)) {
return
}

try {
mkdirSync(this.paths.defaultsDir, { recursive: true })
mkdirSync(this.paths.globalOverridesDir, { recursive: true })
if (!existsSync(this.paths.globalOverridesDir)) {
mkdirSync(this.paths.globalOverridesDir, { recursive: true })
}
} catch {
this.logger.warn("Failed to initialize prompt directories", {
defaultsDir: this.paths.defaultsDir,
Expand Down
13 changes: 12 additions & 1 deletion lib/v2/tui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { panelTheme } from "./theme"
export async function setup(ctx: Plugin.Context) {
const client = ctx.client.rpc(rpc)
const options = () => ({ location: ctx.location ?? ctx.data.location.default() })
if (!(await client.status({}, options())).enabled) return
const api: ViewApi = {
renderer: ctx.renderer,
theme: {
Expand Down Expand Up @@ -37,6 +36,18 @@ export async function setup(ctx: Plugin.Context) {
}
const sessionID = route.sessionID
try {
const status = await client.status({}, options())
if (!status.enabled) {
show(() => (
<StatusDialog
api={api}
title="DCP"
eyebrow="Disabled"
message="DCP is disabled in configuration."
/>
))
return
}
const data = await client.snapshot({ sessionID }, options())
const back = () => {
void open()
Expand Down