Ponder

Appwrite Functions

Function configuration from appwrite.json, live Appwrite settings, and behavior derived from the function source code.

VCS deployment notes

news_refresh

Purpose: fetches external news articles, normalizes them into content rows, removes duplicates, applies quality filters, and optionally prunes old content.

Field Value
Runtime node-22
Entrypoint functions/news_refresh/src/main.js
Timeout 300 seconds
Execute none; schedule/runtime only
Schedule 0 */6 * * *
Install command npm install
Build/runtime specification s-0.5vcpu-512mb

Scopes:

Expected input: no request body is required by the implementation. Required environment variables are NEWS_API_KEY or NEWSAPIKEY, APPWRITE_ENDPOINT, APPWRITE_PROJECT_ID, and APPWRITE_API_KEY. Optional environment variables are GUARDIANKEY, SENTRY_DSN, MIN_BODY_CHARS, REQUIRE_IMAGE, CONTENT_RETENTION_DAYS, CONTENT_RETENTION_MAX_DELETES, and CONTENT_BODY_MAX_CHARS.

Output:

Implementation notes:

fact_check

Purpose: validates a claim, reuses a recent exact cache hit when available, otherwise checks the claim with Perplexity and stores a fact-check row.

Field Value
Runtime node-22
Entrypoint functions/fact_check/src/index.js
Timeout 30 seconds
Execute any
Schedule none
Install command npm install
Build/runtime specification s-0.5vcpu-512mb

Scopes:

Expected input:

{
  "claim": "Claim text, 500 characters or fewer",
  "userId": "optional user id for private history only"
}

The function supports OPTIONS for CORS and only accepts POST for execution. PERPLEXITY_API_KEY is required when no cache hit is returned.

Output:

Implementation notes:

chat_write

Purpose: performs trusted server-side writes for 1:1 threads, text messages, and article shares after verifying authenticated user and accepted friendship.

Field Value
Runtime node-22
Entrypoint functions/chat_write/src/index.js
Timeout 30 seconds
Execute users
Schedule none
Install command npm install
Build/runtime specification s-0.5vcpu-512mb

Scopes:

Expected input by action:

{ "action": "getOrCreateThread", "otherUserId": "user id" }
{ "action": "postMessage", "threadId": "thread id", "body": "encrypted message body" }
{
  "action": "shareArticle",
  "recipientId": "user id",
  "contentId": "content row id",
  "message": "optional encrypted message"
}

The function reads the current user from Appwrite execution headers such as x-appwrite-user-id. It supports OPTIONS for CORS and only accepts POST.

Output:

Implementation notes:

like_sync

Purpose: synchronizes the denormalized content.likeCount after a client like row is created or deleted.

Field Value
Runtime node-22
Entrypoint functions/like_sync/src/main.js
Timeout 15 seconds
Execute users
Schedule none
Install command npm install
Build/runtime specification s-0.5vcpu-512mb

Scopes:

Expected input:

{
  "contentId": "content row id, at most 64 characters",
  "liked": true
}

Output:

Implementation notes: