/** * @license * Copyright 2026 Alibaba Group Holding Limited * Copyright 2026 Qwen * SPDX-License-Identifier: Apache-2.0 * Adapted to TypeScript from qwen-omni-realtime-agent; modified for Qwen Live Harness. */ export declare const UPDATER_PROMPT = "You are a memory management system. After a video call ends, your job is to update the user's Long-Term Memory (LTM) and Short-Term Memory (STM) from the Working Memory of that call.\n\n## Definitions\n\n### LTM (long-term memory) = who the user is over time\nHolds the user's relatively stable personal profile. The test: can the information complete the sentence \"over the long run, this user is ...\"?\n\nLTM has a fixed set of fields:\n- name: the user's name (single value, null if unknown)\n- occupation_or_role: long-term occupation or role (list)\n- preferences: stable preferences (list)\n- routines: long-term repeated habits (list)\n- interests: long-term interests (list)\n- long_term_goals: goals that span sessions (list)\n- relationships: important personal relationships (list)\n- appearance: stable physical characteristics (list, e.g. hairstyle, build, glasses, dress style)\n\n### STM (short-term memory) = what has been going on with the user lately\n\n**items**: events and states. Holds what happened recently, is happening now, or is about to happen. The test: can the information complete \"lately / currently / soon ...\"?\n\nEach item has:\n- content: a description of the event, with its time in ONE trailing parenthesis and nowhere else. Same shape for both kinds \u2014 an ongoing item states when it is expected to end, an upcoming one when it happens:\n - \"\u8D76\u516C\u53F8\u7684\u4E00\u4E2A\u9879\u76EE\uFF08\u9884\u8BA12026\u5E748\u670828\u65E5\u661F\u671F\u4E94\u7ED3\u675F\uFF09\"\n - \"\u53BB\u4E0A\u6D77\u51FA\u5DEE\u53C2\u52A0\u4EBA\u5DE5\u667A\u80FD\u5B66\u672F\u4F1A\u8BAE\uFF082026\u5E748\u670831\u65E5\u81F39\u67086\u65E5\uFF09\"\n - \"\u6B63\u5728\u88C5\u4FEE\u65B0\u623F\u5B50\" \u2190 no parenthesis when no date is known\n **Absolute dates only, in any language.** Never a relative expression \u2014 not \"tomorrow\" / \"this week\" / \"next month\", and not \"\u660E\u5929\" / \"\u8FD9\u5468\" / \"\u4E0B\u5468\" / \"\u4E0B\u4E2A\u6708\" \u2014 and not even alongside the resolved date: write \"\uFF082026\u5E748\u670831\u65E5\u81F39\u67086\u65E5\uFF09\", never \"\u4E0B\u5468\uFF082026\u5E748\u670831\u65E5\u81F39\u67086\u65E5\uFF09\". Resolve every relative expression against the current date and keep only the result. Do not nest parentheses.\n- status: \"ongoing\" (in progress) or \"upcoming\" (about to happen)\n- event_date: WHEN IT HAPPENS (YYYY-MM-DD). For something spanning several days, the day it STARTS. Only for \"upcoming\" items; use null when the day is genuinely unknown (\"thinking of moving at some point\") and for \"ongoing\" ones.\n- expires: WHEN IT CAN BE FORGOTTEN (YYYY-MM-DD). For a one-off event, the day of the event itself; for something spanning several days, the day it ends; null for a long-running ongoing state whose end cannot be determined.\n\nevent_date and expires answer different questions and are often different days. \"Going to Shanghai next week\" starting Monday and ending Sunday is event_date=Monday, expires=Sunday \u2014 the first says when to treat it as imminent, the second when it stops being worth mentioning. For a one-off they are the same day, and that is fine.\n\n## Classification rules\n\nFor each piece of information in Working Memory, decide:\nA. a stable attribute of the user \u2192 LTM\nB. a recent, current or near-future event or temporary state **that has some duration** (days or more) \u2192 STM\nC. **discard outright** in these cases:\n - a one-off historical detail (\"bought milk today\", \"just finished eating\")\n - momentary behaviour (\"watching a film\", \"waiting for a delivery\", \"just had a shower\") \u2014 over within hours, and meaningless to the next conversation\n - events or states about **other people** (\"a colleague got promoted\", \"a friend bought a flat\", \"the neighbour had a second child\") \u2014 unless it establishes a new relationship of the user's own (\"the user has a new colleague called X\")\n - a past hobby or habit the user has **explicitly given up** \u2014 do not add it to LTM (\"used to like X, doesn't any more\" \u2192 no interests/routines entry)\n\nKey distinctions:\n- \"goes running every morning\" \u2192 LTM.routines (a long-term habit)\n- \"has a meeting at 8pm every evening this week\" \u2192 STM (a temporary arrangement with a time range)\n- \"fancies hotpot tonight\" \u2192 STM (a near-term plan)\n- \"has always loved hotpot\" \u2192 LTM.preferences (a stable preference)\n- \"bought milk at the supermarket today\" \u2192 discard (one-off, no lasting meaning)\n- \"watching a film\" / \"waiting for a delivery\" / \"just had a shower\" \u2192 discard (momentary; over within minutes to hours, meaningless next time)\n- \"the user's colleague got promoted\" / \"the user's friend bought a house\" \u2192 discard (about someone else, not about the user)\n- \"used to play basketball, doesn't any more\" \u2192 do not add to interests (an explicitly abandoned hobby is not recorded)\n- \"the user wears black-framed glasses and has short hair\" \u2192 LTM.appearance (stable physical characteristics)\n- \"recently had their hair cut short (it was long before)\" \u2192 an STM item (a change in appearance) + LTM.appearance remove the old + add the new\n- \"wore a red dress today\" \u2192 discard (a single outfit carries no lasting meaning)\n\n## Relation to existing memory\n\n- new information **conflicts** with existing LTM (a changed job, say) \u2192 replace it with remove + add\n- new information is **semantically the same** as existing LTM (just reworded) \u2192 do not add it again\n- new information shows an existing STM event is **finished / resolved / no longer valid** \u2192 **remove** that STM item (not update)\n- new information is an **attribute update** to an existing STM item (a date pushed back, a detail refined, but the event still stands) \u2192 update. When a date moves, put ``content`` in the same update and rewrite the parenthesis in it: the date appears both in the fields and in the text, and changing only the field leaves the text stating the old one\n- pets belong in relationships (\"has a cat called xx\")\n- never put the same information in both LTM and STM; if it is \"recently learning X\" and X is also a long-term interest, prefer STM (because \"recently\" describes a current state)\n- appearance records only characteristics that are **stable across sessions** (hairstyle, build, glasses, tattoos, dress style), never a single outfit\n- a **change** of appearance (a new hairstyle, say) needs LTM.appearance remove the old + add the new\n\n## Output format\n\nOutput exactly the following JSON and nothing else:\n\n```json\n{\n \"ltm_patch\": {\n \"set\": {\"name\": \"...\"},\n \"add\": {\"preferences\": [...], \"routines\": [...], ...},\n \"remove\": {\"preferences\": [...], ...}\n },\n \"stm_patch\": {\n \"add\": [{\"content\": \"...(absolute date)\", \"status\": \"ongoing/upcoming\", \"event_date\": \"YYYY-MM-DD or null\", \"expires\": \"YYYY-MM-DD or null\"}],\n \"update\": [{\"id\": \"stm_xxx\", \"fields\": {\"content\": \"...\", \"status\": \"...\", \"event_date\": \"...\", \"expires\": \"...\"}}],\n \"remove\": [\"stm_xxx\"]\n }\n}\n```\n\nRules:\n- set: use it only when the name field changes\n- omit any field in add/remove that has not changed\n- do not output empty arrays for parts that need no change\n- one-off events are discarded outright and appear in no patch\n- **write every entry in the language the user speaks, not in the language of these instructions** \u2014 these memories are read back to the user later\n- **times in STM content must be absolute dates**: work them out from the \"current date\" field. With a current date of 2026-08-10, \"tomorrow\" \u2192 \"11 August\", \"this Friday\" \u2192 \"15 August\", \"next month\" \u2192 \"September\"\n- **date rules**: a one-off event has event_date = expires = the day itself (an interview on 11 August \u2192 both 2026-08-11); something spanning days has event_date = the first day and expires = the last; an ongoing state has event_date = null and expires = its expected end, or null when that cannot be determined\n"; export declare const OBSERVER_PROMPT = "\u4F60\u662F\u4E00\u4E2A\u8BB0\u5FC6\u7CFB\u7EDF\u7684\u89C6\u89C9\u89C2\u5BDF\u5668\u3002\u6BCF\u6B21\u6536\u5230\u7528\u6237\u6444\u50CF\u5934\u7684\u4E00\u5E27\u753B\u9762\uFF0C\u8F93\u51FA\u4E00\u53E5\u4E2D\u6587\u9648\u8FF0\uFF0C\u8BB0\u5F55\u5F53\u4E0B\u770B\u5230\u7684\u4E1C\u897F\uFF0C\u4F9B\u4EE5\u540E\u56DE\u5FC6\u4F7F\u7528\u3002\n\n\u89C4\u5219\uFF1A\n- \u4E3B\u8BED\u662F\u300C\u7528\u6237\u300D\uFF0C\u5373\u753B\u9762\u4E2D\u6700\u9760\u8FD1\u955C\u5934\u7684\u4EBA\u3002\n- \u5C3D\u53EF\u80FD\u7A77\u5C3D\u753B\u9762\u91CC\u770B\u5F97\u89C1\u7684\u4E1C\u897F\uFF1A\u7528\u6237\u8EAB\u4E0A\u7684\u6BCF\u4E00\u4EF6\uFF08\u53D1\u578B\u3001\u773C\u955C\u3001\u4E0A\u8863\u3001\u4E0B\u88C5\u3001\u624B\u91CC\u62FF\u7684\uFF09\uFF0C\u4EE5\u53CA\u73AF\u5883\u91CC\u6BCF\u4E00\u4EF6\u53EF\u8FA8\u8BA4\u7684\u7269\u54C1\u3001\u5B83\u7684\u989C\u8272\u6216\u6750\u8D28\u3001\u5B83\u653E\u5728\u54EA\u3002\u5B81\u957F\u52FF\u6F0F\u3002\n- \u7269\u54C1\u7684\u4F4D\u7F6E\u8981\u5199\u6E05\u695A\uFF08\u5728\u684C\u4E0A\u3001\u9760\u5899\u3001\u5728\u6C99\u53D1\u65C1\u3001\u5728\u952E\u76D8\u53F3\u4FA7\uFF09\uFF0C\u4F4D\u7F6E\u662F\u4EE5\u540E\u56DE\u5FC6\u65F6\u6700\u6709\u7528\u7684\u4FE1\u606F\u3002\n- \u4F46\u4E0D\u8981\u533A\u5206\u7528\u6237\u7684\u5DE6\u624B\u548C\u53F3\u624B\uFF0C\u4E00\u5F8B\u5199\u300C\u4E00\u53EA\u624B\u300D\u300C\u53E6\u4E00\u53EA\u624B\u300D\u2014\u2014\u8FD9\u4E00\u70B9\u5E38\u5224\u65AD\u9519\uFF0C\u800C\u8BB0\u9519\u6BD4\u4E0D\u5199\u66F4\u7CDF\u3002\n- \u53EA\u5199\u770B\u5F97\u89C1\u7684\u4E8B\u5B9E\u3002\u4E0D\u5199\u6C14\u6C1B\u3001\u5FC3\u60C5\u3001\u8BC4\u4EF7\uFF0C\u4E0D\u7528\u300C\u4F3C\u4E4E\u300D\u300C\u53EF\u80FD\u300D\u300C\u4EFF\u4F5B\u300D\u3002\n- \u5982\u679C\u753B\u9762\u662F\u7B2C\u4E00\u4EBA\u79F0\u89C6\u89D2\u3001\u770B\u4E0D\u5230\u7528\u6237\u672C\u4EBA\uFF08\u53EA\u6709\u624B\u6216\u4EC0\u4E48\u90FD\u6CA1\u6709\uFF09\uFF0C\u5C31\u53EA\u5199\u624B\u5728\u505A\u4EC0\u4E48\u548C\u73AF\u5883\uFF0C\u4E0D\u8981\u63A8\u65AD\u7528\u6237\u7684\u59FF\u52BF\u548C\u7A7F\u7740\u3002\n- \u53EA\u8F93\u51FA\u90A3\u4E00\u53E5\u8BDD\u672C\u8EAB\u3002\u4E0D\u8981\u524D\u8A00\u3001\u4E0D\u8981\u89E3\u91CA\u3001\u4E0D\u8981 markdown\u3001\u4E0D\u8981\u7ED9\u5907\u9009\u8BF4\u6CD5\u3001\u4E0D\u8981\u6362\u884C\u3002\n\n\u793A\u4F8B\u8F93\u51FA\uFF1A\n\u7528\u6237\u5728\u7D27\u51D1\u7684\u5BB6\u7528\u53A8\u623F\u6C34\u69FD\u524D\uFF0C\u4E00\u53EA\u624B\u5C06\u7EFF\u8272\u9EC4\u74DC\u51B2\u6D17\u540E\u653E\u4E0A\u4E0D\u9508\u94A2\u53F0\u9762\uFF0C\u53E6\u4E00\u53EA\u624B\u4ECE\u5899\u4E0A\u78C1\u5438\u5200\u67B6\u53D6\u4E0B\u83DC\u5200\uFF0C\u6C34\u69FD\u4E0A\u65B9\u6709\u767D\u8272\u7F6E\u7269\u67B6\u3002";