atris 3.15.36 → 3.15.37

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/README.md CHANGED
@@ -106,7 +106,7 @@ AgentXP is the proof-backed game loop for getting better with agents. Start it
106
106
  inside any project folder:
107
107
 
108
108
  ```bash
109
- npm exec --yes --package github:atrislabs/atris#v3.15.28 -- atris play --as <player>
109
+ npm exec --yes --package atris@latest -- atris play
110
110
  ```
111
111
 
112
112
  The first run creates a local starter mission if one does not exist. The loop is:
@@ -118,13 +118,13 @@ start -> proof -> accept -> login -> sync
118
118
  The player path:
119
119
 
120
120
  ```bash
121
- atris play --as justin
121
+ atris play
122
122
  atris task claim <mission-ref> --as game-manager
123
123
  atris task ready <mission-ref> --as game-manager --proof "<artifact path + verifier result>"
124
124
  atris task accept <mission-ref> --as justin --proof "<human review>"
125
125
  atris xp card --local
126
126
  atris login
127
- atris xp sync --local --as justin
127
+ atris xp sync --local
128
128
  ```
129
129
 
130
130
  The manager path:
package/commands/gm.js CHANGED
@@ -267,8 +267,8 @@ function compactTask(task) {
267
267
  function globalSyncCommands(player) {
268
268
  return [
269
269
  'atris login',
270
- `atris xp sync --local --as ${player}`,
271
- `atris xp sync --local --as ${player} --token <owner-provided-token>`,
270
+ 'atris xp sync --local',
271
+ 'atris xp sync --local --token <owner-provided-token>',
272
272
  ];
273
273
  }
274
274
 
package/commands/play.js CHANGED
@@ -258,8 +258,8 @@ function starterMissionPrompt(player) {
258
258
  function globalSyncCommands(player) {
259
259
  return [
260
260
  'atris login',
261
- `atris xp sync --local --as ${player}`,
262
- `atris xp sync --local --as ${player} --token <owner-provided-token>`,
261
+ 'atris xp sync --local',
262
+ 'atris xp sync --local --token <owner-provided-token>',
263
263
  ];
264
264
  }
265
265
 
package/commands/pull.js CHANGED
@@ -933,12 +933,12 @@ async function pullBusiness(slug) {
933
933
  const relativePath = path.relative(path.dirname(symlinkPath), fullPath);
934
934
 
935
935
  // Business skills override init skills (remove existing symlink if present)
936
- if (fs.existsSync(symlinkPath)) {
937
- try {
938
- const stat = fs.lstatSync(symlinkPath);
939
- if (stat.isSymbolicLink()) fs.unlinkSync(symlinkPath);
940
- else continue; // Don't overwrite real directories
941
- } catch { continue; }
936
+ try {
937
+ const stat = fs.lstatSync(symlinkPath);
938
+ if (stat.isSymbolicLink()) fs.unlinkSync(symlinkPath);
939
+ else continue; // Don't overwrite real directories
940
+ } catch (err) {
941
+ if (err && err.code !== 'ENOENT') continue;
942
942
  }
943
943
  try {
944
944
  fs.symlinkSync(relativePath, symlinkPath);
@@ -959,7 +959,11 @@ async function pullBusiness(slug) {
959
959
  // Count wired skills
960
960
  const wiredSkills = fs.readdirSync(claudeSkillsDir).filter(f => {
961
961
  const p = path.join(claudeSkillsDir, f);
962
- return fs.statSync(p).isDirectory();
962
+ try {
963
+ return fs.statSync(p).isDirectory();
964
+ } catch {
965
+ return false;
966
+ }
963
967
  });
964
968
  if (wiredSkills.length > 0) {
965
969
  console.log(` Wired ${wiredSkills.length} skills → .claude/skills/`);
package/commands/xp.js CHANGED
@@ -1,4 +1,4 @@
1
- const { ensureValidCredentials } = require('../utils/auth');
1
+ const { ensureValidCredentials, getSessionProfile, loadCredentials, profileNameFromEmail } = require('../utils/auth');
2
2
  const { apiRequestJson } = require('../utils/api');
3
3
  const fs = require('fs');
4
4
  const os = require('os');
@@ -1740,18 +1740,54 @@ function projectionWorkspaceSummaries(projection) {
1740
1740
  }];
1741
1741
  }
1742
1742
 
1743
+ function credentialHandle(credentials) {
1744
+ return slugify(
1745
+ credentials?.username
1746
+ || credentials?.handle
1747
+ || credentials?.display_name
1748
+ || credentials?.name
1749
+ || profileNameFromEmail(credentials?.email)
1750
+ || credentials?.user_id
1751
+ );
1752
+ }
1753
+
1754
+ function activeAccountHandle() {
1755
+ const envPlayer = slugify(process.env.ATRIS_PLAYER || process.env.ATRIS_USERNAME);
1756
+ if (envPlayer) return envPlayer;
1757
+
1758
+ const envProfile = slugify(process.env.ATRIS_PROFILE);
1759
+ if (envProfile) return envProfile;
1760
+
1761
+ try {
1762
+ const sessionProfile = slugify(getSessionProfile());
1763
+ if (sessionProfile) return sessionProfile;
1764
+ } catch {}
1765
+
1766
+ try {
1767
+ const credentials = loadCredentials();
1768
+ const handle = credentialHandle(credentials);
1769
+ if (handle) return handle;
1770
+ } catch {}
1771
+
1772
+ return null;
1773
+ }
1774
+
1775
+ function projectionHandle(projection) {
1776
+ return slugify(
1777
+ projection?.operator
1778
+ || projection?.latest_accepted_proof?.actor
1779
+ || projection?.latest_accepted_proof?.assignee
1780
+ || projection?.latest_accepted_proof?.assigned_to
1781
+ );
1782
+ }
1783
+
1743
1784
  function syncPlayer(args, projection) {
1744
1785
  const explicit = readFirstFlag(args, ['--as', '--player', '--user', '--operator'], null);
1745
- return slugify(
1746
- explicit
1747
- || process.env.ATRIS_PLAYER
1748
- || process.env.ATRIS_USERNAME
1749
- || process.env.ATRIS_PROFILE
1750
- || process.env.USER
1751
- || os.userInfo().username
1752
- || projection?.operator
1753
- || 'player'
1754
- ) || 'player';
1786
+ return slugify(explicit)
1787
+ || activeAccountHandle()
1788
+ || projectionHandle(projection)
1789
+ || slugify(process.env.USER || os.userInfo().username)
1790
+ || 'player';
1755
1791
  }
1756
1792
 
1757
1793
  function buildAgentXpSyncPacket(args = []) {
@@ -1899,7 +1935,7 @@ function renderSync(payload) {
1899
1935
  console.log(`Player ${payload.player || entry.username || 'player'} | AgentXP ${formatNumber(entry.agent_xp)} | receipts ${formatNumber(entry.verified_receipts)}`);
1900
1936
  if (payload.dry_run) {
1901
1937
  console.log(`Packet ${payload.packet?.packet_hash || 'unhashed'} ready; no network upload ran.`);
1902
- console.log(`Run atris login, then atris xp sync --local --as ${payload.player || entry.username || '<player>'} to publish to the hosted leaderboard.`);
1938
+ console.log('Run atris login, then atris xp sync --local to publish to the hosted leaderboard.');
1903
1939
  console.log('Guided demos can pass --token <owner-provided-token>.');
1904
1940
  console.log(`Leaderboard: ${AGENTXP_LEADERBOARD_URL}`);
1905
1941
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atris",
3
- "version": "3.15.36",
3
+ "version": "3.15.37",
4
4
  "main": "bin/atris.js",
5
5
  "bin": {
6
6
  "atris": "bin/atris.js",