@pi-unipi/core 2.4.0 → 2.5.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 (3) hide show
  1. package/events.ts +13 -13
  2. package/package.json +3 -2
  3. package/sandbox.ts +7 -6
package/events.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  export const UNIPI_EVENTS = {
10
10
  /** Module loaded and ready */
11
11
  MODULE_READY: "unipi:module:ready",
12
- /** Module unloading */
12
+ /** @deprecated No built-in emitter; retained for external compatibility. */
13
13
  MODULE_GONE: "unipi:module:gone",
14
14
 
15
15
  /** Workflow command started */
@@ -24,9 +24,9 @@ export const UNIPI_EVENTS = {
24
24
  /** Ralph loop iteration completed */
25
25
  RALPH_ITERATION_DONE: "unipi:ralph:iteration:done",
26
26
 
27
- /** Request module status (for info-screen) */
27
+ /** @deprecated No built-in responders; use the info registry and /unipi:info. */
28
28
  MODULE_STATUS_REQUEST: "unipi:module:status:request",
29
- /** Module status response */
29
+ /** @deprecated No built-in aggregator; use the info registry and /unipi:info. */
30
30
  MODULE_STATUS_RESPONSE: "unipi:module:status:response",
31
31
 
32
32
  /** Info screen group registered */
@@ -38,7 +38,7 @@ export const UNIPI_EVENTS = {
38
38
  MEMORY_STORED: "unipi:memory:stored",
39
39
  /** Memory deleted */
40
40
  MEMORY_DELETED: "unipi:memory:deleted",
41
- /** Memory search performed */
41
+ /** @deprecated No built-in emitter; retained for external compatibility. */
42
42
  MEMORY_SEARCHED: "unipi:memory:searched",
43
43
  /** Memory consolidation completed */
44
44
  MEMORY_CONSOLIDATED: "unipi:memory:consolidated",
@@ -58,9 +58,9 @@ export const UNIPI_EVENTS = {
58
58
 
59
59
  /** Compactor: compaction completed */
60
60
  COMPACTOR_COMPACTED: "unipi:compactor:compacted",
61
- /** Compactor: stats updated */
61
+ /** @deprecated Footer reads live Pi session data; retained for compatibility. */
62
62
  COMPACTOR_STATS_UPDATED: "unipi:compactor:stats:updated",
63
- /** Utility module cleanup started */
63
+ /** @deprecated No built-in emitter; retained for external compatibility. */
64
64
  UTILITY_CLEANUP_START: "unipi:utility:cleanup:start",
65
65
  /** Utility module cleanup completed */
66
66
  UTILITY_CLEANUP_DONE: "unipi:utility:cleanup:done",
@@ -68,9 +68,9 @@ export const UNIPI_EVENTS = {
68
68
  UTILITY_DIAGNOSTICS_START: "unipi:utility:diagnostics:start",
69
69
  /** Utility diagnostics completed */
70
70
  UTILITY_DIAGNOSTICS_DONE: "unipi:utility:diagnostics:done",
71
- /** Utility cache invalidated */
71
+ /** @deprecated No built-in emitter; retained for external compatibility. */
72
72
  UTILITY_CACHE_INVALIDATED: "unipi:utility:cache:invalidated",
73
- /** Utility lifecycle state changed */
73
+ /** @deprecated No built-in emitter; retained for external compatibility. */
74
74
  UTILITY_LIFECYCLE_STATE: "unipi:utility:lifecycle:state",
75
75
 
76
76
  /** Notification sent */
@@ -91,11 +91,11 @@ export const UNIPI_EVENTS = {
91
91
  /** Update error */
92
92
  UPDATE_ERROR: "unipi:update:error",
93
93
 
94
- /** CocoIndex: update started */
94
+ /** @deprecated Reserved external contract; no built-in emitter. */
95
95
  COCOINDEX_UPDATE_STARTED: "unipi:cocoindex:update:started",
96
- /** CocoIndex: update completed */
96
+ /** @deprecated Reserved external contract; no built-in emitter. */
97
97
  COCOINDEX_UPDATE_COMPLETED: "unipi:cocoindex:update:completed",
98
- /** CocoIndex: search performed */
98
+ /** @deprecated Reserved external contract; no built-in emitter. */
99
99
  COCOINDEX_SEARCH_PERFORMED: "unipi:cocoindex:search:performed",
100
100
  } as const;
101
101
 
@@ -151,13 +151,13 @@ export interface UnipiRalphIterationEvent {
151
151
  nextIteration: number;
152
152
  }
153
153
 
154
- /** Payload for MODULE_STATUS_REQUEST */
154
+ /** @deprecated No built-in responders; retained for compatibility. */
155
155
  export interface UnipiStatusRequestEvent {
156
156
  /** Request ID for correlation */
157
157
  requestId: string;
158
158
  }
159
159
 
160
- /** Payload for MODULE_STATUS_RESPONSE */
160
+ /** @deprecated No built-in aggregator; retained for compatibility. */
161
161
  export interface UnipiStatusResponseEvent {
162
162
  /** Request ID this responds to */
163
163
  requestId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/core",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Shared utilities, event types, and constants for Unipi extension suite",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -17,7 +17,8 @@
17
17
  ],
18
18
  "files": [
19
19
  "*.ts",
20
- "README.md"
20
+ "README.md",
21
+ "!*.test.ts"
21
22
  ],
22
23
  "publishConfig": {
23
24
  "access": "public"
package/sandbox.ts CHANGED
@@ -2,7 +2,8 @@
2
2
  * @unipi/core — Sandbox module
3
3
  *
4
4
  * Defines tool access levels for workflow commands.
5
- * Used with pi.setActiveTools() to enforce restrictions.
5
+ * Workflow enforces blocked names at tool_call time so provider tool schemas
6
+ * and ordering remain stable; filtering helpers remain available to other callers.
6
7
  */
7
8
 
8
9
  import { WORKFLOW_COMMANDS } from "./constants.js";
@@ -13,9 +14,9 @@ export type SandboxLevel = "read_only" | "brainstorm" | "write_unipi" | "review"
13
14
  /**
14
15
  * Built-in workflow tools used when no active tool list is supplied.
15
16
  *
16
- * Workflow commands should normally call filterToolsForLevel() with the current
17
- * active tool list. That keeps safe extension tools (memory, ask-user, web,
18
- * notify, etc.) available while removing only tools that violate the sandbox.
17
+ * Legacy fallback list used by callers that need an explicit filtered tool set.
18
+ * The workflow package itself keeps Pi's active tools unchanged and enforces
19
+ * BLOCKED_TOOLS at tool_call time.
19
20
  */
20
21
  const FALLBACK_TOOLS: Record<SandboxLevel, readonly string[]> = {
21
22
  /** Only read-only file tools — no bash, no write, no edit */
@@ -78,8 +79,8 @@ export function getSandboxLevel(commandName: string): SandboxLevel {
78
79
  /**
79
80
  * Get fallback tools for a sandbox level.
80
81
  *
81
- * Prefer filterToolsForLevel(level, activeTools) when applying a sandbox so
82
- * extension tools are preserved unless explicitly blocked.
82
+ * Prefer isToolAllowed() for cache-stable call-time enforcement. Filtering is
83
+ * retained for compatibility with callers that intentionally alter tool sets.
83
84
  */
84
85
  export function getToolsForLevel(level: SandboxLevel): readonly string[] {
85
86
  return FALLBACK_TOOLS[level];