stacklink-sdk 0.2.0__tar.gz → 0.2.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.
Files changed (44) hide show
  1. {stacklink_sdk-0.2.0/stacklink_sdk.egg-info → stacklink_sdk-0.2.2}/PKG-INFO +15 -2
  2. stacklink_sdk-0.2.2/README.md +65 -0
  3. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/pyproject.toml +2 -2
  4. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/__init__.py +10 -1
  5. stacklink_sdk-0.2.2/stacklink/client.py +890 -0
  6. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/connected_accounts.py +2 -3
  7. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/executions.py +23 -1
  8. stacklink_sdk-0.2.2/stacklink/mcp.py +112 -0
  9. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/memory.py +9 -2
  10. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/openai_memory.py +240 -41
  11. stacklink_sdk-0.2.2/stacklink/providers.py +25 -0
  12. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/sessions.py +104 -22
  13. stacklink_sdk-0.2.2/stacklink/tools.py +40 -0
  14. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/types.py +56 -0
  15. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/workbench.py +36 -37
  16. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2/stacklink_sdk.egg-info}/PKG-INFO +15 -2
  17. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink_sdk.egg-info/SOURCES.txt +1 -0
  18. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink_sdk.egg-info/requires.txt +1 -0
  19. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/tests/test_client.py +374 -162
  20. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/tests/test_google_docs_provider.py +6 -4
  21. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/tests/test_google_drive_provider.py +6 -4
  22. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/tests/test_google_sheets_provider.py +6 -4
  23. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/tests/test_openai_memory.py +88 -1
  24. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/tests/test_zoho_books_provider.py +6 -4
  25. stacklink_sdk-0.2.0/README.md +0 -53
  26. stacklink_sdk-0.2.0/stacklink/client.py +0 -292
  27. stacklink_sdk-0.2.0/stacklink/mcp.py +0 -76
  28. stacklink_sdk-0.2.0/stacklink/tools.py +0 -144
  29. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/LICENSE +0 -0
  30. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/setup.cfg +0 -0
  31. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/api_keys.py +0 -0
  32. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/artifacts.py +0 -0
  33. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/auth_configs.py +0 -0
  34. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/billing.py +0 -0
  35. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/claude_agent.py +0 -0
  36. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/errors.py +0 -0
  37. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/knowledge.py +0 -0
  38. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/logs.py +0 -0
  39. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/openai_agents.py +0 -0
  40. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/projects.py +0 -0
  41. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/triggers.py +0 -0
  42. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink/webhooks.py +0 -0
  43. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink_sdk.egg-info/dependency_links.txt +0 -0
  44. {stacklink_sdk-0.2.0 → stacklink_sdk-0.2.2}/stacklink_sdk.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stacklink-sdk
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python SDK for Stacklink sessions, tools, MCP, auth, workbench, logs, knowledge, and billing.
5
5
  Author: Stacklink
6
6
  License-Expression: LicenseRef-Proprietary
@@ -8,6 +8,7 @@ Project-URL: Documentation, https://docs.stacklink.in/docs/quickstart
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
+ Requires-Dist: httpx[http2]<1,>=0.27
11
12
  Provides-Extra: openai
12
13
  Requires-Dist: openai<3,>=2.0; extra == "openai"
13
14
  Provides-Extra: openai-agents
@@ -54,7 +55,7 @@ stacklink = Stacklink(
54
55
  session = stacklink.sessions.create_bound({
55
56
  'externalTenantId': 'acme',
56
57
  'externalUserId': 'user_123',
57
- 'metaTools': {'surface': 'connector'},
58
+ 'modelSurface': {'mode': 'router'},
58
59
  })
59
60
 
60
61
  try:
@@ -69,3 +70,15 @@ The complete OpenAI Agents and Claude Agent examples shown by the Stacklink Over
69
70
  The raw OpenAI `with_stacklink_memory` helper remains a separate Memory integration. It is not the agent-tool integration and is not part of basic Overview onboarding.
70
71
 
71
72
  Environment variables are `STACKLINK_API_KEY`, optional `STACKLINK_BASE_URL`, and the model-provider credentials required by the selected harness. The SDK is proprietary and is provided under the applicable Stacklink agreement.
73
+
74
+ ## Accepted operations, approvals and retries
75
+
76
+ An execution response can be pending. Keep its `executionKind`, `executionId`, session ID and retry key in your application. Read or wait for that operation using the existing execution APIs. A lost connection does not submit a second action, and closing the application session can remove the authority required to execute pending work.
77
+
78
+ Retry keys are case-sensitive and accept up to 240 characters. Tool and batch requests have separate key namespaces. Reuse a key only for the exact same request in the same SDK session. Changed inputs return `409 idempotency_key_reused`; an expired stored result returns `410 execution_result_expired`. Neither response authorizes submitting the write again.
79
+
80
+ For `waiting_for_approval`, your backend can use the session approval read, approve and deny APIs with `platform_approvals:read` / `platform_approvals:manage` scopes. Keep the API key on your backend. A pending action must not be labelled completed. `provider_execution_result_unknown` means an external write may have happened; inspect the provider before considering another action.
81
+
82
+ Use execution cancellation for an explicit Stop request. Losing a stream only stops observation. Vercel and LangChain adapters forward their supported abort signal; other adapters keep the structured operation identity available for explicit cancellation. MCP progress reports actual stages, not invented percentages.
83
+
84
+ Streaming has a total observation deadline and a separate inactivity timeout. A timeout raises `sdk_stream_timeout` without repeating the action; use its original operation ID to resume observation. Stream responses are limited to 8 MiB, including JSON responses to streaming requests. The synchronous client keeps blocking reads in a bounded reader and releases the response when that read finishes or reaches its inactivity timeout. Custom transports must honor the timeout passed to them. MCP calls return once all matching responses arrive, even if the server keeps the stream open.
@@ -0,0 +1,65 @@
1
+ # Stacklink Python SDK
2
+
3
+ Stacklink supplies executable, governed tools to an agent harness. The selected harness owns the model call, tool loop, and final answer.
4
+
5
+ Install the public package with the harness extra you use:
6
+
7
+ ```bash
8
+ uv add 'stacklink-sdk[openai-agents]'
9
+ ```
10
+
11
+ or:
12
+
13
+ ```bash
14
+ uv add 'stacklink-sdk[claude-agent]'
15
+ ```
16
+
17
+ The complete guides and certified recipes live at [docs.stacklink.in](https://docs.stacklink.in/docs/quickstart). PyPI is the package delivery system, not the primary documentation surface. Stacklink does not display registry download badges in its product or documentation.
18
+
19
+ ## Certified agent harnesses
20
+
21
+ | Harness | Stacklink adapter |
22
+ |---|---|
23
+ | OpenAI Agents SDK | `create_stacklink_openai_agents_tools(session)` |
24
+ | Claude Agent SDK | `create_stacklink_claude_agent_tool_config(session)` |
25
+
26
+ Both start with one explicit Stacklink session:
27
+
28
+ ```python
29
+ import os
30
+ from stacklink import Stacklink
31
+
32
+ stacklink = Stacklink(
33
+ api_key=os.environ['STACKLINK_API_KEY'],
34
+ base_url=os.getenv('STACKLINK_BASE_URL', 'https://api.stacklink.in'),
35
+ )
36
+ session = stacklink.sessions.create_bound({
37
+ 'externalTenantId': 'acme',
38
+ 'externalUserId': 'user_123',
39
+ 'modelSurface': {'mode': 'router'},
40
+ })
41
+
42
+ try:
43
+ # Pass the selected Stacklink adapter output to your agent harness.
44
+ pass
45
+ finally:
46
+ session.close()
47
+ ```
48
+
49
+ The complete OpenAI Agents and Claude Agent examples shown by the Stacklink Overview are generated from the executable files under `examples/sdk/`. The dashboard, documentation, and certification tests all read those same files.
50
+
51
+ The raw OpenAI `with_stacklink_memory` helper remains a separate Memory integration. It is not the agent-tool integration and is not part of basic Overview onboarding.
52
+
53
+ Environment variables are `STACKLINK_API_KEY`, optional `STACKLINK_BASE_URL`, and the model-provider credentials required by the selected harness. The SDK is proprietary and is provided under the applicable Stacklink agreement.
54
+
55
+ ## Accepted operations, approvals and retries
56
+
57
+ An execution response can be pending. Keep its `executionKind`, `executionId`, session ID and retry key in your application. Read or wait for that operation using the existing execution APIs. A lost connection does not submit a second action, and closing the application session can remove the authority required to execute pending work.
58
+
59
+ Retry keys are case-sensitive and accept up to 240 characters. Tool and batch requests have separate key namespaces. Reuse a key only for the exact same request in the same SDK session. Changed inputs return `409 idempotency_key_reused`; an expired stored result returns `410 execution_result_expired`. Neither response authorizes submitting the write again.
60
+
61
+ For `waiting_for_approval`, your backend can use the session approval read, approve and deny APIs with `platform_approvals:read` / `platform_approvals:manage` scopes. Keep the API key on your backend. A pending action must not be labelled completed. `provider_execution_result_unknown` means an external write may have happened; inspect the provider before considering another action.
62
+
63
+ Use execution cancellation for an explicit Stop request. Losing a stream only stops observation. Vercel and LangChain adapters forward their supported abort signal; other adapters keep the structured operation identity available for explicit cancellation. MCP progress reports actual stages, not invented percentages.
64
+
65
+ Streaming has a total observation deadline and a separate inactivity timeout. A timeout raises `sdk_stream_timeout` without repeating the action; use its original operation ID to resume observation. Stream responses are limited to 8 MiB, including JSON responses to streaming requests. The synchronous client keeps blocking reads in a bounded reader and releases the response when that read finishes or reaches its inactivity timeout. Custom transports must honor the timeout passed to them. MCP calls return once all matching responses arrive, even if the server keeps the stream open.
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "stacklink-sdk"
7
- version = "0.2.0"
7
+ version = "0.2.2"
8
8
  description = "Python SDK for Stacklink sessions, tools, MCP, auth, workbench, logs, knowledge, and billing."
9
9
  readme = "README.md"
10
10
  license = "LicenseRef-Proprietary"
11
11
  license-files = ["LICENSE"]
12
12
  requires-python = ">=3.10"
13
13
  authors = [{ name = "Stacklink" }]
14
- dependencies = []
14
+ dependencies = ["httpx[http2]>=0.27,<1"]
15
15
 
16
16
  [project.urls]
17
17
  Documentation = "https://docs.stacklink.in/docs/quickstart"
@@ -1,12 +1,16 @@
1
1
  from __future__ import annotations
2
2
 
3
- from .client import STACKLINK_PYTHON_SDK_VERSION, Stacklink
3
+ from .client import AsyncStacklink, STACKLINK_PYTHON_SDK_VERSION, Stacklink
4
4
  from .claude_agent import create_stacklink_claude_agent_tool_config
5
5
  from .errors import RateLimitError, StacklinkError
6
6
  from .openai_agents import create_stacklink_openai_agents_tools
7
7
  from .openai_memory import StacklinkMemoryLifecycleError, with_stacklink_memory
8
8
  from .types import (
9
9
  ProjectProvider,
10
+ ProviderCatalogItem,
11
+ ProviderCatalogPage,
12
+ ProviderToolCatalogItem,
13
+ ProviderToolCatalogPage,
10
14
  ProviderMarketplaceMetadata,
11
15
  ProviderProfile,
12
16
  ProviderProfileCapabilityGroup,
@@ -21,6 +25,7 @@ from .types import (
21
25
 
22
26
  __all__ = [
23
27
  "Stacklink",
28
+ "AsyncStacklink",
24
29
  "STACKLINK_PYTHON_SDK_VERSION",
25
30
  "StacklinkError",
26
31
  "RateLimitError",
@@ -29,6 +34,10 @@ __all__ = [
29
34
  "create_stacklink_openai_agents_tools",
30
35
  "create_stacklink_claude_agent_tool_config",
31
36
  "ProjectProvider",
37
+ "ProviderCatalogItem",
38
+ "ProviderCatalogPage",
39
+ "ProviderToolCatalogItem",
40
+ "ProviderToolCatalogPage",
32
41
  "ProviderMarketplaceMetadata",
33
42
  "ProviderProfile",
34
43
  "ProviderProfileCapabilityGroup",