@nextclaw/kernel 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -8909,6 +8909,7 @@ const createInlineInteractiveSurfaceContextProvider = () => staticBlock([
|
|
|
8909
8909
|
"Do not make every UI an inline card. Choose inline only when the intended result is a compact, immediately usable card or short interaction; use the side panel for normal Panel Apps, long reading, rich editing, file browsing, large tables, multi-page workflows, or sustained workspaces.",
|
|
8910
8910
|
"Inline Panel App display is Markdown-only: in the final reply, output a `nextclaw-inline` fenced JSON block so the display remains message content.",
|
|
8911
8911
|
"`show_panel_app` is side-panel only. Never call `show_panel_app` for inline display, including when the user asks which Panel Apps are suitable for inline display or says \"show/display them inline\".",
|
|
8912
|
+
"To open a local image or document in the side panel, call `show_file`; its automatic viewer handles supported visual formats, including SVG. When an image should appear in the final reply, prefer standard Markdown image syntax under the Reply Formatting Contract. `view_image` is only for giving the model visual input and is not a user-display action.",
|
|
8912
8913
|
"For ordinary local HTML files or page prototypes, call `show_file` with `path` and `viewer=\"rendered\"`; use `viewer=\"source\"` when the user needs to inspect source text. Markdown file links open source by default; append `?viewer=rendered` only when the link itself should open the rendered HTML view. Do not convert a plain HTML file into a Panel App just to preview it.",
|
|
8913
8914
|
"A Panel Card must be designed card-first: prefer a landscape composition where width carries the main information and the card is wider than it is tall; collapse to one column only in narrow containers. Core value must be visible in the first 220-420px, with no horizontal scrolling, no reliance on document-level internal scrolling, compact controls, at most one primary action, clear loading/empty/error states, and an obvious expand path for details.",
|
|
8914
8915
|
"Typical Panel Card fits: weather cards, calculators, timers, checklists, pickers, compact forms, previews, and small dashboards. If the UI needs more space than a card, use the side panel instead. Inline hosts may pass `nextclawDisplayMode=card` and `nextclawPlacement=inline`; use those hints to render a compact card layout instead of a full page."
|
|
@@ -9066,7 +9067,20 @@ var ProjectContextProvider = class {
|
|
|
9066
9067
|
//#endregion
|
|
9067
9068
|
//#region src/contributions/context-provider/providers/reply-format-context.provider.ts
|
|
9068
9069
|
var ReplyFormatContextProvider = class {
|
|
9069
|
-
provide = (_request) => [
|
|
9070
|
+
provide = (_request) => [[
|
|
9071
|
+
"## Reply Formatting Contract",
|
|
9072
|
+
"Goal: openable files in user-visible replies must be clickable, local images should appear directly in the reply when appropriate, and inert inline display declarations are only for content that should appear as part of the reply.",
|
|
9073
|
+
"File links: use Markdown links only, with a plain text label and an openable href: [MEMORY.md](MEMORY.md), [report.docx](report.docx), [file](packages/example/file.ts), [notes.md](/Users/example/Documents/notes.md). Use project-relative hrefs for files under the active/session project root, and absolute hrefs for local files outside it. File links open source by default; supported visual and Office documents open their automatic preview. Use a viewer query such as [diagram.svg](diagram.svg?viewer=source) when source is explicitly required, or [preview.html](preview.html?viewer=rendered) when an HTML link should open rendered output.",
|
|
9074
|
+
"Markdown syntax and resource availability are separate: emit a proper Markdown link even when you cannot verify that its target still exists. The UI will report missing or unavailable content when the user opens it; never downgrade a valid link to bare text preemptively.",
|
|
9075
|
+
"Local images: prefer standard Markdown image syntax when the image should be visible in the reply:  or . Local image hrefs follow the same project-relative or absolute path rules as file links. Do not invent an internal API URL or a file:// URL. Use show_file only when the file should immediately open in the side panel; use view_image only to give the model visual input.",
|
|
9076
|
+
"Inline display: when the final reply should include a non-clickable inline display placeholder, output a fenced `nextclaw-inline` JSON block:",
|
|
9077
|
+
"```nextclaw-inline\n{\"target\":{\"type\":\"panel_app\",\"payload\":{\"appId\":\"timer\"}},\"title\":\"Timer\"}\n```",
|
|
9078
|
+
"Supported targets are `panel_app`, `json`, `file`, and `url`. Prefer `panel_app` for inline Panel App display; use `file` and `url` only as non-clickable placeholders when a clickable link is not intended; use `json` for inert JSON snapshots.",
|
|
9079
|
+
"It is display-only: no opening, executing, or tool action. Never call `show_panel_app` for inline display; `show_panel_app` is only for immediately opening a Panel App outside the final reply in the side panel. Use Markdown links for clickable resources and show_file/show_url/show_panel_app tools only when you want the UI to immediately show or run content outside the final reply.",
|
|
9080
|
+
"Forbidden forms: bare file names or paths, inline-code file names, bold-only file names, code-styled link labels, code blocks for file references, file:// URLs, internal API URLs, action semantics inside `nextclaw-inline`, tool calls for inline display, and unlinked comma-separated file lists.",
|
|
9081
|
+
"Examples: bad `MEMORY.md` -> good [MEMORY.md](MEMORY.md); bad `memory/` -> good [memory/](memory/); bad `report.docx` -> good [report.docx](report.docx); bad `/Users/example/chart.png` -> good ; bad `2026-03-07.md` / `feishu-notes.md` -> good [2026-03-07.md](memory/2026-03-07.md) / [feishu-notes.md](memory/feishu-notes.md).",
|
|
9082
|
+
"Self-check before sending: scan the final visible reply for local file names, paths, and images. Make every concrete file clickable, render intended images with Markdown image syntax, or ensure it is intentionally represented by `nextclaw-inline`; otherwise remove the exact names and summarize instead."
|
|
9083
|
+
].join("\n")];
|
|
9070
9084
|
};
|
|
9071
9085
|
//#endregion
|
|
9072
9086
|
//#region src/contributions/context-provider/providers/skills-context.provider.ts
|
|
@@ -10182,7 +10196,7 @@ function normalizeShowFileArgs(args) {
|
|
|
10182
10196
|
path: readRequiredString(params.path, "path"),
|
|
10183
10197
|
line: readOptionalPositiveInteger(params.line, "line"),
|
|
10184
10198
|
column: readOptionalPositiveInteger(params.column, "column"),
|
|
10185
|
-
viewer: readOptionalEnum(params.viewer, "viewer", FILE_VIEWERS) ?? "
|
|
10199
|
+
viewer: readOptionalEnum(params.viewer, "viewer", FILE_VIEWERS) ?? "auto"
|
|
10186
10200
|
}
|
|
10187
10201
|
},
|
|
10188
10202
|
...readCommonRequestFields(params, FILE_PURPOSES)
|
|
@@ -10251,7 +10265,7 @@ var ShowContentDisplayTool = class {
|
|
|
10251
10265
|
const SHOW_CONTENT_TOOL_SPECS = [
|
|
10252
10266
|
{
|
|
10253
10267
|
name: "show_file",
|
|
10254
|
-
description: "Show a local file in the current chat UI.
|
|
10268
|
+
description: "Show a local file in the current chat UI. The automatic viewer displays images (including SVG), PDF, media, and supported documents, while text remains source. Use viewer=\"rendered\" for HTML/page previews or viewer=\"source\" to force source text.",
|
|
10255
10269
|
parameters: {
|
|
10256
10270
|
type: "object",
|
|
10257
10271
|
properties: {
|