Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .agents/skills/comment-automation/references/channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
|---|---|---|---|---|---|
| public reply | ✅ | ✅ | ✅ | ✅ | ✅ |
| private DM reply (`PRIVATE_REPLY_TEXT_SENDERS`) | ✅ | ✅ | ✅ | ❌ | ⚠️ |
| like (`supportsCommentLike`) | ✅ | ✅ | ✅ | ❌ | ✅ |
| like (`supportsCommentLike`) | ✅ | ❌ | ❌ | ❌ | ✅ |
| hide (`supportsHideComments`) | ✅ | ✅ | ✅ | ✅ | ✅ |
| attachment lookup (`hasImage`/`hasVideo` hide) | ✅ | ❌ | ❌ | ❌ | ❌ |
| `onlyCommentsWithImage` reply filter (`commentAutomationChannelSupportsImageFilter`) | ✅ | ❌ | ❌ | ✅ | ❌ |
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/feature-scaffold/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Not every feature needs all directories. A feature folder holds only these; neve
## Core patterns (one-liners; samples in references)

- **Pages** are async server components; `params`/`searchParams` are `Promise<...>`; `getIdFromParams()`; pass `Promise.all([...])` as `promises` to a client component that unwraps with `use(promises)`; URL state via nuqs.
- **Public routes** (short links, webhooks, redirects): Route Handler under `app/<public-prefix>/.../route.ts` plus the prefix in `PUBLIC_ROUTES` (`apps/builder/src/lib/public-routes.ts`); register Tools in `features/tools/tools-list.tsx`.
- **Public routes** (webhooks, redirects): Route Handler under `app/<public-prefix>/.../route.ts` plus the prefix in `PUBLIC_ROUTES` (`apps/builder/src/lib/public-routes.ts`); register Tools in `features/tools/tools-list.tsx`.
- **Server actions**: `workspaceActionClient.bindArgsSchemas([z.string()])`; always `.bind(null, workspaceId)` before `useHookFormAction`/`useAction`; `execute()` takes no argument when the action has no input (invariants 4, 6). Default to the most restrictive client; `...AllowExpired` only for delete/disconnect/cancel (invariant 14).
- **Server data** goes through TanStack Query, never a zustand store; every create/update/delete/toggle/move calls the resource invalidator before `router.push` (invariant 21). Zustand is for client-only state.
- **Forms**: React Hook Form + Zod + `useHookFormAction`; nullable text defaults are `""` (never `null`), use `z.preprocess` to map `""` to `null`; read values with `useWatch`, not `form.watch()`. Prefer defined fields from `@chatbotx.io/ui/components/form/*`, `<Card>` and `<Button>`, never raw HTML.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default async function ItemsPage(props: {
- Client components unwrap with `React.use(promises)`
- URL state via **nuqs** (`listItemsSearchParamsCache.parse()`)

### Public routes (short links, webhooks, open redirects)
### Public routes (webhooks, open redirects)

Some features expose **unauthenticated** URLs (tracking links, asset callbacks, etc.):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
`queueNames` (`packages/worker-config/src/lib/types.ts:3`) also declares `broadcast` and
`quota`, which have queues but no dedicated worker entry — their jobs are consumed by the
workers above. Some queues get their own `Worker` (own concurrency) hosted inside an existing
process: `profileSnapshot`, `leaderboard` and `contactInfoCapture` in `src/low/worker.ts`, and `template` (template
process: `profileSnapshot`, `leaderboard`, `contactInfoCapture` and `postPublish` (composed-post publishing) in `src/low/worker.ts`, and `template` (template
install, sync, uninstall and fan-out) in `src/default/worker.ts`. Marketing Messages
campaign steps have their own `marketingMessage` worker, while schedule crons enqueue them.
Check `apps/worker/tsdown.config.ts` for the authoritative entry list.
Expand All @@ -31,6 +31,10 @@ on this" webhook action is added to `isLowRoutedIntegrationJob` and `LowRoutedIn
(`packages/worker-config/src/queues/integration/index.ts`), not given a queue of its own.
Producers of bulk work on `low` set `priority: LOW_BULK_PRIORITY` so that ingress passes them.

`reconnectPublishFanOut` (`LowJobAction`, handler `processReconnectPublishFanOut` in `src/publish-destination/reconnect-fan-out.ts`) is a `low` job: when one Facebook Page reconnect cannot refresh every other Messenger and Instagram-via-Facebook inbox of the same person inline (100 pages / 20 s), the rest continues here. The payload carries the page tokens encrypted (never plaintext in Redis), the work is idempotent and guarded like the inline run (same workspace, same app client id, same stored authorizer, connected inbox only, never creates one), the job id dedups per workspace and Facebook user, and a job that runs out of its 5 minute budget enqueues the next hop, at most 10 (`docs/posts.md`, "Reconnect fan-out").

`refreshPublishDestinationAvatar` (`LowJobAction`, handler `refreshPublishDestinationAvatar` in `src/publish-destination/refresh-avatar.ts`) is a `low` job: fetches one inbox publish destination's Page/profile picture with the destination's own token (loaded in the worker, never in the payload), re-hosts it under `public/space/<workspaceId>/publish-destinations/<id>/` and stores the path in `PublishDestination.avatar`. Enqueued after a connect/reconnect (`captureInboxScopes`, delayed 10 s) and by the destinations list backfill (never fetched or older than 7 days, at most 20 per call); jobId `refresh-publish-destination-avatar-<id>` dedups. A failure back-dates `avatarFetchedAt` so the retry comes after a day; the job never throws for a network problem.

The `heavy` queue/worker is a **workload-class** queue, not a domain queue:
use it for bounded but RAM/CPU/I/O/model-heavy jobs that should not occupy
latency-sensitive domain workers. AI file processing, media generation,
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pnpm dev # turbo dev — all dev tasks the repo wires up
pnpm build # turbo build
pnpm lint # check:agent-instructions → check:invariants → turbo run lint → ultracite check
pnpm fix # ultracite fix --unsafe
pnpm check-types:cold # concurrency=1 — use on a cold run (no tsbuildinfo) or low-RAM machine; builder tsc peaks ~6 GB cold
pnpm check-types:cold # concurrency=1 — use on a cold run (no tsbuildinfo) or low-RAM machine; builder tsc peaks ~6–8 GB cold
pnpm check-types # turbo run check-types --concurrency=2 — always use this, not bare `pnpm turbo check-types`
# (bare turbo runs 10 tsc in parallel, ~4 GB each for packages importing database/business → swaps/freezes the machine)
pnpm test # turbo run test --concurrency=2 — 2 suites × 4 vitest threads (VITEST_MAX_WORKERS); 50% ran 6×4 = 24 threads on a 12-core Mac
Expand Down Expand Up @@ -201,9 +201,10 @@ See **`.agents/rules/git.md`** for the full canonical rules (commit format, bran
- Ads conversion tracking (CTWA/CTM/CTID, rules vs Trigger actions, CAPI, per-click ad touch history): `docs/ads-conversion-tracking.md`
- Google Ads Click-to-Message conversion tracking (gclid/gbraid capture, Connection-engine OAuth, Data Manager API delivery, dedup, state machine, statistics dashboard, read-only public API, ops runbook): `docs/google-ads-conversion-tracking.md`
- Google Ads conversion options for admins (dedup mode, conversion time, consent, legacy differences): `docs/google-ads-conversion-options-admin-guide.md`
- Trigger sequence actions (`addSequence` / `removeSequence`: shape, no sequence events, template behavior) and trigger loop protection (non-emitting actions, per-trigger-per-contact run circuit breaker, blind spots): `docs/trigger-actions.md`
- Trigger sequence actions (`addSequence` / `removeSequence`: shape, no sequence events, template behavior) and trigger loop protection (non-emitting actions, per-trigger-per-contact run circuit breaker, blind spots), and post-comment events (`contactCommentedOnPost` / `contactFirstCommentedOnPost`: Messenger + Instagram, conditions, first-claim and Redis dedupe, run-scoped `{{post.*}}` / `{{comment.*}}`, templates): `docs/trigger-actions.md`
- Bot block trigger events (`contactBlockedBot` / `contactUnblockedBot`: Telegram `my_chat_member` source, existing contacts only, retry dedupe, re-registering older bots' webhooks with `backfill:telegram-webhooks`): `docs/bot-block-trigger-events.md`
- Comment automation (all channels): `docs/comment-automation.md` (skill: `.agents/skills/comment-automation/`)
- Posts (post analytics: sparse daily snapshots `ChannelPostMetricDaily`, baseline/unknown-vs-zero rules, coverage, best posting times, retention; list posts that exist on inbox channels, topics, per-post comment settings, post sync engine, comments and exports, publishing with inbox tokens (TikTok via its own login), destination states, reconnect fan-out, posting schedule, public API): `docs/posts.md`
- LINE channel (Messaging API setup, webhook + signature, reply vs push and monthly quota, token refresh, flow-step mapping, ops runbook, open items): `docs/line.md`
- Push notifications (Expo Push Service, device tokens): `docs/push-notifications.md`
- Enterprise licensing (offline Ed25519 license keys): `docs/licensing.md`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ exports[`default tool set > operation ids match the curated snapshot 1`] = `
"pipelines.list",
"pipelines.listItems",
"pipelines.moveItem",
"postAnalytics.summary",
"schemas.flowSpec",
"sequences.get",
"sequences.list",
Expand Down
Loading
Loading