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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
"version": "0.1.0",
"private": true,
"packageManager": "npm@10.8.2",
"description": "Relayfile adapters — map external services to the relayfile VFS",
"description": "Relayfile adapters \u2014 map external services to the relayfile VFS",
"workspaces": [
"packages/*"
],
"scripts": {
"build": "npx turbo build",
"test": "npm run test:publish-targets && npm run test:internal-dependencies && npm run test:writeback-discovery && npm run test:digest-contracts && npm run test:catalog-task-graph && npx turbo test catalog:check",
"test": "npm run test:publish-targets && npm run test:internal-dependencies && npm run test:writeback-discovery && npm run test:digest-contracts && npm run test:catalog-task-graph && npm run test:adapter-mapping-bundle && npx turbo test catalog:check",
"test:catalog-task-graph": "node scripts/verify-catalog-check-task.mjs",
"test:publish-targets": "node --test scripts/resolve-publish-targets.test.mjs",
"test:internal-dependencies": "node scripts/sync-internal-dependencies.mjs --check",
"test:writeback-discovery": "node --test scripts/writeback-discovery-normalizer.test.mjs && node scripts/verify-writeback-discovery.mjs",
"test:digest-contracts": "node --test scripts/digest-layout-contracts.test.mjs && node scripts/digest-layout-contracts.mjs",
"test:writeback-e2e": "node scripts/verify-file-native-writeback-e2e.mjs",
"typecheck": "npx turbo typecheck"
"typecheck": "npx turbo typecheck",
"test:adapter-mapping-bundle": "node --test scripts/bundle-adapter-mappings.test.mjs"
},
"devDependencies": {
"@agentworkforce/workload-router": "^0.1.3",
Expand Down
18 changes: 18 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ writebacks:

See [../../docs/MAPPING_YAML_SPEC.md](../../docs/MAPPING_YAML_SPEC.md) for the full mapping YAML specification.

## Bundled adapter mappings

The published package ships every adapter's mapping YAML, not only the core
fallbacks:

- `mappings/<provider>.mapping.yaml` — the core fallbacks (`github`, `slack`),
unchanged.
- `mappings/adapters/<provider>.mapping.yaml` — a verbatim copy of each
`packages/<adapter>/<provider>.mapping.yaml`, so a consumer that depends only
on `@relayfile/adapter-core` (for example `AgentWorkforce/flows`, which
generates its trigger namespaces from the `webhooks:` blocks) sees the
adapter's own events. Apply adapter-local over fallback.

The copies are generated and committed: `npm run mappings:bundle -w
@relayfile/adapter-core` refreshes them and `catalog:check` (run by
`turbo test`) fails when they drift, so a tarball can never carry a stale
bundle.

## CLI

```bash
Expand Down
7 changes: 7 additions & 0 deletions packages/core/mappings/adapters/azure-blob.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
webhooks:
file.created:
description: A new blob was created in the Azure Blob Storage container.
file.updated:
description: An existing blob was updated in the Azure Blob Storage container.
file.deleted:
description: A blob was deleted from the Azure Blob Storage container.
7 changes: 7 additions & 0 deletions packages/core/mappings/adapters/box.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
webhooks:
file.created:
description: A new file or folder was created in Box.
file.updated:
description: An existing file or folder was updated in Box.
file.deleted:
description: A file or folder was deleted from Box.
51 changes: 51 additions & 0 deletions packages/core/mappings/adapters/cloudflare.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
adapter:
name: cloudflare
version: "1.0.0"
baseUrl: https://api.cloudflare.com/client/v4
scopeKeys:
- accountId
- zoneId
resources:
workers-scripts:
path: /cloudflare/workers/scripts
worker-usage:
path: /cloudflare/analytics/workers/scripts
pages-projects:
path: /cloudflare/pages/projects
d1-databases:
path: /cloudflare/d1/databases
kv-namespaces:
path: /cloudflare/kv/namespaces
r2-buckets:
path: /cloudflare/r2/buckets
queues:
path: /cloudflare/queues
tunnels:
path: /cloudflare/tunnels
zones:
path: /cloudflare/zones
dns-records:
path: /cloudflare/zones/{zoneId}/dns-records
notification-webhooks:
path: /cloudflare/notifications/webhooks
notification-policies:
path: /cloudflare/notifications/policies
notification-events:
path: /cloudflare/notifications/events
webhooks:
workers_alert:
path: /cloudflare/notifications/events
workers_observability_alert:
path: /cloudflare/notifications/events
advanced_http_alert_error:
path: /cloudflare/notifications/events
http_alert_origin_error:
path: /cloudflare/notifications/events
billing_usage_alert:
path: /cloudflare/notifications/events
health_check_status_notification:
path: /cloudflare/notifications/events
dedicated_ssl_certificate_event_type:
path: /cloudflare/notifications/events
access_custom_certificate_expiration_type:
path: /cloudflare/notifications/events
12 changes: 12 additions & 0 deletions packages/core/mappings/adapters/daytona.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
adapter:
name: daytona
version: "1.0.0"
baseUrl: https://api.daytona.io
webhooks:
sandbox.created: {}
sandbox.state.updated: {}
snapshot.created: {}
snapshot.state.updated: {}
snapshot.removed: {}
volume.created: {}
volume.state.updated: {}
3 changes: 3 additions & 0 deletions packages/core/mappings/adapters/dropbox.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
webhooks:
file.changed:
description: Dropbox account-level webhook notification that one or more files/folders changed.
17 changes: 17 additions & 0 deletions packages/core/mappings/adapters/fathom.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
adapter:
name: fathom
version: "1.0.0"
baseUrl: https://api.fathom.ai
# Fathom delivers a single webhook event when new meeting content (summary,
# transcript, action items) becomes available. The adapter webhook-normalizer
# canonicalizes the upstream `new_meeting_content_ready` payload to the runtime
# event type `new-meeting-content-ready`, which is the name persona triggers and
# deploy-time lint match against.
#
# No destination-path template is declared: fathom uses a hand-written
# normalizer + path-mapper rather than the schema-driven runtime, and its
# normalizer resolves the record id from `recording_id ?? id ?? recordingId`
# (a fallback a single `{{...}}` template can't express). The trigger-catalog
# generator consumes only the event-name key below.
webhooks:
new-meeting-content-ready: {}
56 changes: 56 additions & 0 deletions packages/core/mappings/adapters/gcp.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
adapter:
name: gcp
version: "1.0.0"
# GCP exposes data over REST across multiple API hosts, so there is no single
# baseUrl. The provider/proxy (e.g. @relayfile/provider-nango via a Nango GCP
# connection) overrides baseUrl per call. Per-resource API hosts:
baseUrls:
cloud-run-services: https://run.googleapis.com
monitoring-alerts: https://monitoring.googleapis.com
billing: https://cloudbilling.googleapis.com
error-reporting-groups: https://clouderrorreporting.googleapis.com
# This adapter is auth-agnostic and declarative: it contains no HTTP client and
# no credentials. Auth is supplied at runtime by a provider via a Nango GCP
# connection.
scopeKeys:
- project
- location
- billingAccountId
resources:
cloud-run-services:
# Cloud Run Admin API
# GET https://run.googleapis.com/v2/projects/{project}/locations/{location}/services
# (and .../services/{service}/revisions). One file per service.
path: /gcp/run/services
monitoring-alerts:
# Cloud Monitoring API alert policies
# GET https://monitoring.googleapis.com/v3/projects/{project}/alertPolicies
# plus firing incidents. One file per alert policy.
path: /gcp/monitoring/alerts
billing:
# Cloud Billing API
# GET https://cloudbilling.googleapis.com/v1/billingAccounts/{id}
# and project billing info (the FinOps mount). A single current-state file.
path: /gcp/billing/current
error-reporting-groups:
# Error Reporting API
# GET https://clouderrorreporting.googleapis.com/v1beta1/projects/{project}/groupStats
# One file per error group.
path: /gcp/error-reporting/groups
webhooks:
# GCP push signals arrive as Cloud Monitoring alert notifications delivered via
# Pub/Sub -> an HTTP push subscription. The incident.state open/closed drives
# alert create/update.
monitoring.incident.open: {}
monitoring.incident.closed: {}
# Cloud Run admin changes are routed from Cloud Audit Logs -> Pub/Sub -> HTTP push.
cloud-run.service.created: {}
cloud-run.service.updated: {}
cloud-run.service.deleted: {}
# Cloud Billing budgets publish current budget status to Pub/Sub multiple times per day.
billing.budget.alert: {}
# Error signals can arrive either as native Error Reporting webhooks or as
# Cloud Run error-log push signals that refresh Error Reporting groups.
error-reporting.event.logged: {}
error-reporting.group.opened: {}
error-reporting.group.reopened: {}
7 changes: 7 additions & 0 deletions packages/core/mappings/adapters/gcs.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
webhooks:
file.created:
description: A new object was created in the Google Cloud Storage bucket.
file.updated:
description: An existing object was updated in the Google Cloud Storage bucket.
file.deleted:
description: An object was deleted from the Google Cloud Storage bucket.
143 changes: 143 additions & 0 deletions packages/core/mappings/adapters/github.mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
adapter:
name: github
version: "1.0.0"
baseUrl: https://api.github.com
source:
openapi: https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml
webhooks:
pull_request:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{number}}/meta.json
extract:
- action
- number
- pull_request.title
- pull_request.state
pull_request_review:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/reviews/{{review.id}}.json
pull_request_review.submitted:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/reviews/{{review.id}}.json
pull_request_review.edited:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/reviews/{{review.id}}.json
pull_request_review.dismissed:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/reviews/{{review.id}}.json
pull_request_review_comment.created:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/comments/{{comment.id}}.json
pull_request_review_thread.resolved:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/review-threads/{{thread.id}}.json
issue_comment:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/issues/{{issue.number}}/comments/{{comment.id}}/meta.json
extract:
- action
- issue.number
- issue.title
- comment.id
issue_comment.created:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/issues/{{issue.number}}/comments/{{comment.id}}/meta.json
extract:
- action
- issue.number
- issue.title
- comment.id
check_run:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/checks/{{check_run.id}}.json
extract:
- action
- check_run.id
- check_run.name
- check_run.status
- check_run.conclusion
- check_run.head_sha
check_run.completed:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/checks/{{check_run.id}}.json
extract:
- action
- check_run.id
- check_run.name
- check_run.status
- check_run.conclusion
- check_run.head_sha
deployment_status.created:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/deployments/{{deployment.id}}/statuses/{{deployment_status.id}}.json
extract:
- action
- deployment.id
- deployment.ref
- deployment.sha
- deployment.environment
- deployment_status.id
- deployment_status.state
- deployment_status.environment
push:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/commits/{{head_commit.id}}/metadata.json
status:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/gate-status/{{sha}}.json
issues:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/issues/{{issue.number}}/meta.json
pull_request.edited:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/meta.json
extract:
- action
- pull_request.number
- pull_request.title
pull_request.reopened:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/pulls/{{pull_request.number}}/meta.json
extract:
- action
- pull_request.number
- pull_request.title
issues.edited:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/issues/{{issue.number}}/meta.json
extract:
- action
- issue.number
- issue.title
issues.labeled:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/issues/{{issue.number}}/meta.json
extract:
- action
- issue.number
- issue.title
- label.name
issues.unlabeled:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/issues/{{issue.number}}/meta.json
extract:
- action
- issue.number
- issue.title
- label.name
issues.reopened:
path: /github/repos/{{repository.owner.login}}/{{repository.name}}/issues/{{issue.number}}/meta.json
extract:
- action
- issue.number
- issue.title
resources:
pull_request:
endpoint: GET /repos/{owner}/{repo}/pulls/{pull_number}
path: /github/repos/{{owner}}/{{repo}}/pulls/{{number}}/meta.json
pull_request_files:
endpoint: GET /repos/{owner}/{repo}/pulls/{pull_number}/files
path: /github/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/files/{{filename}}
iterate: true
writebacks:
create_pull_request:
match: /github/repos/*/*/pull-requests/*.json
endpoint: POST /repos/{owner}/{repo}/pulls
update_ref:
match: /github/repos/*/*/refs/refs%2F*%2F*.json
endpoint: PATCH /repos/{owner}/{repo}/git/refs/{namespace}/{ref}
create_ref:
match: /github/repos/*/*/refs/*.json
endpoint: POST /repos/{owner}/{repo}/git/refs
close_pull_request:
match: /github/repos/*/*/pulls/*/close.json
endpoint: PATCH /repos/{owner}/{repo}/pulls/{pull_number}
review:
match: /github/repos/*/*/pulls/*/reviews/*.json
endpoint: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews
merge:
match: /github/repos/*/*/pulls/*/merge.json
endpoint: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge
comment:
match: /github/repos/*/*/pulls/*/comments/*.json
endpoint: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments
Loading
Loading