@fanchaozz/provider-manager 1.0.0 → 1.1.0

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.
Files changed (7) hide show
  1. package/README.md +267 -257
  2. package/README_EN.md +249 -249
  3. package/commands.ts +3 -17
  4. package/components.ts +1193 -866
  5. package/forms.ts +19 -1
  6. package/package.json +1 -1
  7. package/ui.ts +1245 -761
package/forms.ts CHANGED
@@ -190,7 +190,10 @@ async function askConfirm(ctx: ExtensionCommandContext, title: string, message:
190
190
  return ctx.ui.confirm(title, message);
191
191
  }
192
192
 
193
- /** 包 FormEditor 进 ctx.ui.custom dialog。返回 { saved, values } 或 { saved: false, values: initial }。 */
193
+ /** 包 FormEditor 进 ctx.ui.custom dialog(浮窗式,不占对话窗口)。
194
+ * 返回 { saved, values } 或 { saved: false, values: initial }。
195
+ * 用 { overlay: true } 打开后,即使 dashboard 还在焦点,form editor 也能接管输入并叠在上面。
196
+ * overlay 框架会自动给合理宽度,编辑器表格长时按 viewport 自适应。 */
194
197
  async function runFormEditor<T extends Record<string, unknown>>(
195
198
  ctx: ExtensionCommandContext,
196
199
  title: string,
@@ -206,6 +209,13 @@ async function runFormEditor<T extends Record<string, unknown>>(
206
209
  onSave: (values: T) => done({ saved: true, values }),
207
210
  onCancel: () => done(undefined),
208
211
  });
212
+ }, {
213
+ overlay: true,
214
+ overlayOptions: {
215
+ anchor: "center",
216
+ width: 84,
217
+ minWidth: 50,
218
+ },
209
219
  }).catch((err) => {
210
220
  // 框架抛错(不是用户取消 Esc)要让用户知道
211
221
  console.error(`[provider-manager] form editor error:`, err);
@@ -655,6 +665,14 @@ export async function syncFlow(ctx: ExtensionCommandContext, opts: SyncOpts = {}
655
665
  onCancel: () => done(undefined),
656
666
  });
657
667
  return checklist;
668
+ }, {
669
+ // 浮窗式:不占对话窗口,dashboard 关掉后这个 checklist 接管焦点
670
+ overlay: true,
671
+ overlayOptions: {
672
+ anchor: "center",
673
+ width: 88,
674
+ minWidth: 60,
675
+ },
658
676
  }).catch((err) => {
659
677
  // 框架抛错(不是用户取消)要让用户知道
660
678
  console.error(`[provider-manager] sync checklist error:`, err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanchaozz/provider-manager",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A pi extension that manages custom providers and models in ~/.pi/agent/models.json via a TUI dashboard, /providers slash command, and remote model sync.",
5
5
  "type": "module",
6
6
  "main": "index.ts",