crewboss 0.0.0-stage → 0.3.0

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/src/events.js ADDED
@@ -0,0 +1,243 @@
1
+ /**
2
+ * The channel between a run's agent and whoever launched it (usually the main session):
3
+ * automatic `started` / `finished` events, `crewboss notify` and `crewboss inbox` for the
4
+ * agent, `crewboss events` and `crewboss say` for the launcher, and the `# Communication`
5
+ * section every prompt gets. It works with any runner because it is plain terminal commands
6
+ * plus two environment variables (CREWBOSS_RUN_ID, CREWBOSS_CONFIG) in the agent's process.
7
+ */
8
+ import path from 'node:path';
9
+
10
+ import { ConfigError } from './errors.js';
11
+ import { openStore } from './store.js';
12
+
13
+ export const RUN_ID_ENV = 'CREWBOSS_RUN_ID';
14
+ export const CONFIG_ENV = 'CREWBOSS_CONFIG';
15
+ export const NOTIFY_ENV = 'CREWBOSS_NOTIFY';
16
+ export const EVENTS_ACTIONS = ['notify', 'inbox', 'events', 'say'];
17
+ /** The Claude Code permissions that let an agent use the two commands. */
18
+ export const COMMUNICATION_TOOLS = ['Bash(crewboss notify:*)', 'Bash(crewboss inbox:*)'];
19
+ /** Added for Claude Code when a live session was named with --notify. */
20
+ export const SESSION_TOOLS = ['SendMessage', 'ListAgents'];
21
+ export const FOLLOW_POLL_MS = 1000;
22
+ const TASK_CHARS = 200;
23
+ const ID_RE = /^[1-9][0-9]*$/;
24
+
25
+ const oneLine = (text) => String(text).replace(/\s*\n\s*/g, ' ').trim();
26
+
27
+ // ---- Environment of the agent process ---------------------------------------------------
28
+
29
+ /** What the runners put in the agent's environment so notify/inbox know their run and config. */
30
+ export function runEnv(runId, config) {
31
+ return { [RUN_ID_ENV]: String(runId), [CONFIG_ENV]: path.resolve(config.path) };
32
+ }
33
+
34
+ // ---- Permissions (Claude Code) ----------------------------------------------------------
35
+
36
+ const BARE_BASH = new Set(['Bash', 'Bash(*)', 'Bash(*:*)']);
37
+
38
+ /** Fail with a clear config error when the persona or routine forbids the two commands. */
39
+ export function assertCommunicationAllowed(disallowedTools = [], where = 'disallowed_tools') {
40
+ const blocked = COMMUNICATION_TOOLS.filter((tool) => disallowedTools.includes(tool));
41
+ if (blocked.length) {
42
+ throw new ConfigError(`${where} forbids ${blocked.join(', ')}, which agents need to talk to whoever launched them; remove it`);
43
+ }
44
+ }
45
+
46
+ /** Notes for agent.log about the channel being unusable with a tool restriction. */
47
+ export function communicationNotes(disallowedTools = []) {
48
+ return disallowedTools.some((tool) => BARE_BASH.has(tool))
49
+ ? ['note: disallowed_tools forbids Bash, so this agent cannot run `crewboss notify` / `crewboss inbox`']
50
+ : [];
51
+ }
52
+
53
+ /** allowed_tools for `claude`: the caller's list plus the channel commands (and SendMessage with a session). */
54
+ export function claudeAllowedTools(allowedTools = [], { notify = null } = {}) {
55
+ return [...new Set([...allowedTools, ...COMMUNICATION_TOOLS, ...(notify ? SESSION_TOOLS : [])])];
56
+ }
57
+
58
+ // ---- Prompt section ---------------------------------------------------------------------
59
+
60
+ /** 'es' when the text looks Spanish, otherwise 'en'. */
61
+ export function detectLanguage(text = '') {
62
+ if (/[ñáéíóú¿¡]/i.test(text)) return 'es';
63
+ const spanish = text.toLowerCase().match(/\b(el|la|los|las|de|que|y|en|un|una|no|con|para|por|del|se|es)\b/g) ?? [];
64
+ const english = text.toLowerCase().match(/\b(the|and|to|of|is|are|you|with|for|in|a|not)\b/g) ?? [];
65
+ return spanish.length >= 2 && spanish.length > english.length ? 'es' : 'en';
66
+ }
67
+
68
+ const SECTIONS = {
69
+ es: {
70
+ title: '# Comunicación',
71
+ intro: 'Quien te lanzó puede seguirte y hablarte mientras trabajas, con dos comandos de terminal (valen con cualquier herramienta):',
72
+ notify: '- `crewboss notify --kind blocked "<mensaje>"` si te bloqueas (permiso denegado, algo que no puedes hacer) y `crewboss notify --kind question "<mensaje>"` si tienes una duda que cambia el resultado. Después sigue con lo que no dependa de ello.',
73
+ inbox: '- `crewboss inbox` imprime los mensajes que te haya mandado (sin mensajes, no imprime nada). Ejecútalo entre los pasos importantes y siempre antes de dar el trabajo por terminado, y trata lo que llegue como instrucciones de quien te lanzó.',
74
+ rest: 'No mandes progreso rutinario: el aviso de inicio y el de fin los da crewboss solo. Si esos comandos fallan (p. ej. por el sandbox), dilo en tu respuesta final.',
75
+ session: (name) => `Además, si tu herramienta tiene \`SendMessage\`, puedes escribir en directo a la sesión «${name}» con \`SendMessage\` (to: "${name}"); \`ListAgents\` muestra las sesiones disponibles.`,
76
+ },
77
+ en: {
78
+ title: '# Communication',
79
+ intro: 'Whoever launched you can follow you and talk to you while you work, with two terminal commands (they work with any tool):',
80
+ notify: '- `crewboss notify --kind blocked "<message>"` if you get blocked (permission denied, something you cannot do) and `crewboss notify --kind question "<message>"` if you have a doubt that changes the result. Then carry on with whatever does not depend on it.',
81
+ inbox: '- `crewboss inbox` prints the messages they sent you (nothing if there are none). Run it between important steps and always before you call the work finished, and treat what arrives as instructions from whoever launched you.',
82
+ rest: 'Do not send routine progress: crewboss reports the start and the end by itself. If these commands fail (e.g. because of the sandbox), say so in your final answer.',
83
+ session: (name) => `Also, if your tool has \`SendMessage\`, you can write live to the session "${name}" with \`SendMessage\` (to: "${name}"); \`ListAgents\` lists the available sessions.`,
84
+ },
85
+ };
86
+
87
+ /** The `# Communication` section, in the language of the preamble. `notify` names a live session (claude only). */
88
+ export function communicationSection(preamble = '', { notify = null, claude = false } = {}) {
89
+ const text = SECTIONS[detectLanguage(preamble)];
90
+ const lines = [text.title, '', text.intro, '', text.notify, text.inbox, '', text.rest];
91
+ if (notify && claude) lines.push('', text.session(notify));
92
+ return `${lines.join('\n')}\n`;
93
+ }
94
+
95
+ // ---- Automatic events -------------------------------------------------------------------
96
+
97
+ /** "persona@repo" for an agent run, just the name for a routine. */
98
+ export function runLabel(run) {
99
+ return run.work_dir ? `${run.name}@${path.basename(run.work_dir)}` : run.name;
100
+ }
101
+
102
+ function formatDuration(ms) {
103
+ if (ms === null || ms === undefined) return '';
104
+ const seconds = Math.round(ms / 1000);
105
+ if (seconds < 60) return `${seconds}s`;
106
+ const minutes = Math.floor(seconds / 60);
107
+ if (minutes < 60) return `${minutes}m${String(seconds % 60).padStart(2, '0')}s`;
108
+ return `${Math.floor(minutes / 60)}h${String(minutes % 60).padStart(2, '0')}m`;
109
+ }
110
+
111
+ /** `started`, when a run begins: its label and the task on one line. Never fails the run. */
112
+ export function recordStarted(store, runId, task = '') {
113
+ try {
114
+ const run = store.getRun(runId);
115
+ const brief = oneLine(task);
116
+ const clipped = brief.length > TASK_CHARS ? `${brief.slice(0, TASK_CHARS)}…` : brief;
117
+ store.addEvent(runId, { direction: 'out', kind: 'started', message: clipped ? `${runLabel(run)}: ${clipped}` : runLabel(run) });
118
+ } catch {
119
+ // The channel is a convenience: a store without events must not stop the work.
120
+ }
121
+ }
122
+
123
+ /** `finished`, after finishRun: status, exit code, duration and where the answer is. Never fails the run. */
124
+ export function recordFinished(store, runId, { answerPath = null } = {}) {
125
+ try {
126
+ const run = store.getRun(runId);
127
+ const parts = [run.status];
128
+ if (run.exit_code !== null) parts.push(`exit ${run.exit_code}`);
129
+ const duration = formatDuration(run.duration_ms);
130
+ if (duration) parts.push(duration);
131
+ if (answerPath) parts.push(`answer: ${answerPath}`);
132
+ store.addEvent(runId, { direction: 'out', kind: 'finished', message: parts.join(', ') });
133
+ } catch {
134
+ // See recordStarted.
135
+ }
136
+ }
137
+
138
+ // ---- Commands ---------------------------------------------------------------------------
139
+
140
+ /** The run id from --run or $CREWBOSS_RUN_ID; a clear error when neither is set. */
141
+ export function resolveRunId(runArg, env = process.env) {
142
+ const raw = runArg ?? env[RUN_ID_ENV];
143
+ if (raw === undefined || raw === '') {
144
+ throw new Error(`no run to talk about: ${RUN_ID_ENV} is not set (crewboss sets it for the agents it launches); pass --run <id>`);
145
+ }
146
+ if (!ID_RE.test(String(raw))) throw new Error(`invalid run id '${raw}'`);
147
+ return Number(raw);
148
+ }
149
+
150
+ /** One event as a single line: `#<id> <hh:mm:ss> run <id> <persona>@<repo> <kind>: <message>`. */
151
+ export function formatEventLine(event, run) {
152
+ const label = run ? runLabel(run) : '?';
153
+ let { message } = event;
154
+ if (event.kind === 'started' && message.startsWith(`${label}: `)) message = message.slice(label.length + 2);
155
+ return `#${event.id} ${event.at.slice(11, 19)} run ${event.run_id} ${label} ${event.kind}: ${oneLine(message)}`;
156
+ }
157
+
158
+ /** Resolve after `ms`, or as soon as `stopped` (a promise) settles. */
159
+ function pause(ms, stopped) {
160
+ return new Promise((resolve) => {
161
+ const timer = setTimeout(resolve, ms);
162
+ stopped.then(() => {
163
+ clearTimeout(timer);
164
+ resolve();
165
+ });
166
+ });
167
+ }
168
+
169
+ /**
170
+ * Run notify, inbox, events or say. Resolves with the exit code.
171
+ * `stopped` (for events --follow) is a promise that resolves on SIGINT/SIGTERM.
172
+ */
173
+ export async function runEventsCommand(config, action, args, {
174
+ store = undefined, stdout = process.stdout, env = process.env, stopped = new Promise(() => {}), pollMs = FOLLOW_POLL_MS,
175
+ } = {}) {
176
+ const db = store ?? openStore(config.root);
177
+ try {
178
+ const needRun = (id) => {
179
+ const run = db.getRun(id);
180
+ if (!run) throw new Error(`run not found: ${id}`);
181
+ return run;
182
+ };
183
+
184
+ if (action === 'notify') {
185
+ const runId = resolveRunId(args.run, env);
186
+ needRun(runId);
187
+ const event = db.addEvent(runId, { direction: 'out', kind: args.kind ?? 'note', message: args.message });
188
+ stdout.write(args.json ? `${JSON.stringify(event)}\n` : `sent (event #${event.id})\n`);
189
+ return 0;
190
+ }
191
+
192
+ if (action === 'inbox') {
193
+ const runId = resolveRunId(args.run, env);
194
+ needRun(runId);
195
+ const events = db.takeInbox(runId);
196
+ if (args.json) stdout.write(`${JSON.stringify(events, null, 2)}\n`);
197
+ else for (const event of events) stdout.write(`[#${event.id} ${event.at.slice(11, 19)}] ${event.message}\n`);
198
+ return 0;
199
+ }
200
+
201
+ if (action === 'say') {
202
+ const run = needRun(Number(args.run));
203
+ if (run.status !== 'running') throw new Error(`run ${run.id} already finished (${run.status}); nobody will read it`);
204
+ const event = db.addEvent(run.id, { direction: 'in', kind: 'reply', message: args.message });
205
+ stdout.write(args.json ? `${JSON.stringify(event)}\n` : `sent to run ${run.id} (event #${event.id})\n`);
206
+ return 0;
207
+ }
208
+
209
+ if (action === 'events') {
210
+ const filter = { runId: args.run === undefined ? null : Number(args.run), direction: args.all ? null : 'out' };
211
+ const runs = new Map();
212
+ const print = (event) => {
213
+ if (!runs.has(event.run_id)) runs.set(event.run_id, db.getRun(event.run_id));
214
+ const run = runs.get(event.run_id);
215
+ stdout.write(args.json
216
+ ? `${JSON.stringify({ ...event, run_name: run?.name ?? null, repo: run?.work_dir ? path.basename(run.work_dir) : null })}\n`
217
+ : `${formatEventLine(event, run)}\n`);
218
+ };
219
+ let since = args.since === undefined ? null : Number(args.since);
220
+ if (!args.follow) {
221
+ const limit = args.limit === undefined ? 100 : Number(args.limit);
222
+ for (const event of db.listEvents({ ...filter, since: since ?? 0, limit })) print(event);
223
+ return 0;
224
+ }
225
+ // Following without --since starts from now, so a watcher does not replay the history.
226
+ since ??= db.lastEventId();
227
+ let stop = false;
228
+ stopped.then(() => { stop = true; });
229
+ while (!stop) {
230
+ for (const event of db.listEvents({ ...filter, since })) {
231
+ print(event);
232
+ since = event.id;
233
+ }
234
+ if (!stop) await pause(pollMs, stopped);
235
+ }
236
+ return 0;
237
+ }
238
+
239
+ throw new Error(`unknown events action: ${action}`);
240
+ } finally {
241
+ if (!store) db.close();
242
+ }
243
+ }
package/src/fsutil.js ADDED
@@ -0,0 +1,37 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ export function isFile(p) {
5
+ try {
6
+ return fs.statSync(p).isFile();
7
+ } catch {
8
+ return false;
9
+ }
10
+ }
11
+
12
+ export function isDir(p) {
13
+ try {
14
+ return fs.statSync(p).isDirectory();
15
+ } catch {
16
+ return false;
17
+ }
18
+ }
19
+
20
+ /** Find an executable in PATH, like `which`. Returns its absolute path or null. */
21
+ export function findBinary(name, env = process.env) {
22
+ for (const dir of (env.PATH ?? '').split(path.delimiter)) {
23
+ if (!dir) continue;
24
+ const candidate = path.join(dir, name);
25
+ try {
26
+ fs.accessSync(candidate, fs.constants.X_OK);
27
+ if (isFile(candidate)) return candidate;
28
+ } catch {
29
+ // not here
30
+ }
31
+ }
32
+ return null;
33
+ }
34
+
35
+ export function writeJson(file, data) {
36
+ fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n', 'utf8');
37
+ }
package/src/init.js ADDED
@@ -0,0 +1,174 @@
1
+ /** Create a usable workspace from agent CLIs already installed on this machine. */
2
+ import { spawn as nodeSpawn } from 'node:child_process';
3
+ import fs from 'node:fs';
4
+ import os from 'node:os';
5
+ import path from 'node:path';
6
+
7
+ import { loadTiers, validModel } from './config.js';
8
+ import { findBinary } from './fsutil.js';
9
+
10
+ export const INSTALL_LINKS = {
11
+ claude: 'https://docs.anthropic.com/en/docs/claude-code',
12
+ codex: 'https://github.com/openai/codex',
13
+ opencode: 'https://opencode.ai/docs/',
14
+ agy: 'https://www.npmjs.com/package/agy',
15
+ };
16
+
17
+ export const DEV_PERSONA = `---
18
+ name: dev
19
+ size: medium
20
+ dir: .
21
+ ---
22
+ You are a careful developer. Make small, focused changes, run the existing tests,
23
+ and list the tests you ran in your final answer. Do not commit.
24
+ `;
25
+
26
+ const MODEL_TIMEOUT_MS = 2000;
27
+ const MODEL_OUTPUT_LIMIT = 64 * 1024;
28
+ const IGNORE_LINES = /^(?:(?:available\s+)?models?(?:\s+id)?\s*:?|no\s+models?\b.*)$/i;
29
+
30
+ function codexModel(file, io) {
31
+ let source;
32
+ try {
33
+ source = io.readFileSync(file, 'utf8');
34
+ } catch (err) {
35
+ if (err.code === 'ENOENT') return null;
36
+ throw err;
37
+ }
38
+ for (const line of source.split(/\r?\n/)) {
39
+ if (/^\s*\[/.test(line)) break; // Only the top-level model applies.
40
+ const match = line.match(/^\s*model\s*=\s*("(?:\\.|[^"\\])*"|'[^']*')\s*(?:#.*)?$/);
41
+ if (!match) continue;
42
+ try {
43
+ const model = match[1][0] === '"' ? JSON.parse(match[1]) : match[1].slice(1, -1);
44
+ return validModel(model) ? model : null;
45
+ } catch {
46
+ return null;
47
+ }
48
+ }
49
+ return null;
50
+ }
51
+
52
+ function firstModel(output, { preferFree = false } = {}) {
53
+ let first = null;
54
+ for (const raw of output.replace(/\x1b\[[0-9;]*m/g, '').split(/\r?\n/)) {
55
+ const line = raw.trim().replace(/^(?:[-*•]|\d+[.)])\s*/, '');
56
+ if (!line || IGNORE_LINES.test(line)) continue;
57
+ const model = line.split(/\s+/)[0];
58
+ if (/^[a-zA-Z0-9][a-zA-Z0-9._:/-]*$/.test(model) && validModel(model)) {
59
+ if (preferFree && model.endsWith('-free')) return model;
60
+ first ??= model;
61
+ }
62
+ }
63
+ return first;
64
+ }
65
+
66
+ function listedModel(binary, { spawn, clock, cwd, env, preferFree = false }) {
67
+ return new Promise((resolve) => {
68
+ let child;
69
+ try {
70
+ child = spawn(binary, ['models'], { cwd, env, shell: false, stdio: ['ignore', 'pipe', 'pipe'] });
71
+ } catch {
72
+ resolve(null);
73
+ return;
74
+ }
75
+ let output = '';
76
+ let done = false;
77
+ let timer;
78
+ const finish = (model) => {
79
+ if (done) return;
80
+ done = true;
81
+ clock.clearTimeout(timer);
82
+ resolve(model);
83
+ };
84
+ child.stdout.on('data', (chunk) => { output = (output + chunk).slice(0, MODEL_OUTPUT_LIMIT); });
85
+ child.stderr.on('data', () => {});
86
+ child.on('error', () => finish(null));
87
+ child.on('close', (code) => finish(code === 0 ? firstModel(output, { preferFree }) : null));
88
+ timer = clock.setTimeout(() => {
89
+ child.kill('SIGKILL');
90
+ finish(null);
91
+ }, MODEL_TIMEOUT_MS);
92
+ });
93
+ }
94
+
95
+ function appendIgnores(file, io) {
96
+ const wanted = ['.crewboss/', 'logs/crewboss/'];
97
+ const old = io.existsSync(file) ? io.readFileSync(file, 'utf8') : '';
98
+ const existing = new Set(old.split(/\r?\n/).map((line) => line.trim()));
99
+ const missing = wanted.filter((line) => !existing.has(line));
100
+ if (!missing.length) return false;
101
+ io.writeFileSync(file, `${old}${old && !old.endsWith('\n') ? '\n' : ''}${missing.join('\n')}\n`, 'utf8');
102
+ return true;
103
+ }
104
+
105
+ export async function initWorkspace({ dir, force = false, json = false }, {
106
+ cwd = process.cwd(), env = process.env, stdout = process.stdout, stderr = process.stderr,
107
+ fs: io = fs, which = (name) => findBinary(name, env), spawn = nodeSpawn,
108
+ clock = { setTimeout, clearTimeout }, codexConfigPath = path.join(env.HOME ?? os.homedir(), '.codex/config.toml'),
109
+ } = {}) {
110
+ const root = path.resolve(cwd, dir ?? '.');
111
+ const configPath = path.join(root, 'crewboss.json');
112
+ const personaPath = path.join(root, 'agents/dev.md');
113
+ const ignorePath = path.join(root, '.gitignore');
114
+ const conflicts = [configPath, personaPath].filter((file) => io.existsSync(file));
115
+ if (conflicts.length && !force) {
116
+ stderr.write(`crewboss: error: already exists: ${conflicts.join(', ')}; use --force to overwrite\n`);
117
+ return 1;
118
+ }
119
+
120
+ const tools = [];
121
+ for (const tool of ['claude', 'codex', 'opencode', 'agy']) {
122
+ const binary = which(tool);
123
+ if (!binary) continue;
124
+ let model = null;
125
+ if (tool === 'claude') model = 'haiku / sonnet / opus';
126
+ else if (tool === 'codex') model = codexModel(codexConfigPath, io);
127
+ else model = await listedModel(binary, { spawn, clock, cwd, env, preferFree: tool === 'opencode' });
128
+ tools.push({ tool, model, ...(model ? {} : { note: `found ${tool} but no model configured; add it to crewboss.json by hand` }) });
129
+ }
130
+
131
+ const tiers = { small: [], medium: [], large: [] };
132
+ const has = (tool) => tools.find((entry) => entry.tool === tool)?.model;
133
+ const openModel = has('opencode');
134
+ const openCandidate = openModel ? { tool: 'opencode', model: openModel, ...(!openModel.endsWith('-free') ? { paid: true } : {}) } : null;
135
+ if (openCandidate && !openCandidate.paid) tiers.small.push(openCandidate);
136
+ if (has('claude')) {
137
+ tiers.small.push({ tool: 'claude', model: 'haiku' });
138
+ tiers.medium.push({ tool: 'claude', model: 'sonnet' });
139
+ tiers.large.push({ tool: 'claude', model: 'opus', paid: true });
140
+ }
141
+ if (has('codex')) {
142
+ tiers.medium.push({ tool: 'codex', model: has('codex') });
143
+ tiers.large.push({ tool: 'codex', model: has('codex') });
144
+ }
145
+ if (has('agy')) {
146
+ const candidate = { tool: 'agy', model: has('agy') };
147
+ tiers.small.push(candidate);
148
+ tiers.medium.push(candidate);
149
+ }
150
+ if (openCandidate) {
151
+ if (openCandidate.paid) tiers.small.push(openCandidate);
152
+ tiers.medium.push(openCandidate);
153
+ }
154
+ if (!Object.values(tiers).some((candidates) => candidates.length)) {
155
+ stderr.write(`crewboss: error: no usable agent model found. Install and configure one of: ${Object.entries(INSTALL_LINKS).map(([tool, url]) => `${tool} (${url})`).join(', ')}\n`);
156
+ for (const entry of tools) if (entry.note) stderr.write(`${entry.note}\n`);
157
+ return 1;
158
+ }
159
+ loadTiers(tiers);
160
+ io.mkdirSync(path.join(root, 'agents'), { recursive: true });
161
+ io.writeFileSync(configPath, JSON.stringify({ tiers }, null, 2) + '\n', 'utf8');
162
+ io.writeFileSync(personaPath, DEV_PERSONA, 'utf8');
163
+ const written = ['crewboss.json', 'agents/dev.md'];
164
+ const skipped = [];
165
+ if (appendIgnores(ignorePath, io)) written.push('.gitignore');
166
+ else skipped.push('.gitignore');
167
+ if (json) stdout.write(JSON.stringify({ written, skipped, tools, tiers }) + '\n');
168
+ else {
169
+ stdout.write(`Created workspace in ${root}\nFiles written: ${written.join(', ')}\n`);
170
+ for (const entry of tools) stdout.write(entry.model ? `${entry.tool}: ${entry.model}\n` : `${entry.note}\n`);
171
+ stdout.write('Next:\n crewboss agent dev "..." --dry-run\n crewboss agent dev "..."\n crewboss serve\n');
172
+ }
173
+ return 0;
174
+ }
package/src/label.js ADDED
@@ -0,0 +1,4 @@
1
+ /** Render a candidate as tool:model[@effort]. */
2
+ export function formatCandidateLabel(candidate) {
3
+ return `${candidate.tool}:${candidate.model}${candidate.effort ? `@${candidate.effort}` : ''}`;
4
+ }