diff --git a/packages/output-strategy/README.md b/packages/output-strategy/README.md index 8573074..e553c16 100644 --- a/packages/output-strategy/README.md +++ b/packages/output-strategy/README.md @@ -1,6 +1,10 @@ # output-strategy -Composable output-style instructions injected before a model call. Seven styles are available in a small selection panel; **every style is off by default**. +An (unofficial) output-style plugin for magpie, developed and maintained by manjughosa. + +Seven composable output styles with a selection panel; **every style is off by default**. + +本插件由 manjughosa 独立开发并维护,非官方出品。七种输出样式可以自由组合,全部默认关闭。 The style texts and the original request-injection design are adapted from OmniRoute's Output Styles, caveman, ponytail, i-have-adhd and 9router. Exact sources, revisions, licenses and adaptations are recorded in `PROVENANCE.json`; upstream license files are in `LICENSES/`. @@ -38,7 +42,7 @@ No options, an empty options object, or all styles off leaves a request unchange - **Anthropic and Chat Completions:** append one static style block to the existing system prompt, or create the protocol-appropriate system field when none exists. - **Responses:** leave `instructions` completely untouched, including Codex's identity and base instructions. Add the style block as a separate `developer` input item. -- **An existing `[Output Strategy]` marker:** the body is already considered injected and is left unchanged; old blocks are never stripped or replaced. If an agent replays that marker in its history, the saved style remains part of that conversation; turning a style off does not rewrite history. Start a new conversation to begin without the old style block. +- **An existing `[Output Strategy]` marker in system/developer instructions:** the body is already considered injected and is left unchanged; old blocks are never stripped or replaced. Quoting the marker in user or assistant messages does not trigger this skip. If an agent replays that marker in system/developer instructions, the saved style remains part of that conversation; turning a style off does not rewrite history. Start a new conversation to begin without the old style block. - **Cache stability:** a selected style injects consistently across turns. The former `autoClarity` and media-history bypasses are removed because they made the cached system prefix appear and disappear. - **Unknown or unsupported shapes:** pass through unchanged. Middleware errors fail open. @@ -55,4 +59,4 @@ node scripts/gen-page-catalog.mjs ## 中文摘要 -7 种输出样式可以自由组合,全部默认关闭。启用后在请求发送前注入固定规则;Responses 不修改 Codex 的 `instructions`,而是另加 developer 输入项。已有 `[Output Strategy]` 标记的请求原样通过。为避免提示缓存失效,已移除 autoClarity 和媒体历史绕过;不再提供统计 hook,不保存请求或响应正文,也不写插件安装目录。页面跟随 Magpie 的语言设置。 +7 种输出样式可以自由组合,全部默认关闭。启用后在请求发送前注入固定规则;Responses 不修改 Codex 的 `instructions`,而是另加 developer 输入项。系统/开发者指令中已有 `[Output Strategy]` 标记的请求原样通过;用户或助手消息中引用标记不会触发跳过。切换或关闭样式不会改写已有会话历史,要完整应用新配置请新建会话。为避免提示缓存失效,已移除 autoClarity 和媒体历史绕过;不再提供统计 hook,不保存请求或响应正文,也不写插件安装目录。页面跟随 Magpie 的语言设置。 diff --git a/packages/output-strategy/package.json b/packages/output-strategy/package.json index cda3b5d..30e9cd2 100644 --- a/packages/output-strategy/package.json +++ b/packages/output-strategy/package.json @@ -1,6 +1,6 @@ { "name": "@magpie-community/middleware-output-strategy", - "version": "0.2.1", + "version": "0.2.2", "description": "Composable output-style instructions injected before the model call, with a small selection panel", "type": "module", "license": "MIT", diff --git a/packages/output-strategy/page/app.js b/packages/output-strategy/page/app.js index 7a6248d..c9e662b 100644 --- a/packages/output-strategy/page/app.js +++ b/packages/output-strategy/page/app.js @@ -95,8 +95,11 @@ input.checked = checked[style.id] === true input.setAttribute("data-style-id", style.id) input.addEventListener("change", function () { - dirty = true - setMessage("Unsaved changes.") + var savedStyles = options.styles && typeof options.styles === "object" ? options.styles : {} + dirty = catalog.some(function (style) { + return inputs[style.id].checked !== (savedStyles[style.id] === true) + }) + setMessage(dirty ? "Unsaved changes." : "No unsaved changes.") updateSelection() updateControls() }) diff --git a/packages/output-strategy/page/i18n.js b/packages/output-strategy/page/i18n.js index 5c0dbad..1cdf1d5 100644 --- a/packages/output-strategy/page/i18n.js +++ b/packages/output-strategy/page/i18n.js @@ -6,6 +6,8 @@ var ZH = { "Output Strategy": "输出策略", "Inject selected writing rules into model requests. Combine freely; all off by default.": "把选中的写作规则注入模型请求。可自由组合,全部默认关闭。", + "An (unofficial) output-style plugin for magpie, developed and maintained by manjughosa.": "本插件由 manjughosa 独立开发并维护,非官方出品。", + "Saving does not rewrite conversation history. Existing conversations may retain previously injected rules; start a new conversation to fully switch or turn off styles.": "保存不会改写会话历史。已有会话可能保留先前注入的规则;要完整切换或关闭样式,请新建会话。", "selected": "已选择", "Style combinations": "样式组合", "Reading catalog…": "正在读取目录…", @@ -15,6 +17,7 @@ "Reading settings…": "正在读取设置…", "Pick styles and save.": "选择样式后保存。", "Unsaved changes.": "有未保存的更改。", + "No unsaved changes.": "没有未保存的更改。", "Saved.": "已保存。", "Could not save. Nothing was written; try again.": "保存失败。更改尚未写入,请重试。", "Could not read settings; reopen the page.": "设置读取失败,请重新打开页面。", diff --git a/packages/output-strategy/page/index.html b/packages/output-strategy/page/index.html index 3268b7f..b205138 100644 --- a/packages/output-strategy/page/index.html +++ b/packages/output-strategy/page/index.html @@ -12,6 +12,7 @@
Inject selected writing rules into model requests. Combine freely; all off by default.
+An (unofficial) output-style plugin for magpie, developed and maintained by manjughosa.
0 / 7 @@ -25,6 +26,8 @@
Reading catalog…
+ +