Skip to content

valkryhx/google_adk_agent / skills/dex

Dex Async Task Manager

Verified

用于管理长耗时、异步任务的工具集。当任务预计执行时间超过 10 秒(如模型训练、大型构建、批量数据处理)时,必须使用此工具,而不是 bash。

FileKindSize
SKILL.mdskill md3.2 KB
assets/example_asset.txtmarkdown865 B
dex.pyscript4.3 KB
dex_exec.pyscript3.1 KB
models.pyscript2.6 KB
references/api_reference.mdmarkdown954 B
scripts/example.pyscript565 B
store.pyscript4.5 KB
summary.pyscript715 B
tools.pyscript5.3 KB
from __future__ import annotations

from dataclasses import asdict, dataclass, field
from datetime import UTC, datetime
from enum import Enum
from typing import Any


class DexTaskStatus(str, Enum):
    PENDING = "pending"
    RUNNING = "running"
    COMPLETED = "completed"
    FAILED = "failed"
    CANCELED = "canceled"


@dataclass
class DexTaskArtifact:
    kind: str
    path: str
    label: str


@dataclass
class DexTaskEvent:
    kind: str
    message: str
    ts: str
    metadata: dict[str, Any] = field(default_factory=dict)


@dataclass
class DexTask:
    id: str
    user_id: str | None
    description: str
    context: str
    status: DexTaskStatus
    created_at: str
    started_at: str | None = None
    completed_at: str | None = None
    command: list[str] | None = None
    pid: int | None = None
    exit_code: int | None = None
    result_summary: str | None = None
    error_summary: str | None = None
    artifacts: list[DexTaskArtifact] = field(default_factory=list)
    events: list[DexTaskEvent] = field(default_factory=list)
    metadata: dict[str, Any] = field(default_factory=dict)

    @classmethod
    def new(cls, task_id: str, user_id: str | None, description: str, context: str) -> "DexTask":
        return cls(
            id=task_id,
            user_id=user_id,
            description=description,
            context=context,
            status=DexTaskStatus.PENDING,
            created_at=datetime.now(UTC).isoformat(),
        )

    def to_dict(self) -> dict[str, Any]:
        payload = asdict(self)
        payload["status"] = self.status.value
        payload["result"] = self.result_summary or ""
        return payload

    @classmethod
    def from_dict(cls, raw: dict[str, Any]) -> "DexTask":
        return cls(
            id=raw["id"],
            user_id=raw.get("user_id"),
            description=raw.get("description", ""),
            context=raw.get("context", ""),
            status=DexTaskStatus(raw.get("status", DexTaskStatus.PENDING.value)),
            created_at=raw.get("created_at", ""),
            started_at=raw.get("started_at"),
            completed_at=raw.get("completed_at"),
            command=list(raw["command"]) if raw.get("command") else None,
            pid=raw.get("pid"),
            exit_code=raw.get("exit_code"),
            result_summary=raw.get("result_summary") or raw.get("result"),
            error_summary=raw.get("error_summary"),
            artifacts=[DexTaskArtifact(**item) for item in raw.get("artifacts", [])],
            events=[DexTaskEvent(**item) for item in raw.get("events", [])],
            metadata=dict(raw.get("metadata", {})),
        )
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall