flowstate-epic-flowstate-community-epicdm-flowstate-tunnel-worker
Package-local agent skill for @epicdm/flowstate-tunnel-worker.
Tags
Publisher
Versions
1 version published — latest: 0.1.0
- 0.1.0publishedInvalid Date
Skill
flowstate-tunnel-worker Package Skill
Package: @epicdm/flowstate-tunnel-worker
Repository: epic-flowstate-community
Path: packages/flowstate-tunnel-worker
Version: 0.1.0
Use this published Dojo skill as the package-level entrypoint. For detailed workflows, use the package-local skills listed below.
Primary Package Workflow
Tunnel Worker Auth And KV
Status: Active
Purpose: Keep Worker authentication and KV indexes consistent.
Scope: packages/flowstate-tunnel-worker/src/lib/auth.ts and src/lib/kv.ts
Trigger: A task changes auth, provision secrets, org records, slug ownership, or tunnel reverse lookup.
Input: Authorization header, org ID, slug, or TunnelKVRecord.
Output: Correct auth decision and KV mutations.
Auth Modes
| Operation | Secret |
|---|---|
register | shared WORKER_API_KEY bearer token. |
provision, status, heartbeat, teardown | per-org provision secret stored in org:{orgId}. |
Auth headers must be Bearer <token>.
Secrets are compared with a constant-time function to avoid early-return timing leaks.
KV Keys
| Key | Value |
|---|---|
org:{orgId} | full TunnelKVRecord. |
slug:{orgSlug} | { orgId } slug owner mapping. |
tunnel:{tunnelId} | { orgId } reverse lookup, only written when tunnelId is set. |
Consistency Rules
setOrgRecordwrites org and slug keys together.- Re-registration deletes the previous slug mapping when slug changes.
- Registration-only records have empty
tunnelId; do not write a tunnel reverse lookup. deleteOrgRecordmirrorssetOrgRecordand deletes reverse lookup only whentunnelIdexists.updateLastSeenupdates only the org record.
Verification
yarn workspace @epicdm/flowstate-tunnel-worker test -- src/__tests__/auth.test.ts src/__tests__/kv.test.ts
Package Skill Inventory
Skill Inventory: @epicdm/flowstate-tunnel-worker
Review date: 2026-06-30
Skill Map
| Skill | Type | Use When |
|---|---|---|
flowstate-tunnel-worker | Orchestrator | Selecting the Cloudflare Worker tunnel control plane. |
flowstate-tunnel-worker-endpoint-lifecycle | Workflow | Implementing or debugging register/provision/status/heartbeat/teardown routes. |
flowstate-tunnel-worker-auth-kv | Reference/workflow | Working with bearer auth and KV records/indexes. |
flowstate-tunnel-worker-cloudflare-api | Reference/troubleshooting | Creating/configuring/deleting Cloudflare tunnels and DNS records. |
flowstate-tunnel-worker-scheduled-cleanup | Workflow | Maintaining stale tunnel cron cleanup behavior. |
flowstate-tunnel-worker-maintenance | Maintenance | Updating docs, tests, Dojo files, worker build/deploy behavior, or shared contracts. |
Feature Coverage
| Feature Matrix Items | Covered By |
|---|---|
| endpoint route handlers | flowstate-tunnel-worker-endpoint-lifecycle |
validateApiKey, validateProvisionSecret, KV helpers | flowstate-tunnel-worker-auth-kv |
| Cloudflare API helpers | flowstate-tunnel-worker-cloudflare-api |
handleScheduled | flowstate-tunnel-worker-scheduled-cleanup |
| Worker fetch/scheduled entrypoint and Wrangler build | flowstate-tunnel-worker, flowstate-tunnel-worker-maintenance |
Composition Notes
- Use
flowstate-tunnelskills when changing shared types, constants, or slug validation. - This package owns Worker behavior; the shared package owns vocabulary.
Review Gate
Package Skill Review: @epicdm/flowstate-tunnel-worker
Review date: 2026-06-30 Verdict: pass
Quality Gate
- Source-backed package purpose: pass.
- Public entry points documented: pass.
- Composable skill map: pass.
- Generated Dojo weaknesses called out: pass.
- Dojo publish readiness: deferred until generated artifacts are rebuilt from reviewed skills.
Evidence Checked
package.jsonsrc/index.tssrc/handlers/*.tssrc/lib/*.tssrc/scheduled.ts.flowstate/feature-matrix/inventory.md.flowstate/dojo/agent-skillset.md
Verification Results
yarn workspace @epicdm/flowstate-tunnel-worker test
yarn workspace @epicdm/flowstate-tunnel-worker typecheck
yarn workspace @epicdm/flowstate-tunnel-worker build
yarn workspace @epicdm/flowstate-tunnel-worker lint
Results:
- ASCII/frontmatter check passed.
testpassed: 4 files, 34 tests. Vitest emitted the existing Vite CJS Node API deprecation warning.typecheckpassed.lintpassed with 2 existingconsole.logwarnings insrc/scheduled.ts.buildpassed viawrangler deploy --dry-run --outdir dist; Wrangler reported telemetry notice and an out-of-date v3 warning.
Dojo Status
Deferred. Existing generated Dojo artifacts should be rebuilt from reviewed local skills because current files split every helper into a feature skilllet instead of teaching endpoint lifecycle, auth/KV, Cloudflare API, and scheduled cleanup workflows.
Usage
Start with this skill to understand the package purpose, then use the package-local focused skills for specific workflows. Keep this Dojo version aligned with packages/flowstate-tunnel-worker/package.json. Do not treat generated feature lists as lessons; use workflow evidence from CODE-REVIEW.md, SKILL-INVENTORY.md, and REVIEW.md.
Install
Run this in your project to install via CLI:
fscloud dojo skill install flowstate-epic-flowstate-community-epicdm-flowstate-tunnel-worker --target <target> --out ./skillsReplace <target> with your agent target identifier. See the CLI docs for details.