getstack 0.5.0__tar.gz → 0.5.1__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 (28) hide show
  1. {getstack-0.5.0 → getstack-0.5.1}/PKG-INFO +1 -1
  2. {getstack-0.5.0 → getstack-0.5.1}/pyproject.toml +1 -1
  3. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/intents.py +22 -12
  4. {getstack-0.5.0 → getstack-0.5.1}/.gitignore +0 -0
  5. {getstack-0.5.0 → getstack-0.5.1}/CLAUDE.md +0 -0
  6. {getstack-0.5.0 → getstack-0.5.1}/LICENSE +0 -0
  7. {getstack-0.5.0 → getstack-0.5.1}/README.md +0 -0
  8. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/__init__.py +0 -0
  9. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/agent_auth.py +0 -0
  10. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/agents.py +0 -0
  11. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/audit.py +0 -0
  12. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/auth.py +0 -0
  13. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/browser_bootstrap.py +0 -0
  14. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/client.py +0 -0
  15. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/credentials.py +0 -0
  16. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/dropoffs.py +0 -0
  17. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/errors.py +0 -0
  18. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/identity.py +0 -0
  19. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/notifications.py +0 -0
  20. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/passports.py +0 -0
  21. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/proxy.py +0 -0
  22. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/py.typed +0 -0
  23. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/reviews.py +0 -0
  24. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/scan.py +0 -0
  25. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/security_events.py +0 -0
  26. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/services.py +0 -0
  27. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/skills.py +0 -0
  28. {getstack-0.5.0 → getstack-0.5.1}/src/getstack/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: getstack
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: Python SDK for STACK — trust infrastructure for AI agents
5
5
  Project-URL: Homepage, https://getstack.run
6
6
  Project-URL: Documentation, https://getstack.run/docs/sdk
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "getstack"
7
- version = "0.5.0"
7
+ version = "0.5.1"
8
8
  description = "Python SDK for STACK — trust infrastructure for AI agents"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -108,14 +108,16 @@ class IntentsService:
108
108
  timeout_seconds: float = 60.0,
109
109
  poll_interval_seconds: float = 1.0,
110
110
  ) -> dict[str, Any]:
111
- """Submit then poll the pending list until the row leaves
112
- 'pending' or the timeout elapses.
111
+ """Submit then poll the per-id endpoint until the row reaches a
112
+ terminal status (approved | rejected | expired) or the timeout
113
+ elapses.
113
114
 
114
115
  Returns:
115
116
  Dict with keys 'initial' (the submit response),
116
117
  'final' (the last known row state), and 'timed_out' (bool).
117
- When the row disappears from the pending list before timeout,
118
- it has been decided; 'timed_out' is False.
118
+ When the row reaches a terminal status before timeout,
119
+ 'timed_out' is False and 'final["status"]' is one of
120
+ approved | rejected | expired.
119
121
  """
120
122
  initial = self.submit(
121
123
  intent,
@@ -126,15 +128,14 @@ class IntentsService:
126
128
  approval_id = initial["approval_id"]
127
129
  deadline = time.monotonic() + timeout_seconds
128
130
  last_row: dict[str, Any] | None = None
131
+ # Use GET /v1/intents/:id rather than list_pending so we can
132
+ # read the actual terminal status — list_pending alone can't
133
+ # distinguish 'no longer pending' from 'approved'.
129
134
  while time.monotonic() < deadline:
130
- response = self.list_pending()
131
- items = response.get("items", [])
132
- match = next((r for r in items if r.get("id") == approval_id), None)
133
- if match is None:
134
- # Row left the pending queue → terminal state.
135
- final = last_row or {"id": approval_id, "status": "approved"}
136
- return {"initial": initial, "final": final, "timed_out": False}
137
- last_row = match
135
+ row = self.get(approval_id)
136
+ last_row = row
137
+ if row.get("status") != "pending":
138
+ return {"initial": initial, "final": row, "timed_out": False}
138
139
  time.sleep(poll_interval_seconds)
139
140
  return {
140
141
  "initial": initial,
@@ -142,6 +143,15 @@ class IntentsService:
142
143
  "timed_out": True,
143
144
  }
144
145
 
146
+ def get(self, approval_id: str) -> dict[str, Any]:
147
+ """Fetch a single approval row by id, regardless of status.
148
+
149
+ Returns the full row when the calling operator owns it. Raises
150
+ the SDK's standard 404 error when the row doesn't exist or
151
+ belongs to a different operator (cross-tenant existence hidden).
152
+ """
153
+ return self._client.request("GET", f"/v1/intents/{approval_id}")
154
+
145
155
  def list_pending(
146
156
  self,
147
157
  *,
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