I want to add the "user intents" feature to the site. ultrathink about this complex feature and implement it fully and completely. This will introduce a new lexicon type, dashboard settings components, and changes to profile and listing pages. # Lexicon This feature uses the user-intents lexicon as defined by: ```json { "defs": { "intention": { "properties": { "allow": { "type": "boolean" }, "updatedAt": { "format": "datetime", "type": "string" } }, "required": [ "updatedAt" ], "type": "object" }, "main": { "description": "A declaration of user intent", "key": "any", "record": { "properties": { "bulkDataset": { "ref": "#intention", "type": "ref" }, "protocolBridging": { "ref": "#intention", "type": "ref" }, "publicAccessArchive": { "ref": "#intention", "type": "ref" }, "syntheticContentGeneration": { "ref": "#intention", "type": "ref" }, "updatedAt": { "format": "datetime", "type": "string" } }, "type": "object" }, "type": "record" } }, "id": "org.user-intents.declaration", "lexicon": 1 } ``` An example record using that lexicon would look like: ```json { "$type": "org.user-intents.declaration", "updatedAt": "2025-02-20T21:37:20.362Z", "publicAccessArchive": { "allow": true, // true means "allow" "updatedAt": "2025-02-20T21:37:20.362Z" }, "bulkDataset": { "allow": false, // false means "disallow" "updatedAt": "2025-02-20T21:37:20.362Z" }, "protocolBridging": { // NOTE: missing 'allow' field means "undefined" preference (do not set to 'null') "updatedAt": "2019-02-20T22:44:20.000Z", } } ``` This lexicon would be created in the @lexicon directory as lexicon/org.user-intents.declaration.json. An example AT-URI is `at://did:plc:cbkjy5n7bk3ax2wplmtjofq2/org.user-intents.declaration/self`. Another would be `at://did:plc:cbkjy5n7bk3ax2wplmtjofq2/org.user-intents.declaration/did:web:atwork.place` referencing use within the https://atwork.place/ website. # Storage Create a storage trait and implementations for the user intents structure with the following fields: * `aturi` (string, primary key) The AT-URI of the user intents record * `cid` (string) The record's CID * `did` (string) The DID from the authority component of the AT-URI * `public_access_archive` (bool, default null) The value of the `publicAccessArchive` record structure's `allow` field. * `protocol_bridging` (bool, default null) The value of the `protocolBridging` record structure's `allow` field. * `synthetic_content_generation` (bool, default null) The value of the `syntheticContentGeneration` record structure's `allow` field. * `record` (JSON) the raw record as it exists in the PDS The storage trait should support the following operations: * Insert/Update (upsert) a user-intents record in storage * Get user-intents record by AT-URI * Get all user-intents records for a DID # Consumer Update the jetstream consumer to also subscribe to the `org.user-intents.declaration` collection. When a record is encountered, it should discard any that have a record key other than "self" or "did:web:atwork.place". These records should be inserted / updated (upserted) into storage. # Dashboard Settings On the dashboard settings page, create a section for "experimental" features. In the experimental features section, create a form that allows a user to update their user-intents record for both "self" and "did:web:atwork.place". This will result in two records being created, each with the record key being "self" and "did:web:atwork.place"". For each of the following value and label pairs, have a radio that lets them be set to "allow", "disallow", or "no preference". * `bulkDataset` as "Bulk Datasets" -- Allow data to be included in bulk "snapshot" datasets which are publicly redistributed, even if only for a fixed time period. * `protocolBridging` as "Protocol Bridging" -- Allow for bridging account data or interactions into distinct social web protocol ecosystems. * `publicAccessArchive` as "Archiving / Preservation" -- Allow public access to or replay of account data as part of archiving and preservation efforts. # Profile Page Update the `/u/[subject]` page to support this feature. All of the user-intents records are retreived from storage for an identity and intentions aggregated in the order of "self" and then "did:web:atwork.place" values. If the aggregated `publicAccessArchive` field is `false` then add the following content to the `
...` section of the page: ```html ``` # Job Listing Page Update the `/u/[subject]/[listing]` page to support this feature. All of the user-intents records are retreived from storage for an identity and intentions aggregated in the order of "self" and then "did:web:atwork.place" values. If the aggregated `publicAccessArchive` field is `false` then add the following content to the `...` section of the page: ```html ``` # Help Content Create a help page at /help/user-intents. Note that this is an experimental feature based on the proposal at https://github.com/bluesky-social/proposals/tree/main/0008-user-intents. Explain that a user can set these values through the dashboard settings page in the experimental features section.