apheris-foundry-cli 2.2.0__tar.gz → 2.4.0__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.
- {apheris_foundry_cli-2.2.0/src/apheris_foundry_cli.egg-info → apheris_foundry_cli-2.4.0}/PKG-INFO +64 -2
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/README.md +63 -1
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/pyproject.toml +1 -1
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0/src/apheris_foundry_cli.egg-info}/PKG-INFO +64 -2
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apheris_foundry_cli.egg-info/SOURCES.txt +4 -0
- apheris_foundry_cli-2.4.0/src/apherisfold_cli/commands/docs.py +162 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/foundry.py +67 -1
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/auth.py +1 -29
- apheris_foundry_cli-2.4.0/src/apherisfold_cli/core/browser.py +31 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/hub_requests.py +21 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/main.py +27 -5
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/skills/apheris-foundry-hub/SKILL.md +40 -0
- apheris_foundry_cli-2.4.0/src/apherisfold_cli/version.py +1 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_auth.py +0 -32
- apheris_foundry_cli-2.4.0/tests/test_browser.py +63 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_cli.py +177 -0
- apheris_foundry_cli-2.4.0/tests/test_docs.py +190 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_documents.py +64 -1
- apheris_foundry_cli-2.2.0/src/apherisfold_cli/version.py +0 -1
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/LICENSE +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/setup.cfg +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apheris_foundry_cli.egg-info/dependency_links.txt +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apheris_foundry_cli.egg-info/entry_points.txt +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apheris_foundry_cli.egg-info/requires.txt +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apheris_foundry_cli.egg-info/top_level.txt +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/__init__.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/__init__.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/compounds.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/login.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/settings.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/skills.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/weights.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/__init__.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/config.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/context.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/documents.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/errors.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/input_archive.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/io.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/limits.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/login_profiles.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/msa.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/pubchem.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/render.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/result_artifacts.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/transient.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/handlers.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_auth_lifecycle.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_benchmark_examples.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_config.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_dry_run_guard.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_foundry_helpers.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_foundry_warnings.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_handlers.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_hub_requests.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_input_archive.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_io.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_jobs_metadata.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_jobs_update.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_login_callback.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_main.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_model_discovery.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_msa.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_pubchem.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_render.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_result_artifacts.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_skills.py +0 -0
- {apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/tests/test_weights.py +0 -0
{apheris_foundry_cli-2.2.0/src/apheris_foundry_cli.egg-info → apheris_foundry_cli-2.4.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apheris-foundry-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: Command-line interface for Apheris Foundry workflows.
|
|
5
5
|
Author: Apheris
|
|
6
6
|
License-Expression: LicenseRef-Apheris-Foundry-Software-License
|
|
@@ -351,6 +351,7 @@ the metadata change notification.
|
|
|
351
351
|
| ------- | ----------- |
|
|
352
352
|
| `apheris-foundry jobs list [--workflow <id>]` | List submitted jobs using server-side filters and bounded hydration |
|
|
353
353
|
| `apheris-foundry jobs get --id <job-id>` | Inspect a job and its artifacts |
|
|
354
|
+
| `apheris-foundry jobs get --id <job-id> --web` | Print the job's Hub URL; add `--auto` to open it in the default browser |
|
|
354
355
|
| `apheris-foundry jobs update --id <job-id> [--name <name>] [--tag <tag> ... \| --clear-tags]` | Edit metadata; omitted fields stay unchanged, tags replace all existing tags, and `--name ""` / `--clear-tags` clear fields |
|
|
355
356
|
| `apheris-foundry jobs logs --id <job-id>` | Print logs for a job |
|
|
356
357
|
| `apheris-foundry jobs error --id <job-id>` | Print the saved error for a failed job |
|
|
@@ -367,7 +368,68 @@ apheris-foundry jobs get --help
|
|
|
367
368
|
|
|
368
369
|
`--name` optionally names the run. Omitted or blank names submit an unnamed run.
|
|
369
370
|
|
|
370
|
-
|
|
371
|
+
### Choosing how to pass settings
|
|
372
|
+
|
|
373
|
+
Workflow instructions describe the configuration and its meaning; the CLI maps
|
|
374
|
+
that configuration to submission options:
|
|
375
|
+
|
|
376
|
+
| Configuration | CLI option | Where to find accepted values |
|
|
377
|
+
| --- | --- | --- |
|
|
378
|
+
| Model and weight selection | `--model <id> --weight <version-or-enabled-id>` | `workflows models --workflow <id> --json` |
|
|
379
|
+
| Top-level workflow setting | Repeat `--param name=value` | `workflows get --workflow <id> --json` and the workflow docs |
|
|
380
|
+
| Model-parameter object, when the workflow supports it | `--model-params '<JSON object>'` or `--model-params @file.json` / `@file.yaml` | The selected task's parameter schema and workflow restrictions |
|
|
381
|
+
| Input data or a workflow-specific configuration file | `--input <file-or-folder>` | The workflow's input contract and preparation instructions |
|
|
382
|
+
|
|
383
|
+
Read `workflows docs --workflow <id>` and the workflow skill for supported model
|
|
384
|
+
parameters, restrictions and defaults. Model parameters configure how the model
|
|
385
|
+
runs and which outputs it writes. In model discovery, `modelParamsTask` identifies the entry in
|
|
386
|
+
`schemas.tasks[]` whose `parameters` defines field types, enums and constraints. A task
|
|
387
|
+
schema can include fields controlled by the workflow or unsupported by that
|
|
388
|
+
workflow; it is not a promise that every field works as a model override.
|
|
389
|
+
The same model can support different overrides in different workflows.
|
|
390
|
+
|
|
391
|
+
`--model-params` accepts an inline JSON object or a JSON/YAML parameter file.
|
|
392
|
+
Use an inline object for short overrides, or prefix a `.json`, `.yaml` or `.yml`
|
|
393
|
+
filename with `@` to load the object from that file. The CLI retrieves the
|
|
394
|
+
selected model and validates the object against its parameter schema before
|
|
395
|
+
submission. Hub validates declared task-parameter objects before staging a run;
|
|
396
|
+
the workflow also enforces its implementation restrictions. Keep exact field
|
|
397
|
+
names and JSON types, such as `true` rather than `"true"`, and pass only intended
|
|
398
|
+
overrides. Task-schema defaults can differ from workflow defaults, so do not
|
|
399
|
+
copy every schema default into the object.
|
|
400
|
+
|
|
401
|
+
Model task schemas retain their required fields. Hub's `modelParamsSuppliedFields`
|
|
402
|
+
identifies the fields supplied by the workflow; only those may be omitted despite
|
|
403
|
+
being required by the task. Structural fine-tuning requires a positive integer
|
|
404
|
+
`max_steps` inside `--model-params`, for example `'{"max_steps":5000}'`.
|
|
405
|
+
There is no implicit 1,000-step workflow default or unlimited sentinel. Hub also
|
|
406
|
+
checks required fields when the whole model parameter object is omitted.
|
|
407
|
+
|
|
408
|
+
For example, benchmark's batch size is a workflow setting, while its seed and
|
|
409
|
+
detailed-score preference are model parameters:
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
apheris-foundry workflows run --workflow benchmark --input prepared-benchmark/ \
|
|
413
|
+
--model openfold3 \
|
|
414
|
+
--param batchSize=5 \
|
|
415
|
+
--model-params '{"seeds":[42],"write_detailed_scores":true}'
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Structural fine-tuning uses the same model-parameter option for its training
|
|
419
|
+
task. Dataset preparation is a separate task configured through `datasetParams`:
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
apheris-foundry workflows run --workflow structural-finetune --input prepared-training/ \
|
|
423
|
+
--model-params '{"max_steps":5000,"learning_rate":0.001}' \
|
|
424
|
+
--param 'datasetParams={"validation_failures":"ignore"}'
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
Check that the deployed workflow supports these fields before submission.
|
|
428
|
+
The detailed-score preference belongs only in the model-parameter object.
|
|
429
|
+
Do not flatten a model field into `--param write_detailed_scores=false`, pass raw
|
|
430
|
+
`--param modelParams=...`, or translate an uploaded config file's keys into
|
|
431
|
+
flags. Use the route the selected workflow documents; `--help` describes the
|
|
432
|
+
installed CLI syntax.
|
|
371
433
|
|
|
372
434
|
### YAML model parameters
|
|
373
435
|
|
|
@@ -325,6 +325,7 @@ the metadata change notification.
|
|
|
325
325
|
| ------- | ----------- |
|
|
326
326
|
| `apheris-foundry jobs list [--workflow <id>]` | List submitted jobs using server-side filters and bounded hydration |
|
|
327
327
|
| `apheris-foundry jobs get --id <job-id>` | Inspect a job and its artifacts |
|
|
328
|
+
| `apheris-foundry jobs get --id <job-id> --web` | Print the job's Hub URL; add `--auto` to open it in the default browser |
|
|
328
329
|
| `apheris-foundry jobs update --id <job-id> [--name <name>] [--tag <tag> ... \| --clear-tags]` | Edit metadata; omitted fields stay unchanged, tags replace all existing tags, and `--name ""` / `--clear-tags` clear fields |
|
|
329
330
|
| `apheris-foundry jobs logs --id <job-id>` | Print logs for a job |
|
|
330
331
|
| `apheris-foundry jobs error --id <job-id>` | Print the saved error for a failed job |
|
|
@@ -341,7 +342,68 @@ apheris-foundry jobs get --help
|
|
|
341
342
|
|
|
342
343
|
`--name` optionally names the run. Omitted or blank names submit an unnamed run.
|
|
343
344
|
|
|
344
|
-
|
|
345
|
+
### Choosing how to pass settings
|
|
346
|
+
|
|
347
|
+
Workflow instructions describe the configuration and its meaning; the CLI maps
|
|
348
|
+
that configuration to submission options:
|
|
349
|
+
|
|
350
|
+
| Configuration | CLI option | Where to find accepted values |
|
|
351
|
+
| --- | --- | --- |
|
|
352
|
+
| Model and weight selection | `--model <id> --weight <version-or-enabled-id>` | `workflows models --workflow <id> --json` |
|
|
353
|
+
| Top-level workflow setting | Repeat `--param name=value` | `workflows get --workflow <id> --json` and the workflow docs |
|
|
354
|
+
| Model-parameter object, when the workflow supports it | `--model-params '<JSON object>'` or `--model-params @file.json` / `@file.yaml` | The selected task's parameter schema and workflow restrictions |
|
|
355
|
+
| Input data or a workflow-specific configuration file | `--input <file-or-folder>` | The workflow's input contract and preparation instructions |
|
|
356
|
+
|
|
357
|
+
Read `workflows docs --workflow <id>` and the workflow skill for supported model
|
|
358
|
+
parameters, restrictions and defaults. Model parameters configure how the model
|
|
359
|
+
runs and which outputs it writes. In model discovery, `modelParamsTask` identifies the entry in
|
|
360
|
+
`schemas.tasks[]` whose `parameters` defines field types, enums and constraints. A task
|
|
361
|
+
schema can include fields controlled by the workflow or unsupported by that
|
|
362
|
+
workflow; it is not a promise that every field works as a model override.
|
|
363
|
+
The same model can support different overrides in different workflows.
|
|
364
|
+
|
|
365
|
+
`--model-params` accepts an inline JSON object or a JSON/YAML parameter file.
|
|
366
|
+
Use an inline object for short overrides, or prefix a `.json`, `.yaml` or `.yml`
|
|
367
|
+
filename with `@` to load the object from that file. The CLI retrieves the
|
|
368
|
+
selected model and validates the object against its parameter schema before
|
|
369
|
+
submission. Hub validates declared task-parameter objects before staging a run;
|
|
370
|
+
the workflow also enforces its implementation restrictions. Keep exact field
|
|
371
|
+
names and JSON types, such as `true` rather than `"true"`, and pass only intended
|
|
372
|
+
overrides. Task-schema defaults can differ from workflow defaults, so do not
|
|
373
|
+
copy every schema default into the object.
|
|
374
|
+
|
|
375
|
+
Model task schemas retain their required fields. Hub's `modelParamsSuppliedFields`
|
|
376
|
+
identifies the fields supplied by the workflow; only those may be omitted despite
|
|
377
|
+
being required by the task. Structural fine-tuning requires a positive integer
|
|
378
|
+
`max_steps` inside `--model-params`, for example `'{"max_steps":5000}'`.
|
|
379
|
+
There is no implicit 1,000-step workflow default or unlimited sentinel. Hub also
|
|
380
|
+
checks required fields when the whole model parameter object is omitted.
|
|
381
|
+
|
|
382
|
+
For example, benchmark's batch size is a workflow setting, while its seed and
|
|
383
|
+
detailed-score preference are model parameters:
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
apheris-foundry workflows run --workflow benchmark --input prepared-benchmark/ \
|
|
387
|
+
--model openfold3 \
|
|
388
|
+
--param batchSize=5 \
|
|
389
|
+
--model-params '{"seeds":[42],"write_detailed_scores":true}'
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Structural fine-tuning uses the same model-parameter option for its training
|
|
393
|
+
task. Dataset preparation is a separate task configured through `datasetParams`:
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
apheris-foundry workflows run --workflow structural-finetune --input prepared-training/ \
|
|
397
|
+
--model-params '{"max_steps":5000,"learning_rate":0.001}' \
|
|
398
|
+
--param 'datasetParams={"validation_failures":"ignore"}'
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Check that the deployed workflow supports these fields before submission.
|
|
402
|
+
The detailed-score preference belongs only in the model-parameter object.
|
|
403
|
+
Do not flatten a model field into `--param write_detailed_scores=false`, pass raw
|
|
404
|
+
`--param modelParams=...`, or translate an uploaded config file's keys into
|
|
405
|
+
flags. Use the route the selected workflow documents; `--help` describes the
|
|
406
|
+
installed CLI syntax.
|
|
345
407
|
|
|
346
408
|
### YAML model parameters
|
|
347
409
|
|
{apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0/src/apheris_foundry_cli.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apheris-foundry-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: Command-line interface for Apheris Foundry workflows.
|
|
5
5
|
Author: Apheris
|
|
6
6
|
License-Expression: LicenseRef-Apheris-Foundry-Software-License
|
|
@@ -351,6 +351,7 @@ the metadata change notification.
|
|
|
351
351
|
| ------- | ----------- |
|
|
352
352
|
| `apheris-foundry jobs list [--workflow <id>]` | List submitted jobs using server-side filters and bounded hydration |
|
|
353
353
|
| `apheris-foundry jobs get --id <job-id>` | Inspect a job and its artifacts |
|
|
354
|
+
| `apheris-foundry jobs get --id <job-id> --web` | Print the job's Hub URL; add `--auto` to open it in the default browser |
|
|
354
355
|
| `apheris-foundry jobs update --id <job-id> [--name <name>] [--tag <tag> ... \| --clear-tags]` | Edit metadata; omitted fields stay unchanged, tags replace all existing tags, and `--name ""` / `--clear-tags` clear fields |
|
|
355
356
|
| `apheris-foundry jobs logs --id <job-id>` | Print logs for a job |
|
|
356
357
|
| `apheris-foundry jobs error --id <job-id>` | Print the saved error for a failed job |
|
|
@@ -367,7 +368,68 @@ apheris-foundry jobs get --help
|
|
|
367
368
|
|
|
368
369
|
`--name` optionally names the run. Omitted or blank names submit an unnamed run.
|
|
369
370
|
|
|
370
|
-
|
|
371
|
+
### Choosing how to pass settings
|
|
372
|
+
|
|
373
|
+
Workflow instructions describe the configuration and its meaning; the CLI maps
|
|
374
|
+
that configuration to submission options:
|
|
375
|
+
|
|
376
|
+
| Configuration | CLI option | Where to find accepted values |
|
|
377
|
+
| --- | --- | --- |
|
|
378
|
+
| Model and weight selection | `--model <id> --weight <version-or-enabled-id>` | `workflows models --workflow <id> --json` |
|
|
379
|
+
| Top-level workflow setting | Repeat `--param name=value` | `workflows get --workflow <id> --json` and the workflow docs |
|
|
380
|
+
| Model-parameter object, when the workflow supports it | `--model-params '<JSON object>'` or `--model-params @file.json` / `@file.yaml` | The selected task's parameter schema and workflow restrictions |
|
|
381
|
+
| Input data or a workflow-specific configuration file | `--input <file-or-folder>` | The workflow's input contract and preparation instructions |
|
|
382
|
+
|
|
383
|
+
Read `workflows docs --workflow <id>` and the workflow skill for supported model
|
|
384
|
+
parameters, restrictions and defaults. Model parameters configure how the model
|
|
385
|
+
runs and which outputs it writes. In model discovery, `modelParamsTask` identifies the entry in
|
|
386
|
+
`schemas.tasks[]` whose `parameters` defines field types, enums and constraints. A task
|
|
387
|
+
schema can include fields controlled by the workflow or unsupported by that
|
|
388
|
+
workflow; it is not a promise that every field works as a model override.
|
|
389
|
+
The same model can support different overrides in different workflows.
|
|
390
|
+
|
|
391
|
+
`--model-params` accepts an inline JSON object or a JSON/YAML parameter file.
|
|
392
|
+
Use an inline object for short overrides, or prefix a `.json`, `.yaml` or `.yml`
|
|
393
|
+
filename with `@` to load the object from that file. The CLI retrieves the
|
|
394
|
+
selected model and validates the object against its parameter schema before
|
|
395
|
+
submission. Hub validates declared task-parameter objects before staging a run;
|
|
396
|
+
the workflow also enforces its implementation restrictions. Keep exact field
|
|
397
|
+
names and JSON types, such as `true` rather than `"true"`, and pass only intended
|
|
398
|
+
overrides. Task-schema defaults can differ from workflow defaults, so do not
|
|
399
|
+
copy every schema default into the object.
|
|
400
|
+
|
|
401
|
+
Model task schemas retain their required fields. Hub's `modelParamsSuppliedFields`
|
|
402
|
+
identifies the fields supplied by the workflow; only those may be omitted despite
|
|
403
|
+
being required by the task. Structural fine-tuning requires a positive integer
|
|
404
|
+
`max_steps` inside `--model-params`, for example `'{"max_steps":5000}'`.
|
|
405
|
+
There is no implicit 1,000-step workflow default or unlimited sentinel. Hub also
|
|
406
|
+
checks required fields when the whole model parameter object is omitted.
|
|
407
|
+
|
|
408
|
+
For example, benchmark's batch size is a workflow setting, while its seed and
|
|
409
|
+
detailed-score preference are model parameters:
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
apheris-foundry workflows run --workflow benchmark --input prepared-benchmark/ \
|
|
413
|
+
--model openfold3 \
|
|
414
|
+
--param batchSize=5 \
|
|
415
|
+
--model-params '{"seeds":[42],"write_detailed_scores":true}'
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Structural fine-tuning uses the same model-parameter option for its training
|
|
419
|
+
task. Dataset preparation is a separate task configured through `datasetParams`:
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
apheris-foundry workflows run --workflow structural-finetune --input prepared-training/ \
|
|
423
|
+
--model-params '{"max_steps":5000,"learning_rate":0.001}' \
|
|
424
|
+
--param 'datasetParams={"validation_failures":"ignore"}'
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
Check that the deployed workflow supports these fields before submission.
|
|
428
|
+
The detailed-score preference belongs only in the model-parameter object.
|
|
429
|
+
Do not flatten a model field into `--param write_detailed_scores=false`, pass raw
|
|
430
|
+
`--param modelParams=...`, or translate an uploaded config file's keys into
|
|
431
|
+
flags. Use the route the selected workflow documents; `--help` describes the
|
|
432
|
+
installed CLI syntax.
|
|
371
433
|
|
|
372
434
|
### YAML model parameters
|
|
373
435
|
|
{apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apheris_foundry_cli.egg-info/SOURCES.txt
RENAMED
|
@@ -13,6 +13,7 @@ src/apherisfold_cli/main.py
|
|
|
13
13
|
src/apherisfold_cli/version.py
|
|
14
14
|
src/apherisfold_cli/commands/__init__.py
|
|
15
15
|
src/apherisfold_cli/commands/compounds.py
|
|
16
|
+
src/apherisfold_cli/commands/docs.py
|
|
16
17
|
src/apherisfold_cli/commands/foundry.py
|
|
17
18
|
src/apherisfold_cli/commands/login.py
|
|
18
19
|
src/apherisfold_cli/commands/settings.py
|
|
@@ -20,6 +21,7 @@ src/apherisfold_cli/commands/skills.py
|
|
|
20
21
|
src/apherisfold_cli/commands/weights.py
|
|
21
22
|
src/apherisfold_cli/core/__init__.py
|
|
22
23
|
src/apherisfold_cli/core/auth.py
|
|
24
|
+
src/apherisfold_cli/core/browser.py
|
|
23
25
|
src/apherisfold_cli/core/config.py
|
|
24
26
|
src/apherisfold_cli/core/context.py
|
|
25
27
|
src/apherisfold_cli/core/documents.py
|
|
@@ -38,8 +40,10 @@ src/apherisfold_cli/skills/apheris-foundry-hub/SKILL.md
|
|
|
38
40
|
tests/test_auth.py
|
|
39
41
|
tests/test_auth_lifecycle.py
|
|
40
42
|
tests/test_benchmark_examples.py
|
|
43
|
+
tests/test_browser.py
|
|
41
44
|
tests/test_cli.py
|
|
42
45
|
tests/test_config.py
|
|
46
|
+
tests/test_docs.py
|
|
43
47
|
tests/test_documents.py
|
|
44
48
|
tests/test_dry_run_guard.py
|
|
45
49
|
tests/test_foundry_helpers.py
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"""Read the selected Hub's private documentation using its navigation."""
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import re
|
|
5
|
+
from typing import Annotated, Any
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
from rich import box
|
|
9
|
+
from rich.console import Group
|
|
10
|
+
from rich.markdown import Markdown
|
|
11
|
+
from rich.table import Table
|
|
12
|
+
from rich.text import Text
|
|
13
|
+
|
|
14
|
+
from apherisfold_cli.core.errors import EXIT_INPUT_DATA, EXIT_USAGE, CLIError
|
|
15
|
+
from apherisfold_cli.core.hub_requests import get_hub_document, get_hub_documentation_index
|
|
16
|
+
from apherisfold_cli.handlers import run_simple_listing
|
|
17
|
+
|
|
18
|
+
app = typer.Typer(no_args_is_help=True, help="Read private release notes, known issues and guides from your Hub.")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _invalid() -> CLIError:
|
|
22
|
+
return CLIError(
|
|
23
|
+
code=EXIT_INPUT_DATA, category="input-data", message="Hub returned invalid documentation.", task="docs"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _pages(entries: Any, depth: int = 0, sections: tuple[str, ...] = ()) -> list[dict[str, Any]]:
|
|
28
|
+
if not isinstance(entries, list) or not entries or depth > 20:
|
|
29
|
+
raise _invalid()
|
|
30
|
+
pages = []
|
|
31
|
+
for entry in entries:
|
|
32
|
+
if not isinstance(entry, dict) or not isinstance(entry.get("title"), str):
|
|
33
|
+
raise _invalid()
|
|
34
|
+
path = entry.get("path")
|
|
35
|
+
if path is not None:
|
|
36
|
+
if (
|
|
37
|
+
not isinstance(path, str)
|
|
38
|
+
or not path.endswith(".md")
|
|
39
|
+
or any(part in {"", ".", ".."} for part in path.split("/"))
|
|
40
|
+
or any(char in path for char in "\\?#:%")
|
|
41
|
+
):
|
|
42
|
+
raise _invalid()
|
|
43
|
+
pages.append(
|
|
44
|
+
{"title": entry["title"], "path": path, "sections": sections, "draft": entry.get("draft") is True}
|
|
45
|
+
)
|
|
46
|
+
else:
|
|
47
|
+
pages.extend(_pages(entry.get("children"), depth + 1, (*sections, entry["title"])))
|
|
48
|
+
return pages
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _index() -> tuple[dict[str, Any], list[dict[str, Any]]]:
|
|
52
|
+
payload = get_hub_documentation_index()
|
|
53
|
+
if not isinstance(payload.get("hubVersion"), str):
|
|
54
|
+
raise _invalid()
|
|
55
|
+
return payload, _pages(payload.get("navigation"))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _release_sections(entries: list[Any], sections: tuple[str, ...] = ()) -> list[tuple[str, ...]]:
|
|
59
|
+
"""Match the Hub UI: a release is a section whose pages all live under releases/."""
|
|
60
|
+
releases = []
|
|
61
|
+
for entry in entries:
|
|
62
|
+
children = entry.get("children") or []
|
|
63
|
+
if children and all(str(child.get("path") or "").startswith("releases/") for child in children):
|
|
64
|
+
releases.append((*sections, entry["title"]))
|
|
65
|
+
elif children:
|
|
66
|
+
releases.extend(_release_sections(children, (*sections, entry["title"])))
|
|
67
|
+
return releases
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _matches_release(sections: tuple[str, ...], release: str) -> bool:
|
|
71
|
+
return bool(sections) and (sections[-1] == release or sections[-1].endswith(f" {release}"))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _module_version(version: str) -> str:
|
|
75
|
+
"""A Go pseudo-version names an untagged commit; show that commit instead."""
|
|
76
|
+
match = re.fullmatch(r"v\d+\.\d+\.\d+-(?:.+\.)?\d{14}-([0-9a-f]{12})", version)
|
|
77
|
+
return f"commit {match.group(1)[:7]}" if match else version
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@app.command("list", help="List the private documents available on the selected Hub.")
|
|
81
|
+
def list_docs(
|
|
82
|
+
release: Annotated[
|
|
83
|
+
str | None,
|
|
84
|
+
typer.Option("--release", help="Show only the documents of one release, for example 1.0.0."),
|
|
85
|
+
] = None,
|
|
86
|
+
json_output: Annotated[bool, typer.Option("--json", help="Return the original navigation as JSON.")] = False,
|
|
87
|
+
) -> None:
|
|
88
|
+
payload, pages = _index()
|
|
89
|
+
releases = _release_sections(payload["navigation"])
|
|
90
|
+
if release is not None:
|
|
91
|
+
pages = [page for page in pages if page["sections"] in releases and _matches_release(page["sections"], release)]
|
|
92
|
+
if not pages:
|
|
93
|
+
available = ", ".join(sections[-1] for sections in releases) or "none"
|
|
94
|
+
raise CLIError(
|
|
95
|
+
code=EXIT_USAGE,
|
|
96
|
+
category="usage",
|
|
97
|
+
message=f"This Hub has no release {release!r}. Available releases: {available}.",
|
|
98
|
+
task="docs.list",
|
|
99
|
+
)
|
|
100
|
+
if json_output:
|
|
101
|
+
run_simple_listing(payload=payload)
|
|
102
|
+
return
|
|
103
|
+
caption = f"Hub {payload['hubVersion']}"
|
|
104
|
+
if isinstance(payload.get("toolkitVersion"), str) and payload["toolkitVersion"]:
|
|
105
|
+
caption += f" · foundry-toolkit {_module_version(payload['toolkitVersion'])}"
|
|
106
|
+
table = Table(box=box.SIMPLE_HEAD, caption=caption, caption_justify="left")
|
|
107
|
+
table.add_column("Section")
|
|
108
|
+
table.add_column("Document")
|
|
109
|
+
# Paths are copied into 'docs show', so narrow terminals wrap the other columns.
|
|
110
|
+
table.add_column("Path", no_wrap=True, min_width=max((len(page["path"]) for page in pages), default=4))
|
|
111
|
+
latest = releases[0] if releases else None
|
|
112
|
+
for page in pages:
|
|
113
|
+
section = " › ".join(page["sections"])
|
|
114
|
+
if page["sections"] and page["sections"] == latest:
|
|
115
|
+
section += " (latest)"
|
|
116
|
+
title = Text(page["title"])
|
|
117
|
+
if page["draft"]:
|
|
118
|
+
title.append(" Draft", style="yellow")
|
|
119
|
+
table.add_row(Text(section), title, Text(page["path"]))
|
|
120
|
+
run_simple_listing(payload=payload, renderable_output=table)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@app.command("show", help="Read a document path from 'docs list'. Use --raw to export its original Markdown.")
|
|
124
|
+
def show_doc(
|
|
125
|
+
path: Annotated[str, typer.Argument(help="Document path from docs list.")],
|
|
126
|
+
json_output: Annotated[
|
|
127
|
+
bool, typer.Option("--json", help="Return source Markdown, version and digest as JSON.")
|
|
128
|
+
] = False,
|
|
129
|
+
raw: Annotated[
|
|
130
|
+
bool, typer.Option("--raw", help="Write exact source Markdown to stdout for offline reading.")
|
|
131
|
+
] = False,
|
|
132
|
+
) -> None:
|
|
133
|
+
if raw and json_output:
|
|
134
|
+
raise typer.BadParameter("Use either --raw or --json.")
|
|
135
|
+
_, pages = _index()
|
|
136
|
+
if path not in {page["path"] for page in pages}:
|
|
137
|
+
raise CLIError(
|
|
138
|
+
code=EXIT_USAGE,
|
|
139
|
+
category="usage",
|
|
140
|
+
message="Document is not listed by this Hub. Run 'apheris-foundry docs list'.",
|
|
141
|
+
task="docs.show",
|
|
142
|
+
)
|
|
143
|
+
payload = get_hub_document(path)
|
|
144
|
+
content = payload.get("content")
|
|
145
|
+
if (
|
|
146
|
+
payload.get("path") != path
|
|
147
|
+
or not isinstance(content, str)
|
|
148
|
+
or not content.strip()
|
|
149
|
+
or payload.get("sha256") != hashlib.sha256(content.encode("utf-8")).hexdigest()
|
|
150
|
+
or any(not isinstance(payload.get(key), str) for key in ("hubVersion", "type", "title"))
|
|
151
|
+
):
|
|
152
|
+
raise _invalid()
|
|
153
|
+
if raw:
|
|
154
|
+
typer.echo(content, nl=False)
|
|
155
|
+
elif json_output:
|
|
156
|
+
run_simple_listing(payload=payload)
|
|
157
|
+
else:
|
|
158
|
+
body = re.sub(r"\A---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\Z)", "", content, count=1)
|
|
159
|
+
renderable: Any = Markdown(body)
|
|
160
|
+
if payload.get("draft") is True:
|
|
161
|
+
renderable = Group(Text("Draft: unreviewed, may change before release.", style="yellow"), renderable)
|
|
162
|
+
run_simple_listing(payload=payload, renderable_output=renderable)
|
{apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/commands/foundry.py
RENAMED
|
@@ -9,6 +9,7 @@ from collections.abc import Iterable
|
|
|
9
9
|
from io import BytesIO
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
from typing import Any
|
|
12
|
+
from urllib.parse import quote, urlsplit
|
|
12
13
|
|
|
13
14
|
import typer
|
|
14
15
|
from rich import box
|
|
@@ -18,6 +19,8 @@ from rich.table import Table
|
|
|
18
19
|
from rich.text import Text
|
|
19
20
|
from rich.tree import Tree
|
|
20
21
|
|
|
22
|
+
from apherisfold_cli.core.auth import load_runtime_config
|
|
23
|
+
from apherisfold_cli.core.browser import open_browser
|
|
21
24
|
from apherisfold_cli.core.errors import EXIT_INPUT_DATA, EXIT_INTERNAL, EXIT_PRECONDITION, EXIT_USAGE, CLIError
|
|
22
25
|
from apherisfold_cli.core.hub_requests import (
|
|
23
26
|
cancel_foundry_run,
|
|
@@ -1059,7 +1062,70 @@ def foundry_workflow_graph(workflow: str, *, json_output: bool, html_output: Pat
|
|
|
1059
1062
|
)
|
|
1060
1063
|
|
|
1061
1064
|
|
|
1062
|
-
def
|
|
1065
|
+
def _show_job_url(run_id: str, *, auto_open_browser: bool) -> None:
|
|
1066
|
+
if not run_id.strip() or run_id in {".", ".."}:
|
|
1067
|
+
raise CLIError(code=EXIT_USAGE, category="usage", message="--id must be a job identifier.", task="foundry.get")
|
|
1068
|
+
|
|
1069
|
+
config = load_runtime_config()
|
|
1070
|
+
if config is None:
|
|
1071
|
+
raise CLIError(
|
|
1072
|
+
code=EXIT_PRECONDITION,
|
|
1073
|
+
category="precondition",
|
|
1074
|
+
message="No Hub runtime configuration found. Run 'apheris-foundry login' first.",
|
|
1075
|
+
task="foundry.get",
|
|
1076
|
+
)
|
|
1077
|
+
hub_url = config.hub_url.rstrip("/")
|
|
1078
|
+
try:
|
|
1079
|
+
parsed = urlsplit(hub_url)
|
|
1080
|
+
valid_url = (
|
|
1081
|
+
parsed.scheme in {"http", "https"}
|
|
1082
|
+
and bool(parsed.hostname)
|
|
1083
|
+
and parsed.port != 0
|
|
1084
|
+
and parsed.username is None
|
|
1085
|
+
and parsed.password is None
|
|
1086
|
+
and "?" not in hub_url
|
|
1087
|
+
and "#" not in hub_url
|
|
1088
|
+
and not re.search(r"[\\\x00-\x20\x7f]", hub_url)
|
|
1089
|
+
)
|
|
1090
|
+
except ValueError:
|
|
1091
|
+
valid_url = False
|
|
1092
|
+
if not valid_url:
|
|
1093
|
+
raise CLIError(
|
|
1094
|
+
code=EXIT_PRECONDITION,
|
|
1095
|
+
category="precondition",
|
|
1096
|
+
message="Invalid Hub URL. Run 'apheris-foundry login' with an HTTP(S) Hub URL without credentials, query, or fragment.",
|
|
1097
|
+
task="foundry.get",
|
|
1098
|
+
)
|
|
1099
|
+
|
|
1100
|
+
url = f"{hub_url}/jobs/{quote(run_id, safe='')}"
|
|
1101
|
+
if not auto_open_browser:
|
|
1102
|
+
typer.echo(url)
|
|
1103
|
+
return
|
|
1104
|
+
if not open_browser(url):
|
|
1105
|
+
raise CLIError(
|
|
1106
|
+
code=EXIT_PRECONDITION,
|
|
1107
|
+
category="precondition",
|
|
1108
|
+
message=f"Could not open the default browser. Open this URL manually: {url}",
|
|
1109
|
+
task="foundry.get",
|
|
1110
|
+
)
|
|
1111
|
+
typer.echo(f"Opening {url}")
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
def foundry_get(
|
|
1115
|
+
run_id: str, *, artifact_id: str | None, json_output: bool, web: bool = False, auto_open_browser: bool = False
|
|
1116
|
+
) -> None:
|
|
1117
|
+
if auto_open_browser and not web:
|
|
1118
|
+
raise CLIError(code=EXIT_USAGE, category="usage", message="--auto requires --web.", task="foundry.get")
|
|
1119
|
+
if web:
|
|
1120
|
+
if json_output or artifact_id is not None:
|
|
1121
|
+
raise CLIError(
|
|
1122
|
+
code=EXIT_USAGE,
|
|
1123
|
+
category="usage",
|
|
1124
|
+
message="--web cannot be combined with --json or --artifact-id.",
|
|
1125
|
+
task="foundry.get",
|
|
1126
|
+
)
|
|
1127
|
+
_show_job_url(run_id, auto_open_browser=auto_open_browser)
|
|
1128
|
+
return
|
|
1063
1129
|
run = get_foundry_run(run_id)
|
|
1064
1130
|
if artifact_id:
|
|
1065
1131
|
artifact = _resolve_artifact(run, artifact_id)
|
|
@@ -8,22 +8,20 @@ import json
|
|
|
8
8
|
import os
|
|
9
9
|
import queue
|
|
10
10
|
import secrets
|
|
11
|
-
import shutil
|
|
12
11
|
import ssl
|
|
13
|
-
import subprocess
|
|
14
12
|
import sys
|
|
15
13
|
import threading
|
|
16
14
|
import time
|
|
17
15
|
import urllib.error
|
|
18
16
|
import urllib.parse
|
|
19
17
|
import urllib.request
|
|
20
|
-
import webbrowser
|
|
21
18
|
from dataclasses import asdict, dataclass
|
|
22
19
|
from http.client import IncompleteRead
|
|
23
20
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
24
21
|
from pathlib import Path
|
|
25
22
|
from typing import Any, cast
|
|
26
23
|
|
|
24
|
+
from .browser import open_browser as _browser_open
|
|
27
25
|
from .errors import (
|
|
28
26
|
EXIT_INPUT_DATA,
|
|
29
27
|
EXIT_INTERNAL,
|
|
@@ -1050,32 +1048,6 @@ def _pkce_code_challenge(code_verifier: str) -> str:
|
|
|
1050
1048
|
return base64.urlsafe_b64encode(digest).decode("utf-8").rstrip("=")
|
|
1051
1049
|
|
|
1052
1050
|
|
|
1053
|
-
def _browser_open(url: str) -> bool:
|
|
1054
|
-
browser_commands = (
|
|
1055
|
-
["xdg-open", url],
|
|
1056
|
-
["gio", "open", url],
|
|
1057
|
-
["open", url],
|
|
1058
|
-
)
|
|
1059
|
-
for command in browser_commands:
|
|
1060
|
-
if shutil.which(command[0]) is None:
|
|
1061
|
-
continue
|
|
1062
|
-
try:
|
|
1063
|
-
subprocess.Popen(
|
|
1064
|
-
command,
|
|
1065
|
-
stdout=subprocess.DEVNULL,
|
|
1066
|
-
stderr=subprocess.DEVNULL,
|
|
1067
|
-
stdin=subprocess.DEVNULL,
|
|
1068
|
-
start_new_session=True,
|
|
1069
|
-
)
|
|
1070
|
-
return True
|
|
1071
|
-
except OSError:
|
|
1072
|
-
continue
|
|
1073
|
-
try:
|
|
1074
|
-
return bool(webbrowser.open(url))
|
|
1075
|
-
except webbrowser.Error:
|
|
1076
|
-
return False
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
1051
|
def _browser_auto_open_enabled() -> bool:
|
|
1080
1052
|
open_raw = (os.getenv("APHERIS_FOUNDRY_OPEN_BROWSER") or os.getenv("APHERISFOLD_OPEN_BROWSER", "")).strip().lower()
|
|
1081
1053
|
if open_raw in {"1", "true", "yes", "on"}:
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import shutil
|
|
4
|
+
import subprocess
|
|
5
|
+
import webbrowser
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def open_browser(url: str) -> bool:
|
|
9
|
+
browser_commands = (
|
|
10
|
+
["xdg-open", url],
|
|
11
|
+
["gio", "open", url],
|
|
12
|
+
["open", url],
|
|
13
|
+
)
|
|
14
|
+
for command in browser_commands:
|
|
15
|
+
if shutil.which(command[0]) is None:
|
|
16
|
+
continue
|
|
17
|
+
try:
|
|
18
|
+
subprocess.Popen(
|
|
19
|
+
command,
|
|
20
|
+
stdout=subprocess.DEVNULL,
|
|
21
|
+
stderr=subprocess.DEVNULL,
|
|
22
|
+
stdin=subprocess.DEVNULL,
|
|
23
|
+
start_new_session=True,
|
|
24
|
+
)
|
|
25
|
+
return True
|
|
26
|
+
except OSError:
|
|
27
|
+
continue
|
|
28
|
+
try:
|
|
29
|
+
return bool(webbrowser.open(url))
|
|
30
|
+
except (webbrowser.Error, OSError):
|
|
31
|
+
return False
|
{apheris_foundry_cli-2.2.0 → apheris_foundry_cli-2.4.0}/src/apherisfold_cli/core/hub_requests.py
RENAMED
|
@@ -301,6 +301,27 @@ def get_foundry_workflow_docs(workflow_id: str) -> dict[str, Any]:
|
|
|
301
301
|
return _request_json(path=f"/api/v1/foundry/workflows/{encoded}/docs", method="GET", task="foundry.workflows.docs")
|
|
302
302
|
|
|
303
303
|
|
|
304
|
+
def _request_hub_documentation(path: str, task: str) -> dict[str, Any]:
|
|
305
|
+
try:
|
|
306
|
+
return _request_json(path=path, method="GET", task=task)
|
|
307
|
+
except CLIError as error:
|
|
308
|
+
status = (error.details or {}).get("status_code")
|
|
309
|
+
if status == 404:
|
|
310
|
+
error.message = "This document is unavailable, or the selected Hub does not support private documentation. Check the Hub version and run 'apheris-foundry docs list'."
|
|
311
|
+
elif status in {401, 403}:
|
|
312
|
+
error.message = "Private documentation requires Hub login and access to this deployment. Run 'apheris-foundry login' with an authorized account."
|
|
313
|
+
raise
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
def get_hub_documentation_index() -> dict[str, Any]:
|
|
317
|
+
return _request_hub_documentation("/api/v1/docs", "docs.list")
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
def get_hub_document(path: str) -> dict[str, Any]:
|
|
321
|
+
encoded = urllib.parse.quote(path, safe="/")
|
|
322
|
+
return _request_hub_documentation(f"/api/v1/docs/pages/{encoded}", "docs.show")
|
|
323
|
+
|
|
324
|
+
|
|
304
325
|
def get_foundry_workflow_skill(workflow_id: str) -> dict[str, Any]:
|
|
305
326
|
encoded = urllib.parse.quote(workflow_id, safe="")
|
|
306
327
|
return _request_json(path=f"/api/v1/foundry/workflows/{encoded}/skill", method="GET", task="foundry.skills.get")
|