mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Add NIP-89 kind 31990 app management for projects
- AppDialog with app preview card, Blossom icon upload, and collapsible advanced section - AppTool for AI to view/update app with view-before-update guard - Shared buildAppEvent utility for DRY event construction - Auto-fill website from deployment URL, default name from project ID - Add repo 'a' tag when origin is a nostr:// URI owned by the user - Custom tool call rendering with AppWindow icon - System prompt guidance for app publishing workflow and prerequisites - Store app coordinate in .git/shakespeare/app.json via DotAI
This commit is contained in:
10 files changed
+1152
-2
No files matched your search
@@ -393,4 +393,47 @@ export class DotAI {
|
||||
console.warn(`Failed to write .git/ai/FINISH_REASON file: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read app config from .git/shakespeare/app.json file.
|
||||
* Stores the Nostr "a" coordinate for the project's kind 31990 app event.
|
||||
* @returns App config object or null if not found or invalid
|
||||
*/
|
||||
async readAppConfig(): Promise<AppConfig | null> {
|
||||
try {
|
||||
const appPath = join(this.workingDir, ".git", "shakespeare", "app.json");
|
||||
const content = await this.fs.readFile(appPath, "utf8");
|
||||
const data = JSON.parse(content);
|
||||
|
||||
if (data && typeof data.a === 'string' && data.a.length > 0) {
|
||||
return { a: data.a };
|
||||
}
|
||||
|
||||
return null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write app config to .git/shakespeare/app.json file.
|
||||
* @param config App config with the Nostr "a" coordinate (e.g. "31990:<pubkey>:<d-tag>")
|
||||
*/
|
||||
async writeAppConfig(config: AppConfig): Promise<void> {
|
||||
const shakespeareDir = join(this.workingDir, ".git", "shakespeare");
|
||||
const appPath = join(shakespeareDir, "app.json");
|
||||
|
||||
try {
|
||||
await this.fs.mkdir(shakespeareDir, { recursive: true });
|
||||
await this.fs.writeFile(appPath, JSON.stringify(config, null, 2) + "\n");
|
||||
} catch (error) {
|
||||
console.warn(`Failed to write .git/shakespeare/app.json file: ${error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** App config stored in .git/shakespeare/app.json */
|
||||
export interface AppConfig {
|
||||
/** Nostr "a" coordinate for the kind 31990 event (e.g. "31990:<pubkey>:<d-tag>") */
|
||||
a: string;
|
||||
}
|
||||
Reference in new issue
Block a user