getstack 3.0.0__py3-none-any.whl → 4.4.0__py3-none-any.whl
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.
- getstack/__init__.py +507 -173
- getstack/_async/__init__.py +1 -1
- getstack/_async/accounts.py +1081 -0
- getstack/_async/agent_identity.py +42 -0
- getstack/_async/agents.py +58 -11
- getstack/_async/audit.py +4 -4
- getstack/_async/authority.py +94 -109
- getstack/_async/billing.py +32 -0
- getstack/_async/brain.py +71 -0
- getstack/_async/calendar.py +170 -0
- getstack/_async/catalogue.py +38 -0
- getstack/_async/chat_channels.py +56 -0
- getstack/_async/control_policies.py +114 -0
- getstack/_async/control_socket.py +154 -0
- getstack/_async/credentials.py +1 -3
- getstack/_async/delivery_methods.py +39 -29
- getstack/_async/detector_config.py +9 -8
- getstack/_async/drive.py +277 -0
- getstack/_async/dropoffs.py +38 -17
- getstack/_async/evidence_packs.py +6 -8
- getstack/_async/flagged_content.py +24 -0
- getstack/_async/fleets.py +103 -30
- getstack/_async/governance.py +22 -0
- getstack/_async/identity.py +85 -21
- getstack/_async/inbound_webhooks.py +37 -13
- getstack/_async/intents.py +42 -25
- getstack/_async/llm.py +108 -22
- getstack/_async/making.py +189 -0
- getstack/_async/meetings.py +162 -0
- getstack/_async/memory.py +300 -0
- getstack/_async/message_access.py +39 -0
- getstack/_async/missions.py +85 -21
- getstack/_async/network.py +220 -0
- getstack/_async/notifications.py +14 -10
- getstack/_async/partner_accounts.py +275 -0
- getstack/_async/passport_session.py +1 -1
- getstack/_async/passports.py +64 -58
- getstack/_async/payments.py +127 -0
- getstack/_async/pii_config.py +8 -22
- getstack/_async/post.py +221 -0
- getstack/_async/proxy.py +64 -10
- getstack/_async/rentahuman.py +115 -0
- getstack/_async/reviews.py +1 -1
- getstack/_async/scan.py +10 -7
- getstack/_async/security_events.py +5 -7
- getstack/_async/services.py +116 -25
- getstack/_async/skills.py +29 -25
- getstack/_async/team.py +27 -5
- getstack/_async/trust.py +37 -0
- getstack/_async/usage.py +4 -4
- getstack/_async/wake.py +123 -0
- getstack/_async/website.py +130 -0
- getstack/_authority_request.py +1 -2
- getstack/_control_ref.py +42 -0
- getstack/_fleet_key.py +6 -3
- getstack/accounts.py +1326 -0
- getstack/agent_auth.py +55 -38
- getstack/agent_identity.py +91 -0
- getstack/agents.py +84 -15
- getstack/audit.py +10 -5
- getstack/auth.py +72 -11
- getstack/authority.py +57 -82
- getstack/billing.py +67 -0
- getstack/brain.py +138 -0
- getstack/browser_bootstrap.py +43 -30
- getstack/calendar.py +265 -0
- getstack/catalogue.py +97 -0
- getstack/chat_channels.py +77 -0
- getstack/client.py +341 -13
- getstack/control_policies.py +266 -0
- getstack/control_server.py +220 -0
- getstack/control_socket.py +259 -0
- getstack/credentials.py +0 -1
- getstack/delivery_methods.py +39 -32
- getstack/detector_config.py +19 -21
- getstack/drive.py +555 -0
- getstack/dropoffs.py +43 -16
- getstack/errors.py +498 -11
- getstack/evidence_packs.py +8 -9
- getstack/flagged_content.py +46 -0
- getstack/fleets.py +97 -30
- getstack/governance.py +48 -0
- getstack/identity.py +90 -20
- getstack/inbound_webhooks.py +36 -13
- getstack/intents.py +55 -38
- getstack/llm.py +143 -25
- getstack/making.py +197 -0
- getstack/meetings.py +235 -0
- getstack/memory.py +508 -0
- getstack/message_access.py +65 -0
- getstack/missions.py +125 -28
- getstack/network.py +322 -0
- getstack/network_install.py +233 -0
- getstack/network_keys.py +137 -0
- getstack/notifications.py +13 -9
- getstack/partner_accounts.py +272 -0
- getstack/passport_header_verify.py +4 -7
- getstack/passport_session.py +1 -1
- getstack/passports.py +78 -58
- getstack/payments.py +163 -0
- getstack/pii_config.py +9 -28
- getstack/post.py +312 -0
- getstack/proxy.py +90 -22
- getstack/rentahuman.py +177 -0
- getstack/reviews.py +11 -10
- getstack/scan.py +13 -10
- getstack/security_events.py +4 -4
- getstack/service_mcp.py +145 -0
- getstack/services.py +164 -27
- getstack/sign_claim.py +2 -9
- getstack/skills.py +27 -19
- getstack/team.py +33 -5
- getstack/trust.py +66 -0
- getstack/types.py +400 -7
- getstack/usage.py +7 -5
- getstack/verify_agent_identity.py +157 -0
- getstack/verify_network.py +285 -0
- getstack/verify_offline.py +7 -3
- getstack/wake.py +199 -0
- getstack/wake_webhook.py +71 -0
- getstack/wallet_key.py +195 -0
- getstack/webhook.py +214 -0
- getstack/website.py +204 -0
- getstack/x402.py +326 -0
- getstack-4.4.0.dist-info/METADATA +725 -0
- getstack-4.4.0.dist-info/RECORD +129 -0
- {getstack-3.0.0.dist-info → getstack-4.4.0.dist-info}/WHEEL +1 -1
- {getstack-3.0.0.dist-info → getstack-4.4.0.dist-info}/licenses/LICENSE +1 -1
- getstack/_async/partner_connect.py +0 -43
- getstack/_async/partner_tenants.py +0 -150
- getstack/partner_connect.py +0 -70
- getstack/partner_tenants.py +0 -177
- getstack-3.0.0.dist-info/METADATA +0 -175
- getstack-3.0.0.dist-info/RECORD +0 -74
getstack/__init__.py
CHANGED
|
@@ -46,81 +46,207 @@ from __future__ import annotations
|
|
|
46
46
|
|
|
47
47
|
import os
|
|
48
48
|
from importlib.metadata import PackageNotFoundError, version
|
|
49
|
-
from typing import Any
|
|
49
|
+
from typing import TYPE_CHECKING, Any
|
|
50
50
|
|
|
51
|
-
from .
|
|
51
|
+
from ._async.accounts import AsyncAccountsService
|
|
52
|
+
from ._async.authority import AsyncAuthorityService
|
|
53
|
+
from ._async.brain import AsyncBrainService
|
|
54
|
+
from ._async.catalogue import AsyncCatalogueService
|
|
55
|
+
from ._async.drive import AsyncDriveService
|
|
56
|
+
from ._async.fleets import AsyncFleetsService
|
|
57
|
+
from ._async.memory import AsyncMemoryService
|
|
58
|
+
from ._async.payments import AsyncPaymentsService
|
|
59
|
+
from ._async.website import AsyncWebsiteService
|
|
60
|
+
from ._authority_request import create_authority_request_id
|
|
61
|
+
from ._control_ref import scoped_stack
|
|
62
|
+
from .accounts import AccountsService
|
|
52
63
|
from .agent_auth import AgentKeypairAuth
|
|
53
|
-
from .
|
|
64
|
+
from .agent_identity import AgentIdentityService
|
|
54
65
|
from .agents import AgentService
|
|
55
|
-
from .
|
|
66
|
+
from .audit import AuditService
|
|
67
|
+
from .auth import ApiKeyAuth, CredentialsFileAuth, OAuthAuth, SessionAuth
|
|
68
|
+
from .authority import AuthorityService
|
|
69
|
+
from .billing import BillingService
|
|
70
|
+
from .brain import BrainService
|
|
71
|
+
from .calendar import CalendarService
|
|
72
|
+
from .catalogue import CatalogueService
|
|
73
|
+
from .chat_channels import ChatChannelsService
|
|
74
|
+
from .client import DEFAULT_BASE_URL, AsyncHttpClient, HttpClient
|
|
75
|
+
from .control_policies import ControlPoliciesService, ControlReviewsService
|
|
76
|
+
from .control_server import (
|
|
77
|
+
ControlSignatureError,
|
|
78
|
+
SignedControlAnswer,
|
|
79
|
+
sign_control_answer,
|
|
80
|
+
verify_control_request,
|
|
81
|
+
)
|
|
82
|
+
from .control_socket import ControlSocketService
|
|
56
83
|
from .credentials import CredentialService
|
|
57
|
-
from .
|
|
84
|
+
from .delivery_methods import DeliveryMethodService
|
|
85
|
+
from .detector_config import DetectorConfigService
|
|
86
|
+
from .drive import DriveService
|
|
58
87
|
from .dropoffs import DropoffService
|
|
59
|
-
from .
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
88
|
+
from .errors import (
|
|
89
|
+
AccountCallFailedError,
|
|
90
|
+
AccountPieceNotReadyError,
|
|
91
|
+
AgentBudgetExceededError,
|
|
92
|
+
BrowserSessionLengthRefusedError,
|
|
93
|
+
BrowserTimeUsedUpError,
|
|
94
|
+
BudgetNeedsControlsError,
|
|
95
|
+
CatalogueUnavailableError,
|
|
96
|
+
ControlDeniedError,
|
|
97
|
+
ControlLimitExceededError,
|
|
98
|
+
ControlsRequiredError,
|
|
99
|
+
DestinationNotAvailableError,
|
|
100
|
+
ForbiddenError,
|
|
101
|
+
GovernanceApprovalRequiredError,
|
|
102
|
+
GovernanceApprovalStateError,
|
|
103
|
+
MakingUnavailableError,
|
|
104
|
+
MissionEndedError,
|
|
105
|
+
ModelCostCapError,
|
|
106
|
+
NotFoundError,
|
|
107
|
+
PassportBlockedError,
|
|
108
|
+
PaymentConnectionRequiredError,
|
|
109
|
+
PlatformSubscriptionRequiredError,
|
|
110
|
+
PostalAddressNotActiveError,
|
|
111
|
+
PostRefusedError,
|
|
112
|
+
PostUnavailableError,
|
|
113
|
+
ProviderCapacityUnavailableError,
|
|
114
|
+
RecipientOptedOutError,
|
|
115
|
+
SharedMailDailyLimitError,
|
|
116
|
+
StackError,
|
|
117
|
+
StripeRequestFailedError,
|
|
118
|
+
TelegramSendRefusedError,
|
|
119
|
+
ToolPriceRefusedError,
|
|
120
|
+
ToolRunRejectedError,
|
|
121
|
+
ToolsUnavailableError,
|
|
122
|
+
UnauthorizedError,
|
|
123
|
+
UnboundedSendRuleError,
|
|
124
|
+
ValidationError,
|
|
125
|
+
WebsiteHostnameUnavailableError,
|
|
126
|
+
WebsiteLimitExceededError,
|
|
127
|
+
WebsitePublishRejectedError,
|
|
128
|
+
WebsiteSuspendedError,
|
|
129
|
+
)
|
|
130
|
+
from .evidence_packs import EvidencePacksService
|
|
131
|
+
from .flagged_content import FlaggedContentService
|
|
132
|
+
from .fleets import FleetsService
|
|
133
|
+
from .governance import GovernanceService
|
|
68
134
|
from .identity import IdentityService
|
|
69
135
|
from .inbound_webhooks import InboundWebhookService
|
|
70
|
-
from .partner_tenants import PartnerTenantsService
|
|
71
|
-
from .partner_connect import PartnerConnectService
|
|
72
|
-
from .passport_header_verify import verify_passport_header
|
|
73
|
-
from .verify_offline import verify_passport_offline
|
|
74
|
-
from .sign_claim import sign_claim_envelope
|
|
75
136
|
from .intents import IntentsService
|
|
76
|
-
from .missions import MissionsService
|
|
77
|
-
from .fleets import FleetsService
|
|
78
|
-
from ._async.fleets import AsyncFleetsService
|
|
79
|
-
from .evidence_packs import EvidencePacksService
|
|
80
137
|
from .llm import LlmService
|
|
81
|
-
from .
|
|
82
|
-
from .
|
|
83
|
-
from .
|
|
84
|
-
from .
|
|
85
|
-
from .
|
|
86
|
-
from .
|
|
138
|
+
from .meetings import MeetingsService
|
|
139
|
+
from .memory import MemoryService
|
|
140
|
+
from .message_access import MessageAccessService
|
|
141
|
+
from .missions import MissionsService
|
|
142
|
+
from .network import NetworkService
|
|
143
|
+
from .network_install import AsyncInstallClient, InstallClient
|
|
144
|
+
from .network_keys import InstallKey, install_key_thumbprint, passport_digest
|
|
145
|
+
from .notifications import NotificationService
|
|
146
|
+
from .partner_accounts import PartnerAccountsService
|
|
147
|
+
from .passport_header_verify import verify_passport_header
|
|
87
148
|
from .passport_session import PassportSession
|
|
149
|
+
from .passports import Mission, PassportService, _require_one_mission
|
|
150
|
+
from .payments import PaymentsService
|
|
151
|
+
from .pii_config import PiiConfigService
|
|
152
|
+
from .post import PostService
|
|
153
|
+
from .proxy import ProxyOperation, ProxyResponse
|
|
154
|
+
from .proxy import ProxyService as ProxySvc
|
|
155
|
+
from .rentahuman import RentAHumanService
|
|
156
|
+
from .reviews import ReviewService
|
|
157
|
+
from .scan import ScanService
|
|
158
|
+
from .security_events import SecurityEventService as SecurityEventSvc
|
|
159
|
+
from .services import ServiceService
|
|
160
|
+
from .sign_claim import sign_claim_envelope
|
|
161
|
+
from .skills import SkillService
|
|
162
|
+
from .team import TeamService
|
|
163
|
+
from .trust import TrustService
|
|
88
164
|
from .types import (
|
|
89
165
|
Agent,
|
|
90
|
-
|
|
91
|
-
|
|
166
|
+
AuthorityReference,
|
|
167
|
+
CatalogueAccountPiece,
|
|
168
|
+
CatalogueAccountView,
|
|
169
|
+
CatalogueActionBand,
|
|
170
|
+
CatalogueConnectedService,
|
|
171
|
+
CatalogueCostCap,
|
|
172
|
+
CatalogueDocument,
|
|
173
|
+
CatalogueEntry,
|
|
174
|
+
CatalogueKind,
|
|
175
|
+
CatalogueModalities,
|
|
176
|
+
CatalogueOrigin,
|
|
177
|
+
CataloguePrice,
|
|
178
|
+
CataloguePricing,
|
|
179
|
+
CatalogueProviderCost,
|
|
180
|
+
CatalogueRead,
|
|
181
|
+
CatalogueResultTrust,
|
|
182
|
+
CatalogueRun,
|
|
183
|
+
CatalogueSearchResult,
|
|
184
|
+
CatalogueSection,
|
|
92
185
|
CheckoutResult,
|
|
93
|
-
|
|
186
|
+
CheckpointResult,
|
|
187
|
+
Credential,
|
|
188
|
+
EmailAttachment,
|
|
189
|
+
EmailDriveAttachment,
|
|
190
|
+
EmailDropped,
|
|
191
|
+
EmailInlineAttachment,
|
|
192
|
+
EmailSendResult,
|
|
193
|
+
EmailSentAttachment,
|
|
194
|
+
ForwardEmailInput,
|
|
195
|
+
IdentityClaim,
|
|
196
|
+
IdentityProvider,
|
|
197
|
+
IdentitySettings,
|
|
198
|
+
MessageAttachment,
|
|
199
|
+
MessageEnvelope,
|
|
200
|
+
NotificationChannel,
|
|
201
|
+
Passport,
|
|
94
202
|
PassportReport,
|
|
203
|
+
PassportStackClaims,
|
|
204
|
+
ReplaceServiceRequirementResult,
|
|
205
|
+
ReplyEmailInput,
|
|
206
|
+
ReviewDecisionResult,
|
|
207
|
+
ReviewFlag,
|
|
95
208
|
ReviewQueue,
|
|
96
209
|
ReviewQueueItem,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
ToolCall,
|
|
210
|
+
SendEmailInput,
|
|
211
|
+
ServiceRequirement,
|
|
212
|
+
SetServiceRequirementInput,
|
|
101
213
|
Skill,
|
|
102
214
|
SkillInvocation,
|
|
103
215
|
SkillRequest,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
216
|
+
ToolCall,
|
|
217
|
+
ToolRunFile,
|
|
218
|
+
ToolRunResult,
|
|
107
219
|
VerificationSession,
|
|
108
|
-
SetServiceRequirementInput,
|
|
109
|
-
ServiceRequirement,
|
|
110
|
-
ReplaceServiceRequirementResult,
|
|
111
|
-
AuthorityReference,
|
|
112
|
-
PassportStackClaims,
|
|
113
220
|
VerifiedPassportClaims,
|
|
114
221
|
)
|
|
115
|
-
from .
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
222
|
+
from .usage import UsageService
|
|
223
|
+
from .verify_agent_identity import AgentIdentityVerificationError, verify_agent_identity
|
|
224
|
+
from .verify_network import (
|
|
225
|
+
NetworkVerificationError,
|
|
226
|
+
revocation_covers,
|
|
227
|
+
verify_countersigned_passport,
|
|
228
|
+
verify_detection_rules,
|
|
229
|
+
verify_revocation_list,
|
|
230
|
+
verify_verified_statement,
|
|
231
|
+
)
|
|
232
|
+
from .verify_offline import verify_passport_offline
|
|
233
|
+
from .wake import WakesService
|
|
234
|
+
from .wake_webhook import WakeSignatureError, verify_wake_webhook
|
|
235
|
+
from .wallet_key import (
|
|
236
|
+
AgentWalletKey,
|
|
237
|
+
WalletKeyInSandboxError,
|
|
238
|
+
WalletPaymentTarget,
|
|
239
|
+
generate_agent_wallet_key,
|
|
240
|
+
load_agent_wallet_key,
|
|
241
|
+
sign_wallet_payment,
|
|
242
|
+
wallet_payment_authorization_payload,
|
|
123
243
|
)
|
|
244
|
+
from .webhook import ReplayGuard, WebhookSignatureError, verify_webhook
|
|
245
|
+
from .website import WebsiteService, site_files
|
|
246
|
+
from .x402 import X402PaymentError, X402Result, X402Wallet, pay_x402, pay_x402_async, read_x402_ask
|
|
247
|
+
|
|
248
|
+
if TYPE_CHECKING:
|
|
249
|
+
from ._async.passport_session import AsyncPassportSession
|
|
124
250
|
|
|
125
251
|
try:
|
|
126
252
|
__version__ = version("getstack")
|
|
@@ -133,7 +259,7 @@ def _build_static_auth(
|
|
|
133
259
|
api_key: str | None,
|
|
134
260
|
base_url: str,
|
|
135
261
|
) -> ApiKeyAuth | CredentialsFileAuth:
|
|
136
|
-
"""
|
|
262
|
+
"""helper. Resolve a static-bearer auth strategy for the
|
|
137
263
|
one-time agent-enrollment dance — explicit api_key, STACK_API_KEY
|
|
138
264
|
env var, or ~/.stack/credentials.json (CLI-managed OAuth refresh).
|
|
139
265
|
"""
|
|
@@ -153,77 +279,195 @@ def _resolve_creds_or_bootstrap(base_url: str) -> CredentialsFileAuth:
|
|
|
153
279
|
"""
|
|
154
280
|
try:
|
|
155
281
|
return CredentialsFileAuth(api_base_url=base_url)
|
|
156
|
-
except RuntimeError:
|
|
282
|
+
except RuntimeError as err:
|
|
157
283
|
from .browser_bootstrap import browser_bootstrap, should_run_browser_bootstrap
|
|
284
|
+
|
|
158
285
|
if should_run_browser_bootstrap():
|
|
159
286
|
browser_bootstrap(base_url)
|
|
160
287
|
try:
|
|
161
288
|
return CredentialsFileAuth(api_base_url=base_url)
|
|
162
289
|
except RuntimeError as e:
|
|
163
290
|
raise ValueError(
|
|
164
|
-
"STACK SDK: browser bootstrap reported success but "
|
|
165
|
-
"credentials file still missing."
|
|
291
|
+
"STACK SDK: browser bootstrap reported success but credentials file still missing."
|
|
166
292
|
) from e
|
|
167
|
-
raise ValueError(
|
|
168
|
-
|
|
169
|
-
"STACK_API_KEY, or run `stack-cli auth login`."
|
|
170
|
-
)
|
|
293
|
+
raise ValueError("No STACK credentials found. Run `npx @getstackrun/cli auth login`.") from err
|
|
294
|
+
|
|
171
295
|
|
|
172
296
|
__all__ = [
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
# Types
|
|
297
|
+
"AccountCallFailedError",
|
|
298
|
+
"AccountPieceNotReadyError",
|
|
299
|
+
"AccountsService",
|
|
177
300
|
"Agent",
|
|
178
|
-
"
|
|
179
|
-
"
|
|
301
|
+
"AgentBudgetExceededError",
|
|
302
|
+
"AgentIdentityService",
|
|
303
|
+
"AgentIdentityVerificationError",
|
|
304
|
+
"AgentWalletKey",
|
|
305
|
+
"AsyncAccountsService",
|
|
306
|
+
"AsyncAuthorityService",
|
|
307
|
+
"AsyncBrainService",
|
|
308
|
+
"AsyncCatalogueService",
|
|
309
|
+
"AsyncDriveService",
|
|
310
|
+
"AsyncFleetsService",
|
|
311
|
+
"AsyncInstallClient",
|
|
312
|
+
"AsyncMemoryService",
|
|
313
|
+
"AsyncPaymentsService",
|
|
314
|
+
"AsyncStack",
|
|
315
|
+
"AsyncWebsiteService",
|
|
316
|
+
"AuthorityReference",
|
|
317
|
+
"AuthorityService",
|
|
318
|
+
"BrainService",
|
|
319
|
+
"BrowserSessionLengthRefusedError",
|
|
320
|
+
"BrowserTimeUsedUpError",
|
|
321
|
+
"BudgetNeedsControlsError",
|
|
322
|
+
"CalendarService",
|
|
323
|
+
"CatalogueAccountPiece",
|
|
324
|
+
"CatalogueAccountView",
|
|
325
|
+
"CatalogueActionBand",
|
|
326
|
+
"CatalogueConnectedService",
|
|
327
|
+
"CatalogueCostCap",
|
|
328
|
+
"CatalogueDocument",
|
|
329
|
+
"CatalogueEntry",
|
|
330
|
+
"CatalogueKind",
|
|
331
|
+
"CatalogueModalities",
|
|
332
|
+
"CatalogueOrigin",
|
|
333
|
+
"CataloguePrice",
|
|
334
|
+
"CataloguePricing",
|
|
335
|
+
"CatalogueProviderCost",
|
|
336
|
+
"CatalogueRead",
|
|
337
|
+
"CatalogueResultTrust",
|
|
338
|
+
"CatalogueRun",
|
|
339
|
+
"CatalogueSearchResult",
|
|
340
|
+
"CatalogueSection",
|
|
341
|
+
"CatalogueService",
|
|
342
|
+
"CatalogueUnavailableError",
|
|
180
343
|
"CheckoutResult",
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
344
|
+
"CheckpointResult",
|
|
345
|
+
"ControlDeniedError",
|
|
346
|
+
"ControlLimitExceededError",
|
|
347
|
+
"ControlPoliciesService",
|
|
348
|
+
"ControlReviewsService",
|
|
349
|
+
"ControlSignatureError",
|
|
350
|
+
"ControlSocketService",
|
|
351
|
+
"ControlsRequiredError",
|
|
186
352
|
"Credential",
|
|
187
|
-
"
|
|
353
|
+
"DeliveryMethodService",
|
|
354
|
+
"DestinationNotAvailableError",
|
|
355
|
+
"DetectorConfigService",
|
|
356
|
+
"DriveService",
|
|
357
|
+
"EmailAttachment",
|
|
358
|
+
"EmailDriveAttachment",
|
|
359
|
+
"EmailDropped",
|
|
360
|
+
"EmailInlineAttachment",
|
|
361
|
+
"EmailSendResult",
|
|
362
|
+
"EmailSentAttachment",
|
|
363
|
+
"FleetsService",
|
|
364
|
+
"ForbiddenError",
|
|
365
|
+
"ForwardEmailInput",
|
|
366
|
+
"GovernanceApprovalRequiredError",
|
|
367
|
+
"GovernanceApprovalStateError",
|
|
368
|
+
"IdentityClaim",
|
|
369
|
+
"IdentityProvider",
|
|
370
|
+
"IdentitySettings",
|
|
371
|
+
"InstallClient",
|
|
372
|
+
"InstallKey",
|
|
373
|
+
"MakingUnavailableError",
|
|
374
|
+
"MemoryService",
|
|
375
|
+
"MessageAccessService",
|
|
376
|
+
"MessageAttachment",
|
|
377
|
+
"MessageEnvelope",
|
|
188
378
|
"Mission",
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
379
|
+
"MissionEndedError",
|
|
380
|
+
"ModelCostCapError",
|
|
381
|
+
"NetworkService",
|
|
382
|
+
"NetworkVerificationError",
|
|
383
|
+
"NotFoundError",
|
|
384
|
+
"NotificationChannel",
|
|
385
|
+
"Passport",
|
|
386
|
+
"PassportBlockedError",
|
|
387
|
+
"PassportReport",
|
|
388
|
+
"PassportStackClaims",
|
|
389
|
+
"PaymentConnectionRequiredError",
|
|
390
|
+
"PaymentsService",
|
|
391
|
+
"PiiConfigService",
|
|
392
|
+
"PlatformSubscriptionRequiredError",
|
|
393
|
+
"PostRefusedError",
|
|
394
|
+
"PostService",
|
|
395
|
+
"PostUnavailableError",
|
|
396
|
+
"PostalAddressNotActiveError",
|
|
397
|
+
"ProviderCapacityUnavailableError",
|
|
192
398
|
"ProxyOperation",
|
|
399
|
+
"ProxyResponse",
|
|
400
|
+
"RecipientOptedOutError",
|
|
401
|
+
"ReplaceServiceRequirementResult",
|
|
402
|
+
"ReplayGuard",
|
|
403
|
+
"ReplyEmailInput",
|
|
404
|
+
"ReviewDecisionResult",
|
|
405
|
+
"ReviewFlag",
|
|
406
|
+
"ReviewQueue",
|
|
407
|
+
"ReviewQueueItem",
|
|
408
|
+
"SendEmailInput",
|
|
409
|
+
"ServiceRequirement",
|
|
410
|
+
"SetServiceRequirementInput",
|
|
411
|
+
"SharedMailDailyLimitError",
|
|
412
|
+
"SignedControlAnswer",
|
|
193
413
|
"Skill",
|
|
194
414
|
"SkillInvocation",
|
|
195
415
|
"SkillRequest",
|
|
196
|
-
"
|
|
197
|
-
"IdentityClaim",
|
|
198
|
-
"IdentitySettings",
|
|
199
|
-
"VerificationSession",
|
|
200
|
-
"SetServiceRequirementInput",
|
|
201
|
-
"ServiceRequirement",
|
|
202
|
-
"ReplaceServiceRequirementResult",
|
|
203
|
-
"AuthorityReference",
|
|
204
|
-
"PassportStackClaims",
|
|
205
|
-
"VerifiedPassportClaims",
|
|
206
|
-
# Service classes (for typing / direct construction)
|
|
207
|
-
"TeamService",
|
|
208
|
-
"DeliveryMethodService",
|
|
209
|
-
"DetectorConfigService",
|
|
210
|
-
"PiiConfigService",
|
|
211
|
-
"AuthorityService",
|
|
212
|
-
"FleetsService",
|
|
213
|
-
"AsyncFleetsService",
|
|
214
|
-
"AsyncAuthorityService",
|
|
215
|
-
# Offline / customer-managed crypto (parity with the JS SDK)
|
|
216
|
-
"verify_passport_offline",
|
|
217
|
-
"verify_passport_header",
|
|
218
|
-
"sign_claim_envelope",
|
|
219
|
-
# Errors
|
|
416
|
+
"Stack",
|
|
220
417
|
"StackError",
|
|
221
|
-
"
|
|
418
|
+
"StripeRequestFailedError",
|
|
419
|
+
"TeamService",
|
|
420
|
+
"TelegramSendRefusedError",
|
|
421
|
+
"ToolCall",
|
|
422
|
+
"ToolPriceRefusedError",
|
|
423
|
+
"ToolRunFile",
|
|
424
|
+
"ToolRunRejectedError",
|
|
425
|
+
"ToolRunResult",
|
|
426
|
+
"ToolsUnavailableError",
|
|
427
|
+
"TrustService",
|
|
222
428
|
"UnauthorizedError",
|
|
223
|
-
"
|
|
429
|
+
"UnboundedSendRuleError",
|
|
224
430
|
"ValidationError",
|
|
225
|
-
"
|
|
226
|
-
"
|
|
431
|
+
"VerificationSession",
|
|
432
|
+
"VerifiedPassportClaims",
|
|
433
|
+
"WakeSignatureError",
|
|
434
|
+
"WakesService",
|
|
435
|
+
"WalletKeyInSandboxError",
|
|
436
|
+
"WalletPaymentTarget",
|
|
437
|
+
"WebhookSignatureError",
|
|
438
|
+
"WebsiteHostnameUnavailableError",
|
|
439
|
+
"WebsiteLimitExceededError",
|
|
440
|
+
"WebsitePublishRejectedError",
|
|
441
|
+
"WebsiteService",
|
|
442
|
+
"WebsiteSuspendedError",
|
|
443
|
+
"X402PaymentError",
|
|
444
|
+
"X402Result",
|
|
445
|
+
"X402Wallet",
|
|
446
|
+
"__version__",
|
|
447
|
+
"create_authority_request_id",
|
|
448
|
+
"generate_agent_wallet_key",
|
|
449
|
+
"install_key_thumbprint",
|
|
450
|
+
"load_agent_wallet_key",
|
|
451
|
+
"passport_digest",
|
|
452
|
+
"pay_x402",
|
|
453
|
+
"pay_x402_async",
|
|
454
|
+
"read_x402_ask",
|
|
455
|
+
"revocation_covers",
|
|
456
|
+
"sign_claim_envelope",
|
|
457
|
+
"sign_control_answer",
|
|
458
|
+
"sign_wallet_payment",
|
|
459
|
+
"site_files",
|
|
460
|
+
"verify_agent_identity",
|
|
461
|
+
"verify_control_request",
|
|
462
|
+
"verify_countersigned_passport",
|
|
463
|
+
"verify_detection_rules",
|
|
464
|
+
"verify_passport_header",
|
|
465
|
+
"verify_passport_offline",
|
|
466
|
+
"verify_revocation_list",
|
|
467
|
+
"verify_verified_statement",
|
|
468
|
+
"verify_wake_webhook",
|
|
469
|
+
"verify_webhook",
|
|
470
|
+
"wallet_payment_authorization_payload",
|
|
227
471
|
]
|
|
228
472
|
|
|
229
473
|
|
|
@@ -247,7 +491,7 @@ class Stack:
|
|
|
247
491
|
):
|
|
248
492
|
# Four-source resolution, in priority order:
|
|
249
493
|
# 1. Explicit _auth (callers that pre-built a strategy).
|
|
250
|
-
# 2. agent_id (
|
|
494
|
+
# 2. agent_id (agent keypair runtime mode). Static
|
|
251
495
|
# bearer is auto-resolved for enrollment via api_key/env/file.
|
|
252
496
|
# 3. api_key arg or STACK_API_KEY env var (legacy sk_live_*).
|
|
253
497
|
# 4. ~/.stack/credentials.json — OAuth refresh token written
|
|
@@ -258,7 +502,11 @@ class Stack:
|
|
|
258
502
|
auth = AgentKeypairAuth(
|
|
259
503
|
agent_id=agent_id,
|
|
260
504
|
api_base_url=base_url,
|
|
261
|
-
bearer_provider=lambda:
|
|
505
|
+
bearer_provider=lambda: (
|
|
506
|
+
_build_static_auth(api_key=api_key, base_url=base_url)
|
|
507
|
+
.get_headers()["Authorization"]
|
|
508
|
+
.split(" ", 1)[1]
|
|
509
|
+
),
|
|
262
510
|
)
|
|
263
511
|
elif api_key or os.environ.get("STACK_API_KEY"):
|
|
264
512
|
auth = ApiKeyAuth(api_key or os.environ["STACK_API_KEY"])
|
|
@@ -277,6 +525,21 @@ class Stack:
|
|
|
277
525
|
self.proxy = ProxySvc(self._client)
|
|
278
526
|
self.scan = ScanService(self._client)
|
|
279
527
|
self.usage = UsageService(self._client)
|
|
528
|
+
self.billing = BillingService(self._client)
|
|
529
|
+
self.control_socket = ControlSocketService(self._client)
|
|
530
|
+
self.network = NetworkService(self._client)
|
|
531
|
+
self.agent_identity = AgentIdentityService(self._client)
|
|
532
|
+
self.control_policies = ControlPoliciesService(self._client)
|
|
533
|
+
self.control_reviews = ControlReviewsService(self._client)
|
|
534
|
+
self.wakes = WakesService(self._client)
|
|
535
|
+
self.trust = TrustService(self._client)
|
|
536
|
+
self.message_access = MessageAccessService(self._client)
|
|
537
|
+
self.calendar = CalendarService(self._client)
|
|
538
|
+
self.meetings = MeetingsService(self._client)
|
|
539
|
+
self.rentahuman = RentAHumanService(self._client)
|
|
540
|
+
self.governance = GovernanceService(self._client)
|
|
541
|
+
self.flagged_content = FlaggedContentService(self._client)
|
|
542
|
+
self.chat_channels = ChatChannelsService(self._client)
|
|
280
543
|
self.security_events = SecurityEventSvc(self._client)
|
|
281
544
|
self.skills = SkillService(self._client)
|
|
282
545
|
self.identity = IdentityService(self._client)
|
|
@@ -286,13 +549,20 @@ class Stack:
|
|
|
286
549
|
self.evidence_packs = EvidencePacksService(self._client)
|
|
287
550
|
self.llm = LlmService(self._client)
|
|
288
551
|
self.inbound_webhooks = InboundWebhookService(self._client)
|
|
289
|
-
self.
|
|
290
|
-
self.partner_connect = PartnerConnectService(self._client)
|
|
552
|
+
self.partner_accounts = PartnerAccountsService(self._client)
|
|
291
553
|
self.team = TeamService(self._client)
|
|
292
554
|
self.delivery_methods = DeliveryMethodService(self._client)
|
|
293
555
|
self.detector_config = DetectorConfigService(self._client)
|
|
294
556
|
self.pii_config = PiiConfigService(self._client)
|
|
295
557
|
self.authority = AuthorityService(self._client)
|
|
558
|
+
self.accounts = AccountsService(self._client)
|
|
559
|
+
self.catalogue = CatalogueService(self._client)
|
|
560
|
+
self.drive = DriveService(self._client)
|
|
561
|
+
self.memory = MemoryService(self._client)
|
|
562
|
+
self.brain = BrainService(self._client)
|
|
563
|
+
self.website = WebsiteService(self._client)
|
|
564
|
+
self.payments = PaymentsService(self._client)
|
|
565
|
+
self.post = PostService(self._client)
|
|
296
566
|
|
|
297
567
|
def issue_passport(
|
|
298
568
|
self,
|
|
@@ -306,7 +576,7 @@ class Stack:
|
|
|
306
576
|
mission_ids: list[str] | None = None,
|
|
307
577
|
**kwargs: Any,
|
|
308
578
|
) -> PassportSession:
|
|
309
|
-
"""
|
|
579
|
+
"""issue a passport and return a PassportSession
|
|
310
580
|
that holds the token + auto-refreshes ~60s before expiry. Pass
|
|
311
581
|
the returned session to LLM calls instead of threading a raw
|
|
312
582
|
token per call. ``mission_ids`` must hold exactly one Mission id;
|
|
@@ -322,16 +592,21 @@ class Stack:
|
|
|
322
592
|
**kwargs,
|
|
323
593
|
"mission_ids": _require_one_mission(mission_ids),
|
|
324
594
|
}
|
|
325
|
-
if services is not None:
|
|
326
|
-
|
|
327
|
-
if
|
|
328
|
-
|
|
329
|
-
if
|
|
595
|
+
if services is not None:
|
|
596
|
+
issue_input["services"] = services
|
|
597
|
+
if intents is not None:
|
|
598
|
+
issue_input["intents"] = intents
|
|
599
|
+
if ttl_seconds is not None:
|
|
600
|
+
issue_input["ttl_seconds"] = ttl_seconds
|
|
601
|
+
if accountability_mode is not None:
|
|
602
|
+
issue_input["accountability_mode"] = accountability_mode
|
|
603
|
+
if authority_binding_ids is not None:
|
|
604
|
+
issue_input["authority_binding_ids"] = authority_binding_ids
|
|
330
605
|
issued = self._client.post("/v1/passports/issue", json=issue_input)
|
|
331
606
|
return PassportSession(self._client, issued, issue_input)
|
|
332
607
|
|
|
333
608
|
@classmethod
|
|
334
|
-
def from_session(cls, session_token: str, **kwargs) -> Stack:
|
|
609
|
+
def from_session(cls, session_token: str, **kwargs: Any) -> Stack:
|
|
335
610
|
"""Create a client authenticated with a session JWT."""
|
|
336
611
|
return cls(_auth=SessionAuth(session_token), **kwargs)
|
|
337
612
|
|
|
@@ -343,7 +618,7 @@ class Stack:
|
|
|
343
618
|
access_token: str,
|
|
344
619
|
refresh_token: str,
|
|
345
620
|
token_endpoint: str = "https://api.getstack.run/v1/oauth/token",
|
|
346
|
-
**kwargs,
|
|
621
|
+
**kwargs: Any,
|
|
347
622
|
) -> Stack:
|
|
348
623
|
"""Create a client with OAuth tokens. Auto-refreshes when expired."""
|
|
349
624
|
auth = OAuthAuth(
|
|
@@ -359,41 +634,51 @@ class Stack:
|
|
|
359
634
|
"""Close the underlying HTTP client."""
|
|
360
635
|
self._client.close()
|
|
361
636
|
|
|
637
|
+
def with_control_ref(self, ref: str) -> Stack:
|
|
638
|
+
"""The same client with ``X-Control-Ref: <ref>`` on every call it makes.
|
|
639
|
+
|
|
640
|
+
When a policy holds a call for the owner, the refusal (``ControlDeniedError``, reason ``review_required``)
|
|
641
|
+
names a ref in ``retry``; once the owner has approved, make the identical call again through this:
|
|
642
|
+
``stack.with_control_ref(ref).accounts.send_email(...)``. It shares this client's connection and credential
|
|
643
|
+
and is meant for that one call.
|
|
644
|
+
"""
|
|
645
|
+
return scoped_stack(self, ref)
|
|
646
|
+
|
|
362
647
|
def __enter__(self) -> Stack:
|
|
363
648
|
return self
|
|
364
649
|
|
|
365
|
-
def __exit__(self, *args) -> None:
|
|
650
|
+
def __exit__(self, *args: object) -> None:
|
|
366
651
|
self.close()
|
|
367
652
|
|
|
368
653
|
|
|
369
654
|
class AsyncStack:
|
|
370
655
|
"""Asynchronous STACK client.
|
|
371
656
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
657
|
+
full parity with Stack. All 14 typed services are
|
|
658
|
+
async-native, plus AsyncMission for the bounded-mission context
|
|
659
|
+
manager. Uses httpx.AsyncClient under the hood.
|
|
660
|
+
|
|
661
|
+
Args:
|
|
662
|
+
api_key: A STACK API key (``sk_live_...``).
|
|
663
|
+
base_url: Override the API base URL.
|
|
664
|
+
timeout: HTTP timeout in seconds.
|
|
665
|
+
|
|
666
|
+
Example::
|
|
667
|
+
|
|
668
|
+
from getstack import AsyncStack
|
|
669
|
+
|
|
670
|
+
async with AsyncStack(api_key="sk_live_...") as stack:
|
|
671
|
+
agents = await stack.agents.list()
|
|
672
|
+
async with stack.passports.mission(
|
|
673
|
+
agent_id=agents[0].id,
|
|
674
|
+
intent="Process invoices",
|
|
675
|
+
services=["slack", "stripe"],
|
|
676
|
+
) as mission:
|
|
677
|
+
resp = await mission.proxy(
|
|
678
|
+
"stripe", "https://api.stripe.com/v1/charges",
|
|
679
|
+
method="POST", body={"amount": 50},
|
|
680
|
+
_proxy_service=stack.proxy,
|
|
681
|
+
)
|
|
397
682
|
"""
|
|
398
683
|
|
|
399
684
|
def __init__(
|
|
@@ -412,7 +697,11 @@ class AsyncStack:
|
|
|
412
697
|
auth = AgentKeypairAuth(
|
|
413
698
|
agent_id=agent_id,
|
|
414
699
|
api_base_url=base_url,
|
|
415
|
-
bearer_provider=lambda:
|
|
700
|
+
bearer_provider=lambda: (
|
|
701
|
+
_build_static_auth(api_key=api_key, base_url=base_url)
|
|
702
|
+
.get_headers()["Authorization"]
|
|
703
|
+
.split(" ", 1)[1]
|
|
704
|
+
),
|
|
416
705
|
)
|
|
417
706
|
elif api_key or os.environ.get("STACK_API_KEY"):
|
|
418
707
|
auth = ApiKeyAuth(api_key or os.environ["STACK_API_KEY"])
|
|
@@ -421,36 +710,50 @@ class AsyncStack:
|
|
|
421
710
|
|
|
422
711
|
self._client = AsyncHttpClient(auth, base_url=base_url, timeout=timeout)
|
|
423
712
|
|
|
424
|
-
#
|
|
713
|
+
# 14 typed async services attached eagerly
|
|
425
714
|
# matching Stack's posture. Footprint is small; lazy init
|
|
426
715
|
# would only buy us memory we don't need to save.
|
|
716
|
+
from ._async.agent_identity import AsyncAgentIdentityService
|
|
427
717
|
from ._async.agents import AsyncAgentService
|
|
428
|
-
from ._async.
|
|
718
|
+
from ._async.audit import AsyncAuditService
|
|
719
|
+
from ._async.authority import AsyncAuthorityService
|
|
720
|
+
from ._async.billing import AsyncBillingService
|
|
721
|
+
from ._async.calendar import AsyncCalendarService
|
|
722
|
+
from ._async.chat_channels import AsyncChatChannelsService
|
|
723
|
+
from ._async.control_policies import AsyncControlPoliciesService, AsyncControlReviewsService
|
|
724
|
+
from ._async.control_socket import AsyncControlSocketService
|
|
429
725
|
from ._async.credentials import AsyncCredentialService
|
|
430
|
-
from ._async.
|
|
726
|
+
from ._async.delivery_methods import AsyncDeliveryMethodService
|
|
727
|
+
from ._async.detector_config import AsyncDetectorConfigService
|
|
431
728
|
from ._async.dropoffs import AsyncDropoffService
|
|
432
|
-
from ._async.
|
|
729
|
+
from ._async.evidence_packs import AsyncEvidencePacksService
|
|
730
|
+
from ._async.flagged_content import AsyncFlaggedContentService
|
|
731
|
+
from ._async.governance import AsyncGovernanceService
|
|
732
|
+
from ._async.identity import AsyncIdentityService
|
|
733
|
+
from ._async.inbound_webhooks import AsyncInboundWebhookService
|
|
734
|
+
from ._async.intents import AsyncIntentsService
|
|
735
|
+
from ._async.llm import AsyncLlmService
|
|
736
|
+
from ._async.meetings import AsyncMeetingsService
|
|
737
|
+
from ._async.message_access import AsyncMessageAccessService
|
|
738
|
+
from ._async.missions import AsyncMissionsService
|
|
739
|
+
from ._async.network import AsyncNetworkService
|
|
433
740
|
from ._async.notifications import AsyncNotificationService
|
|
434
|
-
from ._async.
|
|
741
|
+
from ._async.partner_accounts import AsyncPartnerAccountsService
|
|
742
|
+
from ._async.passport_session import AsyncPassportSession
|
|
743
|
+
from ._async.passports import AsyncPassportService
|
|
744
|
+
from ._async.pii_config import AsyncPiiConfigService
|
|
745
|
+
from ._async.post import AsyncPostService
|
|
435
746
|
from ._async.proxy import AsyncProxyService
|
|
747
|
+
from ._async.rentahuman import AsyncRentAHumanService
|
|
748
|
+
from ._async.reviews import AsyncReviewService
|
|
436
749
|
from ._async.scan import AsyncScanService
|
|
437
|
-
from ._async.usage import AsyncUsageService
|
|
438
750
|
from ._async.security_events import AsyncSecurityEventService
|
|
751
|
+
from ._async.services import AsyncServiceService
|
|
439
752
|
from ._async.skills import AsyncSkillService
|
|
440
|
-
from ._async.identity import AsyncIdentityService
|
|
441
|
-
from ._async.intents import AsyncIntentsService
|
|
442
|
-
from ._async.missions import AsyncMissionsService
|
|
443
|
-
from ._async.llm import AsyncLlmService
|
|
444
|
-
from ._async.inbound_webhooks import AsyncInboundWebhookService
|
|
445
|
-
from ._async.partner_tenants import AsyncPartnerTenantsService
|
|
446
|
-
from ._async.partner_connect import AsyncPartnerConnectService
|
|
447
|
-
from ._async.evidence_packs import AsyncEvidencePacksService
|
|
448
753
|
from ._async.team import AsyncTeamService
|
|
449
|
-
from ._async.
|
|
450
|
-
from ._async.
|
|
451
|
-
from ._async.
|
|
452
|
-
from ._async.authority import AsyncAuthorityService
|
|
453
|
-
from ._async.passport_session import AsyncPassportSession
|
|
754
|
+
from ._async.trust import AsyncTrustService
|
|
755
|
+
from ._async.usage import AsyncUsageService
|
|
756
|
+
from ._async.wake import AsyncWakesService
|
|
454
757
|
|
|
455
758
|
self.agents = AsyncAgentService(self._client)
|
|
456
759
|
self.passports = AsyncPassportService(self._client)
|
|
@@ -463,6 +766,21 @@ class AsyncStack:
|
|
|
463
766
|
self.proxy = AsyncProxyService(self._client)
|
|
464
767
|
self.scan = AsyncScanService(self._client)
|
|
465
768
|
self.usage = AsyncUsageService(self._client)
|
|
769
|
+
self.billing = AsyncBillingService(self._client)
|
|
770
|
+
self.control_socket = AsyncControlSocketService(self._client)
|
|
771
|
+
self.network = AsyncNetworkService(self._client)
|
|
772
|
+
self.agent_identity = AsyncAgentIdentityService(self._client)
|
|
773
|
+
self.control_policies = AsyncControlPoliciesService(self._client)
|
|
774
|
+
self.control_reviews = AsyncControlReviewsService(self._client)
|
|
775
|
+
self.wakes = AsyncWakesService(self._client)
|
|
776
|
+
self.trust = AsyncTrustService(self._client)
|
|
777
|
+
self.message_access = AsyncMessageAccessService(self._client)
|
|
778
|
+
self.calendar = AsyncCalendarService(self._client)
|
|
779
|
+
self.meetings = AsyncMeetingsService(self._client)
|
|
780
|
+
self.rentahuman = AsyncRentAHumanService(self._client)
|
|
781
|
+
self.governance = AsyncGovernanceService(self._client)
|
|
782
|
+
self.flagged_content = AsyncFlaggedContentService(self._client)
|
|
783
|
+
self.chat_channels = AsyncChatChannelsService(self._client)
|
|
466
784
|
self.security_events = AsyncSecurityEventService(self._client)
|
|
467
785
|
self.skills = AsyncSkillService(self._client)
|
|
468
786
|
self.identity = AsyncIdentityService(self._client)
|
|
@@ -471,14 +789,21 @@ class AsyncStack:
|
|
|
471
789
|
self.fleets = AsyncFleetsService(self._client)
|
|
472
790
|
self.llm = AsyncLlmService(self._client)
|
|
473
791
|
self.inbound_webhooks = AsyncInboundWebhookService(self._client)
|
|
474
|
-
self.
|
|
475
|
-
self.partner_connect = AsyncPartnerConnectService(self._client)
|
|
792
|
+
self.partner_accounts = AsyncPartnerAccountsService(self._client)
|
|
476
793
|
self.evidence_packs = AsyncEvidencePacksService(self._client)
|
|
477
794
|
self.team = AsyncTeamService(self._client)
|
|
478
795
|
self.delivery_methods = AsyncDeliveryMethodService(self._client)
|
|
479
796
|
self.detector_config = AsyncDetectorConfigService(self._client)
|
|
480
797
|
self.pii_config = AsyncPiiConfigService(self._client)
|
|
481
798
|
self.authority = AsyncAuthorityService(self._client)
|
|
799
|
+
self.accounts = AsyncAccountsService(self._client)
|
|
800
|
+
self.catalogue = AsyncCatalogueService(self._client)
|
|
801
|
+
self.drive = AsyncDriveService(self._client)
|
|
802
|
+
self.memory = AsyncMemoryService(self._client)
|
|
803
|
+
self.brain = AsyncBrainService(self._client)
|
|
804
|
+
self.website = AsyncWebsiteService(self._client)
|
|
805
|
+
self.payments = AsyncPaymentsService(self._client)
|
|
806
|
+
self.post = AsyncPostService(self._client)
|
|
482
807
|
# Stash for issue_passport() — Python doesn't easily expose the
|
|
483
808
|
# class binding without re-importing inside the method body.
|
|
484
809
|
self._AsyncPassportSession = AsyncPassportSession
|
|
@@ -494,24 +819,29 @@ class AsyncStack:
|
|
|
494
819
|
authority_binding_ids: list[str] | None = None,
|
|
495
820
|
mission_ids: list[str] | None = None,
|
|
496
821
|
**kwargs: Any,
|
|
497
|
-
):
|
|
498
|
-
"""
|
|
822
|
+
) -> AsyncPassportSession:
|
|
823
|
+
"""async passport issue + session wrapper.
|
|
499
824
|
``mission_ids`` must hold exactly one Mission id."""
|
|
500
825
|
issue_input: dict[str, Any] = {
|
|
501
826
|
"agent_id": agent_id,
|
|
502
827
|
**kwargs,
|
|
503
828
|
"mission_ids": _require_one_mission(mission_ids),
|
|
504
829
|
}
|
|
505
|
-
if services is not None:
|
|
506
|
-
|
|
507
|
-
if
|
|
508
|
-
|
|
509
|
-
if
|
|
830
|
+
if services is not None:
|
|
831
|
+
issue_input["services"] = services
|
|
832
|
+
if intents is not None:
|
|
833
|
+
issue_input["intents"] = intents
|
|
834
|
+
if ttl_seconds is not None:
|
|
835
|
+
issue_input["ttl_seconds"] = ttl_seconds
|
|
836
|
+
if accountability_mode is not None:
|
|
837
|
+
issue_input["accountability_mode"] = accountability_mode
|
|
838
|
+
if authority_binding_ids is not None:
|
|
839
|
+
issue_input["authority_binding_ids"] = authority_binding_ids
|
|
510
840
|
issued = await self._client.post("/v1/passports/issue", json=issue_input)
|
|
511
841
|
return self._AsyncPassportSession(self._client, issued, issue_input)
|
|
512
842
|
|
|
513
843
|
@classmethod
|
|
514
|
-
def from_session(cls, session_token: str, **kwargs) -> AsyncStack:
|
|
844
|
+
def from_session(cls, session_token: str, **kwargs: Any) -> AsyncStack:
|
|
515
845
|
"""Create an async client authenticated with a session JWT."""
|
|
516
846
|
return cls(_auth=SessionAuth(session_token), **kwargs)
|
|
517
847
|
|
|
@@ -523,7 +853,7 @@ class AsyncStack:
|
|
|
523
853
|
access_token: str,
|
|
524
854
|
refresh_token: str,
|
|
525
855
|
token_endpoint: str = "https://api.getstack.run/v1/oauth/token",
|
|
526
|
-
**kwargs,
|
|
856
|
+
**kwargs: Any,
|
|
527
857
|
) -> AsyncStack:
|
|
528
858
|
"""Create an async client with OAuth tokens. Auto-refreshes when expired."""
|
|
529
859
|
auth = OAuthAuth(
|
|
@@ -539,8 +869,12 @@ class AsyncStack:
|
|
|
539
869
|
"""Close the underlying HTTP client."""
|
|
540
870
|
await self._client.close()
|
|
541
871
|
|
|
872
|
+
def with_control_ref(self, ref: str) -> AsyncStack:
|
|
873
|
+
"""The same client with ``X-Control-Ref: <ref>`` on every call it makes (see ``Stack.with_control_ref``)."""
|
|
874
|
+
return scoped_stack(self, ref)
|
|
875
|
+
|
|
542
876
|
async def __aenter__(self) -> AsyncStack:
|
|
543
877
|
return self
|
|
544
878
|
|
|
545
|
-
async def __aexit__(self, *args) -> None:
|
|
879
|
+
async def __aexit__(self, *args: object) -> None:
|
|
546
880
|
await self.close()
|