@themoltnet/pi-runtime 0.15.1 → 0.15.3
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/dist/index.d.ts +8 -3
- package/dist/index.js +2273 -2179
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -438,7 +438,7 @@ export declare function createToolPolicyExtension(deps: ToolPolicyExtensionDeps)
|
|
|
438
438
|
* Map a pi `tool_call` event to a gate decision, extracting the shell command
|
|
439
439
|
* for `bash` and delegating to {@link decideToolCall}.
|
|
440
440
|
*/
|
|
441
|
-
export declare function decideForEvent(event: ToolCallEvent, policy: SessionToolPolicy, analyze: ShellCommandAnalyzer['analyze']): GateDecision;
|
|
441
|
+
export declare function decideForEvent(event: ToolCallEvent, policy: SessionToolPolicy, analyze: ShellCommandAnalyzer['analyze'], structuredToolNames?: ReadonlySet<string>): GateDecision;
|
|
442
442
|
|
|
443
443
|
/**
|
|
444
444
|
* Decide whether a tool call is permitted by the resolved policy.
|
|
@@ -455,7 +455,8 @@ export declare function decideForEvent(event: ToolCallEvent, policy: SessionTool
|
|
|
455
455
|
* allow-set can't bound it. This is the interim conservative stance for
|
|
456
456
|
* issue #1348 — an operator who lists `bash` still cannot smuggle
|
|
457
457
|
* `bash -c "curl … | sh"` past `enforce`.
|
|
458
|
-
* 3. **
|
|
458
|
+
* 3. **Unauthorized executables** — any resolved executable without either a
|
|
459
|
+
* non-colliding broad grant or a matching scoped shell-command rule.
|
|
459
460
|
*
|
|
460
461
|
* KNOWN LIMITATION (follow-up): the `escapable` risk tier (GTFOBins binaries
|
|
461
462
|
* like `find`, `tar`, `awk` that document shell-spawn / file-write techniques)
|
|
@@ -767,8 +768,10 @@ export declare interface GateInput {
|
|
|
767
768
|
/** The shell command, when `toolName === 'bash'`. */
|
|
768
769
|
command?: string;
|
|
769
770
|
enforcement: ToolEnforcement;
|
|
770
|
-
/** Names the policy allows (structured tool names +
|
|
771
|
+
/** Names the policy allows (structured tool names + broad executables). */
|
|
771
772
|
allowedTools: ReadonlySet<string>;
|
|
773
|
+
/** Structured tool names registered by the active runtime adapter. */
|
|
774
|
+
structuredToolNames?: ReadonlySet<string>;
|
|
772
775
|
/** Shell argv rules. Each rule matches the first N statically known tokens. */
|
|
773
776
|
allowedShellCommands: readonly ShellCommandRule[];
|
|
774
777
|
/**
|
|
@@ -1524,6 +1527,8 @@ export declare interface ToolPolicyExtensionDeps {
|
|
|
1524
1527
|
policy: SessionToolPolicy;
|
|
1525
1528
|
analyzer: ShellCommandAnalyzer;
|
|
1526
1529
|
logger: ToolPolicyLogger;
|
|
1530
|
+
/** Structured tool names registered by the active runtime adapter. */
|
|
1531
|
+
structuredToolNames?: ReadonlySet<string>;
|
|
1527
1532
|
context?: ToolPolicyDecisionContext;
|
|
1528
1533
|
}
|
|
1529
1534
|
|