mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 19:04:23 +00:00
update
This commit is contained in:
+2
-3
@@ -4,8 +4,8 @@ import { NodeExecutionEnv } from '@earendil-works/pi-agent-core/node'
|
||||
import { getModel } from '@earendil-works/pi-ai'
|
||||
import { Type, type TSchema } from '@sinclair/typebox'
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
import { DatabaseSessionStorage } from './database-session-storage'
|
||||
import { analyzeAssetMediaTool } from './tools/analyze-asset-media'
|
||||
import { createCreateFileTool } from './tools/create-file'
|
||||
@@ -119,8 +119,7 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
|
||||
deniedDomains: [],
|
||||
},
|
||||
filesystem: {
|
||||
allowRead: [piDir],
|
||||
denyRead: [os.homedir(), '.env', '.env.*', '*.pem', '*.key'],
|
||||
denyRead: ['.env', '.env.*', '*.pem', '*.key'],
|
||||
allowWrite,
|
||||
denyWrite: ['.env', '.env.*', '*.pem', '*.key'],
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { logger } from '@/logger'
|
||||
import { SandboxManager } from '@anthropic-ai/sandbox-runtime'
|
||||
import { type AgentTool, type AgentToolResult } from '@earendil-works/pi-agent-core'
|
||||
import { Type } from '@sinclair/typebox'
|
||||
import { spawn } from 'node:child_process'
|
||||
import { logger } from '@/logger'
|
||||
|
||||
const BashParameters = Type.Object({
|
||||
command: Type.String({ description: 'The bash command to execute.' }),
|
||||
@@ -37,7 +37,8 @@ export const createSandboxedBashTool = (
|
||||
detached: true,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
env: {
|
||||
...process.env,
|
||||
PATH: process.env.PATH || '',
|
||||
HOME: process.env.HOME || '',
|
||||
...skillEnvs,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user