diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3eab1ca --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,46 @@ +name: Build and Release + +on: + push: + branches: [main] + tags: ['v*'] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install build dependencies + run: pip install build + + - name: Build wheel + run: python -m build + + - name: Test wheel installs and imports + run: | + pip install dist/*.whl + python -c "from truffile import TruffleClient; print('βœ“ Import OK')" + truffile --help + + - name: Upload wheel artifact + uses: actions/upload-artifact@v4 + with: + name: truffile-wheel + path: dist/*.whl + + - name: Upload sdist artifact + uses: actions/upload-artifact@v4 + with: + name: truffile-sdist + path: dist/*.tar.gz + diff --git a/.gitignore b/.gitignore index 56bd224..29c5afc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .venv/ -truffle/ -*.egg-info \ No newline at end of file +*.egg-info +__pycache__/ +.DS_Store +dist diff --git a/APP.md b/APP.md new file mode 100644 index 0000000..8125954 --- /dev/null +++ b/APP.md @@ -0,0 +1,454 @@ +# Building TruffleOS Apps +tell ralph i said hi + +this is without cli +sketch for what docs will be structured like and u can just feed this to whatever model with example app code to make u an app or ven an exisiting mcp and have it port it + +TruffleOS apps come in two flavors: **Focus** and **Background**. + +## App Types + +| Type | When it runs | What it does | +|------|--------------|--------------| +| **Focus** | Always on, waiting | Exposes tools the AI can call on demand | +| **Background** | On a schedule | Runs periodically, posts to user's feed | + +--- + +## Focus Apps + +Focus apps are MCP servers that expose tools to the device AI. When the user asks a question, the AI can call your tools. + +### Example: Finance App + +```python +from mcp.server.fastmcp import FastMCP + +HOST = "0.0.0.0" +PORT = 8000 + +mcp = FastMCP("finance", stateless_http=True, host=HOST, port=PORT) + +@mcp.tool("get_stock_price", description="Get current price for a stock ticker") +async def get_stock_price(symbol: str) -> str: + # fetch from API... + return f"{symbol}: $256.44" + +@mcp.tool("search_ticker", description="Search for stock ticker symbols") +async def search_ticker(keywords: str) -> str: + # search API... + return "AAPL - Apple Inc." + +def main(): + print(f"Starting MCP server on {HOST}:{PORT}") + mcp.run(transport="streamable-http") + +if __name__ == "__main__": + main() +``` + +### How Tool Calls Work + +1. User asks: "What's Apple stock at?" +2. Truffle sees your `get_stock_price` tool +3. calls `get_stock_price("AAPL")` +4. Your app returns the result +5. Truffle responds to you with the data + +### Focus App Requirements + +- Must run an MCP server on `0.0.0.0:8000` +- Use `transport="streamable-http"` +- Tools are defined with `@mcp.tool()` decorator +- Each tool needs a `description` for the AI to understand when to use it + +--- + +## Local Development (Focus Apps) + +You can run your MCP server locally on your machine instead of deploying to the device as well. This is great for fast iteration during development. + +### 1. Run the server locally + +```bash +cd your-app-directory +python app.py +``` + +You should see: +``` +Starting MCP server on 0.0.0.0:8000 +INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) +``` + +### 2. Get your machine's IP + +```bash +# macOS +ipconfig getifaddr en0 + +# Linux +hostname -I | awk '{print $1}' +``` + +### 3. Add MCP in TruffleOS Settings + +Go to Settings β†’ Add New MCP and enter: + +| Field | Value | +|-------|-------| +| **Name** | Your App Name | +| **Server URL** | `192.168.X.X` (your IP from step 2) | +| **Port** | `8000` | +| **Path** | `mcp` | + +Now you can use your tools immediately without deploying. Changes to your code take effect as soon as you restart `python app.py`. + +--- + +## Background Apps + +Background apps run on a schedule and post content to the user's feed. + +### Example: Hedge App + +```python +import os +from datetime import datetime +from gourmet.ambient import run_ambient, AmbientContext + +TICKERS = os.getenv("HEDGE_TICKERS", "AAPL,MSFT").split(",") + +def hedge_ambient(ctx: AmbientContext): + for symbol in TICKERS: + # fetch stock data... + price = 256.44 + + ctx.bg.post_to_feed( + title=f"πŸ“ˆ {symbol}: ${price}", + body=f"{symbol} is currently trading at ${price}", + src_uri=f"https://finance.yahoo.com/quote/{symbol}", + media_uris=["https://example.com/chart.png"], # optional + content_timestamp=datetime.now() + ) + +if __name__ == "__main__": + run_ambient(hedge_ambient) +``` + +### post_to_feed() Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `title` | str | yes | Card title shown in feed | +| `body` | str | yes | Main content text | +| `src_uri` | str | no | Link to original source | +| `media_uris` | list[str] | no | List of image URLs to display | +| `content_timestamp` | datetime | no | When the content was created | + +### Background App Requirements + +- Import `run_ambient` and `AmbientContext` from `gourmet.ambient` +- Define a function that takes `ctx: AmbientContext` +- Call `run_ambient(your_function)` in main +- Use `ctx.bg.post_to_feed()` to post content + +--- + +## truffile.yaml + +The `truffile.yaml` defines your app's metadata and installation steps. + +### Focus App Example + +```yaml +metadata: + name: Finance + type: foreground + description: | + Financial data tools for your Truffle. + process: + cmd: + - python + - app.py + working_directory: / + environment: + PYTHONUNBUFFERED: "1" + icon_file: ./icon.png + +steps: + - name: Welcome + type: welcome + content: | + This app provides financial data tools. + + - name: Copy files + type: files + files: + - source: ./app.py + destination: ./app.py + + - name: Install dependencies + type: bash + run: | + pip install mcp requests +``` + +### Background App Example + +```yaml +metadata: + name: Hedge + type: background + description: | + Track your stock portfolio. + process: + cmd: + - python + - app.py + working_directory: / + environment: + PYTHONUNBUFFERED: "1" + HEDGE_TICKERS: "AAPL,MSFT,GOOGL" + icon_file: ./icon.png + default_schedule: + type: interval + interval: + duration: 5m + schedule: + daily_window: "06:00-22:00" + allowed_days: [mon, tue, wed, thu, fri] + +steps: + - name: Copy files + type: files + files: + - source: ./app.py + destination: ./app.py + + - name: Install dependencies + type: bash + run: | + pip install requests + pip install gourmet +``` + +--- + +## Metadata Fields + +| Field | Required | Description | +|-------|----------|-------------| +| `name` | yes | App name shown to user | +| `type` | yes | `foreground` or `background` | +| `description` | no | What the app does | +| `process.cmd` | yes | Command to run the app | +| `process.working_directory` | no | Working dir (default: `/`) | +| `process.environment` | no | Environment variables | +| `icon_file` | no | Path to PNG icon | +| `default_schedule` | background only | When the app runs | + +--- + +## Schedule Types (Background Apps Only) + +### 1. Interval + +Run every X time period. + +```yaml +default_schedule: + type: interval + interval: + duration: 5m # required: how often + schedule: # optional: constraints + daily_window: "09:00-17:00" + allowed_days: [mon, tue, wed, thu, fri] +``` + +### 2. Times + +Run at specific times each day. + +```yaml +default_schedule: + type: times + times: + run_times: # required: list of times + - "09:00" + - "12:00" + - "18:00" + allowed_days: [mon, wed, fri] # optional +``` + +### 3. Always + +Run continuously (never stops). + +```yaml +default_schedule: + type: always +``` + +--- + +## Duration Format + +| Format | Example | Meaning | +|--------|---------|---------| +| `Xms` | `500ms` | 500 milliseconds | +| `Xs` | `30s` | 30 seconds | +| `Xm` | `5m` | 5 minutes | +| `Xh` | `2h` | 2 hours | +| `Xd` | `1d` | 1 day | + +--- + +## Daily Window + +Restrict when the app can run during the day. + +```yaml +daily_window: "09:00-17:30" +``` + +Or verbose format: + +```yaml +daily_window: + start: "09:00" + end: "17:30" +``` + +--- + +## Day Restrictions + +Use ONE of these (not both): + +**allowed_days** - only run on these days: +```yaml +allowed_days: [mon, tue, wed, thu, fri] +``` + +**forbidden_days** - don't run on these days: +```yaml +forbidden_days: [sat, sun] +``` + +Valid day values: `sun`, `mon`, `tue`, `wed`, `thu`, `fri`, `sat` + +--- + +## Installation Step Types + +### files + +Copy files from your app directory to the container. + +```yaml +- name: Copy files + type: files + files: + - source: ./app.py + destination: ./app.py + - source: ./config.yaml + destination: ./config.yaml + permissions: 600 # optional +``` + +### bash + +Run shell commands. + +```yaml +- name: Install dependencies + type: bash + run: | + pip install requests + apk add --no-cache curl +``` + +### welcome + +Show a welcome message to the user. + +```yaml +- name: Welcome + type: welcome + content: | + Welcome to my app! + It does cool things. +``` + +### text + +Prompt user for text input (saved to env vars). + +```yaml +- name: Configure API Key + type: text + content: | + Enter your API key to continue. + fields: + - name: api_key + label: API Key + type: password + env: MY_API_KEY + placeholder: "sk-..." +``` + +Field types: `text`, `password`, `number` + +### vnc + +Open a VNC window for user interaction (login flows, etc). + +```yaml +- name: Sign into Twitter + type: vnc + cmd: + - python + - onboard.py + closes_on_complete: true + description: | + Sign into your account in the browser window. +``` + +--- + +## Environment Variables + +Set in `process.environment`: + +```yaml +process: + environment: + PYTHONUNBUFFERED: "1" # always use this for Python apps + MY_API_KEY: "secret" + DEBUG: "true" +``` + +Or collected from user input via `text` steps (uses `env` field). + +--- + +## Quick Reference + +### Minimal Focus App + +``` +my-focus-app/ +β”œβ”€β”€ app.py # MCP server with @mcp.tool() functions +β”œβ”€β”€ truffile.yaml # type: foreground +└── icon.png # optional +``` + +### Minimal Background App + +``` +my-bg-app/ +β”œβ”€β”€ app.py # Uses run_ambient() + post_to_feed() +β”œβ”€β”€ truffile.yaml # type: background + default_schedule +└── icon.png # optional +``` diff --git a/README.md b/README.md index 255b8f5..b198ddc 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,78 @@ -genesis -hope the name survives +# truffile -used same protos (copied it over) -setup pyproject +TruffleOS SDK - deploy apps to Truffle devices +## install ```bash -cd /Users/truffle/work/3fw/genesis -python -m venv .venv -source .venv/bin/activate +pip install truffile +``` + +or from source: +```bash +git clone +cd truffile pip install -e . ``` -imports working + +## commands + +```bash +# find truffle devices on your network +truffile scan + +# connect to a device (first time requires approval on device) +truffile connect truffle-6272 + +# deploy an app from current directory +truffile deploy + +# deploy an app from a specific path +truffile deploy ./my-app + +# deploy with interactive shell (for debugging) +truffile deploy -i + +# list installed apps on connected device +truffile list apps + +# list connected devices +truffile list devices + +# disconnect from a device +truffile disconnect truffle-6272 + +# disconnect from all devices +truffile disconnect all +``` + +## truffile.yaml + +apps need a `truffile.yaml` in their directory: + +```yaml +metadata: + name: My App + description: does cool stuff + type: ambient # or focus + +files: + - app.py + - icon.png + +run: | + pip install requests + pip install gourmet[ambient] --extra-index-url https://test.pypi.org/simple/ + +process: + cmd: python + args: [app.py] + env: + MY_VAR: value +``` + +## example apps + +see `example-apps/` for working examples: +- `example-apps/ambient/hedge` - background app +- `example-apps/focus/finance` - foreground app diff --git a/deploy_test.py b/deploy_test.py new file mode 100644 index 0000000..5741f7a --- /dev/null +++ b/deploy_test.py @@ -0,0 +1,193 @@ +#!/usr/bin/env python3 +import asyncio +import sys +from pathlib import Path +import yaml +from truffile import TruffleClient + +# add your truffle ip (get it with ping truffle-xxxx.local) +DEVICE_ADDRESS = "192.168.1.32:80" +TOKEN = "go get your token" + + +def parse_truffile(app_dir: Path) -> dict: + truffile = app_dir / "truffile.yaml" + if not truffile.exists(): + raise FileNotFoundError(f"No truffile.yaml in {app_dir}") + with open(truffile) as f: + return yaml.safe_load(f) + + +async def deploy_focus_app(app_dir: Path): + app_dir = Path(app_dir).resolve() + config = parse_truffile(app_dir) + meta = config["metadata"] + + name = meta["name"] + description = meta.get("description", "") + process = meta.get("process", {}) + cmd_list = process.get("cmd", ["python", "app.py"]) + cwd = process.get("working_directory", "/") + env_dict = process.get("environment", {}) + env = [f"{k}={v}" for k, v in env_dict.items()] + icon_file = meta.get("icon_file") + icon_path = (app_dir / icon_file) if icon_file else None + + print(f"Deploying FOCUS app: {name}") + print(f" Directory: {app_dir}") + + client = TruffleClient(DEVICE_ADDRESS, token=TOKEN) + await client.connect() + print(f" Connected to {DEVICE_ADDRESS}") + + await client.start_build() + print(f" Build session: {client.app_uuid}") + + try: + for step in config.get("steps", []): + if step["type"] == "files": + for f in step.get("files", []): + src = app_dir / f["source"] + dest = f["destination"] + print(f" Uploading {src.name} -> {dest}") + result = await client.upload(src, dest) + print(f" {result.bytes} bytes") + elif step["type"] == "bash": + print(f" Running: {step['name']}") + r = await client.exec(step["run"]) + print(f" Exit code: {r.exit_code}") + if r.exit_code != 0: + for line in r.output[-10:]: + print(f" {line}") + + print(f" Finishing as foreground app...") + await client.finish_foreground( + name=name, + cmd=cmd_list[0] if cmd_list[0].startswith("/") else f"/usr/bin/{cmd_list[0]}", + args=cmd_list[1:], + cwd=cwd, + env=env, + description=description, + icon=icon_path, + ) + print(f"Done! {name} deployed as focus app.") + + except Exception as e: + print(f"Error: {e}") + await client.discard() + raise + finally: + await client.close() + + +async def deploy_ambient_app(app_dir: Path): + app_dir = Path(app_dir).resolve() + config = parse_truffile(app_dir) + meta = config["metadata"] + + name = meta["name"] + description = meta.get("description", "") + process = meta.get("process", {}) + cmd_list = process.get("cmd", ["python", "app.py"]) + cwd = process.get("working_directory", "/") + env_dict = process.get("environment", {}) + env = [f"{k}={v}" for k, v in env_dict.items()] + icon_file = meta.get("icon_file") + icon_path = (app_dir / icon_file) if icon_file else None + + schedule_cfg = meta.get("default_schedule", {}) + schedule_type = schedule_cfg.get("type", "interval") + interval_seconds = 60 + daily_start_hour = None + daily_end_hour = None + + if schedule_type == "interval": + interval_cfg = schedule_cfg.get("interval", {}) + duration_str = interval_cfg.get("duration", "1m") + if duration_str.endswith("m"): + interval_seconds = int(duration_str[:-1]) * 60 + elif duration_str.endswith("h"): + interval_seconds = int(duration_str[:-1]) * 3600 + elif duration_str.endswith("s"): + interval_seconds = int(duration_str[:-1]) + + sched = interval_cfg.get("schedule", {}) + # Skip daily window for now - let it run anytime + # daily_window = sched.get("daily_window") + # if daily_window and "-" in daily_window: + # start, end = daily_window.split("-") + # daily_start_hour = int(start.split(":")[0]) + # daily_end_hour = int(end.split(":")[0]) + + print(f"Deploying AMBIENT app: {name}") + print(f" Directory: {app_dir}") + print(f" Schedule: {schedule_type}, interval={interval_seconds}s") + + client = TruffleClient(DEVICE_ADDRESS, token=TOKEN) + await client.connect() + print(f" Connected to {DEVICE_ADDRESS}") + + await client.start_build() + print(f" Build session: {client.app_uuid}") + + try: + for step in config.get("steps", []): + if step["type"] == "files": + for f in step.get("files", []): + src = app_dir / f["source"] + dest = f["destination"] + print(f" Uploading {src.name} -> {dest}") + result = await client.upload(src, dest) + print(f" {result.bytes} bytes") + elif step["type"] == "bash": + print(f" Running: {step['name']}") + r = await client.exec(step["run"]) + print(f" Exit code: {r.exit_code}") + if r.exit_code != 0: + for line in r.output[-10:]: + print(f" {line}") + + print(f" Finishing as background app...") + await client.finish_background( + name=name, + cmd=cmd_list[0] if cmd_list[0].startswith("/") else f"/usr/bin/{cmd_list[0]}", + args=cmd_list[1:], + cwd=cwd, + env=env, + description=description, + icon=icon_path, + schedule=schedule_type, + interval_seconds=interval_seconds, + daily_start_hour=daily_start_hour, + daily_end_hour=daily_end_hour, + ) + print(f"Done! {name} deployed as ambient app.") + + except Exception as e: + print(f"Error: {e}") + await client.discard() + raise + finally: + await client.close() + + +if __name__ == "__main__": + if len(sys.argv) < 3: + print("Usage: python deploy_test.py ") + print() + print("Examples:") + print(" python deploy_test.py focus ./example-apps/focus/finance") + print(" python deploy_test.py ambient ./example-apps/ambient/hedge") + sys.exit(1) + + app_type = sys.argv[1].lower() + app_path = Path(sys.argv[2]) + + if app_type == "focus": + asyncio.run(deploy_focus_app(app_path)) + elif app_type == "ambient": + asyncio.run(deploy_ambient_app(app_path)) + else: + print(f"Unknown type: {app_type}") + print("Use 'focus' for foreground apps or 'ambient' for background apps") + sys.exit(1) diff --git a/example-apps/ambient/hedge/app.py b/example-apps/ambient/hedge/app.py new file mode 100644 index 0000000..f643e14 --- /dev/null +++ b/example-apps/ambient/hedge/app.py @@ -0,0 +1,120 @@ +import os +import requests +import urllib.parse +from datetime import datetime +from gourmet.ambient import run_ambient, AmbientContext +import logging + +logger = logging.getLogger("hedge") +logger.setLevel(logging.DEBUG) + +API_KEY = os.getenv("ALPHAVANTAGE_API_KEY", "go get your key dudes") +TICKERS = os.getenv("HEDGE_TICKERS", "AAPL,MSFT,GOOGL,IREN").split(",") +BASE_URL = "https://www.alphavantage.co/query" + + +def fetch_daily_data(symbol: str) -> dict | None: + try: + resp = requests.get(BASE_URL, params={ + "function": "TIME_SERIES_DAILY", + "symbol": symbol.strip().upper(), + "outputsize": "compact", + "apikey": API_KEY, + }, timeout=30) + resp.raise_for_status() + data = resp.json() + if "Time Series (Daily)" not in data: + logger.warning(f"No daily data for {symbol}: {data}") + return None + return data + except Exception as e: + logger.error(f"Failed to fetch {symbol}: {e}") + return None + + +def generate_chart_url(symbol: str, dates: list[str], prices: list[float]) -> str: + chart_config = { + "type": "line", + "data": { + "labels": dates, + "datasets": [{ + "label": symbol, + "data": prices, + "fill": False, + "borderColor": "#4CAF50", + "tension": 0.1, + "pointRadius": 2, + }] + }, + "options": { + "plugins": { + "legend": {"display": False}, + "title": {"display": True, "text": f"{symbol} - Last 5 Days"} + }, + "scales": { + "y": {"beginAtZero": False} + } + } + } + chart_json = str(chart_config).replace("'", '"').replace("False", "false").replace("True", "true") + encoded = urllib.parse.quote(chart_json, safe='') + return f"https://quickchart.io/chart?c={encoded}&w=400&h=200&bkg=white" + + +def hedge_ambient(ctx: AmbientContext): + logger.info(f"Hedge running for tickers: {TICKERS}") + + for symbol in TICKERS: + symbol = symbol.strip().upper() + if not symbol: + continue + + data = fetch_daily_data(symbol) + if not data: + continue + + ts = data["Time Series (Daily)"] + sorted_dates = sorted(ts.keys(), reverse=True)[:5] + sorted_dates.reverse() + + dates = [d[5:] for d in sorted_dates] + prices = [float(ts[d]["4. close"]) for d in sorted_dates] + + today = sorted_dates[-1] + today_data = ts[today] + current_price = float(today_data["4. close"]) + open_price = float(today_data["1. open"]) + high = float(today_data["2. high"]) + low = float(today_data["3. low"]) + volume = int(today_data["5. volume"]) + + change = current_price - open_price + change_pct = (change / open_price) * 100 if open_price else 0 + arrow = "πŸ“ˆ" if change >= 0 else "πŸ“‰" + + chart_url = generate_chart_url(symbol, dates, prices) + + title = f"{arrow} {symbol}: ${current_price:.2f}" + body = f""" +{symbol} Stock Update + +Price: ${current_price:.2f} +Change: {'+' if change >= 0 else ''}{change:.2f} ({'+' if change_pct >= 0 else ''}{change_pct:.2f}%) + +Today's Range: ${low:.2f} - ${high:.2f} +Volume: {volume:,} +""".strip() + + logger.info(f"Posting {symbol} to feed: {title}") + ctx.bg.post_to_feed( + title=title, + body=body, + src_uri=f"https://finance.yahoo.com/quote/{symbol}", + media_uris=[chart_url], + content_timestamp=datetime.now() + ) + logger.info(f"Posted {symbol} to feed") + + +if __name__ == "__main__": + run_ambient(hedge_ambient) diff --git a/example-apps/ambient/hedge/icon.png b/example-apps/ambient/hedge/icon.png new file mode 100644 index 0000000..27bcddf Binary files /dev/null and b/example-apps/ambient/hedge/icon.png differ diff --git a/example-apps/ambient/hedge/truffile.yaml b/example-apps/ambient/hedge/truffile.yaml new file mode 100644 index 0000000..c8f2779 --- /dev/null +++ b/example-apps/ambient/hedge/truffile.yaml @@ -0,0 +1,25 @@ +metadata: + name: Hedge + type: background + description: | + Track your stock portfolio with live price updates and charts in your feed. + Configure your tickers via the HEDGE_TICKERS environment variable. + process: + cmd: + - python + - app.py + working_directory: / + environment: + PYTHONUNBUFFERED: "1" + HEDGE_TICKERS: "AAPL,MSFT,GOOGL" + icon_file: ./icon.png + default_schedule: + type: interval + interval: + duration: 2m +files: + - source: ./app.py + destination: ./app.py +run: | + pip install --no-cache-dir requests + pip install --no-cache-dir -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ 'gourmet[ambient]==0.1.dev45' \ No newline at end of file diff --git a/example-apps/ambient/reddit/icon.png b/example-apps/ambient/reddit/icon.png new file mode 100644 index 0000000..6bd4185 Binary files /dev/null and b/example-apps/ambient/reddit/icon.png differ diff --git a/example-apps/ambient/reddit/reddit.py b/example-apps/ambient/reddit/reddit.py new file mode 100644 index 0000000..85e4372 --- /dev/null +++ b/example-apps/ambient/reddit/reddit.py @@ -0,0 +1,432 @@ +from gourmet.ambient import run_ambient, AmbientContext, InferenceClient + +from abrasive.extract import extract_content_from_url, ExtractedContent +from abrasive.fetch import USER_AGENT +from typing import Deque, List, Optional, Tuple, Any +from collections import deque +import logging +import requests +from dataclasses import dataclass +import logging +import time +import os +from datetime import datetime +from datetime import UTC +logger = logging.getLogger("reddit") +logger.setLevel(logging.DEBUG) + +REDDIT_JSON_REQUESTS_PER_MINUTE = 10 +REDDIT_JSON_RATE_LIMIT_SECONDS = 60 / REDDIT_JSON_REQUESTS_PER_MINUTE + +DEFAULT_SUBREDDITS = ["news", "worldnews", "all"] +SORT = "hot" # "hot", "new", "top", ... +POST_LIMIT = 32 + +@dataclass +class RedditConfig: + subreddits: List[str] + user_feed_url: Optional[str] + sort : str = SORT + post_limit : int = POST_LIMIT + + def get_listing_url(self) -> str: + if self.user_feed_url: + return self.user_feed_url + else: + return f"https://www.reddit.com/r/{'+'.join(self.subreddits)}/{self.sort}/.json" + + @staticmethod + def load_reddit_config_from_env() -> "RedditConfig": + subreddits_str = os.getenv("SUBREDDITS", "").strip() + user_feed_url = os.getenv("USER_FEED_URL", "").strip() + + subreddits: List[str] = [] + + # user may have done comma space or just comma + if subreddits_str: + subreddits = [s.strip() for s in subreddits_str.split(",") if s.strip()] + else: + subreddits = DEFAULT_SUBREDDITS + + if user_feed_url: + assert isinstance(user_feed_url, str) + # validate url format minimally + if not ( user_feed_url.startswith("http://") or user_feed_url.startswith("https://")): + logger.warning("Invalid USER_FEED_URL format, ignoring: %s", user_feed_url) + user_feed_url = None + elif not "reddit.com" in user_feed_url: + logger.warning("USER_FEED_URL does not appear to be a reddit.com url, ignoring: %s", user_feed_url) + user_feed_url = None + if user_feed_url and ".rss" in user_feed_url: + logger.warning("USER_FEED_URL appears to be an RSS feed, expected JSON feed, replacing: %s", user_feed_url) + user_feed_url = user_feed_url.replace(".rss", ".json") + + if user_feed_url and not ".json?feed=" in user_feed_url: + logger.warning("USER_FEED_URL does not appear to be a reddit JSON feed url, ignoring: %s", user_feed_url) + user_feed_url = None + elif user_feed_url and not "user=" in user_feed_url: + logger.warning("USER_FEED_URL does not appear to be a user frontpage feed url, ignoring: %s", user_feed_url) + user_feed_url = None + + if user_feed_url: + # add sort + # https://old.reddit.com/.json?feed=uuid1234ffffaaaa&user=bobnal&sort=new + dotjson_index = user_feed_url.find("/.json") + if dotjson_index != -1: + user_feed_url = f"{user_feed_url[:dotjson_index]}/{SORT}{user_feed_url[dotjson_index:]}" + else: + logger.warning("Could not find /.json in USER_FEED_URL, could not add sort!", user_feed_url) + + return RedditConfig( + subreddits=subreddits, + user_feed_url=user_feed_url + ) + +reddit_config = RedditConfig.load_reddit_config_from_env() + + + +@dataclass +class RedditPost: + fullname: str # "t3_xxx" + id: str # bare id, e.g. "1pczt9f" + title: str + subreddit: str + permalink: str # "/r/.../comments/..." + comments_url: str # "https://www.reddit.com" + permalink + article_url: str # external link or self post url + image_urls: Optional[List[str]] + score: int + num_comments: int + created_utc: datetime + domain: str + +@dataclass +class RedditComment: + id: str + author: Optional[str] + body: str # markdown text + score: Optional[int] + permalink: str + +_seen_reddit: set[str] = set() +_pending_reddit: Deque[RedditPost] = deque() +_listing_after: Optional[str] = None +_listing_after_fp: Optional[str] = None + +last_request_time = time.time() - REDDIT_JSON_RATE_LIMIT_SECONDS +def reddit_request(url: str, params: dict, timeout: int = 10) -> requests.Response: + global last_request_time + elapsed = time.time() - last_request_time + if elapsed < REDDIT_JSON_RATE_LIMIT_SECONDS: + time.sleep((REDDIT_JSON_RATE_LIMIT_SECONDS - elapsed) + 0.25 ) + last_request_time = time.time() + headers = { + "User-Agent": USER_AGENT, + "Connection": "close", + } + logger.warning("Reddit JSON request to %s with params %s", url, params) + resp = requests.get(url, params=params, headers=headers, timeout=timeout) + resp.raise_for_status() + return resp + +def _fetch_listing(after: Optional[str] = None) -> Tuple[List[RedditPost], Optional[str]]: + params : dict[str, Any]= {"limit": POST_LIMIT, "sort" : "new"} + if after: + params["after"] = after + global reddit_config + + resp = reddit_request(reddit_config.get_listing_url(), params=params, timeout=10) + resp.raise_for_status() + data = resp.json()["data"] + children = data.get("children", []) + after_token = data.get("after") + + posts: List[RedditPost] = [] + for child in children: + if child.get("kind") != "t3": + continue + d : dict[str, Any] = child["data"] + + fullname = d.get("name") + if not fullname: + continue + + permalink = d.get("permalink") or "" + comments_url = f"https://www.reddit.com{permalink}" if permalink else "" + + article_url = d.get("url_overridden_by_dest") or d.get("url") or "" + + # get best image + image_urls: List[str]= [] + if 'preview' in d and 'images' in d['preview'] and len(d['preview']['images']) > 0: + for img in d['preview']['images']: + if 'source' in img and 'url' in img['source']: + image_urls.append(img['source']['url'].replace("&", "&")) + + if not image_urls: + thumb = d.get("thumbnail") + if thumb and thumb.startswith("http"): + image_urls.append(thumb.replace("&", "&")) + + + created_float = float(d.get("created_utc") or 0.0) + created_utc = datetime.fromtimestamp(created_float, tz=UTC) if created_float > 0.0 else datetime.now() + posts.append( + RedditPost( + fullname=fullname, + id=d.get("id", ""), + title=d.get("title", ""), + subreddit=d.get("subreddit", ""), + permalink=permalink, + comments_url=comments_url, + article_url=article_url, + image_urls=image_urls if image_urls else None, + score=int(d.get("score") or 0), + num_comments=int(d.get("num_comments") or 0), + created_utc=created_utc, + domain=d.get("domain", ""), + ) + ) + + return posts, after_token + + +def _refill_from_frontpage() -> bool: + global _listing_after_fp + posts, after_token = _fetch_listing(after=None) + _listing_after_fp = after_token + + added = 0 + for p in posts: + if p.fullname in _seen_reddit: + continue + _pending_reddit.append(p) + added += 1 + + logger.debug("frontpage refill added %d posts", added) + return added > 0 + + +def _refill_from_older() -> bool: + global _listing_after + # if not _listing_after: + # return False + + posts, after_token = _fetch_listing(after=_listing_after) + _listing_after = after_token + + added = 0 + for p in posts: + if p.fullname in _seen_reddit: + continue + _pending_reddit.append(p) + added += 1 + + logger.debug("older-page refill added %d posts (after=%s)", added, _listing_after) + return added > 0 + + +def _refill_reddit(): + if _refill_from_frontpage(): + return + _refill_from_older() + + +def _next_new_reddit_item() -> Optional[RedditPost]: + global _pending_reddit, _seen_reddit + + if not _pending_reddit: + _refill_reddit() + + if not _pending_reddit: + return None + + item = _pending_reddit.popleft() + _seen_reddit.add(item.fullname) + return item + + +def fetch_post_comments( + post: RedditPost, + max_top: int = 10, +) -> List[RedditComment]: + if not post.permalink: + return [] + + url = f"https://www.reddit.com{post.permalink.rstrip('/')}.json" + resp = reddit_request(url, params={"sort": "top", "limit": 50}, timeout=10) + resp.raise_for_status() + blob = resp.json() + + if not isinstance(blob, list) or len(blob) < 2: + return [] + + comments_listing = blob[1]["data"]["children"] + + raw: List[RedditComment] = [] + for child in comments_listing: + if child.get("kind") != "t1": + continue + d = child["data"] + body = d.get("body") + if not body: + continue + + permalink = d.get("permalink") or "" + raw.append( + RedditComment( + id=d.get("id", ""), + author=d.get("author"), + body=body, + score=d.get("score"), + permalink=f"https://www.reddit.com{permalink}" if permalink else "", + ) + ) + + if not raw: + return [] + + raw.sort(key=lambda c: (c.score or 0), reverse=True) + top = raw[:max_top] + + # maybe merit to adding worst comments too? if downvoted + worst = min(raw, key=lambda c: (c.score or 0)) + if worst not in top and len(top) < max_top + 1: + top.append(worst) + + return top + + +def get_content_for_reddit_item( + item: RedditPost, +) -> Tuple[ExtractedContent | None, List[RedditComment]]: + try: + link_content = None + if item.article_url and not item.domain.startswith("self."): + link_content = extract_content_from_url(item.article_url) + comments = fetch_post_comments(item, max_top=10) + return link_content, comments + except Exception as e: + logger.error("Error fetching content for %s: %s", item.fullname, e, exc_info=True) + return None, [] + +def validate_reddit_config(config: RedditConfig) -> bool: + try: + url = config.get_listing_url() + resp = reddit_request(url, params={"limit": 1}, timeout=10) + resp.raise_for_status() + data = resp.json() + if "data" not in data: + logger.error("Reddit config validation failed: no 'data' in response") + return False + return True + except Exception as e: + logger.error("Reddit config validation error: %s", e, exc_info=True) + return False + +def test_once(): + item = _next_new_reddit_item() + if item is None: + print("No new reddit items.") + return + + logger.info( + "Processing Reddit post %s [%s] %s (%s) score=%d comments=%d imgs=[%s]", + item.fullname, + item.subreddit, + item.title, + item.article_url, + item.score, + item.num_comments, + " ".join(item.image_urls) if item.image_urls else "None", + ) + post, comments = get_content_for_reddit_item(item) + print("Post:", item.title) + print("Article URL:", item.article_url) + print("Comments fetched:", len(comments)) + print("thumb:", item.image_urls or "None") + print("Top comments:") + for c in comments[:3]: + print(f"- @{c.author} [{c.score}]: {c.body[:160].replace('\n', ' ')}...") + print("Article text:", post.text[:500].replace("\n", " ") if post and post.text else "None") + print("article images:", post.images[0] if post and len(post.images) else "None") + print("-----") + +TESTING_MODE = False + +def run_test(): + global reddit_config + + logger.info("Starting reddit JSON ambient test...") + logger.info("using reddit listing url: %s", reddit_config.get_listing_url()) + + + while True: + try: + test_once() + time.sleep(5) + except KeyboardInterrupt: + print("Exiting.") + break + +def process_reddit_item(ctx: AmbientContext, item: RedditPost): + title, url, item_id, subreddit, image_urls = ( + item.title, + item.article_url, + item.fullname, + item.subreddit, + item.image_urls, + ) + logger.info(f"Processing Reddit item {item_id}: {title} ({url}) {subreddit if subreddit else ''} {image_urls if image_urls else ''}") + link_content, comments = get_content_for_reddit_item(item) + ctx.bg.post_to_feed( + title=link_content.title if link_content and link_content.title else title, + body=link_content.text if link_content and link_content.text else f'**{subreddit}** {item.domain} {item.score}', + src_uri=url, + media_uris=link_content.images if link_content and link_content.images else (image_urls if image_urls else []), + content_timestamp = link_content.date if link_content and link_content.date else item.created_utc + ) + +def reddit_ambient(ctx: AmbientContext): + for _ in range(3): + item = _next_new_reddit_item() + if not item: + logger.info("No new reddit items to process.") + return + process_reddit_item(ctx, item) + + return + + + #post_body = f"{f'**{subreddit}**' if subreddit else ''} {item.score }\n" + # + + # if link_content and link_content.text: + # post_body += f"\n\n{link_content.text[:2000]}" + + # if comments: + # post_body += "\n\n**Top Comments:**\n" + # for c in comments: + # post_body += f"- @{c.author if c.author else 'unknown'}: {c.body[:300].replace('\n', ' ')}...\n" + + + + +if __name__ == "__main__": + import sys + if sys.argv and len(sys.argv) > 1 and sys.argv[1] and "verify" in sys.argv[1].lower(): + logger.info("Verifying reddit configuration...") + ok = validate_reddit_config(reddit_config) + logger.info("Reddit configuration valid: %s", str(reddit_config)) if ok else logger.error("Reddit configuration invalid!") + sys.exit(0 if ok else 1) + + if TESTING_MODE: + run_test() + else: + run_ambient(reddit_ambient) + + +# :cp ./apps/ambient/reddit.py /app.py +# :cp /home/dylan/ds/3fw/python/dist/gourmet-0.1.dev0-py3-none-any.whl /tmp/gourmet-0.1.dev0-py3-none-any.whl +# pip install /tmp/gourmet-0.1.dev0-py3-none-any.whl[abrasive] \ No newline at end of file diff --git a/example-apps/ambient/reddit/truffile.yaml b/example-apps/ambient/reddit/truffile.yaml new file mode 100644 index 0000000..3162af9 --- /dev/null +++ b/example-apps/ambient/reddit/truffile.yaml @@ -0,0 +1,70 @@ +metadata: + name: Front Page of the Internet + type: background + description: | + Have your TruffleΒΉ browse Reddit and post relevant content to your feed. + process: + cmd: + - python + - /opt/reddit.py + working_directory: / + environment: + PYTHONUNBUFFERED: "1" + + icon_file: ./icon.png + default_schedule: + type: interval + interval: + duration: 15m + schedule: + daily_window: "01:00-22:30" +steps: + - name: Reddit Setup + type: welcome + content: | + The Reddit app will allow your Truffle to post relevant content from Reddit on your feed. + You can customize which subreddits to follow in the configuration step. + Please use this app in accordance with Reddit's terms of service. + - name: Install dependencies + type: bash + run: | + pip install --no-cache-dir --force-reinstall requests feedparser trafilatura==2.0.0 tld==0.13.1 + - name: Copy application files + type: files + files: + - source: ./reddit.py + destination: ./opt/reddit.py + - name: Configure Reddit + type: text + content: | + Please provide either a comma separated list of subreddits to follow, or leave blank to follow r/all. + Example: news, worldnews, technology, science, funny, pics, videos, gaming + Alternatively, [copy the URL of your personal frontpage RSS feed (JSON) from here](https://old.reddit.com/prefs/feeds/) + If a personal feed URL is provided, that will be used instead of the subreddit list if the URL is valid. + fields: + - name: subreddits + label: Comma Separated Subreddits + type: text + placeholder: news, worldnews, technology, LosAngeles + default: all + env: SUBREDDITS + - name: user_feed_url + label: Optional - Personal Frontpage RSS Feed URL (JSON) + type: text + placeholder: + default: + env: USER_FEED_URL + validator: + type: bash + run: | + python /opt/reddit.py --verify + timeout: 60 + error_message: | + Was unable to scrape Reddit with the provided configuration. + Please ensure the subreddit names are valid or the feed URL is correct. + + + + + + \ No newline at end of file diff --git a/example-apps/focus/finance/app.py b/example-apps/focus/finance/app.py new file mode 100644 index 0000000..8deff0e --- /dev/null +++ b/example-apps/focus/finance/app.py @@ -0,0 +1,157 @@ +import requests +from mcp.server.fastmcp import FastMCP + +API_KEY = "nope" +BASE_URL = "https://www.alphavantage.co/query" + +HOST = "0.0.0.0" +PORT = 8000 + +mcp = FastMCP("finance", stateless_http=True, host=HOST, port=PORT) + + +def _call_av(function: str, **params) -> dict: + params["function"] = function + params["apikey"] = API_KEY + resp = requests.get(BASE_URL, params=params, timeout=30) + resp.raise_for_status() + return resp.json() + + +@mcp.tool("get_stock_price", description="Get current price and daily stats for a stock ticker (e.g. AAPL, MSFT, TSLA)") +async def get_stock_price(symbol: str) -> str: + data = _call_av("GLOBAL_QUOTE", symbol=symbol.upper()) + quote = data.get("Global Quote", {}) + if not quote: + return f"No data found for {symbol}" + return f""" +{quote.get('01. symbol', symbol)} +Price: ${quote.get('05. price', 'N/A')} +Change: {quote.get('09. change', 'N/A')} ({quote.get('10. change percent', 'N/A')}) +Open: ${quote.get('02. open', 'N/A')} +High: ${quote.get('03. high', 'N/A')} +Low: ${quote.get('04. low', 'N/A')} +Volume: {quote.get('06. volume', 'N/A')} +Previous Close: ${quote.get('08. previous close', 'N/A')} +""".strip() + + +@mcp.tool("get_stock_history", description="Get daily price history for a stock. Returns last 30 days by default.") +async def get_stock_history(symbol: str, days: int = 30) -> str: + data = _call_av("TIME_SERIES_DAILY", symbol=symbol.upper(), outputsize="compact") + ts = data.get("Time Series (Daily)", {}) + if not ts: + return f"No historical data for {symbol}" + lines = [f"{symbol.upper()} - Last {min(days, len(ts))} trading days:"] + for i, (date, vals) in enumerate(sorted(ts.items(), reverse=True)): + if i >= days: + break + lines.append(f"{date}: Open ${vals['1. open']} | High ${vals['2. high']} | Low ${vals['3. low']} | Close ${vals['4. close']} | Vol {vals['5. volume']}") + return "\n".join(lines) + + +@mcp.tool("get_company_overview", description="Get company profile, financials, and key metrics for a stock") +async def get_company_overview(symbol: str) -> str: + data = _call_av("OVERVIEW", symbol=symbol.upper()) + if not data or "Symbol" not in data: + return f"No company data for {symbol}" + return f""" +{data.get('Name', symbol)} ({data.get('Symbol', '')}) +Sector: {data.get('Sector', 'N/A')} | Industry: {data.get('Industry', 'N/A')} +Market Cap: ${data.get('MarketCapitalization', 'N/A')} +P/E Ratio: {data.get('PERatio', 'N/A')} | EPS: ${data.get('EPS', 'N/A')} +52-Week High: ${data.get('52WeekHigh', 'N/A')} | 52-Week Low: ${data.get('52WeekLow', 'N/A')} +Dividend Yield: {data.get('DividendYield', 'N/A')} +Description: {data.get('Description', 'N/A')[:500]}... +""".strip() + + +@mcp.tool("search_ticker", description="Search for stock ticker symbols by company name or keywords") +async def search_ticker(keywords: str) -> str: + data = _call_av("SYMBOL_SEARCH", keywords=keywords) + matches = data.get("bestMatches", []) + if not matches: + return f"No matches for '{keywords}'" + lines = [f"Search results for '{keywords}':"] + for m in matches[:10]: + lines.append(f" {m.get('1. symbol', '')} - {m.get('2. name', '')} ({m.get('4. region', '')})") + return "\n".join(lines) + + +@mcp.tool("get_market_news", description="Get latest market news and sentiment for a stock or topic") +async def get_market_news(tickers: str = "", topics: str = "", limit: int = 5) -> str: + params = {"limit": min(limit, 50)} + if tickers: + params["tickers"] = tickers.upper() + if topics: + params["topics"] = topics + data = _call_av("NEWS_SENTIMENT", **params) + feed = data.get("feed", []) + if not feed: + return "No news found" + lines = ["Latest Market News:"] + for article in feed[:limit]: + sentiment = article.get("overall_sentiment_label", "") + lines.append(f"[{sentiment}] {article.get('title', 'No title')}") + lines.append(f" Source: {article.get('source', 'Unknown')} | {article.get('time_published', '')[:10]}") + lines.append(f" {article.get('summary', '')[:200]}...") + lines.append("") + return "\n".join(lines) + + +@mcp.tool("get_top_movers", description="Get top gainers, losers, and most actively traded stocks today") +async def get_top_movers() -> str: + data = _call_av("TOP_GAINERS_LOSERS") + lines = [] + for category in ["top_gainers", "top_losers", "most_actively_traded"]: + items = data.get(category, [])[:5] + if items: + lines.append(f"\n{category.replace('_', ' ').title()}:") + for item in items: + lines.append(f" {item.get('ticker', '')} ${item.get('price', '')} ({item.get('change_percentage', '')})") + return "\n".join(lines).strip() or "No market data available" + + +@mcp.tool("get_crypto_price", description="Get current exchange rate for a cryptocurrency (e.g. BTC, ETH)") +async def get_crypto_price(crypto: str, currency: str = "USD") -> str: + data = _call_av("CURRENCY_EXCHANGE_RATE", from_currency=crypto.upper(), to_currency=currency.upper()) + rate = data.get("Realtime Currency Exchange Rate", {}) + if not rate: + return f"No data for {crypto}/{currency}" + return f""" +{rate.get('1. From_Currency Code', crypto)} β†’ {rate.get('3. To_Currency Code', currency)} +Rate: {rate.get('5. Exchange Rate', 'N/A')} +Bid: {rate.get('8. Bid Price', 'N/A')} | Ask: {rate.get('9. Ask Price', 'N/A')} +Last Updated: {rate.get('6. Last Refreshed', 'N/A')} +""".strip() + + +@mcp.tool("get_economic_indicator", description="Get economic indicators: GDP, CPI, UNEMPLOYMENT, INTEREST_RATE, INFLATION") +async def get_economic_indicator(indicator: str) -> str: + indicator = indicator.upper() + func_map = { + "GDP": "REAL_GDP", + "CPI": "CPI", + "UNEMPLOYMENT": "UNEMPLOYMENT", + "INTEREST_RATE": "FEDERAL_FUNDS_RATE", + "INFLATION": "INFLATION", + } + func = func_map.get(indicator, indicator) + data = _call_av(func) + vals = data.get("data", [])[:10] + if not vals: + return f"No data for {indicator}" + name = data.get("name", indicator) + lines = [f"{name}:"] + for v in vals: + lines.append(f" {v.get('date', '')}: {v.get('value', 'N/A')}") + return "\n".join(lines) + + +def main(): + print(f"Starting Finance MCP server on {HOST}:{PORT}") + mcp.run(transport="streamable-http") + + +if __name__ == "__main__": + main() diff --git a/example-apps/focus/finance/icon.png b/example-apps/focus/finance/icon.png new file mode 100644 index 0000000..90f6234 Binary files /dev/null and b/example-apps/focus/finance/icon.png differ diff --git a/example-apps/focus/finance/truffile.yaml b/example-apps/focus/finance/truffile.yaml new file mode 100644 index 0000000..75c1a1e --- /dev/null +++ b/example-apps/focus/finance/truffile.yaml @@ -0,0 +1,20 @@ +metadata: + name: Finance + type: foreground + description: | + Financial data analyst tools for your Truffle. Get stock prices, company info, + market news, crypto rates, and economic indicators powered by Alpha Vantage. + process: + cmd: + - python + - app.py + working_directory: / + environment: + PYTHONUNBUFFERED: "1" + icon_file: ./icon.png +files: + - source: ./app.py + destination: ./app.py +run: | + pip install --no-cache-dir mcp requests + diff --git a/example-apps/focus/research/icon.png b/example-apps/focus/research/icon.png new file mode 100644 index 0000000..fbd6440 Binary files /dev/null and b/example-apps/focus/research/icon.png differ diff --git a/example-apps/focus/research/research.py b/example-apps/focus/research/research.py new file mode 100644 index 0000000..2dffc44 --- /dev/null +++ b/example-apps/focus/research/research.py @@ -0,0 +1,87 @@ +import requests +from ddgs import DDGS +from ddgs.results import TextResult, NewsResult +from typing import List +from mcp.server.fastmcp import FastMCP +from abrasive.extract import extract_content_from_url + +PERPLEXITY_KEY = "you thought" +class PerplexitySearcher: + def __init__(self, key : str = PERPLEXITY_KEY): + self.system_prompt = "You provide concise and accurate answers to queries, aim for recent information. This is presented to another LLM which will use it to help a user. Cite sources where possible and format your answer in markdown." + self.model = "sonar" + self.url = "https://api.perplexity.ai/chat/completions" + self.key = key + def run(self, query: str) -> str: + messages = [ + {"role": "system", "content": self.system_prompt}, + {"role": "user", "content": query} + ] + response = requests.post( + self.url, + json={ + "model": self.model, + "messages": messages + }, + headers={ + "accept": "application/json", + "Content-Type": "application/json", + "Authorization": f"Bearer {self.key}" + } + ) + return response.json()["choices"][0]["message"]["content"] + +HOST = "0.0.0.0" +PORT = 8000 + +mcp = FastMCP("research", stateless_http=True, host=HOST, port=PORT) + + +@mcp.tool("search_perplexity", description="Searches Perplexity AI for an answer to the given query.") +async def search_perplexity(query: str) -> str: + searcher = PerplexitySearcher() + result = searcher.run(query) + return result + +@mcp.tool("search_web") +async def search_web(query: str, num_results: int = 5) -> str: + + results : List[dict] = DDGS().text(query, max_results=num_results, region='us-en', safesearch='off') # type: ignore + formatted_results = "\n".join([f"{i+1}. {res['title']}: {res['href']}" for i, res in enumerate(results)]) + return formatted_results + +@mcp.tool("search_news") +async def search_news(query: str, num_results: int = 5) -> str: + results : List[dict] = DDGS().news(query, max_results=num_results, region='us-en', safesearch='off') # type: ignore + formatted_results = "\n".join([f"{i+1}. [{res['source']}] '{res['title']}': {res['body']} <{res['url']}>" for i, res in enumerate(results)]) + return formatted_results + +@mcp.tool("fetch_url_content", description="Fetches and extracts the main content from a given URL. Will return text and any images found in markdown format. Some sites may block scraping.") +async def fetch_url_content(url: str) -> str: + try: + content = extract_content_from_url(url.strip()) + if content is None: + return "Error: Failed to extract content from the URL. Was it valid? This site may block scraping." + + content_str = f"<{url}>\n\n{content.text}\n" + if content.images: + content_str += "\n\nImages:\n" + "\n".join(content.images) + if content.source_name: + content_str = f"Source: {content.source_name}\n\n" + content_str + return content_str + except Exception as e: + return f"Error: Exception occurred while fetching URL: {str(e)}" + +def main(): + print(f"Starting MCP server on {HOST}:{PORT}") + mcp.run(transport="streamable-http") + + + + + +if __name__ == "__main__": + main() + + + diff --git a/example-apps/focus/research/truffile.yaml b/example-apps/focus/research/truffile.yaml new file mode 100644 index 0000000..3154533 --- /dev/null +++ b/example-apps/focus/research/truffile.yaml @@ -0,0 +1,39 @@ +metadata: + name: Research + type: foreground + description: | + Tools to help your TruffleΒΉ research and gather information from the web. + process: + cmd: + - python + - research.py + working_directory: / + environment: + PYTHONUNBUFFERED: "1" + icon_file: ./icon.png +steps: + - name: Welcome + type: welcome + content: | + This app provides tools to help your Truffle research and gather information from the web. + It includes web search, scraping and data extraction capabilities to assist in your research tasks. + Installation will set up the necessary dependencies and files, and may take a moment. + - name: Copy application files + type: files + files: + - source: ./research.py + destination: ./research.py + - name: Install dependencies + type: bash + run: | + pip install --no-cache-dir -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ 'gourmet[abrasive]==0.1.dev45' + pip install --no-cache-dir --force-reinstall requests trafilatura==2.0.0 tld==0.13.1 + pip install --no-cache-dir mcp ddgs + + + + + + + + \ No newline at end of file diff --git a/example-apps/truffile-example.yaml b/example-apps/truffile-example.yaml new file mode 100644 index 0000000..0e38580 --- /dev/null +++ b/example-apps/truffile-example.yaml @@ -0,0 +1,76 @@ +metadata: + name: Twitter App + type: background + process: + cmd: + - python + - app.py + working_directory: / + environment: + PYTHONUNBUFFERED: "1" + icon_file: ./icon.png + default_schedule: + type: interval + interval: + duration: 1h + schedule: + daily_window: "09:00-17:30" # optional + allowed_days: [mon, tue, wed, thu, fri] # optional, default = all days +steps: + - name: Copy application files + type: files + files: + - source: ./requirements.txt + destination: ./requirements.txt + - source: ./app.py + destination: ./app.py + - source: ./config.yaml + destination: ./config.yaml + permissions: 600 # optional + - name: Install dependencies + type: bash + run: | + pip install requests + apk add --no-cache btop + - name: Sign into X + type: vnc + cmd: + - python + - app.py + - --install + closes_on_complete: true + description: | + A VNC window will open. Please sign into your X account to continue the installation. + - name: Configure Email Account + type: text + content: | + Please provide an IMAP server, email address, and password to configure your email account. + fields: + - name: imap_server + label: IMAP Server + type: text # one of: text, password, number + placeholder: imap.example.com #optional + default: imap.gmail.com #optional + env: IMAP_SERVER + - name: email_address + label: Email Address + type: text + env: EMAIL_ADDRESS + placeholder: dude@wheresmycar.com + - name: password + label: Password + type: password + env: EMAIL_PASSWORD + validator: + cmd: + - python + - validate_email.py + args: + - ${inputs.imap_server} + - ${inputs.email_address} + - ${inputs.password} + + + + + \ No newline at end of file diff --git a/genesis/__init__.py b/genesis/__init__.py deleted file mode 100644 index 42455e8..0000000 --- a/genesis/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -""" -Genesis - TruffleOS SDK -connect, build, upload, execute -""" -try: - from ._version import __version__ -except ImportError: - __version__ = "0.1.dev0" - -__all__ = ["__version__"] diff --git a/pyproject.toml b/pyproject.toml index c7830e8..846b92e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,12 +6,12 @@ build-backend = "setuptools.build_meta" version_scheme = "guess-next-dev" local_scheme = "no-local-version" fallback_version = "0.1.dev0" -version_file = "genesis/_version.py" +version_file = "truffile/_version.py" [project] -name = "genesis" +name = "truffile" dynamic = ["version"] -description = "Genesis the TruffleOS SDK - Connect and deploy apps to Truffle devices" +description = "truffile the TruffleOS SDK - Connect and deploy apps to Truffle devices" readme = "README.md" requires-python = ">=3.10" license = {text = "MIT"} @@ -20,8 +20,15 @@ dependencies = [ "grpcio>=1.60.0", "protobuf>=4.25.0", "httpx>=0.27.0", + "pyyaml>=6.0", + "platformdirs>=3.10.0", + "websockets>=12.0", + "zeroconf>=0.131.0", ] +[project.scripts] +truffile = "truffile.cli:main" + [project.optional-dependencies] dev = [ "pytest>=8.0.0", @@ -30,7 +37,7 @@ dev = [ [tool.setuptools.packages.find] where = ["."] -include = ["genesis*", "truffle*"] +include = ["truffile*", "truffle*"] [tool.setuptools.package-data] "*" = ["*.pyi", "py.typed"] diff --git a/truffile/__init__.py b/truffile/__init__.py new file mode 100644 index 0000000..7a81239 --- /dev/null +++ b/truffile/__init__.py @@ -0,0 +1,17 @@ +try: + from ._version import __version__ +except ImportError: + __version__ = "0.1.dev0" + +from .client import TruffleClient, ExecResult, UploadResult, resolve_mdns, NewSessionStatus +from truffle.app.app_type_pb2 import AppType + +__all__ = [ + "__version__", + "TruffleClient", + "ExecResult", + "UploadResult", + "resolve_mdns", + "NewSessionStatus", + "AppType", +] diff --git a/truffile/cli.py b/truffile/cli.py new file mode 100644 index 0000000..433cdf1 --- /dev/null +++ b/truffile/cli.py @@ -0,0 +1,913 @@ +import argparse +import asyncio +import ast +import signal +import sys +import threading +import time +from pathlib import Path + +import yaml + +from truffile.storage import StorageService +from truffile.client import TruffleClient, resolve_mdns, NewSessionStatus + + +# ANSI colors +class C: + RED = "\033[91m" + GREEN = "\033[92m" + YELLOW = "\033[93m" + BLUE = "\033[94m" + MAGENTA = "\033[95m" + CYAN = "\033[96m" + DIM = "\033[2m" + BOLD = "\033[1m" + RESET = "\033[0m" + + +# Icons +MUSHROOM = "πŸ„β€πŸŸ«" +CHECK = "βœ“" +CROSS = "βœ—" +ARROW = "β†’" +DOT = "β€’" +WARN = "⚠" + + +class Spinner: + FRAMES = ["β ‹", "β ™", "β Ή", "β Έ", "β Ό", "β ΄", "β ¦", "β §", "β ‡", "⠏"] + + def __init__(self, message: str): + self.message = message + self.running = False + self.thread = None + self.frame_idx = 0 + + def _spin(self): + while self.running: + frame = self.FRAMES[self.frame_idx % len(self.FRAMES)] + sys.stdout.write(f"\r{C.CYAN}{frame}{C.RESET} {self.message}") + sys.stdout.flush() + self.frame_idx += 1 + time.sleep(0.08) + + def start(self): + self.running = True + self.thread = threading.Thread(target=self._spin, daemon=True) + self.thread.start() + + def stop(self, success: bool = True): + self.running = False + if self.thread: + self.thread.join(timeout=0.2) + icon = f"{C.GREEN}{CHECK}{C.RESET}" if success else f"{C.RED}{CROSS}{C.RESET}" + sys.stdout.write(f"\r{icon} {self.message}\n") + sys.stdout.flush() + + def fail(self, message: str | None = None): + self.running = False + if self.thread: + self.thread.join(timeout=0.2) + msg = message or self.message + sys.stdout.write(f"\r{C.RED}{CROSS}{C.RESET} {msg}\n") + sys.stdout.flush() + + +class ScrollingLog: + #felt a little fancy lol + """A scrolling log window that shows the last N lines in place.""" + + def __init__(self, height: int = 6, prefix: str = " "): + self.height = height + self.prefix = prefix + self.lines: list[str] = [] + self.started = False + try: + import shutil + self.width = shutil.get_terminal_size().columns - len(prefix) - 2 + except Exception: + self.width = 76 + + def _truncate(self, line: str) -> str: + if len(line) > self.width: + return line[:self.width - 3] + "..." + return line + + def _render(self): + if self.started: + sys.stdout.write(f"\033[{self.height}A") + + display = self.lines[-self.height:] if len(self.lines) >= self.height else self.lines + + while len(display) < self.height: + display.insert(0, "") + + for line in display: + truncated = self._truncate(line) + sys.stdout.write(f"\033[K{self.prefix}{C.DIM}{truncated}{C.RESET}\n") + + sys.stdout.flush() + self.started = True + + def add(self, line: str): + self.lines.append(line.rstrip()) + self._render() + + def finish(self): + if self.started: + sys.stdout.write(f"\033[{self.height}A") + for _ in range(self.height): + sys.stdout.write("\033[K\n") + sys.stdout.write(f"\033[{self.height}A") + sys.stdout.flush() + + +def error(msg: str): + print(f"{C.RED}{CROSS} Error:{C.RESET} {msg}") + + +def warn(msg: str): + print(f"{C.YELLOW}{WARN} Warning:{C.RESET} {msg}") + + +def success(msg: str): + print(f"{C.GREEN}{CHECK}{C.RESET} {msg}") + + +def info(msg: str): + print(f"{C.CYAN}{DOT}{C.RESET} {msg}") + + +async def cmd_connect(args, storage: StorageService) -> int: + device_name = args.device + + spinner = Spinner(f"Resolving {device_name}.local") + spinner.start() + + hostname = f"{device_name}.local" + try: + ip = await resolve_mdns(hostname) + spinner.stop(success=True) + except RuntimeError: + spinner.fail(f"Could not resolve {device_name}.local") + print() + print(f" {C.DIM}Try running:{C.RESET}") + print(f" {C.CYAN}ping {device_name}.local{C.RESET}") + print() + print(f" {C.DIM}If ping fails, check:{C.RESET}") + print(f" {C.DIM}{DOT} Device is powered on and connected to WiFi{C.RESET}") + print(f" {C.DIM}{DOT} Your computer is on the same network{C.RESET}") + print(f" {C.DIM}{DOT} mDNS is working{C.RESET}") + print() + return 1 + + address = f"{ip}:80" + existing_token = storage.get_token(device_name) + + if existing_token: + spinner = Spinner("Validating existing token") + spinner.start() + client = TruffleClient(address, existing_token) + try: + await client.connect() + if await client.check_auth(): + spinner.stop(success=True) + storage.set_last_used(device_name) + success(f"Already connected to {C.BOLD}{device_name}{C.RESET}") + await client.close() + return 0 + spinner.fail("Token invalid, re-authenticating") + except Exception: + spinner.fail("Token validation failed") + finally: + await client.close() + + print() + print(f" {C.DIM}Make sure you have:{C.RESET}") + print(f" {C.DIM}{DOT} Onboarded with the Truffle app{C.RESET}") + print(f" {C.DIM}{DOT} Your User ID from the recovery codes{C.RESET}") + print() + + try: + user_id = input(f"{C.CYAN}?{C.RESET} Enter your User ID: ").strip() + except (KeyboardInterrupt, EOFError): + print() + raise KeyboardInterrupt() + if not user_id: + error("User ID is required") + return 1 + + spinner = Spinner("Connecting to device") + spinner.start() + + client = TruffleClient(address, token="") + try: + await client.connect() + spinner.stop(success=True) + except Exception as e: + spinner.fail(f"Failed to connect: {e}") + return 1 + + print() + info("Requesting authorization...") + print(f" {C.DIM}Please approve on your Truffle device{C.RESET}") + + spinner = Spinner("Waiting for approval") + spinner.start() + + try: + status, token = await client.register_new_session(user_id) + except Exception as e: + spinner.fail(f"Failed to register: {e}") + await client.close() + return 1 + + await client.close() + + if status.error == NewSessionStatus.NEW_SESSION_SUCCESS and token: + spinner.stop(success=True) + storage.set_token(device_name, token) + storage.set_last_used(device_name) + print() + success(f"Connected to {C.BOLD}{device_name}{C.RESET}") + return 0 + elif status.error == NewSessionStatus.NEW_SESSION_TIMEOUT: + spinner.fail("Approval timed out") + return 1 + elif status.error == NewSessionStatus.NEW_SESSION_REJECTED: + spinner.fail("Request was rejected") + return 1 + else: + spinner.fail(f"Authentication failed: {status.error}") + return 1 + + +def cmd_disconnect(args, storage: StorageService) -> int: + target = args.target + if target == "all": + storage.clear_all() + success("All device credentials cleared") + else: + if storage.remove_device(target): + success(f"Disconnected from {C.BOLD}{target}{C.RESET}") + else: + error(f"No credentials found for {target}") + return 0 + + +def check_python_syntax(file_path: Path) -> tuple[bool, str]: + try: + with open(file_path) as f: + source = f.read() + ast.parse(source) + return True, "" + except SyntaxError as e: + return False, f"Line {e.lineno}: {e.msg}" + + +def validate_app_dir(app_dir: Path) -> tuple[bool, dict | None, str | None, list[str]]: + """Validate app directory and return (valid, config, app_type, warnings).""" + warnings = [] + + truffile = app_dir / "truffile.yaml" + if not truffile.exists(): + error(f"No truffile.yaml found in {app_dir}") + return False, None, None, warnings + + try: + with open(truffile) as f: + config = yaml.safe_load(f) + except yaml.YAMLError as e: + error(f"Invalid truffile.yaml: {e}") + return False, None, None, warnings + + meta = config.get("metadata", {}) + if not meta.get("name"): + error("metadata.name is required in truffile.yaml") + return False, None, None, warnings + + cfg_type = meta.get("type", "").lower() + if cfg_type in ("background", "ambient"): + app_type = "ambient" + elif cfg_type in ("foreground", "focus"): + app_type = "focus" + else: + app_type = "focus" + warnings.append(f"No type specified in truffile.yaml, defaulting to focus") + + icon_file = meta.get("icon_file") + if icon_file: + icon_path = app_dir / icon_file + if not icon_path.exists(): + warnings.append(f"Icon file not found: {icon_file}") + else: + warnings.append("No icon specified in truffile.yaml") + + # Check files - either in steps or top-level files: + files_to_check = [] + for step in config.get("steps", []): + if step.get("type") == "files": + files_to_check.extend(step.get("files", [])) + # Also check top-level files: (simplified format) + files_to_check.extend(config.get("files", [])) + + for f in files_to_check: + src = app_dir / f["source"] + if not src.exists(): + error(f"Source file not found: {src}") + return False, None, None, warnings + if src.suffix == ".py": + ok, err = check_python_syntax(src) + if not ok: + error(f"Syntax error in {src.name}: {err}") + return False, None, None, warnings + + return True, config, app_type, warnings + + +async def _do_deploy(client: TruffleClient, config: dict, app_dir: Path, app_type: str, device: str, interactive: bool = False) -> int: + meta = config["metadata"] + name = meta["name"] + description = meta.get("description", "") + process = meta.get("process", {}) + cmd_list = process.get("cmd", ["python", "app.py"]) + cwd = process.get("working_directory", "/") + env_dict = process.get("environment", {}) + env = [f"{k}={v}" for k, v in env_dict.items()] + icon_file = meta.get("icon_file") + icon_path = (app_dir / icon_file) if icon_file and (app_dir / icon_file).exists() else None + + spinner = Spinner(f"Connecting to {device}") + spinner.start() + await client.connect() + spinner.stop(success=True) + + spinner = Spinner("Starting build session") + spinner.start() + await client.start_build() + await asyncio.sleep(5) + spinner.stop(success=True) + print(f" {C.DIM}Session: {client.app_uuid}{C.RESET}") + + # Always upload files first + files_to_upload = [] + for step in config.get("steps", []): + if step.get("type") == "files": + files_to_upload.extend(step.get("files", [])) + files_to_upload.extend(config.get("files", [])) + + for f in files_to_upload: + src = app_dir / f["source"] + dest = f["destination"] + spinner = Spinner(f"Uploading {src.name} {ARROW} {dest}") + spinner.start() + result = await client.upload(src, dest) + spinner.stop(success=True) + print(f" {C.DIM}{result.bytes} bytes, sha256={result.sha256[:12]}...{C.RESET}") + + # always run bash commands + bash_commands = [] + for step in config.get("steps", []): + if step.get("type") == "bash": + bash_commands.append((step.get("name", "bash"), step["run"])) + if config.get("run"): + bash_commands.append(("Install dependencies", config["run"])) + + for step_name, run_cmd in bash_commands: + info(f"Running: {step_name}") + log = ScrollingLog(height=6, prefix=" ") + exit_code = 0 + async for ev, data in client.exec_stream(run_cmd, cwd=cwd): + if ev == "log": + try: + import json + obj = json.loads(data) + line = obj.get("line", "") + except Exception: + line = data + log.add(line) + elif ev == "exit": + try: + import json + exit_code = int(json.loads(data).get("code", 0)) + except (ValueError, KeyError): + pass + log.finish() + if exit_code != 0: + error(f"Step '{step_name}' failed with exit code {exit_code}") + raise RuntimeError(f"Step '{step_name}' failed with exit code {exit_code}") + + if interactive: + # interactive mode: open shell after setup for testing/debugging + print() + info("Opening interactive shell (exit with Ctrl+D or 'exit' to finish deploy)") + ws_url = str(client.http_base or "").replace("http://", "ws://").replace("https://", "wss://") + "/term" + await _interactive_shell(ws_url) + print() + spinner = Spinner(f"Finishing as {app_type} app") + spinner.start() + + cmd = cmd_list[0] if cmd_list[0].startswith("/") else f"/usr/bin/{cmd_list[0]}" + + if app_type == "focus": + await client.finish_foreground( + name=name, + cmd=cmd, + args=cmd_list[1:], + cwd=cwd, + env=env, + description=description, + icon=icon_path, + ) + else: + schedule_cfg = meta.get("default_schedule", {}) + schedule_type = schedule_cfg.get("type", "interval") + interval_seconds = 60 + + if schedule_type == "interval": + interval_cfg = schedule_cfg.get("interval", {}) + duration_str = interval_cfg.get("duration", "1m") + if duration_str.endswith("m"): + interval_seconds = int(duration_str[:-1]) * 60 + elif duration_str.endswith("h"): + interval_seconds = int(duration_str[:-1]) * 3600 + elif duration_str.endswith("s"): + interval_seconds = int(duration_str[:-1]) + + await client.finish_background( + name=name, + cmd=cmd, + args=cmd_list[1:], + cwd=cwd, + env=env, + description=description, + icon=icon_path, + schedule=schedule_type, + interval_seconds=interval_seconds, + ) + + spinner.stop(success=True) + print() + success(f"Deployed: {C.BOLD}{name}{C.RESET} ({app_type})") + return 0 + + +async def cmd_deploy(args, storage: StorageService) -> int: + app_path = args.path if args.path else "." + app_dir = Path(app_path).resolve() + interactive = args.interactive + if not app_dir.exists() or not app_dir.is_dir(): + error(f"{app_dir} is not a valid directory") + return 1 + + info(f"Validating app in {app_dir.name}") + valid, config, app_type, warnings = validate_app_dir(app_dir) + if not valid or not app_type: + return 1 + + for w in warnings: + warn(w) + + device = storage.state.last_used_device + if not device: + error("No device connected") + print(f" {C.DIM}Run: truffile connect {C.RESET}") + return 1 + + token = storage.get_token(device) + if not token: + error(f"No token for {device}") + print(f" {C.DIM}Run: truffile connect {device}{C.RESET}") + return 1 + + spinner = Spinner(f"Resolving {device}") + spinner.start() + try: + ip = await resolve_mdns(f"{device}.local") + spinner.stop(success=True) + except RuntimeError: + spinner.fail(f"Could not resolve {device}.local") + print(f" {C.DIM}Try: ping {device}.local{C.RESET}") + return 1 + + address = f"{ip}:80" + client = TruffleClient(address, token=token) + deploy_task = None + + loop = asyncio.get_event_loop() + + def handle_sigint(): + print("\nInterrupted!") + if deploy_task and not deploy_task.done(): + deploy_task.cancel() + + loop.add_signal_handler(signal.SIGINT, handle_sigint) + + try: + deploy_task = asyncio.create_task(_do_deploy(client, config, app_dir, app_type, device, interactive)) + return await deploy_task + except asyncio.CancelledError: + print() + spinner = Spinner("Discarding build session") + spinner.start() + if client.app_uuid: + try: + await client.discard() + spinner.stop(success=True) + except Exception: + spinner.fail("Failed to discard") + return 130 + except Exception as e: + error(str(e)) + if client.app_uuid: + spinner = Spinner("Discarding build session") + spinner.start() + try: + await client.discard() + spinner.stop(success=True) + except Exception: + spinner.fail("Failed to discard") + return 1 + finally: + loop.remove_signal_handler(signal.SIGINT) + await client.close() + + +async def cmd_list_apps(storage: StorageService) -> int: + device = storage.state.last_used_device + if not device: + error("No device connected") + print(f" {C.DIM}Run: truffile connect {C.RESET}") + return 1 + + token = storage.get_token(device) + if not token: + error(f"No token for {device}") + print(f" {C.DIM}Run: truffile connect {device}{C.RESET}") + return 1 + + spinner = Spinner(f"Connecting to {device}") + spinner.start() + + try: + ip = await resolve_mdns(f"{device}.local") + except RuntimeError as e: + spinner.fail(str(e)) + return 1 + + address = f"{ip}:80" + client = TruffleClient(address, token=token) + + try: + await client.connect() + foreground, background = await client.get_all_apps() + spinner.stop(success=True) + + if not foreground and not background: + print(f" {C.DIM}No apps installed{C.RESET}") + return 0 + + print() + if foreground: + print(f"{C.BOLD}Focus Apps{C.RESET}") + for app in foreground: + print(f" {C.CYAN}{DOT}{C.RESET} {app.metadata.name}") + setattr(app.metadata, "description", getattr(app.metadata, "description", "")) + if hasattr(app.metadata, "description") and app.metadata.description: + desc = app.metadata.description.strip().split('\n')[0][:55] + print(f" {C.DIM}{desc}{C.RESET}") + + if background: + if foreground: + print() + print(f"{C.BOLD}Ambient Apps{C.RESET}") + for app in background: + schedule = "" + if app.runtime_policy.HasField("interval"): + secs = app.runtime_policy.interval.duration.seconds + if secs >= 3600: + schedule = f"every {secs // 3600}h" + elif secs >= 60: + schedule = f"every {secs // 60}m" + else: + schedule = f"every {secs}s" + elif app.runtime_policy.HasField("always"): + schedule = "always" + print(f" {C.CYAN}{DOT}{C.RESET} {app.metadata.name} {C.DIM}({schedule}){C.RESET}") + setattr(app.metadata, "description", getattr(app.metadata, "description", "")) + if hasattr(app.metadata, "description") and app.metadata.description: + desc = app.metadata.description.strip().split('\n')[0][:55] + print(f" {C.DIM}{desc}{C.RESET}") + + print() + print(f"{C.DIM}Total: {len(foreground)} focus, {len(background)} ambient{C.RESET}") + return 0 + + except Exception as e: + spinner.fail(str(e)) + return 1 + finally: + await client.close() + +async def _interactive_shell(ws_url: str) -> int: + print(f"{C.DIM}Opening shell... (exit with Ctrl+D or 'exit'){C.RESET}") + import os, termios, fcntl, struct, tty, contextlib, json + try: + import websockets + from websockets.exceptions import ConnectionClosed, ConnectionClosedOK + except Exception: + print(f"{C.RED}{CROSS} Error:{C.RESET} websockets package is required for terminal mode") + return 67 + + def _winsz(): + try: + h, w, _, _ = struct.unpack("HHHH", fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, b"\0"*8)) + return w, h + except Exception: + return 80, 24 + + class Raw: + def __enter__(self): + self.fd = sys.stdin.fileno() + self.old = termios.tcgetattr(self.fd) + tty.setraw(self.fd); return self + def __exit__(self, *a): + termios.tcsetattr(self.fd, termios.TCSADRAIN, self.old) + + async def run_once(): + async with websockets.connect(ws_url, max_size=None, ping_interval=30) as ws: + cols, rows = _winsz() + await ws.send(json.dumps({"resize":[cols, rows]})) + + loop = asyncio.get_running_loop() + q: asyncio.Queue[bytes] = asyncio.Queue() + stop = asyncio.Event() + + def on_stdin(): + try: + data = os.read(sys.stdin.fileno(), 4096) + if data: q.put_nowait(data) + except BlockingIOError: + pass + loop.add_reader(sys.stdin.fileno(), on_stdin) + + async def pump_in(): + try: + while not stop.is_set(): + data = await q.get() + try: await ws.send(data) + except (ConnectionClosed, ConnectionClosedOK): break + finally: + stop.set() + async def pump_out(): + try: + async for msg in ws: + if isinstance(msg, bytes): + os.write(sys.stdout.fileno(), msg) + else: + os.write(sys.stdout.fileno(), msg.encode()) # type: ignore + except (ConnectionClosed, ConnectionClosedOK): + pass + finally: + stop.set() + + with Raw(): + t_in = asyncio.create_task(pump_in()) + t_out = asyncio.create_task(pump_out()) + try: + await asyncio.wait({t_in, t_out}, return_when=asyncio.FIRST_COMPLETED) + finally: + stop.set(); t_in.cancel(); t_out.cancel() + with contextlib.suppress(Exception): + await asyncio.gather(t_in, t_out, return_exceptions=True) + loop.remove_reader(sys.stdin.fileno()) + + + await run_once() + return 67 + +def run_async(coro): + try: + return asyncio.run(coro) + except KeyboardInterrupt: + print(f"\r{C.RED}{CROSS} Cancelled{C.RESET} ") + return 130 + + +def cmd_list(args, storage: StorageService) -> int: + what = args.what + if what == "apps": + return run_async(cmd_list_apps(storage)) + elif what == "devices": + devices = storage.list_devices() + if not devices: + print(f" {C.DIM}No connected devices{C.RESET}") + else: + print(f"{C.BOLD}Connected Devices{C.RESET}") + for d in devices: + if d == storage.state.last_used_device: + print(f" {C.GREEN}{DOT}{C.RESET} {d} {C.DIM}(active){C.RESET}") + else: + print(f" {C.CYAN}{DOT}{C.RESET} {d}") + return 0 + + +async def cmd_scan(args, storage: StorageService) -> int: + try: + from zeroconf import ServiceBrowser, ServiceListener, Zeroconf, IPVersion + except ImportError: + error("zeroconf package required for scanning") + print(f" {C.DIM}pip install zeroconf{C.RESET}") + return 1 + + devices: dict[str, dict] = {} + scan_done = asyncio.Event() + + class TruffleListener(ServiceListener): + def add_service(self, zc: Zeroconf, type_: str, name: str): + if name.lower().startswith("truffle-"): + info = zc.get_service_info(type_, name) + device_name = name.split(".")[0] + if info and device_name not in devices: + addresses = [addr for addr in info.parsed_addresses(IPVersion.V4Only)] + devices[device_name] = { + "name": device_name, + "addresses": addresses, + "port": info.port, + } + + def remove_service(self, zc: Zeroconf, type_: str, name: str): + pass + + def update_service(self, zc: Zeroconf, type_: str, name: str): + pass + + timeout = args.timeout if hasattr(args, 'timeout') else 5 + + spinner = Spinner(f"Scanning for Truffle devices ({timeout}s)") + spinner.start() + + try: + zc = Zeroconf(ip_version=IPVersion.V4Only) + listener = TruffleListener() + + browsers = [ + ServiceBrowser(zc, "_truffle._tcp.local.", listener), + ] + + await asyncio.sleep(timeout) + + for browser in browsers: + browser.cancel() + zc.close() + + except Exception as e: + spinner.fail(f"Scan failed: {e}") + return 1 + + spinner.stop(success=True) + + if not devices: + print() + print(f" {C.DIM}No Truffle devices found on the network{C.RESET}") + print() + print(f" {C.DIM}Make sure your Truffle is:{C.RESET}") + print(f" {C.DIM}β€’ Powered on{C.RESET}") + print(f" {C.DIM}β€’ Connected to the same network as this computer{C.RESET}") + print() + return 1 + + print() + print(f"{C.BOLD}Found {len(devices)} Truffle device(s):{C.RESET}") + print() + + device_list = list(devices.values()) + for i, device in enumerate(device_list, 1): + name = device["name"] + addrs = ", ".join(device["addresses"]) if device["addresses"] else "unknown" + + already_connected = storage.get_token(name) is not None + if already_connected: + print(f" {C.GREEN}{i}.{C.RESET} {C.BOLD}{name}{C.RESET} {C.DIM}({addrs}){C.RESET} {C.GREEN}[connected]{C.RESET}") + else: + print(f" {C.CYAN}{i}.{C.RESET} {C.BOLD}{name}{C.RESET} {C.DIM}({addrs}){C.RESET}") + + print() + + try: + choice = input(f"Select device to connect (1-{len(device_list)}) or press Enter to cancel: ").strip() + except (KeyboardInterrupt, EOFError): + print() + return 0 + + if not choice: + return 0 + + try: + idx = int(choice) - 1 + if 0 <= idx < len(device_list): + selected = device_list[idx] + print() + + class FakeArgs: + device = selected["name"] + + return await cmd_connect(FakeArgs(), storage) + else: + error("Invalid selection") + return 1 + except ValueError: + error("Invalid input") + return 1 + + +def print_help(): + print(f"{MUSHROOM} {C.BOLD}truffile{C.RESET} - TruffleOS SDK") + print() + print(f"{C.BOLD}Usage:{C.RESET} truffile [options]") + print() + print(f"{C.BOLD}Commands:{C.RESET}") + print(f" {C.BLUE}scan{C.RESET} Scan network for Truffle devices") + print(f" {C.BLUE}connect{C.RESET} Connect to a Truffle device") + print(f" {C.BLUE}disconnect{C.RESET} Disconnect and clear credentials") + print(f" {C.BLUE}deploy{C.RESET} [path] Deploy an app (reads type from truffile.yaml)") + print(f" {C.BLUE}list{C.RESET} List installed apps or devices") + print() + print(f"{C.BOLD}Examples:{C.RESET}") + print(f" {C.DIM}truffile scan{C.RESET} {C.DIM}# find devices on network{C.RESET}") + print(f" {C.DIM}truffile connect truffle-6272{C.RESET}") + print(f" {C.DIM}truffile deploy ./my-app{C.RESET}") + print(f" {C.DIM}truffile deploy{C.RESET} {C.DIM}# uses current directory{C.RESET}") + print(f" {C.DIM}truffile list apps{C.RESET}") + print() + + +def main() -> int: + if len(sys.argv) == 1 or sys.argv[1] in ("-h", "--help"): + print_help() + return 0 + + parser = argparse.ArgumentParser( + prog="truffile", + description="truffile - TruffleOS SDK CLI", + add_help=False, + ) + subparsers = parser.add_subparsers(dest="command") + + p_scan = subparsers.add_parser("scan", add_help=False) + p_scan.add_argument("-t", "--timeout", type=int, default=5, help="Scan timeout in seconds") + + p_connect = subparsers.add_parser("connect", add_help=False) + p_connect.add_argument("device", nargs="?") + + p_disconnect = subparsers.add_parser("disconnect", add_help=False) + p_disconnect.add_argument("target", nargs="?") + + p_deploy = subparsers.add_parser("deploy", add_help=False) + p_deploy.add_argument("path", nargs="?", default=".") + p_deploy.add_argument("-i", "--interactive", action="store_true", help="Interactive terminal mode") + + p_list = subparsers.add_parser("list", add_help=False) + p_list.add_argument("what", choices=["apps", "devices"], nargs="?") + + args = parser.parse_args() + + if args.command is None: + print_help() + return 0 + + if args.command == "connect": + if not args.device: + error("Missing device name") + print(f" {C.DIM}Usage: truffile connect {C.RESET}") + return 1 + elif args.command == "disconnect": + if not args.target: + error("Missing device name") + print(f" {C.DIM}Usage: truffile disconnect {C.RESET}") + return 1 + elif args.command == "list": + if not args.what: + error("Missing argument") + print(f" {C.DIM}Usage: truffile list {C.RESET}") + return 1 + + storage = StorageService() + + if args.command == "scan": + return run_async(cmd_scan(args, storage)) + elif args.command == "connect": + return run_async(cmd_connect(args, storage)) + elif args.command == "disconnect": + return cmd_disconnect(args, storage) + elif args.command == "deploy": + return run_async(cmd_deploy(args, storage)) + elif args.command == "list": + return cmd_list(args, storage) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/truffile/client.py b/truffile/client.py new file mode 100644 index 0000000..ead281e --- /dev/null +++ b/truffile/client.py @@ -0,0 +1,360 @@ +import asyncio +import json +import platform +import socket +from dataclasses import dataclass +from pathlib import Path +from typing import AsyncIterator +import grpc +from grpc import aio +import httpx +from google.protobuf import empty_pb2 +from truffle.os.truffleos_pb2_grpc import TruffleOSStub +from truffle.os.builder_pb2 import ( + StartBuildSessionRequest, + StartBuildSessionResponse, + FinishBuildSessionRequest, + FinishBuildSessionResponse, +) +from truffle.os.client_session_pb2 import ( + RegisterNewSessionRequest, + RegisterNewSessionResponse, + NewSessionStatus, +) +from truffle.os.client_metadata_pb2 import ClientMetadata +from truffle.os.app_queries_pb2 import GetAllAppsRequest, GetAllAppsResponse +from truffle.app.app_type_pb2 import AppType +from truffle.app.foreground_pb2 import ForegroundApp +from truffle.app.background_pb2 import BackgroundApp + + +def get_client_metadata() -> ClientMetadata: + from truffile import __version__ + metadata = ClientMetadata() + metadata.device = platform.node() + metadata.platform = platform.platform() + metadata.version = f"truffile-{__version__}-{platform.python_version()}" + return metadata + + +async def resolve_mdns(hostname: str) -> str: + if ".local" not in hostname: + return hostname + loop = asyncio.get_event_loop() + try: + resolved = await loop.run_in_executor(None, socket.gethostbyname, hostname) + return resolved + except socket.gaierror as e: + raise RuntimeError(f"Failed to resolve {hostname} - is the device on the same network? ({e})") + + +@dataclass +class ExecResult: + exit_code: int + output: list[str] + + +@dataclass +class UploadResult: + path: str + bytes: int + sha256: str + + +class TruffleClient: + def __init__(self, address: str, token: str): + self.address = address + self.token = token + self.channel: aio.Channel | None = None + self.stub: TruffleOSStub | None = None + self.app_uuid: str | None = None + self.access_path: str | None = None + + @property + def http_base(self) -> str | None: + if not self.access_path: + return None + host = self.address if "://" in self.address else f"http://{self.address}" + return f"{host}/containers/{self.access_path}" + + @property + def _metadata(self) -> list: + return [("session", self.token)] + + async def connect(self, timeout: float = 15.0): + self.channel = aio.insecure_channel(self.address) + await asyncio.wait_for(self.channel.channel_ready(), timeout=timeout) + self.stub = TruffleOSStub(self.channel) + + def update_token(self, token: str): + self.token = token + + async def check_auth(self) -> bool: + if not self.stub or not self.token: + return False + try: + await self.stub.System_GetInfo(empty_pb2.Empty(), metadata=self._metadata) + return True + except aio.AioRpcError as e: + if e.code() == grpc.StatusCode.UNAUTHENTICATED: + return False + raise + + async def register_new_session(self, user_id: str) -> tuple[NewSessionStatus, str | None]: + if not self.stub: + raise RuntimeError("not connected") + req = RegisterNewSessionRequest() + req.user_id = user_id + req.metadata.CopyFrom(get_client_metadata()) + resp: RegisterNewSessionResponse = await self.stub.Client_RegisterNewSession(req) + if resp.status.error == NewSessionStatus.NEW_SESSION_SUCCESS: + self.token = resp.token + return resp.status, resp.token + return resp.status, None + + async def get_all_apps(self) -> tuple[list[ForegroundApp], list[BackgroundApp]]: + if not self.stub: + raise RuntimeError("not connected") + req = GetAllAppsRequest() + resp: GetAllAppsResponse = await self.stub.Apps_GetAll(req, metadata=self._metadata) + return list(resp.foreground_apps), list(resp.background_apps) + + async def start_build(self, app_type: AppType = AppType.APP_TYPE_BACKGROUND) -> StartBuildSessionResponse: + if not self.stub: + raise RuntimeError("not connected") + req = StartBuildSessionRequest() + req.app_type = app_type + resp: StartBuildSessionResponse = await self.stub.Builder_StartBuildSession( + req, metadata=self._metadata + ) + self.app_uuid = resp.app_uuid + self.access_path = resp.access_path + return resp + + async def _sse_events(self, client: httpx.AsyncClient, url: str, body: dict) -> AsyncIterator[tuple[str, str]]: + async with client.stream("POST", url, json=body, timeout=None) as r: + r.raise_for_status() + event = "message" + data_parts = [] + async for raw in r.aiter_lines(): + if raw is None: + continue + line = raw.rstrip("\r") + if line == "": + if data_parts: + yield event, "\n".join(data_parts) + event, data_parts = "message", [] + continue + if line.startswith(":"): + continue + if line.startswith("event:"): + event = line[6:].strip() + elif line.startswith("data:"): + data_parts.append(line[5:].lstrip()) + if data_parts: + yield event, "\n".join(data_parts) + + async def exec(self, cmd: str, cwd: str = "/") -> ExecResult: + if not self.http_base: + raise RuntimeError("no active build session") + url = f"{self.http_base}/exec/stream" + body = {"cmd": ["bash", "-lc", f"cd {cwd} && {cmd}"], "cwd": cwd} + output = [] + exit_code = 0 + retries = 5 + backoff = 1.0 + async with httpx.AsyncClient(timeout=None) as client: + for attempt in range(retries): + try: + async for ev, data in self._sse_events(client, url, body): + if ev == "log": + try: + obj = json.loads(data) + line = obj.get("line", "") + except Exception: + line = data + output.append(line) + elif ev == "exit": + try: + exit_code = int(json.loads(data).get("code", 0)) + except Exception: + pass + return ExecResult(exit_code=exit_code, output=output) + except httpx.HTTPStatusError as e: + if e.response.status_code == 503 and attempt < retries - 1: + await asyncio.sleep(backoff * (attempt + 1)) + continue + raise + return ExecResult(exit_code=exit_code, output=output) + + async def exec_stream(self, cmd: str, cwd: str = "/") -> AsyncIterator[tuple[str, str]]: + if not self.http_base: + raise RuntimeError("no active build session") + url = f"{self.http_base}/exec/stream" + body = {"cmd": ["bash", "-lc", f"cd {cwd} && {cmd}"], "cwd": cwd} + retries = 5 + backoff = 1.0 + async with httpx.AsyncClient(timeout=None) as client: + for attempt in range(retries): + try: + async for ev, data in self._sse_events(client, url, body): + yield ev, data + return + except httpx.HTTPStatusError as e: + if e.response.status_code == 503 and attempt < retries - 1: + await asyncio.sleep(backoff * (attempt + 1)) + continue + raise + + async def upload(self, src: str | Path, dest: str) -> UploadResult: + if not self.http_base: + raise RuntimeError("no active build session") + path = Path(src).expanduser() + if not path.exists() or not path.is_file(): + raise FileNotFoundError(f"no such file: {path}") + url = f"{self.http_base}/upload" + retries = 5 + backoff = 1.0 + async with httpx.AsyncClient(timeout=None) as client: + for attempt in range(retries): + try: + with path.open("rb") as fh: + files = {"file": (path.name, fh)} + r = await client.post(url, params={"path": dest}, files=files) + r.raise_for_status() + data = r.json() + return UploadResult( + path=data.get("path", ""), + bytes=data.get("bytes", 0), + sha256=data.get("sha256", ""), + ) + except httpx.HTTPStatusError as e: + if e.response.status_code == 503 and attempt < retries - 1: + await asyncio.sleep(backoff * (attempt + 1)) + continue + raise + raise RuntimeError("upload failed after retries") + + def _load_icon(self, icon: str | Path | bytes | None) -> bytes | None: + if icon is None: + return None + if isinstance(icon, bytes): + return icon + path = Path(icon).expanduser() + if path.exists() and path.is_file(): + return path.read_bytes() + return None + + async def finish_foreground( + self, + name: str, + cmd: str, + args: list[str], + cwd: str = "/", + env: list[str] | None = None, + description: str = "", + icon: str | Path | bytes | None = None, + ) -> FinishBuildSessionResponse: + if not self.stub or not self.app_uuid: + raise RuntimeError("no active build session") + req = FinishBuildSessionRequest() + req.app_uuid = self.app_uuid + req.discard = False + req.foreground.metadata.name = name + if description: + req.foreground.metadata.description = description + icon_data = self._load_icon(icon) + if icon_data: + req.foreground.metadata.icon.png_data = icon_data + req.process.cmd = cmd + req.process.args.extend(args) + if env: + req.process.env.extend(env) + req.process.cwd = cwd + resp: FinishBuildSessionResponse = await self.stub.Builder_FinishBuildSession( + req, metadata=self._metadata + ) + self.app_uuid = None + self.access_path = None + if resp.HasField("error"): + raise RuntimeError(f"finish failed: {resp.error.error} - {resp.error.details}") + return resp + + async def finish_background( + self, + name: str, + cmd: str, + args: list[str], + cwd: str = "/", + env: list[str] | None = None, + description: str = "", + icon: str | Path | bytes | None = None, + schedule: str = "interval", + interval_seconds: int = 60, + daily_start_hour: int | None = None, + daily_start_minute: int = 0, + daily_end_hour: int | None = None, + daily_end_minute: int = 0, + ) -> FinishBuildSessionResponse: + if not self.stub or not self.app_uuid: + raise RuntimeError("no active build session") + req = FinishBuildSessionRequest() + req.app_uuid = self.app_uuid + req.discard = False + req.background.metadata.name = name + if description: + req.background.metadata.description = description + icon_data = self._load_icon(icon) + if icon_data: + req.background.metadata.icon.png_data = icon_data + if schedule == "always": + req.background.runtime_policy.always.SetInParent() + elif schedule == "interval": + req.background.runtime_policy.interval.duration.seconds = interval_seconds + if daily_start_hour is not None and daily_end_hour is not None: + req.background.runtime_policy.interval.schedule.daily_window.daily_start_time.hour = daily_start_hour + req.background.runtime_policy.interval.schedule.daily_window.daily_start_time.minute = daily_start_minute + req.background.runtime_policy.interval.schedule.daily_window.daily_end_time.hour = daily_end_hour + req.background.runtime_policy.interval.schedule.daily_window.daily_end_time.minute = daily_end_minute + req.process.cmd = cmd + req.process.args.extend(args) + if env: + req.process.env.extend(env) + req.process.cwd = cwd + resp: FinishBuildSessionResponse = await self.stub.Builder_FinishBuildSession( + req, metadata=self._metadata + ) + self.app_uuid = None + self.access_path = None + if resp.HasField("error"): + raise RuntimeError(f"finish failed: {resp.error.error} - {resp.error.details}") + return resp + + async def discard(self) -> FinishBuildSessionResponse | None: + if not self.stub or not self.app_uuid: + return None + req = FinishBuildSessionRequest() + req.app_uuid = self.app_uuid + req.discard = True + resp: FinishBuildSessionResponse = await self.stub.Builder_FinishBuildSession( + req, metadata=self._metadata + ) + self.app_uuid = None + self.access_path = None + return resp + + async def close(self): + if self.channel: + await self.channel.close() + self.channel = None + self.stub = None + + async def __aenter__(self): + await self.connect() + await self.start_build() + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + await self.discard() + await self.close() + return False diff --git a/truffile/storage.py b/truffile/storage.py new file mode 100644 index 0000000..b35e675 --- /dev/null +++ b/truffile/storage.py @@ -0,0 +1,94 @@ +import json +import platformdirs +from pathlib import Path +from dataclasses import dataclass, field + + +@dataclass +class StoredDevice: + name: str + token: str + + +@dataclass +class StoredState: + devices: list[StoredDevice] = field(default_factory=list) + last_used_device: str | None = None + client_user_id: str | None = None + + +def get_storage_dir() -> Path: + dir_path = Path(platformdirs.user_data_dir("truffile")) + dir_path.mkdir(parents=True, exist_ok=True) + return dir_path + + +class StorageService: + def __init__(self): + self.storage_dir = get_storage_dir() + self.state_file = self.storage_dir / "state.json" + self.state = self._load_state() + + def _load_state(self) -> StoredState: + if not self.state_file.exists(): + return StoredState() + try: + with open(self.state_file, "r") as f: + data = json.load(f) + devices = [StoredDevice(**d) for d in data.get("devices", [])] + return StoredState( + devices=devices, + last_used_device=data.get("last_used_device"), + client_user_id=data.get("client_user_id"), + ) + except (json.JSONDecodeError, KeyError): + return StoredState() + + def save(self) -> None: + state_dict = { + "devices": [{"name": d.name, "token": d.token} for d in self.state.devices], + "last_used_device": self.state.last_used_device, + "client_user_id": self.state.client_user_id, + } + with open(self.state_file, "w") as f: + json.dump(state_dict, f, indent=4) + + def get_token(self, device_name: str) -> str | None: + for device in self.state.devices: + if device.name == device_name: + return device.token + return None + + def has_token(self, device_name: str) -> bool: + token = self.get_token(device_name) + return token is not None and len(token) > 0 + + def set_token(self, device_name: str, token: str) -> None: + for device in self.state.devices: + if device.name == device_name: + device.token = token + self.save() + return + self.state.devices.append(StoredDevice(name=device_name, token=token)) + self.save() + + def set_last_used(self, device_name: str) -> None: + self.state.last_used_device = device_name + self.save() + + def remove_device(self, device_name: str) -> bool: + for i, device in enumerate(self.state.devices): + if device.name == device_name: + self.state.devices.pop(i) + if self.state.last_used_device == device_name: + self.state.last_used_device = None + self.save() + return True + return False + + def clear_all(self) -> None: + self.state = StoredState() + self.save() + + def list_devices(self) -> list[str]: + return [d.name for d in self.state.devices] diff --git a/truffle/__init__.py b/truffle/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/truffle/app/__init__.py b/truffle/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/truffle/app/app_build_pb2.py b/truffle/app/app_build_pb2.py new file mode 100644 index 0000000..28406bb --- /dev/null +++ b/truffle/app/app_build_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/app_build.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/app_build.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1btruffle/app/app_build.proto\x12\x0btruffle.app\"D\n\rProcessConfig\x12\x0b\n\x03\x63md\x18\x01 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x02 \x03(\t\x12\x0b\n\x03\x65nv\x18\x03 \x03(\t\x12\x0b\n\x03\x63wd\x18\x04 \x01(\tb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.app_build_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_PROCESSCONFIG']._serialized_start=44 + _globals['_PROCESSCONFIG']._serialized_end=112 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/app_build_pb2.pyi b/truffle/app/app_build_pb2.pyi new file mode 100644 index 0000000..d62fb0c --- /dev/null +++ b/truffle/app/app_build_pb2.pyi @@ -0,0 +1,19 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable +from typing import ClassVar as _ClassVar, Optional as _Optional + +DESCRIPTOR: _descriptor.FileDescriptor + +class ProcessConfig(_message.Message): + __slots__ = ("cmd", "args", "env", "cwd") + CMD_FIELD_NUMBER: _ClassVar[int] + ARGS_FIELD_NUMBER: _ClassVar[int] + ENV_FIELD_NUMBER: _ClassVar[int] + CWD_FIELD_NUMBER: _ClassVar[int] + cmd: str + args: _containers.RepeatedScalarFieldContainer[str] + env: _containers.RepeatedScalarFieldContainer[str] + cwd: str + def __init__(self, cmd: _Optional[str] = ..., args: _Optional[_Iterable[str]] = ..., env: _Optional[_Iterable[str]] = ..., cwd: _Optional[str] = ...) -> None: ... diff --git a/truffle/app/app_build_pb2_grpc.py b/truffle/app/app_build_pb2_grpc.py new file mode 100644 index 0000000..8a82ac6 --- /dev/null +++ b/truffle/app/app_build_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/app_build_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/app/app_install_pb2.py b/truffle/app/app_install_pb2.py new file mode 100644 index 0000000..1f90b58 --- /dev/null +++ b/truffle/app/app_install_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/app_install.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/app_install.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import installer_pb2 as truffle_dot_os_dot_installer__pb2 +from truffle.app import app_build_pb2 as truffle_dot_app_dot_app__build__pb2 +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/app/app_install.proto\x12\x0btruffle.app\x1a\x1atruffle/os/installer.proto\x1a\x1btruffle/app/app_build.proto\x1a\x1ctruffle/app/background.proto\".\n\x1aGetFinalInstallInfoRequest\x12\x10\n\x08\x61pp_uuid\x18\x01 \x01(\t\"\xa6\x01\n\x1bGetFinalInstallInfoResponse\x12\x32\n\x0eprocess_config\x18\x01 \x01(\x0b\x32\x1a.truffle.app.ProcessConfig\x12\x42\n\x0c\x62g_rt_policy\x18\x02 \x01(\x0b\x32\'.truffle.app.BackgroundAppRuntimePolicyH\x00\x88\x01\x01\x42\x0f\n\r_bg_rt_policy2\xce\x01\n\x11\x41ppInstallService\x12O\n\nInstallApp\x12\x1d.truffle.os.AppInstallRequest\x1a\x1e.truffle.os.AppInstallResponse(\x01\x30\x01\x12h\n\x13GetFinalInstallInfo\x12\'.truffle.app.GetFinalInstallInfoRequest\x1a(.truffle.app.GetFinalInstallInfoResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.app_install_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_GETFINALINSTALLINFOREQUEST']._serialized_start=133 + _globals['_GETFINALINSTALLINFOREQUEST']._serialized_end=179 + _globals['_GETFINALINSTALLINFORESPONSE']._serialized_start=182 + _globals['_GETFINALINSTALLINFORESPONSE']._serialized_end=348 + _globals['_APPINSTALLSERVICE']._serialized_start=351 + _globals['_APPINSTALLSERVICE']._serialized_end=557 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/app_install_pb2.pyi b/truffle/app/app_install_pb2.pyi new file mode 100644 index 0000000..1d428e6 --- /dev/null +++ b/truffle/app/app_install_pb2.pyi @@ -0,0 +1,23 @@ +from truffle.os import installer_pb2 as _installer_pb2 +from truffle.app import app_build_pb2 as _app_build_pb2 +from truffle.app import background_pb2 as _background_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class GetFinalInstallInfoRequest(_message.Message): + __slots__ = ("app_uuid",) + APP_UUID_FIELD_NUMBER: _ClassVar[int] + app_uuid: str + def __init__(self, app_uuid: _Optional[str] = ...) -> None: ... + +class GetFinalInstallInfoResponse(_message.Message): + __slots__ = ("process_config", "bg_rt_policy") + PROCESS_CONFIG_FIELD_NUMBER: _ClassVar[int] + BG_RT_POLICY_FIELD_NUMBER: _ClassVar[int] + process_config: _app_build_pb2.ProcessConfig + bg_rt_policy: _background_pb2.BackgroundAppRuntimePolicy + def __init__(self, process_config: _Optional[_Union[_app_build_pb2.ProcessConfig, _Mapping]] = ..., bg_rt_policy: _Optional[_Union[_background_pb2.BackgroundAppRuntimePolicy, _Mapping]] = ...) -> None: ... diff --git a/truffle/app/app_install_pb2_grpc.py b/truffle/app/app_install_pb2_grpc.py new file mode 100644 index 0000000..9170a0f --- /dev/null +++ b/truffle/app/app_install_pb2_grpc.py @@ -0,0 +1,142 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from truffle.app import app_install_pb2 as truffle_dot_app_dot_app__install__pb2 +from truffle.os import installer_pb2 as truffle_dot_os_dot_installer__pb2 + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/app_install_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class AppInstallServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.InstallApp = channel.stream_stream( + '/truffle.app.AppInstallService/InstallApp', + request_serializer=truffle_dot_os_dot_installer__pb2.AppInstallRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_installer__pb2.AppInstallResponse.FromString, + _registered_method=True) + self.GetFinalInstallInfo = channel.unary_unary( + '/truffle.app.AppInstallService/GetFinalInstallInfo', + request_serializer=truffle_dot_app_dot_app__install__pb2.GetFinalInstallInfoRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_app__install__pb2.GetFinalInstallInfoResponse.FromString, + _registered_method=True) + + +class AppInstallServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def InstallApp(self, request_iterator, context): + """bidi stream for install modals and flow + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetFinalInstallInfo(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_AppInstallServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'InstallApp': grpc.stream_stream_rpc_method_handler( + servicer.InstallApp, + request_deserializer=truffle_dot_os_dot_installer__pb2.AppInstallRequest.FromString, + response_serializer=truffle_dot_os_dot_installer__pb2.AppInstallResponse.SerializeToString, + ), + 'GetFinalInstallInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetFinalInstallInfo, + request_deserializer=truffle_dot_app_dot_app__install__pb2.GetFinalInstallInfoRequest.FromString, + response_serializer=truffle_dot_app_dot_app__install__pb2.GetFinalInstallInfoResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'truffle.app.AppInstallService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('truffle.app.AppInstallService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class AppInstallService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def InstallApp(request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.stream_stream( + request_iterator, + target, + '/truffle.app.AppInstallService/InstallApp', + truffle_dot_os_dot_installer__pb2.AppInstallRequest.SerializeToString, + truffle_dot_os_dot_installer__pb2.AppInstallResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetFinalInstallInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.AppInstallService/GetFinalInstallInfo', + truffle_dot_app_dot_app__install__pb2.GetFinalInstallInfoRequest.SerializeToString, + truffle_dot_app_dot_app__install__pb2.GetFinalInstallInfoResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/truffle/app/app_type_pb2.py b/truffle/app/app_type_pb2.py new file mode 100644 index 0000000..2c65e37 --- /dev/null +++ b/truffle/app/app_type_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/app_type.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/app_type.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1atruffle/app/app_type.proto\x12\x0btruffle.app*f\n\x07\x41ppType\x12\x14\n\x10\x41PP_TYPE_INVALID\x10\x00\x12\x17\n\x13\x41PP_TYPE_FOREGROUND\x10\x01\x12\x17\n\x13\x41PP_TYPE_BACKGROUND\x10\x02\x12\x13\n\x0f\x41PP_TYPE_SYSTEM\x10\x03\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.app_type_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_APPTYPE']._serialized_start=43 + _globals['_APPTYPE']._serialized_end=145 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/app_type_pb2.pyi b/truffle/app/app_type_pb2.pyi new file mode 100644 index 0000000..9f2aeb0 --- /dev/null +++ b/truffle/app/app_type_pb2.pyi @@ -0,0 +1,16 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from typing import ClassVar as _ClassVar + +DESCRIPTOR: _descriptor.FileDescriptor + +class AppType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + APP_TYPE_INVALID: _ClassVar[AppType] + APP_TYPE_FOREGROUND: _ClassVar[AppType] + APP_TYPE_BACKGROUND: _ClassVar[AppType] + APP_TYPE_SYSTEM: _ClassVar[AppType] +APP_TYPE_INVALID: AppType +APP_TYPE_FOREGROUND: AppType +APP_TYPE_BACKGROUND: AppType +APP_TYPE_SYSTEM: AppType diff --git a/truffle/app/app_type_pb2_grpc.py b/truffle/app/app_type_pb2_grpc.py new file mode 100644 index 0000000..7886f3d --- /dev/null +++ b/truffle/app/app_type_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/app_type_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/app/background_feed_pb2.py b/truffle/app/background_feed_pb2.py new file mode 100644 index 0000000..abc9691 --- /dev/null +++ b/truffle/app/background_feed_pb2.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/background_feed.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/background_feed.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from truffle.common import content_pb2 as truffle_dot_common_dot_content__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!truffle/app/background_feed.proto\x12\x0btruffle.app\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1ctruffle/common/content.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xe3\x01\n\x08\x46\x65\x65\x64\x43\x61rd\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0c\n\x04\x62ody\x18\x02 \x01(\t\x12\x32\n\rmedia_sources\x18\x03 \x03(\x0b\x32\x1b.truffle.common.MediaSource\x12\x12\n\nsource_uri\x18\x04 \x01(\t\x12\x35\n\x11\x63ontent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\x08metadata\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x42\x0b\n\t_metadata\"9\n\x0e\x42\x61\x63kgroundFeed\x12\'\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x16.truffle.app.FeedEntry\"\x8c\x01\n\tFeedEntry\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x10\n\x08\x61pp_uuid\x18\x02 \x01(\t\x12-\n\ttimestamp\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12#\n\x04\x63\x61rd\x18\x05 \x01(\x0b\x32\x15.truffle.app.FeedCard\x12\r\n\x05likes\x18\x07 \x01(\x05\"?\n\x14\x46\x65\x65\x64\x45ntryTaskContext\x12\'\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x16.truffle.app.FeedEntryb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.background_feed_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_FEEDCARD']._serialized_start=144 + _globals['_FEEDCARD']._serialized_end=371 + _globals['_BACKGROUNDFEED']._serialized_start=373 + _globals['_BACKGROUNDFEED']._serialized_end=430 + _globals['_FEEDENTRY']._serialized_start=433 + _globals['_FEEDENTRY']._serialized_end=573 + _globals['_FEEDENTRYTASKCONTEXT']._serialized_start=575 + _globals['_FEEDENTRYTASKCONTEXT']._serialized_end=638 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/background_feed_pb2.pyi b/truffle/app/background_feed_pb2.pyi new file mode 100644 index 0000000..f9bbf1d --- /dev/null +++ b/truffle/app/background_feed_pb2.pyi @@ -0,0 +1,52 @@ +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from truffle.common import content_pb2 as _content_pb2 +from google.protobuf import struct_pb2 as _struct_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class FeedCard(_message.Message): + __slots__ = ("title", "body", "media_sources", "source_uri", "content_timestamp", "metadata") + TITLE_FIELD_NUMBER: _ClassVar[int] + BODY_FIELD_NUMBER: _ClassVar[int] + MEDIA_SOURCES_FIELD_NUMBER: _ClassVar[int] + SOURCE_URI_FIELD_NUMBER: _ClassVar[int] + CONTENT_TIMESTAMP_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + title: str + body: str + media_sources: _containers.RepeatedCompositeFieldContainer[_content_pb2.MediaSource] + source_uri: str + content_timestamp: _timestamp_pb2.Timestamp + metadata: _struct_pb2.Struct + def __init__(self, title: _Optional[str] = ..., body: _Optional[str] = ..., media_sources: _Optional[_Iterable[_Union[_content_pb2.MediaSource, _Mapping]]] = ..., source_uri: _Optional[str] = ..., content_timestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ... + +class BackgroundFeed(_message.Message): + __slots__ = ("entries",) + ENTRIES_FIELD_NUMBER: _ClassVar[int] + entries: _containers.RepeatedCompositeFieldContainer[FeedEntry] + def __init__(self, entries: _Optional[_Iterable[_Union[FeedEntry, _Mapping]]] = ...) -> None: ... + +class FeedEntry(_message.Message): + __slots__ = ("id", "app_uuid", "timestamp", "card", "likes") + ID_FIELD_NUMBER: _ClassVar[int] + APP_UUID_FIELD_NUMBER: _ClassVar[int] + TIMESTAMP_FIELD_NUMBER: _ClassVar[int] + CARD_FIELD_NUMBER: _ClassVar[int] + LIKES_FIELD_NUMBER: _ClassVar[int] + id: int + app_uuid: str + timestamp: _timestamp_pb2.Timestamp + card: FeedCard + likes: int + def __init__(self, id: _Optional[int] = ..., app_uuid: _Optional[str] = ..., timestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., card: _Optional[_Union[FeedCard, _Mapping]] = ..., likes: _Optional[int] = ...) -> None: ... + +class FeedEntryTaskContext(_message.Message): + __slots__ = ("entries",) + ENTRIES_FIELD_NUMBER: _ClassVar[int] + entries: _containers.RepeatedCompositeFieldContainer[FeedEntry] + def __init__(self, entries: _Optional[_Iterable[_Union[FeedEntry, _Mapping]]] = ...) -> None: ... diff --git a/truffle/app/background_feed_pb2_grpc.py b/truffle/app/background_feed_pb2_grpc.py new file mode 100644 index 0000000..eb25b60 --- /dev/null +++ b/truffle/app/background_feed_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/background_feed_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/app/background_pb2.py b/truffle/app/background_pb2.py new file mode 100644 index 0000000..82b1a94 --- /dev/null +++ b/truffle/app/background_pb2.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/background.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/background.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 +from truffle.app import background_feed_pb2 as truffle_dot_app_dot_background__feed__pb2 +from truffle.common import icon_pb2 as truffle_dot_common_dot_icon__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/app/background.proto\x12\x0btruffle.app\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/descriptor.proto\x1a!truffle/app/background_feed.proto\x1a\x19truffle/common/icon.proto\"\x9b\x0b\n\x1a\x42\x61\x63kgroundAppRuntimePolicy\x12\x44\n\x08interval\x18\x01 \x01(\x0b\x32\x30.truffle.app.BackgroundAppRuntimePolicy.IntervalH\x00\x12\x46\n\x05times\x18\x02 \x01(\x0b\x32\x35.truffle.app.BackgroundAppRuntimePolicy.SpecificTimesH\x00\x12@\n\x06\x61lways\x18\x03 \x01(\x0b\x32..truffle.app.BackgroundAppRuntimePolicy.AlwaysH\x00\x12\x37\n\x14\x66\x65\x65\x64_entry_retention\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\x39\n\tTimeOfDay\x12\x0c\n\x04hour\x18\x01 \x01(\r\x12\x0e\n\x06minute\x18\x02 \x01(\r\x12\x0e\n\x06second\x18\x03 \x01(\r\x1a\xa5\x01\n\x0b\x44\x61ilyWindow\x12K\n\x10\x64\x61ily_start_time\x18\x01 \x01(\x0b\x32\x31.truffle.app.BackgroundAppRuntimePolicy.TimeOfDay\x12I\n\x0e\x64\x61ily_end_time\x18\x02 \x01(\x0b\x32\x31.truffle.app.BackgroundAppRuntimePolicy.TimeOfDay\x1a\x91\x03\n\x0cWeeklyWindow\x12\x10\n\x08\x64\x61y_mask\x18\x01 \x01(\r\"\xee\x02\n\x05Masks\x12\x19\n\x15WEEKLY_WINDOW_DEFAULT\x10\x00\x12\x1a\n\x16WEEKLY_WINDOW_ALL_DAYS\x10\x00\x12\x1a\n\x16WEEKLY_WINDOW_SATURDAY\x10\x01\x12\x18\n\x14WEEKLY_WINDOW_FRIDAY\x10\x02\x12\x1a\n\x16WEEKLY_WINDOW_THURSDAY\x10\x04\x12\x1b\n\x17WEEKLY_WINDOW_WEDNESDAY\x10\x08\x12\x19\n\x15WEEKLY_WINDOW_TUESDAY\x10\x10\x12\x18\n\x14WEEKLY_WINDOW_MONDAY\x10 \x12\x18\n\x14WEEKLY_WINDOW_SUNDAY\x10@\x12\x1a\n\x16WEEKLY_WINDOW_WEEKENDS\x10\x41\x12\x1a\n\x16WEEKLY_WINDOW_WEEKDAYS\x10>\x12\x19\n\x15WEEKLY_WINDOW_NO_DAYS\x10\x7f\x12\x19\n\x15WEEKLY_WINDOW_INVALID\x10\x7f\x1a\x02\x10\x01\x1a\xbf\x02\n\x08Interval\x12+\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12K\n\x08schedule\x18\x02 \x01(\x0b\x32\x39.truffle.app.BackgroundAppRuntimePolicy.Interval.Schedule\x1a\xb8\x01\n\x08Schedule\x12N\n\x0c\x64\x61ily_window\x18\x01 \x01(\x0b\x32\x33.truffle.app.BackgroundAppRuntimePolicy.DailyWindowH\x00\x88\x01\x01\x12K\n\rweekly_window\x18\x02 \x01(\x0b\x32\x34.truffle.app.BackgroundAppRuntimePolicy.WeeklyWindowB\x0f\n\r_daily_window\x1a\xa2\x01\n\rSpecificTimes\x12\x44\n\trun_times\x18\x01 \x03(\x0b\x32\x31.truffle.app.BackgroundAppRuntimePolicy.TimeOfDay\x12K\n\rweekly_window\x18\x02 \x01(\x0b\x32\x34.truffle.app.BackgroundAppRuntimePolicy.WeeklyWindow\x1a\x08\n\x06\x41lwaysB\x06\n\x04whenJ\x04\x08\x04\x10\n\"\xe8\x01\n\rBackgroundApp\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x35\n\x08metadata\x18\x02 \x01(\x0b\x32#.truffle.app.BackgroundApp.Metadata\x12?\n\x0eruntime_policy\x18\x03 \x01(\x0b\x32\'.truffle.app.BackgroundAppRuntimePolicy\x1aQ\n\x08Metadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\"\n\x04icon\x18\x02 \x01(\x0b\x32\x14.truffle.common.Icon\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"\xdc\x01\n\x19\x42\x61\x63kgroundAppNotification\x12\x16\n\x0e\x66\x65\x65\x64_entry_ids\x18\x02 \x03(\x04\x12\x43\n\toperation\x18\x03 \x01(\x0e\x32\x30.truffle.app.BackgroundAppNotification.Operation\"b\n\tOperation\x12\x15\n\x11OPERATION_INVALID\x10\x00\x12\x11\n\rOPERATION_ADD\x10\x01\x12\x14\n\x10OPERATION_DELETE\x10\x02\x12\x15\n\x11OPERATION_REFRESH\x10\x03\"\x90\x01\n\x16\x42\x61\x63kgroundAppBuildInfo\x12\x35\n\x08metadata\x18\x01 \x01(\x0b\x32#.truffle.app.BackgroundApp.Metadata\x12?\n\x0eruntime_policy\x18\x02 \x01(\x0b\x32\'.truffle.app.BackgroundAppRuntimePolicy\"L\n%BackgroundAppSubmitFeedContentRequest\x12#\n\x04\x63\x61rd\x18\x02 \x01(\x0b\x32\x15.truffle.app.FeedCard\"?\n&BackgroundAppSubmitFeedContentResponse\x12\x15\n\rfeed_entry_id\x18\x01 \x01(\x04\"\x1b\n\x19\x42\x61\x63kgroundAppOnRunRequest\"\x1c\n\x1a\x42\x61\x63kgroundAppOnRunResponse\"\x1b\n\x19\x42\x61\x63kgroundAppYieldRequest\"Y\n\x1a\x42\x61\x63kgroundAppYieldResponse\x12;\n\x17next_scheduled_run_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xeb\x01\n\x12\x42\x61\x63kgroundAppError\x12=\n\nerror_type\x18\x01 \x01(\x0e\x32).truffle.app.BackgroundAppError.ErrorType\x12\x15\n\rerror_message\x18\x02 \x01(\t\"\x7f\n\tErrorType\x12\x1d\n\x19\x42G_APP_ERROR_TYPE_INVALID\x10\x00\x12\x1d\n\x19\x42G_APP_ERROR_TYPE_RUNTIME\x10\x01\x12\x15\n\x11\x42G_APP_ERROR_AUTH\x10\x02\x12\x1d\n\x19\x42G_APP_ERROR_TYPE_UNKNOWN\x10\x03\"m\n\x1f\x42\x61\x63kgroundAppReportErrorRequest\x12.\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x1f.truffle.app.BackgroundAppError\x12\x1a\n\x12needs_intervention\x18\x02 \x01(\x08\"\"\n BackgroundAppReportErrorResponse2\xb4\x03\n\x14\x42\x61\x63kgroundAppService\x12|\n\x11SubmitFeedContent\x12\x32.truffle.app.BackgroundAppSubmitFeedContentRequest\x1a\x33.truffle.app.BackgroundAppSubmitFeedContentResponse\x12X\n\x05OnRun\x12&.truffle.app.BackgroundAppOnRunRequest\x1a\'.truffle.app.BackgroundAppOnRunResponse\x12X\n\x05Yield\x12&.truffle.app.BackgroundAppYieldRequest\x1a\'.truffle.app.BackgroundAppYieldResponse\x12j\n\x0bReportError\x12,.truffle.app.BackgroundAppReportErrorRequest\x1a-.truffle.app.BackgroundAppReportErrorResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.background_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_WEEKLYWINDOW_MASKS']._loaded_options = None + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_WEEKLYWINDOW_MASKS']._serialized_options = b'\020\001' + _globals['_BACKGROUNDAPPRUNTIMEPOLICY']._serialized_start=207 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY']._serialized_end=1642 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_TIMEOFDAY']._serialized_start=502 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_TIMEOFDAY']._serialized_end=559 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_DAILYWINDOW']._serialized_start=562 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_DAILYWINDOW']._serialized_end=727 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_WEEKLYWINDOW']._serialized_start=730 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_WEEKLYWINDOW']._serialized_end=1131 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_WEEKLYWINDOW_MASKS']._serialized_start=765 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_WEEKLYWINDOW_MASKS']._serialized_end=1131 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_INTERVAL']._serialized_start=1134 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_INTERVAL']._serialized_end=1453 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_INTERVAL_SCHEDULE']._serialized_start=1269 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_INTERVAL_SCHEDULE']._serialized_end=1453 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_SPECIFICTIMES']._serialized_start=1456 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_SPECIFICTIMES']._serialized_end=1618 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_ALWAYS']._serialized_start=1620 + _globals['_BACKGROUNDAPPRUNTIMEPOLICY_ALWAYS']._serialized_end=1628 + _globals['_BACKGROUNDAPP']._serialized_start=1645 + _globals['_BACKGROUNDAPP']._serialized_end=1877 + _globals['_BACKGROUNDAPP_METADATA']._serialized_start=1796 + _globals['_BACKGROUNDAPP_METADATA']._serialized_end=1877 + _globals['_BACKGROUNDAPPNOTIFICATION']._serialized_start=1880 + _globals['_BACKGROUNDAPPNOTIFICATION']._serialized_end=2100 + _globals['_BACKGROUNDAPPNOTIFICATION_OPERATION']._serialized_start=2002 + _globals['_BACKGROUNDAPPNOTIFICATION_OPERATION']._serialized_end=2100 + _globals['_BACKGROUNDAPPBUILDINFO']._serialized_start=2103 + _globals['_BACKGROUNDAPPBUILDINFO']._serialized_end=2247 + _globals['_BACKGROUNDAPPSUBMITFEEDCONTENTREQUEST']._serialized_start=2249 + _globals['_BACKGROUNDAPPSUBMITFEEDCONTENTREQUEST']._serialized_end=2325 + _globals['_BACKGROUNDAPPSUBMITFEEDCONTENTRESPONSE']._serialized_start=2327 + _globals['_BACKGROUNDAPPSUBMITFEEDCONTENTRESPONSE']._serialized_end=2390 + _globals['_BACKGROUNDAPPONRUNREQUEST']._serialized_start=2392 + _globals['_BACKGROUNDAPPONRUNREQUEST']._serialized_end=2419 + _globals['_BACKGROUNDAPPONRUNRESPONSE']._serialized_start=2421 + _globals['_BACKGROUNDAPPONRUNRESPONSE']._serialized_end=2449 + _globals['_BACKGROUNDAPPYIELDREQUEST']._serialized_start=2451 + _globals['_BACKGROUNDAPPYIELDREQUEST']._serialized_end=2478 + _globals['_BACKGROUNDAPPYIELDRESPONSE']._serialized_start=2480 + _globals['_BACKGROUNDAPPYIELDRESPONSE']._serialized_end=2569 + _globals['_BACKGROUNDAPPERROR']._serialized_start=2572 + _globals['_BACKGROUNDAPPERROR']._serialized_end=2807 + _globals['_BACKGROUNDAPPERROR_ERRORTYPE']._serialized_start=2680 + _globals['_BACKGROUNDAPPERROR_ERRORTYPE']._serialized_end=2807 + _globals['_BACKGROUNDAPPREPORTERRORREQUEST']._serialized_start=2809 + _globals['_BACKGROUNDAPPREPORTERRORREQUEST']._serialized_end=2918 + _globals['_BACKGROUNDAPPREPORTERRORRESPONSE']._serialized_start=2920 + _globals['_BACKGROUNDAPPREPORTERRORRESPONSE']._serialized_end=2954 + _globals['_BACKGROUNDAPPSERVICE']._serialized_start=2957 + _globals['_BACKGROUNDAPPSERVICE']._serialized_end=3393 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/background_pb2.pyi b/truffle/app/background_pb2.pyi new file mode 100644 index 0000000..7847843 --- /dev/null +++ b/truffle/app/background_pb2.pyi @@ -0,0 +1,203 @@ +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from google.protobuf import duration_pb2 as _duration_pb2 +from google.protobuf import descriptor_pb2 as _descriptor_pb2 +from truffle.app import background_feed_pb2 as _background_feed_pb2 +from truffle.common import icon_pb2 as _icon_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class BackgroundAppRuntimePolicy(_message.Message): + __slots__ = ("interval", "times", "always", "feed_entry_retention") + class TimeOfDay(_message.Message): + __slots__ = ("hour", "minute", "second") + HOUR_FIELD_NUMBER: _ClassVar[int] + MINUTE_FIELD_NUMBER: _ClassVar[int] + SECOND_FIELD_NUMBER: _ClassVar[int] + hour: int + minute: int + second: int + def __init__(self, hour: _Optional[int] = ..., minute: _Optional[int] = ..., second: _Optional[int] = ...) -> None: ... + class DailyWindow(_message.Message): + __slots__ = ("daily_start_time", "daily_end_time") + DAILY_START_TIME_FIELD_NUMBER: _ClassVar[int] + DAILY_END_TIME_FIELD_NUMBER: _ClassVar[int] + daily_start_time: BackgroundAppRuntimePolicy.TimeOfDay + daily_end_time: BackgroundAppRuntimePolicy.TimeOfDay + def __init__(self, daily_start_time: _Optional[_Union[BackgroundAppRuntimePolicy.TimeOfDay, _Mapping]] = ..., daily_end_time: _Optional[_Union[BackgroundAppRuntimePolicy.TimeOfDay, _Mapping]] = ...) -> None: ... + class WeeklyWindow(_message.Message): + __slots__ = ("day_mask",) + class Masks(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + WEEKLY_WINDOW_DEFAULT: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_ALL_DAYS: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_SATURDAY: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_FRIDAY: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_THURSDAY: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_WEDNESDAY: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_TUESDAY: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_MONDAY: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_SUNDAY: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_WEEKENDS: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_WEEKDAYS: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_NO_DAYS: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_INVALID: _ClassVar[BackgroundAppRuntimePolicy.WeeklyWindow.Masks] + WEEKLY_WINDOW_DEFAULT: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_ALL_DAYS: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_SATURDAY: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_FRIDAY: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_THURSDAY: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_WEDNESDAY: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_TUESDAY: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_MONDAY: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_SUNDAY: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_WEEKENDS: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_WEEKDAYS: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_NO_DAYS: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + WEEKLY_WINDOW_INVALID: BackgroundAppRuntimePolicy.WeeklyWindow.Masks + DAY_MASK_FIELD_NUMBER: _ClassVar[int] + day_mask: int + def __init__(self, day_mask: _Optional[int] = ...) -> None: ... + class Interval(_message.Message): + __slots__ = ("duration", "schedule") + class Schedule(_message.Message): + __slots__ = ("daily_window", "weekly_window") + DAILY_WINDOW_FIELD_NUMBER: _ClassVar[int] + WEEKLY_WINDOW_FIELD_NUMBER: _ClassVar[int] + daily_window: BackgroundAppRuntimePolicy.DailyWindow + weekly_window: BackgroundAppRuntimePolicy.WeeklyWindow + def __init__(self, daily_window: _Optional[_Union[BackgroundAppRuntimePolicy.DailyWindow, _Mapping]] = ..., weekly_window: _Optional[_Union[BackgroundAppRuntimePolicy.WeeklyWindow, _Mapping]] = ...) -> None: ... + DURATION_FIELD_NUMBER: _ClassVar[int] + SCHEDULE_FIELD_NUMBER: _ClassVar[int] + duration: _duration_pb2.Duration + schedule: BackgroundAppRuntimePolicy.Interval.Schedule + def __init__(self, duration: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., schedule: _Optional[_Union[BackgroundAppRuntimePolicy.Interval.Schedule, _Mapping]] = ...) -> None: ... + class SpecificTimes(_message.Message): + __slots__ = ("run_times", "weekly_window") + RUN_TIMES_FIELD_NUMBER: _ClassVar[int] + WEEKLY_WINDOW_FIELD_NUMBER: _ClassVar[int] + run_times: _containers.RepeatedCompositeFieldContainer[BackgroundAppRuntimePolicy.TimeOfDay] + weekly_window: BackgroundAppRuntimePolicy.WeeklyWindow + def __init__(self, run_times: _Optional[_Iterable[_Union[BackgroundAppRuntimePolicy.TimeOfDay, _Mapping]]] = ..., weekly_window: _Optional[_Union[BackgroundAppRuntimePolicy.WeeklyWindow, _Mapping]] = ...) -> None: ... + class Always(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + INTERVAL_FIELD_NUMBER: _ClassVar[int] + TIMES_FIELD_NUMBER: _ClassVar[int] + ALWAYS_FIELD_NUMBER: _ClassVar[int] + FEED_ENTRY_RETENTION_FIELD_NUMBER: _ClassVar[int] + interval: BackgroundAppRuntimePolicy.Interval + times: BackgroundAppRuntimePolicy.SpecificTimes + always: BackgroundAppRuntimePolicy.Always + feed_entry_retention: _duration_pb2.Duration + def __init__(self, interval: _Optional[_Union[BackgroundAppRuntimePolicy.Interval, _Mapping]] = ..., times: _Optional[_Union[BackgroundAppRuntimePolicy.SpecificTimes, _Mapping]] = ..., always: _Optional[_Union[BackgroundAppRuntimePolicy.Always, _Mapping]] = ..., feed_entry_retention: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ...) -> None: ... + +class BackgroundApp(_message.Message): + __slots__ = ("uuid", "metadata", "runtime_policy") + class Metadata(_message.Message): + __slots__ = ("name", "icon", "description") + NAME_FIELD_NUMBER: _ClassVar[int] + ICON_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + name: str + icon: _icon_pb2.Icon + description: str + def __init__(self, name: _Optional[str] = ..., icon: _Optional[_Union[_icon_pb2.Icon, _Mapping]] = ..., description: _Optional[str] = ...) -> None: ... + UUID_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + RUNTIME_POLICY_FIELD_NUMBER: _ClassVar[int] + uuid: str + metadata: BackgroundApp.Metadata + runtime_policy: BackgroundAppRuntimePolicy + def __init__(self, uuid: _Optional[str] = ..., metadata: _Optional[_Union[BackgroundApp.Metadata, _Mapping]] = ..., runtime_policy: _Optional[_Union[BackgroundAppRuntimePolicy, _Mapping]] = ...) -> None: ... + +class BackgroundAppNotification(_message.Message): + __slots__ = ("feed_entry_ids", "operation") + class Operation(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + OPERATION_INVALID: _ClassVar[BackgroundAppNotification.Operation] + OPERATION_ADD: _ClassVar[BackgroundAppNotification.Operation] + OPERATION_DELETE: _ClassVar[BackgroundAppNotification.Operation] + OPERATION_REFRESH: _ClassVar[BackgroundAppNotification.Operation] + OPERATION_INVALID: BackgroundAppNotification.Operation + OPERATION_ADD: BackgroundAppNotification.Operation + OPERATION_DELETE: BackgroundAppNotification.Operation + OPERATION_REFRESH: BackgroundAppNotification.Operation + FEED_ENTRY_IDS_FIELD_NUMBER: _ClassVar[int] + OPERATION_FIELD_NUMBER: _ClassVar[int] + feed_entry_ids: _containers.RepeatedScalarFieldContainer[int] + operation: BackgroundAppNotification.Operation + def __init__(self, feed_entry_ids: _Optional[_Iterable[int]] = ..., operation: _Optional[_Union[BackgroundAppNotification.Operation, str]] = ...) -> None: ... + +class BackgroundAppBuildInfo(_message.Message): + __slots__ = ("metadata", "runtime_policy") + METADATA_FIELD_NUMBER: _ClassVar[int] + RUNTIME_POLICY_FIELD_NUMBER: _ClassVar[int] + metadata: BackgroundApp.Metadata + runtime_policy: BackgroundAppRuntimePolicy + def __init__(self, metadata: _Optional[_Union[BackgroundApp.Metadata, _Mapping]] = ..., runtime_policy: _Optional[_Union[BackgroundAppRuntimePolicy, _Mapping]] = ...) -> None: ... + +class BackgroundAppSubmitFeedContentRequest(_message.Message): + __slots__ = ("card",) + CARD_FIELD_NUMBER: _ClassVar[int] + card: _background_feed_pb2.FeedCard + def __init__(self, card: _Optional[_Union[_background_feed_pb2.FeedCard, _Mapping]] = ...) -> None: ... + +class BackgroundAppSubmitFeedContentResponse(_message.Message): + __slots__ = ("feed_entry_id",) + FEED_ENTRY_ID_FIELD_NUMBER: _ClassVar[int] + feed_entry_id: int + def __init__(self, feed_entry_id: _Optional[int] = ...) -> None: ... + +class BackgroundAppOnRunRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class BackgroundAppOnRunResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class BackgroundAppYieldRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class BackgroundAppYieldResponse(_message.Message): + __slots__ = ("next_scheduled_run_time",) + NEXT_SCHEDULED_RUN_TIME_FIELD_NUMBER: _ClassVar[int] + next_scheduled_run_time: _timestamp_pb2.Timestamp + def __init__(self, next_scheduled_run_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... + +class BackgroundAppError(_message.Message): + __slots__ = ("error_type", "error_message") + class ErrorType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + BG_APP_ERROR_TYPE_INVALID: _ClassVar[BackgroundAppError.ErrorType] + BG_APP_ERROR_TYPE_RUNTIME: _ClassVar[BackgroundAppError.ErrorType] + BG_APP_ERROR_AUTH: _ClassVar[BackgroundAppError.ErrorType] + BG_APP_ERROR_TYPE_UNKNOWN: _ClassVar[BackgroundAppError.ErrorType] + BG_APP_ERROR_TYPE_INVALID: BackgroundAppError.ErrorType + BG_APP_ERROR_TYPE_RUNTIME: BackgroundAppError.ErrorType + BG_APP_ERROR_AUTH: BackgroundAppError.ErrorType + BG_APP_ERROR_TYPE_UNKNOWN: BackgroundAppError.ErrorType + ERROR_TYPE_FIELD_NUMBER: _ClassVar[int] + ERROR_MESSAGE_FIELD_NUMBER: _ClassVar[int] + error_type: BackgroundAppError.ErrorType + error_message: str + def __init__(self, error_type: _Optional[_Union[BackgroundAppError.ErrorType, str]] = ..., error_message: _Optional[str] = ...) -> None: ... + +class BackgroundAppReportErrorRequest(_message.Message): + __slots__ = ("error", "needs_intervention") + ERROR_FIELD_NUMBER: _ClassVar[int] + NEEDS_INTERVENTION_FIELD_NUMBER: _ClassVar[int] + error: BackgroundAppError + needs_intervention: bool + def __init__(self, error: _Optional[_Union[BackgroundAppError, _Mapping]] = ..., needs_intervention: bool = ...) -> None: ... + +class BackgroundAppReportErrorResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... diff --git a/truffle/app/background_pb2_grpc.py b/truffle/app/background_pb2_grpc.py new file mode 100644 index 0000000..a731773 --- /dev/null +++ b/truffle/app/background_pb2_grpc.py @@ -0,0 +1,237 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/background_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class BackgroundAppServiceStub(object): + """ + The service exposed to background apps when running in the Truffle OS. + gated by per app api key, available in the environment when the app is run. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.SubmitFeedContent = channel.unary_unary( + '/truffle.app.BackgroundAppService/SubmitFeedContent', + request_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppSubmitFeedContentRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppSubmitFeedContentResponse.FromString, + _registered_method=True) + self.OnRun = channel.unary_unary( + '/truffle.app.BackgroundAppService/OnRun', + request_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppOnRunRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppOnRunResponse.FromString, + _registered_method=True) + self.Yield = channel.unary_unary( + '/truffle.app.BackgroundAppService/Yield', + request_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppYieldRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppYieldResponse.FromString, + _registered_method=True) + self.ReportError = channel.unary_unary( + '/truffle.app.BackgroundAppService/ReportError', + request_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppReportErrorRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppReportErrorResponse.FromString, + _registered_method=True) + + +class BackgroundAppServiceServicer(object): + """ + The service exposed to background apps when running in the Truffle OS. + gated by per app api key, available in the environment when the app is run. + """ + + def SubmitFeedContent(self, request, context): + """post to curator/feed + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def OnRun(self, request, context): + """must be called when the app is run by the system scheduler in the first few seconds of execution or the run will be considered failed + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Yield(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ReportError(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_BackgroundAppServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'SubmitFeedContent': grpc.unary_unary_rpc_method_handler( + servicer.SubmitFeedContent, + request_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppSubmitFeedContentRequest.FromString, + response_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppSubmitFeedContentResponse.SerializeToString, + ), + 'OnRun': grpc.unary_unary_rpc_method_handler( + servicer.OnRun, + request_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppOnRunRequest.FromString, + response_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppOnRunResponse.SerializeToString, + ), + 'Yield': grpc.unary_unary_rpc_method_handler( + servicer.Yield, + request_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppYieldRequest.FromString, + response_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppYieldResponse.SerializeToString, + ), + 'ReportError': grpc.unary_unary_rpc_method_handler( + servicer.ReportError, + request_deserializer=truffle_dot_app_dot_background__pb2.BackgroundAppReportErrorRequest.FromString, + response_serializer=truffle_dot_app_dot_background__pb2.BackgroundAppReportErrorResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'truffle.app.BackgroundAppService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('truffle.app.BackgroundAppService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class BackgroundAppService(object): + """ + The service exposed to background apps when running in the Truffle OS. + gated by per app api key, available in the environment when the app is run. + """ + + @staticmethod + def SubmitFeedContent(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.BackgroundAppService/SubmitFeedContent', + truffle_dot_app_dot_background__pb2.BackgroundAppSubmitFeedContentRequest.SerializeToString, + truffle_dot_app_dot_background__pb2.BackgroundAppSubmitFeedContentResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def OnRun(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.BackgroundAppService/OnRun', + truffle_dot_app_dot_background__pb2.BackgroundAppOnRunRequest.SerializeToString, + truffle_dot_app_dot_background__pb2.BackgroundAppOnRunResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Yield(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.BackgroundAppService/Yield', + truffle_dot_app_dot_background__pb2.BackgroundAppYieldRequest.SerializeToString, + truffle_dot_app_dot_background__pb2.BackgroundAppYieldResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ReportError(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.BackgroundAppService/ReportError', + truffle_dot_app_dot_background__pb2.BackgroundAppReportErrorRequest.SerializeToString, + truffle_dot_app_dot_background__pb2.BackgroundAppReportErrorResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/truffle/app/curator_pb2.py b/truffle/app/curator_pb2.py new file mode 100644 index 0000000..3893185 --- /dev/null +++ b/truffle/app/curator_pb2.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/curator.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/curator.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.app import background_feed_pb2 as truffle_dot_app_dot_background__feed__pb2 +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 +from truffle.os import background_feed_queries_pb2 as truffle_dot_os_dot_background__feed__queries__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19truffle/app/curator.proto\x12\x0btruffle.app\x1a!truffle/app/background_feed.proto\x1a\x1ctruffle/app/background.proto\x1a(truffle/os/background_feed_queries.proto\"\x16\n\x14TakeFeedbackResponse\"q\n\x13TakeFeedbackRequest\x12;\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x01 \x01(\x0b\x32).truffle.os.BackgroundFeedFeedbackRequest\x12\x1d\n\x15\x66\x65\x65\x64\x62\x61\x63k_request_uuid\x18\x02 \x01(\t\"\xae\x01\n\rFeedOperation\x12\x15\n\rfeed_entry_id\x18\x01 \x01(\x04\x12\x43\n\toperation\x18\x02 \x01(\x0e\x32\x30.truffle.app.BackgroundAppNotification.Operation\x12\x30\n\x0cupdated_card\x18\x03 \x01(\x0b\x32\x15.truffle.app.FeedCardH\x00\x88\x01\x01\x42\x0f\n\r_updated_card\"@\n\x14HandleNewPostRequest\x12(\n\x08new_post\x18\x01 \x01(\x0b\x32\x16.truffle.app.FeedEntry\"\x17\n\x15HandleNewPostResponse\"\"\n\x0c\x43uratorState\x12\x12\n\nstate_json\x18\x01 \x01(\t\"\x87\x01\n\x12\x46\x65\x65\x64\x43ontrolRequest\x12\x38\n\x10last_known_state\x18\x01 \x01(\x0b\x32\x19.truffle.app.CuratorStateH\x00\x88\x01\x01\x12\"\n\x1a\x63urator_user_session_token\x18\x02 \x01(\tB\x13\n\x11_last_known_state\"2\n\x11\x46\x65\x65\x64\x62\x61\x63kProcessed\x12\x1d\n\x15\x66\x65\x65\x64\x62\x61\x63k_request_uuid\x18\x01 \x01(\t\"\xbe\x01\n\x13\x46\x65\x65\x64\x43ontrolResponse\x12/\n\toperation\x18\x01 \x01(\x0b\x32\x1a.truffle.app.FeedOperationH\x00\x12\x32\n\rstate_to_save\x18\x02 \x01(\x0b\x32\x19.truffle.app.CuratorStateH\x00\x12\x37\n\rfeedback_done\x18\x03 \x01(\x0b\x32\x1e.truffle.app.FeedbackProcessedH\x00\x42\t\n\x07\x63ontrol2\x91\x02\n\x0e\x43uratorService\x12S\n\x0cTakeFeedback\x12 .truffle.app.TakeFeedbackRequest\x1a!.truffle.app.TakeFeedbackResponse\x12V\n\rHandleNewPost\x12!.truffle.app.HandleNewPostRequest\x1a\".truffle.app.HandleNewPostResponse\x12R\n\x0b\x46\x65\x65\x64\x43ontrol\x12\x1f.truffle.app.FeedControlRequest\x1a .truffle.app.FeedControlResponse0\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.curator_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TAKEFEEDBACKRESPONSE']._serialized_start=149 + _globals['_TAKEFEEDBACKRESPONSE']._serialized_end=171 + _globals['_TAKEFEEDBACKREQUEST']._serialized_start=173 + _globals['_TAKEFEEDBACKREQUEST']._serialized_end=286 + _globals['_FEEDOPERATION']._serialized_start=289 + _globals['_FEEDOPERATION']._serialized_end=463 + _globals['_HANDLENEWPOSTREQUEST']._serialized_start=465 + _globals['_HANDLENEWPOSTREQUEST']._serialized_end=529 + _globals['_HANDLENEWPOSTRESPONSE']._serialized_start=531 + _globals['_HANDLENEWPOSTRESPONSE']._serialized_end=554 + _globals['_CURATORSTATE']._serialized_start=556 + _globals['_CURATORSTATE']._serialized_end=590 + _globals['_FEEDCONTROLREQUEST']._serialized_start=593 + _globals['_FEEDCONTROLREQUEST']._serialized_end=728 + _globals['_FEEDBACKPROCESSED']._serialized_start=730 + _globals['_FEEDBACKPROCESSED']._serialized_end=780 + _globals['_FEEDCONTROLRESPONSE']._serialized_start=783 + _globals['_FEEDCONTROLRESPONSE']._serialized_end=973 + _globals['_CURATORSERVICE']._serialized_start=976 + _globals['_CURATORSERVICE']._serialized_end=1249 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/curator_pb2.pyi b/truffle/app/curator_pb2.pyi new file mode 100644 index 0000000..7317d86 --- /dev/null +++ b/truffle/app/curator_pb2.pyi @@ -0,0 +1,71 @@ +from truffle.app import background_feed_pb2 as _background_feed_pb2 +from truffle.app import background_pb2 as _background_pb2 +from truffle.os import background_feed_queries_pb2 as _background_feed_queries_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class TakeFeedbackResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class TakeFeedbackRequest(_message.Message): + __slots__ = ("feedback", "feedback_request_uuid") + FEEDBACK_FIELD_NUMBER: _ClassVar[int] + FEEDBACK_REQUEST_UUID_FIELD_NUMBER: _ClassVar[int] + feedback: _background_feed_queries_pb2.BackgroundFeedFeedbackRequest + feedback_request_uuid: str + def __init__(self, feedback: _Optional[_Union[_background_feed_queries_pb2.BackgroundFeedFeedbackRequest, _Mapping]] = ..., feedback_request_uuid: _Optional[str] = ...) -> None: ... + +class FeedOperation(_message.Message): + __slots__ = ("feed_entry_id", "operation", "updated_card") + FEED_ENTRY_ID_FIELD_NUMBER: _ClassVar[int] + OPERATION_FIELD_NUMBER: _ClassVar[int] + UPDATED_CARD_FIELD_NUMBER: _ClassVar[int] + feed_entry_id: int + operation: _background_pb2.BackgroundAppNotification.Operation + updated_card: _background_feed_pb2.FeedCard + def __init__(self, feed_entry_id: _Optional[int] = ..., operation: _Optional[_Union[_background_pb2.BackgroundAppNotification.Operation, str]] = ..., updated_card: _Optional[_Union[_background_feed_pb2.FeedCard, _Mapping]] = ...) -> None: ... + +class HandleNewPostRequest(_message.Message): + __slots__ = ("new_post",) + NEW_POST_FIELD_NUMBER: _ClassVar[int] + new_post: _background_feed_pb2.FeedEntry + def __init__(self, new_post: _Optional[_Union[_background_feed_pb2.FeedEntry, _Mapping]] = ...) -> None: ... + +class HandleNewPostResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class CuratorState(_message.Message): + __slots__ = ("state_json",) + STATE_JSON_FIELD_NUMBER: _ClassVar[int] + state_json: str + def __init__(self, state_json: _Optional[str] = ...) -> None: ... + +class FeedControlRequest(_message.Message): + __slots__ = ("last_known_state", "curator_user_session_token") + LAST_KNOWN_STATE_FIELD_NUMBER: _ClassVar[int] + CURATOR_USER_SESSION_TOKEN_FIELD_NUMBER: _ClassVar[int] + last_known_state: CuratorState + curator_user_session_token: str + def __init__(self, last_known_state: _Optional[_Union[CuratorState, _Mapping]] = ..., curator_user_session_token: _Optional[str] = ...) -> None: ... + +class FeedbackProcessed(_message.Message): + __slots__ = ("feedback_request_uuid",) + FEEDBACK_REQUEST_UUID_FIELD_NUMBER: _ClassVar[int] + feedback_request_uuid: str + def __init__(self, feedback_request_uuid: _Optional[str] = ...) -> None: ... + +class FeedControlResponse(_message.Message): + __slots__ = ("operation", "state_to_save", "feedback_done") + OPERATION_FIELD_NUMBER: _ClassVar[int] + STATE_TO_SAVE_FIELD_NUMBER: _ClassVar[int] + FEEDBACK_DONE_FIELD_NUMBER: _ClassVar[int] + operation: FeedOperation + state_to_save: CuratorState + feedback_done: FeedbackProcessed + def __init__(self, operation: _Optional[_Union[FeedOperation, _Mapping]] = ..., state_to_save: _Optional[_Union[CuratorState, _Mapping]] = ..., feedback_done: _Optional[_Union[FeedbackProcessed, _Mapping]] = ...) -> None: ... diff --git a/truffle/app/curator_pb2_grpc.py b/truffle/app/curator_pb2_grpc.py new file mode 100644 index 0000000..000ab71 --- /dev/null +++ b/truffle/app/curator_pb2_grpc.py @@ -0,0 +1,183 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from truffle.app import curator_pb2 as truffle_dot_app_dot_curator__pb2 + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/curator_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class CuratorServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.TakeFeedback = channel.unary_unary( + '/truffle.app.CuratorService/TakeFeedback', + request_serializer=truffle_dot_app_dot_curator__pb2.TakeFeedbackRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_curator__pb2.TakeFeedbackResponse.FromString, + _registered_method=True) + self.HandleNewPost = channel.unary_unary( + '/truffle.app.CuratorService/HandleNewPost', + request_serializer=truffle_dot_app_dot_curator__pb2.HandleNewPostRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_curator__pb2.HandleNewPostResponse.FromString, + _registered_method=True) + self.FeedControl = channel.unary_stream( + '/truffle.app.CuratorService/FeedControl', + request_serializer=truffle_dot_app_dot_curator__pb2.FeedControlRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_curator__pb2.FeedControlResponse.FromString, + _registered_method=True) + + +class CuratorServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def TakeFeedback(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def HandleNewPost(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def FeedControl(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_CuratorServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'TakeFeedback': grpc.unary_unary_rpc_method_handler( + servicer.TakeFeedback, + request_deserializer=truffle_dot_app_dot_curator__pb2.TakeFeedbackRequest.FromString, + response_serializer=truffle_dot_app_dot_curator__pb2.TakeFeedbackResponse.SerializeToString, + ), + 'HandleNewPost': grpc.unary_unary_rpc_method_handler( + servicer.HandleNewPost, + request_deserializer=truffle_dot_app_dot_curator__pb2.HandleNewPostRequest.FromString, + response_serializer=truffle_dot_app_dot_curator__pb2.HandleNewPostResponse.SerializeToString, + ), + 'FeedControl': grpc.unary_stream_rpc_method_handler( + servicer.FeedControl, + request_deserializer=truffle_dot_app_dot_curator__pb2.FeedControlRequest.FromString, + response_serializer=truffle_dot_app_dot_curator__pb2.FeedControlResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'truffle.app.CuratorService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('truffle.app.CuratorService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class CuratorService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def TakeFeedback(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.CuratorService/TakeFeedback', + truffle_dot_app_dot_curator__pb2.TakeFeedbackRequest.SerializeToString, + truffle_dot_app_dot_curator__pb2.TakeFeedbackResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def HandleNewPost(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.CuratorService/HandleNewPost', + truffle_dot_app_dot_curator__pb2.HandleNewPostRequest.SerializeToString, + truffle_dot_app_dot_curator__pb2.HandleNewPostResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def FeedControl(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.app.CuratorService/FeedControl', + truffle_dot_app_dot_curator__pb2.FeedControlRequest.SerializeToString, + truffle_dot_app_dot_curator__pb2.FeedControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/truffle/app/default_app_manifest_pb2.py b/truffle/app/default_app_manifest_pb2.py new file mode 100644 index 0000000..1ae3978 --- /dev/null +++ b/truffle/app/default_app_manifest_pb2.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/default_app_manifest.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/default_app_manifest.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.app import app_type_pb2 as truffle_dot_app_dot_app__type__pb2 +from truffle.common import icon_pb2 as truffle_dot_common_dot_icon__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&truffle/app/default_app_manifest.proto\x12\x0btruffle.app\x1a\x1atruffle/app/app_type.proto\x1a\x19truffle/common/icon.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x02\n\x12\x44\x65\x66\x61ultAppManifest\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x30\n\x0cgenerated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x04\x61pps\x18\x03 \x03(\x0b\x32*.truffle.app.DefaultAppManifest.DefaultApp\x1a\xa3\x01\n\nDefaultApp\x12&\n\x08\x61pp_type\x18\x01 \x01(\x0e\x32\x14.truffle.app.AppType\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x12\n\nbundle_url\x18\x03 \x01(\t\x12\"\n\x04icon\x18\x04 \x01(\x0b\x32\x14.truffle.common.Icon\x12\x12\n\nbundle_md5\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\tb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.default_app_manifest_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_DEFAULTAPPMANIFEST']._serialized_start=144 + _globals['_DEFAULTAPPMANIFEST']._serialized_end=455 + _globals['_DEFAULTAPPMANIFEST_DEFAULTAPP']._serialized_start=292 + _globals['_DEFAULTAPPMANIFEST_DEFAULTAPP']._serialized_end=455 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/default_app_manifest_pb2.pyi b/truffle/app/default_app_manifest_pb2.pyi new file mode 100644 index 0000000..a06eb47 --- /dev/null +++ b/truffle/app/default_app_manifest_pb2.pyi @@ -0,0 +1,35 @@ +from truffle.app import app_type_pb2 as _app_type_pb2 +from truffle.common import icon_pb2 as _icon_pb2 +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class DefaultAppManifest(_message.Message): + __slots__ = ("version", "generated_at", "apps") + class DefaultApp(_message.Message): + __slots__ = ("app_type", "name", "bundle_url", "icon", "bundle_md5", "description") + APP_TYPE_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + BUNDLE_URL_FIELD_NUMBER: _ClassVar[int] + ICON_FIELD_NUMBER: _ClassVar[int] + BUNDLE_MD5_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + app_type: _app_type_pb2.AppType + name: str + bundle_url: str + icon: _icon_pb2.Icon + bundle_md5: str + description: str + def __init__(self, app_type: _Optional[_Union[_app_type_pb2.AppType, str]] = ..., name: _Optional[str] = ..., bundle_url: _Optional[str] = ..., icon: _Optional[_Union[_icon_pb2.Icon, _Mapping]] = ..., bundle_md5: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ... + VERSION_FIELD_NUMBER: _ClassVar[int] + GENERATED_AT_FIELD_NUMBER: _ClassVar[int] + APPS_FIELD_NUMBER: _ClassVar[int] + version: str + generated_at: _timestamp_pb2.Timestamp + apps: _containers.RepeatedCompositeFieldContainer[DefaultAppManifest.DefaultApp] + def __init__(self, version: _Optional[str] = ..., generated_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., apps: _Optional[_Iterable[_Union[DefaultAppManifest.DefaultApp, _Mapping]]] = ...) -> None: ... diff --git a/truffle/app/default_app_manifest_pb2_grpc.py b/truffle/app/default_app_manifest_pb2_grpc.py new file mode 100644 index 0000000..8507aef --- /dev/null +++ b/truffle/app/default_app_manifest_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/default_app_manifest_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/app/foreground_pb2.py b/truffle/app/foreground_pb2.py new file mode 100644 index 0000000..730276d --- /dev/null +++ b/truffle/app/foreground_pb2.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/foreground.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/foreground.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.common import icon_pb2 as truffle_dot_common_dot_icon__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/app/foreground.proto\x12\x0btruffle.app\x1a\x19truffle/common/icon.proto\"\xa7\x01\n\rForegroundApp\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x35\n\x08metadata\x18\x02 \x01(\x0b\x32#.truffle.app.ForegroundApp.Metadata\x1aQ\n\x08Metadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\"\n\x04icon\x18\x02 \x01(\x0b\x32\x14.truffle.common.Icon\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"O\n\x16\x46oregroundAppBuildInfo\x12\x35\n\x08metadata\x18\x01 \x01(\x0b\x32#.truffle.app.ForegroundApp.Metadatab\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.foreground_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_FOREGROUNDAPP']._serialized_start=73 + _globals['_FOREGROUNDAPP']._serialized_end=240 + _globals['_FOREGROUNDAPP_METADATA']._serialized_start=159 + _globals['_FOREGROUNDAPP_METADATA']._serialized_end=240 + _globals['_FOREGROUNDAPPBUILDINFO']._serialized_start=242 + _globals['_FOREGROUNDAPPBUILDINFO']._serialized_end=321 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/foreground_pb2.pyi b/truffle/app/foreground_pb2.pyi new file mode 100644 index 0000000..e946641 --- /dev/null +++ b/truffle/app/foreground_pb2.pyi @@ -0,0 +1,30 @@ +from truffle.common import icon_pb2 as _icon_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ForegroundApp(_message.Message): + __slots__ = ("uuid", "metadata") + class Metadata(_message.Message): + __slots__ = ("name", "icon", "description") + NAME_FIELD_NUMBER: _ClassVar[int] + ICON_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + name: str + icon: _icon_pb2.Icon + description: str + def __init__(self, name: _Optional[str] = ..., icon: _Optional[_Union[_icon_pb2.Icon, _Mapping]] = ..., description: _Optional[str] = ...) -> None: ... + UUID_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + uuid: str + metadata: ForegroundApp.Metadata + def __init__(self, uuid: _Optional[str] = ..., metadata: _Optional[_Union[ForegroundApp.Metadata, _Mapping]] = ...) -> None: ... + +class ForegroundAppBuildInfo(_message.Message): + __slots__ = ("metadata",) + METADATA_FIELD_NUMBER: _ClassVar[int] + metadata: ForegroundApp.Metadata + def __init__(self, metadata: _Optional[_Union[ForegroundApp.Metadata, _Mapping]] = ...) -> None: ... diff --git a/truffle/app/foreground_pb2_grpc.py b/truffle/app/foreground_pb2_grpc.py new file mode 100644 index 0000000..b0258f3 --- /dev/null +++ b/truffle/app/foreground_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/foreground_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/app/system_pb2.py b/truffle/app/system_pb2.py new file mode 100644 index 0000000..fa84ae9 --- /dev/null +++ b/truffle/app/system_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/system.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/system.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 +from truffle.app import app_build_pb2 as truffle_dot_app_dot_app__build__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18truffle/app/system.proto\x12\x0btruffle.app\x1a\x1ctruffle/app/background.proto\x1a\x1btruffle/app/app_build.proto\"\xc5\x01\n\tSystemApp\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x12\n\nsource_dir\x18\x02 \x01(\t\x12+\n\x07process\x18\x03 \x01(\x0b\x32\x1a.truffle.app.ProcessConfig\x12\x0f\n\x07no_ckpt\x18\x04 \x01(\x08\x12\x45\n\x0fschedule_policy\x18\x05 \x01(\x0b\x32\'.truffle.app.BackgroundAppRuntimePolicyH\x00\x88\x01\x01\x42\x12\n\x10_schedule_policyb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.system_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_SYSTEMAPP']._serialized_start=101 + _globals['_SYSTEMAPP']._serialized_end=298 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/system_pb2.pyi b/truffle/app/system_pb2.pyi new file mode 100644 index 0000000..1529d8c --- /dev/null +++ b/truffle/app/system_pb2.pyi @@ -0,0 +1,22 @@ +from truffle.app import background_pb2 as _background_pb2 +from truffle.app import app_build_pb2 as _app_build_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class SystemApp(_message.Message): + __slots__ = ("key", "source_dir", "process", "no_ckpt", "schedule_policy") + KEY_FIELD_NUMBER: _ClassVar[int] + SOURCE_DIR_FIELD_NUMBER: _ClassVar[int] + PROCESS_FIELD_NUMBER: _ClassVar[int] + NO_CKPT_FIELD_NUMBER: _ClassVar[int] + SCHEDULE_POLICY_FIELD_NUMBER: _ClassVar[int] + key: str + source_dir: str + process: _app_build_pb2.ProcessConfig + no_ckpt: bool + schedule_policy: _background_pb2.BackgroundAppRuntimePolicy + def __init__(self, key: _Optional[str] = ..., source_dir: _Optional[str] = ..., process: _Optional[_Union[_app_build_pb2.ProcessConfig, _Mapping]] = ..., no_ckpt: bool = ..., schedule_policy: _Optional[_Union[_background_pb2.BackgroundAppRuntimePolicy, _Mapping]] = ...) -> None: ... diff --git a/truffle/app/system_pb2_grpc.py b/truffle/app/system_pb2_grpc.py new file mode 100644 index 0000000..ea78c67 --- /dev/null +++ b/truffle/app/system_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/system_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/app/task_runtime_pb2.py b/truffle/app/task_runtime_pb2.py new file mode 100644 index 0000000..9a46ed1 --- /dev/null +++ b/truffle/app/task_runtime_pb2.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/app/task_runtime.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/app/task_runtime.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import task_pb2 as truffle_dot_os_dot_task__pb2 +try: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__info__pb2 +except AttributeError: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_info_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__step__pb2 +except AttributeError: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_step_pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle.common.content_pb2 +from truffle.os import task_user_response_pb2 as truffle_dot_os_dot_task__user__response__pb2 +from truffle.os import task_actions_pb2 as truffle_dot_os_dot_task__actions__pb2 +try: + truffle_dot_os_dot_task__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__pb2 +except AttributeError: + truffle_dot_os_dot_task__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_pb2 +try: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__info__pb2 +except AttributeError: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_info_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__step__pb2 +except AttributeError: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_step_pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.common.content_pb2 +try: + truffle_dot_os_dot_task__target__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__target__pb2 +except AttributeError: + truffle_dot_os_dot_task__target__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_target_pb2 +try: + truffle_dot_os_dot_task__options__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__options__pb2 +except AttributeError: + truffle_dot_os_dot_task__options__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_options_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_common_dot_tool__provider__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_common_dot_tool__provider__pb2 +except AttributeError: + truffle_dot_common_dot_tool__provider__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.common.tool_provider_pb2 +from truffle.os import task_step_pb2 as truffle_dot_os_dot_task__step__pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__step__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__step__pb2.truffle.common.content_pb2 +from truffle.infer.convo import conversation_pb2 as truffle_dot_infer_dot_convo_dot_conversation__pb2 +try: + truffle_dot_infer_dot_convo_dot_msg__pb2 = truffle_dot_infer_dot_convo_dot_conversation__pb2.truffle_dot_infer_dot_convo_dot_msg__pb2 +except AttributeError: + truffle_dot_infer_dot_convo_dot_msg__pb2 = truffle_dot_infer_dot_convo_dot_conversation__pb2.truffle.infer.convo.msg_pb2 +from truffle.app import background_feed_pb2 as truffle_dot_app_dot_background__feed__pb2 +from truffle.common import file_pb2 as truffle_dot_common_dot_file__pb2 +from truffle.os import task_options_pb2 as truffle_dot_os_dot_task__options__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1etruffle/app/task_runtime.proto\x12\x0btruffle.app\x1a\x15truffle/os/task.proto\x1a#truffle/os/task_user_response.proto\x1a\x1dtruffle/os/task_actions.proto\x1a\x1atruffle/os/task_step.proto\x1a&truffle/infer/convo/conversation.proto\x1a!truffle/app/background_feed.proto\x1a\x19truffle/common/file.proto\x1a\x1dtruffle/os/task_options.proto\"\xad\x01\n\rToolsProvider\x12:\n\nmcp_server\x18\x01 \x01(\x0b\x32$.truffle.app.ToolsProvider.MCPServerH\x00\x1aT\n\tMCPServer\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\x12\x11\n\x04path\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_pathB\n\n\x08provider\"K\n\x16\x41\x64\x64ToolProviderRequest\x12\x31\n\rtool_provider\x18\x01 \x01(\x0b\x32\x1a.truffle.app.ToolsProvider\"U\n\x17\x41\x64\x64ToolProviderResponse\x12:\n\x16\x63urrent_tool_providers\x18\x01 \x03(\x0b\x32\x1a.truffle.app.ToolsProvider\"2\n\x19RemoveToolProviderRequest\x12\x15\n\rprovider_uuid\x18\x01 \x01(\t\"X\n\x1aRemoveToolProviderResponse\x12:\n\x16\x63urrent_tool_providers\x18\x01 \x03(\x0b\x32\x1a.truffle.app.ToolsProvider\"h\n\x11TaskContextUpdate\x12\x37\n\x0clatest_convo\x18\x01 \x01(\x0b\x32!.truffle.infer.convo.Conversation\x12\x1a\n\x12\x61ssociated_node_id\x18\x02 \x01(\x05\"\xd5\x01\n\x07NewTask\x12-\n\x0cuser_message\x18\x01 \x01(\x0b\x32\x17.truffle.os.UserMessage\x12:\n\x0e\x61ttached_files\x18\x02 \x03(\x0b\x32\".truffle.common.AttachedFileIntent\x12\x45\n\x15\x61ttached_feed_entries\x18\x03 \x01(\x0b\x32!.truffle.app.FeedEntryTaskContextH\x00\x88\x01\x01\x42\x18\n\x16_attached_feed_entries\"b\n\x08PrevTask\x12\x1e\n\x04task\x18\x01 \x01(\x0b\x32\x10.truffle.os.Task\x12\x36\n\x0elatest_context\x18\x02 \x01(\x0b\x32\x1e.truffle.app.TaskContextUpdate\"\xd5\x01\n\x10StartTaskRequest\x12(\n\x08new_task\x18\x01 \x01(\x0b\x32\x14.truffle.app.NewTaskH\x00\x12*\n\tprev_task\x18\x02 \x01(\x0b\x32\x15.truffle.app.PrevTaskH\x00\x12(\n\x07options\x18\x03 \x01(\x0b\x32\x17.truffle.os.TaskOptions\x12\x32\n\x0etool_providers\x18\x04 \x03(\x0b\x32\x1a.truffle.app.ToolsProviderB\r\n\x0btask_source\"\x87\x01\n\x10TaskRuntimeError\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x14\n\x07\x64\x65tails\x18\x02 \x01(\tH\x00\x88\x01\x01\x12%\n\x18\x61ssociated_provider_uuid\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\n\n\x08_detailsB\x1b\n\x19_associated_provider_uuid\"\xc4\x01\n\x11TaskRuntimeUpdate\x12\x33\n\x0btask_update\x18\x01 \x01(\x0b\x32\x1c.truffle.os.TaskStreamUpdateH\x00\x12\x36\n\rruntime_error\x18\x02 \x01(\x0b\x32\x1d.truffle.app.TaskRuntimeErrorH\x00\x12\x38\n\x0e\x63ontext_update\x18\x03 \x01(\x0b\x32\x1e.truffle.app.TaskContextUpdateH\x00\x42\x08\n\x06update2\xd3\x03\n\x12TaskRuntimeService\x12K\n\x08OpenTask\x12\x1d.truffle.app.StartTaskRequest\x1a\x1e.truffle.app.TaskRuntimeUpdate0\x01\x12S\n\x0fHandleInterrupt\x12 .truffle.os.InterruptTaskRequest\x1a\x1e.truffle.os.TaskActionResponse\x12V\n\x12HandleUserResponse\x12 .truffle.os.RespondToTaskRequest\x1a\x1e.truffle.os.TaskActionResponse\x12\\\n\x0f\x41\x64\x64ToolProvider\x12#.truffle.app.AddToolProviderRequest\x1a$.truffle.app.AddToolProviderResponse\x12\x65\n\x12RemoveToolProvider\x12&.truffle.app.RemoveToolProviderRequest\x1a\'.truffle.app.RemoveToolProviderResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.app.task_runtime_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TOOLSPROVIDER']._serialized_start=300 + _globals['_TOOLSPROVIDER']._serialized_end=473 + _globals['_TOOLSPROVIDER_MCPSERVER']._serialized_start=377 + _globals['_TOOLSPROVIDER_MCPSERVER']._serialized_end=461 + _globals['_ADDTOOLPROVIDERREQUEST']._serialized_start=475 + _globals['_ADDTOOLPROVIDERREQUEST']._serialized_end=550 + _globals['_ADDTOOLPROVIDERRESPONSE']._serialized_start=552 + _globals['_ADDTOOLPROVIDERRESPONSE']._serialized_end=637 + _globals['_REMOVETOOLPROVIDERREQUEST']._serialized_start=639 + _globals['_REMOVETOOLPROVIDERREQUEST']._serialized_end=689 + _globals['_REMOVETOOLPROVIDERRESPONSE']._serialized_start=691 + _globals['_REMOVETOOLPROVIDERRESPONSE']._serialized_end=779 + _globals['_TASKCONTEXTUPDATE']._serialized_start=781 + _globals['_TASKCONTEXTUPDATE']._serialized_end=885 + _globals['_NEWTASK']._serialized_start=888 + _globals['_NEWTASK']._serialized_end=1101 + _globals['_PREVTASK']._serialized_start=1103 + _globals['_PREVTASK']._serialized_end=1201 + _globals['_STARTTASKREQUEST']._serialized_start=1204 + _globals['_STARTTASKREQUEST']._serialized_end=1417 + _globals['_TASKRUNTIMEERROR']._serialized_start=1420 + _globals['_TASKRUNTIMEERROR']._serialized_end=1555 + _globals['_TASKRUNTIMEUPDATE']._serialized_start=1558 + _globals['_TASKRUNTIMEUPDATE']._serialized_end=1754 + _globals['_TASKRUNTIMESERVICE']._serialized_start=1757 + _globals['_TASKRUNTIMESERVICE']._serialized_end=2224 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/app/task_runtime_pb2.pyi b/truffle/app/task_runtime_pb2.pyi new file mode 100644 index 0000000..dce11c1 --- /dev/null +++ b/truffle/app/task_runtime_pb2.pyi @@ -0,0 +1,124 @@ +from truffle.os import task_pb2 as _task_pb2 +from truffle.os import task_info_pb2 as _task_info_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2 +from truffle.os import task_step_pb2 as _task_step_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2_1 +from truffle.os import task_actions_pb2 as _task_actions_pb2 +from truffle.os import task_pb2 as _task_pb2_1 +from truffle.os import task_target_pb2 as _task_target_pb2 +from truffle.os import task_options_pb2 as _task_options_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2_1_1 +from truffle.common import tool_provider_pb2 as _tool_provider_pb2 +from truffle.os import task_step_pb2 as _task_step_pb2_1 +from truffle.common import content_pb2 as _content_pb2 +from truffle.infer.convo import conversation_pb2 as _conversation_pb2 +from truffle.infer.convo import msg_pb2 as _msg_pb2 +from truffle.app import background_feed_pb2 as _background_feed_pb2 +from truffle.common import file_pb2 as _file_pb2 +from truffle.os import task_options_pb2 as _task_options_pb2_1 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ToolsProvider(_message.Message): + __slots__ = ("mcp_server",) + class MCPServer(_message.Message): + __slots__ = ("uuid", "address", "port", "path") + UUID_FIELD_NUMBER: _ClassVar[int] + ADDRESS_FIELD_NUMBER: _ClassVar[int] + PORT_FIELD_NUMBER: _ClassVar[int] + PATH_FIELD_NUMBER: _ClassVar[int] + uuid: str + address: str + port: int + path: str + def __init__(self, uuid: _Optional[str] = ..., address: _Optional[str] = ..., port: _Optional[int] = ..., path: _Optional[str] = ...) -> None: ... + MCP_SERVER_FIELD_NUMBER: _ClassVar[int] + mcp_server: ToolsProvider.MCPServer + def __init__(self, mcp_server: _Optional[_Union[ToolsProvider.MCPServer, _Mapping]] = ...) -> None: ... + +class AddToolProviderRequest(_message.Message): + __slots__ = ("tool_provider",) + TOOL_PROVIDER_FIELD_NUMBER: _ClassVar[int] + tool_provider: ToolsProvider + def __init__(self, tool_provider: _Optional[_Union[ToolsProvider, _Mapping]] = ...) -> None: ... + +class AddToolProviderResponse(_message.Message): + __slots__ = ("current_tool_providers",) + CURRENT_TOOL_PROVIDERS_FIELD_NUMBER: _ClassVar[int] + current_tool_providers: _containers.RepeatedCompositeFieldContainer[ToolsProvider] + def __init__(self, current_tool_providers: _Optional[_Iterable[_Union[ToolsProvider, _Mapping]]] = ...) -> None: ... + +class RemoveToolProviderRequest(_message.Message): + __slots__ = ("provider_uuid",) + PROVIDER_UUID_FIELD_NUMBER: _ClassVar[int] + provider_uuid: str + def __init__(self, provider_uuid: _Optional[str] = ...) -> None: ... + +class RemoveToolProviderResponse(_message.Message): + __slots__ = ("current_tool_providers",) + CURRENT_TOOL_PROVIDERS_FIELD_NUMBER: _ClassVar[int] + current_tool_providers: _containers.RepeatedCompositeFieldContainer[ToolsProvider] + def __init__(self, current_tool_providers: _Optional[_Iterable[_Union[ToolsProvider, _Mapping]]] = ...) -> None: ... + +class TaskContextUpdate(_message.Message): + __slots__ = ("latest_convo", "associated_node_id") + LATEST_CONVO_FIELD_NUMBER: _ClassVar[int] + ASSOCIATED_NODE_ID_FIELD_NUMBER: _ClassVar[int] + latest_convo: _conversation_pb2.Conversation + associated_node_id: int + def __init__(self, latest_convo: _Optional[_Union[_conversation_pb2.Conversation, _Mapping]] = ..., associated_node_id: _Optional[int] = ...) -> None: ... + +class NewTask(_message.Message): + __slots__ = ("user_message", "attached_files", "attached_feed_entries") + USER_MESSAGE_FIELD_NUMBER: _ClassVar[int] + ATTACHED_FILES_FIELD_NUMBER: _ClassVar[int] + ATTACHED_FEED_ENTRIES_FIELD_NUMBER: _ClassVar[int] + user_message: _task_user_response_pb2_1_1.UserMessage + attached_files: _containers.RepeatedCompositeFieldContainer[_file_pb2.AttachedFileIntent] + attached_feed_entries: _background_feed_pb2.FeedEntryTaskContext + def __init__(self, user_message: _Optional[_Union[_task_user_response_pb2_1_1.UserMessage, _Mapping]] = ..., attached_files: _Optional[_Iterable[_Union[_file_pb2.AttachedFileIntent, _Mapping]]] = ..., attached_feed_entries: _Optional[_Union[_background_feed_pb2.FeedEntryTaskContext, _Mapping]] = ...) -> None: ... + +class PrevTask(_message.Message): + __slots__ = ("task", "latest_context") + TASK_FIELD_NUMBER: _ClassVar[int] + LATEST_CONTEXT_FIELD_NUMBER: _ClassVar[int] + task: _task_pb2_1.Task + latest_context: TaskContextUpdate + def __init__(self, task: _Optional[_Union[_task_pb2_1.Task, _Mapping]] = ..., latest_context: _Optional[_Union[TaskContextUpdate, _Mapping]] = ...) -> None: ... + +class StartTaskRequest(_message.Message): + __slots__ = ("new_task", "prev_task", "options", "tool_providers") + NEW_TASK_FIELD_NUMBER: _ClassVar[int] + PREV_TASK_FIELD_NUMBER: _ClassVar[int] + OPTIONS_FIELD_NUMBER: _ClassVar[int] + TOOL_PROVIDERS_FIELD_NUMBER: _ClassVar[int] + new_task: NewTask + prev_task: PrevTask + options: _task_options_pb2_1.TaskOptions + tool_providers: _containers.RepeatedCompositeFieldContainer[ToolsProvider] + def __init__(self, new_task: _Optional[_Union[NewTask, _Mapping]] = ..., prev_task: _Optional[_Union[PrevTask, _Mapping]] = ..., options: _Optional[_Union[_task_options_pb2_1.TaskOptions, _Mapping]] = ..., tool_providers: _Optional[_Iterable[_Union[ToolsProvider, _Mapping]]] = ...) -> None: ... + +class TaskRuntimeError(_message.Message): + __slots__ = ("error", "details", "associated_provider_uuid") + ERROR_FIELD_NUMBER: _ClassVar[int] + DETAILS_FIELD_NUMBER: _ClassVar[int] + ASSOCIATED_PROVIDER_UUID_FIELD_NUMBER: _ClassVar[int] + error: str + details: str + associated_provider_uuid: str + def __init__(self, error: _Optional[str] = ..., details: _Optional[str] = ..., associated_provider_uuid: _Optional[str] = ...) -> None: ... + +class TaskRuntimeUpdate(_message.Message): + __slots__ = ("task_update", "runtime_error", "context_update") + TASK_UPDATE_FIELD_NUMBER: _ClassVar[int] + RUNTIME_ERROR_FIELD_NUMBER: _ClassVar[int] + CONTEXT_UPDATE_FIELD_NUMBER: _ClassVar[int] + task_update: _task_pb2_1.TaskStreamUpdate + runtime_error: TaskRuntimeError + context_update: TaskContextUpdate + def __init__(self, task_update: _Optional[_Union[_task_pb2_1.TaskStreamUpdate, _Mapping]] = ..., runtime_error: _Optional[_Union[TaskRuntimeError, _Mapping]] = ..., context_update: _Optional[_Union[TaskContextUpdate, _Mapping]] = ...) -> None: ... diff --git a/truffle/app/task_runtime_pb2_grpc.py b/truffle/app/task_runtime_pb2_grpc.py new file mode 100644 index 0000000..0fe0e2b --- /dev/null +++ b/truffle/app/task_runtime_pb2_grpc.py @@ -0,0 +1,274 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from truffle.app import task_runtime_pb2 as truffle_dot_app_dot_task__runtime__pb2 +from truffle.os import task_actions_pb2 as truffle_dot_os_dot_task__actions__pb2 +from truffle.os import task_user_response_pb2 as truffle_dot_os_dot_task__user__response__pb2 + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/app/task_runtime_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class TaskRuntimeServiceStub(object): + """task == foreground app, bear with me + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.OpenTask = channel.unary_stream( + '/truffle.app.TaskRuntimeService/OpenTask', + request_serializer=truffle_dot_app_dot_task__runtime__pb2.StartTaskRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_task__runtime__pb2.TaskRuntimeUpdate.FromString, + _registered_method=True) + self.HandleInterrupt = channel.unary_unary( + '/truffle.app.TaskRuntimeService/HandleInterrupt', + request_serializer=truffle_dot_os_dot_task__actions__pb2.InterruptTaskRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + _registered_method=True) + self.HandleUserResponse = channel.unary_unary( + '/truffle.app.TaskRuntimeService/HandleUserResponse', + request_serializer=truffle_dot_os_dot_task__user__response__pb2.RespondToTaskRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + _registered_method=True) + self.AddToolProvider = channel.unary_unary( + '/truffle.app.TaskRuntimeService/AddToolProvider', + request_serializer=truffle_dot_app_dot_task__runtime__pb2.AddToolProviderRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_task__runtime__pb2.AddToolProviderResponse.FromString, + _registered_method=True) + self.RemoveToolProvider = channel.unary_unary( + '/truffle.app.TaskRuntimeService/RemoveToolProvider', + request_serializer=truffle_dot_app_dot_task__runtime__pb2.RemoveToolProviderRequest.SerializeToString, + response_deserializer=truffle_dot_app_dot_task__runtime__pb2.RemoveToolProviderResponse.FromString, + _registered_method=True) + + +class TaskRuntimeServiceServicer(object): + """task == foreground app, bear with me + """ + + def OpenTask(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def HandleInterrupt(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def HandleUserResponse(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def AddToolProvider(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemoveToolProvider(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_TaskRuntimeServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'OpenTask': grpc.unary_stream_rpc_method_handler( + servicer.OpenTask, + request_deserializer=truffle_dot_app_dot_task__runtime__pb2.StartTaskRequest.FromString, + response_serializer=truffle_dot_app_dot_task__runtime__pb2.TaskRuntimeUpdate.SerializeToString, + ), + 'HandleInterrupt': grpc.unary_unary_rpc_method_handler( + servicer.HandleInterrupt, + request_deserializer=truffle_dot_os_dot_task__actions__pb2.InterruptTaskRequest.FromString, + response_serializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.SerializeToString, + ), + 'HandleUserResponse': grpc.unary_unary_rpc_method_handler( + servicer.HandleUserResponse, + request_deserializer=truffle_dot_os_dot_task__user__response__pb2.RespondToTaskRequest.FromString, + response_serializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.SerializeToString, + ), + 'AddToolProvider': grpc.unary_unary_rpc_method_handler( + servicer.AddToolProvider, + request_deserializer=truffle_dot_app_dot_task__runtime__pb2.AddToolProviderRequest.FromString, + response_serializer=truffle_dot_app_dot_task__runtime__pb2.AddToolProviderResponse.SerializeToString, + ), + 'RemoveToolProvider': grpc.unary_unary_rpc_method_handler( + servicer.RemoveToolProvider, + request_deserializer=truffle_dot_app_dot_task__runtime__pb2.RemoveToolProviderRequest.FromString, + response_serializer=truffle_dot_app_dot_task__runtime__pb2.RemoveToolProviderResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'truffle.app.TaskRuntimeService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('truffle.app.TaskRuntimeService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class TaskRuntimeService(object): + """task == foreground app, bear with me + """ + + @staticmethod + def OpenTask(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.app.TaskRuntimeService/OpenTask', + truffle_dot_app_dot_task__runtime__pb2.StartTaskRequest.SerializeToString, + truffle_dot_app_dot_task__runtime__pb2.TaskRuntimeUpdate.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def HandleInterrupt(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.TaskRuntimeService/HandleInterrupt', + truffle_dot_os_dot_task__actions__pb2.InterruptTaskRequest.SerializeToString, + truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def HandleUserResponse(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.TaskRuntimeService/HandleUserResponse', + truffle_dot_os_dot_task__user__response__pb2.RespondToTaskRequest.SerializeToString, + truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def AddToolProvider(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.TaskRuntimeService/AddToolProvider', + truffle_dot_app_dot_task__runtime__pb2.AddToolProviderRequest.SerializeToString, + truffle_dot_app_dot_task__runtime__pb2.AddToolProviderResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RemoveToolProvider(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.app.TaskRuntimeService/RemoveToolProvider', + truffle_dot_app_dot_task__runtime__pb2.RemoveToolProviderRequest.SerializeToString, + truffle_dot_app_dot_task__runtime__pb2.RemoveToolProviderResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/truffle/common/__init__.py b/truffle/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/truffle/common/content_pb2.py b/truffle/common/content_pb2.py new file mode 100644 index 0000000..2eeffb8 --- /dev/null +++ b/truffle/common/content_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/common/content.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/common/content.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/common/content.proto\x12\x0etruffle.common\"\x1a\n\x0bMediaSource\x12\x0b\n\x03uri\x18\x01 \x01(\t\":\n\x0cWebComponent\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.common.content_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_MEDIASOURCE']._serialized_start=48 + _globals['_MEDIASOURCE']._serialized_end=74 + _globals['_WEBCOMPONENT']._serialized_start=76 + _globals['_WEBCOMPONENT']._serialized_end=134 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/common/content_pb2.pyi b/truffle/common/content_pb2.pyi new file mode 100644 index 0000000..f31bca8 --- /dev/null +++ b/truffle/common/content_pb2.pyi @@ -0,0 +1,21 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional + +DESCRIPTOR: _descriptor.FileDescriptor + +class MediaSource(_message.Message): + __slots__ = ("uri",) + URI_FIELD_NUMBER: _ClassVar[int] + uri: str + def __init__(self, uri: _Optional[str] = ...) -> None: ... + +class WebComponent(_message.Message): + __slots__ = ("uri", "width", "height") + URI_FIELD_NUMBER: _ClassVar[int] + WIDTH_FIELD_NUMBER: _ClassVar[int] + HEIGHT_FIELD_NUMBER: _ClassVar[int] + uri: str + width: int + height: int + def __init__(self, uri: _Optional[str] = ..., width: _Optional[int] = ..., height: _Optional[int] = ...) -> None: ... diff --git a/truffle/common/content_pb2_grpc.py b/truffle/common/content_pb2_grpc.py new file mode 100644 index 0000000..308017e --- /dev/null +++ b/truffle/common/content_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/common/content_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/common/file_pb2.py b/truffle/common/file_pb2.py new file mode 100644 index 0000000..604fc59 --- /dev/null +++ b/truffle/common/file_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/common/file.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/common/file.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19truffle/common/file.proto\x12\x0etruffle.common\"=\n\x0c\x46ileMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x0c\n\x04size\x18\x03 \x01(\x04\"L\n\x0c\x41ttachedFile\x12\x0c\n\x04path\x18\x01 \x01(\t\x12.\n\x08metadata\x18\x02 \x01(\x0b\x32\x1c.truffle.common.FileMetadata\"@\n\x12\x41ttachedFileIntent\x12*\n\x04\x66ile\x18\x01 \x01(\x0b\x32\x1c.truffle.common.AttachedFileb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.common.file_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_FILEMETADATA']._serialized_start=45 + _globals['_FILEMETADATA']._serialized_end=106 + _globals['_ATTACHEDFILE']._serialized_start=108 + _globals['_ATTACHEDFILE']._serialized_end=184 + _globals['_ATTACHEDFILEINTENT']._serialized_start=186 + _globals['_ATTACHEDFILEINTENT']._serialized_end=250 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/common/file_pb2.pyi b/truffle/common/file_pb2.pyi new file mode 100644 index 0000000..79b2d95 --- /dev/null +++ b/truffle/common/file_pb2.pyi @@ -0,0 +1,30 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class FileMetadata(_message.Message): + __slots__ = ("name", "mime_type", "size") + NAME_FIELD_NUMBER: _ClassVar[int] + MIME_TYPE_FIELD_NUMBER: _ClassVar[int] + SIZE_FIELD_NUMBER: _ClassVar[int] + name: str + mime_type: str + size: int + def __init__(self, name: _Optional[str] = ..., mime_type: _Optional[str] = ..., size: _Optional[int] = ...) -> None: ... + +class AttachedFile(_message.Message): + __slots__ = ("path", "metadata") + PATH_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + path: str + metadata: FileMetadata + def __init__(self, path: _Optional[str] = ..., metadata: _Optional[_Union[FileMetadata, _Mapping]] = ...) -> None: ... + +class AttachedFileIntent(_message.Message): + __slots__ = ("file",) + FILE_FIELD_NUMBER: _ClassVar[int] + file: AttachedFile + def __init__(self, file: _Optional[_Union[AttachedFile, _Mapping]] = ...) -> None: ... diff --git a/truffle/common/file_pb2_grpc.py b/truffle/common/file_pb2_grpc.py new file mode 100644 index 0000000..d037a40 --- /dev/null +++ b/truffle/common/file_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/common/file_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/common/icon_pb2.py b/truffle/common/icon_pb2.py new file mode 100644 index 0000000..25b47f3 --- /dev/null +++ b/truffle/common/icon_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/common/icon.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/common/icon.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19truffle/common/icon.proto\x12\x0etruffle.common\"\x18\n\x04Icon\x12\x10\n\x08png_data\x18\x01 \x01(\x0c\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.common.icon_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_ICON']._serialized_start=45 + _globals['_ICON']._serialized_end=69 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/common/icon_pb2.pyi b/truffle/common/icon_pb2.pyi new file mode 100644 index 0000000..7ebe6b8 --- /dev/null +++ b/truffle/common/icon_pb2.pyi @@ -0,0 +1,11 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional + +DESCRIPTOR: _descriptor.FileDescriptor + +class Icon(_message.Message): + __slots__ = ("png_data",) + PNG_DATA_FIELD_NUMBER: _ClassVar[int] + png_data: bytes + def __init__(self, png_data: _Optional[bytes] = ...) -> None: ... diff --git a/truffle/common/icon_pb2_grpc.py b/truffle/common/icon_pb2_grpc.py new file mode 100644 index 0000000..7c5c6b0 --- /dev/null +++ b/truffle/common/icon_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/common/icon_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/common/led_states_pb2.py b/truffle/common/led_states_pb2.py new file mode 100644 index 0000000..1ebad80 --- /dev/null +++ b/truffle/common/led_states_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/common/led_states.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/common/led_states.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ftruffle/common/led_states.proto\x12\x0etruffle.common\"C\n\tLedStatus\x12\'\n\x05state\x18\x01 \x01(\x0e\x32\x18.truffle.common.LedState\x12\r\n\x05\x63olor\x18\x02 \x01(\r*\xfd\x02\n\x08LedState\x12\x15\n\x11LED_STATE_INVALID\x10\x00\x12\x16\n\x12LED_STATE_DISABLED\x10\x00\x12\x11\n\rLED_STATE_OFF\x10\x01\x12\x15\n\x11LED_STATE_STARTUP\x10\x02\x12\x1e\n\x1aLED_STATE_READY_TO_CONNECT\x10\x03\x12\x18\n\x14LED_STATE_CONNECTING\x10\x04\x12\x17\n\x13LED_STATE_CONNECTED\x10\x05\x12\x13\n\x0fLED_STATE_ERROR\x10\x06\x12\x17\n\x13LED_STATE_REASONING\x10\x07\x12\x12\n\x0eLED_STATE_IDLE\x10\x08\x12\x14\n\x10LED_STATE_TYPING\x10\t\x12\x1d\n\x19LED_STATE_RESPOND_TO_USER\x10\n\x12\x15\n\x11LED_STATE_ONBOARD\x10\x0b\x12\x19\n\x15LED_STATE_ONCE_ACTION\x10\x0c\x12\x18\n\x14LED_STATE_ONCE_FLAIR\x10\r\x1a\x02\x10\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.common.led_states_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_LEDSTATE']._loaded_options = None + _globals['_LEDSTATE']._serialized_options = b'\020\001' + _globals['_LEDSTATE']._serialized_start=121 + _globals['_LEDSTATE']._serialized_end=502 + _globals['_LEDSTATUS']._serialized_start=51 + _globals['_LEDSTATUS']._serialized_end=118 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/common/led_states_pb2.pyi b/truffle/common/led_states_pb2.pyi new file mode 100644 index 0000000..3e2f122 --- /dev/null +++ b/truffle/common/led_states_pb2.pyi @@ -0,0 +1,47 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class LedState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + LED_STATE_INVALID: _ClassVar[LedState] + LED_STATE_DISABLED: _ClassVar[LedState] + LED_STATE_OFF: _ClassVar[LedState] + LED_STATE_STARTUP: _ClassVar[LedState] + LED_STATE_READY_TO_CONNECT: _ClassVar[LedState] + LED_STATE_CONNECTING: _ClassVar[LedState] + LED_STATE_CONNECTED: _ClassVar[LedState] + LED_STATE_ERROR: _ClassVar[LedState] + LED_STATE_REASONING: _ClassVar[LedState] + LED_STATE_IDLE: _ClassVar[LedState] + LED_STATE_TYPING: _ClassVar[LedState] + LED_STATE_RESPOND_TO_USER: _ClassVar[LedState] + LED_STATE_ONBOARD: _ClassVar[LedState] + LED_STATE_ONCE_ACTION: _ClassVar[LedState] + LED_STATE_ONCE_FLAIR: _ClassVar[LedState] +LED_STATE_INVALID: LedState +LED_STATE_DISABLED: LedState +LED_STATE_OFF: LedState +LED_STATE_STARTUP: LedState +LED_STATE_READY_TO_CONNECT: LedState +LED_STATE_CONNECTING: LedState +LED_STATE_CONNECTED: LedState +LED_STATE_ERROR: LedState +LED_STATE_REASONING: LedState +LED_STATE_IDLE: LedState +LED_STATE_TYPING: LedState +LED_STATE_RESPOND_TO_USER: LedState +LED_STATE_ONBOARD: LedState +LED_STATE_ONCE_ACTION: LedState +LED_STATE_ONCE_FLAIR: LedState + +class LedStatus(_message.Message): + __slots__ = ("state", "color") + STATE_FIELD_NUMBER: _ClassVar[int] + COLOR_FIELD_NUMBER: _ClassVar[int] + state: LedState + color: int + def __init__(self, state: _Optional[_Union[LedState, str]] = ..., color: _Optional[int] = ...) -> None: ... diff --git a/truffle/common/led_states_pb2_grpc.py b/truffle/common/led_states_pb2_grpc.py new file mode 100644 index 0000000..276c1ac --- /dev/null +++ b/truffle/common/led_states_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/common/led_states_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/common/tool_provider_pb2.py b/truffle/common/tool_provider_pb2.py new file mode 100644 index 0000000..024bb84 --- /dev/null +++ b/truffle/common/tool_provider_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/common/tool_provider.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/common/tool_provider.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"truffle/common/tool_provider.proto\x12\x0etruffle.common\"\xce\x01\n\x14\x45xternalToolProvider\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12L\n\nmcp_server\x18\x02 \x01(\x0b\x32\x36.truffle.common.ExternalToolProvider.ExternalMCPServerH\x00\x1aN\n\x11\x45xternalMCPServer\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x11\n\x04path\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_pathB\n\n\x08provider\"d\n\x1a\x45xternalToolProvidersError\x12\x15\n\rprovider_uuid\x18\x01 \x01(\t\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x14\n\x07\x64\x65tails\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_detailsb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.common.tool_provider_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_EXTERNALTOOLPROVIDER']._serialized_start=55 + _globals['_EXTERNALTOOLPROVIDER']._serialized_end=261 + _globals['_EXTERNALTOOLPROVIDER_EXTERNALMCPSERVER']._serialized_start=171 + _globals['_EXTERNALTOOLPROVIDER_EXTERNALMCPSERVER']._serialized_end=249 + _globals['_EXTERNALTOOLPROVIDERSERROR']._serialized_start=263 + _globals['_EXTERNALTOOLPROVIDERSERROR']._serialized_end=363 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/common/tool_provider_pb2.pyi b/truffle/common/tool_provider_pb2.pyi new file mode 100644 index 0000000..843d87d --- /dev/null +++ b/truffle/common/tool_provider_pb2.pyi @@ -0,0 +1,33 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ExternalToolProvider(_message.Message): + __slots__ = ("uuid", "mcp_server") + class ExternalMCPServer(_message.Message): + __slots__ = ("address", "port", "path") + ADDRESS_FIELD_NUMBER: _ClassVar[int] + PORT_FIELD_NUMBER: _ClassVar[int] + PATH_FIELD_NUMBER: _ClassVar[int] + address: str + port: int + path: str + def __init__(self, address: _Optional[str] = ..., port: _Optional[int] = ..., path: _Optional[str] = ...) -> None: ... + UUID_FIELD_NUMBER: _ClassVar[int] + MCP_SERVER_FIELD_NUMBER: _ClassVar[int] + uuid: str + mcp_server: ExternalToolProvider.ExternalMCPServer + def __init__(self, uuid: _Optional[str] = ..., mcp_server: _Optional[_Union[ExternalToolProvider.ExternalMCPServer, _Mapping]] = ...) -> None: ... + +class ExternalToolProvidersError(_message.Message): + __slots__ = ("provider_uuid", "error", "details") + PROVIDER_UUID_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + DETAILS_FIELD_NUMBER: _ClassVar[int] + provider_uuid: str + error: str + details: str + def __init__(self, provider_uuid: _Optional[str] = ..., error: _Optional[str] = ..., details: _Optional[str] = ...) -> None: ... diff --git a/truffle/common/tool_provider_pb2_grpc.py b/truffle/common/tool_provider_pb2_grpc.py new file mode 100644 index 0000000..1d2335c --- /dev/null +++ b/truffle/common/tool_provider_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/common/tool_provider_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/__init__.py b/truffle/infer/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/truffle/infer/convo/__init__.py b/truffle/infer/convo/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/truffle/infer/convo/conversation_pb2.py b/truffle/infer/convo/conversation_pb2.py new file mode 100644 index 0000000..5ba3cc2 --- /dev/null +++ b/truffle/infer/convo/conversation_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/convo/conversation.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/convo/conversation.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.infer.convo import msg_pb2 as truffle_dot_infer_dot_convo_dot_msg__pb2 + +from truffle.infer.convo.msg_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&truffle/infer/convo/conversation.proto\x12\x13truffle.infer.convo\x1a\x1dtruffle/infer/convo/msg.proto\"R\n\x0c\x43onversation\x12.\n\x08messages\x18\x01 \x03(\x0b\x32\x1c.truffle.infer.convo.Message\x12\x12\n\nmodel_uuid\x18\x03 \x01(\t\"3\n\x0c\x42uiltContext\x12\x0f\n\x07\x63ontext\x18\x01 \x01(\t\x12\x12\n\nmodel_uuid\x18\x02 \x01(\tP\x00\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.convo.conversation_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_CONVERSATION']._serialized_start=94 + _globals['_CONVERSATION']._serialized_end=176 + _globals['_BUILTCONTEXT']._serialized_start=178 + _globals['_BUILTCONTEXT']._serialized_end=229 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/convo/conversation_pb2.pyi b/truffle/infer/convo/conversation_pb2.pyi new file mode 100644 index 0000000..8366e78 --- /dev/null +++ b/truffle/infer/convo/conversation_pb2.pyi @@ -0,0 +1,25 @@ +from truffle.infer.convo import msg_pb2 as _msg_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from truffle.infer.convo.msg_pb2 import Message as Message + +DESCRIPTOR: _descriptor.FileDescriptor + +class Conversation(_message.Message): + __slots__ = ("messages", "model_uuid") + MESSAGES_FIELD_NUMBER: _ClassVar[int] + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + messages: _containers.RepeatedCompositeFieldContainer[_msg_pb2.Message] + model_uuid: str + def __init__(self, messages: _Optional[_Iterable[_Union[_msg_pb2.Message, _Mapping]]] = ..., model_uuid: _Optional[str] = ...) -> None: ... + +class BuiltContext(_message.Message): + __slots__ = ("context", "model_uuid") + CONTEXT_FIELD_NUMBER: _ClassVar[int] + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + context: str + model_uuid: str + def __init__(self, context: _Optional[str] = ..., model_uuid: _Optional[str] = ...) -> None: ... diff --git a/truffle/infer/convo/conversation_pb2_grpc.py b/truffle/infer/convo/conversation_pb2_grpc.py new file mode 100644 index 0000000..e3a3b17 --- /dev/null +++ b/truffle/infer/convo/conversation_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/convo/conversation_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/convo/msg_pb2.py b/truffle/infer/convo/msg_pb2.py new file mode 100644 index 0000000..2ec02cd --- /dev/null +++ b/truffle/infer/convo/msg_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/convo/msg.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/convo/msg.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/infer/convo/msg.proto\x12\x13truffle.infer.convo\"\xa8\x01\n\x07Message\x12/\n\x04role\x18\x01 \x01(\x0e\x32!.truffle.infer.convo.Message.Role\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"[\n\x04Role\x12\x10\n\x0cROLE_INVALID\x10\x00\x12\x0f\n\x0bROLE_SYSTEM\x10\x01\x12\r\n\tROLE_USER\x10\x02\x12\x12\n\x0eROLE_ASSISTANT\x10\x03\x12\r\n\tROLE_TOOL\x10\x04\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.convo.msg_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_MESSAGE']._serialized_start=55 + _globals['_MESSAGE']._serialized_end=223 + _globals['_MESSAGE_ROLE']._serialized_start=132 + _globals['_MESSAGE_ROLE']._serialized_end=223 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/convo/msg_pb2.pyi b/truffle/infer/convo/msg_pb2.pyi new file mode 100644 index 0000000..1594747 --- /dev/null +++ b/truffle/infer/convo/msg_pb2.pyi @@ -0,0 +1,26 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class Message(_message.Message): + __slots__ = ("role", "content") + class Role(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + ROLE_INVALID: _ClassVar[Message.Role] + ROLE_SYSTEM: _ClassVar[Message.Role] + ROLE_USER: _ClassVar[Message.Role] + ROLE_ASSISTANT: _ClassVar[Message.Role] + ROLE_TOOL: _ClassVar[Message.Role] + ROLE_INVALID: Message.Role + ROLE_SYSTEM: Message.Role + ROLE_USER: Message.Role + ROLE_ASSISTANT: Message.Role + ROLE_TOOL: Message.Role + ROLE_FIELD_NUMBER: _ClassVar[int] + CONTENT_FIELD_NUMBER: _ClassVar[int] + role: Message.Role + content: str + def __init__(self, role: _Optional[_Union[Message.Role, str]] = ..., content: _Optional[str] = ...) -> None: ... diff --git a/truffle/infer/convo/msg_pb2_grpc.py b/truffle/infer/convo/msg_pb2_grpc.py new file mode 100644 index 0000000..db9c591 --- /dev/null +++ b/truffle/infer/convo/msg_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/convo/msg_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/embedding_pb2.py b/truffle/infer/embedding_pb2.py new file mode 100644 index 0000000..42cda6d --- /dev/null +++ b/truffle/infer/embedding_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/embedding.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/embedding.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/infer/embedding.proto\x12\rtruffle.infer\")\n\nEmbeddable\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\r\n\x05query\x18\x02 \x01(\x08\"V\n\x10\x45mbeddingRequest\x12.\n\x0b\x65mbeddables\x18\x01 \x03(\x0b\x32\x19.truffle.infer.Embeddable\x12\x12\n\nmodel_uuid\x18\x02 \x01(\t\"H\n\x11\x45mbeddingResponse\x12\x12\n\nembeddings\x18\x01 \x03(\x0c\x12\x0b\n\x03\x64im\x18\x02 \x01(\x04\x12\x12\n\ndtype_size\x18\x03 \x01(\x04\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.embedding_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_EMBEDDABLE']._serialized_start=48 + _globals['_EMBEDDABLE']._serialized_end=89 + _globals['_EMBEDDINGREQUEST']._serialized_start=91 + _globals['_EMBEDDINGREQUEST']._serialized_end=177 + _globals['_EMBEDDINGRESPONSE']._serialized_start=179 + _globals['_EMBEDDINGRESPONSE']._serialized_end=251 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/embedding_pb2.pyi b/truffle/infer/embedding_pb2.pyi new file mode 100644 index 0000000..6608a08 --- /dev/null +++ b/truffle/infer/embedding_pb2.pyi @@ -0,0 +1,33 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class Embeddable(_message.Message): + __slots__ = ("text", "query") + TEXT_FIELD_NUMBER: _ClassVar[int] + QUERY_FIELD_NUMBER: _ClassVar[int] + text: str + query: bool + def __init__(self, text: _Optional[str] = ..., query: bool = ...) -> None: ... + +class EmbeddingRequest(_message.Message): + __slots__ = ("embeddables", "model_uuid") + EMBEDDABLES_FIELD_NUMBER: _ClassVar[int] + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + embeddables: _containers.RepeatedCompositeFieldContainer[Embeddable] + model_uuid: str + def __init__(self, embeddables: _Optional[_Iterable[_Union[Embeddable, _Mapping]]] = ..., model_uuid: _Optional[str] = ...) -> None: ... + +class EmbeddingResponse(_message.Message): + __slots__ = ("embeddings", "dim", "dtype_size") + EMBEDDINGS_FIELD_NUMBER: _ClassVar[int] + DIM_FIELD_NUMBER: _ClassVar[int] + DTYPE_SIZE_FIELD_NUMBER: _ClassVar[int] + embeddings: _containers.RepeatedScalarFieldContainer[bytes] + dim: int + dtype_size: int + def __init__(self, embeddings: _Optional[_Iterable[bytes]] = ..., dim: _Optional[int] = ..., dtype_size: _Optional[int] = ...) -> None: ... diff --git a/truffle/infer/embedding_pb2_grpc.py b/truffle/infer/embedding_pb2_grpc.py new file mode 100644 index 0000000..b32d5d9 --- /dev/null +++ b/truffle/infer/embedding_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/embedding_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/finishreason_pb2.py b/truffle/infer/finishreason_pb2.py new file mode 100644 index 0000000..ea0eba0 --- /dev/null +++ b/truffle/infer/finishreason_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/finishreason.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/finishreason.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n truffle/infer/finishreason.proto\x12\rtruffle.infer*\xab\x01\n\x0c\x46inishReason\x12\x16\n\x12\x46INISH_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x46INISH_STOP\x10\x01\x12\x11\n\rFINISH_LENGTH\x10\x02\x12\x14\n\x10\x46INISH_TOOLCALLS\x10\x03\x12\x10\n\x0c\x46INISH_ERROR\x10\x04\x12\x10\n\x0c\x46INISH_ABORT\x10\x05\x12\x12\n\x0e\x46INISH_UNKNOWN\x10\x06\x12\x11\n\rFINISH_GOAWAY\x10\x07\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.finishreason_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_FINISHREASON']._serialized_start=52 + _globals['_FINISHREASON']._serialized_end=223 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/finishreason_pb2.pyi b/truffle/infer/finishreason_pb2.pyi new file mode 100644 index 0000000..c244ecd --- /dev/null +++ b/truffle/infer/finishreason_pb2.pyi @@ -0,0 +1,24 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from typing import ClassVar as _ClassVar + +DESCRIPTOR: _descriptor.FileDescriptor + +class FinishReason(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + FINISH_UNSPECIFIED: _ClassVar[FinishReason] + FINISH_STOP: _ClassVar[FinishReason] + FINISH_LENGTH: _ClassVar[FinishReason] + FINISH_TOOLCALLS: _ClassVar[FinishReason] + FINISH_ERROR: _ClassVar[FinishReason] + FINISH_ABORT: _ClassVar[FinishReason] + FINISH_UNKNOWN: _ClassVar[FinishReason] + FINISH_GOAWAY: _ClassVar[FinishReason] +FINISH_UNSPECIFIED: FinishReason +FINISH_STOP: FinishReason +FINISH_LENGTH: FinishReason +FINISH_TOOLCALLS: FinishReason +FINISH_ERROR: FinishReason +FINISH_ABORT: FinishReason +FINISH_UNKNOWN: FinishReason +FINISH_GOAWAY: FinishReason diff --git a/truffle/infer/finishreason_pb2_grpc.py b/truffle/infer/finishreason_pb2_grpc.py new file mode 100644 index 0000000..853a3ef --- /dev/null +++ b/truffle/infer/finishreason_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/finishreason_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/gencfg_pb2.py b/truffle/infer/gencfg_pb2.py new file mode 100644 index 0000000..1218626 --- /dev/null +++ b/truffle/infer/gencfg_pb2.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/gencfg.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/gencfg.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1atruffle/infer/gencfg.proto\x12\rtruffle.infer\"\xcf\x02\n\x0eResponseFormat\x12\x34\n\x06\x66ormat\x18\x01 \x01(\x0e\x32$.truffle.infer.ResponseFormat.Format\x12\x13\n\x06schema\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x45\n\x0c\x65xperimental\x18\x03 \x01(\x0b\x32*.truffle.infer.ResponseFormat.ExperimentalH\x01\x88\x01\x01\x1aS\n\x0c\x45xperimental\x12\x17\n\x0f\x61\x64\x64itional_ebnf\x18\x01 \x01(\t\x12\x14\n\x0cold_root_key\x18\x02 \x01(\t\x12\x14\n\x0cnew_root_key\x18\x03 \x01(\t\":\n\x06\x46ormat\x12\x08\n\x04TEXT\x10\x00\x12\x08\n\x04JSON\x10\x01\x12\x08\n\x04\x45\x42NF\x10\x02\x12\x12\n\x0eSTRUCTURAL_TAG\x10\x03\x42\t\n\x07_schemaB\x0f\n\r_experimental\"\xda\x03\n\x10GenerationConfig\x12\x11\n\x04temp\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x12\n\x05top_p\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x19\n\x0c\x66req_penalty\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x19\n\x0cpres_penalty\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x18\n\x0brep_penalty\x18\x05 \x01(\x01H\x04\x88\x01\x01\x12\x11\n\x04seed\x18\x06 \x01(\x05H\x05\x88\x01\x01\x12\x17\n\nmax_tokens\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x11\n\tstop_strs\x18\x08 \x03(\t\x12\x10\n\x08stop_ids\x18\t \x03(\r\x12\x36\n\x0fresponse_format\x18\n \x01(\x0b\x32\x1d.truffle.infer.ResponseFormat\x12\x34\n\x05\x64\x65\x62ug\x18\x0b \x01(\x0b\x32%.truffle.infer.GenerationConfig.Debug\x1a\x33\n\x05\x44\x65\x62ug\x12\x12\n\nignore_eos\x18\x01 \x01(\x08\x12\x16\n\x0epinned_context\x18\x02 \x01(\x08\x42\x07\n\x05_tempB\x08\n\x06_top_pB\x0f\n\r_freq_penaltyB\x0f\n\r_pres_penaltyB\x0e\n\x0c_rep_penaltyB\x07\n\x05_seedB\r\n\x0b_max_tokens\"Y\n\x15ValidateConfigRequest\x12,\n\x03\x63\x66g\x18\x01 \x01(\x0b\x32\x1f.truffle.infer.GenerationConfig\x12\x12\n\nmodel_uuid\x18\x02 \x01(\t\"H\n\x16ValidateConfigResponse\x12\r\n\x05valid\x18\x01 \x01(\x08\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x10\n\x08warnings\x18\x03 \x03(\tb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.gencfg_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_RESPONSEFORMAT']._serialized_start=46 + _globals['_RESPONSEFORMAT']._serialized_end=381 + _globals['_RESPONSEFORMAT_EXPERIMENTAL']._serialized_start=210 + _globals['_RESPONSEFORMAT_EXPERIMENTAL']._serialized_end=293 + _globals['_RESPONSEFORMAT_FORMAT']._serialized_start=295 + _globals['_RESPONSEFORMAT_FORMAT']._serialized_end=353 + _globals['_GENERATIONCONFIG']._serialized_start=384 + _globals['_GENERATIONCONFIG']._serialized_end=858 + _globals['_GENERATIONCONFIG_DEBUG']._serialized_start=714 + _globals['_GENERATIONCONFIG_DEBUG']._serialized_end=765 + _globals['_VALIDATECONFIGREQUEST']._serialized_start=860 + _globals['_VALIDATECONFIGREQUEST']._serialized_end=949 + _globals['_VALIDATECONFIGRESPONSE']._serialized_start=951 + _globals['_VALIDATECONFIGRESPONSE']._serialized_end=1023 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/gencfg_pb2.pyi b/truffle/infer/gencfg_pb2.pyi new file mode 100644 index 0000000..a2a6830 --- /dev/null +++ b/truffle/infer/gencfg_pb2.pyi @@ -0,0 +1,88 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ResponseFormat(_message.Message): + __slots__ = ("format", "schema", "experimental") + class Format(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + TEXT: _ClassVar[ResponseFormat.Format] + JSON: _ClassVar[ResponseFormat.Format] + EBNF: _ClassVar[ResponseFormat.Format] + STRUCTURAL_TAG: _ClassVar[ResponseFormat.Format] + TEXT: ResponseFormat.Format + JSON: ResponseFormat.Format + EBNF: ResponseFormat.Format + STRUCTURAL_TAG: ResponseFormat.Format + class Experimental(_message.Message): + __slots__ = ("additional_ebnf", "old_root_key", "new_root_key") + ADDITIONAL_EBNF_FIELD_NUMBER: _ClassVar[int] + OLD_ROOT_KEY_FIELD_NUMBER: _ClassVar[int] + NEW_ROOT_KEY_FIELD_NUMBER: _ClassVar[int] + additional_ebnf: str + old_root_key: str + new_root_key: str + def __init__(self, additional_ebnf: _Optional[str] = ..., old_root_key: _Optional[str] = ..., new_root_key: _Optional[str] = ...) -> None: ... + FORMAT_FIELD_NUMBER: _ClassVar[int] + SCHEMA_FIELD_NUMBER: _ClassVar[int] + EXPERIMENTAL_FIELD_NUMBER: _ClassVar[int] + format: ResponseFormat.Format + schema: str + experimental: ResponseFormat.Experimental + def __init__(self, format: _Optional[_Union[ResponseFormat.Format, str]] = ..., schema: _Optional[str] = ..., experimental: _Optional[_Union[ResponseFormat.Experimental, _Mapping]] = ...) -> None: ... + +class GenerationConfig(_message.Message): + __slots__ = ("temp", "top_p", "freq_penalty", "pres_penalty", "rep_penalty", "seed", "max_tokens", "stop_strs", "stop_ids", "response_format", "debug") + class Debug(_message.Message): + __slots__ = ("ignore_eos", "pinned_context") + IGNORE_EOS_FIELD_NUMBER: _ClassVar[int] + PINNED_CONTEXT_FIELD_NUMBER: _ClassVar[int] + ignore_eos: bool + pinned_context: bool + def __init__(self, ignore_eos: bool = ..., pinned_context: bool = ...) -> None: ... + TEMP_FIELD_NUMBER: _ClassVar[int] + TOP_P_FIELD_NUMBER: _ClassVar[int] + FREQ_PENALTY_FIELD_NUMBER: _ClassVar[int] + PRES_PENALTY_FIELD_NUMBER: _ClassVar[int] + REP_PENALTY_FIELD_NUMBER: _ClassVar[int] + SEED_FIELD_NUMBER: _ClassVar[int] + MAX_TOKENS_FIELD_NUMBER: _ClassVar[int] + STOP_STRS_FIELD_NUMBER: _ClassVar[int] + STOP_IDS_FIELD_NUMBER: _ClassVar[int] + RESPONSE_FORMAT_FIELD_NUMBER: _ClassVar[int] + DEBUG_FIELD_NUMBER: _ClassVar[int] + temp: float + top_p: float + freq_penalty: float + pres_penalty: float + rep_penalty: float + seed: int + max_tokens: int + stop_strs: _containers.RepeatedScalarFieldContainer[str] + stop_ids: _containers.RepeatedScalarFieldContainer[int] + response_format: ResponseFormat + debug: GenerationConfig.Debug + def __init__(self, temp: _Optional[float] = ..., top_p: _Optional[float] = ..., freq_penalty: _Optional[float] = ..., pres_penalty: _Optional[float] = ..., rep_penalty: _Optional[float] = ..., seed: _Optional[int] = ..., max_tokens: _Optional[int] = ..., stop_strs: _Optional[_Iterable[str]] = ..., stop_ids: _Optional[_Iterable[int]] = ..., response_format: _Optional[_Union[ResponseFormat, _Mapping]] = ..., debug: _Optional[_Union[GenerationConfig.Debug, _Mapping]] = ...) -> None: ... + +class ValidateConfigRequest(_message.Message): + __slots__ = ("cfg", "model_uuid") + CFG_FIELD_NUMBER: _ClassVar[int] + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + cfg: GenerationConfig + model_uuid: str + def __init__(self, cfg: _Optional[_Union[GenerationConfig, _Mapping]] = ..., model_uuid: _Optional[str] = ...) -> None: ... + +class ValidateConfigResponse(_message.Message): + __slots__ = ("valid", "error", "warnings") + VALID_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + WARNINGS_FIELD_NUMBER: _ClassVar[int] + valid: bool + error: str + warnings: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, valid: bool = ..., error: _Optional[str] = ..., warnings: _Optional[_Iterable[str]] = ...) -> None: ... diff --git a/truffle/infer/gencfg_pb2_grpc.py b/truffle/infer/gencfg_pb2_grpc.py new file mode 100644 index 0000000..15da2a6 --- /dev/null +++ b/truffle/infer/gencfg_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/gencfg_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/infer_pb2.py b/truffle/infer/infer_pb2.py new file mode 100644 index 0000000..dec4d15 --- /dev/null +++ b/truffle/infer/infer_pb2.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/infer.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/infer.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from truffle.infer import irequest_pb2 as truffle_dot_infer_dot_irequest__pb2 +from truffle.infer import iresponse_pb2 as truffle_dot_infer_dot_iresponse__pb2 +from truffle.infer import model_pb2 as truffle_dot_infer_dot_model__pb2 +from truffle.infer import embedding_pb2 as truffle_dot_infer_dot_embedding__pb2 +from truffle.infer.convo import conversation_pb2 as truffle_dot_infer_dot_convo_dot_conversation__pb2 +try: + truffle_dot_infer_dot_convo_dot_msg__pb2 = truffle_dot_infer_dot_convo_dot_conversation__pb2.truffle_dot_infer_dot_convo_dot_msg__pb2 +except AttributeError: + truffle_dot_infer_dot_convo_dot_msg__pb2 = truffle_dot_infer_dot_convo_dot_conversation__pb2.truffle.infer.convo.msg_pb2 +from truffle.infer import tokenize_pb2 as truffle_dot_infer_dot_tokenize__pb2 +from truffle.infer import gencfg_pb2 as truffle_dot_infer_dot_gencfg__pb2 + +from truffle.infer.irequest_pb2 import * +from truffle.infer.iresponse_pb2 import * +from truffle.infer.model_pb2 import * +from truffle.infer.embedding_pb2 import * +from truffle.infer.convo.conversation_pb2 import * +from truffle.infer.tokenize_pb2 import * +from truffle.infer.gencfg_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19truffle/infer/infer.proto\x12\rtruffle.infer\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1ctruffle/infer/irequest.proto\x1a\x1dtruffle/infer/iresponse.proto\x1a\x19truffle/infer/model.proto\x1a\x1dtruffle/infer/embedding.proto\x1a&truffle/infer/convo/conversation.proto\x1a\x1ctruffle/infer/tokenize.proto\x1a\x1atruffle/infer/gencfg.proto2\xfb\x08\n\x10InferenceService\x12?\n\x08Generate\x12\x17.truffle.infer.IRequest\x1a\x18.truffle.infer.IResponse0\x01\x12\x41\n\x0cGenerateSync\x12\x17.truffle.infer.IRequest\x1a\x18.truffle.infer.IResponse\x12L\n\rGenerateBatch\x12\x1c.truffle.infer.BatchIRequest\x1a\x1d.truffle.infer.BatchIResponse\x12J\n\x05\x45mbed\x12\x1f.truffle.infer.EmbeddingRequest\x1a .truffle.infer.EmbeddingResponse\x12Q\n\x0c\x45mbedQueries\x12\x1f.truffle.infer.EmbeddingRequest\x1a .truffle.infer.EmbeddingResponse\x12L\n\x0cGetModelList\x12\".truffle.infer.GetModelListRequest\x1a\x18.truffle.infer.ModelList\x12@\n\x08GetModel\x12\x1e.truffle.infer.GetModelRequest\x1a\x14.truffle.infer.Model\x12N\n\tSetModels\x12\x1f.truffle.infer.SetModelsRequest\x1a .truffle.infer.SetModelsResponse\x12P\n\rGetModelState\x12\x1e.truffle.infer.GetModelRequest\x1a\x1f.truffle.infer.ModelStateUpdate\x12W\n\x12OnModelStateChange\x12\x1e.truffle.infer.GetModelRequest\x1a\x1f.truffle.infer.ModelStateUpdate0\x01\x12R\n\x15GetEmbeddingModelList\x12\x16.google.protobuf.Empty\x1a!.truffle.infer.EmbeddingModelList\x12Z\n\x15GetEmbeddingModelInfo\x12\x1e.truffle.infer.GetModelRequest\x1a!.truffle.infer.EmbeddingModelInfo\x12R\n\nBuildConvo\x12!.truffle.infer.convo.Conversation\x1a!.truffle.infer.convo.BuiltContext\x12g\n\x18ValidateGenerationConfig\x12$.truffle.infer.ValidateConfigRequest\x1a%.truffle.infer.ValidateConfigResponseP\x01P\x02P\x03P\x04P\x05P\x06P\x07\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.infer_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_INFERENCESERVICE']._serialized_start=291 + _globals['_INFERENCESERVICE']._serialized_end=1438 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/infer_pb2.pyi b/truffle/infer/infer_pb2.pyi new file mode 100644 index 0000000..27a1470 --- /dev/null +++ b/truffle/infer/infer_pb2.pyi @@ -0,0 +1,43 @@ +from google.protobuf import empty_pb2 as _empty_pb2 +from truffle.infer import irequest_pb2 as _irequest_pb2 +from truffle.infer import iresponse_pb2 as _iresponse_pb2 +from truffle.infer import model_pb2 as _model_pb2 +from truffle.infer import embedding_pb2 as _embedding_pb2 +from truffle.infer.convo import conversation_pb2 as _conversation_pb2 +from truffle.infer.convo import msg_pb2 as _msg_pb2 +from truffle.infer import tokenize_pb2 as _tokenize_pb2 +from truffle.infer import gencfg_pb2 as _gencfg_pb2 +from google.protobuf import descriptor as _descriptor +from typing import ClassVar as _ClassVar +from truffle.infer.irequest_pb2 import IRequest as IRequest +from truffle.infer.irequest_pb2 import BatchIRequest as BatchIRequest +from truffle.infer.irequest_pb2 import RequestPriority as RequestPriority +from truffle.infer.iresponse_pb2 import IResponse as IResponse +from truffle.infer.iresponse_pb2 import BatchIResponse as BatchIResponse +from truffle.infer.model_pb2 import EmbeddingModelInfo as EmbeddingModelInfo +from truffle.infer.model_pb2 import EmbeddingModelList as EmbeddingModelList +from truffle.infer.model_pb2 import ModelConfig as ModelConfig +from truffle.infer.model_pb2 import Model as Model +from truffle.infer.model_pb2 import ModelStateUpdate as ModelStateUpdate +from truffle.infer.model_pb2 import ModelList as ModelList +from truffle.infer.model_pb2 import GetModelRequest as GetModelRequest +from truffle.infer.model_pb2 import GetModelListRequest as GetModelListRequest +from truffle.infer.model_pb2 import SetModelsResponse as SetModelsResponse +from truffle.infer.model_pb2 import SetModelsRequest as SetModelsRequest +from truffle.infer.embedding_pb2 import Embeddable as Embeddable +from truffle.infer.embedding_pb2 import EmbeddingRequest as EmbeddingRequest +from truffle.infer.embedding_pb2 import EmbeddingResponse as EmbeddingResponse +from truffle.infer.convo.conversation_pb2 import Conversation as Conversation +from truffle.infer.convo.conversation_pb2 import BuiltContext as BuiltContext +from truffle.infer.tokenize_pb2 import TokenizeRequest as TokenizeRequest +from truffle.infer.tokenize_pb2 import TokenizeResponse as TokenizeResponse +from truffle.infer.gencfg_pb2 import ResponseFormat as ResponseFormat +from truffle.infer.gencfg_pb2 import GenerationConfig as GenerationConfig +from truffle.infer.gencfg_pb2 import ValidateConfigRequest as ValidateConfigRequest +from truffle.infer.gencfg_pb2 import ValidateConfigResponse as ValidateConfigResponse + +DESCRIPTOR: _descriptor.FileDescriptor +REQUEST_PRIORITY_UNSPECIFIED: _irequest_pb2.RequestPriority +REQUEST_PRIORITY_LOW: _irequest_pb2.RequestPriority +REQUEST_PRIORITY_NORMAL: _irequest_pb2.RequestPriority +REQUEST_PRIORITY_REALTIME: _irequest_pb2.RequestPriority diff --git a/truffle/infer/infer_pb2_grpc.py b/truffle/infer/infer_pb2_grpc.py new file mode 100644 index 0000000..6c6b6a4 --- /dev/null +++ b/truffle/infer/infer_pb2_grpc.py @@ -0,0 +1,701 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from truffle.infer.convo import conversation_pb2 as truffle_dot_infer_dot_convo_dot_conversation__pb2 +from truffle.infer import embedding_pb2 as truffle_dot_infer_dot_embedding__pb2 +from truffle.infer import gencfg_pb2 as truffle_dot_infer_dot_gencfg__pb2 +from truffle.infer import irequest_pb2 as truffle_dot_infer_dot_irequest__pb2 +from truffle.infer import iresponse_pb2 as truffle_dot_infer_dot_iresponse__pb2 +from truffle.infer import model_pb2 as truffle_dot_infer_dot_model__pb2 + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/infer_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class InferenceServiceStub(object): + """ + Defines the main gRPC service for all AI inference operations. + This service is the primary entry point for clients to interact with generative + models, create embeddings, manage model configurations, and use other related + utility functions. It consolidates all necessary data structures from other + .proto files into a single, cohesive API. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Generate = channel.unary_stream( + '/truffle.infer.InferenceService/Generate', + request_serializer=truffle_dot_infer_dot_irequest__pb2.IRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_iresponse__pb2.IResponse.FromString, + _registered_method=True) + self.GenerateSync = channel.unary_unary( + '/truffle.infer.InferenceService/GenerateSync', + request_serializer=truffle_dot_infer_dot_irequest__pb2.IRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_iresponse__pb2.IResponse.FromString, + _registered_method=True) + self.GenerateBatch = channel.unary_unary( + '/truffle.infer.InferenceService/GenerateBatch', + request_serializer=truffle_dot_infer_dot_irequest__pb2.BatchIRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_iresponse__pb2.BatchIResponse.FromString, + _registered_method=True) + self.Embed = channel.unary_unary( + '/truffle.infer.InferenceService/Embed', + request_serializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingResponse.FromString, + _registered_method=True) + self.EmbedQueries = channel.unary_unary( + '/truffle.infer.InferenceService/EmbedQueries', + request_serializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingResponse.FromString, + _registered_method=True) + self.GetModelList = channel.unary_unary( + '/truffle.infer.InferenceService/GetModelList', + request_serializer=truffle_dot_infer_dot_model__pb2.GetModelListRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_model__pb2.ModelList.FromString, + _registered_method=True) + self.GetModel = channel.unary_unary( + '/truffle.infer.InferenceService/GetModel', + request_serializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_model__pb2.Model.FromString, + _registered_method=True) + self.SetModels = channel.unary_unary( + '/truffle.infer.InferenceService/SetModels', + request_serializer=truffle_dot_infer_dot_model__pb2.SetModelsRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_model__pb2.SetModelsResponse.FromString, + _registered_method=True) + self.GetModelState = channel.unary_unary( + '/truffle.infer.InferenceService/GetModelState', + request_serializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_model__pb2.ModelStateUpdate.FromString, + _registered_method=True) + self.OnModelStateChange = channel.unary_stream( + '/truffle.infer.InferenceService/OnModelStateChange', + request_serializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_model__pb2.ModelStateUpdate.FromString, + _registered_method=True) + self.GetEmbeddingModelList = channel.unary_unary( + '/truffle.infer.InferenceService/GetEmbeddingModelList', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=truffle_dot_infer_dot_model__pb2.EmbeddingModelList.FromString, + _registered_method=True) + self.GetEmbeddingModelInfo = channel.unary_unary( + '/truffle.infer.InferenceService/GetEmbeddingModelInfo', + request_serializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_model__pb2.EmbeddingModelInfo.FromString, + _registered_method=True) + self.BuildConvo = channel.unary_unary( + '/truffle.infer.InferenceService/BuildConvo', + request_serializer=truffle_dot_infer_dot_convo_dot_conversation__pb2.Conversation.SerializeToString, + response_deserializer=truffle_dot_infer_dot_convo_dot_conversation__pb2.BuiltContext.FromString, + _registered_method=True) + self.ValidateGenerationConfig = channel.unary_unary( + '/truffle.infer.InferenceService/ValidateGenerationConfig', + request_serializer=truffle_dot_infer_dot_gencfg__pb2.ValidateConfigRequest.SerializeToString, + response_deserializer=truffle_dot_infer_dot_gencfg__pb2.ValidateConfigResponse.FromString, + _registered_method=True) + + +class InferenceServiceServicer(object): + """ + Defines the main gRPC service for all AI inference operations. + This service is the primary entry point for clients to interact with generative + models, create embeddings, manage model configurations, and use other related + utility functions. It consolidates all necessary data structures from other + .proto files into a single, cohesive API. + """ + + def Generate(self, request, context): + """Starts a generation task that streams responses back to the client. + This is suitable for interactive applications where responses are displayed + as they are generated. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GenerateSync(self, request, context): + """Performs a generation task and returns the full response in a single message. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GenerateBatch(self, request, context): + """Processes a batch of inference requests in parallel. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Embed(self, request, context): + """Generates embeddings for a given set of inputs. Embeddings are numerical + representations of text that can be used for semantic search, clustering, + and other machine learning tasks. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def EmbedQueries(self, request, context): + """A specialized version of Embed for generating embeddings for + search queries. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetModelList(self, request, context): + """Retrieves a list of all available models. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetModel(self, request, context): + """Fetches detailed information about a specific model. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetModels(self, request, context): + """Configures model parameters such as context length, batch size etc. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetModelState(self, request, context): + """Gets the current state of a model, such as loading, loaded, unloaded etc. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def OnModelStateChange(self, request, context): + """Subscribes to updates on the state of a model to avoid polling. + pass an empty ID to get updates for all models. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetEmbeddingModelList(self, request, context): + """Retrieves a list of all available embedding models. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetEmbeddingModelInfo(self, request, context): + """Gets detailed information about a specific embedding model (input length, dimension size etc). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BuildConvo(self, request, context): + """Builds a context from a conversation. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ValidateGenerationConfig(self, request, context): + """Validates a generation configuration to ensure that it is compatible with + the models. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_InferenceServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Generate': grpc.unary_stream_rpc_method_handler( + servicer.Generate, + request_deserializer=truffle_dot_infer_dot_irequest__pb2.IRequest.FromString, + response_serializer=truffle_dot_infer_dot_iresponse__pb2.IResponse.SerializeToString, + ), + 'GenerateSync': grpc.unary_unary_rpc_method_handler( + servicer.GenerateSync, + request_deserializer=truffle_dot_infer_dot_irequest__pb2.IRequest.FromString, + response_serializer=truffle_dot_infer_dot_iresponse__pb2.IResponse.SerializeToString, + ), + 'GenerateBatch': grpc.unary_unary_rpc_method_handler( + servicer.GenerateBatch, + request_deserializer=truffle_dot_infer_dot_irequest__pb2.BatchIRequest.FromString, + response_serializer=truffle_dot_infer_dot_iresponse__pb2.BatchIResponse.SerializeToString, + ), + 'Embed': grpc.unary_unary_rpc_method_handler( + servicer.Embed, + request_deserializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingRequest.FromString, + response_serializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingResponse.SerializeToString, + ), + 'EmbedQueries': grpc.unary_unary_rpc_method_handler( + servicer.EmbedQueries, + request_deserializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingRequest.FromString, + response_serializer=truffle_dot_infer_dot_embedding__pb2.EmbeddingResponse.SerializeToString, + ), + 'GetModelList': grpc.unary_unary_rpc_method_handler( + servicer.GetModelList, + request_deserializer=truffle_dot_infer_dot_model__pb2.GetModelListRequest.FromString, + response_serializer=truffle_dot_infer_dot_model__pb2.ModelList.SerializeToString, + ), + 'GetModel': grpc.unary_unary_rpc_method_handler( + servicer.GetModel, + request_deserializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.FromString, + response_serializer=truffle_dot_infer_dot_model__pb2.Model.SerializeToString, + ), + 'SetModels': grpc.unary_unary_rpc_method_handler( + servicer.SetModels, + request_deserializer=truffle_dot_infer_dot_model__pb2.SetModelsRequest.FromString, + response_serializer=truffle_dot_infer_dot_model__pb2.SetModelsResponse.SerializeToString, + ), + 'GetModelState': grpc.unary_unary_rpc_method_handler( + servicer.GetModelState, + request_deserializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.FromString, + response_serializer=truffle_dot_infer_dot_model__pb2.ModelStateUpdate.SerializeToString, + ), + 'OnModelStateChange': grpc.unary_stream_rpc_method_handler( + servicer.OnModelStateChange, + request_deserializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.FromString, + response_serializer=truffle_dot_infer_dot_model__pb2.ModelStateUpdate.SerializeToString, + ), + 'GetEmbeddingModelList': grpc.unary_unary_rpc_method_handler( + servicer.GetEmbeddingModelList, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=truffle_dot_infer_dot_model__pb2.EmbeddingModelList.SerializeToString, + ), + 'GetEmbeddingModelInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetEmbeddingModelInfo, + request_deserializer=truffle_dot_infer_dot_model__pb2.GetModelRequest.FromString, + response_serializer=truffle_dot_infer_dot_model__pb2.EmbeddingModelInfo.SerializeToString, + ), + 'BuildConvo': grpc.unary_unary_rpc_method_handler( + servicer.BuildConvo, + request_deserializer=truffle_dot_infer_dot_convo_dot_conversation__pb2.Conversation.FromString, + response_serializer=truffle_dot_infer_dot_convo_dot_conversation__pb2.BuiltContext.SerializeToString, + ), + 'ValidateGenerationConfig': grpc.unary_unary_rpc_method_handler( + servicer.ValidateGenerationConfig, + request_deserializer=truffle_dot_infer_dot_gencfg__pb2.ValidateConfigRequest.FromString, + response_serializer=truffle_dot_infer_dot_gencfg__pb2.ValidateConfigResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'truffle.infer.InferenceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('truffle.infer.InferenceService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class InferenceService(object): + """ + Defines the main gRPC service for all AI inference operations. + This service is the primary entry point for clients to interact with generative + models, create embeddings, manage model configurations, and use other related + utility functions. It consolidates all necessary data structures from other + .proto files into a single, cohesive API. + """ + + @staticmethod + def Generate(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.infer.InferenceService/Generate', + truffle_dot_infer_dot_irequest__pb2.IRequest.SerializeToString, + truffle_dot_infer_dot_iresponse__pb2.IResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GenerateSync(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/GenerateSync', + truffle_dot_infer_dot_irequest__pb2.IRequest.SerializeToString, + truffle_dot_infer_dot_iresponse__pb2.IResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GenerateBatch(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/GenerateBatch', + truffle_dot_infer_dot_irequest__pb2.BatchIRequest.SerializeToString, + truffle_dot_infer_dot_iresponse__pb2.BatchIResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Embed(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/Embed', + truffle_dot_infer_dot_embedding__pb2.EmbeddingRequest.SerializeToString, + truffle_dot_infer_dot_embedding__pb2.EmbeddingResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def EmbedQueries(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/EmbedQueries', + truffle_dot_infer_dot_embedding__pb2.EmbeddingRequest.SerializeToString, + truffle_dot_infer_dot_embedding__pb2.EmbeddingResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetModelList(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/GetModelList', + truffle_dot_infer_dot_model__pb2.GetModelListRequest.SerializeToString, + truffle_dot_infer_dot_model__pb2.ModelList.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetModel(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/GetModel', + truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + truffle_dot_infer_dot_model__pb2.Model.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetModels(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/SetModels', + truffle_dot_infer_dot_model__pb2.SetModelsRequest.SerializeToString, + truffle_dot_infer_dot_model__pb2.SetModelsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetModelState(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/GetModelState', + truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + truffle_dot_infer_dot_model__pb2.ModelStateUpdate.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def OnModelStateChange(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.infer.InferenceService/OnModelStateChange', + truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + truffle_dot_infer_dot_model__pb2.ModelStateUpdate.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetEmbeddingModelList(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/GetEmbeddingModelList', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + truffle_dot_infer_dot_model__pb2.EmbeddingModelList.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetEmbeddingModelInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/GetEmbeddingModelInfo', + truffle_dot_infer_dot_model__pb2.GetModelRequest.SerializeToString, + truffle_dot_infer_dot_model__pb2.EmbeddingModelInfo.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def BuildConvo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/BuildConvo', + truffle_dot_infer_dot_convo_dot_conversation__pb2.Conversation.SerializeToString, + truffle_dot_infer_dot_convo_dot_conversation__pb2.BuiltContext.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ValidateGenerationConfig(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.infer.InferenceService/ValidateGenerationConfig', + truffle_dot_infer_dot_gencfg__pb2.ValidateConfigRequest.SerializeToString, + truffle_dot_infer_dot_gencfg__pb2.ValidateConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/truffle/infer/irequest_pb2.py b/truffle/infer/irequest_pb2.py new file mode 100644 index 0000000..df2bafa --- /dev/null +++ b/truffle/infer/irequest_pb2.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/irequest.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/irequest.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.infer import gencfg_pb2 as truffle_dot_infer_dot_gencfg__pb2 +from truffle.infer.convo import conversation_pb2 as truffle_dot_infer_dot_convo_dot_conversation__pb2 +try: + truffle_dot_infer_dot_convo_dot_msg__pb2 = truffle_dot_infer_dot_convo_dot_conversation__pb2.truffle_dot_infer_dot_convo_dot_msg__pb2 +except AttributeError: + truffle_dot_infer_dot_convo_dot_msg__pb2 = truffle_dot_infer_dot_convo_dot_conversation__pb2.truffle.infer.convo.msg_pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/infer/irequest.proto\x12\rtruffle.infer\x1a\x1atruffle/infer/gencfg.proto\x1a&truffle/infer/convo/conversation.proto\"\xd8\x01\n\x08IRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x03raw\x18\x02 \x01(\tH\x00\x12\x32\n\x05\x63onvo\x18\x03 \x01(\x0b\x32!.truffle.infer.convo.ConversationH\x00\x12,\n\x03\x63\x66g\x18\x04 \x01(\x0b\x32\x1f.truffle.infer.GenerationConfig\x12\x12\n\nmodel_uuid\x18\x05 \x01(\t\x12\x30\n\x08priority\x18\x06 \x01(\x0e\x32\x1e.truffle.infer.RequestPriorityB\t\n\x07\x63ontext\":\n\rBatchIRequest\x12)\n\x08requests\x18\x01 \x03(\x0b\x32\x17.truffle.infer.IRequest*\x89\x01\n\x0fRequestPriority\x12 \n\x1cREQUEST_PRIORITY_UNSPECIFIED\x10\x00\x12\x18\n\x14REQUEST_PRIORITY_LOW\x10\x01\x12\x1b\n\x17REQUEST_PRIORITY_NORMAL\x10\x02\x12\x1d\n\x19REQUEST_PRIORITY_REALTIME\x10\x03\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.irequest_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_REQUESTPRIORITY']._serialized_start=395 + _globals['_REQUESTPRIORITY']._serialized_end=532 + _globals['_IREQUEST']._serialized_start=116 + _globals['_IREQUEST']._serialized_end=332 + _globals['_BATCHIREQUEST']._serialized_start=334 + _globals['_BATCHIREQUEST']._serialized_end=392 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/irequest_pb2.pyi b/truffle/infer/irequest_pb2.pyi new file mode 100644 index 0000000..8332e8c --- /dev/null +++ b/truffle/infer/irequest_pb2.pyi @@ -0,0 +1,44 @@ +from truffle.infer import gencfg_pb2 as _gencfg_pb2 +from truffle.infer.convo import conversation_pb2 as _conversation_pb2 +from truffle.infer.convo import msg_pb2 as _msg_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class RequestPriority(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + REQUEST_PRIORITY_UNSPECIFIED: _ClassVar[RequestPriority] + REQUEST_PRIORITY_LOW: _ClassVar[RequestPriority] + REQUEST_PRIORITY_NORMAL: _ClassVar[RequestPriority] + REQUEST_PRIORITY_REALTIME: _ClassVar[RequestPriority] +REQUEST_PRIORITY_UNSPECIFIED: RequestPriority +REQUEST_PRIORITY_LOW: RequestPriority +REQUEST_PRIORITY_NORMAL: RequestPriority +REQUEST_PRIORITY_REALTIME: RequestPriority + +class IRequest(_message.Message): + __slots__ = ("id", "raw", "convo", "cfg", "model_uuid", "priority") + ID_FIELD_NUMBER: _ClassVar[int] + RAW_FIELD_NUMBER: _ClassVar[int] + CONVO_FIELD_NUMBER: _ClassVar[int] + CFG_FIELD_NUMBER: _ClassVar[int] + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + PRIORITY_FIELD_NUMBER: _ClassVar[int] + id: str + raw: str + convo: _conversation_pb2.Conversation + cfg: _gencfg_pb2.GenerationConfig + model_uuid: str + priority: RequestPriority + def __init__(self, id: _Optional[str] = ..., raw: _Optional[str] = ..., convo: _Optional[_Union[_conversation_pb2.Conversation, _Mapping]] = ..., cfg: _Optional[_Union[_gencfg_pb2.GenerationConfig, _Mapping]] = ..., model_uuid: _Optional[str] = ..., priority: _Optional[_Union[RequestPriority, str]] = ...) -> None: ... + +class BatchIRequest(_message.Message): + __slots__ = ("requests",) + REQUESTS_FIELD_NUMBER: _ClassVar[int] + requests: _containers.RepeatedCompositeFieldContainer[IRequest] + def __init__(self, requests: _Optional[_Iterable[_Union[IRequest, _Mapping]]] = ...) -> None: ... diff --git a/truffle/infer/irequest_pb2_grpc.py b/truffle/infer/irequest_pb2_grpc.py new file mode 100644 index 0000000..de17794 --- /dev/null +++ b/truffle/infer/irequest_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/irequest_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/iresponse_pb2.py b/truffle/infer/iresponse_pb2.py new file mode 100644 index 0000000..5c6ad2a --- /dev/null +++ b/truffle/infer/iresponse_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/iresponse.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/iresponse.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.infer import usage_pb2 as truffle_dot_infer_dot_usage__pb2 +from truffle.infer import finishreason_pb2 as truffle_dot_infer_dot_finishreason__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/infer/iresponse.proto\x12\rtruffle.infer\x1a\x19truffle/infer/usage.proto\x1a truffle/infer/finishreason.proto\"\xa7\x01\n\tIResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12(\n\x05usage\x18\x03 \x01(\x0b\x32\x14.truffle.infer.UsageH\x00\x88\x01\x01\x12\x37\n\rfinish_reason\x18\x04 \x01(\x0e\x32\x1b.truffle.infer.FinishReasonH\x01\x88\x01\x01\x42\x08\n\x06_usageB\x10\n\x0e_finish_reason\"=\n\x0e\x42\x61tchIResponse\x12+\n\tresponses\x18\x01 \x03(\x0b\x32\x18.truffle.infer.IResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.iresponse_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_IRESPONSE']._serialized_start=110 + _globals['_IRESPONSE']._serialized_end=277 + _globals['_BATCHIRESPONSE']._serialized_start=279 + _globals['_BATCHIRESPONSE']._serialized_end=340 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/iresponse_pb2.pyi b/truffle/infer/iresponse_pb2.pyi new file mode 100644 index 0000000..43d8a58 --- /dev/null +++ b/truffle/infer/iresponse_pb2.pyi @@ -0,0 +1,27 @@ +from truffle.infer import usage_pb2 as _usage_pb2 +from truffle.infer import finishreason_pb2 as _finishreason_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class IResponse(_message.Message): + __slots__ = ("id", "content", "usage", "finish_reason") + ID_FIELD_NUMBER: _ClassVar[int] + CONTENT_FIELD_NUMBER: _ClassVar[int] + USAGE_FIELD_NUMBER: _ClassVar[int] + FINISH_REASON_FIELD_NUMBER: _ClassVar[int] + id: str + content: str + usage: _usage_pb2.Usage + finish_reason: _finishreason_pb2.FinishReason + def __init__(self, id: _Optional[str] = ..., content: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.Usage, _Mapping]] = ..., finish_reason: _Optional[_Union[_finishreason_pb2.FinishReason, str]] = ...) -> None: ... + +class BatchIResponse(_message.Message): + __slots__ = ("responses",) + RESPONSES_FIELD_NUMBER: _ClassVar[int] + responses: _containers.RepeatedCompositeFieldContainer[IResponse] + def __init__(self, responses: _Optional[_Iterable[_Union[IResponse, _Mapping]]] = ...) -> None: ... diff --git a/truffle/infer/iresponse_pb2_grpc.py b/truffle/infer/iresponse_pb2_grpc.py new file mode 100644 index 0000000..1be00b7 --- /dev/null +++ b/truffle/infer/iresponse_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/iresponse_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/model_pb2.py b/truffle/infer/model_pb2.py new file mode 100644 index 0000000..7253b61 --- /dev/null +++ b/truffle/infer/model_pb2.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/model.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/model.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19truffle/infer/model.proto\x12\rtruffle.infer\"\xda\x01\n\x12\x45mbeddingModelInfo\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x38\n\x06\x63onfig\x18\x04 \x01(\x0b\x32(.truffle.infer.EmbeddingModelInfo.Config\x12\x0c\n\x04uuid\x18\x05 \x01(\t\x1aQ\n\x06\x43onfig\x12\x18\n\x10max_input_length\x18\x01 \x01(\x03\x12\x16\n\x0emax_batch_size\x18\x02 \x01(\x03\x12\x15\n\rembedding_dim\x18\x03 \x01(\x03\"G\n\x12\x45mbeddingModelList\x12\x31\n\x06models\x18\x01 \x03(\x0b\x32!.truffle.infer.EmbeddingModelInfo\"\xba\x04\n\x0bModelConfig\x12=\n\x04info\x18\x01 \x01(\x0b\x32*.truffle.infer.ModelConfig.ModelConfigInfoH\x00\x88\x01\x01\x12\x1b\n\x0e\x63ontext_length\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1b\n\x0emax_batch_size\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x16\n\tdata_type\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06loaded\x18\x05 \x01(\x08H\x04\x88\x01\x01\x1a\xbc\x02\n\x0fModelConfigInfo\x12 \n\x18\x63ontext_length_limit_max\x18\x01 \x01(\r\x12 \n\x18\x63ontext_length_limit_min\x18\x02 \x01(\r\x12\x1c\n\x14model_context_length\x18\n \x01(\r\x12\x1c\n\x14\x62\x61tch_size_limit_max\x18\x03 \x01(\r\x12\x1c\n\x14\x62\x61tch_size_limit_min\x18\x04 \x01(\r\x12\x1c\n\x14has_chain_of_thought\x18\x05 \x01(\x08\x12\x12\n\nis_agentic\x18\x06 \x01(\x08\x12\x1b\n\x13memory_usage_params\x18\x07 \x01(\x03\x12\x1e\n\x16memory_usage_inference\x18\x08 \x01(\x03\x12\x1c\n\x14\x61vailable_data_types\x18\t \x03(\tB\x07\n\x05_infoB\x11\n\x0f_context_lengthB\x11\n\x0f_max_batch_sizeB\x0c\n\n_data_typeB\t\n\x07_loaded\"\xa0\x02\n\x05Model\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08provider\x18\x03 \x01(\t\x12*\n\x06\x63onfig\x18\x04 \x01(\x0b\x32\x1a.truffle.infer.ModelConfig\x12.\n\x05state\x18\x05 \x01(\x0e\x32\x1f.truffle.infer.Model.ModelState\"\x8c\x01\n\nModelState\x12\x17\n\x13MODEL_STATE_INVALID\x10\x00\x12\x19\n\x15MODEL_STATE_AVAILABLE\x10\x01\x12\x17\n\x13MODEL_STATE_LOADING\x10\x02\x12\x19\n\x15MODEL_STATE_UNLOADING\x10\x03\x12\x16\n\x12MODEL_STATE_LOADED\x10\x04\"z\n\x10ModelStateUpdate\x12\x12\n\nmodel_uuid\x18\x01 \x01(\t\x12.\n\x05state\x18\x02 \x01(\x0e\x32\x1f.truffle.infer.Model.ModelState\x12\x15\n\x08progress\x18\x03 \x01(\x05H\x00\x88\x01\x01\x42\x0b\n\t_progress\"\\\n\tModelList\x12$\n\x06models\x18\x01 \x03(\x0b\x32\x14.truffle.infer.Model\x12\x14\n\x0ctotal_memory\x18\x02 \x01(\x04\x12\x13\n\x0bused_memory\x18\x03 \x01(\x04\"%\n\x0fGetModelRequest\x12\x12\n\nmodel_uuid\x18\x01 \x01(\t\"m\n\x13GetModelListRequest\x12\x12\n\nuse_filter\x18\x01 \x01(\x08\x12\x13\n\tavailable\x18\x02 \x01(\x08H\x00\x12\x10\n\x06loaded\x18\x03 \x01(\x08H\x00\x12\x11\n\x07\x61gentic\x18\x04 \x01(\x08H\x00\x42\x08\n\x06\x66ilter\"\x88\x02\n\x11SetModelsResponse\x12\x41\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x33.truffle.infer.SetModelsResponse.SetModelsErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x33\n\x0cupdated_list\x18\x03 \x01(\x0b\x32\x18.truffle.infer.ModelListH\x00\x88\x01\x01\"Y\n\x12SetModelsErrorCode\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eINVALID_CONFIG\x10\x01\x12\x15\n\x11NOT_ENOUGH_MEMORY\x10\x02\x12\x10\n\x0cMODEL_IN_USE\x10\x03\x42\x0f\n\r_updated_list\"\x9d\x01\n\x10SetModelsRequest\x12=\n\x07updates\x18\x01 \x03(\x0b\x32,.truffle.infer.SetModelsRequest.UpdatesEntry\x1aJ\n\x0cUpdatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.truffle.infer.ModelConfig:\x02\x38\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.model_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_SETMODELSREQUEST_UPDATESENTRY']._loaded_options = None + _globals['_SETMODELSREQUEST_UPDATESENTRY']._serialized_options = b'8\001' + _globals['_EMBEDDINGMODELINFO']._serialized_start=45 + _globals['_EMBEDDINGMODELINFO']._serialized_end=263 + _globals['_EMBEDDINGMODELINFO_CONFIG']._serialized_start=182 + _globals['_EMBEDDINGMODELINFO_CONFIG']._serialized_end=263 + _globals['_EMBEDDINGMODELLIST']._serialized_start=265 + _globals['_EMBEDDINGMODELLIST']._serialized_end=336 + _globals['_MODELCONFIG']._serialized_start=339 + _globals['_MODELCONFIG']._serialized_end=909 + _globals['_MODELCONFIG_MODELCONFIGINFO']._serialized_start=521 + _globals['_MODELCONFIG_MODELCONFIGINFO']._serialized_end=837 + _globals['_MODEL']._serialized_start=912 + _globals['_MODEL']._serialized_end=1200 + _globals['_MODEL_MODELSTATE']._serialized_start=1060 + _globals['_MODEL_MODELSTATE']._serialized_end=1200 + _globals['_MODELSTATEUPDATE']._serialized_start=1202 + _globals['_MODELSTATEUPDATE']._serialized_end=1324 + _globals['_MODELLIST']._serialized_start=1326 + _globals['_MODELLIST']._serialized_end=1418 + _globals['_GETMODELREQUEST']._serialized_start=1420 + _globals['_GETMODELREQUEST']._serialized_end=1457 + _globals['_GETMODELLISTREQUEST']._serialized_start=1459 + _globals['_GETMODELLISTREQUEST']._serialized_end=1568 + _globals['_SETMODELSRESPONSE']._serialized_start=1571 + _globals['_SETMODELSRESPONSE']._serialized_end=1835 + _globals['_SETMODELSRESPONSE_SETMODELSERRORCODE']._serialized_start=1729 + _globals['_SETMODELSRESPONSE_SETMODELSERRORCODE']._serialized_end=1818 + _globals['_SETMODELSREQUEST']._serialized_start=1838 + _globals['_SETMODELSREQUEST']._serialized_end=1995 + _globals['_SETMODELSREQUEST_UPDATESENTRY']._serialized_start=1921 + _globals['_SETMODELSREQUEST_UPDATESENTRY']._serialized_end=1995 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/model_pb2.pyi b/truffle/infer/model_pb2.pyi new file mode 100644 index 0000000..218c5d7 --- /dev/null +++ b/truffle/infer/model_pb2.pyi @@ -0,0 +1,171 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class EmbeddingModelInfo(_message.Message): + __slots__ = ("id", "name", "version", "config", "uuid") + class Config(_message.Message): + __slots__ = ("max_input_length", "max_batch_size", "embedding_dim") + MAX_INPUT_LENGTH_FIELD_NUMBER: _ClassVar[int] + MAX_BATCH_SIZE_FIELD_NUMBER: _ClassVar[int] + EMBEDDING_DIM_FIELD_NUMBER: _ClassVar[int] + max_input_length: int + max_batch_size: int + embedding_dim: int + def __init__(self, max_input_length: _Optional[int] = ..., max_batch_size: _Optional[int] = ..., embedding_dim: _Optional[int] = ...) -> None: ... + ID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + VERSION_FIELD_NUMBER: _ClassVar[int] + CONFIG_FIELD_NUMBER: _ClassVar[int] + UUID_FIELD_NUMBER: _ClassVar[int] + id: int + name: str + version: str + config: EmbeddingModelInfo.Config + uuid: str + def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., version: _Optional[str] = ..., config: _Optional[_Union[EmbeddingModelInfo.Config, _Mapping]] = ..., uuid: _Optional[str] = ...) -> None: ... + +class EmbeddingModelList(_message.Message): + __slots__ = ("models",) + MODELS_FIELD_NUMBER: _ClassVar[int] + models: _containers.RepeatedCompositeFieldContainer[EmbeddingModelInfo] + def __init__(self, models: _Optional[_Iterable[_Union[EmbeddingModelInfo, _Mapping]]] = ...) -> None: ... + +class ModelConfig(_message.Message): + __slots__ = ("info", "context_length", "max_batch_size", "data_type", "loaded") + class ModelConfigInfo(_message.Message): + __slots__ = ("context_length_limit_max", "context_length_limit_min", "model_context_length", "batch_size_limit_max", "batch_size_limit_min", "has_chain_of_thought", "is_agentic", "memory_usage_params", "memory_usage_inference", "available_data_types") + CONTEXT_LENGTH_LIMIT_MAX_FIELD_NUMBER: _ClassVar[int] + CONTEXT_LENGTH_LIMIT_MIN_FIELD_NUMBER: _ClassVar[int] + MODEL_CONTEXT_LENGTH_FIELD_NUMBER: _ClassVar[int] + BATCH_SIZE_LIMIT_MAX_FIELD_NUMBER: _ClassVar[int] + BATCH_SIZE_LIMIT_MIN_FIELD_NUMBER: _ClassVar[int] + HAS_CHAIN_OF_THOUGHT_FIELD_NUMBER: _ClassVar[int] + IS_AGENTIC_FIELD_NUMBER: _ClassVar[int] + MEMORY_USAGE_PARAMS_FIELD_NUMBER: _ClassVar[int] + MEMORY_USAGE_INFERENCE_FIELD_NUMBER: _ClassVar[int] + AVAILABLE_DATA_TYPES_FIELD_NUMBER: _ClassVar[int] + context_length_limit_max: int + context_length_limit_min: int + model_context_length: int + batch_size_limit_max: int + batch_size_limit_min: int + has_chain_of_thought: bool + is_agentic: bool + memory_usage_params: int + memory_usage_inference: int + available_data_types: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, context_length_limit_max: _Optional[int] = ..., context_length_limit_min: _Optional[int] = ..., model_context_length: _Optional[int] = ..., batch_size_limit_max: _Optional[int] = ..., batch_size_limit_min: _Optional[int] = ..., has_chain_of_thought: bool = ..., is_agentic: bool = ..., memory_usage_params: _Optional[int] = ..., memory_usage_inference: _Optional[int] = ..., available_data_types: _Optional[_Iterable[str]] = ...) -> None: ... + INFO_FIELD_NUMBER: _ClassVar[int] + CONTEXT_LENGTH_FIELD_NUMBER: _ClassVar[int] + MAX_BATCH_SIZE_FIELD_NUMBER: _ClassVar[int] + DATA_TYPE_FIELD_NUMBER: _ClassVar[int] + LOADED_FIELD_NUMBER: _ClassVar[int] + info: ModelConfig.ModelConfigInfo + context_length: int + max_batch_size: int + data_type: str + loaded: bool + def __init__(self, info: _Optional[_Union[ModelConfig.ModelConfigInfo, _Mapping]] = ..., context_length: _Optional[int] = ..., max_batch_size: _Optional[int] = ..., data_type: _Optional[str] = ..., loaded: bool = ...) -> None: ... + +class Model(_message.Message): + __slots__ = ("uuid", "name", "provider", "config", "state") + class ModelState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + MODEL_STATE_INVALID: _ClassVar[Model.ModelState] + MODEL_STATE_AVAILABLE: _ClassVar[Model.ModelState] + MODEL_STATE_LOADING: _ClassVar[Model.ModelState] + MODEL_STATE_UNLOADING: _ClassVar[Model.ModelState] + MODEL_STATE_LOADED: _ClassVar[Model.ModelState] + MODEL_STATE_INVALID: Model.ModelState + MODEL_STATE_AVAILABLE: Model.ModelState + MODEL_STATE_LOADING: Model.ModelState + MODEL_STATE_UNLOADING: Model.ModelState + MODEL_STATE_LOADED: Model.ModelState + UUID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + PROVIDER_FIELD_NUMBER: _ClassVar[int] + CONFIG_FIELD_NUMBER: _ClassVar[int] + STATE_FIELD_NUMBER: _ClassVar[int] + uuid: str + name: str + provider: str + config: ModelConfig + state: Model.ModelState + def __init__(self, uuid: _Optional[str] = ..., name: _Optional[str] = ..., provider: _Optional[str] = ..., config: _Optional[_Union[ModelConfig, _Mapping]] = ..., state: _Optional[_Union[Model.ModelState, str]] = ...) -> None: ... + +class ModelStateUpdate(_message.Message): + __slots__ = ("model_uuid", "state", "progress") + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + STATE_FIELD_NUMBER: _ClassVar[int] + PROGRESS_FIELD_NUMBER: _ClassVar[int] + model_uuid: str + state: Model.ModelState + progress: int + def __init__(self, model_uuid: _Optional[str] = ..., state: _Optional[_Union[Model.ModelState, str]] = ..., progress: _Optional[int] = ...) -> None: ... + +class ModelList(_message.Message): + __slots__ = ("models", "total_memory", "used_memory") + MODELS_FIELD_NUMBER: _ClassVar[int] + TOTAL_MEMORY_FIELD_NUMBER: _ClassVar[int] + USED_MEMORY_FIELD_NUMBER: _ClassVar[int] + models: _containers.RepeatedCompositeFieldContainer[Model] + total_memory: int + used_memory: int + def __init__(self, models: _Optional[_Iterable[_Union[Model, _Mapping]]] = ..., total_memory: _Optional[int] = ..., used_memory: _Optional[int] = ...) -> None: ... + +class GetModelRequest(_message.Message): + __slots__ = ("model_uuid",) + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + model_uuid: str + def __init__(self, model_uuid: _Optional[str] = ...) -> None: ... + +class GetModelListRequest(_message.Message): + __slots__ = ("use_filter", "available", "loaded", "agentic") + USE_FILTER_FIELD_NUMBER: _ClassVar[int] + AVAILABLE_FIELD_NUMBER: _ClassVar[int] + LOADED_FIELD_NUMBER: _ClassVar[int] + AGENTIC_FIELD_NUMBER: _ClassVar[int] + use_filter: bool + available: bool + loaded: bool + agentic: bool + def __init__(self, use_filter: bool = ..., available: bool = ..., loaded: bool = ..., agentic: bool = ...) -> None: ... + +class SetModelsResponse(_message.Message): + __slots__ = ("code", "message", "updated_list") + class SetModelsErrorCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + OK: _ClassVar[SetModelsResponse.SetModelsErrorCode] + INVALID_CONFIG: _ClassVar[SetModelsResponse.SetModelsErrorCode] + NOT_ENOUGH_MEMORY: _ClassVar[SetModelsResponse.SetModelsErrorCode] + MODEL_IN_USE: _ClassVar[SetModelsResponse.SetModelsErrorCode] + OK: SetModelsResponse.SetModelsErrorCode + INVALID_CONFIG: SetModelsResponse.SetModelsErrorCode + NOT_ENOUGH_MEMORY: SetModelsResponse.SetModelsErrorCode + MODEL_IN_USE: SetModelsResponse.SetModelsErrorCode + CODE_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + UPDATED_LIST_FIELD_NUMBER: _ClassVar[int] + code: SetModelsResponse.SetModelsErrorCode + message: str + updated_list: ModelList + def __init__(self, code: _Optional[_Union[SetModelsResponse.SetModelsErrorCode, str]] = ..., message: _Optional[str] = ..., updated_list: _Optional[_Union[ModelList, _Mapping]] = ...) -> None: ... + +class SetModelsRequest(_message.Message): + __slots__ = ("updates",) + class UpdatesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: ModelConfig + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[ModelConfig, _Mapping]] = ...) -> None: ... + UPDATES_FIELD_NUMBER: _ClassVar[int] + updates: _containers.MessageMap[str, ModelConfig] + def __init__(self, updates: _Optional[_Mapping[str, ModelConfig]] = ...) -> None: ... diff --git a/truffle/infer/model_pb2_grpc.py b/truffle/infer/model_pb2_grpc.py new file mode 100644 index 0000000..05e4dd8 --- /dev/null +++ b/truffle/infer/model_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/model_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/tokenize_pb2.py b/truffle/infer/tokenize_pb2.py new file mode 100644 index 0000000..9d13153 --- /dev/null +++ b/truffle/infer/tokenize_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/tokenize.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/tokenize.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/infer/tokenize.proto\x12\rtruffle.infer\"4\n\x0fTokenizeRequest\x12\r\n\x05texts\x18\x01 \x03(\t\x12\x12\n\nmodel_uuid\x18\x02 \x01(\t\"#\n\x10TokenizeResponse\x12\x0f\n\x07lengths\x18\x01 \x03(\rb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.tokenize_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TOKENIZEREQUEST']._serialized_start=47 + _globals['_TOKENIZEREQUEST']._serialized_end=99 + _globals['_TOKENIZERESPONSE']._serialized_start=101 + _globals['_TOKENIZERESPONSE']._serialized_end=136 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/tokenize_pb2.pyi b/truffle/infer/tokenize_pb2.pyi new file mode 100644 index 0000000..8f9a640 --- /dev/null +++ b/truffle/infer/tokenize_pb2.pyi @@ -0,0 +1,21 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable +from typing import ClassVar as _ClassVar, Optional as _Optional + +DESCRIPTOR: _descriptor.FileDescriptor + +class TokenizeRequest(_message.Message): + __slots__ = ("texts", "model_uuid") + TEXTS_FIELD_NUMBER: _ClassVar[int] + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + texts: _containers.RepeatedScalarFieldContainer[str] + model_uuid: str + def __init__(self, texts: _Optional[_Iterable[str]] = ..., model_uuid: _Optional[str] = ...) -> None: ... + +class TokenizeResponse(_message.Message): + __slots__ = ("lengths",) + LENGTHS_FIELD_NUMBER: _ClassVar[int] + lengths: _containers.RepeatedScalarFieldContainer[int] + def __init__(self, lengths: _Optional[_Iterable[int]] = ...) -> None: ... diff --git a/truffle/infer/tokenize_pb2_grpc.py b/truffle/infer/tokenize_pb2_grpc.py new file mode 100644 index 0000000..25b9a25 --- /dev/null +++ b/truffle/infer/tokenize_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/tokenize_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/infer/usage_pb2.py b/truffle/infer/usage_pb2.py new file mode 100644 index 0000000..60361b0 --- /dev/null +++ b/truffle/infer/usage_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/infer/usage.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/infer/usage.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19truffle/infer/usage.proto\x12\rtruffle.infer\"\xbb\x02\n\x05Usage\x12\x12\n\ntotal_time\x18\x01 \x01(\x01\x12\x14\n\x0cprefill_time\x18\x02 \x01(\x01\x12\x13\n\x0b\x64\x65\x63ode_time\x18\x03 \x01(\x01\x12\x0c\n\x04ttft\x18\x04 \x01(\x01\x12\x1b\n\x13inter_token_latency\x18\x05 \x01(\x01\x12\x12\n\ndecode_tps\x18\x06 \x01(\x01\x12\x13\n\x0bprefill_tps\x18\x07 \x01(\x01\x12+\n\x06tokens\x18\x08 \x01(\x0b\x32\x1b.truffle.infer.Usage.Tokens\x1ar\n\x06Tokens\x12\x0e\n\x06prompt\x18\x01 \x01(\x04\x12\x12\n\ncompletion\x18\x02 \x01(\x04\x12\x0f\n\x07prefill\x18\x03 \x01(\x04\x12\x0e\n\x06\x64\x65\x63ode\x18\x04 \x01(\x04\x12\x14\n\x0cjump_forward\x18\x05 \x01(\x04\x12\r\n\x05image\x18\x06 \x01(\x04\"R\n\x0bSystemUsage\x12\x13\n\x0b\x64\x65vice_name\x18\x01 \x01(\t\x12\x14\n\x0ctotal_memory\x18\x02 \x01(\x04\x12\x18\n\x10\x61vailable_memory\x18\x03 \x01(\x04\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.infer.usage_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_USAGE']._serialized_start=45 + _globals['_USAGE']._serialized_end=360 + _globals['_USAGE_TOKENS']._serialized_start=246 + _globals['_USAGE_TOKENS']._serialized_end=360 + _globals['_SYSTEMUSAGE']._serialized_start=362 + _globals['_SYSTEMUSAGE']._serialized_end=444 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/infer/usage_pb2.pyi b/truffle/infer/usage_pb2.pyi new file mode 100644 index 0000000..bb2758e --- /dev/null +++ b/truffle/infer/usage_pb2.pyi @@ -0,0 +1,51 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class Usage(_message.Message): + __slots__ = ("total_time", "prefill_time", "decode_time", "ttft", "inter_token_latency", "decode_tps", "prefill_tps", "tokens") + class Tokens(_message.Message): + __slots__ = ("prompt", "completion", "prefill", "decode", "jump_forward", "image") + PROMPT_FIELD_NUMBER: _ClassVar[int] + COMPLETION_FIELD_NUMBER: _ClassVar[int] + PREFILL_FIELD_NUMBER: _ClassVar[int] + DECODE_FIELD_NUMBER: _ClassVar[int] + JUMP_FORWARD_FIELD_NUMBER: _ClassVar[int] + IMAGE_FIELD_NUMBER: _ClassVar[int] + prompt: int + completion: int + prefill: int + decode: int + jump_forward: int + image: int + def __init__(self, prompt: _Optional[int] = ..., completion: _Optional[int] = ..., prefill: _Optional[int] = ..., decode: _Optional[int] = ..., jump_forward: _Optional[int] = ..., image: _Optional[int] = ...) -> None: ... + TOTAL_TIME_FIELD_NUMBER: _ClassVar[int] + PREFILL_TIME_FIELD_NUMBER: _ClassVar[int] + DECODE_TIME_FIELD_NUMBER: _ClassVar[int] + TTFT_FIELD_NUMBER: _ClassVar[int] + INTER_TOKEN_LATENCY_FIELD_NUMBER: _ClassVar[int] + DECODE_TPS_FIELD_NUMBER: _ClassVar[int] + PREFILL_TPS_FIELD_NUMBER: _ClassVar[int] + TOKENS_FIELD_NUMBER: _ClassVar[int] + total_time: float + prefill_time: float + decode_time: float + ttft: float + inter_token_latency: float + decode_tps: float + prefill_tps: float + tokens: Usage.Tokens + def __init__(self, total_time: _Optional[float] = ..., prefill_time: _Optional[float] = ..., decode_time: _Optional[float] = ..., ttft: _Optional[float] = ..., inter_token_latency: _Optional[float] = ..., decode_tps: _Optional[float] = ..., prefill_tps: _Optional[float] = ..., tokens: _Optional[_Union[Usage.Tokens, _Mapping]] = ...) -> None: ... + +class SystemUsage(_message.Message): + __slots__ = ("device_name", "total_memory", "available_memory") + DEVICE_NAME_FIELD_NUMBER: _ClassVar[int] + TOTAL_MEMORY_FIELD_NUMBER: _ClassVar[int] + AVAILABLE_MEMORY_FIELD_NUMBER: _ClassVar[int] + device_name: str + total_memory: int + available_memory: int + def __init__(self, device_name: _Optional[str] = ..., total_memory: _Optional[int] = ..., available_memory: _Optional[int] = ...) -> None: ... diff --git a/truffle/infer/usage_pb2_grpc.py b/truffle/infer/usage_pb2_grpc.py new file mode 100644 index 0000000..0e4108f --- /dev/null +++ b/truffle/infer/usage_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/infer/usage_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/__init__.py b/truffle/os/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/truffle/os/app_queries_pb2.py b/truffle/os/app_queries_pb2.py new file mode 100644 index 0000000..1b0f73c --- /dev/null +++ b/truffle/os/app_queries_pb2.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/app_queries.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/app_queries.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.app import foreground_pb2 as truffle_dot_app_dot_foreground__pb2 +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/os/app_queries.proto\x12\ntruffle.os\x1a\x1ctruffle/app/foreground.proto\x1a\x1ctruffle/app/background.proto\")\n\x18GetForegroundAppsRequest\x12\r\n\x05uuids\x18\x01 \x03(\t\"E\n\x19GetForegroundAppsResponse\x12(\n\x04\x61pps\x18\x01 \x03(\x0b\x32\x1a.truffle.app.ForegroundApp\")\n\x18GetBackgroundAppsRequest\x12\r\n\x05uuids\x18\x01 \x03(\t\"E\n\x19GetBackgroundAppsResponse\x12(\n\x04\x61pps\x18\x01 \x03(\x0b\x32\x1a.truffle.app.BackgroundApp\"\x13\n\x11GetAllAppsRequest\"~\n\x12GetAllAppsResponse\x12\x33\n\x0f\x66oreground_apps\x18\x01 \x03(\x0b\x32\x1a.truffle.app.ForegroundApp\x12\x33\n\x0f\x62\x61\x63kground_apps\x18\x02 \x03(\x0b\x32\x1a.truffle.app.BackgroundApp\"$\n\x10\x44\x65leteAppRequest\x12\x10\n\x08\x61pp_uuid\x18\x01 \x01(\t\"\x13\n\x11\x44\x65leteAppResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.app_queries_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_GETFOREGROUNDAPPSREQUEST']._serialized_start=104 + _globals['_GETFOREGROUNDAPPSREQUEST']._serialized_end=145 + _globals['_GETFOREGROUNDAPPSRESPONSE']._serialized_start=147 + _globals['_GETFOREGROUNDAPPSRESPONSE']._serialized_end=216 + _globals['_GETBACKGROUNDAPPSREQUEST']._serialized_start=218 + _globals['_GETBACKGROUNDAPPSREQUEST']._serialized_end=259 + _globals['_GETBACKGROUNDAPPSRESPONSE']._serialized_start=261 + _globals['_GETBACKGROUNDAPPSRESPONSE']._serialized_end=330 + _globals['_GETALLAPPSREQUEST']._serialized_start=332 + _globals['_GETALLAPPSREQUEST']._serialized_end=351 + _globals['_GETALLAPPSRESPONSE']._serialized_start=353 + _globals['_GETALLAPPSRESPONSE']._serialized_end=479 + _globals['_DELETEAPPREQUEST']._serialized_start=481 + _globals['_DELETEAPPREQUEST']._serialized_end=517 + _globals['_DELETEAPPRESPONSE']._serialized_start=519 + _globals['_DELETEAPPRESPONSE']._serialized_end=538 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/app_queries_pb2.pyi b/truffle/os/app_queries_pb2.pyi new file mode 100644 index 0000000..d18e1f9 --- /dev/null +++ b/truffle/os/app_queries_pb2.pyi @@ -0,0 +1,55 @@ +from truffle.app import foreground_pb2 as _foreground_pb2 +from truffle.app import background_pb2 as _background_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class GetForegroundAppsRequest(_message.Message): + __slots__ = ("uuids",) + UUIDS_FIELD_NUMBER: _ClassVar[int] + uuids: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, uuids: _Optional[_Iterable[str]] = ...) -> None: ... + +class GetForegroundAppsResponse(_message.Message): + __slots__ = ("apps",) + APPS_FIELD_NUMBER: _ClassVar[int] + apps: _containers.RepeatedCompositeFieldContainer[_foreground_pb2.ForegroundApp] + def __init__(self, apps: _Optional[_Iterable[_Union[_foreground_pb2.ForegroundApp, _Mapping]]] = ...) -> None: ... + +class GetBackgroundAppsRequest(_message.Message): + __slots__ = ("uuids",) + UUIDS_FIELD_NUMBER: _ClassVar[int] + uuids: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, uuids: _Optional[_Iterable[str]] = ...) -> None: ... + +class GetBackgroundAppsResponse(_message.Message): + __slots__ = ("apps",) + APPS_FIELD_NUMBER: _ClassVar[int] + apps: _containers.RepeatedCompositeFieldContainer[_background_pb2.BackgroundApp] + def __init__(self, apps: _Optional[_Iterable[_Union[_background_pb2.BackgroundApp, _Mapping]]] = ...) -> None: ... + +class GetAllAppsRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class GetAllAppsResponse(_message.Message): + __slots__ = ("foreground_apps", "background_apps") + FOREGROUND_APPS_FIELD_NUMBER: _ClassVar[int] + BACKGROUND_APPS_FIELD_NUMBER: _ClassVar[int] + foreground_apps: _containers.RepeatedCompositeFieldContainer[_foreground_pb2.ForegroundApp] + background_apps: _containers.RepeatedCompositeFieldContainer[_background_pb2.BackgroundApp] + def __init__(self, foreground_apps: _Optional[_Iterable[_Union[_foreground_pb2.ForegroundApp, _Mapping]]] = ..., background_apps: _Optional[_Iterable[_Union[_background_pb2.BackgroundApp, _Mapping]]] = ...) -> None: ... + +class DeleteAppRequest(_message.Message): + __slots__ = ("app_uuid",) + APP_UUID_FIELD_NUMBER: _ClassVar[int] + app_uuid: str + def __init__(self, app_uuid: _Optional[str] = ...) -> None: ... + +class DeleteAppResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... diff --git a/truffle/os/app_queries_pb2_grpc.py b/truffle/os/app_queries_pb2_grpc.py new file mode 100644 index 0000000..18983d9 --- /dev/null +++ b/truffle/os/app_queries_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/app_queries_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/background_feed_queries_pb2.py b/truffle/os/background_feed_queries_pb2.py new file mode 100644 index 0000000..a3d91d3 --- /dev/null +++ b/truffle/os/background_feed_queries_pb2.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/background_feed_queries.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/background_feed_queries.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 +from truffle.app import background_feed_pb2 as truffle_dot_app_dot_background__feed__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(truffle/os/background_feed_queries.proto\x12\ntruffle.os\x1a\x1ctruffle/app/background.proto\x1a!truffle/app/background_feed.proto\"Z\n\x18GetBackgroundFeedRequest\x12\x17\n\x0ftarget_entry_id\x18\x01 \x01(\x04\x12\x12\n\nmax_before\x18\x02 \x01(\x05\x12\x11\n\tmax_after\x18\x03 \x01(\x05\"D\n\x19GetBackgroundFeedResponse\x12\'\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x16.truffle.app.FeedEntry\"J\n\x1eLikeBackgroundFeedEntryRequest\x12\x15\n\rfeed_entry_id\x18\x01 \x01(\x04\x12\x11\n\tincrement\x18\x02 \x01(\x05\"9\n\x1fLikeBackgroundFeedEntryResponse\x12\x16\n\x0enew_like_count\x18\x01 \x01(\x05\"\x1d\n\x1bGetLatestFeedEntryIDRequest\"<\n\x1cGetLatestFeedEntryIDResponse\x12\x1c\n\x14latest_feed_entry_id\x18\x01 \x01(\x04\"R\n\x1d\x42\x61\x63kgroundFeedFeedbackRequest\x12\x1f\n\x17\x61ssociated_feed_entries\x18\x01 \x03(\x04\x12\x10\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x02 \x01(\t\"7\n\x1e\x42\x61\x63kgroundFeedFeedbackResponse\x12\x15\n\rfeedback_uuid\x18\x01 \x01(\tb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.background_feed_queries_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_GETBACKGROUNDFEEDREQUEST']._serialized_start=121 + _globals['_GETBACKGROUNDFEEDREQUEST']._serialized_end=211 + _globals['_GETBACKGROUNDFEEDRESPONSE']._serialized_start=213 + _globals['_GETBACKGROUNDFEEDRESPONSE']._serialized_end=281 + _globals['_LIKEBACKGROUNDFEEDENTRYREQUEST']._serialized_start=283 + _globals['_LIKEBACKGROUNDFEEDENTRYREQUEST']._serialized_end=357 + _globals['_LIKEBACKGROUNDFEEDENTRYRESPONSE']._serialized_start=359 + _globals['_LIKEBACKGROUNDFEEDENTRYRESPONSE']._serialized_end=416 + _globals['_GETLATESTFEEDENTRYIDREQUEST']._serialized_start=418 + _globals['_GETLATESTFEEDENTRYIDREQUEST']._serialized_end=447 + _globals['_GETLATESTFEEDENTRYIDRESPONSE']._serialized_start=449 + _globals['_GETLATESTFEEDENTRYIDRESPONSE']._serialized_end=509 + _globals['_BACKGROUNDFEEDFEEDBACKREQUEST']._serialized_start=511 + _globals['_BACKGROUNDFEEDFEEDBACKREQUEST']._serialized_end=593 + _globals['_BACKGROUNDFEEDFEEDBACKRESPONSE']._serialized_start=595 + _globals['_BACKGROUNDFEEDFEEDBACKRESPONSE']._serialized_end=650 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/background_feed_queries_pb2.pyi b/truffle/os/background_feed_queries_pb2.pyi new file mode 100644 index 0000000..9ee2d57 --- /dev/null +++ b/truffle/os/background_feed_queries_pb2.pyi @@ -0,0 +1,63 @@ +from truffle.app import background_pb2 as _background_pb2 +from truffle.app import background_feed_pb2 as _background_feed_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class GetBackgroundFeedRequest(_message.Message): + __slots__ = ("target_entry_id", "max_before", "max_after") + TARGET_ENTRY_ID_FIELD_NUMBER: _ClassVar[int] + MAX_BEFORE_FIELD_NUMBER: _ClassVar[int] + MAX_AFTER_FIELD_NUMBER: _ClassVar[int] + target_entry_id: int + max_before: int + max_after: int + def __init__(self, target_entry_id: _Optional[int] = ..., max_before: _Optional[int] = ..., max_after: _Optional[int] = ...) -> None: ... + +class GetBackgroundFeedResponse(_message.Message): + __slots__ = ("entries",) + ENTRIES_FIELD_NUMBER: _ClassVar[int] + entries: _containers.RepeatedCompositeFieldContainer[_background_feed_pb2.FeedEntry] + def __init__(self, entries: _Optional[_Iterable[_Union[_background_feed_pb2.FeedEntry, _Mapping]]] = ...) -> None: ... + +class LikeBackgroundFeedEntryRequest(_message.Message): + __slots__ = ("feed_entry_id", "increment") + FEED_ENTRY_ID_FIELD_NUMBER: _ClassVar[int] + INCREMENT_FIELD_NUMBER: _ClassVar[int] + feed_entry_id: int + increment: int + def __init__(self, feed_entry_id: _Optional[int] = ..., increment: _Optional[int] = ...) -> None: ... + +class LikeBackgroundFeedEntryResponse(_message.Message): + __slots__ = ("new_like_count",) + NEW_LIKE_COUNT_FIELD_NUMBER: _ClassVar[int] + new_like_count: int + def __init__(self, new_like_count: _Optional[int] = ...) -> None: ... + +class GetLatestFeedEntryIDRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class GetLatestFeedEntryIDResponse(_message.Message): + __slots__ = ("latest_feed_entry_id",) + LATEST_FEED_ENTRY_ID_FIELD_NUMBER: _ClassVar[int] + latest_feed_entry_id: int + def __init__(self, latest_feed_entry_id: _Optional[int] = ...) -> None: ... + +class BackgroundFeedFeedbackRequest(_message.Message): + __slots__ = ("associated_feed_entries", "feedback") + ASSOCIATED_FEED_ENTRIES_FIELD_NUMBER: _ClassVar[int] + FEEDBACK_FIELD_NUMBER: _ClassVar[int] + associated_feed_entries: _containers.RepeatedScalarFieldContainer[int] + feedback: str + def __init__(self, associated_feed_entries: _Optional[_Iterable[int]] = ..., feedback: _Optional[str] = ...) -> None: ... + +class BackgroundFeedFeedbackResponse(_message.Message): + __slots__ = ("feedback_uuid",) + FEEDBACK_UUID_FIELD_NUMBER: _ClassVar[int] + feedback_uuid: str + def __init__(self, feedback_uuid: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/background_feed_queries_pb2_grpc.py b/truffle/os/background_feed_queries_pb2_grpc.py new file mode 100644 index 0000000..d152381 --- /dev/null +++ b/truffle/os/background_feed_queries_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/background_feed_queries_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/builder_pb2.py b/truffle/os/builder_pb2.py new file mode 100644 index 0000000..866f33f --- /dev/null +++ b/truffle/os/builder_pb2.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/builder.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/builder.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.app import app_type_pb2 as truffle_dot_app_dot_app__type__pb2 +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 +from truffle.app import foreground_pb2 as truffle_dot_app_dot_foreground__pb2 +from truffle.app import app_build_pb2 as truffle_dot_app_dot_app__build__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18truffle/os/builder.proto\x12\ntruffle.os\x1a\x1atruffle/app/app_type.proto\x1a\x1ctruffle/app/background.proto\x1a\x1ctruffle/app/foreground.proto\x1a\x1btruffle/app/app_build.proto\"f\n\x18StartBuildSessionRequest\x12\x15\n\x08\x61pp_uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12&\n\x08\x61pp_type\x18\x02 \x01(\x0e\x32\x14.truffle.app.AppTypeB\x0b\n\t_app_uuid\"B\n\x19StartBuildSessionResponse\x12\x13\n\x0b\x61\x63\x63\x65ss_path\x18\x01 \x01(\t\x12\x10\n\x08\x61pp_uuid\x18\x02 \x01(\t\"\xef\x01\n\x19\x46inishBuildSessionRequest\x12\x10\n\x08\x61pp_uuid\x18\x01 \x01(\t\x12\x0f\n\x07\x64iscard\x18\x02 \x01(\x08\x12\x39\n\nforeground\x18\x03 \x01(\x0b\x32#.truffle.app.ForegroundAppBuildInfoH\x00\x12\x39\n\nbackground\x18\x04 \x01(\x0b\x32#.truffle.app.BackgroundAppBuildInfoH\x00\x12+\n\x07process\x18\x05 \x01(\x0b\x32\x1a.truffle.app.ProcessConfigB\x0c\n\nbuild_info\"D\n\x11\x42uildSessionError\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x14\n\x07\x64\x65tails\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_details\"Y\n\x1a\x46inishBuildSessionResponse\x12\x31\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x1d.truffle.os.BuildSessionErrorH\x00\x88\x01\x01\x42\x08\n\x06_errorb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.builder_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_STARTBUILDSESSIONREQUEST']._serialized_start=157 + _globals['_STARTBUILDSESSIONREQUEST']._serialized_end=259 + _globals['_STARTBUILDSESSIONRESPONSE']._serialized_start=261 + _globals['_STARTBUILDSESSIONRESPONSE']._serialized_end=327 + _globals['_FINISHBUILDSESSIONREQUEST']._serialized_start=330 + _globals['_FINISHBUILDSESSIONREQUEST']._serialized_end=569 + _globals['_BUILDSESSIONERROR']._serialized_start=571 + _globals['_BUILDSESSIONERROR']._serialized_end=639 + _globals['_FINISHBUILDSESSIONRESPONSE']._serialized_start=641 + _globals['_FINISHBUILDSESSIONRESPONSE']._serialized_end=730 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/builder_pb2.pyi b/truffle/os/builder_pb2.pyi new file mode 100644 index 0000000..f36a285 --- /dev/null +++ b/truffle/os/builder_pb2.pyi @@ -0,0 +1,54 @@ +from truffle.app import app_type_pb2 as _app_type_pb2 +from truffle.app import background_pb2 as _background_pb2 +from truffle.app import foreground_pb2 as _foreground_pb2 +from truffle.app import app_build_pb2 as _app_build_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class StartBuildSessionRequest(_message.Message): + __slots__ = ("app_uuid", "app_type") + APP_UUID_FIELD_NUMBER: _ClassVar[int] + APP_TYPE_FIELD_NUMBER: _ClassVar[int] + app_uuid: str + app_type: _app_type_pb2.AppType + def __init__(self, app_uuid: _Optional[str] = ..., app_type: _Optional[_Union[_app_type_pb2.AppType, str]] = ...) -> None: ... + +class StartBuildSessionResponse(_message.Message): + __slots__ = ("access_path", "app_uuid") + ACCESS_PATH_FIELD_NUMBER: _ClassVar[int] + APP_UUID_FIELD_NUMBER: _ClassVar[int] + access_path: str + app_uuid: str + def __init__(self, access_path: _Optional[str] = ..., app_uuid: _Optional[str] = ...) -> None: ... + +class FinishBuildSessionRequest(_message.Message): + __slots__ = ("app_uuid", "discard", "foreground", "background", "process") + APP_UUID_FIELD_NUMBER: _ClassVar[int] + DISCARD_FIELD_NUMBER: _ClassVar[int] + FOREGROUND_FIELD_NUMBER: _ClassVar[int] + BACKGROUND_FIELD_NUMBER: _ClassVar[int] + PROCESS_FIELD_NUMBER: _ClassVar[int] + app_uuid: str + discard: bool + foreground: _foreground_pb2.ForegroundAppBuildInfo + background: _background_pb2.BackgroundAppBuildInfo + process: _app_build_pb2.ProcessConfig + def __init__(self, app_uuid: _Optional[str] = ..., discard: bool = ..., foreground: _Optional[_Union[_foreground_pb2.ForegroundAppBuildInfo, _Mapping]] = ..., background: _Optional[_Union[_background_pb2.BackgroundAppBuildInfo, _Mapping]] = ..., process: _Optional[_Union[_app_build_pb2.ProcessConfig, _Mapping]] = ...) -> None: ... + +class BuildSessionError(_message.Message): + __slots__ = ("error", "details") + ERROR_FIELD_NUMBER: _ClassVar[int] + DETAILS_FIELD_NUMBER: _ClassVar[int] + error: str + details: str + def __init__(self, error: _Optional[str] = ..., details: _Optional[str] = ...) -> None: ... + +class FinishBuildSessionResponse(_message.Message): + __slots__ = ("error",) + ERROR_FIELD_NUMBER: _ClassVar[int] + error: BuildSessionError + def __init__(self, error: _Optional[_Union[BuildSessionError, _Mapping]] = ...) -> None: ... diff --git a/truffle/os/builder_pb2_grpc.py b/truffle/os/builder_pb2_grpc.py new file mode 100644 index 0000000..d5be29b --- /dev/null +++ b/truffle/os/builder_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/builder_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/classification_pb2.py b/truffle/os/classification_pb2.py new file mode 100644 index 0000000..0489117 --- /dev/null +++ b/truffle/os/classification_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/classification.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/classification.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ftruffle/os/classification.proto\x12\ntruffle.os\"K\n\x0f\x43lassifyRequest\x12\x0e\n\x06prompt\x18\x01 \x01(\t\x12\x18\n\x0bmax_results\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\x0e\n\x0c_max_results\"\x81\x01\n\x10\x43lassifyResponse\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.truffle.os.ClassifyResponse.ClassifyResult\x1a/\n\x0e\x43lassifyResult\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.classification_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_CLASSIFYREQUEST']._serialized_start=47 + _globals['_CLASSIFYREQUEST']._serialized_end=122 + _globals['_CLASSIFYRESPONSE']._serialized_start=125 + _globals['_CLASSIFYRESPONSE']._serialized_end=254 + _globals['_CLASSIFYRESPONSE_CLASSIFYRESULT']._serialized_start=207 + _globals['_CLASSIFYRESPONSE_CLASSIFYRESULT']._serialized_end=254 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/classification_pb2.pyi b/truffle/os/classification_pb2.pyi new file mode 100644 index 0000000..4bca042 --- /dev/null +++ b/truffle/os/classification_pb2.pyi @@ -0,0 +1,28 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ClassifyRequest(_message.Message): + __slots__ = ("prompt", "max_results") + PROMPT_FIELD_NUMBER: _ClassVar[int] + MAX_RESULTS_FIELD_NUMBER: _ClassVar[int] + prompt: str + max_results: int + def __init__(self, prompt: _Optional[str] = ..., max_results: _Optional[int] = ...) -> None: ... + +class ClassifyResponse(_message.Message): + __slots__ = ("results",) + class ClassifyResult(_message.Message): + __slots__ = ("app_id", "score") + APP_ID_FIELD_NUMBER: _ClassVar[int] + SCORE_FIELD_NUMBER: _ClassVar[int] + app_id: str + score: float + def __init__(self, app_id: _Optional[str] = ..., score: _Optional[float] = ...) -> None: ... + RESULTS_FIELD_NUMBER: _ClassVar[int] + results: _containers.RepeatedCompositeFieldContainer[ClassifyResponse.ClassifyResult] + def __init__(self, results: _Optional[_Iterable[_Union[ClassifyResponse.ClassifyResult, _Mapping]]] = ...) -> None: ... diff --git a/truffle/os/classification_pb2_grpc.py b/truffle/os/classification_pb2_grpc.py new file mode 100644 index 0000000..62c9799 --- /dev/null +++ b/truffle/os/classification_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/classification_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/client_metadata_pb2.py b/truffle/os/client_metadata_pb2.py new file mode 100644 index 0000000..9ba5066 --- /dev/null +++ b/truffle/os/client_metadata_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/client_metadata.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/client_metadata.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n truffle/os/client_metadata.proto\x12\ntruffle.os\"d\n\x0e\x43lientMetadata\x12\x10\n\x08platform\x18\x01 \x01(\t\x12\x14\n\x07version\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x64\x65vice\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\n\n\x08_versionB\t\n\x07_deviceb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.client_metadata_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_CLIENTMETADATA']._serialized_start=48 + _globals['_CLIENTMETADATA']._serialized_end=148 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/client_metadata_pb2.pyi b/truffle/os/client_metadata_pb2.pyi new file mode 100644 index 0000000..36b1489 --- /dev/null +++ b/truffle/os/client_metadata_pb2.pyi @@ -0,0 +1,15 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional + +DESCRIPTOR: _descriptor.FileDescriptor + +class ClientMetadata(_message.Message): + __slots__ = ("platform", "version", "device") + PLATFORM_FIELD_NUMBER: _ClassVar[int] + VERSION_FIELD_NUMBER: _ClassVar[int] + DEVICE_FIELD_NUMBER: _ClassVar[int] + platform: str + version: str + device: str + def __init__(self, platform: _Optional[str] = ..., version: _Optional[str] = ..., device: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/client_metadata_pb2_grpc.py b/truffle/os/client_metadata_pb2_grpc.py new file mode 100644 index 0000000..66437f4 --- /dev/null +++ b/truffle/os/client_metadata_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/client_metadata_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/client_session_pb2.py b/truffle/os/client_session_pb2.py new file mode 100644 index 0000000..0eaf851 --- /dev/null +++ b/truffle/os/client_session_pb2.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/client_session.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/client_session.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import client_metadata_pb2 as truffle_dot_os_dot_client__metadata__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ftruffle/os/client_session.proto\x12\ntruffle.os\x1a truffle/os/client_metadata.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\"\n\x11UserRecoveryCodes\x12\r\n\x05\x63odes\x18\x01 \x03(\t\"\x88\x01\n\x19RegisterNewSessionRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12,\n\x08metadata\x18\x02 \x01(\x0b\x32\x1a.truffle.os.ClientMetadata\x12\x1a\n\rrecovery_code\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x10\n\x0e_recovery_code\"\x99\x01\n\x1aRegisterNewSessionResponse\x12\r\n\x05token\x18\x01 \x01(\t\x12\x31\n\x08verifier\x18\x02 \x01(\x0b\x32\x1a.truffle.os.ClientMetadataH\x00\x88\x01\x01\x12,\n\x06status\x18\x03 \x01(\x0b\x32\x1c.truffle.os.NewSessionStatusB\x0b\n\t_verifier\"\x9b\x01\n\x16NewSessionVerification\x12\x1a\n\x12verification_token\x18\x01 \x01(\t\x12.\n\nexpires_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11requesting_client\x18\x03 \x01(\x0b\x32\x1a.truffle.os.ClientMetadata\"D\n\x17VerifyNewSessionRequest\x12\x1a\n\x12verification_token\x18\x01 \x01(\t\x12\r\n\x05\x61llow\x18\x02 \x01(\x08\"\xfc\x01\n\x10NewSessionStatus\x12@\n\x05\x65rror\x18\x01 \x01(\x0e\x32,.truffle.os.NewSessionStatus.NewSessionErrorH\x00\x88\x01\x01\"\x9b\x01\n\x0fNewSessionError\x12\x17\n\x13NEW_SESSION_SUCCESS\x10\x00\x12\x17\n\x13NEW_SESSION_TIMEOUT\x10\x01\x12\x18\n\x14NEW_SESSION_REJECTED\x10\x02\x12\x1f\n\x1bNEW_SESSION_TOKEN_NOT_FOUND\x10\x03\x12\x1b\n\x17NEW_SESSION_NO_REQUESTS\x10\x04\x42\x08\n\x06_errorb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.client_session_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_USERRECOVERYCODES']._serialized_start=114 + _globals['_USERRECOVERYCODES']._serialized_end=148 + _globals['_REGISTERNEWSESSIONREQUEST']._serialized_start=151 + _globals['_REGISTERNEWSESSIONREQUEST']._serialized_end=287 + _globals['_REGISTERNEWSESSIONRESPONSE']._serialized_start=290 + _globals['_REGISTERNEWSESSIONRESPONSE']._serialized_end=443 + _globals['_NEWSESSIONVERIFICATION']._serialized_start=446 + _globals['_NEWSESSIONVERIFICATION']._serialized_end=601 + _globals['_VERIFYNEWSESSIONREQUEST']._serialized_start=603 + _globals['_VERIFYNEWSESSIONREQUEST']._serialized_end=671 + _globals['_NEWSESSIONSTATUS']._serialized_start=674 + _globals['_NEWSESSIONSTATUS']._serialized_end=926 + _globals['_NEWSESSIONSTATUS_NEWSESSIONERROR']._serialized_start=761 + _globals['_NEWSESSIONSTATUS_NEWSESSIONERROR']._serialized_end=916 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/client_session_pb2.pyi b/truffle/os/client_session_pb2.pyi new file mode 100644 index 0000000..a1a2178 --- /dev/null +++ b/truffle/os/client_session_pb2.pyi @@ -0,0 +1,72 @@ +from truffle.os import client_metadata_pb2 as _client_metadata_pb2 +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class UserRecoveryCodes(_message.Message): + __slots__ = ("codes",) + CODES_FIELD_NUMBER: _ClassVar[int] + codes: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, codes: _Optional[_Iterable[str]] = ...) -> None: ... + +class RegisterNewSessionRequest(_message.Message): + __slots__ = ("user_id", "metadata", "recovery_code") + USER_ID_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + RECOVERY_CODE_FIELD_NUMBER: _ClassVar[int] + user_id: str + metadata: _client_metadata_pb2.ClientMetadata + recovery_code: str + def __init__(self, user_id: _Optional[str] = ..., metadata: _Optional[_Union[_client_metadata_pb2.ClientMetadata, _Mapping]] = ..., recovery_code: _Optional[str] = ...) -> None: ... + +class RegisterNewSessionResponse(_message.Message): + __slots__ = ("token", "verifier", "status") + TOKEN_FIELD_NUMBER: _ClassVar[int] + VERIFIER_FIELD_NUMBER: _ClassVar[int] + STATUS_FIELD_NUMBER: _ClassVar[int] + token: str + verifier: _client_metadata_pb2.ClientMetadata + status: NewSessionStatus + def __init__(self, token: _Optional[str] = ..., verifier: _Optional[_Union[_client_metadata_pb2.ClientMetadata, _Mapping]] = ..., status: _Optional[_Union[NewSessionStatus, _Mapping]] = ...) -> None: ... + +class NewSessionVerification(_message.Message): + __slots__ = ("verification_token", "expires_at", "requesting_client") + VERIFICATION_TOKEN_FIELD_NUMBER: _ClassVar[int] + EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] + REQUESTING_CLIENT_FIELD_NUMBER: _ClassVar[int] + verification_token: str + expires_at: _timestamp_pb2.Timestamp + requesting_client: _client_metadata_pb2.ClientMetadata + def __init__(self, verification_token: _Optional[str] = ..., expires_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., requesting_client: _Optional[_Union[_client_metadata_pb2.ClientMetadata, _Mapping]] = ...) -> None: ... + +class VerifyNewSessionRequest(_message.Message): + __slots__ = ("verification_token", "allow") + VERIFICATION_TOKEN_FIELD_NUMBER: _ClassVar[int] + ALLOW_FIELD_NUMBER: _ClassVar[int] + verification_token: str + allow: bool + def __init__(self, verification_token: _Optional[str] = ..., allow: bool = ...) -> None: ... + +class NewSessionStatus(_message.Message): + __slots__ = ("error",) + class NewSessionError(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + NEW_SESSION_SUCCESS: _ClassVar[NewSessionStatus.NewSessionError] + NEW_SESSION_TIMEOUT: _ClassVar[NewSessionStatus.NewSessionError] + NEW_SESSION_REJECTED: _ClassVar[NewSessionStatus.NewSessionError] + NEW_SESSION_TOKEN_NOT_FOUND: _ClassVar[NewSessionStatus.NewSessionError] + NEW_SESSION_NO_REQUESTS: _ClassVar[NewSessionStatus.NewSessionError] + NEW_SESSION_SUCCESS: NewSessionStatus.NewSessionError + NEW_SESSION_TIMEOUT: NewSessionStatus.NewSessionError + NEW_SESSION_REJECTED: NewSessionStatus.NewSessionError + NEW_SESSION_TOKEN_NOT_FOUND: NewSessionStatus.NewSessionError + NEW_SESSION_NO_REQUESTS: NewSessionStatus.NewSessionError + ERROR_FIELD_NUMBER: _ClassVar[int] + error: NewSessionStatus.NewSessionError + def __init__(self, error: _Optional[_Union[NewSessionStatus.NewSessionError, str]] = ...) -> None: ... diff --git a/truffle/os/client_session_pb2_grpc.py b/truffle/os/client_session_pb2_grpc.py new file mode 100644 index 0000000..d244186 --- /dev/null +++ b/truffle/os/client_session_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/client_session_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/client_state_pb2.py b/truffle/os/client_state_pb2.py new file mode 100644 index 0000000..f1fe300 --- /dev/null +++ b/truffle/os/client_state_pb2.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/client_state.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/client_state.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/os/client_state.proto\x12\ntruffle.os\"\x1b\n\x0b\x43lientState\x12\x0c\n\x04\x62lob\x18\x01 \x01(\t\"O\n\x18UpdateClientStateRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05state\x18\x02 \x01(\x0b\x32\x17.truffle.os.ClientState\"\x1b\n\x19UpdateClientStateResponse\"$\n\x15GetClientStateRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\"@\n\x16GetClientStateResponse\x12&\n\x05state\x18\x01 \x01(\x0b\x32\x17.truffle.os.ClientState\"\x1b\n\x19GetAllClientStatesRequest\"\xa8\x01\n\x1aGetAllClientStatesResponse\x12\x42\n\x06states\x18\x01 \x03(\x0b\x32\x32.truffle.os.GetAllClientStatesResponse.StatesEntry\x1a\x46\n\x0bStatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.truffle.os.ClientState:\x02\x38\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.client_state_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_GETALLCLIENTSTATESRESPONSE_STATESENTRY']._loaded_options = None + _globals['_GETALLCLIENTSTATESRESPONSE_STATESENTRY']._serialized_options = b'8\001' + _globals['_CLIENTSTATE']._serialized_start=45 + _globals['_CLIENTSTATE']._serialized_end=72 + _globals['_UPDATECLIENTSTATEREQUEST']._serialized_start=74 + _globals['_UPDATECLIENTSTATEREQUEST']._serialized_end=153 + _globals['_UPDATECLIENTSTATERESPONSE']._serialized_start=155 + _globals['_UPDATECLIENTSTATERESPONSE']._serialized_end=182 + _globals['_GETCLIENTSTATEREQUEST']._serialized_start=184 + _globals['_GETCLIENTSTATEREQUEST']._serialized_end=220 + _globals['_GETCLIENTSTATERESPONSE']._serialized_start=222 + _globals['_GETCLIENTSTATERESPONSE']._serialized_end=286 + _globals['_GETALLCLIENTSTATESREQUEST']._serialized_start=288 + _globals['_GETALLCLIENTSTATESREQUEST']._serialized_end=315 + _globals['_GETALLCLIENTSTATESRESPONSE']._serialized_start=318 + _globals['_GETALLCLIENTSTATESRESPONSE']._serialized_end=486 + _globals['_GETALLCLIENTSTATESRESPONSE_STATESENTRY']._serialized_start=416 + _globals['_GETALLCLIENTSTATESRESPONSE_STATESENTRY']._serialized_end=486 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/client_state_pb2.pyi b/truffle/os/client_state_pb2.pyi new file mode 100644 index 0000000..5c66f9b --- /dev/null +++ b/truffle/os/client_state_pb2.pyi @@ -0,0 +1,54 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ClientState(_message.Message): + __slots__ = ("blob",) + BLOB_FIELD_NUMBER: _ClassVar[int] + blob: str + def __init__(self, blob: _Optional[str] = ...) -> None: ... + +class UpdateClientStateRequest(_message.Message): + __slots__ = ("key", "state") + KEY_FIELD_NUMBER: _ClassVar[int] + STATE_FIELD_NUMBER: _ClassVar[int] + key: str + state: ClientState + def __init__(self, key: _Optional[str] = ..., state: _Optional[_Union[ClientState, _Mapping]] = ...) -> None: ... + +class UpdateClientStateResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class GetClientStateRequest(_message.Message): + __slots__ = ("key",) + KEY_FIELD_NUMBER: _ClassVar[int] + key: str + def __init__(self, key: _Optional[str] = ...) -> None: ... + +class GetClientStateResponse(_message.Message): + __slots__ = ("state",) + STATE_FIELD_NUMBER: _ClassVar[int] + state: ClientState + def __init__(self, state: _Optional[_Union[ClientState, _Mapping]] = ...) -> None: ... + +class GetAllClientStatesRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class GetAllClientStatesResponse(_message.Message): + __slots__ = ("states",) + class StatesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: ClientState + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[ClientState, _Mapping]] = ...) -> None: ... + STATES_FIELD_NUMBER: _ClassVar[int] + states: _containers.MessageMap[str, ClientState] + def __init__(self, states: _Optional[_Mapping[str, ClientState]] = ...) -> None: ... diff --git a/truffle/os/client_state_pb2_grpc.py b/truffle/os/client_state_pb2_grpc.py new file mode 100644 index 0000000..0fd1040 --- /dev/null +++ b/truffle/os/client_state_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/client_state_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/client_user_pb2.py b/truffle/os/client_user_pb2.py new file mode 100644 index 0000000..1ccf5e6 --- /dev/null +++ b/truffle/os/client_user_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/client_user.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/client_user.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import client_metadata_pb2 as truffle_dot_os_dot_client__metadata__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/os/client_user.proto\x12\ntruffle.os\x1a truffle/os/client_metadata.proto\"h\n\x16RegisterNewUserRequest\x12,\n\x08metadata\x18\x01 \x01(\x0b\x32\x1a.truffle.os.ClientMetadata\x12\x14\n\x07user_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_user_id\"9\n\x17RegisterNewUserResponse\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"&\n\x15UserIDForTokenRequest\x12\r\n\x05token\x18\x01 \x01(\t\")\n\x16UserIDForTokenResponse\x12\x0f\n\x07user_id\x18\x01 \x01(\tb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.client_user_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_REGISTERNEWUSERREQUEST']._serialized_start=78 + _globals['_REGISTERNEWUSERREQUEST']._serialized_end=182 + _globals['_REGISTERNEWUSERRESPONSE']._serialized_start=184 + _globals['_REGISTERNEWUSERRESPONSE']._serialized_end=241 + _globals['_USERIDFORTOKENREQUEST']._serialized_start=243 + _globals['_USERIDFORTOKENREQUEST']._serialized_end=281 + _globals['_USERIDFORTOKENRESPONSE']._serialized_start=283 + _globals['_USERIDFORTOKENRESPONSE']._serialized_end=324 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/client_user_pb2.pyi b/truffle/os/client_user_pb2.pyi new file mode 100644 index 0000000..b6add62 --- /dev/null +++ b/truffle/os/client_user_pb2.pyi @@ -0,0 +1,35 @@ +from truffle.os import client_metadata_pb2 as _client_metadata_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class RegisterNewUserRequest(_message.Message): + __slots__ = ("metadata", "user_id") + METADATA_FIELD_NUMBER: _ClassVar[int] + USER_ID_FIELD_NUMBER: _ClassVar[int] + metadata: _client_metadata_pb2.ClientMetadata + user_id: str + def __init__(self, metadata: _Optional[_Union[_client_metadata_pb2.ClientMetadata, _Mapping]] = ..., user_id: _Optional[str] = ...) -> None: ... + +class RegisterNewUserResponse(_message.Message): + __slots__ = ("user_id", "token") + USER_ID_FIELD_NUMBER: _ClassVar[int] + TOKEN_FIELD_NUMBER: _ClassVar[int] + user_id: str + token: str + def __init__(self, user_id: _Optional[str] = ..., token: _Optional[str] = ...) -> None: ... + +class UserIDForTokenRequest(_message.Message): + __slots__ = ("token",) + TOKEN_FIELD_NUMBER: _ClassVar[int] + token: str + def __init__(self, token: _Optional[str] = ...) -> None: ... + +class UserIDForTokenResponse(_message.Message): + __slots__ = ("user_id",) + USER_ID_FIELD_NUMBER: _ClassVar[int] + user_id: str + def __init__(self, user_id: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/client_user_pb2_grpc.py b/truffle/os/client_user_pb2_grpc.py new file mode 100644 index 0000000..0a6955b --- /dev/null +++ b/truffle/os/client_user_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/client_user_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/hardware_control_pb2.py b/truffle/os/hardware_control_pb2.py new file mode 100644 index 0000000..9f28a54 --- /dev/null +++ b/truffle/os/hardware_control_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/hardware_control.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/hardware_control.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!truffle/os/hardware_control.proto\x12\ntruffle.os\"\xe7\x01\n\x1bHardwarePowerControlRequest\x12R\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x42.truffle.os.HardwarePowerControlRequest.HardwarePowerControlAction\"t\n\x1aHardwarePowerControlAction\x12\x1e\n\x1a\x43ONTROL_ACTION_UNSPECIFIED\x10\x00\x12\x19\n\x15\x43ONTROL_ACTION_REBOOT\x10\x01\x12\x1b\n\x17\x43ONTROL_ACTION_SHUTDOWN\x10\x02\"\x1e\n\x1cHardwarePowerControlResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.hardware_control_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_HARDWAREPOWERCONTROLREQUEST']._serialized_start=50 + _globals['_HARDWAREPOWERCONTROLREQUEST']._serialized_end=281 + _globals['_HARDWAREPOWERCONTROLREQUEST_HARDWAREPOWERCONTROLACTION']._serialized_start=165 + _globals['_HARDWAREPOWERCONTROLREQUEST_HARDWAREPOWERCONTROLACTION']._serialized_end=281 + _globals['_HARDWAREPOWERCONTROLRESPONSE']._serialized_start=283 + _globals['_HARDWAREPOWERCONTROLRESPONSE']._serialized_end=313 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/hardware_control_pb2.pyi b/truffle/os/hardware_control_pb2.pyi new file mode 100644 index 0000000..99af986 --- /dev/null +++ b/truffle/os/hardware_control_pb2.pyi @@ -0,0 +1,24 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class HardwarePowerControlRequest(_message.Message): + __slots__ = ("action",) + class HardwarePowerControlAction(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + CONTROL_ACTION_UNSPECIFIED: _ClassVar[HardwarePowerControlRequest.HardwarePowerControlAction] + CONTROL_ACTION_REBOOT: _ClassVar[HardwarePowerControlRequest.HardwarePowerControlAction] + CONTROL_ACTION_SHUTDOWN: _ClassVar[HardwarePowerControlRequest.HardwarePowerControlAction] + CONTROL_ACTION_UNSPECIFIED: HardwarePowerControlRequest.HardwarePowerControlAction + CONTROL_ACTION_REBOOT: HardwarePowerControlRequest.HardwarePowerControlAction + CONTROL_ACTION_SHUTDOWN: HardwarePowerControlRequest.HardwarePowerControlAction + ACTION_FIELD_NUMBER: _ClassVar[int] + action: HardwarePowerControlRequest.HardwarePowerControlAction + def __init__(self, action: _Optional[_Union[HardwarePowerControlRequest.HardwarePowerControlAction, str]] = ...) -> None: ... + +class HardwarePowerControlResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... diff --git a/truffle/os/hardware_control_pb2_grpc.py b/truffle/os/hardware_control_pb2_grpc.py new file mode 100644 index 0000000..e98792b --- /dev/null +++ b/truffle/os/hardware_control_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/hardware_control_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/hardware_info_pb2.py b/truffle/os/hardware_info_pb2.py new file mode 100644 index 0000000..bcf246c --- /dev/null +++ b/truffle/os/hardware_info_pb2.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/hardware_info.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/hardware_info.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import hardware_network_pb2 as truffle_dot_os_dot_hardware__network__pb2 +from truffle.common import led_states_pb2 as truffle_dot_common_dot_led__states__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1etruffle/os/hardware_info.proto\x12\ntruffle.os\x1a!truffle/os/hardware_network.proto\x1a\x1ftruffle/common/led_states.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa8\x02\n\x0cHardwareInfo\x12\x10\n\x08hostname\x18\x01 \x01(\t\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x13\n\x0bmac_address\x18\x03 \x01(\t\x12\x39\n\x0enetwork_status\x18\x04 \x01(\x0e\x32!.truffle.os.HardwareNetworkStatus\x12\x42\n\x14\x63urrent_wifi_network\x18\x05 \x01(\x0b\x32\x1f.truffle.os.HardwareWifiNetworkH\x00\x88\x01\x01\x12\x15\n\rserial_number\x18\n \x01(\t\x12.\n\nstart_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x17\n\x15_current_wifi_networkb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.hardware_info_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_HARDWAREINFO']._serialized_start=148 + _globals['_HARDWAREINFO']._serialized_end=444 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/hardware_info_pb2.pyi b/truffle/os/hardware_info_pb2.pyi new file mode 100644 index 0000000..5042bff --- /dev/null +++ b/truffle/os/hardware_info_pb2.pyi @@ -0,0 +1,27 @@ +from truffle.os import hardware_network_pb2 as _hardware_network_pb2 +from truffle.common import led_states_pb2 as _led_states_pb2 +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class HardwareInfo(_message.Message): + __slots__ = ("hostname", "ip_address", "mac_address", "network_status", "current_wifi_network", "serial_number", "start_time") + HOSTNAME_FIELD_NUMBER: _ClassVar[int] + IP_ADDRESS_FIELD_NUMBER: _ClassVar[int] + MAC_ADDRESS_FIELD_NUMBER: _ClassVar[int] + NETWORK_STATUS_FIELD_NUMBER: _ClassVar[int] + CURRENT_WIFI_NETWORK_FIELD_NUMBER: _ClassVar[int] + SERIAL_NUMBER_FIELD_NUMBER: _ClassVar[int] + START_TIME_FIELD_NUMBER: _ClassVar[int] + hostname: str + ip_address: str + mac_address: str + network_status: _hardware_network_pb2.HardwareNetworkStatus + current_wifi_network: _hardware_network_pb2.HardwareWifiNetwork + serial_number: str + start_time: _timestamp_pb2.Timestamp + def __init__(self, hostname: _Optional[str] = ..., ip_address: _Optional[str] = ..., mac_address: _Optional[str] = ..., network_status: _Optional[_Union[_hardware_network_pb2.HardwareNetworkStatus, str]] = ..., current_wifi_network: _Optional[_Union[_hardware_network_pb2.HardwareWifiNetwork, _Mapping]] = ..., serial_number: _Optional[str] = ..., start_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... diff --git a/truffle/os/hardware_info_pb2_grpc.py b/truffle/os/hardware_info_pb2_grpc.py new file mode 100644 index 0000000..2b1cec8 --- /dev/null +++ b/truffle/os/hardware_info_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/hardware_info_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/hardware_network_pb2.py b/truffle/os/hardware_network_pb2.py new file mode 100644 index 0000000..b961935 --- /dev/null +++ b/truffle/os/hardware_network_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/hardware_network.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/hardware_network.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!truffle/os/hardware_network.proto\x12\ntruffle.os\"1\n\x13HardwareWifiNetwork\x12\x0c\n\x04ssid\x18\x01 \x01(\t\x12\x0c\n\x04rssi\x18\x02 \x01(\x02*g\n\x15HardwareNetworkStatus\x12\x0f\n\x0bNET_DEFAULT\x10\x00\x12\x15\n\x11NET_NOT_CONNECTED\x10\x01\x12\x13\n\x0fNET_NO_INTERNET\x10\x02\x12\x11\n\rNET_CONNECTED\x10\x03\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.hardware_network_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_HARDWARENETWORKSTATUS']._serialized_start=100 + _globals['_HARDWARENETWORKSTATUS']._serialized_end=203 + _globals['_HARDWAREWIFINETWORK']._serialized_start=49 + _globals['_HARDWAREWIFINETWORK']._serialized_end=98 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/hardware_network_pb2.pyi b/truffle/os/hardware_network_pb2.pyi new file mode 100644 index 0000000..8a70fed --- /dev/null +++ b/truffle/os/hardware_network_pb2.pyi @@ -0,0 +1,25 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional + +DESCRIPTOR: _descriptor.FileDescriptor + +class HardwareNetworkStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + NET_DEFAULT: _ClassVar[HardwareNetworkStatus] + NET_NOT_CONNECTED: _ClassVar[HardwareNetworkStatus] + NET_NO_INTERNET: _ClassVar[HardwareNetworkStatus] + NET_CONNECTED: _ClassVar[HardwareNetworkStatus] +NET_DEFAULT: HardwareNetworkStatus +NET_NOT_CONNECTED: HardwareNetworkStatus +NET_NO_INTERNET: HardwareNetworkStatus +NET_CONNECTED: HardwareNetworkStatus + +class HardwareWifiNetwork(_message.Message): + __slots__ = ("ssid", "rssi") + SSID_FIELD_NUMBER: _ClassVar[int] + RSSI_FIELD_NUMBER: _ClassVar[int] + ssid: str + rssi: float + def __init__(self, ssid: _Optional[str] = ..., rssi: _Optional[float] = ...) -> None: ... diff --git a/truffle/os/hardware_network_pb2_grpc.py b/truffle/os/hardware_network_pb2_grpc.py new file mode 100644 index 0000000..83be82a --- /dev/null +++ b/truffle/os/hardware_network_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/hardware_network_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/hardware_settings_pb2.py b/truffle/os/hardware_settings_pb2.py new file mode 100644 index 0000000..73b02f9 --- /dev/null +++ b/truffle/os/hardware_settings_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/hardware_settings.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/hardware_settings.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"truffle/os/hardware_settings.proto\x12\ntruffle.os\"\xc3\x01\n\x10HardwareSettings\x12\x14\n\x0ctruffle_name\x18\x01 \x01(\t\x12\x43\n\x0cled_settings\x18\x02 \x01(\x0b\x32(.truffle.os.HardwareSettings.LEDSettingsH\x00\x88\x01\x01\x1a\x43\n\x0bLEDSettings\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x12\n\nbrightness\x18\x02 \x01(\x02\x42\n\n\x08_enabledB\x0f\n\r_led_settingsb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.hardware_settings_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_HARDWARESETTINGS']._serialized_start=51 + _globals['_HARDWARESETTINGS']._serialized_end=246 + _globals['_HARDWARESETTINGS_LEDSETTINGS']._serialized_start=162 + _globals['_HARDWARESETTINGS_LEDSETTINGS']._serialized_end=229 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/hardware_settings_pb2.pyi b/truffle/os/hardware_settings_pb2.pyi new file mode 100644 index 0000000..7f3af53 --- /dev/null +++ b/truffle/os/hardware_settings_pb2.pyi @@ -0,0 +1,21 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class HardwareSettings(_message.Message): + __slots__ = ("truffle_name", "led_settings") + class LEDSettings(_message.Message): + __slots__ = ("enabled", "brightness") + ENABLED_FIELD_NUMBER: _ClassVar[int] + BRIGHTNESS_FIELD_NUMBER: _ClassVar[int] + enabled: bool + brightness: float + def __init__(self, enabled: bool = ..., brightness: _Optional[float] = ...) -> None: ... + TRUFFLE_NAME_FIELD_NUMBER: _ClassVar[int] + LED_SETTINGS_FIELD_NUMBER: _ClassVar[int] + truffle_name: str + led_settings: HardwareSettings.LEDSettings + def __init__(self, truffle_name: _Optional[str] = ..., led_settings: _Optional[_Union[HardwareSettings.LEDSettings, _Mapping]] = ...) -> None: ... diff --git a/truffle/os/hardware_settings_pb2_grpc.py b/truffle/os/hardware_settings_pb2_grpc.py new file mode 100644 index 0000000..c3ea15a --- /dev/null +++ b/truffle/os/hardware_settings_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/hardware_settings_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/hardware_stats_pb2.py b/truffle/os/hardware_stats_pb2.py new file mode 100644 index 0000000..f2deb13 --- /dev/null +++ b/truffle/os/hardware_stats_pb2.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/hardware_stats.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/hardware_stats.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import hardware_network_pb2 as truffle_dot_os_dot_hardware__network__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ftruffle/os/hardware_stats.proto\x12\ntruffle.os\x1a!truffle/os/hardware_network.proto\"\xf7\x05\n\rHardwareStats\x12.\n\x05usage\x18\x01 \x01(\x0b\x32\x1f.truffle.os.HardwareStats.Usage\x12.\n\x05temps\x18\x02 \x01(\x0b\x32\x1f.truffle.os.HardwareStats.Temps\x12.\n\x05power\x18\x03 \x01(\x0b\x32\x1f.truffle.os.HardwareStats.Power\x12,\n\x04misc\x18\x04 \x01(\x0b\x32\x1e.truffle.os.HardwareStats.Misc\x12\x39\n\x0enetwork_status\x18\x05 \x01(\x0e\x32!.truffle.os.HardwareNetworkStatus\x12\x17\n\x0fthermal_warning\x18\n \x01(\x08\x12\x14\n\x0c\x64isk_warning\x18\x0b \x01(\x08\x12\x15\n\rfubar_warning\x18\x0c \x01(\x08\x12 \n\x18\x63urrent_poll_interval_ms\x18\r \x01(\r\x1a\x8f\x01\n\x05Usage\x12\x0f\n\x07\x63pu_avg\x18\x01 \x01(\x02\x12\x0f\n\x07\x63pu_max\x18\x02 \x01(\x02\x12\x14\n\x0cmemory_total\x18\x03 \x01(\x02\x12\x12\n\nmemory_gpu\x18\x04 \x01(\x02\x12\x12\n\nmemory_cpu\x18\x05 \x01(\x02\x12\x0c\n\x04\x64isk\x18\x06 \x01(\x02\x12\x0b\n\x03gpu\x18\x07 \x01(\x02\x12\x0b\n\x03\x66\x61n\x18\x08 \x01(\x02\x1aZ\n\x05Temps\x12\x0f\n\x07\x63pu_avg\x18\x01 \x01(\x02\x12\x0f\n\x07\x63pu_max\x18\x02 \x01(\x02\x12\x0f\n\x07gpu_avg\x18\x03 \x01(\x02\x12\x0f\n\x07gpu_max\x18\x04 \x01(\x02\x12\r\n\x05t_max\x18\x05 \x01(\x02\x1a\x30\n\x05Power\x12\r\n\x05total\x18\x01 \x01(\x02\x12\x0b\n\x03\x63pu\x18\x02 \x01(\x02\x12\x0b\n\x03gpu\x18\x03 \x01(\x02\x1aM\n\x04Misc\x12\x0e\n\x06net_rx\x18\x01 \x01(\x03\x12\x0e\n\x06net_tx\x18\x02 \x01(\x03\x12\x11\n\tdisk_read\x18\x03 \x01(\x03\x12\x12\n\ndisk_write\x18\x04 \x01(\x03J\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\x16\n\x14HardwareStatsRequestb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.hardware_stats_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_HARDWARESTATS']._serialized_start=83 + _globals['_HARDWARESTATS']._serialized_end=842 + _globals['_HARDWARESTATS_USAGE']._serialized_start=454 + _globals['_HARDWARESTATS_USAGE']._serialized_end=597 + _globals['_HARDWARESTATS_TEMPS']._serialized_start=599 + _globals['_HARDWARESTATS_TEMPS']._serialized_end=689 + _globals['_HARDWARESTATS_POWER']._serialized_start=691 + _globals['_HARDWARESTATS_POWER']._serialized_end=739 + _globals['_HARDWARESTATS_MISC']._serialized_start=741 + _globals['_HARDWARESTATS_MISC']._serialized_end=818 + _globals['_HARDWARESTATSREQUEST']._serialized_start=844 + _globals['_HARDWARESTATSREQUEST']._serialized_end=866 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/hardware_stats_pb2.pyi b/truffle/os/hardware_stats_pb2.pyi new file mode 100644 index 0000000..27d7c5d --- /dev/null +++ b/truffle/os/hardware_stats_pb2.pyi @@ -0,0 +1,85 @@ +from truffle.os import hardware_network_pb2 as _hardware_network_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class HardwareStats(_message.Message): + __slots__ = ("usage", "temps", "power", "misc", "network_status", "thermal_warning", "disk_warning", "fubar_warning", "current_poll_interval_ms") + class Usage(_message.Message): + __slots__ = ("cpu_avg", "cpu_max", "memory_total", "memory_gpu", "memory_cpu", "disk", "gpu", "fan") + CPU_AVG_FIELD_NUMBER: _ClassVar[int] + CPU_MAX_FIELD_NUMBER: _ClassVar[int] + MEMORY_TOTAL_FIELD_NUMBER: _ClassVar[int] + MEMORY_GPU_FIELD_NUMBER: _ClassVar[int] + MEMORY_CPU_FIELD_NUMBER: _ClassVar[int] + DISK_FIELD_NUMBER: _ClassVar[int] + GPU_FIELD_NUMBER: _ClassVar[int] + FAN_FIELD_NUMBER: _ClassVar[int] + cpu_avg: float + cpu_max: float + memory_total: float + memory_gpu: float + memory_cpu: float + disk: float + gpu: float + fan: float + def __init__(self, cpu_avg: _Optional[float] = ..., cpu_max: _Optional[float] = ..., memory_total: _Optional[float] = ..., memory_gpu: _Optional[float] = ..., memory_cpu: _Optional[float] = ..., disk: _Optional[float] = ..., gpu: _Optional[float] = ..., fan: _Optional[float] = ...) -> None: ... + class Temps(_message.Message): + __slots__ = ("cpu_avg", "cpu_max", "gpu_avg", "gpu_max", "t_max") + CPU_AVG_FIELD_NUMBER: _ClassVar[int] + CPU_MAX_FIELD_NUMBER: _ClassVar[int] + GPU_AVG_FIELD_NUMBER: _ClassVar[int] + GPU_MAX_FIELD_NUMBER: _ClassVar[int] + T_MAX_FIELD_NUMBER: _ClassVar[int] + cpu_avg: float + cpu_max: float + gpu_avg: float + gpu_max: float + t_max: float + def __init__(self, cpu_avg: _Optional[float] = ..., cpu_max: _Optional[float] = ..., gpu_avg: _Optional[float] = ..., gpu_max: _Optional[float] = ..., t_max: _Optional[float] = ...) -> None: ... + class Power(_message.Message): + __slots__ = ("total", "cpu", "gpu") + TOTAL_FIELD_NUMBER: _ClassVar[int] + CPU_FIELD_NUMBER: _ClassVar[int] + GPU_FIELD_NUMBER: _ClassVar[int] + total: float + cpu: float + gpu: float + def __init__(self, total: _Optional[float] = ..., cpu: _Optional[float] = ..., gpu: _Optional[float] = ...) -> None: ... + class Misc(_message.Message): + __slots__ = ("net_rx", "net_tx", "disk_read", "disk_write") + NET_RX_FIELD_NUMBER: _ClassVar[int] + NET_TX_FIELD_NUMBER: _ClassVar[int] + DISK_READ_FIELD_NUMBER: _ClassVar[int] + DISK_WRITE_FIELD_NUMBER: _ClassVar[int] + net_rx: int + net_tx: int + disk_read: int + disk_write: int + def __init__(self, net_rx: _Optional[int] = ..., net_tx: _Optional[int] = ..., disk_read: _Optional[int] = ..., disk_write: _Optional[int] = ...) -> None: ... + USAGE_FIELD_NUMBER: _ClassVar[int] + TEMPS_FIELD_NUMBER: _ClassVar[int] + POWER_FIELD_NUMBER: _ClassVar[int] + MISC_FIELD_NUMBER: _ClassVar[int] + NETWORK_STATUS_FIELD_NUMBER: _ClassVar[int] + THERMAL_WARNING_FIELD_NUMBER: _ClassVar[int] + DISK_WARNING_FIELD_NUMBER: _ClassVar[int] + FUBAR_WARNING_FIELD_NUMBER: _ClassVar[int] + CURRENT_POLL_INTERVAL_MS_FIELD_NUMBER: _ClassVar[int] + usage: HardwareStats.Usage + temps: HardwareStats.Temps + power: HardwareStats.Power + misc: HardwareStats.Misc + network_status: _hardware_network_pb2.HardwareNetworkStatus + thermal_warning: bool + disk_warning: bool + fubar_warning: bool + current_poll_interval_ms: int + def __init__(self, usage: _Optional[_Union[HardwareStats.Usage, _Mapping]] = ..., temps: _Optional[_Union[HardwareStats.Temps, _Mapping]] = ..., power: _Optional[_Union[HardwareStats.Power, _Mapping]] = ..., misc: _Optional[_Union[HardwareStats.Misc, _Mapping]] = ..., network_status: _Optional[_Union[_hardware_network_pb2.HardwareNetworkStatus, str]] = ..., thermal_warning: bool = ..., disk_warning: bool = ..., fubar_warning: bool = ..., current_poll_interval_ms: _Optional[int] = ...) -> None: ... + +class HardwareStatsRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... diff --git a/truffle/os/hardware_stats_pb2_grpc.py b/truffle/os/hardware_stats_pb2_grpc.py new file mode 100644 index 0000000..e5ba7dd --- /dev/null +++ b/truffle/os/hardware_stats_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/hardware_stats_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/installer_pb2.py b/truffle/os/installer_pb2.py new file mode 100644 index 0000000..82cf1b8 --- /dev/null +++ b/truffle/os/installer_pb2.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/installer.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/installer.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.app import foreground_pb2 as truffle_dot_app_dot_foreground__pb2 +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 +from truffle.app import app_type_pb2 as truffle_dot_app_dot_app__type__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1atruffle/os/installer.proto\x12\ntruffle.os\x1a\x1ctruffle/app/foreground.proto\x1a\x1ctruffle/app/background.proto\x1a\x1atruffle/app/app_type.proto\"\x87\x01\n\x10\x41ppInstallSource\x12\x35\n\x0bsource_type\x18\x01 \x01(\x0e\x32 .truffle.os.AppInstallSourceType\x12\x10\n\x03url\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08git_hash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x06\n\x04_urlB\x0b\n\t_git_hash\"\xc3\x07\n\x0f\x41ppInstallModal\x12\x12\n\nstep_index\x18\x01 \x01(\x05\x12\x11\n\tstep_name\x18\x02 \x01(\t\x12\x41\n\rwelcome_modal\x18\n \x01(\x0b\x32(.truffle.os.AppInstallModal.WelcomeModalH\x00\x12H\n\x11text_fields_modal\x18\x0b \x01(\x0b\x32+.truffle.os.AppInstallModal.TextFieldsModalH\x00\x12\x39\n\tvnc_modal\x18\x0c \x01(\x0b\x32$.truffle.os.AppInstallModal.VNCModalH\x00\x12?\n\x0c\x66inish_modal\x18\x0e \x01(\x0b\x32\'.truffle.os.AppInstallModal.FinishModalH\x00\x12H\n\x11upload_file_modal\x18\x0f \x01(\x0b\x32+.truffle.os.AppInstallModal.UploadFileModalH\x00\x1a\'\n\x0cWelcomeModal\x12\x17\n\x0fwelcome_message\x18\x01 \x01(\t\x1a\xca\x02\n\x0fTextFieldsModal\x12\x14\n\x0cinstructions\x18\x01 \x01(\t\x12G\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x37.truffle.os.AppInstallModal.TextFieldsModal.FieldsEntry\x1ar\n\tTextField\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0bplaceholder\x18\x02 \x01(\t\x12\x13\n\x0bis_password\x18\x03 \x01(\x08\x12\x1a\n\rdefault_value\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x10\n\x0e_default_value\x1a\x64\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x44\n\x05value\x18\x02 \x01(\x0b\x32\x35.truffle.os.AppInstallModal.TextFieldsModal.TextField:\x02\x38\x01\x1aR\n\x08VNCModal\x12\x14\n\x0cinstructions\x18\x01 \x01(\t\x12\x14\n\x0cvnc_uri_path\x18\x02 \x01(\t\x12\x1a\n\x12\x63loses_on_complete\x18\x03 \x01(\x08\x1a*\n\x0fUploadFileModal\x12\x17\n\x0fupload_uri_path\x18\x01 \x01(\t\x1a\x37\n\x0b\x46inishModal\x12\x10\n\x08\x61pp_uuid\x18\x01 \x01(\t\x12\x16\n\x0e\x66inish_message\x18\x02 \x01(\tB\x07\n\x05modal\"(\n\x0f\x41ppInstallError\x12\x15\n\rerror_message\x18\x01 \x01(\t\",\n\x11\x41ppInstallLoading\x12\x17\n\x0floading_message\x18\x01 \x01(\t\"\xde\x01\n\x12\x41ppInstallMetadata\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12&\n\x08\x61pp_type\x18\x02 \x01(\x0e\x32\x14.truffle.app.AppType\x12\x42\n\x13\x66oreground_metadata\x18\x03 \x01(\x0b\x32#.truffle.app.ForegroundApp.MetadataH\x00\x12\x42\n\x13\x62\x61\x63kground_metadata\x18\x04 \x01(\x0b\x32#.truffle.app.BackgroundApp.MetadataH\x00\x42\n\n\x08metadata\"\xc1\x03\n\x14\x41ppInstallUserAction\x12;\n\x04next\x18\x01 \x01(\x0b\x32+.truffle.os.AppInstallUserAction.NextActionH\x00\x12N\n\x0btext_fields\x18\x02 \x01(\x0b\x32\x37.truffle.os.AppInstallUserAction.SubmitTextFieldsActionH\x00\x12=\n\x05\x61\x62ort\x18\x03 \x01(\x0b\x32,.truffle.os.AppInstallUserAction.AbortActionH\x00\x1a\x0c\n\nNextAction\x1a\xb5\x01\n\x16SubmitTextFieldsAction\x12\x64\n\x0f\x66ield_responses\x18\x01 \x03(\x0b\x32K.truffle.os.AppInstallUserAction.SubmitTextFieldsAction.FieldResponsesEntry\x1a\x35\n\x13\x46ieldResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\r\n\x0b\x41\x62ortActionB\x08\n\x06\x61\x63tion\"\xde\x01\n\x11\x41ppInstallRequest\x12\x42\n\tstart_new\x18\x01 \x01(\x0b\x32-.truffle.os.AppInstallRequest.StartNewInstallH\x00\x12\x37\n\x0buser_action\x18\x03 \x01(\x0b\x32 .truffle.os.AppInstallUserActionH\x00\x1a?\n\x0fStartNewInstall\x12,\n\x06source\x18\x01 \x01(\x0b\x32\x1c.truffle.os.AppInstallSourceB\x0b\n\toperation\"\x83\x02\n\x12\x41ppInstallResponse\x12\x34\n\rinstall_modal\x18\x01 \x01(\x0b\x32\x1b.truffle.os.AppInstallModalH\x00\x12\x34\n\rinstall_error\x18\x02 \x01(\x0b\x32\x1b.truffle.os.AppInstallErrorH\x00\x12\x38\n\x0finstall_loading\x18\x03 \x01(\x0b\x32\x1d.truffle.os.AppInstallLoadingH\x00\x12:\n\x10install_metadata\x18\x04 \x01(\x0b\x32\x1e.truffle.os.AppInstallMetadataH\x00\x42\x0b\n\toperation*\xa3\x01\n\x14\x41ppInstallSourceType\x12\'\n#APP_INSTALL_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x41PP_INSTALL_SOURCE_TYPE_URL\x10\x01\x12 \n\x1c\x41PP_INSTALL_SOURCE_TYPE_FILE\x10\x02\x12\x1f\n\x1b\x41PP_INSTALL_SOURCE_TYPE_GIT\x10\x03\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.installer_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL_FIELDSENTRY']._loaded_options = None + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL_FIELDSENTRY']._serialized_options = b'8\001' + _globals['_APPINSTALLUSERACTION_SUBMITTEXTFIELDSACTION_FIELDRESPONSESENTRY']._loaded_options = None + _globals['_APPINSTALLUSERACTION_SUBMITTEXTFIELDSACTION_FIELDRESPONSESENTRY']._serialized_options = b'8\001' + _globals['_APPINSTALLSOURCETYPE']._serialized_start=2487 + _globals['_APPINSTALLSOURCETYPE']._serialized_end=2650 + _globals['_APPINSTALLSOURCE']._serialized_start=131 + _globals['_APPINSTALLSOURCE']._serialized_end=266 + _globals['_APPINSTALLMODAL']._serialized_start=269 + _globals['_APPINSTALLMODAL']._serialized_end=1232 + _globals['_APPINSTALLMODAL_WELCOMEMODAL']._serialized_start=666 + _globals['_APPINSTALLMODAL_WELCOMEMODAL']._serialized_end=705 + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL']._serialized_start=708 + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL']._serialized_end=1038 + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL_TEXTFIELD']._serialized_start=822 + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL_TEXTFIELD']._serialized_end=936 + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL_FIELDSENTRY']._serialized_start=938 + _globals['_APPINSTALLMODAL_TEXTFIELDSMODAL_FIELDSENTRY']._serialized_end=1038 + _globals['_APPINSTALLMODAL_VNCMODAL']._serialized_start=1040 + _globals['_APPINSTALLMODAL_VNCMODAL']._serialized_end=1122 + _globals['_APPINSTALLMODAL_UPLOADFILEMODAL']._serialized_start=1124 + _globals['_APPINSTALLMODAL_UPLOADFILEMODAL']._serialized_end=1166 + _globals['_APPINSTALLMODAL_FINISHMODAL']._serialized_start=1168 + _globals['_APPINSTALLMODAL_FINISHMODAL']._serialized_end=1223 + _globals['_APPINSTALLERROR']._serialized_start=1234 + _globals['_APPINSTALLERROR']._serialized_end=1274 + _globals['_APPINSTALLLOADING']._serialized_start=1276 + _globals['_APPINSTALLLOADING']._serialized_end=1320 + _globals['_APPINSTALLMETADATA']._serialized_start=1323 + _globals['_APPINSTALLMETADATA']._serialized_end=1545 + _globals['_APPINSTALLUSERACTION']._serialized_start=1548 + _globals['_APPINSTALLUSERACTION']._serialized_end=1997 + _globals['_APPINSTALLUSERACTION_NEXTACTION']._serialized_start=1776 + _globals['_APPINSTALLUSERACTION_NEXTACTION']._serialized_end=1788 + _globals['_APPINSTALLUSERACTION_SUBMITTEXTFIELDSACTION']._serialized_start=1791 + _globals['_APPINSTALLUSERACTION_SUBMITTEXTFIELDSACTION']._serialized_end=1972 + _globals['_APPINSTALLUSERACTION_SUBMITTEXTFIELDSACTION_FIELDRESPONSESENTRY']._serialized_start=1919 + _globals['_APPINSTALLUSERACTION_SUBMITTEXTFIELDSACTION_FIELDRESPONSESENTRY']._serialized_end=1972 + _globals['_APPINSTALLUSERACTION_ABORTACTION']._serialized_start=1974 + _globals['_APPINSTALLUSERACTION_ABORTACTION']._serialized_end=1987 + _globals['_APPINSTALLREQUEST']._serialized_start=2000 + _globals['_APPINSTALLREQUEST']._serialized_end=2222 + _globals['_APPINSTALLREQUEST_STARTNEWINSTALL']._serialized_start=2146 + _globals['_APPINSTALLREQUEST_STARTNEWINSTALL']._serialized_end=2209 + _globals['_APPINSTALLRESPONSE']._serialized_start=2225 + _globals['_APPINSTALLRESPONSE']._serialized_end=2484 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/installer_pb2.pyi b/truffle/os/installer_pb2.pyi new file mode 100644 index 0000000..78b5080 --- /dev/null +++ b/truffle/os/installer_pb2.pyi @@ -0,0 +1,178 @@ +from truffle.app import foreground_pb2 as _foreground_pb2 +from truffle.app import background_pb2 as _background_pb2 +from truffle.app import app_type_pb2 as _app_type_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class AppInstallSourceType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + APP_INSTALL_SOURCE_TYPE_UNSPECIFIED: _ClassVar[AppInstallSourceType] + APP_INSTALL_SOURCE_TYPE_URL: _ClassVar[AppInstallSourceType] + APP_INSTALL_SOURCE_TYPE_FILE: _ClassVar[AppInstallSourceType] + APP_INSTALL_SOURCE_TYPE_GIT: _ClassVar[AppInstallSourceType] +APP_INSTALL_SOURCE_TYPE_UNSPECIFIED: AppInstallSourceType +APP_INSTALL_SOURCE_TYPE_URL: AppInstallSourceType +APP_INSTALL_SOURCE_TYPE_FILE: AppInstallSourceType +APP_INSTALL_SOURCE_TYPE_GIT: AppInstallSourceType + +class AppInstallSource(_message.Message): + __slots__ = ("source_type", "url", "git_hash") + SOURCE_TYPE_FIELD_NUMBER: _ClassVar[int] + URL_FIELD_NUMBER: _ClassVar[int] + GIT_HASH_FIELD_NUMBER: _ClassVar[int] + source_type: AppInstallSourceType + url: str + git_hash: str + def __init__(self, source_type: _Optional[_Union[AppInstallSourceType, str]] = ..., url: _Optional[str] = ..., git_hash: _Optional[str] = ...) -> None: ... + +class AppInstallModal(_message.Message): + __slots__ = ("step_index", "step_name", "welcome_modal", "text_fields_modal", "vnc_modal", "finish_modal", "upload_file_modal") + class WelcomeModal(_message.Message): + __slots__ = ("welcome_message",) + WELCOME_MESSAGE_FIELD_NUMBER: _ClassVar[int] + welcome_message: str + def __init__(self, welcome_message: _Optional[str] = ...) -> None: ... + class TextFieldsModal(_message.Message): + __slots__ = ("instructions", "fields") + class TextField(_message.Message): + __slots__ = ("label", "placeholder", "is_password", "default_value") + LABEL_FIELD_NUMBER: _ClassVar[int] + PLACEHOLDER_FIELD_NUMBER: _ClassVar[int] + IS_PASSWORD_FIELD_NUMBER: _ClassVar[int] + DEFAULT_VALUE_FIELD_NUMBER: _ClassVar[int] + label: str + placeholder: str + is_password: bool + default_value: str + def __init__(self, label: _Optional[str] = ..., placeholder: _Optional[str] = ..., is_password: bool = ..., default_value: _Optional[str] = ...) -> None: ... + class FieldsEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: AppInstallModal.TextFieldsModal.TextField + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[AppInstallModal.TextFieldsModal.TextField, _Mapping]] = ...) -> None: ... + INSTRUCTIONS_FIELD_NUMBER: _ClassVar[int] + FIELDS_FIELD_NUMBER: _ClassVar[int] + instructions: str + fields: _containers.MessageMap[str, AppInstallModal.TextFieldsModal.TextField] + def __init__(self, instructions: _Optional[str] = ..., fields: _Optional[_Mapping[str, AppInstallModal.TextFieldsModal.TextField]] = ...) -> None: ... + class VNCModal(_message.Message): + __slots__ = ("instructions", "vnc_uri_path", "closes_on_complete") + INSTRUCTIONS_FIELD_NUMBER: _ClassVar[int] + VNC_URI_PATH_FIELD_NUMBER: _ClassVar[int] + CLOSES_ON_COMPLETE_FIELD_NUMBER: _ClassVar[int] + instructions: str + vnc_uri_path: str + closes_on_complete: bool + def __init__(self, instructions: _Optional[str] = ..., vnc_uri_path: _Optional[str] = ..., closes_on_complete: bool = ...) -> None: ... + class UploadFileModal(_message.Message): + __slots__ = ("upload_uri_path",) + UPLOAD_URI_PATH_FIELD_NUMBER: _ClassVar[int] + upload_uri_path: str + def __init__(self, upload_uri_path: _Optional[str] = ...) -> None: ... + class FinishModal(_message.Message): + __slots__ = ("app_uuid", "finish_message") + APP_UUID_FIELD_NUMBER: _ClassVar[int] + FINISH_MESSAGE_FIELD_NUMBER: _ClassVar[int] + app_uuid: str + finish_message: str + def __init__(self, app_uuid: _Optional[str] = ..., finish_message: _Optional[str] = ...) -> None: ... + STEP_INDEX_FIELD_NUMBER: _ClassVar[int] + STEP_NAME_FIELD_NUMBER: _ClassVar[int] + WELCOME_MODAL_FIELD_NUMBER: _ClassVar[int] + TEXT_FIELDS_MODAL_FIELD_NUMBER: _ClassVar[int] + VNC_MODAL_FIELD_NUMBER: _ClassVar[int] + FINISH_MODAL_FIELD_NUMBER: _ClassVar[int] + UPLOAD_FILE_MODAL_FIELD_NUMBER: _ClassVar[int] + step_index: int + step_name: str + welcome_modal: AppInstallModal.WelcomeModal + text_fields_modal: AppInstallModal.TextFieldsModal + vnc_modal: AppInstallModal.VNCModal + finish_modal: AppInstallModal.FinishModal + upload_file_modal: AppInstallModal.UploadFileModal + def __init__(self, step_index: _Optional[int] = ..., step_name: _Optional[str] = ..., welcome_modal: _Optional[_Union[AppInstallModal.WelcomeModal, _Mapping]] = ..., text_fields_modal: _Optional[_Union[AppInstallModal.TextFieldsModal, _Mapping]] = ..., vnc_modal: _Optional[_Union[AppInstallModal.VNCModal, _Mapping]] = ..., finish_modal: _Optional[_Union[AppInstallModal.FinishModal, _Mapping]] = ..., upload_file_modal: _Optional[_Union[AppInstallModal.UploadFileModal, _Mapping]] = ...) -> None: ... + +class AppInstallError(_message.Message): + __slots__ = ("error_message",) + ERROR_MESSAGE_FIELD_NUMBER: _ClassVar[int] + error_message: str + def __init__(self, error_message: _Optional[str] = ...) -> None: ... + +class AppInstallLoading(_message.Message): + __slots__ = ("loading_message",) + LOADING_MESSAGE_FIELD_NUMBER: _ClassVar[int] + loading_message: str + def __init__(self, loading_message: _Optional[str] = ...) -> None: ... + +class AppInstallMetadata(_message.Message): + __slots__ = ("uuid", "app_type", "foreground_metadata", "background_metadata") + UUID_FIELD_NUMBER: _ClassVar[int] + APP_TYPE_FIELD_NUMBER: _ClassVar[int] + FOREGROUND_METADATA_FIELD_NUMBER: _ClassVar[int] + BACKGROUND_METADATA_FIELD_NUMBER: _ClassVar[int] + uuid: str + app_type: _app_type_pb2.AppType + foreground_metadata: _foreground_pb2.ForegroundApp.Metadata + background_metadata: _background_pb2.BackgroundApp.Metadata + def __init__(self, uuid: _Optional[str] = ..., app_type: _Optional[_Union[_app_type_pb2.AppType, str]] = ..., foreground_metadata: _Optional[_Union[_foreground_pb2.ForegroundApp.Metadata, _Mapping]] = ..., background_metadata: _Optional[_Union[_background_pb2.BackgroundApp.Metadata, _Mapping]] = ...) -> None: ... + +class AppInstallUserAction(_message.Message): + __slots__ = ("next", "text_fields", "abort") + class NextAction(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + class SubmitTextFieldsAction(_message.Message): + __slots__ = ("field_responses",) + class FieldResponsesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + FIELD_RESPONSES_FIELD_NUMBER: _ClassVar[int] + field_responses: _containers.ScalarMap[str, str] + def __init__(self, field_responses: _Optional[_Mapping[str, str]] = ...) -> None: ... + class AbortAction(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + NEXT_FIELD_NUMBER: _ClassVar[int] + TEXT_FIELDS_FIELD_NUMBER: _ClassVar[int] + ABORT_FIELD_NUMBER: _ClassVar[int] + next: AppInstallUserAction.NextAction + text_fields: AppInstallUserAction.SubmitTextFieldsAction + abort: AppInstallUserAction.AbortAction + def __init__(self, next: _Optional[_Union[AppInstallUserAction.NextAction, _Mapping]] = ..., text_fields: _Optional[_Union[AppInstallUserAction.SubmitTextFieldsAction, _Mapping]] = ..., abort: _Optional[_Union[AppInstallUserAction.AbortAction, _Mapping]] = ...) -> None: ... + +class AppInstallRequest(_message.Message): + __slots__ = ("start_new", "user_action") + class StartNewInstall(_message.Message): + __slots__ = ("source",) + SOURCE_FIELD_NUMBER: _ClassVar[int] + source: AppInstallSource + def __init__(self, source: _Optional[_Union[AppInstallSource, _Mapping]] = ...) -> None: ... + START_NEW_FIELD_NUMBER: _ClassVar[int] + USER_ACTION_FIELD_NUMBER: _ClassVar[int] + start_new: AppInstallRequest.StartNewInstall + user_action: AppInstallUserAction + def __init__(self, start_new: _Optional[_Union[AppInstallRequest.StartNewInstall, _Mapping]] = ..., user_action: _Optional[_Union[AppInstallUserAction, _Mapping]] = ...) -> None: ... + +class AppInstallResponse(_message.Message): + __slots__ = ("install_modal", "install_error", "install_loading", "install_metadata") + INSTALL_MODAL_FIELD_NUMBER: _ClassVar[int] + INSTALL_ERROR_FIELD_NUMBER: _ClassVar[int] + INSTALL_LOADING_FIELD_NUMBER: _ClassVar[int] + INSTALL_METADATA_FIELD_NUMBER: _ClassVar[int] + install_modal: AppInstallModal + install_error: AppInstallError + install_loading: AppInstallLoading + install_metadata: AppInstallMetadata + def __init__(self, install_modal: _Optional[_Union[AppInstallModal, _Mapping]] = ..., install_error: _Optional[_Union[AppInstallError, _Mapping]] = ..., install_loading: _Optional[_Union[AppInstallLoading, _Mapping]] = ..., install_metadata: _Optional[_Union[AppInstallMetadata, _Mapping]] = ...) -> None: ... diff --git a/truffle/os/installer_pb2_grpc.py b/truffle/os/installer_pb2_grpc.py new file mode 100644 index 0000000..c1eb7ce --- /dev/null +++ b/truffle/os/installer_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/installer_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/notification_pb2.py b/truffle/os/notification_pb2.py new file mode 100644 index 0000000..c66af35 --- /dev/null +++ b/truffle/os/notification_pb2.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/notification.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/notification.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from truffle.os import hardware_stats_pb2 as truffle_dot_os_dot_hardware__stats__pb2 +from truffle.os import client_session_pb2 as truffle_dot_os_dot_client__session__pb2 +from truffle.app import background_pb2 as truffle_dot_app_dot_background__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/os/notification.proto\x12\ntruffle.os\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1ftruffle/os/hardware_stats.proto\x1a\x1ftruffle/os/client_session.proto\x1a\x1ctruffle/app/background.proto\"!\n\x1fSubscribeToNotificationsRequest\"\xa6\x05\n\x0cNotification\x12\x37\n\x04type\x18\x01 \x01(\x0e\x32).truffle.os.Notification.NotificationType\x12\x15\n\rassociated_id\x18\x02 \x01(\t\x12&\n\x04none\x18\x03 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x12*\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x46\n\x18new_session_verification\x18\x07 \x01(\x0b\x32\".truffle.os.NewSessionVerificationH\x00\x12M\n\x1b\x62\x61\x63kground_app_notification\x18\n \x01(\x0b\x32&.truffle.app.BackgroundAppNotificationH\x00\x12\x10\n\x08is_error\x18\x08 \x01(\x08\"\xc0\x02\n\x10NotificationType\x12\x1d\n\x19NOTIFICATION_TYPE_INVALID\x10\x00\x12\x12\n\x0e\x42G_FEED_UPDATE\x10\x01\x12\x13\n\x0fTASK_HAS_RESULT\x10\x02\x12\x1e\n\x1a\x42G_FEED_FEEDBACK_PROCESSED\x10\x03\x12\x15\n\x11\x42G_APP_LIST_DIRTY\x10\x0e\x12\x15\n\x11\x46G_APP_LIST_DIRTY\x10\x0f\x12\x13\n\x0fTASK_LIST_DIRTY\x10\x10\x12\x11\n\rSESSION_READY\x10\x14\x12 \n\x1cSESSION_VERIFICATION_REQUEST\x10\x15\x12\x11\n\rSESSION_ADDED\x10\x16\x12\x12\n\x0eSESSION_DENIED\x10\x17\x12\x12\n\x0eSERVER_CLOSING\x10\x1f\x12\x11\n\rDISPLAY_TOAST\x10 B\x06\n\x04\x64\x61tab\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.notification_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_SUBSCRIBETONOTIFICATIONSREQUEST']._serialized_start=200 + _globals['_SUBSCRIBETONOTIFICATIONSREQUEST']._serialized_end=233 + _globals['_NOTIFICATION']._serialized_start=236 + _globals['_NOTIFICATION']._serialized_end=914 + _globals['_NOTIFICATION_NOTIFICATIONTYPE']._serialized_start=586 + _globals['_NOTIFICATION_NOTIFICATIONTYPE']._serialized_end=906 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/notification_pb2.pyi b/truffle/os/notification_pb2.pyi new file mode 100644 index 0000000..1a521b0 --- /dev/null +++ b/truffle/os/notification_pb2.pyi @@ -0,0 +1,62 @@ +from google.protobuf import struct_pb2 as _struct_pb2 +from google.protobuf import empty_pb2 as _empty_pb2 +from truffle.os import hardware_stats_pb2 as _hardware_stats_pb2 +from truffle.os import client_session_pb2 as _client_session_pb2 +from truffle.app import background_pb2 as _background_pb2 +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class SubscribeToNotificationsRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class Notification(_message.Message): + __slots__ = ("type", "associated_id", "none", "payload", "new_session_verification", "background_app_notification", "is_error") + class NotificationType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + NOTIFICATION_TYPE_INVALID: _ClassVar[Notification.NotificationType] + BG_FEED_UPDATE: _ClassVar[Notification.NotificationType] + TASK_HAS_RESULT: _ClassVar[Notification.NotificationType] + BG_FEED_FEEDBACK_PROCESSED: _ClassVar[Notification.NotificationType] + BG_APP_LIST_DIRTY: _ClassVar[Notification.NotificationType] + FG_APP_LIST_DIRTY: _ClassVar[Notification.NotificationType] + TASK_LIST_DIRTY: _ClassVar[Notification.NotificationType] + SESSION_READY: _ClassVar[Notification.NotificationType] + SESSION_VERIFICATION_REQUEST: _ClassVar[Notification.NotificationType] + SESSION_ADDED: _ClassVar[Notification.NotificationType] + SESSION_DENIED: _ClassVar[Notification.NotificationType] + SERVER_CLOSING: _ClassVar[Notification.NotificationType] + DISPLAY_TOAST: _ClassVar[Notification.NotificationType] + NOTIFICATION_TYPE_INVALID: Notification.NotificationType + BG_FEED_UPDATE: Notification.NotificationType + TASK_HAS_RESULT: Notification.NotificationType + BG_FEED_FEEDBACK_PROCESSED: Notification.NotificationType + BG_APP_LIST_DIRTY: Notification.NotificationType + FG_APP_LIST_DIRTY: Notification.NotificationType + TASK_LIST_DIRTY: Notification.NotificationType + SESSION_READY: Notification.NotificationType + SESSION_VERIFICATION_REQUEST: Notification.NotificationType + SESSION_ADDED: Notification.NotificationType + SESSION_DENIED: Notification.NotificationType + SERVER_CLOSING: Notification.NotificationType + DISPLAY_TOAST: Notification.NotificationType + TYPE_FIELD_NUMBER: _ClassVar[int] + ASSOCIATED_ID_FIELD_NUMBER: _ClassVar[int] + NONE_FIELD_NUMBER: _ClassVar[int] + PAYLOAD_FIELD_NUMBER: _ClassVar[int] + NEW_SESSION_VERIFICATION_FIELD_NUMBER: _ClassVar[int] + BACKGROUND_APP_NOTIFICATION_FIELD_NUMBER: _ClassVar[int] + IS_ERROR_FIELD_NUMBER: _ClassVar[int] + type: Notification.NotificationType + associated_id: str + none: _empty_pb2.Empty + payload: _struct_pb2.Struct + new_session_verification: _client_session_pb2.NewSessionVerification + background_app_notification: _background_pb2.BackgroundAppNotification + is_error: bool + def __init__(self, type: _Optional[_Union[Notification.NotificationType, str]] = ..., associated_id: _Optional[str] = ..., none: _Optional[_Union[_empty_pb2.Empty, _Mapping]] = ..., payload: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., new_session_verification: _Optional[_Union[_client_session_pb2.NewSessionVerification, _Mapping]] = ..., background_app_notification: _Optional[_Union[_background_pb2.BackgroundAppNotification, _Mapping]] = ..., is_error: bool = ...) -> None: ... diff --git a/truffle/os/notification_pb2_grpc.py b/truffle/os/notification_pb2_grpc.py new file mode 100644 index 0000000..1b8bc2c --- /dev/null +++ b/truffle/os/notification_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/notification_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/system_info_pb2.py b/truffle/os/system_info_pb2.py new file mode 100644 index 0000000..2968f0c --- /dev/null +++ b/truffle/os/system_info_pb2.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/system_info.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/system_info.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from truffle.os import hardware_info_pb2 as truffle_dot_os_dot_hardware__info__pb2 + +from truffle.os.hardware_info_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/os/system_info.proto\x12\ntruffle.os\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1etruffle/os/hardware_info.proto\"\"\n\x0f\x46irmwareVersion\x12\x0f\n\x07version\x18\x01 \x01(\t\"\x88\x02\n\nSystemInfo\x12\x37\n\x0bsystem_type\x18\x01 \x01(\x0e\x32\".truffle.os.SystemInfo.TruffleType\x12\x35\n\x10\x66irmware_version\x18\x02 \x01(\x0b\x32\x1b.truffle.os.FirmwareVersion\x12\x34\n\rhardware_info\x18\x05 \x01(\x0b\x32\x18.truffle.os.HardwareInfoH\x00\x88\x01\x01\"B\n\x0bTruffleType\x12\x18\n\x14TRUFFLE_TYPE_INVALID\x10\x00\x12\x19\n\x15TRUFFLE_TYPE_HARDWARE\x10\x01\x42\x10\n\x0e_hardware_info\"\x1d\n\x1bSystemCheckForUpdateRequest\"\x1e\n\x1cSystemCheckForUpdateResponse\"\x14\n\x12SystemGetIDRequest\"@\n\x13SystemGetIDResponse\x12\x12\n\ntruffle_id\x18\x01 \x01(\t\x12\x15\n\rserial_number\x18\x02 \x01(\tP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.system_info_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_FIRMWAREVERSION']._serialized_start=109 + _globals['_FIRMWAREVERSION']._serialized_end=143 + _globals['_SYSTEMINFO']._serialized_start=146 + _globals['_SYSTEMINFO']._serialized_end=410 + _globals['_SYSTEMINFO_TRUFFLETYPE']._serialized_start=326 + _globals['_SYSTEMINFO_TRUFFLETYPE']._serialized_end=392 + _globals['_SYSTEMCHECKFORUPDATEREQUEST']._serialized_start=412 + _globals['_SYSTEMCHECKFORUPDATEREQUEST']._serialized_end=441 + _globals['_SYSTEMCHECKFORUPDATERESPONSE']._serialized_start=443 + _globals['_SYSTEMCHECKFORUPDATERESPONSE']._serialized_end=473 + _globals['_SYSTEMGETIDREQUEST']._serialized_start=475 + _globals['_SYSTEMGETIDREQUEST']._serialized_end=495 + _globals['_SYSTEMGETIDRESPONSE']._serialized_start=497 + _globals['_SYSTEMGETIDRESPONSE']._serialized_end=561 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/system_info_pb2.pyi b/truffle/os/system_info_pb2.pyi new file mode 100644 index 0000000..c27de8b --- /dev/null +++ b/truffle/os/system_info_pb2.pyi @@ -0,0 +1,52 @@ +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from truffle.os import hardware_info_pb2 as _hardware_info_pb2 +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from truffle.os.hardware_info_pb2 import HardwareInfo as HardwareInfo + +DESCRIPTOR: _descriptor.FileDescriptor + +class FirmwareVersion(_message.Message): + __slots__ = ("version",) + VERSION_FIELD_NUMBER: _ClassVar[int] + version: str + def __init__(self, version: _Optional[str] = ...) -> None: ... + +class SystemInfo(_message.Message): + __slots__ = ("system_type", "firmware_version", "hardware_info") + class TruffleType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + TRUFFLE_TYPE_INVALID: _ClassVar[SystemInfo.TruffleType] + TRUFFLE_TYPE_HARDWARE: _ClassVar[SystemInfo.TruffleType] + TRUFFLE_TYPE_INVALID: SystemInfo.TruffleType + TRUFFLE_TYPE_HARDWARE: SystemInfo.TruffleType + SYSTEM_TYPE_FIELD_NUMBER: _ClassVar[int] + FIRMWARE_VERSION_FIELD_NUMBER: _ClassVar[int] + HARDWARE_INFO_FIELD_NUMBER: _ClassVar[int] + system_type: SystemInfo.TruffleType + firmware_version: FirmwareVersion + hardware_info: _hardware_info_pb2.HardwareInfo + def __init__(self, system_type: _Optional[_Union[SystemInfo.TruffleType, str]] = ..., firmware_version: _Optional[_Union[FirmwareVersion, _Mapping]] = ..., hardware_info: _Optional[_Union[_hardware_info_pb2.HardwareInfo, _Mapping]] = ...) -> None: ... + +class SystemCheckForUpdateRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class SystemCheckForUpdateResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class SystemGetIDRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class SystemGetIDResponse(_message.Message): + __slots__ = ("truffle_id", "serial_number") + TRUFFLE_ID_FIELD_NUMBER: _ClassVar[int] + SERIAL_NUMBER_FIELD_NUMBER: _ClassVar[int] + truffle_id: str + serial_number: str + def __init__(self, truffle_id: _Optional[str] = ..., serial_number: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/system_info_pb2_grpc.py b/truffle/os/system_info_pb2_grpc.py new file mode 100644 index 0000000..b4a31ff --- /dev/null +++ b/truffle/os/system_info_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/system_info_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/system_settings_pb2.py b/truffle/os/system_settings_pb2.py new file mode 100644 index 0000000..93de2d3 --- /dev/null +++ b/truffle/os/system_settings_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/system_settings.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/system_settings.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import hardware_settings_pb2 as truffle_dot_os_dot_hardware__settings__pb2 + +from truffle.os.hardware_settings_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n truffle/os/system_settings.proto\x12\ntruffle.os\x1a\"truffle/os/hardware_settings.proto\"\xac\x01\n\x0eSystemSettings\x12<\n\x11hardware_settings\x18\x01 \x01(\x0b\x32\x1c.truffle.os.HardwareSettingsH\x00\x88\x01\x01\x12\x34\n\rtask_settings\x18\x02 \x01(\x0b\x32\x18.truffle.os.TaskSettingsH\x01\x88\x01\x01\x42\x14\n\x12_hardware_settingsB\x10\n\x0e_task_settings\"0\n\x0cTaskSettings\x12\x1a\n\x12\x64\x65\x66\x61ult_model_uuid\x18\x02 \x01(\tJ\x04\x08\x01\x10\x02P\x00\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.system_settings_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_SYSTEMSETTINGS']._serialized_start=85 + _globals['_SYSTEMSETTINGS']._serialized_end=257 + _globals['_TASKSETTINGS']._serialized_start=259 + _globals['_TASKSETTINGS']._serialized_end=307 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/system_settings_pb2.pyi b/truffle/os/system_settings_pb2.pyi new file mode 100644 index 0000000..16864f1 --- /dev/null +++ b/truffle/os/system_settings_pb2.pyi @@ -0,0 +1,22 @@ +from truffle.os import hardware_settings_pb2 as _hardware_settings_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from truffle.os.hardware_settings_pb2 import HardwareSettings as HardwareSettings + +DESCRIPTOR: _descriptor.FileDescriptor + +class SystemSettings(_message.Message): + __slots__ = ("hardware_settings", "task_settings") + HARDWARE_SETTINGS_FIELD_NUMBER: _ClassVar[int] + TASK_SETTINGS_FIELD_NUMBER: _ClassVar[int] + hardware_settings: _hardware_settings_pb2.HardwareSettings + task_settings: TaskSettings + def __init__(self, hardware_settings: _Optional[_Union[_hardware_settings_pb2.HardwareSettings, _Mapping]] = ..., task_settings: _Optional[_Union[TaskSettings, _Mapping]] = ...) -> None: ... + +class TaskSettings(_message.Message): + __slots__ = ("default_model_uuid",) + DEFAULT_MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + default_model_uuid: str + def __init__(self, default_model_uuid: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/system_settings_pb2_grpc.py b/truffle/os/system_settings_pb2_grpc.py new file mode 100644 index 0000000..b192150 --- /dev/null +++ b/truffle/os/system_settings_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/system_settings_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_actions_pb2.py b/truffle/os/task_actions_pb2.py new file mode 100644 index 0000000..6e57ed2 --- /dev/null +++ b/truffle/os/task_actions_pb2.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_actions.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_actions.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.common import file_pb2 as truffle_dot_common_dot_file__pb2 +from truffle.os import task_pb2 as truffle_dot_os_dot_task__pb2 +try: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__info__pb2 +except AttributeError: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_info_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__step__pb2 +except AttributeError: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_step_pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle.common.content_pb2 +from truffle.os import task_target_pb2 as truffle_dot_os_dot_task__target__pb2 +from truffle.os import task_options_pb2 as truffle_dot_os_dot_task__options__pb2 +from truffle.os import task_user_response_pb2 as truffle_dot_os_dot_task__user__response__pb2 +from truffle.common import tool_provider_pb2 as truffle_dot_common_dot_tool__provider__pb2 + +from truffle.os.task_pb2 import * +from truffle.os.task_target_pb2 import * +from truffle.os.task_options_pb2 import * +from truffle.os.task_user_response_pb2 import * +from truffle.common.tool_provider_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/os/task_actions.proto\x12\ntruffle.os\x1a\x19truffle/common/file.proto\x1a\x15truffle/os/task.proto\x1a\x1ctruffle/os/task_target.proto\x1a\x1dtruffle/os/task_options.proto\x1a#truffle/os/task_user_response.proto\x1a\"truffle/common/tool_provider.proto\">\n\x14InterruptTaskRequest\x12&\n\x06target\x18\x01 \x01(\x0b\x32\x16.truffle.os.TargetTask\"\x8d\x01\n\x07NewTask\x12-\n\x0cuser_message\x18\x01 \x01(\x0b\x32\x17.truffle.os.UserMessage\x12\x11\n\tapp_uuids\x18\x02 \x03(\t\x12@\n\x14\x66iles_to_be_uploaded\x18\x03 \x03(\x0b\x32\".truffle.common.AttachedFileIntent\"\xf7\x01\n\x0fOpenTaskRequest\x12/\n\rexisting_task\x18\x01 \x01(\x0b\x32\x16.truffle.os.TargetTaskH\x00\x12\'\n\x08new_task\x18\x02 \x01(\x0b\x32\x13.truffle.os.NewTaskH\x00\x12-\n\x07options\x18\x03 \x01(\x0b\x32\x17.truffle.os.TaskOptionsH\x01\x88\x01\x01\x12\x45\n\x17\x65xternal_tool_providers\x18\x04 \x03(\x0b\x32$.truffle.common.ExternalToolProviderB\x08\n\x06targetB\n\n\x08_options\"\x88\x01\n\x1bTaskSetAvailableAppsRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x11\n\tapp_uuids\x18\x02 \x03(\t\x12\x45\n\x17\x65xternal_tool_providers\x18\x03 \x03(\x0b\x32$.truffle.common.ExternalToolProvider\"\x1e\n\x1cTaskSetAvailableAppsResponse\"\x14\n\x12TaskActionResponse\"k\n#TaskTestExternalToolProviderRequest\x12\x44\n\x16\x65xternal_tool_provider\x18\x01 \x01(\x0b\x32$.truffle.common.ExternalToolProvider\"e\n$TaskTestExternalToolProviderResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x1a\n\rerror_message\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x10\n\x0e_error_messageP\x01P\x02P\x03P\x04P\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_actions_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_INTERRUPTTASKREQUEST']._serialized_start=229 + _globals['_INTERRUPTTASKREQUEST']._serialized_end=291 + _globals['_NEWTASK']._serialized_start=294 + _globals['_NEWTASK']._serialized_end=435 + _globals['_OPENTASKREQUEST']._serialized_start=438 + _globals['_OPENTASKREQUEST']._serialized_end=685 + _globals['_TASKSETAVAILABLEAPPSREQUEST']._serialized_start=688 + _globals['_TASKSETAVAILABLEAPPSREQUEST']._serialized_end=824 + _globals['_TASKSETAVAILABLEAPPSRESPONSE']._serialized_start=826 + _globals['_TASKSETAVAILABLEAPPSRESPONSE']._serialized_end=856 + _globals['_TASKACTIONRESPONSE']._serialized_start=858 + _globals['_TASKACTIONRESPONSE']._serialized_end=878 + _globals['_TASKTESTEXTERNALTOOLPROVIDERREQUEST']._serialized_start=880 + _globals['_TASKTESTEXTERNALTOOLPROVIDERREQUEST']._serialized_end=987 + _globals['_TASKTESTEXTERNALTOOLPROVIDERRESPONSE']._serialized_start=989 + _globals['_TASKTESTEXTERNALTOOLPROVIDERRESPONSE']._serialized_end=1090 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_actions_pb2.pyi b/truffle/os/task_actions_pb2.pyi new file mode 100644 index 0000000..11ff9e6 --- /dev/null +++ b/truffle/os/task_actions_pb2.pyi @@ -0,0 +1,87 @@ +from truffle.common import file_pb2 as _file_pb2 +from truffle.os import task_pb2 as _task_pb2 +from truffle.os import task_info_pb2 as _task_info_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2 +from truffle.os import task_step_pb2 as _task_step_pb2 +from truffle.os import task_target_pb2 as _task_target_pb2 +from truffle.os import task_options_pb2 as _task_options_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2_1 +from truffle.common import tool_provider_pb2 as _tool_provider_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from truffle.os.task_pb2 import Task as Task +from truffle.os.task_pb2 import TasksList as TasksList +from truffle.os.task_pb2 import TaskNode as TaskNode +from truffle.os.task_pb2 import TaskStreamUpdate as TaskStreamUpdate +from truffle.os.task_target_pb2 import TargetTask as TargetTask +from truffle.os.task_options_pb2 import TaskOptions as TaskOptions +from truffle.os.task_user_response_pb2 import UserMessage as UserMessage +from truffle.os.task_user_response_pb2 import PendingUserResponse as PendingUserResponse +from truffle.os.task_user_response_pb2 import RespondToTaskRequest as RespondToTaskRequest +from truffle.common.tool_provider_pb2 import ExternalToolProvider as ExternalToolProvider +from truffle.common.tool_provider_pb2 import ExternalToolProvidersError as ExternalToolProvidersError + +DESCRIPTOR: _descriptor.FileDescriptor + +class InterruptTaskRequest(_message.Message): + __slots__ = ("target",) + TARGET_FIELD_NUMBER: _ClassVar[int] + target: _task_target_pb2.TargetTask + def __init__(self, target: _Optional[_Union[_task_target_pb2.TargetTask, _Mapping]] = ...) -> None: ... + +class NewTask(_message.Message): + __slots__ = ("user_message", "app_uuids", "files_to_be_uploaded") + USER_MESSAGE_FIELD_NUMBER: _ClassVar[int] + APP_UUIDS_FIELD_NUMBER: _ClassVar[int] + FILES_TO_BE_UPLOADED_FIELD_NUMBER: _ClassVar[int] + user_message: _task_user_response_pb2_1.UserMessage + app_uuids: _containers.RepeatedScalarFieldContainer[str] + files_to_be_uploaded: _containers.RepeatedCompositeFieldContainer[_file_pb2.AttachedFileIntent] + def __init__(self, user_message: _Optional[_Union[_task_user_response_pb2_1.UserMessage, _Mapping]] = ..., app_uuids: _Optional[_Iterable[str]] = ..., files_to_be_uploaded: _Optional[_Iterable[_Union[_file_pb2.AttachedFileIntent, _Mapping]]] = ...) -> None: ... + +class OpenTaskRequest(_message.Message): + __slots__ = ("existing_task", "new_task", "options", "external_tool_providers") + EXISTING_TASK_FIELD_NUMBER: _ClassVar[int] + NEW_TASK_FIELD_NUMBER: _ClassVar[int] + OPTIONS_FIELD_NUMBER: _ClassVar[int] + EXTERNAL_TOOL_PROVIDERS_FIELD_NUMBER: _ClassVar[int] + existing_task: _task_target_pb2.TargetTask + new_task: NewTask + options: _task_options_pb2.TaskOptions + external_tool_providers: _containers.RepeatedCompositeFieldContainer[_tool_provider_pb2.ExternalToolProvider] + def __init__(self, existing_task: _Optional[_Union[_task_target_pb2.TargetTask, _Mapping]] = ..., new_task: _Optional[_Union[NewTask, _Mapping]] = ..., options: _Optional[_Union[_task_options_pb2.TaskOptions, _Mapping]] = ..., external_tool_providers: _Optional[_Iterable[_Union[_tool_provider_pb2.ExternalToolProvider, _Mapping]]] = ...) -> None: ... + +class TaskSetAvailableAppsRequest(_message.Message): + __slots__ = ("task_id", "app_uuids", "external_tool_providers") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + APP_UUIDS_FIELD_NUMBER: _ClassVar[int] + EXTERNAL_TOOL_PROVIDERS_FIELD_NUMBER: _ClassVar[int] + task_id: str + app_uuids: _containers.RepeatedScalarFieldContainer[str] + external_tool_providers: _containers.RepeatedCompositeFieldContainer[_tool_provider_pb2.ExternalToolProvider] + def __init__(self, task_id: _Optional[str] = ..., app_uuids: _Optional[_Iterable[str]] = ..., external_tool_providers: _Optional[_Iterable[_Union[_tool_provider_pb2.ExternalToolProvider, _Mapping]]] = ...) -> None: ... + +class TaskSetAvailableAppsResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class TaskActionResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class TaskTestExternalToolProviderRequest(_message.Message): + __slots__ = ("external_tool_provider",) + EXTERNAL_TOOL_PROVIDER_FIELD_NUMBER: _ClassVar[int] + external_tool_provider: _tool_provider_pb2.ExternalToolProvider + def __init__(self, external_tool_provider: _Optional[_Union[_tool_provider_pb2.ExternalToolProvider, _Mapping]] = ...) -> None: ... + +class TaskTestExternalToolProviderResponse(_message.Message): + __slots__ = ("success", "error_message") + SUCCESS_FIELD_NUMBER: _ClassVar[int] + ERROR_MESSAGE_FIELD_NUMBER: _ClassVar[int] + success: bool + error_message: str + def __init__(self, success: bool = ..., error_message: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/task_actions_pb2_grpc.py b/truffle/os/task_actions_pb2_grpc.py new file mode 100644 index 0000000..1b4d731 --- /dev/null +++ b/truffle/os/task_actions_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_actions_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_error_pb2.py b/truffle/os/task_error_pb2.py new file mode 100644 index 0000000..a78d4c0 --- /dev/null +++ b/truffle/os/task_error_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_error.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_error.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.common import tool_provider_pb2 as truffle_dot_common_dot_tool__provider__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1btruffle/os/task_error.proto\x12\ntruffle.os\x1a\"truffle/common/tool_provider.proto\"\x87\x01\n\tTaskError\x12\x10\n\x08is_fatal\x18\x01 \x01(\x08\x12\x11\n\x07message\x18\x02 \x01(\tH\x00\x12L\n\x16\x65xternal_tool_provider\x18\x03 \x01(\x0b\x32*.truffle.common.ExternalToolProvidersErrorH\x00\x42\x07\n\x05\x65rrorb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_error_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TASKERROR']._serialized_start=80 + _globals['_TASKERROR']._serialized_end=215 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_error_pb2.pyi b/truffle/os/task_error_pb2.pyi new file mode 100644 index 0000000..f08099c --- /dev/null +++ b/truffle/os/task_error_pb2.pyi @@ -0,0 +1,17 @@ +from truffle.common import tool_provider_pb2 as _tool_provider_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class TaskError(_message.Message): + __slots__ = ("is_fatal", "message", "external_tool_provider") + IS_FATAL_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + EXTERNAL_TOOL_PROVIDER_FIELD_NUMBER: _ClassVar[int] + is_fatal: bool + message: str + external_tool_provider: _tool_provider_pb2.ExternalToolProvidersError + def __init__(self, is_fatal: bool = ..., message: _Optional[str] = ..., external_tool_provider: _Optional[_Union[_tool_provider_pb2.ExternalToolProvidersError, _Mapping]] = ...) -> None: ... diff --git a/truffle/os/task_error_pb2_grpc.py b/truffle/os/task_error_pb2_grpc.py new file mode 100644 index 0000000..7876bc4 --- /dev/null +++ b/truffle/os/task_error_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_error_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_info_pb2.py b/truffle/os/task_info_pb2.py new file mode 100644 index 0000000..0d6aa9b --- /dev/null +++ b/truffle/os/task_info_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_info.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_info.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from truffle.os import task_options_pb2 as truffle_dot_os_dot_task__options__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1atruffle/os/task_info.proto\x12\ntruffle.os\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1dtruffle/os/task_options.proto\"\xd7\x03\n\x08TaskInfo\x12\x34\n\trun_state\x18\x01 \x01(\x0e\x32!.truffle.os.TaskInfo.TaskRunState\x12\x11\n\tapp_uuids\x18\x02 \x03(\t\x12\x17\n\ntask_title\x18\x05 \x01(\tH\x00\x88\x01\x01\x12(\n\x07options\x18\x06 \x01(\x0b\x32\x17.truffle.os.TaskOptions\x12+\n\x07\x63reated\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0clast_updated\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\naccess_uri\x18\x08 \x01(\tH\x01\x88\x01\x01\"\xa8\x01\n\x0cTaskRunState\x12\x1a\n\x16TASK_RUN_STATE_INVALID\x10\x00\x12\x1f\n\x1bTASK_RUN_STATE_CREATING_NEW\x10\x01\x12!\n\x1dTASK_RUN_STATE_RELOADING_PREV\x10\x02\x12\x18\n\x14TASK_RUN_STATE_READY\x10\x03\x12\x1e\n\x1aTASK_RUN_STATE_FATAL_ERROR\x10\x05\x42\r\n\x0b_task_titleB\r\n\x0b_access_uri*X\n\tTaskFlags\x12\x13\n\x0fTASK_FLAGS_NONE\x10\x00\x12\x0f\n\x0bTASK_ACTIVE\x10\x01\x12\x13\n\x0fTASK_NO_RESPOND\x10\x02\x12\x10\n\x0cTASK_BLOCKED\x10\x04\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_info_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TASKFLAGS']._serialized_start=580 + _globals['_TASKFLAGS']._serialized_end=668 + _globals['_TASKINFO']._serialized_start=107 + _globals['_TASKINFO']._serialized_end=578 + _globals['_TASKINFO_TASKRUNSTATE']._serialized_start=380 + _globals['_TASKINFO_TASKRUNSTATE']._serialized_end=548 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_info_pb2.pyi b/truffle/os/task_info_pb2.pyi new file mode 100644 index 0000000..00f2f90 --- /dev/null +++ b/truffle/os/task_info_pb2.pyi @@ -0,0 +1,51 @@ +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from truffle.os import task_options_pb2 as _task_options_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class TaskFlags(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + TASK_FLAGS_NONE: _ClassVar[TaskFlags] + TASK_ACTIVE: _ClassVar[TaskFlags] + TASK_NO_RESPOND: _ClassVar[TaskFlags] + TASK_BLOCKED: _ClassVar[TaskFlags] +TASK_FLAGS_NONE: TaskFlags +TASK_ACTIVE: TaskFlags +TASK_NO_RESPOND: TaskFlags +TASK_BLOCKED: TaskFlags + +class TaskInfo(_message.Message): + __slots__ = ("run_state", "app_uuids", "task_title", "options", "created", "last_updated", "access_uri") + class TaskRunState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + TASK_RUN_STATE_INVALID: _ClassVar[TaskInfo.TaskRunState] + TASK_RUN_STATE_CREATING_NEW: _ClassVar[TaskInfo.TaskRunState] + TASK_RUN_STATE_RELOADING_PREV: _ClassVar[TaskInfo.TaskRunState] + TASK_RUN_STATE_READY: _ClassVar[TaskInfo.TaskRunState] + TASK_RUN_STATE_FATAL_ERROR: _ClassVar[TaskInfo.TaskRunState] + TASK_RUN_STATE_INVALID: TaskInfo.TaskRunState + TASK_RUN_STATE_CREATING_NEW: TaskInfo.TaskRunState + TASK_RUN_STATE_RELOADING_PREV: TaskInfo.TaskRunState + TASK_RUN_STATE_READY: TaskInfo.TaskRunState + TASK_RUN_STATE_FATAL_ERROR: TaskInfo.TaskRunState + RUN_STATE_FIELD_NUMBER: _ClassVar[int] + APP_UUIDS_FIELD_NUMBER: _ClassVar[int] + TASK_TITLE_FIELD_NUMBER: _ClassVar[int] + OPTIONS_FIELD_NUMBER: _ClassVar[int] + CREATED_FIELD_NUMBER: _ClassVar[int] + LAST_UPDATED_FIELD_NUMBER: _ClassVar[int] + ACCESS_URI_FIELD_NUMBER: _ClassVar[int] + run_state: TaskInfo.TaskRunState + app_uuids: _containers.RepeatedScalarFieldContainer[str] + task_title: str + options: _task_options_pb2.TaskOptions + created: _timestamp_pb2.Timestamp + last_updated: _timestamp_pb2.Timestamp + access_uri: str + def __init__(self, run_state: _Optional[_Union[TaskInfo.TaskRunState, str]] = ..., app_uuids: _Optional[_Iterable[str]] = ..., task_title: _Optional[str] = ..., options: _Optional[_Union[_task_options_pb2.TaskOptions, _Mapping]] = ..., created: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., last_updated: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., access_uri: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/task_info_pb2_grpc.py b/truffle/os/task_info_pb2_grpc.py new file mode 100644 index 0000000..b2a4954 --- /dev/null +++ b/truffle/os/task_info_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_info_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_options_pb2.py b/truffle/os/task_options_pb2.py new file mode 100644 index 0000000..f809068 --- /dev/null +++ b/truffle/os/task_options_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_options.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_options.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/os/task_options.proto\x12\ntruffle.os\x1a\x1egoogle/protobuf/duration.proto\"\r\n\x0bTaskOptionsb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_options_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TASKOPTIONS']._serialized_start=77 + _globals['_TASKOPTIONS']._serialized_end=90 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_options_pb2.pyi b/truffle/os/task_options_pb2.pyi new file mode 100644 index 0000000..765098f --- /dev/null +++ b/truffle/os/task_options_pb2.pyi @@ -0,0 +1,10 @@ +from google.protobuf import duration_pb2 as _duration_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar + +DESCRIPTOR: _descriptor.FileDescriptor + +class TaskOptions(_message.Message): + __slots__ = () + def __init__(self) -> None: ... diff --git a/truffle/os/task_options_pb2_grpc.py b/truffle/os/task_options_pb2_grpc.py new file mode 100644 index 0000000..11e3f5b --- /dev/null +++ b/truffle/os/task_options_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_options_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_pb2.py b/truffle/os/task_pb2.py new file mode 100644 index 0000000..b50c38c --- /dev/null +++ b/truffle/os/task_pb2.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from truffle.common import file_pb2 as truffle_dot_common_dot_file__pb2 +from truffle.os import task_info_pb2 as truffle_dot_os_dot_task__info__pb2 +from truffle.os import task_user_response_pb2 as truffle_dot_os_dot_task__user__response__pb2 +from truffle.os import task_step_pb2 as truffle_dot_os_dot_task__step__pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__step__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__step__pb2.truffle.common.content_pb2 +from truffle.os import task_error_pb2 as truffle_dot_os_dot_task__error__pb2 + +from truffle.os.task_info_pb2 import * +from truffle.os.task_user_response_pb2 import * +from truffle.os.task_step_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15truffle/os/task.proto\x12\ntruffle.os\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19truffle/common/file.proto\x1a\x1atruffle/os/task_info.proto\x1a#truffle/os/task_user_response.proto\x1a\x1atruffle/os/task_step.proto\x1a\x1btruffle/os/task_error.proto\"t\n\x04Task\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\"\n\x04info\x18\x02 \x01(\x0b\x32\x14.truffle.os.TaskInfo\x12\x12\n\ntask_flags\x18\x03 \x01(\r\x12#\n\x05nodes\x18\x05 \x03(\x0b\x32\x14.truffle.os.TaskNode\",\n\tTasksList\x12\x1f\n\x05tasks\x18\x01 \x03(\x0b\x32\x10.truffle.os.Task\"\xc0\x01\n\x08TaskNode\x12\n\n\x02id\x18\x01 \x01(\r\x12\x11\n\tparent_id\x18\x02 \x01(\r\x12\x11\n\tchild_ids\x18\x03 \x03(\r\x12+\n\x05\x66iles\x18\x08 \x03(\x0b\x32\x1c.truffle.common.AttachedFile\x12 \n\x04step\x18\t \x01(\x0b\x32\x10.truffle.os.StepH\x00\x12+\n\x08user_msg\x18\n \x01(\x0b\x32\x17.truffle.os.UserMessageH\x00\x42\x06\n\x04item\"\xaf\x01\n\x10TaskStreamUpdate\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\'\n\x04info\x18\x03 \x01(\x0b\x32\x14.truffle.os.TaskInfoH\x00\x88\x01\x01\x12#\n\x05nodes\x18\x02 \x03(\x0b\x32\x14.truffle.os.TaskNode\x12)\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x15.truffle.os.TaskErrorH\x01\x88\x01\x01\x42\x07\n\x05_infoB\x08\n\x06_errorP\x02P\x03P\x04\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TASK']._serialized_start=219 + _globals['_TASK']._serialized_end=335 + _globals['_TASKSLIST']._serialized_start=337 + _globals['_TASKSLIST']._serialized_end=381 + _globals['_TASKNODE']._serialized_start=384 + _globals['_TASKNODE']._serialized_end=576 + _globals['_TASKSTREAMUPDATE']._serialized_start=579 + _globals['_TASKSTREAMUPDATE']._serialized_end=754 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_pb2.pyi b/truffle/os/task_pb2.pyi new file mode 100644 index 0000000..2778deb --- /dev/null +++ b/truffle/os/task_pb2.pyi @@ -0,0 +1,70 @@ +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from truffle.common import file_pb2 as _file_pb2 +from truffle.os import task_info_pb2 as _task_info_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2 +from truffle.os import task_step_pb2 as _task_step_pb2 +from truffle.common import content_pb2 as _content_pb2 +from truffle.os import task_error_pb2 as _task_error_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from truffle.os.task_info_pb2 import TaskInfo as TaskInfo +from truffle.os.task_info_pb2 import TaskFlags as TaskFlags +from truffle.os.task_user_response_pb2 import UserMessage as UserMessage +from truffle.os.task_user_response_pb2 import PendingUserResponse as PendingUserResponse +from truffle.os.task_user_response_pb2 import RespondToTaskRequest as RespondToTaskRequest +from truffle.os.task_step_pb2 import Step as Step + +DESCRIPTOR: _descriptor.FileDescriptor +TASK_FLAGS_NONE: _task_info_pb2.TaskFlags +TASK_ACTIVE: _task_info_pb2.TaskFlags +TASK_NO_RESPOND: _task_info_pb2.TaskFlags +TASK_BLOCKED: _task_info_pb2.TaskFlags + +class Task(_message.Message): + __slots__ = ("task_id", "info", "task_flags", "nodes") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + INFO_FIELD_NUMBER: _ClassVar[int] + TASK_FLAGS_FIELD_NUMBER: _ClassVar[int] + NODES_FIELD_NUMBER: _ClassVar[int] + task_id: str + info: _task_info_pb2.TaskInfo + task_flags: int + nodes: _containers.RepeatedCompositeFieldContainer[TaskNode] + def __init__(self, task_id: _Optional[str] = ..., info: _Optional[_Union[_task_info_pb2.TaskInfo, _Mapping]] = ..., task_flags: _Optional[int] = ..., nodes: _Optional[_Iterable[_Union[TaskNode, _Mapping]]] = ...) -> None: ... + +class TasksList(_message.Message): + __slots__ = ("tasks",) + TASKS_FIELD_NUMBER: _ClassVar[int] + tasks: _containers.RepeatedCompositeFieldContainer[Task] + def __init__(self, tasks: _Optional[_Iterable[_Union[Task, _Mapping]]] = ...) -> None: ... + +class TaskNode(_message.Message): + __slots__ = ("id", "parent_id", "child_ids", "files", "step", "user_msg") + ID_FIELD_NUMBER: _ClassVar[int] + PARENT_ID_FIELD_NUMBER: _ClassVar[int] + CHILD_IDS_FIELD_NUMBER: _ClassVar[int] + FILES_FIELD_NUMBER: _ClassVar[int] + STEP_FIELD_NUMBER: _ClassVar[int] + USER_MSG_FIELD_NUMBER: _ClassVar[int] + id: int + parent_id: int + child_ids: _containers.RepeatedScalarFieldContainer[int] + files: _containers.RepeatedCompositeFieldContainer[_file_pb2.AttachedFile] + step: _task_step_pb2.Step + user_msg: _task_user_response_pb2.UserMessage + def __init__(self, id: _Optional[int] = ..., parent_id: _Optional[int] = ..., child_ids: _Optional[_Iterable[int]] = ..., files: _Optional[_Iterable[_Union[_file_pb2.AttachedFile, _Mapping]]] = ..., step: _Optional[_Union[_task_step_pb2.Step, _Mapping]] = ..., user_msg: _Optional[_Union[_task_user_response_pb2.UserMessage, _Mapping]] = ...) -> None: ... + +class TaskStreamUpdate(_message.Message): + __slots__ = ("task_id", "info", "nodes", "error") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + INFO_FIELD_NUMBER: _ClassVar[int] + NODES_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + task_id: str + info: _task_info_pb2.TaskInfo + nodes: _containers.RepeatedCompositeFieldContainer[TaskNode] + error: _task_error_pb2.TaskError + def __init__(self, task_id: _Optional[str] = ..., info: _Optional[_Union[_task_info_pb2.TaskInfo, _Mapping]] = ..., nodes: _Optional[_Iterable[_Union[TaskNode, _Mapping]]] = ..., error: _Optional[_Union[_task_error_pb2.TaskError, _Mapping]] = ...) -> None: ... diff --git a/truffle/os/task_pb2_grpc.py b/truffle/os/task_pb2_grpc.py new file mode 100644 index 0000000..563c6fb --- /dev/null +++ b/truffle/os/task_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_queries_pb2.py b/truffle/os/task_queries_pb2.py new file mode 100644 index 0000000..8c23762 --- /dev/null +++ b/truffle/os/task_queries_pb2.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_queries.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_queries.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import task_info_pb2 as truffle_dot_os_dot_task__info__pb2 +from truffle.os import task_pb2 as truffle_dot_os_dot_task__pb2 +try: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__info__pb2 +except AttributeError: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_info_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__step__pb2 +except AttributeError: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_step_pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle.common.content_pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtruffle/os/task_queries.proto\x12\ntruffle.os\x1a\x1atruffle/os/task_info.proto\x1a\x15truffle/os/task.proto\"7\n\x0fGetTasksRequest\x12\x10\n\x08task_ids\x18\x01 \x03(\t\x12\x12\n\nwith_nodes\x18\x03 \x01(\x08\"8\n\x11GetOneTaskRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x12\n\nwith_nodes\x18\x03 \x01(\x08\"T\n\x13GetTaskInfosRequest\x12\x16\n\x0etarget_task_id\x18\x01 \x01(\t\x12\x12\n\nmax_before\x18\x02 \x01(\x05\x12\x11\n\tmax_after\x18\x03 \x01(\x05\"\xee\x01\n\x14GetTaskInfosResponse\x12=\n\x07\x65ntries\x18\x01 \x03(\x0b\x32,.truffle.os.GetTaskInfosResponse.TaskPreview\x12\x17\n\x0ftotal_num_tasks\x18\x02 \x01(\r\x1a~\n\x0bTaskPreview\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\"\n\x04info\x18\x02 \x01(\x0b\x32\x14.truffle.os.TaskInfo\x12,\n\tlast_node\x18\x03 \x01(\x0b\x32\x14.truffle.os.TaskNodeH\x00\x88\x01\x01\x42\x0c\n\n_last_nodeb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_queries_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_GETTASKSREQUEST']._serialized_start=96 + _globals['_GETTASKSREQUEST']._serialized_end=151 + _globals['_GETONETASKREQUEST']._serialized_start=153 + _globals['_GETONETASKREQUEST']._serialized_end=209 + _globals['_GETTASKINFOSREQUEST']._serialized_start=211 + _globals['_GETTASKINFOSREQUEST']._serialized_end=295 + _globals['_GETTASKINFOSRESPONSE']._serialized_start=298 + _globals['_GETTASKINFOSRESPONSE']._serialized_end=536 + _globals['_GETTASKINFOSRESPONSE_TASKPREVIEW']._serialized_start=410 + _globals['_GETTASKINFOSRESPONSE_TASKPREVIEW']._serialized_end=536 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_queries_pb2.pyi b/truffle/os/task_queries_pb2.pyi new file mode 100644 index 0000000..5957d64 --- /dev/null +++ b/truffle/os/task_queries_pb2.pyi @@ -0,0 +1,55 @@ +from truffle.os import task_info_pb2 as _task_info_pb2 +from truffle.os import task_pb2 as _task_pb2 +from truffle.os import task_info_pb2 as _task_info_pb2_1 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2 +from truffle.os import task_step_pb2 as _task_step_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class GetTasksRequest(_message.Message): + __slots__ = ("task_ids", "with_nodes") + TASK_IDS_FIELD_NUMBER: _ClassVar[int] + WITH_NODES_FIELD_NUMBER: _ClassVar[int] + task_ids: _containers.RepeatedScalarFieldContainer[str] + with_nodes: bool + def __init__(self, task_ids: _Optional[_Iterable[str]] = ..., with_nodes: bool = ...) -> None: ... + +class GetOneTaskRequest(_message.Message): + __slots__ = ("task_id", "with_nodes") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + WITH_NODES_FIELD_NUMBER: _ClassVar[int] + task_id: str + with_nodes: bool + def __init__(self, task_id: _Optional[str] = ..., with_nodes: bool = ...) -> None: ... + +class GetTaskInfosRequest(_message.Message): + __slots__ = ("target_task_id", "max_before", "max_after") + TARGET_TASK_ID_FIELD_NUMBER: _ClassVar[int] + MAX_BEFORE_FIELD_NUMBER: _ClassVar[int] + MAX_AFTER_FIELD_NUMBER: _ClassVar[int] + target_task_id: str + max_before: int + max_after: int + def __init__(self, target_task_id: _Optional[str] = ..., max_before: _Optional[int] = ..., max_after: _Optional[int] = ...) -> None: ... + +class GetTaskInfosResponse(_message.Message): + __slots__ = ("entries", "total_num_tasks") + class TaskPreview(_message.Message): + __slots__ = ("task_id", "info", "last_node") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + INFO_FIELD_NUMBER: _ClassVar[int] + LAST_NODE_FIELD_NUMBER: _ClassVar[int] + task_id: str + info: _task_info_pb2_1.TaskInfo + last_node: _task_pb2.TaskNode + def __init__(self, task_id: _Optional[str] = ..., info: _Optional[_Union[_task_info_pb2_1.TaskInfo, _Mapping]] = ..., last_node: _Optional[_Union[_task_pb2.TaskNode, _Mapping]] = ...) -> None: ... + ENTRIES_FIELD_NUMBER: _ClassVar[int] + TOTAL_NUM_TASKS_FIELD_NUMBER: _ClassVar[int] + entries: _containers.RepeatedCompositeFieldContainer[GetTaskInfosResponse.TaskPreview] + total_num_tasks: int + def __init__(self, entries: _Optional[_Iterable[_Union[GetTaskInfosResponse.TaskPreview, _Mapping]]] = ..., total_num_tasks: _Optional[int] = ...) -> None: ... diff --git a/truffle/os/task_queries_pb2_grpc.py b/truffle/os/task_queries_pb2_grpc.py new file mode 100644 index 0000000..bd31e7f --- /dev/null +++ b/truffle/os/task_queries_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_queries_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_search_pb2.py b/truffle/os/task_search_pb2.py new file mode 100644 index 0000000..2fcf123 --- /dev/null +++ b/truffle/os/task_search_pb2.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_search.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_search.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from truffle.os import task_info_pb2 as truffle_dot_os_dot_task__info__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/os/task_search.proto\x12\ntruffle.os\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1atruffle/os/task_info.proto\"H\n\x12SearchTasksRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\x0e\n\x06offset\x18\x03 \x01(\x05\"\xe2\x01\n\x10TaskSearchResult\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\'\n\ttask_info\x18\x02 \x01(\x0b\x32\x14.truffle.os.TaskInfo\x12-\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12?\n\x07\x63ontent\x18\x04 \x01(\x0b\x32..truffle.os.TaskSearchResult.TaskSearchContent\x1a$\n\x11TaskSearchContent\x12\x0f\n\x07snippet\x18\x01 \x01(\t\"s\n\x13SearchTasksResponse\x12\x15\n\rtotal_results\x18\x01 \x01(\x05\x12\x16\n\x0e\x63urrent_offset\x18\x02 \x01(\x05\x12-\n\x07results\x18\x03 \x03(\x0b\x32\x1c.truffle.os.TaskSearchResultb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_search_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_SEARCHTASKSREQUEST']._serialized_start=105 + _globals['_SEARCHTASKSREQUEST']._serialized_end=177 + _globals['_TASKSEARCHRESULT']._serialized_start=180 + _globals['_TASKSEARCHRESULT']._serialized_end=406 + _globals['_TASKSEARCHRESULT_TASKSEARCHCONTENT']._serialized_start=370 + _globals['_TASKSEARCHRESULT_TASKSEARCHCONTENT']._serialized_end=406 + _globals['_SEARCHTASKSRESPONSE']._serialized_start=408 + _globals['_SEARCHTASKSRESPONSE']._serialized_end=523 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_search_pb2.pyi b/truffle/os/task_search_pb2.pyi new file mode 100644 index 0000000..789a436 --- /dev/null +++ b/truffle/os/task_search_pb2.pyi @@ -0,0 +1,46 @@ +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from truffle.os import task_info_pb2 as _task_info_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class SearchTasksRequest(_message.Message): + __slots__ = ("query", "max_results", "offset") + QUERY_FIELD_NUMBER: _ClassVar[int] + MAX_RESULTS_FIELD_NUMBER: _ClassVar[int] + OFFSET_FIELD_NUMBER: _ClassVar[int] + query: str + max_results: int + offset: int + def __init__(self, query: _Optional[str] = ..., max_results: _Optional[int] = ..., offset: _Optional[int] = ...) -> None: ... + +class TaskSearchResult(_message.Message): + __slots__ = ("task_id", "task_info", "timestamp", "content") + class TaskSearchContent(_message.Message): + __slots__ = ("snippet",) + SNIPPET_FIELD_NUMBER: _ClassVar[int] + snippet: str + def __init__(self, snippet: _Optional[str] = ...) -> None: ... + TASK_ID_FIELD_NUMBER: _ClassVar[int] + TASK_INFO_FIELD_NUMBER: _ClassVar[int] + TIMESTAMP_FIELD_NUMBER: _ClassVar[int] + CONTENT_FIELD_NUMBER: _ClassVar[int] + task_id: str + task_info: _task_info_pb2.TaskInfo + timestamp: _timestamp_pb2.Timestamp + content: TaskSearchResult.TaskSearchContent + def __init__(self, task_id: _Optional[str] = ..., task_info: _Optional[_Union[_task_info_pb2.TaskInfo, _Mapping]] = ..., timestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., content: _Optional[_Union[TaskSearchResult.TaskSearchContent, _Mapping]] = ...) -> None: ... + +class SearchTasksResponse(_message.Message): + __slots__ = ("total_results", "current_offset", "results") + TOTAL_RESULTS_FIELD_NUMBER: _ClassVar[int] + CURRENT_OFFSET_FIELD_NUMBER: _ClassVar[int] + RESULTS_FIELD_NUMBER: _ClassVar[int] + total_results: int + current_offset: int + results: _containers.RepeatedCompositeFieldContainer[TaskSearchResult] + def __init__(self, total_results: _Optional[int] = ..., current_offset: _Optional[int] = ..., results: _Optional[_Iterable[_Union[TaskSearchResult, _Mapping]]] = ...) -> None: ... diff --git a/truffle/os/task_search_pb2_grpc.py b/truffle/os/task_search_pb2_grpc.py new file mode 100644 index 0000000..022f753 --- /dev/null +++ b/truffle/os/task_search_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_search_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_step_pb2.py b/truffle/os/task_step_pb2.py new file mode 100644 index 0000000..3f55d2e --- /dev/null +++ b/truffle/os/task_step_pb2.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_step.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_step.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import task_user_response_pb2 as truffle_dot_os_dot_task__user__response__pb2 +from truffle.common import content_pb2 as truffle_dot_common_dot_content__pb2 +from truffle.infer import usage_pb2 as truffle_dot_infer_dot_usage__pb2 + +from truffle.common.content_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1atruffle/os/task_step.proto\x12\ntruffle.os\x1a#truffle/os/task_user_response.proto\x1a\x1ctruffle/common/content.proto\x1a\x19truffle/infer/usage.proto\"\x8d\x08\n\x04Step\x12.\n\x05state\x18\x01 \x01(\x0e\x32\x1a.truffle.os.Step.StepStateH\x00\x88\x01\x01\x12;\n\ruser_response\x18\n \x01(\x0b\x32\x1f.truffle.os.PendingUserResponseH\x01\x88\x01\x01\x12+\n\x08thinking\x18\x02 \x01(\x0b\x32\x19.truffle.os.Step.Thinking\x12-\n\ntool_calls\x18\x03 \x03(\x0b\x32\x19.truffle.os.Step.ToolCall\x12+\n\texecution\x18\x04 \x01(\x0b\x32\x18.truffle.os.Step.Execute\x12)\n\x07results\x18\x05 \x01(\x0b\x32\x18.truffle.os.Step.Results\x12)\n\x07metrics\x18\x06 \x01(\x0b\x32\x18.truffle.os.Step.Metrics\x12\x17\n\nmodel_uuid\x18\x07 \x01(\tH\x02\x88\x01\x01\x1a\x93\x01\n\x08Thinking\x12\x12\n\ncot_chunks\x18\x01 \x03(\t\x12\x15\n\rcot_summaries\x18\x02 \x03(\t\x12\x17\n\nraw_output\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x11thinking_finished\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\r\n\x0b_raw_outputB\x14\n\x12_thinking_finished\x1aR\n\x08ToolCall\x12\x16\n\ttool_name\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07summary\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x0c\n\n_tool_nameB\n\n\x08_summary\x1a\x1f\n\x07\x45xecute\x12\x14\n\x0ctool_updates\x18\x01 \x03(\t\x1a\xbd\x01\n\x07Results\x12\x14\n\x07summary\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12\x63ontent_incomplete\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12.\n\x03web\x18\x04 \x01(\x0b\x32\x1c.truffle.common.WebComponentH\x03\x88\x01\x01\x42\n\n\x08_summaryB\n\n\x08_contentB\x15\n\x13_content_incompleteB\x06\n\x04_web\x1aQ\n\x07Metrics\x12\x32\n\x0finference_usage\x18\x01 \x01(\x0b\x32\x14.truffle.infer.UsageH\x00\x88\x01\x01\x42\x12\n\x10_inference_usage\"W\n\tStepState\x12\x10\n\x0cSTEP_INVALID\x10\x00\x12\x13\n\x0fSTEP_GENERATING\x10\x01\x12\x12\n\x0eSTEP_EXECUTING\x10\x02\x12\x0f\n\x0bSTEP_RESULT\x10\x03\x42\x08\n\x06_stateB\x10\n\x0e_user_responseB\r\n\x0b_model_uuidP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_step_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_STEP']._serialized_start=137 + _globals['_STEP']._serialized_end=1174 + _globals['_STEP_THINKING']._serialized_start=503 + _globals['_STEP_THINKING']._serialized_end=650 + _globals['_STEP_TOOLCALL']._serialized_start=652 + _globals['_STEP_TOOLCALL']._serialized_end=734 + _globals['_STEP_EXECUTE']._serialized_start=736 + _globals['_STEP_EXECUTE']._serialized_end=767 + _globals['_STEP_RESULTS']._serialized_start=770 + _globals['_STEP_RESULTS']._serialized_end=959 + _globals['_STEP_METRICS']._serialized_start=961 + _globals['_STEP_METRICS']._serialized_end=1042 + _globals['_STEP_STEPSTATE']._serialized_start=1044 + _globals['_STEP_STEPSTATE']._serialized_end=1131 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_step_pb2.pyi b/truffle/os/task_step_pb2.pyi new file mode 100644 index 0000000..5b4164a --- /dev/null +++ b/truffle/os/task_step_pb2.pyi @@ -0,0 +1,82 @@ +from truffle.os import task_user_response_pb2 as _task_user_response_pb2 +from truffle.common import content_pb2 as _content_pb2 +from truffle.infer import usage_pb2 as _usage_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from truffle.common.content_pb2 import MediaSource as MediaSource +from truffle.common.content_pb2 import WebComponent as WebComponent + +DESCRIPTOR: _descriptor.FileDescriptor + +class Step(_message.Message): + __slots__ = ("state", "user_response", "thinking", "tool_calls", "execution", "results", "metrics", "model_uuid") + class StepState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + STEP_INVALID: _ClassVar[Step.StepState] + STEP_GENERATING: _ClassVar[Step.StepState] + STEP_EXECUTING: _ClassVar[Step.StepState] + STEP_RESULT: _ClassVar[Step.StepState] + STEP_INVALID: Step.StepState + STEP_GENERATING: Step.StepState + STEP_EXECUTING: Step.StepState + STEP_RESULT: Step.StepState + class Thinking(_message.Message): + __slots__ = ("cot_chunks", "cot_summaries", "raw_output", "thinking_finished") + COT_CHUNKS_FIELD_NUMBER: _ClassVar[int] + COT_SUMMARIES_FIELD_NUMBER: _ClassVar[int] + RAW_OUTPUT_FIELD_NUMBER: _ClassVar[int] + THINKING_FINISHED_FIELD_NUMBER: _ClassVar[int] + cot_chunks: _containers.RepeatedScalarFieldContainer[str] + cot_summaries: _containers.RepeatedScalarFieldContainer[str] + raw_output: str + thinking_finished: bool + def __init__(self, cot_chunks: _Optional[_Iterable[str]] = ..., cot_summaries: _Optional[_Iterable[str]] = ..., raw_output: _Optional[str] = ..., thinking_finished: bool = ...) -> None: ... + class ToolCall(_message.Message): + __slots__ = ("tool_name", "summary") + TOOL_NAME_FIELD_NUMBER: _ClassVar[int] + SUMMARY_FIELD_NUMBER: _ClassVar[int] + tool_name: str + summary: str + def __init__(self, tool_name: _Optional[str] = ..., summary: _Optional[str] = ...) -> None: ... + class Execute(_message.Message): + __slots__ = ("tool_updates",) + TOOL_UPDATES_FIELD_NUMBER: _ClassVar[int] + tool_updates: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, tool_updates: _Optional[_Iterable[str]] = ...) -> None: ... + class Results(_message.Message): + __slots__ = ("summary", "content", "content_incomplete", "web") + SUMMARY_FIELD_NUMBER: _ClassVar[int] + CONTENT_FIELD_NUMBER: _ClassVar[int] + CONTENT_INCOMPLETE_FIELD_NUMBER: _ClassVar[int] + WEB_FIELD_NUMBER: _ClassVar[int] + summary: str + content: str + content_incomplete: bool + web: _content_pb2.WebComponent + def __init__(self, summary: _Optional[str] = ..., content: _Optional[str] = ..., content_incomplete: bool = ..., web: _Optional[_Union[_content_pb2.WebComponent, _Mapping]] = ...) -> None: ... + class Metrics(_message.Message): + __slots__ = ("inference_usage",) + INFERENCE_USAGE_FIELD_NUMBER: _ClassVar[int] + inference_usage: _usage_pb2.Usage + def __init__(self, inference_usage: _Optional[_Union[_usage_pb2.Usage, _Mapping]] = ...) -> None: ... + STATE_FIELD_NUMBER: _ClassVar[int] + USER_RESPONSE_FIELD_NUMBER: _ClassVar[int] + THINKING_FIELD_NUMBER: _ClassVar[int] + TOOL_CALLS_FIELD_NUMBER: _ClassVar[int] + EXECUTION_FIELD_NUMBER: _ClassVar[int] + RESULTS_FIELD_NUMBER: _ClassVar[int] + METRICS_FIELD_NUMBER: _ClassVar[int] + MODEL_UUID_FIELD_NUMBER: _ClassVar[int] + state: Step.StepState + user_response: _task_user_response_pb2.PendingUserResponse + thinking: Step.Thinking + tool_calls: _containers.RepeatedCompositeFieldContainer[Step.ToolCall] + execution: Step.Execute + results: Step.Results + metrics: Step.Metrics + model_uuid: str + def __init__(self, state: _Optional[_Union[Step.StepState, str]] = ..., user_response: _Optional[_Union[_task_user_response_pb2.PendingUserResponse, _Mapping]] = ..., thinking: _Optional[_Union[Step.Thinking, _Mapping]] = ..., tool_calls: _Optional[_Iterable[_Union[Step.ToolCall, _Mapping]]] = ..., execution: _Optional[_Union[Step.Execute, _Mapping]] = ..., results: _Optional[_Union[Step.Results, _Mapping]] = ..., metrics: _Optional[_Union[Step.Metrics, _Mapping]] = ..., model_uuid: _Optional[str] = ...) -> None: ... diff --git a/truffle/os/task_step_pb2_grpc.py b/truffle/os/task_step_pb2_grpc.py new file mode 100644 index 0000000..1937b34 --- /dev/null +++ b/truffle/os/task_step_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_step_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_target_pb2.py b/truffle/os/task_target_pb2.py new file mode 100644 index 0000000..6596839 --- /dev/null +++ b/truffle/os/task_target_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_target.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_target.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ctruffle/os/task_target.proto\x12\ntruffle.os\"?\n\nTargetTask\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x14\n\x07node_id\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\n\n\x08_node_idb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_target_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TARGETTASK']._serialized_start=44 + _globals['_TARGETTASK']._serialized_end=107 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_target_pb2.pyi b/truffle/os/task_target_pb2.pyi new file mode 100644 index 0000000..ee8bd4d --- /dev/null +++ b/truffle/os/task_target_pb2.pyi @@ -0,0 +1,13 @@ +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional + +DESCRIPTOR: _descriptor.FileDescriptor + +class TargetTask(_message.Message): + __slots__ = ("task_id", "node_id") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + NODE_ID_FIELD_NUMBER: _ClassVar[int] + task_id: str + node_id: int + def __init__(self, task_id: _Optional[str] = ..., node_id: _Optional[int] = ...) -> None: ... diff --git a/truffle/os/task_target_pb2_grpc.py b/truffle/os/task_target_pb2_grpc.py new file mode 100644 index 0000000..400a908 --- /dev/null +++ b/truffle/os/task_target_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_target_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/task_user_response_pb2.py b/truffle/os/task_user_response_pb2.py new file mode 100644 index 0000000..181a0e5 --- /dev/null +++ b/truffle/os/task_user_response_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/task_user_response.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/task_user_response.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from truffle.os import task_target_pb2 as truffle_dot_os_dot_task__target__pb2 +from truffle.common import file_pb2 as truffle_dot_common_dot_file__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#truffle/os/task_user_response.proto\x12\ntruffle.os\x1a\x1ctruffle/os/task_target.proto\x1a\x19truffle/common/file.proto\"?\n\x0bUserMessage\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x1f\n\x17\x61ttached_feed_entry_ids\x18\x02 \x03(\x04\"7\n\x13PendingUserResponse\x12\x0f\n\x07task_id\x18\x02 \x01(\t\x12\x0f\n\x07node_id\x18\x03 \x01(\r\"\x8f\x01\n\x14RespondToTaskRequest\x12\x0f\n\x07task_id\x18\x02 \x01(\t\x12\x0f\n\x07node_id\x18\x03 \x01(\r\x12(\n\x07message\x18\x04 \x01(\x0b\x32\x17.truffle.os.UserMessage\x12+\n\x05\x66iles\x18\x05 \x03(\x0b\x32\x1c.truffle.common.AttachedFileb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.task_user_response_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_USERMESSAGE']._serialized_start=108 + _globals['_USERMESSAGE']._serialized_end=171 + _globals['_PENDINGUSERRESPONSE']._serialized_start=173 + _globals['_PENDINGUSERRESPONSE']._serialized_end=228 + _globals['_RESPONDTOTASKREQUEST']._serialized_start=231 + _globals['_RESPONDTOTASKREQUEST']._serialized_end=374 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/task_user_response_pb2.pyi b/truffle/os/task_user_response_pb2.pyi new file mode 100644 index 0000000..3dbe4eb --- /dev/null +++ b/truffle/os/task_user_response_pb2.pyi @@ -0,0 +1,37 @@ +from truffle.os import task_target_pb2 as _task_target_pb2 +from truffle.common import file_pb2 as _file_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class UserMessage(_message.Message): + __slots__ = ("content", "attached_feed_entry_ids") + CONTENT_FIELD_NUMBER: _ClassVar[int] + ATTACHED_FEED_ENTRY_IDS_FIELD_NUMBER: _ClassVar[int] + content: str + attached_feed_entry_ids: _containers.RepeatedScalarFieldContainer[int] + def __init__(self, content: _Optional[str] = ..., attached_feed_entry_ids: _Optional[_Iterable[int]] = ...) -> None: ... + +class PendingUserResponse(_message.Message): + __slots__ = ("task_id", "node_id") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + NODE_ID_FIELD_NUMBER: _ClassVar[int] + task_id: str + node_id: int + def __init__(self, task_id: _Optional[str] = ..., node_id: _Optional[int] = ...) -> None: ... + +class RespondToTaskRequest(_message.Message): + __slots__ = ("task_id", "node_id", "message", "files") + TASK_ID_FIELD_NUMBER: _ClassVar[int] + NODE_ID_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + FILES_FIELD_NUMBER: _ClassVar[int] + task_id: str + node_id: int + message: UserMessage + files: _containers.RepeatedCompositeFieldContainer[_file_pb2.AttachedFile] + def __init__(self, task_id: _Optional[str] = ..., node_id: _Optional[int] = ..., message: _Optional[_Union[UserMessage, _Mapping]] = ..., files: _Optional[_Iterable[_Union[_file_pb2.AttachedFile, _Mapping]]] = ...) -> None: ... diff --git a/truffle/os/task_user_response_pb2_grpc.py b/truffle/os/task_user_response_pb2_grpc.py new file mode 100644 index 0000000..f23ce5a --- /dev/null +++ b/truffle/os/task_user_response_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/task_user_response_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/truffle/os/truffleos_pb2.py b/truffle/os/truffleos_pb2.py new file mode 100644 index 0000000..936eea4 --- /dev/null +++ b/truffle/os/truffleos_pb2.py @@ -0,0 +1,201 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: truffle/os/truffleos.proto +# Protobuf Python Version: 6.30.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 30, + 0, + '', + 'truffle/os/truffleos.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from truffle.os import hardware_stats_pb2 as truffle_dot_os_dot_hardware__stats__pb2 +from truffle.os import hardware_control_pb2 as truffle_dot_os_dot_hardware__control__pb2 +from truffle.os import system_settings_pb2 as truffle_dot_os_dot_system__settings__pb2 +try: + truffle_dot_os_dot_hardware__settings__pb2 = truffle_dot_os_dot_system__settings__pb2.truffle_dot_os_dot_hardware__settings__pb2 +except AttributeError: + truffle_dot_os_dot_hardware__settings__pb2 = truffle_dot_os_dot_system__settings__pb2.truffle.os.hardware_settings_pb2 +from truffle.os import system_info_pb2 as truffle_dot_os_dot_system__info__pb2 +try: + truffle_dot_os_dot_hardware__info__pb2 = truffle_dot_os_dot_system__info__pb2.truffle_dot_os_dot_hardware__info__pb2 +except AttributeError: + truffle_dot_os_dot_hardware__info__pb2 = truffle_dot_os_dot_system__info__pb2.truffle.os.hardware_info_pb2 +from truffle.os import notification_pb2 as truffle_dot_os_dot_notification__pb2 +from truffle.os import client_session_pb2 as truffle_dot_os_dot_client__session__pb2 +from truffle.os import client_user_pb2 as truffle_dot_os_dot_client__user__pb2 +from truffle.os import client_state_pb2 as truffle_dot_os_dot_client__state__pb2 +from truffle.os import task_pb2 as truffle_dot_os_dot_task__pb2 +try: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__info__pb2 +except AttributeError: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_info_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_os_dot_task__step__pb2 +except AttributeError: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__pb2.truffle.os.task_step_pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__pb2.truffle.common.content_pb2 +from truffle.os import task_queries_pb2 as truffle_dot_os_dot_task__queries__pb2 +from truffle.os import task_actions_pb2 as truffle_dot_os_dot_task__actions__pb2 +try: + truffle_dot_os_dot_task__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__pb2 +except AttributeError: + truffle_dot_os_dot_task__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_pb2 +try: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__info__pb2 +except AttributeError: + truffle_dot_os_dot_task__info__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_info_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__step__pb2 +except AttributeError: + truffle_dot_os_dot_task__step__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_step_pb2 +try: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_common_dot_content__pb2 +except AttributeError: + truffle_dot_common_dot_content__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.common.content_pb2 +try: + truffle_dot_os_dot_task__target__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__target__pb2 +except AttributeError: + truffle_dot_os_dot_task__target__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_target_pb2 +try: + truffle_dot_os_dot_task__options__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__options__pb2 +except AttributeError: + truffle_dot_os_dot_task__options__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_options_pb2 +try: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_os_dot_task__user__response__pb2 +except AttributeError: + truffle_dot_os_dot_task__user__response__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.os.task_user_response_pb2 +try: + truffle_dot_common_dot_tool__provider__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle_dot_common_dot_tool__provider__pb2 +except AttributeError: + truffle_dot_common_dot_tool__provider__pb2 = truffle_dot_os_dot_task__actions__pb2.truffle.common.tool_provider_pb2 +from truffle.os import task_user_response_pb2 as truffle_dot_os_dot_task__user__response__pb2 +from truffle.os import task_search_pb2 as truffle_dot_os_dot_task__search__pb2 +from truffle.os import builder_pb2 as truffle_dot_os_dot_builder__pb2 +from truffle.os import background_feed_queries_pb2 as truffle_dot_os_dot_background__feed__queries__pb2 +from truffle.os import app_queries_pb2 as truffle_dot_os_dot_app__queries__pb2 +from truffle.os import installer_pb2 as truffle_dot_os_dot_installer__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + +from truffle.os.hardware_stats_pb2 import * +from truffle.os.hardware_control_pb2 import * +from truffle.os.system_settings_pb2 import * +from truffle.os.system_info_pb2 import * +from truffle.os.notification_pb2 import * +from truffle.os.client_session_pb2 import * +from truffle.os.client_user_pb2 import * +from truffle.os.client_state_pb2 import * +from truffle.os.task_pb2 import * +from truffle.os.task_queries_pb2 import * +from truffle.os.task_actions_pb2 import * +from truffle.os.task_user_response_pb2 import * +from truffle.os.task_search_pb2 import * +from truffle.os.builder_pb2 import * +from truffle.os.background_feed_queries_pb2 import * +from truffle.os.app_queries_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1atruffle/os/truffleos.proto\x12\ntruffle.os\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1ftruffle/os/hardware_stats.proto\x1a!truffle/os/hardware_control.proto\x1a truffle/os/system_settings.proto\x1a\x1ctruffle/os/system_info.proto\x1a\x1dtruffle/os/notification.proto\x1a\x1ftruffle/os/client_session.proto\x1a\x1ctruffle/os/client_user.proto\x1a\x1dtruffle/os/client_state.proto\x1a\x15truffle/os/task.proto\x1a\x1dtruffle/os/task_queries.proto\x1a\x1dtruffle/os/task_actions.proto\x1a#truffle/os/task_user_response.proto\x1a\x1ctruffle/os/task_search.proto\x1a\x18truffle/os/builder.proto\x1a(truffle/os/background_feed_queries.proto\x1a\x1ctruffle/os/app_queries.proto\x1a\x1atruffle/os/installer.proto\x1a\x1cgoogle/api/annotations.proto2\xc9$\n\tTruffleOS\x12m\n\x0e\x41pps_DeleteApp\x12\x1c.truffle.os.DeleteAppRequest\x1a\x1d.truffle.os.DeleteAppResponse\"\x1e\x82\xd3\xe4\x93\x02\x18*\x16/v1/os/apps/{app_uuid}\x12\x81\x01\n\x12\x41pps_GetBackground\x12$.truffle.os.GetBackgroundAppsRequest\x1a%.truffle.os.GetBackgroundAppsResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/os/apps/background\x12\x81\x01\n\x12\x41pps_GetForeground\x12$.truffle.os.GetForegroundAppsRequest\x1a%.truffle.os.GetForegroundAppsResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/os/apps/foreground\x12\x65\n\x0b\x41pps_GetAll\x12\x1d.truffle.os.GetAllAppsRequest\x1a\x1e.truffle.os.GetAllAppsResponse\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/os/apps/all\x12T\n\x0f\x41pps_InstallApp\x12\x1d.truffle.os.AppInstallRequest\x1a\x1e.truffle.os.AppInstallResponse(\x01\x30\x01\x12\x8d\x01\n\x12\x42\x61\x63kground_GetFeed\x12$.truffle.os.GetBackgroundFeedRequest\x1a%.truffle.os.GetBackgroundFeedResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/v1/os/apps/background/feed:get:\x01*\x12\xa8\x01\n\x1f\x42\x61\x63kground_GetLatestFeedEntryID\x12\'.truffle.os.GetLatestFeedEntryIDRequest\x1a(.truffle.os.GetLatestFeedEntryIDResponse\"2\x82\xd3\xe4\x93\x02,\"\'/v1/os/apps/background/latestfeedid:get:\x01*\x12\xa6\x01\n\x18\x42\x61\x63kground_LikeFeedEntry\x12*.truffle.os.LikeBackgroundFeedEntryRequest\x1a+.truffle.os.LikeBackgroundFeedEntryResponse\"1\x82\xd3\xe4\x93\x02+\"&/v1/os/apps/background/feed/entry:like:\x01*\x12\xa7\x01\n\x1d\x42\x61\x63kground_SubmitFeedFeedback\x12).truffle.os.BackgroundFeedFeedbackRequest\x1a*.truffle.os.BackgroundFeedFeedbackResponse\"/\x82\xd3\xe4\x93\x02)\"$/v1/os/apps/background/feed:feedback:\x01*\x12\x90\x01\n\x19\x42uilder_StartBuildSession\x12$.truffle.os.StartBuildSessionRequest\x1a%.truffle.os.StartBuildSessionResponse\"&\x82\xd3\xe4\x93\x02 \"\x1b/v1/os/builder/builds:start:\x01*\x12\x94\x01\n\x1a\x42uilder_FinishBuildSession\x12%.truffle.os.FinishBuildSessionRequest\x1a&.truffle.os.FinishBuildSessionResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/v1/os/builder/builds:finish:\x01*\x12\x83\x01\n\x16\x43lient_RegisterNewUser\x12\".truffle.os.RegisterNewUserRequest\x1a#.truffle.os.RegisterNewUserResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/v1/os/users:register:\x01*\x12\x8f\x01\n\x19\x43lient_RegisterNewSession\x12%.truffle.os.RegisterNewSessionRequest\x1a&.truffle.os.RegisterNewSessionResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/v1/os/sessions:register:\x01*\x12\x82\x01\n\x15\x43lient_UserIDForToken\x12!.truffle.os.UserIDForTokenRequest\x1a\".truffle.os.UserIDForTokenResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v1/os/tokens/{token}/user\x12\x8b\x01\n#Client_VerifyNewSessionRegistration\x12#.truffle.os.VerifyNewSessionRequest\x1a\x1c.truffle.os.NewSessionStatus\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/v1/os/sessions:verify:\x01*\x12x\n\x1b\x43lient_GetUserRecoveryCodes\x12\x16.google.protobuf.Empty\x1a\x1d.truffle.os.UserRecoveryCodes\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v1/os/users/recoveryCodes\x12\x87\x01\n\x18\x43lient_UpdateClientState\x12$.truffle.os.UpdateClientStateRequest\x1a%.truffle.os.UpdateClientStateResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x13/v1/os/client/state:\x01*\x12\x81\x01\n\x15\x43lient_GetClientState\x12!.truffle.os.GetClientStateRequest\x1a\".truffle.os.GetClientStateResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/os/client/state/{key}\x12\x88\x01\n\x19\x43lient_GetAllClientStates\x12%.truffle.os.GetAllClientStatesRequest\x1a&.truffle.os.GetAllClientStatesResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/os/client/states\x12\x8b\x01\n\x18SubscribeToNotifications\x12+.truffle.os.SubscribeToNotificationsRequest\x1a\x18.truffle.os.Notification\"&\x82\xd3\xe4\x93\x02 \x12\x1e/v1/os/notifications:subscribe0\x01\x12o\n\x11Hardware_GetStats\x12 .truffle.os.HardwareStatsRequest\x1a\x19.truffle.os.HardwareStats\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/os/hardware/stats\x12|\n\x15Hardware_StatsUpdates\x12 .truffle.os.HardwareStatsRequest\x1a\x19.truffle.os.HardwareStats\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/os/hardware/stats:stream0\x01\x12\x93\x01\n\x15Hardware_PowerControl\x12\'.truffle.os.HardwarePowerControlRequest\x1a(.truffle.os.HardwarePowerControlResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/v1/os/hardware/powerControl:\x01*\x12i\n\x0cSystem_GetID\x12\x1e.truffle.os.SystemGetIDRequest\x1a\x1f.truffle.os.SystemGetIDResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/os/system/id\x12h\n\x12System_GetSettings\x12\x16.google.protobuf.Empty\x1a\x1a.truffle.os.SystemSettings\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/os/system/settings\x12o\n\x12System_SetSettings\x12\x1a.truffle.os.SystemSettings\x1a\x1a.truffle.os.SystemSettings\"!\x82\xd3\xe4\x93\x02\x1b\x32\x16/v1/os/system/settings:\x01*\x12\\\n\x0eSystem_GetInfo\x12\x16.google.protobuf.Empty\x1a\x16.truffle.os.SystemInfo\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/os/system/info\x12\x8e\x01\n\x15System_CheckForUpdate\x12\'.truffle.os.SystemCheckForUpdateRequest\x1a(.truffle.os.SystemCheckForUpdateResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v1/os/system/check-update\x12j\n\rTask_OpenTask\x12\x1b.truffle.os.OpenTaskRequest\x1a\x1c.truffle.os.TaskStreamUpdate\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/os/tasks:open:\x01*0\x01\x12\x83\x01\n\x12Task_InterruptTask\x12 .truffle.os.InterruptTaskRequest\x1a\x1e.truffle.os.TaskActionResponse\"+\x82\xd3\xe4\x93\x02%\" /v1/os/tasks/{task_id}:interrupt:\x01*\x12\x81\x01\n\x12Task_RespondToTask\x12 .truffle.os.RespondToTaskRequest\x1a\x1e.truffle.os.TaskActionResponse\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/os/tasks/{task_id}:respond:\x01*\x12\x9e\x01\n\x15Task_SetAvailableApps\x12\'.truffle.os.TaskSetAvailableAppsRequest\x1a(.truffle.os.TaskSetAvailableAppsResponse\"2\x82\xd3\xe4\x93\x02,\"\'/v1/os/tasks/{task_id}:setAvailableApps:\x01*\x12s\n\x10Task_SearchTasks\x12\x1e.truffle.os.SearchTasksRequest\x1a\x1f.truffle.os.SearchTasksResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x13/v1/os/tasks:search:\x01*\x12\x63\n\rTask_GetTasks\x12\x1b.truffle.os.GetTasksRequest\x1a\x10.truffle.os.Task\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/v1/os/tasks:streamGet:\x01*0\x01\x12\x62\n\x0fTask_GetOneTask\x12\x1d.truffle.os.GetOneTaskRequest\x1a\x10.truffle.os.Task\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/os/tasks/{task_id}\x12u\n\x11Task_GetTaskInfos\x12\x1f.truffle.os.GetTaskInfosRequest\x1a .truffle.os.GetTaskInfosResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/v1/os/tasks/infos:\x01*P\x01P\x02P\x03P\x04P\x05P\x06P\x07P\x08P\tP\nP\x0bP\x0cP\rP\x0eP\x0fP\x10\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'truffle.os.truffleos_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Apps_DeleteApp']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Apps_DeleteApp']._serialized_options = b'\202\323\344\223\002\030*\026/v1/os/apps/{app_uuid}' + _globals['_TRUFFLEOS'].methods_by_name['Apps_GetBackground']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Apps_GetBackground']._serialized_options = b'\202\323\344\223\002\030\022\026/v1/os/apps/background' + _globals['_TRUFFLEOS'].methods_by_name['Apps_GetForeground']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Apps_GetForeground']._serialized_options = b'\202\323\344\223\002\030\022\026/v1/os/apps/foreground' + _globals['_TRUFFLEOS'].methods_by_name['Apps_GetAll']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Apps_GetAll']._serialized_options = b'\202\323\344\223\002\021\022\017/v1/os/apps/all' + _globals['_TRUFFLEOS'].methods_by_name['Background_GetFeed']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Background_GetFeed']._serialized_options = b'\202\323\344\223\002$\"\037/v1/os/apps/background/feed:get:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Background_GetLatestFeedEntryID']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Background_GetLatestFeedEntryID']._serialized_options = b'\202\323\344\223\002,\"\'/v1/os/apps/background/latestfeedid:get:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Background_LikeFeedEntry']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Background_LikeFeedEntry']._serialized_options = b'\202\323\344\223\002+\"&/v1/os/apps/background/feed/entry:like:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Background_SubmitFeedFeedback']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Background_SubmitFeedFeedback']._serialized_options = b'\202\323\344\223\002)\"$/v1/os/apps/background/feed:feedback:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Builder_StartBuildSession']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Builder_StartBuildSession']._serialized_options = b'\202\323\344\223\002 \"\033/v1/os/builder/builds:start:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Builder_FinishBuildSession']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Builder_FinishBuildSession']._serialized_options = b'\202\323\344\223\002!\"\034/v1/os/builder/builds:finish:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Client_RegisterNewUser']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_RegisterNewUser']._serialized_options = b'\202\323\344\223\002\032\"\025/v1/os/users:register:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Client_RegisterNewSession']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_RegisterNewSession']._serialized_options = b'\202\323\344\223\002\035\"\030/v1/os/sessions:register:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Client_UserIDForToken']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_UserIDForToken']._serialized_options = b'\202\323\344\223\002\034\022\032/v1/os/tokens/{token}/user' + _globals['_TRUFFLEOS'].methods_by_name['Client_VerifyNewSessionRegistration']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_VerifyNewSessionRegistration']._serialized_options = b'\202\323\344\223\002\033\"\026/v1/os/sessions:verify:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Client_GetUserRecoveryCodes']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_GetUserRecoveryCodes']._serialized_options = b'\202\323\344\223\002\034\022\032/v1/os/users/recoveryCodes' + _globals['_TRUFFLEOS'].methods_by_name['Client_UpdateClientState']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_UpdateClientState']._serialized_options = b'\202\323\344\223\002\030\"\023/v1/os/client/state:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Client_GetClientState']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_GetClientState']._serialized_options = b'\202\323\344\223\002\033\022\031/v1/os/client/state/{key}' + _globals['_TRUFFLEOS'].methods_by_name['Client_GetAllClientStates']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Client_GetAllClientStates']._serialized_options = b'\202\323\344\223\002\026\022\024/v1/os/client/states' + _globals['_TRUFFLEOS'].methods_by_name['SubscribeToNotifications']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['SubscribeToNotifications']._serialized_options = b'\202\323\344\223\002 \022\036/v1/os/notifications:subscribe' + _globals['_TRUFFLEOS'].methods_by_name['Hardware_GetStats']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Hardware_GetStats']._serialized_options = b'\202\323\344\223\002\027\022\025/v1/os/hardware/stats' + _globals['_TRUFFLEOS'].methods_by_name['Hardware_StatsUpdates']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Hardware_StatsUpdates']._serialized_options = b'\202\323\344\223\002\036\022\034/v1/os/hardware/stats:stream' + _globals['_TRUFFLEOS'].methods_by_name['Hardware_PowerControl']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Hardware_PowerControl']._serialized_options = b'\202\323\344\223\002!\"\034/v1/os/hardware/powerControl:\001*' + _globals['_TRUFFLEOS'].methods_by_name['System_GetID']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['System_GetID']._serialized_options = b'\202\323\344\223\002\022\022\020/v1/os/system/id' + _globals['_TRUFFLEOS'].methods_by_name['System_GetSettings']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['System_GetSettings']._serialized_options = b'\202\323\344\223\002\030\022\026/v1/os/system/settings' + _globals['_TRUFFLEOS'].methods_by_name['System_SetSettings']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['System_SetSettings']._serialized_options = b'\202\323\344\223\002\0332\026/v1/os/system/settings:\001*' + _globals['_TRUFFLEOS'].methods_by_name['System_GetInfo']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['System_GetInfo']._serialized_options = b'\202\323\344\223\002\024\022\022/v1/os/system/info' + _globals['_TRUFFLEOS'].methods_by_name['System_CheckForUpdate']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['System_CheckForUpdate']._serialized_options = b'\202\323\344\223\002\034\022\032/v1/os/system/check-update' + _globals['_TRUFFLEOS'].methods_by_name['Task_OpenTask']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_OpenTask']._serialized_options = b'\202\323\344\223\002\026\"\021/v1/os/tasks:open:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Task_InterruptTask']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_InterruptTask']._serialized_options = b'\202\323\344\223\002%\" /v1/os/tasks/{task_id}:interrupt:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Task_RespondToTask']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_RespondToTask']._serialized_options = b'\202\323\344\223\002#\"\036/v1/os/tasks/{task_id}:respond:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Task_SetAvailableApps']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_SetAvailableApps']._serialized_options = b'\202\323\344\223\002,\"\'/v1/os/tasks/{task_id}:setAvailableApps:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Task_SearchTasks']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_SearchTasks']._serialized_options = b'\202\323\344\223\002\030\"\023/v1/os/tasks:search:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Task_GetTasks']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_GetTasks']._serialized_options = b'\202\323\344\223\002\033\"\026/v1/os/tasks:streamGet:\001*' + _globals['_TRUFFLEOS'].methods_by_name['Task_GetOneTask']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_GetOneTask']._serialized_options = b'\202\323\344\223\002\030\022\026/v1/os/tasks/{task_id}' + _globals['_TRUFFLEOS'].methods_by_name['Task_GetTaskInfos']._loaded_options = None + _globals['_TRUFFLEOS'].methods_by_name['Task_GetTaskInfos']._serialized_options = b'\202\323\344\223\002\027\"\022/v1/os/tasks/infos:\001*' + _globals['_TRUFFLEOS']._serialized_start=637 + _globals['_TRUFFLEOS']._serialized_end=5318 +# @@protoc_insertion_point(module_scope) diff --git a/truffle/os/truffleos_pb2.pyi b/truffle/os/truffleos_pb2.pyi new file mode 100644 index 0000000..da187f1 --- /dev/null +++ b/truffle/os/truffleos_pb2.pyi @@ -0,0 +1,107 @@ +from google.protobuf import empty_pb2 as _empty_pb2 +from truffle.os import hardware_stats_pb2 as _hardware_stats_pb2 +from truffle.os import hardware_control_pb2 as _hardware_control_pb2 +from truffle.os import system_settings_pb2 as _system_settings_pb2 +from truffle.os import hardware_settings_pb2 as _hardware_settings_pb2 +from truffle.os import system_info_pb2 as _system_info_pb2 +from truffle.os import hardware_info_pb2 as _hardware_info_pb2 +from truffle.os import notification_pb2 as _notification_pb2 +from truffle.os import client_session_pb2 as _client_session_pb2 +from truffle.os import client_user_pb2 as _client_user_pb2 +from truffle.os import client_state_pb2 as _client_state_pb2 +from truffle.os import task_pb2 as _task_pb2 +from truffle.os import task_info_pb2 as _task_info_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2 +from truffle.os import task_step_pb2 as _task_step_pb2 +from truffle.os import task_queries_pb2 as _task_queries_pb2 +from truffle.os import task_actions_pb2 as _task_actions_pb2 +from truffle.os import task_pb2 as _task_pb2_1 +from truffle.os import task_target_pb2 as _task_target_pb2 +from truffle.os import task_options_pb2 as _task_options_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2_1 +from truffle.common import tool_provider_pb2 as _tool_provider_pb2 +from truffle.os import task_user_response_pb2 as _task_user_response_pb2_1_1 +from truffle.os import task_search_pb2 as _task_search_pb2 +from truffle.os import builder_pb2 as _builder_pb2 +from truffle.os import background_feed_queries_pb2 as _background_feed_queries_pb2 +from truffle.os import app_queries_pb2 as _app_queries_pb2 +from truffle.os import installer_pb2 as _installer_pb2 +from google.api import annotations_pb2 as _annotations_pb2 +from google.protobuf import descriptor as _descriptor +from typing import ClassVar as _ClassVar +from truffle.os.hardware_stats_pb2 import HardwareStats as HardwareStats +from truffle.os.hardware_stats_pb2 import HardwareStatsRequest as HardwareStatsRequest +from truffle.os.hardware_control_pb2 import HardwarePowerControlRequest as HardwarePowerControlRequest +from truffle.os.hardware_control_pb2 import HardwarePowerControlResponse as HardwarePowerControlResponse +from truffle.os.system_settings_pb2 import SystemSettings as SystemSettings +from truffle.os.system_settings_pb2 import TaskSettings as TaskSettings +from truffle.os.system_info_pb2 import FirmwareVersion as FirmwareVersion +from truffle.os.system_info_pb2 import SystemInfo as SystemInfo +from truffle.os.system_info_pb2 import SystemCheckForUpdateRequest as SystemCheckForUpdateRequest +from truffle.os.system_info_pb2 import SystemCheckForUpdateResponse as SystemCheckForUpdateResponse +from truffle.os.system_info_pb2 import SystemGetIDRequest as SystemGetIDRequest +from truffle.os.system_info_pb2 import SystemGetIDResponse as SystemGetIDResponse +from truffle.os.notification_pb2 import SubscribeToNotificationsRequest as SubscribeToNotificationsRequest +from truffle.os.notification_pb2 import Notification as Notification +from truffle.os.client_session_pb2 import UserRecoveryCodes as UserRecoveryCodes +from truffle.os.client_session_pb2 import RegisterNewSessionRequest as RegisterNewSessionRequest +from truffle.os.client_session_pb2 import RegisterNewSessionResponse as RegisterNewSessionResponse +from truffle.os.client_session_pb2 import NewSessionVerification as NewSessionVerification +from truffle.os.client_session_pb2 import VerifyNewSessionRequest as VerifyNewSessionRequest +from truffle.os.client_session_pb2 import NewSessionStatus as NewSessionStatus +from truffle.os.client_user_pb2 import RegisterNewUserRequest as RegisterNewUserRequest +from truffle.os.client_user_pb2 import RegisterNewUserResponse as RegisterNewUserResponse +from truffle.os.client_user_pb2 import UserIDForTokenRequest as UserIDForTokenRequest +from truffle.os.client_user_pb2 import UserIDForTokenResponse as UserIDForTokenResponse +from truffle.os.client_state_pb2 import ClientState as ClientState +from truffle.os.client_state_pb2 import UpdateClientStateRequest as UpdateClientStateRequest +from truffle.os.client_state_pb2 import UpdateClientStateResponse as UpdateClientStateResponse +from truffle.os.client_state_pb2 import GetClientStateRequest as GetClientStateRequest +from truffle.os.client_state_pb2 import GetClientStateResponse as GetClientStateResponse +from truffle.os.client_state_pb2 import GetAllClientStatesRequest as GetAllClientStatesRequest +from truffle.os.client_state_pb2 import GetAllClientStatesResponse as GetAllClientStatesResponse +from truffle.os.task_pb2 import Task as Task +from truffle.os.task_pb2 import TasksList as TasksList +from truffle.os.task_pb2 import TaskNode as TaskNode +from truffle.os.task_pb2 import TaskStreamUpdate as TaskStreamUpdate +from truffle.os.task_queries_pb2 import GetTasksRequest as GetTasksRequest +from truffle.os.task_queries_pb2 import GetOneTaskRequest as GetOneTaskRequest +from truffle.os.task_queries_pb2 import GetTaskInfosRequest as GetTaskInfosRequest +from truffle.os.task_queries_pb2 import GetTaskInfosResponse as GetTaskInfosResponse +from truffle.os.task_actions_pb2 import InterruptTaskRequest as InterruptTaskRequest +from truffle.os.task_actions_pb2 import NewTask as NewTask +from truffle.os.task_actions_pb2 import OpenTaskRequest as OpenTaskRequest +from truffle.os.task_actions_pb2 import TaskSetAvailableAppsRequest as TaskSetAvailableAppsRequest +from truffle.os.task_actions_pb2 import TaskSetAvailableAppsResponse as TaskSetAvailableAppsResponse +from truffle.os.task_actions_pb2 import TaskActionResponse as TaskActionResponse +from truffle.os.task_actions_pb2 import TaskTestExternalToolProviderRequest as TaskTestExternalToolProviderRequest +from truffle.os.task_actions_pb2 import TaskTestExternalToolProviderResponse as TaskTestExternalToolProviderResponse +from truffle.os.task_user_response_pb2 import UserMessage as UserMessage +from truffle.os.task_user_response_pb2 import PendingUserResponse as PendingUserResponse +from truffle.os.task_user_response_pb2 import RespondToTaskRequest as RespondToTaskRequest +from truffle.os.task_search_pb2 import SearchTasksRequest as SearchTasksRequest +from truffle.os.task_search_pb2 import TaskSearchResult as TaskSearchResult +from truffle.os.task_search_pb2 import SearchTasksResponse as SearchTasksResponse +from truffle.os.builder_pb2 import StartBuildSessionRequest as StartBuildSessionRequest +from truffle.os.builder_pb2 import StartBuildSessionResponse as StartBuildSessionResponse +from truffle.os.builder_pb2 import FinishBuildSessionRequest as FinishBuildSessionRequest +from truffle.os.builder_pb2 import BuildSessionError as BuildSessionError +from truffle.os.builder_pb2 import FinishBuildSessionResponse as FinishBuildSessionResponse +from truffle.os.background_feed_queries_pb2 import GetBackgroundFeedRequest as GetBackgroundFeedRequest +from truffle.os.background_feed_queries_pb2 import GetBackgroundFeedResponse as GetBackgroundFeedResponse +from truffle.os.background_feed_queries_pb2 import LikeBackgroundFeedEntryRequest as LikeBackgroundFeedEntryRequest +from truffle.os.background_feed_queries_pb2 import LikeBackgroundFeedEntryResponse as LikeBackgroundFeedEntryResponse +from truffle.os.background_feed_queries_pb2 import GetLatestFeedEntryIDRequest as GetLatestFeedEntryIDRequest +from truffle.os.background_feed_queries_pb2 import GetLatestFeedEntryIDResponse as GetLatestFeedEntryIDResponse +from truffle.os.background_feed_queries_pb2 import BackgroundFeedFeedbackRequest as BackgroundFeedFeedbackRequest +from truffle.os.background_feed_queries_pb2 import BackgroundFeedFeedbackResponse as BackgroundFeedFeedbackResponse +from truffle.os.app_queries_pb2 import GetForegroundAppsRequest as GetForegroundAppsRequest +from truffle.os.app_queries_pb2 import GetForegroundAppsResponse as GetForegroundAppsResponse +from truffle.os.app_queries_pb2 import GetBackgroundAppsRequest as GetBackgroundAppsRequest +from truffle.os.app_queries_pb2 import GetBackgroundAppsResponse as GetBackgroundAppsResponse +from truffle.os.app_queries_pb2 import GetAllAppsRequest as GetAllAppsRequest +from truffle.os.app_queries_pb2 import GetAllAppsResponse as GetAllAppsResponse +from truffle.os.app_queries_pb2 import DeleteAppRequest as DeleteAppRequest +from truffle.os.app_queries_pb2 import DeleteAppResponse as DeleteAppResponse + +DESCRIPTOR: _descriptor.FileDescriptor diff --git a/truffle/os/truffleos_pb2_grpc.py b/truffle/os/truffleos_pb2_grpc.py new file mode 100644 index 0000000..ac95a7b --- /dev/null +++ b/truffle/os/truffleos_pb2_grpc.py @@ -0,0 +1,1635 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from truffle.os import app_queries_pb2 as truffle_dot_os_dot_app__queries__pb2 +from truffle.os import background_feed_queries_pb2 as truffle_dot_os_dot_background__feed__queries__pb2 +from truffle.os import builder_pb2 as truffle_dot_os_dot_builder__pb2 +from truffle.os import client_session_pb2 as truffle_dot_os_dot_client__session__pb2 +from truffle.os import client_state_pb2 as truffle_dot_os_dot_client__state__pb2 +from truffle.os import client_user_pb2 as truffle_dot_os_dot_client__user__pb2 +from truffle.os import hardware_control_pb2 as truffle_dot_os_dot_hardware__control__pb2 +from truffle.os import hardware_stats_pb2 as truffle_dot_os_dot_hardware__stats__pb2 +from truffle.os import installer_pb2 as truffle_dot_os_dot_installer__pb2 +from truffle.os import notification_pb2 as truffle_dot_os_dot_notification__pb2 +from truffle.os import system_info_pb2 as truffle_dot_os_dot_system__info__pb2 +from truffle.os import system_settings_pb2 as truffle_dot_os_dot_system__settings__pb2 +from truffle.os import task_actions_pb2 as truffle_dot_os_dot_task__actions__pb2 +from truffle.os import task_pb2 as truffle_dot_os_dot_task__pb2 +from truffle.os import task_queries_pb2 as truffle_dot_os_dot_task__queries__pb2 +from truffle.os import task_search_pb2 as truffle_dot_os_dot_task__search__pb2 +from truffle.os import task_user_response_pb2 as truffle_dot_os_dot_task__user__response__pb2 + +GRPC_GENERATED_VERSION = '1.72.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in truffle/os/truffleos_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class TruffleOSStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Apps_DeleteApp = channel.unary_unary( + '/truffle.os.TruffleOS/Apps_DeleteApp', + request_serializer=truffle_dot_os_dot_app__queries__pb2.DeleteAppRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_app__queries__pb2.DeleteAppResponse.FromString, + _registered_method=True) + self.Apps_GetBackground = channel.unary_unary( + '/truffle.os.TruffleOS/Apps_GetBackground', + request_serializer=truffle_dot_os_dot_app__queries__pb2.GetBackgroundAppsRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_app__queries__pb2.GetBackgroundAppsResponse.FromString, + _registered_method=True) + self.Apps_GetForeground = channel.unary_unary( + '/truffle.os.TruffleOS/Apps_GetForeground', + request_serializer=truffle_dot_os_dot_app__queries__pb2.GetForegroundAppsRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_app__queries__pb2.GetForegroundAppsResponse.FromString, + _registered_method=True) + self.Apps_GetAll = channel.unary_unary( + '/truffle.os.TruffleOS/Apps_GetAll', + request_serializer=truffle_dot_os_dot_app__queries__pb2.GetAllAppsRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_app__queries__pb2.GetAllAppsResponse.FromString, + _registered_method=True) + self.Apps_InstallApp = channel.stream_stream( + '/truffle.os.TruffleOS/Apps_InstallApp', + request_serializer=truffle_dot_os_dot_installer__pb2.AppInstallRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_installer__pb2.AppInstallResponse.FromString, + _registered_method=True) + self.Background_GetFeed = channel.unary_unary( + '/truffle.os.TruffleOS/Background_GetFeed', + request_serializer=truffle_dot_os_dot_background__feed__queries__pb2.GetBackgroundFeedRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.GetBackgroundFeedResponse.FromString, + _registered_method=True) + self.Background_GetLatestFeedEntryID = channel.unary_unary( + '/truffle.os.TruffleOS/Background_GetLatestFeedEntryID', + request_serializer=truffle_dot_os_dot_background__feed__queries__pb2.GetLatestFeedEntryIDRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.GetLatestFeedEntryIDResponse.FromString, + _registered_method=True) + self.Background_LikeFeedEntry = channel.unary_unary( + '/truffle.os.TruffleOS/Background_LikeFeedEntry', + request_serializer=truffle_dot_os_dot_background__feed__queries__pb2.LikeBackgroundFeedEntryRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.LikeBackgroundFeedEntryResponse.FromString, + _registered_method=True) + self.Background_SubmitFeedFeedback = channel.unary_unary( + '/truffle.os.TruffleOS/Background_SubmitFeedFeedback', + request_serializer=truffle_dot_os_dot_background__feed__queries__pb2.BackgroundFeedFeedbackRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.BackgroundFeedFeedbackResponse.FromString, + _registered_method=True) + self.Builder_StartBuildSession = channel.unary_unary( + '/truffle.os.TruffleOS/Builder_StartBuildSession', + request_serializer=truffle_dot_os_dot_builder__pb2.StartBuildSessionRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_builder__pb2.StartBuildSessionResponse.FromString, + _registered_method=True) + self.Builder_FinishBuildSession = channel.unary_unary( + '/truffle.os.TruffleOS/Builder_FinishBuildSession', + request_serializer=truffle_dot_os_dot_builder__pb2.FinishBuildSessionRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_builder__pb2.FinishBuildSessionResponse.FromString, + _registered_method=True) + self.Client_RegisterNewUser = channel.unary_unary( + '/truffle.os.TruffleOS/Client_RegisterNewUser', + request_serializer=truffle_dot_os_dot_client__user__pb2.RegisterNewUserRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__user__pb2.RegisterNewUserResponse.FromString, + _registered_method=True) + self.Client_RegisterNewSession = channel.unary_unary( + '/truffle.os.TruffleOS/Client_RegisterNewSession', + request_serializer=truffle_dot_os_dot_client__session__pb2.RegisterNewSessionRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__session__pb2.RegisterNewSessionResponse.FromString, + _registered_method=True) + self.Client_UserIDForToken = channel.unary_unary( + '/truffle.os.TruffleOS/Client_UserIDForToken', + request_serializer=truffle_dot_os_dot_client__user__pb2.UserIDForTokenRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__user__pb2.UserIDForTokenResponse.FromString, + _registered_method=True) + self.Client_VerifyNewSessionRegistration = channel.unary_unary( + '/truffle.os.TruffleOS/Client_VerifyNewSessionRegistration', + request_serializer=truffle_dot_os_dot_client__session__pb2.VerifyNewSessionRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__session__pb2.NewSessionStatus.FromString, + _registered_method=True) + self.Client_GetUserRecoveryCodes = channel.unary_unary( + '/truffle.os.TruffleOS/Client_GetUserRecoveryCodes', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__session__pb2.UserRecoveryCodes.FromString, + _registered_method=True) + self.Client_UpdateClientState = channel.unary_unary( + '/truffle.os.TruffleOS/Client_UpdateClientState', + request_serializer=truffle_dot_os_dot_client__state__pb2.UpdateClientStateRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__state__pb2.UpdateClientStateResponse.FromString, + _registered_method=True) + self.Client_GetClientState = channel.unary_unary( + '/truffle.os.TruffleOS/Client_GetClientState', + request_serializer=truffle_dot_os_dot_client__state__pb2.GetClientStateRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__state__pb2.GetClientStateResponse.FromString, + _registered_method=True) + self.Client_GetAllClientStates = channel.unary_unary( + '/truffle.os.TruffleOS/Client_GetAllClientStates', + request_serializer=truffle_dot_os_dot_client__state__pb2.GetAllClientStatesRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_client__state__pb2.GetAllClientStatesResponse.FromString, + _registered_method=True) + self.SubscribeToNotifications = channel.unary_stream( + '/truffle.os.TruffleOS/SubscribeToNotifications', + request_serializer=truffle_dot_os_dot_notification__pb2.SubscribeToNotificationsRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_notification__pb2.Notification.FromString, + _registered_method=True) + self.Hardware_GetStats = channel.unary_unary( + '/truffle.os.TruffleOS/Hardware_GetStats', + request_serializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStatsRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStats.FromString, + _registered_method=True) + self.Hardware_StatsUpdates = channel.unary_stream( + '/truffle.os.TruffleOS/Hardware_StatsUpdates', + request_serializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStatsRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStats.FromString, + _registered_method=True) + self.Hardware_PowerControl = channel.unary_unary( + '/truffle.os.TruffleOS/Hardware_PowerControl', + request_serializer=truffle_dot_os_dot_hardware__control__pb2.HardwarePowerControlRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_hardware__control__pb2.HardwarePowerControlResponse.FromString, + _registered_method=True) + self.System_GetID = channel.unary_unary( + '/truffle.os.TruffleOS/System_GetID', + request_serializer=truffle_dot_os_dot_system__info__pb2.SystemGetIDRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_system__info__pb2.SystemGetIDResponse.FromString, + _registered_method=True) + self.System_GetSettings = channel.unary_unary( + '/truffle.os.TruffleOS/System_GetSettings', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=truffle_dot_os_dot_system__settings__pb2.SystemSettings.FromString, + _registered_method=True) + self.System_SetSettings = channel.unary_unary( + '/truffle.os.TruffleOS/System_SetSettings', + request_serializer=truffle_dot_os_dot_system__settings__pb2.SystemSettings.SerializeToString, + response_deserializer=truffle_dot_os_dot_system__settings__pb2.SystemSettings.FromString, + _registered_method=True) + self.System_GetInfo = channel.unary_unary( + '/truffle.os.TruffleOS/System_GetInfo', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=truffle_dot_os_dot_system__info__pb2.SystemInfo.FromString, + _registered_method=True) + self.System_CheckForUpdate = channel.unary_unary( + '/truffle.os.TruffleOS/System_CheckForUpdate', + request_serializer=truffle_dot_os_dot_system__info__pb2.SystemCheckForUpdateRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_system__info__pb2.SystemCheckForUpdateResponse.FromString, + _registered_method=True) + self.Task_OpenTask = channel.unary_stream( + '/truffle.os.TruffleOS/Task_OpenTask', + request_serializer=truffle_dot_os_dot_task__actions__pb2.OpenTaskRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__pb2.TaskStreamUpdate.FromString, + _registered_method=True) + self.Task_InterruptTask = channel.unary_unary( + '/truffle.os.TruffleOS/Task_InterruptTask', + request_serializer=truffle_dot_os_dot_task__actions__pb2.InterruptTaskRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + _registered_method=True) + self.Task_RespondToTask = channel.unary_unary( + '/truffle.os.TruffleOS/Task_RespondToTask', + request_serializer=truffle_dot_os_dot_task__user__response__pb2.RespondToTaskRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + _registered_method=True) + self.Task_SetAvailableApps = channel.unary_unary( + '/truffle.os.TruffleOS/Task_SetAvailableApps', + request_serializer=truffle_dot_os_dot_task__actions__pb2.TaskSetAvailableAppsRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__actions__pb2.TaskSetAvailableAppsResponse.FromString, + _registered_method=True) + self.Task_SearchTasks = channel.unary_unary( + '/truffle.os.TruffleOS/Task_SearchTasks', + request_serializer=truffle_dot_os_dot_task__search__pb2.SearchTasksRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__search__pb2.SearchTasksResponse.FromString, + _registered_method=True) + self.Task_GetTasks = channel.unary_stream( + '/truffle.os.TruffleOS/Task_GetTasks', + request_serializer=truffle_dot_os_dot_task__queries__pb2.GetTasksRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__pb2.Task.FromString, + _registered_method=True) + self.Task_GetOneTask = channel.unary_unary( + '/truffle.os.TruffleOS/Task_GetOneTask', + request_serializer=truffle_dot_os_dot_task__queries__pb2.GetOneTaskRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__pb2.Task.FromString, + _registered_method=True) + self.Task_GetTaskInfos = channel.unary_unary( + '/truffle.os.TruffleOS/Task_GetTaskInfos', + request_serializer=truffle_dot_os_dot_task__queries__pb2.GetTaskInfosRequest.SerializeToString, + response_deserializer=truffle_dot_os_dot_task__queries__pb2.GetTaskInfosResponse.FromString, + _registered_method=True) + + +class TruffleOSServicer(object): + """Missing associated documentation comment in .proto file.""" + + def Apps_DeleteApp(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Apps_GetBackground(self, request, context): + """apps that can contribute to bg feed (ambients) + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Apps_GetForeground(self, request, context): + """apps used in tasks (focuses) + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Apps_GetAll(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Apps_InstallApp(self, request_iterator, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Background_GetFeed(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Background_GetLatestFeedEntryID(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Background_LikeFeedEntry(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Background_SubmitFeedFeedback(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Builder_StartBuildSession(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Builder_FinishBuildSession(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_RegisterNewUser(self, request, context): + """NOAUTH. Registers a new user and returns a user ID and a session token. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_RegisterNewSession(self, request, context): + """NOAUTH. starts session verification process for a new session on another device. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_UserIDForToken(self, request, context): + """get the user id associated with a session token + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_VerifyNewSessionRegistration(self, request, context): + """called by an already authenticated client to approve or deny a new session creation request from another device. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_GetUserRecoveryCodes(self, request, context): + """WARNING! calling this wipes existing recovery codes, if they exist + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_UpdateClientState(self, request, context): + """client can store arbitrary key-value state data on the server + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_GetClientState(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Client_GetAllClientStates(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SubscribeToNotifications(self, request, context): + """do this on session start to get your notification stream + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Hardware_GetStats(self, request, context): + """please don't poll this use the damn stream. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Hardware_StatsUpdates(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Hardware_PowerControl(self, request, context): + """this rpc might not return.. so treat calling it as a fire-and-forget + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def System_GetID(self, request, context): + """NO AUTH + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def System_GetSettings(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def System_SetSettings(self, request, context): + """only applies the fields that are explicitly set + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def System_GetInfo(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def System_CheckForUpdate(self, request, context): + """client guys dont use me. this is basically just for dev.. pretty useless due to ota flow. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_OpenTask(self, request, context): + """Task == Focus == Foreground App + create or open an existing task and its update stream + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_InterruptTask(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_RespondToTask(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_SetAvailableApps(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_SearchTasks(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_GetTasks(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_GetOneTask(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Task_GetTaskInfos(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_TruffleOSServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Apps_DeleteApp': grpc.unary_unary_rpc_method_handler( + servicer.Apps_DeleteApp, + request_deserializer=truffle_dot_os_dot_app__queries__pb2.DeleteAppRequest.FromString, + response_serializer=truffle_dot_os_dot_app__queries__pb2.DeleteAppResponse.SerializeToString, + ), + 'Apps_GetBackground': grpc.unary_unary_rpc_method_handler( + servicer.Apps_GetBackground, + request_deserializer=truffle_dot_os_dot_app__queries__pb2.GetBackgroundAppsRequest.FromString, + response_serializer=truffle_dot_os_dot_app__queries__pb2.GetBackgroundAppsResponse.SerializeToString, + ), + 'Apps_GetForeground': grpc.unary_unary_rpc_method_handler( + servicer.Apps_GetForeground, + request_deserializer=truffle_dot_os_dot_app__queries__pb2.GetForegroundAppsRequest.FromString, + response_serializer=truffle_dot_os_dot_app__queries__pb2.GetForegroundAppsResponse.SerializeToString, + ), + 'Apps_GetAll': grpc.unary_unary_rpc_method_handler( + servicer.Apps_GetAll, + request_deserializer=truffle_dot_os_dot_app__queries__pb2.GetAllAppsRequest.FromString, + response_serializer=truffle_dot_os_dot_app__queries__pb2.GetAllAppsResponse.SerializeToString, + ), + 'Apps_InstallApp': grpc.stream_stream_rpc_method_handler( + servicer.Apps_InstallApp, + request_deserializer=truffle_dot_os_dot_installer__pb2.AppInstallRequest.FromString, + response_serializer=truffle_dot_os_dot_installer__pb2.AppInstallResponse.SerializeToString, + ), + 'Background_GetFeed': grpc.unary_unary_rpc_method_handler( + servicer.Background_GetFeed, + request_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.GetBackgroundFeedRequest.FromString, + response_serializer=truffle_dot_os_dot_background__feed__queries__pb2.GetBackgroundFeedResponse.SerializeToString, + ), + 'Background_GetLatestFeedEntryID': grpc.unary_unary_rpc_method_handler( + servicer.Background_GetLatestFeedEntryID, + request_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.GetLatestFeedEntryIDRequest.FromString, + response_serializer=truffle_dot_os_dot_background__feed__queries__pb2.GetLatestFeedEntryIDResponse.SerializeToString, + ), + 'Background_LikeFeedEntry': grpc.unary_unary_rpc_method_handler( + servicer.Background_LikeFeedEntry, + request_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.LikeBackgroundFeedEntryRequest.FromString, + response_serializer=truffle_dot_os_dot_background__feed__queries__pb2.LikeBackgroundFeedEntryResponse.SerializeToString, + ), + 'Background_SubmitFeedFeedback': grpc.unary_unary_rpc_method_handler( + servicer.Background_SubmitFeedFeedback, + request_deserializer=truffle_dot_os_dot_background__feed__queries__pb2.BackgroundFeedFeedbackRequest.FromString, + response_serializer=truffle_dot_os_dot_background__feed__queries__pb2.BackgroundFeedFeedbackResponse.SerializeToString, + ), + 'Builder_StartBuildSession': grpc.unary_unary_rpc_method_handler( + servicer.Builder_StartBuildSession, + request_deserializer=truffle_dot_os_dot_builder__pb2.StartBuildSessionRequest.FromString, + response_serializer=truffle_dot_os_dot_builder__pb2.StartBuildSessionResponse.SerializeToString, + ), + 'Builder_FinishBuildSession': grpc.unary_unary_rpc_method_handler( + servicer.Builder_FinishBuildSession, + request_deserializer=truffle_dot_os_dot_builder__pb2.FinishBuildSessionRequest.FromString, + response_serializer=truffle_dot_os_dot_builder__pb2.FinishBuildSessionResponse.SerializeToString, + ), + 'Client_RegisterNewUser': grpc.unary_unary_rpc_method_handler( + servicer.Client_RegisterNewUser, + request_deserializer=truffle_dot_os_dot_client__user__pb2.RegisterNewUserRequest.FromString, + response_serializer=truffle_dot_os_dot_client__user__pb2.RegisterNewUserResponse.SerializeToString, + ), + 'Client_RegisterNewSession': grpc.unary_unary_rpc_method_handler( + servicer.Client_RegisterNewSession, + request_deserializer=truffle_dot_os_dot_client__session__pb2.RegisterNewSessionRequest.FromString, + response_serializer=truffle_dot_os_dot_client__session__pb2.RegisterNewSessionResponse.SerializeToString, + ), + 'Client_UserIDForToken': grpc.unary_unary_rpc_method_handler( + servicer.Client_UserIDForToken, + request_deserializer=truffle_dot_os_dot_client__user__pb2.UserIDForTokenRequest.FromString, + response_serializer=truffle_dot_os_dot_client__user__pb2.UserIDForTokenResponse.SerializeToString, + ), + 'Client_VerifyNewSessionRegistration': grpc.unary_unary_rpc_method_handler( + servicer.Client_VerifyNewSessionRegistration, + request_deserializer=truffle_dot_os_dot_client__session__pb2.VerifyNewSessionRequest.FromString, + response_serializer=truffle_dot_os_dot_client__session__pb2.NewSessionStatus.SerializeToString, + ), + 'Client_GetUserRecoveryCodes': grpc.unary_unary_rpc_method_handler( + servicer.Client_GetUserRecoveryCodes, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=truffle_dot_os_dot_client__session__pb2.UserRecoveryCodes.SerializeToString, + ), + 'Client_UpdateClientState': grpc.unary_unary_rpc_method_handler( + servicer.Client_UpdateClientState, + request_deserializer=truffle_dot_os_dot_client__state__pb2.UpdateClientStateRequest.FromString, + response_serializer=truffle_dot_os_dot_client__state__pb2.UpdateClientStateResponse.SerializeToString, + ), + 'Client_GetClientState': grpc.unary_unary_rpc_method_handler( + servicer.Client_GetClientState, + request_deserializer=truffle_dot_os_dot_client__state__pb2.GetClientStateRequest.FromString, + response_serializer=truffle_dot_os_dot_client__state__pb2.GetClientStateResponse.SerializeToString, + ), + 'Client_GetAllClientStates': grpc.unary_unary_rpc_method_handler( + servicer.Client_GetAllClientStates, + request_deserializer=truffle_dot_os_dot_client__state__pb2.GetAllClientStatesRequest.FromString, + response_serializer=truffle_dot_os_dot_client__state__pb2.GetAllClientStatesResponse.SerializeToString, + ), + 'SubscribeToNotifications': grpc.unary_stream_rpc_method_handler( + servicer.SubscribeToNotifications, + request_deserializer=truffle_dot_os_dot_notification__pb2.SubscribeToNotificationsRequest.FromString, + response_serializer=truffle_dot_os_dot_notification__pb2.Notification.SerializeToString, + ), + 'Hardware_GetStats': grpc.unary_unary_rpc_method_handler( + servicer.Hardware_GetStats, + request_deserializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStatsRequest.FromString, + response_serializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStats.SerializeToString, + ), + 'Hardware_StatsUpdates': grpc.unary_stream_rpc_method_handler( + servicer.Hardware_StatsUpdates, + request_deserializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStatsRequest.FromString, + response_serializer=truffle_dot_os_dot_hardware__stats__pb2.HardwareStats.SerializeToString, + ), + 'Hardware_PowerControl': grpc.unary_unary_rpc_method_handler( + servicer.Hardware_PowerControl, + request_deserializer=truffle_dot_os_dot_hardware__control__pb2.HardwarePowerControlRequest.FromString, + response_serializer=truffle_dot_os_dot_hardware__control__pb2.HardwarePowerControlResponse.SerializeToString, + ), + 'System_GetID': grpc.unary_unary_rpc_method_handler( + servicer.System_GetID, + request_deserializer=truffle_dot_os_dot_system__info__pb2.SystemGetIDRequest.FromString, + response_serializer=truffle_dot_os_dot_system__info__pb2.SystemGetIDResponse.SerializeToString, + ), + 'System_GetSettings': grpc.unary_unary_rpc_method_handler( + servicer.System_GetSettings, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=truffle_dot_os_dot_system__settings__pb2.SystemSettings.SerializeToString, + ), + 'System_SetSettings': grpc.unary_unary_rpc_method_handler( + servicer.System_SetSettings, + request_deserializer=truffle_dot_os_dot_system__settings__pb2.SystemSettings.FromString, + response_serializer=truffle_dot_os_dot_system__settings__pb2.SystemSettings.SerializeToString, + ), + 'System_GetInfo': grpc.unary_unary_rpc_method_handler( + servicer.System_GetInfo, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=truffle_dot_os_dot_system__info__pb2.SystemInfo.SerializeToString, + ), + 'System_CheckForUpdate': grpc.unary_unary_rpc_method_handler( + servicer.System_CheckForUpdate, + request_deserializer=truffle_dot_os_dot_system__info__pb2.SystemCheckForUpdateRequest.FromString, + response_serializer=truffle_dot_os_dot_system__info__pb2.SystemCheckForUpdateResponse.SerializeToString, + ), + 'Task_OpenTask': grpc.unary_stream_rpc_method_handler( + servicer.Task_OpenTask, + request_deserializer=truffle_dot_os_dot_task__actions__pb2.OpenTaskRequest.FromString, + response_serializer=truffle_dot_os_dot_task__pb2.TaskStreamUpdate.SerializeToString, + ), + 'Task_InterruptTask': grpc.unary_unary_rpc_method_handler( + servicer.Task_InterruptTask, + request_deserializer=truffle_dot_os_dot_task__actions__pb2.InterruptTaskRequest.FromString, + response_serializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.SerializeToString, + ), + 'Task_RespondToTask': grpc.unary_unary_rpc_method_handler( + servicer.Task_RespondToTask, + request_deserializer=truffle_dot_os_dot_task__user__response__pb2.RespondToTaskRequest.FromString, + response_serializer=truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.SerializeToString, + ), + 'Task_SetAvailableApps': grpc.unary_unary_rpc_method_handler( + servicer.Task_SetAvailableApps, + request_deserializer=truffle_dot_os_dot_task__actions__pb2.TaskSetAvailableAppsRequest.FromString, + response_serializer=truffle_dot_os_dot_task__actions__pb2.TaskSetAvailableAppsResponse.SerializeToString, + ), + 'Task_SearchTasks': grpc.unary_unary_rpc_method_handler( + servicer.Task_SearchTasks, + request_deserializer=truffle_dot_os_dot_task__search__pb2.SearchTasksRequest.FromString, + response_serializer=truffle_dot_os_dot_task__search__pb2.SearchTasksResponse.SerializeToString, + ), + 'Task_GetTasks': grpc.unary_stream_rpc_method_handler( + servicer.Task_GetTasks, + request_deserializer=truffle_dot_os_dot_task__queries__pb2.GetTasksRequest.FromString, + response_serializer=truffle_dot_os_dot_task__pb2.Task.SerializeToString, + ), + 'Task_GetOneTask': grpc.unary_unary_rpc_method_handler( + servicer.Task_GetOneTask, + request_deserializer=truffle_dot_os_dot_task__queries__pb2.GetOneTaskRequest.FromString, + response_serializer=truffle_dot_os_dot_task__pb2.Task.SerializeToString, + ), + 'Task_GetTaskInfos': grpc.unary_unary_rpc_method_handler( + servicer.Task_GetTaskInfos, + request_deserializer=truffle_dot_os_dot_task__queries__pb2.GetTaskInfosRequest.FromString, + response_serializer=truffle_dot_os_dot_task__queries__pb2.GetTaskInfosResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'truffle.os.TruffleOS', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('truffle.os.TruffleOS', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class TruffleOS(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def Apps_DeleteApp(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Apps_DeleteApp', + truffle_dot_os_dot_app__queries__pb2.DeleteAppRequest.SerializeToString, + truffle_dot_os_dot_app__queries__pb2.DeleteAppResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Apps_GetBackground(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Apps_GetBackground', + truffle_dot_os_dot_app__queries__pb2.GetBackgroundAppsRequest.SerializeToString, + truffle_dot_os_dot_app__queries__pb2.GetBackgroundAppsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Apps_GetForeground(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Apps_GetForeground', + truffle_dot_os_dot_app__queries__pb2.GetForegroundAppsRequest.SerializeToString, + truffle_dot_os_dot_app__queries__pb2.GetForegroundAppsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Apps_GetAll(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Apps_GetAll', + truffle_dot_os_dot_app__queries__pb2.GetAllAppsRequest.SerializeToString, + truffle_dot_os_dot_app__queries__pb2.GetAllAppsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Apps_InstallApp(request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.stream_stream( + request_iterator, + target, + '/truffle.os.TruffleOS/Apps_InstallApp', + truffle_dot_os_dot_installer__pb2.AppInstallRequest.SerializeToString, + truffle_dot_os_dot_installer__pb2.AppInstallResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Background_GetFeed(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Background_GetFeed', + truffle_dot_os_dot_background__feed__queries__pb2.GetBackgroundFeedRequest.SerializeToString, + truffle_dot_os_dot_background__feed__queries__pb2.GetBackgroundFeedResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Background_GetLatestFeedEntryID(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Background_GetLatestFeedEntryID', + truffle_dot_os_dot_background__feed__queries__pb2.GetLatestFeedEntryIDRequest.SerializeToString, + truffle_dot_os_dot_background__feed__queries__pb2.GetLatestFeedEntryIDResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Background_LikeFeedEntry(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Background_LikeFeedEntry', + truffle_dot_os_dot_background__feed__queries__pb2.LikeBackgroundFeedEntryRequest.SerializeToString, + truffle_dot_os_dot_background__feed__queries__pb2.LikeBackgroundFeedEntryResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Background_SubmitFeedFeedback(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Background_SubmitFeedFeedback', + truffle_dot_os_dot_background__feed__queries__pb2.BackgroundFeedFeedbackRequest.SerializeToString, + truffle_dot_os_dot_background__feed__queries__pb2.BackgroundFeedFeedbackResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Builder_StartBuildSession(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Builder_StartBuildSession', + truffle_dot_os_dot_builder__pb2.StartBuildSessionRequest.SerializeToString, + truffle_dot_os_dot_builder__pb2.StartBuildSessionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Builder_FinishBuildSession(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Builder_FinishBuildSession', + truffle_dot_os_dot_builder__pb2.FinishBuildSessionRequest.SerializeToString, + truffle_dot_os_dot_builder__pb2.FinishBuildSessionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_RegisterNewUser(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_RegisterNewUser', + truffle_dot_os_dot_client__user__pb2.RegisterNewUserRequest.SerializeToString, + truffle_dot_os_dot_client__user__pb2.RegisterNewUserResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_RegisterNewSession(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_RegisterNewSession', + truffle_dot_os_dot_client__session__pb2.RegisterNewSessionRequest.SerializeToString, + truffle_dot_os_dot_client__session__pb2.RegisterNewSessionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_UserIDForToken(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_UserIDForToken', + truffle_dot_os_dot_client__user__pb2.UserIDForTokenRequest.SerializeToString, + truffle_dot_os_dot_client__user__pb2.UserIDForTokenResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_VerifyNewSessionRegistration(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_VerifyNewSessionRegistration', + truffle_dot_os_dot_client__session__pb2.VerifyNewSessionRequest.SerializeToString, + truffle_dot_os_dot_client__session__pb2.NewSessionStatus.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_GetUserRecoveryCodes(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_GetUserRecoveryCodes', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + truffle_dot_os_dot_client__session__pb2.UserRecoveryCodes.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_UpdateClientState(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_UpdateClientState', + truffle_dot_os_dot_client__state__pb2.UpdateClientStateRequest.SerializeToString, + truffle_dot_os_dot_client__state__pb2.UpdateClientStateResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_GetClientState(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_GetClientState', + truffle_dot_os_dot_client__state__pb2.GetClientStateRequest.SerializeToString, + truffle_dot_os_dot_client__state__pb2.GetClientStateResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Client_GetAllClientStates(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Client_GetAllClientStates', + truffle_dot_os_dot_client__state__pb2.GetAllClientStatesRequest.SerializeToString, + truffle_dot_os_dot_client__state__pb2.GetAllClientStatesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SubscribeToNotifications(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.os.TruffleOS/SubscribeToNotifications', + truffle_dot_os_dot_notification__pb2.SubscribeToNotificationsRequest.SerializeToString, + truffle_dot_os_dot_notification__pb2.Notification.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Hardware_GetStats(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Hardware_GetStats', + truffle_dot_os_dot_hardware__stats__pb2.HardwareStatsRequest.SerializeToString, + truffle_dot_os_dot_hardware__stats__pb2.HardwareStats.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Hardware_StatsUpdates(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.os.TruffleOS/Hardware_StatsUpdates', + truffle_dot_os_dot_hardware__stats__pb2.HardwareStatsRequest.SerializeToString, + truffle_dot_os_dot_hardware__stats__pb2.HardwareStats.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Hardware_PowerControl(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Hardware_PowerControl', + truffle_dot_os_dot_hardware__control__pb2.HardwarePowerControlRequest.SerializeToString, + truffle_dot_os_dot_hardware__control__pb2.HardwarePowerControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def System_GetID(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/System_GetID', + truffle_dot_os_dot_system__info__pb2.SystemGetIDRequest.SerializeToString, + truffle_dot_os_dot_system__info__pb2.SystemGetIDResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def System_GetSettings(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/System_GetSettings', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + truffle_dot_os_dot_system__settings__pb2.SystemSettings.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def System_SetSettings(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/System_SetSettings', + truffle_dot_os_dot_system__settings__pb2.SystemSettings.SerializeToString, + truffle_dot_os_dot_system__settings__pb2.SystemSettings.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def System_GetInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/System_GetInfo', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + truffle_dot_os_dot_system__info__pb2.SystemInfo.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def System_CheckForUpdate(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/System_CheckForUpdate', + truffle_dot_os_dot_system__info__pb2.SystemCheckForUpdateRequest.SerializeToString, + truffle_dot_os_dot_system__info__pb2.SystemCheckForUpdateResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_OpenTask(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.os.TruffleOS/Task_OpenTask', + truffle_dot_os_dot_task__actions__pb2.OpenTaskRequest.SerializeToString, + truffle_dot_os_dot_task__pb2.TaskStreamUpdate.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_InterruptTask(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Task_InterruptTask', + truffle_dot_os_dot_task__actions__pb2.InterruptTaskRequest.SerializeToString, + truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_RespondToTask(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Task_RespondToTask', + truffle_dot_os_dot_task__user__response__pb2.RespondToTaskRequest.SerializeToString, + truffle_dot_os_dot_task__actions__pb2.TaskActionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_SetAvailableApps(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Task_SetAvailableApps', + truffle_dot_os_dot_task__actions__pb2.TaskSetAvailableAppsRequest.SerializeToString, + truffle_dot_os_dot_task__actions__pb2.TaskSetAvailableAppsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_SearchTasks(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Task_SearchTasks', + truffle_dot_os_dot_task__search__pb2.SearchTasksRequest.SerializeToString, + truffle_dot_os_dot_task__search__pb2.SearchTasksResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_GetTasks(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/truffle.os.TruffleOS/Task_GetTasks', + truffle_dot_os_dot_task__queries__pb2.GetTasksRequest.SerializeToString, + truffle_dot_os_dot_task__pb2.Task.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_GetOneTask(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Task_GetOneTask', + truffle_dot_os_dot_task__queries__pb2.GetOneTaskRequest.SerializeToString, + truffle_dot_os_dot_task__pb2.Task.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Task_GetTaskInfos(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/truffle.os.TruffleOS/Task_GetTaskInfos', + truffle_dot_os_dot_task__queries__pb2.GetTaskInfosRequest.SerializeToString, + truffle_dot_os_dot_task__queries__pb2.GetTaskInfosResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True)