Skip to content

Commit 0a2536f

Browse files
committed
Merge branch 'dev' of https://github.com/microsoft/genaiscript into dev
2 parents 8658fbe + 2ff1e73 commit 0a2536f

113 files changed

Lines changed: 4386 additions & 325 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
11
{
2-
"image": "mcr.microsoft.com/devcontainers/javascript-node:22",
3-
"postCreateCommand": "pnpm install --frozen-lockfile --prefer-offline && pnpm install:playwright",
4-
"customizations": {
5-
"vscode": {
6-
"extensions": [
7-
"GitHub.copilot-chat",
8-
"esbenp.prettier-vscode",
9-
"dbaeumer.vscode-eslint",
10-
"bierner.markdown-mermaid",
11-
"yoavbls.pretty-ts-errors",
12-
"astro-build.astro-vscode",
13-
"unifiedjs.vscode-mdx",
14-
"streetsidesoftware.code-spell-checker",
15-
"file-icons.file-icons",
16-
"GitHub.vscode-pull-request-github",
17-
"usernamehw.errorlens",
18-
"goessner.mdmath",
19-
"vsls-contrib.gistfs",
20-
"ms-azuretools.vscode-containers",
21-
"ms-vscode.vscode-js-profile-flame",
22-
"streetsidesoftware.code-spell-checker-french"
23-
]
24-
}
2+
"image": "mcr.microsoft.com/devcontainers/javascript-node:24",
3+
"postCreateCommand": "pnpm install --frozen-lockfile --prefer-offline && pnpm install:playwright",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"GitHub.copilot-chat",
8+
"esbenp.prettier-vscode",
9+
"dbaeumer.vscode-eslint",
10+
"bierner.markdown-mermaid",
11+
"yoavbls.pretty-ts-errors",
12+
"astro-build.astro-vscode",
13+
"unifiedjs.vscode-mdx",
14+
"streetsidesoftware.code-spell-checker",
15+
"file-icons.file-icons",
16+
"GitHub.vscode-pull-request-github",
17+
"usernamehw.errorlens",
18+
"goessner.mdmath",
19+
"vsls-contrib.gistfs",
20+
"ms-azuretools.vscode-containers",
21+
"ms-vscode.vscode-js-profile-flame",
22+
"streetsidesoftware.code-spell-checker-french"
23+
]
2524
},
26-
"features": {
27-
"ghcr.io/devcontainers/features/common-utils:2": {},
28-
"ghcr.io/devcontainers/features/git:1": {},
29-
"ghcr.io/ghcr.io/devcontainers/features/github-cli:1": {},
30-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
31-
"ghcr.io/devcontainers/features/azure-cli:1": {},
32-
"ghcr.io/devcontainers/features/python:1": {},
33-
"ghcr.io/devcontainers-extra/features/ffmpeg-apt-get:1": {},
34-
"ghcr.io/devcontainers/features/rust:1": {}
25+
"codespaces": {
26+
"repositories": {
27+
"githubnext/gh-aw": {
28+
"permissions": {
29+
"releases": "read",
30+
"contents": "read"
31+
}
32+
}
33+
}
3534
}
35+
},
36+
"features": {
37+
"ghcr.io/devcontainers/features/common-utils:2": {},
38+
"ghcr.io/devcontainers/features/git:1": {},
39+
"ghcr.io/ghcr.io/devcontainers/features/github-cli:1": {},
40+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
41+
"ghcr.io/devcontainers/features/azure-cli:1": {},
42+
"ghcr.io/devcontainers/features/python:1": {},
43+
"ghcr.io/devcontainers-extra/features/ffmpeg-apt-get:1": {},
44+
"ghcr.io/devcontainers/features/rust:1": {}
45+
}
3646
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ packages/**/.genaiscript/
1111
.genaiscript/stats/
1212
.genaiscript/test-runs/
1313
.genaiscript/tests/
14+
install-gh-aw.sh
15+
gh-aw
1416

1517
vscode-extension-samples/
1618
.DS_Store

demo/genaisrc/haiku.genai.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
script({ metadata: { name: "haiku" } })
2-
$`Write a haiku about ${env.files[0] || "code"}`
1+
script({ model: "github_copilot_chat:gpt-4.1", metadata: { name: "haiku" } })
2+
$`Write a haiku about ${env.files || "code"}`

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "docs",
33
"type": "module",
44
"private": true,
5-
"version": "2.3.15",
5+
"version": "2.5.0",
66
"license": "MIT",
77
"scripts": {
88
"build": "astro build",

docs/public/genaiscript.d.ts

Lines changed: 39 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/components/BuiltinTools.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ import { LinkCard } from '@astrojs/starlight/components';
4141
<LinkCard title="python_code_interpreter_run" description="Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy===2.1.3, pandas===2.2.3, scipy===1.14.1, matplotlib===3.9.2. There is NO network connectivity. Do not attempt to install other packages or make web requests. You must copy all the necessary files or pass all the data because the python code runs in a separate container." href="/genaiscript/reference/scripts/system#systempython_code_interpreter" />
4242
<LinkCard title="python_code_interpreter_copy_files_to_container" description="Copy files from the workspace file system to the container file system. NO absolute paths. Returns the path of each file copied in the python container." href="/genaiscript/reference/scripts/system#systempython_code_interpreter" />
4343
<LinkCard title="python_code_interpreter_read_file" description="Reads a file from the container file system. No absolute paths." href="/genaiscript/reference/scripts/system#systempython_code_interpreter" />
44+
<LinkCard title="resource_list" description="List available resources from the host. Returns a list of available resource URIs and their descriptions." href="/genaiscript/reference/scripts/system#systemresources" />
45+
<LinkCard title="resource_read" description="Read the content of a resource from a URL. Resolves various protocols and returns the content of the files found at the URL." href="/genaiscript/reference/scripts/system#systemresources" />
4446
<LinkCard title="retrieval_fuzz_search" description="Search for keywords using the full text of files and a fuzzy distance." href="/genaiscript/reference/scripts/system#systemretrieval_fuzz_search" />
4547
<LinkCard title="retrieval_vector_search" description="Search files using embeddings and similarity distance." href="/genaiscript/reference/scripts/system#systemretrieval_vector_search" />
4648
<LinkCard title="retrieval_web_search" description="Search the web for a user query using Tavily or Bing Search." href="/genaiscript/reference/scripts/system#systemretrieval_web_search" />

docs/src/content/docs/blog/mcp-resources.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,36 @@ await host.resolveResource("https://github.com/user/repo.git/path/to/file");
151151
await host.resolveResource("vscode://vsls-contrib.gistfs/open?gist=123&file=script.js");
152152
```
153153

154+
## System Resource Tools
155+
156+
GenAIScript provides built-in tools for working with resources through the `system.resources` system script. These tools make it easy to list and read resources in your scripts:
157+
158+
### `resource_list`
159+
160+
Lists all available resources from the host, returning their URIs and descriptions.
161+
162+
```js
163+
script({
164+
system: ["system.resources"]
165+
})
166+
167+
$`Use the resource_list tool to see what resources are available, then read one of them.`
168+
```
169+
170+
### `resource_read`
171+
172+
Reads content from a URL using the same resolution logic as `host.resolveResource`. Supports all the URL patterns mentioned above.
173+
174+
```js
175+
script({
176+
system: ["system.resources"]
177+
})
178+
179+
$`Use the resource_read tool to read the content from https://raw.githubusercontent.com/microsoft/genaiscript/main/README.md`
180+
```
181+
182+
The tool automatically handles content formatting, binary detection, and multiple files.
183+
154184
## Next steps
155185

156186
Are you ready to build your own MCP tools and resources?

docs/src/content/docs/configuration/anthropic-bedrock.mdx

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,78 @@ import LLMProviderFeatures from "../../../components/LLMProviderFeatures.astro";
2626

2727
The `anthropic_bedrock` provider accesses Anthropic models on Amazon Bedrock. You can find the model names in the [Anthropic model documentation](https://docs.anthropic.com/en/docs/about-claude/models#model-names).
2828

29-
GenAIScript assumes that you have configured Amazon Web Services (AWS) credentials
30-
in a way that the [AWS Node SDK will recognize](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html).
31-
3229
```js "anthropic_bedrock:"
3330
script({
3431
model:
3532
"anthropic_bedrock:anthropic.claude-3-sonnet-20240229-v1:0",
3633
});
3734
```
35+
36+
## Configuration
37+
38+
GenAIScript supports multiple ways to configure AWS credentials for Bedrock access:
39+
40+
### Required Environment Variables
41+
42+
- `AWS_REGION` - The AWS region where Bedrock is enabled (e.g., `us-east-1`, `us-west-2`)
43+
44+
### Authentication Options
45+
46+
Choose one of the following authentication methods:
47+
48+
<Tabs>
49+
<TabItem label="Access Keys">
50+
```bash
51+
export AWS_ACCESS_KEY_ID="AKIA..."
52+
export AWS_SECRET_ACCESS_KEY="..."
53+
export AWS_SESSION_TOKEN="..." # Optional, for temporary credentials
54+
```
55+
</TabItem>
56+
57+
<TabItem label="AWS Profile">
58+
```bash
59+
export AWS_PROFILE="my-profile"
60+
```
61+
</TabItem>
62+
63+
<TabItem label="Bedrock API Key">
64+
```bash
65+
export AWS_BEARER_TOKEN_BEDROCK="your-bedrock-api-key"
66+
```
67+
</TabItem>
68+
</Tabs>
69+
70+
### Optional Environment Variables
71+
72+
- `ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION` - Override AWS region for small/fast models
73+
- `DISABLE_PROMPT_CACHING` - Set to `1` to disable Anthropic prompt caching
74+
- `ANTHROPIC_MODEL` - Override the default Anthropic model ID for Bedrock
75+
76+
### Setup Steps
77+
78+
<Steps>
79+
80+
1. **Enable Bedrock Access**
81+
82+
Request access to Claude models in the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock/) under "Model Access".
83+
84+
2. **Configure Credentials**
85+
86+
Set up your AWS credentials using one of the methods above. GenAIScript follows the standard [AWS credential provider chain](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html).
87+
88+
3. **Set Region**
89+
90+
Configure the AWS region where you have Bedrock access:
91+
```bash
92+
export AWS_REGION="us-east-1"
93+
```
94+
95+
4. **Test Configuration**
96+
97+
```bash
98+
genaiscript configure anthropic_bedrock
99+
```
100+
101+
</Steps>
102+
103+
<LLMProviderFeatures provider="anthropic_bedrock" />

docs/src/content/docs/guides/genaiscript.d.ts

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/content/docs/reference/cli/commands.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Options:
118118
--run-retry <number> number of retries for the entire run
119119
--no-run-trace disable automatic trace generation
120120
--no-output-trace disable automatic output generation
121+
--mcp-config <file> MCP configuration file (Claude format) to load servers from
121122
-h, --help display help for command
122123
```
123124

0 commit comments

Comments
 (0)