Skip to content

Commit

Permalink
Initial web agent support and Turtle Graphic example (#529)
Browse files Browse the repository at this point in the history
Initial Turtle Graphic example
Initial web agent support
- Refactor and generalize process shim to support RPC on different
"transport" or channels, add support for shared channels
- Add support to dynamically add and remove agents at runtime.
- Add new target "webAgent" in browser service worker's websocket
message which will be relay to the web context via content script
- interface remote call messages will pass thru `dispatcher` -> [node
IPC] `browser agent process` -> [websocket]`extension service worker` ->
[chrome.runtime] `extension content script` -> [window.postmessage] `web
page` and vice versa for message back.
  • Loading branch information
curtisman authored Jan 10, 2025
1 parent 4a9baa4 commit 958b2cf
Show file tree
Hide file tree
Showing 50 changed files with 2,324 additions and 892 deletions.
4 changes: 2 additions & 2 deletions ts/packages/actionSchema/src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class ActionParser {
const parser = new ActionParser();
const definition = parser.parseSchema(sourceFile, typeName);
if (definition === undefined) {
throw new Error(`Type ${typeName} not found`);
throw new Error(`Type '${typeName}' not found`);
}
const result = createActionSchemaFile(
schemaName,
Expand All @@ -330,7 +330,7 @@ class ActionParser {
for (const pending of this.pendingReferences) {
const resolvedType = this.typeMap.get(pending.name);
if (resolvedType === undefined) {
throw new Error(`Type ${pending.name} not found`);
throw new Error(`Type '${pending.name}' not found`);
}
pending.definition = resolvedType;
}
Expand Down
21 changes: 21 additions & 0 deletions ts/packages/agentRpc/LICENSE
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
11 changes: 11 additions & 0 deletions ts/packages/agentRpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Agent Remoting

This package contains code to support remoting Agent SDK interfaces via an abstract RpcChannel interface.

## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.
39 changes: 39 additions & 0 deletions ts/packages/agentRpc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "agent-rpc",
"version": "0.0.1",
"description": "Remoting library for the TypeAgent SDK",
"homepage": "https://github.com/microsoft/TypeAgent#readme",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/TypeAgent.git",
"directory": "ts/packages/agentRpc"
},
"license": "MIT",
"author": "Microsoft",
"type": "module",
"exports": {
"./server": "./dist/server.js",
"./client": "./dist/client.js"
},
"types": "./dist/index.d.ts",
"scripts": {
"build": "npm run tsc",
"clean": "rimraf --glob dist *.tsbuildinfo *.done.build.log",
"prettier": "prettier --check . --ignore-path ../../.prettierignore",
"prettier:fix": "prettier --write . --ignore-path ../../.prettierignore",
"tsc": "tsc -b"
},
"dependencies": {
"@typeagent/agent-sdk": "workspace:*",
"common-utils": "workspace:*",
"debug": "^4.3.4"
},
"devDependencies": {
"@types/debug": "^4.1.10",
"@types/jest": "^29.5.7",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"typescript": "^5.4.2"
}
}
Loading

0 comments on commit 958b2cf

Please sign in to comment.