← 返回
未分类 Key 中文

ticktick-calendar

TickTick task/project integration toolkit for OAuth2 authorization, token refresh, and typed task/project operations. Use when users need to authenticate wit...
TickTick 任务/项目集成工具包,用于 OAuth2 授权、令牌刷新以及类型化任务/项目操作。在用户需要认证时使用。
one0x393 one0x393 来源
未分类 clawhub v0.1.2 1 版本 99670 Key: 需要
★ 0
Stars
📥 302
下载
💾 0
安装
1
版本
#latest

概述

TickTick Skill

Operate TickTick task/project workflows with strict contracts, runtime token management, typed API access, and OpenClaw-ready action wrappers.

Quick Reference

SituationAction
-------------------
First-time OAuth authorization neededRun npm run ticktick:cli -- auth-url, then auth-exchange with callback URL
Token expired but refresh token existsUse runtime/CLI auto-refresh path (getAccessTokenWithAutoReauth)
Token missing or refresh failedReauthorize from emitted URL and rerun command
Need task creation/update/completeUse runtime.useCases.createTask/updateTask/completeTask or skill actions
Need task/project listingUse runtime.useCases.listTasks/listProjects or CLI commands
Need OpenClaw action integrationUse skill-entry/ticktick-skill.mjs and expose 5 MVP actions
Need error categorization for UX/retryHandle TickTickDomainError categories from src/shared/error-categories.ts

Capabilities

  • OAuth2 contract + runtime token client
  • Authorization URL build/callback parse
  • Authorization-code exchange
  • Refresh-token renewal
  • Typed API client with timeout/retry/error typing
  • HTTP timeout and exponential backoff for retryable failures
  • Core usecases (MVP 5)
  • create_task
  • list_tasks
  • update_task
  • complete_task
  • list_projects
  • OpenClaw/Codex wrapper entrypoints
  • skill-entry/token-manager.mjs
  • skill-entry/ticktick-skill.mjs
  • scripts/ticktick-cli.mjs

Prerequisites

Required environment variables:

  • TICKTICK_CLIENT_ID
  • TICKTICK_CLIENT_SECRET
  • TICKTICK_REDIRECT_URI

Optional runtime defaults:

  • TICKTICK_OAUTH_AUTHORIZE_URL (default: https://ticktick.com/oauth/authorize)
  • TICKTICK_OAUTH_TOKEN_URL (default: https://ticktick.com/oauth/token)
  • TICKTICK_API_BASE_URL (default: https://api.ticktick.com/open/v1)
  • TICKTICK_API_TIMEOUT_MS (default: 10000)
  • TICKTICK_API_MAX_RETRIES (default: 3)
  • TICKTICK_API_RETRY_BASE_DELAY_MS (default: 250)
  • TICKTICK_OAUTH_SCOPE
  • TICKTICK_USER_AGENT

Token and notification options:

  • TICKTICK_TOKEN_PATH (default: ~/.config/ticktick/token.json)
  • TICKTICK_REAUTH_WEBHOOK_URL
  • TICKTICK_REAUTH_NOTIFY_COOLDOWN_MS
  • TICKTICK_REAUTH_NOTIFY_STATE_PATH

OpenClaw Setup (Recommended)

OpenClaw integration is provided through createTickTickOpenClawSkill in skill-entry/ticktick-skill.mjs.

Skill action surface

Expose the following actions:

  • create_task
  • list_tasks
  • update_task
  • complete_task
  • list_projects

Runtime/token behavior

  1. Parse env via parseTickTickEnvFromRuntime.
  2. Resolve token path (options.tokenPath -> TICKTICK_TOKEN_PATH -> default path).
  3. Load access token with auto refresh (getAccessTokenWithAutoReauth).
  4. On missing/expired token without valid refresh token:
    • raise ReauthRequiredError
    • optionally notify via webhook
    • surface reauthorization URL to caller.

CLI Workflow (Practical)

1) Generate OAuth URL

npm run ticktick:cli -- auth-url

2) Exchange callback for token file

npm run ticktick:cli -- auth-exchange --callbackUrl "http://localhost:3000/oauth/callback?code=...&state=..."

3) Run actions

npm run ticktick:cli -- list-projects
npm run ticktick:cli -- list-tasks --projectId <projectId> --limit 20
npm run ticktick:cli -- create-task --projectId <projectId> --title "Write docs" --priority 3
npm run ticktick:cli -- update-task --taskId <taskId> --priority 5
npm run ticktick:cli -- complete-task --taskId <taskId>

Programmatic Workflow

  1. Load env: parseTickTickEnvFromRuntime()
  2. Build runtime: createTickTickRuntime({ env, getAccessToken })
  3. Execute usecases via runtime.useCases.*
  4. Handle category-mapped errors in caller for retry/UX behavior
  5. Persist/rotate token outside process memory when used in production

Error Mapping Contract

Normalize API/runtime errors to domain categories:

CategoryTypical Source
--------------------------
auth_401Invalid/expired access token
auth_403Scope/permission denied
not_found_404Missing task/project resource
rate_limit_429TickTick rate-limited request
server_5xxTickTick server-side failure
networkTimeout, transport, DNS, fetch failures
validationInput contract or payload mismatch
unknownNon-classified fallback

Verification Gates

Run after any implementation or integration change:

npm run typecheck
npm test

If either gate fails, do not finalize until fixed or explicitly accepted by user.

Troubleshooting

Token file not found

  • Symptom: ReauthRequiredError with message about missing token file
  • Action: run auth-url -> complete browser consent -> run auth-exchange

Token expired and refresh unavailable

  • Symptom: runtime/CLI asks for reauthorization URL
  • Action: complete OAuth again and persist new token JSON

401/403 on valid token

  • Verify OAuth app scopes and redirect URI alignment
  • Confirm .env values match TickTick app configuration

429/5xx spikes

  • Check retry settings:
  • TICKTICK_API_MAX_RETRIES
  • TICKTICK_API_RETRY_BASE_DELAY_MS
  • Add higher-level caller backoff if workload is bursty

References

  • README.md
  • docs/openclaw-skill-guide.md
  • skill-entry/token-manager.mjs
  • skill-entry/ticktick-skill.mjs
  • scripts/ticktick-cli.mjs
  • src/core/ticktick-runtime.ts
  • src/core/ticktick-usecases.ts
  • src/api/ticktick-api-client.ts
  • src/api/ticktick-gateway.ts
  • src/shared/error-categories.ts

版本历史

共 1 个版本

  • v0.1.2 当前
    2026-05-12 05:33 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,418
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,082 📥 810,014
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,227 📥 267,818