Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 0 additions & 111 deletions .github/workflows/publish_pip.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ __pycache__/
.DS_Store
dist
whatsapp/
docs-repo/
docs-repo/
.env
truffile/app_runtime/
truffle/
73 changes: 73 additions & 0 deletions build/lib/truffile/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import os
import sys
from pathlib import Path

# Keep gRPC from enabling fork support in this CLI process.
os.environ["GRPC_ENABLE_FORK_SUPPORT"] = "false"


def _ensure_bundled_truffle_on_path() -> None:
repo_root = Path(__file__).resolve().parent.parent
bundled_truffle = repo_root / "truffle"
if not bundled_truffle.is_dir():
return

repo_root_str = str(repo_root)
if repo_root_str not in sys.path:
sys.path.insert(0, repo_root_str)


_ensure_bundled_truffle_on_path()

try:
from ._version import __version__
except ImportError:
__version__ = "0.1.dev0"

from .client import TruffleClient, ExecResult, UploadResult, resolve_mdns, NewSessionStatus
from .schedule import parse_runtime_policy

try:
from .sdk import (
ForegroundApp,
BackgroundWorkerApp,
tool,
ok,
err,
OAuth,
AppHarness,
ToolSpec,
)

# register app_runtime as an alias for truffile.app_runtime
# so old apps using "from app_runtime import ..." still work
# when only truffile is installed (no standalone app_runtime)
import truffile.app_runtime as _app_runtime
if "app_runtime" not in sys.modules:
sys.modules["app_runtime"] = _app_runtime
# register submodules so deep imports work too
for _submod in ("background", "mcp", "abrasive", "browser", "browser.web_fingerprint"):
_full = f"truffile.app_runtime.{_submod}"
_alias = f"app_runtime.{_submod}"
if _full in sys.modules and _alias not in sys.modules:
sys.modules[_alias] = sys.modules[_full]
except ImportError:
pass

__all__ = [
"__version__",
"TruffleClient",
"ExecResult",
"UploadResult",
"resolve_mdns",
"NewSessionStatus",
"parse_runtime_policy",
"ForegroundApp",
"BackgroundWorkerApp",
"tool",
"ok",
"err",
"OAuth",
"AppHarness",
"ToolSpec",
]
24 changes: 24 additions & 0 deletions build/lib/truffile/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# file generated by vcs-versioning
# don't change, don't track in version control
from __future__ import annotations

__all__ = [
"__version__",
"__version_tuple__",
"version",
"version_tuple",
"__commit_id__",
"commit_id",
]

version: str
__version__: str
__version_tuple__: tuple[int | str, ...]
version_tuple: tuple[int | str, ...]
commit_id: str | None
__commit_id__: str | None

__version__ = version = '0.1.36.dev9'
__version_tuple__ = version_tuple = (0, 1, 36, 'dev9')

__commit_id__ = commit_id = 'ge131e4e0f'
102 changes: 102 additions & 0 deletions build/lib/truffile/app_runtime/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
from .app_client import AppRuntimeClient, report_app_error, AppRuntimeErrorType
from .auth_modes import OAuthAuth, PublicAuth, TextConfigAuth, VncAuth, load_required_env
from .browser import ChromiumCDPBrowser
from .core import (
RuntimeConnectionInfo,
build_auth_metadata,
close_channel,
init_channel,
load_runtime_connection_info,
)
from .errors import AppAuthError, AppRuntimeFailure
from .foreground import ForegroundApp, ToolSpec
from .grpc_harness import InProcessGrpcServer
from .icons import phosphor_icon_url
from .jsonrpc import HttpxResponseAdapter, parse_jsonrpc_payload
from .mcp_harness import McpTestServer, call_tool
from .oauth import OAuth
from .protocols import (
ApiKeyProvider,
AuthProvider,
BrowserSessionProvider,
CookieStore,
HttpResponse,
HttpTransport,
OAuthProvider,
TokenStore,
)
from .responses import err, ok
from .result import truncate_items, truncate_result
from .stores import FileCookieStore, FileTokenStore, MemoryCookieStore, MemoryTokenStore
from .testing import (
AppHarness,
FakeApiKeyProvider,
FakeAuthProvider,
FakeBackgroundRuntime,
FakeHttpResponse,
FakeHttpTransport,
FakeOAuthProvider,
HarnessResult,
RecordedBackgroundError,
RecordedSubmission,
make_background_ctx,
)
from .worker import BackgroundApp, BackgroundWorkerApp, Submission

__all__ = [
"ApiKeyProvider",
"AppAuthError",
"AppHarness",
"AppRuntimeClient",
"AppRuntimeErrorType",
"AppRuntimeFailure",
"AuthProvider",
"BackgroundApp",
"BackgroundWorkerApp",
"BrowserSessionProvider",
"ChromiumCDPBrowser",
"CookieStore",
"FakeApiKeyProvider",
"FakeAuthProvider",
"FakeBackgroundRuntime",
"FakeHttpResponse",
"FakeHttpTransport",
"FakeOAuthProvider",
"FileCookieStore",
"FileTokenStore",
"ForegroundApp",
"HarnessResult",
"HttpResponse",
"HttpTransport",
"HttpxResponseAdapter",
"InProcessGrpcServer",
"McpTestServer",
"MemoryCookieStore",
"MemoryTokenStore",
"OAuth",
"OAuthAuth",
"OAuthProvider",
"PublicAuth",
"RecordedBackgroundError",
"RecordedSubmission",
"RuntimeConnectionInfo",
"Submission",
"TextConfigAuth",
"TokenStore",
"ToolSpec",
"VncAuth",
"build_auth_metadata",
"call_tool",
"close_channel",
"err",
"init_channel",
"load_required_env",
"load_runtime_connection_info",
"make_background_ctx",
"ok",
"parse_jsonrpc_payload",
"phosphor_icon_url",
"report_app_error",
"truncate_items",
"truncate_result",
]
1 change: 1 addition & 0 deletions build/lib/truffile/app_runtime/abrasive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# general helpers for webscraping
Loading