@pi-unipi/subagents 0.2.8 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/subagents",
3
- "version": "0.2.8",
3
+ "version": "2.0.0",
4
4
  "description": "Subagents for UniPi — parallel execution, file locking, workflow integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -12,7 +12,7 @@ import { Type } from "@sinclair/typebox";
12
12
  import { existsSync, readdirSync } from "node:fs";
13
13
  import { join } from "node:path";
14
14
  import { homedir } from "node:os";
15
- import { emitEvent, MODULES, UNIPI_EVENTS } from "@pi-unipi/core";
15
+ import { emitEvent, MODULES, UNIPI_EVENTS, type UnipiBadgeGenerateRequestEvent } from "@pi-unipi/core";
16
16
  import { AgentManager } from "./agent-manager.js";
17
17
  import { initConfig } from "./config.js";
18
18
  import { type AgentActivity, type NotificationDetails, BUILTIN_TYPES } from "./types.js";
@@ -21,8 +21,7 @@ import { AgentWidget } from "./widget.js";
21
21
 
22
22
  /** Get info registry from global */
23
23
  function getInfoRegistry() {
24
- const g = globalThis as any;
25
- return g.__unipi_info_registry;
24
+ return globalThis.__unipi_info_registry;
26
25
  }
27
26
 
28
27
  // ---- Formatting helpers (shared between renderers and inline text) ----
@@ -338,7 +337,7 @@ export default function (pi: ExtensionAPI) {
338
337
  }
339
338
 
340
339
  // Store session context for badge generation
341
- let sessionCtx: any = null;
340
+ let sessionCtx: import("@mariozechner/pi-coding-agent").ExtensionContext | null = null;
342
341
 
343
342
  // Session start: emit MODULE_READY + capture context
344
343
  pi.on("session_start", async (_event, ctx) => {
@@ -352,7 +351,8 @@ export default function (pi: ExtensionAPI) {
352
351
  });
353
352
 
354
353
  // Listen for badge generation requests — spawn background agent
355
- pi.events.on(UNIPI_EVENTS.BADGE_GENERATE_REQUEST, async (event: any) => {
354
+ pi.events.on(UNIPI_EVENTS.BADGE_GENERATE_REQUEST, async (data) => {
355
+ const event = data as UnipiBadgeGenerateRequestEvent;
356
356
  if (!sessionCtx) return;
357
357
 
358
358
  const summary = event?.conversationSummary ?? "";
package/src/widget.ts CHANGED
@@ -11,6 +11,7 @@
11
11
  */
12
12
 
13
13
  import { truncateToWidth } from "@mariozechner/pi-tui";
14
+ import type { ExtensionUIContext } from "@mariozechner/pi-coding-agent";
14
15
  import type { AgentManager } from "./agent-manager.js";
15
16
  import type { AgentActivity } from "./types.js";
16
17
 
@@ -94,8 +95,8 @@ function describeActivity(activeTools: Map<string, string>, responseText?: strin
94
95
  export class AgentWidget {
95
96
  private spinnerFrame = 0;
96
97
  private timer?: ReturnType<typeof setInterval>;
97
- private uiCtx?: any;
98
- private tui?: any;
98
+ private uiCtx?: ExtensionUIContext;
99
+ private tui?: import("@mariozechner/pi-tui").TUI;
99
100
  private widgetRegistered = false;
100
101
  /** Last content key — skips requestRender when only spinner changed. */
101
102
  private lastContentKey = "";
@@ -112,7 +113,7 @@ export class AgentWidget {
112
113
  private activity: Map<string, AgentActivity>,
113
114
  ) {}
114
115
 
115
- setUICtx(ctx: any) {
116
+ setUICtx(ctx: ExtensionUIContext) {
116
117
  if (ctx !== this.uiCtx) {
117
118
  this.uiCtx = ctx;
118
119
  this.widgetRegistered = false;