@trim21/personal-pi-extensions 0.0.173 → 0.0.174

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": "@trim21/personal-pi-extensions",
3
- "version": "0.0.173",
3
+ "version": "0.0.174",
4
4
  "type": "module",
5
5
  "description": "Custom pi coding-agent extensions: bwrap sandbox, workspace guard, opencode edit, and more",
6
6
  "keywords": [
@@ -457,7 +457,7 @@ export default function visionAgent(pi: ExtensionAPI) {
457
457
  ),
458
458
  }),
459
459
 
460
- async execute(_toolCallId, params, signal, _onUpdate, ctx) {
460
+ async execute(_toolCallId, params, signal, onUpdate, ctx) {
461
461
  try {
462
462
  const paths = resolveImagePaths({ path: params.path });
463
463
  if (paths.length === 0) {
@@ -502,10 +502,17 @@ export default function visionAgent(pi: ExtensionAPI) {
502
502
  };
503
503
  }
504
504
 
505
+ const prompt = buildPrompt(params.prompt, paths.length);
506
+ // 把发给视觉模型的 prompt 实时透传给主会话,识别要求对主模型可见
507
+ onUpdate?.({
508
+ content: [{ type: "text", text: `视觉识别 prompt: ${prompt}` }],
509
+ details: { prompt },
510
+ });
511
+
505
512
  const description = await callVision(
506
513
  { ...provider, model: visionConfig.model },
507
514
  paths,
508
- buildPrompt(params.prompt, paths.length),
515
+ prompt,
509
516
  signal ?? ctx.signal,
510
517
  );
511
518
  return {
@@ -513,6 +520,8 @@ export default function visionAgent(pi: ExtensionAPI) {
513
520
  details: {
514
521
  provider: providerName,
515
522
  model: visionConfig.model,
523
+ prompt,
524
+ output: description,
516
525
  paths,
517
526
  count: paths.length,
518
527
  },