Go to file
ywkj b29037526b feat: install.sh 自动下载安装 auth-rt(无需手动 clone)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 18:36:47 +08:00
.forgejo/workflows ci: use shared-actions/register-skill composite action 2026-03-12 21:58:58 +08:00
agents feat: initial commit 2026-03-12 07:36:43 +08:00
references feat: initial commit 2026-03-12 07:36:43 +08:00
scripts refactor: simplify index.ts — use ctx object instead of 8-param helpers 2026-03-19 07:16:46 +08:00
src chore: auth-rt 默认路径改为 ~/.local/bin/ 2026-03-20 18:35:37 +08:00
.env.example chore: clean CLIENT_KEY references from SKILL.md and .env.example 2026-03-19 08:31:57 +08:00
.gitignore feat: initial commit 2026-03-12 07:36:43 +08:00
ASYNC.md feat: initial commit 2026-03-12 07:36:43 +08:00
CONFIG_MIGRATION.md feat: initial commit 2026-03-12 07:36:43 +08:00
README.md feat: initial commit 2026-03-12 07:36:43 +08:00
REFACTORING_SUMMARY.md feat: initial commit 2026-03-12 07:36:43 +08:00
SKILL.md chore: clean CLIENT_KEY references from SKILL.md and .env.example 2026-03-19 08:31:57 +08:00
bun.lock chore: clean CLIENT_KEY references from SKILL.md and .env.example 2026-03-19 08:31:57 +08:00
how-to-use.md feat: initial commit 2026-03-12 07:36:43 +08:00
install.sh feat: install.sh 自动下载安装 auth-rt(无需手动 clone) 2026-03-20 18:36:47 +08:00
output_schema.json feat: initial commit 2026-03-12 07:36:43 +08:00
package.json refactor: 移除 @clawd/auth-runtime npm 依赖,改用 CLI subprocess 调用 2026-03-20 14:38:05 +08:00

README.md

Client Finder - Bun + TypeScript Implementation

This document describes the Bun + TypeScript implementation of the client-finder skill.

Overview

The client-finder skill is implemented with Bun + TypeScript, providing:

  • Type safety
  • Modular structure
  • Easier testing
  • Robust error handling

Project Structure

client-finder/
├── src/
│   ├── index.ts         # Main entry point and orchestration logic
│   ├── expansion.ts     # Query expansion logic (LLM and rule-based)
│   ├── workflow.ts      # Workflow API calls
│   └── types.ts         # TypeScript type definitions
├── scripts/
│   ├── run.ts           # Bun CLI entry point
│   ├── test.ts          # Test suite
│   └── skill-run-uat.sh # Endpoint UAT script
├── package.json
├── SKILL.md
└── output_schema.json

Runtime Flow

  1. Exchange token: POST /auth/skill-credit/session with clientKey
  2. Read accessToken
  3. Start workflow: POST /ecom/cold-outreach/run-flow with Authorization: Bearer <accessToken>
  4. If response indicates runtime session expired (401/403), @clawd/auth-runtime auto refreshes token and retries once
  5. Return accepted immediately

Note: this skill does not pass webhook_url/webhook_token in body. Webhook config is resolved from client-key binding by backend.

Run

bun run scripts/run.ts --client-key='<sk_xxx.yyy>' "office machine" "us"

Dry-run:

bun run scripts/run.ts --client-key='<sk_xxx.yyy>' "office machine" "us" --dry-run

Environment

  • AUTH_BASE (default: https://api-gw-test.yuanwei-lnc.com)
  • CLIENT_KEY (required for live)
  • QUERY_EXPANSION_JSON (optional)
  • AUTH_CACHE_DIR (optional)
  • AUTH_MIN_TTL_SEC (optional)

--client-key and --auth-base CLI args override env values.

Testing

Run unit-like checks:

bun run test

Run endpoint UAT:

./scripts/skill-run-uat.sh --live

Notes

  • Output must match output_schema.json.
  • This skill is async fire-and-return: no local polling/finalize/hook emission.