@pi-unipi/core 0.1.4 → 0.1.6

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/constants.ts CHANGED
@@ -25,9 +25,11 @@ export const MODULES = {
25
25
  REGISTRY: "@pi-unipi/registry",
26
26
  MCP: "@pi-unipi/mcp",
27
27
  TASK: "@pi-unipi/task",
28
- WEBTOOLS: "@pi-unipi/webtools",
28
+ WEB_API: "@pi-unipi/web-api",
29
29
  IMPECCABLE: "@pi-unipi/impeccable",
30
30
  SETTINGS: "@pi-unipi/settings",
31
+ UTILITY: "@pi-unipi/utility",
32
+ ASK_USER: "@pi-unipi/ask-user",
31
33
  } as const;
32
34
 
33
35
  /** Workflow command names */
@@ -45,6 +47,7 @@ export const WORKFLOW_COMMANDS = {
45
47
  GATHER_CONTEXT: "gather-context",
46
48
  DOCUMENT: "document",
47
49
  SCAN_ISSUES: "scan-issues",
50
+ AUTO: "auto",
48
51
  } as const;
49
52
 
50
53
  /** Ralph command names */
@@ -132,3 +135,41 @@ export const RALPH_STATUS_ICONS = {
132
135
  paused: "⏸",
133
136
  completed: "✓",
134
137
  } as const;
138
+
139
+ /** Utility command names */
140
+ export const UTILITY_COMMANDS = {
141
+ CONTINUE: "continue",
142
+ } as const;
143
+
144
+ /** Utility tool names */
145
+ export const UTILITY_TOOLS = {
146
+ CONTINUE: "continue_task",
147
+ } as const;
148
+
149
+ /** Ask-user tool names */
150
+ export const ASK_USER_TOOLS = {
151
+ ASK: "ask_user",
152
+ } as const;
153
+
154
+ /** MCP directory paths */
155
+ export const MCP_DIRS = {
156
+ GLOBAL_CONFIG: "~/.unipi/config/mcp",
157
+ PROJECT_CONFIG: ".unipi/config/mcp",
158
+ CATALOG_CACHE: "~/.unipi/config/mcp/servers.json",
159
+ } as const;
160
+
161
+ /** MCP command names */
162
+ export const MCP_COMMANDS = {
163
+ ADD: "mcp-add",
164
+ SETTINGS: "mcp-settings",
165
+ SYNC: "mcp-sync",
166
+ STATUS: "mcp-status",
167
+ } as const;
168
+
169
+ /** MCP defaults */
170
+ export const MCP_DEFAULTS = {
171
+ SYNC_INTERVAL_MS: 86400000,
172
+ STARTUP_TIMEOUT_MS: 10000,
173
+ MAX_SERVERS: 20,
174
+ TOOL_NAME_SEPARATOR: "__",
175
+ } as const;
package/events.ts CHANGED
@@ -42,6 +42,19 @@ export const UNIPI_EVENTS = {
42
42
  MEMORY_SEARCHED: "unipi:memory:searched",
43
43
  /** Memory consolidation completed */
44
44
  MEMORY_CONSOLIDATED: "unipi:memory:consolidated",
45
+
46
+ /** MCP server started */
47
+ MCP_SERVER_STARTED: "unipi:mcp:server:started",
48
+ /** MCP server stopped */
49
+ MCP_SERVER_STOPPED: "unipi:mcp:server:stopped",
50
+ /** MCP server error */
51
+ MCP_SERVER_ERROR: "unipi:mcp:server:error",
52
+ /** MCP tools registered */
53
+ MCP_TOOLS_REGISTERED: "unipi:mcp:tools:registered",
54
+ /** MCP tools unregistered */
55
+ MCP_TOOLS_UNREGISTERED: "unipi:mcp:tools:unregistered",
56
+ /** MCP catalog synced */
57
+ MCP_CATALOG_SYNCED: "unipi:mcp:catalog:synced",
45
58
  } as const;
46
59
 
47
60
  /** Payload for MODULE_READY / MODULE_GONE */
@@ -170,6 +183,34 @@ export interface UnipiInfoDataEvent {
170
183
  keys: string[];
171
184
  }
172
185
 
186
+ /** Payload for MCP_SERVER_STARTED / MCP_SERVER_STOPPED */
187
+ export interface UnipiMcpServerEvent {
188
+ /** Server name */
189
+ name: string;
190
+ /** Number of tools (for started) */
191
+ toolCount?: number;
192
+ /** Error message (for error) */
193
+ error?: string;
194
+ /** Process ID */
195
+ pid?: number;
196
+ }
197
+
198
+ /** Payload for MCP_TOOLS_REGISTERED / MCP_TOOLS_UNREGISTERED */
199
+ export interface UnipiMcpToolsEvent {
200
+ /** Server name */
201
+ serverName: string;
202
+ /** Tool names */
203
+ toolNames: string[];
204
+ }
205
+
206
+ /** Payload for MCP_CATALOG_SYNCED */
207
+ export interface UnipiMcpCatalogSyncedEvent {
208
+ /** Total servers in catalog */
209
+ totalServers: number;
210
+ /** Source of sync */
211
+ source: string;
212
+ }
213
+
173
214
  /** Union of all unipi event payloads */
174
215
  export type UnipiEventPayload =
175
216
  | UnipiModuleEvent
@@ -183,4 +224,7 @@ export type UnipiEventPayload =
183
224
  | UnipiMemorySearchedEvent
184
225
  | UnipiMemoryConsolidatedEvent
185
226
  | UnipiInfoGroupEvent
186
- | UnipiInfoDataEvent;
227
+ | UnipiInfoDataEvent
228
+ | UnipiMcpServerEvent
229
+ | UnipiMcpToolsEvent
230
+ | UnipiMcpCatalogSyncedEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/core",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Shared utilities, event types, and constants for Unipi extension suite",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/sandbox.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  import { WORKFLOW_COMMANDS } from "./constants.js";
9
9
 
10
10
  /** Sandbox levels */
11
- export type SandboxLevel = "read_only" | "brainstorm" | "write_unipi" | "full";
11
+ export type SandboxLevel = "read_only" | "brainstorm" | "write_unipi" | "review" | "full";
12
12
 
13
13
  /** Tool sets per sandbox level */
14
14
  const SANDBOX_TOOLS: Record<SandboxLevel, readonly string[]> = {
@@ -18,6 +18,8 @@ const SANDBOX_TOOLS: Record<SandboxLevel, readonly string[]> = {
18
18
  brainstorm: ["read", "grep", "find", "ls", "write", "bash"],
19
19
  /** Read + write/edit + file discovery — no bash */
20
20
  write_unipi: ["read", "write", "edit", "grep", "find", "ls"],
21
+ /** Read + write + bash for git operations — no code editing outside .unipi */
22
+ review: ["read", "write", "edit", "grep", "find", "ls", "bash"],
21
23
  /** All tools */
22
24
  full: ["read", "write", "edit", "bash"],
23
25
  };
@@ -27,7 +29,7 @@ const COMMAND_SANDBOX: Record<string, SandboxLevel> = {
27
29
  [WORKFLOW_COMMANDS.BRAINSTORM]: "brainstorm",
28
30
  [WORKFLOW_COMMANDS.PLAN]: "write_unipi",
29
31
  [WORKFLOW_COMMANDS.WORK]: "full",
30
- [WORKFLOW_COMMANDS.REVIEW_WORK]: "write_unipi",
32
+ [WORKFLOW_COMMANDS.REVIEW_WORK]: "review",
31
33
  [WORKFLOW_COMMANDS.CONSOLIDATE]: "write_unipi",
32
34
  [WORKFLOW_COMMANDS.WORKTREE_CREATE]: "full",
33
35
  [WORKFLOW_COMMANDS.WORKTREE_LIST]: "read_only",
@@ -37,6 +39,7 @@ const COMMAND_SANDBOX: Record<string, SandboxLevel> = {
37
39
  [WORKFLOW_COMMANDS.GATHER_CONTEXT]: "read_only",
38
40
  [WORKFLOW_COMMANDS.DOCUMENT]: "write_unipi",
39
41
  [WORKFLOW_COMMANDS.SCAN_ISSUES]: "read_only",
42
+ [WORKFLOW_COMMANDS.AUTO]: "full",
40
43
  };
41
44
 
42
45
  /**