-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f2dead0
Showing
20 changed files
with
473 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build Javascript/Typescript | ||
|
||
on: | ||
push: | ||
|
||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '21' | ||
registry-url: 'https://npm.pkg.github.com' | ||
|
||
- name: Build | ||
run: bash build-javascript.sh | ||
|
||
- name: Upload Javascript artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-javascript | ||
path: build/javascript/dist | ||
|
||
- name: Upload Typescript artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-typescript | ||
path: build/javascript/src | ||
|
||
- name: Upload dist | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist-typescript-javascript | ||
path: build/javascript/*.tgz | ||
|
||
- name: Upload release asset | ||
if: github.event_name == 'release' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: build/javascript/openagents-service-provider-proto-*.tgz | ||
|
||
- name: Publish | ||
if: github.event_name == 'release' | ||
run: cd build/javascript && npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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,34 @@ | ||
name: Build PHP | ||
|
||
on: | ||
push: | ||
|
||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
|
||
- name: Install Protocol Buffers compiler | ||
run: sudo apt-get install -y protobuf-compiler | ||
|
||
- name: Build | ||
run: bash build-php.sh | ||
|
||
- name: Upload PHP artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-php | ||
path: build/php |
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,43 @@ | ||
name: Build Python | ||
|
||
on: | ||
push: | ||
|
||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Build | ||
run: bash build-python.sh | ||
|
||
- name: Upload Python artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-python | ||
path: build/python/openagents_service_provider_proto | ||
|
||
- name: Upload Python dist | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist-python | ||
path: build/python/dist | ||
|
||
- name: Upload release asset | ||
if: github.event_name == 'release' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: build/python/dist/*.tar.gz |
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,5 @@ | ||
tmp | ||
build | ||
/package-lock.json | ||
/package.json | ||
node_modules |
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,16 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p build/javascript/src | ||
mkdir -p build/javascript/dist | ||
|
||
npm i --save-dev @grpc/grpc-js ts-protoc-gen @protobuf-ts/plugin typescript @types/node | ||
|
||
npx protoc --ts_out build/javascript/src \ | ||
--experimental_allow_proto3_optional \ | ||
--ts_opt long_type_number,server_generic \ | ||
--proto_path proto proto/*.proto | ||
|
||
cp -Rvf npm/* build/javascript/ | ||
cd build/javascript | ||
npm run build | ||
npm pack |
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,10 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p tmp | ||
mkdir -p build/php | ||
pecl install grpc | ||
protoc --proto_path=proto \ | ||
--php_out=build/php \ | ||
--grpc_out=build/phpp \ | ||
--plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin \ | ||
proto/*.proto |
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,26 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p tmp | ||
python3 -m venv tmp/protobuild-venv | ||
. tmp/protobuild-venv/bin/activate | ||
pip install grpcio-tools | ||
|
||
mkdir -p build/python/openagents_service_provider_proto | ||
python -m grpc_tools.protoc -Iproto \ | ||
--python_out=build/python/openagents_service_provider_proto \ | ||
--pyi_out=build/python/openagents_service_provider_proto \ | ||
--grpc_python_out=build/python/openagents_service_provider_proto \ | ||
proto/*.proto | ||
|
||
cp -Rvf python/* build/python/ | ||
cd build/python | ||
|
||
|
||
|
||
if [ "$DEBUG" = "1" ] ; | ||
then | ||
deactivate | ||
pip install -e . | ||
else | ||
python setup.py sdist | ||
fi |
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,21 @@ | ||
{ | ||
"name": "openagents-service-provider-proto", | ||
"version": "1.0.0", | ||
"description": "", | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"author": "", | ||
"license": "", | ||
"dependencies": { | ||
"@grpc/grpc-js": "^1.10.6", | ||
"@protobuf-ts/plugin": "^2.9.4" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.12.5", | ||
"typescript": "^5.4.4" | ||
}, | ||
"files": [ | ||
"dist" | ||
] | ||
} |
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,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"outDir": "dist", | ||
"moduleResolution": "node", | ||
"esModuleInterop": true, | ||
"declaration": true | ||
}, | ||
"include": ["src/*.ts"], | ||
"exclude": ["node_modules"] | ||
} |
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,38 @@ | ||
syntax = "proto3"; | ||
|
||
import "JobParam.proto"; | ||
import "JobInput.proto"; | ||
import "JobState.proto"; | ||
import "JobResult.proto"; | ||
|
||
|
||
|
||
message Job { | ||
string id = 1; | ||
uint32 kind = 14; | ||
|
||
string runOn = 2; | ||
uint64 expiration = 3; | ||
uint64 timestamp = 4; | ||
|
||
repeated JobInput input = 5; // primary input | ||
repeated JobParam param = 6; // additional parameters | ||
|
||
string customerPublicKey = 7; | ||
string description = 8; | ||
string provider = 9; | ||
|
||
repeated string relays = 10; | ||
|
||
JobResult result = 12; | ||
JobState state = 11; | ||
|
||
uint64 maxExecutionTime = 13; // enforced by the provider | ||
// map<string,JobResult> results = 12; | ||
|
||
// map<string,JobState> states = 11; | ||
|
||
|
||
|
||
|
||
} |
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 @@ | ||
syntax = "proto3"; | ||
|
||
message JobInput { | ||
optional string data = 1; | ||
optional string ref = 2; | ||
string type = 3; | ||
string marker = 4; | ||
optional string source = 5; | ||
} |
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,6 @@ | ||
syntax = "proto3"; | ||
|
||
message JobParam { | ||
string key = 1; | ||
repeated string value = 2; | ||
} |
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,8 @@ | ||
syntax = "proto3"; | ||
|
||
message JobResult { | ||
string content = 1; | ||
uint64 timestamp = 2; | ||
string id = 3; | ||
} | ||
|
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,15 @@ | ||
syntax = "proto3"; | ||
|
||
import "Log.proto"; | ||
import "JobStatus.proto"; | ||
|
||
|
||
|
||
|
||
message JobState { | ||
uint64 acceptedAt = 13; | ||
string acceptedBy = 14; | ||
JobStatus status = 15; | ||
repeated Log logs = 17; | ||
uint64 timestamp = 18; | ||
} |
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,12 @@ | ||
|
||
syntax = "proto3"; | ||
|
||
enum JobStatus { | ||
PENDING = 0; | ||
PROCESSING = 1; | ||
ERROR = 2; | ||
SUCCESS = 3; | ||
PARTIAL = 4; | ||
PAYMENT_REQUIRED = 7; | ||
UNKNOWN=99; | ||
} |
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,10 @@ | ||
|
||
syntax = "proto3"; | ||
|
||
message Log { | ||
string id=1; | ||
string log = 2; | ||
string level = 3; | ||
uint64 timestamp = 4; | ||
string source = 5; | ||
} |
Oops, something went wrong.