Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(briefing): add configurable enrichment options to daily briefing job
Adam Eivy92cc3db69d5b
diff --git a/client/src/components/cos/tabs/JobsTab.jsx b/client/src/components/cos/tabs/JobsTab.jsxindex 0f12d7a5c6..9d26f6fe0e 100644--- a/client/src/components/cos/tabs/JobsTab.jsx+++ b/client/src/components/cos/tabs/JobsTab.jsx@@ -45,6 +45,42 @@ const JOB_TYPE_OPTIONS = [{ value: 'shell', label: 'Shell Command' }];+const BRIEFING_CONFIG_OPTIONS = [+ { key: 'dailyJoke', label: 'Daily Joke', desc: 'Include a short joke to start the day' },+ { key: 'dailyQuote', label: 'Daily Quote', desc: 'Include an inspirational quote related to focus areas' },+ { key: 'dailyImage', label: 'Daily Image', desc: 'Generate an image via Stable Diffusion (requires image gen API)' }+];++function BriefingConfig({ config, onChange }) {+ return (+ <div className="space-y-2">+ <span className="text-xs text-gray-400">Briefing Enrichments</span>+ <div className="grid grid-cols-1 sm:grid-cols-3 gap-2">+ {BRIEFING_CONFIG_OPTIONS.map(opt => (+ <button+ key={opt.key}+ type="button"+ onClick={() => onChange(opt.key, !config[opt.key])}+ className={`flex items-center gap-2 px-3 py-2 rounded-lg border text-left text-sm transition-colors ${+ config[opt.key]+ ? 'border-port-accent/50 bg-port-accent/10 text-white'+ : 'border-port-border bg-port-bg text-gray-500 hover:text-gray-300'+ }`}+ >+ <span className={`w-3 h-3 rounded-sm border shrink-0 ${+ config[opt.key] ? 'bg-port-accent border-port-accent' : 'border-gray-600'+ }`} />+ <div>+ <div className="font-medium">{opt.label}</div>+ <div className="text-xs opacity-60">{opt.desc}</div>+ </div>+ </button>+ ))}+ </div>+ </div>+ );+}+function normalizeJobPayload(formData) {const payload = { ...formData };if (payload.type !== 'shell' && payload.type !== 'script') {@@ -182,6 +218,9 @@ function JobCard({ job, onToggle, onTrigger, onDelete, onUpdate }) {// Always initialize shell fields so switching type to 'shell' during editing worksbase.command = job.command || '';base.triggerAction = job.triggerAction || 'log-only';+ if (job.id === 'job-daily-briefing') {+ base.config = { dailyJoke: false, dailyQuote: false, dailyImage: false, ...job.config };+ }setEditData(base);setEditing(true);setExpanded(true);@@ -343,6 +382,12 @@ function JobCard({ job, onToggle, onTrigger, onDelete, onUpdate }) {)}</div><ScheduleFields data={editData} onChange={(key, val) => setEditData(d => ({ ...d, [key]: val }))} />+ {editData.config && (+ <BriefingConfig+ config={editData.config}+ onChange={(key, val) => setEditData(d => ({ ...d, config: { ...d.config, [key]: val } }))}+ />+ )}{editData.type === 'shell' ? (<><textarea@@ -398,12 +443,20 @@ function JobCard({ job, onToggle, onTrigger, onDelete, onUpdate }) {<code className="text-emerald-300 bg-port-bg px-2 py-1 rounded font-mono">{job.command}</code></div>)}- <div className="flex gap-4 text-xs text-gray-500">+ <div className="flex flex-wrap gap-4 text-xs text-gray-500"><span>Priority: <span className="text-gray-300">{job.priority}</span></span>{!isShell && <span>Autonomy: <span className="text-gray-300">{job.autonomyLevel}</span></span>}{isShell && <span>Action: <span className="text-gray-300">{job.triggerAction || 'log-only'}</span></span>}<span>Created: <span className="text-gray-300">{job.createdAt ? new Date(job.createdAt).toLocaleDateString() : '—'}</span></span></div>+ {job.config && BRIEFING_CONFIG_OPTIONS.some(o => job.config[o.key]) && (+ <div className="flex flex-wrap gap-2 text-xs">+ <span className="text-gray-500">Enrichments:</span>+ {BRIEFING_CONFIG_OPTIONS.filter(o => job.config[o.key]).map(o => (+ <span key={o.key} className="px-2 py-0.5 bg-port-accent/10 text-port-accent rounded">{o.label}</span>+ ))}+ </div>+ )}{isShell && job.lastOutput && (<details className="group"><summary className="text-xs text-gray-500 cursor-pointer hover:text-gray-300 transition-colors">diff --git a/server/services/autonomousJobs.js b/server/services/autonomousJobs.jsindex 7877571259..25d4882a59 100644--- a/server/services/autonomousJobs.js+++ b/server/services/autonomousJobs.js@@ -220,6 +220,11 @@ Focus on surfacing actionable insights and moving projects forward. Don't just cenabled: false,priority: 'LOW',autonomyLevel: 'assistant',+ config: {+ dailyJoke: false,+ dailyQuote: false,+ dailyImage: false+ },promptTemplate: `[Autonomous Job] Daily BriefingYou are acting as my Chief of Staff, preparing a daily briefing.@@ -720,6 +725,7 @@ async function createJob(jobData) {promptTemplate: jobData.promptTemplate || '',command: jobData.command || null,triggerAction,+ config: jobData.config || null,lastRun: null,runCount: 0,createdAt: now,@@ -762,7 +768,7 @@ async function updateJob(jobId, updates) {const updatableFields = ['name', 'description', 'category', 'type', 'interval', 'intervalMs','scheduledTime', 'cronExpression', 'weekdaysOnly', 'enabled', 'priority', 'autonomyLevel', 'promptTemplate',- 'command', 'triggerAction'+ 'command', 'triggerAction', 'config']for (const field of updatableFields) {@@ -937,6 +943,39 @@ async function listJobSkillTemplates() {return results}+/**+ * Build additional prompt instructions based on daily briefing config options.+ * @param {Object} config - The briefing config object+ * @returns {string} Additional instructions to append, or empty string+ */+function buildBriefingConfigInstructions(config) {+ const parts = []++ if (config.dailyJoke) {+ parts.push('- Include a "Daily Joke" section with a short, clever joke to start the day on a light note.')+ }+ if (config.dailyQuote) {+ parts.push('- Include a "Daily Quote" section with an inspirational or thought-provoking quote relevant to the day\'s focus areas.')+ }+ if (config.dailyImage) {+ parts.push(+ '- Generate a "Daily Image" to accompany the briefing by calling POST /api/image-gen/generate with a creative prompt related to today\'s theme or focus areas. Use a cyberpunk or futuristic aesthetic. Include the resulting image path in the briefing. If the image gen API is unavailable (GET /api/image-gen/status returns connected: false), skip this section silently.'+ )+ }++ if (parts.length === 0) return ''+ return 'Optional enrichments (include these sections in the briefing):\n' + parts.join('\n')+}++/**+ * Append briefing config instructions to a prompt if this is the daily briefing job.+ */+function appendBriefingConfig(job, prompt) {+ if (job.id !== 'job-daily-briefing' || !job.config) return prompt+ const extras = buildBriefingConfigInstructions(job.config)+ return extras ? prompt + '\n\n' + extras : prompt+}+/*** Get the effective prompt for a job, using skill template if available* Extracts the prompt from the skill template's structured format@@ -945,10 +984,10 @@ async function listJobSkillTemplates() {*/async function getJobEffectivePrompt(job) {const skillName = JOB_SKILL_MAP[job.id]- if (!skillName) return job.promptTemplate+ if (!skillName) return appendBriefingConfig(job, job.promptTemplate)const template = await loadJobSkillTemplate(skillName)- if (!template) return job.promptTemplate+ if (!template) return appendBriefingConfig(job, job.promptTemplate)// Extract structured sections from the skill template and build a prompt// The skill template has: Prompt Template header, Steps, Expected Outputs, Success Criteria@@ -973,6 +1012,9 @@ async function getJobEffectivePrompt(job) {if (sections.steps.trim()) {prompt += '\n\nTasks to perform:\n' + sections.steps.trim()}++ prompt = appendBriefingConfig(job, prompt)+if (sections.expectedOutputs.trim()) {prompt += '\n\nExpected outputs:\n' + sections.expectedOutputs.trim()}