@nowcrew/daemon 0.6.94 → 0.6.95-beta.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.
@@ -182,35 +182,10 @@ export function parseOpencodeModels(stdout) {
182
182
  }
183
183
  return models;
184
184
  }
185
- export function parsePiModels(stdout) {
186
- const reasoning = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
187
- const models = [];
188
- const seen = new Set();
189
- for (const rawLine of stdout.split(/\r?\n/)) {
190
- const line = rawLine.trim();
191
- if (line.length === 0 || line.toLowerCase().startsWith("warning"))
192
- continue;
193
- const columns = line.split(/\s+/);
194
- const [provider, model, context, maxOutput, thinking, images] = columns;
195
- if (provider === "provider" && model === "model"
196
- || !provider || !model
197
- || !/^\d+(?:\.\d+)?[KMG]$/i.test(context ?? "")
198
- || !/^\d+(?:\.\d+)?[KMG]$/i.test(maxOutput ?? "")
199
- || !/^(?:yes|no)$/i.test(thinking ?? "")
200
- || !/^(?:yes|no)$/i.test(images ?? ""))
201
- continue;
202
- const id = `${provider}/${model}`;
203
- if (seen.has(id))
204
- continue;
205
- seen.add(id);
206
- models.push({
207
- id,
208
- label: id,
209
- ...(thinking?.toLowerCase() === "yes" ? { reasoning } : {}),
210
- });
211
- }
212
- // `pi --list-models` does not identify the configured default model, and its
213
- // output order is not a default-model contract. Leave default unset so the
214
- // UI does not infer capabilities from an unrelated first row.
215
- return models;
185
+ function parsePiModels(stdout) {
186
+ return stdout
187
+ .split(/\r?\n/)
188
+ .map((line) => line.trim())
189
+ .filter((line) => line.length > 0 && !line.toLowerCase().startsWith("warning"))
190
+ .map((line, index) => ({ id: line, label: line, ...(index === 0 ? { default: true } : {}) }));
216
191
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nowcrew/daemon",
3
- "version": "0.6.94",
3
+ "version": "0.6.95-beta.1",
4
4
  "type": "module",
5
5
  "description": "crew daemon — 运行在用户机器:拉起/管理 agent 进程,注入 crew CLI,归一化 runtime 事件",
6
6
  "license": "Apache-2.0",