feat(appservice): @mosaicstack/appservice — Matrix AS core (M4a, agent-comms#9)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

First phase of mosaic-as per agent-comms docs/design/M4-MOSAIC-AS.md:
- TransactionHandler: AS transactions endpoint logic with timing-safe
  hs_token verification (Bearer + legacy access_token), bounded txnId
  dedupe (documented at-least-once limitation), handler error isolation
- AppserviceIntent: virtual user registration (m.login.application_service),
  user_id impersonation, invite-then-join fallback, thread-aware sends
  (m.thread + is_falling_back), typing, display names, uuid txn ids
- Registration builder + hardened YAML serializer (control-char rejection,
  quote escaping) for the Synapse mosaic-as.yaml
- bridge.dto.ts validators for the agent-comms daemon bridge API
Zero runtime deps; strict ESM/NodeNext; 14 vitest tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jason Woltje
2026-06-10 16:09:11 -05:00
parent dde95a59b3
commit 8b9d19347f
10 changed files with 738 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
{
"name": "@mosaicstack/appservice",
"version": "0.0.1",
"type": "module",
"repository": {
"type": "git",
"url": "https://git.mosaicstack.dev/mosaicstack/stack.git",
"directory": "packages/appservice"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"lint": "eslint src",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests"
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.8.0",
"vitest": "^2.0.0"
},
"publishConfig": {
"registry": "https://git.mosaicstack.dev/api/packages/mosaicstack/npm/",
"access": "public"
},
"files": [
"dist"
]
}