trinity-cli 0.2.2__tar.gz → 0.2.4__tar.gz

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 (26) hide show
  1. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/PKG-INFO +1 -1
  2. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/pyproject.toml +1 -1
  3. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/_notify.py +1 -1
  4. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/auth.py +55 -33
  5. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli.egg-info/PKG-INFO +1 -1
  6. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/README.md +0 -0
  7. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/setup.cfg +0 -0
  8. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/__init__.py +0 -0
  9. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/client.py +0 -0
  10. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/__init__.py +0 -0
  11. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/agents.py +0 -0
  12. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/chat.py +0 -0
  13. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/deploy.py +0 -0
  14. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/health.py +0 -0
  15. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/profiles.py +0 -0
  16. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/schedules.py +0 -0
  17. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/skills.py +0 -0
  18. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/commands/tags.py +0 -0
  19. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/config.py +0 -0
  20. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/main.py +0 -0
  21. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli/output.py +0 -0
  22. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli.egg-info/SOURCES.txt +0 -0
  23. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli.egg-info/dependency_links.txt +0 -0
  24. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli.egg-info/entry_points.txt +0 -0
  25. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli.egg-info/requires.txt +0 -0
  26. {trinity_cli-0.2.2 → trinity_cli-0.2.4}/trinity_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trinity-cli
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: CLI for the Trinity Autonomous Agent Orchestration Platform
5
5
  Author-email: Ability AI <hello@ability.ai>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "trinity-cli"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "CLI for the Trinity Autonomous Agent Orchestration Platform"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -8,7 +8,7 @@ import httpx
8
8
  # Obfuscated API credential — XOR split across two base85-encoded halves.
9
9
  _M = '0g>kenBuVjL4!SP130qQ*=KYIggxnFiM4SMY<kpZ;xz3G'
10
10
  _X = 'bM&}o{<_;(3FJ^SHeH9T>{SCrvQ4lu+J+oL4l%n7gIR)6'
11
- _F = 'noreply@ability.ai'
11
+ _F = 'noreply@abilityai.dev'
12
12
  _T = 'eugene@ability.ai'
13
13
 
14
14
 
@@ -230,14 +230,16 @@ def status(ctx):
230
230
  @click.command()
231
231
  @click.option("--profile", "profile_opt", default=None,
232
232
  help="Profile name (default: derived from instance hostname)")
233
+ @click.option("--admin", is_flag=True, help="Login as admin with password instead of email")
233
234
  @click.pass_context
234
- def init(ctx, profile_opt):
235
+ def init(ctx, profile_opt, admin):
235
236
  """Set up Trinity CLI: configure instance, request access, and log in.
236
237
 
237
238
  One command to go from zero to authenticated. Creates a named profile
238
239
  for the instance (defaults to hostname).
239
240
 
240
241
  If you don't have an instance URL, leave it blank to request access.
242
+ Use --admin to authenticate with admin password instead of email.
241
243
  """
242
244
  url = click.prompt(
243
245
  "Trinity instance URL (leave blank to request access)", default="", show_default=False
@@ -280,48 +282,68 @@ def init(ctx, profile_opt):
280
282
  # Determine profile name
281
283
  profile_name = profile_opt or _get_profile_name(ctx) or profile_name_from_url(url)
282
284
 
283
- email = click.prompt("Email")
284
-
285
- # Request access (auto-approve endpoint)
286
- try:
287
- client.post_unauthenticated("/api/access/request", {"email": email})
288
- click.echo("Access granted")
289
- except TrinityAPIError as e:
290
- if e.status_code == 409:
291
- click.echo("Already registered")
292
- else:
293
- click.echo(f"Access request failed: {e.detail}", err=True)
285
+ if admin:
286
+ # Admin password login
287
+ password = click.prompt("Admin password", hide_input=True)
288
+ try:
289
+ result = client.post_form("/api/token", {
290
+ "username": "admin",
291
+ "password": password,
292
+ })
293
+ except TrinityAPIError as e:
294
+ click.echo(f"Admin login failed: {e.detail}", err=True)
294
295
  raise SystemExit(1)
295
296
 
296
- # Send verification code
297
- try:
298
- client.post_unauthenticated("/api/auth/email/request", {"email": email})
299
- except TrinityAPIError as e:
300
- click.echo(f"Error requesting code: {e.detail}", err=True)
301
- raise SystemExit(1)
297
+ token = result["access_token"]
298
+ authed_client = TrinityClient(base_url=url, token=token)
299
+ try:
300
+ user = authed_client.get("/api/users/me")
301
+ except TrinityAPIError:
302
+ user = {"username": "admin", "role": "admin"}
303
+ else:
304
+ email = click.prompt("Email")
302
305
 
303
- click.echo(f"Verification code sent to {email}")
304
- code = click.prompt("Enter 6-digit code")
306
+ # Request access (auto-approve endpoint)
307
+ try:
308
+ client.post_unauthenticated("/api/access/request", {"email": email})
309
+ click.echo("Access granted")
310
+ except TrinityAPIError as e:
311
+ if e.status_code == 409:
312
+ click.echo("Already registered")
313
+ else:
314
+ click.echo(f"Access request failed: {e.detail}", err=True)
315
+ raise SystemExit(1)
305
316
 
306
- # Verify and get token
307
- try:
308
- result = client.post_unauthenticated("/api/auth/email/verify", {
309
- "email": email,
310
- "code": code,
311
- })
312
- except TrinityAPIError as e:
313
- click.echo(f"Verification failed: {e.detail}", err=True)
314
- raise SystemExit(1)
317
+ # Send verification code
318
+ try:
319
+ client.post_unauthenticated("/api/auth/email/request", {"email": email})
320
+ except TrinityAPIError as e:
321
+ click.echo(f"Error requesting code: {e.detail}", err=True)
322
+ raise SystemExit(1)
315
323
 
316
- token = result["access_token"]
317
- user = result.get("user")
324
+ click.echo(f"Verification code sent to {email}")
325
+ code = click.prompt("Enter 6-digit code")
326
+
327
+ # Verify and get token
328
+ try:
329
+ result = client.post_unauthenticated("/api/auth/email/verify", {
330
+ "email": email,
331
+ "code": code,
332
+ })
333
+ except TrinityAPIError as e:
334
+ click.echo(f"Verification failed: {e.detail}", err=True)
335
+ raise SystemExit(1)
336
+
337
+ token = result["access_token"]
338
+ user = result.get("user")
318
339
 
319
340
  set_auth(url, token, user, profile_name=profile_name)
320
- name = user.get("name") or user.get("email") or user.get("username") if user else email
341
+ name = user.get("name") or user.get("email") or user.get("username") if user else "admin"
321
342
  click.echo(f"Logged in as {name} [profile: {profile_name}]")
322
343
 
323
344
  # Auto-provision MCP API key and write .mcp.json
324
- authed_client = TrinityClient(base_url=url, token=token)
345
+ if not admin:
346
+ authed_client = TrinityClient(base_url=url, token=token)
325
347
  mcp_key = _provision_mcp_key(authed_client, profile_name)
326
348
  if mcp_key:
327
349
  _write_mcp_json(url, mcp_key)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trinity-cli
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: CLI for the Trinity Autonomous Agent Orchestration Platform
5
5
  Author-email: Ability AI <hello@ability.ai>
6
6
  License-Expression: MIT
File without changes
File without changes