opencode-translate 0.0.3 → 0.0.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 +1 -1
- package/src/activation.ts +7 -1
package/package.json
CHANGED
package/src/activation.ts
CHANGED
|
@@ -124,6 +124,12 @@ function mergeTranslatedMetadata(state: TranslateState, part: TextPartLike, engl
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
// OpenCode's flag semantics, observed from packages/opencode and packages/ui:
|
|
128
|
+
// synthetic: true -> hidden from the user UI, still sent to the LLM
|
|
129
|
+
// ignored: true -> hidden from the LLM, still shown in the user UI
|
|
130
|
+
// The translation preview, activation banner, and failure notices are
|
|
131
|
+
// user-facing status/diagnostic parts that must not leak into the LLM
|
|
132
|
+
// prompt, so they use synthetic:false + ignored:true.
|
|
127
133
|
function createSyntheticTextPart(
|
|
128
134
|
sessionID: string,
|
|
129
135
|
messageID: string,
|
|
@@ -136,7 +142,7 @@ function createSyntheticTextPart(
|
|
|
136
142
|
messageID,
|
|
137
143
|
type: "text",
|
|
138
144
|
text,
|
|
139
|
-
synthetic:
|
|
145
|
+
synthetic: false,
|
|
140
146
|
ignored: true,
|
|
141
147
|
metadata,
|
|
142
148
|
}
|