atris 3.30.5 → 3.30.6
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/commands/mission.js +75 -14
- package/package.json +1 -1
package/commands/mission.js
CHANGED
|
@@ -10,6 +10,8 @@ const {
|
|
|
10
10
|
resolveClaudeRunnerBin,
|
|
11
11
|
} = require('../lib/runner-command');
|
|
12
12
|
const {
|
|
13
|
+
FUNCTIONAL_MEMBER_TOPICS,
|
|
14
|
+
listWorkspaceMemberSlugs,
|
|
13
15
|
normalizeOwnerSlug,
|
|
14
16
|
resolveFunctionalOwner,
|
|
15
17
|
} = require('../lib/functional-owner');
|
|
@@ -142,19 +144,48 @@ function printJsonOrText(payload, lines, asJson) {
|
|
|
142
144
|
for (const line of lines) console.log(line);
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
|
|
147
|
+
const MISSION_RUN_VALUE_FLAGS = [
|
|
148
|
+
'--max-ticks',
|
|
149
|
+
'--max-wall',
|
|
150
|
+
'--cadence',
|
|
151
|
+
'--owner',
|
|
152
|
+
'--runner',
|
|
153
|
+
'--lane',
|
|
154
|
+
'--verify',
|
|
155
|
+
'--stop',
|
|
156
|
+
'--model',
|
|
157
|
+
];
|
|
158
|
+
const MISSION_RUN_BOOLEAN_FLAGS = [
|
|
159
|
+
'--json',
|
|
160
|
+
'--due',
|
|
161
|
+
'--no-claude',
|
|
162
|
+
'--no-verify',
|
|
163
|
+
'--complete-on-pass',
|
|
164
|
+
'--no-drain',
|
|
165
|
+
'--always-on',
|
|
166
|
+
'--xp-task',
|
|
167
|
+
'--agent-xp',
|
|
168
|
+
];
|
|
169
|
+
const DEFAULT_MISSION_RUN_OWNER_SLUGS = new Set(
|
|
170
|
+
FUNCTIONAL_MEMBER_TOPICS.map(topic => normalizeOwnerSlug(topic.owner)),
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
function missionRunInputRequired(asJson = false, owner = '') {
|
|
174
|
+
const defaultOwner = normalizeOwnerSlug(owner || process.env.ATRIS_AGENT_ID || 'mission-lead') || 'mission-lead';
|
|
146
175
|
const payload = {
|
|
147
176
|
ok: false,
|
|
148
177
|
action: 'mission_input_required',
|
|
149
178
|
prompt: 'What mission should Atris run?',
|
|
179
|
+
owner: defaultOwner,
|
|
150
180
|
owner_prompt: 'Which team member should own it?',
|
|
151
|
-
example:
|
|
181
|
+
example: `atris mission run "make onboarding magical" --owner ${defaultOwner}`,
|
|
152
182
|
};
|
|
153
183
|
if (asJson) {
|
|
154
184
|
console.log(JSON.stringify(payload, null, 2));
|
|
155
185
|
} else {
|
|
156
186
|
console.error('What mission should Atris run?');
|
|
157
|
-
console.error(
|
|
187
|
+
if (defaultOwner) console.error(`Team member: ${defaultOwner}`);
|
|
188
|
+
console.error(`Try: atris mission run "make onboarding magical" --owner ${defaultOwner}`);
|
|
158
189
|
}
|
|
159
190
|
process.exit(1);
|
|
160
191
|
}
|
|
@@ -178,6 +209,38 @@ function removeValueFlag(args, name) {
|
|
|
178
209
|
return out;
|
|
179
210
|
}
|
|
180
211
|
|
|
212
|
+
function missionRunOwnerRef(ref, root = process.cwd()) {
|
|
213
|
+
const owner = normalizeOwnerSlug(ref);
|
|
214
|
+
if (!owner || /\s/.test(String(ref || ''))) return null;
|
|
215
|
+
if (listWorkspaceMemberSlugs(root).has(owner)) return owner;
|
|
216
|
+
if (DEFAULT_MISSION_RUN_OWNER_SLUGS.has(owner)) return owner;
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function missionRunArgsWithOwner(args, owner) {
|
|
221
|
+
return [...removeValueFlag(args, '--owner'), '--owner', owner];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function missionRunInputFromArgs(args, root = process.cwd()) {
|
|
225
|
+
const positionals = stripKnownFlags(args, MISSION_RUN_VALUE_FLAGS, MISSION_RUN_BOOLEAN_FLAGS);
|
|
226
|
+
const explicitOwner = Boolean(readFlag(args, '--owner', ''));
|
|
227
|
+
if (!explicitOwner && positionals.length > 0) {
|
|
228
|
+
const owner = missionRunOwnerRef(positionals[0], root);
|
|
229
|
+
if (owner) {
|
|
230
|
+
return {
|
|
231
|
+
ref: positionals.slice(1).join(' ').trim(),
|
|
232
|
+
args: missionRunArgsWithOwner(args, owner),
|
|
233
|
+
owner,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
ref: positionals.join(' ').trim(),
|
|
239
|
+
args,
|
|
240
|
+
owner: readFlag(args, '--owner', ''),
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
181
244
|
async function promptMissionRunInput(args) {
|
|
182
245
|
const defaultOwner = readFlag(args, '--owner', process.env.ATRIS_AGENT_ID || 'mission-lead');
|
|
183
246
|
const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
|
|
@@ -2368,17 +2431,15 @@ async function runMission(args) {
|
|
|
2368
2431
|
const maxTicks = Math.max(1, Number(maxTicksFlag) || MISSION_RUN_DEFAULTS.maxTicks);
|
|
2369
2432
|
const maxWallSeconds = Math.max(60, Number(readFlag(args, '--max-wall', '')) || MISSION_RUN_DEFAULTS.maxWallSeconds);
|
|
2370
2433
|
const cadenceOverride = readFlag(args, '--cadence', '');
|
|
2371
|
-
const
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
['--json', '--due', '--no-claude', '--no-verify', '--complete-on-pass', '--no-drain', '--always-on', '--xp-task', '--agent-xp'],
|
|
2375
|
-
).join(' ').trim();
|
|
2434
|
+
const input = missionRunInputFromArgs(args);
|
|
2435
|
+
const ref = input.ref;
|
|
2436
|
+
const runArgs = input.args;
|
|
2376
2437
|
|
|
2377
2438
|
if (!dueMode && !ref) {
|
|
2378
2439
|
if (asJson || !process.stdin.isTTY || !process.stderr.isTTY) {
|
|
2379
|
-
missionRunInputRequired(asJson);
|
|
2440
|
+
missionRunInputRequired(asJson, input.owner);
|
|
2380
2441
|
}
|
|
2381
|
-
const prompted = await promptMissionRunInput(
|
|
2442
|
+
const prompted = await promptMissionRunInput(runArgs);
|
|
2382
2443
|
startMissionFromRunObjective(prompted.objective, prompted.args);
|
|
2383
2444
|
return;
|
|
2384
2445
|
}
|
|
@@ -2392,8 +2453,8 @@ async function runMission(args) {
|
|
|
2392
2453
|
);
|
|
2393
2454
|
return;
|
|
2394
2455
|
}
|
|
2395
|
-
if (!mission && ref &&
|
|
2396
|
-
startMissionFromRunObjective(ref,
|
|
2456
|
+
if (!mission && ref && !String(ref).startsWith('mission-')) {
|
|
2457
|
+
startMissionFromRunObjective(ref, runArgs);
|
|
2397
2458
|
return;
|
|
2398
2459
|
}
|
|
2399
2460
|
if (!mission) {
|
|
@@ -3216,9 +3277,9 @@ atris mission - durable goal + loop + owner + proof state
|
|
|
3216
3277
|
atris mission goal [--heartbeat] [--json]
|
|
3217
3278
|
atris mission goal-loop [--max-wall 28800] [--max-iterations 32] [--no-claude] [--json]
|
|
3218
3279
|
atris mission tick <id> [--verify] [--complete-on-pass] [--summary "..."] [--json]
|
|
3219
|
-
atris mission run ["objective"|id|--due] [--owner <member>] [--max-ticks 4] [--max-wall 3600] [--cadence "15m"]
|
|
3280
|
+
atris mission run ["objective"|<member> ["objective"]|id|--due] [--owner <member>] [--max-ticks 4] [--max-wall 3600] [--cadence "15m"]
|
|
3220
3281
|
[--no-claude] [--no-verify] [--complete-on-pass] [--no-drain] [--json]
|
|
3221
|
-
(bare run prompts
|
|
3282
|
+
(bare/member-only run prompts; one-word fuzzy intent starts a new visible-goal mission; --due runs the saved queue)
|
|
3222
3283
|
(mission-run completions seed the next visible goal: decide and start the next useful mission)
|
|
3223
3284
|
atris mission complete <id> --proof "..."
|
|
3224
3285
|
atris mission stop <id> [--pause] [--reason "..."]
|