clementine-agent 1.0.12 → 1.0.13
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/agent/agent-manager.js +32 -0
- package/package.json +1 -1
|
@@ -14,8 +14,10 @@ import { execSync } from 'node:child_process';
|
|
|
14
14
|
import fs from 'node:fs';
|
|
15
15
|
import path from 'node:path';
|
|
16
16
|
import matter from 'gray-matter';
|
|
17
|
+
import { randomBytes } from 'node:crypto';
|
|
17
18
|
import { ProfileManager } from './profiles.js';
|
|
18
19
|
import { getScaffoldForRole } from './role-scaffolds.js';
|
|
20
|
+
import { writeGoalForOwner } from '../tools/shared.js';
|
|
19
21
|
// ── Keychain helpers for agent secrets ────────────────────────────────
|
|
20
22
|
function storeAgentSecret(slug, key, value) {
|
|
21
23
|
execSync(`security add-generic-password -U -s "clementine" -a "AGENT_${slug.toUpperCase()}_${key}" -w "${value}"`, { stdio: 'pipe', timeout: 3000 });
|
|
@@ -324,6 +326,36 @@ export class AgentManager {
|
|
|
324
326
|
}
|
|
325
327
|
}
|
|
326
328
|
}
|
|
329
|
+
// Seed a starter goal so the agent shows up in goal reviews from day one.
|
|
330
|
+
// Status is "pending" — forces the owner to give it a real success metric
|
|
331
|
+
// before it starts driving goal_work sessions.
|
|
332
|
+
try {
|
|
333
|
+
const now = new Date().toISOString();
|
|
334
|
+
const starterGoal = {
|
|
335
|
+
id: randomBytes(4).toString('hex'),
|
|
336
|
+
title: `${config.name}: Define Success Metric`,
|
|
337
|
+
description: `Starter goal auto-created when ${config.name} was hired. Replace this with a ` +
|
|
338
|
+
`concrete outcome and measurable success metric (e.g., "book 3 demos/week", ` +
|
|
339
|
+
`"publish 2 posts/week", "reduce queue backlog under 50 items"). Set status to ` +
|
|
340
|
+
`"active" once defined so goal_work sessions can drive progress.`,
|
|
341
|
+
status: 'pending',
|
|
342
|
+
owner: slug,
|
|
343
|
+
priority: 'high',
|
|
344
|
+
createdAt: now,
|
|
345
|
+
updatedAt: now,
|
|
346
|
+
progressNotes: [],
|
|
347
|
+
nextActions: [
|
|
348
|
+
`Define the measurable success metric for ${config.name}`,
|
|
349
|
+
'Link the relevant cron jobs once the metric is set',
|
|
350
|
+
'Set status to "active" to enable goal_work sessions',
|
|
351
|
+
],
|
|
352
|
+
blockers: ['Success metric not yet defined'],
|
|
353
|
+
reviewFrequency: 'weekly',
|
|
354
|
+
linkedCronJobs: [],
|
|
355
|
+
};
|
|
356
|
+
writeGoalForOwner(starterGoal);
|
|
357
|
+
}
|
|
358
|
+
catch { /* non-fatal — agent is still created */ }
|
|
327
359
|
// Invalidate cache
|
|
328
360
|
this.cacheTime = 0;
|
|
329
361
|
return this.get(slug);
|