Skip to content
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

Release cut 0.4.10 #2520

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/src/browser/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const readdirSync = (...args: any[]) => globalThis.core.api?.readdirSync(...args
*/
const mkdir = (...args: any[]) => globalThis.core.api?.mkdir(...args)

const mkdir = (...args: any[]) => global.core.api?.mkdir(...args)

/**
* Removes a directory at the specified path.
* @returns {Promise<any>} A Promise that resolves when the directory is removed successfully.
Expand Down
24 changes: 24 additions & 0 deletions core/src/node/api/processors/fsExt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,28 @@ export class FSExt implements Processor {
})
})
}

mkdir(path: string): Promise<void> {
return new Promise((resolve, reject) => {
fs.mkdir(path, { recursive: true }, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}

rmdir(path: string): Promise<void> {
return new Promise((resolve, reject) => {
fs.rm(path, { recursive: true }, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}
}
2 changes: 2 additions & 0 deletions core/src/types/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export enum FileManagerRoute {
getUserHomePath = 'getUserHomePath',
fileStat = 'fileStat',
writeBlob = 'writeBlob',
mkdir = 'mkdir',
rm = 'rm',
}

export type ApiFunction = (...args: any[]) => any
Expand Down
2 changes: 2 additions & 0 deletions extensions/tensorrt-llm-extension/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
PromptTemplate,
} from '@janhq/core/node'
import decompress from 'decompress'
import { SystemInformation } from '@janhq/core'
import { PromptTemplate } from '@janhq/core'

// Polyfill fetch with retry
const fetchRetry = fetchRT(fetch)
Expand Down
Loading