simplex 3.0.5__tar.gz → 3.0.7__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 (31) hide show
  1. {simplex-3.0.5/simplex.egg-info → simplex-3.0.7}/PKG-INFO +1 -1
  2. {simplex-3.0.5 → simplex-3.0.7}/pyproject.toml +1 -1
  3. {simplex-3.0.5 → simplex-3.0.7}/simplex/__init__.py +3 -1
  4. {simplex-3.0.5 → simplex-3.0.7}/simplex/_http_client.py +1 -1
  5. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/editor.py +3 -2
  6. {simplex-3.0.5 → simplex-3.0.7}/simplex/client.py +56 -0
  7. {simplex-3.0.5 → simplex-3.0.7}/simplex/types.py +19 -0
  8. {simplex-3.0.5 → simplex-3.0.7/simplex.egg-info}/PKG-INFO +1 -1
  9. {simplex-3.0.5 → simplex-3.0.7}/LICENSE +0 -0
  10. {simplex-3.0.5 → simplex-3.0.7}/MANIFEST.in +0 -0
  11. {simplex-3.0.5 → simplex-3.0.7}/README.md +0 -0
  12. {simplex-3.0.5 → simplex-3.0.7}/requirements.txt +0 -0
  13. {simplex-3.0.5 → simplex-3.0.7}/setup.cfg +0 -0
  14. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/__init__.py +0 -0
  15. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/auth.py +0 -0
  16. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/config.py +0 -0
  17. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/connect.py +0 -0
  18. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/main.py +0 -0
  19. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/output.py +0 -0
  20. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/run.py +0 -0
  21. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/send.py +0 -0
  22. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/sessions.py +0 -0
  23. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/variables.py +0 -0
  24. {simplex-3.0.5 → simplex-3.0.7}/simplex/cli/workflows.py +0 -0
  25. {simplex-3.0.5 → simplex-3.0.7}/simplex/errors.py +0 -0
  26. {simplex-3.0.5 → simplex-3.0.7}/simplex/webhook.py +0 -0
  27. {simplex-3.0.5 → simplex-3.0.7}/simplex.egg-info/SOURCES.txt +0 -0
  28. {simplex-3.0.5 → simplex-3.0.7}/simplex.egg-info/dependency_links.txt +0 -0
  29. {simplex-3.0.5 → simplex-3.0.7}/simplex.egg-info/entry_points.txt +0 -0
  30. {simplex-3.0.5 → simplex-3.0.7}/simplex.egg-info/requires.txt +0 -0
  31. {simplex-3.0.5 → simplex-3.0.7}/simplex.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplex
3
- Version: 3.0.5
3
+ Version: 3.0.7
4
4
  Summary: Official Python SDK for the Simplex API
5
5
  Author-email: Simplex <support@simplex.sh>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simplex"
7
- version = "3.0.5"
7
+ version = "3.0.7"
8
8
  description = "Official Python SDK for the Simplex API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -30,6 +30,7 @@ from simplex.errors import (
30
30
  WorkflowError,
31
31
  )
32
32
  from simplex.types import (
33
+ Add2FAConfigResponse,
33
34
  FileMetadata,
34
35
  PauseSessionResponse,
35
36
  ResumeSessionResponse,
@@ -43,7 +44,7 @@ from simplex.types import (
43
44
  )
44
45
  from simplex.webhook import WebhookVerificationError, verify_simplex_webhook
45
46
 
46
- __version__ = "3.0.5"
47
+ __version__ = "3.0.7"
47
48
  __all__ = [
48
49
  "SimplexClient",
49
50
  "SimplexError",
@@ -52,6 +53,7 @@ __all__ = [
52
53
  "AuthenticationError",
53
54
  "RateLimitError",
54
55
  "WorkflowError",
56
+ "Add2FAConfigResponse",
55
57
  "FileMetadata",
56
58
  "SessionStatusResponse",
57
59
  "RunWorkflowResponse",
@@ -21,7 +21,7 @@ from simplex.errors import (
21
21
  ValidationError,
22
22
  )
23
23
 
24
- __version__ = "3.0.5"
24
+ __version__ = "3.0.7"
25
25
 
26
26
 
27
27
  class HttpClient:
@@ -18,6 +18,7 @@ def editor(
18
18
  name: str = typer.Option(..., "--name", "-n", help="Workflow name"),
19
19
  url: str = typer.Option(..., "--url", "-u", help="Starting URL"),
20
20
  vars_json: Optional[str] = typer.Option(None, "--vars", help="Variables as JSON string or path to .json file"),
21
+ prompt: Optional[str] = typer.Option(None, "--prompt", "-p", help="Initial prompt to send to the agent"),
21
22
  json_output: bool = typer.Option(False, "--json", help="Output session info as JSON"),
22
23
  ) -> None:
23
24
  """Create a workflow and start an editor session."""
@@ -36,13 +37,13 @@ def editor(
36
37
  console.print()
37
38
  with console.status("[bold]Starting editor session...[/bold]", spinner="dots"):
38
39
  try:
39
- result = client.start_editor_session(name=name, url=url, test_data=test_data)
40
+ result = client.start_editor_session(name=name, url=url, test_data=test_data, prompt=prompt)
40
41
  except SimplexError as e:
41
42
  print_error(str(e))
42
43
  raise typer.Exit(1)
43
44
  else:
44
45
  try:
45
- result = client.start_editor_session(name=name, url=url, test_data=test_data)
46
+ result = client.start_editor_session(name=name, url=url, test_data=test_data, prompt=prompt)
46
47
  except SimplexError as e:
47
48
  print_error(str(e))
48
49
  raise typer.Exit(1)
@@ -13,6 +13,7 @@ from typing import Any
13
13
  from simplex._http_client import HttpClient
14
14
  from simplex.errors import WorkflowError
15
15
  from simplex.types import (
16
+ Add2FAConfigResponse,
16
17
  PauseSessionResponse,
17
18
  ResumeSessionResponse,
18
19
  RunWorkflowResponse,
@@ -576,6 +577,7 @@ class SimplexClient:
576
577
  name: str,
577
578
  url: str,
578
579
  test_data: dict[str, Any] | None = None,
580
+ prompt: str | None = None,
579
581
  ) -> StartEditorSessionResponse:
580
582
  """
581
583
  Start an editor session. Creates a workflow and starts a browser session.
@@ -584,6 +586,7 @@ class SimplexClient:
584
586
  name: Name for the workflow
585
587
  url: Starting URL
586
588
  test_data: Optional test data variables
589
+ prompt: Optional initial prompt to send to the agent after session starts
587
590
 
588
591
  Returns:
589
592
  StartEditorSessionResponse with session_id, workflow_id, and URLs
@@ -591,6 +594,8 @@ class SimplexClient:
591
594
  data: dict[str, Any] = {"name": name, "url": url}
592
595
  if test_data is not None:
593
596
  data["test_data"] = test_data
597
+ if prompt is not None:
598
+ data["prompt"] = prompt
594
599
 
595
600
  try:
596
601
  response: StartEditorSessionResponse = self._http_client.post_json(
@@ -666,6 +671,57 @@ class SimplexClient:
666
671
  """
667
672
  return self._http_client.get(f"/workflow/{workflow_id}/active_session")
668
673
 
674
+ def add_2fa_config(
675
+ self,
676
+ seed: str,
677
+ name: str | None = None,
678
+ partial_url: str | None = None,
679
+ ) -> Add2FAConfigResponse:
680
+ """
681
+ Add a 2FA TOTP seed configuration for your organization.
682
+
683
+ The seed is used to generate TOTP codes during automated browser
684
+ sessions. Either ``name`` or ``partial_url`` must be provided.
685
+
686
+ Args:
687
+ seed: The TOTP secret/seed for generating 2FA codes
688
+ name: Friendly name for the configuration (e.g. "GitHub")
689
+ partial_url: URL pattern to auto-match (e.g. "github.com")
690
+
691
+ Returns:
692
+ Add2FAConfigResponse with the added config and total count
693
+
694
+ Raises:
695
+ WorkflowError: If adding the 2FA config fails
696
+
697
+ Example:
698
+ >>> result = client.add_2fa_config(
699
+ ... seed="JBSWY3DPEHPK3PXP",
700
+ ... name="GitHub",
701
+ ... partial_url="github.com"
702
+ ... )
703
+ >>> print(f"Total configs: {result['total_configs']}")
704
+ """
705
+ data: dict[str, Any] = {"seed": seed}
706
+ if name is not None:
707
+ data["name"] = name
708
+ if partial_url is not None:
709
+ data["partial_url"] = partial_url
710
+
711
+ try:
712
+ response: Add2FAConfigResponse = self._http_client.post_json(
713
+ "/add_2fa_config", data=data
714
+ )
715
+ if not response.get("succeeded"):
716
+ raise WorkflowError(
717
+ response.get("error", "Failed to add 2FA config")
718
+ )
719
+ return response
720
+ except Exception as e:
721
+ if isinstance(e, WorkflowError):
722
+ raise
723
+ raise WorkflowError(f"Failed to add 2FA config: {e}")
724
+
669
725
  def close_session(self, session_id: str) -> Any:
670
726
  """
671
727
  Close a workflow session.
@@ -182,6 +182,25 @@ class StartEditorSessionResponse(TypedDict, total=False):
182
182
  filesystem_url: str | None
183
183
 
184
184
 
185
+ class Add2FAConfigResponse(TypedDict, total=False):
186
+ """
187
+ Response from adding a 2FA configuration.
188
+
189
+ Attributes:
190
+ succeeded: Whether the operation succeeded
191
+ added_config: The 2FA configuration that was added
192
+ total_configs: Total number of 2FA configs for the organization
193
+ all_configs: Array of all 2FA configurations
194
+ error: Error message if the operation failed
195
+ """
196
+
197
+ succeeded: bool
198
+ added_config: dict[str, Any]
199
+ total_configs: int
200
+ all_configs: list[dict[str, Any]]
201
+ error: str
202
+
203
+
185
204
  class WebhookPayload(TypedDict, total=False):
186
205
  """
187
206
  Payload received from a Simplex webhook.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplex
3
- Version: 3.0.5
3
+ Version: 3.0.7
4
4
  Summary: Official Python SDK for the Simplex API
5
5
  Author-email: Simplex <support@simplex.sh>
6
6
  License: MIT
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