stackresolve 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ node_modules/
2
+ node_modules
3
+ .next/
4
+ .env*
5
+ !.env.example
6
+ .DS_Store
7
+ *.log
8
+ /.claude/worktrees/
9
+
10
+ # prior-work semantic vector cache (machine-local)
11
+ .claude/cache/
12
+
13
+ # playwright e2e artifacts
14
+ test-results/
15
+ playwright-report/
16
+ blob-report/
17
+ playwright/.cache/
18
+ **/e2e/.auth/
19
+
20
+ # SEO submit run logs (per-run audit trail, written by scripts/seo/*)
21
+ scripts/seo/index-submit-log.tsv
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: stackresolve
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Official Python SDK for the StackResolve API (AgentReady + CompanyData).
5
5
  Project-URL: Homepage, https://stackresolve.dev
6
6
  Author: StackResolve
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "stackresolve"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  description = "Official Python SDK for the StackResolve API (AgentReady + CompanyData)."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -2,5 +2,5 @@
2
2
 
3
3
  from .client import StackResolve, StackResolveError
4
4
 
5
- __version__ = "0.1.0"
5
+ __version__ = "0.2.0"
6
6
  __all__ = ["StackResolve", "StackResolveError", "__version__"]
@@ -41,6 +41,11 @@ class StackResolve:
41
41
  base_url: Base URL override. Falls back to STACKRESOLVE_BASE_URL,
42
42
  then https://api.stackresolve.dev .
43
43
  timeout: Per-request timeout in seconds (default 60).
44
+ integration: Identifies the caller in the User-Agent, e.g.
45
+ "langchain-stackresolve/0.1.0". Framework adapters set this so a call
46
+ through an adapter is distinguishable from a raw SDK call. Without it
47
+ every caller looks identical to the API and we cannot tell which
48
+ distribution surface is working.
44
49
  """
45
50
 
46
51
  def __init__(
@@ -48,15 +53,31 @@ class StackResolve:
48
53
  api_key: Optional[str] = None,
49
54
  base_url: Optional[str] = None,
50
55
  timeout: float = 60.0,
56
+ integration: Optional[str] = None,
51
57
  ) -> None:
52
58
  self.api_key = api_key or os.environ.get("STACKRESOLVE_API_KEY")
53
59
  base = base_url or os.environ.get("STACKRESOLVE_BASE_URL") or DEFAULT_BASE_URL
54
60
  self.base_url = base.rstrip("/")
55
- headers = {"accept": "application/json"}
61
+ self.integration = integration or os.environ.get("STACKRESOLVE_INTEGRATION")
62
+ headers = {"accept": "application/json", "user-agent": self._user_agent()}
56
63
  if self.api_key:
57
64
  headers["x-api-key"] = self.api_key
58
65
  self._client = httpx.Client(base_url=self.base_url, headers=headers, timeout=timeout)
59
66
 
67
+ def _user_agent(self) -> str:
68
+ """Identify the SDK, and the adapter on top of it when there is one."""
69
+ from . import __version__
70
+
71
+ ua = f"stackresolve-python/{__version__}"
72
+ # Keep it to the printable subset a header allows; a label is a package
73
+ # name, never user input, but the SDK should not be the thing that
74
+ # produces an invalid header.
75
+ if self.integration:
76
+ safe = "".join(c for c in self.integration if c.isprintable() and c not in '\r\n')[:80]
77
+ if safe:
78
+ ua += f" ({safe})"
79
+ return ua
80
+
60
81
  # ---- context manager + cleanup ----
61
82
 
62
83
  def close(self) -> None:
@@ -1,10 +0,0 @@
1
- node_modules/
2
- .next/
3
- .env*
4
- !.env.example
5
- .DS_Store
6
- *.log
7
- /.claude/worktrees/
8
-
9
- # prior-work semantic vector cache (machine-local)
10
- .claude/cache/
File without changes