envloop-cli 2.2.0__py3-none-any.whl → 2.3.1__py3-none-any.whl

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.
envloop_asset/assets.py CHANGED
@@ -9,9 +9,10 @@ from envloop.http import RemoteError, WaitTimeoutError
9
9
  KINDS = ('dataset', 'checkpoint', 'recipe', 'profile')
10
10
 
11
11
 
12
- def precise_ref(ref: str) -> str:
12
+ def precise_ref(ref: str, *, allow_name: bool = False) -> str:
13
13
  if (not isinstance(ref, str) or not ref or len(ref) > 8192 or any(ord(c) < 32 for c in ref)
14
- or '/' in ref and not ref.startswith('envloop://') and ('@' not in ref or not ref.rpartition('@')[2])):
14
+ or '/' in ref and not ref.startswith('envloop://') and (
15
+ '@' not in ref and not allow_name or '@' in ref and not ref.rpartition('@')[2])):
15
16
  raise ValueError('REF must be an opaque resource ID or a name with an explicit version (NAME@VERSION)')
16
17
  return ref
17
18
 
@@ -89,7 +90,7 @@ class Assets:
89
90
  def get(self, ref: str, *, type: str | None = None) -> dict[str, Any]:
90
91
  if type not in (None, *KINDS):
91
92
  raise ValueError('select a user asset type')
92
- path = scope(self.transport) + '/assets/' + quote(precise_ref(ref), safe='')
93
+ path = scope(self.transport) + '/assets/' + quote(precise_ref(ref, allow_name=type in ('recipe', 'profile')), safe='')
93
94
  value = envelope(self.transport.request('GET', path + ('?' + urlencode({'type': type}) if type else '')))
94
95
  if value['asset'] is None or value['asset'].get('type') not in KINDS or type is not None and value['asset'].get('type') != type:
95
96
  raise RemoteError('INVALID_RESPONSE')
envloop_asset/client.py CHANGED
@@ -252,7 +252,7 @@ class Runners:
252
252
  return self._server.list_runners(limit=limit, cursor=cursor)
253
253
 
254
254
  def get(self, asset_id: str):
255
- """Read a Runner Asset resource by ID or immutable ANS URI."""
255
+ """Read a Runner by ID, fixed URI or registered NAME[@REVISION]; the API resolves latest."""
256
256
  from envloop_asset.execution_content import ExecutionContent
257
257
  resource = ExecutionContent(self._server, 'runner').get(asset_id)
258
258
  if resource.get('type') != 'runner':
@@ -16,6 +16,11 @@ class ExecutionContent(AssetTransfer):
16
16
  path = scope(self.transport) + ('/runners' if self.kind == 'runner' else '/trials/artifacts')
17
17
  return path if asset_id is None else path + '/' + quote(precise_ref(asset_id),safe='')
18
18
 
19
+ @override
20
+ def get(self, asset_id: str) -> dict[str, Any]:
21
+ ref = precise_ref(asset_id, allow_name=self.kind == 'runner')
22
+ return self.transport.request('GET', self._path() + '/' + quote(ref, safe=''))
23
+
19
24
  @override
20
25
  def list(self, *, type: Any = None, **filters: Any) -> dict[str, Any]:
21
26
  if type not in (None,self.kind):
@@ -26,8 +26,11 @@ def add_resource_commands(groups: "argparse._SubParsersAction[argparse.ArgumentP
26
26
  if kind == 'checkpoint':
27
27
  command.add_argument('--job-id')
28
28
  command.add_argument('--trial-id')
29
- command = actions.add_parser('get', help='Read one exact version without downloading files')
30
- command.add_argument('ref', metavar='REF', help=DATASET_REF_HELP if kind == 'dataset' else None)
29
+ command = actions.add_parser('get', help='Read a version without downloading files')
30
+ command.add_argument('ref', metavar='REF', help=(DATASET_REF_HELP if kind == 'dataset' else
31
+ 'NAME, NAME@latest, NAME@VERSION, opaque asset ID or fixed ANS URI; '
32
+ 'omitted version selects the newest accessible publication'
33
+ if kind in ('recipe', 'profile') else None))
31
34
  command.add_argument('--json', action='store_true')
32
35
  for action in ('create','update'):
33
36
  command = actions.add_parser(action, help='Create an immutable version' if action == 'create' else 'Publish a new version from an owned exact source')
@@ -141,7 +144,9 @@ def add_runner_commands(groups: "argparse._SubParsersAction[argparse.ArgumentPar
141
144
  command.add_argument('--ref')
142
145
  for action in ('get','delete'):
143
146
  command = actions.add_parser(action)
144
- command.add_argument('asset_id', metavar='RUNNER_REF')
147
+ command.add_argument('asset_id', metavar='RUNNER_REF',
148
+ help=('Runner ID, fixed ANS URI or NAME[@REVISION]; omitted revision and @latest select the newest accessible publication'
149
+ if action == 'get' else 'Runner ID, fixed ANS URI or NAME@REVISION'))
145
150
  if action == 'delete':
146
151
  command.add_argument('--dry-run', action='store_true')
147
152
  command.add_argument('--json', action='store_true')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: envloop-cli
3
- Version: 2.2.0
3
+ Version: 2.3.1
4
4
  Summary: EnvLoop CLI and Python SDK for jobs, training, checkpoints and inference
5
5
  Project-URL: Homepage, https://envloop.ai
6
6
  Project-URL: Documentation, https://docs.envloop.ai
@@ -10,7 +10,7 @@ Project-URL: Agent instructions, https://docs.envloop.ai/skill.md
10
10
  Requires-Python: >=3.12
11
11
  Provides-Extra: asset
12
12
  Requires-Dist: boto3==1.44.3; extra == 'asset'
13
- Requires-Dist: envloop-envhub==2.2.0; extra == 'asset'
13
+ Requires-Dist: envloop-envhub==2.3.1; extra == 'asset'
14
14
  Provides-Extra: chat
15
15
  Requires-Dist: openai==3.55.1; extra == 'chat'
16
16
  Provides-Extra: default
@@ -224,8 +224,8 @@ el job list --type sandbox
224
224
  el job log JOB_ID --follow
225
225
  ```
226
226
 
227
- The platform resolves `base` to the registered `envloop/base@main` source ref and
228
- freezes its immutable Revision. The Sandbox image defaults to the registered Runner image;
227
+ The platform resolves `base` to the newest accessible successfully published `envloop/base` Revision and
228
+ freezes its immutable identity. The Sandbox image defaults to the registered Runner image;
229
229
  `--image` accepts an image name, tag or digest. Bench and Sandbox submissions can request a
230
230
  platform-enabled provider by name. In a request file, `provider` is a
231
231
  top-level field alongside `spec` and optional `overrides` in an `envloop.job/v2`
@@ -360,7 +360,9 @@ Availability requires matching platform support and approved content in your pro
360
360
 
361
361
  Datasets, Checkpoints, Recipes and Profiles share `list`, `get`, `create`, `update`, `delete`
362
362
  and `set-visibility`. Every list row is an immutable version. A REF is an opaque resource ID,
363
- a fixed ANS URI supported by that type, or `namespace/name@version`; a bare name is rejected.
363
+ a fixed ANS URI supported by that type, or `namespace/name@version`. Recipe/Profile `get` also accepts
364
+ bare names or `@latest`, resolved by the platform to the newest accessible successful publication.
365
+ Dataset/Checkpoint names require explicit versions; mutation sources remain exact.
364
366
  `get/create/update` return `{ "asset": RECORD_OR_NULL, "operation": OPERATION_OR_NULL }`.
365
367
  Records share `asset_id/type/name/version/owner/visibility/acl_revision/status`; type details,
366
368
  files, model identity and provenance stay in `asset.details`.
@@ -384,7 +386,10 @@ el dataset set-visibility example/eval@1.0 --visibility internal --expected-acl-
384
386
 
385
387
  `--file` supplies a complete declaration; `--patch` is Profile update's explicit patch mode.
386
388
  An update creates a new immutable version owned by the current Project and leaves Profile defaults
387
- and submitted Job references unchanged. Profile default changes use `set-default REF --expected-version V`.
389
+ and submitted Job references unchanged. Profile default metadata changes use `set-default REF --expected-version V` and do not affect latest selection.
390
+ Runner/Recipe references in a Profile may omit the version or use `@latest`; Profile publication retains
391
+ those author references. Each new Job freezes the concrete URI, revision, hashes and owner; retries
392
+ with the same request ID retain the first choice.
388
393
  Profile supports private/public; other user content also supports internal. The returned ACL scope
389
394
  states whether sharing affects a name's versions or one saved record. Every visibility write requires
390
395
  an explicit `--expected-acl-revision`.
@@ -19,19 +19,19 @@ envloop/terminal.py,sha256=YcUXw0qfLki0I10Ul3nF73pylq-OJ4SJMPh_FMV0kZE,3698
19
19
  envloop/utils/__init__.py,sha256=huB3qPQuKNr3JxfH3Ys09YWFtHiDamCHFsBa4epANgQ,25
20
20
  envloop/utils/logging.py,sha256=rXN0qyxhfGEq4vWXxjwfaczPPZf_7atnOkkBTgNNRPc,1017
21
21
  envloop_asset/__init__.py,sha256=nKDGmzFNAQv2mq16YijiI3Q-gDL_smNyZD-AQaqoz7Y,68
22
- envloop_asset/assets.py,sha256=12S_SP5GY-4Sf1dyBaFA_gHEUEwu8qq784yORC3YlG8,32127
22
+ envloop_asset/assets.py,sha256=H6hstDNz8SdLLi6RXSrR23uh5rRqku7DQkb9r5ojTgc,32249
23
23
  envloop_asset/checkpoint_download.py,sha256=86pq8IXoJCEP6dVaLtgocp8b8rTyuEccK_ecOQLGiec,4622
24
24
  envloop_asset/checkpoint_upload.py,sha256=BwvLDb862B15MJGjr1lTTu8H6GIyDN5wsVcyoD30WRA,5317
25
25
  envloop_asset/cli.py,sha256=mISKgX1xz6UjSwP_4TQeOm89ugmcKctsZUC9DpWpcIw,3776
26
26
  envloop_asset/cli_output.py,sha256=XKw5LRuQdorldl2ifJr-R1FDRJbSD2vthGz9GhIWw_U,5637
27
- envloop_asset/client.py,sha256=xuUdlMDB5NcBbECVgyMADg3zbDYu4s0S4RLQxgJwqLc,20461
27
+ envloop_asset/client.py,sha256=IzvxmznkDtrDB2qFDsjOGrTNXWJXdNO3zVmKulz3zfg,20491
28
28
  envloop_asset/dataset_upload.py,sha256=G1lwQvqsqD5d-U80hYzCb83dvfPz73Yg4_7JKh3Mrys,19574
29
29
  envloop_asset/direct_artifact.py,sha256=1564EPw64MbGiUfMGRFfqHvyocxwA0gx1V5lhaH-jhM,10774
30
30
  envloop_asset/direct_checkpoint.py,sha256=sL00wpBfax75G5hYzwJimZ4hE2BeRbpOUntzWEoM9Yw,8718
31
31
  envloop_asset/direct_publication.py,sha256=zKBoAWnR6CGzdvsKS5ZZPLWAFDwiC0VFHLp9TxYE2O4,4103
32
32
  envloop_asset/direct_storage.py,sha256=z3dZFlrPUFbLzOWVbN4PS1R_kHYkdJXjvIz0QsJjY70,13207
33
33
  envloop_asset/direct_worker_artifact.py,sha256=LS5SuglxglbrkDxbr8AhLvJ5KFS1IWKAG5bprqKcd1Q,4631
34
- envloop_asset/execution_content.py,sha256=rP_blkZet1ZualA--a7vwZnz1r5jwD87mFtyDN7S3cQ,916
34
+ envloop_asset/execution_content.py,sha256=hqdjOyKpip3l6iJv1DX2oZ8NtDhMKuctNlNiPkJ7TUg,1140
35
35
  envloop_asset/http.py,sha256=v0gLHZFnsjaPnx5Jg3I-ktn-O7rCPu8UnB10zEGhMqg,7965
36
36
  envloop_asset/navigation_resources.py,sha256=puEAFr6biykIZPpqlowZ-BbRkh0miEp2OdTRP_P8ZkY,14167
37
37
  envloop_asset/profile_updates.py,sha256=M0KWqznDY6-MPPfjGNeL4FVTR86_yCRq6OyUJc-tUVY,3387
@@ -40,7 +40,7 @@ envloop_asset/publications.py,sha256=Xn794hX1n7nHwqQJzOzlmFFgIlA9h1XNDRAm5DZiBJM
40
40
  envloop_asset/r2_upload.py,sha256=m-L1Z7L7fQvJNVA9pGzwSGGOTv1_COC5OVSjUIQfxMU,1605
41
41
  envloop_asset/recipe_packages.py,sha256=HA7RT2T6Lt94cl5_4ye3wPxxQd8lCo2_HdAeuq3yQvQ,5957
42
42
  envloop_asset/recipes.py,sha256=We2TZWdRl-ialV-uLFvUSvJng9P2HGquqGtqKYKllgs,1442
43
- envloop_asset/resource_cli.py,sha256=B6re9EjNy90m2RGMv3nYnYrXdMsGohqSOfzVEY_6e6E,20041
43
+ envloop_asset/resource_cli.py,sha256=ivKLF0XWppAixgyCvAS6EVp7CyQms4MGChF-NJ6L6OY,20544
44
44
  envloop_asset/runner_packages.py,sha256=ve4UIUBBxoJ6h7LOSpiP6Tox00nak2v6K95hZ0VqvVM,6639
45
45
  envloop_asset/tags.py,sha256=wFP0Rg-avOmYkpyYqNGdJrnGreHEli-O5_eH9Liat6c,2016
46
46
  envloop_asset/transfer.py,sha256=sXK6kHwI5587OUo3GrFqS7TRpJTR7ytoAxHTIF4OIDk,53233
@@ -49,12 +49,12 @@ envloop_chat/__init__.py,sha256=pEW8SHBlrQr2_9UFm45unSUg-GP6rY04V3O27bspOuQ,75
49
49
  envloop_chat/cli.py,sha256=aUoflpsBWl-U4vrzZP4xsZrvc0md-zuSsCB6APeIk8Q,5783
50
50
  envloop_chat/client.py,sha256=CUCG0jBXJplsXsDNOdu-R-v9O-dVrMMVycNMZUS5b9M,7215
51
51
  envloop_experiment/__init__.py,sha256=nKDGmzFNAQv2mq16YijiI3Q-gDL_smNyZD-AQaqoz7Y,68
52
- envloop_experiment/cli.py,sha256=kWXlcY_cznUB3D1y6OInkZebjBa0fjQ6V9ciWtkOiAY,43336
52
+ envloop_experiment/cli.py,sha256=BDmxdTxiUo8cxOkSa8Hxd61ns_mXIkNn6SbDmn-0HwA,43363
53
53
  envloop_experiment/cli_output.py,sha256=aM6eajuMDheWb2GA956UE0_y-6_tC0MCdC23ulROHi4,5196
54
- envloop_experiment/client.py,sha256=XKoeoIz4OZgbLh55CqvZmnWKEcnk-jMsI6XQ9SQHTC8,41757
54
+ envloop_experiment/client.py,sha256=9V3GRxOc7Fru7dgOUtZsqW-zjwnzb4PQghh5XyVCwsU,41772
55
55
  envloop_experiment/decision.py,sha256=HJTj-jSJJ5kcxQQzFXwrA9IICWXA6zSNBFL9EbbrxqI,918
56
56
  envloop_experiment/http.py,sha256=wQ81Pz_daVRGFDIZQnIgTKRyOWWBgxF8xi4kM9UE6tQ,6970
57
- envloop_experiment/inference.py,sha256=qSObsdo9suHhG5i_xlCh6-lt-NJkhQzAoF9KzCdVWws,5640
57
+ envloop_experiment/inference.py,sha256=GPg1LNPk1-ce1txSJWTkJ0qhNXxhFfP0cBwNt_fyQJ4,5662
58
58
  envloop_experiment/job_cost.py,sha256=gZB69-pdsJM4wManw44AIS9T3ZtsxxQTqrJs-cHjwJU,2214
59
59
  envloop_experiment/job_logs.py,sha256=RLipbj89e5hQdBeXtszsxSYYw7By1hscwSTGFQzQ3Qw,1340
60
60
  envloop_experiment/job_spec_cli.py,sha256=2q-_Txt0xkeBEjeWfoY9tkWhJnf2ZNhueAk9s4ahNYQ,14468
@@ -68,14 +68,14 @@ envloop_experiment/train.py,sha256=qfB9fA2D0vV17GlBuxNsnNhSo1eZRy49855PR-H3ARM,5
68
68
  envloop_experiment/train_log_cli.py,sha256=jCu7c0DGzy0La8tigJVDjuQHROaw6kfclU64QYsRVj0,6622
69
69
  envloop_experiment/train_metrics_cli.py,sha256=AXq5UPf_Xa4RCxAwZNvz8VZKghN1k3dhxbAXXxMmLlY,6522
70
70
  envloop_experiment/train_progress.py,sha256=9YO6CkTc7-LCpUpY8juf6GPF58kCU2rxc4iZjPoRQ58,3508
71
- envloop_experiment/train_runner_cli.py,sha256=N7sSkc4WlNQkMMCU9DoINVm_beyXzLybnjp6fD68sS4,3804
71
+ envloop_experiment/train_runner_cli.py,sha256=XJ-woz80M6ngsArlyP-dVT4CeTeT-O2PXKP5vcSQriE,3811
72
72
  envloop_experiment/training/__init__.py,sha256=IEQWbCHe-zZ2e7JQxOrFOdYlSQxMfOceCZUf_KeszBk,221
73
73
  envloop_rsi_loop/__init__.py,sha256=nKDGmzFNAQv2mq16YijiI3Q-gDL_smNyZD-AQaqoz7Y,68
74
74
  envloop_rsi_loop/cli.py,sha256=egat_Keygh9V1VAYgfEmqBKDmntCWe7ES_SFjhh26Yg,4102
75
75
  envloop_rsi_loop/cli_output.py,sha256=o5XzAkcddBOZ2h_AQ-pUPqJIWUOIMfZPWaPxqm0AtUM,4840
76
76
  envloop_rsi_loop/loop_cli.py,sha256=V_LEyWTsps2G1UNuMiWhrDDRdO0H4Z1bXGuWsYTOo0c,4491
77
77
  envloop_rsi_loop/loops.py,sha256=MGVe3uXxGlnzT_Sc7OHU97kyYA_FSFpXIUtlpXQ8ha0,8924
78
- envloop_cli-2.2.0.dist-info/METADATA,sha256=GUCA421BzfUTdOAe4-JZgMG2Oe8efr_xa_M_YDroQao,21966
79
- envloop_cli-2.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
80
- envloop_cli-2.2.0.dist-info/entry_points.txt,sha256=8aXOpgtVk4GndhChA4XNecShkb1w0xGHBHrKla78ofI,67
81
- envloop_cli-2.2.0.dist-info/RECORD,,
78
+ envloop_cli-2.3.1.dist-info/METADATA,sha256=H1BJYg_dzkWmquE1nRSG3n0niuiHK8U9gOzLyV9P8fU,22479
79
+ envloop_cli-2.3.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
80
+ envloop_cli-2.3.1.dist-info/entry_points.txt,sha256=8aXOpgtVk4GndhChA4XNecShkb1w0xGHBHrKla78ofI,67
81
+ envloop_cli-2.3.1.dist-info/RECORD,,
envloop_experiment/cli.py CHANGED
@@ -67,7 +67,7 @@ def log_page_size(value: str):
67
67
 
68
68
  def runner_arguments(submit: argparse.ArgumentParser):
69
69
  submit.add_argument("--runner", metavar="NAME[@REVISION]",
70
- help="Bench/Train/Inference: namespace/name@REVISION; Sandbox: registered Runner name (for example base)")
70
+ help="Registered Runner NAME or NAME@REVISION; omitted revision and @latest select the newest accessible publication")
71
71
  submit.add_argument("--job-id", help="Bench/Sandbox: caller-selected Job ID")
72
72
  submit.add_argument("--tag", help="Bench/Sandbox: run label")
73
73
  submit.add_argument("--priority", type=int, help="Bench/Sandbox/Train recipe: waiting priority; explicit value overrides spec (server default: 0)")
@@ -148,7 +148,7 @@ def add_commands(groups: "argparse._SubParsersAction[argparse.ArgumentParser]"):
148
148
  job_submit.add_argument("--attempts", type=int)
149
149
  job_submit.add_argument("--request-id", help="idempotency key; overrides request_id in --spec")
150
150
  job_submit.add_argument("--profile", type=profile_reference, metavar="NAME[@VERSION]",
151
- help="named runtime Profile; omitted version prefers default, then newest unarchived creation")
151
+ help="named runtime Profile; omitted version and @latest select the newest accessible unarchived publication")
152
152
  job_submit.add_argument('--input', action='append', default=[], metavar='NAME=URI|NAME=ASSET_ID',
153
153
  help='Bind an ANS input slot of a named Train/Bench/Sandbox Profile; repeatable. '
154
154
  'A Dataset URI alone uses the default config and the train split; a Asset ID (data_…) '
@@ -388,16 +388,16 @@ class Trials:
388
388
 
389
389
 
390
390
  def runner_selector(value: str):
391
- """Require an explicit, portable revision; resolution belongs to the API."""
391
+ """Pass a registered name or portable revision; latest resolution belongs to the API."""
392
392
  if not isinstance(value, str):
393
393
  raise ValueError("runner requires name@revision")
394
394
  name, separator, revision = value.partition("@")
395
- if (not separator or not name or "/" not in name or not revision
395
+ if (not name or "/" not in name or separator and not revision
396
396
  or value != value.strip() or any(char.isspace() for char in value)
397
397
  or revision in {"HEAD", "FETCH_HEAD", "ORIG_HEAD", "MERGE_HEAD", "CHERRY_PICK_HEAD", "REVERT_HEAD"}
398
398
  or revision.startswith("-") or ".." in revision or revision == "@" or "@{" in revision
399
399
  or any(char in revision for char in "~^:{}?*[\\")):
400
- raise ValueError("runner requires name@revision with an explicit commit, tag or branch")
400
+ raise ValueError("runner requires namespace/name with optional latest, commit, tag or branch")
401
401
  return value
402
402
 
403
403
 
@@ -26,8 +26,8 @@ def validate_submission(body: Any):
26
26
  raise ValueError('fixed-input inference cannot mix legacy or runtime fields')
27
27
  runner = spec['runner']
28
28
  if (not isinstance(runner, str)
29
- or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*@[^\s@]+', runner)):
30
- raise ValueError('runner requires namespace/name@revision')
29
+ or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*(?:@[^\s@]+)?', runner)):
30
+ raise ValueError('runner requires namespace/name with an optional revision')
31
31
  if not isinstance(spec.get('name'), str) or not spec['name'].strip():
32
32
  raise ValueError('fixed-input inference requires name')
33
33
  profile = spec.get('profile')
@@ -44,8 +44,8 @@ def runner_request(args: argparse.Namespace):
44
44
  from envloop_experiment.client import runner_selector
45
45
  from envloop_experiment.sandbox import validate_image
46
46
 
47
- if not args.runner or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*@[^\s@]+', args.runner):
48
- raise ValueError('Train Runner requires --runner namespace/name@REVISION')
47
+ if not args.runner or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*(?:@[^\s@]+)?', args.runner):
48
+ raise ValueError('Train Runner requires --runner namespace/name[@REVISION]')
49
49
  runner = runner_selector(args.runner)
50
50
  if args.docker is not None and args.image is not None:
51
51
  raise ValueError('--docker and --image cannot be combined')