simplex 3.0.4__tar.gz → 3.0.6__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.
- {simplex-3.0.4/simplex.egg-info → simplex-3.0.6}/PKG-INFO +1 -1
- {simplex-3.0.4 → simplex-3.0.6}/pyproject.toml +1 -1
- {simplex-3.0.4 → simplex-3.0.6}/simplex/__init__.py +1 -1
- {simplex-3.0.4 → simplex-3.0.6}/simplex/_http_client.py +1 -1
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/editor.py +3 -2
- {simplex-3.0.4 → simplex-3.0.6}/simplex/client.py +4 -81
- {simplex-3.0.4 → simplex-3.0.6}/simplex/types.py +2 -47
- {simplex-3.0.4 → simplex-3.0.6/simplex.egg-info}/PKG-INFO +1 -1
- {simplex-3.0.4 → simplex-3.0.6}/LICENSE +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/MANIFEST.in +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/README.md +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/requirements.txt +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/setup.cfg +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/__init__.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/auth.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/config.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/connect.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/main.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/output.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/run.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/send.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/sessions.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/variables.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/cli/workflows.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/errors.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex/webhook.py +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex.egg-info/SOURCES.txt +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex.egg-info/dependency_links.txt +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex.egg-info/entry_points.txt +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex.egg-info/requires.txt +0 -0
- {simplex-3.0.4 → simplex-3.0.6}/simplex.egg-info/top_level.txt +0 -0
|
@@ -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,15 +13,12 @@ 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
|
-
DeleteCredentialResponse,
|
|
17
|
-
ListCredentialsResponse,
|
|
18
16
|
PauseSessionResponse,
|
|
19
17
|
ResumeSessionResponse,
|
|
20
18
|
RunWorkflowResponse,
|
|
21
19
|
SearchWorkflowsResponse,
|
|
22
20
|
SessionStatusResponse,
|
|
23
21
|
StartEditorSessionResponse,
|
|
24
|
-
StoreCredentialResponse,
|
|
25
22
|
UpdateWorkflowMetadataResponse,
|
|
26
23
|
)
|
|
27
24
|
|
|
@@ -579,6 +576,7 @@ class SimplexClient:
|
|
|
579
576
|
name: str,
|
|
580
577
|
url: str,
|
|
581
578
|
test_data: dict[str, Any] | None = None,
|
|
579
|
+
prompt: str | None = None,
|
|
582
580
|
) -> StartEditorSessionResponse:
|
|
583
581
|
"""
|
|
584
582
|
Start an editor session. Creates a workflow and starts a browser session.
|
|
@@ -587,6 +585,7 @@ class SimplexClient:
|
|
|
587
585
|
name: Name for the workflow
|
|
588
586
|
url: Starting URL
|
|
589
587
|
test_data: Optional test data variables
|
|
588
|
+
prompt: Optional initial prompt to send to the agent after session starts
|
|
590
589
|
|
|
591
590
|
Returns:
|
|
592
591
|
StartEditorSessionResponse with session_id, workflow_id, and URLs
|
|
@@ -594,6 +593,8 @@ class SimplexClient:
|
|
|
594
593
|
data: dict[str, Any] = {"name": name, "url": url}
|
|
595
594
|
if test_data is not None:
|
|
596
595
|
data["test_data"] = test_data
|
|
596
|
+
if prompt is not None:
|
|
597
|
+
data["prompt"] = prompt
|
|
597
598
|
|
|
598
599
|
try:
|
|
599
600
|
response: StartEditorSessionResponse = self._http_client.post_json(
|
|
@@ -669,84 +670,6 @@ class SimplexClient:
|
|
|
669
670
|
"""
|
|
670
671
|
return self._http_client.get(f"/workflow/{workflow_id}/active_session")
|
|
671
672
|
|
|
672
|
-
def store_credential(self, name: str, value: str) -> StoreCredentialResponse:
|
|
673
|
-
"""
|
|
674
|
-
Store an encrypted credential for your organization.
|
|
675
|
-
|
|
676
|
-
The value is encrypted server-side and can later be used by the agent
|
|
677
|
-
via ``type_secret(credential_name="...")``.
|
|
678
|
-
|
|
679
|
-
Args:
|
|
680
|
-
name: A unique name for the credential
|
|
681
|
-
value: The plaintext value to encrypt and store
|
|
682
|
-
|
|
683
|
-
Returns:
|
|
684
|
-
StoreCredentialResponse with credential_id on success
|
|
685
|
-
|
|
686
|
-
Example:
|
|
687
|
-
>>> client.store_credential("github_token", "ghp_xxxx...")
|
|
688
|
-
{'succeeded': True, 'name': 'github_token', 'credential_id': '...'}
|
|
689
|
-
"""
|
|
690
|
-
try:
|
|
691
|
-
response: StoreCredentialResponse = self._http_client.post_json(
|
|
692
|
-
"/store_credential",
|
|
693
|
-
data={"name": name, "value": value},
|
|
694
|
-
)
|
|
695
|
-
return response
|
|
696
|
-
except Exception as e:
|
|
697
|
-
if isinstance(e, WorkflowError):
|
|
698
|
-
raise
|
|
699
|
-
raise WorkflowError(f"Failed to store credential: {e}")
|
|
700
|
-
|
|
701
|
-
def list_credentials(self) -> ListCredentialsResponse:
|
|
702
|
-
"""
|
|
703
|
-
List all encrypted credentials for your organization.
|
|
704
|
-
|
|
705
|
-
Returns metadata only (name, dates) -- not the encrypted values.
|
|
706
|
-
|
|
707
|
-
Returns:
|
|
708
|
-
ListCredentialsResponse with array of credential metadata
|
|
709
|
-
|
|
710
|
-
Example:
|
|
711
|
-
>>> result = client.list_credentials()
|
|
712
|
-
>>> for cred in result["credentials"]:
|
|
713
|
-
... print(f"{cred['name']} (created {cred['created_at']})")
|
|
714
|
-
"""
|
|
715
|
-
try:
|
|
716
|
-
response: ListCredentialsResponse = self._http_client.get(
|
|
717
|
-
"/list_credentials",
|
|
718
|
-
)
|
|
719
|
-
return response
|
|
720
|
-
except Exception as e:
|
|
721
|
-
if isinstance(e, WorkflowError):
|
|
722
|
-
raise
|
|
723
|
-
raise WorkflowError(f"Failed to list credentials: {e}")
|
|
724
|
-
|
|
725
|
-
def delete_credential(self, name: str) -> DeleteCredentialResponse:
|
|
726
|
-
"""
|
|
727
|
-
Delete an encrypted credential by name.
|
|
728
|
-
|
|
729
|
-
Args:
|
|
730
|
-
name: The name of the credential to delete
|
|
731
|
-
|
|
732
|
-
Returns:
|
|
733
|
-
DeleteCredentialResponse
|
|
734
|
-
|
|
735
|
-
Example:
|
|
736
|
-
>>> client.delete_credential("github_token")
|
|
737
|
-
{'succeeded': True}
|
|
738
|
-
"""
|
|
739
|
-
try:
|
|
740
|
-
response: DeleteCredentialResponse = self._http_client.post_json(
|
|
741
|
-
"/delete_credential",
|
|
742
|
-
data={"name": name},
|
|
743
|
-
)
|
|
744
|
-
return response
|
|
745
|
-
except Exception as e:
|
|
746
|
-
if isinstance(e, WorkflowError):
|
|
747
|
-
raise
|
|
748
|
-
raise WorkflowError(f"Failed to delete credential: {e}")
|
|
749
|
-
|
|
750
673
|
def close_session(self, session_id: str) -> Any:
|
|
751
674
|
"""
|
|
752
675
|
Close a workflow session.
|
|
@@ -182,58 +182,13 @@ class StartEditorSessionResponse(TypedDict, total=False):
|
|
|
182
182
|
filesystem_url: str | None
|
|
183
183
|
|
|
184
184
|
|
|
185
|
-
class StoreCredentialResponse(TypedDict, total=False):
|
|
186
|
-
"""
|
|
187
|
-
Response from storing a credential.
|
|
188
|
-
|
|
189
|
-
Attributes:
|
|
190
|
-
succeeded: Whether the credential was stored successfully
|
|
191
|
-
name: The credential name
|
|
192
|
-
credential_id: The ID of the stored credential
|
|
193
|
-
error: Error message if the operation failed
|
|
194
|
-
"""
|
|
195
|
-
|
|
196
|
-
succeeded: bool
|
|
197
|
-
name: str
|
|
198
|
-
credential_id: str
|
|
199
|
-
error: str
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
class ListCredentialsResponse(TypedDict, total=False):
|
|
203
|
-
"""
|
|
204
|
-
Response from listing credentials.
|
|
205
|
-
|
|
206
|
-
Attributes:
|
|
207
|
-
succeeded: Whether the list operation succeeded
|
|
208
|
-
credentials: List of credential metadata (id, name, created_at, updated_at)
|
|
209
|
-
error: Error message if the operation failed
|
|
210
|
-
"""
|
|
211
|
-
|
|
212
|
-
succeeded: bool
|
|
213
|
-
credentials: list[dict[str, Any]]
|
|
214
|
-
error: str
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
class DeleteCredentialResponse(TypedDict, total=False):
|
|
218
|
-
"""
|
|
219
|
-
Response from deleting a credential.
|
|
220
|
-
|
|
221
|
-
Attributes:
|
|
222
|
-
succeeded: Whether the credential was deleted successfully
|
|
223
|
-
error: Error message if the operation failed
|
|
224
|
-
"""
|
|
225
|
-
|
|
226
|
-
succeeded: bool
|
|
227
|
-
error: str
|
|
228
|
-
|
|
229
|
-
|
|
230
185
|
class WebhookPayload(TypedDict, total=False):
|
|
231
186
|
"""
|
|
232
187
|
Payload received from a Simplex webhook.
|
|
233
188
|
|
|
234
189
|
Attributes:
|
|
235
190
|
success: Whether the session completed successfully
|
|
236
|
-
|
|
191
|
+
final_message: The agent's final message summarizing what was accomplished
|
|
237
192
|
session_id: The session identifier
|
|
238
193
|
file_metadata: Metadata for files created during the session
|
|
239
194
|
scraper_outputs: Scraper outputs collected during the session
|
|
@@ -246,7 +201,7 @@ class WebhookPayload(TypedDict, total=False):
|
|
|
246
201
|
"""
|
|
247
202
|
|
|
248
203
|
success: bool
|
|
249
|
-
|
|
204
|
+
final_message: str
|
|
250
205
|
session_id: str
|
|
251
206
|
file_metadata: list[FileMetadata]
|
|
252
207
|
scraper_outputs: dict[str, Any]
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|