ap-client 0.5.2.dev1__tar.gz → 0.5.2.dev2__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 (22) hide show
  1. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/PKG-INFO +1 -1
  2. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/instance_commands.py +41 -18
  3. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/pyproject.toml +1 -1
  4. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/__init__.py +0 -0
  5. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/akpool_commands.py +0 -0
  6. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/api.py +0 -0
  7. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/cli.py +0 -0
  8. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/config.py +0 -0
  9. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/dataset_commands.py +0 -0
  10. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/dataset_register.py +0 -0
  11. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/exporter.py +0 -0
  12. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/fs_commands.py +0 -0
  13. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/instance_options.py +0 -0
  14. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/irepo_sdk.py +0 -0
  15. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/managed_ak.py +0 -0
  16. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/manifest_view.py +0 -0
  17. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/profile_commands.py +0 -0
  18. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/repo_read_guard.py +0 -0
  19. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/share_api.py +0 -0
  20. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/split_publish.py +0 -0
  21. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/tbb.py +0 -0
  22. {ap_client-0.5.2.dev1 → ap_client-0.5.2.dev2}/ap_client/waiter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ap-client
3
- Version: 0.5.2.dev1
3
+ Version: 0.5.2.dev2
4
4
  Summary: Agent Platform API Client & CLI
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: irepo-artifact==0.2.1
@@ -477,7 +477,7 @@ def instance_get(
477
477
  max_pages: int = typer.Option(50, "--max-pages", min=1, help="Maximum directory listing pages"),
478
478
  output_format: str = typer.Option(None, "--format", help=_FORMAT_HELP),
479
479
  ):
480
- """Show instance metadata, or list directory contents with --path."""
480
+ """Show instance metadata and root assets; use --path to browse a directory."""
481
481
  from .irepo_sdk import _reason
482
482
 
483
483
  output_format = _fmt(output_format)
@@ -525,17 +525,20 @@ def instance_get(
525
525
  f"Failed to query instance {instance}: not found",
526
526
  f"Check the instance id: ap instance list --dataset {dataset} --split {split}",
527
527
  )
528
- payload = _instance_record(record)
529
- manifest = payload.get("manifest")
530
- if output_format in ("json", "yaml") or not isinstance(manifest, list):
531
- _emit_detail(payload, output_format)
532
- return
533
- from .manifest_view import manifest_lines
534
-
535
- _emit_detail({key: value for key, value in payload.items() if key != "manifest"}, output_format)
536
- typer.echo()
537
- for line in manifest_lines(manifest):
538
- typer.echo(line)
528
+ _list_instance_objects(
529
+ repo,
530
+ dataset,
531
+ resolved_version,
532
+ instance,
533
+ split,
534
+ "",
535
+ env,
536
+ _metadata_model_for_split(metadata_model, split=split),
537
+ page_size,
538
+ max_pages,
539
+ output_format,
540
+ metadata=_instance_record(record),
541
+ )
539
542
 
540
543
 
541
544
  def _list_instance_objects(
@@ -550,6 +553,8 @@ def _list_instance_objects(
550
553
  page_size: int,
551
554
  max_pages: int,
552
555
  output_format: str,
556
+ *,
557
+ metadata: dict | None = None,
553
558
  ) -> None:
554
559
  from .irepo_sdk import _reason
555
560
 
@@ -585,12 +590,30 @@ def _list_instance_objects(
585
590
  {key: _visible(value) if isinstance(value, str) else value for key, value in row.items()}
586
591
  for row in rows
587
592
  ]
588
- _emit(
589
- payload,
590
- rows,
591
- (("type", "TYPE"), ("name", "NAME"), ("path", "PATH"), ("size_bytes", "BYTES")),
592
- output_format,
593
- )
593
+ if metadata is not None and output_format in ("json", "yaml"):
594
+ _emit_detail(dict(metadata, objects=payload), output_format)
595
+ else:
596
+ if metadata is not None:
597
+ manifest = metadata.get("manifest")
598
+ if isinstance(manifest, list):
599
+ from .manifest_view import manifest_lines
600
+
601
+ _emit_detail(
602
+ {key: value for key, value in metadata.items() if key != "manifest"},
603
+ output_format,
604
+ )
605
+ typer.echo()
606
+ for line in manifest_lines(manifest):
607
+ typer.echo(line)
608
+ else:
609
+ _emit_detail(metadata, output_format)
610
+ typer.echo("\nassets: .")
611
+ _emit(
612
+ payload,
613
+ rows,
614
+ (("type", "TYPE"), ("name", "NAME"), ("path", "PATH"), ("size_bytes", "BYTES")),
615
+ output_format,
616
+ )
594
617
  if payload.get("truncated"):
595
618
  typer.echo(
596
619
  "warning: directory listing is incomplete; increase --max-pages and retry", err=True
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ap-client"
7
- version = "0.5.2.dev1"
7
+ version = "0.5.2.dev2"
8
8
  description = "Agent Platform API Client & CLI"
9
9
  readme = { text = "A lightweight Python SDK and command line interface for Agent Platform. It provides helpers for configuring API access and managing templates, datasets, jobs, and groups.", content-type = "text/markdown" }
10
10
  requires-python = ">=3.10"