@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.
- package/package.json +1 -1
- package/sandbox.ts +7 -6
package/package.json
CHANGED
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
|
-
*
|
|
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
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
|
|
82
|
-
*
|
|
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];
|