Commit Graph

27 Commits

Author SHA1 Message Date
khalid@traclabs.com
c17ce052c1 Flip between messages for the update. 2026-04-23 08:44:30 -05:00
khalid@traclabs.com
68ecaec76c Add better messages for intent processing and update in progress 2026-04-23 08:40:15 -05:00
khalid@traclabs.com
46247b7733 Add a banner to indicate updates in progress 2026-04-23 08:34:47 -05:00
khalid@traclabs.com
4e014fa648 Switch to a smaller intent model 2026-04-23 08:26:24 -05:00
khalid@traclabs.com
36bce5a908 Fix how env variables are loaded in astro 2026-04-23 08:20:16 -05:00
khalid@traclabs.com
36fadf710d Add live reload on changes 2026-04-23 08:04:34 -05:00
khalid@traclabs.com
233fb6d003 Autoapply edits if env variable configured 2026-04-23 07:58:35 -05:00
khalid@traclabs.com
fdf6124fa1 Add tailwind and shadcn 2026-04-23 07:41:37 -05:00
khalid@traclabs.com
c61f3acae9 Fix CSS layout width and add more user friendly messages 2026-04-23 01:10:54 -05:00
khalid@traclabs.com
5229ccdb0f Consolidate Dockerfiles for singular deployment 2026-04-23 00:32:32 -05:00
khalid@traclabs.com
80459e8336 Add logging 2026-04-23 00:05:17 -05:00
khalid@traclabs.com
86476115df Fix content and URL in README 2026-04-22 23:52:29 -05:00
khalid@traclabs.com
6aa4288821 Update phone number 2026-04-22 22:51:09 -05:00
khalid@traclabs.com
bcd047bc54 Fix issues and add linting 2026-04-22 22:44:03 -05:00
Khalid A
498d873c47 Fix SMS config path resolution and fail-open when config missing
The config loader now searches multiple paths for sms-sites.json
(REPO_ROOT-based, /app/, and CWD-relative) so it works regardless
of deployment environment. When config can't be loaded, the auth
check fails open (allows messages through) rather than blocking
everything. The isOwnNumber check still returns false when config
is unavailable since we can't identify our own numbers without it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 21:03:15 -05:00
Khalid A
ec92b6c7c6 Fix SMS echo loop and empty manifest in Docker
Two bugs fixed:

1. SMS echo loop: Telnyx delivers our own outbound messages back to the
   webhook, causing the system to process its own replies as new requests.
   Added isOwnNumber() check to skip messages from system phone numbers.

2. Sender authorization: Added findAuthorizedSite() to verify that the
   sender is in the allowedSenders list for the receiving phone number,
   preventing unauthorized messages from being processed.

3. Empty manifest: The server Dockerfile runs from /app/server/ but
   REPO_ROOT defaulted to '.', causing content/sections/ to resolve to
   /app/server/content/sections/ (doesn't exist) instead of
   /app/content/sections/. Added ENV REPO_ROOT=/app to the Dockerfile.

Added new sms/config.ts module that loads config/sms-sites.json at
runtime (with 60-second cache) and provides isOwnNumber() and
findAuthorizedSite() checks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:40:52 -05:00
Khalid A
3cf3694ee7 Add message intent classification (edit/info/help) before routing
Introduces a two-LLM-call pipeline: the first call classifies the user's
message intent as "edit", "info", or "help". Edit messages proceed through
the existing routing → edit → propose flow. Info messages get a generated
response about site content from the manifest. Help messages get a
templated capabilities overview. This handles open-ended questions like
"What can I do?" or "What does my site have on it?" which previously
had no path through the system.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:17:22 -05:00
Khalid A
464d2c8230 Fix LLM returning null for repo_relative_path in routing
Two changes:
1. Add `format: "json"` to Ollama API calls so the model enforces
   JSON output mode, reducing malformed responses
2. Strengthen the routing prompt with explicit type constraints
   ("NEVER null or empty"), rules to copy manifest paths exactly,
   and a concrete example response

This fixes the validation error: "repo_relative_path: Expected
string, received null" from qwen3.5:397b-cloud.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:07:16 -05:00
Khalid A
75e4c96a78 Fix allowedSenders to use actual sender phone number
The allowedSenders had the Telnyx inbound number (+14157049277)
instead of the sender's phone number (+18322070387). This caused
all inbound SMS to be rejected since the sender wasn't in the allowlist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:00:18 -05:00
Khalid A
3a151f3832 Add message text logging to SMS webhook handler
- Log the message text for regular SMS: "Received text" with text content
- Log "Received image" for MMS messages without the content
- Includes masked phone number and message ID in both cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:26:51 -05:00
khalid@traclabs.com
84121b46ae Undo git push change 2026-04-17 16:43:52 -05:00
khalid@traclabs.com
9cef82b0bd Test git push 2026-04-17 16:43:34 -05:00
khalid@traclabs.com
fdcaabf61e Update allowed phone number 2026-04-17 16:41:23 -05:00
Khalid A
61dad7c172 Fix canonical format of config/sms-sites.json
The sms-sites.json file was not in canonical format (sorted keys,
2-space indent, trailing newline), causing `npm run build` to fail
during the `check:content` step in Docker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:25:57 -05:00
Khalid A
875f377194 Fix Docker build: replace workspace:* with file: references
npm doesn't support the `workspace:*` protocol (that's pnpm/Yarn).
This caused `npm install` to fail with EUNSUPPORTEDPROTOCOL during
Docker builds. Replaced both occurrences with `file:` relative paths
that npm workspaces resolves correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:17:58 -05:00
kadil
4ee4cb8e7c First cut 2026-04-17 16:08:31 -05:00
d10105ac00 Initial commit 2026-04-17 21:07:34 +00:00