CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

jbaruch/nanoclaw-travel

Travel assistant for NanoClaw: byAir flight notifications (delay, gate, connection risk, inbound aircraft delay, time-to-leave, arrival logistics), traffic-aware drive planning for in-person meetings (auto drive blocks + leave-by traffic rechecks), travel-booking gap checks, and nightly TripIt sync. Per-chat overlay plugin.

Quality

90%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

record_attendance.pyskills/drive-engine/

"""JSON-stdin owner intake for conference attendance; see attendance-contract.md."""

from __future__ import annotations

import json
import sys
from pathlib import Path

_BUNDLE_DIR = Path(__file__).resolve().parent
if str(_BUNDLE_DIR) not in sys.path:
    sys.path.insert(0, str(_BUNDLE_DIR))

from conference_attendance import (  # noqa: E402
    MAX_BYTES,
    AttendanceError,
    attendance_record,
    decode_store,
    record_attendance,
)


def main() -> int:
    if sys.argv[1:] == ["--choices"]:
        labels = ("По расписанию", "Только мои слоты", "Свои часы")
        print(
            json.dumps(
                {
                    "schema_version": 1,
                    "kind": "attendance_choices",
                    "buttons": [
                        [
                            {
                                "label": label,
                                "action": "owner.answer.v1",
                                "payload": {"label": label},
                            }
                            for label in labels
                        ]
                    ],
                },
                ensure_ascii=False,
            )
        )
        return 0
    phase = "request_decode"
    try:
        if len(sys.argv) != 1:
            raise ValueError("no arguments")
        # Reuse the exact store decoder, including duplicate/version/bounds checks.
        rows = decode_store(sys.stdin.buffer.read(MAX_BYTES + 1))
        if len(rows) != 1:
            raise ValueError("one row required")
        row = rows[0]
        phase = "state_upsert"
        record_attendance(attendance_record(row))
    # outer-boundary-process-contract: the skill consumes structured stdout;
    # emit a fixed error plus stderr, as a traceback would break its JSON contract.
    except Exception as exc:
        print(
            json.dumps(
                {
                    "schema_version": 1,
                    "recorded": False,
                    "error": "Attendance not recorded; follow attendance-contract.md",
                }
            )
        )
        if isinstance(exc, AttendanceError):
            cause = str(exc)  # Fixed owner messages contain no input values or paths.
        elif isinstance(exc, OSError):
            cause = f"filesystem errno={exc.errno}; verify agent access and storage health"
        elif isinstance(exc, ValueError):
            cause = "invalid intake envelope; provide exactly one row and no arguments"
        else:
            cause = "unexpected owner failure; inspect the installed utility before retrying"
        print(
            f"Attendance intake failed phase={phase} cause={type(exc).__name__}: {cause}",
            file=sys.stderr,
        )
        return 1
    print(json.dumps({"schema_version": 1, "recorded": True, "id": row.id}))
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

skills

README.md

tile.json