Cursor: Difference between revisions

Created page with "This page and other pages linked from it are maintained by Cursor AI to document the development and deployment of the entire project. === Functional Requirements === These pages provide details about how various features should work. Please do not edit these or any other existing pages. * Wiki Page Types * New User Onboarding === Guidelines === * You may make as many additional pages as you need * Prepend all page names with "Cursor ""
 
CursorBot (talk | contribs)
Cursor: sync Cursor page from git
Line 2: Line 2:


=== Functional Requirements ===
=== Functional Requirements ===
These pages provide details about how various features should work. Please do not edit these or any other existing pages.
 
These pages provide details about how various features should work. Please do not edit these or any other existing pages.


* [[Wiki Page Types]]
* [[Wiki Page Types]]
Line 10: Line 11:


* You may make as many additional pages as you need
* You may make as many additional pages as you need
* Prepend all page names with "Cursor "
* Prepend all page names with <code>Cursor </code>
* Use edit summary prefix <code>Cursor:</code> on all bot edits
 
=== API access (CursorBot) ===
 
Cursor edits Knowledge Commons through the [https://www.mediawiki.org/wiki/API:Main_page MediaWiki Action API] as '''CursorBot'''. Edits appear in page history as [[User:CursorBot]].
 
'''Login''' uses a [https://www.mediawiki.org/wiki/Manual:Bot_passwords bot password], not Google/Authentik:
 
* API endpoint: <code>https://wiki.goalstriving.org/api.php</code>
* Login name: <code>CursorBot@Cursor</code>
* Password: on the EC2 server at <code>/etc/goalstriving/cursor-bot-credentials.php</code> (not in git)
 
'''Login flow''' (MediaWiki 1.43 — tokens required):
 
# <code>action=query&meta=tokens&type=login&format=json</code> — get <code>logintoken</code> (use a cookie jar)
# <code>action=login</code> with <code>lgname</code>, <code>lgpassword</code>, <code>lgtoken</code>, <code>format=json</code>
# <code>action=query&meta=tokens&type=csrf&format=json</code> — get <code>csrftoken</code>
# <code>action=edit</code> with <code>title</code>, <code>text</code>, <code>token</code> (csrf), <code>summary</code>, <code>format=json</code>
 
'''Scope:''' CursorBot may edit this page tree and create pages prefixed with <code>Cursor </code>. Do not edit functional-requirements pages ([[Wiki Page Types]], [[New User Onboarding]]).
 
'''Server setup:''' after deploy, run once on EC2:
 
<source lang="bash">
sudo /usr/local/bin/provision-cursor-bot.sh
</source>
 
To verify API login on EC2:
 
<source lang="bash">
sudo /usr/local/bin/test-cursor-bot-login.php
</source>
 
To republish this page from git after deploy:
 
<source lang="bash">
sudo /usr/local/bin/publish-cursor-wiki-page.sh
</source>
 
Repo reference: <code>docs/cursor-bot.md</code>