跳到主要内容

智能体上下文

该分类包含 5 条以 system.luna. 开头的 Runtime 系统命令。

1. 读取上下文工具结果​

完整命令:system.luna.context.tool-result.read

按工具结果引用里的 runId 与 toolCallId 读取此前持久化的结果;只能访问本租户自己的对话。不要为了恢复输出而重跑已完成的写入。 · 风险:读取

sl system luna context tool-result read \
(--definition-json json|--definition-file path) [--json]

参数:

  • appCode(可选)— Application code from the current context; defaults to luna
  • threadId(必填)— Owned tenant conversation UUID from the current context
  • runId(必填)— Explicit run ID from a stored tool-result reference
  • toolCallId(必填)— Exact completed tool call ID from that reference
  • offset(可选)— Character offset; defaults to zero. Continue with nextOffset
  • length(可选)— Characters to return, 1–16000; defaults to 8000

2. 列出记忆​

完整命令:system.luna.memory.list

列出或搜索私有长期记忆,含来源、版本与范围修订;用分页查看全部记忆。 · 风险:读取

sl system luna memory list \
(--definition-json json|--definition-file path) [--json]

参数:

  • appCode(可选)— Current application code; defaults to luna. Identity is derived from the authenticated actor
  • query(可选)— Literal content filter; empty returns all active memories with pagination
  • offset / limit(可选)— Offset defaults to 0; limit 1–100 defaults to 30. Continue with nextOffset

3. 搜索上下文​

完整命令:system.luna.context.search

在当前对话分支里搜索原始用户需求、纠正与执行证据,并返回来源步骤 ID 以便精确读取。 · 风险:读取

sl system luna context search \
(--definition-json json|--definition-file path) [--json]

参数:

  • appCode(可选)— Application code from the current context; defaults to luna
  • threadId(必填)— Owned tenant conversation UUID from the current context
  • headMessageId(必填)— Exact branch head from the current context. Sibling branches are excluded
  • query(必填)— Literal text to find in original messages and stored execution evidence
  • offset(可选)— Result offset; defaults to zero. Continue with nextOffset
  • limit(可选)— Page size 1–50; defaults to 20

4. 应用记忆​

完整命令:system.luna.memory.apply

以原子方式记住、纠正或遗忘私有记忆;先列表获取修订与精确 ID,并附上原始用户消息与原文引用,成功后再确认。 · 风险:记忆写入

sl system luna memory apply \
(--definition-json json|--definition-file path) [--json]

参数:

  • appCode(可选)— Current application code; defaults to luna
  • expectedRevision(必填)— Exact scope revision returned by list. On conflict, list again and reconsider the requested changes
  • source(必填)— {threadId, messageId}: original owned user message authorizing this change; never assistant or tool content
  • operations(必填)— 1–20 atomic changes. create: {action:"create",key,content,quote,priority?}; update: {action:"update",id,version,content,quote,priority?}; delete: {action:"delete",id,version,quote}. priority is core only for stable cross-topic preferences or identity, otherwise contextual. Quote must be an exact substring of the source user message. List first for IDs and versions. Use stable semantic keys and update existing facts. Deletion clears saved content, not original chat history

5. 读取上下文​

完整命令:system.luna.context.read

按精确 stepId 读取已保存的证据步骤,支持字符分页;需提供当前上下文的 appCode、threadId 与 headMessageId。不要为了取回结果而重复已完成的写入。 · 风险:读取

sl system luna context read \
(--definition-json json|--definition-file path) [--json]

参数:

  • appCode(可选)— Application code from the current context; defaults to luna
  • threadId(必填)— Owned tenant conversation UUID from the current context
  • headMessageId(必填)— Exact branch head from the current context
  • stepId(必填)— Exact source stepId returned by search or an evidence reference
  • offset(可选)— Character offset; defaults to zero. Continue with nextOffset
  • length(可选)— Characters to return, 1–16000; defaults to 8000