@punica/editor 1.25.1 → 1.26.1

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": "@punica/editor",
3
- "version": "1.25.1",
3
+ "version": "1.26.1",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -56,8 +56,8 @@
56
56
  "dependencies": {
57
57
  "@punica/common": "^1.0.2",
58
58
  "highlight.js": "^11.11.1",
59
- "markdown-it": "^14.2.0",
60
- "yaml": "^2.4.5"
59
+ "yaml": "^2.4.5",
60
+ "markdown-it": "^14.2.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@eslint/config-array": "^0.17.0",
@@ -150,6 +150,18 @@ declare module 'punica' {
150
150
  * from disk.
151
151
  */
152
152
  promptVersion?: string;
153
+ /**
154
+ * The model stopped because it reached its output budget.
155
+ *
156
+ * True when `outputTokens >= maxTokens`, which is the only
157
+ * signal available here: `runtime.LlmChatResponse` carries no
158
+ * finish reason. The text is a PARTIAL answer, so this stays on
159
+ * a successful result — a caller that can use a partial one
160
+ * still gets it, and a caller that cannot now has the field to
161
+ * check. An answer that was truncated to NOTHING is a
162
+ * `CapabilityError` with `LLM_EMPTY_ANSWER` instead.
163
+ */
164
+ truncated?: boolean;
153
165
  };
154
166
  }
155
167
 
@@ -165,6 +177,20 @@ declare module 'punica' {
165
177
  blocked?: boolean;
166
178
  /**
167
179
  * Stable reason code for blocked operations (e.g., 'LLM_PROFILE_NOT_REGISTERED').
180
+ *
181
+ * Two of them describe a call that reached a model and came back
182
+ * unusable, rather than one that never ran:
183
+ * - `LLM_EMPTY_ANSWER` — the model returned no text and no tool
184
+ * calls. A reasoning model that spends its whole output budget
185
+ * thinking answers exactly this way, and the provider reports no
186
+ * error, so nothing below this layer can tell it from success.
187
+ * - `LLM_STRUCTURED_PARSE_FAILED` — text arrived but the instruction
188
+ * class declared `json_object` and it did not parse.
189
+ *
190
+ * Both carry the call's `metadata` diagnostics, because the tokens
191
+ * were spent and the difference between "no model" and "a model
192
+ * that answered nothing after 2000 output tokens" is the whole
193
+ * question a reader has.
168
194
  */
169
195
  reasonCode?: string;
170
196
  metadata: {
@@ -173,6 +199,19 @@ declare module 'punica' {
173
199
  originExtension?: string;
174
200
  productId?: string;
175
201
  cacheHit?: boolean;
202
+ /**
203
+ * Present when the failure happened AFTER a model answered.
204
+ * Absent when the call never reached one (unknown instruction
205
+ * class, inactive origin extension, provider chain exhausted).
206
+ */
207
+ tokensUsed?: number;
208
+ inputTokens?: number;
209
+ outputTokens?: number;
210
+ latencyMs?: number;
211
+ modelId?: string;
212
+ provider?: string;
213
+ promptVersion?: string;
214
+ truncated?: boolean;
176
215
  };
177
216
  }
178
217