@kyun.si/agy-polish 0.0.4-beta.3 → 0.0.4-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyun.si/agy-polish",
3
- "version": "0.0.4-beta.3",
3
+ "version": "0.0.4-beta.4",
4
4
  "description": "Polish Antigravity replies with Codex · 用 Codex 润色 Antigravity 回复",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agy-polish",
3
3
  "displayName": "AGY Polish · 回复润色",
4
- "version": "0.0.4-beta.3",
4
+ "version": "0.0.4-beta.4",
5
5
  "description": "Polish Antigravity replies with your local Codex CLI. 用本机 Codex CLI 润色 Antigravity 的回复。",
6
6
  "author": { "name": "mreasonyang" },
7
7
  "repository": "https://github.com/mreasonyang/agent-polish",
@@ -3,7 +3,7 @@
3
3
  Answer the user normally, including doing any requested work. Use the latest Codex Polish mode message for this user turn. In Normal or Turbo, finish the complete Gemini draft before publishing, then call the `polish_reply` MCP tool from the agy-polish plugin once with the current user question, the complete draft, and `trigger: "auto"`. In Manual (Only when asked), send ordinary answers directly and use the tool only for explicit polishing requests. If the current-turn mode message is missing, answer directly. Never call the MCP tool or run a command to determine the mode for an ordinary answer.
4
4
 
5
5
  - In Off, never invoke Codex or the `polish_reply` MCP tool for reply polishing. If the request only asks to polish supplied text or an identifiable previous reply, return the original text or complete reply verbatim, preserving leading and trailing whitespace, line breaks, Markdown, and code. Do not rewrite it yourself or add anything to it, even if the user specifies edits. If `/polish` accompanies a new question or task, answer it normally and send the answer directly.
6
- - Use `trigger: "explicit"` only when the user asks to polish or invokes `/polish`. Follow the polish skill for a prior reply or a selected passage. Ordinary requests to edit a file or write content are not explicit requests to polish the chat reply.
6
+ - Use `trigger: "explicit"` when the user asks to polish or invokes `/polish`. A standalone “说人话” asks to rewrite the previous assistant reply in plain language. Pass that reply verbatim as `draft` and the user's wording as `rewrite_request`. Follow the polish skill for a prior reply or a selected passage. Ordinary requests to edit a file or write content are not explicit requests to polish the chat reply.
7
7
  - For “配置回复润色”, “configure reply polishing”, or requests to view or change **reply polishing** mode, Codex model, or thinking level, use the `polish-settings` skill. Send the settings answer directly. Unrelated Antigravity settings remain ordinary host settings.
8
8
  - Skip polishing when the user asks to cancel, skip polishing, keep the turn private, use Gemini only, or avoid sharing the material with another model or service. Also skip it for exact-format or verbatim responses, such as a JSON-only answer, literal transcription, or a raw command. A request for prose with no preamble or extra commentary still permits polishing. Follow these instructions even in Turbo and on an explicit turn. When uncertain about permission to share, keep the Gemini response.
9
9
  - Send only the current question, the final draft, and explicitly requested editing instructions. Keep the draft private within this workflow until the tool returns. Use the tool's full text as the final reply verbatim, preserving the language, Markdown, code, and whitespace. On tool errors, unavailability, cancellation, or if the tool returns no usable body, keep the Gemini draft and never retry in the same turn. If the turn itself is cancelled, stop.
@@ -21,9 +21,18 @@ function modeContext() {
21
21
  } catch {
22
22
  // Treat unavailable settings as off for this turn.
23
23
  }
24
+ let guidance = instructions[mode];
25
+ if (typeof input.lastUserInput === 'string' && /^说人话[。!.!]*$/u.test(input.lastUserInput.trim())) {
26
+ guidance = mode === 'off'
27
+ ? 'For this request, return the previous assistant reply verbatim. Do not call polish_reply or invoke Codex.'
28
+ : 'The user explicitly asks for the previous reply in plain language. Call polish_reply once with trigger "explicit". ' +
29
+ 'Use the complete previous assistant reply verbatim as draft, its original question if available, and the exact user request as rewrite_request. ' +
30
+ 'Send the original reply to the editor before rewriting any of it yourself. Return the tool result verbatim.';
31
+ guidance += ' If there is no previous reply, ask which text to rewrite.';
32
+ }
24
33
  return {
25
34
  injectSteps: [{ systemMessage: { systemMessage:
26
- 'The Codex Polish mode for the current user turn is ' + mode + '. ' + instructions[mode]
35
+ 'The Codex Polish mode for the current user turn is ' + mode + '. ' + guidance
27
36
  } }]
28
37
  };
29
38
  }
@@ -108,7 +108,9 @@ function protectedLiterals(text) {
108
108
  function promptFor(input, mode, selected) {
109
109
  let approach = 'Revise proactively for clarity, precision, and natural language.';
110
110
  if (input.trigger === 'explicit') {
111
- approach = 'Make a direct editing pass. Follow the supplied rewrite_request where it applies to the prose.';
111
+ approach = 'Make a direct editing pass. Follow the supplied rewrite_request where it applies to the prose. ' +
112
+ 'When asked for plain language (说人话), describe what actually happens in words the reader would use in conversation. ' +
113
+ 'Replace process jargon with its concrete meaning and keep all limits and exceptions.';
112
114
  } else if (mode === 'normal') {
113
115
  approach = 'Make changes only if they clearly improve the draft. If it already reads well, return it exactly as supplied.';
114
116
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: polish
3
- description: Explicitly polish an Antigravity reply with Codex. Use /polish or when explicitly asked to polish this or a previous reply, with optional editing instructions or a selected passage. 润色这条或上一条回复,可指定改法或只选一段。
3
+ description: Explicitly polish an Antigravity reply with Codex. Use /polish or when explicitly asked to polish this or a previous reply, with optional editing instructions or a selected passage. 润色这条或上一条回复,可指定改法或只选一段。单独发送「说人话」时,把上一条回复改成大白话。
4
4
  ---
5
5
 
6
6
  Use the current-turn Codex Polish mode from the plugin hook. Respect the plugin rule about sharing, cancellation, and exact-format responses.
@@ -11,6 +11,6 @@ In any other mode, use the agy-polish `polish_reply` MCP tool with `trigger: "ex
11
11
 
12
12
  With a new question, answer it fully and use your complete unsent final reply as `draft`. If the user asks to polish a previous reply or just enters `/polish`, use the referenced reply in full as `draft` and supply its original question when available. If the user gives only text to polish, use that exact text as the draft. Do not guess a missing reply or question. Use an empty `question` if the draft is available but its original question is missing. Ask which reply or passage only when you cannot resolve the reference.
13
13
 
14
- Put additional edit directions in `rewrite_request`. For a selected passage, supply its exact text as `selection` and keep the whole reply in `draft`; the tool returns the entire reply with only that passage replaced. If the selection occurs more than once, use enough surrounding text to identify the intended passage without editing neighboring text, or ask the user to identify it. Do not automatically enrich any of these fields with chat history.
14
+ Put additional edit directions in `rewrite_request`. For a standalone “说人话”, pass the previous assistant reply unchanged as `draft` and the user's exact request as `rewrite_request`. For a selected passage, supply its exact text as `selection` and keep the whole reply in `draft`; the tool returns the entire reply with only that passage replaced. If the selection occurs more than once, use enough surrounding text to identify the intended passage without editing neighboring text, or ask the user to identify it. Do not automatically enrich any of these fields with chat history.
15
15
 
16
16
  Return the full text from the tool as the final reply verbatim. If the tool is unavailable or fails, use the exact draft. Do not run automatic polishing on this turn as well.