repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
QwenPaw
plugins/apps/qwenpaw-creator/backend/tests/models/test_video_reference_transport.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=protected-access from __future__ import annotations import asyncio import io import pytest from PIL import Image from models import config as model_config from models import video_model from utils.exceptions import ModelError def _png_bytes() -> bytes:...
212
5,397
QwenPaw
plugins/apps/qwenpaw-creator/backend/tests/models/test_embedding_model.py
.py
# -*- coding: utf-8 -*- # pylint: disable=protected-access """Embedding thin-client batching, backoff and config resolution tests.""" from __future__ import annotations import asyncio import httpx import pytest from models import embedding_model from utils.exceptions import ModelError class _Response: def __in...
168
4,789
QwenPaw
plugins/apps/qwenpaw-creator/backend/scripts/seed_demo_projects.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Create repeatable demo projects through the public Creator HTTP API. This script intentionally has no storage/database imports and never writes a Project tree itself. Project bootstrap, immutable asset ingest, and the first goal message all go through the same API bound...
271
8,974
QwenPaw
plugins/apps/qwenpaw-creator/backend/scripts/smoke_web_grounding.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=wrong-import-position """Run live Creator web grounding without creating a Project. This is an opt-in smoke-test executable, not a pytest test. It calls the configured text/image search and VLM providers, downloads candidates, performs raster validation, a...
293
10,213
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/content_disposition.py
.py
# -*- coding: utf-8 -*- """Shared response-header helpers for serving named Creator files.""" from __future__ import annotations import mimetypes from pathlib import Path from urllib.parse import quote def inline_content_disposition(name: str, media_type: str = "") -> str: """Build a Latin-1-safe inline filenam...
42
1,406
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/model_routes.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=line-too-long,protected-access,too-many-branches # pylint: disable=too-many-return-statements,too-many-statements # pylint: disable=wrong-import-order # pylint: disable=raise-missing-from """External-root model configuration and explicit provider connection...
1,767
64,223
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/__init__.py
.py
# -*- coding: utf-8 -*- """Creator HTTP package. Composition roots import :mod:`api.router` explicitly. Keeping this package initializer side-effect free prevents an incidental ``import api`` (for example, while loading one route module in a test) from composing the complete HTTP surface or reviving the removed flat ...
9
348
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/project_file_routes.py
.py
# -*- coding: utf-8 -*- # pylint: disable=protected-access,too-many-branches,too-many-return-statements # pylint: disable=too-many-statements """File-native Project snapshot, patch, block, and Review endpoints.""" from __future__ import annotations import asyncio import logging from typing import Any, Literal from f...
1,138
40,027
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/router.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Composition root for the unique Creator API. Routes in this router intentionally begin at ``/projects``. The QwenPaw host mounts the router at ``/qwenpaw-creator`` and standalone development mounts it at ``/api/qwenpaw-creator``. """ from __future__ import annotations ...
77
2,657
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/example_routes.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """OSS-hosted inspiration example Projects. Example archives are not shipped with the plugin; only a small ``backend/examples/manifest.json`` catalogue is bundled, and each entry points at a public archive URL (OSS) plus its sha256. Opening an example lazily downloads the ...
391
13,694
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/file_asset_routes.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=raise-missing-from,too-many-branches,too-many-statements # pylint: disable=unused-argument """File-native immutable Asset ingest, index, import and content routes.""" from __future__ import annotations import asyncio from contextlib import nullcontext fro...
1,914
65,495
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/dependencies.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """FastAPI dependencies for Creator storage and request infrastructure.""" from __future__ import annotations from collections.abc import AsyncIterator, Awaitable, Callable from uuid import uuid4 from fastapi import Depends, Request, Response from fastapi.routing import A...
136
4,181
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/project_routes.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=try-except-raise """File-native Project lifecycle routes. ``project.json`` and its Project-local ``runtime/`` tree are the only durable authorities used here. """ from __future__ import annotations import asyncio import shutil import stat as stat_module ...
650
23,363
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/file_session_routes.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """File-native Creator Session, Conversation, Message, Event, and stop routes.""" from __future__ import annotations import asyncio from collections.abc import AsyncIterator from hashlib import sha256 import json import logging from typing import Any from fastapi import (...
643
20,556
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/work_graph_routes.py
.py
# -*- coding: utf-8 -*- """Work-graph HTTP surface: read the production DAG, dispatch one node. The graph is derived on demand from durable facts (never persisted), so GET is cheap and always current. Manual dispatch is the human override: it bypasses the scheduler's once-per-fingerprint ledger deliberately — a person...
127
4,305
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/file_execution_routes.py
.py
# -*- coding: utf-8 -*- """File-native SpecialistRun and Task query/cancellation routes.""" from __future__ import annotations import asyncio import logging import secrets from typing import Any from fastapi import APIRouter, Depends, Header, Query, status from pydantic import Field from domain.enums import ( C...
706
23,884
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/file_source_intelligence_routes.py
.py
# -*- coding: utf-8 -*- """File-native Source Intelligence analyze and read APIs.""" from __future__ import annotations import asyncio import re from fastapi import APIRouter, Depends, Header, HTTPException, Query, status from fastapi.responses import FileResponse from pydantic import Field from domain.errors impor...
135
3,998
QwenPaw
plugins/apps/qwenpaw-creator/backend/api/file_media_routes.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Read-only media delivery from Project Asset indexes and file namespaces.""" from __future__ import annotations import asyncio from collections.abc import Iterator from pathlib import Path import re from typing import Any, Literal from fastapi import APIRouter, Depends,...
689
23,587
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/logger.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Centralized logging configuration for the backend.""" from __future__ import annotations import logging import os import sys from collections.abc import Callable from logging.handlers import TimedRotatingFileHandler from pathlib import Path _LOG_FORMAT = ( "%(ascti...
245
7,136
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/exceptions.py
.py
# -*- coding: utf-8 -*- # pylint: disable=redefined-builtin """Custom exception hierarchy for structured error handling.""" class AppError(Exception): """Base application exception with error code and HTTP status.""" def __init__( self, message: str, code: str = "INTERNAL_ERROR", ...
51
1,515
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/__init__.py
.py
# -*- coding: utf-8 -*- # pylint: disable=import-self """Utility modules: logging, retry, exceptions.""" from utils.logger import logger, setup_logger from utils.exceptions import AppError, AgentError, ModelError, ValidationError from utils.retry import retry __all__ = [ "logger", "setup_logger", "AppErro...
18
398
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/remote_download.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Download remote files through the shared SSRF-safe transport. All Creator remote media downloads share one DNS/peer/redirect/size policy in ``services.runtime_files.safe_remote_download``; this module only adds the durable temp-file + atomic-rename boundary and env-tunab...
158
5,633
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/retry.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=line-too-long """Retry decorator with exponential backoff, supports both sync and async functions.""" import asyncio import functools import time from typing import Tuple, Type from utils.logger import setup_logger logger = setup_logger("retry") def re...
75
2,738
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/paths.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Canonical Creator media paths exposed through the ``/generated`` route. The HTTP route is a stable transport surface for the current UI. Its first path segment always names one of the four on-disk media namespaces; no ``CREATOR_DATA_ROOT/generated`` directory or legacy ...
252
8,015
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/structured_output.py
.py
# -*- coding: utf-8 -*- """Helpers for extracting structured JSON from model responses.""" from __future__ import annotations import json from typing import Any def _strip_fenced_block(text: str) -> str | None: if "```json" in text: return text.split("```json", 1)[1].split("```", 1)[0].strip() if "`...
83
2,426
QwenPaw
plugins/apps/qwenpaw-creator/backend/utils/env.py
.py
# -*- coding: utf-8 -*- """Environment loading anchored at the project root.""" from pathlib import Path from dotenv import load_dotenv PROJECT_ROOT = Path(__file__).resolve().parents[2] def load_project_env() -> None: load_dotenv(PROJECT_ROOT / ".env", override=False)
14
280
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/media_transport.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=line-too-long,too-many-return-statements import asyncio import base64 import hashlib import io import mimetypes import re import time import uuid from datetime import datetime, timezone from pathlib import Path from urllib.parse import quote, urlparse impo...
706
23,863
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/concurrency.py
.py
# -*- coding: utf-8 -*- """Shared async concurrency limits for model calls.""" from __future__ import annotations import asyncio from contextlib import asynccontextmanager from typing import AsyncIterator from models import config _limiters: dict[str, tuple[int, asyncio.Semaphore]] = {} def _get_limiter(name: str...
40
1,153
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/tts_model.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Text-to-speech client for Creator narration and character voices. Two DashScope families share the ``creator_tts_model`` configuration and are routed by :mod:`models.tts_capabilities`: - ``qwen-tts`` synthesizes over HTTP and manages voices through ``qwen-voice-enroll...
576
19,151
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/provider_tasks.py
.py
# -*- coding: utf-8 -*- """Durable ledger of accepted (billed) provider task ids. A model client that submits an asynchronous provider task is billed the moment the provider accepts it, but the client itself owns no durable state. Records land in the current Task's own durable scratch directory (``runtime/task-work/<t...
110
3,290
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/text_model.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Small OpenAI-compatible text-model client for semantic media planning.""" from __future__ import annotations import httpx from models import config as model_config from models.concurrency import model_slot from utils.exceptions import ModelError def _chat_url() -> st...
88
2,795
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/vlm_model.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=line-too-long,too-many-branches,too-many-statements """DashScope Bailian VLM wrapper for multimodal understanding. The Bailian vision API is OpenAI Chat compatible: image inputs use ``image_url`` content parts and video inputs use ``video_url`` content par...
392
13,482
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/video_capabilities.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Model-aware capability catalog for reference-to-video providers. Both the submit path (``models.video_model``) and the specialist prompt surface (``services.file_agent_runtime.subagents``) consult this module so model-specific request constraints and prompt-writing rules...
288
11,653
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/model_capability_cache.py
.py
# -*- coding: utf-8 -*- from __future__ import annotations import threading class ModelCapabilityCache: def __init__(self) -> None: self._lock = threading.Lock() self._data: dict[str, dict[str, bool]] = {} def learn(self, model_key: str, capability: str, value: bool) -> None: with se...
45
1,168
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/embedding_model.py
.py
# -*- coding: utf-8 -*- """DashScope native multimodal-embedding thin client. Creator-native rewrite of the upstream video-memory embedding transport (手法 A): the vendored index keeps only local math, while every HTTP call goes through this client with the ``creator_embedding_model`` config tree. The native endpoint re...
144
4,691
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/s2v_model.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Digital-human lip-sync client for DashScope Wan2.2-S2V. Protocol-aligned thin client (手法 A), transcribed from the upstream ``wan_s2v.py`` tool and the Bailian API reference: - ``detect_face``: POST ``{base}/services/aigc/image2video/face-detect`` with ``{"model": <det...
411
14,670
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/config.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Centralized model/tool configuration for Creator generation backends. Environment variables remain the standalone/local fallback, while QwenPaw loads request-scoped values from the current agent's tool configuration. """ from contextvars import ContextVar, Token import ...
1,781
55,423
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/asr_model.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=subprocess-run-check """Normalized speech-to-text clients for Creator Source Intelligence.""" from __future__ import annotations import asyncio import json import math import mimetypes import random import re import subprocess import tempfile import loggi...
1,102
37,086
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/video_model.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=line-too-long,raise-missing-from,too-many-branches # pylint: disable=too-many-statements,wrong-import-order """Video model wrapper for DashScope Bailian Wan2.7 video synthesis.""" import asyncio import json import mimetypes from pathlib import Path import ...
851
32,690
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/native_content.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """AgentScope-native message blocks for Creator text and media parts.""" from __future__ import annotations import base64 from collections.abc import Mapping, Sequence import mimetypes from typing import Any from agentscope.message import Base64Source, DataBlock, TextBloc...
142
5,288
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/tts_capabilities.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 """Capability table for the supported DashScope speech-synthesis models. The provider exposes two families that share nothing but the credential: - ``qwen-tts``: synthesis over HTTP ``multimodal-generation``; voice cloning and voice design live on separate companion mode...
147
4,581
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/dashscope_multimodal.py
.py
# -*- coding: utf-8 -*- """DashScope-native multimodal blocks that preserve documented video options. AgentScope 2.0.2 correctly transports a ``DataBlock`` as ``video_url``, but its stock DashScope formatter only keeps the URL. DashScope's OpenAI-compatible API also accepts sampling options such as ``fps`` on the con...
47
1,742
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/image/dashscope_provider.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=line-too-long,ungrouped-imports,wrong-import-order """DashScope multimodal-generation image provider (qwen-image-2.0-pro). Endpoint: POST {IMAGE_BASE_URL} (the base URL is already the full /api/v1/services/aigc/multimodal-generation/...
681
26,843
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/image/__init__.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=protected-access,too-many-return-statements """Image generation providers. Public API: get_image_model() -> BaseImageModel generate_image(prompt, aspect_ratio, reference_image_urls) -> str The provider is selected by ``IMAGE_MODEL`` (DASHSCOPE / ...
149
5,132
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/image/openai_provider.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=ungrouped-imports """OpenAI Images API image provider (routify / gpt-image-2). Endpoint: POST {IMAGE_BASE_URL}[/v1]/images/generations[/edits] (the /v1 segment is added only when the base URL lacks it) Protocol: https://developers.openai.com/a...
527
19,333
QwenPaw
plugins/apps/qwenpaw-creator/backend/models/image/base.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=protected-access,raise-missing-from """Abstract base and shared helpers for image generation providers. A small provider abstraction so multiple image backends share the same API: BaseImageModel.generate(prompt, aspect_ratio, reference_image_urls) -> ...
466
17,153
QwenPaw
plugins/apps/qwenpaw-creator/e2e/config.py
.py
# -*- coding: utf-8 -*- from __future__ import annotations import os UI_HOST = os.getenv("QWENPAW_UI_HOST", "127.0.0.1") UI_PORT = os.getenv("QWENPAW_UI_PORT", "5173") BASE_URL = os.getenv("CREATOR_E2E_BASE_URL", f"http://{UI_HOST}:{UI_PORT}") API_PREFIX = "/api/qwenpaw-creator" STRICT = os.getenv("CREATOR_E2E_STRI...
13
337
QwenPaw
plugins/apps/qwenpaw-creator/e2e/conftest.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=redefined-outer-name,use-sequence-for-iteration # pylint: disable=wrong-import-position from __future__ import annotations import sys from pathlib import Path from uuid import uuid4 import pytest E2E_DIR = Path(__file__).resolve().parent if str(E2E_DIR...
82
2,241
QwenPaw
plugins/apps/qwenpaw-creator/e2e/tests/test_shell.py
.py
# -*- coding: utf-8 -*- from uuid import uuid4 import pytest from playwright.sync_api import expect from pages.home_page import HomePage pytestmark = pytest.mark.shell def test_home_and_composer_use_current_project_contract(page): home = HomePage(page).open() expect(page.get_by_role("heading", name="我的项目...
66
2,128
QwenPaw
plugins/apps/qwenpaw-creator/e2e/tests/test_timeline_element_plan.py
.py
# -*- coding: utf-8 -*- from __future__ import annotations from urllib.parse import unquote import pytest from playwright.sync_api import expect from pages.plan_page import PlanPage pytestmark = pytest.mark.timeline def _location() -> dict: return { "coordinate_space": "normalized_canvas", "...
153
4,911
QwenPaw
plugins/apps/qwenpaw-creator/e2e/tests/test_assets.py
.py
# -*- coding: utf-8 -*- from __future__ import annotations import pytest pytestmark = pytest.mark.assets def test_supplement_upload_is_indexed_in_project(page, api, project, tmp_path): project_id = project["projectId"] source = tmp_path / "source.txt" source.write_text("immutable supplement source", e...
47
1,864
QwenPaw
plugins/apps/qwenpaw-creator/e2e/pages/plan_page.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 from __future__ import annotations from playwright.sync_api import Locator, Page, expect class PlanPage: def __init__(self, page: Page): self.page = page def open(self, project_id: str) -> "PlanPage": self.page.goto(f"/#/project/{project_id}/plan...
70
2,800
QwenPaw
plugins/apps/qwenpaw-creator/e2e/pages/home_page.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 from __future__ import annotations from playwright.sync_api import Locator, Page from pages.composer import ComposerModal class HomePage: def __init__(self, page: Page): self.page = page def open(self): self.page.goto("/#/") self.page.get...
39
1,378
QwenPaw
plugins/apps/qwenpaw-creator/e2e/pages/composer.py
.py
# -*- coding: utf-8 -*- from __future__ import annotations import re from pathlib import Path from typing import Iterable from playwright.sync_api import Locator, Page class ComposerModal: """Drive the hero composer card on the redesigned "开始创作" view.""" def __init__(self, page: Page): self.page = ...
80
2,517
QwenPaw
plugins/apps/qwenpaw-creator/e2e/utils/ffprobe.py
.py
# -*- coding: utf-8 -*- # pylint: disable=subprocess-run-check from __future__ import annotations import json import shutil import subprocess def ffprobe_available() -> bool: return shutil.which("ffprobe") is not None def probe_duration_seconds(media_path: str) -> float: ffprobe = shutil.which("ffprobe") ...
48
1,217
QwenPaw
plugins/apps/qwenpaw-creator/e2e/utils/backend_process.py
.py
# -*- coding: utf-8 -*- # pylint: disable=consider-using-with """Launch and hard-restart the real Creator backend as an external process. The release E2E suite deliberately imports no backend module here. Recovery is exercised through the same uvicorn entry point and public HTTP surface used by the local product runt...
184
6,116
QwenPaw
plugins/apps/qwenpaw-creator/e2e/utils/api_client.py
.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 # pylint: disable=redefined-outer-name from __future__ import annotations import hashlib import json import time from typing import Any from uuid import uuid4 import requests import config as e2e_config def _json_hash(value: Any) -> str: encoded = json.dumps( ...
198
5,771
QwenPaw
plugins/apps/agent-kanban/backend/main.py
.py
# -*- coding: utf-8 -*- # pylint: disable=too-many-branches,too-many-statements,too-many-nested-blocks """Agent Kanban — PawApp backend. A Kanban board where issues are created, assigned to agents, and auto-run through the assigned agent via ``ctx.chat``. Agents can query their own assigned issues through the ``list_m...
1,314
44,377
QwenPaw
plugins/middleware-demo/thinking-log-middleware/thinking_log_plugin.py
.py
# -*- coding: utf-8 -*- """Thinking Log Middleware Demo Plugin. Demonstrates `on_reasoning` middleware that captures and prints the model's chain-of-thought reasoning steps to stdout. This middleware is always active (the factory unconditionally returns an instance), showing the simplest possible registration pattern...
67
1,944
QwenPaw
plugins/middleware-demo/tracing-middleware/tracing_plugin.py
.py
# -*- coding: utf-8 -*- """Tracing Middleware Demo Plugin. Demonstrates `on_acting` middleware that logs every tool call with timing information to a trace file in the workspace. The middleware factory conditionally activates: it returns None (skip) unless the ``QWENPAW_TRACE`` environment variable is set. """ impor...
80
2,438
QwenPaw
plugins/tool/wan27/wan27.py
.py
# -*- coding: utf-8 -*- """Wan 2.7 Video Generation Tool Plugin Entry Point.""" import importlib.util import logging import os from qwenpaw.plugins.api import PluginApi logger = logging.getLogger(__name__) _PLUGIN_DIR = os.path.dirname(os.path.abspath(__file__)) def _load_tool_module(): """Load wan27_tool.py ...
73
1,953
QwenPaw
plugins/tool/wan27/wan27_tool.py
.py
# -*- coding: utf-8 -*- # pylint: disable=too-many-return-statements,too-many-branches # pylint: disable=too-many-statements,too-many-locals """Wan 2.7 video generation tools.""" import asyncio import base64 import logging import mimetypes import threading import time from http import HTTPStatus from pathlib import Pa...
988
32,716
QwenPaw
plugins/tool/qwen-image/qwen_image.py
.py
# -*- coding: utf-8 -*- """Qwen-Image Tool Plugin Entry Point.""" import importlib.util import logging import os from qwenpaw.plugins.api import PluginApi logger = logging.getLogger(__name__) _PLUGIN_DIR = os.path.dirname(os.path.abspath(__file__)) def _load_tool_module(): """Load qwen_image_tool.py from this...
65
1,635
QwenPaw
plugins/tool/qwen-image/qwen_image_tool.py
.py
# -*- coding: utf-8 -*- # pylint: disable=too-many-return-statements,too-many-branches # pylint: disable=too-many-statements,too-many-locals """Qwen-Image image generation and editing tools.""" import asyncio import base64 import logging import mimetypes import threading import time from pathlib import Path from typin...
763
23,708
QwenPaw
plugins/tool/gpt-image2/gpt_image2_tool.py
.py
# -*- coding: utf-8 -*- # pylint: disable=too-many-return-statements,too-many-branches """GPT Image 2 image generation tool.""" import base64 import logging import mimetypes import time from pathlib import Path from typing import List import httpx from agentscope.message import DataBlock, TextBlock, URLSource from ag...
605
20,132
QwenPaw
plugins/tool/gpt-image2/gpt_image2.py
.py
# -*- coding: utf-8 -*- """GPT Image 2 Tool Plugin Entry Point.""" import importlib.util import logging import os from qwenpaw.plugins.api import PluginApi logger = logging.getLogger(__name__) _PLUGIN_DIR = os.path.dirname(os.path.abspath(__file__)) def _load_tool_module(): """Load gpt_image2_tool.py from thi...
66
1,673
QwenPaw
plugins/bundle/qwenpaw-pet/router.py
.py
# -*- coding: utf-8 -*- """QwenPaw plugin HTTP routes.""" from __future__ import annotations import json import mimetypes import re import shutil import tempfile import zipfile from pathlib import Path from fastapi import APIRouter, File, Form, HTTPException, UploadFile from fastapi.responses import FileResponse fro...
395
13,832
QwenPaw
plugins/bundle/qwenpaw-pet/emitter.py
.py
# -*- coding: utf-8 -*- """Fire-and-forget desktop event emitter.""" from __future__ import annotations import asyncio import functools import logging import os import socket import subprocess import sys import threading import time from pathlib import Path from typing import Any from urllib.parse import urlparse im...
792
26,349
QwenPaw
plugins/bundle/qwenpaw-pet/pet_paths.py
.py
# -*- coding: utf-8 -*- """Resolve QwenPaw working dir and list installed pet packages.""" from __future__ import annotations import json import os from pathlib import Path from typing import Any def qwenpaw_working_dir() -> Path: """Match ``qwenpaw_pet_desktop.runtime.qwenpaw_working_dir`` precedence.""" e...
75
2,392
QwenPaw
plugins/bundle/qwenpaw-pet/plugin.py
.py
# -*- coding: utf-8 -*- """QwenPaw Pet backend plugin entry point.""" # pylint: disable=wrong-import-position,wrong-import-order import atexit import logging import os import sys from pathlib import Path # ``qwenpaw plugin install`` execs this file as a plain module (no # package), so sibling modules are not reachab...
172
5,666
QwenPaw
plugins/bundle/qwenpaw-pet/patch_approval.py
.py
# -*- coding: utf-8 -*- """Hook ApprovalService so console pending approvals drive the desktop pet.""" from __future__ import annotations import logging from typing import Any from emitter import schedule_emit_pet_event logger = logging.getLogger("qwenpaw.pet_desktop") _PATCHED = False _ORIG_CREATE_PENDING: Any = ...
167
5,669
QwenPaw
plugins/bundle/qwenpaw-pet/patch_runner.py
.py
# -*- coding: utf-8 -*- # pylint: disable=protected-access """Wrap ``Workspace.stream_query`` to emit pet lifecycle events. Emissions: - ``query.received`` / ``query.running`` — fired up-front - ``query.first_token`` (Replying) — first ``Message`` envelope with ``type=message`` and ``status=in_p...
312
10,584
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/pet_package.py
.py
# -*- coding: utf-8 -*- """Load and install Codex-compatible pet packages.""" from __future__ import annotations import json import shutil from pathlib import Path from typing import Any from PIL import Image from . import runtime from .sprites import ATLAS_HEIGHT, ATLAS_WIDTH SNOWPAW_PET_ID = "snowpaw" def vali...
161
5,491
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/server.py
.py
# -*- coding: utf-8 -*- """Local HTTP bridge for QwenPaw lifecycle events.""" from __future__ import annotations import logging import os import time from pathlib import Path from typing import Any, Callable from fastapi import FastAPI, Header, HTTPException, Request from pydantic import BaseModel, ConfigDict, model...
182
5,493
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/app.py
.py
# -*- coding: utf-8 -*- """Desktop app entry point.""" from __future__ import annotations import argparse import logging import os import signal import sys import threading from copy import deepcopy from pathlib import Path from queue import Empty, SimpleQueue from typing import Any, Callable import uvicorn from PyS...
173
5,653
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/runtime.py
.py
# -*- coding: utf-8 -*- """Runtime paths, process state, and small JSON helpers.""" from __future__ import annotations import json import os import secrets import signal import subprocess import sys import time from pathlib import Path from typing import Any def home_dir() -> Path: return Path( os.envir...
483
12,609
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/window.py
.py
# -*- coding: utf-8 -*- """Transparent Qt desktop pet window.""" from __future__ import annotations import sys import time from pathlib import Path from typing import Any from PySide6.QtCore import QPoint, QRect, Qt, QTimer from PySide6.QtGui import QColor, QFont, QFontMetrics, QPainter, QPixmap from PySide6.QtWidge...
499
17,186
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/__main__.py
.py
# -*- coding: utf-8 -*- from .cli import main if __name__ == "__main__": raise SystemExit(main())
7
104
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/__init__.py
.py
# -*- coding: utf-8 -*- """QwenPaw Pet Desktop runtime.""" __version__ = "0.1.0"
5
82
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/sprites.py
.py
# -*- coding: utf-8 -*- """Codex-compatible pet atlas constants.""" CELL_WIDTH = 192 CELL_HEIGHT = 208 COLUMNS = 8 ROWS = 9 ATLAS_WIDTH = CELL_WIDTH * COLUMNS ATLAS_HEIGHT = CELL_HEIGHT * ROWS STATE_SPECS = { "idle": {"row": 0, "frames": 6, "dur": 280, "last": 480}, "running-right": {"row": 1, "frames": 8, "d...
56
1,736
QwenPaw
plugins/bundle/qwenpaw-pet/qwenpaw_pet_desktop/cli.py
.py
# -*- coding: utf-8 -*- """Command-line management for QwenPaw Pet Desktop.""" from __future__ import annotations import argparse import json import os import subprocess import sys import urllib.error import urllib.request from pathlib import Path from . import runtime from .pet_package import install_default_pet, i...
226
7,081
QwenPaw
plugins/bundle/cloudpaw/routers_setup.py
.py
# -*- coding: utf-8 -*- """API router builders for CloudPaw plugin. Returns FastAPI APIRouter instances that the plugin registers via ``api.register_http_router()`` — no manual app mounting needed. """ import logging logger = logging.getLogger("qwenpaw").getChild( __name__.replace("plugin_cloudpaw.", ""), ) de...
30
798
QwenPaw
plugins/bundle/cloudpaw/__init__.py
.py
# -*- coding: utf-8 -*- """CloudPaw Plugin for QwenPaw."""
3
59
QwenPaw
plugins/bundle/cloudpaw/hooks.py
.py
# -*- coding: utf-8 -*- # pylint: disable=protected-access """Monkey-patch hooks for tools, prompts, and mission mode.""" import logging import os import shutil from pathlib import Path from .constants import ( BUILTIN_EXECUTOR_AGENT_ID, BUILTIN_ORCHESTRATION_AGENT_ID, BUILTIN_VERIFIER_AGENT_ID, PLUGI...
709
24,617
QwenPaw
plugins/bundle/cloudpaw/constants.py
.py
# -*- coding: utf-8 -*- """Shared constants for CloudPaw plugin.""" import sys from pathlib import Path from typing import Any PLUGIN_DIR = Path(__file__).parent _plugin_dir_str = str(PLUGIN_DIR) if _plugin_dir_str not in sys.path: sys.path.insert(0, _plugin_dir_str) BUILTIN_ORCHESTRATION_AGENT_ID = "cloud-orch...
141
4,517
QwenPaw
plugins/bundle/cloudpaw/injectors.py
.py
# -*- coding: utf-8 -*- """Synthetic module injectors for CloudPaw plugin.""" import logging import sys logger = logging.getLogger("qwenpaw").getChild( __name__.replace("plugin_cloudpaw.", ""), ) def inject_interaction_module() -> None: """Inject the interaction module into the qwenpaw.app namespace.""" ...
61
1,734
QwenPaw
plugins/bundle/cloudpaw/a2a_mode.py
.py
# -*- coding: utf-8 -*- """A2A mode — ``AgentMode`` for A2A agent communication. Exposes ``/a2a`` slash command via ``SlashCommandRegistry``. """ from __future__ import annotations import json import logging from pathlib import Path from typing import TYPE_CHECKING, Optional from agentscope.message import Msg, Text...
183
5,950
QwenPaw
plugins/bundle/cloudpaw/agents_setup.py
.py
# -*- coding: utf-8 -*- """Agent registration and workspace initialization for CloudPaw plugin.""" import json import logging import shutil from pathlib import Path from typing import Any from .constants import ( BUILTIN_EXECUTOR_AGENT_ID, BUILTIN_ORCHESTRATION_AGENT_ID, BUILTIN_VERIFIER_AGENT_ID, PLU...
515
16,445
QwenPaw
plugins/bundle/cloudpaw/plugin.py
.py
# -*- coding: utf-8 -*- # pylint: disable=protected-access """CloudPaw Plugin for QwenPaw. Provides Alibaba Cloud deployment orchestration capabilities: - Built-in agents (Orchestration + IaC Code + Executor + Verifier) - Custom skills (alicloud_cli, terraform, etc.) - Custom tools (proposal_choice, manage_prd) - API ...
600
19,707
QwenPaw
plugins/bundle/cloudpaw/routers/__init__.py
.py
# -*- coding: utf-8 -*- """CloudPaw API routers."""
3
52
QwenPaw
plugins/bundle/cloudpaw/routers/interaction.py
.py
# -*- coding: utf-8 -*- """Interaction API router for CloudPaw plugin. POST /api/interaction — resolve a pending user interaction. """ import logging from fastapi import APIRouter, HTTPException from pydantic import BaseModel # pylint: disable=no-name-in-module from qwenpaw.app.interaction import InteractionManager...
36
878
QwenPaw
plugins/bundle/cloudpaw/routers/prd.py
.py
# -*- coding: utf-8 -*- """PRD API router for CloudPaw plugin. GET /api/prd?loop_dir=... — read prd.json or a snapshot. """ import json import logging from pathlib import Path from fastapi import APIRouter, HTTPException, Query logger = logging.getLogger("qwenpaw").getChild("plugin.cloudpaw.routers.prd") router = ...
45
1,186
QwenPaw
plugins/bundle/cloudpaw/routers/a2a.py
.py
# -*- coding: utf-8 -*- """REST API endpoints for A2A remote agent management (per-agent scoped). Endpoints: GET /a2a/agents – list registered agents for current agent POST /a2a/agents – register (discover + connect) DELETE /a2a/agents/{alias} – disconnect and remove POST /...
684
21,208
QwenPaw
plugins/bundle/cloudpaw/tools/proposal_choice.py
.py
# -*- coding: utf-8 -*- """Proposal choice tool for interactive resource selection. Presents resource proposals to users in table format and waits for their selection. Supports up to 5 proposals with resource details, including multi-strategy proposals from iac-code. Auto-corrects common LLM formatting mistakes: - St...
373
12,761
QwenPaw
plugins/bundle/cloudpaw/tools/a2a_config_helper.py
.py
# -*- coding: utf-8 -*- """Helpers to read per-agent A2A configuration from workspace. Used by ``a2a_list`` and ``a2a_call`` tools to resolve registered A2A agents by alias without requiring the caller to know URLs. """ from __future__ import annotations import json import logging from pathlib import Path logger = ...
58
1,695
QwenPaw
plugins/bundle/cloudpaw/tools/a2a_call.py
.py
# -*- coding: utf-8 -*- """A2A call tool: send a message to a remote A2A Agent. Supports resolution by alias (reading from per-agent a2a_config.json) or by direct URL. When using alias, auth config is automatically applied from the stored registration. The tool is an ``AsyncGenerator`` that yields intermediate ``Too...
438
14,919
QwenPaw
plugins/bundle/cloudpaw/tools/a2a_list.py
.py
# -*- coding: utf-8 -*- """A2A list tool: list registered remote A2A agents for the current agent. Reads the per-agent ``a2a_config.json`` and returns a summary of all registered remote agents with their connection info and capabilities. """ import json import logging from agentscope.message import TextBlock from ag...
84
2,815
QwenPaw
plugins/bundle/cloudpaw/tools/__init__.py
.py
# -*- coding: utf-8 -*- """CloudPaw custom tools."""
3
53
QwenPaw
plugins/bundle/cloudpaw/tools/a2a_discover.py
.py
# -*- coding: utf-8 -*- """A2A discover tool: discover remote A2A Agent and get its info. Resolves Agent Card, establishes authenticated connection, and returns agent capabilities for the calling agent to decide whether/how to interact with the remote agent. """ import json import logging from agentscope.message imp...
84
2,540
QwenPaw
plugins/bundle/cloudpaw/tools/manage_prd.py
.py
# -*- coding: utf-8 -*- """Manage PRD tool — CRUD and mark_passed for prd.json stories.""" import json import logging import time from pathlib import Path from typing import Any from agentscope.message import TextBlock from agentscope.message import ToolResultState from agentscope.tool import ToolChunk logger = logg...
480
16,253