ap-client 0.6.1.dev1__tar.gz → 0.6.1.dev3__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.
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/PKG-INFO +1 -1
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/dfs_commands.py +4 -4
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/ossutil_io.py +12 -7
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/pyproject.toml +1 -1
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/__init__.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/akpool_commands.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/api.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/cli.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/config.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/dataset_commands.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/dataset_name.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/dataset_register.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/exporter.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/fs_commands.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/instance_commands.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/instance_options.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/irepo_sdk.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/managed_ak.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/manifest_view.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/ossutil_hash.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/profile_commands.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/repo_read_guard.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/share_api.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/split_publish.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/tbb.py +0 -0
- {ap_client-0.6.1.dev1 → ap_client-0.6.1.dev3}/ap_client/waiter.py +0 -0
|
@@ -359,14 +359,14 @@ def dfs_cat(
|
|
|
359
359
|
Uses AP-managed reader credentials and private networking only, with no public fallback.
|
|
360
360
|
Example: ap dfs cat ans://team/bench/train/T001.json > T001.json.
|
|
361
361
|
"""
|
|
362
|
-
import
|
|
362
|
+
import sys
|
|
363
363
|
|
|
364
364
|
try:
|
|
365
365
|
_validate_options(encoding_type, payer)
|
|
366
366
|
path = _read_operand(path, encoding_type)
|
|
367
367
|
files = _files()
|
|
368
368
|
_configure(files, encoding_type, payer)
|
|
369
|
-
files.cat(files.resolve(path),
|
|
369
|
+
files.cat(files.resolve(path), sys.stdout.buffer)
|
|
370
370
|
except BrokenPipeError:
|
|
371
371
|
import os
|
|
372
372
|
import sys
|
|
@@ -465,12 +465,12 @@ def _transfer(direction: str, src: str, dst: str, ctx: typer.Context) -> None:
|
|
|
465
465
|
typer.echo(f"{_display(path)}: {done}/{total} bytes", err=True)
|
|
466
466
|
|
|
467
467
|
def confirm(path):
|
|
468
|
-
import
|
|
468
|
+
import sys
|
|
469
469
|
|
|
470
470
|
with lock:
|
|
471
471
|
while True:
|
|
472
472
|
typer.echo(f"Overwrite {_display(path)}? [y/N]: ", err=True, nl=False)
|
|
473
|
-
answer =
|
|
473
|
+
answer = sys.stdin.readline()
|
|
474
474
|
if not answer:
|
|
475
475
|
raise OssUsageError(
|
|
476
476
|
"Overwrite confirmation requires input; use --force for batch operations"
|
|
@@ -298,13 +298,13 @@ class OssFiles:
|
|
|
298
298
|
def _dataset_for_scope(self, scope: str) -> str | None:
|
|
299
299
|
"""解析覆盖 ``scope``(完整对象 key)的已注册 dataset 名。
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
301
|
+
凭据请求携带 ``dataset_name``:普通调用方在控制面按它走 dataset RBAC(旧 prod
|
|
302
|
+
构建也要求显式上下文)。ans:// 路径是 dataset 相对的,dataset 名就是最长前缀
|
|
303
|
+
(两段 L1/L2 优先,单段 L1 兜底);由于 ``A``(L1)与 ``A/B`` 可能同时是合法布局,
|
|
304
|
+
这里以**注册表为准**:候选按"最长优先"查注册,第一个命中者胜出;都未注册时退回
|
|
305
|
+
最长候选(系统白名单/平台管理员的 raw 路径与服务端的 list-only 发现都会校验
|
|
306
|
+
claimed 命名空间,写操作仍由服务端拒绝)。结果按相对路径缓存,一次命令内多次
|
|
307
|
+
签发只查一次。
|
|
308
308
|
"""
|
|
309
309
|
prefix = self.binding.prefix
|
|
310
310
|
if not scope.startswith(prefix):
|
|
@@ -352,6 +352,11 @@ class OssFiles:
|
|
|
352
352
|
dataset = self._dataset_for_scope(scope)
|
|
353
353
|
if dataset:
|
|
354
354
|
kwargs["dataset_name"] = dataset
|
|
355
|
+
# 双参数齐发:``dataset_source=oss`` 对系统白名单/平台管理员是跳过 RBAC 的
|
|
356
|
+
# raw 快速路径(ossutil 式,与数据集注册无关);普通调用方在新 apiserver 上会
|
|
357
|
+
# 忽略该参数并回落 dataset RBAC(用上面的 dataset_name),老 prod 构建本就
|
|
358
|
+
# 不认该参数。两者并存才能同时保住"系统身份无注册直读"与"普通用户受控"。
|
|
359
|
+
kwargs["dataset_source"] = "oss"
|
|
355
360
|
cred = dict(
|
|
356
361
|
self.repo.transport.get_oss_credentials(
|
|
357
362
|
self.binding.bucket,
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ap-client"
|
|
7
|
-
version = "0.6.1.
|
|
7
|
+
version = "0.6.1.dev3"
|
|
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"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|