Skip to content

Airtable webhook support - #9

Closed
matt-aitken wants to merge 7 commits into
devfrom
integrations/airtable-webhooks
Closed

Airtable webhook support#9
matt-aitken wants to merge 7 commits into
devfrom
integrations/airtable-webhooks

Conversation

@matt-aitken

@matt-aitkenmatt-aitken commented Jan 23, 2023

Copy link
Copy Markdown
Member

Todo

  • Remove key column from TriggerEvent
  • Add lastDelivery and version columns to ExternalSource
  • Use a cursor for getting Airtable payloads
  • Verify the Airtable webhook using the raw body
  • Amalgamate changes into a structure that's good for users
  • Create convenient functions so user's can convert between fieldIds and names in their workflows

Desired payload format

constpayload={recordId: "dsfgh",type: "update",fields: {Author: {fieldId: "dfg6y464hg43",previous: "123",current: "456",},},};

Workflow usage

constorgChart=airtable.tableSchema({dfg6y464hg43: {name: "Last contacted",type: airtable.CollaboratorSchema},});newTrigger({id: "airtable-webhook-9",name: "Airtable table change",apiKey: "trigger_dev_zC25mKNn6c0q",on: airtable.events.tableEvent({baseId: "appX9X9X9X9X9X9X9",tableId: "tblX9X9X9X9X9X9X9",tableSchema: orgChart,}),run: async(event,ctx)=>{constlastContactedField=orgChart.f("Last contacted");constlastContactedValue=event.fields[lastContactedField]).current;return{};},}).listen();

@matt-aitken
matt-aitken deleted the integrations/airtable-webhooks branch June 27, 2023 13:18
tejassudsfp pushed a commit to tejassudsfp/trigger.dev that referenced this pull request Apr 21, 2026
Ships J.1–J.9 of the eval framework.
Schema: 4 new Prisma models scope-stamped — PlatosMessageRating
(J.1), PlatosEvalCriterion (J.3), PlatosAgentEval (J.5),
PlatosGoldenSet (J.8) — with migration
20260419210000_platos_eval_framework.
Agent services (apps/agent/src/evals/):
- rating.service.ts — upsert/remove/getForMessage + satisfactionByVersion
aggregation (J.1 + J.2). Anonymized.
- criterion.service.ts — CRUD + list for PlatosEvalCriterion (J.3).
- eval.service.ts — runJudge pipeline + list/getById/aggregate (J.4,
J.5, J.6, J.7). SelfEvaluationError blocks judge-model == agent-
model. Judge API key via ScopedEnvService (BYOK, no new cred store).
- golden-set.service.ts — fan every (thread × criterion), regression
verdict with ±5pt threshold (J.8).
- evals.module.ts wired into AppModule + AgentRuntimeModule.
Controller endpoints on AgentController: messages/:id/rating
(POST/DELETE/GET), agents/:id/satisfaction, eval-criteria CRUD,
evals/run + /evals list + :id + agents/:id/evals/aggregate,
golden-sets CRUD + /run. ScopeGuard'd.
Webapp routes:
- Chat inline thumbs UI with optimistic state via /resources/agent
proxy (J.1).
- /eval-criteria builder page (J.3 UI).
- /agent-evals scoreboard with satisfaction + judge score per
version (J.6).
- /agents/:id/evals-ab two-version A/B with two-proportion z-test
confidence (J.7).
- agents.$agentId.versions loader renders per-version eval +
satisfaction pill overlay (J.9).
- api.v1.agent.evals public REST proxy (J.5).
- pathBuilder helpers for new routes.
Trigger.dev task: platos.eval.sample (placeholder; cross-scope
sampling pends Theme H budget caps).
Invariants honored:
- Scope tuple on every new row + query.
- BYOK for judge LLM (no new cred store) — §5 triggerdotdev#9.
- tool-sync-ws.service.ts early-message buffer untouched.
- Zod pinned.
Verification: static_only_UNVERIFIED in worktree sandbox (Bash
denied); main thread will typecheck post-merge.
J.R review gate: leave in To Do — main close after all siblings
Done per §9.16.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tejassudsfp pushed a commit to tejassudsfp/trigger.dev that referenced this pull request Apr 21, 2026
Ships S.1-S.11. Claude-skills-format compatible manifests, import
from URL, runtime merge into agent prompt block + tool catalog,
4 official skills (web_search live, code_exec/file_ops/image_gen
scaffolded with handlers + manifests).
Schema (S.1): PlatosSkill + PlatosAgentSkill scope-stamped.
Official skills live at org scope (projectId + envId NULL) with
NULLS NOT DISTINCT unique index for upsert-on-(org, skillId).
Migration 20260419120000_platos_skills.
Services:
- skill-manifest.parser.ts (no new deps, handwritten YAML subset)
- skill-importer.service.ts (claude.ai/github/gist URL rewriting
+ 256 KiB / 10s limits)
- skill-registry.service.ts.enableForAgent: fail-fast env check,
HTTP 412 + { missing: [...] } pre-write; re-checked at
loadActiveForAgent so removed env vars drop skills at runtime.
- skill-runtime.service.ts: merges prompt block (16k char cap +
truncation footer, §6) + tool catalog into AgentService.stream/run.
- skill-handlers.ts: webSearch (Tavily HTTP), fetchUrl (HTML strip
+ cap). Namespaced tool names (platos_web_search__foo) to
prevent collisions.
- SkillsModule wired into AppModule + AgentRuntimeModule
(onApplicationBootstrap seeds official skills idempotently).
Webapp:
- /skills library UI
- /skills/new authoring UI (two-pane markdown + live preview)
- /agents/:id/skills picker + env-var install
- SideMenu + pathBuilder entries
Invariants:
- Scope tuple on every row + query.
- Single secret store (§5 triggerdotdev#9): required_env routes through
ScopedEnvService → trigger.dev SecretStore.
- tool-sync-ws.service.ts early-message buffer untouched.
- Zod pinned.
Runtime/BYOK:
- Judge/search API keys via ScopedEnvService only. No new stores.
Known gaps (tracked in per-ticket comments):
- S.8 code_execution: handler scaffolded; E2B wiring deferred.
- S.9 file_operations: handler scaffolded; AttachmentsService
delegation deferred.
- S.10 image_generation: handler scaffolded; Flux polling deferred.
- Runtime verification DEFERRED per sprint policy (post-Theme K).
S.R review gate: leave in To Do (§9.16 closes last).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tejassudsfp pushed a commit to tejassudsfp/trigger.dev that referenced this pull request Apr 21, 2026
…efactor (Theme I)
Bundles Theme H (PLAT-98–107) + Theme I (PLAT-109–119) — agents landed
together on main; committed as one Round 4 batch for simpler merge
resolution.
=== Theme H — Safety + budget + governance (H.1-H.10) ===
Detectors (H.1/H.2/H.3):
- safety.service.ts: expanded PII regex catalogue (SSN, credit-card+
Luhn, email, phone, IP, Aadhaar, PAN, IBAN, US passport, AWS keys)
+ redactPII() policy helper.
- Prompt-injection named patterns w/ injectionPattern metadata.
- checkGroundedness() lexical-overlap baseline; emits safety_flags
stream event + persists PlatosSafetyEvent.
Encryption (H.4):
- New MessageCryptoService (AES-256-GCM) + encKeyVersion column on
PlatosAgentMessage. Transparent encrypt-on-write /
decrypt-on-read through ConversationService. Rotation-safe via
PLATOS_MESSAGE_ENCRYPTION_KEY_V<N>. Vitest: round-trip, passthrough,
rotation, fail-closed.
Budget + alerts (H.5-H.7):
- PlatosBudgetCap model + BudgetService CRUD. evaluate() pre-LLM-
call in AgentTaskService. Fail-open on evaluate error; fail-closed
when provably over. admin override with audit.
- platos.budget.alert trigger.dev task: webhook + email at 50/80/100%.
Per-(cap, window) Redis SET for idempotent firing.
- /agent-budgets webapp route + SideMenu.
Rate limits (H.8):
- RateLimitService token-bucket (minute/hour/day per-user +
per-agent-per-user tool). Wired in AgentTaskService +
ToolExecutorService. Fail-open on Redis.
Pre-tool gate (H.9):
- scanToolParams runs PII + injection on stringified params pre-
HMAC dispatch. High → status:failed + blocked event; low/mid →
warn-only event.
Governance dashboard (H.10):
- GovernanceService: safety summary + budget statuses + risk score
(0.4 pii + 0.3 inj + 0.2 toolErr + 0.1 approval).
- /agent-governance route + /monitoring/governance endpoint.
Migration 20260419220000_platos_theme_h_safety_budget: additive.
=== Theme I — Consumer SDK + DX (I.1-I.11 except I.5) ===
Expands the PPR-34 MVP packages/platos-client/ into a modular SDK:
- split src/index.ts → src/{client,errors,types}.ts + src/apis/ for
agents/threads/runs/schedules/batches trigger ops (I.1 + I.2).
- Realtime WS streaming hardened with reconnection + buffer during
disconnect (I.3).
- New packages/platos-client-py/ — Python mirror of core + async
streaming iterators (I.6 + I.7).
- SDK examples + dev mint-token button + OpenAPI scaffold.
- I.5 closed as duplicate of F.8 (<PlatosArtifact> shipped in
cf0a011).
Typecheck (apps/agent):
- Fixed one `'m' implicitly any` error in conversation.service.ts
decrypt-then-filter chain.
- 2 pre-existing @aws-sdk/client-s3 errors unrelated.
Invariants honored:
- Scope tuple on every new DB row + query.
- SPEC §10.13 conversations encrypted at rest — wired via H.4.
- tool-sync-ws.service.ts early-message buffer untouched.
- Zod pinned; no version bumps.
- Single secret store (§5 triggerdotdev#9): BYOK keys via ScopedEnvService only.
Runtime verification DEFERRED per sprint policy (post-Theme K).
Review gates H.R + I.R stay To Do pending §9.16.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@matt-aitken@ericallam