@aglit-ai/cli 0.1.17107 → 0.1.17135
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/bin/aglit.cjs +14 -4
- package/package.json +1 -1
package/bin/aglit.cjs
CHANGED
|
@@ -27,7 +27,7 @@ const help = `Aglit Computer Use
|
|
|
27
27
|
aglit console
|
|
28
28
|
aglit update [--check] [--channel latest|canary|embedded] [--json]
|
|
29
29
|
aglit updates on|off|status [--json]
|
|
30
|
-
aglit enable | disable
|
|
30
|
+
aglit enable [--two-factor on|off] | disable
|
|
31
31
|
aglit teams [--open]
|
|
32
32
|
aglit team --name "Team name" [--team TEAM_ID] [--workspace WORKSPACE_ID]
|
|
33
33
|
aglit pipelines [--open]
|
|
@@ -68,7 +68,7 @@ async function finishUninstall(receipt) {
|
|
|
68
68
|
async function main() {
|
|
69
69
|
const delegated = installation.development ? null : updates.delegate(__filename); if (delegated !== null) { process.exitCode = delegated; return; }
|
|
70
70
|
const { values, positionals } = parseArgs({ options: {
|
|
71
|
-
connections: { type: 'string' }, attempt: { type: 'string' }, reauth: {type:'boolean'},
|
|
71
|
+
'two-factor': { type: 'string' }, connections: { type: 'string' }, attempt: { type: 'string' }, reauth: {type:'boolean'},
|
|
72
72
|
harness: { type: 'boolean' },
|
|
73
73
|
device: { type: 'string' }, fingerprint: { type: 'string' }, challenge: { type: 'string' }, code: { type: 'string' }, connection: { type: 'string' }, model: { type: 'string' }, name: { type: 'string' }, provider: { type: 'string' }, account: { type: 'string' },
|
|
74
74
|
team: { type: 'string' }, workspace: { type: 'string' }, check: { type: 'boolean' }, channel: { type: 'string' }, open: { type: 'boolean' }, json: { type: 'boolean' }, help: { type: 'boolean', short: 'h' },
|
|
@@ -79,9 +79,11 @@ async function main() {
|
|
|
79
79
|
const options = {
|
|
80
80
|
models: ['device','fingerprint','name','json','challenge','code','connection','connections','model','harness','attempt','reauth'],
|
|
81
81
|
install: ['json', 'channel'], init: ['name', 'provider', 'account', 'json', 'channel'],
|
|
82
|
-
start: ['json', 'channel'], ui: ['json'], status: ['json'], update: ['check', 'channel', 'json'], updates: ['json'], enable: [], disable: [], rename: ['name', 'json'], console: ['json'], teams: ['json', 'open'], team: ['name', 'team', 'workspace', 'json'], pipelines: ['open', 'json'], providers: ['json'], invite: ['team'], uninstall: [],
|
|
82
|
+
start: ['json', 'channel'], ui: ['json'], status: ['json'], update: ['check', 'channel', 'json'], updates: ['json'], enable: ['two-factor'], disable: [], rename: ['name', 'json'], console: ['json'], teams: ['json', 'open'], team: ['name', 'team', 'workspace', 'json'], pipelines: ['open', 'json'], providers: ['json'], invite: ['team'], uninstall: [],
|
|
83
83
|
};
|
|
84
84
|
if (!Object.hasOwn(options, command) || Object.keys(values).some(key => !options[command].includes(key)) || positionals.length > (command === 'models' ? 3 : ['invite', 'updates'].includes(command) ? 2 : 1)) throw Error('Invalid command or options. Run aglit --help.');
|
|
85
|
+
if (values['two-factor'] !== undefined && !['on', 'off'].includes(values['two-factor']))
|
|
86
|
+
throw Error('Choose --two-factor on or off.');
|
|
85
87
|
if (installation.development && !['models','status','init','providers','enable','disable','ui','start'].includes(command)) throw Error('Source profile supports model/setup, access and window commands; installed runtime management is separate');
|
|
86
88
|
if (command === 'updates' && !['on', 'off', 'status'].includes(email)) throw Error('Use aglit updates on|off|status');
|
|
87
89
|
if (values.channel !== undefined && !['latest', 'canary', 'embedded'].includes(values.channel)) throw Error('Update channel must be latest, canary or embedded');
|
|
@@ -285,7 +287,15 @@ async function main() {
|
|
|
285
287
|
ui.finish('Uninstalled'); return;
|
|
286
288
|
} finally { unlock(); }
|
|
287
289
|
}
|
|
288
|
-
|
|
290
|
+
try {
|
|
291
|
+
ui.result(await control(command, command === 'enable' && values['two-factor'] !== undefined
|
|
292
|
+
? { requireTwoFactor: String(values['two-factor'] === 'on') } : {}));
|
|
293
|
+
} catch (error) {
|
|
294
|
+
if (command === 'enable' && values['two-factor'] !== undefined && /Unknown Computer Use command or field/.test(error.message))
|
|
295
|
+
throw Error('This Desktop runtime needs an update to change two-factor settings. Run aglit update, then retry.');
|
|
296
|
+
throw error;
|
|
297
|
+
}
|
|
298
|
+
ui.finish('Done');
|
|
289
299
|
}
|
|
290
300
|
|
|
291
301
|
module.exports = {assertSetupRuntime};
|