@stacksjs/defaults 0.75.575 → 0.75.579

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-actions
3
- description: Use when working with Stacks server actions - creating actions in app/Actions/, auto-generated API actions from the useApi model trait, the 758 default framework actions (auth, dashboard, commerce, content, deployment, jobs), action request/response handling, or action registration. Covers @stacksjs/actions and storage/framework/defaults/app/Actions/.
3
+ description: Use when working with Stacks server actions - creating actions in app/Actions/, auto-generated API actions from the useApi model trait, the 759 default framework actions (auth, dashboard, commerce, content, deployment, jobs), action request/response handling, or action registration. Covers @stacksjs/actions and storage/framework/defaults/app/Actions/.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -563,3 +563,76 @@ HTTP ranges, safely restarts when Range is ignored, and honors caller aborts.
563
563
  It defaults to four attempts with a 180,000 ms timeout per transfer. Keep model
564
564
  download handling in this package rather than copying a shell downloader into
565
565
  an application. The Whisper executable remains a managed Pantry dependency.
566
+
567
+ ## Realtime audio transport
568
+
569
+ `connectRealtime` from `@stacksjs/ai/realtime` opens a server-only GA Realtime
570
+ audio session with Bun's WebSocket client. Supply `apiKey`, an explicitly chosen
571
+ `model`, bounded `instructions`, and `onEvent`. The default audio format is
572
+ `audio/pcmu` for phone media; PCM uses mono 24 kHz. The API key travels only in
573
+ server handshake headers. No connection is opened on import.
574
+
575
+ Wait for the returned session before appending audio. The transport refuses
576
+ oversized or invalid base64, bounds socket backpressure, and never reconnects
577
+ or retries automatically. Set a maximum call duration and enforce wallet
578
+ reservations outside the transport. `interrupt(itemId, playedMilliseconds)`
579
+ cancels generation and truncates history to the audio actually played.
580
+
581
+ Only declared completed tool calls are emitted, once per call ID. The caller
582
+ authorizes and executes tools, then submits the result. No tool executes inside
583
+ the transport. Deduplicate response usage by response ID and reconcile incomplete
584
+ calls against provider billing. A closed socket is not proof of final usage.
585
+
586
+ Retained tests: `core/ai/tests/realtime.test.ts`, including a real local Bun
587
+ WebSocket handshake. Live OpenAI audio quality, account access, media bridging
588
+ and production latency require separate provider qualification. Protocol sources:
589
+ <https://developers.openai.com/api/docs/guides/voice-websockets> and
590
+ <https://developers.openai.com/api/docs/guides/realtime-conversations>.
591
+
592
+ ## Durable SQL retrieval
593
+
594
+ Use `createDurableRetrievalStore` from `@stacksjs/ai/durable-retrieval` when
595
+ knowledge must survive process restarts. `VectorIndex` above remains memory only.
596
+ The adapter takes the native application's parameterized SQL executor and its
597
+ model-generated source/index/chunk table names. It performs exact pgvector cosine
598
+ ranking on PostgreSQL. Explicit mode: 'lexical' uses native PostgreSQL
599
+ `to_tsvector` / `plainto_tsquery` ranking, while SQLite uses bounded substring
600
+ matching; it does not create tables,
601
+ install extensions, maintain an ANN index, or authorize a caller for you.
602
+
603
+ The source schema names workspace_id, project_id, source_key, language, audience,
604
+ publication, permission_granted, deleted_at, current_revision and active_index_id.
605
+ Indexes carry source_id, workspace_id, project_id, revision, status,
606
+ embedding_model and dimensions. Chunks carry source_id, index_id, workspace_id,
607
+ project_id, revision, content and embedding (JSON text). Keep these as app models.
608
+ Declare `databaseExtensions: ['vector']` on the embedding-owning model: native
609
+ migration generation emits `CREATE EXTENSION IF NOT EXISTS vector` only in the
610
+ PostgreSQL corpus. Provision the pgvector server extension before migrating;
611
+ missing server binaries or migration privileges fail explicitly. SQLite emits no
612
+ PostgreSQL prerequisite and retains lexical retrieval.
613
+
614
+ Every search requires a scope with numeric string workspaceId/projectId,
615
+ language, audience ('public' or 'internal') and allowedSourceIds. Authorize these
616
+ source ids through the application's live membership/source ACL before calling.
617
+ An empty list denies all. The list is bounded to 10,000 ids. The SQL intersects
618
+ that grant with ownership, audience, publication, permission state, deletion and
619
+ active revision before ranking; PostgreSQL uses a materialized permitted relation
620
+ so a vector expression cannot run on unauthorized rows. Applications must still
621
+ invalidate sources atomically when their authoritative content or permissions
622
+ change, and swap active_index_id only when a complete new revision is ready.
623
+
624
+ `createConfiguredEmbeddingClient` from `@stacksjs/ai/embedding-client` consumes
625
+ server AI driver config and an optional explicit OpenAI/Ollama provider, model and
626
+ dimensions. `embed(texts, { signal })` makes a bounded provider HTTP request and
627
+ validates batch indexes, finite nonzero vectors and consistent dimensions. Requests
628
+ refuse redirects and combine a server deadline (at most 60 seconds) with caller
629
+ cancellation. Endpoint URLs reject userinfo, query strings and fragments; OpenAI
630
+ requires HTTPS except on loopback. An explicitly configured private Ollama host
631
+ may use HTTP because it is a server-owned endpoint without provider credentials. It
632
+ honors configured provider endpoints and never silently routes a chat-only
633
+ provider's documents to another service. Provider secrets stay server-side.
634
+
635
+ Evidence: `ai/tests/durable-retrieval.test.ts`,
636
+ `ai/tests/durable-retrieval-postgres.test.ts` (set STACKS_TEST_PGVECTOR_URL to a
637
+ local server with pgvector; the fixture owns its temporary database) and
638
+ `database/tests/model-extensions.test.ts`.
@@ -872,3 +872,23 @@ The credential is consumed before the callback, so it composes with
872
872
  `revokeAccountCredentials(claim.userId)`. That sweep also removes any pending
873
873
  password-reset links; changing a password must retire recovery credentials too.
874
874
  The existing `passwordResets(email)` flow supports email-addressed bcrypt tokens.
875
+
876
+ ## Enterprise relying-party identity
877
+
878
+ Use `@stacksjs/auth/enterprise-oidc` for signed OIDC callbacks with PKCE, state,
879
+ nonce, issuer, audience and JWKS verification. Use `@stacksjs/auth/enterprise-saml`
880
+ for signed SAML requests and strict signed Response + Assertion verification.
881
+ Keep each challenge in a native durable, browser-bound, one-use OAuth flow and
882
+ consume it before accepting a callback. These helpers return provider subject
883
+ identity only; they never assign roles or link a local account by email.
884
+
885
+ HQ.support uses operator-approved issuer/endpoint configuration. The OIDC helper
886
+ requires discovery endpoints on the issuer origin and client-secret-post support.
887
+ SAML requires persistent NameIDs, RSA-SHA256 and SHA256 digests, exact audience and
888
+ callback recipient, request correlation and bounded assertion lifetime. Provider
889
+ configuration and private keys belong to the operator, never login input.
890
+
891
+ Tests: `auth/tests/enterprise-oidc.test.ts` and `auth/tests/enterprise-saml.test.ts`.
892
+ They exercise signed fixtures and refusals, not live identity-provider readiness.
893
+ Deprovision workspace memberships and linked identities within that workspace;
894
+ a tenant administrator must not revoke another workspace's native credentials.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-dashboard
3
- description: Use when building or customizing the Stacks admin dashboard, including dashboard pages, model management views, analytics widgets, commerce dashboards, content management, settings panels, deployment monitoring, job/queue management, or the 431 built-in dashboard components. Covers the dashboard system at storage/framework/defaults/.
3
+ description: Use when building or customizing the Stacks admin dashboard, including dashboard pages, model management views, analytics widgets, commerce dashboards, content management, settings panels, deployment monitoring, job/queue management, or the 432 built-in dashboard components. Covers the dashboard system at storage/framework/defaults/.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -8,7 +8,7 @@ allowed-tools: Read Edit Write Bash Grep Glob
8
8
 
9
9
  # Stacks Dashboard
10
10
 
11
- The Stacks admin dashboard provides a full-featured admin panel with 100+ route views, 431 components, and a multi-section layout.
11
+ The Stacks admin dashboard provides a full-featured admin panel with 100+ route views, 432 components, and a multi-section layout.
12
12
 
13
13
  ## Key Paths
14
14
  - Dashboard components: `storage/framework/defaults/resources/components/Dashboard/`
@@ -190,3 +190,19 @@ the two project readers, with no port.
190
190
  durable total loads behind it.
191
191
  - This package does not create accounts, sign anyone in, or share keys between
192
192
  services.
193
+
194
+ ## Stacks Free deployment verification
195
+
196
+ `buddy support:verify https://your-app.example` starts an HQ.support challenge
197
+ using the project's server integration key. It writes only the public nonce
198
+ document to `public/.well-known/hq-support` and a pending record to ignored
199
+ `storage/framework/runtime/support-verification.json`. Deploy the document, then
200
+ run the same command with `--confirm` within ten minutes. No consumer deployment
201
+ is started implicitly. The configured native static server serves the proof;
202
+ JSON and octet-stream MIME types are accepted at the exact well-known path.
203
+
204
+ The service checks public HTTPS ownership, a confirmed Buddy connection, the
205
+ challenge expiry and one free workspace per owning account. Framework metadata is
206
+ a self-reported eligibility signal, not an unforgeable attestation. Free includes
207
+ 2 agents, 100 monthly conversations with 20% grace, 10 hosted text AI conversations,
208
+ 300 MB storage and 10 MB per file. Keep all integration keys server-side.
@@ -12,21 +12,21 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
12
12
  |---|---|---|---|
13
13
  | `@stacksjs/action-runner` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/action-runner/src/index.ts) | 1 |
14
14
  | `@stacksjs/actions` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/index.ts) | 109 |
15
- | `@stacksjs/ai` | [`stacks-ai`](../stacks-ai/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/index.ts) | 21 |
15
+ | `@stacksjs/ai` | [`stacks-ai`](../stacks-ai/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/index.ts) | 24 |
16
16
  | `@stacksjs/alias` | [`stacks-alias`](../stacks-alias/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/alias/src/index.ts) | 3 |
17
17
  | `@stacksjs/analytics` | [`stacks-analytics`](../stacks-analytics/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/analytics/src/index.ts) | 7 |
18
18
  | `@stacksjs/api` | [`stacks-api`](../stacks-api/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/api/src/index.ts) | 12 |
19
19
  | `@stacksjs/arrays` | [`stacks-arrays`](../stacks-arrays/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/arrays/src/index.ts) | 12 |
20
20
  | `@stacksjs/audio` | [`stacks-audio`](../stacks-audio/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/audio/src/index.ts) | 3 |
21
- | `@stacksjs/auth` | [`stacks-auth`](../stacks-auth/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/index.ts) | 134 |
21
+ | `@stacksjs/auth` | [`stacks-auth`](../stacks-auth/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/index.ts) | 136 |
22
22
  | `@stacksjs/browser` | [`stacks-browser`](../stacks-browser/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/index.ts) | 10 |
23
23
  | `@stacksjs/browser-extension` | [`stacks-browser-extension`](../stacks-browser-extension/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser-extension/src/index.ts) | 9 |
24
- | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 196 |
24
+ | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 200 |
25
25
  | `@stacksjs/build` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/build/src/index.ts) | 7 |
26
26
  | `@stacksjs/cache` | [`stacks-cache`](../stacks-cache/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cache/src/index.ts) | 24 |
27
27
  | `@stacksjs/calendar-api` | [`stacks-calendar`](../stacks-calendar/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/calendar-api/src/index.ts) | 5 |
28
28
  | `@stacksjs/charts` | [`stacks-charts`](../stacks-charts/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/charts/src/index.ts) | 3 |
29
- | `@stacksjs/chat` | [`stacks-chat`](../stacks-chat/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/index.ts) | 6 |
29
+ | `@stacksjs/chat` | [`stacks-chat`](../stacks-chat/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/index.ts) | 7 |
30
30
  | `@stacksjs/cli` | [`stacks-cli`](../stacks-cli/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cli/src/index.ts) | 14 |
31
31
  | `@stacksjs/cloud` | [`stacks-cloud`](../stacks-cloud/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cloud/src/index.ts) | 10 |
32
32
  | `@stacksjs/cms` | [`stacks-cms`](../stacks-cms/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cms/src/index.ts) | 5 |
@@ -35,7 +35,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
35
35
  | `@stacksjs/composables` | [`stacks-composables`](../stacks-composables/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/composables/src/index.ts) | 18 |
36
36
  | `@stacksjs/config` | [`stacks-config`](../stacks-config/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/index.ts) | 16 |
37
37
  | `@stacksjs/cron` | [`stacks-cron`](../stacks-cron/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/index.ts) | 6 |
38
- | `@stacksjs/database` | [`stacks-database`](../stacks-database/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index.ts) | 146 |
38
+ | `@stacksjs/database` | [`stacks-database`](../stacks-database/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index.ts) | 147 |
39
39
  | `@stacksjs/datetime` | [`stacks-datetime`](../stacks-datetime/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/datetime/src/index.ts) | 22 |
40
40
  | `@stacksjs/defaults` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/defaults/package.json) | 3 |
41
41
  | `@stacksjs/deploy` | [`stacks-deploy`](../stacks-deploy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/deploy/package.json) | 1 |
@@ -55,7 +55,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
55
55
  | `@stacksjs/git` | [`stacks-git`](../stacks-git/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/git/src/index.ts) | 2 |
56
56
  | `@stacksjs/github` | [`stacks-git`](../stacks-git/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/index.ts) | 8 |
57
57
  | `@stacksjs/health` | [`stacks-health`](../stacks-health/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/health/src/index.ts) | 2 |
58
- | `@stacksjs/hq` | [`stacks-hq`](../stacks-hq/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/index.ts) | 8 |
58
+ | `@stacksjs/hq` | [`stacks-hq`](../stacks-hq/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/index.ts) | 9 |
59
59
  | `@stacksjs/http` | [`stacks-http`](../stacks-http/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/http/src/index.ts) | 4 |
60
60
  | `@stacksjs/i18n` | [`stacks-i18n`](../stacks-i18n/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/i18n/src/index.ts) | 5 |
61
61
  | `@stacksjs/image` | [`stacks-image`](../stacks-image/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/index.ts) | 4 |
@@ -85,10 +85,12 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
85
85
  | `@stacksjs/sites` | [`stacks-sites`](../stacks-sites/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sites/src/index.ts) | 3 |
86
86
  | `@stacksjs/skills` | [`stacks-skills`](../stacks-skills/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/skills/src/index.ts) | 1 |
87
87
  | `@stacksjs/slug` | [`stacks-slug`](../stacks-slug/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/slug/src/index.ts) | 5 |
88
- | `@stacksjs/sms` | [`stacks-sms`](../stacks-sms/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/index.ts) | 6 |
88
+ | `@stacksjs/sms` | [`stacks-sms`](../stacks-sms/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/index.ts) | 7 |
89
89
  | `@stacksjs/socials` | [`stacks-socials`](../stacks-socials/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/socials/src/index.ts) | 18 |
90
90
  | `@stacksjs/storage` | [`stacks-storage`](../stacks-storage/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/index.ts) | 52 |
91
91
  | `@stacksjs/strings` | [`stacks-strings`](../stacks-strings/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/strings/src/index.ts) | 12 |
92
+ | `@stacksjs/support` | [`stacks-support`](../stacks-support/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/support/src/index.ts) | 6 |
93
+ | `@stacksjs/telephony` | [`stacks-telephony`](../stacks-telephony/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/index.ts) | 5 |
92
94
  | `@stacksjs/testing` | [`stacks-testing`](../stacks-testing/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/index.ts) | 24 |
93
95
  | `@stacksjs/tinker` | [`stacks-repl`](../stacks-repl/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/index.ts) | 4 |
94
96
  | `@stacksjs/tunnel` | [`stacks-tunnel`](../stacks-tunnel/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tunnel/src/index.ts) | 1 |
@@ -126,11 +128,11 @@ Evidence directory: [109 retained tests](https://github.com/stacksjs/stacks/blob
126
128
 
127
129
  Guidance: [`stacks-ai`](../stacks-ai/SKILL.md). Source: [storage/framework/core/ai/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/index.ts).
128
130
 
129
- Declared runtime exports: `assistantTurn`, `buildMessageWithImages`, `clearUsageReporters`, `estimateMessageTokens`, `estimateTokens`, `fetchWithRetry`, `listUsageReporters`, `normalizeMessagesForProvider`, `onUsage`, `recordUsage`, `sanitizePrompt`, `toolResultsTurn`.
131
+ Declared runtime exports: `RealtimeError`, `assistantTurn`, `buildMessageWithImages`, `clearUsageReporters`, `connectRealtime`, `estimateMessageTokens`, `estimateTokens`, `fetchWithRetry`, `listUsageReporters`, `normalizeMessagesForProvider`, `onUsage`, `recordUsage`, `sanitizePrompt`, `toolResultsTurn`.
130
132
 
131
- Local source modules: [src/agents/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/agents/index.ts), [src/buddy.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/buddy.ts), [src/client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/client.ts), [src/complete.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/complete.ts), [src/context.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/context.ts), [src/documents.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/documents.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/drivers/index.ts), [src/image.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/image.ts), [src/mcp-server.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/mcp-server.ts), [src/mcp.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/mcp.ts), [src/models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/models.ts), [src/personalization.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/personalization.ts), [src/search.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/search.ts), [src/speech.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/speech.ts), [src/text.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/text.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/types.ts), [src/utils/client-bedrock-runtime.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/client-bedrock-runtime.ts), [src/utils/client-bedrock.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/client-bedrock.ts), [src/utils/model-access.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/model-access.ts), [src/utils/retry.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/retry.ts), [src/utils/tokens.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/tokens.ts), [src/utils/tools.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/tools.ts), [src/utils/usage.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/usage.ts), [src/utils/vision.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/vision.ts).
133
+ Local source modules: [src/agents/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/agents/index.ts), [src/buddy.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/buddy.ts), [src/client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/client.ts), [src/complete.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/complete.ts), [src/context.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/context.ts), [src/documents.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/documents.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/drivers/index.ts), [src/durable-retrieval.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/durable-retrieval.ts), [src/embedding-client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/embedding-client.ts), [src/image.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/image.ts), [src/mcp-server.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/mcp-server.ts), [src/mcp.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/mcp.ts), [src/models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/models.ts), [src/personalization.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/personalization.ts), [src/realtime.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/realtime.ts), [src/search.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/search.ts), [src/speech.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/speech.ts), [src/text.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/text.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/types.ts), [src/utils/client-bedrock-runtime.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/client-bedrock-runtime.ts), [src/utils/client-bedrock.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/client-bedrock.ts), [src/utils/model-access.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/model-access.ts), [src/utils/retry.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/retry.ts), [src/utils/tokens.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/tokens.ts), [src/utils/tools.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/tools.ts), [src/utils/usage.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/usage.ts), [src/utils/vision.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/utils/vision.ts).
132
134
 
133
- Evidence directory: [21 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
135
+ Evidence directory: [24 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
134
136
 
135
137
  ### @stacksjs/alias
136
138
 
@@ -190,7 +192,7 @@ Declared runtime exports: `DEFAULT_ROLE_PACKS`, `adminEmails`, `createBqbRbacSto
190
192
 
191
193
  Local source modules: [src/admins.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/admins.ts), [src/authentication.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/authentication.ts), [src/authenticator.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/authenticator.ts), [src/authorizable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/authorizable.ts), [src/browser-session-store.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/browser-session-store.ts), [src/browser-session.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/browser-session.ts), [src/client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/client.ts), [src/cookie-auth.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/cookie-auth.ts), [src/credential-user.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/credential-user.ts), [src/display-name.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/display-name.ts), [src/email-verification.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/email-verification.ts), [src/gate.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/gate.ts), [src/impersonation-auth.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/impersonation-auth.ts), [src/impersonation-store.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/impersonation-store.ts), [src/impersonation.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/impersonation.ts), [src/magic-link.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/magic-link.ts), [src/middleware.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/middleware.ts), [src/oauth-authorization-codes.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-authorization-codes.ts), [src/oauth-authorization-endpoint.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-authorization-endpoint.ts), [src/oauth-authorization-requests.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-authorization-requests.ts), [src/oauth-authorization-response.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-authorization-response.ts), [src/oauth-authorization.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-authorization.ts), [src/oauth-browser-session.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-browser-session.ts), [src/oauth-client-registration.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-client-registration.ts), [src/oauth-consent.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-consent.ts), [src/oauth-delegated-access.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-delegated-access.ts), [src/oauth-dynamic-registration.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-dynamic-registration.ts), [src/oauth-grants.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-grants.ts), [src/oauth-introspection.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-introspection.ts), [src/oauth-metadata.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-metadata.ts), [src/oauth-pkce.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-pkce.ts), [src/oauth-protected-resource.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-protected-resource.ts), [src/oauth-provider.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-provider.ts), [src/oauth-pruning.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-pruning.ts), [src/oauth-revocation.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-revocation.ts), [src/oauth-server.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-server.ts), [src/oauth-token-endpoint.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-token-endpoint.ts), [src/oauth-token-exchange.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-token-exchange.ts), [src/oauth-token-request.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-token-request.ts), [src/oauth-token-response.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-token-response.ts), [src/oauth-userinfo.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/oauth-userinfo.ts), [src/page-gate.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/page-gate.ts), [src/passkey.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/passkey.ts), [src/passkeys.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/passkeys.ts), [src/password/reset-token.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/password/reset-token.ts), [src/password/reset.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/password/reset.ts), [src/permissions.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/permissions.ts), [src/policy.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/policy.ts), [src/rate-limiter.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/rate-limiter.ts), [src/rbac-seed.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/rbac-seed.ts), [src/rbac-store-bqb.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/rbac-store-bqb.ts), [src/rbac.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/rbac.ts), [src/referrals.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/referrals.ts), [src/register.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/register.ts), [src/request-token.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/request-token.ts), [src/session-auth.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/session-auth.ts), [src/session-handoff.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/session-handoff.ts), [src/socials.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/socials.ts), [src/team.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/team.ts), [src/tokens.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/tokens.ts), [src/two-factor-recovery-codes.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/two-factor-recovery-codes.ts), [src/two-factor.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/two-factor.ts), [src/user.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/user.ts).
192
194
 
193
- Evidence directory: [134 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
195
+ Evidence directory: [136 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
194
196
 
195
197
  ### @stacksjs/browser
196
198
 
@@ -220,7 +222,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
220
222
 
221
223
  Local source modules: [src/commands/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/commands/index.ts).
222
224
 
223
- Evidence directory: [196 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
225
+ Evidence directory: [200 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
224
226
 
225
227
  ### @stacksjs/build
226
228
 
@@ -266,11 +268,11 @@ Evidence directory: [3 retained tests](https://github.com/stacksjs/stacks/blob/m
266
268
 
267
269
  Guidance: [`stacks-chat`](../stacks-chat/SKILL.md). Source: [storage/framework/core/chat/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/index.ts).
268
270
 
269
- Declared runtime exports: `MessagingError`, `configureDiscord`, `configureSlack`, `configureTeams`, `createMessenger`, `discord`, `inbox`, `messagingChannel`, `send`, `sendToDiscord`, `sendToSlack`, `sendToTeams`, `slack`, `teams`.
271
+ Declared runtime exports: `ChatTransportError`, `MessagingError`, `MetaMessagingClient`, `configureDiscord`, `configureSlack`, `configureTeams`, `createMessenger`, `discord`, `inbox`, `messagingChannel`, `send`, `sendToDiscord`, `sendToSlack`, `sendToTeams`, `slack`, `teams`.
270
272
 
271
- Local source modules: [src/drivers/discord.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/drivers/discord.ts), [src/drivers/slack.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/drivers/slack.ts), [src/drivers/teams.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/drivers/teams.ts), [src/inbox/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/inbox/index.ts).
273
+ Local source modules: [src/drivers/discord.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/drivers/discord.ts), [src/drivers/slack.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/drivers/slack.ts), [src/drivers/teams.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/drivers/teams.ts), [src/inbox/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/inbox/index.ts), [src/meta.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/meta.ts), [src/transport.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/src/transport.ts).
272
274
 
273
- Evidence directory: [6 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
275
+ Evidence directory: [7 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/chat/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
274
276
 
275
277
  ### @stacksjs/cli
276
278
 
@@ -358,7 +360,7 @@ Declared runtime exports: `Database`, `EntityQueryBuilder`, `__flushAfterCommitN
358
360
 
359
361
  Local source modules: [src/affected-rows.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/affected-rows.ts), [src/auth-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/auth-tables.ts), [src/custom/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/custom/index.ts), [src/database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/database.ts), [src/datetime-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/datetime-columns.ts), [src/ddl-constraints.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ddl-constraints.ts), [src/defaults.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/defaults.ts), [src/dialect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/dialect.ts), [src/driver-config.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/driver-config.ts), [src/drivers/dynamodb.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/drivers/dynamodb.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/drivers/index.ts), [src/ensure-database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ensure-database.ts), [src/erd.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/erd.ts), [src/fk-audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/fk-audit.ts), [src/framework-renames.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/framework-renames.ts), [src/framework-route-admission.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/framework-route-admission.ts), [src/hand-written-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/hand-written-migrations.ts), [src/ignored-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ignored-migrations.ts), [src/index-shape.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index-shape.ts), [src/managed-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/managed-columns.ts), [src/migration-dialect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-dialect.ts), [src/migration-ledger.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-ledger.ts), [src/migration-names.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-names.ts), [src/migration-path.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-path.ts), [src/migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migrations.ts), [src/model-sources.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/model-sources.ts), [src/notification-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/notification-tables.ts), [src/package-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/package-migrations.ts), [src/package-models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/package-models.ts), [src/query-logger.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/query-logger.ts), [src/rbac-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/rbac-tables.ts), [src/relation-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/relation-columns.ts), [src/replicas.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/replicas.ts), [src/row-lease.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/row-lease.ts), [src/row-lock.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/row-lock.ts), [src/safe-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/safe-migrations.ts), [src/schema-align.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/schema-align.ts), [src/schema-drift.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/schema-drift.ts), [src/seeder.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/seeder.ts), [src/shadowed-models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/shadowed-models.ts), [src/sql-helpers.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/sql-helpers.ts), [src/table-exists.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/table-exists.ts), [src/trait-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/trait-tables.ts), [src/transaction-context.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/transaction-context.ts), [src/transaction-options.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/transaction-options.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/types.ts), [src/unique-audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/unique-audit.ts), [src/utc-defaults.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/utc-defaults.ts), [src/utils.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/utils.ts), [src/uuid-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/uuid-columns.ts), [src/vschema.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/vschema.ts).
360
362
 
361
- Evidence directory: [146 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
363
+ Evidence directory: [147 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
362
364
 
363
365
  ### @stacksjs/datetime
364
366
 
@@ -548,7 +550,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
548
550
 
549
551
  Local source modules: [src/client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/client.ts), [src/meter.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/meter.ts), [src/service.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/service.ts).
550
552
 
551
- Evidence directory: [8 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
553
+ Evidence directory: [9 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
552
554
 
553
555
  ### @stacksjs/http
554
556
 
@@ -830,11 +832,11 @@ Evidence directory: [5 retained tests](https://github.com/stacksjs/stacks/blob/m
830
832
 
831
833
  Guidance: [`stacks-sms`](../stacks-sms/SKILL.md). Source: [storage/framework/core/sms/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/index.ts).
832
834
 
833
- Declared runtime exports: `SMS`, `TwilioDriver`, `VonageDriver`, `createTwilioDriver`, `createVonageDriver`.
835
+ Declared runtime exports: `SMS`, `TwilioDriver`, `VonageDriver`, `WhatsAppCloudClient`, `createTwilioDriver`, `createVonageDriver`, `twilioPriceMicros`.
834
836
 
835
- Local source modules: [src/compliance.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/compliance.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/drivers/index.ts), [src/drivers/twilio.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/drivers/twilio.ts), [src/drivers/vonage.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/drivers/vonage.ts), [src/inbound.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/inbound.ts), [src/keywords.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/keywords.ts), [src/opt-out.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/opt-out.ts), [src/sms.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/sms.ts).
837
+ Local source modules: [src/compliance.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/compliance.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/drivers/index.ts), [src/drivers/twilio.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/drivers/twilio.ts), [src/drivers/vonage.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/drivers/vonage.ts), [src/inbound.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/inbound.ts), [src/keywords.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/keywords.ts), [src/opt-out.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/opt-out.ts), [src/sms.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/sms.ts), [src/whatsapp-cloud.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/whatsapp-cloud.ts).
836
838
 
837
- Evidence directory: [6 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
839
+ Evidence directory: [7 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
838
840
 
839
841
  ### @stacksjs/socials
840
842
 
@@ -866,6 +868,26 @@ Local source modules: [src/string.ts](https://github.com/stacksjs/stacks/blob/ma
866
868
 
867
869
  Evidence directory: [12 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/strings/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
868
870
 
871
+ ### @stacksjs/support
872
+
873
+ Guidance: [`stacks-support`](../stacks-support/SKILL.md). Source: [storage/framework/core/support/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/support/src/index.ts).
874
+
875
+ Declared runtime exports: `SupportError`, `createAuthenticatedSupportSession`, `createSupportClient`.
876
+
877
+ Local source modules: [src/server.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/support/src/server.ts).
878
+
879
+ Evidence directory: [6 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/support/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
880
+
881
+ ### @stacksjs/telephony
882
+
883
+ Guidance: [`stacks-telephony`](../stacks-telephony/SKILL.md). Source: [storage/framework/core/telephony/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/index.ts).
884
+
885
+ Declared runtime exports: `MemoryOperationJournal`.
886
+
887
+ Local source modules: [src/errors.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/errors.ts), [src/journal.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/journal.ts), [src/media.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/media.ts), [src/twilio.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/twilio.ts), [src/twiml.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/twiml.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/types.ts), [src/webhooks.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/webhooks.ts).
888
+
889
+ Evidence directory: [5 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
890
+
869
891
  ### @stacksjs/testing
870
892
 
871
893
  Guidance: [`stacks-testing`](../stacks-testing/SKILL.md). Source: [storage/framework/core/testing/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/index.ts).
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: stacks-support
3
+ description: Use when connecting an application to HQ.support, issuing customer sessions, creating support conversations, forwarding customer events, or controlling its stx messenger. Covers @stacksjs/support and services.supporthq.
4
+ license: MIT
5
+ compatibility: Bun >= 1.3.0, TypeScript
6
+ ---
7
+
8
+ # Native customer support
9
+
10
+ Read `stacks-hq` for approval, connection credentials and usage reporting.
11
+ HQ.support owns its own accounts and billing; no other HQ service grants access.
12
+
13
+ ## Server
14
+
15
+ Import `createSupportClient` from `@stacksjs/support/server` (or the package root).
16
+ Configure `url`, `key`, `readKey` and `project` from the application's
17
+ `services.supporthq` configuration. The origin defaults to `https://hq.support`.
18
+ `SUPPORTHQ_KEY` and `SUPPORTHQ_READ_KEY` are server secrets. Only the project
19
+ identifier is public.
20
+
21
+ Call `createSession` with `externalId` derived from the authenticated server
22
+ request. Send only the selected name, email, company and attributes. Give the
23
+ returned customer token to the messenger as a property, never an HTML attribute.
24
+ An arbitrary browser-supplied user ID is not authentication.
25
+
26
+ `track`, `conversations.create` and `conversations.reply` require an
27
+ `idempotencyKey`. Reuse it when retrying the same operation. The client never
28
+ automatically retries writes because a timeout may occur after persistence.
29
+ `conversations.list` reads project-scoped summaries with the read key when
30
+ available. A read key does not grant full transcript access.
31
+
32
+ `SupportError` exposes a safe `code` and HTTP `status`. Handle quota exhaustion,
33
+ expired credentials, network failures and uncertain writes explicitly. Error
34
+ messages exclude provider response bodies and secrets.
35
+
36
+ ## Browser
37
+
38
+ Import `createSupportBrowser` from `@stacksjs/support/browser`. Supply a compiled
39
+ messenger instance implementing `boot/open/close/update/track/shutdown`.
40
+ Load the versioned stx element bundle separately. No document or window globals
41
+ are needed merely to import the lifecycle client.
42
+
43
+ `boot({ project, endpoint?, sessionToken?, locale? })` initializes the widget.
44
+ Always `shutdown()` on logout, account change, or tenant change. Booting a new
45
+ identity clears the old widget first. Never forward a server integration key.
46
+
47
+ ## Verification
48
+
49
+ Use `createFakeSupportService` from `@stacksjs/support/testing` and pass its
50
+ `fetch` to the real client. It exercises wire contracts, scoped authentication,
51
+ and idempotency without a port. It is test-only and provides no production
52
+ persistence, metering, provider delivery, or identity verification.
53
+
54
+ Test through the public client and the built package subpaths. Customer flows
55
+ also require actual app route/database tests and the emitted stx widget running
56
+ in a plain host. Package tests alone do not prove the hosted product is ready.
57
+
58
+ ## Native identified messenger
59
+
60
+ `buddy support:install --messenger` explicitly opts in: it approves the configured
61
+ `APP_URL` origin, creates `resources/components/HqSupport.stx`, mounts it in the
62
+ chosen app-local layout (`--layout` selects another), and writes
63
+ `SUPPORTHQ_ENABLED=true` / `SUPPORTHQ_MESSENGER=true`. Existing customized components
64
+ are preserved. Plain `support:install` connects server keys without enabling UI.
65
+
66
+ The native `/api/support/config` and authenticated `/api/support/session` routes
67
+ exist only when the session integration is enabled. The session action reads
68
+ `request.user()` through `createAuthenticatedSupportSession`; request parameters
69
+ cannot select another customer. Optional name/email sharing defaults off; select
70
+ fields explicitly with `config.services.supporthq.expose`. A custom tenant-aware
71
+ session action may pass the helper an authorized `resolveTenant` callback.
72
+
73
+ The stx component uses `mountNativeSupport` from the browser subpath and native
74
+ `authFetch`, so access-token refresh remains native. Navigation, page removal,
75
+ logout, sign-in and cross-tab auth changes clear the old messenger before any
76
+ new customer session is booted. Customer credentials remain element properties.
77
+ No framework upgrade enables this integration or sends customer data by itself.
78
+
79
+ `buddy support:doctor` checks usage, bounded summaries and, when native UI is
80
+ enabled, the approved exact app origin and published versioned widget manifest.
81
+ It creates no customer probe or conversation. `support:sync-docs` sends only
82
+ explicitly selected Markdown files (one to twenty, at most100KB each), defaults
83
+ to internal drafts, and supports `--dry-run`, `--public`, `--publish` and `--locale`.
84
+ Manual edits conflict instead of being overwritten. `support:import intercom`
85
+ accepts a selected private JSON bundle, `--dry-run` for a server rollback rehearsal,
86
+ and `--resume` / `--status` for counts-only migration control. Neither command prints
87
+ customer source bodies or integration keys.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: stacks-telephony
3
+ description: Use when implementing telephone numbers or voice calls - US/Canada number search and provisioning, Twilio call control, authenticated voice callbacks, TwiML responses, or bounded Media Streams audio. Covers @stacksjs/telephony.
4
+ license: MIT
5
+ compatibility: Bun >= 1.3.0, TypeScript
6
+ allowed-tools: Read Edit Write Bash Grep Glob
7
+ ---
8
+
9
+ # Stacks Telephony
10
+
11
+ Read `storage/framework/core/telephony/README.md` for the public contracts and
12
+ provider limitations. Source is `storage/framework/core/telephony/src/`;
13
+ public API and isolated-consumer tests are in its `tests/` directory.
14
+
15
+ ## Provider choice
16
+
17
+ `TwilioTelephony` is a real REST transport. Construction requires explicit
18
+ `accountSid`, `authToken`, and `journal`; `fetch` and `timeoutMs` are injectable.
19
+ Construction performs no network request. Credentials stay server-side.
20
+ `FakeTelephony` from `@stacksjs/telephony/testing` is deterministic and uses no
21
+ network. Its `receiveCall`, `setCallStatus` and `failNext` controls simulate
22
+ provider behavior without implying live delivery or provider approval.
23
+
24
+ Search with `searchNumbers({country: 'US' | 'CA', areaCode?, limit?})` and
25
+ provision only a country-verified result. A `+1` prefix alone is not a country
26
+ check. `provisionNumber` requires `phoneNumber` and an HTTPS `voiceUrl`;
27
+ regulatory `bundleSid`/`addressSid` are optional provider inputs, not approval.
28
+ `configureNumber` updates inbound routing; `releaseNumber` releases the number.
29
+ All provider writes incur real consequences when used with real credentials.
30
+ Use the application's authorized ownership, consent and spending checks first.
31
+
32
+ ## Durable writes
33
+
34
+ Every write takes `{operationKey}`. Use the application's stable outbox/job ID,
35
+ scoped by workspace. `createCall`, `redirectCall`, `endCall`, `provisionNumber`,
36
+ `configureNumber`, and `releaseNumber` send a single request and never retry
37
+ behind the caller's back. The operation journal stores its fingerprint and
38
+ result. Different input with the same key fails. Pending and uncertain outcomes
39
+ block another attempt.
40
+
41
+ Implement the `OperationJournal` interface with an atomic durable unique-key
42
+ claim and durable settlement. A failed journal claim must prevent the provider
43
+ write. Never expire pending/uncertain entries into a fresh attempt: a process
44
+ may have crashed after Twilio committed. Reconcile through signed callbacks,
45
+ provider resources and audited operator review. Reusing a successful key
46
+ replays its result; a confirmed rejection is replayed without another request.
47
+ A newly authorized attempt after rejection uses a new key.
48
+
49
+ `MemoryOperationJournal` is bounded, local to one process, and suitable for
50
+ tests/development. It does not provide production outbox durability or
51
+ cross-process coordination. `getCall`, `listCalls` and `listNumbers` help
52
+ reconciliation, but lists are the first page (max 50) and can lag writes.
53
+ An empty call list is not proof an ambiguous call was never placed.
54
+
55
+ ## Voice callback boundary
56
+
57
+ `parseVoiceWebhook({url, fields, signature, authToken, accountSid})` verifies
58
+ Twilio's HMAC-SHA1 signature over the exact configured public HTTPS URL and
59
+ all decoded form fields, before parsing. Preserve duplicates and whitespace;
60
+ apply a body-size limit before parsing the form. Never trust forwarded headers
61
+ to choose the public URL. JSON bodySHA256 callbacks are outside this helper's
62
+ contract. Check `CallSid` and destination ownership against the workspace.
63
+ Persist callback deduplication and ordering; signatures do not prove freshness.
64
+
65
+ Return `voiceResponse(steps)` as `text/xml` to answer an inbound call.
66
+ Supported steps: `say`, `dial`, `reject`, `hangup`, and bidirectional `stream`.
67
+ Speech and custom parameters are XML-escaped. Raw TwiML passed directly to a
68
+ call API must be trusted application code. Stream destinations use `wss:`
69
+ without query strings; put scoped non-secret context in custom parameters.
70
+
71
+ ## Media Streams boundary
72
+
73
+ Authenticate the WebSocket upgrade with `verifyTwilioSignature` (empty form
74
+ fields, exact public HTTPS handshake URL) before accepting messages. Bind the
75
+ connection to a known account/call, then use `MediaStreamSession` to enforce
76
+ start metadata, stream identity, sequence progression and aggregate limits.
77
+ `parseMediaEvent` alone is a bounded parser, not authentication or a lifecycle.
78
+
79
+ Audio is raw mu-law, 8 kHz, mono. Default bounds are 64 KiB JSON, 8,000 bytes per
80
+ audio frame, and 30 minutes of audio per session. `mediaMessage` encodes bytes;
81
+ it does not transcode PCM or remove WAV headers. Mark acknowledgements can
82
+ mean completion or buffer clearing. `AudioQueue` rejects overflow explicitly
83
+ without dropping accepted frames. Apply socket backpressure and close/fail the
84
+ call on overflow; never silently drop or sample support audio.
85
+
86
+ These primitives do not supply a WebSocket host, STT, TTS, an AI orchestration
87
+ loop, consent policy or billing. Claim a live voice agent only after those
88
+ layers and real provider approval have been tested end to end.
89
+
90
+ ## Completion evidence
91
+
92
+ From the package: `bun run build`, `bun test ./tests`, `bun run typecheck`.
93
+ From the repository: `./buddy lint storage/framework/core/telephony`.
94
+ The consumer test uses only copied manifest/dist output, no workspace aliases.
95
+ Keep provider access optional in CI and never purchase numbers or place calls
96
+ as an automatic test. Live acceptance is a separate explicitly authorized step.
@@ -13,7 +13,7 @@ project `AGENTS.md`, a doc reached by a pointer. The packaging differs, the
13
13
  writing does not. The same levers make each one predictable, because the agent
14
14
  takes the same *process* every run rather than producing the same output.
15
15
 
16
- Stacks ships 211 skills and expects projects to add their own under
16
+ Stacks ships 213 skills and expects projects to add their own under
17
17
  `app/Skills/`, so this is the skill that keeps that set from turning to sludge.
18
18
  The Stacks-specific mechanics (frontmatter, invocation, the override model,
19
19
  what `buddy setup:ai` does with the result) are in
@@ -175,6 +175,7 @@ const HQ_LABELS: Record<HqServiceName, string> = {
175
175
  analyticshq: 'AnalyticsHQ',
176
176
  statushq: 'StatusHQ',
177
177
  commshq: 'CommsHQ',
178
+ supporthq: 'HQ.support',
178
179
  reportshq: 'ReportsHQ',
179
180
  }
180
181
 
@@ -0,0 +1,20 @@
1
+ import { Action } from '@stacksjs/actions/runtime'
2
+ import { config, overridesReady } from '@stacksjs/config'
3
+ import { createAuthenticatedSupportSession, createSupportClient } from '@stacksjs/support/server'
4
+
5
+ export default new Action({
6
+ name: 'Create an identified native support session', method: 'POST', apiResponse: false,
7
+ async handle(request) {
8
+ await overridesReady
9
+ const service = config.services.supporthq
10
+ if (service?.enabled !== true || !service.key || !service.project) return Response.json({ error: { code: 'support_disabled' } }, { status: 404 })
11
+ const user = await request.user()
12
+ if (!user) return Response.json({ error: { code: 'unauthorized' } }, { status: 401 })
13
+ try {
14
+ const client = createSupportClient({ url: service.url, key: service.key, project: service.project })
15
+ const session = await createAuthenticatedSupportSession(client, request, { expose: service.expose })
16
+ return Response.json({ token: session.token, expiresAt: session.expiresAt }, { headers: { 'Cache-Control': 'private, no-store' } })
17
+ }
18
+ catch { return Response.json({ error: { code: 'support_unavailable' } }, { status: 503, headers: { 'Cache-Control': 'no-store' } }) }
19
+ },
20
+ })
package/functions/auth.ts CHANGED
@@ -81,11 +81,17 @@ export interface AuthComposable {
81
81
  token: { value: string | null }
82
82
  }
83
83
 
84
+ function notifyAuthSession(phase: 'changing' | 'changed'): void {
85
+ if (typeof globalThis.dispatchEvent === 'function') globalThis.dispatchEvent(new Event(`stacks:auth-${phase}`))
86
+ }
87
+
84
88
  export function useAuth(): AuthComposable {
85
89
  function storeLogin(data: LoginResponse): void {
90
+ notifyAuthSession('changing')
86
91
  token.value = data.token
87
92
  user.value = data.user
88
93
  isAuthenticated.value = true
94
+ notifyAuthSession('changed')
89
95
  }
90
96
 
91
97
  async function fetchAuthUser(): Promise<UserData | null> {
@@ -148,9 +154,11 @@ export function useAuth(): AuthComposable {
148
154
  return data
149
155
 
150
156
  if (isRegisterResponse(data)) {
157
+ notifyAuthSession('changing')
151
158
  token.value = data.token
152
159
  user.value = data.user
153
160
  isAuthenticated.value = true
161
+ notifyAuthSession('changed')
154
162
  return data
155
163
  }
156
164
 
@@ -203,6 +211,7 @@ export function useAuth(): AuthComposable {
203
211
  }
204
212
 
205
213
  async function logout() {
214
+ notifyAuthSession('changing')
206
215
  const currentToken = token.value
207
216
  const response = await fetch(`${baseUrl}/logout`, {
208
217
  method: 'POST',
@@ -218,6 +227,7 @@ export function useAuth(): AuthComposable {
218
227
  token.value = ''
219
228
  user.value = null
220
229
  isAuthenticated.value = false
230
+ notifyAuthSession('changed')
221
231
  }
222
232
 
223
233
  return {
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.575",
5
+ "version": "0.75.579",
6
6
  "description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.575",
5
+ "version": "0.75.579",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -45,12 +45,14 @@
45
45
  "dependencies": {
46
46
  "@iconify-json/f7": "^1.2.2",
47
47
  "@iconify-json/hugeicons": "^1.2.35",
48
- "@stacksjs/mobile": "0.75.575",
49
- "@stacksjs/sanitizer": "^0.2.864",
50
- "@stacksjs/stx": "^0.2.864",
51
- "@stacksjs/strings": "0.75.575",
48
+ "@stacksjs/mobile": "0.75.579",
49
+ "@stacksjs/sanitizer": "^0.2.872",
50
+ "@stacksjs/stx": "^0.2.872",
51
+ "@stacksjs/strings": "0.75.579",
52
52
  "@xterm/addon-fit": "^0.11.0",
53
53
  "@xterm/xterm": "^6.0.0",
54
- "ts-qr-codes": "^0.1.8"
54
+ "ts-qr-codes": "^0.1.8",
55
+ "@stacksjs/support": "0.75.579",
56
+ "@stacksjs/browser": "0.75.579"
55
57
  }
56
58
  }
@@ -0,0 +1,16 @@
1
+ <script client>
2
+ import { mountNativeSupport } from '@stacksjs/support/browser'
3
+ import type { NativeSupportMount } from '@stacksjs/support/browser'
4
+ import { useAuth } from '@stacksjs/browser'
5
+
6
+ const supportHost = useRef('supportHost')
7
+ let mountedSupport: NativeSupportMount | undefined
8
+ onMount(() => {
9
+ const auth = useAuth()
10
+ mountedSupport = mountNativeSupport(supportHost.current as HTMLElement, { getToken: auth.getToken, fetch: auth.authFetch })
11
+ void mountedSupport.refresh()
12
+ })
13
+ onDestroy(() => mountedSupport?.shutdown())
14
+ </script>
15
+
16
+ <div ref="supportHost" data-hq-support-native></div>
package/routes/core.ts CHANGED
@@ -76,3 +76,16 @@ route.get('/_stacks/mail/preview/{name}/raw', async (req: any) => {
76
76
  headers: { 'Content-Type': 'text/html; charset=utf-8' },
77
77
  })
78
78
  }).skipCsrf()
79
+
80
+ // Configuration reads never contact HQ.support or expose either server key.
81
+ {
82
+ const { config } = await import('@stacksjs/config')
83
+ if (config.services.supporthq?.enabled === true) {
84
+ route.get('/api/support/config', () => {
85
+ const service = config.services.supporthq!
86
+ return Response.json({ enabled: service.enabled === true && service.messenger?.enabled === true, project: service.project,
87
+ endpoint: service.url, loaderUrl: service.messenger?.loaderUrl ?? 'https://hq.support/support.js', locale: service.messenger?.locale ?? 'en', sessionEndpoint: '/api/support/session' }, { headers: { 'Cache-Control': 'no-store' } })
88
+ })
89
+ route.post('/api/support/session', 'Actions/Support/SessionAction').middleware('auth').rateLimit(60, 'minute')
90
+ }
91
+ }