-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Python: Add Hyperlight CodeAct package and docs #5185
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
Open
eavanvalkenburg
wants to merge
39
commits into
microsoft:main
Choose a base branch
from
eavanvalkenburg:code_mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
a241a42
initial work on code_mode
eavanvalkenburg 492401d
updated samples
eavanvalkenburg 9f8eada
updates to codeact
eavanvalkenburg 988d4a9
udpated codeact
eavanvalkenburg ec16c12
Draft CodeAct ADR and sample updates
eavanvalkenburg 3d168ff
initial implementation and adr and feature
eavanvalkenburg 8dddecc
Python: Limit Hyperlight wasm backend to Python <3.14
eavanvalkenburg 8d70aff
Python: Fix CI for Hyperlight CodeAct PR
eavanvalkenburg 4f77938
Python: Run Hyperlight integration when available
eavanvalkenburg d959537
Python: Address Hyperlight review feedback
eavanvalkenburg 779ff14
Python: Simplify Hyperlight file mount inputs
eavanvalkenburg 003b5f2
Python: Accept Path host paths in Hyperlight mounts
eavanvalkenburg e296d61
Python: Fix Hyperlight mount typing for CI
eavanvalkenburg 66e5028
temp run integration test
eavanvalkenburg f880d2c
Python: Strengthen Hyperlight real sandbox tests
eavanvalkenburg f5cb9ea
added additional tests
eavanvalkenburg 1763ebf
Python: Simplify Hyperlight CodeAct API
eavanvalkenburg 07d0b9e
set tests as non-integration
eavanvalkenburg 83fe46d
Retry Hyperlight allowed-domain registration
eavanvalkenburg bbb8416
Gate Hyperlight integration tests by runtime support
eavanvalkenburg c055acd
Fix Hyperlight skip test on Python 3.14
eavanvalkenburg 85d8e7f
Delay Hyperlight runtime probe until test execution
eavanvalkenburg 2380fc8
Relax Hyperlight Windows integration stdout assertion
eavanvalkenburg bf56d12
Scan Hyperlight output directory for artifacts
eavanvalkenburg 7cf4091
Retry Hyperlight output artifact collection
eavanvalkenburg 771d763
Harden Hyperlight integration output assertions
eavanvalkenburg 9f99e03
Retry Hyperlight read-back check in integration test
eavanvalkenburg 21615b6
Simplify Hyperlight integration write assertion
eavanvalkenburg 2d9544b
Avoid pathlib in Hyperlight integration sandbox
eavanvalkenburg 582bf97
Use socket network check in Hyperlight sandbox
eavanvalkenburg be61f6f
Replace blocked Azure AI Search blog link
eavanvalkenburg 54f1b3a
Clarify Hyperlight guest stdlib limits
eavanvalkenburg d25bf1f
Use _socket in Hyperlight integration sandbox
eavanvalkenburg 7cf71c2
Handle Hyperlight mounted file paths
eavanvalkenburg dafdd21
Broaden Hyperlight sandbox path fallbacks
eavanvalkenburg 55f7403
Search Hyperlight guest mounts recursively
eavanvalkenburg 32244b1
Split Hyperlight mount coverage
eavanvalkenburg 92eaad2
Split Hyperlight live network tests
eavanvalkenburg f3dbd8c
Fix Hyperlight file-write test on Windows
eavanvalkenburg 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 hidden or 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
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,6 @@ | ||
| # CodeAct .NET implementation | ||
|
|
||
| This document will describe the .NET realization of the CodeAct design in | ||
| [`docs/decisions/0024-codeact-integration.md`](../../decisions/0024-codeact-integration.md). | ||
|
|
||
| Coming soon. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) Microsoft Corporation. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE |
This file contains hidden or 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,36 @@ | ||
| # agent-framework-hyperlight | ||
|
|
||
| Alpha Hyperlight-backed CodeAct integrations for Microsoft Agent Framework. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| pip install agent-framework-hyperlight --pre | ||
| ``` | ||
|
|
||
| This package depends on `hyperlight-sandbox`, the packaged Python guest, and the | ||
| Wasm backend package on supported platforms. If the backend is not published for | ||
| your current platform yet, `execute_code` will fail at runtime when it tries to | ||
| create the sandbox. | ||
|
|
||
| ## Public API | ||
|
|
||
| - `AllowedDomain` | ||
| - `AllowedDomainInput` | ||
| - `HyperlightCodeActProvider` | ||
| - `HyperlightExecuteCodeTool` | ||
| - `FileMount` | ||
| - `FileMountInput` | ||
|
|
||
| ## Notes | ||
|
|
||
| - This package is intentionally separate from `agent-framework-core` so CodeAct | ||
| usage and installation remain optional. | ||
| - Alpha-package samples live under `packages/hyperlight/samples/`. | ||
| - `file_mounts` accepts a single string shorthand, an explicit `(host_path, | ||
| mount_path)` pair, or a `FileMount` named tuple. The host-side path in the | ||
| explicit forms may be a `str` or `Path`. Use the explicit two-value form when | ||
| the host path differs from the sandbox path. | ||
| - `allowed_domains` accepts a single string target such as `"github.com"` to | ||
| allow all backend-supported methods, an explicit `(target, method_or_methods)` | ||
| tuple such as `("github.com", "GET")`, or an `AllowedDomain` named tuple. |
24 changes: 24 additions & 0 deletions
24
python/packages/hyperlight/agent_framework_hyperlight/__init__.py
This file contains hidden or 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,24 @@ | ||
| # Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import importlib.metadata | ||
|
|
||
| from ._execute_code_tool import HyperlightExecuteCodeTool | ||
| from ._provider import HyperlightCodeActProvider | ||
| from ._types import AllowedDomain, AllowedDomainInput, FileMount, FileMountInput | ||
|
|
||
| try: | ||
| __version__ = importlib.metadata.version(__name__) | ||
| except importlib.metadata.PackageNotFoundError: | ||
| __version__ = "0.0.0" | ||
|
|
||
| __all__ = [ | ||
| "AllowedDomain", | ||
| "AllowedDomainInput", | ||
| "FileMount", | ||
| "FileMountInput", | ||
| "HyperlightCodeActProvider", | ||
| "HyperlightExecuteCodeTool", | ||
| "__version__", | ||
| ] |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.