ctx-sdk 2.0.1__tar.gz → 2.0.2__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.
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/PKG-INFO +1 -1
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/pyproject.toml +1 -1
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/dynamic_models.py +6 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/model_fetcher.py +4 -1
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/dynamic.py +16 -18
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/providers/anthropic_sdk.py +5 -1
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/providers/openai_sdk.py +2 -2
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/version.py +1 -1
- ctx_sdk-2.0.2/tests/test_api_key_resolution.py +106 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/tests/test_model_cache_fallback.py +13 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/.gitignore +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/CHANGELOG.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agent_runner.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agents/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agents/activate.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agents/api.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agents/discovery.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agents/loader.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agents/registry.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/agents/schema.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/async_utils.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/background.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/commands.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/compaction_check.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/context/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/context/_xml.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/context/agent_mds.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/context/git.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/context/loader.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/context/skills.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/context_governance.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/dispatcher.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/hooks/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/hooks/agent_hook.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/hooks/bridge.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/hooks/loader.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/hooks/registry.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/hooks/runtime.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/hooks/types.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/inbox.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/loop.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/prompts/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/prompts/builder.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/prompts/env.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/prompts/registry.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/prompts/tooling.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/revert.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/runtime.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/_version.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/agent.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/approvals.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/guardrails/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/guardrails/types.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/handoffs.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/items.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/items_base.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/permissions.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/results.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/run_config.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/runner.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/sessions.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/skills.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/sdk/tools.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/session.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/skills.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/skills_refresh.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/snapshot.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/tools/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/tools/base.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/tools/schema.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/tools/schema_tool.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/tools_manager.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/agent/turn.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/_httpcore_patch.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/base.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/context_length.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/models.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/cline.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/codex.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/copilot.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/deepai.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/devin/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/devin/descriptors.pb +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/devin/proto.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/freepi.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/oauth/junie.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/phase_parser.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/provider.yaml +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/provider_catalog.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/provider_hooks.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/providers/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/providers/mock.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/providers/openai_responses_sdk.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/providers/sanitize.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/py.typed +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/rate_limit.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/sdk/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/sdk/_sse.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/sdk/anthropic.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/sdk/base.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/sdk/openai.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/sdk/openai_responses.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/streaming_json.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/thinking.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/ai/tool_parser.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/bytes_util.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/compaction.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/config.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/defaults/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/defaults/config.yml +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/events.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/handoff.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/harness_config.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/image.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/notify.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/paths.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/permissions.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/py.typed +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/recap.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/scratchpad.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/session_retention.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/sounds/completion.wav +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/sounds/error.wav +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/sounds/permission.wav +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/store.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/themes.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/core/token_usage.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/git/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/git/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/git/gh_app.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/git/gh_cli.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/git/git_branch.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/bootstrap.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/commands.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/hooks.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/agent_instances.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/agent_loop.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/agents.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/compaction.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/llm.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/permissions.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/projections.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/prompts.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/sessions.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/skills.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/telemetry.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/tool_executor.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/tools.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/services/turn_engine.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/tools/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/tools/_register.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/builtins/ui.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/bus.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/context.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/errors.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/event_contract.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/events.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/host.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/install.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/loader.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/plugin.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/profile.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/plugins/services.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/protocol/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/protocol/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/protocol/abc.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/protocol/errors.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/protocol/types.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/sdk/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/telemetry/README.md +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/telemetry/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/telemetry/exporters/__init__.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/telemetry/exporters/console.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/telemetry/exporters/jsonl.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/telemetry/processor.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/src/ctx/telemetry/tracing_impl.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/tests/test_plugin_install.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/tests/test_switch_model_closes_provider.py +0 -0
- {ctx_sdk-2.0.1 → ctx_sdk-2.0.2}/tests/test_turn_stream_stall.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: ctx-sdk
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: Minimalist agent harness: agent loop, sessions, tools, plugin composition, 67 LLM providers, and a Python SDK. The coding agent CLI/TUI is a separate package (ctx-agent) built on top.
|
|
5
5
|
Author: OEvortex
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -20,7 +20,7 @@ artifacts = []
|
|
|
20
20
|
|
|
21
21
|
[project]
|
|
22
22
|
name = "ctx-sdk"
|
|
23
|
-
version = "2.0.
|
|
23
|
+
version = "2.0.2"
|
|
24
24
|
description = "Minimalist agent harness: agent loop, sessions, tools, plugin composition, 67 LLM providers, and a Python SDK. The coding agent CLI/TUI is a separate package (ctx-agent) built on top."
|
|
25
25
|
requires-python = ">=3.12"
|
|
26
26
|
keywords = ["agent", "harness", "llm", "agent-loop", "sdk"]
|
|
@@ -367,6 +367,12 @@ def _write_cache(catalog: CachedCatalog) -> None:
|
|
|
367
367
|
|
|
368
368
|
for memo in (_fetcher._MODELS_CACHE, _fetcher._LITE_CACHE, _fetcher._IDS_CACHE):
|
|
369
369
|
memo.pop(catalog.provider, None)
|
|
370
|
+
# Same for the whole-catalog memo in ctx.ai.models: a TTL fetch that
|
|
371
|
+
# lands here (not via an explicit refresh) must not leave it stale.
|
|
372
|
+
with contextlib.suppress(Exception):
|
|
373
|
+
from ctx.ai.models import invalidate_all_models_cache
|
|
374
|
+
|
|
375
|
+
invalidate_all_models_cache()
|
|
370
376
|
|
|
371
377
|
|
|
372
378
|
# =================================================================================================
|
|
@@ -28,7 +28,7 @@ from dataclasses import asdict, dataclass
|
|
|
28
28
|
from pathlib import Path
|
|
29
29
|
from typing import Any
|
|
30
30
|
|
|
31
|
-
from ctx.ai.models import ApiType, Model
|
|
31
|
+
from ctx.ai.models import ApiType, Model, invalidate_all_models_cache
|
|
32
32
|
|
|
33
33
|
logger = logging.getLogger(__name__)
|
|
34
34
|
|
|
@@ -162,6 +162,9 @@ def _write_cache(provider_slug: str, models: list[FetchedModel], cooldown_minute
|
|
|
162
162
|
_MODELS_CACHE.pop(provider_slug, None)
|
|
163
163
|
_LITE_CACHE.pop(provider_slug, None)
|
|
164
164
|
_IDS_CACHE.pop(provider_slug, None)
|
|
165
|
+
# A fetch landing here (devin/junie/sync paths) must not leave the
|
|
166
|
+
# whole-catalog memo in ctx.ai.models serving the pre-fetch list.
|
|
167
|
+
invalidate_all_models_cache()
|
|
165
168
|
try:
|
|
166
169
|
store.put_catalog(
|
|
167
170
|
f"fetch:{provider_slug}",
|
|
@@ -30,7 +30,6 @@ from ctx.core.paths import get_config_dir
|
|
|
30
30
|
|
|
31
31
|
# Default configuration
|
|
32
32
|
AUTH_FILENAME = "dynamic_auth.json"
|
|
33
|
-
Ctx_STORAGE_DIR = Path.home() / "ctx"
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
@dataclass
|
|
@@ -49,27 +48,26 @@ class DynamicProviderStatus:
|
|
|
49
48
|
return self.has_env_key or self.has_stored_key or self.api_key_optional
|
|
50
49
|
|
|
51
50
|
|
|
51
|
+
def _legacy_yml_path() -> Path:
|
|
52
|
+
# Older installs (and the api-key-storage skill) keep keys in
|
|
53
|
+
# ~/ctx/dynamic_auth.yml, beside ~/.ctx. Computed per call so a
|
|
54
|
+
# changed $HOME is honoured, unlike an import-time constant.
|
|
55
|
+
return Path.home() / "ctx" / "dynamic_auth.yml"
|
|
56
|
+
|
|
57
|
+
|
|
52
58
|
def get_dynamic_auth_path() -> Path:
|
|
53
59
|
"""Get the path to the API key storage file.
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
to the JSON
|
|
61
|
+
Checks for a YAML key file first (config dir, then the legacy
|
|
62
|
+
``~/ctx`` location), then falls back to the JSON file in the config
|
|
63
|
+
dir. ``get_config_dir()`` already honours ``XDG_CONFIG_HOME``, so no
|
|
64
|
+
separate XDG branch is needed.
|
|
57
65
|
"""
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
# Check for JSON format in both old and new locations
|
|
64
|
-
# First check XDG_CONFIG_HOME/ctx/
|
|
65
|
-
xdg_config_dir = os.environ.get("XDG_CONFIG_HOME")
|
|
66
|
-
if xdg_config_dir:
|
|
67
|
-
xdg_path = Path(xdg_config_dir) / "ctx" / AUTH_FILENAME
|
|
68
|
-
if xdg_path.exists():
|
|
69
|
-
return xdg_path
|
|
70
|
-
|
|
71
|
-
# Then check ~/.ctx/ for backward compatibility
|
|
72
|
-
return get_config_dir() / AUTH_FILENAME
|
|
66
|
+
config_dir = get_config_dir()
|
|
67
|
+
for candidate in (config_dir / "dynamic_auth.yml", _legacy_yml_path()):
|
|
68
|
+
if candidate.exists():
|
|
69
|
+
return candidate
|
|
70
|
+
return config_dir / AUTH_FILENAME
|
|
73
71
|
|
|
74
72
|
|
|
75
73
|
def _read_all() -> dict[str, str]:
|
|
@@ -49,9 +49,13 @@ class AnthropicSDKProvider(BaseProvider):
|
|
|
49
49
|
base_url=config.base_url,
|
|
50
50
|
auth_mode=config.anthropic_compat_auth_mode,
|
|
51
51
|
)
|
|
52
|
+
if not api_key:
|
|
53
|
+
from ctx.ai.oauth.dynamic import get_dynamic_api_key
|
|
54
|
+
|
|
55
|
+
api_key = get_dynamic_api_key(config.provider or self.name)
|
|
52
56
|
if not api_key:
|
|
53
57
|
raise ValueError(
|
|
54
|
-
f"No API key found for {self.name}. "
|
|
58
|
+
f"No API key found for {config.provider or self.name}. "
|
|
55
59
|
"Set ANTHROPIC_API_KEY environment variable or pass api_key in config, "
|
|
56
60
|
'or configure llm.auth.anthropic_compat = "auto"/"none" for local endpoints.'
|
|
57
61
|
)
|
|
@@ -61,11 +61,11 @@ class OpenAISDKProvider(BaseProvider):
|
|
|
61
61
|
base_url=config.base_url,
|
|
62
62
|
auth_mode=config.openai_compat_auth_mode,
|
|
63
63
|
)
|
|
64
|
-
if not api_key
|
|
64
|
+
if not api_key:
|
|
65
65
|
api_key = self._resolve_dynamic_key_for(config)
|
|
66
66
|
if not api_key:
|
|
67
67
|
raise ValueError(
|
|
68
|
-
f"No API key found for {self.name}. "
|
|
68
|
+
f"No API key found for {config.provider or self.name}. "
|
|
69
69
|
f"Set {provider_env_var} environment variable or pass api_key in config, "
|
|
70
70
|
'or configure llm.auth.openai_compat = "auto"/"none" for local endpoints.'
|
|
71
71
|
)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""Stored API keys must be found wherever the provider config came from.
|
|
2
|
+
|
|
3
|
+
Regression: picking a kilo model raised "No API key found for openai. Set
|
|
4
|
+
KILO_API_KEY..." even with a key stored by /login, because the OpenAI-compat
|
|
5
|
+
provider only consulted the stored-key file when a base_url was set, the
|
|
6
|
+
Anthropic provider never consulted it at all, and the error named the
|
|
7
|
+
provider class instead of the selected provider.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import pytest
|
|
13
|
+
from ctx.ai.base import ProviderConfig
|
|
14
|
+
from ctx.ai.oauth import dynamic as dyn
|
|
15
|
+
from ctx.ai.providers.anthropic_sdk import AnthropicSDKProvider
|
|
16
|
+
from ctx.ai.providers.openai_sdk import OpenAISDKProvider
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@pytest.fixture(autouse=True)
|
|
20
|
+
def _no_env_keys(monkeypatch):
|
|
21
|
+
for var in ("KILO_API_KEY", "ANTHROPIC_API_KEY", "OPENAI_API_KEY"):
|
|
22
|
+
monkeypatch.delenv(var, raising=False)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _stored(monkeypatch, key: str | None):
|
|
26
|
+
monkeypatch.setattr(dyn, "get_dynamic_api_key", lambda slug: key)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class TestOpenAICompat:
|
|
30
|
+
def test_stored_key_used_without_base_url(self, monkeypatch):
|
|
31
|
+
_stored(monkeypatch, "stored-key")
|
|
32
|
+
provider = OpenAISDKProvider(
|
|
33
|
+
ProviderConfig(
|
|
34
|
+
api_key=None,
|
|
35
|
+
provider="kilo",
|
|
36
|
+
model="m",
|
|
37
|
+
base_url=None,
|
|
38
|
+
openai_compat_auth_mode="required",
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
assert provider is not None
|
|
42
|
+
|
|
43
|
+
def test_error_names_the_selected_provider(self, monkeypatch):
|
|
44
|
+
_stored(monkeypatch, None)
|
|
45
|
+
with pytest.raises(ValueError) as excinfo:
|
|
46
|
+
OpenAISDKProvider(
|
|
47
|
+
ProviderConfig(
|
|
48
|
+
api_key=None,
|
|
49
|
+
provider="kilo",
|
|
50
|
+
model="m",
|
|
51
|
+
base_url="https://api.kilo.ai/api/gateway",
|
|
52
|
+
openai_compat_auth_mode="required",
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
message = str(excinfo.value)
|
|
56
|
+
assert "for kilo." in message
|
|
57
|
+
assert "KILO_API_KEY" in message
|
|
58
|
+
assert "for openai" not in message
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class TestAnthropic:
|
|
62
|
+
def test_stored_key_used_when_env_missing(self, monkeypatch):
|
|
63
|
+
_stored(monkeypatch, "stored-key")
|
|
64
|
+
provider = AnthropicSDKProvider(
|
|
65
|
+
ProviderConfig(
|
|
66
|
+
api_key=None,
|
|
67
|
+
provider="anthropic",
|
|
68
|
+
model="m",
|
|
69
|
+
base_url="https://api.anthropic.com",
|
|
70
|
+
anthropic_compat_auth_mode="required",
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
assert provider is not None
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class TestAuthPath:
|
|
77
|
+
def test_defaults_to_config_dir_json(self, monkeypatch, tmp_path):
|
|
78
|
+
cfg = tmp_path / "cfg"
|
|
79
|
+
monkeypatch.setattr(dyn, "get_config_dir", lambda: cfg)
|
|
80
|
+
monkeypatch.setattr(dyn, "_legacy_yml_path", lambda: tmp_path / "nope.yml")
|
|
81
|
+
assert dyn.get_dynamic_auth_path() == cfg / "dynamic_auth.json"
|
|
82
|
+
|
|
83
|
+
def test_config_dir_yml_wins(self, monkeypatch, tmp_path):
|
|
84
|
+
cfg = tmp_path / "cfg"
|
|
85
|
+
cfg.mkdir()
|
|
86
|
+
(cfg / "dynamic_auth.yml").write_text("kilo: x\n")
|
|
87
|
+
monkeypatch.setattr(dyn, "get_config_dir", lambda: cfg)
|
|
88
|
+
monkeypatch.setattr(dyn, "_legacy_yml_path", lambda: tmp_path / "nope.yml")
|
|
89
|
+
assert dyn.get_dynamic_auth_path() == cfg / "dynamic_auth.yml"
|
|
90
|
+
|
|
91
|
+
def test_legacy_yml_used_when_only_it_exists(self, monkeypatch, tmp_path):
|
|
92
|
+
cfg = tmp_path / "cfg"
|
|
93
|
+
legacy = tmp_path / "home" / "ctx" / "dynamic_auth.yml"
|
|
94
|
+
legacy.parent.mkdir(parents=True)
|
|
95
|
+
legacy.write_text("kilo: x\n")
|
|
96
|
+
monkeypatch.setattr(dyn, "get_config_dir", lambda: cfg)
|
|
97
|
+
monkeypatch.setattr(dyn, "_legacy_yml_path", lambda: legacy)
|
|
98
|
+
assert dyn.get_dynamic_auth_path() == legacy
|
|
99
|
+
|
|
100
|
+
def test_save_load_roundtrip_in_config_dir(self, monkeypatch, tmp_path):
|
|
101
|
+
cfg = tmp_path / "cfg"
|
|
102
|
+
monkeypatch.setattr(dyn, "get_config_dir", lambda: cfg)
|
|
103
|
+
monkeypatch.setattr(dyn, "_legacy_yml_path", lambda: tmp_path / "nope.yml")
|
|
104
|
+
dyn.save_api_key("kilo", "secret-key")
|
|
105
|
+
assert dyn.load_api_key("kilo") == "secret-key"
|
|
106
|
+
assert (cfg / "dynamic_auth.json").exists()
|
|
@@ -14,6 +14,7 @@ import time
|
|
|
14
14
|
|
|
15
15
|
import pytest
|
|
16
16
|
from ctx.ai import dynamic_models, model_fetcher
|
|
17
|
+
from ctx.ai import models as models_mod
|
|
17
18
|
from ctx.ai.model_fetcher import get_fetched_models
|
|
18
19
|
from ctx.ai.provider_catalog import get as get_provider
|
|
19
20
|
from ctx.ai.provider_catalog import get_catalog_models_for
|
|
@@ -63,3 +64,15 @@ class TestDynamicFallback:
|
|
|
63
64
|
assert get_fetched_models(provider, enrich=False) == []
|
|
64
65
|
_dynamic_write()
|
|
65
66
|
assert [m.id for m in get_fetched_models(provider, enrich=False)] == ["kilo-model"]
|
|
67
|
+
|
|
68
|
+
def test_writes_invalidate_all_models_memo(self, fake_store, monkeypatch):
|
|
69
|
+
sentinel = []
|
|
70
|
+
monkeypatch.setattr(models_mod, "_ALL_MODELS_CACHE", sentinel)
|
|
71
|
+
monkeypatch.setattr(models_mod, "_ALL_MODELS_LITE_CACHE", sentinel)
|
|
72
|
+
_dynamic_write()
|
|
73
|
+
assert models_mod._ALL_MODELS_CACHE is None
|
|
74
|
+
assert models_mod._ALL_MODELS_LITE_CACHE is None
|
|
75
|
+
|
|
76
|
+
monkeypatch.setattr(models_mod, "_ALL_MODELS_CACHE", sentinel)
|
|
77
|
+
model_fetcher._write_cache("kilo", [], 60)
|
|
78
|
+
assert models_mod._ALL_MODELS_CACHE is None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|