Repository navigation
API Snap Conversation
Caligrafy Quill 2.26.0. Generated from the source by
php qa/build-api-reference.php; the guides explain how to use these classes, this reference says exactly what each public method takes and returns. Back to the API reference.
Part of Snap.
namespace Caligrafy\Snap;
class ConversationSource: framework/core/Snap/Conversation.php:19
The Snap shell's two spaces (2.23.0):
Home the starting workspace: the agent's message for the situation, prompt suggestions (and "What else can
I do"), the input; then the cards: Needs you (alerts, tasks waiting on you, changes to confirm),
For you (offers), In progress (tasks), Shortcuts. Only the sections that have something.
Task space the engagement: the conversation minimized to the agent's latest answer (back and forth, history,
rating, a different answer, the input on demand); only the cards of that answer.
Each turn is kept (snap_turns): what was asked, the caption, the cards, the suggestions, how it was answered.
TABLE = 'caligrafy_snap_turns'MORE = 'What else can I do?'HOME = 'Back to Home'
Conversation::installed()Conversation::save()Conversation::turns()Conversation::last()Conversation::history()Conversation::rate()Conversation::memory()Conversation::suggestions()Conversation::empty()Conversation::lower()Conversation::home()Conversation::open()Conversation::needs()Conversation::insights()Conversation::progress()
public static function installed()Whether Snap's tables are there (php caligrafer.php platform install): checked once per request
Source: framework/core/Snap/Conversation.php:28
public static function save(Context $context, $conversation, $text, array $answer)No doc comment.
Parameters
-
$contextContext $conversation$text-
$answerarray
Source: framework/core/Snap/Conversation.php:44
public static function turns(Context $context, $conversation)No doc comment.
Parameters
-
$contextContext $conversation
Source: framework/core/Snap/Conversation.php:52
public static function last(Context $context, $turnId)No doc comment.
Parameters
-
$contextContext $turnId
Source: framework/core/Snap/Conversation.php:74
public static function history(Context $context, $limit = 20)This person's conversations, newest first: their first question is their title
Parameters
-
$contextContext -
$limit, default20
Source: framework/core/Snap/Conversation.php:86
public static function rate(Context $context, $turnId, $rating)No doc comment.
Parameters
-
$contextContext $turnId$rating
Source: framework/core/Snap/Conversation.php:103
public static function memory(Context $context, $conversation, $sent)The conversation's memory for the next ask: its earlier turns (what was asked, what was shown), what is on the person's screen now, what they chose since (opened, picked, confirmed), and what it is about (the focus: "it"). What the page sends is checked and cut to size; it is the person's own context, and the planner is told it is data from the app, never instructions.
Parameters
-
$contextContext $conversation$sent
Returns array: ['focus' => array|null, 'text' => string] (text empty: nothing to remember)
Source: framework/core/Snap/Conversation.php:121
public static function suggestions(array $cards, Context $context)What the person may want to do next, beyond the buttons of the cards on screen: the optional details a form still takes, what follows a change (another one, the list it belongs to), what a list leads to, then "What else can I do?". Each suggestion carries what it runs, so a click is at once a card, without a model.
Parameters
-
$cardsarray -
$contextContext
Source: framework/core/Snap/Conversation.php:174
public static function empty(array $card)No doc comment.
Parameters
-
$cardarray
Source: framework/core/Snap/Conversation.php:232
public static function lower($text)No doc comment.
Parameters
$text
Source: framework/core/Snap/Conversation.php:324
public static function home(Context $context)Home, for this person, now: an orchestrator of what to concentrate on, in this order:
Needs you alerts, tasks waiting on the person, changes to confirm (the focus)
insights numbers, each with the action it calls for (none without one)
For you offers (what they usually do now, routines)
In progress running tasks
discover the things this app is about, to browse: more like what they looked at, new, available
Just done, Your shortcuts
The message says the focus and nudges the conversation on; the suggestions start with the focus's action and a pick to look at. One card per capability (the latest task of a capability is its only card) and per object. Each card carries its key: opening it (snap_ask open) shows it in the task space.
Parameters
-
$contextContext
Source: framework/core/Snap/Conversation.php:343
public static function open(Context $context, $key)A Home card opened in the task space, by its key: a shortcut runs what it saved; anything else is shown in full, with the assistant's line
Parameters
-
$contextContext $key
Returns array: the answer: caption, cards, via, text
Source: framework/core/Snap/Conversation.php:436
public static function needs(Context $context, ?array $tasks = null)Needs you: alerts (a hint 'alert' on a read capability whose rows carry a flag), tasks that wait on the person (needs your answer, could not finish), routines waiting for their confirm. Each one carries its next step.
Parameters
-
$contextContext -
$tasks?array, defaultnull
Source: framework/core/Snap/Conversation.php:481
public static function insights(Context $context)Insights: numbers that call for something. One per read capability with an 'insight' hint, shown only when there is something to act on (a count above zero) and this person may take its action; each carries that action.
'insight' => array('label', 'icon', 'action' => array('capability', 'text'),
'since' => array('field', 'days')? count only what was added lately
'ring' => array('of', 'label', 'invert')?) and a share of another count
Parameters
-
$contextContext
Source: framework/core/Snap/Conversation.php:535
public static function progress(Context $context)The person's progress: what they got done today through the app, and how many days in a row they did something (from Caligrafy's audit log: their successful changes; the assistant's own bookkeeping is left out)
Parameters
-
$contextContext
Caligrafy: Describe it. Approve it. Ship it. Your idea turned into a complete app: every feature built once, for web pages, Vue apps, a REST API and AI agents, and online.
Why Caligrafy: the benefits, the measurements, and what it is not yet
-
Quickstart with Claude: describe it, approve it, ship it
or the Quickstart: the same three steps by hand, in 5 minutes
- How Caligrafy works: the ideas in 5 minutes
- Your first capability: build a feature, page included
-
Capabilities in depth
-
#[Capability]: every option - Scheduled jobs: capabilities on a timer
- Notifications: web push and email
- Background jobs: capabilities run later
- Migrations: database changes, in order
- The cache
-
Testing your app
- Dependency injection
- Validation rules
-
Web pages
- Views and page components
- Design styles: another look, one setting
- Declarative routes: every request, in one line
-
Route::page·Route::form·Route::auth·Route::webhook·Route::download·Route::redirect·Route::action·Route::snap· capability routes - How to export a list as CSV
- Controllers: moving one to a declared route · how to, step by step
- Forms and helpers
-
Vue apps
-
Mobile and tablet
-
REST API
-
AI agents
-
Snap Cards and the assistant
- Payments: Stripe and crypto
- Face detection and face login
- OpenAI: chat and images · Assistants
- Open models: Llama, Mistral...
- Chatbots with Watson
- Machine learning in the browser
- Metadata and social cards · search and analytics
-
Putting it online: the production image, the database at every start
-
API reference: every class and method
-
Routing ·
Route·AuthRoutes· pages ·Controller· capabilities -
Data ·
Model·Query· sign-in · jobs ·Notify· payments · AI -
Interfaces · Snap ·
Snap\Cards·Snap\Conversation· testing · tooling · helper functions
-
Routing ·
-
Caligrafer: every command
- Project · build · data · agents · jobs and tests · maintenance · deploy
- Installation, configuration and Caligrafer
- Routing · Request · Controllers · Views
- Vue: flow of information · routes · validations
- Security and upgrading
- Release notes: 2.26 · 2.25 · 2.24 · 2.23 · 2.22 · 2.21 · 2.20 · 2.19 · 2.18 · 2.17 · 2.16 · 2.15 · 2.14 · 2.13 · 2.12 · 2.11 · 2.10 · 2.9 · 2.8 · 2.7 · 2.6 · 2.5 · 2.4 · 2.3 · 2.1 · October 2026 · changelog
- Testing Caligrafy (contributors)