@pi-unipi/core 2.4.1 → 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 (2) hide show
  1. package/package.json +1 -1
  2. package/sandbox.ts +7 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/core",
3
- "version": "2.4.1",
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",
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];