### Install OASF SDK and Dependencies (Golang) Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Installs the OASF SDK and its required Protocol Buffers for Golang. This is a prerequisite for using the SDK in your Go projects. ```bash go get github.com/agntcy/oasf-sdk/pkg@v0.0.9 go get buf.build/gen/go/agntcy/oasf-sdk/protocolbuffers/go@v1.36.10-20251029125108-823ea6fabc82.1 go get buf.build/gen/go/agntcy/oasf-sdk/grpc/go@v1.5.1-20251029125108-823ea6fabc82.2 ``` -------------------------------- ### Install OASF SDK Python Packages with uv Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md This snippet shows how to add the 'agntcy-oasf-sdk-grpc-python' and 'agntcy-oasf-sdk-protocolbuffers-python' packages using the 'uv' package installer. It specifies the versions and the remote index to use. Ensure 'uv' is installed in your environment. ```bash uv add 'agntcy-oasf-sdk-grpc-python==1.75.0.1.20250917120021+8b2bf93bf8dc' --index https://buf.build/gen/python uv add 'agntcy-oasf-sdk-protocolbuffers-python==32.1.0.1.20250917120021+8b2bf93bf8dc' --index https://buf.build/gen/python ``` -------------------------------- ### Install oasf-sdk npm package Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Installs the necessary @buf/agntcy_oasf-sdk.grpc_node package for Node.js gRPC communication. This step requires configuring npm to use the buf.build registry. ```bash npm config set @buf:registry https://buf.build/gen/npm/v1/ npm install @buf/agntcy_oasf-sdk.grpc_node@1.13.0-20250917120021-8b2bf93bf8dc.2 ``` -------------------------------- ### Run OASF SDK Docker Container Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Starts the OASF SDK as a Docker container, making it accessible on port 31234 for incoming requests. This is the standard method for deploying and running the SDK. ```bash docker run -p 31234:31234 ghcr.io/agntcy/oasf-sdk:latest ``` -------------------------------- ### Generate GitHub Copilot Config Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Creates a GitHub Copilot configuration by converting OASF data model using the RecordToGHCopilot RPC method. The output can be piped to a file for saving. It requires 'jq' and 'grpcurl' to be installed. ```bash cat e2e/fixtures/translation_0.8.0_record.json | jq '{record: .}' | grpcurl -plaintext -d @ localhost:31234 agntcy.oasfsdk.translation.v1.TranslationService/RecordToGHCopilot ``` -------------------------------- ### Local Development Docker Run Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Builds and runs the OASF SDK locally using the 'task build' command and then starts it as a Docker container on port 31234. This is intended for local testing and development workflows. ```bash task build docker run -p 31234:31234 oasf-sdk:latest ``` -------------------------------- ### Git Commit Sign-off Example Source: https://github.com/agntcy/oasf-sdk/blob/main/CONTRIBUTING.md This snippet demonstrates the required format for a Developer's Certificate of Origin sign-off in a commit message. It ensures proper attribution for contributions. The sign-off line is crucial for tracking contributions and must be included in pull requests. ```git Signed-off-by: Random J Developer ``` -------------------------------- ### Validate OASF Record Programmatically (Go) Source: https://context7.com/agntcy/oasf-sdk/llms.txt This Go code snippet demonstrates how to validate an OASF record using the OASF SDK's Go library. It shows initializing a validator with embedded schemas and performing validation, including an example of validating against a remote schema URL. This requires the `github.com/agntcy/oasf-sdk/pkg/validator` and `github.com/agntcy/oasf-sdk/pkg/decoder` packages. ```go package main import ( "context" "fmt" "log" "github.com/agntcy/oasf-sdk/pkg/decoder" "github.com/agntcy/oasf-sdk/pkg/validator" ) func main() { // Create validator with embedded schemas v, err := validator.New() if err != nil { log.Fatalf("Failed to create validator: %v", err) } // Sample OASF record recordData := map[string]interface{}{ "name": "example.org/my-agent", "schema_version": "0.8.0", "version": "v1.0.0", "description": "An example agent for demonstration", "authors": []string{"Your Name "}, "created_at": "2025-01-01T00:00:00Z", "domains": []map[string]interface{}{ {"id": 101, "name": "technology/internet_of_things"}, }, "locators": []map[string]interface{}{ {"type": "docker_image", "url": "ghcr.io/example/my-agent:latest"}, }, "skills": []map[string]interface{}{ {"name": "natural_language_processing/natural_language_understanding", "id": 101}, }, } // Convert to protobuf recordStruct, err := decoder.StructToProto(recordData) if err != nil { log.Fatalf("Failed to convert: %v", err) } // Validate with embedded schemas ctx := context.Background() isValid, errors, err := v.ValidateRecord(ctx, recordStruct) if err != nil { log.Fatalf("Validation failed: %v", err) } fmt.Printf("Valid: %t\n", isValid) if len(errors) > 0 { fmt.Println("Errors:") for _, e := range errors { fmt.Printf(" - %s\n", e) } } // Validate against remote schema isValid, errors, err = v.ValidateRecord(ctx, recordStruct, validator.WithSchemaURL("https://schema.oasf.outshift.com")) if err != nil { log.Fatalf("Remote validation failed: %v", err) } } ``` -------------------------------- ### Validate Record with Explicit Schema URL using grpcurl Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md This example shows how to validate a record using the gRPC API of the OASF SDK by providing an explicit schema URL. It pipes a JSON record along with the schema URL to grpcurl, targeting the validation service. This method allows for specifying a custom schema location. ```bash cat e2e/fixtures/valid_0.8.0_record.json | jq '{record: ., schema_url: "https://schema.oasf.outshift.com"}' | grpcurl -plaintext -d @ localhost:31234 agntcy.oasfsdk.validation.v1.ValidationService/ValidateRecord ``` -------------------------------- ### Decode OASF Record using grpcurl CLI Source: https://context7.com/agntcy/oasf-sdk/llms.txt This snippet demonstrates how to decode an unstructured OASF record into a typed protobuf structure using the grpcurl command-line tool. It requires grpcurl and jq to be installed and configured to communicate with the DecodingService RPC endpoint. The input is a JSON object representing the unstructured record, and the output is a typed protobuf message. ```bash # Input: Unstructured OASF record cat <"], "created_at": "2025-01-01T00:00:00Z", "domains": [{"id": 101, "name": "technology/internet_of_things"}], "locators": [{"type": "docker_image", "url": "ghcr.io/example/agent:latest"}], "skills": [{"name": "nlp/nlu", "id": 101}] } EOF # Output: Typed record (v1alpha2 for schema 0.8.0) { "v1alpha2": { "name": "example.org/my-agent", "schemaVersion": "0.8.0", "version": "v1.0.0", "description": "Example agent", "authors": ["Developer "], "createdAt": "2025-01-01T00:00:00Z", "domains": [{"id": 101, "name": "technology/internet_of_things"}], "locators": [{"type": "LOCATOR_TYPE_DOCKER_IMAGE", "url": "ghcr.io/example/agent:latest"}], "skills": [{"name": "nlp/nlu", "id": 101}] } } ``` -------------------------------- ### Example Agent-to-Agent (A2A) Card Structure Source: https://context7.com/agntcy/oasf-sdk/llms.txt This JSON object represents a typical Agent-to-Agent (A2A) card structure. It defines an agent's name, version, description, URL, provider information, capabilities, input/output modes, and skills. This format is used as input for the TranslationService.A2AToRecord RPC. ```json { "data": { "a2aCard": { "capabilities": { "pushNotifications": false, "streaming": true }, "defaultInputModes": ["text"], "defaultOutputModes": ["text"], "description": "An agent that performs web searches and extracts information.", "name": "example-agent", "skills": [{ "description": "Performs web searches to retrieve information.", "id": "browser", "name": "browser automation" }], "url": "http://localhost:8000" } } } ``` -------------------------------- ### Validate Record with Embedded Schema using grpcurl Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md This example demonstrates how to validate a record using the gRPC API of the OASF SDK with embedded schemas. It pipes a JSON record to grpcurl, specifying the validation service and method. No external schema URL is required. ```bash cat e2e/fixtures/valid_0.8.0_record.json | jq '{record: .}' | grpcurl -plaintext -d @ localhost:31234 agntcy.oasfsdk.validation.v1.ValidationService/ValidateRecord ``` -------------------------------- ### Bump Dependencies and Prepare Release Source: https://github.com/agntcy/oasf-sdk/blob/main/RELEASE.md This command prepares the release by updating all `go.mod` files to the new release version. After execution, review the changes, push the release branch to GitHub, and create a pull request. ```shell task release:prepare # If the command fails with 'failed: working tree not clean', run: git stash --all # Then retry the task release:prepare git push origin release/v1.0.0 ``` -------------------------------- ### Validate OASF Record using Package (Golang) Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Demonstrates how to validate an OASF record using the OASF SDK's package-based approach in Go. It includes creating a validator instance, converting a Go struct to a protobuf format, and performing validation against embedded schemas or a specified URL. ```go package main import ( "fmt" "log" "github.com/agntcy/oasf-sdk/pkg/decoder" "github.com/agntcy/oasf-sdk/pkg/validator" ) func main() { // Create a new validator instance with embedded schemas v, err := validator.New() if err != nil { log.Fatalf("Failed to create validator: %v", err) } // Sample OASF record data as a Go struct recordData := map[string]interface{}{ "name": "example.org/my-agent", "schema_version": "0.8.0", "version": "v1.0.0", "description": "An example agent for demonstration", "authors": []string{"Your Name "}, "created_at": "2025-01-01T00:00:00Z", "domains": []map[string]interface{}{ { "id": 101, "name": "technology/internet_of_things", }, }, "locators": []map[string]interface{}{ { "type": "docker_image", "url": "ghcr.io/example/my-agent:latest", }, }, "skills": []map[string]interface{}{ { "name": "natural_language_processing/natural_language_understanding", "id": 101, }, }, } // Convert Go struct to protobuf format using OASF SDK decoder recordStruct, err := decoder.StructToProto(recordData) if err != nil { log.Fatalf("Failed to convert struct to proto: %v", err) } // Validate using embedded schemas (default behavior) isValid, errors, err := v.ValidateRecord(recordStruct) if err != nil { log.Fatalf("Validation failed: %v", err) } fmt.Printf("Record is valid: %t\n", isValid) if len(errors) > 0 { fmt.Println("Validation errors:") for _, errMsg := range errors { fmt.Printf(" - %s\n", errMsg) } } else { fmt.Println("No validation errors found!") } // Optional: Validate against a specific schema URL isValidURL, errorsURL, err := v.ValidateRecord( recordStruct, validator.WithSchemaURL("https://schema.oasf.outshift.com"), ) if err != nil { log.Fatalf("URL validation failed: %v", err) } fmt.Printf("Record is valid (URL schema): %t\n", isValidURL) if len(errorsURL) > 0 { fmt.Println("URL validation errors:") for _, errMsg := range errorsURL { fmt.Printf(" - %s\n", errMsg) } } } ``` -------------------------------- ### Translate A2A Card Data to OASF Record using grpcurl Source: https://context7.com/agntcy/oasf-sdk/llms.txt This snippet demonstrates converting Agent-to-Agent (A2A) card data into OASF 0.8.0 records. It uses `jq` for input formatting and `grpcurl` to interact with the TranslationService.A2AToRecord RPC. The resulting OASF record encapsulates the A2A agent's details, capabilities, and metadata. ```bash # Input: A2A card data cat <"}, "created_at": "2025-01-01T00:00:00Z", "domains": []map[string]interface{}{ {"id": 101, "name": "technology/internet_of_things"}, }, "locators": []map[string]interface{}{ {"type": "docker_image", "url": "ghcr.io/example/agent:latest"}, }, "skills": []map[string]interface{}{ {"name": "nlp/nlu", "id": 101}, }, } // Convert to protobuf Struct recordStruct, err := decoder.StructToProto(recordData) if err != nil { log.Fatalf("Failed to convert: %v", err) } // Decode into typed structure response, err := decoder.DecodeRecord(recordStruct) if err != nil { log.Fatalf("Failed to decode: %v", err) } // Type switch on version switch r := response.Record.(type) { case *decodingv1.DecodeRecordResponse_V1Alpha2: fmt.Printf("Decoded v0.8.0 record: %s\n", r.V1Alpha2.Name) fmt.Printf("Authors: %v\n", r.V1Alpha2.Authors) fmt.Printf("Skills: %v\n", r.V1Alpha2.Skills) case *decodingv1.DecodeRecordResponse_V1Alpha1: fmt.Printf("Decoded v0.7.0 record: %s\n", r.V1Alpha1.Name) case *decodingv1.DecodeRecordResponse_V1Alpha0: fmt.Printf("Decoded v0.3.1 record: %s\n", r.V1Alpha0.Name) default: log.Fatal("Unknown record version") } } ``` -------------------------------- ### Translate OASF Record to GitHub Copilot MCP Config using grpcurl Source: https://context7.com/agntcy/oasf-sdk/llms.txt Converts OASF records with an integration/mcp module into GitHub Copilot MCP configuration format using grpcurl. It takes OASF data as input and outputs the corresponding MCP configuration. ```bash # Input: OASF record with integration/mcp module cat <"} authorsIface := make([]interface{}, len(authors)) for i, v := range authors { authorsIface[i] = v } // Sample OASF record to validate record := map[string]interface{}{ "name": "example.org/my-agent", "schema_version": "0.8.0", "version": "v1.0.0", "description": "An example agent for demonstration", "authors": authorsIface, "created_at": "2025-01-01T00:00:00Z", "domains": []map[string]interface{}{ { "id": 101, "name": "technology/internet_of_things", }, }, "locators": []map[string]interface{}{ { "type": "docker_image", "url": "ghcr.io/example/my-agent:latest", }, }, "skills": []map[string]interface{}{ { "name": "natural_language_processing/natural_language_understanding", "id": 101, }, }, } // Convert record to protobuf Struct recordProto, err := decoder.StructToProto(record) if err != nil { log.Fatalf("Failed to convert record to proto: %v", err) } // Create validation request req := &validationv1.ValidateRecordRequest{ Record: recordProto, // Optional: specify schema URL to validate against // SchemaUrl: "https://schema.oasf.outshift.com", } // Call validation service ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() resp, err := client.ValidateRecord(ctx, req) if err != nil { log.Fatalf("Validation failed: %v", err) } // Print results fmt.Printf("Valid: %t\n", resp.IsValid) if len(resp.Errors) > 0 { fmt.Printf("Errors:\n") for _, err := range resp.Errors { fmt.Printf(" - %s\n", err) } } } ``` -------------------------------- ### Validate OASF Record with grpcurl (Bash) Source: https://context7.com/agntcy/oasf-sdk/llms.txt This snippet demonstrates how to validate an OASF record using the `grpcurl` command-line tool against the OASF SDK's ValidationService. It shows validation using both embedded schemas and a remote schema URL. Ensure the OASF SDK service is running and accessible. ```bash # Start the OASF SDK service docker run -p 31234:31234 ghcr.io/agntcy/oasf-sdk:latest # Validate using embedded schemas (default) cat <"], "created_at": "2025-01-01T00:00:00Z", "domains": [{"id": 101, "name": "technology/internet_of_things"}], "locators": [{"type": "docker_image", "url": "ghcr.io/example/my-agent:latest"}], "skills": [{"name": "natural_language_processing/natural_language_understanding", "id": 101}] } EOF # Response # { # "isValid": true, # "errors": [] # } # Validate using remote schema URL cat record.json | jq '{record: ., schema_url: "https://schema.oasf.outshift.com"}' | grpcurl -plaintext -d @ localhost:31234 agntcy.oasfsdk.validation.v1.ValidationService/ValidateRecord ``` -------------------------------- ### Validate OASF Record with Node.js gRPC Client Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Demonstrates validating an OASF record using the Node.js gRPC client. It includes setting up the client, creating a validation request with a protobuf Struct, sending the request, and handling the response, including any validation errors. ```javascript const grpc = require('@grpc/grpc-js'); const { ValidationServiceClient } = require('@buf/agntcy_oasf-sdk.grpc_node/agntcy/oasfsdk/validation/v1/validation_service_grpc_pb'); const { ValidateRecordRequest } = require('@buf/agntcy_oasf-sdk.grpc_node/agntcy/oasfsdk/validation/v1/validation_service_pb'); const { Struct } = require('google-protobuf/google/protobuf/struct_pb'); async function validateRecord() { // Sample OASF record to validate const recordData = { name: "example.org/my-agent", schema_version: "0.8.0", version: "v1.0.0", description: "An example agent for demonstration", authors: ["Your Name "], created_at: "2025-01-01T00:00:00Z", previous_record_cid: "2883dcaa-ae90-11f0-9e37-5e1f5302e045", domains: [ { id: 101, name: "technology/internet_of_things" } ], locators: [ { type: "docker_image", url: "ghcr.io/example/my-agent:latest" } ], skills: [ { name: "natural_language_processing/natural_language_understanding", id: 101 } ] }; // Create gRPC client const client = new ValidationServiceClient( 'localhost:31234', grpc.credentials.createInsecure() ); // Convert JavaScript object to protobuf Struct using the proper method const recordStruct = Struct.fromJavaScript(recordData); // Create validation request const request = new ValidateRecordRequest(); request.setRecord(recordStruct); // Optional: request.setSchemaUrl("https://schema.oasf.outshift.com"); return new Promise((resolve, reject) => { client.validateRecord(request, (error, response) => { if (error) { console.error('gRPC error:', error); reject(error); return; } // Print results console.log(`Valid: ${response.getIsValid()}`); const errors = response.getErrorsList(); if (errors && errors.length > 0) { console.log('Errors:'); errors.forEach(err => { console.log(` - ${err}`); }); } else { console.log('No validation errors found!'); } resolve(response); }); }); } // Run the validation validateRecord() .then(() => { console.log('Validation completed successfully'); process.exit(0); }) .catch((error) => { console.error('Validation failed:', error); process.exit(1); }); ``` -------------------------------- ### POST /agntcy.oasfsdk.decoding.v1.DecodingService/DecodeRecord Source: https://context7.com/agntcy/oasf-sdk/llms.txt Decodes unstructured OASF records into strongly-typed protobuf structures based on schema version using the DecodingService RPC. ```APIDOC ## POST /agntcy.oasfsdk.decoding.v1.DecodingService/DecodeRecord ### Description Decodes unstructured OASF records into strongly-typed protobuf structures based on schema version. ### Method POST ### Endpoint /agntcy.oasfsdk.decoding.v1.DecodingService/DecodeRecord ### Parameters #### Request Body - **record** (object) - Required - The unstructured OASF record to decode. - **name** (string) - Required - The name of the agent. - **schema_version** (string) - Required - The schema version of the record. - **version** (string) - Required - The version of the agent. - **description** (string) - Optional - A description of the agent. - **authors** (array) - Optional - A list of authors for the agent. - **created_at** (string) - Optional - The creation timestamp of the agent. - **domains** (array) - Optional - A list of domains the agent operates in. - **id** (integer) - Required - The domain ID. - **name** (string) - Required - The domain name. - **locators** (array) - Optional - A list of locators for the agent. - **type** (string) - Required - The type of locator (e.g., "docker_image"). - **url** (string) - Required - The URL of the locator. - **skills** (array) - Optional - A list of skills the agent possesses. - **name** (string) - Required - The skill name. - **id** (integer) - Required - The skill ID. ### Request Example ```json { "record": { "name": "example.org/my-agent", "schema_version": "0.8.0", "version": "v1.0.0", "description": "Example agent", "authors": ["Developer "], "created_at": "2025-01-01T00:00:00Z", "domains": [{"id": 101, "name": "technology/internet_of_things"}], "locators": [{"type": "docker_image", "url": "ghcr.io/example/agent:latest"}], "skills": [{"name": "nlp/nlu", "id": 101}] } } ``` ### Response #### Success Response (200) - **v1alpha2** (object) - The decoded record in v1alpha2 format. - **name** (string) - The name of the agent. - **schemaVersion** (string) - The schema version. - **version** (string) - The agent version. - **description** (string) - The agent description. - **authors** (array) - The list of authors. - **createdAt** (string) - The creation timestamp. - **domains** (array) - The list of domains. - **id** (integer) - The domain ID. - **name** (string) - The domain name. - **locators** (array) - The list of locators. - **type** (string) - The locator type. - **url** (string) - The locator URL. - **skills** (array) - The list of skills. - **name** (string) - The skill name. - **id** (integer) - The skill ID. #### Response Example ```json { "v1alpha2": { "name": "example.org/my-agent", "schemaVersion": "0.8.0", "version": "v1.0.0", "description": "Example agent", "authors": ["Developer "], "createdAt": "2025-01-01T00:00:00Z", "domains": [{"id": 101, "name": "technology/internet_of_things"}], "locators": [{"type": "LOCATOR_TYPE_DOCKER_IMAGE", "url": "ghcr.io/example/agent:latest"}], "skills": [{"name": "nlp/nlu", "id": 101}] } } ``` ``` -------------------------------- ### Convert MCP Registry to OASF Record Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Converts an MCP Registry server.json file into an OASF record format using the MCPToRecord RPC method. This is useful for translating deployment metadata from MCP servers into a structured OASF record, populating the MCP module. Requires 'jq' and 'grpcurl'. ```bash cat e2e/fixtures/translation_mcp.json | jq '{data: .}' | grpcurl -plaintext -d @ localhost:31234 agntcy.oasfsdk.translation.v1.TranslationService/MCPToRecord ``` -------------------------------- ### Update Release Version in versions.yaml Source: https://github.com/agntcy/oasf-sdk/blob/main/RELEASE.md This snippet demonstrates how to update the SDK version in the `versions.yaml` file. It involves checking out a new branch, modifying the version, committing the changes, and verifying the version update. Ensure `go.work` and `go.work.sum` files are temporarily removed if present. ```shell git checkout -b release/v1.0.0 # Modify versions.yaml # Example diff: # oasf-sdk: # - version: v0.0.0 # + version: v1.0.0 git add versions.yaml git commit -s -m "release: update module set to version v1.0.0" task release:verify ``` -------------------------------- ### TranslationService.RecordToGHCopilot RPC Source: https://context7.com/agntcy/oasf-sdk/llms.txt This endpoint converts OASF records containing integration/mcp module data into the GitHub Copilot MCP configuration format. It utilizes grpcurl for command-line interaction. ```APIDOC ## TranslationService.RecordToGHCopilot ### Description Converts OASF records with MCP module data into GitHub Copilot MCP configuration format. This is useful for setting up GitHub Copilot integrations. ### Method gRPC ### Endpoint agntcy.oasfsdk.translation.v1.TranslationService/RecordToGHCopilot ### Parameters #### Request Body - **record** (Object) - Required - The OASF record containing the 'integration/mcp' module. - **name** (string) - The name of the record. - **schema_version** (string) - The schema version of the record. - **version** (string) - The version of the record. - **description** (string) - A description of the record. - **authors** (list of strings) - Authors of the record. - **created_at** (string) - Timestamp when the record was created. - **skills** (list of objects) - Skills associated with the record. - **domains** (list of objects) - Domains associated with the record. - **modules** (list of objects) - Modules associated with the record. - **name** (string) - Must be 'integration/mcp'. - **data** (object) - Module-specific data. - **servers** (object) - Server configuration for MCP. - **github** (object) - **command** (string) - The command to run the server. - **args** (list of strings) - Arguments for the command. - **env** (object) - Environment variables for the server. ### Request Example ```bash cat <"], "created_at": "2025-01-01T00:00:00Z", "domains": [ { "id": 101, "name": "technology/internet_of_things" } ], "locators": [ { "type": "docker_image", "url": "ghcr.io/example/my-agent:latest" } ], "skills": [ { "name": "natural_language_processing/natural_language_understanding", "id": 101 } ] } # Create gRPC channel with grpc.insecure_channel('localhost:31234') as channel: stub = ValidationServiceStub(channel) # Convert dict to protobuf Struct record_struct = Struct() record_struct.update(record_data) # Create validation request request = ValidateRecordRequest( record=record_struct # schema_url="https://schema.oasf.outshift.com" # Optional ) try: # Call validation service response = stub.ValidateRecord(request) # Print results print(f"Valid: {response.is_valid}") if response.errors: print("Errors:") for error in response.errors: print(f" - {error}") else: print("No validation errors found!") except grpc.RpcError as e: print(f"gRPC error: {e.code()}: {e.details()}") if __name__ == "__main__": validate_record() ``` -------------------------------- ### Translation Service - RecordToGHCopilot Source: https://github.com/agntcy/oasf-sdk/blob/main/USAGE.md Converts an OASF data model to a GitHub Copilot config using the RecordToGHCopilot RPC method. ```APIDOC ## POST /agntcy.oasfsdk.translation.v1.TranslationService/RecordToGHCopilot ### Description Converts an OASF data model to a GitHub Copilot configuration. ### Method POST ### Endpoint `localhost:31234/agntcy.oasfsdk.translation.v1.TranslationService/RecordToGHCopilot` ### Parameters #### Query Parameters - None #### Request Body - **record** (object) - The OASF data model to convert. ### Request Example ```json { "record": { ... OASF data model ... } } ``` ### Response #### Success Response (200) - **data** (object) - Contains the generated GitHub Copilot configuration. - **mcpConfig** (object) - The GitHub Copilot configuration. - **inputs** (array) - List of required inputs for the Copilot configuration. - **servers** (object) - Configuration for Docker servers. #### Response Example ```json { "data": { "mcpConfig": { "inputs": [ { "description": "Secret value for GITHUB_PERSONAL_ACCESS_TOKEN", "id": "GITHUB_PERSONAL_ACCESS_TOKEN", "password": true, "type": "promptString" } ], "servers": { "github": { "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "command": "docker", "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:GITHUB_PERSONAL_ACCESS_TOKEN}" } } } } } } ``` ```