gravity-cli 0.13.5__tar.gz → 0.13.6__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.5 → gravity_cli-0.13.6}/PKG-INFO +6 -5
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/README.md +4 -3
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/capabilities.yaml +1 -1
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/gmail.yaml +57 -4
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/outlook.yaml +79 -4
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/core_shapes.yaml +2 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/pyproject.toml +1 -1
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_vocabulary.py +37 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/pyproject.toml +2 -2
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/CHANGELOG.md +7 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/api.py +7 -4
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/login.py +79 -12
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/workspace.py +9 -2
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_gateway_token.py +2 -2
- gravity_cli-0.13.6/tests/test_login.py +70 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_session.py +2 -2
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_workspace.py +17 -1
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/uv.lock +6 -6
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/.env.example +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/.github/workflows/ci.yml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/.github/workflows/composio-watch.yml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/.github/workflows/release.yml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/AGENT_STANDARD.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/AGENT_STANDARD_V2.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/LICENSE +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/NOTICE +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/RELEASING.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/TEMPLATES.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/LICENSE +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/NOTICE +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/README.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/__init__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/__main__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/built_ins.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/catalog.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/catalog.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/catalog_imported.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/contract.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/cron.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/describe.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/errors.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/export.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/gen_catalog.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/gen_vocabulary.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/instance.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/manifest.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/manifest_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/rules.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/rules_cases.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/source_scan.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/specs.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/validation.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/__init__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/__main__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/airtable.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/asana.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/browser_tool.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/composio_search.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/dropbox.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/exa.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/excel.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/firecrawl.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/github.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googlecalendar.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googledocs.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googledrive.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googlesheets.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googleslides.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/googletasks.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/hackernews.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/hubspot.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/instagram.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/jira.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/linear.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/linkedin.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/microsoft_teams.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/notion.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/perplexityai.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/pinterest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/reddit.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/slack.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/tavily.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/connectors/youtube.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/generated_shapes.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/policy.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/airtable.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/asana.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/browser_tool.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/composio_search.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/dropbox.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/exa.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/excel.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/firecrawl.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/github.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/gmail.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googlecalendar.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googledocs.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googledrive.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googlesheets.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googleslides.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/googletasks.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/hackernews.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/hubspot.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/instagram.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/jira.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/linear.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/linkedin.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/microsoft_teams.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/notion.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/outlook.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/perplexityai.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/pinterest.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/reddit.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/slack.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/tavily.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas/youtube.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/schemas.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/ochat.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/ocrm.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/ogh.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/oms.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/oweb.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/owork.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/shapes.d/shared.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/sync.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/ochat.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/ocrm.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/ogh.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/oms.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/oweb.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/owork.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rchat.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rfiles.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rgh.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rtrack.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.d/rwork.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/gravity_schema/vocabulary/verbs.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/schema/manifest.schema.json +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/conftest.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/fixtures/demo_manifests.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_accounts.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_actions_memory.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_catalog_parity.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_cron.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_describe.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_errors.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_generated_tables.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_instance.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_json_schema.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_kind_outputs.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_manifest.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_manifest_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_place_maker.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_rules.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_slots.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_source_scan.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_sync.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/packages/gravity-schema/tests/test_validation.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/scripts/composio-watch.sh +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/BUILDER_GUIDE.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/BUILDER_GUIDE_V2.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/__init__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/__main__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/_runner_script.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/changelog.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/cli.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/__init__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/adapt.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/build.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/capabilities.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/changelog.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/check.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/connect.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/dev.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/docs.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/guide.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/help.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/init.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/memory.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/push.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/run.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/runs.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/schedule.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/tools.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/update.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/commands/validate.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/config.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/dev.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/dev_page/index.html +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/docs/Gravity.agent.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/docs/Gravity.getting-started.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/docs/problem-to-agent.md +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/inputs.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/localrun.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/manifest.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/project.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/chat/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/chat/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/chat/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/chat/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/deepagent/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/deepagent/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/deepagent/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/deepagent/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/minimal/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/minimal/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/minimal/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/minimal/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/src/gateway.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/src/nodes/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/src/prompts.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/structured/src/state.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/chat/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/chat/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/chat/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/chat/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/chat/tests/test_agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/deepagent/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/deepagent/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/deepagent/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/deepagent/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/deepagent/tests/test_agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/minimal/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/minimal/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/minimal/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/minimal/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/minimal/tests/test_agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/.gitignore +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/src/__init__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/src/gateway.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/src/nodes/__init__.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/src/nodes/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/src/prompts.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/src/state.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/templates/v2/structured/tests/test_agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/timeline.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/ui.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/src/gravity_cli/updater.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter/src/summary.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter/tests/test_summary.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter-v2/manifest.yaml +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter-v2/requirements.txt +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter-v2/src/agent.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter-v2/src/summary.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/starter-v2/tests/test_summary.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/conftest.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_adapt.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_agent_guide.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_agents.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_api.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_build_push.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_changelog.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_check.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_connect.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_connect_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_dev.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_dev_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_inputs_memory.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_localrun.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_manifest_integration.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_run.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_run_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_runs.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_schedule.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_schedule_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_templates.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_templates_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_timeline.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_tools.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_ui.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_updater.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_v2_cli.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_validate.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_validate_v2.py +0 -0
- {gravity_cli-0.13.5 → gravity_cli-0.13.6}/tests/test_welcome.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gravity-cli
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.6
|
|
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.6
|
|
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
|
|
@@ -517,10 +517,11 @@ gravity tools gmail # only tools whose name contains "gmail"
|
|
|
517
517
|
|
|
518
518
|
### `gravity login`
|
|
519
519
|
|
|
520
|
-
Sign in to Gravity. It opens your browser
|
|
520
|
+
Sign in to Gravity. It opens your browser on Google's sign-in and stores the session in your operating system's keychain. The browser hands the sign-in back to the CLI on this machine (on 127.0.0.1), so there is no code to copy or compare.
|
|
521
521
|
|
|
522
522
|
```
|
|
523
523
|
gravity login
|
|
524
|
+
gravity login --no-browser # over SSH, or with no browser here: open the link on any device and check the code
|
|
524
525
|
```
|
|
525
526
|
|
|
526
527
|
### `gravity logout`
|
|
@@ -589,7 +590,7 @@ gravity docs [--force]
|
|
|
589
590
|
|---|---|
|
|
590
591
|
| `--force` | Replace the files even where you edited them, or where a file Gravity did not write has the same name |
|
|
591
592
|
|
|
592
|
-
You rarely need this. Every command
|
|
593
|
+
You rarely need this. Every command run in an agent's folder (one with a `manifest.yaml`) writes the three files there if they are missing, and rewrites them when a newer release changes them; a folder that already holds them, from `gravity docs`, is kept current the same way. Anywhere else, such as a repository you sign in from, commands write nothing (`gravity init` writes them into the new agent). The first line of a file Gravity wrote names the release and a hash of the text after it: if you edit the file the hash no longer matches and Gravity leaves it alone. Your own `agent.md`, `AGENTS.md` and `CLAUDE.md` are never touched. Point your coding agent at `Gravity.agent.md` from them if it does not look there by itself. Set `GRAVITY_AGENT_DOCS=0` to stop the automatic writes.
|
|
593
594
|
|
|
594
595
|
### `gravity update`
|
|
595
596
|
|
|
@@ -673,7 +674,7 @@ Set `GRAVITY_API_URL` and `GRAVITY_GATEWAY_URL` only to work against services yo
|
|
|
673
674
|
| `GRAVITY_API_TOKEN` | A control-plane dev token, used instead of `gravity login`. For development only. | none |
|
|
674
675
|
| `GRAVITY_CONFIG_DIR` | Moves `~/.gravity` elsewhere. Useful for tests and CI. | `~/.gravity` |
|
|
675
676
|
| `GRAVITY_AUTO_UPDATE` | When `0`, commands neither check for a newer release nor install one. Always off when `CI` is set. | `1` |
|
|
676
|
-
| `GRAVITY_AGENT_DOCS` | When `0`, commands do not write `Gravity.agent.md`, `problem-to-agent.md` and `Gravity.getting-started.md` into the folder they run in. `gravity docs` still does. | `1` |
|
|
677
|
+
| `GRAVITY_AGENT_DOCS` | When `0`, commands do not write `Gravity.agent.md`, `problem-to-agent.md` and `Gravity.getting-started.md` into the agent's folder they run in. `gravity docs` still does. | `1` |
|
|
677
678
|
| `GRAVITY_UPDATE_URL` | Where the latest version is read from, a JSON document with `info.version`. For tests and mirrors. | PyPI |
|
|
678
679
|
| `GRAVITY_UNATTENDED` | When `1`, calls that need approval are rejected without asking. `gravity schedule` sets it for you. | unset |
|
|
679
680
|
|
|
@@ -500,10 +500,11 @@ gravity tools gmail # only tools whose name contains "gmail"
|
|
|
500
500
|
|
|
501
501
|
### `gravity login`
|
|
502
502
|
|
|
503
|
-
Sign in to Gravity. It opens your browser
|
|
503
|
+
Sign in to Gravity. It opens your browser on Google's sign-in and stores the session in your operating system's keychain. The browser hands the sign-in back to the CLI on this machine (on 127.0.0.1), so there is no code to copy or compare.
|
|
504
504
|
|
|
505
505
|
```
|
|
506
506
|
gravity login
|
|
507
|
+
gravity login --no-browser # over SSH, or with no browser here: open the link on any device and check the code
|
|
507
508
|
```
|
|
508
509
|
|
|
509
510
|
### `gravity logout`
|
|
@@ -572,7 +573,7 @@ gravity docs [--force]
|
|
|
572
573
|
|---|---|
|
|
573
574
|
| `--force` | Replace the files even where you edited them, or where a file Gravity did not write has the same name |
|
|
574
575
|
|
|
575
|
-
You rarely need this. Every command
|
|
576
|
+
You rarely need this. Every command run in an agent's folder (one with a `manifest.yaml`) writes the three files there if they are missing, and rewrites them when a newer release changes them; a folder that already holds them, from `gravity docs`, is kept current the same way. Anywhere else, such as a repository you sign in from, commands write nothing (`gravity init` writes them into the new agent). The first line of a file Gravity wrote names the release and a hash of the text after it: if you edit the file the hash no longer matches and Gravity leaves it alone. Your own `agent.md`, `AGENTS.md` and `CLAUDE.md` are never touched. Point your coding agent at `Gravity.agent.md` from them if it does not look there by itself. Set `GRAVITY_AGENT_DOCS=0` to stop the automatic writes.
|
|
576
577
|
|
|
577
578
|
### `gravity update`
|
|
578
579
|
|
|
@@ -656,7 +657,7 @@ Set `GRAVITY_API_URL` and `GRAVITY_GATEWAY_URL` only to work against services yo
|
|
|
656
657
|
| `GRAVITY_API_TOKEN` | A control-plane dev token, used instead of `gravity login`. For development only. | none |
|
|
657
658
|
| `GRAVITY_CONFIG_DIR` | Moves `~/.gravity` elsewhere. Useful for tests and CI. | `~/.gravity` |
|
|
658
659
|
| `GRAVITY_AUTO_UPDATE` | When `0`, commands neither check for a newer release nor install one. Always off when `CI` is set. | `1` |
|
|
659
|
-
| `GRAVITY_AGENT_DOCS` | When `0`, commands do not write `Gravity.agent.md`, `problem-to-agent.md` and `Gravity.getting-started.md` into the folder they run in. `gravity docs` still does. | `1` |
|
|
660
|
+
| `GRAVITY_AGENT_DOCS` | When `0`, commands do not write `Gravity.agent.md`, `problem-to-agent.md` and `Gravity.getting-started.md` into the agent's folder they run in. `gravity docs` still does. | `1` |
|
|
660
661
|
| `GRAVITY_UPDATE_URL` | Where the latest version is read from, a JSON document with `info.version`. For tests and mirrors. | PyPI |
|
|
661
662
|
| `GRAVITY_UNATTENDED` | When `1`, calls that need approval are rejected without asking. `gravity schedule` sets it for you. | unset |
|
|
662
663
|
|
|
@@ -621,20 +621,73 @@ writes:
|
|
|
621
621
|
args: {id: "{id}"}
|
|
622
622
|
check: fields_match
|
|
623
623
|
map: {name: name}
|
|
624
|
+
# a reply in a thread (draft.reply_to or draft.thread): unverified until a live write; a new draft as before
|
|
624
625
|
message.create:
|
|
626
|
+
# draft: {to, subject, text | html}: a new draft. With draft.reply_to (the id of the message it answers) or
|
|
627
|
+
# draft.thread (a thread's id, as reads give it: its last message is the one answered), a reply DRAFT in that
|
|
628
|
+
# thread instead: it takes the thread's subject ("Re: ..."; Composio: a subject of its own would start a new
|
|
629
|
+
# thread, so draft.subject isn't sent), and goes where Gmail's Reply sends it: to the sender of the message
|
|
630
|
+
# answered, or, when the account wrote that message (sent, or a draft of its own), to the people it went to, as
|
|
631
|
+
# message.reply does (draft.to isn't used). The receipt's id is the DRAFT's (message.send_draft sends it as the
|
|
632
|
+
# user left it, message.update_draft changes it, message.delete_draft deletes it); extra.message_id is the message
|
|
633
|
+
# inside it, and thread its thread, for a follow-up later
|
|
625
634
|
steps:
|
|
635
|
+
- &gmail_thread_last
|
|
636
|
+
# a thread named without a message: its last message (the thread's messages come oldest first)
|
|
637
|
+
action: GMAIL_FETCH_MESSAGE_BY_THREAD_ID
|
|
638
|
+
each: draft.thread
|
|
639
|
+
args: {thread_id: "{item}"}
|
|
640
|
+
save: {last: "data.messages[].messageId|last"}
|
|
641
|
+
- &gmail_answered
|
|
642
|
+
# the message answered: its thread, its sender, and whether the account wrote it. A thread whose messages
|
|
643
|
+
# weren't found is passed on as it is, so this read fails rather than a new email going out
|
|
644
|
+
action: GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID
|
|
645
|
+
each: "draft.reply_to ?? last|first ?? draft.thread"
|
|
646
|
+
args: {message_id: "{item}"}
|
|
647
|
+
save: {answered: data.messageId, reply_thread: data.threadId, sender: data.sender|email_addr,
|
|
648
|
+
mine: "data.labelIds|str|split(SENT)|count|enum(1:,*:true) ?? data.labelIds|str|split(DRAFT)|count|enum(1:,*:true)"}
|
|
649
|
+
- &gmail_answered_mine
|
|
650
|
+
# the account's own message: read again for the people it went to (as message.reply)
|
|
651
|
+
action: GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID
|
|
652
|
+
each: mine|first
|
|
653
|
+
args: {message_id: "{answered|first}"}
|
|
654
|
+
save: {sent_to: data.to|emails}
|
|
655
|
+
- action: GMAIL_CREATE_EMAIL_DRAFT
|
|
656
|
+
each: reply_thread|first
|
|
657
|
+
args: {thread_id: "{item}", recipient_email: "{sent_to|first|first ?? sender|first}", extra_recipients: "{sent_to|first|rest}",
|
|
658
|
+
body: "{draft.html ?? draft.text}", is_html: "{draft.html|present}"}
|
|
659
|
+
save: {reply_id: "data.response_data.id ?? data.id", reply_message: data.message.id, replied_thread: data.message.threadId}
|
|
626
660
|
- action: GMAIL_CREATE_EMAIL_DRAFT
|
|
661
|
+
each: "reply_thread|first|present|enum(false:new)" # no thread asked for: a new draft
|
|
627
662
|
args: {recipient_email: "{draft.to|emails|first}", extra_recipients: "{draft.to|emails|rest}", subject: "{draft.subject}",
|
|
628
663
|
body: "{draft.html ?? draft.text}", is_html: "{draft.html|present}"}
|
|
629
|
-
save: {id: "data.response_data.id ?? data.id"
|
|
630
|
-
|
|
664
|
+
save: {id: "data.response_data.id ?? data.id", message: data.message.id, thread: data.message.threadId,
|
|
665
|
+
subject: "={draft.subject}"}
|
|
666
|
+
returns: {id: "reply_id|first ?? id|first", thread: "replied_thread|first ?? reply_thread|first ?? thread|first",
|
|
667
|
+
subject: subject|first, extra.message_id: "reply_message|first ?? message|first", extra.replied_to: answered|first}
|
|
668
|
+
# a reply in a thread (draft.reply_to or draft.thread): unverified until a live write; a new email as before
|
|
631
669
|
message.send:
|
|
670
|
+
# draft: {to, subject, text | html}: a new email. With draft.reply_to or draft.thread (as message.create), a reply
|
|
671
|
+
# in that thread instead, sent at once: Gmail's send can't thread (Composio: "To reply in an existing thread, use
|
|
672
|
+
# GMAIL_REPLY_TO_THREAD"). It keeps the thread's subject ("Re: ...") and goes where Gmail's Reply sends it, as
|
|
673
|
+
# message.create says (draft.subject and draft.to aren't used). The receipt names the sent message and its thread
|
|
674
|
+
# either way, so a follow-up can go in the same thread
|
|
632
675
|
steps:
|
|
676
|
+
- *gmail_thread_last
|
|
677
|
+
- *gmail_answered
|
|
678
|
+
- *gmail_answered_mine
|
|
679
|
+
- action: GMAIL_REPLY_TO_THREAD
|
|
680
|
+
each: reply_thread|first
|
|
681
|
+
args: {thread_id: "{item}", recipient_email: "{sent_to|first|first ?? sender|first}", extra_recipients: "{sent_to|first|rest}",
|
|
682
|
+
message_body: "{draft.html ?? draft.text}", is_html: "{draft.html|present}"}
|
|
683
|
+
save: {reply_id: data.id, replied_thread: data.threadId}
|
|
633
684
|
- action: GMAIL_SEND_EMAIL
|
|
685
|
+
each: "reply_thread|first|present|enum(false:new)" # no thread asked for: a new email
|
|
634
686
|
args: {recipient_email: "{draft.to|emails|first}", extra_recipients: "{draft.to|emails|rest}", subject: "{draft.subject}",
|
|
635
687
|
body: "{draft.html ?? draft.text}", is_html: "{draft.html|present}"}
|
|
636
|
-
save: {id: "data.response_data.id ?? data.id"}
|
|
637
|
-
returns: {id: id,
|
|
688
|
+
save: {id: "data.response_data.id ?? data.id", thread: data.threadId, subject: "={draft.subject}"}
|
|
689
|
+
returns: {id: "reply_id|first ?? id|first", thread: "replied_thread|first ?? reply_thread|first ?? thread|first",
|
|
690
|
+
subject: subject|first, extra.replied_to: answered|first}
|
|
638
691
|
# verified live 2026-10-12
|
|
639
692
|
label.update:
|
|
640
693
|
# draft.id names a user label (system labels can't change); only the fields given change, one call each. A color
|
|
@@ -757,6 +757,8 @@ actions:
|
|
|
757
757
|
about: Tool to delete a category from the user's master category list
|
|
758
758
|
OUTLOOK_DELETE_MESSAGE:
|
|
759
759
|
capability: message.delete
|
|
760
|
+
also:
|
|
761
|
+
- message.delete_draft
|
|
760
762
|
side_effect: write
|
|
761
763
|
required:
|
|
762
764
|
- message_id
|
|
@@ -2678,21 +2680,77 @@ reads:
|
|
|
2678
2680
|
features: tags, extra.wheelchair: isWheelChairAccessible, extra.booking: bookingType,
|
|
2679
2681
|
extra.audio: audioDeviceName, extra.video: videoDeviceName, extra.display: displayDeviceName}
|
|
2680
2682
|
writes:
|
|
2683
|
+
# a reply in a conversation (draft.reply_to or draft.thread): unverified until a live write; a new draft as before
|
|
2681
2684
|
message.create:
|
|
2685
|
+
# draft: {to, subject, text | html}: a new draft. With draft.reply_to (the id of the message it answers) or
|
|
2686
|
+
# draft.thread (a conversation's id, as reads give it: its latest message that isn't a draft is the one answered),
|
|
2687
|
+
# a reply DRAFT in that conversation instead: Outlook's own reply, under "RE: ...", with the text above the quoted
|
|
2688
|
+
# message (Outlook takes a reply's text as plain text: draft.text, else draft.html's text). It goes to the sender
|
|
2689
|
+
# of the message answered, or, when the account sent that message (it is in Sent Items), to the people it went to
|
|
2690
|
+
# (Outlook's reply would address the account itself). draft.to and draft.subject aren't used. The receipt's id is
|
|
2691
|
+
# the draft's (message.send_draft sends it as the user left it), and thread its conversation, for a follow-up
|
|
2682
2692
|
steps:
|
|
2693
|
+
- &outlook_thread_last
|
|
2694
|
+
# a conversation named without a message: its latest one, in any folder. Outlook sorts on a field only when the
|
|
2695
|
+
# filter names it first
|
|
2696
|
+
action: OUTLOOK_LIST_MESSAGES
|
|
2697
|
+
each: draft.thread
|
|
2698
|
+
args: {folder: allfolders, top: 1, orderby: receivedDateTime desc,
|
|
2699
|
+
filter: "receivedDateTime ge 2000-01-01T00:00:00Z and conversationId eq '{item}' and isDraft eq false"}
|
|
2700
|
+
save: {last: "data.value[].id|first"}
|
|
2701
|
+
- &outlook_answered
|
|
2702
|
+
# the message answered: its conversation, its folder and who it went to. A conversation whose messages weren't
|
|
2703
|
+
# found is passed on as it is, so this read fails rather than a new email going out
|
|
2704
|
+
action: OUTLOOK_GET_MESSAGE
|
|
2705
|
+
each: "draft.reply_to ?? last|first ?? draft.thread"
|
|
2706
|
+
args: {message_id: "{item}", user_id: me}
|
|
2707
|
+
save: {answered: data.id, reply_thread: data.conversationId, folder: data.parentFolderId,
|
|
2708
|
+
sent_to: "data.toRecipients[].emailAddress.address"}
|
|
2709
|
+
- &outlook_sent_items
|
|
2710
|
+
# Sent Items, to tell whether the account sent the message answered
|
|
2711
|
+
action: OUTLOOK_GET_MAIL_FOLDER
|
|
2712
|
+
each: reply_thread|first
|
|
2713
|
+
args: {mail_folder_id: sentitems, user_id: me}
|
|
2714
|
+
save: {sent_items: data}
|
|
2715
|
+
- &outlook_reply_draft
|
|
2716
|
+
action: OUTLOOK_CREATE_DRAFT_REPLY
|
|
2717
|
+
each: reply_thread|first
|
|
2718
|
+
args: {message_id: "{answered|first}", user_id: me, comment: "{draft.text ?? draft.html|html_text}"}
|
|
2719
|
+
save: {reply_id: data.id, reply_link: data.webLink, replied_thread: data.conversationId}
|
|
2720
|
+
- &outlook_reply_to_mine
|
|
2721
|
+
# the account's own message (its folder is Sent Items): the reply goes to the people it went to
|
|
2722
|
+
action: OUTLOOK_UPDATE_EMAIL
|
|
2723
|
+
each: "sent_items[id={folder|first}]"
|
|
2724
|
+
args: {message_id: "{reply_id|first}", user_id: me, to_recipients: "{sent_to|first|wrap(address)}"}
|
|
2683
2725
|
- action: OUTLOOK_CREATE_DRAFT
|
|
2726
|
+
each: "reply_thread|first|present|enum(false:new)" # no conversation asked for: a new draft
|
|
2684
2727
|
args: {subject: "{draft.subject}", body: "{draft.html ?? draft.text}", is_html: "{draft.html|present}",
|
|
2685
2728
|
to_recipients: "{draft.to|emails}"}
|
|
2686
|
-
save: {id: data.id, link: data.webLink}
|
|
2687
|
-
returns: {id: id,
|
|
2729
|
+
save: {id: data.id, link: data.webLink, thread: data.conversationId, subject: "={draft.subject}"}
|
|
2730
|
+
returns: {id: "reply_id|first ?? id|first", thread: "replied_thread|first ?? reply_thread|first ?? thread|first",
|
|
2731
|
+
subject: subject|first, link: "reply_link|first ?? link|first", extra.replied_to: answered|first}
|
|
2732
|
+
# a reply in a conversation (draft.reply_to or draft.thread): unverified until a live write; a new email as before
|
|
2688
2733
|
message.send:
|
|
2734
|
+
# draft: {to, subject, text | html}: a new email. With draft.reply_to or draft.thread, a reply in that conversation
|
|
2735
|
+
# instead, made as message.create makes one and then sent. Outlook's send gives back no record of what it sent: the
|
|
2736
|
+
# receipt names a reply's conversation (for a follow-up), and a new email's subject only (to learn a new email's
|
|
2737
|
+
# conversation, make it with message.create and send that with message.send_draft)
|
|
2689
2738
|
steps:
|
|
2739
|
+
- *outlook_thread_last
|
|
2740
|
+
- *outlook_answered
|
|
2741
|
+
- *outlook_sent_items
|
|
2742
|
+
- *outlook_reply_draft
|
|
2743
|
+
- *outlook_reply_to_mine
|
|
2744
|
+
- action: OUTLOOK_SEND_DRAFT
|
|
2745
|
+
each: reply_id|first
|
|
2746
|
+
args: {message_id: "{item}", user_id: me}
|
|
2690
2747
|
- action: OUTLOOK_SEND_EMAIL
|
|
2748
|
+
each: "reply_thread|first|present|enum(false:new)" # no conversation asked for: a new email
|
|
2691
2749
|
# OUTLOOK_SEND_EMAIL takes one `to`: everyone else is copied, so no recipient is dropped
|
|
2692
2750
|
args: {to: "{draft.to|emails|first}", cc_emails: "{draft.to|emails|rest}", subject: "{draft.subject}",
|
|
2693
2751
|
body: "{draft.html ?? draft.text}", is_html: "{draft.html|present}"}
|
|
2694
|
-
save: {status: data.status_code}
|
|
2695
|
-
returns: {subject:
|
|
2752
|
+
save: {status: data.status_code, subject: "={draft.subject}"}
|
|
2753
|
+
returns: {thread: "replied_thread|first ?? reply_thread|first", subject: subject|first, extra.replied_to: answered|first}
|
|
2696
2754
|
# verified live 2026-10-12 (a personal Microsoft account)
|
|
2697
2755
|
message.update:
|
|
2698
2756
|
# draft.id names the message; its subject, labels (Outlook categories, by name) and body change, the rest stays.
|
|
@@ -3179,6 +3237,23 @@ writes:
|
|
|
3179
3237
|
action: OUTLOOK_GET_MESSAGE
|
|
3180
3238
|
args: {message_id: "{draft.id}", user_id: me}
|
|
3181
3239
|
check: gone
|
|
3240
|
+
# unverified until a live write
|
|
3241
|
+
message.delete_draft:
|
|
3242
|
+
# draft.id names a draft (message.create gives it); it is deleted for good, as a Gmail draft is (message.delete
|
|
3243
|
+
# moves a message to Deleted Items instead). Only a draft: the message is read first, and one that isn't a draft
|
|
3244
|
+
# is left alone, which the read-back then reports (found, not gone)
|
|
3245
|
+
steps:
|
|
3246
|
+
- action: OUTLOOK_GET_MESSAGE
|
|
3247
|
+
args: {message_id: "{draft.id}", user_id: me}
|
|
3248
|
+
save: {is_draft: "data.isDraft|enum(true:yes)"}
|
|
3249
|
+
- action: OUTLOOK_DELETE_MESSAGE
|
|
3250
|
+
each: is_draft
|
|
3251
|
+
args: {message_id: "{draft.id}", user_id: me}
|
|
3252
|
+
returns: {id: draft.id}
|
|
3253
|
+
read_back:
|
|
3254
|
+
action: OUTLOOK_GET_MESSAGE
|
|
3255
|
+
args: {message_id: "{draft.id}", user_id: me}
|
|
3256
|
+
check: gone
|
|
3182
3257
|
# verified live 2026-10-12 (a personal Microsoft account)
|
|
3183
3258
|
message.move:
|
|
3184
3259
|
# draft: {id, folder}: the message moves to the folder draft.folder names (its id, as mail_folder.list gives it,
|
|
@@ -24,6 +24,8 @@ message:
|
|
|
24
24
|
author: ref
|
|
25
25
|
subject: text?
|
|
26
26
|
thread: thread?
|
|
27
|
+
reply_to: message? # the message this one answers, by its id (not a Reply-To address): an email drafted or sent
|
|
28
|
+
# with it, or with a thread, is a reply in that thread
|
|
27
29
|
channel: channel?
|
|
28
30
|
to: list[ref]?
|
|
29
31
|
labels: list[text]?
|
|
@@ -161,3 +161,40 @@ def test_an_invite_gets_a_video_call_only_when_asked():
|
|
|
161
161
|
outlook = VOCABULARY.connectors["outlook"].writes["event.create"]["steps"][0]["args"]
|
|
162
162
|
assert outlook["is_online_meeting"] == "{draft.video_call|bool}"
|
|
163
163
|
assert {"video_call", "video_link"} <= set(VOCABULARY.shapes["event"].fields)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
@pytest.mark.parametrize("app,capability,reply", [
|
|
167
|
+
("gmail", "message.send", "GMAIL_REPLY_TO_THREAD"),
|
|
168
|
+
("gmail", "message.create", "GMAIL_CREATE_EMAIL_DRAFT"),
|
|
169
|
+
("outlook", "message.send", "OUTLOOK_SEND_DRAFT"),
|
|
170
|
+
("outlook", "message.create", "OUTLOOK_CREATE_DRAFT_REPLY"),
|
|
171
|
+
])
|
|
172
|
+
def test_an_email_with_a_thread_or_a_message_it_answers_is_a_reply_in_that_thread(app, capability, reply):
|
|
173
|
+
# the engine's behaviour is tested where it runs (gravity-connect's mapping tests); here, the mapping's outline
|
|
174
|
+
assert VOCABULARY.shapes["message"].fields["reply_to"] == "message?" # beside thread, in every message draft
|
|
175
|
+
spec = VOCABULARY.connectors[app].writes[capability]
|
|
176
|
+
assert spec["steps"][0]["each"] == "draft.thread" # a thread: its latest message is answered
|
|
177
|
+
assert spec["steps"][1]["each"] == "draft.reply_to ?? last|first ?? draft.thread"
|
|
178
|
+
threaded = next(s for s in spec["steps"] if s["action"] == reply) # only when a thread was asked for
|
|
179
|
+
assert threaded["each"] in ("reply_thread|first", "reply_id|first")
|
|
180
|
+
new = spec["steps"][-1] # and a new one only when none was
|
|
181
|
+
assert new is not threaded and new["each"] == "reply_thread|first|present|enum(false:new)"
|
|
182
|
+
assert "subject" in new["args"] and "thread_id" not in new["args"]
|
|
183
|
+
if app == "gmail":
|
|
184
|
+
# Composio: a subject of its own starts a new thread, so a reply is sent with the thread's id and no subject
|
|
185
|
+
assert threaded["args"]["thread_id"] == "{item}" and "subject" not in threaded["args"]
|
|
186
|
+
assert "thread" in spec["returns"] and "extra.replied_to" in spec["returns"]
|
|
187
|
+
# the reads it makes are in the run's grant with it
|
|
188
|
+
assert "message.get" in VOCABULARY.uses(capability, app)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def test_a_draft_the_agent_made_can_be_sent_or_deleted_as_the_user_left_it():
|
|
192
|
+
for app in ("gmail", "outlook"):
|
|
193
|
+
for capability in ("message.send_draft", "message.delete_draft"):
|
|
194
|
+
assert capability in VOCABULARY.connectors[app].writes, (app, capability)
|
|
195
|
+
assert VOCABULARY.takes("message.send_draft") == {"id": "the draft"}
|
|
196
|
+
assert VOCABULARY.is_off_by_default("message.delete_draft") and not VOCABULARY.is_off_by_default("message.send_draft")
|
|
197
|
+
# Outlook deletes only a draft: the message is read first, and the delete runs only when it is one
|
|
198
|
+
steps = VOCABULARY.connectors["outlook"].writes["message.delete_draft"]["steps"]
|
|
199
|
+
assert [s["action"] for s in steps] == ["OUTLOOK_GET_MESSAGE", "OUTLOOK_DELETE_MESSAGE"]
|
|
200
|
+
assert steps[1]["each"] == "is_draft" and steps[0]["save"]["is_draft"] == "data.isDraft|enum(true:yes)"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "gravity-cli"
|
|
3
|
-
version = "0.13.
|
|
3
|
+
version = "0.13.6"
|
|
4
4
|
description = "gravity cli — init, run, and push python agents to the Gravity marketplace"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "Apache-2.0"
|
|
7
7
|
license-files = ["LICENSE", "NOTICE"]
|
|
8
8
|
requires-python = ">=3.12"
|
|
9
9
|
dependencies = [
|
|
10
|
-
"gravity-schema==0.13.
|
|
10
|
+
"gravity-schema==0.13.6", # released in lockstep: always the same version as this package
|
|
11
11
|
"typer>=0.15.0",
|
|
12
12
|
"httpx>=0.27.0",
|
|
13
13
|
"rich>=13.9.0",
|
|
@@ -4,6 +4,13 @@ Shown by `gravity update` and `gravity changelog`, and after an update. Each rel
|
|
|
4
4
|
then one bullet per change: `- new|improved|fixed: A one-line headline. The detail behind it.`
|
|
5
5
|
Write it for a builder, not for a maintainer. `tests/test_changelog.py` fails a release that has no entry.
|
|
6
6
|
|
|
7
|
+
## 0.13.6 - 2026-11-02
|
|
8
|
+
|
|
9
|
+
- new: Replies and follow-ups stay in their email thread. A `message.send` or `message.create` draft with `reply_to` (the id of the message it answers) or `thread` (a thread's id, from a read or an earlier receipt; its latest message is the one answered) is a reply in that thread on Gmail and Outlook, under the thread's "Re:" subject, to whom the app's Reply sends it: the sender, or the people your own message went to, so a follow-up to an unanswered email reaches them. A reply ignores `subject` and `to`. Receipts now give the `thread` to follow up in (and `extra.replied_to`). Without either field, nothing changes.
|
|
10
|
+
- new: Send the draft as the user left it. A `message.create` receipt's `id` is the draft's: `message.send_draft` with `{"id": ...}` sends that draft with the user's edits (Gmail and Outlook), and `message.delete_draft` deletes it, now on Outlook too (a draft only; off by default, like every delete). List `message.send_draft` under `approvals.required_for` as you do `message.send`. On Outlook, a new email sent with `message.send` still gives back no thread: make it with `message.create` and send it with `message.send_draft` to keep its `thread`.
|
|
11
|
+
- improved: `gravity login` is just Google. The browser opens on the sign-in, and after you pick your account it hands the session back to the CLI on this machine, so there is no code to confirm. Over SSH or without a browser, `gravity login --no-browser` prints a link and a code to use on any device.
|
|
12
|
+
- fixed: Commands no longer leave Gravity.agent.md, problem-to-agent.md and Gravity.getting-started.md in whatever folder you run them in. They are written in an agent's folder (one with a manifest.yaml) and kept current where they already are; `gravity docs` still writes them anywhere you ask.
|
|
13
|
+
|
|
7
14
|
## 0.13.5 - 2026-11-02
|
|
8
15
|
|
|
9
16
|
- new: Apollo and Firecrawl as built-in tools for contract v2 agents, on Gravity's own account through Composio Instant (nothing for the user to connect): `apollo.search_people` (free), `apollo.search_companies`, `apollo.enrich_person`, `apollo.job_postings`, `firecrawl.scrape` and `firecrawl.map`. Apollo's data has no page to quote: use it to find companies and people, and confirm what you show on their own site or a register.
|
|
@@ -119,14 +119,17 @@ def service_config() -> dict:
|
|
|
119
119
|
return _shaped(_request("GET", "/api/cli/config", auth=False, timeout=15), "/api/cli/config", "gateway_url")
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
def device_start() -> dict:
|
|
122
|
+
def device_start(loopback: bool = False) -> dict:
|
|
123
|
+
"""loopback: this CLI waits on 127.0.0.1 for the browser's hand-off (commands/login.py); else the code flow."""
|
|
123
124
|
path = "/api/cli/device/start"
|
|
124
|
-
|
|
125
|
+
body = {"json": {"loopback": True}} if loopback else {}
|
|
126
|
+
return _shaped(_request("POST", path, auth=False, timeout=15, **body), path, "deviceCode", "verificationUrl", "userCode")
|
|
125
127
|
|
|
126
128
|
|
|
127
|
-
def device_poll(device_code: str) -> dict:
|
|
129
|
+
def device_poll(device_code: str, handoff: str | None = None) -> dict:
|
|
128
130
|
path = "/api/cli/device/poll"
|
|
129
|
-
|
|
131
|
+
body = {"deviceCode": device_code, **({"handoff": handoff} if handoff else {})}
|
|
132
|
+
result = _shaped(_request("POST", path, auth=False, timeout=15, json=body), path, "status")
|
|
130
133
|
if result["status"] == "approved":
|
|
131
134
|
_shaped(result.get("session"), path, "accessToken", "refreshToken")
|
|
132
135
|
return result
|
|
@@ -1,39 +1,106 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import http.server
|
|
3
4
|
import os
|
|
5
|
+
import secrets
|
|
6
|
+
import threading
|
|
4
7
|
import time
|
|
5
8
|
import webbrowser
|
|
6
9
|
from datetime import UTC, datetime
|
|
7
10
|
from typing import Annotated
|
|
11
|
+
from urllib.parse import parse_qs, urlencode, urlsplit
|
|
8
12
|
|
|
9
13
|
import typer
|
|
10
14
|
|
|
11
15
|
from .. import Problem, api, config, ui
|
|
12
16
|
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
"""
|
|
18
|
+
class _Callback(http.server.BaseHTTPRequestHandler):
|
|
19
|
+
"""The sign-in page sends the browser here after Google, with the one-time hand-off the server asks for."""
|
|
20
|
+
|
|
21
|
+
def do_GET(self):
|
|
22
|
+
url = urlsplit(self.path)
|
|
23
|
+
q = parse_qs(url.query)
|
|
24
|
+
if url.path != "/callback" or q.get("state") != [self.server.state] or not q.get("handoff"):
|
|
25
|
+
self.send_error(404)
|
|
26
|
+
return
|
|
27
|
+
self.server.handoff = q["handoff"][0]
|
|
28
|
+
self.server.got.set()
|
|
29
|
+
self.send_response(302) # back to the page, which says the CLI is signed in
|
|
30
|
+
self.send_header("Location", f"{config.api_url()}/cli-login?signed_in=1")
|
|
31
|
+
self.end_headers()
|
|
32
|
+
|
|
33
|
+
def log_message(self, *args): # nothing on the terminal
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class _Listener(http.server.HTTPServer):
|
|
38
|
+
"""127.0.0.1 only, on a free port, for this one sign-in. Only the browser on this machine can reach it, so a
|
|
39
|
+
login link someone else opens can never hand their account to this CLI, and nobody has to compare a code."""
|
|
40
|
+
|
|
41
|
+
def __init__(self):
|
|
42
|
+
self.state = secrets.token_urlsafe(16)
|
|
43
|
+
self.handoff: str | None = None
|
|
44
|
+
self.got = threading.Event()
|
|
45
|
+
super().__init__(("127.0.0.1", 0), _Callback)
|
|
46
|
+
threading.Thread(target=self.serve_forever, daemon=True).start()
|
|
47
|
+
|
|
48
|
+
def close(self):
|
|
49
|
+
self.shutdown()
|
|
50
|
+
self.server_close()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _listen() -> _Listener | None:
|
|
54
|
+
try:
|
|
55
|
+
return _Listener()
|
|
56
|
+
except OSError: # no loopback socket here: the code flow still works
|
|
57
|
+
return None
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def login_command(
|
|
61
|
+
no_browser: Annotated[bool, typer.Option("--no-browser", help="Sign in from another device with a code (SSH, or no browser here)")] = False,
|
|
62
|
+
):
|
|
63
|
+
"""Sign in with Google in your browser; the token goes in the OS keychain."""
|
|
16
64
|
if os.environ.get("GRAVITY_API_TOKEN"):
|
|
17
65
|
ui.warn("GRAVITY_API_TOKEN is set", "it is used instead of this sign-in", "Remove it from ~/.gravity/.env to use your account")
|
|
18
|
-
|
|
66
|
+
listener = None if no_browser else _listen()
|
|
67
|
+
try:
|
|
68
|
+
_sign_in(listener, open_browser=not no_browser)
|
|
69
|
+
finally:
|
|
70
|
+
if listener:
|
|
71
|
+
listener.close()
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _sign_in(listener: _Listener | None, open_browser: bool) -> None:
|
|
75
|
+
start = api.device_start(loopback=listener is not None)
|
|
19
76
|
device_code = start["deviceCode"]
|
|
20
77
|
interval = start.get("interval", 3)
|
|
21
78
|
deadline = time.time() + start.get("expiresIn", 600)
|
|
22
79
|
|
|
23
80
|
ui.heading("Sign in to Gravity")
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
["
|
|
27
|
-
|
|
81
|
+
if listener:
|
|
82
|
+
url = f"{start['verificationUrl']}&{urlencode({'port': listener.server_address[1], 'state': listener.state})}"
|
|
83
|
+
ui.table(["", ""], [["Your browser is opening", "sign in with Google there"], ["Or open", url]])
|
|
84
|
+
else:
|
|
85
|
+
url = start["verificationUrl"]
|
|
86
|
+
ui.table(["", "", ""], [
|
|
87
|
+
["1", "Open this page" if not open_browser else "Your browser is opening", url],
|
|
88
|
+
["2", "Check it shows this code", start["userCode"]],
|
|
89
|
+
])
|
|
28
90
|
ui.say()
|
|
29
|
-
|
|
91
|
+
if open_browser:
|
|
92
|
+
webbrowser.open(url)
|
|
30
93
|
|
|
31
|
-
|
|
94
|
+
waiting = "Waiting for you to sign in"
|
|
95
|
+
with ui.working(waiting) as show:
|
|
32
96
|
while (left := deadline - time.time()) > 0:
|
|
33
|
-
show(f"
|
|
34
|
-
|
|
97
|
+
show(f"{waiting} {int(left) // 60}:{int(left) % 60:02d} left")
|
|
98
|
+
if listener:
|
|
99
|
+
listener.got.wait(interval) # wakes as soon as the browser hands off
|
|
100
|
+
else:
|
|
101
|
+
time.sleep(interval)
|
|
35
102
|
try:
|
|
36
|
-
result = api.device_poll(device_code)
|
|
103
|
+
result = api.device_poll(device_code, listener.handoff if listener else None)
|
|
37
104
|
except Problem as e:
|
|
38
105
|
if e.title != "expired_token": # the control plane's only 400 here; anything else is its own problem
|
|
39
106
|
raise
|
|
@@ -149,9 +149,16 @@ def sync(folder: Path, *, force: bool = False) -> list[Outcome]:
|
|
|
149
149
|
return [_sync_one(folder, name, release, force) for name in FILES]
|
|
150
150
|
|
|
151
151
|
|
|
152
|
+
def _agent_folder(folder: Path) -> bool:
|
|
153
|
+
"""An agent's folder, or one that already holds the files (gravity docs put them there). Anywhere else, such
|
|
154
|
+
as a repository someone signs in from, every command would leave ~200 KB of guides behind."""
|
|
155
|
+
return (folder / "manifest.yaml").exists() or any((folder / name).exists() for name in FILES)
|
|
156
|
+
|
|
157
|
+
|
|
152
158
|
def refresh(folder: Path) -> None:
|
|
153
|
-
"""What every command does first: create or update the files
|
|
154
|
-
|
|
159
|
+
"""What every command does first: create or update the files in an agent's folder, and say so in one line.
|
|
160
|
+
Never raises."""
|
|
161
|
+
if not enabled() or not _agent_folder(folder):
|
|
155
162
|
return
|
|
156
163
|
with contextlib.suppress(Exception):
|
|
157
164
|
by_status: dict[str, list[str]] = defaultdict(list)
|
|
@@ -25,8 +25,8 @@ def stored(monkeypatch):
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _login(monkeypatch, issued):
|
|
28
|
-
monkeypatch.setattr(login.api, "device_start", lambda: {"deviceCode": "d", "userCode": "U", "verificationUrl": "https://x", "interval": 0})
|
|
29
|
-
monkeypatch.setattr(login.api, "device_poll", lambda code: {"status": "approved", "session": {"accessToken": "a", "refreshToken": "r"}})
|
|
28
|
+
monkeypatch.setattr(login.api, "device_start", lambda loopback=False: {"deviceCode": "d", "userCode": "U", "verificationUrl": "https://x", "interval": 0})
|
|
29
|
+
monkeypatch.setattr(login.api, "device_poll", lambda code, handoff=None: {"status": "approved", "session": {"accessToken": "a", "refreshToken": "r"}})
|
|
30
30
|
monkeypatch.setattr(login.api, "gateway_token", lambda: issued)
|
|
31
31
|
monkeypatch.setattr(login.webbrowser, "open", lambda url: None)
|
|
32
32
|
login.login_command()
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""gravity login: Google in the browser, and the session only ever reaches the CLI on the machine that browser
|
|
2
|
+
runs on (the page hands off to 127.0.0.1). --no-browser keeps the code flow for SSH."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import http.client
|
|
7
|
+
from urllib.parse import parse_qs, urlsplit
|
|
8
|
+
|
|
9
|
+
from gravity_cli import config
|
|
10
|
+
from gravity_cli.commands import login
|
|
11
|
+
|
|
12
|
+
SESSION = {"accessToken": "a", "refreshToken": "r"}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _fake_server(monkeypatch, calls):
|
|
16
|
+
def start(loopback=False):
|
|
17
|
+
calls.append(("start", loopback))
|
|
18
|
+
return {"deviceCode": "d", "userCode": "ABCD-EFGH", "verificationUrl": "https://agents.example/cli-login?code=ABCD-EFGH",
|
|
19
|
+
"interval": 0.05, "expiresIn": 5}
|
|
20
|
+
|
|
21
|
+
def poll(code, handoff=None): # the server releases a loopback session only with the hand-off
|
|
22
|
+
calls.append(("poll", handoff))
|
|
23
|
+
return {"status": "approved", "session": SESSION} if handoff == "H1" else {"status": "pending"}
|
|
24
|
+
|
|
25
|
+
monkeypatch.setattr(login.api, "device_start", start)
|
|
26
|
+
monkeypatch.setattr(login.api, "device_poll", poll)
|
|
27
|
+
monkeypatch.setattr(login.api, "gateway_token", lambda: None)
|
|
28
|
+
monkeypatch.setattr(config, "save_session", lambda s: calls.append(("saved", s.access_token)))
|
|
29
|
+
monkeypatch.setattr(config, "api_url", lambda: "https://agents.example")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _get(port: int, path: str) -> http.client.HTTPResponse:
|
|
33
|
+
c = http.client.HTTPConnection("127.0.0.1", port, timeout=5) # no redirect following, unlike urllib
|
|
34
|
+
c.request("GET", path)
|
|
35
|
+
return c.getresponse()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_the_browser_hands_off_to_this_machine_and_no_code_is_shown(monkeypatch, capsys):
|
|
39
|
+
calls: list = []
|
|
40
|
+
_fake_server(monkeypatch, calls)
|
|
41
|
+
seen = {}
|
|
42
|
+
|
|
43
|
+
def browser(url): # what the page does after Google: back to 127.0.0.1 with the state and the hand-off
|
|
44
|
+
q = parse_qs(urlsplit(url).query)
|
|
45
|
+
port, state = int(q["port"][0]), q["state"][0]
|
|
46
|
+
seen["wrong"] = _get(port, "/callback?state=nope&handoff=H1").status
|
|
47
|
+
r = _get(port, f"/callback?state={state}&handoff=H1")
|
|
48
|
+
seen["ok"], seen["to"] = r.status, r.getheader("Location")
|
|
49
|
+
|
|
50
|
+
monkeypatch.setattr(login.webbrowser, "open", browser)
|
|
51
|
+
login.login_command(no_browser=False)
|
|
52
|
+
|
|
53
|
+
assert calls[0] == ("start", True)
|
|
54
|
+
assert seen == {"wrong": 404, "ok": 302, "to": "https://agents.example/cli-login?signed_in=1"}
|
|
55
|
+
assert ("poll", "H1") in calls and ("saved", "a") in calls
|
|
56
|
+
assert "this code" not in capsys.readouterr().out # nothing to compare
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def test_no_browser_keeps_the_code_flow_and_opens_nothing(monkeypatch, capsys):
|
|
60
|
+
calls: list = []
|
|
61
|
+
_fake_server(monkeypatch, calls)
|
|
62
|
+
monkeypatch.setattr(login.api, "device_poll", lambda code, handoff=None: {"status": "approved", "session": SESSION})
|
|
63
|
+
opened = []
|
|
64
|
+
monkeypatch.setattr(login.webbrowser, "open", opened.append)
|
|
65
|
+
|
|
66
|
+
login.login_command(no_browser=True)
|
|
67
|
+
|
|
68
|
+
assert calls[0] == ("start", False) and opened == []
|
|
69
|
+
out = capsys.readouterr().out
|
|
70
|
+
assert "Check it shows this code" in out and "ABCD-EFGH" in out
|