atris 3.53.0 → 3.56.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 (119) hide show
  1. package/FOR_AGENTS.md +7 -0
  2. package/README.md +1 -1
  3. package/atris/policies/ANTISLOP.md +2 -1
  4. package/atris/skills/copy-editor/SKILL.md +2 -1
  5. package/atris/skills/design/SKILL.md +1 -1
  6. package/atris/skills/x-search/SKILL.md +24 -22
  7. package/atris/skills/youtube/SKILL.md +82 -33
  8. package/atris/team/_template/SOUL.md +40 -0
  9. package/atris/team/validator/MEMBER.md +1 -2
  10. package/bin/atris +21 -0
  11. package/bin/atris.js +563 -373
  12. package/commands/api-key.js +170 -0
  13. package/commands/auth.js +453 -43
  14. package/commands/autoland.js +3 -1
  15. package/commands/autopilot-front.js +58 -11
  16. package/commands/avail.js +5 -4
  17. package/commands/balance.js +55 -0
  18. package/commands/bench.js +29 -1
  19. package/commands/brain.js +63 -12
  20. package/commands/brainstorm.js +18 -0
  21. package/commands/business.js +149 -1
  22. package/commands/chat-scan.js +17 -4
  23. package/commands/close.js +5 -1
  24. package/commands/doctor.js +174 -0
  25. package/commands/dream.js +7 -0
  26. package/commands/drill.js +34 -2
  27. package/commands/engine.js +47 -35
  28. package/commands/errors.js +58 -8
  29. package/commands/experiments.js +14 -0
  30. package/commands/feedback.js +61 -2
  31. package/commands/fleet-report.js +27 -7
  32. package/commands/fleet.js +98 -11
  33. package/commands/founder.js +60 -21
  34. package/commands/human-missions.js +79 -4
  35. package/commands/improve.js +54 -4
  36. package/commands/init.js +68 -92
  37. package/commands/install.js +40 -0
  38. package/commands/integrations.js +565 -30
  39. package/commands/interview.js +8 -0
  40. package/commands/land.js +48 -17
  41. package/commands/learn.js +29 -4
  42. package/commands/log.js +51 -0
  43. package/commands/member.js +68 -10
  44. package/commands/mission.js +287 -50
  45. package/commands/now.js +15 -3
  46. package/commands/orb.js +97 -2
  47. package/commands/pack.js +83 -9
  48. package/commands/playbook.js +381 -0
  49. package/commands/plugin.js +16 -0
  50. package/commands/radar.js +31 -7
  51. package/commands/recap.js +128 -21
  52. package/commands/release.js +102 -2
  53. package/commands/review.js +5 -10
  54. package/commands/revisions.js +55 -0
  55. package/commands/run-front.js +12 -4
  56. package/commands/scout.js +12 -1
  57. package/commands/search.js +123 -28
  58. package/commands/sign.js +2 -2
  59. package/commands/signup.js +12 -3
  60. package/commands/site-deploy.js +17 -4
  61. package/commands/site.js +2 -2
  62. package/commands/skill-eval.js +289 -0
  63. package/commands/skill.js +56 -6
  64. package/commands/social.js +603 -0
  65. package/commands/spaceship.js +69 -6
  66. package/commands/stream.js +8 -1
  67. package/commands/study.js +32 -19
  68. package/commands/sync.js +28 -22
  69. package/commands/task.js +435 -60
  70. package/commands/teach.js +72 -63
  71. package/commands/terminal.js +25 -9
  72. package/commands/topup.js +88 -0
  73. package/commands/truth.js +52 -6
  74. package/commands/usage.js +91 -0
  75. package/commands/verify.js +3 -2
  76. package/commands/version.js +3 -1
  77. package/commands/voice.js +5 -1
  78. package/commands/who.js +69 -11
  79. package/commands/wiki.js +7 -4
  80. package/commands/wish.js +76 -5
  81. package/commands/workflow.js +327 -145
  82. package/commands/worktree.js +1 -0
  83. package/commands/write.js +5 -0
  84. package/commands/x-search.js +340 -0
  85. package/commands/xp.js +5 -1
  86. package/commands/youtube.js +551 -25
  87. package/lib/account-bound.js +47 -0
  88. package/lib/auto-accept-certified.js +8 -1
  89. package/lib/auto-lessons.js +186 -0
  90. package/lib/autoland.js +4 -2
  91. package/lib/chat-log-scan.js +7 -4
  92. package/lib/cli-json.js +77 -0
  93. package/lib/cli-scope.js +26 -0
  94. package/lib/codex-flight.js +1 -0
  95. package/lib/conductor-artifacts.js +1 -1
  96. package/lib/context-gatherer.js +11 -0
  97. package/lib/developer-api.js +116 -0
  98. package/lib/feedback-triage.js +274 -0
  99. package/lib/first-minute.js +398 -0
  100. package/lib/fleet.js +115 -34
  101. package/lib/functional-owner.js +22 -0
  102. package/lib/known-commands.js +31 -5
  103. package/lib/member-scaffold.js +197 -0
  104. package/lib/mission-root.js +4 -2
  105. package/lib/noninteractive.js +88 -0
  106. package/lib/policy-lessons.js +4 -1
  107. package/lib/revision-metric.js +279 -0
  108. package/lib/scratch-root.js +48 -0
  109. package/lib/skill-eval-gate.js +249 -0
  110. package/lib/task-db.js +4 -0
  111. package/lib/task-proof.js +69 -8
  112. package/lib/verifier-quality.js +69 -0
  113. package/lib/wish-audit.js +2 -2
  114. package/lib/wish-delegate.js +10 -1
  115. package/lib/workspace-scaffold.js +270 -0
  116. package/package.json +3 -2
  117. package/scripts/det/checklist-score.js +191 -0
  118. package/scripts/det/ytsearch +31 -0
  119. package/utils/update-check.js +15 -0
@@ -0,0 +1,170 @@
1
+ 'use strict';
2
+
3
+ const { apiRequestJson } = require('../utils/api');
4
+ const { loadCredentials } = require('../utils/auth');
5
+ const {
6
+ NOT_LOGGED_IN,
7
+ ROLLOUT_MESSAGE,
8
+ wantsHelp,
9
+ wantsJson,
10
+ tokenFrom,
11
+ isNotFound,
12
+ oneLine,
13
+ printResult,
14
+ } = require('../lib/developer-api');
15
+
16
+ const ACTIONS = new Set(['create', 'list', 'rotate', 'revoke']);
17
+
18
+ function showApiKeyHelp() {
19
+ console.log('usage: atris api-key create [name] [--cap usd]');
20
+ console.log(' atris api-key list');
21
+ console.log(' atris api-key rotate <id>');
22
+ console.log(' atris api-key revoke <id>');
23
+ console.log('create, list, rotate, or revoke a developer api key. add --json for machine output.');
24
+ }
25
+
26
+ function parseApiKeyArgs(args = []) {
27
+ const positionals = [];
28
+ let cap = null;
29
+ let name = null;
30
+ for (let i = 0; i < args.length; i += 1) {
31
+ const arg = String(args[i]);
32
+ if (arg === '--json' || arg === '--help' || arg === '-h' || arg === 'help') continue;
33
+ if (arg === '--cap' || arg.startsWith('--cap=')) {
34
+ const value = arg.startsWith('--cap=') ? arg.slice('--cap='.length) : args[++i];
35
+ if (value == null || String(value).startsWith('--')) {
36
+ return { error: '--cap needs a dollar amount' };
37
+ }
38
+ cap = Number(value);
39
+ continue;
40
+ }
41
+ if (arg === '--name' || arg.startsWith('--name=')) {
42
+ const value = arg.startsWith('--name=') ? arg.slice('--name='.length) : args[++i];
43
+ if (value == null || String(value).startsWith('--')) {
44
+ return { error: '--name needs a label' };
45
+ }
46
+ name = String(value);
47
+ continue;
48
+ }
49
+ if (arg.startsWith('--')) {
50
+ return { error: `unknown api-key option: ${arg}` };
51
+ }
52
+ positionals.push(arg);
53
+ }
54
+
55
+ const action = positionals[0] || '';
56
+ const rest = positionals[1] || '';
57
+ if (cap != null && (!Number.isFinite(cap) || cap <= 0)) {
58
+ return { error: '--cap must be a positive dollar amount' };
59
+ }
60
+ return {
61
+ action,
62
+ id: rest,
63
+ name: name || rest || 'cli',
64
+ cap,
65
+ };
66
+ }
67
+
68
+ function listKeys(data = {}) {
69
+ const raw = data && typeof data === 'object' ? data : {};
70
+ const keys = Array.isArray(raw.keys) ? raw.keys : Array.isArray(raw) ? raw : [];
71
+ if (keys.length === 0) return 'no api keys yet.';
72
+ return keys.map((key) => {
73
+ const id = key.id || key.agent_id || '';
74
+ const label = key.name || key.label || key.agent_name || 'api key';
75
+ const prefix = key.api_key || key.api_key_prefix || '';
76
+ return `${id} ${label}${prefix ? ` ${prefix}` : ''}`;
77
+ }).join('\n');
78
+ }
79
+
80
+ function createdKeyText(data = {}) {
81
+ const key = data.api_key || data.new_api_key || '';
82
+ const id = data.agent_id || data.id || '';
83
+ if (!key) return oneLine(data.message || 'api key created.');
84
+ return `store this key now; it will not be shown again.\n${id ? `${id}\n` : ''}${key}`;
85
+ }
86
+
87
+ async function apiKeyCommand(args = [], deps = {}) {
88
+ if (wantsHelp(args) || args.length === 0) {
89
+ showApiKeyHelp();
90
+ return args.length === 0 ? 1 : 0;
91
+ }
92
+
93
+ const json = wantsJson(args);
94
+ const io = { log: deps.log || console.log, err: deps.err || console.error };
95
+ const parsed = parseApiKeyArgs(args);
96
+ if (parsed.error) {
97
+ printResult({ json, ok: false, error: parsed.error, payload: { ok: false, error: parsed.error } }, io);
98
+ return 1;
99
+ }
100
+ if (!ACTIONS.has(parsed.action)) {
101
+ const error = 'usage: atris api-key create|list|rotate|revoke';
102
+ printResult({ json, ok: false, error, payload: { ok: false, error } }, io);
103
+ return 1;
104
+ }
105
+ if ((parsed.action === 'rotate' || parsed.action === 'revoke') && !parsed.id) {
106
+ const error = `usage: atris api-key ${parsed.action} <id>`;
107
+ printResult({ json, ok: false, error, payload: { ok: false, error } }, io);
108
+ return 1;
109
+ }
110
+
111
+ const load = deps.loadCredentials || loadCredentials;
112
+ const request = deps.apiRequestJson || apiRequestJson;
113
+ const token = tokenFrom(load());
114
+ if (!token) {
115
+ printResult({ json, ok: false, error: NOT_LOGGED_IN, payload: { ok: false, error: NOT_LOGGED_IN } }, io);
116
+ return 1;
117
+ }
118
+
119
+ try {
120
+ let result;
121
+ if (parsed.action === 'list') {
122
+ result = await request('/developer/keys', { method: 'GET', token });
123
+ } else if (parsed.action === 'create') {
124
+ const body = { name: parsed.name };
125
+ if (parsed.cap != null) body.monthly_spend_cap_usd = parsed.cap;
126
+ result = await request('/developer/create-key', { method: 'POST', token, body });
127
+ } else if (parsed.action === 'rotate') {
128
+ result = await request(`/developer/keys/${encodeURIComponent(parsed.id)}/rotate`, {
129
+ method: 'POST',
130
+ token,
131
+ });
132
+ } else {
133
+ result = await request(`/developer/keys/${encodeURIComponent(parsed.id)}`, {
134
+ method: 'DELETE',
135
+ token,
136
+ });
137
+ }
138
+
139
+ const developerRoute = parsed.action === 'list' || parsed.action === 'create';
140
+ if (developerRoute && isNotFound(result)) {
141
+ printResult({
142
+ json,
143
+ ok: false,
144
+ error: ROLLOUT_MESSAGE,
145
+ payload: { ok: false, error: ROLLOUT_MESSAGE, status: 404 },
146
+ }, io);
147
+ return 1;
148
+ }
149
+ if (!result || !result.ok) {
150
+ const error = oneLine(result && result.error);
151
+ printResult({ json, ok: false, error, payload: { ok: false, error, status: result && result.status } }, io);
152
+ return 1;
153
+ }
154
+
155
+ const data = result.data || {};
156
+ let text = '';
157
+ if (parsed.action === 'list') text = listKeys(data);
158
+ else if (parsed.action === 'create' || parsed.action === 'rotate') text = createdKeyText(data);
159
+ else text = oneLine(data.message || `api key revoked for ${parsed.id}.`);
160
+
161
+ printResult({ json, ok: true, text, payload: { ok: true, ...data } }, io);
162
+ return 0;
163
+ } catch (error) {
164
+ const message = oneLine(error && error.message);
165
+ printResult({ json, ok: false, error: message, payload: { ok: false, error: message } }, io);
166
+ return 1;
167
+ }
168
+ }
169
+
170
+ module.exports = { apiKeyCommand, showApiKeyHelp, parseApiKeyArgs, listKeys };