Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 18 additions & 26 deletions src/lib/tools/conversation_search.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,15 @@ export const conversationSearchSchema = {
'over what was actually said in them as well as their title and ' +
'summary. Returns {id, title, summary, updated_at, archived, ' +
'match_kind, similarity?, passage?}[]. ' +
'Search in the words the user would have used, not in the words a ' +
'title would use - the message text is indexed, so "ran out of ' +
'lentils" finds the conversation that says it however it is ' +
'titled. ' +
'`passage` is the excerpt that matched, when the hit came from the ' +
'message text; pass it back as conversation_get\'s `query` to open ' +
'the thread at that point rather than at its end. Absent on threads ' +
'matched only by title/summary. ' +
'summary is auto-generated after the first terminal assistant turn ' +
'(null on brand-new threads). Archived threads are included; weigh ' +
'the archived flag lower if freshness matters. ' +
'RANKING IS BY TOPIC ONLY unless you say otherwise. If the user ' +
'anchors their request in time - "yesterday", "last week", "the ' +
'other day", "recently" - a plain query will happily return the ' +
'best topical match from a year ago and nothing recent at all. Use ' +
'`within_days` when the time frame is a requirement, and ' +
'Search in the words the user would have used, not title words - ' +
'the message text is indexed, so "ran out of lentils" finds the ' +
'conversation that says it however it is titled. `passage` is the ' +
'matched excerpt; pass it back as conversation_get\'s `query` to ' +
'open the thread at that point. ' +
'RANKING IS BY TOPIC ONLY unless you say otherwise: if the user ' +
'anchors the request in time ("yesterday", "last week", "recently"), ' +
'a plain query may return the best topical match from a year ago. ' +
'Use `within_days` when the time frame is a requirement, ' +
'`prefer_recent` when it is only a lean.',
shortDescription: 'search past conversations by topic',
parameters: {
Expand All @@ -52,20 +45,19 @@ export const conversationSearchSchema = {
maximum: CONVERSATION_SEARCH_MAX_WITHIN_DAYS,
description:
'Only consider conversations with activity in the last N days. ' +
'A hard filter, so a great match outside the window is dropped ' +
'entirely - use it when the user made the time frame a ' +
'requirement ("the conversation from yesterday"), not when they ' +
'merely implied freshness. "the last few days" is about 3; "last ' +
'week" about 7.',
'A hard filter - a great match outside the window is dropped ' +
'entirely. Use when the user made the time frame a requirement, ' +
'not when they merely implied freshness ("the last few days" is ' +
'about 3; "last week" about 7).',
},
prefer_recent: {
type: 'boolean',
description:
'Break near-ties toward more recent conversations, without ' +
'excluding anything. Deliberately gentle: it reorders results ' +
'that already score similarly and will NOT lift a weak match ' +
'above a strong one. Use for "did we talk about this recently"; ' +
'use within_days when the time frame is the actual requirement.',
'Break near-ties toward more recent conversations without ' +
'excluding anything - it reorders similar scores, it will NOT ' +
'lift a weak match above a strong one. Use for "did we talk ' +
'about this recently"; use within_days when the frame is a ' +
'requirement.',
},
},
required: ['query'],
Expand Down
59 changes: 28 additions & 31 deletions src/lib/tools/recipe_save.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,37 +65,34 @@ export const recipeSaveSchema = {
'Omit id to create (title + cooklang required); pass id (from ' +
'recipe_list) to update, providing only the fields that change - ' +
'pass null for source / source_url to clear them. cooklang is the ' +
'raw Cooklang source (https://cooklang.org/docs/spec/): ' +
'@ingredient{qty%unit}, #cookware{}, ~timer{d%unit}, ' +
`>> metadata: value (max ${MAX_RECIPE_COOKLANG_CHARS} chars). Group ` +
'long recipes with `== Section ==` or `# Section` headers. Two ' +
'authoring styles supported and mixable: (a) pure Cooklang (each ' +
'line is an instruction with inline ingredients); (b) cookbook-style ' +
"(a line whose first non-whitespace char is `@` is an ingredient " +
'DECLARATION, not numbered as an instruction; a dash-only line like ' +
'`--` ends the declaration block so prose instructions below render ' +
'as a flat numbered list). Wrap a long instruction across lines by ' +
'prefixing continuations with `> `. Inline emphasis is supported in ' +
'step text: `**bold**`, `*italic*`, and `_italic_` render as styled ' +
'spans. Backtick code spans are NOT rendered - they show as literal ' +
"backticks, so don't use them. For durations, prefer the Cooklang " +
'timer syntax `~{N%unit}` (e.g. `~{4-5%hours}`) so the duration ' +
'also contributes to the timers list; wrapping it in `**...**` for ' +
'emphasis is fine but the `~` is what makes it a timer. For an ' +
'ingredient with a modifier, write the whole phrase as a single ' +
'multi-word braced name: `@pre-minced garlic{1%tbsp}`, NEVER ' +
'`@pre-minced @garlic{1%tbsp}` (which creates two separate ' +
'ingredient entries). Mark an OPTIONAL ingredient with `?` right ' +
'after the `@` (`@?cilantro{2%tbsp}`, bare `@?cilantro`) - it ' +
'renders with an "(optional)" tag in the ingredient list. For ' +
"alternatives (\"use X or Y\"), only the primary ingredient gets " +
'`@`; write the substitute as plain prose. The star rating is the ' +
"user's own verdict and is not editable here - only they can set " +
'or clear it, from the recipe card. change_message: optional on ' +
'create (defaults to "Initial version"), required on update - it ' +
'lands in the recipe history the user reviews. Returns the saved ' +
'row plus the current photo list, which this tool never changes - ' +
'use the recipe_photos_* tools to edit photos.',
`raw recipe source (max ${MAX_RECIPE_COOKLANG_CHARS} chars). ` +
'Grammar per line: ' +
'step | ingredient-declaration | section | metadata | comment; ' +
'ingredient := "@" "?"? name ("{" qty "%" unit? "}")?; ' +
'cookware := "#" name "{}"; ' +
'timer := "~" name? "{" qty "%" unit "}" ' +
`(e.g. ~{4%hours}); metadata := ">>" key ":" value. ` +
'Two authoring styles, mixable. Pure style puts references inline ' +
'in step prose ("Season the @pork{}, add @soy sauce{2%tbsp} to the ' +
'#wok{}, cook ~{3%minutes}"). Cookbook style: `@`-first lines are ' +
'not numbered as steps); a dash-only line ends the declaration block so ' +
'prose below renders as a flat numbered list. Guards: ' +
'a modifier+ingredient is ONE multi-word braced name - ' +
'`@pre-minced garlic{1%tbsp}`, NEVER `@pre-minced @garlic{...}`; ' +
'prep hints are a note AFTER the reference, not inside the name - ' +
'`@basil{1%tbsp} (finely chopped)`, never `@finely chopped basil{...}`; ' +
'optional ingredients take `?` after the `@` (`@?cilantro{2%tbsp}`); ' +
'alternatives get one `@` with the substitute as prose; ' +
'prefer timer syntax `~{N%unit}` over prose durations (it feeds the timers list); ' +
"wrap long steps with a `> ` continuation line; " +
'`== Soup ==` / `# Soup` start sections; ' +
'emphasis `**bold**` / `*italic*` renders, backticks do NOT. ' +
"The star rating is the user's verdict and is not editable here - " +
'only they can set or clear it, from the recipe card. ' +
'change_message: optional on create (defaults to "Initial version"), ' +
'required on update - it lands in the recipe history the user reviews. ' +
'Returns the saved row plus the current photo list, which this tool ' +
'never changes - use the recipe_photos_* tools to edit photos.',
shortDescription: 'save a recipe to the cookbook',
parameters: {
type: 'object',
Expand Down
20 changes: 6 additions & 14 deletions supabase/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1152,20 +1152,12 @@ grant execute on function public.mark_second_thoughts_acted(uuid)
-- gate existed. `toolboxes_enabled` held that set (written by the
-- retired toggle_toolbox meta-tool and composer popover);
-- `tools_enabled` was its boolean predecessor. No code reads
-- either any more.
--
-- The drop is DEFERRED one release on purpose. The deploy pipeline
-- applies this file BEFORE the new frontend reaches GitHub Pages,
-- and the previously-deployed frontend still writes
-- `toolboxes_enabled` in its createThread / forkThread inserts and
-- its toolbox-popover UPDATE - dropping the column now makes the
-- old bundle's first-send INSERT fail with PGRST204 for the
-- minutes-wide window until Pages finishes publishing. A dropped
-- column harms nothing while the new code (which never selects or
-- writes it) is live, so the drop lands in a follow-up PR once no
-- cached old bundle can still be in service.
-- alter table public.threads drop column if exists toolboxes_enabled;
-- alter table public.threads drop column if exists tools_enabled;
-- either any more. The drop was deferred one release so the
-- pre-gating-retirement frontend (which wrote toolboxes_enabled in
-- its createThread / forkThread inserts) survived the mixed-version
-- window; two releases have since deployed, so the drop is live.
alter table public.threads drop column if exists toolboxes_enabled;
alter table public.threads drop column if exists tools_enabled;

-- Soft-hide flag for the "Archive" drawer section. Archived threads still
-- load into the sidebar and remain viewable, but the composer is disabled
Expand Down