atris 2.6.3 → 3.0.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/README.md +124 -34
- package/atris/CLAUDE.md +5 -1
- package/atris/atris.md +4 -0
- package/atris/features/README.md +24 -0
- package/atris/skills/autopilot/SKILL.md +74 -75
- package/atris/skills/endgame/SKILL.md +179 -0
- package/atris/skills/flow/SKILL.md +121 -0
- package/atris/skills/improve/SKILL.md +84 -0
- package/atris/skills/loop/SKILL.md +72 -0
- package/atris/skills/wiki/SKILL.md +61 -0
- package/atris/team/executor/MEMBER.md +10 -4
- package/atris/team/navigator/MEMBER.md +2 -0
- package/atris/team/validator/MEMBER.md +8 -5
- package/atris.md +33 -0
- package/bin/atris.js +210 -41
- package/commands/activate.js +28 -2
- package/commands/align.js +720 -0
- package/commands/auth.js +75 -2
- package/commands/autopilot.js +1213 -270
- package/commands/browse.js +100 -0
- package/commands/business.js +785 -12
- package/commands/clean.js +107 -2
- package/commands/computer.js +429 -0
- package/commands/context-sync.js +78 -8
- package/commands/experiments.js +351 -0
- package/commands/feedback.js +150 -0
- package/commands/fleet.js +395 -0
- package/commands/fork.js +127 -0
- package/commands/init.js +50 -1
- package/commands/learn.js +407 -0
- package/commands/lifecycle.js +94 -0
- package/commands/loop.js +114 -0
- package/commands/publish.js +129 -0
- package/commands/pull.js +369 -38
- package/commands/push.js +283 -246
- package/commands/review.js +149 -0
- package/commands/run.js +76 -43
- package/commands/serve.js +360 -0
- package/commands/setup.js +1 -1
- package/commands/soul.js +381 -0
- package/commands/status.js +119 -1
- package/commands/sync.js +147 -1
- package/commands/terminal.js +201 -0
- package/commands/wiki.js +376 -0
- package/commands/workflow.js +191 -74
- package/commands/workspace-clean.js +3 -3
- package/lib/endstate.js +259 -0
- package/lib/learnings.js +235 -0
- package/lib/manifest.js +1 -0
- package/lib/todo.js +9 -5
- package/lib/wiki.js +578 -0
- package/package.json +2 -2
- package/utils/api.js +40 -35
- package/utils/auth.js +1 -0
package/commands/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { loadCredentials, saveCredentials, deleteCredentials, getCredentialsPath, openBrowser, promptUser, displayAccountSummary, loadProfile, listProfiles, profileNameFromEmail, deleteProfile, getTerminalSessionId, setSessionProfile, getSessionProfile, clearSessionProfile, cleanStaleSessions } = require('../utils/auth');
|
|
1
|
+
const { loadCredentials, saveCredentials, deleteCredentials, getCredentialsPath, openBrowser, promptUser, displayAccountSummary, loadProfile, listProfiles, profileNameFromEmail, deleteProfile, getTerminalSessionId, setSessionProfile, getSessionProfile, clearSessionProfile, cleanStaleSessions, getSessionsDir } = require('../utils/auth');
|
|
2
2
|
const { getAppBaseUrl, apiRequestJson } = require('../utils/api');
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
@@ -451,6 +451,58 @@ function profileEmail() {
|
|
|
451
451
|
process.exit(1);
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
+
function activateGlobal() {
|
|
455
|
+
// Hidden command: atris _activate <name> → copy profile to credentials.json
|
|
456
|
+
// Called by the shell wrapper so `atris switch` persists across terminals.
|
|
457
|
+
const name = process.argv[3];
|
|
458
|
+
if (!name) { process.exit(1); }
|
|
459
|
+
const profile = loadProfile(name);
|
|
460
|
+
if (!profile || !profile.token) { process.exit(1); }
|
|
461
|
+
const credentialsPath = getCredentialsPath();
|
|
462
|
+
fs.writeFileSync(credentialsPath, JSON.stringify(profile, null, 2));
|
|
463
|
+
try { fs.chmodSync(credentialsPath, 0o600); } catch {}
|
|
464
|
+
process.exit(0);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function switchSession() {
|
|
468
|
+
// Hidden command: atris _switch-session <name> [--session-id <id>]
|
|
469
|
+
// Per-terminal switch: writes session file so each tab keeps its own account.
|
|
470
|
+
// Falls back to global (credentials.json) when no session ID is available.
|
|
471
|
+
const args = process.argv.slice(3);
|
|
472
|
+
const name = args.filter(a => !a.startsWith('-'))[0];
|
|
473
|
+
if (!name) { process.exit(1); }
|
|
474
|
+
|
|
475
|
+
const profile = loadProfile(name);
|
|
476
|
+
if (!profile || !profile.token) { process.exit(1); }
|
|
477
|
+
|
|
478
|
+
// Accept explicit session ID from the shell wrapper (more reliable than
|
|
479
|
+
// detecting it from inside a child process where TTY env vars may be missing).
|
|
480
|
+
const sidIdx = args.indexOf('--session-id');
|
|
481
|
+
const explicitId = sidIdx !== -1 ? args[sidIdx + 1] : null;
|
|
482
|
+
|
|
483
|
+
if (explicitId) {
|
|
484
|
+
// Write session file directly using the caller's session ID
|
|
485
|
+
const sanitized = explicitId.replace(/[^a-zA-Z0-9_-]/g, '-').slice(0, 64);
|
|
486
|
+
const sessPath = path.join(getSessionsDir(), `${sanitized}.json`);
|
|
487
|
+
fs.writeFileSync(sessPath, JSON.stringify({
|
|
488
|
+
profile: name,
|
|
489
|
+
set_at: new Date().toISOString(),
|
|
490
|
+
}));
|
|
491
|
+
} else {
|
|
492
|
+
// Try to detect terminal ID from this process; fall back to global
|
|
493
|
+
const termId = getTerminalSessionId();
|
|
494
|
+
if (termId) {
|
|
495
|
+
setSessionProfile(name);
|
|
496
|
+
} else {
|
|
497
|
+
// No terminal ID — global fallback
|
|
498
|
+
const credentialsPath = getCredentialsPath();
|
|
499
|
+
fs.writeFileSync(credentialsPath, JSON.stringify(profile, null, 2));
|
|
500
|
+
try { fs.chmodSync(credentialsPath, 0o600); } catch {}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
process.exit(0);
|
|
504
|
+
}
|
|
505
|
+
|
|
454
506
|
function shellInit() {
|
|
455
507
|
// Output shell function for per-terminal account switching
|
|
456
508
|
// Usage: eval "$(atris shell-init)" (add to ~/.zshrc)
|
|
@@ -458,12 +510,27 @@ function shellInit() {
|
|
|
458
510
|
const lines = [
|
|
459
511
|
'# Atris per-terminal account switching',
|
|
460
512
|
'# Added by: eval "$(atris shell-init)"',
|
|
513
|
+
'_atris_session_id() {',
|
|
514
|
+
' # Detect terminal session ID — same priority as the Node.js code',
|
|
515
|
+
' local _sid="${TERM_SESSION_ID:-${ITERM_SESSION_ID:-${TMUX_PANE:-${WT_SESSION:-${WEZTERM_PANE:-}}}}}"',
|
|
516
|
+
' if [[ -n "$_sid" ]]; then echo "$_sid"; return; fi',
|
|
517
|
+
' # Fallback: TTY device (unique per macOS/Linux terminal tab)',
|
|
518
|
+
' local _tty',
|
|
519
|
+
' _tty=$(tty 2>/dev/null)',
|
|
520
|
+
' if [[ $? -eq 0 && "$_tty" == /dev/* ]]; then echo "$_tty"; return; fi',
|
|
521
|
+
'}',
|
|
461
522
|
'atris() {',
|
|
462
523
|
' if [[ "$1" == "switch" && -n "$2" && "$2" != "--"* ]]; then',
|
|
463
524
|
' local _profile',
|
|
464
525
|
' _profile=$(command atris _resolve "$2" 2>/dev/null)',
|
|
465
526
|
' if [[ $? -eq 0 && -n "$_profile" ]]; then',
|
|
466
527
|
' export ATRIS_PROFILE="$_profile"',
|
|
528
|
+
' local _sid',
|
|
529
|
+
' _sid=$(_atris_session_id)',
|
|
530
|
+
' if [[ -n "$_sid" ]]; then',
|
|
531
|
+
' command atris _switch-session "$_profile" --session-id "$_sid" 2>/dev/null',
|
|
532
|
+
' fi',
|
|
533
|
+
' command atris _activate "$_profile" 2>/dev/null',
|
|
467
534
|
' local _email',
|
|
468
535
|
' _email=$(command atris _profile-email "$_profile" 2>/dev/null)',
|
|
469
536
|
' echo "Switched to ${_email:-$_profile}"',
|
|
@@ -481,6 +548,12 @@ function shellInit() {
|
|
|
481
548
|
' _profile=$(command atris _resolve "$_pick" 2>/dev/null)',
|
|
482
549
|
' if [[ $? -eq 0 && -n "$_profile" ]]; then',
|
|
483
550
|
' export ATRIS_PROFILE="$_profile"',
|
|
551
|
+
' local _sid',
|
|
552
|
+
' _sid=$(_atris_session_id)',
|
|
553
|
+
' if [[ -n "$_sid" ]]; then',
|
|
554
|
+
' command atris _switch-session "$_profile" --session-id "$_sid" 2>/dev/null',
|
|
555
|
+
' fi',
|
|
556
|
+
' command atris _activate "$_profile" 2>/dev/null',
|
|
484
557
|
' local _email',
|
|
485
558
|
' _email=$(command atris _profile-email "$_profile" 2>/dev/null)',
|
|
486
559
|
' echo "Switched to ${_email:-$_profile}"',
|
|
@@ -496,4 +569,4 @@ function shellInit() {
|
|
|
496
569
|
console.log(lines.join('\n'));
|
|
497
570
|
}
|
|
498
571
|
|
|
499
|
-
module.exports = { loginAtris, logoutAtris, whoamiAtris, switchAccount, useAccount, accountsCmd, listAccountsCmd, resolveProfile, profileEmail, shellInit };
|
|
572
|
+
module.exports = { loginAtris, logoutAtris, whoamiAtris, switchAccount, useAccount, accountsCmd, listAccountsCmd, resolveProfile, profileEmail, activateGlobal, switchSession, shellInit };
|