gravity-cli 0.13.20__tar.gz → 0.13.21__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.
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/AGENT_STANDARD_V2.md +4 -1
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/PKG-INFO +3 -3
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/README.md +1 -1
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/__init__.py +2 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/manifest.py +5 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/manifest_v2.py +4 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/specs.py +163 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/pyproject.toml +1 -1
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/schema/manifest.schema.json +112 -0
- gravity_cli-0.13.21/packages/gravity-schema/tests/test_light_actions.py +219 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/pyproject.toml +2 -2
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/CHANGELOG.md +5 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/project.py +18 -2
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_build_push.py +11 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/uv.lock +2 -2
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/.env.example +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/.github/workflows/ci.yml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/.github/workflows/composio-watch.yml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/.github/workflows/release.yml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/AGENT_STANDARD.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/LICENSE +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/NOTICE +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/RELEASING.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/TEMPLATES.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/LICENSE +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/NOTICE +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/README.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/__main__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/built_ins.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/catalog.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/catalog.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/catalog_imported.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/contract.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/cron.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/describe.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/errors.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/export.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/gen_catalog.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/gen_vocabulary.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/instance.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/rules.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/rules_cases.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/source_scan.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/validation.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/__init__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/__main__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/capabilities.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/airtable.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/asana.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/browser_tool.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/composio_search.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/dropbox.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/exa.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/excel.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/firecrawl.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/github.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/gmail.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googlecalendar.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googledocs.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googledrive.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googlesheets.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googleslides.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googletasks.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/hackernews.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/hubspot.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/instagram.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/jira.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/linear.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/linkedin.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/microsoft_teams.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/notion.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/outlook.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/perplexityai.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/pinterest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/reddit.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/slack.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/tavily.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/connectors/youtube.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/core_shapes.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/generated_shapes.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/policy.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/airtable.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/asana.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/browser_tool.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/composio_search.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/dropbox.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/exa.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/excel.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/firecrawl.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/github.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/gmail.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googlecalendar.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googledocs.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googledrive.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googlesheets.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googleslides.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googletasks.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/hackernews.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/hubspot.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/instagram.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/jira.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/linear.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/linkedin.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/microsoft_teams.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/notion.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/outlook.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/perplexityai.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/pinterest.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/reddit.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/slack.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/tavily.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas/youtube.json +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/schemas.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/ochat.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/ocrm.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/ogh.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/oms.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/oweb.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/owork.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/shared.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/sync.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/ochat.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/ocrm.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/ogh.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/oms.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/oweb.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/owork.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rchat.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rfiles.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rgh.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rtrack.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rwork.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/vocabulary/verbs.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/conftest.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/fixtures/demo_manifests.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_accounts.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_actions_memory.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_catalog_parity.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_cron.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_describe.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_errors.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_generated_tables.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_instance.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_json_schema.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_kind_outputs.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_manifest.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_manifest_v2.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_place_maker.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_rules.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_slots.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_source_scan.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_sync.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_validation.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/tests/test_vocabulary.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/scripts/composio-watch.sh +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/BUILDER_GUIDE.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/BUILDER_GUIDE_V2.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/__init__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/__main__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/_runner_script.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/api.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/changelog.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/cli.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/__init__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/adapt.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/build.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/capabilities.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/changelog.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/check.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/connect.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/dev.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/docs.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/guide.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/help.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/init.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/login.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/memory.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/push.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/run.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/runs.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/schedule.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/tools.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/update.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/commands/validate.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/config.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/dev.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/dev_page/index.html +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/docs/Gravity.agent.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/docs/Gravity.getting-started.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/docs/problem-to-agent.md +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/inputs.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/localrun.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/manifest.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/chat/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/chat/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/chat/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/chat/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/deepagent/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/deepagent/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/deepagent/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/deepagent/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/minimal/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/minimal/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/minimal/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/minimal/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/src/gateway.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/src/nodes/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/src/prompts.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/structured/src/state.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/chat/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/chat/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/chat/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/chat/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/chat/tests/test_agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/deepagent/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/deepagent/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/deepagent/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/deepagent/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/deepagent/tests/test_agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/minimal/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/minimal/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/minimal/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/minimal/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/minimal/tests/test_agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/.gitignore +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/src/__init__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/src/gateway.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/src/nodes/__init__.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/src/nodes/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/src/prompts.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/src/state.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/templates/v2/structured/tests/test_agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/timeline.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/ui.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/updater.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/src/gravity_cli/workspace.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter/src/summary.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter/tests/test_summary.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter-v2/manifest.yaml +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter-v2/requirements.txt +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter-v2/src/agent.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter-v2/src/summary.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/starter-v2/tests/test_summary.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/conftest.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_adapt.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_agent_guide.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_agents.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_api.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_changelog.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_check.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_connect.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_connect_v2.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_dev.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_dev_v2.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_gateway_token.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_inputs_memory.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_localrun.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_login.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_manifest_integration.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_run.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_run_v2.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_runs.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_schedule.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_schedule_v2.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_session.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_templates.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_templates_v2.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_timeline.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_tools.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_ui.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_updater.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_v2_cli.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_validate.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_validate_v2.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_welcome.py +0 -0
- {gravity_cli-0.13.20 → gravity_cli-0.13.21}/tests/test_workspace.py +0 -0
|
@@ -32,9 +32,12 @@ my-agent/
|
|
|
32
32
|
|
|
33
33
|
**Only these are bundled.** `gravity build` zips exactly `manifest.yaml`,
|
|
34
34
|
`requirements.txt`, `requirements.lock`, and the contents of `src/` and
|
|
35
|
-
`tests/` (minus dotfiles, `__pycache__
|
|
35
|
+
`tests/` (minus dotfiles, `__pycache__`, bytecode and anything `.gravityignore` names). Anything else — `.venv/`, `build/`, notebooks,
|
|
36
36
|
a `data/` folder — is not shipped, and code that reads it will fail at runtime.
|
|
37
37
|
|
|
38
|
+
`.gravityignore` sits beside the manifest: one path or glob per line (`tests/`, `tests/cache/`, `*.jsonl`), `#` for
|
|
39
|
+
comments. It only removes files under `src/` and `tests/`. Use it for test data that should not leave your machine.
|
|
40
|
+
|
|
38
41
|
## 2. `manifest.yaml`
|
|
39
42
|
|
|
40
43
|
```yaml
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gravity-cli
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.21
|
|
4
4
|
Summary: gravity cli — init, run, and push python agents to the Gravity marketplace
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
License-File: NOTICE
|
|
8
8
|
Requires-Python: >=3.12
|
|
9
|
-
Requires-Dist: gravity-schema==0.13.
|
|
9
|
+
Requires-Dist: gravity-schema==0.13.21
|
|
10
10
|
Requires-Dist: httpx>=0.27.0
|
|
11
11
|
Requires-Dist: keyring>=25.0.0
|
|
12
12
|
Requires-Dist: python-dotenv>=1.0.0
|
|
@@ -446,7 +446,7 @@ Validate the agent, then bundle it into `build/agent.zip` with its hashes in `bu
|
|
|
446
446
|
gravity build [path]
|
|
447
447
|
```
|
|
448
448
|
|
|
449
|
-
The bundle holds `manifest.yaml`, `requirements.txt`, `requirements.lock`, `src/`, `tests/` and `tools_needed.yaml` when present; dotfiles under `src/` and `tests/` are left out. It refuses to build without `requirements.lock` (run `gravity validate` first). The same source always produces the same bytes.
|
|
449
|
+
The bundle holds `manifest.yaml`, `requirements.txt`, `requirements.lock`, `src/`, `tests/` and `tools_needed.yaml` when present; dotfiles under `src/` and `tests/` are left out. To leave out more, put a `.gravityignore` file beside the manifest with one path or glob per line (`tests/`, `tests/cache/`, `*.jsonl`); it only applies under `src/` and `tests/`. It refuses to build without `requirements.lock` (run `gravity validate` first). The same source always produces the same bytes.
|
|
450
450
|
|
|
451
451
|
```bash
|
|
452
452
|
gravity build
|
|
@@ -429,7 +429,7 @@ Validate the agent, then bundle it into `build/agent.zip` with its hashes in `bu
|
|
|
429
429
|
gravity build [path]
|
|
430
430
|
```
|
|
431
431
|
|
|
432
|
-
The bundle holds `manifest.yaml`, `requirements.txt`, `requirements.lock`, `src/`, `tests/` and `tools_needed.yaml` when present; dotfiles under `src/` and `tests/` are left out. It refuses to build without `requirements.lock` (run `gravity validate` first). The same source always produces the same bytes.
|
|
432
|
+
The bundle holds `manifest.yaml`, `requirements.txt`, `requirements.lock`, `src/`, `tests/` and `tools_needed.yaml` when present; dotfiles under `src/` and `tests/` are left out. To leave out more, put a `.gravityignore` file beside the manifest with one path or glob per line (`tests/`, `tests/cache/`, `*.jsonl`); it only applies under `src/` and `tests/`. It refuses to build without `requirements.lock` (run `gravity validate` first). The same source always produces the same bytes.
|
|
433
433
|
|
|
434
434
|
```bash
|
|
435
435
|
gravity build
|
{gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/__init__.py
RENAMED
|
@@ -82,6 +82,7 @@ from .specs import (
|
|
|
82
82
|
DependenciesSpec,
|
|
83
83
|
InputSpec,
|
|
84
84
|
InputType,
|
|
85
|
+
LightSpec,
|
|
85
86
|
MemoryScope,
|
|
86
87
|
MemorySpec,
|
|
87
88
|
ModelsSpec,
|
|
@@ -157,6 +158,7 @@ __all__ = [ # noqa: RUF022 - grouped by concern, not alphabetical
|
|
|
157
158
|
"CollectionSpec",
|
|
158
159
|
"ChooseOneSpec",
|
|
159
160
|
"ActionSpec",
|
|
161
|
+
"LightSpec",
|
|
160
162
|
"OfferAs",
|
|
161
163
|
# input rules
|
|
162
164
|
"visible_inputs",
|
{gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/manifest.py
RENAMED
|
@@ -23,6 +23,7 @@ from .specs import ( # noqa: F401 - re-exported: `from gravity_schema.manifest
|
|
|
23
23
|
DisplaySpec,
|
|
24
24
|
InputSpec,
|
|
25
25
|
InputType,
|
|
26
|
+
LightSpec,
|
|
26
27
|
MemoryScope,
|
|
27
28
|
MemorySpec,
|
|
28
29
|
ModelsSpec,
|
|
@@ -39,6 +40,7 @@ from .specs import ( # noqa: F401 - re-exported: `from gravity_schema.manifest
|
|
|
39
40
|
_check_budget_when,
|
|
40
41
|
_check_show_if,
|
|
41
42
|
_cycle,
|
|
43
|
+
check_light,
|
|
42
44
|
)
|
|
43
45
|
|
|
44
46
|
|
|
@@ -454,6 +456,9 @@ class Manifest(BaseModel):
|
|
|
454
456
|
"Input '{value}' offers action '{other}', which is not declared.",
|
|
455
457
|
{"value": i.name, "other": unknown[0], "remediation": "Declare it under `actions`."},
|
|
456
458
|
)
|
|
459
|
+
collections = self.memory.collections if self.memory is not None else {}
|
|
460
|
+
for a in self.actions:
|
|
461
|
+
check_light(a, self.actions, collections, ())
|
|
457
462
|
return self
|
|
458
463
|
|
|
459
464
|
@model_validator(mode="after")
|
{gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/gravity_schema/manifest_v2.py
RENAMED
|
@@ -40,6 +40,7 @@ from .specs import (
|
|
|
40
40
|
_check_budget_when,
|
|
41
41
|
_check_show_if,
|
|
42
42
|
_cycle,
|
|
43
|
+
check_light,
|
|
43
44
|
)
|
|
44
45
|
from .vocabulary import VOCABULARY
|
|
45
46
|
|
|
@@ -562,6 +563,9 @@ class ManifestV2(BaseModel):
|
|
|
562
563
|
"Input '{value}' offers action '{other}', which is not declared.",
|
|
563
564
|
{"value": i.name, "other": unknown[0], "remediation": "Declare it under `actions`."},
|
|
564
565
|
)
|
|
566
|
+
collections = self.memory.collections if self.memory is not None else {}
|
|
567
|
+
for a in self.actions:
|
|
568
|
+
check_light(a, self.actions, collections, self.writes)
|
|
565
569
|
return self
|
|
566
570
|
|
|
567
571
|
@model_validator(mode="after")
|
|
@@ -4,6 +4,7 @@ own: tools in manifest.py (v1), capabilities in manifest_v2.py (v2)."""
|
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
7
|
+
import re
|
|
7
8
|
from collections.abc import Iterable, Mapping
|
|
8
9
|
from enum import Enum
|
|
9
10
|
from typing import Annotated, Any
|
|
@@ -641,6 +642,163 @@ class ChooseOneSpec(BaseModel):
|
|
|
641
642
|
required: bool = False
|
|
642
643
|
|
|
643
644
|
|
|
645
|
+
_LIGHT_FIELD_RE = re.compile(r"[A-Za-z_][A-Za-z0-9_]{0,63}")
|
|
646
|
+
_LIGHT_TOKEN_RE = re.compile(r"\$(now|today|ref|input\.[A-Za-z_][A-Za-z0-9_]{0,63})")
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
class LightSpec(BaseModel):
|
|
650
|
+
"""A press that only changes a few stored fields on the rows the person picked, which the platform applies with no
|
|
651
|
+
run (the control plane's light-actions.ts; the rules below are its `lightProblems`). Any decline there sends the
|
|
652
|
+
press down the normal path, so a wrong declaration is never worse than a normal run, but it is caught here first.
|
|
653
|
+
A value is a literal, `$now`, `$today`, `$ref`, `$input.<name>`, or `{from: <one of those>, map: {...}}`."""
|
|
654
|
+
|
|
655
|
+
model_config = _STRICT
|
|
656
|
+
|
|
657
|
+
# The list of the result whose rows the person presses, and the field of a row that holds its memory key.
|
|
658
|
+
rows_in: str
|
|
659
|
+
key_from: str
|
|
660
|
+
# The memory collection the row's item lives in.
|
|
661
|
+
collection: str
|
|
662
|
+
# False when the list is not numbered: a row is found by its `key`, not its position.
|
|
663
|
+
numbered: bool | None = None
|
|
664
|
+
# How a pressed reference reads, e.g. "cv:{value}:{row}": {row} once, {value} at most once.
|
|
665
|
+
ref: str | None = None
|
|
666
|
+
# Every condition must hold, each one `input` or `field` with one of in / not_in / empty.
|
|
667
|
+
when: list[dict[str, Any]] = Field(default_factory=list)
|
|
668
|
+
# Any guard that holds declines: a collection that has the item (exists / has) or a write that is bound (`bound`).
|
|
669
|
+
unless: list[dict[str, Any]] = Field(default_factory=list)
|
|
670
|
+
set: dict[str, Any] = Field(default_factory=dict)
|
|
671
|
+
unset: list[str] = Field(default_factory=list)
|
|
672
|
+
keep_first: list[str] = Field(default_factory=list)
|
|
673
|
+
# Per list of the result: the rows carrying a pressed row's key change by `set` / `swap`, or leave by `remove`.
|
|
674
|
+
result: dict[str, Any] = Field(default_factory=dict)
|
|
675
|
+
say: str | None = None
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
def _light_field_problems(names: Iterable[Any], where: str) -> list[str]:
|
|
679
|
+
return [f"{where}: '{n}' is not a field name." for n in names
|
|
680
|
+
if not isinstance(n, str) or not _LIGHT_FIELD_RE.fullmatch(n)]
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
def _light_value_problems(value: Any, where: str, inputs: set[str], has_ref: bool) -> list[str]:
|
|
684
|
+
token = value
|
|
685
|
+
if isinstance(value, (dict, list)):
|
|
686
|
+
token = value.get("from") if isinstance(value, dict) else None
|
|
687
|
+
if not isinstance(token, str) or not _LIGHT_TOKEN_RE.fullmatch(token):
|
|
688
|
+
return [f"{where}: 'from' must be $now, $today, $ref or $input.<name>."]
|
|
689
|
+
mapping = value.get("map")
|
|
690
|
+
if not isinstance(mapping, dict) or not mapping:
|
|
691
|
+
return [f"{where}: 'map' must list the allowed values."]
|
|
692
|
+
if not isinstance(token, str) or not token.startswith("$"):
|
|
693
|
+
return []
|
|
694
|
+
if not _LIGHT_TOKEN_RE.fullmatch(token):
|
|
695
|
+
return [f"{where}: '{token}' is not $now, $today, $ref or $input.<name>."]
|
|
696
|
+
if token == "$ref" and not has_ref:
|
|
697
|
+
return [f"{where}: $ref needs a {{value}} in 'ref'."]
|
|
698
|
+
if token.startswith("$input.") and token[7:] not in inputs:
|
|
699
|
+
return [f"{where}: {token[7:]} is not an input of this action."]
|
|
700
|
+
return []
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
def light_problems(
|
|
704
|
+
action: ActionSpec,
|
|
705
|
+
*,
|
|
706
|
+
actions: Iterable[ActionSpec] | None = None,
|
|
707
|
+
collections: Iterable[str] | None = None,
|
|
708
|
+
writes: Iterable[str] | None = None,
|
|
709
|
+
) -> list[str]:
|
|
710
|
+
"""What is wrong with an action's `light`. Given the manifest's `actions`, memory `collections` and `writes` (none
|
|
711
|
+
on a v1 manifest) it also checks the names it points at; without them only what the action itself holds."""
|
|
712
|
+
s = action.light
|
|
713
|
+
if s is None:
|
|
714
|
+
return ["no light declaration."]
|
|
715
|
+
out: list[str] = []
|
|
716
|
+
inputs = {i.name for i in action.inputs}
|
|
717
|
+
has_ref = s.ref is not None and "{value}" in s.ref
|
|
718
|
+
if not action.per_row:
|
|
719
|
+
out.append("a light action works on rows: set per_row.")
|
|
720
|
+
if action.run_once:
|
|
721
|
+
out.append("a light action may not be run_once.")
|
|
722
|
+
if action.schedule is not None:
|
|
723
|
+
out.append("a light action may not have a schedule.")
|
|
724
|
+
if action.then:
|
|
725
|
+
out.append("a light action may not start other actions (then).")
|
|
726
|
+
if actions is not None and any(action.name in x.requires for x in actions):
|
|
727
|
+
out.append("no other action may require a light action.")
|
|
728
|
+
if not _LIGHT_FIELD_RE.fullmatch(s.rows_in):
|
|
729
|
+
out.append("rows_in must name a list of the result.")
|
|
730
|
+
if not _LIGHT_FIELD_RE.fullmatch(s.key_from):
|
|
731
|
+
out.append("key_from must name a field of the row.")
|
|
732
|
+
declared = None if collections is None else set(collections)
|
|
733
|
+
if declared is not None and s.collection not in declared:
|
|
734
|
+
out.append(f"collection '{s.collection}' is not declared under memory.collections.")
|
|
735
|
+
if s.ref is not None and (s.ref.count("{row}") != 1 or s.ref.count("{value}") > 1):
|
|
736
|
+
out.append("ref must hold {row} once and {value} at most once.")
|
|
737
|
+
for c in s.when:
|
|
738
|
+
if ("input" in c) == ("field" in c):
|
|
739
|
+
out.append("each when names one input or one field.")
|
|
740
|
+
continue
|
|
741
|
+
if "input" in c and c["input"] not in inputs:
|
|
742
|
+
out.append(f"when: {c['input']} is not an input of this action.")
|
|
743
|
+
if "field" in c and (not isinstance(c["field"], str) or not _LIGHT_FIELD_RE.fullmatch(c["field"])):
|
|
744
|
+
out.append(f"when: '{c['field']}' is not a field name.")
|
|
745
|
+
tests = [k for k in ("in", "not_in", "empty") if k in c]
|
|
746
|
+
if len(tests) != 1 or ("in" in c and not isinstance(c["in"], list)) or ("not_in" in c and not isinstance(c["not_in"], list)):
|
|
747
|
+
out.append("each when has one of in: [...], not_in: [...] or empty: true|false.")
|
|
748
|
+
write_names = None if writes is None else set(writes)
|
|
749
|
+
for g in s.unless:
|
|
750
|
+
if "bound" in g:
|
|
751
|
+
if write_names is not None and g["bound"] not in write_names:
|
|
752
|
+
out.append(f"unless: '{g['bound']}' is not one of the agent's writes.")
|
|
753
|
+
elif not g.get("collection") or (declared is not None and g["collection"] not in declared):
|
|
754
|
+
out.append(f"unless: collection '{g.get('collection')}' is not declared under memory.collections.")
|
|
755
|
+
elif not g.get("exists") and not (isinstance(g.get("has"), str) and _LIGHT_FIELD_RE.fullmatch(g["has"])):
|
|
756
|
+
out.append("unless on a collection needs exists: true or has: <field>.")
|
|
757
|
+
out.extend(_light_field_problems(s.set, "set"))
|
|
758
|
+
out.extend(_light_field_problems(s.unset, "unset"))
|
|
759
|
+
out.extend(_light_field_problems(s.keep_first, "keep_first"))
|
|
760
|
+
for k, v in s.set.items():
|
|
761
|
+
out.extend(_light_value_problems(v, f"set.{k}", inputs, has_ref))
|
|
762
|
+
out.extend(f"keep_first: {k} is not set." for k in s.keep_first if k not in s.set)
|
|
763
|
+
if not s.set and not s.unset:
|
|
764
|
+
out.append("a light action sets or unsets at least one field.")
|
|
765
|
+
for name, p in s.result.items():
|
|
766
|
+
if not _LIGHT_FIELD_RE.fullmatch(name) or not isinstance(p, dict):
|
|
767
|
+
out.append(f"result.{name}: not a list of the result.")
|
|
768
|
+
continue
|
|
769
|
+
if p.get("remove") and name == s.rows_in and s.numbered is not False:
|
|
770
|
+
out.append(f"result.{name}: rows are numbered on this list, so none may leave it.")
|
|
771
|
+
sets, swaps = p.get("set") or {}, p.get("swap") or {}
|
|
772
|
+
out.extend(_light_field_problems(sets, f"result.{name}.set"))
|
|
773
|
+
out.extend(_light_field_problems(swaps, f"result.{name}.swap"))
|
|
774
|
+
for k, v in sets.items():
|
|
775
|
+
out.extend(_light_value_problems(v, f"result.{name}.set.{k}", inputs, has_ref))
|
|
776
|
+
return out
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
def _bad_light(action: ActionSpec, problem: str) -> PydanticCustomError:
|
|
780
|
+
return PydanticCustomError(
|
|
781
|
+
ErrorCode.INVALID_ACTION.value,
|
|
782
|
+
"Action '{value}' has a light declaration that cannot work: {problem}",
|
|
783
|
+
{"value": action.name, "problem": problem,
|
|
784
|
+
"remediation": "Fix `light`, or remove it so the press runs as a normal run."},
|
|
785
|
+
)
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
def check_light(
|
|
789
|
+
action: ActionSpec,
|
|
790
|
+
actions: Iterable[ActionSpec],
|
|
791
|
+
collections: Iterable[str],
|
|
792
|
+
writes: Iterable[str],
|
|
793
|
+
) -> None:
|
|
794
|
+
"""The manifest-level pass: the names a `light` points at must exist in this manifest."""
|
|
795
|
+
if action.light is None:
|
|
796
|
+
return
|
|
797
|
+
problems = light_problems(action, actions=actions, collections=collections, writes=writes)
|
|
798
|
+
if problems:
|
|
799
|
+
raise _bad_light(action, problems[0])
|
|
800
|
+
|
|
801
|
+
|
|
644
802
|
class ActionSpec(BaseModel):
|
|
645
803
|
"""One thing the agent can do. The runner passes the chosen ones in state["actions"]."""
|
|
646
804
|
|
|
@@ -662,6 +820,8 @@ class ActionSpec(BaseModel):
|
|
|
662
820
|
run_once: bool = False
|
|
663
821
|
# Run these next, each as its own run on the same conversation, when this one completes.
|
|
664
822
|
then: Annotated[list[str], Field(max_length=C.MAX_ACTIONS)] = Field(default_factory=list)
|
|
823
|
+
# A press that only changes a few stored fields, applied by the platform with no run (LightSpec).
|
|
824
|
+
light: LightSpec | None = None
|
|
665
825
|
|
|
666
826
|
@field_validator("name")
|
|
667
827
|
@classmethod
|
|
@@ -689,6 +849,9 @@ class ActionSpec(BaseModel):
|
|
|
689
849
|
"Action '{value}' declares an input twice.",
|
|
690
850
|
{"value": self.name, "remediation": "Rename or remove the duplicate input."},
|
|
691
851
|
)
|
|
852
|
+
own = light_problems(self) if self.light is not None else []
|
|
853
|
+
if own:
|
|
854
|
+
raise _bad_light(self, own[0])
|
|
692
855
|
for spec in self.inputs:
|
|
693
856
|
if spec.type is InputType.ACTION_CHOICE:
|
|
694
857
|
raise PydanticCustomError(
|
{gravity_cli-0.13.20 → gravity_cli-0.13.21}/packages/gravity-schema/schema/manifest.schema.json
RENAMED
|
@@ -60,6 +60,17 @@
|
|
|
60
60
|
"title": "Label",
|
|
61
61
|
"type": "string"
|
|
62
62
|
},
|
|
63
|
+
"light": {
|
|
64
|
+
"anyOf": [
|
|
65
|
+
{
|
|
66
|
+
"$ref": "#/$defs/LightSpec"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"type": "null"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"default": null
|
|
73
|
+
},
|
|
63
74
|
"name": {
|
|
64
75
|
"maxLength": 64,
|
|
65
76
|
"title": "Name",
|
|
@@ -589,6 +600,107 @@
|
|
|
589
600
|
"title": "InputType",
|
|
590
601
|
"type": "string"
|
|
591
602
|
},
|
|
603
|
+
"LightSpec": {
|
|
604
|
+
"additionalProperties": false,
|
|
605
|
+
"description": "A press that only changes a few stored fields on the rows the person picked, which the platform applies with no\nrun (the control plane's light-actions.ts; the rules below are its `lightProblems`). Any decline there sends the\npress down the normal path, so a wrong declaration is never worse than a normal run, but it is caught here first.\nA value is a literal, `$now`, `$today`, `$ref`, `$input.<name>`, or `{from: <one of those>, map: {...}}`.",
|
|
606
|
+
"properties": {
|
|
607
|
+
"collection": {
|
|
608
|
+
"title": "Collection",
|
|
609
|
+
"type": "string"
|
|
610
|
+
},
|
|
611
|
+
"keep_first": {
|
|
612
|
+
"items": {
|
|
613
|
+
"type": "string"
|
|
614
|
+
},
|
|
615
|
+
"title": "Keep First",
|
|
616
|
+
"type": "array"
|
|
617
|
+
},
|
|
618
|
+
"key_from": {
|
|
619
|
+
"title": "Key From",
|
|
620
|
+
"type": "string"
|
|
621
|
+
},
|
|
622
|
+
"numbered": {
|
|
623
|
+
"anyOf": [
|
|
624
|
+
{
|
|
625
|
+
"type": "boolean"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"type": "null"
|
|
629
|
+
}
|
|
630
|
+
],
|
|
631
|
+
"default": null,
|
|
632
|
+
"title": "Numbered"
|
|
633
|
+
},
|
|
634
|
+
"ref": {
|
|
635
|
+
"anyOf": [
|
|
636
|
+
{
|
|
637
|
+
"type": "string"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"type": "null"
|
|
641
|
+
}
|
|
642
|
+
],
|
|
643
|
+
"default": null,
|
|
644
|
+
"title": "Ref"
|
|
645
|
+
},
|
|
646
|
+
"result": {
|
|
647
|
+
"additionalProperties": true,
|
|
648
|
+
"title": "Result",
|
|
649
|
+
"type": "object"
|
|
650
|
+
},
|
|
651
|
+
"rows_in": {
|
|
652
|
+
"title": "Rows In",
|
|
653
|
+
"type": "string"
|
|
654
|
+
},
|
|
655
|
+
"say": {
|
|
656
|
+
"anyOf": [
|
|
657
|
+
{
|
|
658
|
+
"type": "string"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"type": "null"
|
|
662
|
+
}
|
|
663
|
+
],
|
|
664
|
+
"default": null,
|
|
665
|
+
"title": "Say"
|
|
666
|
+
},
|
|
667
|
+
"set": {
|
|
668
|
+
"additionalProperties": true,
|
|
669
|
+
"title": "Set",
|
|
670
|
+
"type": "object"
|
|
671
|
+
},
|
|
672
|
+
"unless": {
|
|
673
|
+
"items": {
|
|
674
|
+
"additionalProperties": true,
|
|
675
|
+
"type": "object"
|
|
676
|
+
},
|
|
677
|
+
"title": "Unless",
|
|
678
|
+
"type": "array"
|
|
679
|
+
},
|
|
680
|
+
"unset": {
|
|
681
|
+
"items": {
|
|
682
|
+
"type": "string"
|
|
683
|
+
},
|
|
684
|
+
"title": "Unset",
|
|
685
|
+
"type": "array"
|
|
686
|
+
},
|
|
687
|
+
"when": {
|
|
688
|
+
"items": {
|
|
689
|
+
"additionalProperties": true,
|
|
690
|
+
"type": "object"
|
|
691
|
+
},
|
|
692
|
+
"title": "When",
|
|
693
|
+
"type": "array"
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
"required": [
|
|
697
|
+
"rows_in",
|
|
698
|
+
"key_from",
|
|
699
|
+
"collection"
|
|
700
|
+
],
|
|
701
|
+
"title": "LightSpec",
|
|
702
|
+
"type": "object"
|
|
703
|
+
},
|
|
592
704
|
"Manifest": {
|
|
593
705
|
"additionalProperties": false,
|
|
594
706
|
"description": "A complete agent declaration. Structural only: tool existence is checked in validation.py.",
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"""An action's optional `light` (specs.LightSpec): the rules are the control plane's `lightProblems`
|
|
2
|
+
(apps/agent-control-plane/src/platform/light-actions.ts), so a declaration that could never work is refused at
|
|
3
|
+
validation, with the rule that failed, instead of silently becoming a normal run on the platform."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import copy
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
from gravity_schema import (
|
|
11
|
+
ErrorCode,
|
|
12
|
+
LightSpec,
|
|
13
|
+
ManifestValidationError,
|
|
14
|
+
validate_manifest,
|
|
15
|
+
)
|
|
16
|
+
from gravity_schema.specs import ActionSpec, light_problems
|
|
17
|
+
|
|
18
|
+
BASE = {"name": "tracker", "runtime": {"entrypoint": "src/agent.py:graph"},
|
|
19
|
+
"memory": {"collections": {"applications": {}, "jobs": {}}}}
|
|
20
|
+
|
|
21
|
+
LIGHT = {
|
|
22
|
+
"rows_in": "applications",
|
|
23
|
+
"ref": "cv:{value}:{row}",
|
|
24
|
+
"collection": "applications",
|
|
25
|
+
"key_from": "mem_key",
|
|
26
|
+
"when": [{"field": "stage", "not_in": ["sent"]}],
|
|
27
|
+
"unless": [{"collection": "jobs", "exists": True}],
|
|
28
|
+
"set": {"resume_choice": {"from": "$ref", "map": {"original": "original", "tailored": "tailored"}}, "at": "$now"},
|
|
29
|
+
"keep_first": ["at"],
|
|
30
|
+
"result": {"prepared": {"set": {"resume_choice": {"from": "$ref", "map": {"original": "original"}}},
|
|
31
|
+
"swap": {"tags": {"a": "b"}}}},
|
|
32
|
+
"say": "Changed which resume goes with that application.",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def action(**light_over) -> dict:
|
|
37
|
+
light = {**copy.deepcopy(LIGHT), **light_over}
|
|
38
|
+
return {"name": "prepare", "label": "Prepare", "default": True, "per_row": True, "light": light}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def manifest(a: dict | None = None, **over) -> dict:
|
|
42
|
+
return {**copy.deepcopy(BASE), "actions": [a or action()], **over}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def refused(data) -> str:
|
|
46
|
+
with pytest.raises(ManifestValidationError) as exc:
|
|
47
|
+
validate_manifest(data)
|
|
48
|
+
first = exc.value.issues[0]
|
|
49
|
+
assert first.code is ErrorCode.INVALID_ACTION
|
|
50
|
+
return first.message
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_a_light_action_validates_and_is_kept():
|
|
54
|
+
m = validate_manifest(manifest())
|
|
55
|
+
light = m.action("prepare").light
|
|
56
|
+
assert isinstance(light, LightSpec)
|
|
57
|
+
assert (light.rows_in, light.collection, light.key_from, light.ref) == ("applications", "applications", "mem_key", "cv:{value}:{row}")
|
|
58
|
+
assert light.numbered is None and light.keep_first == ["at"] and light.unset == []
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_light_is_optional_and_a_push_dump_leaves_it_out():
|
|
62
|
+
plain = validate_manifest({**BASE, "actions": [{"name": "go", "label": "Go", "default": True}]})
|
|
63
|
+
assert plain.action("go").light is None
|
|
64
|
+
assert "light" not in plain.model_dump(mode="json", exclude_none=True)["actions"][0]
|
|
65
|
+
dumped = validate_manifest(manifest()).model_dump(mode="json", exclude_none=True)["actions"][0]["light"]
|
|
66
|
+
assert dumped["set"]["resume_choice"]["from"] == "$ref" and dumped["when"] == [{"field": "stage", "not_in": ["sent"]}]
|
|
67
|
+
assert "numbered" not in dumped
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def test_a_light_declaration_with_an_unknown_field_is_refused():
|
|
71
|
+
with pytest.raises(ManifestValidationError) as exc:
|
|
72
|
+
validate_manifest(manifest(action(rows_on="x")))
|
|
73
|
+
assert exc.value.issues[0].code is ErrorCode.UNKNOWN_FIELD
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@pytest.mark.parametrize("over", [{"rows_in": "1bad"}, {"rows_in": "has space"}, {"key_from": "a-b"}])
|
|
77
|
+
def test_rows_in_and_key_from_name_fields(over):
|
|
78
|
+
assert "must name" in refused(manifest(action(**over)))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def test_a_light_action_works_on_rows_and_stands_alone():
|
|
82
|
+
a = action()
|
|
83
|
+
assert "per_row" in refused(manifest({**a, "per_row": False}))
|
|
84
|
+
assert "run_once" in refused(manifest({**a, "run_once": True}))
|
|
85
|
+
assert "schedule" in refused(manifest({**a, "schedule": {"cron": "0 9 * * *"}}))
|
|
86
|
+
chained = manifest({**a, "then": ["other"]})
|
|
87
|
+
chained["actions"].append({"name": "other", "label": "Other"})
|
|
88
|
+
assert "(then)" in refused(chained)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def test_no_other_action_may_require_a_light_action():
|
|
92
|
+
data = manifest({**action(), "default": True})
|
|
93
|
+
data["actions"].append({"name": "later", "label": "Later", "requires": ["prepare"]})
|
|
94
|
+
assert "may require a light action" in refused(data)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def test_the_collection_must_be_declared_under_memory():
|
|
98
|
+
assert "collection 'ghost' is not declared" in refused(manifest(action(collection="ghost")))
|
|
99
|
+
assert "collection 'ghost' is not declared" in refused(manifest(action(unless=[{"collection": "ghost", "exists": True}])))
|
|
100
|
+
no_memory = {"name": "tracker", "runtime": {"entrypoint": "src/agent.py:graph"}, "actions": [action()]}
|
|
101
|
+
assert "is not declared" in refused(no_memory)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@pytest.mark.parametrize("ref", ["cv:{value}", "cv:{row}:{row}", "cv:{value}:{value}:{row}", "plain"])
|
|
105
|
+
def test_ref_holds_row_once_and_value_at_most_once(ref):
|
|
106
|
+
assert "ref must hold" in refused(manifest(action(ref=ref)))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_ref_may_be_left_out_or_leave_out_value():
|
|
110
|
+
for ref in (None, "tone:{row}"):
|
|
111
|
+
light = {**LIGHT, "ref": ref, "set": {"at": "$now"}, "result": {}}
|
|
112
|
+
data = manifest({"name": "prepare", "label": "P", "default": True, "per_row": True,
|
|
113
|
+
"light": {k: v for k, v in light.items() if v is not None}})
|
|
114
|
+
assert validate_manifest(data).action("prepare").light.ref == ref
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def test_when_names_one_input_or_one_field_with_one_test():
|
|
118
|
+
cases = [
|
|
119
|
+
({"field": "stage", "input": "x", "in": ["a"]}, "names one input or one field"),
|
|
120
|
+
({"in": ["a"]}, "names one input or one field"),
|
|
121
|
+
({"field": "stage"}, "each when has one of"),
|
|
122
|
+
({"field": "stage", "in": ["a"], "empty": True}, "each when has one of"),
|
|
123
|
+
({"field": "stage", "in": "a"}, "each when has one of"),
|
|
124
|
+
({"field": "stage", "not_in": "a"}, "each when has one of"),
|
|
125
|
+
({"field": "1stage", "empty": False}, "'1stage' is not a field name"),
|
|
126
|
+
({"input": "nope", "in": ["a"]}, "nope is not an input of this action"),
|
|
127
|
+
]
|
|
128
|
+
for when, why in cases:
|
|
129
|
+
assert why in refused(manifest(action(when=[when]))), when
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def test_when_on_an_input_of_the_action_is_valid():
|
|
133
|
+
a = {**action(when=[{"input": "resume", "in": ["x"]}, {"field": "resume", "empty": False}]),
|
|
134
|
+
"inputs": [{"name": "resume", "type": "text", "label": "Which?"}]}
|
|
135
|
+
validate_manifest(manifest(a))
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def test_unless_on_a_collection_needs_exists_or_a_field_to_have():
|
|
139
|
+
assert "needs exists: true or has" in refused(manifest(action(unless=[{"collection": "jobs"}])))
|
|
140
|
+
assert "needs exists: true or has" in refused(manifest(action(unless=[{"collection": "jobs", "has": "1x"}])))
|
|
141
|
+
validate_manifest(manifest(action(unless=[{"collection": "jobs", "has": "saved_at"}])))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
V2 = {
|
|
145
|
+
"contract": "v2", "name": "tracker", "runtime": {"entrypoint": "src/agent.py:graph"},
|
|
146
|
+
"sources": {"mail": {"capability": "message.search", "label": "Your email"}},
|
|
147
|
+
"writes": {"tracker": {"capability": "row.append", "label": "Your sheet"},
|
|
148
|
+
"copy": {"capability": "row.append", "label": "A copy", "same_as": "tracker"}},
|
|
149
|
+
"memory": {"collections": {"applications": {}}},
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def test_bound_names_a_declared_write_on_a_v2_manifest():
|
|
154
|
+
ok = {**copy.deepcopy(V2), "actions": [action(unless=[{"bound": "tracker"}, {"collection": "applications", "exists": True}])]}
|
|
155
|
+
assert validate_manifest(ok).action("prepare").light.unless[0] == {"bound": "tracker"}
|
|
156
|
+
bad = {**copy.deepcopy(V2), "actions": [action(unless=[{"bound": "ghost"}])]}
|
|
157
|
+
assert "'ghost' is not one of the agent's writes" in refused(bad)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def test_bound_has_no_writes_to_name_on_a_v1_manifest():
|
|
161
|
+
assert "'tracker' is not one of the agent's writes" in refused(manifest(action(unless=[{"bound": "tracker"}])))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def test_set_unset_and_keep_first_name_fields():
|
|
165
|
+
assert "'a-b' is not a field name" in refused(manifest(action(set={"a-b": 1})))
|
|
166
|
+
assert "'9' is not a field name" in refused(manifest(action(unset=["9"], set={})))
|
|
167
|
+
assert "'x y' is not a field name" in refused(manifest(action(set={"at": "$now"}, keep_first=["x y"])))
|
|
168
|
+
assert "keep_first: later is not set" in refused(manifest(action(keep_first=["later"])))
|
|
169
|
+
assert "sets or unsets at least one field" in refused(manifest(action(set={}, keep_first=[], result={})))
|
|
170
|
+
validate_manifest(manifest(action(set={}, unset=["draft"], keep_first=[], result={})))
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
@pytest.mark.parametrize(("value", "why"), [
|
|
174
|
+
({"from": "$nope", "map": {"a": 1}}, "'from' must be $now, $today, $ref or $input.<name>"),
|
|
175
|
+
({"from": "literal", "map": {"a": 1}}, "'from' must be"),
|
|
176
|
+
({"map": {"a": 1}}, "'from' must be"),
|
|
177
|
+
({"from": "$ref", "map": {}}, "'map' must list the allowed values"),
|
|
178
|
+
({"from": "$ref"}, "'map' must list the allowed values"),
|
|
179
|
+
({"from": "$ref", "map": ["a"]}, "'map' must list the allowed values"),
|
|
180
|
+
("$later", "'$later' is not $now, $today, $ref or $input.<name>"),
|
|
181
|
+
("$input.ghost", "ghost is not an input of this action"),
|
|
182
|
+
({"from": "$input.ghost", "map": {"a": 1}}, "ghost is not an input of this action"),
|
|
183
|
+
])
|
|
184
|
+
def test_set_values_are_literals_tokens_or_mapped_tokens(value, why):
|
|
185
|
+
assert why in refused(manifest(action(set={"at": value}, keep_first=[], result={})))
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def test_a_ref_token_needs_a_value_in_ref():
|
|
189
|
+
why = "$ref needs a {value} in 'ref'"
|
|
190
|
+
assert why in refused(manifest(action(ref="tone:{row}", set={"at": "$ref"}, result={})))
|
|
191
|
+
assert why in refused(manifest(action(ref=None, set={"at": {"from": "$ref", "map": {"a": 1}}}, result={})))
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def test_literals_and_input_tokens_are_valid():
|
|
195
|
+
a = {**action(set={"n": 3, "yes": True, "nothing": None, "text": "plain", "today": "$today", "pick": "$input.resume"}, keep_first=[], result={}),
|
|
196
|
+
"inputs": [{"name": "resume", "type": "text", "label": "Which?"}]}
|
|
197
|
+
validate_manifest(manifest(a))
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def test_result_lists_set_swap_and_remove():
|
|
201
|
+
assert "result.1x: not a list of the result" in refused(manifest(action(result={"1x": {"remove": True}})))
|
|
202
|
+
assert "result.jobs: not a list of the result" in refused(manifest(action(result={"jobs": "gone"})))
|
|
203
|
+
assert "result.prepared.set: 'a-b' is not a field name" in refused(manifest(action(result={"prepared": {"set": {"a-b": 1}}})))
|
|
204
|
+
assert "result.prepared.swap: '2' is not a field name" in refused(manifest(action(result={"prepared": {"swap": {"2": {}}}})))
|
|
205
|
+
assert "result.prepared.set.x: ghost is not an input" in refused(manifest(action(result={"prepared": {"set": {"x": "$input.ghost"}}})))
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def test_rows_may_leave_a_list_other_than_the_numbered_one():
|
|
209
|
+
assert "rows are numbered on this list" in refused(manifest(action(result={"applications": {"remove": True}})))
|
|
210
|
+
validate_manifest(manifest(action(result={"prepared": {"remove": True}})))
|
|
211
|
+
validate_manifest(manifest(action(numbered=False, result={"applications": {"remove": True}})))
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def test_the_checks_run_on_the_action_alone_without_manifest_context():
|
|
215
|
+
spec = ActionSpec.model_validate({"name": "prepare", "label": "P", "per_row": True, "light": LIGHT})
|
|
216
|
+
assert light_problems(spec) == []
|
|
217
|
+
assert light_problems(spec, collections=[]) == ["collection 'applications' is not declared under memory.collections.",
|
|
218
|
+
"unless: collection 'jobs' is not declared under memory.collections."]
|
|
219
|
+
assert light_problems(ActionSpec(name="x", label="X")) == ["no light declaration."]
|