-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mcp #478
base: main
Are you sure you want to change the base?
Mcp #478
Changes from 3 commits
e02bcd4
c20136c
2258970
aaf7f16
2d26fc5
1401fac
4e54d5f
ef20a58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,8 @@ | |
}, | ||
"dependencies": { | ||
"@ironclad/rivet-core": "workspace:^", | ||
"@ironclad/rivet-node": "workspace:^" | ||
"@ironclad/rivet-node": "workspace:^", | ||
"@modelcontextprotocol/sdk": "^1.5.0" | ||
}, | ||
"dependenciesMeta": { | ||
"@pnpm/[email protected]": { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have a better node body? Maybe it's just the example, but a blank body doesn't seem very helpful? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// Mock implementation for node:child_process | ||
export const spawn = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we don't need this file any more? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it came back |
||
throw new Error('child_process.spawn is not supported in browser environment'); | ||
}; | ||
|
||
const process = { | ||
env: {}, | ||
platform: 'browser', | ||
cwd: () => '/', | ||
versions: { | ||
node: '0.0.0', | ||
}, | ||
}; | ||
|
||
export default process; | ||
|
||
export const fs = { | ||
readFileSync: () => { | ||
throw new Error('fs.readFileSync is not supported in browser environment'); | ||
}, | ||
writeFileSync: () => { | ||
throw new Error('fs.writeFileSync is not supported in browser environment'); | ||
}, | ||
// Add other fs methods as needed | ||
}; | ||
|
||
export const path = { | ||
join: (...paths: string[]) => paths.join('/'), | ||
resolve: (...paths: string[]) => paths.join('/'), | ||
dirname: (path: string) => path.split('/').slice(0, -1).join('/'), | ||
// Add other path methods as needed | ||
}; | ||
|
||
export const os = { | ||
platform: () => 'browser', | ||
homedir: () => '/', | ||
// Add other os methods as needed | ||
}; | ||
|
||
export const stream = { | ||
Readable: class { | ||
pipe() { return this; } | ||
}, | ||
Writable: class {}, | ||
Transform: class {}, | ||
// Add other stream classes as needed | ||
}; | ||
|
||
export const util = { | ||
promisify: (fn: Function) => fn, | ||
// Add other util methods as needed | ||
}; | ||
|
||
export const events = { | ||
EventEmitter: class { | ||
on() {} | ||
emit() {} | ||
// Add other EventEmitter methods as needed | ||
}, | ||
}; | ||
|
||
export const buffer = { | ||
Buffer: { | ||
from: () => new Uint8Array(), | ||
// Add other Buffer methods as needed | ||
}, | ||
}; | ||
|
||
export const crypto = { | ||
randomBytes: () => new Uint8Array(), | ||
createHash: () => ({ | ||
update: () => ({ | ||
digest: () => '', | ||
}), | ||
}), | ||
// Add other crypto methods as needed | ||
}; | ||
|
||
// Export other Node.js module mocks as needed | ||
export const querystring = { | ||
stringify: (obj: any) => new URLSearchParams(obj).toString(), | ||
parse: (str: string) => Object.fromEntries(new URLSearchParams(str)), | ||
}; | ||
|
||
export const url = { | ||
parse: (urlStr: string) => new URL(urlStr), | ||
resolve: (from: string, to: string) => new URL(to, from).toString(), | ||
}; | ||
|
||
export const http = { | ||
request: () => { | ||
throw new Error('http.request is not supported in browser environment'); | ||
}, | ||
}; | ||
|
||
export const https = { | ||
request: () => { | ||
throw new Error('https.request is not supported in browser environment'); | ||
}, | ||
}; | ||
|
||
export const net = { | ||
Socket: class {}, | ||
// Add other net methods as needed | ||
}; | ||
|
||
export const tls = { | ||
connect: () => { | ||
throw new Error('tls.connect is not supported in browser environment'); | ||
}, | ||
}; | ||
|
||
export const assert = { | ||
ok: () => {}, | ||
// Add other assert methods as needed | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,28 @@ export default defineConfig({ | |
}, | ||
resolve: { | ||
preserveSymlinks: true, | ||
|
||
alias: { | ||
'@ironclad/rivet-core': resolve('../core/src/index.ts'), | ||
'@ironclad/trivet': resolve('../trivet/src/index.ts'), | ||
'node:child_process': resolve('./src/mocks/node-polyfills.ts'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why were these added back in? |
||
'node:process': resolve('./src/mocks/node-polyfills.ts'), | ||
'child_process': resolve('./src/mocks/node-polyfills.ts'), | ||
'process': resolve('./src/mocks/node-polyfills.ts'), | ||
'fs': resolve('./src/mocks/node-polyfills.ts'), | ||
'path': resolve('./src/mocks/node-polyfills.ts'), | ||
'os': resolve('./src/mocks/node-polyfills.ts'), | ||
'stream': resolve('./src/mocks/node-polyfills.ts'), | ||
'util': resolve('./src/mocks/node-polyfills.ts'), | ||
'events': resolve('./src/mocks/node-polyfills.ts'), | ||
'buffer': resolve('./src/mocks/node-polyfills.ts'), | ||
'crypto': resolve('./src/mocks/node-polyfills.ts'), | ||
'querystring': resolve('./src/mocks/node-polyfills.ts'), | ||
'url': resolve('./src/mocks/node-polyfills.ts'), | ||
'http': resolve('./src/mocks/node-polyfills.ts'), | ||
'https': resolve('./src/mocks/node-polyfills.ts'), | ||
'net': resolve('./src/mocks/node-polyfills.ts'), | ||
'tls': resolve('./src/mocks/node-polyfills.ts'), | ||
'assert': resolve('./src/mocks/node-polyfills.ts'), | ||
}, | ||
}, | ||
build: { | ||
|
@@ -34,6 +52,10 @@ export default defineConfig({ | |
plugins: [visualizer()], | ||
}, | ||
}, | ||
define: { | ||
'process.env': {}, | ||
'global': {}, | ||
}, | ||
plugins: [ | ||
react(), | ||
viteTsconfigPaths(), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ | |
"@google-cloud/vertexai": "^0.1.3", | ||
"@google/generative-ai": "^0.21.0", | ||
"@huggingface/inference": "^2.6.4", | ||
"@modelcontextprotocol/sdk": "^1.5.0", | ||
"@tauri-apps/api": "^1.5.3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Core cannot depend on tauri |
||
"assemblyai": "^4.6.0", | ||
"autoevals": "^0.0.26", | ||
"cron-parser": "^4.9.0", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add this to the individual packages, not the root package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed