修改前端架构到Electron ,增加llm_api页面,增加chat SSE渲染,修改若安按钮,卡片名称修改等小功能,增加agent-core,增加SQlite,增加llm UDS Pipe websocke
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
const vm = require('vm')
|
||||
const v8 = require('v8')
|
||||
const wrap = require('module').wrap
|
||||
|
||||
v8.setFlagsFromString('--no-lazy')
|
||||
v8.setFlagsFromString('--no-flush-bytecode')
|
||||
|
||||
let code = ''
|
||||
|
||||
process.stdin.setEncoding('utf-8')
|
||||
|
||||
process.stdin.on('readable', () => {
|
||||
const data = process.stdin.read()
|
||||
if (data !== null) {
|
||||
code += data
|
||||
}
|
||||
})
|
||||
|
||||
process.stdin.on('end', () => {
|
||||
try {
|
||||
if (typeof code !== 'string') {
|
||||
throw new Error(`javascript code must be string. ${typeof code} was given.`)
|
||||
}
|
||||
|
||||
const script = new vm.Script(wrap(code), { produceCachedData: true })
|
||||
const bytecodeBuffer = script.createCachedData()
|
||||
|
||||
process.stdout.write(bytecodeBuffer)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const debugIndex = process.argv.findIndex(arg => /^(?:-d|--debug)$/.test(arg))
|
||||
const filterIndex = process.argv.findIndex(arg => /^(?:-f|--filter)$/.test(arg))
|
||||
|
||||
if (debugIndex > 0) {
|
||||
let value = process.argv[debugIndex + 1]
|
||||
if (!value || value.startsWith('-')) {
|
||||
value = 'vite:*'
|
||||
} else {
|
||||
value = value
|
||||
.split(',')
|
||||
.map(v => `vite:${v}`)
|
||||
.join(',')
|
||||
}
|
||||
process.env.DEBUG = `${process.env.DEBUG ? process.env.DEBUG + ',' : ''}${value}`
|
||||
|
||||
if (filterIndex > 0) {
|
||||
const filter = process.argv[filterIndex + 1]
|
||||
if (filter && !filter.startsWith('-')) {
|
||||
process.env.VITE_DEBUG_FILTER = filter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function run() {
|
||||
import('../dist/cli.mjs')
|
||||
}
|
||||
|
||||
run()
|
||||
Reference in New Issue
Block a user