-
Notifications
You must be signed in to change notification settings - Fork 126
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
Runtime file #935
Merged
Runtime file #935
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,126 @@ | ||
{ | ||
"name": "genaiscript", | ||
"version": "1.84.0", | ||
"main": "built/genaiscript.cjs", | ||
"type": "commonjs", | ||
"bin": { | ||
"genaiscript": "built/genaiscript.cjs" | ||
}, | ||
"exports": { | ||
".": "./built/genaiscript.cjs", | ||
"./api": "./built/api.mjs", | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"built/api.mjs", | ||
"built/genaiscript.cjs" | ||
], | ||
"publisher": "Microsoft", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/microsoft/genaiscript.git" | ||
}, | ||
"homepage": "https://microsoft.github.io/genaiscript", | ||
"keywords": [ | ||
"genai", | ||
"ai", | ||
"agentic", | ||
"agent", | ||
"cli", | ||
"prompt", | ||
"llm", | ||
"generative ai", | ||
"gpt4", | ||
"chatgpt", | ||
"ollama", | ||
"llamacpp", | ||
"chatgpt" | ||
], | ||
"description": "A CLI for GenAIScript, a generative AI scripting framework.", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@anthropic-ai/sdk": "^0.32.1", | ||
"@azure/identity": "^4.5.0", | ||
"@inquirer/prompts": "^7.2.0", | ||
"@modelcontextprotocol/sdk": "^1.0.3", | ||
"@octokit/plugin-paginate-rest": "^11.3.6", | ||
"@octokit/plugin-retry": "^7.1.2", | ||
"@octokit/plugin-throttling": "^9.3.2", | ||
"@octokit/rest": "^21.0.2", | ||
"dockerode": "^4.0.2", | ||
"gpt-tokenizer": "^2.8.1", | ||
"html-to-text": "^9.0.5", | ||
"jimp": "^1.6.0", | ||
"mammoth": "^1.8.0", | ||
"mathjs": "^14.0.0", | ||
"tabletojson": "^4.1.5", | ||
"tsx": "^4.19.2", | ||
"turndown": "^7.2.0", | ||
"turndown-plugin-gfm": "^1.0.2", | ||
"typescript": "5.7.2", | ||
"vectra": "^0.9.0", | ||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz" | ||
}, | ||
"optionalDependencies": { | ||
"@huggingface/transformers": "^3.1.2", | ||
"@lvce-editor/ripgrep": "^1.5.0", | ||
"pdfjs-dist": "4.9.155", | ||
"playwright": "^1.49.0", | ||
"skia-canvas": "^2.0.1", | ||
"tree-sitter-wasms": "^0.1.11", | ||
"web-tree-sitter": "0.22.2" | ||
}, | ||
"engines": { | ||
"node": ">=20.0.0" | ||
}, | ||
"peerDependencies": { | ||
"promptfoo": "0.100.3" | ||
}, | ||
"devDependencies": { | ||
"@types/diff": "^6.0.0", | ||
"@types/dockerode": "^3.3.32", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/memorystream": "^0.3.4", | ||
"@types/node": "^22.10.1", | ||
"@types/papaparse": "^5.3.15", | ||
"@types/prompts": "^2.4.9", | ||
"@types/replace-ext": "^2.0.2", | ||
"@types/ws": "^8.5.13", | ||
"commander": "^12.1.0", | ||
"diff": "^7.0.0", | ||
"dotenv": "^16.4.7", | ||
"es-toolkit": "^1.29.0", | ||
"esbuild": "^0.24.0", | ||
"execa": "^9.5.1", | ||
"fs-extra": "^11.2.0", | ||
"glob": "^11.0.0", | ||
"memorystream": "^0.3.1", | ||
"node-sarif-builder": "^3.2.0", | ||
"octokit": "^4.0.2", | ||
"openai": "^4.76.0", | ||
"pretty-bytes": "^6.1.1", | ||
"replace-ext": "^2.0.0", | ||
"ws": "^8.18.0", | ||
"zx": "^8.2.4" | ||
}, | ||
"scripts": { | ||
"compile": "esbuild src/api.ts --outfile=built/api.mjs && esbuild src/main.ts --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:turndown-plugin-gfm --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers --external:@modelcontextprotocol/sdk --external:@anthropic-ai/sdk && node ../../scripts/patch-cli.mjs", | ||
"compile-debug": "esbuild src/main.ts --sourcemap --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:turndown-plugin-gfm --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers --external:@modelcontextprotocol/sdk --external:@anthropic-ai/sdk", | ||
"postcompile": "node built/genaiscript.cjs info help > ../../docs/src/content/docs/reference/cli/commands.md", | ||
"vis:treemap": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.treemap.html", | ||
"vis:network": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.network.html --template network", | ||
"go": "yarn compile && node built/genaiscript.cjs", | ||
"test": "node --import tsx --test src/**.test.ts", | ||
"typecheck": "tsc -p src", | ||
"lint": "npx --yes publint" | ||
} | ||
"name": "genaiscript", | ||
"version": "1.84.0", | ||
"main": "built/genaiscript.cjs", | ||
"type": "commonjs", | ||
"bin": { | ||
"genaiscript": "built/genaiscript.cjs" | ||
}, | ||
"exports": { | ||
".": "./built/genaiscript.cjs", | ||
"./api": "./built/api.mjs", | ||
"./runtime": { | ||
"import": "./built/runtime.js", | ||
"types": "./built/runtime.d.ts" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"built/api.mjs", | ||
"built/runtime.js", | ||
"built/runtime.d.ts", | ||
"built/genaiscript.cjs" | ||
], | ||
"publisher": "Microsoft", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/microsoft/genaiscript.git" | ||
}, | ||
"homepage": "https://microsoft.github.io/genaiscript", | ||
"keywords": [ | ||
"genai", | ||
"ai", | ||
"agentic", | ||
"agent", | ||
"cli", | ||
"prompt", | ||
"llm", | ||
"generative ai", | ||
"gpt4", | ||
"chatgpt", | ||
"ollama", | ||
"llamacpp", | ||
"chatgpt" | ||
], | ||
"description": "A CLI for GenAIScript, a generative AI scripting framework.", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@anthropic-ai/sdk": "^0.32.1", | ||
"@azure/identity": "^4.5.0", | ||
"@inquirer/prompts": "^7.2.0", | ||
"@modelcontextprotocol/sdk": "^1.0.3", | ||
"@octokit/plugin-paginate-rest": "^11.3.6", | ||
"@octokit/plugin-retry": "^7.1.2", | ||
"@octokit/plugin-throttling": "^9.3.2", | ||
"@octokit/rest": "^21.0.2", | ||
"dockerode": "^4.0.2", | ||
"es-toolkit": "^1.29.0", | ||
"gpt-tokenizer": "^2.8.1", | ||
"html-to-text": "^9.0.5", | ||
"jimp": "^1.6.0", | ||
"mammoth": "^1.8.0", | ||
"mathjs": "^14.0.0", | ||
"tabletojson": "^4.1.5", | ||
"tsx": "^4.19.2", | ||
"turndown": "^7.2.0", | ||
"turndown-plugin-gfm": "^1.0.2", | ||
"typescript": "5.7.2", | ||
"vectra": "^0.9.0", | ||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz" | ||
}, | ||
"optionalDependencies": { | ||
"@huggingface/transformers": "^3.1.2", | ||
"@lvce-editor/ripgrep": "^1.5.0", | ||
"pdfjs-dist": "4.9.155", | ||
"playwright": "^1.49.0", | ||
"skia-canvas": "^2.0.1", | ||
"tree-sitter-wasms": "^0.1.11", | ||
"web-tree-sitter": "0.22.2" | ||
}, | ||
"engines": { | ||
"node": ">=20.0.0" | ||
}, | ||
"peerDependencies": { | ||
"promptfoo": "0.100.3" | ||
}, | ||
"devDependencies": { | ||
"@types/diff": "^6.0.0", | ||
"@types/dockerode": "^3.3.32", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/memorystream": "^0.3.4", | ||
"@types/node": "^22.10.1", | ||
"@types/papaparse": "^5.3.15", | ||
"@types/prompts": "^2.4.9", | ||
"@types/replace-ext": "^2.0.2", | ||
"@types/ws": "^8.5.13", | ||
"commander": "^12.1.0", | ||
"diff": "^7.0.0", | ||
"dotenv": "^16.4.7", | ||
"es-toolkit": "^1.29.0", | ||
"esbuild": "^0.24.0", | ||
"execa": "^9.5.1", | ||
"fs-extra": "^11.2.0", | ||
"glob": "^11.0.0", | ||
"memorystream": "^0.3.1", | ||
"node-sarif-builder": "^3.2.0", | ||
"octokit": "^4.0.2", | ||
"openai": "^4.76.0", | ||
"pretty-bytes": "^6.1.1", | ||
"replace-ext": "^2.0.0", | ||
"ws": "^8.18.0", | ||
"zx": "^8.2.4" | ||
}, | ||
"scripts": { | ||
"compile:runtime": "tsc src/runtime.ts --skipLibCheck --outDir built --declaration --module es6 --moduleResolution node", | ||
"compile:api": "esbuild src/api.ts --outfile=built/api.mjs", | ||
"compile": "yarn compile:api && yarn compile:runtime && esbuild src/main.ts --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:turndown-plugin-gfm --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers --external:@modelcontextprotocol/sdk --external:@anthropic-ai/sdk --external:es-toolkit && node ../../scripts/patch-cli.mjs", | ||
"compile-debug": "esbuild src/main.ts --sourcemap --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:turndown-plugin-gfm --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers --external:@modelcontextprotocol/sdk --external:@anthropic-ai/sdk --external:es-toolkit", | ||
"postcompile": "node built/genaiscript.cjs info help > ../../docs/src/content/docs/reference/cli/commands.md", | ||
"vis:treemap": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.treemap.html", | ||
"vis:network": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.network.html --template network", | ||
"go": "yarn compile && node built/genaiscript.cjs", | ||
"test": "node --import tsx --test src/**.test.ts", | ||
"typecheck": "tsc -p src", | ||
"lint": "npx --yes publint" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* GenAIScript supporting runtime | ||
*/ | ||
import { delay as esDelay } from "es-toolkit" | ||
|
||
/** | ||
* A helper function to delay the execution of the script | ||
*/ | ||
export const delay: (ms: number) => Promise<void> = esDelay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
script({ | ||
tests: {}, | ||
}) | ||
|
||
import { delay } from "genaiscript/runtime" | ||
|
||
await delay(100) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Missing comment describing the purpose of the file.