atris 3.38.0 → 3.41.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.
Files changed (78) hide show
  1. package/AGENTS.md +25 -6
  2. package/atris/PERSONA.md +8 -4
  3. package/atris.md +7 -0
  4. package/ax +2 -1
  5. package/bin/atris.js +31 -6
  6. package/commands/agent-spawn.js +13 -11
  7. package/commands/autoland.js +28 -77
  8. package/commands/bench.js +10 -12
  9. package/commands/business.js +345 -0
  10. package/commands/chat-scan.js +5 -7
  11. package/commands/codex-goal.js +8 -10
  12. package/commands/computer.js +20 -0
  13. package/commands/console.js +19 -3
  14. package/commands/decide.js +166 -0
  15. package/commands/deck.js +1 -4
  16. package/commands/drill.js +14 -24
  17. package/commands/engine.js +196 -8
  18. package/commands/gm.js +8 -6
  19. package/commands/harvest.js +1 -4
  20. package/commands/init.js +23 -3
  21. package/commands/land.js +8 -14
  22. package/commands/launchpad.js +1 -14
  23. package/commands/lifecycle.js +5 -5
  24. package/commands/log.js +55 -5
  25. package/commands/member.js +558 -574
  26. package/commands/mission.js +456 -237
  27. package/commands/pack.js +2746 -164
  28. package/commands/play.js +6 -4
  29. package/commands/probe.js +2 -2
  30. package/commands/pulse.js +15 -16
  31. package/commands/release.js +10 -9
  32. package/commands/router.js +5 -4
  33. package/commands/site-deploy.js +885 -0
  34. package/commands/site.js +11 -2
  35. package/commands/slop.js +14 -2
  36. package/commands/stream.js +4 -18
  37. package/commands/task.js +880 -558
  38. package/commands/taste.js +101 -0
  39. package/commands/team.js +176 -3
  40. package/commands/vercel.js +4 -2
  41. package/commands/voice.js +195 -0
  42. package/commands/watch.js +1 -22
  43. package/commands/wiki.js +1 -4
  44. package/commands/workflow.js +2 -2
  45. package/commands/worktree.js +1 -14
  46. package/commands/xp.js +27 -24
  47. package/lib/accept-verify-gate.js +5 -1
  48. package/lib/arg-parser.js +41 -0
  49. package/lib/auto-accept-certified.js +116 -1
  50. package/lib/autoland.js +66 -0
  51. package/lib/bench/runner.js +19 -1
  52. package/lib/context-gatherer.js +7 -1
  53. package/lib/engine-registry.js +141 -20
  54. package/lib/falsifier-probe.js +84 -0
  55. package/lib/fleet.js +65 -15
  56. package/lib/git-spawn.js +15 -0
  57. package/lib/json-file.js +37 -0
  58. package/lib/known-commands.js +2 -2
  59. package/lib/lesson-preflight.js +146 -0
  60. package/lib/loop-doctor.js +0 -2
  61. package/lib/mission-human-asks.js +28 -0
  62. package/lib/mission-protected-lane.js +4 -1
  63. package/lib/official-cli-integration.js +47 -2
  64. package/lib/orb-context.js +8 -1
  65. package/lib/pack-capabilities.js +685 -0
  66. package/lib/router-brain.js +51 -1
  67. package/lib/runner-command.js +0 -6
  68. package/lib/self-drive.js +44 -13
  69. package/lib/task-db.js +137 -3
  70. package/lib/task-decision.js +50 -0
  71. package/lib/taste-lessons.js +153 -0
  72. package/lib/tool-result-encode.js +17 -1
  73. package/lib/voice-gate.js +66 -0
  74. package/lib/wish-audit.js +1 -1
  75. package/lib/wish-delegate.js +1 -1
  76. package/lib/zip.js +95 -7
  77. package/package.json +2 -1
  78. package/templates/business-starter/persona.md +9 -0
package/commands/play.js CHANGED
@@ -5,6 +5,7 @@ const os = require('os');
5
5
  const fs = require('fs');
6
6
  const { spawnSync } = require('child_process');
7
7
  const { getSessionProfile, loadCredentials } = require('../utils/auth');
8
+ const { hasFlag: hasExactFlag } = require('../lib/arg-parser');
8
9
 
9
10
  const AGENTXP_LEADERBOARD_URL = 'https://api.atris.ai/api/agentxp/leaderboard';
10
11
  const AGENTXP_GLOBAL_SYNC_RULE = 'Run atris login, then sync. Owner-provided sync tokens are guided-demo fallback only.';
@@ -38,8 +39,9 @@ function flag(args, name) {
38
39
  return null;
39
40
  }
40
41
 
41
- function hasFlag(args, name) {
42
- return args.includes(name) || args.some(arg => arg.startsWith(`${name}=`));
42
+ // This command treats --name=value as flag presence as well as a standalone flag.
43
+ function hasFlagOrValue(args, name) {
44
+ return hasExactFlag(args, name) || args.some(arg => arg.startsWith(`${name}=`));
43
45
  }
44
46
 
45
47
  function positional(args) {
@@ -284,7 +286,7 @@ function handleSourceLine(state) {
284
286
  }
285
287
 
286
288
  function ensureStarterMission(taskDb, db, workspaceRoot, player, tasks, args = []) {
287
- if (hasFlag(args, '--no-seed')) return { tasks, seeded: null };
289
+ if (hasFlagOrValue(args, '--no-seed')) return { tasks, seeded: null };
288
290
  if (selectMission(tasks, player)) return { tasks, seeded: null };
289
291
  fs.mkdirSync(path.join(workspaceRoot, 'atris'), { recursive: true });
290
292
 
@@ -476,7 +478,7 @@ async function playCommand(...args) {
476
478
  }
477
479
 
478
480
  const state = modeState(args);
479
- if (hasFlag(args, '--json')) {
481
+ if (hasFlagOrValue(args, '--json')) {
480
482
  console.log(JSON.stringify(state, null, 2));
481
483
  return;
482
484
  }
package/commands/probe.js CHANGED
@@ -29,7 +29,7 @@ const http = require('http');
29
29
  const path = require('path');
30
30
  const { getApiBaseUrl } = require('../utils/api');
31
31
  const { loadCredentials } = require('../utils/auth');
32
- const { encodeToolResult } = require('../lib/tool-result-encode');
32
+ const { buildToolResultBody } = require('../lib/tool-result-encode');
33
33
 
34
34
  // G2's honest blocked message (tool_policy_bench.MAX_TURNS_EXHAUSTED_MESSAGE)
35
35
  // starts with this — an answer that is only this marker is a dead-end.
@@ -357,7 +357,7 @@ async function runAtris2Turn(opts = {}) {
357
357
  unsupported.push(`tool:${name || '?'}`);
358
358
  }
359
359
  await postJson(`${base}/atris2/turn/tool-result`, token,
360
- { call_id: ev.call_id || ev.id, result_base64: encodeToolResult(out) }, 30000);
360
+ buildToolResultBody(ev.call_id || ev.id, out), 30000);
361
361
  resetIdle();
362
362
  }).catch((e) => reject(e));
363
363
  } else if (et === 'result') {
package/commands/pulse.js CHANGED
@@ -19,11 +19,10 @@ const path = require('path');
19
19
  const { spawnSync } = require('child_process');
20
20
  const pulse = require('../lib/pulse');
21
21
  const { DEFAULT_CLAUDE_RUNNER_MODEL } = require('../lib/runner-command');
22
+ const { hasFlag } = require('../lib/arg-parser');
22
23
 
23
- function hasFlag(args, name) {
24
- return args.includes(name);
25
- }
26
- function readFlag(args, name, fallback = null) {
24
+ // Preserve the existing rule that the next token is a value, even if it is a flag.
25
+ function readFollowingFlag(args, name, fallback = null) {
27
26
  const i = args.indexOf(name);
28
27
  if (i === -1 || i === args.length - 1) return fallback;
29
28
  return args[i + 1];
@@ -208,7 +207,7 @@ function tickCommand(args, root = process.cwd()) {
208
207
  const asJson = wantsJson(args);
209
208
  const noClaude = hasFlag(args, '--no-claude');
210
209
  const noVerify = hasFlag(args, '--no-verify');
211
- const verifyCmd = noVerify ? null : readFlag(args, '--verify', pulse.defaultVerifyCmd(root));
210
+ const verifyCmd = noVerify ? null : readFollowingFlag(args, '--verify', pulse.defaultVerifyCmd(root));
212
211
  const startedAt = Date.now();
213
212
 
214
213
  // Detect a previous tick that died mid-run before we take the lock.
@@ -577,7 +576,7 @@ function installCommand(args, root = process.cwd(), options = {}) {
577
576
  const commandSpawn = options.spawnSync || spawnSync;
578
577
  const writeOutput = options.writeOutput || ((text) => process.stdout.write(text));
579
578
  const slot = pulse.resolvePulseSlot(root, options.homeDir ? { homeDir: options.homeDir } : {});
580
- const cadenceInput = readFlag(args, '--cadence', pulse.DEFAULT_CADENCE_CRON);
579
+ const cadenceInput = readFollowingFlag(args, '--cadence', pulse.DEFAULT_CADENCE_CRON);
581
580
  let cron;
582
581
  try {
583
582
  cron = pulse.normalizeCronCadence(cadenceInput);
@@ -595,8 +594,8 @@ function installCommand(args, root = process.cwd(), options = {}) {
595
594
  let expiry;
596
595
  try {
597
596
  expiry = pulse.normalizeExpiryDuration({
598
- hours: readFlag(args, '--hours', null),
599
- days: readFlag(args, '--days', '7'),
597
+ hours: readFollowingFlag(args, '--hours', null),
598
+ days: readFollowingFlag(args, '--days', '7'),
600
599
  });
601
600
  } catch (error) {
602
601
  const out = {
@@ -604,17 +603,17 @@ function installCommand(args, root = process.cwd(), options = {}) {
604
603
  action: 'pulse_install',
605
604
  reason: 'invalid_expiry',
606
605
  detail: error && error.message ? error.message : String(error),
607
- hours: readFlag(args, '--hours', null),
608
- days: readFlag(args, '--days', '7'),
606
+ hours: readFollowingFlag(args, '--hours', null),
607
+ days: readFollowingFlag(args, '--days', '7'),
609
608
  };
610
609
  if (!asJson) process.stdout.write(`pulse install failed: ${out.detail}\n`);
611
610
  return emit(out, asJson);
612
611
  }
613
- const verifyCmd = readFlag(args, '--verify', pulse.defaultVerifyCmd(root));
614
- const model = readFlag(args, '--model', process.env.ATRIS_RUNNER_MODEL || process.env.ATRIS_CLAUDE_MODEL || DEFAULT_CLAUDE_RUNNER_MODEL);
615
- const runnerProfile = readFlag(args, '--runner-profile', process.env.ATRIS_RUNNER_PROFILE || '');
616
- const runnerBin = readFlag(args, '--runner-bin', process.env.ATRIS_RUNNER_BIN || process.env.ATRIS_CLAUDE_BIN || '');
617
- const runnerCommandTemplate = readFlag(args, '--runner-template', process.env.ATRIS_RUNNER_COMMAND_TEMPLATE || process.env.ATRIS_CLAUDE_COMMAND_TEMPLATE || '');
612
+ const verifyCmd = readFollowingFlag(args, '--verify', pulse.defaultVerifyCmd(root));
613
+ const model = readFollowingFlag(args, '--model', process.env.ATRIS_RUNNER_MODEL || process.env.ATRIS_CLAUDE_MODEL || DEFAULT_CLAUDE_RUNNER_MODEL);
614
+ const runnerProfile = readFollowingFlag(args, '--runner-profile', process.env.ATRIS_RUNNER_PROFILE || '');
615
+ const runnerBin = readFollowingFlag(args, '--runner-bin', process.env.ATRIS_RUNNER_BIN || process.env.ATRIS_CLAUDE_BIN || '');
616
+ const runnerCommandTemplate = readFollowingFlag(args, '--runner-template', process.env.ATRIS_RUNNER_COMMAND_TEMPLATE || process.env.ATRIS_CLAUDE_COMMAND_TEMPLATE || '');
618
617
  const deadlineEpoch = Math.floor(Date.now() / 1000) + expiry.seconds;
619
618
 
620
619
  fs.mkdirSync(slot.stateHome, { recursive: true });
@@ -735,7 +734,7 @@ function uninstallCommand(args, root = process.cwd(), options = {}) {
735
734
 
736
735
  function runCommand(args, root = process.cwd()) {
737
736
  const asJson = wantsJson(args);
738
- const maxTicks = Math.max(1, Number(readFlag(args, '--max-ticks', '1')) || 1);
737
+ const maxTicks = Math.max(1, Number(readFollowingFlag(args, '--max-ticks', '1')) || 1);
739
738
  const passthrough = args.filter((a) => a !== '--max-ticks' && a !== String(maxTicks));
740
739
  const results = [];
741
740
  for (let i = 0; i < maxTicks; i++) {
@@ -7,7 +7,7 @@ const { execFileSync } = require('child_process');
7
7
  *
8
8
  * - Reads git log since last tag
9
9
  * - Determines bump type (minor if any scorecard has reward>=5, else patch)
10
- * - Bumps package.json version
10
+ * - Bumps package.json and package-lock.json together
11
11
  * - Commits, tags, pushes
12
12
  * - Creates GitHub release via `gh`
13
13
  * - Drafts a /launch post (3 emoji bullets)
@@ -79,16 +79,17 @@ async function releaseAtris({ dryRun = false } = {}) {
79
79
  return;
80
80
  }
81
81
 
82
- // 7. Bump package.json
83
- const updatedPkgRaw = pkgRaw.replace(
84
- `"version": "${currentVersion}"`,
85
- `"version": "${nextVersion}"`
86
- );
87
- fs.writeFileSync(pkgPath, updatedPkgRaw);
88
- console.log(`bumped package.json to ${nextVersion}`);
82
+ // 7. Let npm keep package.json and package-lock.json aligned.
83
+ execFileSync('npm', [
84
+ 'version',
85
+ nextVersion,
86
+ '--no-git-tag-version',
87
+ '--ignore-scripts',
88
+ ], { cwd, stdio: 'ignore' });
89
+ console.log(`bumped package.json and package-lock.json to ${nextVersion}`);
89
90
 
90
91
  // 8. Commit
91
- execFileSync('git', ['add', 'package.json'], { cwd });
92
+ execFileSync('git', ['add', 'package.json', 'package-lock.json'], { cwd });
92
93
  execFileSync('git', ['commit', '-m', `v${nextVersion}`], { cwd });
93
94
  console.log('committed');
94
95
 
@@ -13,7 +13,8 @@ const LANE_ORDER = ['fast', 'pro', 'max', 'code-fast'];
13
13
  const DEPTH = { fast: 0, 'code-fast': 1, pro: 1, max: 2 };
14
14
  const QUALITY_MISS_WEIGHT = 3;
15
15
 
16
- function readFlag(args, names) {
16
+ // Preserve alias priority and inline-value priority within each alias.
17
+ function readFirstNamedFlag(args, names) {
17
18
  for (const name of names) {
18
19
  const prefix = `${name}=`;
19
20
  const inline = args.find((arg) => String(arg).startsWith(prefix));
@@ -29,14 +30,14 @@ function readFlag(args, names) {
29
30
  function resolveRouterPaths(args = [], env = process.env) {
30
31
  const home = env.HOME || os.homedir();
31
32
  return {
32
- picks: path.resolve(readFlag(args, ['--picks', '--picks-path'])
33
+ picks: path.resolve(readFirstNamedFlag(args, ['--picks', '--picks-path'])
33
34
  || env.ATRIS_ROUTER_PICKS_PATH
34
35
  || env.ATRIS_AX_AUTO_PICKS_PATH
35
36
  || path.join(home, '.atris', 'ax-auto-picks.jsonl')),
36
- overrides: path.resolve(readFlag(args, ['--overrides', '--overrides-path'])
37
+ overrides: path.resolve(readFirstNamedFlag(args, ['--overrides', '--overrides-path'])
37
38
  || env.ATRIS_ROUTER_OVERRIDES_PATH
38
39
  || path.join(home, '.atris', 'router-overrides.json')),
39
- gold: path.resolve(readFlag(args, ['--gold', '--gold-path'])
40
+ gold: path.resolve(readFirstNamedFlag(args, ['--gold', '--gold-path'])
40
41
  || env.ATRIS_ROUTER_GOLD_PATH
41
42
  || DEFAULT_GOLD_PATH),
42
43
  };