@firefunc-agent/runner 0.7.1 → 0.9.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/LICENSE +7 -3
- package/README.md +233 -3
- package/dist/activity.d.ts +29 -0
- package/dist/activity.js +209 -0
- package/dist/api.d.ts +45 -1
- package/dist/api.js +44 -2
- package/dist/brief.d.ts +6 -0
- package/dist/brief.js +257 -0
- package/dist/build-info.json +4 -0
- package/dist/cli.js +49 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +3 -0
- package/dist/daemon.js +70 -2
- package/dist/engines/antigravity.d.ts +2 -0
- package/dist/engines/antigravity.js +102 -0
- package/dist/engines/claude-budget.d.ts +1 -1
- package/dist/engines/claude-budget.js +2 -72
- package/dist/engines/claude.js +10 -1
- package/dist/engines/codex.js +10 -3
- package/dist/engines/copilot.d.ts +2 -0
- package/dist/engines/copilot.js +117 -0
- package/dist/engines/cursor.js +4 -0
- package/dist/engines/gemini.js +6 -1
- package/dist/engines/index.d.ts +2 -0
- package/dist/engines/index.js +22 -4
- package/dist/engines/types.d.ts +2 -1
- package/dist/firefunc/agents.d.ts +2 -0
- package/dist/firefunc/agents.js +291 -0
- package/dist/firefunc/args.d.ts +18 -0
- package/dist/firefunc/args.js +82 -0
- package/dist/firefunc/auth.d.ts +21 -0
- package/dist/firefunc/auth.js +129 -0
- package/dist/firefunc/catalog.d.ts +10 -0
- package/dist/firefunc/catalog.js +201 -0
- package/dist/firefunc/cli.d.ts +2 -0
- package/dist/firefunc/cli.js +24 -0
- package/dist/firefunc/client.d.ts +35 -0
- package/dist/firefunc/client.js +174 -0
- package/dist/firefunc/command.d.ts +28 -0
- package/dist/firefunc/command.js +35 -0
- package/dist/firefunc/config.d.ts +29 -0
- package/dist/firefunc/config.js +111 -0
- package/dist/firefunc/io.d.ts +25 -0
- package/dist/firefunc/io.js +14 -0
- package/dist/firefunc/main.d.ts +4 -0
- package/dist/firefunc/main.js +221 -0
- package/dist/firefunc/output.d.ts +29 -0
- package/dist/firefunc/output.js +128 -0
- package/dist/firefunc/prompt.d.ts +14 -0
- package/dist/firefunc/prompt.js +58 -0
- package/dist/firefunc/skill.d.ts +3 -0
- package/dist/firefunc/skill.js +80 -0
- package/dist/firefunc/tasks.d.ts +2 -0
- package/dist/firefunc/tasks.js +279 -0
- package/dist/firefunc/version.d.ts +2 -0
- package/dist/firefunc/version.js +23 -0
- package/dist/git-auth.d.ts +4 -1
- package/dist/git-auth.js +6 -2
- package/dist/job.js +439 -84
- package/dist/keep-local.d.ts +7 -0
- package/dist/keep-local.js +484 -0
- package/dist/machine-logins.d.ts +19 -0
- package/dist/machine-logins.js +187 -0
- package/dist/mcp-login.d.ts +24 -0
- package/dist/mcp-login.js +993 -0
- package/dist/mcp.d.ts +60 -0
- package/dist/mcp.js +582 -0
- package/dist/network.d.ts +20 -0
- package/dist/network.js +76 -0
- package/dist/pending.d.ts +14 -0
- package/dist/pending.js +56 -0
- package/dist/secret-scan.d.ts +19 -0
- package/dist/secret-scan.js +161 -0
- package/dist/session-stream.d.ts +1 -0
- package/dist/session-stream.js +11 -1
- package/dist/viewer.js +7 -1
- package/package.json +8 -5
- package/skill/firefunc/SKILL.md +173 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { bool, positiveNumber, str, UsageError } from './args.js';
|
|
2
|
+
import { pick, listIn } from './catalog.js';
|
|
3
|
+
import { ApiRefusal, ApiUnreachable } from './client.js';
|
|
4
|
+
import { enc, readInputFile } from './command.js';
|
|
5
|
+
import { Refusal } from './io.js';
|
|
6
|
+
import { printJson, table, text } from './output.js';
|
|
7
|
+
const TASK_TYPES = ['task', 'feature', 'refactor', 'chore', 'bug'];
|
|
8
|
+
const STOPS_FOR_A_PERSON = [
|
|
9
|
+
'resolved',
|
|
10
|
+
'rejected',
|
|
11
|
+
'false_positive',
|
|
12
|
+
'pr_opened',
|
|
13
|
+
'needs_human',
|
|
14
|
+
'requires_human',
|
|
15
|
+
'quota_exceeded',
|
|
16
|
+
'dry_run_skipped',
|
|
17
|
+
];
|
|
18
|
+
const isFailure = (state) => state.endsWith('_failed');
|
|
19
|
+
function printTask(ctx, t) {
|
|
20
|
+
const agent = t.agent;
|
|
21
|
+
const project = t.project;
|
|
22
|
+
const lines = [
|
|
23
|
+
`${text(t.title)}`,
|
|
24
|
+
` id: ${text(t.id)}`,
|
|
25
|
+
` state: ${text(t.state)}`,
|
|
26
|
+
` type: ${text(t.type)}`,
|
|
27
|
+
` agent: ${agent ? `${text(agent.name)}${agent.handle ? ` (@${String(agent.handle)})` : ''}` : text(t.workflowId)}`,
|
|
28
|
+
` project: ${project ? text(project.name) : text(t.projectId)}`,
|
|
29
|
+
];
|
|
30
|
+
if (t.error)
|
|
31
|
+
lines.push(` error: ${text(t.error)}`);
|
|
32
|
+
const prs = Array.isArray(t.pullRequests) ? t.pullRequests : [];
|
|
33
|
+
for (const pr of prs)
|
|
34
|
+
lines.push(` pull request: ${text(pr.url)} (${text(pr.state)})`);
|
|
35
|
+
if (t.externalUrl)
|
|
36
|
+
lines.push(` source: ${text(t.externalUrl)}`);
|
|
37
|
+
const runs = Array.isArray(t.runs) ? t.runs : [];
|
|
38
|
+
if (runs.length) {
|
|
39
|
+
lines.push(` runs: ${runs.length}`);
|
|
40
|
+
for (const r of runs.slice(0, 5)) {
|
|
41
|
+
lines.push(` ${text(r.id)} ${text(r.state)} ${text(r.engine)}${r.error ? ` ${text(r.error)}` : ''}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
ctx.io.stdout.write(`${lines.join('\n')}\n`);
|
|
45
|
+
}
|
|
46
|
+
async function stopStates(api) {
|
|
47
|
+
const stops = new Set(STOPS_FOR_A_PERSON);
|
|
48
|
+
try {
|
|
49
|
+
const body = await api.get('/api/v1/task-states');
|
|
50
|
+
if (Array.isArray(body?.terminal))
|
|
51
|
+
for (const s of body.terminal)
|
|
52
|
+
if (typeof s === 'string')
|
|
53
|
+
stops.add(s);
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if (!(err instanceof ApiRefusal) && !(err instanceof ApiUnreachable))
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
return stops;
|
|
60
|
+
}
|
|
61
|
+
const mmss = (ms) => {
|
|
62
|
+
const s = Math.max(0, Math.round(ms / 1000));
|
|
63
|
+
return `${String(Math.floor(s / 60)).padStart(2, '0')}:${String(s % 60).padStart(2, '0')}`;
|
|
64
|
+
};
|
|
65
|
+
async function watchTask(ctx, id, opts) {
|
|
66
|
+
const { io } = ctx;
|
|
67
|
+
const api = ctx.api();
|
|
68
|
+
const stops = await stopStates(api);
|
|
69
|
+
const started = io.now();
|
|
70
|
+
let last;
|
|
71
|
+
let lost = false;
|
|
72
|
+
let task;
|
|
73
|
+
if (!ctx.json) {
|
|
74
|
+
io.stdout.write(`Watching task ${id} every ${Math.round(opts.intervalMs / 1000)}s for up to ${Math.round(opts.timeoutMs / 60_000)} min.\n` +
|
|
75
|
+
'Ctrl-C stops the watch, not the task.\n');
|
|
76
|
+
}
|
|
77
|
+
for (;;) {
|
|
78
|
+
try {
|
|
79
|
+
const body = await api.get(`/api/v1/tasks/${enc(id)}`);
|
|
80
|
+
task = body?.task ?? {};
|
|
81
|
+
if (lost && !ctx.json)
|
|
82
|
+
io.stderr.write('Back in contact.\n');
|
|
83
|
+
lost = false;
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
const transient = err instanceof ApiUnreachable || (err instanceof ApiRefusal && err.status >= 500);
|
|
87
|
+
if (!transient)
|
|
88
|
+
throw err;
|
|
89
|
+
if (!lost && !ctx.json) {
|
|
90
|
+
io.stderr.write(`Lost contact with the API (${err.message}); still watching.\n`);
|
|
91
|
+
}
|
|
92
|
+
lost = true;
|
|
93
|
+
}
|
|
94
|
+
const state = typeof task?.state === 'string' ? task.state : undefined;
|
|
95
|
+
if (state && state !== last) {
|
|
96
|
+
if (!ctx.json)
|
|
97
|
+
io.stdout.write(`${mmss(io.now() - started)} ${state}\n`);
|
|
98
|
+
last = state;
|
|
99
|
+
}
|
|
100
|
+
if (state && (stops.has(state) || isFailure(state)))
|
|
101
|
+
break;
|
|
102
|
+
if (io.now() - started >= opts.timeoutMs) {
|
|
103
|
+
throw new Refusal(`Task ${id} is still ${state ?? 'unread'} after ${Math.round(opts.timeoutMs / 60_000)} min of watching` +
|
|
104
|
+
(lost ? ', and the API has not answered the last reads.' : '.'), `It carries on without the watch. Keep watching: firefunc tasks watch ${id}`, 'watch_timeout');
|
|
105
|
+
}
|
|
106
|
+
await io.sleep(opts.intervalMs);
|
|
107
|
+
}
|
|
108
|
+
const t = task;
|
|
109
|
+
const state = String(t.state);
|
|
110
|
+
if (ctx.json)
|
|
111
|
+
printJson(io, { task: t });
|
|
112
|
+
else {
|
|
113
|
+
io.stdout.write('\n');
|
|
114
|
+
printTask(ctx, t);
|
|
115
|
+
const prs = Array.isArray(t.pullRequests) ? t.pullRequests : [];
|
|
116
|
+
if (state === 'pr_opened' && prs.length) {
|
|
117
|
+
io.stdout.write('\nA pull request is open for review; the task resolves when it is merged.\n');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (isFailure(state)) {
|
|
121
|
+
throw new Refusal(`Task ${id} ended ${state}${t.error ? `: ${text(t.error)}` : '.'}`, 'Read what happened on the task page in FireFunc, then run it again: firefunc run <agent> --title …', 'task_failed');
|
|
122
|
+
}
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
function watchOpts(ctx) {
|
|
126
|
+
const interval = positiveNumber(ctx.args, 'interval', ctx.command, { min: 2, max: 300 }) ?? 5;
|
|
127
|
+
const timeout = positiveNumber(ctx.args, 'timeout', ctx.command, { min: 1, max: 24 * 60 }) ?? 60;
|
|
128
|
+
return { intervalMs: interval * 1000, timeoutMs: timeout * 60_000 };
|
|
129
|
+
}
|
|
130
|
+
const watchFlagHelp = [
|
|
131
|
+
['--interval <seconds>', 'how often to read it (default 5, at least 2)'],
|
|
132
|
+
[
|
|
133
|
+
'--timeout <minutes>',
|
|
134
|
+
'give up watching after this long (default 60); exit 1 says where it was',
|
|
135
|
+
],
|
|
136
|
+
];
|
|
137
|
+
export const taskCommands = [
|
|
138
|
+
{
|
|
139
|
+
path: ['run'],
|
|
140
|
+
summary: 'Start a task on an active agent (what "Run now" does)',
|
|
141
|
+
usage: 'run <agent id or @handle> --title <title> [--body <text> | --body-file <path>] [--type <type>] [--watch]',
|
|
142
|
+
details: 'The agent must be active; a draft is activated by a person first. Needs tasks:write.\n' +
|
|
143
|
+
`Types: ${TASK_TYPES.join(', ')} (default task).`,
|
|
144
|
+
flags: {
|
|
145
|
+
title: 'string',
|
|
146
|
+
body: 'string',
|
|
147
|
+
'body-file': 'string',
|
|
148
|
+
type: 'string',
|
|
149
|
+
watch: 'boolean',
|
|
150
|
+
interval: 'string',
|
|
151
|
+
timeout: 'string',
|
|
152
|
+
},
|
|
153
|
+
flagHelp: [
|
|
154
|
+
['--title <title>', 'what to do, in a line (required)'],
|
|
155
|
+
['--body <text>', 'the detail'],
|
|
156
|
+
['--body-file <path>', 'the detail from a file ("-" for stdin)'],
|
|
157
|
+
['--type <type>', `${TASK_TYPES.join(' | ')}`],
|
|
158
|
+
['--watch', 'then watch it until it stops (see "firefunc tasks watch --help")'],
|
|
159
|
+
...watchFlagHelp,
|
|
160
|
+
],
|
|
161
|
+
positional: { min: 1, max: 1 },
|
|
162
|
+
async run(ctx) {
|
|
163
|
+
const agent = ctx.args.positional[0];
|
|
164
|
+
const title = str(ctx.args, 'title');
|
|
165
|
+
if (!title?.trim())
|
|
166
|
+
throw new UsageError('Say what to do: --title "…"', ctx.command);
|
|
167
|
+
const bodyText = str(ctx.args, 'body');
|
|
168
|
+
const bodyFile = str(ctx.args, 'body-file');
|
|
169
|
+
if (bodyText !== undefined && bodyFile !== undefined) {
|
|
170
|
+
throw new UsageError('Pass --body or --body-file, not both.', ctx.command);
|
|
171
|
+
}
|
|
172
|
+
const type = str(ctx.args, 'type');
|
|
173
|
+
if (type !== undefined && !TASK_TYPES.includes(type)) {
|
|
174
|
+
throw new UsageError(`--type must be one of ${TASK_TYPES.join(', ')}.`, ctx.command);
|
|
175
|
+
}
|
|
176
|
+
const watch = bool(ctx.args, 'watch');
|
|
177
|
+
const opts = watch ? watchOpts(ctx) : undefined;
|
|
178
|
+
const detail = bodyFile !== undefined
|
|
179
|
+
? (await readInputFile(ctx.io, bodyFile, 'body-file')).trim()
|
|
180
|
+
: bodyText;
|
|
181
|
+
const answer = await ctx.api().post('/api/v1/tasks', {
|
|
182
|
+
agent,
|
|
183
|
+
title: title.trim(),
|
|
184
|
+
...(detail ? { body: detail } : {}),
|
|
185
|
+
...(type ? { type } : {}),
|
|
186
|
+
});
|
|
187
|
+
const task = (answer?.task ?? {});
|
|
188
|
+
if (watch && typeof task.id === 'string') {
|
|
189
|
+
if (!ctx.json)
|
|
190
|
+
ctx.io.stdout.write(`Started task ${task.id}.\n`);
|
|
191
|
+
return watchTask(ctx, task.id, opts);
|
|
192
|
+
}
|
|
193
|
+
if (ctx.json)
|
|
194
|
+
return printJson(ctx.io, answer);
|
|
195
|
+
ctx.io.stdout.write('Started a task.\n\n');
|
|
196
|
+
printTask(ctx, task);
|
|
197
|
+
if (typeof task.id === 'string')
|
|
198
|
+
ctx.io.stdout.write(`\nFollow it: firefunc tasks watch ${task.id}\n`);
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
path: ['tasks', 'list'],
|
|
203
|
+
summary: 'Recent tasks, newest first',
|
|
204
|
+
usage: 'tasks list [--state <state>] [--agent <id or @handle>] [--limit <n>]',
|
|
205
|
+
flags: { state: 'string', agent: 'string', limit: 'string' },
|
|
206
|
+
flagHelp: [
|
|
207
|
+
['--state <state>', 'only tasks in this state (firefunc tasks states)'],
|
|
208
|
+
['--agent <id or @handle>', "only this agent's tasks"],
|
|
209
|
+
['--limit <n>', 'how many (1-100, default 25)'],
|
|
210
|
+
],
|
|
211
|
+
async run(ctx) {
|
|
212
|
+
const limit = positiveNumber(ctx.args, 'limit', ctx.command, { min: 1, max: 100 });
|
|
213
|
+
const body = await ctx.api().get('/api/v1/tasks', {
|
|
214
|
+
state: str(ctx.args, 'state'),
|
|
215
|
+
agent: str(ctx.args, 'agent'),
|
|
216
|
+
limit,
|
|
217
|
+
});
|
|
218
|
+
if (ctx.json)
|
|
219
|
+
return printJson(ctx.io, body);
|
|
220
|
+
const rows = listIn(body, 'tasks');
|
|
221
|
+
if (!rows.length) {
|
|
222
|
+
ctx.io.stdout.write('No tasks match.\n');
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
table(ctx.io, rows, [
|
|
226
|
+
{ head: 'ID', get: pick('id') },
|
|
227
|
+
{ head: 'STATE', get: pick('state') },
|
|
228
|
+
{ head: 'TYPE', get: pick('type') },
|
|
229
|
+
{ head: 'CREATED', get: pick('createdAt') },
|
|
230
|
+
{ head: 'TITLE', get: pick('title'), max: 70 },
|
|
231
|
+
]);
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
path: ['tasks', 'get'],
|
|
236
|
+
summary: 'One task: its state, runs and pull requests',
|
|
237
|
+
usage: 'tasks get <task id>',
|
|
238
|
+
positional: { min: 1, max: 1 },
|
|
239
|
+
async run(ctx) {
|
|
240
|
+
const body = await ctx.api().get(`/api/v1/tasks/${enc(ctx.args.positional[0])}`);
|
|
241
|
+
if (ctx.json)
|
|
242
|
+
return printJson(ctx.io, body);
|
|
243
|
+
printTask(ctx, body?.task ?? {});
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
path: ['tasks', 'watch'],
|
|
248
|
+
summary: 'Follow a task until it stops',
|
|
249
|
+
usage: 'tasks watch <task id> [--interval <seconds>] [--timeout <minutes>]',
|
|
250
|
+
details: "Stops when the agent's part is over: resolved, a pull request open for review, parked\n" +
|
|
251
|
+
'for a person (needs_human, requires_human, quota_exceeded), rejected, or failed.\n' +
|
|
252
|
+
'Exit 0 when it stopped, 1 when it failed (the state ends in _failed) or the watch ran\n' +
|
|
253
|
+
'out of time. Network loss is waited out; a refusal ends the watch.\n' +
|
|
254
|
+
'Under --json, prints only the final { task } — nothing while it waits.',
|
|
255
|
+
flags: { interval: 'string', timeout: 'string' },
|
|
256
|
+
flagHelp: watchFlagHelp,
|
|
257
|
+
positional: { min: 1, max: 1 },
|
|
258
|
+
async run(ctx) {
|
|
259
|
+
return watchTask(ctx, ctx.args.positional[0], watchOpts(ctx));
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
path: ['tasks', 'states'],
|
|
264
|
+
summary: 'The states a task can be in, and which are final',
|
|
265
|
+
usage: 'tasks states',
|
|
266
|
+
async run(ctx) {
|
|
267
|
+
const body = await ctx
|
|
268
|
+
.api()
|
|
269
|
+
.get('/api/v1/task-states');
|
|
270
|
+
if (ctx.json)
|
|
271
|
+
return printJson(ctx.io, body);
|
|
272
|
+
const states = Array.isArray(body?.states) ? body.states.map(String) : [];
|
|
273
|
+
const terminal = new Set(Array.isArray(body?.terminal) ? body.terminal.map(String) : []);
|
|
274
|
+
for (const s of states)
|
|
275
|
+
ctx.io.stdout.write(`${s}${terminal.has(s) ? ' (final)' : ''}\n`);
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
];
|
|
279
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
export const CLI_VERSION = (() => {
|
|
5
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
for (const file of [
|
|
7
|
+
join(here, '..', 'build-info.json'),
|
|
8
|
+
join(here, '..', '..', 'package.json'),
|
|
9
|
+
]) {
|
|
10
|
+
try {
|
|
11
|
+
const v = JSON.parse(readFileSync(file, 'utf8')).version;
|
|
12
|
+
if (v)
|
|
13
|
+
return v;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return '0.0.0';
|
|
19
|
+
})();
|
|
20
|
+
export function packageRoot() {
|
|
21
|
+
return join(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=version.js.map
|
package/dist/git-auth.d.ts
CHANGED
|
@@ -7,7 +7,10 @@ export type GitCredential = {
|
|
|
7
7
|
export declare function redact(text: string, token?: string): string;
|
|
8
8
|
export declare function gitAuthEnv(token: string, repo: string): NodeJS.ProcessEnv;
|
|
9
9
|
export declare function cloneRepo(repo: string, dest: string, cred: GitCredential): Promise<ExecResult>;
|
|
10
|
-
export declare
|
|
10
|
+
export declare const pushFlags: (force: boolean) => string[];
|
|
11
|
+
export declare function pushBranch(worktree: string, branch: string, repo: string, cred: GitCredential, opts?: {
|
|
12
|
+
force: boolean;
|
|
13
|
+
}): Promise<ExecResult>;
|
|
11
14
|
export declare function openDraftPr(args: {
|
|
12
15
|
repo: string;
|
|
13
16
|
head: string;
|
package/dist/git-auth.js
CHANGED
|
@@ -35,8 +35,12 @@ export async function cloneRepo(repo, dest, cred) {
|
|
|
35
35
|
});
|
|
36
36
|
return { ...res, stderr: redact(res.stderr, cred.token), stdout: redact(res.stdout, cred.token) };
|
|
37
37
|
}
|
|
38
|
-
export
|
|
39
|
-
|
|
38
|
+
export const pushFlags = (force) => (force ? ['--force-with-lease'] : []);
|
|
39
|
+
export async function pushBranch(worktree, branch, repo, cred, opts = { force: true }) {
|
|
40
|
+
const res = await exec('git', ['-C', worktree, 'push', ...pushFlags(opts.force), 'origin', `${branch}:${branch}`], {
|
|
41
|
+
timeoutMs: 120_000,
|
|
42
|
+
env: gitAuthEnv(cred.token, repo),
|
|
43
|
+
});
|
|
40
44
|
return { ...res, stderr: redact(res.stderr, cred.token), stdout: redact(res.stdout, cred.token) };
|
|
41
45
|
}
|
|
42
46
|
export async function openDraftPr(args) {
|